@looker/run-it 0.9.54 → 0.9.57

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. package/CHANGELOG.md +333 -386
  2. package/lib/RunIt.d.ts +4 -4
  3. package/lib/RunIt.js +2 -2
  4. package/lib/RunIt.js.map +1 -1
  5. package/lib/RunItProvider.js +3 -4
  6. package/lib/RunItProvider.js.map +1 -1
  7. package/lib/components/Collapser/CollapserCard.d.ts +2 -1
  8. package/lib/components/Collapser/CollapserCard.js.map +1 -1
  9. package/lib/components/Collapser/index.js.map +1 -1
  10. package/lib/components/ConfigForm/ConfigForm.js +6 -6
  11. package/lib/components/ConfigForm/ConfigForm.js.map +1 -1
  12. package/lib/components/ConfigForm/index.js.map +1 -1
  13. package/lib/components/ConfigForm/utils.js +9 -14
  14. package/lib/components/ConfigForm/utils.js.map +1 -1
  15. package/lib/components/CopyLinkWrapper/CopyLinkWrapper.d.ts +2 -1
  16. package/lib/components/CopyLinkWrapper/CopyLinkWrapper.js +2 -2
  17. package/lib/components/CopyLinkWrapper/CopyLinkWrapper.js.map +1 -1
  18. package/lib/components/CopyLinkWrapper/index.js.map +1 -1
  19. package/lib/components/DataGrid/DataGrid.d.ts +2 -1
  20. package/lib/components/DataGrid/DataGrid.js +2 -2
  21. package/lib/components/DataGrid/DataGrid.js.map +1 -1
  22. package/lib/components/DataGrid/gridUtils.js.map +1 -1
  23. package/lib/components/DataGrid/index.js.map +1 -1
  24. package/lib/components/DocSdkCalls/DocMultiCall.js.map +1 -1
  25. package/lib/components/DocSdkCalls/DocSdkCalls.js +2 -2
  26. package/lib/components/DocSdkCalls/DocSdkCalls.js.map +1 -1
  27. package/lib/components/DocSdkCalls/callUtils.js.map +1 -1
  28. package/lib/components/DocSdkCalls/index.js.map +1 -1
  29. package/lib/components/Loading/Loading.js.map +1 -1
  30. package/lib/components/Loading/index.js.map +1 -1
  31. package/lib/components/LoginForm/LoginForm.js +2 -4
  32. package/lib/components/LoginForm/LoginForm.js.map +1 -1
  33. package/lib/components/LoginForm/index.js.map +1 -1
  34. package/lib/components/MethodBadge/MethodBadge.d.ts +4 -4
  35. package/lib/components/MethodBadge/MethodBadge.js +3 -4
  36. package/lib/components/MethodBadge/MethodBadge.js.map +1 -1
  37. package/lib/components/MethodBadge/index.js.map +1 -1
  38. package/lib/components/PerfTracker/PerfChart.js.map +1 -1
  39. package/lib/components/PerfTracker/PerfTable.js +2 -2
  40. package/lib/components/PerfTracker/PerfTable.js.map +1 -1
  41. package/lib/components/PerfTracker/PerfTracker.js +2 -2
  42. package/lib/components/PerfTracker/PerfTracker.js.map +1 -1
  43. package/lib/components/PerfTracker/index.js.map +1 -1
  44. package/lib/components/PerfTracker/perfTableUtils.d.ts +2 -2
  45. package/lib/components/PerfTracker/perfTableUtils.js +4 -7
  46. package/lib/components/PerfTracker/perfTableUtils.js.map +1 -1
  47. package/lib/components/PerfTracker/perfUtils.js +2 -2
  48. package/lib/components/PerfTracker/perfUtils.js.map +1 -1
  49. package/lib/components/RequestForm/FormItem.js.map +1 -1
  50. package/lib/components/RequestForm/RequestForm.d.ts +1 -1
  51. package/lib/components/RequestForm/RequestForm.js +4 -4
  52. package/lib/components/RequestForm/RequestForm.js.map +1 -1
  53. package/lib/components/RequestForm/formUtils.d.ts +4 -3
  54. package/lib/components/RequestForm/formUtils.js +7 -8
  55. package/lib/components/RequestForm/formUtils.js.map +1 -1
  56. package/lib/components/RequestForm/index.js.map +1 -1
  57. package/lib/components/ResponseExplorer/ResponseExplorer.d.ts +1 -1
  58. package/lib/components/ResponseExplorer/ResponseExplorer.js +3 -3
  59. package/lib/components/ResponseExplorer/ResponseExplorer.js.map +1 -1
  60. package/lib/components/ResponseExplorer/index.js.map +1 -1
  61. package/lib/components/ShowResponse/ShowResponse.js.map +1 -1
  62. package/lib/components/ShowResponse/index.js.map +1 -1
  63. package/lib/components/ShowResponse/responseUtils.js +1 -2
  64. package/lib/components/ShowResponse/responseUtils.js.map +1 -1
  65. package/lib/components/common/common.js +2 -4
  66. package/lib/components/common/common.js.map +1 -1
  67. package/lib/components/common/index.js.map +1 -1
  68. package/lib/components/index.js.map +1 -1
  69. package/lib/esm/RunIt.js +4 -4
  70. package/lib/esm/RunIt.js.map +1 -1
  71. package/lib/esm/RunItProvider.js.map +1 -1
  72. package/lib/esm/components/Collapser/CollapserCard.js +1 -1
  73. package/lib/esm/components/Collapser/CollapserCard.js.map +1 -1
  74. package/lib/esm/components/Collapser/index.js.map +1 -1
  75. package/lib/esm/components/ConfigForm/ConfigForm.js +8 -8
  76. package/lib/esm/components/ConfigForm/ConfigForm.js.map +1 -1
  77. package/lib/esm/components/ConfigForm/index.js.map +1 -1
  78. package/lib/esm/components/ConfigForm/utils.js +4 -4
  79. package/lib/esm/components/ConfigForm/utils.js.map +1 -1
  80. package/lib/esm/components/CopyLinkWrapper/CopyLinkWrapper.js.map +1 -1
  81. package/lib/esm/components/CopyLinkWrapper/index.js.map +1 -1
  82. package/lib/esm/components/DataGrid/DataGrid.js.map +1 -1
  83. package/lib/esm/components/DataGrid/gridUtils.js.map +1 -1
  84. package/lib/esm/components/DataGrid/index.js.map +1 -1
  85. package/lib/esm/components/DocSdkCalls/DocMultiCall.js +1 -1
  86. package/lib/esm/components/DocSdkCalls/DocMultiCall.js.map +1 -1
  87. package/lib/esm/components/DocSdkCalls/DocSdkCalls.js.map +1 -1
  88. package/lib/esm/components/DocSdkCalls/callUtils.js.map +1 -1
  89. package/lib/esm/components/DocSdkCalls/index.js.map +1 -1
  90. package/lib/esm/components/Loading/Loading.js +1 -1
  91. package/lib/esm/components/Loading/Loading.js.map +1 -1
  92. package/lib/esm/components/Loading/index.js.map +1 -1
  93. package/lib/esm/components/LoginForm/LoginForm.js.map +1 -1
  94. package/lib/esm/components/LoginForm/index.js.map +1 -1
  95. package/lib/esm/components/MethodBadge/MethodBadge.js.map +1 -1
  96. package/lib/esm/components/MethodBadge/index.js.map +1 -1
  97. package/lib/esm/components/PerfTracker/PerfChart.js.map +1 -1
  98. package/lib/esm/components/PerfTracker/PerfTable.js.map +1 -1
  99. package/lib/esm/components/PerfTracker/PerfTracker.js +1 -1
  100. package/lib/esm/components/PerfTracker/PerfTracker.js.map +1 -1
  101. package/lib/esm/components/PerfTracker/index.js.map +1 -1
  102. package/lib/esm/components/PerfTracker/perfTableUtils.js +2 -2
  103. package/lib/esm/components/PerfTracker/perfTableUtils.js.map +1 -1
  104. package/lib/esm/components/PerfTracker/perfUtils.js +2 -2
  105. package/lib/esm/components/PerfTracker/perfUtils.js.map +1 -1
  106. package/lib/esm/components/RequestForm/FormItem.js +1 -1
  107. package/lib/esm/components/RequestForm/FormItem.js.map +1 -1
  108. package/lib/esm/components/RequestForm/RequestForm.js +6 -6
  109. package/lib/esm/components/RequestForm/RequestForm.js.map +1 -1
  110. package/lib/esm/components/RequestForm/formUtils.js +5 -5
  111. package/lib/esm/components/RequestForm/formUtils.js.map +1 -1
  112. package/lib/esm/components/RequestForm/index.js.map +1 -1
  113. package/lib/esm/components/ResponseExplorer/ResponseExplorer.js +2 -2
  114. package/lib/esm/components/ResponseExplorer/ResponseExplorer.js.map +1 -1
  115. package/lib/esm/components/ResponseExplorer/index.js.map +1 -1
  116. package/lib/esm/components/ShowResponse/ShowResponse.js +1 -1
  117. package/lib/esm/components/ShowResponse/ShowResponse.js.map +1 -1
  118. package/lib/esm/components/ShowResponse/index.js.map +1 -1
  119. package/lib/esm/components/ShowResponse/responseUtils.js +2 -2
  120. package/lib/esm/components/ShowResponse/responseUtils.js.map +1 -1
  121. package/lib/esm/components/common/common.js.map +1 -1
  122. package/lib/esm/components/common/index.js.map +1 -1
  123. package/lib/esm/components/index.js.map +1 -1
  124. package/lib/esm/index.js.map +1 -1
  125. package/lib/esm/test-data/index.js.map +1 -1
  126. package/lib/esm/test-data/responses.js.map +1 -1
  127. package/lib/esm/test-data/specs.js.map +1 -1
  128. package/lib/esm/utils/RunItSDK.js +4 -4
  129. package/lib/esm/utils/RunItSDK.js.map +1 -1
  130. package/lib/esm/utils/index.js.map +1 -1
  131. package/lib/esm/utils/requestUtils.js.map +1 -1
  132. package/lib/index.js.map +1 -1
  133. package/lib/test-data/index.js.map +1 -1
  134. package/lib/test-data/responses.js +9 -18
  135. package/lib/test-data/responses.js.map +1 -1
  136. package/lib/test-data/specs.js +1 -2
  137. package/lib/test-data/specs.js.map +1 -1
  138. package/lib/utils/RunItSDK.js +5 -6
  139. package/lib/utils/RunItSDK.js.map +1 -1
  140. package/lib/utils/index.js.map +1 -1
  141. package/lib/utils/requestUtils.d.ts +2 -2
  142. package/lib/utils/requestUtils.js +4 -8
  143. package/lib/utils/requestUtils.js.map +1 -1
  144. package/package.json +32 -32
@@ -9,8 +9,8 @@ var _components = require("@looker/components");
9
9
  var _Link = require("@styled-icons/material-outlined/Link");
10
10
  var _extensionUtils = require("@looker/extension-utils");
11
11
  var _reactRouterDom = require("react-router-dom");
12
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
14
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
15
15
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
16
16
  var COPY_TO_CLIPBOARD = 'Copy to clipboard';
@@ -1 +1 @@
1
- {"version":3,"file":"CopyLinkWrapper.js","names":["_react","_interopRequireWildcard","require","_components","_Link","_extensionUtils","_reactRouterDom","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","asyncGeneratorStep","gen","resolve","reject","_next","_throw","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","COPY_TO_CLIPBOARD","CopyLinkWrapper","_ref","children","visible","tooltipContent","setTooltipContent","useState","showCopyLinkButton","setShowCopyLinkButton","location","useLocation","handleCopyLink","_ref2","getEnvAdaptor","copyToClipboard","handleMouseLeave","createElement","Space","width","onMouseEnter","onMouseLeave","IconButton","onClick","icon","Link","size","label","tooltipPlacement","exports"],"sources":["../../../src/components/CopyLinkWrapper/CopyLinkWrapper.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { ReactNode, ReactNodeArray } from 'react'\nimport React, { useState } from 'react'\nimport { IconButton, Space } from '@looker/components'\nimport { Link } from '@styled-icons/material-outlined/Link'\nimport { getEnvAdaptor } from '@looker/extension-utils'\nimport { useLocation } from 'react-router-dom'\n\ninterface CopyLinkWrapperProps {\n children: ReactNode | ReactNodeArray\n visible?: boolean\n}\n\nconst COPY_TO_CLIPBOARD = 'Copy to clipboard'\n\n/**\n * Displays a copy link button on hover\n *\n * @param children component(s) which will render left of the button\n * @param visible boolean determining button visibility\n */\nexport const CopyLinkWrapper = ({\n children,\n visible = true,\n}: CopyLinkWrapperProps) => {\n const [tooltipContent, setTooltipContent] = useState(COPY_TO_CLIPBOARD)\n const [showCopyLinkButton, setShowCopyLinkButton] = useState(false)\n const location = useLocation()\n const handleCopyLink = async () => {\n await getEnvAdaptor().copyToClipboard(location)\n setTooltipContent('Copied to clipboard')\n }\n const handleMouseLeave = () => {\n setTooltipContent(COPY_TO_CLIPBOARD)\n }\n return (\n <Space\n width={'100%'}\n onMouseEnter={() => setShowCopyLinkButton(true)}\n onMouseLeave={() => setShowCopyLinkButton(false)}\n >\n {children}\n {showCopyLinkButton && visible && (\n <IconButton\n onClick={handleCopyLink}\n icon={<Link />}\n size=\"small\"\n label={tooltipContent}\n tooltipPlacement=\"bottom\"\n onMouseLeave={handleMouseLeave}\n />\n )}\n </Space>\n )\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AAA8C,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAW,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,M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AE;IACfC,IAAI,EAAC,OAAO;IACZC,KAAK,EAAEtB,cAAe;IACtBuB,gBAAgB,EAAC,QAAQ;IACzBP,YAAY,EAAEL;EAAiB,CAChC,CAEE,CAAC;AAEZ,CAAC;AAAAa,OAAA,CAAA5B,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"file":"CopyLinkWrapper.js","names":["_react","_interopRequireWildcard","require","_components","_Link","_extensionUtils","_reactRouterDom","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","COPY_TO_CLIPBOARD","CopyLinkWrapper","_ref","children","visible","tooltipContent","setTooltipContent","useState","showCopyLinkButton","setShowCopyLinkButton","location","useLocation","handleCopyLink","_ref2","getEnvAdaptor","copyToClipboard","handleMouseLeave","createElement","Space","width","onMouseEnter","onMouseLeave","IconButton","onClick","icon","Link","size","label","tooltipPlacement","exports"],"sources":["../../../src/components/CopyLinkWrapper/CopyLinkWrapper.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { ReactNode, ReactNodeArray } from 'react';\nimport React, { useState } from 'react';\nimport { IconButton, Space } from '@looker/components';\nimport { Link } from '@styled-icons/material-outlined/Link';\nimport { getEnvAdaptor } from '@looker/extension-utils';\nimport { useLocation } from 'react-router-dom';\n\ninterface CopyLinkWrapperProps {\n children: ReactNode | ReactNodeArray;\n visible?: boolean;\n}\n\nconst COPY_TO_CLIPBOARD = 'Copy to clipboard';\n\n/**\n * Displays a copy link button on hover\n *\n * @param children component(s) which will render left of the button\n * @param visible boolean determining button visibility\n */\nexport const CopyLinkWrapper = ({\n children,\n visible = true,\n}: CopyLinkWrapperProps) => {\n const [tooltipContent, setTooltipContent] = useState(COPY_TO_CLIPBOARD);\n const [showCopyLinkButton, setShowCopyLinkButton] = useState(false);\n const location = useLocation();\n const handleCopyLink = async () => {\n await getEnvAdaptor().copyToClipboard(location);\n setTooltipContent('Copied to clipboard');\n };\n const handleMouseLeave = () => {\n setTooltipContent(COPY_TO_CLIPBOARD);\n };\n return (\n <Space\n width={'100%'}\n onMouseEnter={() => setShowCopyLinkButton(true)}\n onMouseLeave={() => setShowCopyLinkButton(false)}\n >\n {children}\n {showCopyLinkButton && visible && (\n <IconButton\n onClick={handleCopyLink}\n icon={<Link />}\n size=\"small\"\n label={tooltipContent}\n tooltipPlacement=\"bottom\"\n onMouseLeave={handleMouseLeave}\n />\n )}\n </Space>\n );\n};\n"],"mappings":";;;;;;AA0BA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;A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C,CAAC;IAAA,gBAHKM,cAAcA,CAAA;MAAA,OAAAC,KAAA,CAAAhB,KAAA,OAAAD,SAAA;IAAA;EAAA,GAGnB;EACD,IAAMoB,gBAAgB,GAAGA,CAAA,KAAM;IAC7BV,iBAAiB,CAACN,iBAAiB,CAAC;EACtC,CAAC;EACD,OACElD,MAAA,CAAAa,OAAA,CAAAsD,aAAA,CAAChE,WAAA,CAAAiE,KAAK;IACJC,KAAK,EAAE,MAAO;IACdC,YAAY,EAAEA,CAAA,KAAMX,qBAAqB,CAAC,IAAI,CAAE;IAChDY,YAAY,EAAEA,CAAA,KAAMZ,qBAAqB,CAAC,KAAK;EAAE,GAEhDN,QAAQ,EACRK,kBAAkB,IAAIJ,OAAO,IAC5BtD,MAAA,CAAAa,OAAA,CAAAsD,aAAA,CAAChE,WAAA,CAAAqE,UAAU;IACTC,OAAO,EAAEX,cAAe;IACxBY,IAAI,EAAE1E,MAAA,CAAAa,OAAA,CAAAsD,aAAA,CAAC/D,KAAA,CAAAuE,IAAI,MAAE,CAAE;IACfC,IAAI,EAAC,OAAO;IACZC,KAAK,EAAEtB,cAAe;IACtBuB,gBAAgB,EAAC,QAAQ;IACzBP,YAAY,EAAEL;EAAiB,CAChC,CAEE,CAAC;AAEZ,CAAC;AAACa,OAAA,CAAA5B,eAAA,GAAAA,eAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_CopyLinkWrapper","require"],"sources":["../../../src/components/CopyLinkWrapper/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { CopyLinkWrapper } from './CopyLinkWrapper'\n"],"mappings":";;;;;;;;;;;AAyBA,IAAAA,gBAAA,GAAAC,OAAA"}
1
+ {"version":3,"file":"index.js","names":["_CopyLinkWrapper","require"],"sources":["../../../src/components/CopyLinkWrapper/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { CopyLinkWrapper } from './CopyLinkWrapper';\n"],"mappings":";;;;;;;;;;;AAyBA,IAAAA,gBAAA,GAAAC,OAAA"}
@@ -1,8 +1,9 @@
1
1
  import type { ReactElement } from 'react';
2
+ import React from 'react';
2
3
  interface DataGridProps {
3
4
  data: any[];
4
5
  raw: ReactElement<any> | ReactElement[];
5
6
  pageSize?: number;
6
7
  }
7
- export declare const DataGrid: ({ data, raw, pageSize }: DataGridProps) => JSX.Element;
8
+ export declare const DataGrid: ({ data, raw, pageSize }: DataGridProps) => React.JSX.Element;
8
9
  export {};
@@ -7,8 +7,8 @@ exports.DataGrid = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _components = require("@looker/components");
9
9
  var _gridUtils = require("./gridUtils");
10
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
12
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
13
  var DataGrid = _ref => {
14
14
  var {
@@ -1 +1 @@
1
- {"version":3,"file":"DataGrid.js","names":["_react","_interopRequireWildcard","require","_components","_gridUtils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","DataGrid","_ref","data","raw","pageSize","tabs","useTabs","headers","gridHeaders","page","setPage","useState","pageCount","Math","round","pageItemData","slice","pageItems","gridRows","useEffect","onSelectTab","createElement","Fragment","TabList","Tab","TabPanels","pt","TabPanel","DataTable","columns","caption","Pagination","current","pages","onChange","nextPage","exports"],"sources":["../../../src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ReactElement } from 'react'\nimport React, { useEffect, useState } from 'react'\nimport {\n DataTable,\n Pagination,\n Tab,\n TabList,\n TabPanel,\n TabPanels,\n useTabs,\n} from '@looker/components'\nimport { gridHeaders, gridRows } from './gridUtils'\n\ninterface DataGridProps {\n /** grid data. First row is header names. All other rows are data */\n data: any[]\n /** Component to render \"raw\" output */\n raw: ReactElement<any> | ReactElement[]\n /** Number of rows per page. Defaults to 15 */\n pageSize?: number\n}\n\nexport const DataGrid = ({ data, raw, pageSize = 15 }: DataGridProps) => {\n const tabs = useTabs()\n const headers = gridHeaders(data)\n const [page, setPage] = useState(1)\n const pageCount = Math.round((data.length - 1) / pageSize)\n\n // The +1 is to skip the header row\n const pageItemData = data.slice(\n (page - 1) * pageSize + 1,\n page * pageSize + 1\n )\n const pageItems = gridRows(pageItemData)\n useEffect(() => {\n if (data.length === 2) {\n // Show raw tab by default for 1 data row\n tabs.onSelectTab(1)\n }\n }, [data])\n return (\n <>\n <TabList {...tabs}>\n <Tab key=\"grid\">Grid</Tab>\n <Tab key=\"raw\">Raw</Tab>\n </TabList>\n <TabPanels {...tabs} pt=\"0\">\n <TabPanel key=\"grid\">\n <DataTable key=\"datagrid\" columns={headers} caption=\"Response data\">\n {pageItems}\n </DataTable>\n <Pagination\n current={page}\n pages={pageCount}\n onChange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,CACX,CAAC;AAEP,CAAC;AAAAiC,OAAA,CAAApC,QAAA,GAAAA,QAAA"}
1
+ {"version":3,"file":"DataGrid.js","names":["_react","_interopRequireWildcard","require","_components","_gridUtils","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","DataGrid","_ref","data","raw","pageSize","tabs","useTabs","headers","gridHeaders","page","setPage","useState","pageCount","Math","round","pageItemData","slice","pageItems","gridRows","useEffect","onSelectTab","createElement","Fragment","TabList","Tab","TabPanels","pt","TabPanel","DataTable","columns","caption","Pagination","current","pages","onChange","nextPage","exports"],"sources":["../../../src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ReactElement } from 'react';\nimport React, { useEffect, useState } from 'react';\nimport {\n DataTable,\n Pagination,\n Tab,\n TabList,\n TabPanel,\n TabPanels,\n useTabs,\n} from '@looker/components';\nimport { gridHeaders, gridRows } from './gridUtils';\n\ninterface DataGridProps {\n /** grid data. First row is header names. All other rows are data */\n data: any[];\n /** Component to render \"raw\" output */\n raw: ReactElement<any> | ReactElement[];\n /** Number of rows per page. Defaults to 15 */\n pageSize?: number;\n}\n\nexport const DataGrid = ({ data, raw, pageSize = 15 }: DataGridProps) => {\n const tabs = useTabs();\n const headers = gridHeaders(data);\n const [page, setPage] = useState(1);\n const pageCount = Math.round((data.length - 1) / pageSize);\n\n // The +1 is to skip the header row\n const pageItemData = data.slice(\n (page - 1) * pageSize + 1,\n page * pageSize + 1\n );\n const pageItems = gridRows(pageItemData);\n useEffect(() => {\n if (data.length === 2) {\n // Show raw tab by default for 1 data row\n tabs.onSelectTab(1);\n }\n }, [data]);\n return (\n <>\n <TabList {...tabs}>\n <Tab key=\"grid\">Grid</Tab>\n <Tab key=\"raw\">Raw</Tab>\n </TabList>\n <TabPanels {...tabs} pt=\"0\">\n <TabPanel key=\"grid\">\n <DataTable key=\"datagrid\" columns={headers} caption=\"Response data\">\n {pageItems}\n </DataTable>\n <Pagination\n current={page}\n pages={pageCount}\n onChange={(nextPage) => {\n setPage(nextPage);\n }}\n />\n </TabPanel>\n <TabPanel key=\"raw\">{raw}</TabPanel>\n </TabPanels>\n </>\n );\n};\n"],"mappings":";;;;;;AA2BA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AASA,IAAAE,UAAA,GAAAF,OAAA;AAAoD,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA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G,EAAC;EAAK,GAAC,KAAQ,CAChB,CAAC,EACVjC,MAAA,CAAAW,OAAA,CAAA6C,aAAA,CAACrD,WAAA,CAAAyD,SAAS,EAAAlC,QAAA,KAAKc,IAAI;IAAEqB,EAAE,EAAC;EAAG,IACzB7D,MAAA,CAAAW,OAAA,CAAA6C,aAAA,CAACrD,WAAA,CAAA2D,QAAQ;IAAC7B,GAAG,EAAC;EAAM,GAClBjC,MAAA,CAAAW,OAAA,CAAA6C,aAAA,CAACrD,WAAA,CAAA4D,SAAS;IAAC9B,GAAG,EAAC,UAAU;IAAC+B,OAAO,EAAEtB,OAAQ;IAACuB,OAAO,EAAC;EAAe,GAChEb,SACQ,CAAC,EACZpD,MAAA,CAAAW,OAAA,CAAA6C,aAAA,CAACrD,WAAA,CAAA+D,UAAU;IACTC,OAAO,EAAEvB,IAAK;IACdwB,KAAK,EAAErB,SAAU;IACjBsB,QAAQ,EAAGC,QAAQ,IAAK;MACtBzB,OAAO,CAACyB,QAAQ,CAAC;IACnB;EAAE,CACH,CACO,CAAC,EACXtE,MAAA,CAAAW,OAAA,CAAA6C,aAAA,CAACrD,WAAA,CAAA2D,QAAQ;IAAC7B,GAAG,EAAC;EAAK,GAAEK,GAAc,CAC1B,CACX,CAAC;AAEP,CAAC;AAACiC,OAAA,CAAApC,QAAA,GAAAA,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"gridUtils.js","names":["_papaparse","_interopRequireDefault","require","_components","_react","obj","__esModule","default","parseCsv","content","Papa","parse","trim","exports","json2Csv","csv","unparse","gridHeaders","data","length","headers","values","undefined","result","forEach","h","index","type","col","id","title","push","gridRowId","concat","gridCellId","rowId","gridRows","row","cells","item","key","cell","createElement","DataTableCell","DataTableItem"],"sources":["../../../src/components/DataGrid/gridUtils.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport Papa from 'papaparse'\nimport type { DataTableColumn, DataTableColumns } from '@looker/components'\nimport { DataTableCell, DataTableItem } from '@looker/components'\nimport React from 'react'\n\nexport const parseCsv = (content: string) => {\n return Papa.parse(content.trim())\n}\n\nexport const json2Csv = (content: any) => {\n const csv = Papa.unparse(content)\n return parseCsv(csv)\n}\n\nexport const gridHeaders = (data: any[]) => {\n if (!data || data.length === 0) return []\n const headers = data[0]\n const values = data.length > 1 ? data[1] : undefined\n const result: DataTableColumn[] = []\n headers.forEach((h: string, index: number) => {\n let type = 'string'\n if (values && index < values.length) {\n if (typeof values[index] === 'number') {\n type = 'number'\n }\n }\n\n const col: DataTableColumn = {\n id: h,\n title: h,\n type: type === 'string' ? 'string' : 'number',\n }\n result.push(col)\n })\n return result as DataTableColumns\n}\n\nexport const gridRowId = (index: number) => `row.${index}`\nexport const gridCellId = (rowId: string, index: number) => `${rowId}.${index}`\n\n/**\n * Generates ActionList rows from an array of data\n * @param data A array of data rows\n */\nexport const gridRows = (data: any[]) => {\n const result: JSX.Element[] = []\n data.forEach((row, index) => {\n const id = gridRowId(index)\n const cells: any = []\n row.forEach((item: any, index: number) => {\n const key = gridCellId(id, index)\n const cell = <DataTableCell key={key}>{item}</DataTableCell>\n cells.push(cell)\n })\n result.push(\n <DataTableItem id={id} key={id}>\n {cells}\n </DataTableItem>\n )\n })\n\n return result\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAyB,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAElB,IAAMG,QAAQ,GAAIC,OAAe,IAAK;EAC3C,OAAOC,kBAAI,CAACC,KAAK,CAACF,OAAO,CAACG,IAAI,CAAC,CAAC,CAAC;AACnC,CAAC;AAAAC,OAAA,CAAAL,QAAA,GAAAA,QAAA;AAEM,IAAMM,QAAQ,GAAIL,OAAY,IAAK;EACxC,IAAMM,GAAG,GAAGL,kBAAI,CAACM,OAAO,CAACP,OAAO,CAAC;EACjC,OAAOD,QAAQ,CAACO,GAAG,CAAC;AACtB,CAAC;AAAAF,OAAA,CAAAC,QAAA,GAAAA,QAAA;AAEM,IAAMG,WAAW,GAAIC,IAAW,IAAK;EAC1C,IAAI,CAACA,IAAI,IAAIA,IAAI,CAACC,MAAM,KAAK,CAAC,EAAE,OAAO,EAAE;EACzC,IAAMC,OAAO,GAAGF,IAAI,CAAC,CAAC,CAAC;EACvB,IAAMG,MAAM,GAAGH,IAAI,CAACC,MAAM,GAAG,CAAC,GAAGD,IAAI,CAAC,CAAC,CAAC,GAAGI,SAAS;EACpD,IAAMC,MAAyB,GAAG,EAAE;EACpCH,OAAO,CAACI,OAAO,CAAC,CAACC,CAAS,EAAEC,KAAa,KAAK;IAC5C,IAAIC,IAAI,GAAG,QAAQ;IACnB,IAAIN,MAAM,IAAIK,KAAK,GAAGL,MAAM,CA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A,CAAAG,OAAA,CAAAmC,aAAA,CAACvC,WAAA,CAAAyC,aAAa;MAACf,EAAE,EAAEA,EAAG;MAACW,GAAG,EAAEX;IAAG,GAC5BS,KACY,CACjB,CAAC;EACH,CAAC,CAAC;EAEF,OAAOf,MAAM;AACf,CAAC;AAAAV,OAAA,CAAAuB,QAAA,GAAAA,QAAA"}
1
+ {"version":3,"file":"gridUtils.js","names":["_papaparse","_interopRequireDefault","require","_components","_react","obj","__esModule","default","parseCsv","content","Papa","parse","trim","exports","json2Csv","csv","unparse","gridHeaders","data","length","headers","values","undefined","result","forEach","h","index","type","col","id","title","push","gridRowId","concat","gridCellId","rowId","gridRows","row","cells","item","key","cell","createElement","DataTableCell","DataTableItem"],"sources":["../../../src/components/DataGrid/gridUtils.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport Papa from 'papaparse';\nimport type { DataTableColumn, DataTableColumns } from '@looker/components';\nimport { DataTableCell, DataTableItem } from '@looker/components';\nimport React from 'react';\n\nexport const parseCsv = (content: string) => {\n return Papa.parse(content.trim());\n};\n\nexport const json2Csv = (content: any) => {\n const csv = Papa.unparse(content);\n return parseCsv(csv);\n};\n\nexport const gridHeaders = (data: any[]) => {\n if (!data || data.length === 0) return [];\n const headers = data[0];\n const values = data.length > 1 ? data[1] : undefined;\n const result: DataTableColumn[] = [];\n headers.forEach((h: string, index: number) => {\n let type = 'string';\n if (values && index < values.length) {\n if (typeof values[index] === 'number') {\n type = 'number';\n }\n }\n\n const col: DataTableColumn = {\n id: h,\n title: h,\n type: type === 'string' ? 'string' : 'number',\n };\n result.push(col);\n });\n return result as DataTableColumns;\n};\n\nexport const gridRowId = (index: number) => `row.${index}`;\nexport const gridCellId = (rowId: string, index: number) => `${rowId}.${index}`;\n\n/**\n * Generates ActionList rows from an array of data\n * @param data A array of data rows\n */\nexport const gridRows = (data: any[]) => {\n const result: JSX.Element[] = [];\n data.forEach((row, index) => {\n const id = gridRowId(index);\n const cells: any = [];\n row.forEach((item: any, index: number) => {\n const key = gridCellId(id, index);\n const cell = <DataTableCell key={key}>{item}</DataTableCell>;\n cells.push(cell);\n });\n result.push(\n <DataTableItem id={id} key={id}>\n {cells}\n </DataTableItem>\n );\n });\n\n return result;\n};\n"],"mappings":";;;;;;AA0BA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEnB,IAAMG,QAAQ,GAAIC,OAAe,IAAK;EAC3C,OAAOC,kBAAI,CAACC,KAAK,CAACF,OAAO,CAACG,IAAI,CAAC,CAAC,CAAC;AACnC,CAAC;AAACC,OAAA,CAAAL,QAAA,GAAAA,QAAA;AAEK,IAAMM,QAAQ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ACb,OAAA,CAAAqB,UAAA,GAAAA,UAAA;AAMzE,IAAME,QAAQ,GAAIlB,IAAW,IAAK;EACvC,IAAMK,MAAqB,GAAG,EAAE;EAChCL,IAAI,CAACM,OAAO,CAAC,CAACa,GAAG,EAAEX,KAAK,KAAK;IAC3B,IAAMG,EAAE,GAAGG,SAAS,CAACN,KAAK,CAAC;IAC3B,IAAMY,KAAU,GAAG,EAAE;IACrBD,GAAG,CAACb,OAAO,CAAC,CAACe,IAAS,EAAEb,KAAa,KAAK;MACxC,IAAMc,GAAG,GAAGN,UAAU,CAACL,EAAE,EAAEH,KAAK,CAAC;MACjC,IAAMe,IAAI,GAAGrC,MAAA,CAAAG,OAAA,CAAAmC,aAAA,CAACvC,WAAA,CAAAwC,aAAa;QAACH,GAAG,EAAEA;MAAI,GAAED,IAAoB,CAAC;MAC5DD,KAAK,CAACP,IAAI,CAACU,IAAI,CAAC;IAClB,CAAC,CAAC;IACFlB,MAAM,CAACQ,IAAI,CACT3B,MAAA,CAAAG,OAAA,CAAAmC,aAAA,CAACvC,WAAA,CAAAyC,aAAa;MAACf,EAAE,EAAEA,EAAG;MAACW,GAAG,EAAEX;IAAG,GAC5BS,KACY,CACjB,CAAC;EACH,CAAC,CAAC;EAEF,OAAOf,MAAM;AACf,CAAC;AAACV,OAAA,CAAAuB,QAAA,GAAAA,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_DataGrid","require","_gridUtils"],"sources":["../../../src/components/DataGrid/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { DataGrid } from './DataGrid'\nexport { parseCsv, json2Csv } from './gridUtils'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA"}
1
+ {"version":3,"file":"index.js","names":["_DataGrid","require","_gridUtils"],"sources":["../../../src/components/DataGrid/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { DataGrid } from './DataGrid';\nexport { parseCsv, json2Csv } from './gridUtils';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"DocMultiCall.js","names":["_react","_interopRequireDefault","require","_components","_codeEditor","obj","__esModule","default","DocMultiCall","_ref","calls","createElement","Tabs2","Object","entries","map","_ref2","language","callSyntax","Tab2","label","key","CodeCopy","code","exports"],"sources":["../../../src/components/DocSdkCalls/DocMultiCall.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { FC } from 'react'\nimport React from 'react'\nimport { Tabs2, Tab2 } from '@looker/components'\nimport { CodeCopy } from '@looker/code-editor'\n\ninterface DocMultiCallProps {\n /** An object with keys representing the language and values for call syntax */\n calls: Record<string, string>\n}\n\n/**\n * Generates the SDK call syntax for all supported languages\n */\nexport const DocMultiCall: FC<DocMultiCallProps> = ({ calls }) => (\n <Tabs2>\n {Object.entries(calls).map(([language, callSyntax]) => (\n <Tab2 label={language} key={language}>\n <CodeCopy code={callSyntax} language={language} />\n </Tab2>\n ))}\n </Tabs2>\n)\n"],"mappings":";;;;;;AA0BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAA8C,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAUvC,IAAMG,YAAmC,GAAGC,IAAA;EAAA,IAAC;IAAEC;EAAM,CAAC,GAAAD,IAAA;EAAA,OAC3DT,MAAA,CAAAO,OAAA,CAAAI,aAAA,CAACR,WAAA,CAAAS,KAAK,QACHC,MAAM,CAACC,OAAO,CAACJ,KAAK,CAAC,CAACK,GAAG,CAACC,KAAA;IAAA,IAAC,CAACC,QAAQ,EAAEC,UAAU,CAAC,GAAAF,KAAA;IAAA,OAChDhB,MAAA,CAAAO,OAAA,CAAAI,aAAA,CAACR,WAAA,CAAAgB,IAAI;MAACC,KAAK,EAAEH,QAAS;MAACI,GAAG,EAAEJ;IAAS,GACnCjB,MAAA,CAAAO,OAAA,CAAAI,aAAA,CAACP,WAAA,CAAAkB,QAAQ;MAACC,IAAI,EAAEL,UAAW;MAACD,QAAQ,EAAEA;IAAS,CAAE,CAC7C,CAAC;EAAA,CACR,CACI,CAAC;AAAA,CACT;AAAAO,OAAA,CAAAhB,YAAA,GAAAA,YAAA"}
1
+ {"version":3,"file":"DocMultiCall.js","names":["_react","_interopRequireDefault","require","_components","_codeEditor","obj","__esModule","default","DocMultiCall","_ref","calls","createElement","Tabs2","Object","entries","map","_ref2","language","callSyntax","Tab2","label","key","CodeCopy","code","exports"],"sources":["../../../src/components/DocSdkCalls/DocMultiCall.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { FC } from 'react';\nimport React from 'react';\nimport { Tab2, Tabs2 } from '@looker/components';\nimport { CodeCopy } from '@looker/code-editor';\n\ninterface DocMultiCallProps {\n /** An object with keys representing the language and values for call syntax */\n calls: Record<string, string>;\n}\n\n/**\n * Generates the SDK call syntax for all supported languages\n */\nexport const DocMultiCall: FC<DocMultiCallProps> = ({ calls }) => (\n <Tabs2>\n {Object.entries(calls).map(([language, callSyntax]) => (\n <Tab2 label={language} key={language}>\n <CodeCopy code={callSyntax} language={language} />\n </Tab2>\n ))}\n </Tabs2>\n);\n"],"mappings":";;;;;;AA0BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAA+C,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAUxC,IAAMG,YAAmC,GAAGC,IAAA;EAAA,IAAC;IAAEC;EAAM,CAAC,GAAAD,IAAA;EAAA,OAC3DT,MAAA,CAAAO,OAAA,CAAAI,aAAA,CAACR,WAAA,CAAAS,KAAK,QACHC,MAAM,CAACC,OAAO,CAACJ,KAAK,CAAC,CAACK,GAAG,CAACC,KAAA;IAAA,IAAC,CAACC,QAAQ,EAAEC,UAAU,CAAC,GAAAF,KAAA;IAAA,OAChDhB,MAAA,CAAAO,OAAA,CAAAI,aAAA,CAACR,WAAA,CAAAgB,IAAI;MAACC,KAAK,EAAEH,QAAS;MAACI,GAAG,EAAEJ;IAAS,GACnCjB,MAAA,CAAAO,OAAA,CAAAI,aAAA,CAACP,WAAA,CAAAkB,QAAQ;MAACC,IAAI,EAAEL,UAAW;MAACD,QAAQ,EAAEA;IAAS,CAAE,CAC7C,CAAC;EAAA,CACR,CACI,CAAC;AAAA,CACT;AAACO,OAAA,CAAAhB,YAAA,GAAAA,YAAA"}
@@ -11,8 +11,8 @@ var _codeEditor = require("@looker/code-editor");
11
11
  var _common = require("../common");
12
12
  var _DocMultiCall = require("./DocMultiCall");
13
13
  var _callUtils = require("./callUtils");
14
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
15
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
16
  var DocSdkCalls = _ref => {
17
17
  var {
18
18
  api,
@@ -1 +1 @@
1
- {"version":3,"file":"DocSdkCalls.js","names":["_react","_interopRequireWildcard","require","_sdkCodegen","_components","_codeEditor","_common","_DocMultiCall","_callUtils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DocSdkCalls","_ref","api","method","inputs","sdkLanguage","keepBody","heading","setHeading","useState","trimmed","trimInputs","useEffect","text","concat","calls","generators","getGenerators","entries","forEach","_ref2","language","gen","makeTheCall","getCodeGenerator","_unused","createElement","DarkSpan","Fragment","Heading","as","mb","DocMultiCall","CodeCopy","code","exports"],"sources":["../../../src/components/DocSdkCalls/DocSdkCalls.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { FC } from 'react'\nimport React, { useEffect, useState } from 'react'\nimport type { ApiModel, IMethod } from '@looker/sdk-codegen'\nimport { getCodeGenerator, trimInputs } from '@looker/sdk-codegen'\nimport { Heading } from '@looker/components'\nimport { CodeCopy } from '@looker/code-editor'\n\nimport type { RunItValues } from '../../RunIt'\nimport { DarkSpan } from '../common'\nimport { DocMultiCall } from './DocMultiCall'\nimport { getGenerators } from './callUtils'\n\nexport interface DocSdkCallsProps {\n /** API spec */\n api: ApiModel\n /** current method */\n method: IMethod\n /** Entered RunIt form values */\n inputs: RunItValues\n /** Language to generate Sdk calls in*/\n sdkLanguage: string\n /** true to not trim the body params */\n keepBody?: boolean\n}\n\n/**\n * Generates the SDK call syntax for a given language or all supported languages\n */\nexport const DocSdkCalls: FC<DocSdkCallsProps> = ({\n api,\n method,\n inputs,\n sdkLanguage = 'All',\n keepBody = false,\n}) => {\n const [heading, setHeading] = useState('')\n const trimmed = trimInputs(inputs, keepBody)\n\n useEffect(() => {\n const text =\n sdkLanguage === 'All'\n ? 'SDKs call syntax'\n : `${sdkLanguage} SDK call syntax`\n setHeading(text)\n }, [sdkLanguage])\n\n const calls = {}\n try {\n if (sdkLanguage === 'All') {\n const generators = getGenerators(api)\n Object.entries(generators).forEach(([language, gen]) => {\n calls[language] = gen.makeTheCall(method, trimmed)\n })\n } else {\n const gen = getCodeGenerator(sdkLanguage, api)\n calls[sdkLanguage] = gen!.makeTheCall(method, trimmed)\n }\n } catch {\n return (\n <DarkSpan>\n Cannot generate SDK call syntax. Ensure all complex structures in the\n request form are valid.\n </DarkSpan>\n )\n }\n\n return (\n <>\n <Heading as=\"h4\" mb=\"medium\">\n {heading}\n </Heading>\n {sdkLanguage === 'All' ? (\n <DocMultiCall calls={calls} />\n ) : (\n <CodeCopy code={calls[sdkLanguage]} language={sdkLanguage} />\n )}\n </>\n )\n}\n"],"mappings":";;;;;;AA2BA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAGA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAA2C,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAa,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KA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A,WAAA"}
1
+ {"version":3,"file":"DocSdkCalls.js","names":["_react","_interopRequireWildcard","require","_sdkCodegen","_components","_codeEditor","_common","_DocMultiCall","_callUtils","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","DocSdkCalls","_ref","api","method","inputs","sdkLanguage","keepBody","heading","setHeading","useState","trimmed","trimInputs","useEffect","text","concat","calls","generators","getGenerators","entries","forEach","_ref2","language","gen","makeTheCall","getCodeGenerator","_unused","createElement","DarkSpan","Fragment","Heading","as","mb","DocMultiCall","CodeCopy","code","exports"],"sources":["../../../src/components/DocSdkCalls/DocSdkCalls.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { FC } from 'react';\nimport React, { useEffect, useState } from 'react';\nimport type { ApiModel, IMethod } from '@looker/sdk-codegen';\nimport { getCodeGenerator, trimInputs } from '@looker/sdk-codegen';\nimport { Heading } from '@looker/components';\nimport { CodeCopy } from '@looker/code-editor';\n\nimport type { RunItValues } from '../../RunIt';\nimport { DarkSpan } from '../common';\nimport { DocMultiCall } from './DocMultiCall';\nimport { getGenerators } from './callUtils';\n\nexport interface DocSdkCallsProps {\n /** API spec */\n api: ApiModel;\n /** current method */\n method: IMethod;\n /** Entered RunIt form values */\n inputs: RunItValues;\n /** Language to generate Sdk calls in*/\n sdkLanguage: string;\n /** true to not trim the body params */\n keepBody?: boolean;\n}\n\n/**\n * Generates the SDK call syntax for a given language or all supported languages\n */\nexport const DocSdkCalls: FC<DocSdkCallsProps> = ({\n api,\n method,\n inputs,\n sdkLanguage = 'All',\n keepBody = false,\n}) => {\n const [heading, setHeading] = useState('');\n const trimmed = trimInputs(inputs, keepBody);\n\n useEffect(() => {\n const text =\n sdkLanguage === 'All'\n ? 'SDKs call syntax'\n : `${sdkLanguage} SDK call syntax`;\n setHeading(text);\n }, [sdkLanguage]);\n\n const calls: any = {};\n try {\n if (sdkLanguage === 'All') {\n const generators = getGenerators(api);\n Object.entries(generators).forEach(([language, gen]) => {\n calls[language] = gen.makeTheCall(method, trimmed);\n });\n } else {\n const gen = getCodeGenerator(sdkLanguage, api);\n calls[sdkLanguage] = gen!.makeTheCall(method, trimmed);\n }\n } catch {\n return (\n <DarkSpan>\n Cannot generate SDK call syntax. Ensure all complex structures in the\n request form are valid.\n </DarkSpan>\n );\n }\n\n return (\n <>\n <Heading as=\"h4\" mb=\"medium\">\n {heading}\n </Heading>\n {sdkLanguage === 'All' ? (\n <DocMultiCall calls={calls} />\n ) : (\n <CodeCopy code={calls[sdkLanguage]} language={sdkLanguage} />\n )}\n </>\n );\n};\n"],"mappings":";;;;;;AA2BA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAGA,IAAAI,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AAxD,MAAA,CAAAe,OAAA,CAAA2C,QAAA,QACE1D,MAAA,CAAAe,OAAA,CAAAyC,aAAA,CAACpD,WAAA,CAAAuD,OAAO;IAACC,EAAE,EAAC,IAAI;IAACC,EAAE,EAAC;EAAQ,GACzBxB,OACM,CAAC,EACTF,WAAW,KAAK,KAAK,GACpBnC,MAAA,CAAAe,OAAA,CAAAyC,aAAA,CAACjD,aAAA,CAAAuD,YAAY;IAACjB,KAAK,EAAEA;EAAM,CAAE,CAAC,GAE9B7C,MAAA,CAAAe,OAAA,CAAAyC,aAAA,CAACnD,WAAA,CAAA0D,QAAQ;IAACC,IAAI,EAAEnB,KAAK,CAACV,WAAW,CAAE;IAACgB,QAAQ,EAAEhB;EAAY,CAAE,CAE9D,CAAC;AAEP,CAAC;AAAC8B,OAAA,CAAAnC,WAAA,GAAAA,WAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"callUtils.js","names":["_sdkCodegen","require","getGenerators","api","codeGens","codeGenerators","filter","x","factory","undefined","forEach","gen","language","exports"],"sources":["../../../src/components/DocSdkCalls/callUtils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { ApiModel, CodeGen, KeyedCollection } from '@looker/sdk-codegen'\nimport { codeGenerators } from '@looker/sdk-codegen'\n\n/**\n * Returns a collection of generators for all supported (non legacy) languages\n * @param api Api spec\n */\nexport const getGenerators = (api: ApiModel): KeyedCollection<CodeGen> => {\n const codeGens = {}\n codeGenerators\n .filter((x) => x.factory !== undefined)\n .forEach((gen) => {\n codeGens[gen.language] = gen.factory!(api)\n })\n return codeGens\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,WAAA,GAAAC,OAAA;AAMO,IAAMC,aAAa,GAAIC,GAAa,IAA+B;EACxE,IAAMC,QAAQ,GAAG,CAAC,CAAC;EACnBC,0BAAc,CACXC,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,KAAKC,SAAS,CAAC,CACtCC,OAAO,CAAEC,GAAG,IAAK;IAChBP,QAAQ,CAACO,GAAG,CAACC,QAAQ,CAAC,GAAGD,GAAG,CAACH,OAAO,CAAEL,GAAG,CAAC;EAC5C,CAAC,CAAC;EACJ,OAAOC,QAAQ;AACjB,CAAC;AAAAS,OAAA,CAAAX,aAAA,GAAAA,aAAA"}
1
+ {"version":3,"file":"callUtils.js","names":["_sdkCodegen","require","getGenerators","api","codeGens","codeGenerators","filter","x","factory","undefined","forEach","gen","language","exports"],"sources":["../../../src/components/DocSdkCalls/callUtils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { ApiModel, CodeGen, KeyedCollection } from '@looker/sdk-codegen';\nimport { codeGenerators } from '@looker/sdk-codegen';\n\n/**\n * Returns a collection of generators for all supported (non legacy) languages\n * @param api Api spec\n */\nexport const getGenerators = (api: ApiModel): KeyedCollection<CodeGen> => {\n const codeGens: any = {};\n codeGenerators\n .filter((x) => x.factory !== undefined)\n .forEach((gen) => {\n codeGens[gen.language] = gen.factory!(api);\n });\n return codeGens;\n};\n"],"mappings":";;;;;;AA0BA,IAAAA,WAAA,GAAAC,OAAA;AAMO,IAAMC,aAAa,GAAIC,GAAa,IAA+B;EACxE,IAAMC,QAAa,GAAG,CAAC,CAAC;EACxBC,0BAAc,CACXC,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,KAAKC,SAAS,CAAC,CACtCC,OAAO,CAAEC,GAAG,IAAK;IAChBP,QAAQ,CAACO,GAAG,CAACC,QAAQ,CAAC,GAAGD,GAAG,CAACH,OAAO,CAAEL,GAAG,CAAC;EAC5C,CAAC,CAAC;EACJ,OAAOC,QAAQ;AACjB,CAAC;AAACS,OAAA,CAAAX,aAAA,GAAAA,aAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_callUtils","require","_DocSdkCalls"],"sources":["../../../src/components/DocSdkCalls/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport { getGenerators } from './callUtils'\nexport { DocSdkCalls } from './DocSdkCalls'\n"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA"}
1
+ {"version":3,"file":"index.js","names":["_callUtils","require","_DocSdkCalls"],"sources":["../../../src/components/DocSdkCalls/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport { getGenerators } from './callUtils';\nexport { DocSdkCalls } from './DocSdkCalls';\n"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Loading.js","names":["_react","_interopRequireDefault","require","_components","obj","__esModule","default","Loading","_ref","loading","message","createElement","Fragment","Space","gap","ProgressCircular","size","Text","color","exports"],"sources":["../../../src/components/Loading/Loading.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { FC } from 'react'\nimport React from 'react'\nimport { Space, ProgressCircular, Text } from '@looker/components'\n\ninterface LoadingProps {\n loading: boolean\n message?: string\n}\n\nexport const Loading: FC<LoadingProps> = ({\n loading,\n message = 'Loading ...',\n}) => (\n <>\n {loading && (\n <Space gap=\"small\">\n <ProgressCircular size=\"small\" />\n <Text color=\"text\">{message}</Text>\n </Space>\n )}\n </>\n)\n"],"mappings":";;;;;;AA2BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAkE,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAO3D,IAAMG,OAAyB,GAAGC,IAAA;EAAA,IAAC;IACxCC,OAAO;IACPC,OAAO,GAAG;EACZ,CAAC,GAAAF,IAAA;EAAA,OACCR,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAAAX,MAAA,CAAAM,OAAA,CAAAM,QAAA,QACGH,OAAO,IACNT,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAACR,WAAA,CAAAU,KAAK;IAACC,GAAG,EAAC;EAAO,GAChBd,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAACR,WAAA,CAAAY,gBAAgB;IAACC,IAAI,EAAC;EAAO,CAAE,CAAC,EACjChB,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAACR,WAAA,CAAAc,IAAI;IAACC,KAAK,EAAC;EAAM,GAAER,OAAc,CAC7B,CAET,CAAC;AAAA,CACJ;AAAAS,OAAA,CAAAZ,OAAA,GAAAA,OAAA"}
1
+ {"version":3,"file":"Loading.js","names":["_react","_interopRequireDefault","require","_components","obj","__esModule","default","Loading","_ref","loading","message","createElement","Fragment","Space","gap","ProgressCircular","size","Text","color","exports"],"sources":["../../../src/components/Loading/Loading.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { FC } from 'react';\nimport React from 'react';\nimport { ProgressCircular, Space, Text } from '@looker/components';\n\ninterface LoadingProps {\n loading: boolean;\n message?: string;\n}\n\nexport const Loading: FC<LoadingProps> = ({\n loading,\n message = 'Loading ...',\n}) => (\n <>\n {loading && (\n <Space gap=\"small\">\n <ProgressCircular size=\"small\" />\n <Text color=\"text\">{message}</Text>\n </Space>\n )}\n </>\n);\n"],"mappings":";;;;;;AA2BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAmE,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAO5D,IAAMG,OAAyB,GAAGC,IAAA;EAAA,IAAC;IACxCC,OAAO;IACPC,OAAO,GAAG;EACZ,CAAC,GAAAF,IAAA;EAAA,OACCR,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAAAX,MAAA,CAAAM,OAAA,CAAAM,QAAA,QACGH,OAAO,IACNT,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAACR,WAAA,CAAAU,KAAK;IAACC,GAAG,EAAC;EAAO,GAChBd,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAACR,WAAA,CAAAY,gBAAgB;IAACC,IAAI,EAAC;EAAO,CAAE,CAAC,EACjChB,MAAA,CAAAM,OAAA,CAAAK,aAAA,CAACR,WAAA,CAAAc,IAAI;IAACC,KAAK,EAAC;EAAM,GAAER,OAAc,CAC7B,CAET,CAAC;AAAA,CACJ;AAACS,OAAA,CAAAZ,OAAA,GAAAA,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_Loading","require"],"sources":["../../../src/components/Loading/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport { Loading } from './Loading'\n"],"mappings":";;;;;;;;;;;AA0BA,IAAAA,QAAA,GAAAC,OAAA"}
1
+ {"version":3,"file":"index.js","names":["_Loading","require"],"sources":["../../../src/components/Loading/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport { Loading } from './Loading';\n"],"mappings":";;;;;;;;;;;AA0BA,IAAAA,QAAA,GAAAC,OAAA"}
@@ -11,10 +11,8 @@ var _ConfigForm = require("../ConfigForm");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
13
13
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
14
- var readyToLogin = 'OAuth is configured but your browser session is not authenticated. Click Login to enable RunIt.';
15
- exports.readyToLogin = readyToLogin;
16
- var notReadyToLogin = 'OAuth is not configured. Configure it to be able to Login.';
17
- exports.notReadyToLogin = notReadyToLogin;
14
+ var readyToLogin = exports.readyToLogin = 'OAuth is configured but your browser session is not authenticated. Click Login to enable RunIt.';
15
+ var notReadyToLogin = exports.notReadyToLogin = 'OAuth is not configured. Configure it to be able to Login.';
18
16
  var LoginForm = _ref => {
19
17
  var {
20
18
  requestContent
@@ -1 +1 @@
1
- {"version":3,"file":"LoginForm.js","names":["_react","_interopRequireDefault","require","_components","_extensionUtils","_ConfigForm","obj","__esModule","default","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","readyToLogin","exports","notReadyToLogin","LoginForm","_ref","requestContent","adaptor","getEnvAdaptor","handleLogin","_ref2","e","preventDefault","localStorageSetItem","RunItFormKey","JSON","stringify","login","_x","createElement","Tooltip","content","sdk","authSession","settings","authIsConfigured","Button","onClick"],"sources":["../../../src/components/LoginForm/LoginForm.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { BaseSyntheticEvent, FC } from 'react'\nimport React from 'react'\nimport { Button, Tooltip } from '@looker/components'\nimport type { OAuthConfigProvider } from '@looker/extension-utils'\nimport { getEnvAdaptor } from '@looker/extension-utils'\n\nimport { RunItFormKey } from '../ConfigForm'\nimport type { RunItValues } from '../..'\n\ninterface LoginFormProps {\n requestContent: RunItValues\n}\n\nexport const readyToLogin =\n 'OAuth is configured but your browser session is not authenticated. Click Login to enable RunIt.'\n\nexport const notReadyToLogin =\n 'OAuth is not configured. Configure it to be able to Login.'\n\nexport const LoginForm: FC<LoginFormProps> = ({ requestContent }) => {\n const adaptor = getEnvAdaptor()\n const handleLogin = async (e: BaseSyntheticEvent) => {\n e.preventDefault()\n if (requestContent) {\n adaptor.localStorageSetItem(RunItFormKey, JSON.stringify(requestContent))\n }\n // This will set storage variables and return to OAuthScene when successful\n await adaptor.login()\n }\n\n return (\n <Tooltip\n content={\n (\n adaptor.sdk.authSession.settings as OAuthConfigProvider\n ).authIsConfigured()\n ? readyToLogin\n : notReadyToLogin\n }\n >\n <Button onClick={handleLogin}>Login</Button>\n </Tooltip>\n )\n}\n"],"mappings":";;;;;;AA2BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAA4C,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA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Ac,EAAE;QAClBC,OAAO,CAACM,mBAAmB,CAACC,wBAAY,EAAEC,IAAI,CAACC,SAAS,CAACV,cAAc,CAAC,CAAC;MAC3E;MAEA,MAAMC,OAAO,CAACU,KAAK,CAAC,CAAC;IACvB,CAAC;IAAA,gBAPKR,WAAWA,CAAAS,EAAA;MAAA,OAAAR,KAAA,CAAAZ,KAAA,OAAAD,SAAA;IAAA;EAAA,GAOhB;EAED,OACE3B,MAAA,CAAAQ,OAAA,CAAAyC,aAAA,CAAC9C,WAAA,CAAA+C,OAAO;IACNC,OAAO,EAEHd,OAAO,CAACe,GAAG,CAACC,WAAW,CAACC,QAAQ,CAChCC,gBAAgB,CAAC,CAAC,GAChBxB,YAAY,GACZE;EACL,GAEDjC,MAAA,CAAAQ,OAAA,CAAAyC,aAAA,CAAC9C,WAAA,CAAAqD,MAAM;IAACC,OAAO,EAAElB;EAAY,GAAC,OAAa,CACpC,CAAC;AAEd,CAAC;AAAAP,OAAA,CAAAE,SAAA,GAAAA,SAAA"}
1
+ {"version":3,"file":"LoginForm.js","names":["_react","_interopRequireDefault","require","_components","_extensionUtils","_ConfigForm","obj","__esModule","default","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","readyToLogin","exports","notReadyToLogin","LoginForm","_ref","requestContent","adaptor","getEnvAdaptor","handleLogin","_ref2","e","preventDefault","localStorageSetItem","RunItFormKey","JSON","stringify","login","_x","createElement","Tooltip","content","sdk","authSession","settings","authIsConfigured","Button","onClick"],"sources":["../../../src/components/LoginForm/LoginForm.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { BaseSyntheticEvent, FC } from 'react';\nimport React from 'react';\nimport { Button, Tooltip } from '@looker/components';\nimport type { OAuthConfigProvider } from '@looker/extension-utils';\nimport { getEnvAdaptor } from '@looker/extension-utils';\n\nimport { RunItFormKey } from '../ConfigForm';\nimport type { RunItValues } from '../..';\n\ninterface LoginFormProps {\n requestContent: RunItValues;\n}\n\nexport const readyToLogin =\n 'OAuth is configured but your browser session is not authenticated. Click Login to enable RunIt.';\n\nexport const notReadyToLogin =\n 'OAuth is not configured. Configure it to be able to Login.';\n\nexport const LoginForm: FC<LoginFormProps> = ({ requestContent }) => {\n const adaptor = getEnvAdaptor();\n const handleLogin = async (e: BaseSyntheticEvent) => {\n e.preventDefault();\n if (requestContent) {\n adaptor.localStorageSetItem(RunItFormKey, JSON.stringify(requestContent));\n }\n // This will set storage variables and return to OAuthScene when successful\n await adaptor.login();\n };\n\n return (\n <Tooltip\n content={\n (\n adaptor.sdk.authSession.settings as OAuthConfigProvider\n ).authIsConfigured()\n ? readyToLogin\n : notReadyToLogin\n }\n >\n <Button onClick={handleLogin}>Login</Button>\n </Tooltip>\n );\n};\n"],"mappings":";;;;;;AA2BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA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AAC,6BAAa,EAAC,CAAC;EAC/B,IAAMC,WAAW;IAAA,IAAAC,KAAA,GAAAjB,iBAAA,CAAG,WAAOkB,CAAqB,EAAK;MACnDA,CAAC,CAACC,cAAc,CAAC,CAAC;MAClB,IAAIN,cAAc,EAAE;QAClBC,OAAO,CAACM,mBAAmB,CAACC,wBAAY,EAAEC,IAAI,CAACC,SAAS,CAACV,cAAc,CAAC,CAAC;MAC3E;MAEA,MAAMC,OAAO,CAACU,KAAK,CAAC,CAAC;IACvB,CAAC;IAAA,gBAPKR,WAAWA,CAAAS,EAAA;MAAA,OAAAR,KAAA,CAAAZ,KAAA,OAAAD,SAAA;IAAA;EAAA,GAOhB;EAED,OACE3B,MAAA,CAAAQ,OAAA,CAAAyC,aAAA,CAAC9C,WAAA,CAAA+C,OAAO;IACNC,OAAO,EAEHd,OAAO,CAACe,GAAG,CAACC,WAAW,CAACC,QAAQ,CAChCC,gBAAgB,CAAC,CAAC,GAChBxB,YAAY,GACZE;EACL,GAEDjC,MAAA,CAAAQ,OAAA,CAAAyC,aAAA,CAAC9C,WAAA,CAAAqD,MAAM;IAACC,OAAO,EAAElB;EAAY,GAAC,OAAa,CACpC,CAAC;AAEd,CAAC;AAACP,OAAA,CAAAE,SAAA,GAAAA,SAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_LoginForm","require"],"sources":["../../../src/components/LoginForm/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport { LoginForm, readyToLogin } from './LoginForm'\n"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,IAAAA,UAAA,GAAAC,OAAA"}
1
+ {"version":3,"file":"index.js","names":["_LoginForm","require"],"sources":["../../../src/components/LoginForm/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport { LoginForm, readyToLogin } from './LoginForm';\n"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,IAAAA,UAAA,GAAAC,OAAA"}
@@ -1,18 +1,18 @@
1
1
  import type { CompatibleHTMLProps, TypographyProps } from '@looker/design-tokens';
2
2
  import type { HttpMethod } from '@looker/sdk-rtl';
3
- declare type MethodStatus = 'alpha' | 'beta' | 'stable' | 'experimental' | 'deprecated' | 'inform' | 'undocumented';
3
+ type MethodStatus = 'alpha' | 'beta' | 'stable' | 'experimental' | 'deprecated' | 'inform' | 'undocumented';
4
4
  interface MethodBadgeProps extends CompatibleHTMLProps<HTMLDivElement>, TypographyProps {
5
5
  type: HttpMethod | MethodStatus | string;
6
6
  compact?: boolean;
7
7
  minWidth?: string;
8
8
  titleStatus?: boolean;
9
9
  }
10
- declare type ApixIntentNames = 'critical' | 'inform' | 'key' | 'neutral' | 'positive' | 'warn';
10
+ type ApixIntentNames = 'critical' | 'inform' | 'key' | 'neutral' | 'positive' | 'warn';
11
11
  export declare const pickBadgeIntent: (type: HttpMethod | MethodStatus | string) => "critical" | "inform" | "positive" | "warn" | "key" | "neutral";
12
12
  export declare const cssForIntent: (intent: ApixIntentNames) => import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
13
13
  export declare const MethodBadge: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
14
- fontSize: import("styled-system").ResponsiveValue<import("@looker/design-tokens").FontSizes, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>;
15
- fontWeight: import("styled-system").ResponsiveValue<import("@looker/design-tokens").FontWeights, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>;
14
+ fontSize: import("styled-system").ResponsiveValue<import("@looker/design-tokens").FontSizes>;
15
+ fontWeight: import("styled-system").ResponsiveValue<import("@looker/design-tokens").FontWeights>;
16
16
  minWidth: string;
17
17
  } & MethodBadgeProps, "fontSize" | "fontWeight" | "minWidth">;
18
18
  export {};
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.pickBadgeIntent = exports.cssForIntent = exports.MethodBadge = void 0;
7
7
  var _designTokens = require("@looker/design-tokens");
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
9
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
10
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
11
  var pickBadgeIntent = type => {
12
12
  switch (type) {
13
13
  case 'alpha':
@@ -40,7 +40,7 @@ var cssForIntent = intent => (0, _styledComponents.css)(["background:", ";color:
40
40
  return (0, _designTokens.generatePressed)(theme.colors[intent]);
41
41
  });
42
42
  exports.cssForIntent = cssForIntent;
43
- var MethodBadge = _styledComponents.default.div.attrs(_ref2 => {
43
+ var MethodBadge = exports.MethodBadge = _styledComponents.default.div.attrs(_ref2 => {
44
44
  var {
45
45
  fontSize = 'xsmall',
46
46
  fontWeight = 'semiBold',
@@ -94,5 +94,4 @@ var MethodBadge = _styledComponents.default.div.attrs(_ref2 => {
94
94
  } = _ref8;
95
95
  return "".concat(space.xxsmall, " ").concat(compact ? space.none : space.xsmall);
96
96
  });
97
- exports.MethodBadge = MethodBadge;
98
97
  //# sourceMappingURL=MethodBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MethodBadge.js","names":["_designTokens","require","_styledComponents","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","pickBadgeIntent","type","exports","cssForIntent","intent","css","intentUIBlend","_ref","theme","generatePressed","colors","MethodBadge","styled","div","attrs","_ref2","fontSize","fontWeight","minWidth","withConfig","displayName","componentId","typography","_ref3","_ref4","titleStatus","ui1","_ref5","radii","medium","_ref6","compact","_ref7","_ref8","space","concat","xxsmall","none","xsmall"],"sources":["../../../src/components/MethodBadge/MethodBadge.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type {\n CompatibleHTMLProps,\n TypographyProps,\n} from '@looker/design-tokens'\nimport {\n generatePressed,\n intentUIBlend,\n typography,\n} from '@looker/design-tokens'\nimport type { HttpMethod } from '@looker/sdk-rtl'\nimport styled, { css } from 'styled-components'\n\n/**\n * Status of endpoint method.\n */\ntype MethodStatus =\n | 'alpha'\n | 'beta'\n | 'stable'\n | 'experimental'\n | 'deprecated'\n | 'inform'\n | 'undocumented'\n\ninterface MethodBadgeProps\n extends CompatibleHTMLProps<HTMLDivElement>,\n TypographyProps {\n /** Determines background color */\n type: HttpMethod | MethodStatus | string\n compact?: boolean\n minWidth?: string\n titleStatus?: boolean\n}\n\n/**\n * Intent names to display the correct color for the badge based on the HTTP method or method status.\n */\ntype ApixIntentNames =\n | 'critical'\n | 'inform'\n | 'key'\n | 'neutral'\n | 'positive'\n | 'warn'\n\nexport const pickBadgeIntent = (type: HttpMethod | MethodStatus | string) => {\n switch (type) {\n case 'alpha':\n case 'DELETE':\n case 'deprecated':\n return 'critical'\n case 'HEAD':\n return 'neutral'\n case 'PATCH':\n case 'TRACE':\n case 'experimental':\n case 'undocumented':\n return 'warn'\n case 'POST':\n case 'stable':\n return 'positive'\n case 'PUT':\n case 'beta':\n return 'key'\n case 'GET':\n default:\n return 'inform'\n }\n}\n\nexport const cssForIntent = (intent: ApixIntentNames) =>\n css`\n background: ${intentUIBlend(intent, 1)};\n color: ${({ theme }) => generatePressed(theme.colors[intent])};\n `\n\nexport const MethodBadge = styled.div.attrs(\n ({\n fontSize = 'xsmall',\n fontWeight = 'semiBold',\n minWidth = '2.5rem',\n }: MethodBadgeProps) => ({\n fontSize,\n fontWeight,\n minWidth,\n })\n)<MethodBadgeProps>`\n ${typography}\n\n ${({ type }) => cssForIntent(pickBadgeIntent(type))};\n\n background: ${({ type, titleStatus, theme: { colors } }) =>\n titleStatus ? colors.ui1 : intentUIBlend(pickBadgeIntent(type), 1)};\n border: 1px solid transparent;\n border-radius: ${({ theme: { radii } }) => radii.medium};\n\n /** NOTE: This is below minimum accessibility threshold font-size */\n ${({ compact }) => compact && `font-size: 9px;`}\n\n min-width: ${({ minWidth }) => minWidth};\n padding: ${({ compact, theme: { space } }) =>\n `${space.xxsmall} ${compact ? space.none : space.xsmall}`};\n`\n"],"mappings":";;;;;;AA8BA,IAAAA,aAAA,GAAAC,OAAA;AAMA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA+C,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAF,wBAAAM,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IA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CAAAS,WAAA,GAAAA,WAAA"}
1
+ {"version":3,"file":"MethodBadge.js","names":["_designTokens","require","_styledComponents","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","pickBadgeIntent","type","exports","cssForIntent","intent","css","intentUIBlend","_ref","theme","generatePressed","colors","MethodBadge","styled","div","attrs","_ref2","fontSize","fontWeight","minWidth","withConfig","displayName","componentId","typography","_ref3","_ref4","titleStatus","ui1","_ref5","radii","medium","_ref6","compact","_ref7","_ref8","space","concat","xxsmall","none","xsmall"],"sources":["../../../src/components/MethodBadge/MethodBadge.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type {\n CompatibleHTMLProps,\n TypographyProps,\n} from '@looker/design-tokens';\nimport {\n generatePressed,\n intentUIBlend,\n typography,\n} from '@looker/design-tokens';\nimport type { HttpMethod } from '@looker/sdk-rtl';\nimport styled, { css } from 'styled-components';\n\n/**\n * Status of endpoint method.\n */\ntype MethodStatus =\n | 'alpha'\n | 'beta'\n | 'stable'\n | 'experimental'\n | 'deprecated'\n | 'inform'\n | 'undocumented';\n\ninterface MethodBadgeProps\n extends CompatibleHTMLProps<HTMLDivElement>,\n TypographyProps {\n /** Determines background color */\n type: HttpMethod | MethodStatus | string;\n compact?: boolean;\n minWidth?: string;\n titleStatus?: boolean;\n}\n\n/**\n * Intent names to display the correct color for the badge based on the HTTP method or method status.\n */\ntype ApixIntentNames =\n | 'critical'\n | 'inform'\n | 'key'\n | 'neutral'\n | 'positive'\n | 'warn';\n\nexport const pickBadgeIntent = (type: HttpMethod | MethodStatus | string) => {\n switch (type) {\n case 'alpha':\n case 'DELETE':\n case 'deprecated':\n return 'critical';\n case 'HEAD':\n return 'neutral';\n case 'PATCH':\n case 'TRACE':\n case 'experimental':\n case 'undocumented':\n return 'warn';\n case 'POST':\n case 'stable':\n return 'positive';\n case 'PUT':\n case 'beta':\n return 'key';\n case 'GET':\n default:\n return 'inform';\n }\n};\n\nexport const cssForIntent = (intent: ApixIntentNames) => css`\n background: ${intentUIBlend(intent, 1)};\n color: ${({ theme }) => generatePressed(theme.colors[intent])};\n`;\n\nexport const MethodBadge = styled.div.attrs(\n ({\n fontSize = 'xsmall',\n fontWeight = 'semiBold',\n minWidth = '2.5rem',\n }: MethodBadgeProps) => ({\n fontSize,\n fontWeight,\n minWidth,\n })\n)<MethodBadgeProps>`\n ${typography}\n\n ${({ type }) => cssForIntent(pickBadgeIntent(type))};\n\n background: ${({ type, titleStatus, theme: { colors } }) =>\n titleStatus ? colors.ui1 : intentUIBlend(pickBadgeIntent(type), 1)};\n border: 1px solid transparent;\n border-radius: ${({ theme: { radii } }) => radii.medium};\n\n /** NOTE: This is below minimum accessibility threshold font-size */\n ${({ compact }) => compact && `font-size: 9px;`}\n\n min-width: ${({ minWidth }) => minWidth};\n padding: ${({ compact, theme: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uB,KAAA;EAAA,IAAC;IAAEvB,IAAI;IAAEwB,WAAW;IAAEjB,KAAK,EAAE;MAAEE;IAAO;EAAE,CAAC,GAAAc,KAAA;EAAA,OACrDC,WAAW,GAAGf,MAAM,CAACgB,GAAG,GAAG,IAAApB,2BAAa,EAACN,eAAe,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC;AAAA,GAEnD0B,KAAA;EAAA,IAAC;IAAEnB,KAAK,EAAE;MAAEoB;IAAM;EAAE,CAAC,GAAAD,KAAA;EAAA,OAAKC,KAAK,CAACC,MAAM;AAAA,GAGrDC,KAAA;EAAA,IAAC;IAAEC;EAAQ,CAAC,GAAAD,KAAA;EAAA,OAAKC,OAAO,qBAAqB;AAAA,GAElCC,KAAA;EAAA,IAAC;IAAEd;EAAS,CAAC,GAAAc,KAAA;EAAA,OAAKd,QAAQ;AAAA,GAC5Be,KAAA;EAAA,IAAC;IAAEF,OAAO;IAAEvB,KAAK,EAAE;MAAE0B;IAAM;EAAE,CAAC,GAAAD,KAAA;EAAA,UAAAE,MAAA,CACpCD,KAAK,CAACE,OAAO,OAAAD,MAAA,CAAIJ,OAAO,GAAGG,KAAK,CAACG,IAAI,GAAGH,KAAK,CAACI,MAAM;AAAA,CAAE,CAC5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_MethodBadge","require"],"sources":["../../../src/components/MethodBadge/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { MethodBadge } from './MethodBadge'\n"],"mappings":";;;;;;;;;;;AAyBA,IAAAA,YAAA,GAAAC,OAAA"}
1
+ {"version":3,"file":"index.js","names":["_MethodBadge","require"],"sources":["../../../src/components/MethodBadge/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { MethodBadge } from './MethodBadge';\n"],"mappings":";;;;;;;;;;;AAyBA,IAAAA,YAAA,GAAAC,OAAA"}