1 line
No EOL
7.4 KiB
Text
1 line
No EOL
7.4 KiB
Text
{"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 }\n mergeTarget[prop] = styles.concat(thisStyle);\n continue;\n }\n case \"id\":\n case \"key\":\n case \"ref\":\n case \"keepAlive\": {\n if (!mergeTarget[prop]) {\n mergeTarget[prop] = arguments[i][prop];\n }\n continue;\n }\n }\n if (prop.startsWith(\"on\") && prop !== \"on\") {\n // Object, the properties of which to merge via array merge strategy (array concatenation).\n // Callback merge strategy merges callbacks to the beginning of the array,\n // so that the last defined callback will be invoked first.\n // This is done since to mimic how Object.assign merging\n // uses the last given value to assign.\n // Concat function to array of functions if callback present.\n if (mergeTarget[prop] && !Array.isArray(mergeTarget[prop])) {\n // Insert current iteration data in beginning of merged array.\n mergeTarget[prop] = [mergeTarget[prop], arguments[i][prop]];\n continue;\n }\n let targetValue = mergeTarget[prop];\n let thisValue = arguments[i][prop];\n // The `else` condition falls through to a simple assignment.\n if (Array.isArray(targetValue)) {\n if (Array.isArray(thisValue)) {\n targetValue.push(...thisValue);\n }\n else {\n targetValue.push(thisValue);\n }\n continue;\n }\n }\n mergeTarget[prop] = arguments[i][prop];\n }\n }\n return mergeTarget;\n}\nexport { mergeData };\n"],"names":["prop","mergeTarget","i","arguments","length","Object","keys","classes","value","Array","isArray","concat","styles","style","thisStyle","push","j","s","parseStyle","startsWith","targetValue","thisValue","pattern","kebab","styleProp","styleList","camelReplace","_substr","match","toUpperCase","styleMap","split","key","val","trim","str","replace"],"mappings":"+LA0DQA,KAFAC,YAAc,GACdC,EAAIC,UAAUC,YAGXF,SAGEF,QAAQK,OAAOC,KAAKH,UAAUD,OACL,MAAtBC,UAAUD,GAAGF,cAGTA,UACC,aACGO,QAAU,QAENC,MAAQP,YAAW,MACnBQ,MAAMC,QAAQF,SACdD,QAAUC,OAKlBP,YAAW,MAAYM,QAAQI,OAAOR,UAAUD,GAAV,oBAIrC,aACGU,OAAS,QAELJ,MAAQP,YAAYY,MACpBJ,MAAMC,QAAQF,SACdI,OAASJ,WAGbM,UAAY,GACZL,MAAMC,QAAQP,UAAUD,GAAGW,OAC3BC,UAAYX,UAAUD,GAAGW,MAGzBC,UAAUC,KAAKZ,UAAUD,GAAGW,WAE3B,IAAIG,EAAI,EAAGA,EAAIF,UAAUV,OAAQY,IAAK,KACnCC,EAAIH,UAAUE,GACD,iBAANC,IACPH,UAAUE,GAAKE,WAAWD,IAGlChB,YAAYD,MAAQY,OAAOD,OAAOG,wBAGjC,SACA,UACA,UACA,YACIb,YAAYD,QACbC,YAAYD,MAAQG,UAAUD,GAAGF,mBAKzCA,KAAKmB,WAAW,OAAkB,OAATnB,KAAe,IAOpCC,YAAYD,QAAUS,MAAMC,QAAQT,YAAYD,OAAQ,CAExDC,YAAYD,MAAQ,CAACC,YAAYD,MAAOG,UAAUD,GAAGF,oBAGrDoB,YAAcnB,YAAYD,MAC1BqB,UAAYlB,UAAUD,GAAGF,SAEzBS,MAAMC,QAAQU,aAAc,CACxBX,MAAMC,QAAQW,WACdD,YAAYL,QAAQM,WAGp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