@splunk/dynamic-editors 0.38.1 → 0.38.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/DynamicEditor.js +1 -1
  3. package/DynamicEditor.js.map +1 -1
  4. package/containers/EditorItem.js +1 -1
  5. package/containers/EditorItem.js.map +1 -1
  6. package/containers/EditorLayout.js +1 -1
  7. package/containers/EditorLayout.js.map +1 -1
  8. package/containers/EditorLayoutItem.js +1 -1
  9. package/containers/EditorLayoutItem.js.map +1 -1
  10. package/editors/AdvancedConfigCard.js.map +1 -1
  11. package/editors/ArrayOfStringsEditor.js.map +1 -1
  12. package/editors/CheckboxEditor.js.map +1 -1
  13. package/editors/ColorEditor.js.map +1 -1
  14. package/editors/ColumnMultiSelectionByFieldNameEditor.js.map +1 -1
  15. package/editors/ColumnMultiSelectionEditor.js.map +1 -1
  16. package/editors/ColumnSelectionEditor.js.map +1 -1
  17. package/editors/DynamicColorEditor.js.map +1 -1
  18. package/editors/DynamicColorEditorWithPrecedence.js.map +1 -1
  19. package/editors/DynamicItemEditor.js.map +1 -1
  20. package/editors/ImageEditor.js.map +1 -1
  21. package/editors/MultiColorPickerEditor.js.map +1 -1
  22. package/editors/NumberEditor.js.map +1 -1
  23. package/editors/PercentEditor.js.map +1 -1
  24. package/editors/PresetSelectorEditor.js.map +1 -1
  25. package/editors/RadioBarEditor.js.map +1 -1
  26. package/editors/SelectEditor.js.map +1 -1
  27. package/editors/SeriesColorsByFieldEditor.js.map +1 -1
  28. package/editors/SeriesColorsEditor.js.map +1 -1
  29. package/editors/SliderEditor.js.map +1 -1
  30. package/editors/StaticItemEditor.js.map +1 -1
  31. package/editors/TableColumnFormatterEditor.js +1 -1
  32. package/editors/TableColumnFormatterEditor.js.map +1 -1
  33. package/editors/TableDynamicColorEditor.js.map +1 -1
  34. package/editors/TextAreaEditor.js.map +1 -1
  35. package/editors/TextEditor.js.map +1 -1
  36. package/editors/ThresholdEditor.js.map +1 -1
  37. package/editors/ToggleEditor.js.map +1 -1
  38. package/editors/useColumnSelectorFooterMessage.js.map +1 -1
  39. package/package.json +17 -17
  40. package/shared/AdvancedControlGroup.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicItemEditor.js","mappings":";;;;4xBASA,MAAMA,EAAeC,IAAAA,GAAU;;;;;;;EASzBC,EACFC,IAAAA,cAACH,EAAY,KACTG,IAAAA,cAAA,QAAM,YAAU,0BAAyBC,EAAAA,EAAAA,GAAE,UAC3CD,IAAAA,cAAA,QAAM,YAAU,0BAAyBC,EAAAA,EAAAA,GAAE,WAU7CC,EAAaA,CAACC,EAAOC,IAAUD,EAAME,QAAO,CAACC,EAAOC,IAAQA,IAAQH,IAyBpEI,EAAcA,CAACC,EAAON,EAAOO,IAEV,iBAAVD,GAAuC,KAAjBA,EAAME,QAKhCR,EAAME,QAAOO,GAAKA,EAAEF,KAASD,IAAOI,OAAS,EAGlDC,EAAeA,CAACC,EAAOZ,IAAUK,EAAYO,EAAOZ,EAAO,SAC3Da,EAAeA,CAACP,EAAON,IAAUK,EAAYC,EAAON,EAAO,SAE3Dc,EAAiBnB,IAAAA,GAAU;;EAI3BoB,EAAe,GAEfC,EAAmBA,EACrBC,WACAC,OACAZ,QAAQS,EACRI,gBAAgB,MAChBP,QAAQ,GACRQ,eAEA,MAAOC,EAAaC,IAAYC,EAAAA,EAAAA,UAASjB,IAClCkB,EAAWC,IAAYF,EAAAA,EAAAA,UAASjB,EAAMI,SAE7CgB,EAAAA,EAAAA,YAAU,KACNJ,EAAShB,GACLA,EAAMI,OAASc,GACfC,EAASnB,EAAMI,OACnB,GACD,CAACJ,EAAOkB,IAEX,MAAMG,GAAeC,EAAAA,EAAAA,cACjBC,IAxDQ7B,OAyDC8B,EAAAA,EAAAA,SAAQD,EAAUvB,MAzDnBN,EAyDqC6B,GAvD1CE,MACH,EAAGnB,QAAON,WACW,iBAAVM,GACU,KA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rB2M,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqB7G,IAAjB8G,EACH,OAAOA,EAAaJ,QAGrB,IAAID,EAASE,EAAyBE,GAAY,CAGjDH,QAAS,CAAC,GAOX,OAHAK,EAAoBF,GAAUG,KAAKP,EAAOC,QAASD,EAAQA,EAAOC,QAASE,GAGpEH,EAAOC,OACf,CCrBAE,EAAoBK,EAAKR,IACxB,IAAIS,EAAST,GAAUA,EAAOU,WAC7B,IAAOV,EAAiB,QACxB,IAAM,EAEP,OADAG,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdN,EAAoBQ,EAAI,CAACV,EAASY,KACjC,IAAI,IAAI9Q,KAAO8Q,EACXV,EAAoBW,EAAED,EAAY9Q,KAASoQ,EAAoBW,EAAEb,EAASlQ,IAC5EgR,OAAOC,eAAef,EAASlQ,EAAK,CAAEkR,YAAY,EAAMhF,IAAK4E,EAAW9Q,IAE1E,ECNDoQ,EAAoBW,EAAI,CAACI,EAAKC,IAAUJ,OAAOK,UAAUC,eAAed,KAAKW,EAAKC,GCClFhB,EAAoBmB,EAAKrB,IACH,oBAAXsB,QAA0BA,OAAOC,aAC1CT,OAAOC,eAAef,EAASsB,OAAOC,YAAa,CAAE1R,MAAO,WAE7DiR,OAAOC,eAAef,EAAS,aAAc,CAAEnQ,OAAO,GAAO,ECF9D,IAAI2R,EAAsBtB,EAAoB,M","sources":["webpack://@splunk/dynamic-editors/./src/editors/StaticItemEditor.jsx","webpack://@splunk/dynamic-editors/external commonjs2 \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://@splunk/dynamic-editors/./src/editors/TextEditor.jsx","webpack://@splunk/dynamic-editors/./src/editors/ColumnSelectionEditor.tsx","webpack://@splunk/dynamic-editors/./src/editors/DynamicItemEditor.tsx","webpack://@splunk/dynamic-editors/./src/editors/useColumnSelectorFooterMessage.tsx","webpack://@splunk/dynamic-editors/./src/hooks/useDataSource.tsx","webpack://@splunk/dynamic-editors/./src/interfaces/BaseEditorProps.ts","webpack://@splunk/dynamic-editors/./src/shared/AdvancedControlGroup.tsx","webpack://@splunk/dynamic-editors/./src/shared/ColumnSelectorFooterMessage.tsx","webpack://@splunk/dynamic-editors/./src/shared/dimensionConstants.ts","webpack://@splunk/dynamic-editors/./src/utils/columnSelectionUtils.ts","webpack://@splunk/dynamic-editors/./src/utils/dynamicItemInputEditor.ts","webpack://@splunk/dynamic-editors/external commonjs2 \"@babel/runtime/helpers/defineProperty\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@babel/runtime/helpers/extends\"","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/ColumnLayout\"","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/Select\"","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/format\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/ui-utils/i18n\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-context/DataSourceContext\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-encoding/DslParser\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-encoding/EncodingParser\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-encoding/utils/dsl\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-encoding/utils/types\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualizations-shared/dataSourceUtils\"","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":["import React, { useCallback, useState, useEffect } from 'react';\nimport T from 'prop-types';\nimport styled from 'styled-components';\nimport { isEqual, uniqBy } from 'lodash';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport FormRows from '@splunk/react-ui/FormRows';\nimport TextEditor from './TextEditor';\nimport ControlGroup from '../shared/AdvancedControlGroup';\n\nconst RowContainer = styled.div`\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 10px;\n [data-test='control-group'] {\n margin: 0;\n }\n`;\n\nconst formRowHeader = (\n <RowContainer>\n <span data-test=\"form-row-header-label\">{_('Label')}</span>\n <span data-test=\"form-row-header-value\">{_('Value')}</span>\n </RowContainer>\n);\n\n/**\n * Remove an item from an array, return a new array\n * @param {Array} items The list of items\n * @param {Number} index The index of the item to remove\n * @returns {Array} list of items without the item at the specified index\n */\nconst removeItem = (items, index) => items.filter((_item, idx) => idx !== index);\n\n/**\n * Detect when a list of static items contains an invalid entry\n * @param {StaticItem[]} items List of static items\n * @returns {Boolean} true when no label or value is an empty string\n */\nconst isValid = items =>\n // exit early when an error found\n !items.some(\n ({ label, value }) =>\n typeof label !== 'string' ||\n label.trim() === '' ||\n typeof value !== 'string' ||\n value.trim() === ''\n ) &&\n uniqBy(items, item => item.value).length === items.length &&\n uniqBy(items, item => item.label).length === items.length;\n\n/**\n * Detect if a label or value in the list is an error case\n * @param {String} value either an item label or value\n * @param {StaticItem[]} items List of all items\n * @param {label | value} key The StaticItem key to check\n */\nconst isItemError = (value, items, key) => {\n // Just have an invalid type\n if (typeof value !== 'string' || value.trim() === '') {\n return true;\n }\n\n // Check the value is unique\n return items.filter(i => i[key] === value).length > 1;\n};\n\nconst isLabelError = (label, items) => isItemError(label, items, 'label');\nconst isValueError = (value, items) => isItemError(value, items, 'value');\n\nconst InputContainer = styled.div`\n width: 100%;\n`;\n\nconst defaultValue = [];\n\nconst StaticItemEditor = ({\n onChange,\n name,\n value = defaultValue,\n labelPosition = 'top',\n label = '',\n validate,\n}) => {\n const [staticItems, setItems] = useState(value);\n const [nextIndex, setIndex] = useState(value.length);\n\n useEffect(() => {\n setItems(value);\n if (value.length > nextIndex) {\n setIndex(value.length);\n }\n }, [value, nextIndex]);\n\n const handleChange = useCallback(\n newItems => {\n if (!isEqual(newItems, value) && isValid(newItems)) {\n // don't save newItems to state,\n // as this component will get a prop change as a result of the onChange call\n onChange(null, name, newItems);\n } else {\n // save invalid values so UI updates.\n setItems(newItems);\n }\n },\n [value, name, onChange]\n );\n\n const handleRequestRemove = useCallback(\n (_evt, { index }) => {\n const newItems = removeItem(staticItems, index);\n\n handleChange(newItems);\n },\n [staticItems, handleChange]\n );\n\n const handleRequestMove = useCallback(\n ({ fromIndex, toIndex }) => {\n const item = staticItems[fromIndex];\n const newItems = removeItem(staticItems, fromIndex);\n\n newItems.splice(toIndex, 0, item);\n handleChange(newItems);\n },\n [staticItems, handleChange]\n );\n\n const handleItemChange = useCallback(\n (idx, key) =>\n (_evt, _name, val = '') => {\n const item = staticItems[idx];\n const newItems = [...staticItems];\n\n newItems.splice(idx, 1, { ...item, [key]: val.trim() });\n handleChange(newItems);\n },\n [staticItems, handleChange]\n );\n\n const handleRequestAdd = useCallback(() => {\n const newItems = staticItems.concat({\n label: `Label ${nextIndex}`,\n value: `menu_v${nextIndex}`,\n });\n\n setIndex(nextIndex + 1);\n handleChange(newItems);\n }, [staticItems, nextIndex, handleChange]);\n\n const rows = staticItems.map((item, idx) => {\n const { label: l, value: v } = item;\n return (\n <FormRows.Row\n index={idx}\n // eslint-disable-next-line react/no-array-index-key\n key={`${l}_${v}_${idx}`} // NOSONAR\n onRequestRemove={handleRequestRemove}\n >\n <RowContainer>\n <TextEditor\n label={_('Label')}\n hideLabel\n value={l}\n onChange={handleItemChange(idx, 'label')}\n name=\"item-label-editor\"\n error={isLabelError(l, staticItems)}\n validate={validate}\n />\n <TextEditor\n label={_('Value')}\n hideLabel\n value={v}\n onChange={handleItemChange(idx, 'value')}\n name=\"item-value-editor\"\n error={isValueError(v, staticItems)}\n validate={validate}\n />\n </RowContainer>\n </FormRows.Row>\n );\n });\n\n return (\n <ControlGroup label={label} labelPosition={labelPosition}>\n <InputContainer>\n <FormRows\n addLabel={_('Add new')}\n header={formRowHeader}\n onRequestAdd={handleRequestAdd}\n onRequestMove={handleRequestMove}\n >\n {rows}\n </FormRows>\n </InputContainer>\n </ControlGroup>\n );\n};\n\nStaticItemEditor.propTypes = {\n /**\n * Callback when changing the text value\n *\n * onChange function has the following properties\n * @param {SyntheticEvent} event The react `SyntheticEvent`\n * @param {String} name The option name\n * @param {StaticItem[]} 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,\n /**\n * The option value\n */\n value: T.arrayOf(T.exact({ label: T.string, value: T.string })),\n /**\n * Label position\n */\n labelPosition: T.oneOf(['top', 'left']),\n /**\n * Validate the value of the editor\n */\n validate: T.func,\n};\n\nexport default StaticItemEditor;\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/objectWithoutProperties\");","import React, { useState, useCallback, useEffect, useMemo } from 'react';\nimport T from 'prop-types';\nimport { debounce } from 'lodash';\nimport Text from '@splunk/react-ui/Text';\nimport ControlGroup from '../shared/AdvancedControlGroup';\nimport { editorStyle } from '../shared/dimensionConstants';\n\nconst defaultLabelStyle = {};\n\nconst TextEditor = ({\n onChange,\n name,\n value = '',\n label,\n labelPosition = 'top',\n labelWidth,\n labelStyle = defaultLabelStyle,\n hideLabel = false,\n isAdvanced,\n isDisabled = false,\n help,\n tooltip,\n validate,\n error,\n ...otherProps\n}) => {\n const [val, setValueState] = useState(value);\n\n const handleValidate = useCallback(\n newValue => (typeof validate === 'function' ? validate({ value: newValue }) : null),\n [validate]\n );\n const [errorState, setErrorState] = useState(handleValidate(value));\n const debouncedHandleValidate = useMemo(\n () =>\n debounce(newVal => {\n setErrorState(handleValidate(newVal));\n }, 250),\n [handleValidate]\n );\n\n useEffect(\n () => () => {\n // cancel debounce on component unmount\n debouncedHandleValidate.cancel();\n },\n [debouncedHandleValidate]\n );\n\n useEffect(() => {\n setValueState(value);\n setErrorState(handleValidate(value));\n }, [handleValidate, value]);\n\n const handleChange = useCallback(\n (_event, { value: v }) => {\n setValueState(v);\n debouncedHandleValidate(v);\n },\n [debouncedHandleValidate]\n );\n\n const handleBlur = useCallback(\n event => {\n const newVal = val.trim();\n if (newVal === value) {\n return;\n }\n const newError = handleValidate(newVal);\n // set error if there is one, or clear an existing error\n setErrorState(newError);\n if (!newError) {\n // only change value if there is no validation error\n onChange(event, name, newVal);\n }\n },\n [val, value, handleValidate, onChange, name]\n );\n\n const handleKeyPress = useCallback(\n event => {\n if (event.key === 'Enter') {\n handleBlur(event);\n }\n },\n [handleBlur]\n );\n\n const style = useMemo(\n () =>\n !label || label === ''\n ? {\n ...labelStyle,\n }\n : labelStyle,\n [label, labelStyle]\n );\n\n return (\n <ControlGroup\n label={label}\n labelPosition={labelPosition}\n labelWidth={labelWidth}\n style={style}\n hideLabel={hideLabel}\n help={help}\n tooltip={tooltip}\n error={errorState?.message || error}\n isAdvanced={isAdvanced}\n >\n <Text\n key={value}\n data-test={name}\n style={editorStyle}\n onChange={handleChange}\n onKeyDown={handleKeyPress}\n onBlur={handleBlur}\n value={val}\n disabled={isDisabled}\n canClear\n {...otherProps}\n error={!!errorState || error}\n />\n </ControlGroup>\n );\n};\n\nTextEditor.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 /**\n * Label width\n */\n labelWidth: T.number,\n /**\n * Styles to be passed to the ControlGroup\n */\n labelStyle: T.object,\n /**\n * Visually hide the label, but render it for screen readers\n */\n hideLabel: T.bool,\n /**\n * As advanced editor to show advanced config button\n */\n isAdvanced: T.bool,\n /**\n * Disabled state of component\n */\n isDisabled: T.bool,\n /**\n * Validate the value of the editor\n */\n validate: T.func,\n /**\n * If the input should display error state\n */\n error: T.bool,\n /**\n * Text to display under the the input\n */\n help: T.string,\n /**\n * Text to display in a tooltip next to the label\n */\n tooltip: T.string,\n};\n\nexport default TextEditor;\n","import React, { useState, useCallback } from 'react';\nimport * as T from 'prop-types';\nimport Select from '@splunk/react-ui/Select';\nimport { getFieldsFromDSL } from '@splunk/visualization-encoding/utils/dsl';\nimport { getDataSourceStateInfo } from '@splunk/visualizations-shared/dataSourceUtils';\nimport { DataType } from '@splunk/visualization-encoding/DataPrimitive';\nimport { BaseEditorProps, BaseEditorPropTypes } from '../interfaces/BaseEditorProps';\nimport { useDataSource } from '../hooks/useDataSource';\nimport { getAvailableFieldsWithTypes, getPlaceholderMessage } from '../utils/columnSelectionUtils';\nimport ControlGroup from '../shared/AdvancedControlGroup';\nimport { editorStyle } from '../shared/dimensionConstants';\nimport { useColumnSelectorFooterMessage } from './useColumnSelectorFooterMessage';\n\ninterface ColumnSelectionEditorProps extends BaseEditorProps {\n dataSourceKey: string;\n prepareValue?: (id: Record<string, any>) => Record<string, any>;\n filterByTypes?: DataType[];\n tooltip?: string;\n}\nconst propTypes: Record<keyof ColumnSelectionEditorProps, T.Validator<any>> = {\n ...BaseEditorPropTypes,\n dataSourceKey: T.string.isRequired,\n prepareValue: T.func,\n filterByTypes: T.arrayOf(T.string),\n tooltip: T.string,\n};\nexport const ColumnSelectionEditor: React.FunctionComponent<ColumnSelectionEditorProps> = ({\n name,\n value,\n label = '',\n labelPosition = 'top',\n dataSourceKey = 'primary',\n dataSourceBindings,\n prepareValue = (id: Record<string, unknown>): Record<string, unknown> => id,\n onChange,\n isAdvanced,\n isDisabled,\n filterByTypes,\n tooltip,\n}) => {\n const dataSource = useDataSource({ dataSourceBindings, dataSourceKey });\n const { columns, fields } = dataSource?.data || { columns: [], fields: [] };\n const availableFieldsWithTypes = getAvailableFieldsWithTypes(columns, fields);\n // return `value` if `value` is undefined or null so editor shows placeholder message\n const fieldName =\n value == null\n ? value\n : getFieldsFromDSL(value, {\n [dataSourceKey]: dataSource,\n })[0] || '';\n const [selectedField, setSelectedField] = useState(fieldName);\n React.useEffect((): void => {\n setSelectedField(fieldName);\n }, [fieldName]);\n const [filter, setFilter] = useState('');\n const filteredFields = availableFieldsWithTypes.filter(\n (field): boolean => field.name.indexOf(filter) !== -1\n );\n const footerMessage = useColumnSelectorFooterMessage({\n availableFields: availableFieldsWithTypes,\n selectedFields: [selectedField],\n filteredFields,\n filter,\n });\n\n const handleValueChange = useCallback(\n (event, { value: selectedValue }): void => {\n setSelectedField(selectedValue);\n const update = prepareValue({\n options: {\n [name]: `> ${dataSourceKey} | seriesByName('${selectedValue}')`,\n },\n });\n onChange(event, update);\n },\n [dataSourceKey, name, onChange, prepareValue]\n );\n\n const handleFilterChange = useCallback((e, { keyword }): void => {\n setFilter(keyword);\n }, []);\n const { hasError, isMissing, isLoading } = getDataSourceStateInfo(dataSource);\n const disabled = isMissing || hasError || isDisabled;\n const placeholderMessage = getPlaceholderMessage({ isMissing, isLoading, hasError });\n\n return (\n <ControlGroup label={label} labelPosition={labelPosition} tooltip={tooltip} isAdvanced={isAdvanced}>\n <Select\n data-test=\"ColumnSelectionEditor\"\n value={selectedField}\n onFilterChange={handleFilterChange}\n onChange={handleValueChange}\n footerMessage={footerMessage}\n disabled={disabled}\n placeholder={placeholderMessage}\n isLoadingOptions={isLoading}\n error={hasError}\n style={editorStyle}\n filter\n >\n {filteredFields.map(field => (\n <Select.Option\n key={field.name}\n label={`${field.name} (${field.type})`}\n value={field.name}\n disabled={!!filterByTypes?.length && !filterByTypes.find(f => f === field.type)}\n />\n ))}\n </Select>\n </ControlGroup>\n );\n};\nColumnSelectionEditor.propTypes = propTypes;\n\nexport default ColumnSelectionEditor;\n","import * as React from 'react';\nimport * as T from 'prop-types';\nimport { unzip } from 'lodash';\nimport Text from '@splunk/react-ui/Text';\nimport ControlGroup from '@splunk/react-ui/ControlGroup';\nimport ColumnLayout from '@splunk/react-ui/ColumnLayout';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport ColumnSelectionEditor from './ColumnSelectionEditor';\nimport StaticItemEditor from './StaticItemEditor';\nimport {\n getDynamicOptionsFromConfig,\n getFieldFromFieldNameDsl,\n isConfigAdvanced,\n} from '../utils/dynamicItemInputEditor';\nimport { VERTICAL_EDITOR_SPACING } from '../shared/dimensionConstants';\nimport type { StaticItem, DynamicOptionsContext } from '../types';\n\ninterface DynamicOptionsConfig {\n context?: DynamicOptionsContext;\n options?: Record<string, unknown>;\n}\n\ninterface DynamicItemEditorProps {\n name: string;\n value: StaticItem[] | string;\n label: string;\n labelPosition?: 'top' | 'left';\n labelWidth?: number;\n onChange: (event: React.SyntheticEvent | null, updatedConfig: DynamicOptionsConfig) => void;\n context: DynamicOptionsContext;\n dataSourceBindings: { primary?: string };\n help?: string;\n validate?: (args: { value: string }) => { message: string } | null;\n [key: string]: unknown;\n}\n\nconst defaultHelpText = _(\n 'Advanced configuration options are being used by this input. Please edit in source mode.'\n);\n\nconst DynamicItemEditor = ({\n name,\n context,\n value = '',\n label,\n onChange,\n dataSourceBindings,\n labelPosition = 'top',\n labelWidth,\n help = defaultHelpText,\n validate,\n}: DynamicItemEditorProps): JSX.Element => {\n const [staticItems, setItems] = React.useState<StaticItem[]>([]);\n const [dynamicItemsLabelField, setLabel] = React.useState('');\n const [dynamicItemsValueField, setValue] = React.useState('');\n\n // update static and dynamic options when the props change\n React.useEffect(() => {\n const { staticOptions, dynamicOptionsLabel, dynamicOptionsValue } = getDynamicOptionsFromConfig({\n items: value,\n context,\n });\n\n setItems(staticOptions);\n setLabel(dynamicOptionsLabel);\n setValue(dynamicOptionsValue);\n }, [value, context]);\n\n // use static mode if no data source is configured\n React.useEffect(() => {\n const currDataSource = dataSourceBindings.primary;\n if (currDataSource !== undefined || Array.isArray(value)) {\n return;\n }\n\n onChange(null, {\n context: {\n formattedConfig: undefined,\n formattedStatics: undefined,\n statics: undefined,\n label: undefined,\n value: undefined,\n },\n options: {\n [name]: staticItems,\n },\n });\n }, [dataSourceBindings, name, value, onChange, staticItems]);\n\n const handleChange = React.useCallback(\n (newItems, newLabelField, newValueField) => {\n const isStaticConfiguration = Array.isArray(value) && (!newLabelField || !newValueField);\n\n if (isStaticConfiguration) {\n onChange(null, { options: { [name]: newItems } });\n } else {\n const statics: string[][] = unzip(\n newItems.map(({ label: l, value: v }: StaticItem) => [l, v])\n );\n onChange(null, {\n context: {\n formattedConfig: { number: { prefix: '' } },\n formattedStatics: '>statics | formatByType(formattedConfig)',\n statics,\n label: `>primary | seriesByName(\"${newLabelField}\") | renameSeries(\"label\") | formatByType(formattedConfig)`,\n value: `>primary | seriesByName(\"${newValueField}\") | renameSeries(\"value\") | formatByType(formattedConfig)`,\n },\n options: {\n [name]: '>frame(label, value) | prepend(formattedStatics) | objects()',\n },\n });\n }\n },\n [name, value, onChange]\n );\n\n const handleStaticItemChange = React.useCallback(\n (_event, _name, newItems) => {\n handleChange(newItems, dynamicItemsLabelField, dynamicItemsValueField);\n },\n [handleChange, dynamicItemsLabelField, dynamicItemsValueField]\n );\n\n const handleDynamicLabelFieldChange = React.useCallback(\n (_event, { value: newLabel }) => {\n if (dynamicItemsValueField === '') {\n // it is unecessary to update the definition until both label and value are set\n setLabel(newLabel);\n } else {\n handleChange(staticItems, newLabel, dynamicItemsValueField);\n }\n },\n [handleChange, staticItems, dynamicItemsValueField]\n );\n\n const handleDynamicValueFieldChange = React.useCallback(\n (_event, { value: newValue }) => {\n if (dynamicItemsLabelField === '') {\n // it is unecessary to update the definition until both label and value are set\n setValue(newValue);\n } else {\n handleChange(staticItems, dynamicItemsLabelField, newValue);\n }\n },\n [handleChange, staticItems, dynamicItemsLabelField]\n );\n\n const prepareDynamicFieldValue =\n (key: string) =>\n (config: DynamicOptionsConfig): Record<string, unknown> => {\n const fieldDsl = config?.options?.[key];\n if (typeof fieldDsl === 'string') {\n return { value: getFieldFromFieldNameDsl(fieldDsl) };\n }\n return { value: '' };\n };\n\n const usingAdvancedConfig = React.useMemo(\n () => isConfigAdvanced({ items: value, context }),\n [value, context]\n );\n if (usingAdvancedConfig) {\n return (\n <ControlGroup label={_(label)} labelPosition={labelPosition} labelWidth={labelWidth} help={help}>\n <Text key={value.toString()} data-test={name} disabled defaultValue={value.toString()} />\n </ControlGroup>\n );\n }\n\n const dataSourceConfigured = !!dataSourceBindings.primary;\n return (\n <>\n <StaticItemEditor\n name=\"\"\n label={_('Static menu configuration')}\n labelPosition={labelPosition}\n value={staticItems}\n onChange={handleStaticItemChange}\n validate={validate}\n />\n {dataSourceConfigured && (\n <ColumnLayout key=\"dynamic-item-editor-label-value-layout\" gutter={VERTICAL_EDITOR_SPACING}>\n <ColumnLayout.Row key=\"dynamic-item-editor-label-row\">\n <ColumnSelectionEditor\n name=\"label\"\n label={_('Dynamic menu label field')}\n dataSourceKey=\"primary\"\n dataSourceBindings={dataSourceBindings}\n value={`>primary | seriesByName(\"${dynamicItemsLabelField}\")`}\n context={context}\n onChange={handleDynamicLabelFieldChange}\n prepareValue={prepareDynamicFieldValue('label')}\n />\n </ColumnLayout.Row>\n <ColumnLayout.Row key=\"dynamic-item-editor-value-row\">\n <ColumnSelectionEditor\n name=\"value\"\n label={_('Dynamic menu value field')}\n dataSourceKey=\"primary\"\n dataSourceBindings={dataSourceBindings}\n value={`>primary | seriesByName(\"${dynamicItemsValueField}\")`}\n context={context}\n onChange={handleDynamicValueFieldChange}\n prepareValue={prepareDynamicFieldValue('value')}\n />\n </ColumnLayout.Row>\n </ColumnLayout>\n )}\n </>\n );\n};\n\nDynamicItemEditor.propTypes = {\n /**\n * Callback when changing the text value\n *\n * onChange function has the following properties\n * @param {SyntheticEvent} event The react `SyntheticEvent`\n * @param {String} name The option name\n * @param {StaticItem[]} 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.oneOfType([\n T.arrayOf(\n T.shape({\n label: T.string.isRequired,\n value: T.string.isRequired,\n }).isRequired\n ),\n T.string,\n ]),\n /**\n * Label position\n */\n labelPosition: T.oneOf(['top', 'left']),\n /**\n * Label width\n */\n labelWidth: T.number,\n /**\n * The context object\n */\n context: T.shape({\n label: T.string,\n value: T.string,\n statics: T.arrayOf(T.arrayOf(T.string.isRequired).isRequired),\n }).isRequired,\n /**\n * Primary data source binding\n */\n dataSourceBindings: T.shape({ primary: T.any }).isRequired,\n help: T.string,\n};\n\nexport default DynamicItemEditor;\n","import React, { useMemo } from 'react';\nimport { ColumnSelectorFooterMessage } from '../shared/ColumnSelectorFooterMessage';\nimport { FieldTuple } from '../utils/columnSelectionUtils';\n\ntype ObjectWithName = {\n name: string;\n [key: string]: string;\n};\n\ntype Fields = FieldTuple[] | ObjectWithName[];\n\ninterface FooterMessageProps {\n noSelectedFieldsInfo?: boolean;\n filter: string;\n availableFields: Fields;\n selectedFields?: string[];\n filteredFields: Fields;\n}\n\nexport const useColumnSelectorFooterMessage = ({\n filter,\n availableFields,\n selectedFields,\n filteredFields,\n noSelectedFieldsInfo = false,\n}: FooterMessageProps) => {\n const selectedFilteredFields = useMemo(() => {\n if (!selectedFields || !filteredFields) return [];\n\n const validSelectedFields = new Set(\n selectedFields.filter(field => field !== '' && field !== undefined)\n );\n\n return filteredFields.filter(item => validSelectedFields.has(item.name));\n }, [selectedFields, filteredFields]);\n\n // make sure to display only 'No matches' text when there is no result of filtering\n if (filter && !filteredFields.length) {\n return null;\n }\n\n return (\n <ColumnSelectorFooterMessage\n noSelectedFieldsInfo={noSelectedFieldsInfo}\n numSelected={selectedFilteredFields?.length} // if no filter is applied filteredFields equal availableFields\n numFiltered={filteredFields.length}\n numAvailable={availableFields.length}\n filter={filter}\n />\n );\n};\n","import { useState, useEffect, useContext } from 'react';\nimport DataSourceContext, {\n type BindingsSnapshot,\n type DataSourceApi,\n} from '@splunk/visualization-context/DataSourceContext';\nimport { get, isFunction } from 'lodash';\n\ninterface UseDataSourceParams {\n dataSourceBindings: BindingsSnapshot;\n dataSourceKey: string;\n}\n// @TODO(pwied): use DataSource interface in return type (w/o dependency on @splunk/visualizations)\nexport const useDataSource = ({\n dataSourceBindings,\n dataSourceKey,\n}: UseDataSourceParams): BindingsSnapshot => {\n const dataSourceApi = useContext<DataSourceApi>(DataSourceContext);\n const [dataSource, setDataSource] = useState<BindingsSnapshot>();\n useEffect((): (() => void) => {\n if (!get(dataSourceBindings, dataSourceKey)) {\n setDataSource(null);\n return () => undefined;\n }\n const unsubscribe =\n isFunction(dataSourceApi.subscribe) &&\n dataSourceApi.subscribe(dataSourceKey, (snapshot): void => setDataSource(snapshot));\n return () => {\n if (unsubscribe) {\n unsubscribe();\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dataSourceBindings]);\n return dataSource;\n};\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, 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, { 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 { sprintf } from '@splunk/ui-utils/format';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport { useMemo } from 'react';\n\ninterface FooterProps {\n filter: string;\n numSelected?: number;\n numFiltered: number;\n numAvailable: number;\n noSelectedFieldsInfo?: boolean; // it is needed for AddColumn component which has different logic than other selection editors\n}\n\nexport const ColumnSelectorFooterMessage = ({\n numSelected,\n numFiltered,\n numAvailable,\n filter,\n noSelectedFieldsInfo,\n}: FooterProps) => {\n const footerMessageText = useMemo(() => {\n if (filter) {\n if (noSelectedFieldsInfo) {\n return sprintf(_('%(filtered)d filtered from %(available)d fields'), {\n filtered: numFiltered,\n available: numAvailable,\n });\n }\n return sprintf(_('%(selected)d selected from %(filtered)d filtered'), {\n selected: numSelected,\n filtered: numFiltered,\n });\n }\n return noSelectedFieldsInfo\n ? sprintf(_('%(shown)d of %(available)d fields'), {\n shown: numFiltered,\n available: numAvailable,\n })\n : sprintf(_('%(selected)d selected from %(available)d'), {\n selected: numSelected,\n available: numAvailable,\n });\n }, [filter, noSelectedFieldsInfo, numFiltered, numAvailable, numSelected]);\n\n return (\n <span data-test=\"footer-message\" aria-live=\"polite\" aria-atomic=\"true\">\n {footerMessageText}\n </span>\n );\n};\n","export const FLYOUT_PADDING = 21;\nexport const COLUMN_FLYOUT_PADDING = 16;\nexport const FLYOUT_WIDTH = 344;\n\nexport const VERTICAL_EDITOR_SPACING = 16;\n\nexport const DROPDOWN_MENU_WIDTH = 327;\n\nexport const editorStyle = { width: '100%' };\n","import { _ } from '@splunk/ui-utils/i18n';\nimport {\n inferDataTypeFromData,\n canInferTypeFromMeta,\n getDataTypeForMeta,\n} from '@splunk/visualization-encoding/utils/types';\n\nexport interface FieldTuple {\n name: string;\n type: string;\n}\n\nexport const getAvailableFieldsWithTypes = (\n columns: unknown[][],\n fields: { name: string; type?: string }[]\n): FieldTuple[] => {\n const fieldsWithType = fields.map((field, index) => {\n const { name } = field;\n const inferredType = canInferTypeFromMeta(field)\n ? getDataTypeForMeta(field)\n : inferDataTypeFromData(columns[index]);\n return {\n name,\n type: inferredType,\n };\n });\n return fieldsWithType;\n};\n\nexport const getFilteredFields = (availableFieldsWithTypes: FieldTuple[], filter: string): FieldTuple[] => {\n return availableFieldsWithTypes.filter((field): boolean => field.name.indexOf(filter) !== -1);\n};\n\nexport const sanitizeFieldNames = (value: unknown, fieldNames: string[]): string[] => {\n if (typeof value === 'string' && fieldNames.includes(value)) {\n return [value];\n }\n if (Array.isArray(value)) {\n return value.filter(name => fieldNames.includes(name));\n }\n return [];\n};\n\nexport const getPlaceholderMessage = ({\n hasError,\n isLoading,\n isMissing,\n defaultMessage = 'Select a field from data source',\n}: {\n hasError: boolean;\n isLoading: boolean;\n isMissing: boolean;\n defaultMessage?: string;\n}): string => {\n if (isMissing) {\n return _('Set up data source to select');\n }\n if (hasError) {\n return _('Please set up valid data source to select');\n }\n if (isLoading) {\n return _('Loading data source...');\n }\n return _(defaultMessage);\n};\n","import { find, findLastIndex, get, isMatch, zipWith } from 'lodash';\nimport { DslParser } from '@splunk/visualization-encoding/DslParser';\nimport EncodingParser from '@splunk/visualization-encoding/EncodingParser';\nimport type { StaticItem, DynamicOptionsContext } from '../types';\n\n/**\n * The Dropdown/Multiselect inputs expect a config that has the following format. Additional\n * formatting clauses and options may be present. This is the \"standard dynamic config\".\n * {\n * context: {\n * statics: [\n * ['label1', 'label2', ...],\n * ['value1', 'value2', ...]\n * ],\n * label: '>primary | seriesByName(\"<label field name>\") | renameSeries('label'),\n * value: '>primary | seriesByName(\"<value field name>\") | renameSeries('value')\n * },\n * options: {\n * items: '>frame(label, value) | prepend(statics) | objects()'\n * }\n * }\n *\n * The \"standard static config\" is as follows. The contents of context do not matter.\n * {\n * context: {},\n * options: {\n * items: [\n * { label: 'label1', value: 'value1 },\n * { label: 'label2', value: 'value2 },\n * ...\n * ]\n * }\n * }\n *\n * \"Advanced configs\" are any config that does not follow the above formats.\n */\n\n/**\n * Retrieve the first field name from a DSL string containing seriesByName().\n */\nexport const getFieldFromFieldNameDsl = (dsl: string): string => {\n try {\n const ast = DslParser.parse(EncodingParser.withoutArrow(dsl));\n const seriesByNameNode = find(ast, {\n type: 'method',\n name: 'seriesByName',\n });\n return get(seriesByNameNode, ['args', '0', 'v'], '');\n } catch {\n return '';\n }\n};\n\n/**\n * Simple validation to check that a DSL string matches the standard config for the\n * context label/value field of Dynamic Options.\n */\nconst isFieldNameDslStandard = (dsl: string): boolean => {\n try {\n const ast = DslParser.parse(EncodingParser.withoutArrow(dsl));\n const seriesIdx = findLastIndex(ast, {\n type: 'method',\n name: 'seriesByName',\n });\n const renameIdx = findLastIndex(ast, {\n type: 'method',\n name: 'renameSeries',\n });\n return seriesIdx !== -1 && renameIdx !== -1 && seriesIdx < renameIdx;\n } catch {\n return false;\n }\n};\n\n/**\n * Simple validation to check that a DSL string matches the standard config for the\n * options items field of Dynamic Options.\n */\nconst isItemsDslStandard = (dsl: string): boolean => {\n try {\n const ast = DslParser.parse(EncodingParser.withoutArrow(dsl));\n return (\n ast.length === 3 &&\n isMatch(ast[0], { type: 'method', name: 'frame' }) &&\n isMatch(ast[1], { type: 'method', name: 'prepend' }) &&\n isMatch(ast[2], { type: 'method', name: 'objects' })\n );\n } catch {\n return false;\n }\n};\n\n/**\n * Simple validation to determine if the config of an input matches the schema for the\n * Dynamic Options.\n */\nexport const isConfigAdvanced = ({\n items,\n context,\n}: {\n items?: StaticItem[] | string;\n context: DynamicOptionsContext;\n}): boolean => {\n if (typeof items !== 'string') {\n return false;\n }\n\n const { label, value } = context;\n if (typeof label !== 'string' || typeof value !== 'string') {\n return true;\n }\n\n return !isItemsDslStandard(items) || !isFieldNameDslStandard(label) || !isFieldNameDslStandard(value);\n};\n\n/**\n * Retrieves static items and Dynamic Options for a dropdown/multiselect input from the input\n * config.\n */\nexport const getDynamicOptionsFromConfig = ({\n items,\n context,\n}: {\n items?: StaticItem[] | string;\n context: DynamicOptionsContext;\n}): {\n staticOptions: StaticItem[];\n dynamicOptionsLabel: string;\n dynamicOptionsValue: string;\n} => {\n if (Array.isArray(items)) {\n return {\n staticOptions: items,\n dynamicOptionsLabel: '',\n dynamicOptionsValue: '',\n };\n }\n\n const statics = context.statics || [];\n const staticOptions = zipWith(...statics, (label: string, value: string) => ({\n label,\n value,\n }));\n\n const { label, value } = context;\n\n const dynamicOptionsLabel = label ? getFieldFromFieldNameDsl(label) : '';\n const dynamicOptionsValue = value ? getFieldFromFieldNameDsl(value) : '';\n\n return {\n staticOptions,\n dynamicOptionsLabel,\n dynamicOptionsValue,\n };\n};\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@splunk/react-icons/SlidersDoubleHorizontal\");","module.exports = require(\"@splunk/react-ui/Button\");","module.exports = require(\"@splunk/react-ui/ColumnLayout\");","module.exports = require(\"@splunk/react-ui/ControlGroup\");","module.exports = require(\"@splunk/react-ui/FormRows\");","module.exports = require(\"@splunk/react-ui/Select\");","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/format\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-context/DataSourceContext\");","module.exports = require(\"@splunk/visualization-encoding/DslParser\");","module.exports = require(\"@splunk/visualization-encoding/EncodingParser\");","module.exports = require(\"@splunk/visualization-encoding/utils/dsl\");","module.exports = require(\"@splunk/visualization-encoding/utils/types\");","module.exports = require(\"@splunk/visualizations-shared/dataSourceUtils\");","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__(7585);\n"],"names":["RowContainer","styled","formRowHeader","React","_","removeItem","items","index","filter","_item","idx","isItemError","value","key","trim","i","length","isLabelError","label","isValueError","InputContainer","defaultValue","StaticItemEditor","onChange","name","labelPosition","validate","staticItems","setItems","useState","nextIndex","setIndex","useEffect","handleChange","useCallback","newItems","isEqual","some","uniqBy","item","handleRequestRemove","_evt","handleRequestMove","fromIndex","toIndex","splice","handleItemChange","_name","val","_objectSpread","handleRequestAdd","concat","rows","map","l","v","FormRows","onRequestRemove","TextEditor","hideLabel","error","ControlGroup","addLabel","header","onRequestAdd","onRequestMove","propTypes","T","isRequired","require","defaultLabelStyle","_ref","labelWidth","labelStyle","isAdvanced","isDisabled","help","tooltip","otherProps","_objectWithoutProperties","_excluded","setValueState","handleValidate","newValue","errorState","setErrorState","debouncedHandleValidate","useMemo","debounce","newVal","cancel","_event","handleBlur","event","newError","handleKeyPress","style","message","Text","_extends","editorStyle","onKeyDown","onBlur","disabled","canClear","BaseEditorPropTypes","dataSourceKey","string","prepareValue","func","filterByTypes","arrayOf","ColumnSelectionEditor","dataSourceBindings","id","dataSource","useDataSource","columns","fields","data","availableFieldsWithTypes","getAvailableFieldsWithTypes","fieldName","getFieldsFromDSL","selectedField","setSelectedField","setFilter","filteredFields","field","indexOf","footerMessage","useColumnSelectorFooterMessage","availableFields","selectedFields","handleValueChange","selectedValue","update","options","handleFilterChange","e","keyword","hasError","isMissing","isLoading","getDataSourceStateInfo","placeholderMessage","getPlaceholderMessage","onFilterChange","placeholder","isLoadingOptions","Option","type","find","f","defaultHelpText","DynamicItemEditor","context","dynamicItemsLabelField","setLabel","dynamicItemsValueField","setValue","staticOptions","dynamicOptionsLabel","dynamicOptionsValue","getDynamicOptionsFromConfig","undefined","primary","Array","isArray","formattedConfig","formattedStatics","statics","newLabelField","newValueField","unzip","number","prefix","handleStaticItemChange","handleDynamicLabelFieldChange","newLabel","handleDynamicValueFieldChange","prepareDynamicFieldValue","config","fieldDsl","getFieldFromFieldNameDsl","isConfigAdvanced","toString","dataSourceConfigured","gutter","VERTICAL_EDITOR_SPACING","Row","oneOfType","shape","oneOf","any","noSelectedFieldsInfo","selectedFilteredFields","validSelectedFields","Set","has","ColumnSelectorFooterMessage","numSelected","numFiltered","numAvailable","dataSourceApi","useContext","setDataSource","get","unsubscribe","isFunction","subscribe","snapshot","object","bool","optionsSchema","ControlGroupContainer","variables","spacingMedium","StyledToolTip","StyledAdvancedConfigButton","contentColorActive","interactiveColorOverlayDrag","AdvancedConfigButton","onClick","content","icon","appearance","AdvancedControlGroup","dataTest","children","controlsLayout","onAdvancedConfigButtonClick","Children","toArray","Boolean","child","cloneElement","flex","footerMessageText","sprintf","filtered","available","selected","shown","FLYOUT_PADDING","COLUMN_FLYOUT_PADDING","FLYOUT_WIDTH","DROPDOWN_MENU_WIDTH","width","canInferTypeFromMeta","getDataTypeForMeta","inferDataTypeFromData","getFilteredFields","sanitizeFieldNames","fieldNames","includes","defaultMessage","dsl","ast","DslParser","parse","withoutArrow","seriesByNameNode","isFieldNameDslStandard","seriesIdx","findLastIndex","renameIdx","isMatch","isItemsDslStandard","zipWith","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":"DynamicItemEditor.js","mappings":";;;;4xBASA,MAAMA,EAAeC,IAAAA,GAAU;;;;;;;EASzBC,EACFC,IAAAA,cAACH,EAAY,KACTG,IAAAA,cAAA,QAAM,YAAU,0BAAyBC,EAAAA,EAAAA,GAAE,UAC3CD,IAAAA,cAAA,QAAM,YAAU,0BAAyBC,EAAAA,EAAAA,GAAE,WAU7CC,EAAaA,CAACC,EAAOC,IAAUD,EAAME,QAAO,CAACC,EAAOC,IAAQA,IAAQH,IAyBpEI,EAAcA,CAACC,EAAON,EAAOO,IAEV,iBAAVD,GAAuC,KAAjBA,EAAME,QAKhCR,EAAME,QAAOO,GAAKA,EAAEF,KAASD,IAAOI,OAAS,EAGlDC,EAAeA,CAACC,EAAOZ,IAAUK,EAAYO,EAAOZ,EAAO,SAC3Da,EAAeA,CAACP,EAAON,IAAUK,EAAYC,EAAON,EAAO,SAE3Dc,EAAiBnB,IAAAA,GAAU;;EAI3BoB,EAAe,GAEfC,EAAmBA,EACrBC,WACAC,OACAZ,QAAQS,EACRI,gBAAgB,MAChBP,QAAQ,GACRQ,eAEA,MAAOC,EAAaC,IAAYC,EAAAA,EAAAA,UAASjB,IAClCkB,EAAWC,IAAYF,EAAAA,EAAAA,UAASjB,EAAMI,SAE7CgB,EAAAA,EAAAA,YAAU,KACNJ,EAAShB,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el/runtime/helpers/objectWithoutProperties\"","webpack://@splunk/dynamic-editors/./src/editors/TextEditor.jsx","webpack://@splunk/dynamic-editors/./src/editors/ColumnSelectionEditor.tsx","webpack://@splunk/dynamic-editors/./src/editors/DynamicItemEditor.tsx","webpack://@splunk/dynamic-editors/./src/editors/useColumnSelectorFooterMessage.tsx","webpack://@splunk/dynamic-editors/./src/hooks/useDataSource.tsx","webpack://@splunk/dynamic-editors/./src/interfaces/BaseEditorProps.ts","webpack://@splunk/dynamic-editors/./src/shared/AdvancedControlGroup.tsx","webpack://@splunk/dynamic-editors/./src/shared/ColumnSelectorFooterMessage.tsx","webpack://@splunk/dynamic-editors/./src/shared/dimensionConstants.ts","webpack://@splunk/dynamic-editors/./src/utils/columnSelectionUtils.ts","webpack://@splunk/dynamic-editors/./src/utils/dynamicItemInputEditor.ts","webpack://@splunk/dynamic-editors/external commonjs2 \"@babel/runtime/helpers/defineProperty\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@babel/runtime/helpers/extends\"","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/ColumnLayout\"","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/Select\"","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/format\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/ui-utils/i18n\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-context/DataSourceContext\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-encoding/DslParser\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-encoding/EncodingParser\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-encoding/utils/dsl\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualization-encoding/utils/types\"","webpack://@splunk/dynamic-editors/external commonjs2 \"@splunk/visualizations-shared/dataSourceUtils\"","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":["import React, { useCallback, useState, useEffect } from 'react';\nimport T from 'prop-types';\nimport styled from 'styled-components';\nimport { isEqual, uniqBy } from 'lodash';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport FormRows from '@splunk/react-ui/FormRows';\nimport TextEditor from './TextEditor';\nimport ControlGroup from '../shared/AdvancedControlGroup';\n\nconst RowContainer = styled.div`\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 10px;\n [data-test='control-group'] {\n margin: 0;\n }\n`;\n\nconst formRowHeader = (\n <RowContainer>\n <span data-test=\"form-row-header-label\">{_('Label')}</span>\n <span data-test=\"form-row-header-value\">{_('Value')}</span>\n </RowContainer>\n);\n\n/**\n * Remove an item from an array, return a new array\n * @param {Array} items The list of items\n * @param {Number} index The index of the item to remove\n * @returns {Array} list of items without the item at the specified index\n */\nconst removeItem = (items, index) => items.filter((_item, idx) => idx !== index);\n\n/**\n * Detect when a list of static items contains an invalid entry\n * @param {StaticItem[]} items List of static items\n * @returns {Boolean} true when no label or value is an empty string\n */\nconst isValid = items =>\n // exit early when an error found\n !items.some(\n ({ label, value }) =>\n typeof label !== 'string' ||\n label.trim() === '' ||\n typeof value !== 'string' ||\n value.trim() === ''\n ) &&\n uniqBy(items, item => item.value).length === items.length &&\n uniqBy(items, item => item.label).length === items.length;\n\n/**\n * Detect if a label or value in the list is an error case\n * @param {String} value either an item label or value\n * @param {StaticItem[]} items List of all items\n * @param {label | value} key The StaticItem key to check\n */\nconst isItemError = (value, items, key) => {\n // Just have an invalid type\n if (typeof value !== 'string' || value.trim() === '') {\n return true;\n }\n\n // Check the value is unique\n return items.filter(i => i[key] === value).length > 1;\n};\n\nconst isLabelError = (label, items) => isItemError(label, items, 'label');\nconst isValueError = (value, items) => isItemError(value, items, 'value');\n\nconst InputContainer = styled.div`\n width: 100%;\n`;\n\nconst defaultValue = [];\n\nconst StaticItemEditor = ({\n onChange,\n name,\n value = defaultValue,\n labelPosition = 'top',\n label = '',\n validate,\n}) => {\n const [staticItems, setItems] = useState(value);\n const [nextIndex, setIndex] = useState(value.length);\n\n useEffect(() => {\n setItems(value);\n if (value.length > nextIndex) {\n setIndex(value.length);\n }\n }, [value, nextIndex]);\n\n const handleChange = useCallback(\n newItems => {\n if (!isEqual(newItems, value) && isValid(newItems)) {\n // don't save newItems to state,\n // as this component will get a prop change as a result of the onChange call\n onChange(null, name, newItems);\n } else {\n // save invalid values so UI updates.\n setItems(newItems);\n }\n },\n [value, name, onChange]\n );\n\n const handleRequestRemove = useCallback(\n (_evt, { index }) => {\n const newItems = removeItem(staticItems, index);\n\n handleChange(newItems);\n },\n [staticItems, handleChange]\n );\n\n const handleRequestMove = useCallback(\n ({ fromIndex, toIndex }) => {\n const item = staticItems[fromIndex];\n const newItems = removeItem(staticItems, fromIndex);\n\n newItems.splice(toIndex, 0, item);\n handleChange(newItems);\n },\n [staticItems, handleChange]\n );\n\n const handleItemChange = useCallback(\n (idx, key) =>\n (_evt, _name, val = '') => {\n const item = staticItems[idx];\n const newItems = [...staticItems];\n\n newItems.splice(idx, 1, { ...item, [key]: val.trim() });\n handleChange(newItems);\n },\n [staticItems, handleChange]\n );\n\n const handleRequestAdd = useCallback(() => {\n const newItems = staticItems.concat({\n label: `Label ${nextIndex}`,\n value: `menu_v${nextIndex}`,\n });\n\n setIndex(nextIndex + 1);\n handleChange(newItems);\n }, [staticItems, nextIndex, handleChange]);\n\n const rows = staticItems.map((item, idx) => {\n const { label: l, value: v } = item;\n return (\n <FormRows.Row\n index={idx}\n // eslint-disable-next-line react/no-array-index-key\n key={`${l}_${v}_${idx}`} // NOSONAR\n onRequestRemove={handleRequestRemove}\n >\n <RowContainer>\n <TextEditor\n label={_('Label')}\n hideLabel\n value={l}\n onChange={handleItemChange(idx, 'label')}\n name=\"item-label-editor\"\n error={isLabelError(l, staticItems)}\n validate={validate}\n />\n <TextEditor\n label={_('Value')}\n hideLabel\n value={v}\n onChange={handleItemChange(idx, 'value')}\n name=\"item-value-editor\"\n error={isValueError(v, staticItems)}\n validate={validate}\n />\n </RowContainer>\n </FormRows.Row>\n );\n });\n\n return (\n <ControlGroup label={label} labelPosition={labelPosition}>\n <InputContainer>\n <FormRows\n addLabel={_('Add new')}\n header={formRowHeader}\n onRequestAdd={handleRequestAdd}\n onRequestMove={handleRequestMove}\n >\n {rows}\n </FormRows>\n </InputContainer>\n </ControlGroup>\n );\n};\n\nStaticItemEditor.propTypes = {\n /**\n * Callback when changing the text value\n *\n * onChange function has the following properties\n * @param {SyntheticEvent} event The react `SyntheticEvent`\n * @param {String} name The option name\n * @param {StaticItem[]} 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,\n /**\n * The option value\n */\n value: T.arrayOf(T.exact({ label: T.string, value: T.string })),\n /**\n * Label position\n */\n labelPosition: T.oneOf(['top', 'left']),\n /**\n * Validate the value of the editor\n */\n validate: T.func,\n};\n\nexport default StaticItemEditor;\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/objectWithoutProperties\");","import React, { useState, useCallback, useEffect, useMemo } from 'react';\nimport T from 'prop-types';\nimport { debounce } from 'lodash';\nimport Text from '@splunk/react-ui/Text';\nimport ControlGroup from '../shared/AdvancedControlGroup';\nimport { editorStyle } from '../shared/dimensionConstants';\n\nconst defaultLabelStyle = {};\n\nconst TextEditor = ({\n onChange,\n name,\n value = '',\n label,\n labelPosition = 'top',\n labelWidth,\n labelStyle = defaultLabelStyle,\n hideLabel = false,\n isAdvanced,\n isDisabled = false,\n help,\n tooltip,\n validate,\n error,\n ...otherProps\n}) => {\n const [val, setValueState] = useState(value);\n\n const handleValidate = useCallback(\n newValue => (typeof validate === 'function' ? validate({ value: newValue }) : null),\n [validate]\n );\n const [errorState, setErrorState] = useState(handleValidate(value));\n const debouncedHandleValidate = useMemo(\n () =>\n debounce(newVal => {\n setErrorState(handleValidate(newVal));\n }, 250),\n [handleValidate]\n );\n\n useEffect(\n () => () => {\n // cancel debounce on component unmount\n debouncedHandleValidate.cancel();\n },\n [debouncedHandleValidate]\n );\n\n useEffect(() => {\n setValueState(value);\n setErrorState(handleValidate(value));\n }, [handleValidate, value]);\n\n const handleChange = useCallback(\n (_event, { value: v }) => {\n setValueState(v);\n debouncedHandleValidate(v);\n },\n [debouncedHandleValidate]\n );\n\n const handleBlur = useCallback(\n event => {\n const newVal = val.trim();\n if (newVal === value) {\n return;\n }\n const newError = handleValidate(newVal);\n // set error if there is one, or clear an existing error\n setErrorState(newError);\n if (!newError) {\n // only change value if there is no validation error\n onChange(event, name, newVal);\n }\n },\n [val, value, handleValidate, onChange, name]\n );\n\n const handleKeyPress = useCallback(\n event => {\n if (event.key === 'Enter') {\n handleBlur(event);\n }\n },\n [handleBlur]\n );\n\n const style = useMemo(\n () =>\n !label || label === ''\n ? {\n ...labelStyle,\n }\n : labelStyle,\n [label, labelStyle]\n );\n\n return (\n <ControlGroup\n label={label}\n labelPosition={labelPosition}\n labelWidth={labelWidth}\n style={style}\n hideLabel={hideLabel}\n help={help}\n tooltip={tooltip}\n error={errorState?.message || error}\n isAdvanced={isAdvanced}\n >\n <Text\n key={value}\n data-test={name}\n style={editorStyle}\n onChange={handleChange}\n onKeyDown={handleKeyPress}\n onBlur={handleBlur}\n value={val}\n disabled={isDisabled}\n canClear\n {...otherProps}\n error={!!errorState || error}\n />\n </ControlGroup>\n );\n};\n\nTextEditor.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 /**\n * Label width\n */\n labelWidth: T.number,\n /**\n * Styles to be passed to the ControlGroup\n */\n labelStyle: T.object,\n /**\n * Visually hide the label, but render it for screen readers\n */\n hideLabel: T.bool,\n /**\n * As advanced editor to show advanced config button\n */\n isAdvanced: T.bool,\n /**\n * Disabled state of component\n */\n isDisabled: T.bool,\n /**\n * Validate the value of the editor\n */\n validate: T.func,\n /**\n * If the input should display error state\n */\n error: T.bool,\n /**\n * Text to display under the the input\n */\n help: T.string,\n /**\n * Text to display in a tooltip next to the label\n */\n tooltip: T.string,\n};\n\nexport default TextEditor;\n","import React, { useState, useCallback } from 'react';\nimport * as T from 'prop-types';\nimport Select from '@splunk/react-ui/Select';\nimport { getFieldsFromDSL } from '@splunk/visualization-encoding/utils/dsl';\nimport { getDataSourceStateInfo } from '@splunk/visualizations-shared/dataSourceUtils';\nimport { DataType } from '@splunk/visualization-encoding/DataPrimitive';\nimport { BaseEditorPropTypes } from '../interfaces/BaseEditorProps';\nimport type { BaseEditorProps } from '../interfaces/BaseEditorProps';\nimport { useDataSource } from '../hooks/useDataSource';\nimport { getAvailableFieldsWithTypes, getPlaceholderMessage } from '../utils/columnSelectionUtils';\nimport ControlGroup from '../shared/AdvancedControlGroup';\nimport { editorStyle } from '../shared/dimensionConstants';\nimport { useColumnSelectorFooterMessage } from './useColumnSelectorFooterMessage';\n\ninterface ColumnSelectionEditorProps extends BaseEditorProps {\n dataSourceKey: string;\n prepareValue?: (id: Record<string, any>) => Record<string, any>;\n filterByTypes?: DataType[];\n tooltip?: string;\n}\nconst propTypes: Record<keyof ColumnSelectionEditorProps, T.Validator<any>> = {\n ...BaseEditorPropTypes,\n dataSourceKey: T.string.isRequired,\n prepareValue: T.func,\n filterByTypes: T.arrayOf(T.string),\n tooltip: T.string,\n};\nexport const ColumnSelectionEditor: React.FunctionComponent<ColumnSelectionEditorProps> = ({\n name,\n value,\n label = '',\n labelPosition = 'top',\n dataSourceKey = 'primary',\n dataSourceBindings,\n prepareValue = (id: Record<string, unknown>): Record<string, unknown> => id,\n onChange,\n isAdvanced,\n isDisabled,\n filterByTypes,\n tooltip,\n}) => {\n const dataSource = useDataSource({ dataSourceBindings, dataSourceKey });\n const { columns, fields } = dataSource?.data || { columns: [], fields: [] };\n const availableFieldsWithTypes = getAvailableFieldsWithTypes(columns, fields);\n // return `value` if `value` is undefined or null so editor shows placeholder message\n const fieldName =\n value == null\n ? value\n : getFieldsFromDSL(value, {\n [dataSourceKey]: dataSource,\n })[0] || '';\n const [selectedField, setSelectedField] = useState(fieldName);\n React.useEffect((): void => {\n setSelectedField(fieldName);\n }, [fieldName]);\n const [filter, setFilter] = useState('');\n const filteredFields = availableFieldsWithTypes.filter(\n (field): boolean => field.name.indexOf(filter) !== -1\n );\n const footerMessage = useColumnSelectorFooterMessage({\n availableFields: availableFieldsWithTypes,\n selectedFields: [selectedField],\n filteredFields,\n filter,\n });\n\n const handleValueChange = useCallback(\n (event, { value: selectedValue }): void => {\n setSelectedField(selectedValue);\n const update = prepareValue({\n options: {\n [name]: `> ${dataSourceKey} | seriesByName('${selectedValue}')`,\n },\n });\n onChange(event, update);\n },\n [dataSourceKey, name, onChange, prepareValue]\n );\n\n const handleFilterChange = useCallback((e, { keyword }): void => {\n setFilter(keyword);\n }, []);\n const { hasError, isMissing, isLoading } = getDataSourceStateInfo(dataSource);\n const disabled = isMissing || hasError || isDisabled;\n const placeholderMessage = getPlaceholderMessage({ isMissing, isLoading, hasError });\n\n return (\n <ControlGroup label={label} labelPosition={labelPosition} tooltip={tooltip} isAdvanced={isAdvanced}>\n <Select\n data-test=\"ColumnSelectionEditor\"\n value={selectedField}\n onFilterChange={handleFilterChange}\n onChange={handleValueChange}\n footerMessage={footerMessage}\n disabled={disabled}\n placeholder={placeholderMessage}\n isLoadingOptions={isLoading}\n error={hasError}\n style={editorStyle}\n filter\n >\n {filteredFields.map(field => (\n <Select.Option\n key={field.name}\n label={`${field.name} (${field.type})`}\n value={field.name}\n disabled={!!filterByTypes?.length && !filterByTypes.find(f => f === field.type)}\n />\n ))}\n </Select>\n </ControlGroup>\n );\n};\nColumnSelectionEditor.propTypes = propTypes;\n\nexport default ColumnSelectionEditor;\n","import * as React from 'react';\nimport * as T from 'prop-types';\nimport { unzip } from 'lodash';\nimport Text from '@splunk/react-ui/Text';\nimport ControlGroup from '@splunk/react-ui/ControlGroup';\nimport ColumnLayout from '@splunk/react-ui/ColumnLayout';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport ColumnSelectionEditor from './ColumnSelectionEditor';\nimport StaticItemEditor from './StaticItemEditor';\nimport {\n getDynamicOptionsFromConfig,\n getFieldFromFieldNameDsl,\n isConfigAdvanced,\n} from '../utils/dynamicItemInputEditor';\nimport { VERTICAL_EDITOR_SPACING } from '../shared/dimensionConstants';\nimport type { StaticItem, DynamicOptionsContext } from '../types';\n\ninterface DynamicOptionsConfig {\n context?: DynamicOptionsContext;\n options?: Record<string, unknown>;\n}\n\ninterface DynamicItemEditorProps {\n name: string;\n value: StaticItem[] | string;\n label: string;\n labelPosition?: 'top' | 'left';\n labelWidth?: number;\n onChange: (event: React.SyntheticEvent | null, updatedConfig: DynamicOptionsConfig) => void;\n context: DynamicOptionsContext;\n dataSourceBindings: { primary?: string };\n help?: string;\n validate?: (args: { value: string }) => { message: string } | null;\n [key: string]: unknown;\n}\n\nconst defaultHelpText = _(\n 'Advanced configuration options are being used by this input. Please edit in source mode.'\n);\n\nconst DynamicItemEditor = ({\n name,\n context,\n value = '',\n label,\n onChange,\n dataSourceBindings,\n labelPosition = 'top',\n labelWidth,\n help = defaultHelpText,\n validate,\n}: DynamicItemEditorProps): JSX.Element => {\n const [staticItems, setItems] = React.useState<StaticItem[]>([]);\n const [dynamicItemsLabelField, setLabel] = React.useState('');\n const [dynamicItemsValueField, setValue] = React.useState('');\n\n // update static and dynamic options when the props change\n React.useEffect(() => {\n const { staticOptions, dynamicOptionsLabel, dynamicOptionsValue } = getDynamicOptionsFromConfig({\n items: value,\n context,\n });\n\n setItems(staticOptions);\n setLabel(dynamicOptionsLabel);\n setValue(dynamicOptionsValue);\n }, [value, context]);\n\n // use static mode if no data source is configured\n React.useEffect(() => {\n const currDataSource = dataSourceBindings.primary;\n if (currDataSource !== undefined || Array.isArray(value)) {\n return;\n }\n\n onChange(null, {\n context: {\n formattedConfig: undefined,\n formattedStatics: undefined,\n statics: undefined,\n label: undefined,\n value: undefined,\n },\n options: {\n [name]: staticItems,\n },\n });\n }, [dataSourceBindings, name, value, onChange, staticItems]);\n\n const handleChange = React.useCallback(\n (newItems, newLabelField, newValueField) => {\n const isStaticConfiguration = Array.isArray(value) && (!newLabelField || !newValueField);\n\n if (isStaticConfiguration) {\n onChange(null, { options: { [name]: newItems } });\n } else {\n const statics: string[][] = unzip(\n newItems.map(({ label: l, value: v }: StaticItem) => [l, v])\n );\n onChange(null, {\n context: {\n formattedConfig: { number: { prefix: '' } },\n formattedStatics: '>statics | formatByType(formattedConfig)',\n statics,\n label: `>primary | seriesByName(\"${newLabelField}\") | renameSeries(\"label\") | formatByType(formattedConfig)`,\n value: `>primary | seriesByName(\"${newValueField}\") | renameSeries(\"value\") | formatByType(formattedConfig)`,\n },\n options: {\n [name]: '>frame(label, value) | prepend(formattedStatics) | objects()',\n },\n });\n }\n },\n [name, value, onChange]\n );\n\n const handleStaticItemChange = React.useCallback(\n (_event, _name, newItems) => {\n handleChange(newItems, dynamicItemsLabelField, dynamicItemsValueField);\n },\n [handleChange, dynamicItemsLabelField, dynamicItemsValueField]\n );\n\n const handleDynamicLabelFieldChange = React.useCallback(\n (_event, { value: newLabel }) => {\n if (dynamicItemsValueField === '') {\n // it is unecessary to update the definition until both label and value are set\n setLabel(newLabel);\n } else {\n handleChange(staticItems, newLabel, dynamicItemsValueField);\n }\n },\n [handleChange, staticItems, dynamicItemsValueField]\n );\n\n const handleDynamicValueFieldChange = React.useCallback(\n (_event, { value: newValue }) => {\n if (dynamicItemsLabelField === '') {\n // it is unecessary to update the definition until both label and value are set\n setValue(newValue);\n } else {\n handleChange(staticItems, dynamicItemsLabelField, newValue);\n }\n },\n [handleChange, staticItems, dynamicItemsLabelField]\n );\n\n const prepareDynamicFieldValue =\n (key: string) =>\n (config: DynamicOptionsConfig): Record<string, unknown> => {\n const fieldDsl = config?.options?.[key];\n if (typeof fieldDsl === 'string') {\n return { value: getFieldFromFieldNameDsl(fieldDsl) };\n }\n return { value: '' };\n };\n\n const usingAdvancedConfig = React.useMemo(\n () => isConfigAdvanced({ items: value, context }),\n [value, context]\n );\n if (usingAdvancedConfig) {\n return (\n <ControlGroup label={_(label)} labelPosition={labelPosition} labelWidth={labelWidth} help={help}>\n <Text key={value.toString()} data-test={name} disabled defaultValue={value.toString()} />\n </ControlGroup>\n );\n }\n\n const dataSourceConfigured = !!dataSourceBindings.primary;\n return (\n <>\n <StaticItemEditor\n name=\"\"\n label={_('Static menu configuration')}\n labelPosition={labelPosition}\n value={staticItems}\n onChange={handleStaticItemChange}\n validate={validate}\n />\n {dataSourceConfigured && (\n <ColumnLayout key=\"dynamic-item-editor-label-value-layout\" gutter={VERTICAL_EDITOR_SPACING}>\n <ColumnLayout.Row key=\"dynamic-item-editor-label-row\">\n <ColumnSelectionEditor\n name=\"label\"\n label={_('Dynamic menu label field')}\n dataSourceKey=\"primary\"\n dataSourceBindings={dataSourceBindings}\n value={`>primary | seriesByName(\"${dynamicItemsLabelField}\")`}\n context={context}\n onChange={handleDynamicLabelFieldChange}\n prepareValue={prepareDynamicFieldValue('label')}\n />\n </ColumnLayout.Row>\n <ColumnLayout.Row key=\"dynamic-item-editor-value-row\">\n <ColumnSelectionEditor\n name=\"value\"\n label={_('Dynamic menu value field')}\n dataSourceKey=\"primary\"\n dataSourceBindings={dataSourceBindings}\n value={`>primary | seriesByName(\"${dynamicItemsValueField}\")`}\n context={context}\n onChange={handleDynamicValueFieldChange}\n prepareValue={prepareDynamicFieldValue('value')}\n />\n </ColumnLayout.Row>\n </ColumnLayout>\n )}\n </>\n );\n};\n\nDynamicItemEditor.propTypes = {\n /**\n * Callback when changing the text value\n *\n * onChange function has the following properties\n * @param {SyntheticEvent} event The react `SyntheticEvent`\n * @param {String} name The option name\n * @param {StaticItem[]} 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.oneOfType([\n T.arrayOf(\n T.shape({\n label: T.string.isRequired,\n value: T.string.isRequired,\n }).isRequired\n ),\n T.string,\n ]),\n /**\n * Label position\n */\n labelPosition: T.oneOf(['top', 'left']),\n /**\n * Label width\n */\n labelWidth: T.number,\n /**\n * The context object\n */\n context: T.shape({\n label: T.string,\n value: T.string,\n statics: T.arrayOf(T.arrayOf(T.string.isRequired).isRequired),\n }).isRequired,\n /**\n * Primary data source binding\n */\n dataSourceBindings: T.shape({ primary: T.any }).isRequired,\n help: T.string,\n};\n\nexport default DynamicItemEditor;\n","import React, { useMemo } from 'react';\nimport { ColumnSelectorFooterMessage } from '../shared/ColumnSelectorFooterMessage';\nimport type { FieldTuple } from '../utils/columnSelectionUtils';\n\ntype ObjectWithName = {\n name: string;\n [key: string]: string;\n};\n\ntype Fields = FieldTuple[] | ObjectWithName[];\n\ninterface FooterMessageProps {\n noSelectedFieldsInfo?: boolean;\n filter: string;\n availableFields: Fields;\n selectedFields?: string[];\n filteredFields: Fields;\n}\n\nexport const useColumnSelectorFooterMessage = ({\n filter,\n availableFields,\n selectedFields,\n filteredFields,\n noSelectedFieldsInfo = false,\n}: FooterMessageProps) => {\n const selectedFilteredFields = useMemo(() => {\n if (!selectedFields || !filteredFields) return [];\n\n const validSelectedFields = new Set(\n selectedFields.filter(field => field !== '' && field !== undefined)\n );\n\n return filteredFields.filter(item => validSelectedFields.has(item.name));\n }, [selectedFields, filteredFields]);\n\n // make sure to display only 'No matches' text when there is no result of filtering\n if (filter && !filteredFields.length) {\n return null;\n }\n\n return (\n <ColumnSelectorFooterMessage\n noSelectedFieldsInfo={noSelectedFieldsInfo}\n numSelected={selectedFilteredFields?.length} // if no filter is applied filteredFields equal availableFields\n numFiltered={filteredFields.length}\n numAvailable={availableFields.length}\n filter={filter}\n />\n );\n};\n","import { useState, useEffect, useContext } from 'react';\nimport DataSourceContext, {\n type BindingsSnapshot,\n type DataSourceApi,\n} from '@splunk/visualization-context/DataSourceContext';\nimport { get, isFunction } from 'lodash';\n\ninterface UseDataSourceParams {\n dataSourceBindings: BindingsSnapshot;\n dataSourceKey: string;\n}\n// @TODO(pwied): use DataSource interface in return type (w/o dependency on @splunk/visualizations)\nexport const useDataSource = ({\n dataSourceBindings,\n dataSourceKey,\n}: UseDataSourceParams): BindingsSnapshot => {\n const dataSourceApi = useContext<DataSourceApi>(DataSourceContext);\n const [dataSource, setDataSource] = useState<BindingsSnapshot>();\n useEffect((): (() => void) => {\n if (!get(dataSourceBindings, dataSourceKey)) {\n setDataSource(null);\n return () => undefined;\n }\n const unsubscribe =\n isFunction(dataSourceApi.subscribe) &&\n dataSourceApi.subscribe(dataSourceKey, (snapshot): void => setDataSource(snapshot));\n return () => {\n if (unsubscribe) {\n unsubscribe();\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dataSourceBindings]);\n return dataSource;\n};\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","import * as React from 'react';\nimport { sprintf } from '@splunk/ui-utils/format';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport { useMemo } from 'react';\n\ninterface FooterProps {\n filter: string;\n numSelected?: number;\n numFiltered: number;\n numAvailable: number;\n noSelectedFieldsInfo?: boolean; // it is needed for AddColumn component which has different logic than other selection editors\n}\n\nexport const ColumnSelectorFooterMessage = ({\n numSelected,\n numFiltered,\n numAvailable,\n filter,\n noSelectedFieldsInfo,\n}: FooterProps) => {\n const footerMessageText = useMemo(() => {\n if (filter) {\n if (noSelectedFieldsInfo) {\n return sprintf(_('%(filtered)d filtered from %(available)d fields'), {\n filtered: numFiltered,\n available: numAvailable,\n });\n }\n return sprintf(_('%(selected)d selected from %(filtered)d filtered'), {\n selected: numSelected,\n filtered: numFiltered,\n });\n }\n return noSelectedFieldsInfo\n ? sprintf(_('%(shown)d of %(available)d fields'), {\n shown: numFiltered,\n available: numAvailable,\n })\n : sprintf(_('%(selected)d selected from %(available)d'), {\n selected: numSelected,\n available: numAvailable,\n });\n }, [filter, noSelectedFieldsInfo, numFiltered, numAvailable, numSelected]);\n\n return (\n <span data-test=\"footer-message\" aria-live=\"polite\" aria-atomic=\"true\">\n {footerMessageText}\n </span>\n );\n};\n","export const FLYOUT_PADDING = 21;\nexport const COLUMN_FLYOUT_PADDING = 16;\nexport const FLYOUT_WIDTH = 344;\n\nexport const VERTICAL_EDITOR_SPACING = 16;\n\nexport const DROPDOWN_MENU_WIDTH = 327;\n\nexport const editorStyle = { width: '100%' };\n","import { _ } from '@splunk/ui-utils/i18n';\nimport {\n inferDataTypeFromData,\n canInferTypeFromMeta,\n getDataTypeForMeta,\n} from '@splunk/visualization-encoding/utils/types';\n\nexport interface FieldTuple {\n name: string;\n type: string;\n}\n\nexport const getAvailableFieldsWithTypes = (\n columns: unknown[][],\n fields: { name: string; type?: string }[]\n): FieldTuple[] => {\n const fieldsWithType = fields.map((field, index) => {\n const { name } = field;\n const inferredType = canInferTypeFromMeta(field)\n ? getDataTypeForMeta(field)\n : inferDataTypeFromData(columns[index]);\n return {\n name,\n type: inferredType,\n };\n });\n return fieldsWithType;\n};\n\nexport const getFilteredFields = (availableFieldsWithTypes: FieldTuple[], filter: string): FieldTuple[] => {\n return availableFieldsWithTypes.filter((field): boolean => field.name.indexOf(filter) !== -1);\n};\n\nexport const sanitizeFieldNames = (value: unknown, fieldNames: string[]): string[] => {\n if (typeof value === 'string' && fieldNames.includes(value)) {\n return [value];\n }\n if (Array.isArray(value)) {\n return value.filter(name => fieldNames.includes(name));\n }\n return [];\n};\n\nexport const getPlaceholderMessage = ({\n hasError,\n isLoading,\n isMissing,\n defaultMessage = 'Select a field from data source',\n}: {\n hasError: boolean;\n isLoading: boolean;\n isMissing: boolean;\n defaultMessage?: string;\n}): string => {\n if (isMissing) {\n return _('Set up data source to select');\n }\n if (hasError) {\n return _('Please set up valid data source to select');\n }\n if (isLoading) {\n return _('Loading data source...');\n }\n return _(defaultMessage);\n};\n","import { find, findLastIndex, get, isMatch, zipWith } from 'lodash';\nimport { DslParser } from '@splunk/visualization-encoding/DslParser';\nimport EncodingParser from '@splunk/visualization-encoding/EncodingParser';\nimport type { StaticItem, DynamicOptionsContext } from '../types';\n\n/**\n * The Dropdown/Multiselect inputs expect a config that has the following format. Additional\n * formatting clauses and options may be present. This is the \"standard dynamic config\".\n * {\n * context: {\n * statics: [\n * ['label1', 'label2', ...],\n * ['value1', 'value2', ...]\n * ],\n * label: '>primary | seriesByName(\"<label field name>\") | renameSeries('label'),\n * value: '>primary | seriesByName(\"<value field name>\") | renameSeries('value')\n * },\n * options: {\n * items: '>frame(label, value) | prepend(statics) | objects()'\n * }\n * }\n *\n * The \"standard static config\" is as follows. The contents of context do not matter.\n * {\n * context: {},\n * options: {\n * items: [\n * { label: 'label1', value: 'value1 },\n * { label: 'label2', value: 'value2 },\n * ...\n * ]\n * }\n * }\n *\n * \"Advanced configs\" are any config that does not follow the above formats.\n */\n\n/**\n * Retrieve the first field name from a DSL string containing seriesByName().\n */\nexport const getFieldFromFieldNameDsl = (dsl: string): string => {\n try {\n const ast = DslParser.parse(EncodingParser.withoutArrow(dsl));\n const seriesByNameNode = find(ast, {\n type: 'method',\n name: 'seriesByName',\n });\n return get(seriesByNameNode, ['args', '0', 'v'], '');\n } catch {\n return '';\n }\n};\n\n/**\n * Simple validation to check that a DSL string matches the standard config for the\n * context label/value field of Dynamic Options.\n */\nconst isFieldNameDslStandard = (dsl: string): boolean => {\n try {\n const ast = DslParser.parse(EncodingParser.withoutArrow(dsl));\n const seriesIdx = findLastIndex(ast, {\n type: 'method',\n name: 'seriesByName',\n });\n const renameIdx = findLastIndex(ast, {\n type: 'method',\n name: 'renameSeries',\n });\n return seriesIdx !== -1 && renameIdx !== -1 && seriesIdx < renameIdx;\n } catch {\n return false;\n }\n};\n\n/**\n * Simple validation to check that a DSL string matches the standard config for the\n * options items field of Dynamic Options.\n */\nconst isItemsDslStandard = (dsl: string): boolean => {\n try {\n const ast = DslParser.parse(EncodingParser.withoutArrow(dsl));\n return (\n ast.length === 3 &&\n isMatch(ast[0], { type: 'method', name: 'frame' }) &&\n isMatch(ast[1], { type: 'method', name: 'prepend' }) &&\n isMatch(ast[2], { type: 'method', name: 'objects' })\n );\n } catch {\n return false;\n }\n};\n\n/**\n * Simple validation to determine if the config of an input matches the schema for the\n * Dynamic Options.\n */\nexport const isConfigAdvanced = ({\n items,\n context,\n}: {\n items?: StaticItem[] | string;\n context: DynamicOptionsContext;\n}): boolean => {\n if (typeof items !== 'string') {\n return false;\n }\n\n const { label, value } = context;\n if (typeof label !== 'string' || typeof value !== 'string') {\n return true;\n }\n\n return !isItemsDslStandard(items) || !isFieldNameDslStandard(label) || !isFieldNameDslStandard(value);\n};\n\n/**\n * Retrieves static items and Dynamic Options for a dropdown/multiselect input from the input\n * config.\n */\nexport const getDynamicOptionsFromConfig = ({\n items,\n context,\n}: {\n items?: StaticItem[] | string;\n context: DynamicOptionsContext;\n}): {\n staticOptions: StaticItem[];\n dynamicOptionsLabel: string;\n dynamicOptionsValue: string;\n} => {\n if (Array.isArray(items)) {\n return {\n staticOptions: items,\n dynamicOptionsLabel: '',\n dynamicOptionsValue: '',\n };\n }\n\n const statics = context.statics || [];\n const staticOptions = zipWith(...statics, (label: string, value: string) => ({\n label,\n value,\n }));\n\n const { label, value } = context;\n\n const dynamicOptionsLabel = label ? getFieldFromFieldNameDsl(label) : '';\n const dynamicOptionsValue = value ? getFieldFromFieldNameDsl(value) : '';\n\n return {\n staticOptions,\n dynamicOptionsLabel,\n dynamicOptionsValue,\n };\n};\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@splunk/react-icons/SlidersDoubleHorizontal\");","module.exports = require(\"@splunk/react-ui/Button\");","module.exports = require(\"@splunk/react-ui/ColumnLayout\");","module.exports = require(\"@splunk/react-ui/ControlGroup\");","module.exports = require(\"@splunk/react-ui/FormRows\");","module.exports = require(\"@splunk/react-ui/Select\");","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/format\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-context/DataSourceContext\");","module.exports = require(\"@splunk/visualization-encoding/DslParser\");","module.exports = require(\"@splunk/visualization-encoding/EncodingParser\");","module.exports = require(\"@splunk/visualization-encoding/utils/dsl\");","module.exports = require(\"@splunk/visualization-encoding/utils/types\");","module.exports = require(\"@splunk/visualizations-shared/dataSourceUtils\");","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__(7585);\n"],"names":["RowContainer","styled","formRowHeader","React","_","removeItem","items","index","filter","_item","idx","isItemError","value","key","trim","i","length","isLabelError","label","isValueError","InputContainer","defaultValue","StaticItemEditor","onChange","name","labelPosition","validate","staticItems","setItems","useState","nextIndex","setIndex","useEffect","handleChange","useCallback","newItems","isEqual","some","uniqBy","item","handleRequestRemove","_evt","handleRequestMove","fromIndex","toIndex","splice","handleItemChange","_name","val","_objectSpread","handleRequestAdd","concat","rows","map","l","v","FormRows","onRequestRemove","TextEditor","hideLabel","error","ControlGroup","addLabel","header","onRequestAdd","onRequestMove","propTypes","T","isRequired","require","defaultLabelStyle","_ref","labelWidth","labelStyle","isAdvanced","isDisabled","help","tooltip","otherProps","_objectWithoutProperties","_excluded","setValueState","handleValidate","newValue","errorState","setErrorState","debouncedHandleValidate","useMemo","debounce","newVal","cancel","_event","handleBlur","event","newError","handleKeyPress","style","message","Text","_extends","editorStyle","onKeyDown","onBlur","disabled","canClear","BaseEditorPropTypes","dataSourceKey","string","prepareValue","func","filterByTypes","arrayOf","ColumnSelectionEditor","dataSourceBindings","id","dataSource","useDataSource","columns","fields","data","availableFieldsWithTypes","getAvailableFieldsWithTypes","fieldName","getFieldsFromDSL","selectedField","setSelectedField","setFilter","filteredFields","field","indexOf","footerMessage","useColumnSelectorFooterMessage","availableFields","selectedFields","handleValueChange","selectedValue","update","options","handleFilterChange","e","keyword","hasError","isMissing","isLoading","getDataSourceStateInfo","placeholderMessage","getPlaceholderMessage","onFilterChange","placeholder","isLoadingOptions","Option","type","find","f","defaultHelpText","DynamicItemEditor","context","dynamicItemsLabelField","setLabel","dynamicItemsValueField","setValue","staticOptions","dynamicOptionsLabel","dynamicOptionsValue","getDynamicOptionsFromConfig","undefined","primary","Array","isArray","formattedConfig","formattedStatics","statics","newLabelField","newValueField","unzip","number","prefix","handleStaticItemChange","handleDynamicLabelFieldChange","newLabel","handleDynamicValueFieldChange","prepareDynamicFieldValue","config","fieldDsl","getFieldFromFieldNameDsl","isConfigAdvanced","toString","dataSourceConfigured","gutter","VERTICAL_EDITOR_SPACING","Row","oneOfType","shape","oneOf","any","noSelectedFieldsInfo","selectedFilteredFields","validSelectedFields","Set","has","ColumnSelectorFooterMessage","numSelected","numFiltered","numAvailable","dataSourceApi","useContext","setDataSource","get","unsubscribe","isFunction","subscribe","snapshot","object","bool","optionsSchema","ControlGroupContainer","variables","spacingMedium","StyledToolTip","StyledAdvancedConfigButton","contentColorActive","interactiveColorOverlayDrag","AdvancedConfigButton","onClick","content","icon","appearance","AdvancedControlGroup","dataTest","children","controlsLayout","onAdvancedConfigButtonClick","Children","toArray","Boolean","child","cloneElement","flex","footerMessageText","sprintf","filtered","available","selected","shown","FLYOUT_PADDING","COLUMN_FLYOUT_PADDING","FLYOUT_WIDTH","DROPDOWN_MENU_WIDTH","width","canInferTypeFromMeta","getDataTypeForMeta","inferDataTypeFromData","getFilteredFields","sanitizeFieldNames","fieldNames","includes","defaultMessage","dsl","ast","DslParser","parse","withoutArrow","seriesByNameNode","isFieldNameDslStandard","seriesIdx","findLastIndex","renameIdx","isMatch","isItemsDslStandard","zipWith","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 +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,mBACA,WACA,YACA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C,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, 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, { 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":";;;;6EAA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S,EAAUtH,IAC9BsH,SAAAA,EAAUC,cAAcvH,GACjBsH,EAASE,SAASxH,GAEtB,CAAEyH,QAASzH,EAAO0H,SAAU,CAAEvB,KAAMnG,IAwDb2H,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 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":""}