Changeset 0c6b92a for imaps-frontend/node_modules/konva/lib/Factory.js
- Timestamp:
- 12/12/24 17:06:06 (5 weeks ago)
- Branches:
- main
- Parents:
- d565449
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/konva/lib/Factory.js
rd565449 r0c6b92a 4 4 const Util_1 = require("./Util"); 5 5 const Validators_1 = require("./Validators"); 6 varGET = 'get', SET = 'set';6 const GET = 'get', SET = 'set'; 7 7 exports.Factory = { 8 8 addGetterSetter(constructor, attr, def, validator, after) { … … 12 12 }, 13 13 addGetter(constructor, attr, def) { 14 varmethod = GET + Util_1.Util._capitalize(attr);14 const method = GET + Util_1.Util._capitalize(attr); 15 15 constructor.prototype[method] = 16 16 constructor.prototype[method] || 17 17 function () { 18 varval = this.attrs[attr];18 const val = this.attrs[attr]; 19 19 return val === undefined ? def : val; 20 20 }; 21 21 }, 22 22 addSetter(constructor, attr, validator, after) { 23 varmethod = SET + Util_1.Util._capitalize(attr);23 const method = SET + Util_1.Util._capitalize(attr); 24 24 if (!constructor.prototype[method]) { 25 25 exports.Factory.overWriteSetter(constructor, attr, validator, after); … … 27 27 }, 28 28 overWriteSetter(constructor, attr, validator, after) { 29 varmethod = SET + Util_1.Util._capitalize(attr);29 const method = SET + Util_1.Util._capitalize(attr); 30 30 constructor.prototype[method] = function (val) { 31 31 if (validator && val !== undefined && val !== null) { … … 40 40 }, 41 41 addComponentsGetterSetter(constructor, attr, components, validator, after) { 42 varlen = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr), n, component;42 let len = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr), n, component; 43 43 constructor.prototype[getter] = function () { 44 varret = {};44 const ret = {}; 45 45 for (n = 0; n < len; n++) { 46 46 component = components[n]; … … 49 49 return ret; 50 50 }; 51 varbasicValidator = (0, Validators_1.getComponentValidator)(components);51 const basicValidator = (0, Validators_1.getComponentValidator)(components); 52 52 constructor.prototype[setter] = function (val) { 53 varoldVal = this.attrs[attr], key;53 let oldVal = this.attrs[attr], key; 54 54 if (validator) { 55 55 val = validator.call(this, val); … … 78 78 }, 79 79 addOverloadedGetterSetter(constructor, attr) { 80 varcapitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr;80 const capitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr; 81 81 constructor.prototype[attr] = function () { 82 82 if (arguments.length) { … … 89 89 addDeprecatedGetterSetter(constructor, attr, def, validator) { 90 90 Util_1.Util.error('Adding deprecated ' + attr); 91 varmethod = GET + Util_1.Util._capitalize(attr);92 varmessage = attr +91 const method = GET + Util_1.Util._capitalize(attr); 92 const message = attr + 93 93 ' property is deprecated and will be removed soon. Look at Konva change log for more information.'; 94 94 constructor.prototype[method] = function () { 95 95 Util_1.Util.error(message); 96 varval = this.attrs[attr];96 const val = this.attrs[attr]; 97 97 return val === undefined ? def : val; 98 98 }; … … 104 104 backCompat(constructor, methods) { 105 105 Util_1.Util.each(methods, function (oldMethodName, newMethodName) { 106 varmethod = constructor.prototype[newMethodName];107 varoldGetter = GET + Util_1.Util._capitalize(oldMethodName);108 varoldSetter = SET + Util_1.Util._capitalize(oldMethodName);106 const method = constructor.prototype[newMethodName]; 107 const oldGetter = GET + Util_1.Util._capitalize(oldMethodName); 108 const oldSetter = SET + Util_1.Util._capitalize(oldMethodName); 109 109 function deprecated() { 110 110 method.apply(this, arguments);
Note:
See TracChangeset
for help on using the changeset viewer.