solace-ui-components 18.0.0 → 18.0.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/dist/charts.js +1 -1
- package/dist/charts.modern.mjs +1 -1
- package/dist/{chunk-ULYCLLUO.modern.mjs → chunk-54TEARQI.modern.mjs} +2 -2
- package/dist/{chunk-ULYCLLUO.modern.mjs.map → chunk-54TEARQI.modern.mjs.map} +1 -1
- package/dist/{chunk-2RTZL4CF.modern.mjs → chunk-HQH2WKJP.modern.mjs} +3 -3
- package/dist/{chunk-2RTZL4CF.modern.mjs.map → chunk-HQH2WKJP.modern.mjs.map} +1 -1
- package/dist/{chunk-IHSXSGCC.modern.mjs → chunk-I7OJ5H4U.modern.mjs} +2 -2
- package/dist/{chunk-IHSXSGCC.modern.mjs.map → chunk-I7OJ5H4U.modern.mjs.map} +1 -1
- package/dist/{chunk-HLXBN2OE.modern.mjs → chunk-LGBO373S.modern.mjs} +2 -2
- package/dist/{chunk-HLXBN2OE.modern.mjs.map → chunk-LGBO373S.modern.mjs.map} +1 -1
- package/dist/{chunk-AOKITPX2.js → chunk-PYADJP2I.js} +2 -2
- package/dist/{chunk-AOKITPX2.js.map → chunk-PYADJP2I.js.map} +1 -1
- package/dist/{chunk-ROSPS5NM.modern.mjs → chunk-QKQRCYG4.modern.mjs} +2 -2
- package/dist/{chunk-ROSPS5NM.modern.mjs.map → chunk-QKQRCYG4.modern.mjs.map} +1 -1
- package/dist/{chunk-TSSPQLS6.js → chunk-SKQ7JGO5.js} +3 -3
- package/dist/{chunk-TSSPQLS6.js.map → chunk-SKQ7JGO5.js.map} +1 -1
- package/dist/{chunk-7SKICMGL.js → chunk-SWGQVSXQ.js} +2 -2
- package/dist/{chunk-7SKICMGL.js.map → chunk-SWGQVSXQ.js.map} +1 -1
- package/dist/{chunk-UFDVHFXE.js → chunk-SXQRCXMP.js} +2 -2
- package/dist/{chunk-UFDVHFXE.js.map → chunk-SXQRCXMP.js.map} +1 -1
- package/dist/{chunk-4XH33OL7.js → chunk-V45EFIXB.js} +2 -2
- package/dist/{chunk-4XH33OL7.js.map → chunk-V45EFIXB.js.map} +1 -1
- package/dist/{chunk-QV564WAK.modern.mjs → chunk-VYHLNTMX.modern.mjs} +2 -2
- package/dist/{chunk-QV564WAK.modern.mjs.map → chunk-VYHLNTMX.modern.mjs.map} +1 -1
- package/dist/chunk-YQTPPT5K.js +2 -0
- package/dist/{chunk-GDZZVHFP.js.map → chunk-YQTPPT5K.js.map} +1 -1
- package/dist/code-editor.d.mts +7 -2
- package/dist/code-editor.d.ts +7 -2
- package/dist/code-editor.js +2 -2
- package/dist/code-editor.js.map +1 -1
- package/dist/code-editor.modern.mjs +2 -2
- package/dist/code-editor.modern.mjs.map +1 -1
- package/dist/datepicker.js +1 -1
- package/dist/datepicker.modern.mjs +1 -1
- package/dist/drag-drop.js +1 -1
- package/dist/drag-drop.modern.mjs +1 -1
- package/dist/index.js +58 -58
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +55 -55
- package/dist/index.modern.mjs.map +1 -1
- package/dist/json-schema-form.js +1 -1
- package/dist/json-schema-form.modern.mjs +1 -1
- package/dist/textDiff.js +2 -2
- package/dist/textDiff.modern.mjs +1 -1
- package/migrate-imports.js +85 -75
- package/package.json +12 -5
- package/dist/chunk-GDZZVHFP.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/createCodeMirror6Theme.ts","../src/utils/codeMirrorLanguages.ts","../src/resources/icons/ExpandIcon.tsx","../src/resources/icons/CollapseIcon.tsx","../src/components/form/SolaceCodeEditor.tsx"],"names":["createCodeMirror6Theme","themeMapping","PROTOBUF_PURPLE","highlightStyle","HighlightStyle","t","editorTheme","EditorView","BASE_FONT_PX_SIZES","syntaxHighlighting","protobufLanguage","StreamLanguage","stream","getLanguageExtension","mode","json","xml","ExpandIcon","size","fill","jsx","SvgIcon_default","ExpandIcon_default","CollapseIcon","jsxs","CollapseIcon_default","StyledOuterWrapper","styled_default","theme","StyledInnerWrapper","StyledEditorWrapper","IconWrapper","renderHelperText","helperText","hasErrors","hasWarnings","ErrorText_default","WarningText_default","HelperText_default","SolaceCodeEditor","value","readOnly","expandable","fullScreen","onChange","useTheme","themeUtils_default","val","setVal","useState","editorExpanded","setEditorExpanded","useEffect","cm6Theme","useMemo","extensions","keymap","defaultKeymap","handleChange","newValue","toggleExpandedMode","Fragment","SolaceButton_default","CodeMirror","SolaceCodeEditor_default"],"mappings":"qkBAuBO,SAASA,CAAAA,CAAuBC,CAAAA,CAAyC,CAE/E,IAAMC,CAAAA,CAAkB,kBAAA,CAGlBC,CAAAA,CAAiBC,cAAAA,CAAe,MAAA,CAAO,CAE5C,CAAE,GAAA,CAAKC,IAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACxD,CAAE,GAAA,CAAKI,IAAA,CAAE,OAAA,CAAQA,IAAA,CAAE,MAAM,CAAA,CAAG,MAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACnE,CAAE,GAAA,CAAKI,IAAA,CAAE,SAAA,CAAW,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CAC3D,CAAE,IAAKI,IAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CAGxD,CAAE,GAAA,CAAKI,IAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,OAAA,CAAQ,IAAK,EAC1D,CAAE,GAAA,CAAKI,IAAA,CAAE,OAAA,CAAS,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,OAAA,CAAQ,IAAK,CAAA,CAC3D,CAAE,GAAA,CAAKI,IAAA,CAAE,KAAA,CAAO,KAAA,CAAOJ,CAAAA,CAAa,Q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,CAACO,CAAAA,EACDlB,IAAAA,CAAAqC,QAAAA,CAAA,CACC,QAAA,CAAA,CAAAzC,GAAAA,CAACU,CAAAA,CAAA,CACA,SAAA,CAAW,CAAA,EAAIoB,EAAuC,EAAA,CAAtB,mBAAwB,CAAA,CAAA,EAAIT,CAAAA,CAAW,qBAAA,CAAwB,EAAE,CAAA,CAAA,CAEjG,QAAA,CAAArB,IAAC2C,CAAAA,CAAA,CACA,KAAA,CAAOhB,GAAAA,CACP,QAAA,CAAUW,CAAAA,CACV,UAAA,CAAYH,CAAAA,CACZ,MAAOF,CAAAA,CACP,QAAA,CAAU,CAACZ,CAAAA,CACX,UAAA,CAAY,CACX,WAAA,CAAa,IAAA,CACb,UAAA,CAAY,IAAA,CACZ,eAAA,CAAiB,IAAA,CACjB,aAAA,CAAe,IAAA,CACf,cAAA,CAAgB,IAAA,CAChB,qBAAsB,KAAA,CACtB,yBAAA,CAA2B,KAAA,CAC3B,YAAA,CAAc,IACf,CAAA,CACD,CAAA,CACD,CAAA,CACCR,GAAcD,CAAAA,CAAiBC,CAAAA,CAAYC,CAAAA,CAAWC,CAAW,CAAA,CAAA,CACnE,CAAA,CAAA,CAEF,CAEF,KAEO6B,EAAAA,CAAQzB","file":"code-editor.modern.mjs","sourcesContent":["/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EditorView } from \"@codemirror/view\";\nimport { syntaxHighlighting, HighlightStyle } from \"@codemirror/language\";\nimport { tags as t } from \"@lezer/highlight\";\nimport type { Extension } from \"@codemirror/state\";\nimport { ThemeMapping } from \"../types/ThemeMapping\";\nimport { BASE_FONT_PX_SIZES } from \"../resources/typography\";\n\nexport function createCodeMirror6Theme(themeMapping: ThemeMapping): Extension[] {\n\t// Purple color for protobuf keywords and types\n\tconst PROTOBUF_PURPLE = \"rgb(119, 0, 136)\";\n\n\t// Create syntax highlighting that matches your theme colors\n\tconst highlightStyle = HighlightStyle.define([\n\t\t// Strings - Red\n\t\t{ tag: t.string, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.special(t.string), color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.character, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.regexp, color: themeMapping.palette.error.w100 },\n\n\t\t// Numbers - Teal\n\t\t{ tag: t.number, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.integer, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.float, color: themeMapping.palette.success.w100 },\n\n\t\t// Booleans/Atoms - Blue\n\t\t{ tag: t.bool, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.null, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.atom, color: themeMapping.palette.info.w100 },\n\n\t\t// Properties/Attributes - Blue for XML attributes, default for JSON properties\n\t\t{ tag: t.propertyName, color: themeMapping.palette.secondary.text.wMain }, // JSON properties stay default\n\t\t{ tag: t.attributeName, color: themeMapping.palette.info.w100 }, // XML attributes blue like original\n\t\t{ tag: t.attributeValue, color: themeMapping.palette.error.w100 }, // XML attribute values red\n\n\t\t// Tags - Teal\n\t\t{ tag: t.tagName, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.angleBracket, color: themeMapping.palette.success.w100 },\n\n\t\t// Keywords/Operators - Purple for protobuf keywords like original\n\t\t{ tag: t.keyword, color: PROTOBUF_PURPLE }, // Purple for protobuf keywords: syntax, package, import, message, string\n\t\t{ tag: t.definitionKeyword, color: PROTOBUF_PURPLE }, // Purple for 'message', 'syntax', etc\n\t\t{ tag: t.modifier, color: PROTOBUF_PURPLE }, // Purple modifiers\n\t\t{ tag: t.controlKeyword, color: PROTOBUF_PURPLE }, // Purple control keywords\n\t\t{ tag: t.operator, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.punctuation, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.bracket, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.brace, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.paren, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Comments\n\t\t{ tag: t.comment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.lineComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.blockComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\n\t\t// Types and definitions - purple for built-in protobuf types like 'string'\n\t\t{ tag: t.typeName, color: PROTOBUF_PURPLE }, // Purple for built-in types like 'string'\n\t\t{ tag: t.className, color: themeMapping.palette.secondary.text.wMain }, // Default for user-defined types like 'OtherRecord'\n\t\t{ tag: t.namespace, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Variables and other text elements - default color\n\t\t{ tag: t.variableName, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.function(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.definition(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Default/fallback for any unspecified tokens\n\t\t{ tag: t.name, color: themeMapping.palette.secondary.text.wMain }\n\t]);\n\n\t// Create editor theme for structural elements\n\tconst editorTheme = EditorView.theme({\n\t\t\"&\": {\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tfontFamily: \"Consolas, 'Liberation Mono', Menlo, Courier, monospace\", // Match original font stack\n\t\t\tlineHeight: \"normal\" // Match original line height\n\t\t},\n\t\t\".cm-content\": {\n\t\t\tpadding: \"4px 2px\", // Match original padding\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-focused\": {\n\t\t\toutline: \"none\"\n\t\t},\n\t\t\".cm-gutters\": {\n\t\t\tbackgroundColor: themeMapping.palette.background.w20,\n\t\t\tborderRight: `1px solid ${themeMapping.palette.secondary.w40}`,\n\t\t\tcolor: themeMapping.palette.secondary.text.wMain,\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-activeLineGutter\": {\n\t\t\tbackgroundColor: \"transparent\"\n\t\t},\n\t\t\".cm-cursor\": {\n\t\t\tborderLeftColor: themeMapping.palette.secondary.wMain\n\t\t},\n\t\t\".cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\"&.cm-focused .cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\".cm-matchingBracket\": {\n\t\t\tcolor: themeMapping.palette.success.w100,\n\t\t\tbackgroundColor: \"transparent\",\n\t\t\tfontWeight: \"bold\"\n\t\t}\n\t});\n\n\treturn [syntaxHighlighting(highlightStyle), editorTheme];\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { json } from \"@codemirror/lang-json\";\nimport { xml } from \"@codemirror/lang-xml\";\nimport { StreamLanguage } from \"@codemirror/language\";\n\n// Custom protobuf support (simplified)\nconst protobufLanguage = StreamLanguage.define({\n\tname: \"protobuf\",\n\ttoken(stream) {\n\t\tif (stream.match(/message|service|rpc|enum|option|import|package/)) {\n\t\t\treturn \"keyword\";\n\t\t}\n\t\tif (stream.match(/int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double/)) {\n\t\t\treturn \"type\";\n\t\t}\n\t\tif (stream.match(/\"[^\"]*\"/)) {\n\t\t\treturn \"string\";\n\t\t}\n\t\tif (stream.match(/\\d+/)) {\n\t\t\treturn \"number\";\n\t\t}\n\t\tstream.next();\n\t\treturn null;\n\t}\n});\n\nexport const getLanguageExtension = (mode: \"json\" | \"xml\" | \"protobuf\") => {\n\tswitch (mode) {\n\t\tcase \"json\":\n\t\t\treturn json();\n\t\tcase \"xml\":\n\t\t\treturn xml();\n\t\tcase \"protobuf\":\n\t\t\treturn protobufLanguage;\n\t\tdefault:\n\t\t\treturn json();\n\t}\n};\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nconst ExpandIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default ExpandIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SvgIcon } from \"@mui/material\";\nimport { IconProps } from \"./IconProps\";\n\nconst CollapseIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon\n\t\t\tsx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }}\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default CollapseIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState, useEffect, useMemo } from \"react\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport { EditorView } from \"@codemirror/view\";\nimport { keymap } from \"@codemirror/view\";\nimport { defaultKeymap } from \"@codemirror/commands\";\nimport { useTheme, styled } from \"@mui/material\";\nimport { createCodeMirror6Theme } from \"../../utils/createCodeMirror6Theme\";\nimport { getLanguageExtension } from \"../../utils/codeMirrorLanguages\";\nimport getThemeMappings from \"../../theming/themeUtils\";\nimport SolaceButton from \"./SolaceButton\";\nimport HelperText from \"./HelperText\";\nimport ErrorText from \"./ErrorText\";\nimport WarningText from \"./WarningText\";\nimport ExpandIcon from \"../../resources/icons/ExpandIcon\";\nimport CollapseIcon from \"../../resources/icons/CollapseIcon\";\n\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\n// KEEP ALL EXISTING STYLED COMPONENTS\nconst StyledOuterWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.OuterWrapper as CSSProperties)\n}));\nconst StyledInnerWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.InnerWrapper as CSSProperties)\n}));\nconst StyledEditorWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.EditorWrapper as CSSProperties)\n}));\nconst IconWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.IconWrapper as CSSProperties)\n}));\n\nexport interface SolaceCodeEditorProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier for the button\n\t */\n\tid?: string;\n\t/**\n\t * The value to initialize the content with\n\t */\n\tvalue?: string;\n\t/**\n\t * Renders the button disabled\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * render SolaceCodeEditor in fullscreen state\n\t */\n\tfullScreen?: boolean;\n\t/**\n\t * The formatting style to render the content as\n\t */\n\tmode?: \"json\" | \"xml\" | \"protobuf\";\n\t/**\n\t * Content to display as supportive/explanitory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in error state\n\t */\n\thasErrors?: boolean;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in warning state\n\t */\n\thasWarnings?: boolean;\n\t/**\n\t * whether to allow CodeEditor to be expandable\n\t */\n\texpandable?: boolean;\n\t/**\n\t * Callback function to trigger whenever the value of the `input` is changed\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tonChange?: (editor: any, data: any, value: string) => void;\n}\n\nconst renderHelperText = (helperText: string | JSX.Element, hasErrors: boolean, hasWarnings: boolean): JSX.Element => {\n\treturn hasErrors ? (\n\t\t<ErrorText>{helperText}</ErrorText>\n\t) : hasWarnings ? (\n\t\t<WarningText>{helperText}</WarningText>\n\t) : (\n\t\t<HelperText>{helperText}</HelperText>\n\t);\n};\n\nfunction SolaceCodeEditor({\n\tmode = \"json\",\n\tvalue,\n\treadOnly = false,\n\texpandable = false,\n\tfullScreen = false,\n\thelperText = \"\",\n\thasErrors = false,\n\thasWarnings = false,\n\tonChange\n}: SolaceCodeEditorProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst themeMapping = getThemeMappings();\n\n\tconst [val, setVal] = useState(value || \"\");\n\tconst [editorExpanded, setEditorExpanded] = useState(fullScreen || false);\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) setVal(value);\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tsetEditorExpanded(fullScreen);\n\t}, [fullScreen]);\n\n\t// Create CM6 theme from your theme mapping\n\tconst cm6Theme = useMemo(() => createCodeMirror6Theme(themeMapping), [themeMapping]);\n\n\t// Build extensions array\n\tconst extensions = useMemo(\n\t\t() => [getLanguageExtension(mode), EditorView.lineWrapping, keymap.of(defaultKeymap)],\n\t\t[mode]\n\t);\n\n\t// Map onChange to match old API for backward compatibility\n\tconst handleChange = (newValue: string) => {\n\t\tsetVal(newValue);\n\t\tif (onChange) {\n\t\t\t// Maintain old API: (editor, data, value)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tonChange(null as any, null, newValue);\n\t\t}\n\t};\n\n\tconst toggleExpandedMode = () => {\n\t\tsetEditorExpanded(!editorExpanded);\n\t};\n\n\t// KEEP EXACT SAME JSX STRUCTURE!\n\treturn (\n\t\t<>\n\t\t\t{expandable && (\n\t\t\t\t<StyledOuterWrapper className={editorExpanded ? \"codeEditor-expanded--backdrop\" : \"\"}>\n\t\t\t\t\t<StyledInnerWrapper className={editorExpanded ? \"codeEditor-expanded--main\" : \"\"}>\n\t\t\t\t\t\t<IconWrapper className={editorExpanded ? \"codeEditor-expanded--icon\" : \"codeEditor-collapsed--icon\"}>\n\t\t\t\t\t\t\t{editorExpanded ? (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonCollapseCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Collapse\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CollapseIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonExpandCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Expand\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ExpandIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</IconWrapper>\n\t\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t\t</StyledInnerWrapper>\n\t\t\t\t</StyledOuterWrapper>\n\t\t\t)}\n\t\t\t{!expandable && (\n\t\t\t\t<>\n\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport default SolaceCodeEditor;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/createCodeMirror6Theme.ts","../src/utils/codeMirrorLanguages.ts","../src/resources/icons/ExpandIcon.tsx","../src/resources/icons/CollapseIcon.tsx","../src/components/form/SolaceCodeEditor.tsx"],"names":["createCodeMirror6Theme","themeMapping","PROTOBUF_PURPLE","highlightStyle","HighlightStyle","t","editorTheme","EditorView","BASE_FONT_PX_SIZES","syntaxHighlighting","protobufLanguage","StreamLanguage","stream","getLanguageExtension","mode","json","xml","yaml","ExpandIcon","size","fill","jsx","SvgIcon_default","ExpandIcon_default","CollapseIcon","jsxs","CollapseIcon_default","StyledOuterWrapper","styled_default","theme","StyledInnerWrapper","StyledEditorWrapper","customHeight","IconWrapper","renderHelperText","helperText","hasErrors","hasWarnings","ErrorText_default","WarningText_default","HelperText_default","SolaceCodeEditor","value","readOnly","expandable","fullScreen","height","onChange","useTheme","themeUtils_default","val","setVal","useState","editorExpanded","setEditorExpanded","useEffect","cm6Theme","useMemo","extensions","keymap","defaultKeymap","handleChange","newValue","cmHeight","toggleExpandedMode","Fragment","SolaceButton_default","CodeMirror","SolaceCodeEditor_default"],"mappings":"8mBAuBO,SAASA,CAAAA,CAAuBC,CAAAA,CAAyC,CAE/E,IAAMC,CAAAA,CAAkB,kBAAA,CAGlBC,CAAAA,CAAiBC,cAAAA,CAAe,MAAA,CAAO,CAE5C,CAAE,GAAA,CAAKC,KAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACxD,CAAE,IAAKI,IAAA,CAAE,OAAA,CAAQA,IAAA,CAAE,MAAM,EAAG,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACnE,CAAE,GAAA,CAAKI,IAAA,CAAE,SAAA,CAAW,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,MAAM,IAAK,CAAA,CAC3D,CAAE,GAAA,CAAKI,IAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,QAAQ,KAAA,CAAM,IAAK,CAAA,CAGxD,CAAE,GAAA,CAAKI,IAAA,CAAE,MAAA,CAA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AAA,CACD,CAAA,CACD,EACCR,CAAAA,EAAcD,CAAAA,CAAiBC,CAAAA,CAAYC,CAAAA,CAAWC,CAAW,CAAA,CAAA,CACnE,CAAA,CAAA,CAEF,CAEF,KAEO+B,EAAAA,CAAQ3B","file":"code-editor.modern.mjs","sourcesContent":["/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EditorView } from \"@codemirror/view\";\nimport { syntaxHighlighting, HighlightStyle } from \"@codemirror/language\";\nimport { tags as t } from \"@lezer/highlight\";\nimport type { Extension } from \"@codemirror/state\";\nimport { ThemeMapping } from \"../types/ThemeMapping\";\nimport { BASE_FONT_PX_SIZES } from \"../resources/typography\";\n\nexport function createCodeMirror6Theme(themeMapping: ThemeMapping): Extension[] {\n\t// Purple color for protobuf keywords and types\n\tconst PROTOBUF_PURPLE = \"rgb(119, 0, 136)\";\n\n\t// Create syntax highlighting that matches your theme colors\n\tconst highlightStyle = HighlightStyle.define([\n\t\t// Strings - Red\n\t\t{ tag: t.string, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.special(t.string), color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.character, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.regexp, color: themeMapping.palette.error.w100 },\n\n\t\t// Numbers - Teal\n\t\t{ tag: t.number, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.integer, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.float, color: themeMapping.palette.success.w100 },\n\n\t\t// Booleans/Atoms - Blue\n\t\t{ tag: t.bool, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.null, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.atom, color: themeMapping.palette.info.w100 },\n\n\t\t// Properties/Attributes - Blue for XML attributes, default for JSON properties\n\t\t{ tag: t.propertyName, color: themeMapping.palette.secondary.text.wMain }, // JSON properties stay default\n\t\t{ tag: t.attributeName, color: themeMapping.palette.info.w100 }, // XML attributes blue like original\n\t\t{ tag: t.attributeValue, color: themeMapping.palette.error.w100 }, // XML attribute values red\n\n\t\t// Tags - Teal\n\t\t{ tag: t.tagName, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.angleBracket, color: themeMapping.palette.success.w100 },\n\n\t\t// Keywords/Operators - Purple for protobuf keywords like original\n\t\t{ tag: t.keyword, color: PROTOBUF_PURPLE }, // Purple for protobuf keywords: syntax, package, import, message, string\n\t\t{ tag: t.definitionKeyword, color: PROTOBUF_PURPLE }, // Purple for 'message', 'syntax', etc\n\t\t{ tag: t.modifier, color: PROTOBUF_PURPLE }, // Purple modifiers\n\t\t{ tag: t.controlKeyword, color: PROTOBUF_PURPLE }, // Purple control keywords\n\t\t{ tag: t.operator, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.punctuation, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.bracket, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.brace, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.paren, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Comments\n\t\t{ tag: t.comment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.lineComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.blockComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\n\t\t// Types and definitions - purple for built-in protobuf types like 'string'\n\t\t{ tag: t.typeName, color: PROTOBUF_PURPLE }, // Purple for built-in types like 'string'\n\t\t{ tag: t.className, color: themeMapping.palette.secondary.text.wMain }, // Default for user-defined types like 'OtherRecord'\n\t\t{ tag: t.namespace, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Variables and other text elements - default color\n\t\t{ tag: t.variableName, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.function(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.definition(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Default/fallback for any unspecified tokens\n\t\t{ tag: t.name, color: themeMapping.palette.secondary.text.wMain }\n\t]);\n\n\t// Create editor theme for structural elements\n\tconst editorTheme = EditorView.theme({\n\t\t\"&\": {\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tfontFamily: \"Consolas, 'Liberation Mono', Menlo, Courier, monospace\", // Match original font stack\n\t\t\tlineHeight: \"normal\" // Match original line height\n\t\t},\n\t\t\".cm-content\": {\n\t\t\tpadding: \"4px 2px\", // Match original padding\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-focused\": {\n\t\t\toutline: \"none\"\n\t\t},\n\t\t\".cm-gutters\": {\n\t\t\tbackgroundColor: themeMapping.palette.background.w20,\n\t\t\tborderRight: `1px solid ${themeMapping.palette.secondary.w40}`,\n\t\t\tcolor: themeMapping.palette.secondary.text.wMain,\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-activeLineGutter\": {\n\t\t\tbackgroundColor: \"transparent\"\n\t\t},\n\t\t\".cm-cursor\": {\n\t\t\tborderLeftColor: themeMapping.palette.secondary.wMain\n\t\t},\n\t\t\".cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\"&.cm-focused .cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\".cm-matchingBracket\": {\n\t\t\tcolor: themeMapping.palette.success.w100,\n\t\t\tbackgroundColor: \"transparent\",\n\t\t\tfontWeight: \"bold\"\n\t\t}\n\t});\n\n\treturn [syntaxHighlighting(highlightStyle), editorTheme];\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { json } from \"@codemirror/lang-json\";\nimport { xml } from \"@codemirror/lang-xml\";\nimport { yaml } from \"@codemirror/lang-yaml\";\nimport { StreamLanguage } from \"@codemirror/language\";\n\n// Custom protobuf support (simplified)\nconst protobufLanguage = StreamLanguage.define({\n\tname: \"protobuf\",\n\ttoken(stream) {\n\t\tif (stream.match(/message|service|rpc|enum|option|import|package/)) {\n\t\t\treturn \"keyword\";\n\t\t}\n\t\tif (stream.match(/int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double/)) {\n\t\t\treturn \"type\";\n\t\t}\n\t\tif (stream.match(/\"[^\"]*\"/)) {\n\t\t\treturn \"string\";\n\t\t}\n\t\tif (stream.match(/\\d+/)) {\n\t\t\treturn \"number\";\n\t\t}\n\t\tstream.next();\n\t\treturn null;\n\t}\n});\n\nexport const getLanguageExtension = (mode: \"json\" | \"xml\" | \"protobuf\" | \"yaml\") => {\n\tswitch (mode) {\n\t\tcase \"json\":\n\t\t\treturn json();\n\t\tcase \"xml\":\n\t\t\treturn xml();\n\t\tcase \"yaml\":\n\t\t\treturn yaml();\n\t\tcase \"protobuf\":\n\t\t\treturn protobufLanguage;\n\t\tdefault:\n\t\t\treturn json();\n\t}\n};\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nconst ExpandIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default ExpandIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SvgIcon } from \"@mui/material\";\nimport { IconProps } from \"./IconProps\";\n\nconst CollapseIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon\n\t\t\tsx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }}\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default CollapseIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState, useEffect, useMemo } from \"react\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport { EditorView } from \"@codemirror/view\";\nimport { keymap } from \"@codemirror/view\";\nimport { defaultKeymap } from \"@codemirror/commands\";\nimport { useTheme, styled } from \"@mui/material\";\nimport { createCodeMirror6Theme } from \"../../utils/createCodeMirror6Theme\";\nimport { getLanguageExtension } from \"../../utils/codeMirrorLanguages\";\nimport getThemeMappings from \"../../theming/themeUtils\";\nimport SolaceButton from \"./SolaceButton\";\nimport HelperText from \"./HelperText\";\nimport ErrorText from \"./ErrorText\";\nimport WarningText from \"./WarningText\";\nimport ExpandIcon from \"../../resources/icons/ExpandIcon\";\nimport CollapseIcon from \"../../resources/icons/CollapseIcon\";\n\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\n// KEEP ALL EXISTING STYLED COMPONENTS\nconst StyledOuterWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.OuterWrapper as CSSProperties)\n}));\nconst StyledInnerWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.InnerWrapper as CSSProperties)\n}));\nconst StyledEditorWrapper = styled(\"div\")<{ customHeight?: string }>(({ theme, customHeight }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.EditorWrapper as CSSProperties),\n\t...(customHeight && {\n\t\theight: `${customHeight} !important`,\n\t\t\"& .cm-theme\": {\n\t\t\theight: `${customHeight} !important`\n\t\t},\n\t\t\"& .cm-editor\": {\n\t\t\theight: `${customHeight} !important`\n\t\t},\n\t\t\"& .cm-editor .cm-scroller\": {\n\t\t\tmaxHeight: `${customHeight} !important`\n\t\t}\n\t})\n}));\nconst IconWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.IconWrapper as CSSProperties)\n}));\n\nexport interface SolaceCodeEditorProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier for the button\n\t */\n\tid?: string;\n\t/**\n\t * The value to initialize the content with\n\t */\n\tvalue?: string;\n\t/**\n\t * Renders the button disabled\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * render SolaceCodeEditor in fullscreen state\n\t */\n\tfullScreen?: boolean;\n\t/**\n\t * The formatting style to render the content as\n\t */\n\tmode?: \"json\" | \"xml\" | \"protobuf\" | \"yaml\";\n\t/**\n\t * Content to display as supportive/explanitory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in error state\n\t */\n\thasErrors?: boolean;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in warning state\n\t */\n\thasWarnings?: boolean;\n\t/**\n\t * whether to allow CodeEditor to be expandable\n\t */\n\texpandable?: boolean;\n\t/**\n\t * Height of the code editor. Can be a number (in pixels) or a string (e.g., '300px', '100%')\n\t * @default '300px'\n\t */\n\theight?: string | number;\n\t/**\n\t * Callback function to trigger whenever the value of the `input` is changed\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tonChange?: (editor: any, data: any, value: string) => void;\n}\n\nconst renderHelperText = (helperText: string | JSX.Element, hasErrors: boolean, hasWarnings: boolean): JSX.Element => {\n\treturn hasErrors ? (\n\t\t<ErrorText>{helperText}</ErrorText>\n\t) : hasWarnings ? (\n\t\t<WarningText>{helperText}</WarningText>\n\t) : (\n\t\t<HelperText>{helperText}</HelperText>\n\t);\n};\n\nfunction SolaceCodeEditor({\n\tmode = \"json\",\n\tvalue,\n\treadOnly = false,\n\texpandable = false,\n\tfullScreen = false,\n\thelperText = \"\",\n\thasErrors = false,\n\thasWarnings = false,\n\theight,\n\tonChange\n}: SolaceCodeEditorProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst themeMapping = getThemeMappings();\n\n\tconst [val, setVal] = useState(value || \"\");\n\tconst [editorExpanded, setEditorExpanded] = useState(fullScreen || false);\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) setVal(value);\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tsetEditorExpanded(fullScreen);\n\t}, [fullScreen]);\n\n\t// Create CM6 theme from your theme mapping\n\tconst cm6Theme = useMemo(() => createCodeMirror6Theme(themeMapping), [themeMapping]);\n\n\t// Build extensions array\n\tconst extensions = useMemo(\n\t\t() => [getLanguageExtension(mode), EditorView.lineWrapping, keymap.of(defaultKeymap)],\n\t\t[mode]\n\t);\n\n\t// Map onChange to match old API for backward compatibility\n\tconst handleChange = (newValue: string) => {\n\t\tsetVal(newValue);\n\t\tif (onChange) {\n\t\t\t// Maintain old API: (editor, data, value)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tonChange(null as any, null, newValue);\n\t\t}\n\t};\n\n\t// Convert height prop to string format for CodeMirror\n\tconst cmHeight = height ? (typeof height === \"number\" ? `${height}px` : height) : \"300px\";\n\n\tconst toggleExpandedMode = () => {\n\t\tsetEditorExpanded(!editorExpanded);\n\t};\n\n\t// KEEP EXACT SAME JSX STRUCTURE!\n\treturn (\n\t\t<>\n\t\t\t{expandable && (\n\t\t\t\t<StyledOuterWrapper className={editorExpanded ? \"codeEditor-expanded--backdrop\" : \"\"}>\n\t\t\t\t\t<StyledInnerWrapper className={editorExpanded ? \"codeEditor-expanded--main\" : \"\"}>\n\t\t\t\t\t\t<IconWrapper className={editorExpanded ? \"codeEditor-expanded--icon\" : \"codeEditor-collapsed--icon\"}>\n\t\t\t\t\t\t\t{editorExpanded ? (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonCollapseCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Collapse\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CollapseIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonExpandCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Expand\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ExpandIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</IconWrapper>\n\t\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\t\tcustomHeight={cmHeight}\n\t\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\t\theight={cmHeight}\n\t\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t\t</StyledInnerWrapper>\n\t\t\t\t</StyledOuterWrapper>\n\t\t\t)}\n\t\t\t{!expandable && (\n\t\t\t\t<>\n\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\tcustomHeight={cmHeight}\n\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport default SolaceCodeEditor;\n"]}
|
package/dist/datepicker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkDKWU3WVA_js=require('./chunk-DKWU3WVA.js'),
|
|
1
|
+
'use strict';var chunkDKWU3WVA_js=require('./chunk-DKWU3WVA.js'),chunkV45EFIXB_js=require('./chunk-V45EFIXB.js'),DatePicker=require('@mui/x-date-pickers/DatePicker'),LocalizationProvider=require('@mui/x-date-pickers/LocalizationProvider'),AdapterMoment=require('@mui/x-date-pickers/AdapterMoment'),d=require('moment-timezone'),react=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var d__default=/*#__PURE__*/_interopDefault(d);var i=(r,n)=>r?n?d__default.default.tz(r,n):d__default.default(r):null;function h({id:r,name:n,value:s=null,onChange:a,onClear:m,dataQa:p,variant:D="yearMonthDay",disabled:M=false,timezone:t=void 0,disableFuture:x=false,disablePast:k=false,onMonthChange:u,isDateAvailable:l,loading:v=false}){let[C,f]=react.useState(i(s,t)),{views:O,openTo:R,format:T}=chunkDKWU3WVA_js.b[D];react.useEffect(()=>{f(i(s,t));},[s,t]);let w=e=>{if(f(e),a&&e){let o=i(e.format(),t);a(o?o.toISOString():null);}else a&&a(null);},A=e=>{if(u){let o=e.clone().startOf("month").hour(12);u(o.toISOString());}},I=e=>{if(!l)return false;let o=i(e.format(),t),F=o?o.toISOString():e.toISOString();return !l(F)},c=chunkV45EFIXB_js.ua().palette.ux.accent.n2.wMain,y={".MuiPickersCalendarHeader-switchViewButton:focus-visible":{border:`1px solid ${c}`,padding:"3px",borderRadius:"3px"},".MuiPickersArrowSwitcher-button:focus-visible":{border:`1px solid ${c}`,padding:"3px",borderRadius:"3px"},".MuiPickersDay-root:focus-visible":{border:`1px solid ${c}`,borderRadius:"50%"}};return jsxRuntime.jsx(LocalizationProvider.LocalizationProvider,{dateAdapter:AdapterMoment.AdapterMoment,dateLibInstance:d__default.default,children:jsxRuntime.jsx(DatePicker.DatePicker,{className:"SolaceDatePicker",value:C,onChange:w,onMonthChange:A,shouldDisableDate:l?I:void 0,loading:v,"data-qa":p,slotProps:{field:{clearable:true,onClear:()=>m&&m()},popper:{sx:y},textField:{inputProps:{"data-qa":p,id:r,name:n}}},disabled:M,views:O,openTo:R,format:T,disableFuture:x,disablePast:k,timezone:t??"system"})})}Object.defineProperty(exports,"SolaceDatePickerVariant",{enumerable:true,get:function(){return chunkDKWU3WVA_js.a}});exports.SolaceDatePicker=h;//# sourceMappingURL=datepicker.js.map
|
|
2
2
|
//# sourceMappingURL=datepicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b}from'./chunk-NWTC7FRW.modern.mjs';export{a as SolaceDatePickerVariant}from'./chunk-NWTC7FRW.modern.mjs';import {ua}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-NWTC7FRW.modern.mjs';export{a as SolaceDatePickerVariant}from'./chunk-NWTC7FRW.modern.mjs';import {ua}from'./chunk-I7OJ5H4U.modern.mjs';import {DatePicker}from'@mui/x-date-pickers/DatePicker';import {LocalizationProvider}from'@mui/x-date-pickers/LocalizationProvider';import {AdapterMoment}from'@mui/x-date-pickers/AdapterMoment';import d from'moment-timezone';import {useState,useEffect}from'react';import {jsx}from'react/jsx-runtime';var i=(r,n)=>r?n?d.tz(r,n):d(r):null;function h({id:r,name:n,value:s=null,onChange:a,onClear:m,dataQa:p,variant:D="yearMonthDay",disabled:M=false,timezone:t=void 0,disableFuture:x=false,disablePast:k=false,onMonthChange:u,isDateAvailable:l,loading:v=false}){let[C,f]=useState(i(s,t)),{views:O,openTo:R,format:T}=b[D];useEffect(()=>{f(i(s,t));},[s,t]);let w=e=>{if(f(e),a&&e){let o=i(e.format(),t);a(o?o.toISOString():null);}else a&&a(null);},A=e=>{if(u){let o=e.clone().startOf("month").hour(12);u(o.toISOString());}},I=e=>{if(!l)return false;let o=i(e.format(),t),F=o?o.toISOString():e.toISOString();return !l(F)},c=ua().palette.ux.accent.n2.wMain,y={".MuiPickersCalendarHeader-switchViewButton:focus-visible":{border:`1px solid ${c}`,padding:"3px",borderRadius:"3px"},".MuiPickersArrowSwitcher-button:focus-visible":{border:`1px solid ${c}`,padding:"3px",borderRadius:"3px"},".MuiPickersDay-root:focus-visible":{border:`1px solid ${c}`,borderRadius:"50%"}};return jsx(LocalizationProvider,{dateAdapter:AdapterMoment,dateLibInstance:d,children:jsx(DatePicker,{className:"SolaceDatePicker",value:C,onChange:w,onMonthChange:A,shouldDisableDate:l?I:void 0,loading:v,"data-qa":p,slotProps:{field:{clearable:true,onClear:()=>m&&m()},popper:{sx:y},textField:{inputProps:{"data-qa":p,id:r,name:n}}},disabled:M,views:O,openTo:R,format:T,disableFuture:x,disablePast:k,timezone:t??"system"})})}export{h as SolaceDatePicker};//# sourceMappingURL=datepicker.modern.mjs.map
|
|
2
2
|
//# sourceMappingURL=datepicker.modern.mjs.map
|
package/dist/drag-drop.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkUFDVHFXE_js=require('./chunk-UFDVHFXE.js'),chunk7SKICMGL_js=require('./chunk-7SKICMGL.js');require('./chunk-GDZZVHFP.js');var chunk4XH33OL7_js=require('./chunk-4XH33OL7.js'),be=require('react'),dnd=require('@hello-pangea/dnd'),jsxRuntime=require('react/jsx-runtime'),reactVirtuoso=require('react-virtuoso');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var be__default=/*#__PURE__*/_interopDefault(be);var re=({fill:e,opacity:r})=>jsxRuntime.jsx(chunk4XH33OL7_js.Na,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("g",{transform:"translate(5,3)",children:jsxRuntime.jsx("path",{d:"M9.5 0H4.5L3.5 1H0.401C0.179 1 0 1.179 0 1.401V2.599C0 2.821 0.179 3 0.401 3H13.599C13.821 3 14 2.821 14 2.599V1.401C14 1.179 13.821 1 13.599 1H10.5L9.5 0ZM10.875 6L10.118 16H3.882L3.125 6H10.875ZM12.59 4H1.39C1.159 4 0.982 4.196 1 4.426L2 17.634C2.016 17.841 2.193 18 2.4 18H11.6C11.807 18 11.984 17.841 12 17.635L13 4.427C13.018 4.196 12.82 4 12.59 4Z",fill:e,opacity:r})})});var te=({fill:e,opacity:r})=>jsxRuntime.jsx(chunk4XH33OL7_js.Na,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("g",{transform:"translate(7,4)",children:jsxRuntime.jsx("path",{d:"M4 14C4 15.1 3.1 16 2 16C0.9 16 0 15.1 0 14C0 12.9 0.9 12 2 12C3.1 12 4 12.9 4 14ZM2 6C0.9 6 0 6.9 0 8C0 9.1 0.9 10 2 10C3.1 10 4 9.1 4 8C4 6.9 3.1 6 2 6ZM2 0C0.9 0 0 0.9 0 2C0 3.1 0.9 4 2 4C3.1 4 4 3.1 4 2C4 0.9 3.1 0 2 0ZM8 4C9.1 4 10 3.1 10 2C10 0.9 9.1 0 8 0C6.9 0 6 0.9 6 2C6 3.1 6.9 4 8 4ZM8 6C6.9 6 6 6.9 6 8C6 9.1 6.9 10 8 10C9.1 10 10 9.1 10 8C10 6.9 9.1 6 8 6ZM8 12C6.9 12 6 12.9 6 14C6 15.1 6.9 16 8 16C9.1 16 10 15.1 10 14C10 12.9 9.1 12 8 12Z",fill:e,fillOpacity:r})})});var pe=(e,r,a,l)=>{let p="";return r!==null&&a!==null&&(r&&a+1===l||!r&&a===l)&&(p=`1px solid ${e.palette.ux.accent.n2.wMain}`),p},ce=chunk4XH33OL7_js.wa("div",{shouldForwardProp:e=>e!=="isDragging"&&e!=="dropOverIndex"&&e!=="dropFromTop"&&e!=="readOnly"&&e!=="disableReorder"})(({theme:e,isDragging:r,dropOverIndex:a,index:l,dropFromTop:p,readOnly:s,disableReorder:b})=>({...e.mixins.formComponent_AVPItem.container,backgroundColor:r?e.palette.ux.brand.w10:"inherit",borderTop:pe(e,p,a,l),gridTemplateColumns:s?"0px minmax(0, 1fr) 8px minmax(0, 1fr) 0px":b?"0px 1fr 8px 1fr 40px":"32px 1fr 8px 1fr 40px"})),me=chunk4XH33OL7_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_AVPItem.inputWrapperForKey})),de=chunk4XH33OL7_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_AVPItem.inputWrapperForValue})),ge=chunk4XH33OL7_js.wa("div",{shouldForwardProp:e=>e!=="ghostItem"&&e!=="isDragging"&&e!=="readOnly"})(({theme:e,ghostItem:r,isDragging:a,readOnly:l})=>({...e.mixins.formComponent_AVPItem.moveButton,cursor:r?"default":a?"move":"pointer",display:l?"none":"inherit"})),fe=chunk4XH33OL7_js.wa("div",{shouldForwardProp:e=>e!=="ghostItem"&&e!=="cursor"&&e!=="background"&&e!=="readOnly"})(({theme:e,ghostItem:r,cursor:a,background:l,readOnly:p})=>({...e.mixins.formComponent_AVPItem.deleteButton,cursor:a,display:p?"none":"inherit",height:"fit-content",":hover":{backgroundColor:l,svg:{path:{fill:r?e.palette.ux.secondary.w40:e.palette.ux.deprecated.primary.wMain}}},paddingBottom:e.spacing(.5),marginLeft:e.spacing(1)})),oe=chunk4XH33OL7_js.wa("div")(({theme:e})=>({paddingTop:"7px",color:e.palette.ux.secondary.text.wMain}));var U=({id:e,index:r,avpKey:a,avpValue:l,dataTags:p,ghostItem:s=false,onDelete:b,onChange:v,onKeyUp:C,onBlur:F,keyErrorText:M,valueErrorText:E,dropOverIndex:w,dropFromTop:T,readOnly:u,emptyFieldDisplayValue:S="",disableReorder:h=false})=>{let f=chunk4XH33OL7_js.ua();return jsxRuntime.jsx(dnd.Draggable,{draggableId:e,index:r,isDragDisabled:s||h,children:(x,c)=>jsxRuntime.jsxs(ce,{ref:x.innerRef,...x.draggableProps,isDragging:c.isDragging,dropOverIndex:w,dropFromTop:T,index:r,readOnly:!!u,disableReorder:h,children:[!h&&jsxRuntime.jsx(ge,{...x.dragHandleProps,isDragging:c.isDragging,ghostItem:s,readOnly:!!u,"data-qa":`avpMove-${r}`,children:jsxRuntime.jsx(te,{fill:s?f.palette.ux.secondary.w40:f.palette.ux.secondary.wMain,opacity:1})}),jsxRuntime.jsxs(me,{children:[!a&&l&&u&&jsxRuntime.jsx(oe,{"data-qa":`avpKey-${r}`,children:S}),(a||!a&&!u)&&jsxRuntime.jsx(chunkUFDVHFXE_js.d,{name:"key",dataQa:`avpKey-${r}`,dataTags:p,value:a,onChange:i=>v(i,r),onKeyUp:C,onBlur:i=>F(i,r),hasErrors:s?false:!!M,helperText:s?"":M,readOnly:u})]}),jsxRuntime.jsxs(de,{children:[a&&!l&&u&&jsxRuntime.jsx(oe,{"data-qa":`avpValue-${r}`,children:S}),(l||!l&&!u)&&jsxRuntime.jsx(chunkUFDVHFXE_js.d,{name:"value",dataQa:`avpValue-${r}`,dataTags:p,value:l,onChange:i=>v(i,r),onKeyUp:C,onBlur:i=>F(i,r),hasErrors:s?false:!!E,helperText:s?"":E,readOnly:u})]}),jsxRuntime.jsx(fe,{onClick:i=>b(i,r),tabIndex:0,ghostItem:s,cursor:s?"default":"pointer",background:s?"inherit":f.palette.ux.secondary.w10,readOnly:!!u,"data-qa":`avpDelete-${r}`,children:jsxRuntime.jsx(re,{fill:s?f.palette.ux.secondary.w40:f.palette.ux.secondary.wMain,opacity:1})})]})})};var Se=chunk4XH33OL7_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_AVPForm.container})),he=chunk4XH33OL7_js.wa("div")(({theme:e,readOnly:r,disableReorder:a,hasScrollBar:l})=>({...e.mixins.formComponent_AVPForm.labelWrapper,gridTemplateColumns:r?`0px minmax(0, 1fr) 8px minmax(0, 1fr) 0px${l?" 16px":""}`:a?`0px 1fr 8px 1fr 32px${l?" 16px":""}`:`32px 1fr 8px 1fr 32px${l?" 16px":""}`})),ae=chunk4XH33OL7_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_AVPForm.listWrapper})),Ve=(e,r,a)=>{let l=Array.from(e),[p]=l.splice(r,1);return l.splice(a,0,p),l},ne=(e,r)=>e[r].key===""&&e[r].value==="";var Ie=(e,r,a)=>{e==="ArrowUp"&&r-1>0?a[r-2].select():e==="ArrowDown"&&r+2<a.length?a[r+2].select():e==="Enter"&&r+2<a.length&&(r%2===0?a[r+2].select():r%2===1&&a[r+1].select());},le=be__default.default.forwardRef((e,r)=>{let a=e.context?.headerRef,l=e.context?.virtualizedAvpListOption,p=e.style;return jsxRuntime.jsx(ae,{...e,ref:r,style:{...p,width:l?.height&&a.current?a.current.offsetWidth-16:"100%"}})});le.displayName="List";var Ae=({id:e,name:r,readOnly:a,labelForKeys:l="Name",labelForValues:p="DisplayName",avpList:s=[],onAVPListUpdate:b,avpKeyValidationCallback:v,avpValueValidationCallback:C,enableRequiredKeyFieldIndicator:F,enableRequiredValueFieldIndicator:M,emptyFieldDisplayValue:E="",keyRequired:w=true,keyIsRequiredMessage:T="Required",helperText:u="",hasErrors:S=false,hasWarnings:h=false,disableReorder:f=false,avpListMaxHeight:x,virtualizedAvpListOption:c})=>{let[i,V]=be.useState(s),[N,R]=be.useState(null),[_,B]=be.useState(null),D=be.useRef(null);be.useEffect(()=>{let n=[...s];n.push({key:"",value:""}),V(n);},[s]);let I=be.useCallback(n=>{V(n),b&&ne(n,n.length-1)&&b(n.slice(0,-1)),R(null),B(null);},[b]),ie=n=>{if(!n.destination||n.destination.index===n.source.index||n.destination.index===i.length-1)return;let t=Ve(i,n.source.index,n.destination.index);V(t),b&&ne(t,t.length-1)&&b(t.slice(0,-1)),R(null),B(null);},se=n=>{let t=n.source.index,o=n?.destination?.index??null,m=o,y=null;t!==null&&o!==null&&(t>o?y=false:t<o&&(y=true)),R(m),B(y);},J=be.useCallback((n,t)=>{let o=n.name,m=n.value,y=[...i];y[t][o]=m,o&&y.length-1===t&&y.push({key:"",value:""}),V(y),I(y);},[i,I]),L=be.useCallback(n=>n===i.length-1,[i.length]),X=be.useCallback((n,t)=>{if(n.type==="click"&&!L(t)&&i.length>1){let o=[...i];o.splice(t,1),V(o),I(o);}},[i,I,L]),Q=be.useCallback(n=>{let t=document.querySelectorAll("[data-tags='avpInput']"),o=document.activeElement;for(let m=0;m<t.length;m++)t[m].getAttribute("data-qa")===o?.getAttribute("data-qa")&&Ie(n.key,m,t);},[]),Y=be.useCallback((n,t)=>{let o=[...i];if(o[t].key=o[t].key.trim(),o[t].value=o[t].value.trim(),n.target.getAttribute("name")==="key"&&v){let m=v(n.target.value,o.slice(0,-1));m?o[t].keyErrorText=m:delete o[t].keyErrorText;}if(n.target.getAttribute("name")==="value"&&C){let m=C(n.target.value,o.slice(0,-1));m?o[t].valueErrorText=m:delete o[t].valueErrorText;}w&&!o[t].key?o[t].keyErrorText=T:o[t].keyErrorText===T&&delete o[t].keyErrorText,V(o),I(o);},[i,w,v,C,T,I]);return jsxRuntime.jsxs(dnd.DragDropContext,{onDragEnd:ie,onDragUpdate:se,children:[jsxRuntime.jsx(dnd.Droppable,{droppableId:e??r,isDropDisabled:!!f||!!a,children:n=>jsxRuntime.jsxs(Se,{ref:n.innerRef,...n.droppableProps,children:[jsxRuntime.jsxs(he,{ref:D,readOnly:!!a,disableReorder:!!f,hasScrollBar:!!x||!!c?.height,children:[jsxRuntime.jsx(chunkUFDVHFXE_js.a,{id:"avpLabelForKeys",required:F,children:l}),jsxRuntime.jsx(chunkUFDVHFXE_js.a,{id:"avpLabelForValues",required:M,children:p})]}),c&&D.current&&jsxRuntime.jsx(reactVirtuoso.Virtuoso,{context:{headerRef:D,virtualizedAvpListOption:c},style:{height:c.height?c.height:"auto",minHeight:c.minHeight?c.minHeight:40},useWindowScroll:c.useWindowScrolling,increaseViewportBy:c.increaseViewportBy,components:{List:le},initialTopMostItemIndex:c.initialTopMostItemIndex??0,data:i,itemContent:(t,o)=>jsxRuntime.jsx(U,{id:`${t}`,index:t,avpKey:o.key,avpValue:o.value,dataTags:"avpInput",onChange:J,onDelete:X,onKeyUp:Q,ghostItem:L(t),onBlur:Y,keyErrorText:o.keyErrorText,valueErrorText:o.valueErrorText,dropOverIndex:N,dropFromTop:_,readOnly:a,emptyFieldDisplayValue:E,disableReorder:f},`${t}`)}),!c&&D.current&&jsxRuntime.jsx("div",{style:x?{maxHeight:x,overflowY:"auto"}:void 0,children:jsxRuntime.jsx(ae,{style:{width:x?D.current.offsetWidth-16:"100%"},children:i.map((t,o)=>jsxRuntime.jsx(U,{id:`${o}`,index:o,avpKey:t.key,avpValue:t.value,dataTags:"avpInput",onChange:J,onDelete:X,onKeyUp:Q,ghostItem:L(o),onBlur:Y,keyErrorText:t.keyErrorText,valueErrorText:t.valueErrorText,dropOverIndex:N,dropFromTop:_,readOnly:a,emptyFieldDisplayValue:E,disableReorder:f},`${o}`))})}),n.placeholder]})}),u&&jsxRuntime.jsxs("div",{style:{paddingLeft:"16px"},children:[u&&!h&&!S&&jsxRuntime.jsx(chunk7SKICMGL_js.c,{children:u}),u&&!S&&h&&jsxRuntime.jsx(chunk7SKICMGL_js.g,{children:u}),u&&S&&jsxRuntime.jsx(chunk7SKICMGL_js.e,{children:u})]})]})},Ee=Ae;exports.SolaceAttributeValuePairForm=Ee;//# sourceMappingURL=drag-drop.js.map
|
|
1
|
+
'use strict';var chunkSXQRCXMP_js=require('./chunk-SXQRCXMP.js'),chunkSWGQVSXQ_js=require('./chunk-SWGQVSXQ.js');require('./chunk-YQTPPT5K.js');var chunkV45EFIXB_js=require('./chunk-V45EFIXB.js'),be=require('react'),dnd=require('@hello-pangea/dnd'),jsxRuntime=require('react/jsx-runtime'),reactVirtuoso=require('react-virtuoso');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var be__default=/*#__PURE__*/_interopDefault(be);var re=({fill:e,opacity:r})=>jsxRuntime.jsx(chunkV45EFIXB_js.Na,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("g",{transform:"translate(5,3)",children:jsxRuntime.jsx("path",{d:"M9.5 0H4.5L3.5 1H0.401C0.179 1 0 1.179 0 1.401V2.599C0 2.821 0.179 3 0.401 3H13.599C13.821 3 14 2.821 14 2.599V1.401C14 1.179 13.821 1 13.599 1H10.5L9.5 0ZM10.875 6L10.118 16H3.882L3.125 6H10.875ZM12.59 4H1.39C1.159 4 0.982 4.196 1 4.426L2 17.634C2.016 17.841 2.193 18 2.4 18H11.6C11.807 18 11.984 17.841 12 17.635L13 4.427C13.018 4.196 12.82 4 12.59 4Z",fill:e,opacity:r})})});var te=({fill:e,opacity:r})=>jsxRuntime.jsx(chunkV45EFIXB_js.Na,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("g",{transform:"translate(7,4)",children:jsxRuntime.jsx("path",{d:"M4 14C4 15.1 3.1 16 2 16C0.9 16 0 15.1 0 14C0 12.9 0.9 12 2 12C3.1 12 4 12.9 4 14ZM2 6C0.9 6 0 6.9 0 8C0 9.1 0.9 10 2 10C3.1 10 4 9.1 4 8C4 6.9 3.1 6 2 6ZM2 0C0.9 0 0 0.9 0 2C0 3.1 0.9 4 2 4C3.1 4 4 3.1 4 2C4 0.9 3.1 0 2 0ZM8 4C9.1 4 10 3.1 10 2C10 0.9 9.1 0 8 0C6.9 0 6 0.9 6 2C6 3.1 6.9 4 8 4ZM8 6C6.9 6 6 6.9 6 8C6 9.1 6.9 10 8 10C9.1 10 10 9.1 10 8C10 6.9 9.1 6 8 6ZM8 12C6.9 12 6 12.9 6 14C6 15.1 6.9 16 8 16C9.1 16 10 15.1 10 14C10 12.9 9.1 12 8 12Z",fill:e,fillOpacity:r})})});var pe=(e,r,a,l)=>{let p="";return r!==null&&a!==null&&(r&&a+1===l||!r&&a===l)&&(p=`1px solid ${e.palette.ux.accent.n2.wMain}`),p},ce=chunkV45EFIXB_js.wa("div",{shouldForwardProp:e=>e!=="isDragging"&&e!=="dropOverIndex"&&e!=="dropFromTop"&&e!=="readOnly"&&e!=="disableReorder"})(({theme:e,isDragging:r,dropOverIndex:a,index:l,dropFromTop:p,readOnly:s,disableReorder:b})=>({...e.mixins.formComponent_AVPItem.container,backgroundColor:r?e.palette.ux.brand.w10:"inherit",borderTop:pe(e,p,a,l),gridTemplateColumns:s?"0px minmax(0, 1fr) 8px minmax(0, 1fr) 0px":b?"0px 1fr 8px 1fr 40px":"32px 1fr 8px 1fr 40px"})),me=chunkV45EFIXB_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_AVPItem.inputWrapperForKey})),de=chunkV45EFIXB_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_AVPItem.inputWrapperForValue})),ge=chunkV45EFIXB_js.wa("div",{shouldForwardProp:e=>e!=="ghostItem"&&e!=="isDragging"&&e!=="readOnly"})(({theme:e,ghostItem:r,isDragging:a,readOnly:l})=>({...e.mixins.formComponent_AVPItem.moveButton,cursor:r?"default":a?"move":"pointer",display:l?"none":"inherit"})),fe=chunkV45EFIXB_js.wa("div",{shouldForwardProp:e=>e!=="ghostItem"&&e!=="cursor"&&e!=="background"&&e!=="readOnly"})(({theme:e,ghostItem:r,cursor:a,background:l,readOnly:p})=>({...e.mixins.formComponent_AVPItem.deleteButton,cursor:a,display:p?"none":"inherit",height:"fit-content",":hover":{backgroundColor:l,svg:{path:{fill:r?e.palette.ux.secondary.w40:e.palette.ux.deprecated.primary.wMain}}},paddingBottom:e.spacing(.5),marginLeft:e.spacing(1)})),oe=chunkV45EFIXB_js.wa("div")(({theme:e})=>({paddingTop:"7px",color:e.palette.ux.secondary.text.wMain}));var U=({id:e,index:r,avpKey:a,avpValue:l,dataTags:p,ghostItem:s=false,onDelete:b,onChange:v,onKeyUp:C,onBlur:F,keyErrorText:M,valueErrorText:E,dropOverIndex:w,dropFromTop:T,readOnly:u,emptyFieldDisplayValue:S="",disableReorder:h=false})=>{let f=chunkV45EFIXB_js.ua();return jsxRuntime.jsx(dnd.Draggable,{draggableId:e,index:r,isDragDisabled:s||h,children:(x,c)=>jsxRuntime.jsxs(ce,{ref:x.innerRef,...x.draggableProps,isDragging:c.isDragging,dropOverIndex:w,dropFromTop:T,index:r,readOnly:!!u,disableReorder:h,children:[!h&&jsxRuntime.jsx(ge,{...x.dragHandleProps,isDragging:c.isDragging,ghostItem:s,readOnly:!!u,"data-qa":`avpMove-${r}`,children:jsxRuntime.jsx(te,{fill:s?f.palette.ux.secondary.w40:f.palette.ux.secondary.wMain,opacity:1})}),jsxRuntime.jsxs(me,{children:[!a&&l&&u&&jsxRuntime.jsx(oe,{"data-qa":`avpKey-${r}`,children:S}),(a||!a&&!u)&&jsxRuntime.jsx(chunkSXQRCXMP_js.d,{name:"key",dataQa:`avpKey-${r}`,dataTags:p,value:a,onChange:i=>v(i,r),onKeyUp:C,onBlur:i=>F(i,r),hasErrors:s?false:!!M,helperText:s?"":M,readOnly:u})]}),jsxRuntime.jsxs(de,{children:[a&&!l&&u&&jsxRuntime.jsx(oe,{"data-qa":`avpValue-${r}`,children:S}),(l||!l&&!u)&&jsxRuntime.jsx(chunkSXQRCXMP_js.d,{name:"value",dataQa:`avpValue-${r}`,dataTags:p,value:l,onChange:i=>v(i,r),onKeyUp:C,onBlur:i=>F(i,r),hasErrors:s?false:!!E,helperText:s?"":E,readOnly:u})]}),jsxRuntime.jsx(fe,{onClick:i=>b(i,r),tabIndex:0,ghostItem:s,cursor:s?"default":"pointer",background:s?"inherit":f.palette.ux.secondary.w10,readOnly:!!u,"data-qa":`avpDelete-${r}`,children:jsxRuntime.jsx(re,{fill:s?f.palette.ux.secondary.w40:f.palette.ux.secondary.wMain,opacity:1})})]})})};var Se=chunkV45EFIXB_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_AVPForm.container})),he=chunkV45EFIXB_js.wa("div")(({theme:e,readOnly:r,disableReorder:a,hasScrollBar:l})=>({...e.mixins.formComponent_AVPForm.labelWrapper,gridTemplateColumns:r?`0px minmax(0, 1fr) 8px minmax(0, 1fr) 0px${l?" 16px":""}`:a?`0px 1fr 8px 1fr 32px${l?" 16px":""}`:`32px 1fr 8px 1fr 32px${l?" 16px":""}`})),ae=chunkV45EFIXB_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_AVPForm.listWrapper})),Ve=(e,r,a)=>{let l=Array.from(e),[p]=l.splice(r,1);return l.splice(a,0,p),l},ne=(e,r)=>e[r].key===""&&e[r].value==="";var Ie=(e,r,a)=>{e==="ArrowUp"&&r-1>0?a[r-2].select():e==="ArrowDown"&&r+2<a.length?a[r+2].select():e==="Enter"&&r+2<a.length&&(r%2===0?a[r+2].select():r%2===1&&a[r+1].select());},le=be__default.default.forwardRef((e,r)=>{let a=e.context?.headerRef,l=e.context?.virtualizedAvpListOption,p=e.style;return jsxRuntime.jsx(ae,{...e,ref:r,style:{...p,width:l?.height&&a.current?a.current.offsetWidth-16:"100%"}})});le.displayName="List";var Ae=({id:e,name:r,readOnly:a,labelForKeys:l="Name",labelForValues:p="DisplayName",avpList:s=[],onAVPListUpdate:b,avpKeyValidationCallback:v,avpValueValidationCallback:C,enableRequiredKeyFieldIndicator:F,enableRequiredValueFieldIndicator:M,emptyFieldDisplayValue:E="",keyRequired:w=true,keyIsRequiredMessage:T="Required",helperText:u="",hasErrors:S=false,hasWarnings:h=false,disableReorder:f=false,avpListMaxHeight:x,virtualizedAvpListOption:c})=>{let[i,V]=be.useState(s),[N,R]=be.useState(null),[_,B]=be.useState(null),D=be.useRef(null);be.useEffect(()=>{let n=[...s];n.push({key:"",value:""}),V(n);},[s]);let I=be.useCallback(n=>{V(n),b&&ne(n,n.length-1)&&b(n.slice(0,-1)),R(null),B(null);},[b]),ie=n=>{if(!n.destination||n.destination.index===n.source.index||n.destination.index===i.length-1)return;let t=Ve(i,n.source.index,n.destination.index);V(t),b&&ne(t,t.length-1)&&b(t.slice(0,-1)),R(null),B(null);},se=n=>{let t=n.source.index,o=n?.destination?.index??null,m=o,y=null;t!==null&&o!==null&&(t>o?y=false:t<o&&(y=true)),R(m),B(y);},J=be.useCallback((n,t)=>{let o=n.name,m=n.value,y=[...i];y[t][o]=m,o&&y.length-1===t&&y.push({key:"",value:""}),V(y),I(y);},[i,I]),L=be.useCallback(n=>n===i.length-1,[i.length]),X=be.useCallback((n,t)=>{if(n.type==="click"&&!L(t)&&i.length>1){let o=[...i];o.splice(t,1),V(o),I(o);}},[i,I,L]),Q=be.useCallback(n=>{let t=document.querySelectorAll("[data-tags='avpInput']"),o=document.activeElement;for(let m=0;m<t.length;m++)t[m].getAttribute("data-qa")===o?.getAttribute("data-qa")&&Ie(n.key,m,t);},[]),Y=be.useCallback((n,t)=>{let o=[...i];if(o[t].key=o[t].key.trim(),o[t].value=o[t].value.trim(),n.target.getAttribute("name")==="key"&&v){let m=v(n.target.value,o.slice(0,-1));m?o[t].keyErrorText=m:delete o[t].keyErrorText;}if(n.target.getAttribute("name")==="value"&&C){let m=C(n.target.value,o.slice(0,-1));m?o[t].valueErrorText=m:delete o[t].valueErrorText;}w&&!o[t].key?o[t].keyErrorText=T:o[t].keyErrorText===T&&delete o[t].keyErrorText,V(o),I(o);},[i,w,v,C,T,I]);return jsxRuntime.jsxs(dnd.DragDropContext,{onDragEnd:ie,onDragUpdate:se,children:[jsxRuntime.jsx(dnd.Droppable,{droppableId:e??r,isDropDisabled:!!f||!!a,children:n=>jsxRuntime.jsxs(Se,{ref:n.innerRef,...n.droppableProps,children:[jsxRuntime.jsxs(he,{ref:D,readOnly:!!a,disableReorder:!!f,hasScrollBar:!!x||!!c?.height,children:[jsxRuntime.jsx(chunkSXQRCXMP_js.a,{id:"avpLabelForKeys",required:F,children:l}),jsxRuntime.jsx(chunkSXQRCXMP_js.a,{id:"avpLabelForValues",required:M,children:p})]}),c&&D.current&&jsxRuntime.jsx(reactVirtuoso.Virtuoso,{context:{headerRef:D,virtualizedAvpListOption:c},style:{height:c.height?c.height:"auto",minHeight:c.minHeight?c.minHeight:40},useWindowScroll:c.useWindowScrolling,increaseViewportBy:c.increaseViewportBy,components:{List:le},initialTopMostItemIndex:c.initialTopMostItemIndex??0,data:i,itemContent:(t,o)=>jsxRuntime.jsx(U,{id:`${t}`,index:t,avpKey:o.key,avpValue:o.value,dataTags:"avpInput",onChange:J,onDelete:X,onKeyUp:Q,ghostItem:L(t),onBlur:Y,keyErrorText:o.keyErrorText,valueErrorText:o.valueErrorText,dropOverIndex:N,dropFromTop:_,readOnly:a,emptyFieldDisplayValue:E,disableReorder:f},`${t}`)}),!c&&D.current&&jsxRuntime.jsx("div",{style:x?{maxHeight:x,overflowY:"auto"}:void 0,children:jsxRuntime.jsx(ae,{style:{width:x?D.current.offsetWidth-16:"100%"},children:i.map((t,o)=>jsxRuntime.jsx(U,{id:`${o}`,index:o,avpKey:t.key,avpValue:t.value,dataTags:"avpInput",onChange:J,onDelete:X,onKeyUp:Q,ghostItem:L(o),onBlur:Y,keyErrorText:t.keyErrorText,valueErrorText:t.valueErrorText,dropOverIndex:N,dropFromTop:_,readOnly:a,emptyFieldDisplayValue:E,disableReorder:f},`${o}`))})}),n.placeholder]})}),u&&jsxRuntime.jsxs("div",{style:{paddingLeft:"16px"},children:[u&&!h&&!S&&jsxRuntime.jsx(chunkSWGQVSXQ_js.c,{children:u}),u&&!S&&h&&jsxRuntime.jsx(chunkSWGQVSXQ_js.g,{children:u}),u&&S&&jsxRuntime.jsx(chunkSWGQVSXQ_js.e,{children:u})]})]})},Ee=Ae;exports.SolaceAttributeValuePairForm=Ee;//# sourceMappingURL=drag-drop.js.map
|
|
2
2
|
//# sourceMappingURL=drag-drop.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a,d}from'./chunk-
|
|
1
|
+
import {a,d}from'./chunk-VYHLNTMX.modern.mjs';import {c,g,e}from'./chunk-54TEARQI.modern.mjs';import'./chunk-QKQRCYG4.modern.mjs';import {wa,ua,Na}from'./chunk-I7OJ5H4U.modern.mjs';import be,{useState,useRef,useEffect,useCallback}from'react';import {DragDropContext,Droppable,Draggable}from'@hello-pangea/dnd';import {jsx,jsxs}from'react/jsx-runtime';import {Virtuoso}from'react-virtuoso';var re=({fill:e,opacity:r})=>jsx(Na,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsx("g",{transform:"translate(5,3)",children:jsx("path",{d:"M9.5 0H4.5L3.5 1H0.401C0.179 1 0 1.179 0 1.401V2.599C0 2.821 0.179 3 0.401 3H13.599C13.821 3 14 2.821 14 2.599V1.401C14 1.179 13.821 1 13.599 1H10.5L9.5 0ZM10.875 6L10.118 16H3.882L3.125 6H10.875ZM12.59 4H1.39C1.159 4 0.982 4.196 1 4.426L2 17.634C2.016 17.841 2.193 18 2.4 18H11.6C11.807 18 11.984 17.841 12 17.635L13 4.427C13.018 4.196 12.82 4 12.59 4Z",fill:e,opacity:r})})});var te=({fill:e,opacity:r})=>jsx(Na,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsx("g",{transform:"translate(7,4)",children:jsx("path",{d:"M4 14C4 15.1 3.1 16 2 16C0.9 16 0 15.1 0 14C0 12.9 0.9 12 2 12C3.1 12 4 12.9 4 14ZM2 6C0.9 6 0 6.9 0 8C0 9.1 0.9 10 2 10C3.1 10 4 9.1 4 8C4 6.9 3.1 6 2 6ZM2 0C0.9 0 0 0.9 0 2C0 3.1 0.9 4 2 4C3.1 4 4 3.1 4 2C4 0.9 3.1 0 2 0ZM8 4C9.1 4 10 3.1 10 2C10 0.9 9.1 0 8 0C6.9 0 6 0.9 6 2C6 3.1 6.9 4 8 4ZM8 6C6.9 6 6 6.9 6 8C6 9.1 6.9 10 8 10C9.1 10 10 9.1 10 8C10 6.9 9.1 6 8 6ZM8 12C6.9 12 6 12.9 6 14C6 15.1 6.9 16 8 16C9.1 16 10 15.1 10 14C10 12.9 9.1 12 8 12Z",fill:e,fillOpacity:r})})});var pe=(e,r,a,l)=>{let p="";return r!==null&&a!==null&&(r&&a+1===l||!r&&a===l)&&(p=`1px solid ${e.palette.ux.accent.n2.wMain}`),p},ce=wa("div",{shouldForwardProp:e=>e!=="isDragging"&&e!=="dropOverIndex"&&e!=="dropFromTop"&&e!=="readOnly"&&e!=="disableReorder"})(({theme:e,isDragging:r,dropOverIndex:a,index:l,dropFromTop:p,readOnly:s,disableReorder:b})=>({...e.mixins.formComponent_AVPItem.container,backgroundColor:r?e.palette.ux.brand.w10:"inherit",borderTop:pe(e,p,a,l),gridTemplateColumns:s?"0px minmax(0, 1fr) 8px minmax(0, 1fr) 0px":b?"0px 1fr 8px 1fr 40px":"32px 1fr 8px 1fr 40px"})),me=wa("div")(({theme:e})=>({...e.mixins.formComponent_AVPItem.inputWrapperForKey})),de=wa("div")(({theme:e})=>({...e.mixins.formComponent_AVPItem.inputWrapperForValue})),ge=wa("div",{shouldForwardProp:e=>e!=="ghostItem"&&e!=="isDragging"&&e!=="readOnly"})(({theme:e,ghostItem:r,isDragging:a,readOnly:l})=>({...e.mixins.formComponent_AVPItem.moveButton,cursor:r?"default":a?"move":"pointer",display:l?"none":"inherit"})),fe=wa("div",{shouldForwardProp:e=>e!=="ghostItem"&&e!=="cursor"&&e!=="background"&&e!=="readOnly"})(({theme:e,ghostItem:r,cursor:a,background:l,readOnly:p})=>({...e.mixins.formComponent_AVPItem.deleteButton,cursor:a,display:p?"none":"inherit",height:"fit-content",":hover":{backgroundColor:l,svg:{path:{fill:r?e.palette.ux.secondary.w40:e.palette.ux.deprecated.primary.wMain}}},paddingBottom:e.spacing(.5),marginLeft:e.spacing(1)})),oe=wa("div")(({theme:e})=>({paddingTop:"7px",color:e.palette.ux.secondary.text.wMain}));var U=({id:e,index:r,avpKey:a,avpValue:l,dataTags:p,ghostItem:s=false,onDelete:b,onChange:v,onKeyUp:C,onBlur:F,keyErrorText:M,valueErrorText:E,dropOverIndex:w,dropFromTop:T,readOnly:u,emptyFieldDisplayValue:S="",disableReorder:h=false})=>{let f=ua();return jsx(Draggable,{draggableId:e,index:r,isDragDisabled:s||h,children:(x,c)=>jsxs(ce,{ref:x.innerRef,...x.draggableProps,isDragging:c.isDragging,dropOverIndex:w,dropFromTop:T,index:r,readOnly:!!u,disableReorder:h,children:[!h&&jsx(ge,{...x.dragHandleProps,isDragging:c.isDragging,ghostItem:s,readOnly:!!u,"data-qa":`avpMove-${r}`,children:jsx(te,{fill:s?f.palette.ux.secondary.w40:f.palette.ux.secondary.wMain,opacity:1})}),jsxs(me,{children:[!a&&l&&u&&jsx(oe,{"data-qa":`avpKey-${r}`,children:S}),(a||!a&&!u)&&jsx(d,{name:"key",dataQa:`avpKey-${r}`,dataTags:p,value:a,onChange:i=>v(i,r),onKeyUp:C,onBlur:i=>F(i,r),hasErrors:s?false:!!M,helperText:s?"":M,readOnly:u})]}),jsxs(de,{children:[a&&!l&&u&&jsx(oe,{"data-qa":`avpValue-${r}`,children:S}),(l||!l&&!u)&&jsx(d,{name:"value",dataQa:`avpValue-${r}`,dataTags:p,value:l,onChange:i=>v(i,r),onKeyUp:C,onBlur:i=>F(i,r),hasErrors:s?false:!!E,helperText:s?"":E,readOnly:u})]}),jsx(fe,{onClick:i=>b(i,r),tabIndex:0,ghostItem:s,cursor:s?"default":"pointer",background:s?"inherit":f.palette.ux.secondary.w10,readOnly:!!u,"data-qa":`avpDelete-${r}`,children:jsx(re,{fill:s?f.palette.ux.secondary.w40:f.palette.ux.secondary.wMain,opacity:1})})]})})};var Se=wa("div")(({theme:e})=>({...e.mixins.formComponent_AVPForm.container})),he=wa("div")(({theme:e,readOnly:r,disableReorder:a,hasScrollBar:l})=>({...e.mixins.formComponent_AVPForm.labelWrapper,gridTemplateColumns:r?`0px minmax(0, 1fr) 8px minmax(0, 1fr) 0px${l?" 16px":""}`:a?`0px 1fr 8px 1fr 32px${l?" 16px":""}`:`32px 1fr 8px 1fr 32px${l?" 16px":""}`})),ae=wa("div")(({theme:e})=>({...e.mixins.formComponent_AVPForm.listWrapper})),Ve=(e,r,a)=>{let l=Array.from(e),[p]=l.splice(r,1);return l.splice(a,0,p),l},ne=(e,r)=>e[r].key===""&&e[r].value==="";var Ie=(e,r,a)=>{e==="ArrowUp"&&r-1>0?a[r-2].select():e==="ArrowDown"&&r+2<a.length?a[r+2].select():e==="Enter"&&r+2<a.length&&(r%2===0?a[r+2].select():r%2===1&&a[r+1].select());},le=be.forwardRef((e,r)=>{let a=e.context?.headerRef,l=e.context?.virtualizedAvpListOption,p=e.style;return jsx(ae,{...e,ref:r,style:{...p,width:l?.height&&a.current?a.current.offsetWidth-16:"100%"}})});le.displayName="List";var Ae=({id:e$1,name:r,readOnly:a$1,labelForKeys:l="Name",labelForValues:p="DisplayName",avpList:s=[],onAVPListUpdate:b,avpKeyValidationCallback:v,avpValueValidationCallback:C,enableRequiredKeyFieldIndicator:F,enableRequiredValueFieldIndicator:M,emptyFieldDisplayValue:E="",keyRequired:w=true,keyIsRequiredMessage:T="Required",helperText:u="",hasErrors:S=false,hasWarnings:h=false,disableReorder:f=false,avpListMaxHeight:x,virtualizedAvpListOption:c$1})=>{let[i,V]=useState(s),[N,R]=useState(null),[_,B]=useState(null),D=useRef(null);useEffect(()=>{let n=[...s];n.push({key:"",value:""}),V(n);},[s]);let I=useCallback(n=>{V(n),b&&ne(n,n.length-1)&&b(n.slice(0,-1)),R(null),B(null);},[b]),ie=n=>{if(!n.destination||n.destination.index===n.source.index||n.destination.index===i.length-1)return;let t=Ve(i,n.source.index,n.destination.index);V(t),b&&ne(t,t.length-1)&&b(t.slice(0,-1)),R(null),B(null);},se=n=>{let t=n.source.index,o=n?.destination?.index??null,m=o,y=null;t!==null&&o!==null&&(t>o?y=false:t<o&&(y=true)),R(m),B(y);},J=useCallback((n,t)=>{let o=n.name,m=n.value,y=[...i];y[t][o]=m,o&&y.length-1===t&&y.push({key:"",value:""}),V(y),I(y);},[i,I]),L=useCallback(n=>n===i.length-1,[i.length]),X=useCallback((n,t)=>{if(n.type==="click"&&!L(t)&&i.length>1){let o=[...i];o.splice(t,1),V(o),I(o);}},[i,I,L]),Q=useCallback(n=>{let t=document.querySelectorAll("[data-tags='avpInput']"),o=document.activeElement;for(let m=0;m<t.length;m++)t[m].getAttribute("data-qa")===o?.getAttribute("data-qa")&&Ie(n.key,m,t);},[]),Y=useCallback((n,t)=>{let o=[...i];if(o[t].key=o[t].key.trim(),o[t].value=o[t].value.trim(),n.target.getAttribute("name")==="key"&&v){let m=v(n.target.value,o.slice(0,-1));m?o[t].keyErrorText=m:delete o[t].keyErrorText;}if(n.target.getAttribute("name")==="value"&&C){let m=C(n.target.value,o.slice(0,-1));m?o[t].valueErrorText=m:delete o[t].valueErrorText;}w&&!o[t].key?o[t].keyErrorText=T:o[t].keyErrorText===T&&delete o[t].keyErrorText,V(o),I(o);},[i,w,v,C,T,I]);return jsxs(DragDropContext,{onDragEnd:ie,onDragUpdate:se,children:[jsx(Droppable,{droppableId:e$1??r,isDropDisabled:!!f||!!a$1,children:n=>jsxs(Se,{ref:n.innerRef,...n.droppableProps,children:[jsxs(he,{ref:D,readOnly:!!a$1,disableReorder:!!f,hasScrollBar:!!x||!!c$1?.height,children:[jsx(a,{id:"avpLabelForKeys",required:F,children:l}),jsx(a,{id:"avpLabelForValues",required:M,children:p})]}),c$1&&D.current&&jsx(Virtuoso,{context:{headerRef:D,virtualizedAvpListOption:c$1},style:{height:c$1.height?c$1.height:"auto",minHeight:c$1.minHeight?c$1.minHeight:40},useWindowScroll:c$1.useWindowScrolling,increaseViewportBy:c$1.increaseViewportBy,components:{List:le},initialTopMostItemIndex:c$1.initialTopMostItemIndex??0,data:i,itemContent:(t,o)=>jsx(U,{id:`${t}`,index:t,avpKey:o.key,avpValue:o.value,dataTags:"avpInput",onChange:J,onDelete:X,onKeyUp:Q,ghostItem:L(t),onBlur:Y,keyErrorText:o.keyErrorText,valueErrorText:o.valueErrorText,dropOverIndex:N,dropFromTop:_,readOnly:a$1,emptyFieldDisplayValue:E,disableReorder:f},`${t}`)}),!c$1&&D.current&&jsx("div",{style:x?{maxHeight:x,overflowY:"auto"}:void 0,children:jsx(ae,{style:{width:x?D.current.offsetWidth-16:"100%"},children:i.map((t,o)=>jsx(U,{id:`${o}`,index:o,avpKey:t.key,avpValue:t.value,dataTags:"avpInput",onChange:J,onDelete:X,onKeyUp:Q,ghostItem:L(o),onBlur:Y,keyErrorText:t.keyErrorText,valueErrorText:t.valueErrorText,dropOverIndex:N,dropFromTop:_,readOnly:a$1,emptyFieldDisplayValue:E,disableReorder:f},`${o}`))})}),n.placeholder]})}),u&&jsxs("div",{style:{paddingLeft:"16px"},children:[u&&!h&&!S&&jsx(c,{children:u}),u&&!S&&h&&jsx(g,{children:u}),u&&S&&jsx(e,{children:u})]})]})},Ee=Ae;export{Ee as SolaceAttributeValuePairForm};//# sourceMappingURL=drag-drop.modern.mjs.map
|
|
2
2
|
//# sourceMappingURL=drag-drop.modern.mjs.map
|