1 line
7.4 KiB
Plaintext
1 line
7.4 KiB
Plaintext
![]() |
{"version":3,"file":"vue-functional-data-merge.min.js","sources":["../../src/bootstrap-vue/vue-functional-data-merge.js"],"sourcesContent":["/* eslint-disable */\n/* \nCompiled from ts into js by PMKuipers @ 2023) from source\nat https://github.com/alexsasharegan/vue-functional-data-merge \nBelow is copy of licens in original project\n*/\n/* \nThe MIT License (MIT)\n\nCopyright (c) 2017 Alex Regan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\nconst pattern = {\n kebab: /-(\\w)/g,\n styleProp: /:(.*)/,\n styleList: /;(?![^(]*\\))/g,\n};\nfunction camelReplace(_substr, match) {\n return match.toUpperCase();\n}\nfunction camelCase(str) {\n return str.replace(pattern.kebab, camelReplace);\n}\nfunction parseStyle(style) {\n let styleMap = {};\n for (let s of style.split(pattern.styleList)) {\n let [key, val] = s.split(pattern.styleProp);\n key = key.trim();\n if (!key) {\n continue;\n }\n // May be undefined if the `key: value` pair is incomplete.\n val = val.trim();\n styleMap[camelCase(key)] = val;\n }\n return styleMap;\n}\nfunction mergeData() {\n let mergeTarget = {};\n let i = arguments.length;\n let prop;\n // Allow for variadic argument length.\n while (i--) {\n // Iterate through the data properties and execute merge strategies\n // Object.keys eliminates need for hasOwnProperty call\n for (prop of Object.keys(arguments[i])) {\n if (arguments[i][prop] == null) {\n continue;\n }\n switch (prop) {\n case \"class\": {\n let classes = [];\n {\n let value = mergeTarget[\"class\"];\n if (Array.isArray(value)) {\n classes = value;\n }\n }\n // Repackaging in an array allows Vue runtime\n // to merge class/style bindings regardless of type.\n mergeTarget[\"class\"] = classes.concat(arguments[i][\"class\"]);\n continue;\n }\n // merge style by concatenating arrays\n case \"style\": {\n let styles = [];\n {\n let value = mergeTarget.style;\n if (Array.isArray(value)) {\n styles = value;\n }\n }\n let thisStyle = [];\n if (Array.isArray(arguments[i].style)) {\n thisStyle = arguments[i].style;\n }\n else {\n thisStyle.push(arguments[i].style);\n }\n for (let j = 0; j < thisStyle.length; j++) {\n let s = thisStyle[j];\n if (typeof s === \"string\") {\n thisStyle[j] = parseStyle(s);\n }\n
|