1 line
28 KiB
JSON
1 line
28 KiB
JSON
{"ast":null,"code":"import _typeof from \"D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/@babel/runtime/helpers/esm/typeof.js\";\nimport \"core-js/modules/es.regexp.constructor.js\";\nimport \"core-js/modules/es.regexp.dot-all.js\";\nimport \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.regexp.sticky.js\";\nimport \"core-js/modules/es.regexp.to-string.js\";\nimport \"core-js/modules/es.regexp.test.js\";\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. 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,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. 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,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { keys, isArray, map, isObject, isString, isRegExp, isArrayLike, hasOwn, isNumber } from 'zrender/lib/core/util.js';\nimport { throwError, makePrintable } from './log.js';\nimport { getRawValueParser, createFilterComparator } from '../data/helper/dataValueHelper.js';\n;\nvar RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {\n value: 'eq',\n // PENDING: not good for literal semantic?\n '<': 'lt',\n '<=': 'lte',\n '>': 'gt',\n '>=': 'gte',\n '=': 'eq',\n '!=': 'ne',\n '<>': 'ne' // Might be misleading for sake of the difference between '==' and '===',\n // so don't support them.\n // '==': 'eq',\n // '===': 'seq',\n // '!==': 'sne'\n // PENDING: Whether support some common alias \"ge\", \"le\", \"neq\"?\n // ge: 'gte',\n // le: 'lte',\n // neq: 'ne',\n\n}; // type RelationalExpressionOpEvaluate = (tarVal: unknown, condVal: unknown) => boolean;\n\nvar RegExpEvaluator =\n/** @class */\nfunction () {\n function RegExpEvaluator(rVal) {\n // Support condVal: RegExp | string\n var condValue = this._condVal = isString(rVal) ? new RegExp(rVal) : isRegExp(rVal) ? rVal : null;\n\n if (condValue == null) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal regexp', rVal, 'in');\n }\n\n throwError(errMsg);\n }\n }\n\n RegExpEvaluator.prototype.evaluate = function (lVal) {\n var type = _typeof(lVal);\n\n return isString(type) ? this._condVal.test(lVal) : isNumber(type) ? this._condVal.test(lVal + '') : false;\n };\n\n return RegExpEvaluator;\n}();\n\nvar ConstConditionInternal =\n/** @class */\nfunction () {\n function ConstConditionInternal() {}\n\n ConstConditionInternal.prototype.evaluate = function () {\n return this.value;\n };\n\n return ConstConditionInternal;\n}();\n\nvar AndConditionInternal =\n/** @class */\nfunction () {\n function AndConditionInternal() {}\n\n AndConditionInternal.prototype.evaluate = function () {\n var children = this.children;\n\n for (var i = 0; i < children.length; i++) {\n if (!children[i].evaluate()) {\n return false;\n }\n }\n\n return true;\n };\n\n return AndConditionInternal;\n}();\n\nvar OrConditionInternal =\n/** @class */\nfunction () {\n function OrConditionInternal() {}\n\n OrConditionInternal.prototype.evaluate = function () {\n var children = this.children;\n\n for (var i = 0; i < children.length; i++) {\n if (children[i].evaluate()) {\n return true;\n }\n }\n\n return false;\n };\n\n return OrConditionInternal;\n}();\n\nvar NotConditionInternal =\n/** @class */\nfunction () {\n function NotConditionInternal() {}\n\n NotConditionInternal.prototype.evaluate = function () {\n return !this.child.evaluate();\n };\n\n return NotConditionInternal;\n}();\n\nvar RelationalConditionInternal =\n/** @class */\nfunction () {\n function RelationalConditionInternal() {}\n\n RelationalConditionInternal.prototype.evaluate = function () {\n var needParse = !!this.valueParser; // Call getValue with no `this`.\n\n var getValue = this.getValue;\n var tarValRaw = getValue(this.valueGetterParam);\n var tarValParsed = needParse ? this.valueParser(tarValRaw) : null; // Relational cond follow \"and\" logic internally.\n\n for (var i = 0; i < this.subCondList.length; i++) {\n if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {\n return false;\n }\n }\n\n return true;\n };\n\n return RelationalConditionInternal;\n}();\n\nfunction parseOption(exprOption, getters) {\n if (exprOption === true || exprOption === false) {\n var cond = new ConstConditionInternal();\n cond.value = exprOption;\n return cond;\n }\n\n var errMsg = '';\n\n if (!isObjectNotArray(exprOption)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal config. Expect a plain object but actually', exprOption);\n }\n\n throwError(errMsg);\n }\n\n if (exprOption.and) {\n return parseAndOrOption('and', exprOption, getters);\n } else if (exprOption.or) {\n return parseAndOrOption('or', exprOption, getters);\n } else if (exprOption.not) {\n return parseNotOption(exprOption, getters);\n }\n\n return parseRelationalOption(exprOption, getters);\n}\n\nfunction parseAndOrOption(op, exprOption, getters) {\n var subOptionArr = exprOption[op];\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('\"and\"/\"or\" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption);\n }\n\n if (!isArray(subOptionArr)) {\n throwError(errMsg);\n }\n\n if (!subOptionArr.length) {\n throwError(errMsg);\n }\n\n var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal();\n cond.children = map(subOptionArr, function (subOption) {\n return parseOption(subOption, getters);\n });\n\n if (!cond.children.length) {\n throwError(errMsg);\n }\n\n return cond;\n}\n\nfunction parseNotOption(exprOption, getters) {\n var subOption = exprOption.not;\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('\"not\" condition should only be `not: {}`.', 'Illegal condition:', exprOption);\n }\n\n if (!isObjectNotArray(subOption)) {\n throwError(errMsg);\n }\n\n var cond = new NotConditionInternal();\n cond.child = parseOption(subOption, getters);\n\n if (!cond.child) {\n throwError(errMsg);\n }\n\n return cond;\n}\n\nfunction parseRelationalOption(exprOption, getters) {\n var errMsg = '';\n var valueGetterParam = getters.prepareGetValue(exprOption);\n var subCondList = [];\n var exprKeys = keys(exprOption);\n var parserName = exprOption.parser;\n var valueParser = parserName ? getRawValueParser(parserName) : null;\n\n for (var i = 0; i < exprKeys.length; i++) {\n var keyRaw = exprKeys[i];\n\n if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) {\n continue;\n }\n\n var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw;\n var condValueRaw = exprOption[keyRaw];\n var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;\n var evaluator = createFilterComparator(op, condValueParsed) || op === 'reg' && new RegExpEvaluator(condValueParsed);\n\n if (!evaluator) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal relational operation: \"' + keyRaw + '\" in condition:', exprOption);\n }\n\n throwError(errMsg);\n }\n\n subCondList.push(evaluator);\n }\n\n if (!subCondList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Relational condition must have at least one operator.', 'Illegal condition:', exprOption);\n } // No relational operator always disabled in case of dangers result.\n\n\n throwError(errMsg);\n }\n\n var cond = new RelationalConditionInternal();\n cond.valueGetterParam = valueGetterParam;\n cond.valueParser = valueParser;\n cond.getValue = getters.getValue;\n cond.subCondList = subCondList;\n return cond;\n}\n\nfunction isObjectNotArray(val) {\n return isObject(val) && !isArrayLike(val);\n}\n\nvar ConditionalExpressionParsed =\n/** @class */\nfunction () {\n function ConditionalExpressionParsed(exprOption, getters) {\n this._cond = parseOption(exprOption, getters);\n }\n\n ConditionalExpressionParsed.prototype.evaluate = function () {\n return this._cond.evaluate();\n };\n\n return ConditionalExpressionParsed;\n}();\n\n;\nexport function parseConditionalExpression(exprOption, getters) {\n return new ConditionalExpressionParsed(exprOption, getters);\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/echarts/lib/util/conditionalExpression.js"],"names":["keys","isArray","map","isObject","isString","isRegExp","isArrayLike","hasOwn","isNumber","throwError","makePrintable","getRawValueParser","createFilterComparator","RELATIONAL_EXPRESSION_OP_ALIAS_MAP","value","RegExpEvaluator","rVal","condValue","_condVal","RegExp","errMsg","process","env","NODE_ENV","prototype","evaluate","lVal","type","test","ConstConditionInternal","AndConditionInternal","children","i","length","OrConditionInternal","NotConditionInternal","child","RelationalConditionInternal","needParse","valueParser","getValue","tarValRaw","valueGetterParam","tarValParsed","subCondList","parseOption","exprOption","getters","cond","isObjectNotArray","and","parseAndOrOption","or","not","parseNotOption","parseRelationalOption","op","subOptionArr","subOption","prepareGetValue","exprKeys","parserName","parser","keyRaw","valueGetterAttrMap","get","condValueRaw","condValueParsed","evaluator","push","val","ConditionalExpressionParsed","_cond","parseConditionalExpression"],"mappings":";;;;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,OAAf,EAAwBC,GAAxB,EAA6BC,QAA7B,EAAuCC,QAAv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CAAYC,QAAZ,KAAyB,YAA7B,EAA2C;AACzCH,MAAAA,MAAM,GAAGV,aAAa,CAAC,uDAAD,EAA0D,oBAA1D,EAAgFoC,UAAhF,CAAtB;AACD,KAHsB,CAGrB;;;AAGFrC,IAAAA,UAAU,CAACW,MAAD,CAAV;AACD;;AAED,MAAI4B,IAAI,GAAG,IAAIX,2BAAJ,EAAX;AACAW,EAAAA,IAAI,CAACN,gBAAL,GAAwBA,gBAAxB;AACAM,EAAAA,IAAI,CAACT,WAAL,GAAmBA,WAAnB;AACAS,EAAAA,IAAI,CAACR,QAAL,GAAgBO,OAAO,CAACP,QAAxB;AACAQ,EAAAA,IAAI,CAACJ,WAAL,GAAmBA,WAAnB;AACA,SAAOI,IAAP;AACD;;AAED,SAASC,gBAAT,CAA0BqB,GAA1B,EAA+B;AAC7B,SAAOnE,QAAQ,CAACmE,GAAD,CAAR,IAAiB,CAAChE,WAAW,CAACgE,GAAD,CAApC;AACD;;AAED,IAAIC,2BAA2B;AAC/B;AACA,YAAY;AACV,WAASA,2BAAT,CAAqCzB,UAArC,EAAiDC,OAAjD,EAA0D;AACxD,SAAKyB,KAAL,GAAa3B,WAAW,CAACC,UAAD,EAAaC,OAAb,CAAxB;AACD;;AAEDwB,EAAAA,2BAA2B,CAAC/C,SAA5B,CAAsCC,QAAtC,GAAiD,YAAY;AAC3D,WAAO,KAAK+C,KAAL,CAAW/C,QAAX,EAAP;AACD,GAFD;;AAIA,SAAO8C,2BAAP;AACD,CAVD,EAFA;;AAcA;AACA,OAAO,SAASE,0BAAT,CAAoC3B,UAApC,EAAgDC,OAAhD,EAAyD;AAC9D,SAAO,IAAIwB,2BAAJ,CAAgCzB,UAAhC,EAA4CC,OAA5C,CAAP;AACD","sourcesContent":["\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. 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,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. 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,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { keys, isArray, map, isObject, isString, isRegExp, isArrayLike, hasOwn, isNumber } from 'zrender/lib/core/util.js';\nimport { throwError, makePrintable } from './log.js';\nimport { getRawValueParser, createFilterComparator } from '../data/helper/dataValueHelper.js';\n;\nvar RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {\n value: 'eq',\n // PENDING: not good for literal semantic?\n '<': 'lt',\n '<=': 'lte',\n '>': 'gt',\n '>=': 'gte',\n '=': 'eq',\n '!=': 'ne',\n '<>': 'ne' // Might be misleading for sake of the difference between '==' and '===',\n // so don't support them.\n // '==': 'eq',\n // '===': 'seq',\n // '!==': 'sne'\n // PENDING: Whether support some common alias \"ge\", \"le\", \"neq\"?\n // ge: 'gte',\n // le: 'lte',\n // neq: 'ne',\n\n}; // type RelationalExpressionOpEvaluate = (tarVal: unknown, condVal: unknown) => boolean;\n\nvar RegExpEvaluator =\n/** @class */\nfunction () {\n function RegExpEvaluator(rVal) {\n // Support condVal: RegExp | string\n var condValue = this._condVal = isString(rVal) ? new RegExp(rVal) : isRegExp(rVal) ? rVal : null;\n\n if (condValue == null) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal regexp', rVal, 'in');\n }\n\n throwError(errMsg);\n }\n }\n\n RegExpEvaluator.prototype.evaluate = function (lVal) {\n var type = typeof lVal;\n return isString(type) ? this._condVal.test(lVal) : isNumber(type) ? this._condVal.test(lVal + '') : false;\n };\n\n return RegExpEvaluator;\n}();\n\nvar ConstConditionInternal =\n/** @class */\nfunction () {\n function ConstConditionInternal() {}\n\n ConstConditionInternal.prototype.evaluate = function () {\n return this.value;\n };\n\n return ConstConditionInternal;\n}();\n\nvar AndConditionInternal =\n/** @class */\nfunction () {\n function AndConditionInternal() {}\n\n AndConditionInternal.prototype.evaluate = function () {\n var children = this.children;\n\n for (var i = 0; i < children.length; i++) {\n if (!children[i].evaluate()) {\n return false;\n }\n }\n\n return true;\n };\n\n return AndConditionInternal;\n}();\n\nvar OrConditionInternal =\n/** @class */\nfunction () {\n function OrConditionInternal() {}\n\n OrConditionInternal.prototype.evaluate = function () {\n var children = this.children;\n\n for (var i = 0; i < children.length; i++) {\n if (children[i].evaluate()) {\n return true;\n }\n }\n\n return false;\n };\n\n return OrConditionInternal;\n}();\n\nvar NotConditionInternal =\n/** @class */\nfunction () {\n function NotConditionInternal() {}\n\n NotConditionInternal.prototype.evaluate = function () {\n return !this.child.evaluate();\n };\n\n return NotConditionInternal;\n}();\n\nvar RelationalConditionInternal =\n/** @class */\nfunction () {\n function RelationalConditionInternal() {}\n\n RelationalConditionInternal.prototype.evaluate = function () {\n var needParse = !!this.valueParser; // Call getValue with no `this`.\n\n var getValue = this.getValue;\n var tarValRaw = getValue(this.valueGetterParam);\n var tarValParsed = needParse ? this.valueParser(tarValRaw) : null; // Relational cond follow \"and\" logic internally.\n\n for (var i = 0; i < this.subCondList.length; i++) {\n if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {\n return false;\n }\n }\n\n return true;\n };\n\n return RelationalConditionInternal;\n}();\n\nfunction parseOption(exprOption, getters) {\n if (exprOption === true || exprOption === false) {\n var cond = new ConstConditionInternal();\n cond.value = exprOption;\n return cond;\n }\n\n var errMsg = '';\n\n if (!isObjectNotArray(exprOption)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal config. Expect a plain object but actually', exprOption);\n }\n\n throwError(errMsg);\n }\n\n if (exprOption.and) {\n return parseAndOrOption('and', exprOption, getters);\n } else if (exprOption.or) {\n return parseAndOrOption('or', exprOption, getters);\n } else if (exprOption.not) {\n return parseNotOption(exprOption, getters);\n }\n\n return parseRelationalOption(exprOption, getters);\n}\n\nfunction parseAndOrOption(op, exprOption, getters) {\n var subOptionArr = exprOption[op];\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('\"and\"/\"or\" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption);\n }\n\n if (!isArray(subOptionArr)) {\n throwError(errMsg);\n }\n\n if (!subOptionArr.length) {\n throwError(errMsg);\n }\n\n var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal();\n cond.children = map(subOptionArr, function (subOption) {\n return parseOption(subOption, getters);\n });\n\n if (!cond.children.length) {\n throwError(errMsg);\n }\n\n return cond;\n}\n\nfunction parseNotOption(exprOption, getters) {\n var subOption = exprOption.not;\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('\"not\" condition should only be `not: {}`.', 'Illegal condition:', exprOption);\n }\n\n if (!isObjectNotArray(subOption)) {\n throwError(errMsg);\n }\n\n var cond = new NotConditionInternal();\n cond.child = parseOption(subOption, getters);\n\n if (!cond.child) {\n throwError(errMsg);\n }\n\n return cond;\n}\n\nfunction parseRelationalOption(exprOption, getters) {\n var errMsg = '';\n var valueGetterParam = getters.prepareGetValue(exprOption);\n var subCondList = [];\n var exprKeys = keys(exprOption);\n var parserName = exprOption.parser;\n var valueParser = parserName ? getRawValueParser(parserName) : null;\n\n for (var i = 0; i < exprKeys.length; i++) {\n var keyRaw = exprKeys[i];\n\n if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) {\n continue;\n }\n\n var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw;\n var condValueRaw = exprOption[keyRaw];\n var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;\n var evaluator = createFilterComparator(op, condValueParsed) || op === 'reg' && new RegExpEvaluator(condValueParsed);\n\n if (!evaluator) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal relational operation: \"' + keyRaw + '\" in condition:', exprOption);\n }\n\n throwError(errMsg);\n }\n\n subCondList.push(evaluator);\n }\n\n if (!subCondList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Relational condition must have at least one operator.', 'Illegal condition:', exprOption);\n } // No relational operator always disabled in case of dangers result.\n\n\n throwError(errMsg);\n }\n\n var cond = new RelationalConditionInternal();\n cond.valueGetterParam = valueGetterParam;\n cond.valueParser = valueParser;\n cond.getValue = getters.getValue;\n cond.subCondList = subCondList;\n return cond;\n}\n\nfunction isObjectNotArray(val) {\n return isObject(val) && !isArrayLike(val);\n}\n\nvar ConditionalExpressionParsed =\n/** @class */\nfunction () {\n function ConditionalExpressionParsed(exprOption, getters) {\n this._cond = parseOption(exprOption, getters);\n }\n\n ConditionalExpressionParsed.prototype.evaluate = function () {\n return this._cond.evaluate();\n };\n\n return ConditionalExpressionParsed;\n}();\n\n;\nexport function parseConditionalExpression(exprOption, getters) {\n return new ConditionalExpressionParsed(exprOption, getters);\n}"]},"metadata":{},"sourceType":"module"} |