@visactor/vtable
Version:
canvas table width high performance
71 lines (65 loc) • 2.49 kB
JavaScript
;
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
void 0 === k2 && (k2 = k);
var desc = Object.getOwnPropertyDescriptor(m, k);
desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
enumerable: !0,
get: function() {
return m[k];
}
}), Object.defineProperty(o, k2, desc);
} : function(o, m, k, k2) {
void 0 === k2 && (k2 = k), o[k2] = m[k];
}), __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
Object.defineProperty(o, "default", {
enumerable: !0,
value: v
});
} : function(o, v) {
o.default = v;
}), __importStar = this && this.__importStar || function(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (null != mod) for (var k in mod) "default" !== k && Object.prototype.hasOwnProperty.call(mod, k) && __createBinding(result, mod, k);
return __setModuleDefault(result, mod), result;
};
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.DrillIcon = void 0;
const icon_1 = require("../graphic/icon"), icons = __importStar(require("../../icons")), regedIcons = icons.get();
class DrillIcon {
constructor() {
const iconOption = regedIcons.drillDown;
this.icon = new icon_1.Icon({
x: -1e3,
y: -1e3,
image: iconOption.svg,
width: iconOption.width,
height: iconOption.height,
dx: -iconOption.width / 2,
dy: -iconOption.height / 2,
visible: !1,
funcType: iconOption.funcType,
cursor: iconOption.cursor
}), this.icon.role = "icon-drill";
}
appand(parent) {
parent.appendChild(this.icon);
}
update(visible, x, y, drillDown, drillUp, scene) {
if (!visible || drillDown && drillUp) return this.icon.setAttributes({
x: -1e3,
y: -1e3,
visible: !1
}), void scene.updateNextFrame();
const drillDownOption = regedIcons.drillDown, drillUpOption = regedIcons.drillUp;
this.icon.setAttributes({
x: x,
y: y,
image: drillDown ? drillDownOption.svg : drillUpOption.svg,
visible: !0
}), this.icon.loadImage(this.icon.attribute.image), scene.updateNextFrame();
}
}
exports.DrillIcon = DrillIcon;
//# sourceMappingURL=drill-icon.js.map