NuclearDispersionSystem/ant-design-vue-jeecg/node_modules/@antv/g2/esm/chart/controller/base.js.map
2023-09-14 14:47:11 +08:00

1 line
3.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/chart/controller/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAOlC;;;;;GAKG;AACH;IASE,oBAAY,IAAU;QARtB,WAAW;QACJ,YAAO,GAAY,IAAI,CAAC;QAI/B,oBAAoB;QACV,eAAU,GAAsB,EAAE,CAAC;QAG3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAkCD;;OAEG;IACI,0BAAK,GAAZ;QACE,yBAAyB;QACzB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,UAAC,EAAmB;YACxC,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,+BAA+B;QAC/B,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACI,4BAAO,GAAd;QACE,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED;;;OAGG;IACI,kCAAa,GAApB;QACE,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,kCAAa,GAApB,UAAqB,OAAgB;QACnC,IAAI,IAAI,CAAC,OAAO,KAAK,OAAO,EAAE;YAC5B,OAAO;SACR;QACD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,EAAmB;YAC1C,IAAI,OAAO,EAAE;gBACX,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;aACrB;iBAAM;gBACL,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;aACrB;QACH,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IACH,iBAAC;AAAD,CAAC,AA1FD,IA0FC","sourcesContent":["import { each } from '@antv/util';\nimport { ComponentOption } from '../../interface';\nimport View from '../view';\n\n/** Component controller class type define */\nexport type ControllerCtor<O = any> = new (view: View) => Controller<O>;\n\n/**\n * Component Controller 规范需要定义的基类\n * 1. 规范的 option 输入\n * 2. 统一的信息获取 API\n * 3. 明确定义的组件事件(名称、数据)\n */\nexport abstract class Controller<O = unknown> {\n /** 是否可见 */\n public visible: boolean = true;\n protected view: View;\n /** option 配置,不同组件有自己不同的配置结构 */\n protected option: O;\n /** 所有的 component */\n protected components: ComponentOption[] = [];\n\n constructor(view: View) {\n this.view = view;\n }\n\n public abstract get name(): string;\n\n /**\n * init the component\n */\n public abstract init();\n\n /**\n * render the components\n */\n public abstract render();\n\n /**\n * update the components\n */\n // public abstract update();\n\n /**\n * do layout\n */\n public abstract layout();\n\n /**\n * 组件的更新逻辑\n * - 根据字段为标识,为每一个组件生成一个 id放到 option 中\n * - 更新的时候按照 id 去做 diff然后对同的做处理\n * - 创建增加的\n * - 更新已有的\n * - 销毁删除的\n */\n public abstract update();\n\n /**\n * clear\n */\n public clear() {\n // destroy all components\n each(this.components, (co: ComponentOption) => {\n co.component.destroy();\n });\n\n // clear all component instance\n this.components = [];\n }\n\n /**\n * destroy the component\n */\n public destroy() {\n this.clear();\n }\n\n /**\n * get all components\n * @returns components array\n */\n public getComponents(): ComponentOption[] {\n return this.components;\n }\n\n /**\n * change visibility of component\n * @param visible\n */\n public changeVisible(visible: boolean) {\n if (this.visible === visible) {\n return;\n }\n this.components.forEach((co: ComponentOption) => {\n if (visible) {\n co.component.show();\n } else {\n co.component.hide();\n }\n });\n this.visible = visible;\n }\n}\n"]}