1 line
14 KiB
JSON
1 line
14 KiB
JSON
{"ast":null,"code":"/*\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 { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { getLayoutParams, sizeCalculable, mergeLayoutParam } from '../../util/layout.js';\n\nvar CalendarModel =\n/** @class */\nfunction (_super) {\n __extends(CalendarModel, _super);\n\n function CalendarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CalendarModel.type;\n return _this;\n }\n /**\n * @override\n */\n\n\n CalendarModel.prototype.init = function (option, parentModel, ecModel) {\n var inputPositionParams = getLayoutParams(option);\n\n _super.prototype.init.apply(this, arguments);\n\n mergeAndNormalizeLayoutParams(option, inputPositionParams);\n };\n /**\n * @override\n */\n\n\n CalendarModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n\n mergeAndNormalizeLayoutParams(this.option, option);\n };\n\n CalendarModel.prototype.getCellSize = function () {\n // Has been normalized\n return this.option.cellSize;\n };\n\n CalendarModel.type = 'calendar';\n CalendarModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n left: 80,\n top: 60,\n cellSize: 20,\n // horizontal vertical\n orient: 'horizontal',\n // month separate line style\n splitLine: {\n show: true,\n lineStyle: {\n color: '#000',\n width: 1,\n type: 'solid'\n }\n },\n // rect style temporarily unused emphasis\n itemStyle: {\n color: '#fff',\n borderWidth: 1,\n borderColor: '#ccc'\n },\n // week text style\n dayLabel: {\n show: true,\n firstDay: 0,\n // start end\n position: 'start',\n margin: '50%',\n color: '#000'\n },\n // month text style\n monthLabel: {\n show: true,\n // start end\n position: 'start',\n margin: 5,\n // center or left\n align: 'center',\n formatter: null,\n color: '#000'\n },\n // year text style\n yearLabel: {\n show: true,\n // top bottom left right\n position: null,\n margin: 30,\n formatter: null,\n color: '#ccc',\n fontFamily: 'sans-serif',\n fontWeight: 'bolder',\n fontSize: 20\n }\n };\n return CalendarModel;\n}(ComponentModel);\n\nfunction mergeAndNormalizeLayoutParams(target, raw) {\n // Normalize cellSize\n var cellSize = target.cellSize;\n var cellSizeArr;\n\n if (!zrUtil.isArray(cellSize)) {\n cellSizeArr = target.cellSize = [cellSize, cellSize];\n } else {\n cellSizeArr = cellSize;\n }\n\n if (cellSizeArr.length === 1) {\n cellSizeArr[1] = cellSizeArr[0];\n }\n\n var ignoreSize = zrUtil.map([0, 1], function (hvIdx) {\n // If user have set `width` or both `left` and `right`, cellSizeArr\n // will be automatically set to 'auto', otherwise the default\n // setting of cellSizeArr will make `width` setting not work.\n if (sizeCalculable(raw, hvIdx)) {\n cellSizeArr[hvIdx] = 'auto';\n }\n\n return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto';\n });\n mergeLayoutParam(target, raw, {\n type: 'box',\n ignoreSize: ignoreSize\n });\n}\n\nexport default CalendarModel;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/echarts/lib/coord/calendar/CalendarModel.js"],"names":["__extends","zrUtil","ComponentModel","getLayoutParams","sizeCalculable","mergeLayoutParam","CalendarModel","_super","_this","apply","arguments","type","prototype","init","option","parentModel","ecModel","inputPositionParams","mergeAndNormalizeLayoutParams","mergeOption","getCellSize","cellSize","defaultOption","z","left","top","orient","splitLine","show","lineStyle","color","width","itemStyle","borderWidth","borderColor","dayLabel","firstDay","position","margin","monthLabel","align","formatter","yearLabel","fontFamily","fontWeight","fontSize","target","raw","cellSizeArr","isArray","length","ignoreSize","map","hvIdx"],"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,SAAT,QAA0B,OAA1B;AACA,OAAO,KAAKC,MAAZ,MAAwB,0BAAxB;AACA,OAAOC,cAAP,MAA2B,0BAA3B;AACA,SAASC,eAAT,EAA0BC,cAA1B,EAA0CC,gBAA1C,QAAkE,sBAAlE;;AAEA,IAAIC,aAAa;AACjB;AACA,UAAUC,MAAV,EAAkB;AAChBP,EAAAA,SAAS,CAACM,aAAD,EAAgBC,MAAhB,CAAT;;AAEA,WAASD,aAAT,GAAyB;AACvB,QAAIE,KAAK,GAAGD,MAAM,KAAK,IAAX,IAAmBA,MAAM,CAACE,KAAP,CAAa,IAAb,EAAmBC,SAAnB,CAAnB,IAAoD,IAAhE;;AAEAF,IAAAA,KAAK,CAACG,IAAN,GAAaL,aAAa,CAACK,IAA3B;AACA,WAAOH,KAAP;AACD;AACD;AACF;AACA;;;AAGEF,EAAAA,aAAa,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AAED,MAAI2B,WAAW,CAACE,MAAZ,KAAuB,CAA3B,EAA8B;AAC5BF,IAAAA,WAAW,CAAC,CAAD,CAAX,GAAiBA,WAAW,CAAC,CAAD,CAA5B;AACD;;AAED,MAAIG,UAAU,GAAGlD,MAAM,CAACmD,GAAP,CAAW,CAAC,CAAD,EAAI,CAAJ,CAAX,EAAmB,UAAUC,KAAV,EAAiB;AACnD;AACA;AACA;AACA,QAAIjD,cAAc,CAAC2C,GAAD,EAAMM,KAAN,CAAlB,EAAgC;AAC9BL,MAAAA,WAAW,CAACK,KAAD,CAAX,GAAqB,MAArB;AACD;;AAED,WAAOL,WAAW,CAACK,KAAD,CAAX,IAAsB,IAAtB,IAA8BL,WAAW,CAACK,KAAD,CAAX,KAAuB,MAA5D;AACD,GATgB,CAAjB;AAUAhD,EAAAA,gBAAgB,CAACyC,MAAD,EAASC,GAAT,EAAc;AAC5BpC,IAAAA,IAAI,EAAE,KADsB;AAE5BwC,IAAAA,UAAU,EAAEA;AAFgB,GAAd,CAAhB;AAID;;AAED,eAAe7C,aAAf","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 { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { getLayoutParams, sizeCalculable, mergeLayoutParam } from '../../util/layout.js';\n\nvar CalendarModel =\n/** @class */\nfunction (_super) {\n __extends(CalendarModel, _super);\n\n function CalendarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CalendarModel.type;\n return _this;\n }\n /**\n * @override\n */\n\n\n CalendarModel.prototype.init = function (option, parentModel, ecModel) {\n var inputPositionParams = getLayoutParams(option);\n\n _super.prototype.init.apply(this, arguments);\n\n mergeAndNormalizeLayoutParams(option, inputPositionParams);\n };\n /**\n * @override\n */\n\n\n CalendarModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n\n mergeAndNormalizeLayoutParams(this.option, option);\n };\n\n CalendarModel.prototype.getCellSize = function () {\n // Has been normalized\n return this.option.cellSize;\n };\n\n CalendarModel.type = 'calendar';\n CalendarModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n left: 80,\n top: 60,\n cellSize: 20,\n // horizontal vertical\n orient: 'horizontal',\n // month separate line style\n splitLine: {\n show: true,\n lineStyle: {\n color: '#000',\n width: 1,\n type: 'solid'\n }\n },\n // rect style temporarily unused emphasis\n itemStyle: {\n color: '#fff',\n borderWidth: 1,\n borderColor: '#ccc'\n },\n // week text style\n dayLabel: {\n show: true,\n firstDay: 0,\n // start end\n position: 'start',\n margin: '50%',\n color: '#000'\n },\n // month text style\n monthLabel: {\n show: true,\n // start end\n position: 'start',\n margin: 5,\n // center or left\n align: 'center',\n formatter: null,\n color: '#000'\n },\n // year text style\n yearLabel: {\n show: true,\n // top bottom left right\n position: null,\n margin: 30,\n formatter: null,\n color: '#ccc',\n fontFamily: 'sans-serif',\n fontWeight: 'bolder',\n fontSize: 20\n }\n };\n return CalendarModel;\n}(ComponentModel);\n\nfunction mergeAndNormalizeLayoutParams(target, raw) {\n // Normalize cellSize\n var cellSize = target.cellSize;\n var cellSizeArr;\n\n if (!zrUtil.isArray(cellSize)) {\n cellSizeArr = target.cellSize = [cellSize, cellSize];\n } else {\n cellSizeArr = cellSize;\n }\n\n if (cellSizeArr.length === 1) {\n cellSizeArr[1] = cellSizeArr[0];\n }\n\n var ignoreSize = zrUtil.map([0, 1], function (hvIdx) {\n // If user have set `width` or both `left` and `right`, cellSizeArr\n // will be automatically set to 'auto', otherwise the default\n // setting of cellSizeArr will make `width` setting not work.\n if (sizeCalculable(raw, hvIdx)) {\n cellSizeArr[hvIdx] = 'auto';\n }\n\n return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto';\n });\n mergeLayoutParam(target, raw, {\n type: 'box',\n ignoreSize: ignoreSize\n });\n}\n\nexport default CalendarModel;"]},"metadata":{},"sourceType":"module"} |