@splunk/dynamic-editors 0.42.1 → 0.42.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -94
- package/DynamicEditor.js +69 -69
- package/DynamicEditor.js.map +1 -1
- package/containers/EditorItem.js +72 -72
- package/containers/EditorItem.js.map +1 -1
- package/containers/EditorLayout.js +80 -80
- package/containers/EditorLayout.js.map +1 -1
- package/containers/EditorLayoutItem.js +54 -54
- package/containers/EditorLayoutItem.js.map +1 -1
- package/editors/AdvancedConfigCard.js.map +1 -1
- package/editors/ArrayOfStringsEditor.js +4 -4
- package/editors/ArrayOfStringsEditor.js.map +1 -1
- package/editors/CheckboxEditor.js.map +1 -1
- package/editors/ColorEditor.js.map +1 -1
- package/editors/ColumnMultiSelectionByFieldNameEditor.js.map +1 -1
- package/editors/ColumnMultiSelectionEditor.js +4 -4
- package/editors/ColumnMultiSelectionEditor.js.map +1 -1
- package/editors/ColumnSelectionEditor.js +4 -4
- package/editors/ColumnSelectionEditor.js.map +1 -1
- package/editors/CustomizedInSourceEditor.js +4 -4
- package/editors/CustomizedInSourceEditor.js.map +1 -1
- package/editors/DynamicColorEditor.js +40 -40
- package/editors/DynamicColorEditor.js.map +1 -1
- package/editors/DynamicColorEditorWithPrecedence.js +24 -24
- package/editors/DynamicColorEditorWithPrecedence.js.map +1 -1
- package/editors/DynamicItemEditor.js +4 -4
- package/editors/DynamicItemEditor.js.map +1 -1
- package/editors/ImageEditor.js.map +1 -1
- package/editors/MultiColorPickerEditor.js.map +1 -1
- package/editors/NetworkGraphDynamicColorEditor.js +39 -39
- package/editors/NetworkGraphDynamicColorEditor.js.map +1 -1
- package/editors/NumberEditor.js.map +1 -1
- package/editors/PercentEditor.js.map +1 -1
- package/editors/PresetSelectorEditor.js +1 -1
- package/editors/PresetSelectorEditor.js.map +1 -1
- package/editors/RadioBarEditor.js.map +1 -1
- package/editors/SelectEditor.js.map +1 -1
- package/editors/SeriesColorsByFieldEditor.js.map +1 -1
- package/editors/SeriesColorsEditor.js +12 -12
- package/editors/SeriesColorsEditor.js.map +1 -1
- package/editors/SliderEditor.js +3 -3
- package/editors/SliderEditor.js.map +1 -1
- package/editors/StaticItemEditor.js.map +1 -1
- package/editors/TableColumnFormatterEditor.js +52 -52
- package/editors/TableColumnFormatterEditor.js.map +1 -1
- package/editors/TableDynamicColorEditor.js +24 -24
- package/editors/TableDynamicColorEditor.js.map +1 -1
- package/editors/TextAreaEditor.js.map +1 -1
- package/editors/TextEditor.js.map +1 -1
- package/editors/ThresholdEditor.js.map +1 -1
- package/editors/ToggleEditor.js.map +1 -1
- package/package.json +2 -2
- package/shared/AdvancedControlGroup.js.map +1 -1
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Copyright © 2018 Splunk Inc.
|
|
3
3
|
* SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
4
4
|
* in part without a valid written license from Splunk Inc. is PROHIBITED.
|
|
5
|
-
*/(()=>{"use strict";var e={5456:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var a=r(6195),
|
|
5
|
+
*/(()=>{"use strict";var e={5456:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var a=r(6195),l=r.n(a),n=r(9497),i=r.n(n),o=r(23),s=r.n(o),u=r(232),d=r.n(u),c=r(4793),f=r(6649),p=r(8965),b=r.n(p),m=r(9967),g=r(4008),v=r.n(g);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const _=d().div`
|
|
6
6
|
display: grid;
|
|
7
7
|
grid-template-columns: 1fr 1fr;
|
|
8
8
|
gap: 10px;
|
|
9
9
|
[data-test='control-group'] {
|
|
10
10
|
margin: 0;
|
|
11
11
|
}
|
|
12
|
-
`,O=i().createElement(_,null,i().createElement("span",{"data-test":"form-row-header-label"},(0,f._)("Label")),i().createElement("span",{"data-test":"form-row-header-value"},(0,f._)("Value"))),P=(e,t)=>e.filter(((e,r)=>r!==t)),S=(e,t,r)=>"string"!=typeof e||""===e.trim()||t.filter((t=>t[r]===e)).length>1,
|
|
12
|
+
`,O=i().createElement(_,null,i().createElement("span",{"data-test":"form-row-header-label"},(0,f._)("Label")),i().createElement("span",{"data-test":"form-row-header-value"},(0,f._)("Value"))),P=(e,t)=>e.filter(((e,r)=>r!==t)),S=(e,t,r)=>"string"!=typeof e||""===e.trim()||t.filter((t=>t[r]===e)).length>1,C=(e,t)=>S(e,t,"label"),D=(e,t)=>S(e,t,"value"),j=d().div`
|
|
13
13
|
width: 100%;
|
|
14
|
-
`,E=[],M=({onChange:e,name:t,value:r=E,labelPosition:a="top",label:n="",validate:o})=>{const[s,u]=(0,l.useState)(r),[d,p]=(0,l.useState)(r.length);(0,l.useEffect)((()=>{u(r),r.length>d&&p(r.length)}),[r,d]);const g=(0,l.useCallback)((a=>{var n;(0,c.isEqual)(a,r)||((n=a).some((({label:e,value:t})=>"string"!=typeof e||""===e.trim()||"string"!=typeof t||""===t.trim()))||(0,c.uniqBy)(n,(e=>e.value)).length!==n.length||(0,c.uniqBy)(n,(e=>e.label)).length!==n.length)?u(a):e(null,t,a)}),[r,t,e]),y=(0,l.useCallback)(((e,{index:t})=>{const r=P(s,t);g(r)}),[s,g]),S=(0,l.useCallback)((({fromIndex:e,toIndex:t})=>{const r=s[e],a=P(s,e);a.splice(t,0,r),g(a)}),[s,g]),M=(0,l.useCallback)(((e,t)=>(r,a,n="")=>{const l=s[e],i=[...s];i.splice(e,1,h(h({},l),{},{[t]:n.trim()})),g(i)}),[s,g]),x=(0,l.useCallback)((()=>{const e=s.concat({label:`Label ${d}`,value:`menu_v${d}`});p(d+1),g(e)}),[s,d,g]),F=s.map(((e,t)=>{const{label:r,value:a}=e;return i().createElement(b().Row,{index:t,key:`${r}_${a}_${t}`,onRequestRemove:y},i().createElement(_,null,i().createElement(m.default,{label:(0,f._)("Label"),hideLabel:!0,value:r,onChange:M(t,"label"),name:"item-label-editor",error:j(r,s),validate:o}),i().createElement(m.default,{label:(0,f._)("Value"),hideLabel:!0,value:a,onChange:M(t,"value"),name:"item-value-editor",error:C(a,s),validate:o})))}));return i().createElement(v(),{label:n,labelPosition:a},i().createElement(D,null,i().createElement(b(),{addLabel:(0,f._)("Add new"),header:O,onRequestAdd:x,onRequestMove:S},F)))};M.propTypes={onChange:s().func.isRequired,name:s().string.isRequired,label:s().string,value:s().arrayOf(s().exact({label:s().string,value:s().string})),labelPosition:s().oneOf(["top","left"]),validate:s().func};const x=M},9967:(e,t,r)=>{r.d(t,{default:()=>S});var a=r(2649),n=r.n(a),l=r(6195),i=r.n(l);const o=require("@babel/runtime/helpers/objectWithoutProperties");var s=r.n(o),u=r(9497),d=r.n(u),c=r(23),f=r.n(c),p=r(4793),b=r(4082),m=r.n(b),g=r(4008),v=r.n(g),y=r(5862);const h=["onChange","name","value","label","labelPosition","labelWidth","labelStyle","hideLabel","isAdvanced","isDisabled","help","tooltip","validate","error"];function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}const O={},P=e=>{let{onChange:t,name:r,value:a="",label:l,labelPosition:o="top",labelWidth:c,labelStyle:f=O,hideLabel:b=!1,isAdvanced:g,isDisabled:P=!1,help:S,tooltip:j,validate:C,error:D}=e,E=s()(e,h);const[M,x]=(0,u.useState)(a),F=(0,u.useCallback)((e=>"function"==typeof C?C({value:e}):null),[C]),[w,k]=(0,u.useState)(F(a)),A=(0,u.useMemo)((()=>(0,p.debounce)((e=>{k(F(e))}),250)),[F]);(0,u.useEffect)((()=>()=>{A.cancel()}),[A]),(0,u.useEffect)((()=>{x(a),k(F(a))}),[F,a]);const q=(0,u.useCallback)(((e,{value:t})=>{x(t),A(t)}),[A]),T=(0,u.useCallback)((e=>{const n=M.trim();if(n===a)return;const l=F(n);k(l),l||t(e,r,n)}),[M,a,F,t,r]),B=(0,u.useCallback)((e=>{"Enter"===e.key&&T(e)}),[T]),L=(0,u.useMemo)((()=>l&&""!==l?f:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},f)),[l,f]);return d().createElement(v(),{label:l,labelPosition:o,labelWidth:c,style:L,hideLabel:b,help:S,tooltip:j,error:(null==w?void 0:w.message)||D,isAdvanced:g},d().createElement(m(),n()({key:a,"data-test":r,style:y.editorStyle,onChange:q,onKeyDown:B,onBlur:T,value:M,disabled:P,canClear:!0},E,{error:!!w||D})))};P.propTypes={onChange:f().func.isRequired,name:f().string.isRequired,label:f().string.isRequired,value:f().string,labelPosition:f().oneOf(["top","left"]),labelWidth:f().number,labelStyle:f().object,hideLabel:f().bool,isAdvanced:f().bool,isDisabled:f().bool,validate:f().func,error:f().bool,help:f().string,tooltip:f().string};const S=P},5731:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ColumnSelectionEditor=void 0;const o=l(r(9497)),s=l(r(23)),u=i(r(2373)),d=r(1413),c=r(9033),f=r(6801),p=r(1385),b=r(1256),m=i(r(4008)),g=r(5862),v=r(8999),y=Object.assign(Object.assign({},f.BaseEditorPropTypes),{dataSourceKey:s.string.isRequired,prepareValue:s.func,filterByTypes:s.arrayOf(s.string),tooltip:s.string,hideEditorWhenLoading:s.bool});t.ColumnSelectionEditor=({name:e,value:t,label:r="",labelPosition:a="top",dataSourceKey:n="primary",dataSourceBindings:l,prepareValue:i=(e=>e),onChange:s,isAdvanced:f,isDisabled:y,filterByTypes:h,tooltip:_,hideEditorWhenLoading:O=!1})=>{const P=(0,p.useDataSource)({dataSourceBindings:l,dataSourceKey:n}),{columns:S,fields:j}=(null==P?void 0:P.data)||{columns:[],fields:[]},C=(0,b.getAvailableFieldsWithTypes)(S,j),D=null==t?t:(0,d.getFieldsFromDSL)(t,{[n]:P})[0]||"",[E,M]=(0,o.useState)(D);o.default.useEffect((()=>{M(D)}),[D]);const[x,F]=(0,o.useState)(""),w=C.filter((e=>-1!==e.name.indexOf(x))),k=(0,v.useColumnSelectorFooterMessage)({availableFields:C,selectedFields:[E],filteredFields:w,filter:x}),A=(0,o.useCallback)(((t,{value:r})=>{M(r);const a=i({options:{[e]:`> ${n} | seriesByName('${r}')`}});s(t,a)}),[n,e,s,i]),q=(0,o.useCallback)(((e,{keyword:t})=>{F(t)}),[]),{hasError:T,isMissing:B,isLoading:L}=(0,c.getDataSourceStateInfo)(P),R=B||T||y,N=(0,b.getPlaceholderMessage)({isMissing:B,isLoading:L,hasError:T});return(!O||!!E)&&o.default.createElement(m.default,{label:r,labelPosition:a,tooltip:_,isAdvanced:f},o.default.createElement(u.default,{"data-test":"ColumnSelectionEditor",value:E,onFilterChange:q,onChange:A,footerMessage:k,disabled:R,placeholder:N,isLoadingOptions:L,error:T,style:g.editorStyle,filter:!0},w.map((e=>o.default.createElement(u.default.Option,{key:e.name,label:`${e.name} (${e.type})`,value:e.name,disabled:!!(null==h?void 0:h.length)&&!h.find((t=>t===e.type))})))))},t.ColumnSelectionEditor.propTypes=y,t.default=t.ColumnSelectionEditor},7585:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=l(r(9497)),s=l(r(23)),u=r(4793),d=i(r(4082)),c=i(r(9250)),f=i(r(7143)),p=r(6649),b=i(r(5731)),m=i(r(5456)),g=r(4381),v=r(5862),y=(0,p._)("Advanced configuration options are being used by this input. Please edit in source mode."),h=({name:e,context:t,value:r="",label:a,onChange:n,dataSourceBindings:l,labelPosition:i="top",labelWidth:s,help:h=y,validate:_})=>{const[O,P]=o.useState([]),[S,j]=o.useState(""),[C,D]=o.useState("");o.useEffect((()=>{const{staticOptions:e,dynamicOptionsLabel:a,dynamicOptionsValue:n}=(0,g.getDynamicOptionsFromConfig)({items:r,context:t});P(e),j(a),D(n)}),[r,t]),o.useEffect((()=>{void 0!==l.primary||Array.isArray(r)||n(null,{context:{formattedConfig:void 0,formattedStatics:void 0,statics:void 0,label:void 0,value:void 0},options:{[e]:O}})}),[l,e,r,n,O]);const E=o.useCallback(((t,a,l)=>{if(Array.isArray(r)&&(!a||!l))n(null,{options:{[e]:t}});else{const r=(0,u.unzip)(t.map((({label:e,value:t})=>[e,t])));n(null,{context:{formattedConfig:{number:{prefix:""}},formattedStatics:">statics | formatByType(formattedConfig)",statics:r,label:`>primary | seriesByName("${a}") | renameSeries("label") | formatByType(formattedConfig)`,value:`>primary | seriesByName("${l}") | renameSeries("value") | formatByType(formattedConfig)`},options:{[e]:">frame(label, value) | prepend(formattedStatics) | objects()"}})}}),[e,r,n]),M=o.useCallback(((e,t,r)=>{E(r,S,C)}),[E,S,C]),x=o.useCallback(((e,{value:t})=>{""===C?j(t):E(O,t,C)}),[E,O,C]),F=o.useCallback(((e,{value:t})=>{""===S?D(t):E(O,S,t)}),[E,O,S]),w=e=>t=>{var r;const a=null===(r=null==t?void 0:t.options)||void 0===r?void 0:r[e];return"string"==typeof a?{value:(0,g.getFieldFromFieldNameDsl)(a)}:{value:""}};if(o.useMemo((()=>(0,g.isConfigAdvanced)({items:r,context:t})),[r,t]))return o.createElement(c.default,{label:(0,p._)(a),labelPosition:i,labelWidth:s,help:h},o.createElement(d.default,{key:r.toString(),"data-test":e,disabled:!0,defaultValue:r.toString()}));const k=!!l.primary;return o.createElement(o.Fragment,null,o.createElement(m.default,{name:"",label:(0,p._)("Static menu configuration"),labelPosition:i,value:O,onChange:M,validate:_}),k&&o.createElement(f.default,{key:"dynamic-item-editor-label-value-layout",gutter:v.VERTICAL_EDITOR_SPACING},o.createElement(f.default.Row,{key:"dynamic-item-editor-label-row"},o.createElement(b.default,{name:"label",label:(0,p._)("Dynamic menu label field"),dataSourceKey:"primary",dataSourceBindings:l,value:`>primary | seriesByName("${S}")`,context:t,onChange:x,prepareValue:w("label")})),o.createElement(f.default.Row,{key:"dynamic-item-editor-value-row"},o.createElement(b.default,{name:"value",label:(0,p._)("Dynamic menu value field"),dataSourceKey:"primary",dataSourceBindings:l,value:`>primary | seriesByName("${C}")`,context:t,onChange:F,prepareValue:w("value")}))))};h.propTypes={onChange:s.func.isRequired,name:s.string.isRequired,label:s.string.isRequired,value:s.oneOfType([s.arrayOf(s.shape({label:s.string.isRequired,value:s.string.isRequired}).isRequired),s.string]),labelPosition:s.oneOf(["top","left"]),labelWidth:s.number,context:s.shape({label:s.string,value:s.string,statics:s.arrayOf(s.arrayOf(s.string.isRequired).isRequired)}).isRequired,dataSourceBindings:s.shape({primary:s.any}).isRequired,help:s.string},t.default=h},8999:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useColumnSelectorFooterMessage=void 0;const i=l(r(9497)),o=r(3620);t.useColumnSelectorFooterMessage=({filter:e,availableFields:t,selectedFields:r,filteredFields:a,noSelectedFieldsInfo:n=!1})=>{const l=(0,i.useMemo)((()=>{if(!r||!a)return[];const e=new Set(r.filter((e=>""!==e&&void 0!==e)));return a.filter((t=>e.has(t.name)))}),[r,a]);return e&&!a.length?null:i.default.createElement(o.ColumnSelectorFooterMessage,{noSelectedFieldsInfo:n,numSelected:null==l?void 0:l.length,numFiltered:a.length,numAvailable:t.length,filter:e})}},1385:function(e,t,r){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDataSource=void 0;const n=r(9497),l=a(r(4853)),i=r(4793);t.useDataSource=({dataSourceBindings:e,dataSourceKey:t})=>{const r=(0,n.useContext)(l.default),[a,o]=(0,n.useState)();return(0,n.useEffect)((()=>{if(!(0,i.get)(e,t))return o(null),()=>{};const a=(0,i.isFunction)(r.subscribe)&&r.subscribe(t,(e=>o(e)));return()=>{a&&a()}}),[e]),a}},6801:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseEditorPropTypes=void 0;const i=l(r(23));t.BaseEditorPropTypes={name:i.string.isRequired,value:i.oneOfType([i.string,i.object,i.arrayOf(i.string)]),context:i.object,label:i.string,labelPosition:i.oneOf(["top","left"]),labelWidth:i.number,onChange:i.func,isAdvanced:i.bool,isDisabled:i.bool,dataSourceBindings:i.object,options:i.object,optionsSchema:i.object}},4008:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AdvancedConfigButton=void 0;const o=l(r(9497)),s=l(r(23)),u=i(r(232)),d=r(6649),c=i(r(6643)),f=r(3563),p=i(r(6379)),b=i(r(7020)),m=i(r(9250)),g=(0,u.default)(m.default)`
|
|
14
|
+
`,E=[],M=({onChange:e,name:t,value:r=E,labelPosition:a="top",label:l="",validate:o})=>{const[s,u]=(0,n.useState)(r),[d,p]=(0,n.useState)(r.length);(0,n.useEffect)((()=>{u(r),r.length>d&&p(r.length)}),[r,d]);const g=(0,n.useCallback)((a=>{var l;(0,c.isEqual)(a,r)||((l=a).some((({label:e,value:t})=>"string"!=typeof e||""===e.trim()||"string"!=typeof t||""===t.trim()))||(0,c.uniqBy)(l,(e=>e.value)).length!==l.length||(0,c.uniqBy)(l,(e=>e.label)).length!==l.length)?u(a):e(null,t,a)}),[r,t,e]),y=(0,n.useCallback)(((e,{index:t})=>{const r=P(s,t);g(r)}),[s,g]),S=(0,n.useCallback)((({fromIndex:e,toIndex:t})=>{const r=s[e],a=P(s,e);a.splice(t,0,r),g(a)}),[s,g]),M=(0,n.useCallback)(((e,t)=>(r,a,l="")=>{const n=s[e],i=[...s];i.splice(e,1,h(h({},n),{},{[t]:l.trim()})),g(i)}),[s,g]),x=(0,n.useCallback)((()=>{const e=s.concat({label:`Label ${d}`,value:`menu_v${d}`});p(d+1),g(e)}),[s,d,g]),F=s.map(((e,t)=>{const{label:r,value:a}=e;return i().createElement(b().Row,{index:t,key:`${r}_${a}_${t}`,onRequestRemove:y},i().createElement(_,null,i().createElement(m.default,{label:(0,f._)("Label"),hideLabel:!0,value:r,onChange:M(t,"label"),name:"item-label-editor",error:C(r,s),validate:o}),i().createElement(m.default,{label:(0,f._)("Value"),hideLabel:!0,value:a,onChange:M(t,"value"),name:"item-value-editor",error:D(a,s),validate:o})))}));return i().createElement(v(),{label:l,labelPosition:a},i().createElement(j,null,i().createElement(b(),{addLabel:(0,f._)("Add new"),header:O,onRequestAdd:x,onRequestMove:S},F)))};M.propTypes={onChange:s().func.isRequired,name:s().string.isRequired,label:s().string,value:s().arrayOf(s().exact({label:s().string,value:s().string})),labelPosition:s().oneOf(["top","left"]),validate:s().func};const x=M},9967:(e,t,r)=>{r.d(t,{default:()=>S});var a=r(2649),l=r.n(a),n=r(6195),i=r.n(n);const o=require("@babel/runtime/helpers/objectWithoutProperties");var s=r.n(o),u=r(9497),d=r.n(u),c=r(23),f=r.n(c),p=r(4793),b=r(4082),m=r.n(b),g=r(4008),v=r.n(g),y=r(5862);const h=["onChange","name","value","label","labelPosition","labelWidth","labelStyle","hideLabel","isAdvanced","isDisabled","help","tooltip","validate","error"];function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}const O={},P=e=>{let{onChange:t,name:r,value:a="",label:n,labelPosition:o="top",labelWidth:c,labelStyle:f=O,hideLabel:b=!1,isAdvanced:g,isDisabled:P=!1,help:S,tooltip:C,validate:D,error:j}=e,E=s()(e,h);const[M,x]=(0,u.useState)(a),F=(0,u.useCallback)((e=>"function"==typeof D?D({value:e}):null),[D]),[k,w]=(0,u.useState)(F(a)),A=(0,u.useMemo)((()=>(0,p.debounce)((e=>{w(F(e))}),250)),[F]);(0,u.useEffect)((()=>()=>{A.cancel()}),[A]),(0,u.useEffect)((()=>{x(a),w(F(a))}),[F,a]);const q=(0,u.useCallback)(((e,{value:t})=>{x(t),A(t)}),[A]),L=(0,u.useCallback)((e=>{const l=M.trim();if(l===a)return;const n=F(l);w(n),n||t(e,r,l)}),[M,a,F,t,r]),T=(0,u.useCallback)((e=>{"Enter"===e.key&&L(e)}),[L]),B=(0,u.useMemo)((()=>n&&""!==n?f:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},f)),[n,f]);return d().createElement(v(),{label:n,labelPosition:o,labelWidth:c,style:B,hideLabel:b,help:S,tooltip:C,error:(null==k?void 0:k.message)||j,isAdvanced:g},d().createElement(m(),l()({key:a,"data-test":r,style:y.editorStyle,onChange:q,onKeyDown:T,onBlur:L,value:M,disabled:P,canClear:!0},E,{error:!!k||j})))};P.propTypes={onChange:f().func.isRequired,name:f().string.isRequired,label:f().string.isRequired,value:f().string,labelPosition:f().oneOf(["top","left"]),labelWidth:f().number,labelStyle:f().object,hideLabel:f().bool,isAdvanced:f().bool,isDisabled:f().bool,validate:f().func,error:f().bool,help:f().string,tooltip:f().string};const S=P},5731:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var l=Object.getOwnPropertyDescriptor(t,r);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,l)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return l(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ColumnSelectionEditor=void 0;const o=n(r(9497)),s=i(r(2373)),u=r(1413),d=r(9033),c=r(1385),f=r(1256),p=i(r(4008)),b=r(5862),m=r(8999);t.ColumnSelectionEditor=({name:e,value:t,label:r="",labelPosition:a="top",dataSourceKey:l="primary",dataSourceBindings:n,prepareValue:i=(e=>e),onChange:g,isAdvanced:v,isDisabled:y,filterByTypes:h,tooltip:_,hideEditorWhenLoading:O=!1})=>{const P=(0,c.useDataSource)({dataSourceBindings:n,dataSourceKey:l}),{columns:S,fields:C}=(null==P?void 0:P.data)||{columns:[],fields:[]},D=(0,f.getAvailableFieldsWithTypes)(S,C),j=null==t?t:(0,u.getFieldsFromDSL)(t,{[l]:P})[0]||"",[E,M]=(0,o.useState)(j);o.default.useEffect((()=>{M(j)}),[j]);const[x,F]=(0,o.useState)(""),k=D.filter((e=>-1!==e.name.indexOf(x))),w=(0,m.useColumnSelectorFooterMessage)({availableFields:D,selectedFields:[E],filteredFields:k,filter:x}),A=(0,o.useCallback)(((t,{value:r})=>{M(r);const a=i({options:{[e]:`> ${l} | seriesByName('${r}')`}});g(t,a)}),[l,e,g,i]),q=(0,o.useCallback)(((e,{keyword:t})=>{F(t)}),[]),{hasError:L,isMissing:T,isLoading:B}=(0,d.getDataSourceStateInfo)(P),R=T||L||y,N=(0,f.getPlaceholderMessage)({isMissing:T,isLoading:B,hasError:L});return(!O||!!E)&&o.default.createElement(p.default,{label:r,labelPosition:a,tooltip:_,isAdvanced:v},o.default.createElement(s.default,{"data-test":"ColumnSelectionEditor",value:E,onFilterChange:q,onChange:A,footerMessage:w,disabled:R,placeholder:N,isLoadingOptions:B,error:L,style:b.editorStyle,filter:!0},k.map((e=>o.default.createElement(s.default.Option,{key:e.name,label:`${e.name} (${e.type})`,value:e.name,disabled:!!(null==h?void 0:h.length)&&!h.find((t=>t===e.type))})))))},t.default=t.ColumnSelectionEditor},7585:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var l=Object.getOwnPropertyDescriptor(t,r);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,l)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return l(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(9497)),s=n(r(23)),u=r(4793),d=i(r(4082)),c=i(r(9250)),f=i(r(7143)),p=r(6649),b=i(r(5731)),m=i(r(5456)),g=r(4381),v=r(5862),y=(0,p._)("Advanced configuration options are being used by this input. Please edit in source mode."),h=({name:e,context:t,value:r="",label:a,onChange:l,dataSourceBindings:n,labelPosition:i="top",labelWidth:s,help:h=y,validate:_})=>{const[O,P]=o.useState([]),[S,C]=o.useState(""),[D,j]=o.useState("");o.useEffect((()=>{const{staticOptions:e,dynamicOptionsLabel:a,dynamicOptionsValue:l}=(0,g.getDynamicOptionsFromConfig)({items:r,context:t});P(e),C(a),j(l)}),[r,t]),o.useEffect((()=>{void 0!==n.primary||Array.isArray(r)||l(null,{context:{formattedConfig:void 0,formattedStatics:void 0,statics:void 0,label:void 0,value:void 0},options:{[e]:O}})}),[n,e,r,l,O]);const E=o.useCallback(((t,a,n)=>{if(Array.isArray(r)&&(!a||!n))l(null,{options:{[e]:t}});else{const r=(0,u.unzip)(t.map((({label:e,value:t})=>[e,t])));l(null,{context:{formattedConfig:{number:{prefix:""}},formattedStatics:">statics | formatByType(formattedConfig)",statics:r,label:`>primary | seriesByName("${a}") | renameSeries("label") | formatByType(formattedConfig)`,value:`>primary | seriesByName("${n}") | renameSeries("value") | formatByType(formattedConfig)`},options:{[e]:">frame(label, value) | prepend(formattedStatics) | objects()"}})}}),[e,r,l]),M=o.useCallback(((e,t,r)=>{E(r,S,D)}),[E,S,D]),x=o.useCallback(((e,{value:t})=>{""===D?C(t):E(O,t,D)}),[E,O,D]),F=o.useCallback(((e,{value:t})=>{""===S?j(t):E(O,S,t)}),[E,O,S]),k=e=>t=>{var r;const a=null===(r=null==t?void 0:t.options)||void 0===r?void 0:r[e];return"string"==typeof a?{value:(0,g.getFieldFromFieldNameDsl)(a)}:{value:""}};if(o.useMemo((()=>(0,g.isConfigAdvanced)({items:r,context:t})),[r,t]))return o.createElement(c.default,{label:(0,p._)(a),labelPosition:i,labelWidth:s,help:h},o.createElement(d.default,{key:r.toString(),"data-test":e,disabled:!0,defaultValue:r.toString()}));const w=!!n.primary;return o.createElement(o.Fragment,null,o.createElement(m.default,{name:"",label:(0,p._)("Static menu configuration"),labelPosition:i,value:O,onChange:M,validate:_}),w&&o.createElement(f.default,{key:"dynamic-item-editor-label-value-layout",gutter:v.VERTICAL_EDITOR_SPACING},o.createElement(f.default.Row,{key:"dynamic-item-editor-label-row"},o.createElement(b.default,{name:"label",label:(0,p._)("Dynamic menu label field"),dataSourceKey:"primary",dataSourceBindings:n,value:`>primary | seriesByName("${S}")`,context:t,onChange:x,prepareValue:k("label")})),o.createElement(f.default.Row,{key:"dynamic-item-editor-value-row"},o.createElement(b.default,{name:"value",label:(0,p._)("Dynamic menu value field"),dataSourceKey:"primary",dataSourceBindings:n,value:`>primary | seriesByName("${D}")`,context:t,onChange:F,prepareValue:k("value")}))))};h.propTypes={onChange:s.func.isRequired,name:s.string.isRequired,label:s.string.isRequired,value:s.oneOfType([s.arrayOf(s.shape({label:s.string.isRequired,value:s.string.isRequired}).isRequired),s.string]),labelPosition:s.oneOf(["top","left"]),labelWidth:s.number,context:s.shape({label:s.string,value:s.string,statics:s.arrayOf(s.arrayOf(s.string.isRequired).isRequired)}).isRequired,dataSourceBindings:s.shape({primary:s.any}).isRequired,help:s.string},t.default=h},8999:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var l=Object.getOwnPropertyDescriptor(t,r);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,l)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return l(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useColumnSelectorFooterMessage=void 0;const i=n(r(9497)),o=r(3620);t.useColumnSelectorFooterMessage=({filter:e,availableFields:t,selectedFields:r,filteredFields:a,noSelectedFieldsInfo:l=!1})=>{const n=(0,i.useMemo)((()=>{if(!r||!a)return[];const e=new Set(r.filter((e=>""!==e&&void 0!==e)));return a.filter((t=>e.has(t.name)))}),[r,a]);return e&&!a.length?null:i.default.createElement(o.ColumnSelectorFooterMessage,{noSelectedFieldsInfo:l,numSelected:null==n?void 0:n.length,numFiltered:a.length,numAvailable:t.length,filter:e})}},1385:function(e,t,r){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDataSource=void 0;const l=r(9497),n=a(r(4853)),i=r(4793);t.useDataSource=({dataSourceBindings:e,dataSourceKey:t})=>{const r=(0,l.useContext)(n.default),[a,o]=(0,l.useState)();return(0,l.useEffect)((()=>{if(!(0,i.get)(e,t))return o(null),()=>{};const a=(0,i.isFunction)(r.subscribe)&&r.subscribe(t,(e=>o(e)));return()=>{a&&a()}}),[e]),a}},4008:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var l=Object.getOwnPropertyDescriptor(t,r);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,l)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return l(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AdvancedConfigButton=void 0;const o=n(r(9497)),s=n(r(23)),u=i(r(232)),d=r(6649),c=i(r(6643)),f=r(3563),p=i(r(6379)),b=i(r(7020)),m=i(r(9250)),g=(0,u.default)(m.default)`
|
|
15
15
|
margin-top: 0;
|
|
16
16
|
padding: 0;
|
|
17
17
|
// adjust bottom margin according to theme
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
&:hover {
|
|
43
43
|
background-color: ${f.variables.interactiveColorOverlayDrag} !important;
|
|
44
44
|
}
|
|
45
|
-
`;t.AdvancedConfigButton=({label:e="",onClick:t})=>o.default.createElement(v,{"data-test":`${e}-advanced-config-button-tooltip`,content:(0,d._)("Advanced configurations")},o.default.createElement(y,{"data-test":`${e}-advanced-config-button`,icon:o.default.createElement(c.default,{"data-test":`${e}-advanced-config-button-icon`}),appearance:"subtle",onClick:t}));const h=({"data-test":e,children:r,isAdvanced:a=!1,label:
|
|
45
|
+
`;t.AdvancedConfigButton=({label:e="",onClick:t})=>o.default.createElement(v,{"data-test":`${e}-advanced-config-button-tooltip`,content:(0,d._)("Advanced configurations")},o.default.createElement(y,{"data-test":`${e}-advanced-config-button`,icon:o.default.createElement(c.default,{"data-test":`${e}-advanced-config-button-icon`}),appearance:"subtle",onClick:t}));const h=({"data-test":e,children:r,isAdvanced:a=!1,label:l,hideLabel:n,labelPosition:i,labelWidth:s,tooltip:u,help:d,style:c,error:f,controlsLayout:p,onClick:b,onAdvancedConfigButtonClick:m})=>o.default.createElement(g,{"data-test":null!=e?e:"control-group",label:l,hideLabel:n,labelPosition:i,labelWidth:s,tooltip:u,help:d,error:f,style:c,onClick:b,controlsLayout:p},a?o.Children.toArray(r).filter(Boolean).map((e=>(0,o.cloneElement)(e,{style:{flex:1}}))):r,a?o.default.createElement(t.AdvancedConfigButton,{label:l,onClick:m}):null);h.propTypes={style:s.object,isAdvanced:s.bool,onClick:s.func,onAdvancedConfigButtonClick:s.func},t.default=h},3620:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var l=Object.getOwnPropertyDescriptor(t,r);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,l)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return l(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ColumnSelectorFooterMessage=void 0;const i=n(r(9497)),o=r(3773),s=r(6649),u=r(9497);t.ColumnSelectorFooterMessage=({numSelected:e,numFiltered:t,numAvailable:r,filter:a,noSelectedFieldsInfo:l})=>{const n=(0,u.useMemo)((()=>a?l?(0,o.sprintf)((0,s._)("%(filtered)d filtered from %(available)d fields"),{filtered:t,available:r}):(0,o.sprintf)((0,s._)("%(selected)d selected from %(filtered)d filtered"),{selected:e,filtered:t}):l?(0,o.sprintf)((0,s._)("%(shown)d of %(available)d fields"),{shown:t,available:r}):(0,o.sprintf)((0,s._)("%(selected)d selected from %(available)d"),{selected:e,available:r})),[a,l,t,r,e]);return i.createElement("span",{"data-test":"footer-message","aria-live":"polite","aria-atomic":"true"},n)}},5862:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.editorStyle=t.DROPDOWN_MENU_WIDTH=t.VERTICAL_EDITOR_SPACING=t.FLYOUT_WIDTH=t.COLUMN_FLYOUT_PADDING=t.FLYOUT_PADDING=void 0,t.FLYOUT_PADDING=21,t.COLUMN_FLYOUT_PADDING=16,t.FLYOUT_WIDTH=344,t.VERTICAL_EDITOR_SPACING=16,t.DROPDOWN_MENU_WIDTH=327,t.editorStyle={width:"100%"}},1256:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getPlaceholderMessage=t.sanitizeFieldNames=t.getFilteredFields=t.getAvailableFieldsWithTypes=void 0;const a=r(6649),l=r(2588);t.getAvailableFieldsWithTypes=(e,t)=>t.map(((t,r)=>{const{name:a}=t;return{name:a,type:(0,l.canInferTypeFromMeta)(t)?(0,l.getDataTypeForMeta)(t):(0,l.inferDataTypeFromData)(e[r])}}));t.getFilteredFields=(e,t)=>e.filter((e=>-1!==e.name.indexOf(t)));t.sanitizeFieldNames=(e,t)=>"string"==typeof e&&t.includes(e)?[e]:Array.isArray(e)?e.filter((e=>t.includes(e))):[];t.getPlaceholderMessage=({hasError:e,isLoading:t,isMissing:r,defaultMessage:l="Select a field from data source"})=>r?(0,a._)("Set up data source to select"):e?(0,a._)("Please set up valid data source to select"):t?(0,a._)("Loading data source..."):(0,a._)(l)},4381:function(e,t,r){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getDynamicOptionsFromConfig=t.isConfigAdvanced=t.getFieldFromFieldNameDsl=void 0;const l=r(4793),n=r(2918),i=a(r(3453));t.getFieldFromFieldNameDsl=e=>{try{const t=n.DslParser.parse(i.default.withoutArrow(e)),r=(0,l.find)(t,{type:"method",name:"seriesByName"});return(0,l.get)(r,["args","0","v"],"")}catch(e){return""}};const o=e=>{try{const t=n.DslParser.parse(i.default.withoutArrow(e)),r=(0,l.findLastIndex)(t,{type:"method",name:"seriesByName"}),a=(0,l.findLastIndex)(t,{type:"method",name:"renameSeries"});return-1!==r&&-1!==a&&r<a}catch(e){return!1}};t.isConfigAdvanced=({items:e,context:t})=>{if("string"!=typeof e)return!1;const{label:r,value:a}=t;return"string"!=typeof r||"string"!=typeof a||(!(e=>{try{const t=n.DslParser.parse(i.default.withoutArrow(e));return 3===t.length&&(0,l.isMatch)(t[0],{type:"method",name:"frame"})&&(0,l.isMatch)(t[1],{type:"method",name:"prepend"})&&(0,l.isMatch)(t[2],{type:"method",name:"objects"})}catch(e){return!1}})(e)||!o(r)||!o(a))};t.getDynamicOptionsFromConfig=({items:e,context:r})=>{if(Array.isArray(e))return{staticOptions:e,dynamicOptionsLabel:"",dynamicOptionsValue:""};const a=r.statics||[],n=(0,l.zipWith)(...a,((e,t)=>({label:e,value:t}))),{label:i,value:o}=r;return{staticOptions:n,dynamicOptionsLabel:i?(0,t.getFieldFromFieldNameDsl)(i):"",dynamicOptionsValue:o?(0,t.getFieldFromFieldNameDsl)(o):""}}},6195:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},2649:e=>{e.exports=require("@babel/runtime/helpers/extends")},6643:e=>{e.exports=require("@splunk/react-icons/SlidersDoubleHorizontal")},7020:e=>{e.exports=require("@splunk/react-ui/Button")},7143:e=>{e.exports=require("@splunk/react-ui/ColumnLayout")},9250:e=>{e.exports=require("@splunk/react-ui/ControlGroup")},8965:e=>{e.exports=require("@splunk/react-ui/FormRows")},2373:e=>{e.exports=require("@splunk/react-ui/Select")},4082:e=>{e.exports=require("@splunk/react-ui/Text")},6379:e=>{e.exports=require("@splunk/react-ui/Tooltip")},3563:e=>{e.exports=require("@splunk/themes")},3773:e=>{e.exports=require("@splunk/ui-utils/format")},6649:e=>{e.exports=require("@splunk/ui-utils/i18n")},4853:e=>{e.exports=require("@splunk/visualization-context/DataSourceContext")},2918:e=>{e.exports=require("@splunk/visualization-encoding/DslParser")},3453:e=>{e.exports=require("@splunk/visualization-encoding/EncodingParser")},1413:e=>{e.exports=require("@splunk/visualization-encoding/utils/dsl")},2588:e=>{e.exports=require("@splunk/visualization-encoding/utils/types")},9033:e=>{e.exports=require("@splunk/visualizations-shared/dataSourceUtils")},4793:e=>{e.exports=require("lodash")},23:e=>{e.exports=require("prop-types")},9497:e=>{e.exports=require("react")},232:e=>{e.exports=require("styled-components")}},t={};function r(a){var l=t[a];if(void 0!==l)return l.exports;var n=t[a]={exports:{}};return e[a].call(n.exports,n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a=r(7585);module.exports=a})();
|
|
46
46
|
//# sourceMappingURL=DynamicItemEditor.js.map
|
|
@@ -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,EAA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,IAE1E,ECNDqQ,EAAoBW,EAAI,CAACI,EAAKC,IAAUJ,OAAOK,UAAUC,eAAed,KAAKW,EAAKC,GCClFhB,EAAoBmB,EAAKrB,IACH,oBAAXsB,QAA0BA,OAAOC,aAC1CT,OAAOC,eAAef,EAASsB,OAAOC,YAAa,CAAE3R,MAAO,WAE7DkR,OAAOC,eAAef,EAAS,aAAc,CAAEpQ,OAAO,GAAO,ECF9D,IAAI4R,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 { 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 hideEditorWhenLoading?: boolean;\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 hideEditorWhenLoading: T.bool,\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 hideEditorWhenLoading = false,\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 const shouldRenderEditor = hideEditorWhenLoading ? !!selectedField : true;\n\n return (\n shouldRenderEditor && (\n <ControlGroup\n label={label}\n labelPosition={labelPosition}\n tooltip={tooltip}\n isAdvanced={isAdvanced}\n >\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 );\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","hideEditorWhenLoading","bool","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","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":""}
|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AAKrB,IACH,oBAAXsB,QAA0BA,OAAOC,aAC1CT,OAAOC,eAAef,EAASsB,OAAOC,YAAa,CAAEzR,MAAO,WAE7DgR,OAAOC,eAAef,EAAS,aAAc,CAAElQ,OAAO,GAAO,ECF9D,IAAI0R,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/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 Select from '@splunk/react-ui/Select';\nimport { getFieldsFromDSL } from '@splunk/visualization-encoding/utils/dsl';\nimport { getDataSourceStateInfo } from '@splunk/visualizations-shared/dataSourceUtils';\nimport type { DataType } from '@splunk/visualization-encoding/DataPrimitive';\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';\nimport type { DynamicOptionsConfig } from '../types';\n\ninterface ColumnSelectionEditorProps extends BaseEditorProps {\n dataSourceKey: string;\n prepareValue?: (id: DynamicOptionsConfig) => DynamicOptionsConfig;\n filterByTypes?: DataType[];\n tooltip?: string;\n hideEditorWhenLoading?: boolean;\n}\n\nexport const ColumnSelectionEditor: React.FunctionComponent<ColumnSelectionEditorProps> = ({\n name,\n value,\n label = '',\n labelPosition = 'top',\n dataSourceKey = 'primary',\n dataSourceBindings,\n prepareValue = (id: DynamicOptionsConfig): DynamicOptionsConfig => id,\n onChange,\n isAdvanced,\n isDisabled,\n filterByTypes,\n tooltip,\n hideEditorWhenLoading = false,\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 const shouldRenderEditor = hideEditorWhenLoading ? !!selectedField : true;\n\n return (\n shouldRenderEditor && (\n <ControlGroup\n label={label}\n labelPosition={labelPosition}\n tooltip={tooltip}\n isAdvanced={isAdvanced}\n >\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 );\n};\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 React, { Children, cloneElement } from 'react';\nimport type { ReactElement } from 'react';\nimport * as T from 'prop-types';\nimport styled from 'styled-components';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport AdvancedConfigIcon from '@splunk/react-icons/SlidersDoubleHorizontal';\nimport { variables } from '@splunk/themes';\nimport Tooltip from '@splunk/react-ui/Tooltip';\nimport type { ButtonClickHandler, ButtonProps } from '@splunk/react-ui/Button';\nimport Button from '@splunk/react-ui/Button';\nimport SUIControlGroup from '@splunk/react-ui/ControlGroup';\nimport type { ControlGroupPropsBase } from '@splunk/react-ui/ControlGroup';\n\ninterface AdvancedControlGroupProps extends Omit<ControlGroupPropsBase, 'splunkTheme'> {\n 'data-test'?: string;\n style?: Record<string, string | number>;\n isAdvanced?: boolean;\n onClick?: React.MouseEventHandler<HTMLDivElement>;\n onAdvancedConfigButtonClick?: ButtonClickHandler;\n}\n\ninterface AdvancedConfigButtonProps {\n label?: string;\n onClick?: ButtonClickHandler;\n}\n\n// remove all surrounding margins. let parent add padding\nconst ControlGroupContainer = styled(SUIControlGroup)`\n margin-top: 0;\n padding: 0;\n // adjust bottom margin according to theme\n margin-bottom: ${variables.spacingMedium};\n width: 100%;\n\n // remove top margin of the first component in control group\n &:first-child {\n margin-top: 0;\n }\n\n // remove bottom margin of the last component in control group\n &:last-child {\n margin-bottom: 0;\n }\n // remove top padding on label of the first control group\n [data-test='label']:first-of-type {\n padding-top: 0;\n }\n`;\n\n// override tooltip to set desired config button style\nconst StyledToolTip = styled(Tooltip)`\n display: flex;\n > span {\n display: flex;\n width: 35px;\n }\n`;\n\nconst StyledAdvancedConfigButton = styled(Button)<ButtonProps>`\n color: ${variables.contentColorActive} !important;\n &:hover {\n background-color: ${variables.interactiveColorOverlayDrag} !important;\n }\n`;\n\nexport const AdvancedConfigButton = ({\n label = '',\n onClick,\n}: AdvancedConfigButtonProps): React.ReactElement => {\n return (\n <StyledToolTip\n data-test={`${label}-advanced-config-button-tooltip`}\n content={_('Advanced configurations')}\n >\n <StyledAdvancedConfigButton\n data-test={`${label}-advanced-config-button`}\n icon={<AdvancedConfigIcon data-test={`${label}-advanced-config-button-icon`} />}\n appearance=\"subtle\"\n onClick={onClick}\n />\n </StyledToolTip>\n );\n};\n\nconst AdvancedControlGroup = ({\n 'data-test': dataTest,\n children,\n isAdvanced = false,\n label,\n hideLabel,\n labelPosition,\n labelWidth,\n tooltip,\n help,\n style,\n error,\n controlsLayout,\n onClick,\n onAdvancedConfigButtonClick,\n}: AdvancedControlGroupProps): React.ReactElement => (\n <ControlGroupContainer\n data-test={dataTest ?? 'control-group'}\n label={label}\n hideLabel={hideLabel}\n labelPosition={labelPosition}\n labelWidth={labelWidth}\n tooltip={tooltip}\n help={help}\n error={error}\n style={style}\n onClick={onClick}\n controlsLayout={controlsLayout}\n >\n {isAdvanced\n ? Children.toArray(children)\n .filter(Boolean)\n .map(child =>\n cloneElement(child as ReactElement, {\n style: { flex: 1 },\n })\n )\n : children}\n {isAdvanced ? <AdvancedConfigButton label={label} onClick={onAdvancedConfigButtonClick} /> : null}\n </ControlGroupContainer>\n);\n\nAdvancedControlGroup.propTypes = {\n /**\n * Style overriding SUI ControlGroup\n */\n style: T.object,\n /**\n * Whether the current editor is enabled with advanced configurations\n */\n isAdvanced: T.bool,\n /**\n * Callback for editor click\n */\n onClick: T.func,\n /**\n * Callback for advanced config button click\n */\n onAdvancedConfigButtonClick: T.func,\n};\n\nexport default AdvancedControlGroup;\n","import * as React from 'react';\nimport { 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","ColumnSelectionEditor","dataSourceKey","dataSourceBindings","prepareValue","id","filterByTypes","hideEditorWhenLoading","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","func","string","oneOfType","arrayOf","shape","oneOf","any","noSelectedFieldsInfo","selectedFilteredFields","validSelectedFields","Set","has","ColumnSelectorFooterMessage","numSelected","numFiltered","numAvailable","dataSourceApi","useContext","setDataSource","get","unsubscribe","isFunction","subscribe","snapshot","ControlGroupContainer","variables","spacingMedium","StyledToolTip","StyledAdvancedConfigButton","contentColorActive","interactiveColorOverlayDrag","AdvancedConfigButton","onClick","content","icon","appearance","AdvancedControlGroup","dataTest","children","controlsLayout","onAdvancedConfigButtonClick","Children","toArray","Boolean","child","cloneElement","flex","object","bool","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":""}
|