@splunk/dynamic-editors 0.42.0 → 0.42.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -94
- package/DynamicEditor.js +70 -69
- package/DynamicEditor.js.map +1 -1
- package/containers/EditorItem.js +73 -72
- package/containers/EditorItem.js.map +1 -1
- package/containers/EditorLayout.js +81 -80
- package/containers/EditorLayout.js.map +1 -1
- package/containers/EditorLayoutItem.js +55 -54
- package/containers/EditorLayoutItem.js.map +1 -1
- package/editors/AdvancedConfigCard.js.map +1 -1
- package/editors/ArrayOfStringsEditor.js +4 -4
- package/editors/ArrayOfStringsEditor.js.map +1 -1
- package/editors/CheckboxEditor.js.map +1 -1
- package/editors/ColorEditor.js.map +1 -1
- package/editors/ColumnMultiSelectionByFieldNameEditor.js.map +1 -1
- package/editors/ColumnMultiSelectionEditor.js +4 -4
- package/editors/ColumnMultiSelectionEditor.js.map +1 -1
- package/editors/ColumnSelectionEditor.js +4 -4
- package/editors/ColumnSelectionEditor.js.map +1 -1
- package/editors/CustomizedInSourceEditor.js +4 -4
- package/editors/CustomizedInSourceEditor.js.map +1 -1
- package/editors/DynamicColorEditor.js +40 -40
- package/editors/DynamicColorEditor.js.map +1 -1
- package/editors/DynamicColorEditorWithPrecedence.js +24 -24
- package/editors/DynamicColorEditorWithPrecedence.js.map +1 -1
- package/editors/DynamicItemEditor.js +4 -4
- package/editors/DynamicItemEditor.js.map +1 -1
- package/editors/ImageEditor.js.map +1 -1
- package/editors/MultiColorPickerEditor.js +1 -0
- package/editors/MultiColorPickerEditor.js.map +1 -1
- package/editors/NetworkGraphDynamicColorEditor.js +39 -39
- package/editors/NetworkGraphDynamicColorEditor.js.map +1 -1
- package/editors/NumberEditor.js.map +1 -1
- package/editors/PercentEditor.js.map +1 -1
- package/editors/PresetSelectorEditor.js +1 -1
- package/editors/PresetSelectorEditor.js.map +1 -1
- package/editors/RadioBarEditor.js.map +1 -1
- package/editors/SelectEditor.js.map +1 -1
- package/editors/SeriesColorsByFieldEditor.js +1 -0
- package/editors/SeriesColorsByFieldEditor.js.map +1 -1
- package/editors/SeriesColorsEditor.js +13 -12
- package/editors/SeriesColorsEditor.js.map +1 -1
- package/editors/SliderEditor.js +3 -3
- package/editors/SliderEditor.js.map +1 -1
- package/editors/StaticItemEditor.js.map +1 -1
- package/editors/TableColumnFormatterEditor.js +53 -52
- package/editors/TableColumnFormatterEditor.js.map +1 -1
- package/editors/TableDynamicColorEditor.js +24 -24
- package/editors/TableDynamicColorEditor.js.map +1 -1
- package/editors/TextAreaEditor.js.map +1 -1
- package/editors/TextEditor.js.map +1 -1
- package/editors/ThresholdEditor.js.map +1 -1
- package/editors/ToggleEditor.js.map +1 -1
- package/package.json +2 -2
- package/shared/AdvancedControlGroup.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageEditor.js","mappings":";;;;6EAAA,gBA0BS,EAAAA,wBAtBuB,CAACC,EAAaC,EAA8B,UACxE,MAAOC,EAAWC,IAAgB,IAAAC,UAAwBH,GAkB1D,OAjBA,IAAAI,YAAU,KACN,MAAMC,EAAmBC,IAChBA,EAAEC,aAAeR,GAAOO,EAAEC,aAAe,GAAGR,MAA6B,YAAlBO,EAAEE,YAIlDF,EAAEC,aAAeR,GAAOO,EAAEC,aAAe,GAAGR,MAA6B,WAAlBO,EAAEE,aACjEN,EAAa,WAFbA,EAAa,QAGjB,EAIJ,OAFAO,SAASC,iBAAiB,0BAA2BL,GACrDH,EAAaF,GACN,KACHS,SAASE,oBAAoB,0BAA2BN,EAAiB,CAC5E,GAEF,CAACN,IACGE,CAAS,C,8zBCvBpB,mBAEA,WACA,YACA,UACA,aACA,UACA,aACA,aACA,aAiBMW,GAAwB,aAAO,UAAgB;;;;qBAIhC,EAAAC,UAAUC;;;;;;;;;;;;;;;;EAmBzBC,GAAgB,aAAO,UAAQ;;;;;;EAQ/BC,GAA6B,aAAO,UAAoB;aACjD,EA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A,OAIPjB,cAAeiB,IAAAA,MAAQ,CAAC,MAAO,SAC/BhB,WAAYgB,IAAAA,OAIZ8I,gBAAiB9I,IAAAA,MAIjBoG,eAAgBpG,IAAAA,KAIhB0I,qBAAsB1I,IAAAA,QAG1B,S","sources":["webpack://@splunk/dynamic-editors/./src/hooks/useCSPViolationObserver.tsx","webpack://@splunk/dynamic-editors/./src/shared/AdvancedControlGroup.tsx","webpack://@splunk/dynamic-editors/./src/shared/CSPMessage.tsx","webpack://@splunk/dynamic-editors/./src/shared/MessageContainer.tsx","webpack://@splunk/dynamic-editors/external commonjs2 \"@babel/runtime/helpers/defineProperty\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-icons/Cross\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-icons/SlidersDoubleHorizontal\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Button\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/ControlGroup\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Link\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Message\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Text\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Tooltip\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/themes\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/ui-utils/i18n\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-context/FeatureFlagContext\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-context/MessageContext\"","webpack://@splunk/dynamic-editors/external commonjs2 \"lodash\"","webpack://@splunk/dynamic-editors/external commonjs2 \"prop-types\"","webpack://@splunk/dynamic-editors/external commonjs2 \"react\"","webpack://@splunk/dynamic-editors/external commonjs2 \"styled-components\"","webpack://@splunk/dynamic-editors/webpack/bootstrap","webpack://@splunk/dynamic-editors/webpack/runtime/compat get default export","webpack://@splunk/dynamic-editors/webpack/runtime/define property getters","webpack://@splunk/dynamic-editors/webpack/runtime/hasOwnProperty shorthand","webpack://@splunk/dynamic-editors/webpack/runtime/make namespace object","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-context/ImageContext\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Image\"","webpack://@splunk/dynamic-editors/./src/components/UploadImageEditor.jsx","webpack://@splunk/dynamic-editors/./src/components/ImageThumbnail.jsx","webpack://@splunk/dynamic-editors/./src/editors/ImageEditor.jsx"],"sourcesContent":["import { useState, useEffect } from 'react';\n\ntype ViolationType = 'error' | 'warning' | 'none';\n\nconst useCSPViolationObserver = (src: string, defaultValue: ViolationType = 'none'): ViolationType => {\n const [violation, setViolation] = useState<ViolationType>(defaultValue);\n useEffect(() => {\n const violationHandler = e => {\n if ((e.blockedURI === src || e.blockedURI === `${src}/`) && e.disposition === 'enforce') {\n // the second src condition is required as Chrome rewrites\n // URLs without query parameters (e.g. foo.com -> foo.com/ )\n setViolation('error');\n } else if ((e.blockedURI === src || e.blockedURI === `${src}/`) && e.disposition === 'report') {\n setViolation('warning');\n }\n };\n document.addEventListener('securitypolicyviolation', violationHandler);\n setViolation(defaultValue);\n return () => {\n document.removeEventListener('securitypolicyviolation', violationHandler);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [src]);\n return violation;\n};\n\nexport { useCSPViolationObserver };\n","import React, { Children, cloneElement } from 'react';\nimport type { ReactElement } from 'react';\nimport * as T from 'prop-types';\nimport styled from 'styled-components';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport AdvancedConfigIcon from '@splunk/react-icons/SlidersDoubleHorizontal';\nimport { variables } from '@splunk/themes';\nimport Tooltip from '@splunk/react-ui/Tooltip';\nimport Button, { ButtonClickHandler, ButtonProps } from '@splunk/react-ui/Button';\nimport SUIControlGroup from '@splunk/react-ui/ControlGroup';\nimport type { ControlGroupPropsBase } from '@splunk/react-ui/ControlGroup';\n\ninterface AdvancedControlGroupProps extends Omit<ControlGroupPropsBase, 'splunkTheme'> {\n 'data-test'?: string;\n style?: Record<string, string | number>;\n isAdvanced?: boolean;\n onClick?: React.MouseEventHandler<HTMLDivElement>;\n onAdvancedConfigButtonClick?: ButtonClickHandler;\n}\n\ninterface AdvancedConfigButtonProps {\n label?: string;\n onClick?: ButtonClickHandler;\n}\n\n// remove all surrounding margins. let parent add padding\nconst ControlGroupContainer = styled(SUIControlGroup)`\n margin-top: 0;\n padding: 0;\n // adjust bottom margin according to theme\n margin-bottom: ${variables.spacingMedium};\n width: 100%;\n\n // remove top margin of the first component in control group\n &:first-child {\n margin-top: 0;\n }\n\n // remove bottom margin of the last component in control group\n &:last-child {\n margin-bottom: 0;\n }\n // remove top padding on label of the first control group\n [data-test='label']:first-of-type {\n padding-top: 0;\n }\n`;\n\n// override tooltip to set desired config button style\nconst StyledToolTip = styled(Tooltip)`\n display: flex;\n > span {\n display: flex;\n width: 35px;\n }\n`;\n\nconst StyledAdvancedConfigButton = styled(Button)<ButtonProps>`\n color: ${variables.contentColorActive} !important;\n &:hover {\n background-color: ${variables.interactiveColorOverlayDrag} !important;\n }\n`;\n\nexport const AdvancedConfigButton = ({\n label = '',\n onClick,\n}: AdvancedConfigButtonProps): React.ReactElement => {\n return (\n <StyledToolTip\n data-test={`${label}-advanced-config-button-tooltip`}\n content={_('Advanced configurations')}\n >\n <StyledAdvancedConfigButton\n data-test={`${label}-advanced-config-button`}\n icon={<AdvancedConfigIcon data-test={`${label}-advanced-config-button-icon`} />}\n appearance=\"subtle\"\n onClick={onClick}\n />\n </StyledToolTip>\n );\n};\n\nconst AdvancedControlGroup = ({\n 'data-test': dataTest,\n children,\n isAdvanced = false,\n label,\n hideLabel,\n labelPosition,\n labelWidth,\n tooltip,\n help,\n style,\n error,\n controlsLayout,\n onClick,\n onAdvancedConfigButtonClick,\n}: AdvancedControlGroupProps): React.ReactElement => (\n <ControlGroupContainer\n data-test={dataTest ?? 'control-group'}\n label={label}\n hideLabel={hideLabel}\n labelPosition={labelPosition}\n labelWidth={labelWidth}\n tooltip={tooltip}\n help={help}\n error={error}\n style={style}\n onClick={onClick}\n controlsLayout={controlsLayout}\n >\n {isAdvanced\n ? Children.toArray(children)\n .filter(Boolean)\n .map(child =>\n cloneElement(child as ReactElement, {\n style: { flex: 1 },\n })\n )\n : children}\n {isAdvanced ? <AdvancedConfigButton label={label} onClick={onAdvancedConfigButtonClick} /> : null}\n </ControlGroupContainer>\n);\n\nAdvancedControlGroup.propTypes = {\n /**\n * Style overriding SUI ControlGroup\n */\n style: T.object,\n /**\n * Whether the current editor is enabled with advanced configurations\n */\n isAdvanced: T.bool,\n /**\n * Callback for editor click\n */\n onClick: T.func,\n /**\n * Callback for advanced config button click\n */\n onAdvancedConfigButtonClick: T.func,\n};\n\nexport default AdvancedControlGroup;\n","import * as React from 'react';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Message from '@splunk/react-ui/Message';\nimport Link from '@splunk/react-ui/Link';\nimport MessageContext from '@splunk/visualization-context/MessageContext';\n\nexport type CSPMessageProps = { type: 'warning' | 'error' };\n\nexport const CSPMessage = ({ type }: CSPMessageProps) => {\n const { cspMessageLink } = React.useContext(MessageContext) as Record<string, string>; // NOSONAR\n return (\n <Message appearance=\"fill\" type={type} data-test={`csp-message-${type}`}>\n {_(\n 'External image URLs must now have their domains listed in the Dashboards Trusted Domains List by working with your administrator. Alternatively, you can upload the image directly into the dashboard. '\n )}\n {cspMessageLink && (\n <Link to={cspMessageLink} openInNewContext>\n {_('Learn more')}\n </Link>\n )}\n </Message>\n );\n};\n","import styled from 'styled-components';\n\nexport const MessageContainer = styled.div`\n margin-top: 10px;\n`;\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@splunk/react-icons/Cross\");","module.exports = require(\"@splunk/react-icons/SlidersDoubleHorizontal\");","module.exports = require(\"@splunk/react-ui/Button\");","module.exports = require(\"@splunk/react-ui/ControlGroup\");","module.exports = require(\"@splunk/react-ui/Link\");","module.exports = require(\"@splunk/react-ui/Message\");","module.exports = require(\"@splunk/react-ui/Text\");","module.exports = require(\"@splunk/react-ui/Tooltip\");","module.exports = require(\"@splunk/themes\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-context/FeatureFlagContext\");","module.exports = require(\"@splunk/visualization-context/MessageContext\");","module.exports = require(\"lodash\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"styled-components\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@splunk/visualization-context/ImageContext\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@splunk/react-ui/Image\");","import React, { Component } from 'react';\nimport T from 'prop-types';\nimport styled from 'styled-components';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Message from '@splunk/react-ui/Message';\nimport Text from '@splunk/react-ui/Text';\nimport ImageFileReader from '@splunk/react-ui/Image';\nimport FeatureFlagContext from '@splunk/visualization-context/FeatureFlagContext';\nimport { memoize } from 'lodash';\nimport { CSPMessage } from '../shared/CSPMessage';\n\nconst EditorContainer = styled.div`\n padding-bottom: 5px;\n width: 100%;\n text-align: center;\n`;\n\nconst textStyle = { marginBottom: 10 };\nconst imageFileReaderStyle = { width: '100%' };\nconst SharingWarning = styled.span`\n font-size: smaller;\n font-style: italic;\n`;\n\nexport const warningText = _(\n 'Note: Uploaded image files can be accessed and deleted by others in your organization'\n);\n\nexport const calculateAllowedImageFileTypes = memoize(\n (mediaTypes, enableSVGImageUpload) => {\n const allowedImageFileTypes = mediaTypes.slice();\n if (enableSVGImageUpload) {\n if (allowedImageFileTypes.indexOf('svg') === -1) {\n allowedImageFileTypes.push('svg');\n }\n } else {\n // if enableSVGImageUpload is set to false, then remove the svg upload capability\n const index = allowedImageFileTypes.indexOf('svg');\n if (index > -1) {\n allowedImageFileTypes.splice(index, 1);\n }\n }\n return allowedImageFileTypes;\n },\n (mediaTypes, enableSVGImageUpload) => `${enableSVGImageUpload}-${mediaTypes.join('-')}`\n);\n\nclass UploadImageEditor extends Component {\n static contextType = FeatureFlagContext;\n\n constructor(props) {\n super(props);\n this.state = {\n urlValue: '',\n validUrl: true,\n violationType: 'none',\n };\n\n // Reference to rendered SUI input clear button\n this.inputRef = React.createRef();\n }\n\n componentDidMount() {\n document.addEventListener('securitypolicyviolation', this.violationHandler);\n }\n\n componentWillUnmount() {\n document.removeEventListener('securitypolicyviolation', this.violationHandler);\n\n if (this.inputRef.current) {\n this.inputRef.current.removeEventListener('focusout', this.handleBlur);\n }\n }\n\n violationHandler = e => {\n if (\n (e.blockedURI === this.state.urlValue || e.blockedURI === `${this.state.urlValue}/`) &&\n e.disposition === 'enforce'\n ) {\n this.setState({\n violationType: 'error',\n });\n } else if (\n (e.blockedURI === this.state.urlValue || e.blockedURI === `${this.state.urlValue}/`) &&\n e.disposition === 'report'\n ) {\n this.setState({\n violationType: 'warning',\n });\n }\n };\n\n /**\n * Executes and passes the url to the callback function, handleImageUpload(), if the image url is valid, else sets the boolean validURL to false\n * @method checkImage\n * @param {String} src\n */\n checkImage = src => {\n if (!src) {\n return;\n }\n const img = new Image();\n img.onload = () => {\n this.props.handleImageUpload({ src });\n };\n img.onerror = () => {\n // Only set validUrl=false when there's a URL value in state\n this.setState(state => (!state.urlValue ? undefined : { validUrl: false }));\n };\n img.src = src;\n };\n\n /**\n * Callback to update text box value (url) on change\n * @method handleURLChange\n * @param {String} value\n * @param {Object} e\n */\n handleURLChange = (e, { value }) => {\n this.setState({\n urlValue: value,\n validUrl: true,\n violationType: 'none',\n });\n };\n\n /**\n * Checks if text key down is 'enter' and calls checkImage() accordingly\n * @method handleTextKeyDown\n * @param {Object} e\n */\n handleTextKeyDown = e => {\n if (e.key === 'Enter') {\n e.preventDefault();\n this.checkImage(this.state.urlValue);\n }\n };\n\n handleBlur = event => {\n // If the element taking focus from the input is in the input tree\n // then it's probably the clear button\n if (this.inputRef.current?.contains(event.relatedTarget)) {\n return;\n }\n\n this.checkImage(this.state.urlValue);\n };\n\n // Custom ref/event listener for the Text input because SUI uses a blur event\n // which doesn't bubble. By using focusout the event will bubble and the clear\n // button can prevent checking for an image while it has focus but doesn't\n // block the check if a user tabs through the button\n trackInputRef = element => {\n this.inputRef.current = element;\n if (element) {\n element.addEventListener('focusout', this.handleBlur);\n }\n };\n\n /**\n * Executes and passes the filename+dataURI to the callback function, handleImageUpload()\n * @method handleOnImageChange\n * @param {Object} {filename, dataURI}\n */\n handleOnImageChange = ({ filename, imageDataURI }) => {\n if (filename && imageDataURI) {\n this.props.handleImageUpload({ filename, imageDataURI });\n } else {\n this.props.handleImageUpload({ filename: null, imageDataURI: null });\n }\n };\n\n render() {\n const {\n enableImageFileUpload,\n enableSVGImageUpload,\n enableSvgHttpDownloader,\n enableGallerySharingWarning,\n } = this.context || {};\n const allowedImageFileTypes = calculateAllowedImageFileTypes(\n this.props.validImageTypes,\n enableSVGImageUpload\n );\n\n // 1. allowedImageFileTypes does not have svg, show URL Input Field\n // 2. allowedImageFileTypes has svg and svg is rendered as dom (ChoroplethSvg), then if feature flag enableSvgHttpDownloader is true, show URL Input Field\n // 3. allowedImageFileTypes has svg and svg is not rendered as dom but with <img> (Image Viz), show URL Input Field\n\n const shouldShowURLField =\n allowedImageFileTypes.indexOf('svg') < 0 ||\n (this.props.svgRenderAsDom &&\n allowedImageFileTypes.indexOf('svg') > -1 &&\n enableSvgHttpDownloader) ||\n (!this.props.svgRenderAsDom && allowedImageFileTypes.indexOf('svg') > -1);\n\n const errorMessage =\n this.state.violationType !== 'none' ? (\n <CSPMessage type={this.state.violationType} />\n ) : (\n <Message appearance=\"fill\" type=\"error\">\n {_(\"We can't find an image with this URL. Please enter a new URL.\")}\n </Message>\n );\n return (\n <EditorContainer>\n {shouldShowURLField && (\n <Text\n canClear\n value={this.state.urlValue}\n onChange={this.handleURLChange}\n onKeyDown={this.handleTextKeyDown}\n style={textStyle}\n elementRef={this.trackInputRef}\n />\n )}\n {this.state.validUrl\n ? enableImageFileUpload && (\n <React.Fragment>\n <ImageFileReader\n style={imageFileReaderStyle}\n defaultFilename={null}\n defaultImageDataURI={null}\n onImageChange={this.handleOnImageChange}\n allowExtensions={allowedImageFileTypes}\n />\n {enableGallerySharingWarning && (\n <SharingWarning data-test=\"gallery-sharing-warning\">\n {warningText}\n </SharingWarning>\n )}\n </React.Fragment>\n )\n : errorMessage}\n </EditorContainer>\n );\n }\n}\n\nUploadImageEditor.propTypes = {\n handleImageUpload: T.func,\n validImageTypes: T.array,\n svgRenderAsDom: T.bool,\n};\n\nUploadImageEditor.defaultProps = {\n handleImageUpload: () => {},\n validImageTypes: ['gif', 'jpeg', 'jpg', 'png', 'webp'],\n svgRenderAsDom: false,\n};\n\nexport default UploadImageEditor;\n","import React from 'react';\nimport styled from 'styled-components';\nimport T from 'prop-types';\nimport { noop } from 'lodash';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Cross from '@splunk/react-icons/Cross';\nimport Button from '@splunk/react-ui/Button';\nimport { variables, mixins } from '@splunk/themes';\nimport { useCSPViolationObserver } from '../hooks/useCSPViolationObserver';\nimport { CSPMessage } from '../shared/CSPMessage';\nimport { MessageContainer } from '../shared/MessageContainer';\n\nconst RemoveButtonIcon = <Cross />;\n\nconst ImageUrlReaderContainer = styled.div`\n width: 100%;\n padding-bottom: 5px;\n`;\n\nconst StyledImagePreview = styled.div`\n border: 1px solid ${variables.borderColor};\n position: relative;\n min-height: 30px;\n height: auto;\n`;\n\nconst StyledTitleContainer = styled.div`\n background-color: ${variables.backgroundColorPage};\n color: ${variables.contentColorDefault};\n opacity: 0.9;\n position: absolute;\n width: 100%;\n min-height: 30px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n`;\n\nconst StyledTitle = styled.div`\n margin-left: ${variables.spacingMedium};\n overflow: hidden;\n text-align: start;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nconst StyledRemoveButton = styled(Button).attrs({\n 'data-test': 'image-remove-button',\n})`\n flex-grow: 0;\n color: ${variables.contentColorActive} !important;\n &:hover {\n background-color: ${variables.actionColorBackgroundSecondaryHover} !important;\n }\n`;\n\nconst StyledImageThumbnail = styled.img`\n ${mixins.reset('block')};\n margin: 0 auto;\n max-width: 100%;\n max-height: 180px;\n`;\n\nconst ImageThumbnail = ({\n filename = null,\n imageDataURI = null,\n onImageRemove = noop,\n overrideCSPViolation,\n}) => {\n const violationType = useCSPViolationObserver(imageDataURI, overrideCSPViolation);\n\n return (\n <ImageUrlReaderContainer>\n <StyledImagePreview>\n <StyledTitleContainer>\n <StyledTitle>{filename}</StyledTitle>\n <StyledRemoveButton\n aria-label={_('Remove image')}\n appearance=\"subtle\"\n icon={RemoveButtonIcon}\n onClick={onImageRemove}\n />\n </StyledTitleContainer>\n <StyledImageThumbnail alt={filename} src={imageDataURI} />\n </StyledImagePreview>\n {violationType !== 'none' && (\n <MessageContainer>\n <CSPMessage type={violationType} />\n </MessageContainer>\n )}\n </ImageUrlReaderContainer>\n );\n};\n\nImageThumbnail.propTypes = {\n filename: T.string,\n imageDataURI: T.string,\n onImageRemove: T.func,\n overrideCSPViolation: T.string,\n};\n\nexport default ImageThumbnail;\n","import React, { useContext, useEffect, useCallback, useState } from 'react';\nimport T from 'prop-types';\nimport ImageContext from '@splunk/visualization-context/ImageContext';\nimport ControlGroup from '../shared/AdvancedControlGroup';\nimport UploadImageEditor from '../components/UploadImageEditor';\nimport ImageThumbnail from '../components/ImageThumbnail';\n\nconst getImageData = async (registry, value) => {\n if (registry?.isResourceURL(value)) {\n return registry.getByURL(value);\n }\n return { dataURI: value, metaData: { name: value } };\n};\n\nconst ImageEditor = ({\n onChange,\n name,\n value,\n labelPosition = 'top',\n labelWidth,\n label,\n validMediaTypes,\n svgRenderAsDom,\n overrideCSPViolation,\n}) => {\n const imageRegistry = useContext(ImageContext);\n const [dataUri, setDataUri] = useState(null);\n const [fileName, setFileName] = useState(null);\n\n const uploadImage = useCallback(\n async (file, imageDataUri) => {\n try {\n const imageId = await imageRegistry.upload(\n imageDataUri,\n { name: file },\n null,\n validMediaTypes\n );\n onChange(null, name, imageId);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.warn(error);\n }\n },\n [imageRegistry, validMediaTypes, onChange, name]\n );\n\n const handleUpload = useCallback(\n ({ src, filename: file, imageDataURI }) => {\n if (src) {\n return onChange(null, name, src);\n }\n\n if (file !== null && imageDataURI !== null) {\n return uploadImage(file, imageDataURI);\n }\n\n return onChange(null, name, null);\n },\n [uploadImage, onChange, name]\n );\n\n const handleRemove = useCallback(event => onChange(event, name, null), [onChange, name]);\n\n useEffect(() => {\n const populateData = async () => {\n if (value) {\n const obj = await getImageData(imageRegistry, value);\n\n setDataUri(obj.dataURI);\n setFileName(obj.metaData.name);\n }\n };\n\n populateData();\n }, [value, imageRegistry]);\n\n return (\n <ControlGroup label={label} labelPosition={labelPosition} labelWidth={labelWidth}>\n {value ? (\n <ImageThumbnail\n filename={fileName}\n imageDataURI={dataUri}\n onImageRemove={handleRemove}\n overrideCSPViolation={overrideCSPViolation}\n />\n ) : (\n <UploadImageEditor\n svgRenderAsDom={svgRenderAsDom}\n validImageTypes={validMediaTypes}\n handleImageUpload={handleUpload}\n />\n )}\n </ControlGroup>\n );\n};\n\nImageEditor.propTypes = {\n /**\n * Callback when changing the text value\n *\n * @param {SyntheticEvent} event The react `SyntheticEvent`\n * @param {string} name The option name\n * @param {string} value The option value\n */\n onChange: T.func.isRequired,\n /**\n * The option name\n */\n name: T.string.isRequired,\n /**\n * A human readable label for the option\n */\n label: T.string.isRequired,\n /**\n * The option value\n */\n value: T.string,\n /**\n * Label position\n */\n labelPosition: T.oneOf(['top', 'left']),\n labelWidth: T.number,\n /**\n * The valid media type\n */\n validMediaTypes: T.array,\n /**\n * Boolean to indicate if svg render in domNode directly\n */\n svgRenderAsDom: T.bool,\n /**\n * Simulate CSP Violation\n */\n overrideCSPViolation: T.string,\n};\n\nexport default ImageEditor;\n"],"names":["useCSPViolationObserver","src","defaultValue","violation","setViolation","useState","useEffect","violationHandler","e","blockedURI","disposition","document","addEventListener","removeEventListener","ControlGroupContainer","variables","spacingMedium","StyledToolTip","StyledAdvancedConfigButton","contentColorActive","interactiveColorOverlayDrag","AdvancedConfigButton","label","onClick","content","_","icon","appearance","AdvancedControlGroup","dataTest","children","isAdvanced","hideLabel","labelPosition","labelWidth","tooltip","help","style","error","controlsLayout","onAdvancedConfigButtonClick","Children","toArray","filter","Boolean","map","child","cloneElement","flex","propTypes","T","object","bool","func","CSPMessage","type","cspMessageLink","React","useContext","to","openInNewContext","MessageContainer","div","module","exports","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","call","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","value","EditorContainer","styled","textStyle","marginBottom","imageFileReaderStyle","width","SharingWarning","warningText","calculateAllowedImageFileTypes","memoize","mediaTypes","enableSVGImageUpload","allowedImageFileTypes","slice","indexOf","push","index","splice","join","UploadImageEditor","Component","constructor","props","super","_defineProperty","this","state","urlValue","setState","violationType","img","Image","onload","handleImageUpload","onerror","validUrl","preventDefault","checkImage","event","_this$inputRef$curren","inputRef","current","contains","relatedTarget","element","handleBlur","filename","imageDataURI","componentDidMount","componentWillUnmount","render","enableImageFileUpload","enableSvgHttpDownloader","enableGallerySharingWarning","context","validImageTypes","shouldShowURLField","svgRenderAsDom","errorMessage","Message","Text","canClear","onChange","handleURLChange","onKeyDown","handleTextKeyDown","elementRef","trackInputRef","ImageFileReader","defaultFilename","defaultImageDataURI","onImageChange","handleOnImageChange","allowExtensions","FeatureFlagContext","defaultProps","RemoveButtonIcon","Cross","ImageUrlReaderContainer","StyledImagePreview","borderColor","StyledTitleContainer","backgroundColorPage","contentColorDefault","StyledTitle","StyledRemoveButton","Button","attrs","actionColorBackgroundSecondaryHover","StyledImageThumbnail","mixins","reset","ImageThumbnail","onImageRemove","noop","overrideCSPViolation","alt","ImageEditor","name","validMediaTypes","imageRegistry","ImageContext","dataUri","setDataUri","fileName","setFileName","uploadImage","useCallback","async","file","imageDataUri","imageId","upload","console","warn","handleUpload","handleRemove","registry","isResourceURL","getByURL","dataURI","metaData","getImageData","populateData","ControlGroup","isRequired"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"ImageEditor.js","mappings":";;;;6EAAA,gBA0BS,EAAAA,wBAtBuB,CAACC,EAAaC,EAA8B,UACxE,MAAOC,EAAWC,IAAgB,IAAAC,UAAwBH,GAkB1D,OAjBA,IAAAI,YAAU,KACN,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Db2H,CAAatB,EAAerG,GAE9CwG,EAAW/G,EAAIgI,SACff,EAAYjH,EAAIiI,SAASvB,KAC7B,GAGJyB,EAAc,GACf,CAAC5H,EAAOqG,IAGPxI,IAAAA,cAACgK,IAAY,CAACnM,MAAOA,EAAOW,cAAeA,EAAeC,WAAYA,GACjE0D,EACGnC,IAAAA,cAACgI,EAAc,CACX9C,SAAU0D,EACVzD,aAAcuD,EACdT,cAAeuB,EACfrB,qBAAsBA,IAG1BnI,IAAAA,cAACuD,EAAiB,CACdsC,eAAgBA,EAChBF,gBAAiB4C,EACjBlE,kBAAmBkF,IAGhB,EAIvBlB,EAAY7I,UAAY,CAQpB0G,SAAUzG,IAAAA,KAAOwK,WAIjB3B,KAAM7I,IAAAA,OAASwK,WAIfpM,MAAO4B,IAAAA,OAASwK,WAIhB9H,MAAO1C,IAAAA,OAIPjB,cAAeiB,IAAAA,MAAQ,CAAC,MAAO,SAC/BhB,WAAYgB,IAAAA,OAIZ8I,gBAAiB9I,IAAAA,MAIjBoG,eAAgBpG,IAAAA,KAIhB0I,qBAAsB1I,IAAAA,QAG1B,S","sources":["webpack://@splunk/dynamic-editors/./src/hooks/useCSPViolationObserver.tsx","webpack://@splunk/dynamic-editors/./src/shared/AdvancedControlGroup.tsx","webpack://@splunk/dynamic-editors/./src/shared/CSPMessage.tsx","webpack://@splunk/dynamic-editors/./src/shared/MessageContainer.tsx","webpack://@splunk/dynamic-editors/external commonjs2 \"@babel/runtime/helpers/defineProperty\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-icons/Cross\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-icons/SlidersDoubleHorizontal\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Button\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/ControlGroup\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Link\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Message\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Text\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Tooltip\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/themes\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/ui-utils/i18n\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-context/FeatureFlagContext\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-context/MessageContext\"","webpack://@splunk/dynamic-editors/external commonjs2 \"lodash\"","webpack://@splunk/dynamic-editors/external commonjs2 \"prop-types\"","webpack://@splunk/dynamic-editors/external commonjs2 \"react\"","webpack://@splunk/dynamic-editors/external commonjs2 \"styled-components\"","webpack://@splunk/dynamic-editors/webpack/bootstrap","webpack://@splunk/dynamic-editors/webpack/runtime/compat get default export","webpack://@splunk/dynamic-editors/webpack/runtime/define property getters","webpack://@splunk/dynamic-editors/webpack/runtime/hasOwnProperty shorthand","webpack://@splunk/dynamic-editors/webpack/runtime/make namespace object","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-context/ImageContext\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Image\"","webpack://@splunk/dynamic-editors/./src/components/UploadImageEditor.jsx","webpack://@splunk/dynamic-editors/./src/components/ImageThumbnail.jsx","webpack://@splunk/dynamic-editors/./src/editors/ImageEditor.jsx"],"sourcesContent":["import { useState, useEffect } from 'react';\n\ntype ViolationType = 'error' | 'warning' | 'none';\n\nconst useCSPViolationObserver = (src: string, defaultValue: ViolationType = 'none'): ViolationType => {\n const [violation, setViolation] = useState<ViolationType>(defaultValue);\n useEffect(() => {\n const violationHandler = e => {\n if ((e.blockedURI === src || e.blockedURI === `${src}/`) && e.disposition === 'enforce') {\n // the second src condition is required as Chrome rewrites\n // URLs without query parameters (e.g. foo.com -> foo.com/ )\n setViolation('error');\n } else if ((e.blockedURI === src || e.blockedURI === `${src}/`) && e.disposition === 'report') {\n setViolation('warning');\n }\n };\n document.addEventListener('securitypolicyviolation', violationHandler);\n setViolation(defaultValue);\n return () => {\n document.removeEventListener('securitypolicyviolation', violationHandler);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [src]);\n return violation;\n};\n\nexport { useCSPViolationObserver };\n","import React, { Children, cloneElement } from 'react';\nimport type { ReactElement } from 'react';\nimport * as T from 'prop-types';\nimport styled from 'styled-components';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport AdvancedConfigIcon from '@splunk/react-icons/SlidersDoubleHorizontal';\nimport { variables } from '@splunk/themes';\nimport Tooltip from '@splunk/react-ui/Tooltip';\nimport type { ButtonClickHandler, ButtonProps } from '@splunk/react-ui/Button';\nimport Button from '@splunk/react-ui/Button';\nimport SUIControlGroup from '@splunk/react-ui/ControlGroup';\nimport type { ControlGroupPropsBase } from '@splunk/react-ui/ControlGroup';\n\ninterface AdvancedControlGroupProps extends Omit<ControlGroupPropsBase, 'splunkTheme'> {\n 'data-test'?: string;\n style?: Record<string, string | number>;\n isAdvanced?: boolean;\n onClick?: React.MouseEventHandler<HTMLDivElement>;\n onAdvancedConfigButtonClick?: ButtonClickHandler;\n}\n\ninterface AdvancedConfigButtonProps {\n label?: string;\n onClick?: ButtonClickHandler;\n}\n\n// remove all surrounding margins. let parent add padding\nconst ControlGroupContainer = styled(SUIControlGroup)`\n margin-top: 0;\n padding: 0;\n // adjust bottom margin according to theme\n margin-bottom: ${variables.spacingMedium};\n width: 100%;\n\n // remove top margin of the first component in control group\n &:first-child {\n margin-top: 0;\n }\n\n // remove bottom margin of the last component in control group\n &:last-child {\n margin-bottom: 0;\n }\n // remove top padding on label of the first control group\n [data-test='label']:first-of-type {\n padding-top: 0;\n }\n`;\n\n// override tooltip to set desired config button style\nconst StyledToolTip = styled(Tooltip)`\n display: flex;\n > span {\n display: flex;\n width: 35px;\n }\n`;\n\nconst StyledAdvancedConfigButton = styled(Button)<ButtonProps>`\n color: ${variables.contentColorActive} !important;\n &:hover {\n background-color: ${variables.interactiveColorOverlayDrag} !important;\n }\n`;\n\nexport const AdvancedConfigButton = ({\n label = '',\n onClick,\n}: AdvancedConfigButtonProps): React.ReactElement => {\n return (\n <StyledToolTip\n data-test={`${label}-advanced-config-button-tooltip`}\n content={_('Advanced configurations')}\n >\n <StyledAdvancedConfigButton\n data-test={`${label}-advanced-config-button`}\n icon={<AdvancedConfigIcon data-test={`${label}-advanced-config-button-icon`} />}\n appearance=\"subtle\"\n onClick={onClick}\n />\n </StyledToolTip>\n );\n};\n\nconst AdvancedControlGroup = ({\n 'data-test': dataTest,\n children,\n isAdvanced = false,\n label,\n hideLabel,\n labelPosition,\n labelWidth,\n tooltip,\n help,\n style,\n error,\n controlsLayout,\n onClick,\n onAdvancedConfigButtonClick,\n}: AdvancedControlGroupProps): React.ReactElement => (\n <ControlGroupContainer\n data-test={dataTest ?? 'control-group'}\n label={label}\n hideLabel={hideLabel}\n labelPosition={labelPosition}\n labelWidth={labelWidth}\n tooltip={tooltip}\n help={help}\n error={error}\n style={style}\n onClick={onClick}\n controlsLayout={controlsLayout}\n >\n {isAdvanced\n ? Children.toArray(children)\n .filter(Boolean)\n .map(child =>\n cloneElement(child as ReactElement, {\n style: { flex: 1 },\n })\n )\n : children}\n {isAdvanced ? <AdvancedConfigButton label={label} onClick={onAdvancedConfigButtonClick} /> : null}\n </ControlGroupContainer>\n);\n\nAdvancedControlGroup.propTypes = {\n /**\n * Style overriding SUI ControlGroup\n */\n style: T.object,\n /**\n * Whether the current editor is enabled with advanced configurations\n */\n isAdvanced: T.bool,\n /**\n * Callback for editor click\n */\n onClick: T.func,\n /**\n * Callback for advanced config button click\n */\n onAdvancedConfigButtonClick: T.func,\n};\n\nexport default AdvancedControlGroup;\n","import * as React from 'react';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Message from '@splunk/react-ui/Message';\nimport Link from '@splunk/react-ui/Link';\nimport MessageContext from '@splunk/visualization-context/MessageContext';\n\nexport type CSPMessageProps = { type: 'warning' | 'error' };\n\nexport const CSPMessage = ({ type }: CSPMessageProps) => {\n const { cspMessageLink } = React.useContext(MessageContext) as Record<string, string>; // NOSONAR\n return (\n <Message appearance=\"fill\" type={type} data-test={`csp-message-${type}`}>\n {_(\n 'External image URLs must now have their domains listed in the Dashboards Trusted Domains List by working with your administrator. Alternatively, you can upload the image directly into the dashboard. '\n )}\n {cspMessageLink && (\n <Link to={cspMessageLink} openInNewContext>\n {_('Learn more')}\n </Link>\n )}\n </Message>\n );\n};\n","import styled from 'styled-components';\n\nexport const MessageContainer = styled.div`\n margin-top: 10px;\n`;\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@splunk/react-icons/Cross\");","module.exports = require(\"@splunk/react-icons/SlidersDoubleHorizontal\");","module.exports = require(\"@splunk/react-ui/Button\");","module.exports = require(\"@splunk/react-ui/ControlGroup\");","module.exports = require(\"@splunk/react-ui/Link\");","module.exports = require(\"@splunk/react-ui/Message\");","module.exports = require(\"@splunk/react-ui/Text\");","module.exports = require(\"@splunk/react-ui/Tooltip\");","module.exports = require(\"@splunk/themes\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-context/FeatureFlagContext\");","module.exports = require(\"@splunk/visualization-context/MessageContext\");","module.exports = require(\"lodash\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"styled-components\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@splunk/visualization-context/ImageContext\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@splunk/react-ui/Image\");","import React, { Component } from 'react';\nimport T from 'prop-types';\nimport styled from 'styled-components';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Message from '@splunk/react-ui/Message';\nimport Text from '@splunk/react-ui/Text';\nimport ImageFileReader from '@splunk/react-ui/Image';\nimport FeatureFlagContext from '@splunk/visualization-context/FeatureFlagContext';\nimport { memoize } from 'lodash';\nimport { CSPMessage } from '../shared/CSPMessage';\n\nconst EditorContainer = styled.div`\n padding-bottom: 5px;\n width: 100%;\n text-align: center;\n`;\n\nconst textStyle = { marginBottom: 10 };\nconst imageFileReaderStyle = { width: '100%' };\nconst SharingWarning = styled.span`\n font-size: smaller;\n font-style: italic;\n`;\n\nexport const warningText = _(\n 'Note: Uploaded image files can be accessed and deleted by others in your organization'\n);\n\nexport const calculateAllowedImageFileTypes = memoize(\n (mediaTypes, enableSVGImageUpload) => {\n const allowedImageFileTypes = mediaTypes.slice();\n if (enableSVGImageUpload) {\n if (allowedImageFileTypes.indexOf('svg') === -1) {\n allowedImageFileTypes.push('svg');\n }\n } else {\n // if enableSVGImageUpload is set to false, then remove the svg upload capability\n const index = allowedImageFileTypes.indexOf('svg');\n if (index > -1) {\n allowedImageFileTypes.splice(index, 1);\n }\n }\n return allowedImageFileTypes;\n },\n (mediaTypes, enableSVGImageUpload) => `${enableSVGImageUpload}-${mediaTypes.join('-')}`\n);\n\nclass UploadImageEditor extends Component {\n static contextType = FeatureFlagContext;\n\n constructor(props) {\n super(props);\n this.state = {\n urlValue: '',\n validUrl: true,\n violationType: 'none',\n };\n\n // Reference to rendered SUI input clear button\n this.inputRef = React.createRef();\n }\n\n componentDidMount() {\n document.addEventListener('securitypolicyviolation', this.violationHandler);\n }\n\n componentWillUnmount() {\n document.removeEventListener('securitypolicyviolation', this.violationHandler);\n\n if (this.inputRef.current) {\n this.inputRef.current.removeEventListener('focusout', this.handleBlur);\n }\n }\n\n violationHandler = e => {\n if (\n (e.blockedURI === this.state.urlValue || e.blockedURI === `${this.state.urlValue}/`) &&\n e.disposition === 'enforce'\n ) {\n this.setState({\n violationType: 'error',\n });\n } else if (\n (e.blockedURI === this.state.urlValue || e.blockedURI === `${this.state.urlValue}/`) &&\n e.disposition === 'report'\n ) {\n this.setState({\n violationType: 'warning',\n });\n }\n };\n\n /**\n * Executes and passes the url to the callback function, handleImageUpload(), if the image url is valid, else sets the boolean validURL to false\n * @method checkImage\n * @param {String} src\n */\n checkImage = src => {\n if (!src) {\n return;\n }\n const img = new Image();\n img.onload = () => {\n this.props.handleImageUpload({ src });\n };\n img.onerror = () => {\n // Only set validUrl=false when there's a URL value in state\n this.setState(state => (!state.urlValue ? undefined : { validUrl: false }));\n };\n img.src = src;\n };\n\n /**\n * Callback to update text box value (url) on change\n * @method handleURLChange\n * @param {String} value\n * @param {Object} e\n */\n handleURLChange = (e, { value }) => {\n this.setState({\n urlValue: value,\n validUrl: true,\n violationType: 'none',\n });\n };\n\n /**\n * Checks if text key down is 'enter' and calls checkImage() accordingly\n * @method handleTextKeyDown\n * @param {Object} e\n */\n handleTextKeyDown = e => {\n if (e.key === 'Enter') {\n e.preventDefault();\n this.checkImage(this.state.urlValue);\n }\n };\n\n handleBlur = event => {\n // If the element taking focus from the input is in the input tree\n // then it's probably the clear button\n if (this.inputRef.current?.contains(event.relatedTarget)) {\n return;\n }\n\n this.checkImage(this.state.urlValue);\n };\n\n // Custom ref/event listener for the Text input because SUI uses a blur event\n // which doesn't bubble. By using focusout the event will bubble and the clear\n // button can prevent checking for an image while it has focus but doesn't\n // block the check if a user tabs through the button\n trackInputRef = element => {\n this.inputRef.current = element;\n if (element) {\n element.addEventListener('focusout', this.handleBlur);\n }\n };\n\n /**\n * Executes and passes the filename+dataURI to the callback function, handleImageUpload()\n * @method handleOnImageChange\n * @param {Object} {filename, dataURI}\n */\n handleOnImageChange = ({ filename, imageDataURI }) => {\n if (filename && imageDataURI) {\n this.props.handleImageUpload({ filename, imageDataURI });\n } else {\n this.props.handleImageUpload({ filename: null, imageDataURI: null });\n }\n };\n\n render() {\n const {\n enableImageFileUpload,\n enableSVGImageUpload,\n enableSvgHttpDownloader,\n enableGallerySharingWarning,\n } = this.context || {};\n const allowedImageFileTypes = calculateAllowedImageFileTypes(\n this.props.validImageTypes,\n enableSVGImageUpload\n );\n\n // 1. allowedImageFileTypes does not have svg, show URL Input Field\n // 2. allowedImageFileTypes has svg and svg is rendered as dom (ChoroplethSvg), then if feature flag enableSvgHttpDownloader is true, show URL Input Field\n // 3. allowedImageFileTypes has svg and svg is not rendered as dom but with <img> (Image Viz), show URL Input Field\n\n const shouldShowURLField =\n allowedImageFileTypes.indexOf('svg') < 0 ||\n (this.props.svgRenderAsDom &&\n allowedImageFileTypes.indexOf('svg') > -1 &&\n enableSvgHttpDownloader) ||\n (!this.props.svgRenderAsDom && allowedImageFileTypes.indexOf('svg') > -1);\n\n const errorMessage =\n this.state.violationType !== 'none' ? (\n <CSPMessage type={this.state.violationType} />\n ) : (\n <Message appearance=\"fill\" type=\"error\">\n {_(\"We can't find an image with this URL. Please enter a new URL.\")}\n </Message>\n );\n return (\n <EditorContainer>\n {shouldShowURLField && (\n <Text\n canClear\n value={this.state.urlValue}\n onChange={this.handleURLChange}\n onKeyDown={this.handleTextKeyDown}\n style={textStyle}\n elementRef={this.trackInputRef}\n />\n )}\n {this.state.validUrl\n ? enableImageFileUpload && (\n <React.Fragment>\n <ImageFileReader\n style={imageFileReaderStyle}\n defaultFilename={null}\n defaultImageDataURI={null}\n onImageChange={this.handleOnImageChange}\n allowExtensions={allowedImageFileTypes}\n />\n {enableGallerySharingWarning && (\n <SharingWarning data-test=\"gallery-sharing-warning\">\n {warningText}\n </SharingWarning>\n )}\n </React.Fragment>\n )\n : errorMessage}\n </EditorContainer>\n );\n }\n}\n\nUploadImageEditor.propTypes = {\n handleImageUpload: T.func,\n validImageTypes: T.array,\n svgRenderAsDom: T.bool,\n};\n\nUploadImageEditor.defaultProps = {\n handleImageUpload: () => {},\n validImageTypes: ['gif', 'jpeg', 'jpg', 'png', 'webp'],\n svgRenderAsDom: false,\n};\n\nexport default UploadImageEditor;\n","import React from 'react';\nimport styled from 'styled-components';\nimport T from 'prop-types';\nimport { noop } from 'lodash';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Cross from '@splunk/react-icons/Cross';\nimport Button from '@splunk/react-ui/Button';\nimport { variables, mixins } from '@splunk/themes';\nimport { useCSPViolationObserver } from '../hooks/useCSPViolationObserver';\nimport { CSPMessage } from '../shared/CSPMessage';\nimport { MessageContainer } from '../shared/MessageContainer';\n\nconst RemoveButtonIcon = <Cross />;\n\nconst ImageUrlReaderContainer = styled.div`\n width: 100%;\n padding-bottom: 5px;\n`;\n\nconst StyledImagePreview = styled.div`\n border: 1px solid ${variables.borderColor};\n position: relative;\n min-height: 30px;\n height: auto;\n`;\n\nconst StyledTitleContainer = styled.div`\n background-color: ${variables.backgroundColorPage};\n color: ${variables.contentColorDefault};\n opacity: 0.9;\n position: absolute;\n width: 100%;\n min-height: 30px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n`;\n\nconst StyledTitle = styled.div`\n margin-left: ${variables.spacingMedium};\n overflow: hidden;\n text-align: start;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nconst StyledRemoveButton = styled(Button).attrs({\n 'data-test': 'image-remove-button',\n})`\n flex-grow: 0;\n color: ${variables.contentColorActive} !important;\n &:hover {\n background-color: ${variables.actionColorBackgroundSecondaryHover} !important;\n }\n`;\n\nconst StyledImageThumbnail = styled.img`\n ${mixins.reset('block')};\n margin: 0 auto;\n max-width: 100%;\n max-height: 180px;\n`;\n\nconst ImageThumbnail = ({\n filename = null,\n imageDataURI = null,\n onImageRemove = noop,\n overrideCSPViolation,\n}) => {\n const violationType = useCSPViolationObserver(imageDataURI, overrideCSPViolation);\n\n return (\n <ImageUrlReaderContainer>\n <StyledImagePreview>\n <StyledTitleContainer>\n <StyledTitle>{filename}</StyledTitle>\n <StyledRemoveButton\n aria-label={_('Remove image')}\n appearance=\"subtle\"\n icon={RemoveButtonIcon}\n onClick={onImageRemove}\n />\n </StyledTitleContainer>\n <StyledImageThumbnail alt={filename} src={imageDataURI} />\n </StyledImagePreview>\n {violationType !== 'none' && (\n <MessageContainer>\n <CSPMessage type={violationType} />\n </MessageContainer>\n )}\n </ImageUrlReaderContainer>\n );\n};\n\nImageThumbnail.propTypes = {\n filename: T.string,\n imageDataURI: T.string,\n onImageRemove: T.func,\n overrideCSPViolation: T.string,\n};\n\nexport default ImageThumbnail;\n","import React, { useContext, useEffect, useCallback, useState } from 'react';\nimport T from 'prop-types';\nimport ImageContext from '@splunk/visualization-context/ImageContext';\nimport ControlGroup from '../shared/AdvancedControlGroup';\nimport UploadImageEditor from '../components/UploadImageEditor';\nimport ImageThumbnail from '../components/ImageThumbnail';\n\nconst getImageData = async (registry, value) => {\n if (registry?.isResourceURL(value)) {\n return registry.getByURL(value);\n }\n return { dataURI: value, metaData: { name: value } };\n};\n\nconst ImageEditor = ({\n onChange,\n name,\n value,\n labelPosition = 'top',\n labelWidth,\n label,\n validMediaTypes,\n svgRenderAsDom,\n overrideCSPViolation,\n}) => {\n const imageRegistry = useContext(ImageContext);\n const [dataUri, setDataUri] = useState(null);\n const [fileName, setFileName] = useState(null);\n\n const uploadImage = useCallback(\n async (file, imageDataUri) => {\n try {\n const imageId = await imageRegistry.upload(\n imageDataUri,\n { name: file },\n null,\n validMediaTypes\n );\n onChange(null, name, imageId);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.warn(error);\n }\n },\n [imageRegistry, validMediaTypes, onChange, name]\n );\n\n const handleUpload = useCallback(\n ({ src, filename: file, imageDataURI }) => {\n if (src) {\n return onChange(null, name, src);\n }\n\n if (file !== null && imageDataURI !== null) {\n return uploadImage(file, imageDataURI);\n }\n\n return onChange(null, name, null);\n },\n [uploadImage, onChange, name]\n );\n\n const handleRemove = useCallback(event => onChange(event, name, null), [onChange, name]);\n\n useEffect(() => {\n const populateData = async () => {\n if (value) {\n const obj = await getImageData(imageRegistry, value);\n\n setDataUri(obj.dataURI);\n setFileName(obj.metaData.name);\n }\n };\n\n populateData();\n }, [value, imageRegistry]);\n\n return (\n <ControlGroup label={label} labelPosition={labelPosition} labelWidth={labelWidth}>\n {value ? (\n <ImageThumbnail\n filename={fileName}\n imageDataURI={dataUri}\n onImageRemove={handleRemove}\n overrideCSPViolation={overrideCSPViolation}\n />\n ) : (\n <UploadImageEditor\n svgRenderAsDom={svgRenderAsDom}\n validImageTypes={validMediaTypes}\n handleImageUpload={handleUpload}\n />\n )}\n </ControlGroup>\n );\n};\n\nImageEditor.propTypes = {\n /**\n * Callback when changing the text value\n *\n * @param {SyntheticEvent} event The react `SyntheticEvent`\n * @param {string} name The option name\n * @param {string} value The option value\n */\n onChange: T.func.isRequired,\n /**\n * The option name\n */\n name: T.string.isRequired,\n /**\n * A human readable label for the option\n */\n label: T.string.isRequired,\n /**\n * The option value\n */\n value: T.string,\n /**\n * Label position\n */\n labelPosition: T.oneOf(['top', 'left']),\n labelWidth: T.number,\n /**\n * The valid media type\n */\n validMediaTypes: T.array,\n /**\n * Boolean to indicate if svg render in domNode directly\n */\n svgRenderAsDom: T.bool,\n /**\n * Simulate CSP Violation\n */\n overrideCSPViolation: T.string,\n};\n\nexport default ImageEditor;\n"],"names":["useCSPViolationObserver","src","defaultValue","violation","setViolation","useState","useEffect","violationHandler","e","blockedURI","disposition","document","addEventListener","removeEventListener","ControlGroupContainer","variables","spacingMedium","StyledToolTip","StyledAdvancedConfigButton","contentColorActive","interactiveColorOverlayDrag","AdvancedConfigButton","label","onClick","content","_","icon","appearance","AdvancedControlGroup","dataTest","children","isAdvanced","hideLabel","labelPosition","labelWidth","tooltip","help","style","error","controlsLayout","onAdvancedConfigButtonClick","Children","toArray","filter","Boolean","map","child","cloneElement","flex","propTypes","T","object","bool","func","CSPMessage","type","cspMessageLink","React","useContext","to","openInNewContext","MessageContainer","div","module","exports","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","call","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","value","EditorContainer","styled","textStyle","marginBottom","imageFileReaderStyle","width","SharingWarning","warningText","calculateAllowedImageFileTypes","memoize","mediaTypes","enableSVGImageUpload","allowedImageFileTypes","slice","indexOf","push","index","splice","join","UploadImageEditor","Component","constructor","props","super","_defineProperty","this","state","urlValue","setState","violationType","img","Image","onload","handleImageUpload","onerror","validUrl","preventDefault","checkImage","event","_this$inputRef$curren","inputRef","current","contains","relatedTarget","element","handleBlur","filename","imageDataURI","componentDidMount","componentWillUnmount","render","enableImageFileUpload","enableSvgHttpDownloader","enableGallerySharingWarning","context","validImageTypes","shouldShowURLField","svgRenderAsDom","errorMessage","Message","Text","canClear","onChange","handleURLChange","onKeyDown","handleTextKeyDown","elementRef","trackInputRef","ImageFileReader","defaultFilename","defaultImageDataURI","onImageChange","handleOnImageChange","allowExtensions","FeatureFlagContext","defaultProps","RemoveButtonIcon","Cross","ImageUrlReaderContainer","StyledImagePreview","borderColor","StyledTitleContainer","backgroundColorPage","contentColorDefault","StyledTitle","StyledRemoveButton","Button","attrs","actionColorBackgroundSecondaryHover","StyledImageThumbnail","mixins","reset","ImageThumbnail","onImageRemove","noop","overrideCSPViolation","alt","ImageEditor","name","validMediaTypes","imageRegistry","ImageContext","dataUri","setDataUri","fileName","setFileName","uploadImage","useCallback","async","file","imageDataUri","imageId","upload","console","warn","handleUpload","handleRemove","registry","isResourceURL","getByURL","dataURI","metaData","getImageData","populateData","ControlGroup","isRequired"],"sourceRoot":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiColorPickerEditor.js","mappings":";;;;iNAAA,MAAM,EAA+BA,QAAQ,wC,aCA7C,MAAM,EAA+BA,QAAQ,gD,iCCc7C,MAAMC,EAAgBC,IAAAA,GAAU;kBACdC,EAAAA,UAAUC;;;EAQtBC,EAAaH,IAAOI,IAAK;kBACbH,EAAAA,UAAUC;EAUtBG,EAAWA,EAAGC,QAAOC,eAAcC,gBACrC,MAAMC,EAA4B,iBAAVH,EAAqBA,EAAMI,OAASJ,EAG5D,OAAIK,EAAAA,EAAAA,SAAQF,IAA0B,OAAbA,EACdA,GAGPE,EAAAA,EAAAA,SAAQJ,GACDA,GAGPI,EAAAA,EAAAA,SAAQH,IAA4B,OAAdA,EACfA,EAGJ,aAAa,EAGlBI,EAAsBA,EACxBC,KACAC,gBACAR,QACAS,UACAC,oBACAC,aACAC,YACAC,QACAC,OACAC,wBACAC,iBACAC,aACAC,iBAEA,MAAMC,GAAcC,EAAAA,EAAAA,UAAQ,KAAMC,EAAAA,EAAAA,aAAY,eAAe,IAE7D,OACIC,IAAAA,cAAAA,IAAAA,SAAA,KACIA,IAAAA,cAAA,WACIA,IAAAA,cAACC,IAAK,CACFC,IAAI,eACJC,OAAQjB,EACRK,MAAOd,EAAS,CAAEC,UAClBS,QAASA,EACTiB,SAAUhB,EACV,YAAW,gBAAgB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ed,KAAKW,EAAKC,GCClFhB,EAAoBmB,EAAKrB,IACH,oBAAXsB,QAA0BA,OAAOC,aAC1CT,OAAOC,eAAef,EAASsB,OAAOC,YAAa,CAAEtM,MAAO,WAE7D6L,OAAOC,eAAef,EAAS,aAAc,CAAE/K,OAAO,GAAO,ECF9D,IAAIuM,EAAsBtB,EAAoB,M","sources":["webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/ScreenReaderContent\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualizations-shared/colorConstants\"","webpack://@splunk/dynamic-editors/./src/editors/ColorEditor.jsx","webpack://@splunk/dynamic-editors/./src/editors/MultiColorPickerEditor.tsx","webpack://@splunk/dynamic-editors/./src/interfaces/BaseEditorProps.ts","webpack://@splunk/dynamic-editors/./src/shared/AdvancedControlGroup.tsx","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-icons/SlidersDoubleHorizontal\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Button\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Color\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/ControlGroup\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/FormRows\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Popover\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Text\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Tooltip\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/themes\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/themes/variables\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/ui-utils/i18n\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/ui-utils/id\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-color-palettes\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualizations-shared/colorUtils\"","webpack://@splunk/dynamic-editors/external commonjs2 \"lodash\"","webpack://@splunk/dynamic-editors/external commonjs2 \"prop-types\"","webpack://@splunk/dynamic-editors/external commonjs2 \"react\"","webpack://@splunk/dynamic-editors/external commonjs2 \"styled-components\"","webpack://@splunk/dynamic-editors/webpack/bootstrap","webpack://@splunk/dynamic-editors/webpack/runtime/compat get default export","webpack://@splunk/dynamic-editors/webpack/runtime/define property getters","webpack://@splunk/dynamic-editors/webpack/runtime/hasOwnProperty shorthand","webpack://@splunk/dynamic-editors/webpack/runtime/make namespace object","webpack://@splunk/dynamic-editors/webpack/startup"],"sourcesContent":["const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@splunk/react-ui/ScreenReaderContent\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@splunk/visualizations-shared/colorConstants\");","import React, { useEffect, useCallback, useState, useMemo } from 'react';\nimport T from 'prop-types';\nimport styled from 'styled-components';\nimport { debounce, noop, toLower } from 'lodash';\nimport { variables } from '@splunk/themes';\nimport Color from '@splunk/react-ui/Color';\nimport Text from '@splunk/react-ui/Text';\nimport { createDOMID } from '@splunk/ui-utils/id';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport ScreenReaderContent from '@splunk/react-ui/ScreenReaderContent';\nimport { COLOR_EDITOR_PALETTE } from '@splunk/visualizations-shared/colorConstants';\nimport { isColor } from '@splunk/visualizations-shared/colorUtils';\nimport ControlGroup from '../shared/AdvancedControlGroup';\n\nconst TextContainer = styled.div`\n max-height: ${variables.inputHeight};\n width: 100%;\n min-width: 0;\n`;\n\n// hardcoded style to sync with SUI color picker's hardcoded dimensions\n// TODO(fkurniawan): see if we can leverage prisma's consolidated textInput out of the box instead of our own component\n// right now, we're using hideInput\nconst StyledText = styled(Text)`\n max-height: ${variables.inputHeight};\n`;\n\n/**\n * Trims the color input and returns the result, or default color if the default color is valid, or previous color\n * @param {String} color The color the user entered\n * @param {String} defaultColor The default color of the component\n * @param {String} prevColor The previous color of the component\n * @returns {String}\n */\nconst getColor = ({ color, defaultColor, prevColor }) => {\n const newColor = typeof color === 'string' ? color.trim() : color;\n\n // color === null is `N/A` in color picker\n if (isColor(newColor) || newColor === null) {\n return newColor;\n }\n\n if (isColor(defaultColor)) {\n return defaultColor;\n }\n\n if (isColor(prevColor) || prevColor === null) {\n return prevColor;\n }\n\n return 'transparent';\n};\n\nconst ColorAndTextWrapper = ({\n id,\n showTextInput,\n color,\n palette,\n handleColorChange,\n labelledBy,\n textWidth,\n value,\n name,\n handleTextColorChange,\n handleKeyPress,\n handleBlur,\n isDisabled,\n}) => {\n const textLabelId = useMemo(() => createDOMID('color-code'), []);\n\n return (\n <>\n <div>\n <Color\n key=\"color-editor\"\n append={showTextInput}\n value={getColor({ color })}\n palette={palette}\n onChange={handleColorChange}\n data-test={`color-picker-${name}`}\n disabled={isDisabled}\n hideInput\n labelledBy={labelledBy}\n />\n </div>\n {showTextInput && (\n <TextContainer data-test=\"text-container\" textWidth={textWidth}>\n <ScreenReaderContent id={textLabelId}>{_('Color code input')}</ScreenReaderContent>\n <StyledText\n key={value}\n data-test={name}\n prepend\n value={color === null ? 'N/A' : color}\n onChange={handleTextColorChange}\n onKeyDown={handleKeyPress}\n onBlur={handleBlur}\n disabled={isDisabled}\n // hardcoded style to sync with SUI color picker's hardcoded dimensions\n // TODO(fkurniawan): see if we can leverage prisma's consolidated textInput out of the box\n style={{ height: '32px' }}\n labelledBy={`${labelledBy} ${textLabelId}`}\n inputId={id}\n />\n </TextContainer>\n )}\n </>\n );\n};\n\nColorAndTextWrapper.propTypes = {\n id: T.string,\n showTextInput: T.bool,\n color: T.string,\n palette: T.arrayOf(T.string),\n handleColorChange: T.func,\n labelledBy: T.string,\n textWidth: T.oneOfType([T.string, T.number]),\n value: T.string,\n name: T.string.isRequired,\n handleTextColorChange: T.func,\n handleKeyPress: T.func,\n handleBlur: T.func,\n isDisabled: T.bool,\n};\n\nconst defaultItemSchema = { default: 'transparent' };\nconst emptyStyle = {};\n\n// The propTypes typing for TS callers isn't working for the onChange callback\n/**\n * @param {Object} props\n * @param {(e: import('react').SyntheticEvent, name: string, value: string) => void} [props.onChange]\n * @returns\n */\nconst ColorEditor = ({\n name = 'color',\n value = 'transparent',\n label = '',\n labelPosition = 'top',\n labelWidth,\n palette = COLOR_EDITOR_PALETTE,\n onChange = noop,\n itemSchema = defaultItemSchema,\n isDisabled = false,\n textWidth = 'auto',\n hideLabel = false,\n showTextInput = true,\n style: customEditorStyle = emptyStyle,\n}) => {\n const [color, setColor] = useState(value);\n\n useEffect(() => {\n setColor(value);\n }, [value]);\n\n const debouncedOnChange = useMemo(() => debounce(onChange, 250), [onChange]);\n\n const handleColorChange = useCallback(\n ({ value: val }) => {\n const newColor = getColor({ color: val, defaultColor: itemSchema.default, prevColor: value });\n setColor(newColor);\n if (value !== newColor) {\n // No event to pass back, so it is null\n debouncedOnChange(null, name, newColor);\n }\n },\n [debouncedOnChange, itemSchema.default, name, value]\n );\n\n const handleTextColorChange = useCallback((_event, { value: val }) => {\n const colorToValue = toLower(val).trim() === 'n/a' ? null : val;\n setColor(colorToValue);\n }, []);\n\n const handleKeyPress = useCallback(\n event => {\n if (event.key === 'Escape') {\n setColor(value);\n return;\n }\n if (event.key !== 'Enter') {\n return;\n }\n\n if (value !== color) {\n const newColor = getColor({ color, defaultColor: itemSchema.default, prevColor: value });\n setColor(newColor);\n if (newColor !== value) {\n onChange(event, name, newColor);\n }\n }\n },\n [name, color, value, onChange, itemSchema.default]\n );\n\n const handleBlur = useCallback(\n event => {\n if (color !== value) {\n const newColor = getColor({ color, defaultColor: itemSchema.default, prevColor: value });\n setColor(newColor);\n if (newColor !== value) {\n onChange(event, name, newColor);\n }\n }\n },\n [name, color, value, onChange, itemSchema.default]\n );\n\n return (\n <ControlGroup\n label={label}\n labelPosition={labelPosition}\n labelWidth={labelWidth}\n style={customEditorStyle}\n hideLabel={hideLabel}\n controlsLayout=\"fillJoin\"\n >\n <ColorAndTextWrapper\n showTextInput={showTextInput}\n color={color}\n palette={palette}\n handleColorChange={handleColorChange}\n name={name}\n isDisabled={isDisabled}\n textWidth={textWidth}\n value={value}\n handleTextColorChange={handleTextColorChange}\n handleKeyPress={handleKeyPress}\n handleBlur={handleBlur}\n />\n </ControlGroup>\n );\n};\n\nColorEditor.propTypes = {\n /**\n * The option name\n */\n name: T.string.isRequired,\n\n /**\n * The option value\n */\n value: T.string,\n\n /**\n * @param {Object} itemSchema Either the dataContract or schema for the selected item\n */\n itemSchema: T.object,\n\n /**\n * A human readable label for the option\n */\n label: T.string.isRequired,\n\n /**\n * Flag to hide the editor label\n */\n hideLabel: T.bool,\n\n /**\n * Flag to hide the color text input\n */\n showTextInput: T.bool,\n\n /**\n * Custom styling for the editor layout, eg: setting margin-bottom to 0px for ControlGroup, SUI has it at 15px\n */\n style: T.object,\n\n /**\n * Label position\n */\n labelPosition: T.oneOf(['top', 'left']),\n\n /**\n * Label position\n */\n labelWidth: T.number,\n\n /**\n * An array of color swatch values\n */\n palette: T.arrayOf(T.string),\n\n /**\n * Callback when changing the text value\n *\n * @param {SyntheticEvent} event The react `SyntheticEvent`\n * @param {string} name The option name\n * @param {string} value The option value\n */\n onChange: T.func.isRequired,\n /**\n * Disabled state of component\n */\n isDisabled: T.bool,\n textWidth: T.oneOfType([T.string, T.number]),\n};\n\nexport default ColorEditor;\n","import React, { useState, useRef, useEffect, useCallback, useMemo } from 'react';\nimport * as T from 'prop-types';\nimport styled from 'styled-components';\nimport { noop } from 'lodash';\nimport variables from '@splunk/themes/variables';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport FormRows from '@splunk/react-ui/FormRows';\nimport { createDOMID } from '@splunk/ui-utils/id';\nimport Button from '@splunk/react-ui/Button';\nimport Popover, { PopoverRequestCloseHandler } from '@splunk/react-ui/Popover';\nimport { VIZ_CATEGORICAL } from '@splunk/visualization-color-palettes';\nimport { BaseEditorPropTypes } from '../interfaces/BaseEditorProps';\nimport type { BaseEditorProps } from '../interfaces/BaseEditorProps';\nimport ControlGroup from '../shared/AdvancedControlGroup';\nimport ColorEditor from './ColorEditor';\n\nconst popoverStyle = { padding: '10px' };\nconst colorButtonStyle = { width: '314px' };\n\nconst StyledButton = styled(Button)`\n padding: 8px;\n width: 100%;\n min-height: 40px;\n & > span {\n display: grid;\n grid-template-columns: repeat(auto-fill, 26px);\n justify-content: space-evenly;\n grid-gap: 4px;\n }\n background-color: ${variables.interactiveColorBackground};\n`;\n\nconst ColorChip = styled.div`\n width: 26px;\n height: 24px;\n background-color: ${(props): string => props.color};\n border-radius: 2px;\n`;\n\nconst StyledFlyoutContent = styled.div`\n box-sizing: border-box;\n padding: 8px;\n width: 312px;\n max-height: 484px;\n background-color: ${variables.backgroundColorPopup};\n`;\n\nconst FlyoutHeader = styled.div`\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n padding: 8px 8px 0 8px;\n font-family: ${variables.fontFamily};\n color: ${variables.contentColorActive};\n`;\n\nconst ColorListEditor = styled.div`\n height: 412px;\n overflow-y: auto;\n padding: 8px 10px;\n`;\n\nexport interface ColorFlyoutEditorProps {\n colors: string[];\n handleColorRemove: (_e, { index }: { index: number }) => void;\n handleColorChange: (idx: number) => (_evt, name: string, value: string) => void;\n CustomColorMatchEditor?: (props: { index: number }) => React.ReactNode;\n flyoutTitle: string;\n addColorButtonLabel: string;\n handleColorAdd: () => void;\n handleColorMove: (data: { fromIndex: number; toIndex: number }) => void;\n}\n\nexport const ColorFlyoutEditor = ({\n colors,\n CustomColorMatchEditor,\n handleColorRemove,\n handleColorChange,\n flyoutTitle,\n addColorButtonLabel,\n handleColorAdd,\n handleColorMove,\n}: ColorFlyoutEditorProps) => {\n const ColorRowItems = useMemo(() => {\n return colors.map((color, idx) => {\n // disable the color editor's text input when a custom input editor is available to render adjacently\n const showTextInput = CustomColorMatchEditor == null;\n return (\n <FormRows.Row\n index={idx}\n key={createDOMID()}\n data-color={color}\n onRequestRemove={handleColorRemove}\n >\n <div style={{ display: 'flex', justifyContent: 'space-between' }}>\n <ColorEditor\n value={color}\n key={createDOMID()}\n onChange={handleColorChange(idx)}\n hideLabel\n label=\" \"\n name=\"color\"\n style={{ marginBottom: 0, marginTop: 0, width: showTextInput ? '100%' : 32 }}\n showTextInput={showTextInput}\n />\n {typeof CustomColorMatchEditor === 'function' && (\n <CustomColorMatchEditor index={idx} />\n )}\n </div>\n </FormRows.Row>\n );\n });\n }, [colors, CustomColorMatchEditor, handleColorRemove, handleColorChange]);\n\n return (\n <StyledFlyoutContent data-test=\"MultiColorPickerFlyoutContent\">\n <FlyoutHeader data-test=\"MultiColorPickerFlyoutTitle\">{flyoutTitle}</FlyoutHeader>\n <ColorListEditor>\n <FormRows\n addLabel={addColorButtonLabel}\n onRequestAdd={handleColorAdd}\n onRequestMove={handleColorMove}\n data-test=\"ColorListEditor\"\n >\n {ColorRowItems}\n </FormRows>\n </ColorListEditor>\n </StyledFlyoutContent>\n );\n};\n\nexport interface MultiColorPickerEditorProps extends BaseEditorProps {\n CustomColorMatchEditor?: (props: { index: number }) => React.ReactNode;\n canReorderColors?: boolean;\n value: string[];\n flyoutTitle?: string;\n addColorButtonLabel?: string;\n hideLabel?: boolean;\n canAddNewColors?: boolean;\n}\n\nconst MultiColorPickerEditor: React.FunctionComponent<MultiColorPickerEditorProps> = ({\n CustomColorMatchEditor,\n onChange = noop,\n canReorderColors = true,\n value: vizColors = VIZ_CATEGORICAL,\n flyoutTitle = _('Customize colors'),\n addColorButtonLabel = _('Add color'),\n name = 'seriesColors',\n label = '',\n labelPosition = 'top',\n labelWidth,\n isDisabled = false,\n hideLabel = true,\n canAddNewColors = true,\n}) => {\n const [showFlyout, setShowFlyout] = useState(false);\n const [colors, setColors] = useState(vizColors);\n const buttonRef = useRef(null);\n\n useEffect(() => {\n setColors(vizColors);\n }, [vizColors]);\n\n // callbacks to add, remove, update and reorder a color form row\n const handleColorAdd = useCallback(() => {\n const userColorsSet = new Set(colors);\n let nextColor = VIZ_CATEGORICAL.find(color => !userColorsSet.has(color));\n if (!nextColor) {\n // All picked, count appearances\n const countMap = new Map<string, number>();\n VIZ_CATEGORICAL.forEach(color => countMap.set(color, 0));\n colors.forEach(color => {\n countMap.set(color, (countMap.get(color) || 0) + 1);\n });\n // Find color with minimum appearances\n let minCount = Infinity;\n VIZ_CATEGORICAL.forEach(color => {\n const count = countMap.get(color) || 0;\n if (count < minCount) {\n minCount = count;\n nextColor = color;\n }\n });\n }\n onChange(null, name, [...colors, nextColor]);\n }, [name, onChange, colors]);\n\n const handleColorChange = useCallback(\n idx => (_evt, _name, value) => {\n const colorsCopy = [...colors];\n colorsCopy.splice(idx, 1, value);\n onChange(null, name, colorsCopy);\n },\n [name, onChange, colors]\n );\n\n const handleColorRemove = useCallback(\n (e, { index }) => {\n const colorsCopy = [...colors];\n colorsCopy.splice(index, 1);\n onChange(null, name, colorsCopy);\n },\n [name, onChange, colors]\n );\n\n const handleColorMove = useCallback(\n ({ fromIndex, toIndex }) => {\n const colorsCopy = [...colors];\n const movedColor = colorsCopy[fromIndex];\n colorsCopy.splice(fromIndex, 1); // first, delete the color at the original position\n colorsCopy.splice(toIndex, 0, movedColor); // then reinsert it at the new position\n onChange(null, name, colorsCopy);\n },\n [name, onChange, colors]\n );\n\n /**\n * custom logic is required for closing the flyout as the FormRows component is rendered inside a Popover, and\n * when we sort the form rows, the popover closes mid-sorting (closeReason=\"clickAway\") as the dragged element is\n * taken out of the flow. Current workaround is to check if the event's source element has a sortable handle,\n * if yes, the flyout is kept open.\n *\n * Additionally, focus is returned to the trigger button when exiting through escape key press\n */\n const handleFlyoutClose: PopoverRequestCloseHandler = useCallback(({ event, reason }) => {\n // @ts-ignore\n if (!event?.srcElement?.sortableHandle) {\n setShowFlyout(false);\n }\n if (reason === 'escapeKey') {\n buttonRef.current.focus();\n }\n }, []);\n\n const ColorChips = useMemo(\n () => colors.map(color => <ColorChip color={color} key={createDOMID()} />),\n [colors]\n );\n\n const toggleShowFlyout = useCallback(() => {\n setShowFlyout(isShown => !isShown);\n }, []);\n\n return (\n <ControlGroup\n label={label}\n labelPosition={labelPosition}\n labelWidth={labelWidth}\n hideLabel={hideLabel}\n data-test=\"MultiColorPickerEditor\"\n >\n <StyledButton\n inline={false}\n data-test=\"MultiColorPickerButton\"\n appearance=\"default\"\n ref={buttonRef}\n onClick={toggleShowFlyout}\n disabled={isDisabled}\n style={colorButtonStyle}\n >\n {ColorChips}\n </StyledButton>\n <Popover\n data-test=\"MultiColorPickerFlyout\"\n open={showFlyout}\n anchor={buttonRef.current}\n defaultPlacement=\"horizontal\"\n style={popoverStyle}\n onRequestClose={handleFlyoutClose}\n takeFocus\n >\n <ColorFlyoutEditor\n colors={colors}\n CustomColorMatchEditor={CustomColorMatchEditor}\n handleColorRemove={handleColorRemove}\n handleColorChange={handleColorChange}\n handleColorAdd={canAddNewColors ? handleColorAdd : undefined}\n handleColorMove={canReorderColors ? handleColorMove : undefined}\n flyoutTitle={flyoutTitle}\n addColorButtonLabel={addColorButtonLabel}\n />\n </Popover>\n </ControlGroup>\n );\n};\n\nMultiColorPickerEditor.propTypes = {\n ...BaseEditorPropTypes,\n /**\n * Colors can be reordered manually\n */\n canReorderColors: T.bool,\n /**\n * Can add a new color\n */\n canAddNewColors: T.bool,\n /**\n * List of colors\n */\n value: T.arrayOf(T.string),\n /**\n * Title of the flyout editor\n */\n flyoutTitle: T.string,\n /**\n * Button label for adding a new color row\n */\n addColorButtonLabel: T.string,\n /**\n * Custom input editor for mapping a value to color, eg: dropdown for field -> color\n */\n CustomColorMatchEditor: T.func,\n /**\n * Flag to hide the editor label\n */\n hideLabel: T.bool,\n};\n\nexport default MultiColorPickerEditor;\n","import * as T from 'prop-types';\nimport type { JSONSchema7 } from 'json-schema';\n\nexport interface BaseEditorProps {\n name: string;\n value: any;\n onChange?: (...args: any[]) => void;\n label?: string; // @TODO(pwied): this should not live in editor props\n labelPosition?: 'top' | 'left'; // ^^^\n context?: Record<string, any>;\n labelWidth?: number;\n isAdvanced?: boolean;\n isDisabled?: boolean;\n dataSourceBindings?: Record<string, any>;\n options?: { [k: string]: any };\n optionsSchema?: {\n [key: string]: JSONSchema7;\n };\n}\n\nexport const BaseEditorPropTypes: Record<keyof BaseEditorProps, T.Validator<any>> = {\n name: T.string.isRequired,\n value: T.oneOfType([T.string, T.object, T.arrayOf(T.string)]),\n context: T.object,\n label: T.string,\n labelPosition: T.oneOf(['top', 'left']),\n labelWidth: T.number,\n onChange: T.func,\n isAdvanced: T.bool,\n isDisabled: T.bool,\n dataSourceBindings: T.object,\n options: T.object,\n optionsSchema: T.object,\n};\n","import React, { Children, cloneElement } from 'react';\nimport type { ReactElement } from 'react';\nimport * as T from 'prop-types';\nimport styled from 'styled-components';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport AdvancedConfigIcon from '@splunk/react-icons/SlidersDoubleHorizontal';\nimport { variables } from '@splunk/themes';\nimport Tooltip from '@splunk/react-ui/Tooltip';\nimport Button, { ButtonClickHandler, ButtonProps } from '@splunk/react-ui/Button';\nimport SUIControlGroup from '@splunk/react-ui/ControlGroup';\nimport type { ControlGroupPropsBase } from '@splunk/react-ui/ControlGroup';\n\ninterface AdvancedControlGroupProps extends Omit<ControlGroupPropsBase, 'splunkTheme'> {\n 'data-test'?: string;\n style?: Record<string, string | number>;\n isAdvanced?: boolean;\n onClick?: React.MouseEventHandler<HTMLDivElement>;\n onAdvancedConfigButtonClick?: ButtonClickHandler;\n}\n\ninterface AdvancedConfigButtonProps {\n label?: string;\n onClick?: ButtonClickHandler;\n}\n\n// remove all surrounding margins. let parent add padding\nconst ControlGroupContainer = styled(SUIControlGroup)`\n margin-top: 0;\n padding: 0;\n // adjust bottom margin according to theme\n margin-bottom: ${variables.spacingMedium};\n width: 100%;\n\n // remove top margin of the first component in control group\n &:first-child {\n margin-top: 0;\n }\n\n // remove bottom margin of the last component in control group\n &:last-child {\n margin-bottom: 0;\n }\n // remove top padding on label of the first control group\n [data-test='label']:first-of-type {\n padding-top: 0;\n }\n`;\n\n// override tooltip to set desired config button style\nconst StyledToolTip = styled(Tooltip)`\n display: flex;\n > span {\n display: flex;\n width: 35px;\n }\n`;\n\nconst StyledAdvancedConfigButton = styled(Button)<ButtonProps>`\n color: ${variables.contentColorActive} !important;\n &:hover {\n background-color: ${variables.interactiveColorOverlayDrag} !important;\n }\n`;\n\nexport const AdvancedConfigButton = ({\n label = '',\n onClick,\n}: AdvancedConfigButtonProps): React.ReactElement => {\n return (\n <StyledToolTip\n data-test={`${label}-advanced-config-button-tooltip`}\n content={_('Advanced configurations')}\n >\n <StyledAdvancedConfigButton\n data-test={`${label}-advanced-config-button`}\n icon={<AdvancedConfigIcon data-test={`${label}-advanced-config-button-icon`} />}\n appearance=\"subtle\"\n onClick={onClick}\n />\n </StyledToolTip>\n );\n};\n\nconst AdvancedControlGroup = ({\n 'data-test': dataTest,\n children,\n isAdvanced = false,\n label,\n hideLabel,\n labelPosition,\n labelWidth,\n tooltip,\n help,\n style,\n error,\n controlsLayout,\n onClick,\n onAdvancedConfigButtonClick,\n}: AdvancedControlGroupProps): React.ReactElement => (\n <ControlGroupContainer\n data-test={dataTest ?? 'control-group'}\n label={label}\n hideLabel={hideLabel}\n labelPosition={labelPosition}\n labelWidth={labelWidth}\n tooltip={tooltip}\n help={help}\n error={error}\n style={style}\n onClick={onClick}\n controlsLayout={controlsLayout}\n >\n {isAdvanced\n ? Children.toArray(children)\n .filter(Boolean)\n .map(child =>\n cloneElement(child as ReactElement, {\n style: { flex: 1 },\n })\n )\n : children}\n {isAdvanced ? <AdvancedConfigButton label={label} onClick={onAdvancedConfigButtonClick} /> : null}\n </ControlGroupContainer>\n);\n\nAdvancedControlGroup.propTypes = {\n /**\n * Style overriding SUI ControlGroup\n */\n style: T.object,\n /**\n * Whether the current editor is enabled with advanced configurations\n */\n isAdvanced: T.bool,\n /**\n * Callback for editor click\n */\n onClick: T.func,\n /**\n * Callback for advanced config button click\n */\n onAdvancedConfigButtonClick: T.func,\n};\n\nexport default AdvancedControlGroup;\n","module.exports = require(\"@splunk/react-icons/SlidersDoubleHorizontal\");","module.exports = require(\"@splunk/react-ui/Button\");","module.exports = require(\"@splunk/react-ui/Color\");","module.exports = require(\"@splunk/react-ui/ControlGroup\");","module.exports = require(\"@splunk/react-ui/FormRows\");","module.exports = require(\"@splunk/react-ui/Popover\");","module.exports = require(\"@splunk/react-ui/Text\");","module.exports = require(\"@splunk/react-ui/Tooltip\");","module.exports = require(\"@splunk/themes\");","module.exports = require(\"@splunk/themes/variables\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/ui-utils/id\");","module.exports = require(\"@splunk/visualization-color-palettes\");","module.exports = require(\"@splunk/visualizations-shared/colorUtils\");","module.exports = require(\"lodash\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"styled-components\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(2965);\n"],"names":["require","TextContainer","styled","variables","inputHeight","StyledText","Text","getColor","color","defaultColor","prevColor","newColor","trim","isColor","ColorAndTextWrapper","id","showTextInput","palette","handleColorChange","labelledBy","textWidth","value","name","handleTextColorChange","handleKeyPress","handleBlur","isDisabled","textLabelId","useMemo","createDOMID","React","Color","key","append","onChange","disabled","hideInput","ScreenReaderContent","_","prepend","onKeyDown","onBlur","style","height","inputId","propTypes","T","isRequired","defaultItemSchema","default","emptyStyle","ColorEditor","label","labelPosition","labelWidth","COLOR_EDITOR_PALETTE","noop","itemSchema","hideLabel","customEditorStyle","setColor","useState","useEffect","debouncedOnChange","debounce","useCallback","val","_event","colorToValue","toLower","event","ControlGroup","controlsLayout","popoverStyle","padding","colorButtonStyle","width","StyledButton","interactiveColorBackground","ColorChip","div","props","StyledFlyoutContent","backgroundColorPopup","FlyoutHeader","fontFamily","contentColorActive","ColorListEditor","ColorFlyoutEditor","colors","CustomColorMatchEditor","handleColorRemove","flyoutTitle","addColorButtonLabel","handleColorAdd","handleColorMove","ColorRowItems","map","idx","Row","index","onRequestRemove","display","justifyContent","marginBottom","marginTop","addLabel","onRequestAdd","onRequestMove","MultiColorPickerEditor","canReorderColors","vizColors","VIZ_CATEGORICAL","canAddNewColors","showFlyout","setShowFlyout","setColors","buttonRef","useRef","userColorsSet","Set","nextColor","find","has","countMap","Map","forEach","set","get","minCount","Infinity","count","_evt","_name","colorsCopy","splice","e","fromIndex","toIndex","movedColor","handleFlyoutClose","reason","srcElement","sortableHandle","current","focus","ColorChips","toggleShowFlyout","isShown","inline","appearance","ref","onClick","open","anchor","defaultPlacement","onRequestClose","takeFocus","undefined","BaseEditorPropTypes","bool","arrayOf","string","func","oneOfType","object","context","oneOf","number","isAdvanced","dataSourceBindings","options","optionsSchema","ControlGroupContainer","spacingMedium","StyledToolTip","StyledAdvancedConfigButton","interactiveColorOverlayDrag","AdvancedConfigButton","content","icon","AdvancedControlGroup","dataTest","children","tooltip","help","error","onAdvancedConfigButtonClick","Children","toArray","filter","Boolean","child","cloneElement","flex","module","exports","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","call","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","__webpack_exports__"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"MultiColorPickerEditor.js","mappings":";;;;iNAAA,MAAM,EAA+BA,QAAQ,wC,aCA7C,MAAM,EAA+BA,QAAQ,gD,iCCc7C,MAAMC,EAAgBC,IAAAA,GAAU;kBACdC,EAAAA,UAAUC;;;EAQtBC,EAAaH,IAAOI,IAAK;kBACbH,EAAAA,UAAUC;EAUtBG,EAAWA,EAAGC,QAAOC,eAAcC,gBACrC,MAAMC,EAA4B,iBAAVH,EAAqBA,EAAMI,OAASJ,EAG5D,OAAIK,EAAAA,EAAAA,SAAQF,IAA0B,OAAbA,EACdA,GAGPE,EAAAA,EAAAA,SAAQJ,GACDA,GAGPI,EAAAA,EAAAA,SAAQH,IAA4B,OAAdA,EACfA,EAGJ,aAAa,EAGlBI,EAAsBA,EACxBC,KACAC,gBACAR,QACAS,UACAC,oBACAC,aACAC,YACAC,QACAC,OACAC,wBACAC,iBACAC,aACAC,iBAEA,MAAMC,GAAcC,EAAAA,EAAAA,UAAQ,KAAMC,EAAAA,EAAAA,aAAY,eAAe,IAE7D,OACIC,IAAAA,cAAAA,IAAAA,SAAA,KACIA,IAAAA,cAAA,WACIA,IAAAA,cAACC,IAAK,CACFC,IAAI,eACJC,OAAQjB,EACRK,MAAOd,EAAS,CAAEC,UAClBS,QAASA,EACTiB,SAAUhB,EACV,YAAW,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KC,IAAUJ,OAAOK,UAAUC,eAAed,KAAKW,EAAKC,GCClFhB,EAAoBmB,EAAKrB,IACH,oBAAXsB,QAA0BA,OAAOC,aAC1CT,OAAOC,eAAef,EAASsB,OAAOC,YAAa,CAAEvM,MAAO,WAE7D8L,OAAOC,eAAef,EAAS,aAAc,CAAEhL,OAAO,GAAO,ECF9D,IAAIwM,EAAsBtB,EAAoB,M","sources":["webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/ScreenReaderContent\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualizations-shared/colorConstants\"","webpack://@splunk/dynamic-editors/./src/editors/ColorEditor.jsx","webpack://@splunk/dynamic-editors/./src/editors/MultiColorPickerEditor.tsx","webpack://@splunk/dynamic-editors/./src/interfaces/BaseEditorProps.ts","webpack://@splunk/dynamic-editors/./src/shared/AdvancedControlGroup.tsx","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-icons/SlidersDoubleHorizontal\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Button\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Color\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/ControlGroup\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/FormRows\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Popover\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Text\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/react-ui/Tooltip\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/themes\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/themes/variables\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/ui-utils/i18n\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/ui-utils/id\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-color-palettes\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualizations-shared/colorUtils\"","webpack://@splunk/dynamic-editors/external commonjs2 \"lodash\"","webpack://@splunk/dynamic-editors/external commonjs2 \"prop-types\"","webpack://@splunk/dynamic-editors/external commonjs2 \"react\"","webpack://@splunk/dynamic-editors/external commonjs2 \"styled-components\"","webpack://@splunk/dynamic-editors/webpack/bootstrap","webpack://@splunk/dynamic-editors/webpack/runtime/compat get default export","webpack://@splunk/dynamic-editors/webpack/runtime/define property getters","webpack://@splunk/dynamic-editors/webpack/runtime/hasOwnProperty shorthand","webpack://@splunk/dynamic-editors/webpack/runtime/make namespace object","webpack://@splunk/dynamic-editors/webpack/startup"],"sourcesContent":["const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@splunk/react-ui/ScreenReaderContent\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@splunk/visualizations-shared/colorConstants\");","import React, { useEffect, useCallback, useState, useMemo } from 'react';\nimport T from 'prop-types';\nimport styled from 'styled-components';\nimport { debounce, noop, toLower } from 'lodash';\nimport { variables } from '@splunk/themes';\nimport Color from '@splunk/react-ui/Color';\nimport Text from '@splunk/react-ui/Text';\nimport { createDOMID } from '@splunk/ui-utils/id';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport ScreenReaderContent from '@splunk/react-ui/ScreenReaderContent';\nimport { COLOR_EDITOR_PALETTE } from '@splunk/visualizations-shared/colorConstants';\nimport { isColor } from '@splunk/visualizations-shared/colorUtils';\nimport ControlGroup from '../shared/AdvancedControlGroup';\n\nconst TextContainer = styled.div`\n max-height: ${variables.inputHeight};\n width: 100%;\n min-width: 0;\n`;\n\n// hardcoded style to sync with SUI color picker's hardcoded dimensions\n// TODO(fkurniawan): see if we can leverage prisma's consolidated textInput out of the box instead of our own component\n// right now, we're using hideInput\nconst StyledText = styled(Text)`\n max-height: ${variables.inputHeight};\n`;\n\n/**\n * Trims the color input and returns the result, or default color if the default color is valid, or previous color\n * @param {String} color The color the user entered\n * @param {String} defaultColor The default color of the component\n * @param {String} prevColor The previous color of the component\n * @returns {String}\n */\nconst getColor = ({ color, defaultColor, prevColor }) => {\n const newColor = typeof color === 'string' ? color.trim() : color;\n\n // color === null is `N/A` in color picker\n if (isColor(newColor) || newColor === null) {\n return newColor;\n }\n\n if (isColor(defaultColor)) {\n return defaultColor;\n }\n\n if (isColor(prevColor) || prevColor === null) {\n return prevColor;\n }\n\n return 'transparent';\n};\n\nconst ColorAndTextWrapper = ({\n id,\n showTextInput,\n color,\n palette,\n handleColorChange,\n labelledBy,\n textWidth,\n value,\n name,\n handleTextColorChange,\n handleKeyPress,\n handleBlur,\n isDisabled,\n}) => {\n const textLabelId = useMemo(() => createDOMID('color-code'), []);\n\n return (\n <>\n <div>\n <Color\n key=\"color-editor\"\n append={showTextInput}\n value={getColor({ color })}\n palette={palette}\n onChange={handleColorChange}\n data-test={`color-picker-${name}`}\n disabled={isDisabled}\n hideInput\n labelledBy={labelledBy}\n />\n </div>\n {showTextInput && (\n <TextContainer data-test=\"text-container\" textWidth={textWidth}>\n <ScreenReaderContent id={textLabelId}>{_('Color code input')}</ScreenReaderContent>\n <StyledText\n key={value}\n data-test={name}\n prepend\n value={color === null ? 'N/A' : color}\n onChange={handleTextColorChange}\n onKeyDown={handleKeyPress}\n onBlur={handleBlur}\n disabled={isDisabled}\n // hardcoded style to sync with SUI color picker's hardcoded dimensions\n // TODO(fkurniawan): see if we can leverage prisma's consolidated textInput out of the box\n style={{ height: '32px' }}\n labelledBy={`${labelledBy} ${textLabelId}`}\n inputId={id}\n />\n </TextContainer>\n )}\n </>\n );\n};\n\nColorAndTextWrapper.propTypes = {\n id: T.string,\n showTextInput: T.bool,\n color: T.string,\n palette: T.arrayOf(T.string),\n handleColorChange: T.func,\n labelledBy: T.string,\n textWidth: T.oneOfType([T.string, T.number]),\n value: T.string,\n name: T.string.isRequired,\n handleTextColorChange: T.func,\n handleKeyPress: T.func,\n handleBlur: T.func,\n isDisabled: T.bool,\n};\n\nconst defaultItemSchema = { default: 'transparent' };\nconst emptyStyle = {};\n\n// The propTypes typing for TS callers isn't working for the onChange callback\n/**\n * @param {Object} props\n * @param {(e: import('react').SyntheticEvent, name: string, value: string) => void} [props.onChange]\n * @returns\n */\nconst ColorEditor = ({\n name = 'color',\n value = 'transparent',\n label = '',\n labelPosition = 'top',\n labelWidth,\n palette = COLOR_EDITOR_PALETTE,\n onChange = noop,\n itemSchema = defaultItemSchema,\n isDisabled = false,\n textWidth = 'auto',\n hideLabel = false,\n showTextInput = true,\n style: customEditorStyle = emptyStyle,\n}) => {\n const [color, setColor] = useState(value);\n\n useEffect(() => {\n setColor(value);\n }, [value]);\n\n const debouncedOnChange = useMemo(() => debounce(onChange, 250), [onChange]);\n\n const handleColorChange = useCallback(\n ({ value: val }) => {\n const newColor = getColor({ color: val, defaultColor: itemSchema.default, prevColor: value });\n setColor(newColor);\n if (value !== newColor) {\n // No event to pass back, so it is null\n debouncedOnChange(null, name, newColor);\n }\n },\n [debouncedOnChange, itemSchema.default, name, value]\n );\n\n const handleTextColorChange = useCallback((_event, { value: val }) => {\n const colorToValue = toLower(val).trim() === 'n/a' ? null : val;\n setColor(colorToValue);\n }, []);\n\n const handleKeyPress = useCallback(\n event => {\n if (event.key === 'Escape') {\n setColor(value);\n return;\n }\n if (event.key !== 'Enter') {\n return;\n }\n\n if (value !== color) {\n const newColor = getColor({ color, defaultColor: itemSchema.default, prevColor: value });\n setColor(newColor);\n if (newColor !== value) {\n onChange(event, name, newColor);\n }\n }\n },\n [name, color, value, onChange, itemSchema.default]\n );\n\n const handleBlur = useCallback(\n event => {\n if (color !== value) {\n const newColor = getColor({ color, defaultColor: itemSchema.default, prevColor: value });\n setColor(newColor);\n if (newColor !== value) {\n onChange(event, name, newColor);\n }\n }\n },\n [name, color, value, onChange, itemSchema.default]\n );\n\n return (\n <ControlGroup\n label={label}\n labelPosition={labelPosition}\n labelWidth={labelWidth}\n style={customEditorStyle}\n hideLabel={hideLabel}\n controlsLayout=\"fillJoin\"\n >\n <ColorAndTextWrapper\n showTextInput={showTextInput}\n color={color}\n palette={palette}\n handleColorChange={handleColorChange}\n name={name}\n isDisabled={isDisabled}\n textWidth={textWidth}\n value={value}\n handleTextColorChange={handleTextColorChange}\n handleKeyPress={handleKeyPress}\n handleBlur={handleBlur}\n />\n </ControlGroup>\n );\n};\n\nColorEditor.propTypes = {\n /**\n * The option name\n */\n name: T.string.isRequired,\n\n /**\n * The option value\n */\n value: T.string,\n\n /**\n * @param {Object} itemSchema Either the dataContract or schema for the selected item\n */\n itemSchema: T.object,\n\n /**\n * A human readable label for the option\n */\n label: T.string.isRequired,\n\n /**\n * Flag to hide the editor label\n */\n hideLabel: T.bool,\n\n /**\n * Flag to hide the color text input\n */\n showTextInput: T.bool,\n\n /**\n * Custom styling for the editor layout, eg: setting margin-bottom to 0px for ControlGroup, SUI has it at 15px\n */\n style: T.object,\n\n /**\n * Label position\n */\n labelPosition: T.oneOf(['top', 'left']),\n\n /**\n * Label position\n */\n labelWidth: T.number,\n\n /**\n * An array of color swatch values\n */\n palette: T.arrayOf(T.string),\n\n /**\n * Callback when changing the text value\n *\n * @param {SyntheticEvent} event The react `SyntheticEvent`\n * @param {string} name The option name\n * @param {string} value The option value\n */\n onChange: T.func.isRequired,\n /**\n * Disabled state of component\n */\n isDisabled: T.bool,\n textWidth: T.oneOfType([T.string, T.number]),\n};\n\nexport default ColorEditor;\n","import React, { useState, useRef, useEffect, useCallback, useMemo } from 'react';\nimport * as T from 'prop-types';\nimport styled from 'styled-components';\nimport { noop } from 'lodash';\nimport variables from '@splunk/themes/variables';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport FormRows from '@splunk/react-ui/FormRows';\nimport { createDOMID } from '@splunk/ui-utils/id';\nimport Button from '@splunk/react-ui/Button';\nimport type { PopoverRequestCloseHandler } from '@splunk/react-ui/Popover';\nimport Popover from '@splunk/react-ui/Popover';\nimport { VIZ_CATEGORICAL } from '@splunk/visualization-color-palettes';\nimport { BaseEditorPropTypes } from '../interfaces/BaseEditorProps';\nimport type { BaseEditorProps } from '../interfaces/BaseEditorProps';\nimport ControlGroup from '../shared/AdvancedControlGroup';\nimport ColorEditor from './ColorEditor';\n\nconst popoverStyle = { padding: '10px' };\nconst colorButtonStyle = { width: '314px' };\n\nconst StyledButton = styled(Button)`\n padding: 8px;\n width: 100%;\n min-height: 40px;\n & > span {\n display: grid;\n grid-template-columns: repeat(auto-fill, 26px);\n justify-content: space-evenly;\n grid-gap: 4px;\n }\n background-color: ${variables.interactiveColorBackground};\n`;\n\nconst ColorChip = styled.div`\n width: 26px;\n height: 24px;\n background-color: ${(props): string => props.color};\n border-radius: 2px;\n border: 1px solid ${variables.neutral100};\n`;\n\nconst StyledFlyoutContent = styled.div`\n box-sizing: border-box;\n padding: 8px;\n width: 312px;\n max-height: 484px;\n background-color: ${variables.backgroundColorPopup};\n`;\n\nconst FlyoutHeader = styled.div`\n font-weight: 500;\n font-size: 14px;\n line-height: 20px;\n padding: 8px 8px 0 8px;\n font-family: ${variables.fontFamily};\n color: ${variables.contentColorActive};\n`;\n\nconst ColorListEditor = styled.div`\n height: 412px;\n overflow-y: auto;\n padding: 8px 10px;\n`;\n\nexport interface ColorFlyoutEditorProps {\n colors: string[];\n handleColorRemove: (_e, { index }: { index: number }) => void;\n handleColorChange: (idx: number) => (_evt, name: string, value: string) => void;\n CustomColorMatchEditor?: (props: { index: number }) => React.ReactNode;\n flyoutTitle: string;\n addColorButtonLabel: string;\n handleColorAdd: () => void;\n handleColorMove: (data: { fromIndex: number; toIndex: number }) => void;\n}\n\nexport const ColorFlyoutEditor = ({\n colors,\n CustomColorMatchEditor,\n handleColorRemove,\n handleColorChange,\n flyoutTitle,\n addColorButtonLabel,\n handleColorAdd,\n handleColorMove,\n}: ColorFlyoutEditorProps) => {\n const ColorRowItems = useMemo(() => {\n return colors.map((color, idx) => {\n // disable the color editor's text input when a custom input editor is available to render adjacently\n const showTextInput = CustomColorMatchEditor == null;\n return (\n <FormRows.Row\n index={idx}\n key={createDOMID()}\n data-color={color}\n onRequestRemove={handleColorRemove}\n >\n <div style={{ display: 'flex', justifyContent: 'space-between' }}>\n <ColorEditor\n value={color}\n key={createDOMID()}\n onChange={handleColorChange(idx)}\n hideLabel\n label=\" \"\n name=\"color\"\n style={{ marginBottom: 0, marginTop: 0, width: showTextInput ? '100%' : 32 }}\n showTextInput={showTextInput}\n />\n {typeof CustomColorMatchEditor === 'function' && (\n <CustomColorMatchEditor index={idx} />\n )}\n </div>\n </FormRows.Row>\n );\n });\n }, [colors, CustomColorMatchEditor, handleColorRemove, handleColorChange]);\n\n return (\n <StyledFlyoutContent data-test=\"MultiColorPickerFlyoutContent\">\n <FlyoutHeader data-test=\"MultiColorPickerFlyoutTitle\">{flyoutTitle}</FlyoutHeader>\n <ColorListEditor>\n <FormRows\n addLabel={addColorButtonLabel}\n onRequestAdd={handleColorAdd}\n onRequestMove={handleColorMove}\n data-test=\"ColorListEditor\"\n >\n {ColorRowItems}\n </FormRows>\n </ColorListEditor>\n </StyledFlyoutContent>\n );\n};\n\nexport interface MultiColorPickerEditorProps extends BaseEditorProps {\n CustomColorMatchEditor?: (props: { index: number }) => React.ReactNode;\n canReorderColors?: boolean;\n value: string[];\n flyoutTitle?: string;\n addColorButtonLabel?: string;\n hideLabel?: boolean;\n canAddNewColors?: boolean;\n}\n\nconst MultiColorPickerEditor: React.FunctionComponent<MultiColorPickerEditorProps> = ({\n CustomColorMatchEditor,\n onChange = noop,\n canReorderColors = true,\n value: vizColors = VIZ_CATEGORICAL,\n flyoutTitle = _('Customize colors'),\n addColorButtonLabel = _('Add color'),\n name = 'seriesColors',\n label = '',\n labelPosition = 'top',\n labelWidth,\n isDisabled = false,\n hideLabel = true,\n canAddNewColors = true,\n}) => {\n const [showFlyout, setShowFlyout] = useState(false);\n const [colors, setColors] = useState(vizColors);\n const buttonRef = useRef(null);\n\n useEffect(() => {\n setColors(vizColors);\n }, [vizColors]);\n\n // callbacks to add, remove, update and reorder a color form row\n const handleColorAdd = useCallback(() => {\n const userColorsSet = new Set(colors);\n let nextColor = VIZ_CATEGORICAL.find(color => !userColorsSet.has(color));\n if (!nextColor) {\n // All picked, count appearances\n const countMap = new Map<string, number>();\n VIZ_CATEGORICAL.forEach(color => countMap.set(color, 0));\n colors.forEach(color => {\n countMap.set(color, (countMap.get(color) || 0) + 1);\n });\n // Find color with minimum appearances\n let minCount = Infinity;\n VIZ_CATEGORICAL.forEach(color => {\n const count = countMap.get(color) || 0;\n if (count < minCount) {\n minCount = count;\n nextColor = color;\n }\n });\n }\n onChange(null, name, [...colors, nextColor]);\n }, [name, onChange, colors]);\n\n const handleColorChange = useCallback(\n idx => (_evt, _name, value) => {\n const colorsCopy = [...colors];\n colorsCopy.splice(idx, 1, value);\n onChange(null, name, colorsCopy);\n },\n [name, onChange, colors]\n );\n\n const handleColorRemove = useCallback(\n (e, { index }) => {\n const colorsCopy = [...colors];\n colorsCopy.splice(index, 1);\n onChange(null, name, colorsCopy);\n },\n [name, onChange, colors]\n );\n\n const handleColorMove = useCallback(\n ({ fromIndex, toIndex }) => {\n const colorsCopy = [...colors];\n const movedColor = colorsCopy[fromIndex];\n colorsCopy.splice(fromIndex, 1); // first, delete the color at the original position\n colorsCopy.splice(toIndex, 0, movedColor); // then reinsert it at the new position\n onChange(null, name, colorsCopy);\n },\n [name, onChange, colors]\n );\n\n /**\n * custom logic is required for closing the flyout as the FormRows component is rendered inside a Popover, and\n * when we sort the form rows, the popover closes mid-sorting (closeReason=\"clickAway\") as the dragged element is\n * taken out of the flow. Current workaround is to check if the event's source element has a sortable handle,\n * if yes, the flyout is kept open.\n *\n * Additionally, focus is returned to the trigger button when exiting through escape key press\n */\n const handleFlyoutClose: PopoverRequestCloseHandler = useCallback(({ event, reason }) => {\n // @ts-ignore\n if (!event?.srcElement?.sortableHandle) {\n setShowFlyout(false);\n }\n if (reason === 'escapeKey') {\n buttonRef.current.focus();\n }\n }, []);\n\n const ColorChips = useMemo(\n () => colors.map(color => <ColorChip color={color} key={createDOMID()} />),\n [colors]\n );\n\n const toggleShowFlyout = useCallback(() => {\n setShowFlyout(isShown => !isShown);\n }, []);\n\n return (\n <ControlGroup\n label={label}\n labelPosition={labelPosition}\n labelWidth={labelWidth}\n hideLabel={hideLabel}\n data-test=\"MultiColorPickerEditor\"\n >\n <StyledButton\n inline={false}\n data-test=\"MultiColorPickerButton\"\n appearance=\"default\"\n ref={buttonRef}\n onClick={toggleShowFlyout}\n disabled={isDisabled}\n style={colorButtonStyle}\n >\n {ColorChips}\n </StyledButton>\n <Popover\n data-test=\"MultiColorPickerFlyout\"\n open={showFlyout}\n anchor={buttonRef.current}\n defaultPlacement=\"horizontal\"\n style={popoverStyle}\n onRequestClose={handleFlyoutClose}\n takeFocus\n >\n <ColorFlyoutEditor\n colors={colors}\n CustomColorMatchEditor={CustomColorMatchEditor}\n handleColorRemove={handleColorRemove}\n handleColorChange={handleColorChange}\n handleColorAdd={canAddNewColors ? handleColorAdd : undefined}\n handleColorMove={canReorderColors ? handleColorMove : undefined}\n flyoutTitle={flyoutTitle}\n addColorButtonLabel={addColorButtonLabel}\n />\n </Popover>\n </ControlGroup>\n );\n};\n\nMultiColorPickerEditor.propTypes = {\n ...BaseEditorPropTypes,\n /**\n * Colors can be reordered manually\n */\n canReorderColors: T.bool,\n /**\n * Can add a new color\n */\n canAddNewColors: T.bool,\n /**\n * List of colors\n */\n value: T.arrayOf(T.string),\n /**\n * Title of the flyout editor\n */\n flyoutTitle: T.string,\n /**\n * Button label for adding a new color row\n */\n addColorButtonLabel: T.string,\n /**\n * Custom input editor for mapping a value to color, eg: dropdown for field -> color\n */\n CustomColorMatchEditor: T.func,\n /**\n * Flag to hide the editor label\n */\n hideLabel: T.bool,\n};\n\nexport default MultiColorPickerEditor;\n","import * as T from 'prop-types';\nimport type { JSONSchema7 } from 'json-schema';\n\nexport interface BaseEditorProps {\n name: string;\n value: any;\n onChange?: (...args: any[]) => void;\n label?: string; // @TODO(pwied): this should not live in editor props\n labelPosition?: 'top' | 'left'; // ^^^\n context?: Record<string, any>;\n labelWidth?: number;\n isAdvanced?: boolean;\n isDisabled?: boolean;\n dataSourceBindings?: Record<string, any>;\n options?: { [k: string]: any };\n optionsSchema?: {\n [key: string]: JSONSchema7;\n };\n}\n\nexport const BaseEditorPropTypes: Record<keyof BaseEditorProps, T.Validator<any>> = {\n name: T.string.isRequired,\n value: T.oneOfType([T.string, T.object, T.arrayOf(T.string)]),\n context: T.object,\n label: T.string,\n labelPosition: T.oneOf(['top', 'left']),\n labelWidth: T.number,\n onChange: T.func,\n isAdvanced: T.bool,\n isDisabled: T.bool,\n dataSourceBindings: T.object,\n options: T.object,\n optionsSchema: T.object,\n};\n","import React, { Children, cloneElement } from 'react';\nimport type { ReactElement } from 'react';\nimport * as T from 'prop-types';\nimport styled from 'styled-components';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport AdvancedConfigIcon from '@splunk/react-icons/SlidersDoubleHorizontal';\nimport { variables } from '@splunk/themes';\nimport Tooltip from '@splunk/react-ui/Tooltip';\nimport type { ButtonClickHandler, ButtonProps } from '@splunk/react-ui/Button';\nimport Button from '@splunk/react-ui/Button';\nimport SUIControlGroup from '@splunk/react-ui/ControlGroup';\nimport type { ControlGroupPropsBase } from '@splunk/react-ui/ControlGroup';\n\ninterface AdvancedControlGroupProps extends Omit<ControlGroupPropsBase, 'splunkTheme'> {\n 'data-test'?: string;\n style?: Record<string, string | number>;\n isAdvanced?: boolean;\n onClick?: React.MouseEventHandler<HTMLDivElement>;\n onAdvancedConfigButtonClick?: ButtonClickHandler;\n}\n\ninterface AdvancedConfigButtonProps {\n label?: string;\n onClick?: ButtonClickHandler;\n}\n\n// remove all surrounding margins. let parent add padding\nconst ControlGroupContainer = styled(SUIControlGroup)`\n margin-top: 0;\n padding: 0;\n // adjust bottom margin according to theme\n margin-bottom: ${variables.spacingMedium};\n width: 100%;\n\n // remove top margin of the first component in control group\n &:first-child {\n margin-top: 0;\n }\n\n // remove bottom margin of the last component in control group\n &:last-child {\n margin-bottom: 0;\n }\n // remove top padding on label of the first control group\n [data-test='label']:first-of-type {\n padding-top: 0;\n }\n`;\n\n// override tooltip to set desired config button style\nconst StyledToolTip = styled(Tooltip)`\n display: flex;\n > span {\n display: flex;\n width: 35px;\n }\n`;\n\nconst StyledAdvancedConfigButton = styled(Button)<ButtonProps>`\n color: ${variables.contentColorActive} !important;\n &:hover {\n background-color: ${variables.interactiveColorOverlayDrag} !important;\n }\n`;\n\nexport const AdvancedConfigButton = ({\n label = '',\n onClick,\n}: AdvancedConfigButtonProps): React.ReactElement => {\n return (\n <StyledToolTip\n data-test={`${label}-advanced-config-button-tooltip`}\n content={_('Advanced configurations')}\n >\n <StyledAdvancedConfigButton\n data-test={`${label}-advanced-config-button`}\n icon={<AdvancedConfigIcon data-test={`${label}-advanced-config-button-icon`} />}\n appearance=\"subtle\"\n onClick={onClick}\n />\n </StyledToolTip>\n );\n};\n\nconst AdvancedControlGroup = ({\n 'data-test': dataTest,\n children,\n isAdvanced = false,\n label,\n hideLabel,\n labelPosition,\n labelWidth,\n tooltip,\n help,\n style,\n error,\n controlsLayout,\n onClick,\n onAdvancedConfigButtonClick,\n}: AdvancedControlGroupProps): React.ReactElement => (\n <ControlGroupContainer\n data-test={dataTest ?? 'control-group'}\n label={label}\n hideLabel={hideLabel}\n labelPosition={labelPosition}\n labelWidth={labelWidth}\n tooltip={tooltip}\n help={help}\n error={error}\n style={style}\n onClick={onClick}\n controlsLayout={controlsLayout}\n >\n {isAdvanced\n ? Children.toArray(children)\n .filter(Boolean)\n .map(child =>\n cloneElement(child as ReactElement, {\n style: { flex: 1 },\n })\n )\n : children}\n {isAdvanced ? <AdvancedConfigButton label={label} onClick={onAdvancedConfigButtonClick} /> : null}\n </ControlGroupContainer>\n);\n\nAdvancedControlGroup.propTypes = {\n /**\n * Style overriding SUI ControlGroup\n */\n style: T.object,\n /**\n * Whether the current editor is enabled with advanced configurations\n */\n isAdvanced: T.bool,\n /**\n * Callback for editor click\n */\n onClick: T.func,\n /**\n * Callback for advanced config button click\n */\n onAdvancedConfigButtonClick: T.func,\n};\n\nexport default AdvancedControlGroup;\n","module.exports = require(\"@splunk/react-icons/SlidersDoubleHorizontal\");","module.exports = require(\"@splunk/react-ui/Button\");","module.exports = require(\"@splunk/react-ui/Color\");","module.exports = require(\"@splunk/react-ui/ControlGroup\");","module.exports = require(\"@splunk/react-ui/FormRows\");","module.exports = require(\"@splunk/react-ui/Popover\");","module.exports = require(\"@splunk/react-ui/Text\");","module.exports = require(\"@splunk/react-ui/Tooltip\");","module.exports = require(\"@splunk/themes\");","module.exports = require(\"@splunk/themes/variables\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/ui-utils/id\");","module.exports = require(\"@splunk/visualization-color-palettes\");","module.exports = require(\"@splunk/visualizations-shared/colorUtils\");","module.exports = require(\"lodash\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"styled-components\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(2965);\n"],"names":["require","TextContainer","styled","variables","inputHeight","StyledText","Text","getColor","color","defaultColor","prevColor","newColor","trim","isColor","ColorAndTextWrapper","id","showTextInput","palette","handleColorChange","labelledBy","textWidth","value","name","handleTextColorChange","handleKeyPress","handleBlur","isDisabled","textLabelId","useMemo","createDOMID","React","Color","key","append","onChange","disabled","hideInput","ScreenReaderContent","_","prepend","onKeyDown","onBlur","style","height","inputId","propTypes","T","isRequired","defaultItemSchema","default","emptyStyle","ColorEditor","label","labelPosition","labelWidth","COLOR_EDITOR_PALETTE","noop","itemSchema","hideLabel","customEditorStyle","setColor","useState","useEffect","debouncedOnChange","debounce","useCallback","val","_event","colorToValue","toLower","event","ControlGroup","controlsLayout","popoverStyle","padding","colorButtonStyle","width","StyledButton","interactiveColorBackground","ColorChip","div","props","neutral100","StyledFlyoutContent","backgroundColorPopup","FlyoutHeader","fontFamily","contentColorActive","ColorListEditor","ColorFlyoutEditor","colors","CustomColorMatchEditor","handleColorRemove","flyoutTitle","addColorButtonLabel","handleColorAdd","handleColorMove","ColorRowItems","map","idx","Row","index","onRequestRemove","display","justifyContent","marginBottom","marginTop","addLabel","onRequestAdd","onRequestMove","MultiColorPickerEditor","canReorderColors","vizColors","VIZ_CATEGORICAL","canAddNewColors","showFlyout","setShowFlyout","setColors","buttonRef","useRef","userColorsSet","Set","nextColor","find","has","countMap","Map","forEach","set","get","minCount","Infinity","count","_evt","_name","colorsCopy","splice","e","fromIndex","toIndex","movedColor","handleFlyoutClose","reason","srcElement","sortableHandle","current","focus","ColorChips","toggleShowFlyout","isShown","inline","appearance","ref","onClick","open","anchor","defaultPlacement","onRequestClose","takeFocus","undefined","BaseEditorPropTypes","bool","arrayOf","string","func","oneOfType","object","context","oneOf","number","isAdvanced","dataSourceBindings","options","optionsSchema","ControlGroupContainer","spacingMedium","StyledToolTip","StyledAdvancedConfigButton","interactiveColorOverlayDrag","AdvancedConfigButton","content","icon","AdvancedControlGroup","dataTest","children","tooltip","help","error","onAdvancedConfigButtonClick","Children","toArray","filter","Boolean","child","cloneElement","flex","module","exports","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","call","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","__webpack_exports__"],"sourceRoot":""}
|