{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/geometries/box/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-09-16 09:28:13\n * @LastEditTime: 2022-03-30 10:18:51\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\geometries\\box\\index.ts\n */\nimport { VcComponentInternalInstance, VcComponentPublicInstance, VcPosition, VcReadyObject } from 'casc-cesium-utils/types'\nimport { defineComponent, getCurrentInstance, createCommentVNode } from 'vue'\nimport { useGeometries } from 'casc-cesium-composables'\nimport { kebabCase } from 'casc-cesium-utils/util'\nimport { dimensions, vertexFormat } from 'casc-cesium-utils/cesium-props'\nimport { commonEmits } from 'casc-cesium-utils/emits'\nexport const boxGeometryProps = {\n  ...dimensions,\n  ...vertexFormat\n}\nexport default defineComponent({\n  name: 'VcGeometryBox',\n  props: boxGeometryProps,\n  emits: commonEmits,\n  setup(props, ctx) {\n    // state\n    const instance = getCurrentInstance() as VcComponentInternalInstance\n    instance.cesiumClass = 'BoxGeometry'\n    const geometriesState = useGeometries(props, ctx, instance)\n\n    // methods\n    instance.createCesiumObject = async () => {\n      const options: any = geometriesState?.transformProps(props)\n      return Cesium.BoxGeometry.fromDimensions(options)\n    }\n\n    return () => createCommentVNode(kebabCase(instance.proxy?.$options.name || ''))\n  }\n})\n\nexport type VcGeometryBoxProps = {\n  /**\n   * The width, depth, and height of the box stored in the x, y, and z coordinates of the Cartesian3, respectively.\n   */\n  dimensions: VcPosition\n  /**\n   * The vertex attributes to be computed.\n   */\n  vertexFormat?: Cesium.VertexFormat\n  /**\n   * Triggers before the VcGeometryBox is loaded.\n   */\n  onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n  /**\n   * Triggers when the VcGeometryBox is successfully loaded.\n   */\n  onReady?: (readyObject: VcReadyObject) => void\n  /**\n   * Triggers when the component load failed.\n   */\n  onUnready?: (e: any) => void\n  /**\n   * Triggers when the VcGeometryBox is destroyed.\n   */\n  onDestroyed?: (instance: VcComponentInternalInstance) => void\n}\n\nexport type VcGeometryBoxRef = VcComponentPublicInstance<VcGeometryBoxProps>\n"],"names":[],"mappings":";;;;;;;AAKY,MAAC,gBAAgB,GAAG;AAChC,EAAE,GAAG,UAAU;AACf,EAAE,GAAG,YAAY;AACjB,EAAE;AACF,kBAAe,eAAe,CAAC;AAC/B,EAAE,IAAI,EAAE,eAAe;AACvB,EAAE,KAAK,EAAE,gBAAgB;AACzB,EAAE,KAAK,EAAE,WAAW;AACpB,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE;AACpB,IAAI,MAAM,QAAQ,GAAG,kBAAkB,EAAE,CAAC;AAC1C,IAAI,QAAQ,CAAC,WAAW,GAAG,aAAa,CAAC;AACzC,IAAI,MAAM,eAAe,GAAG,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AAChE,IAAI,QAAQ,CAAC,kBAAkB,GAAG,YAAY;AAC9C,MAAM,MAAM,OAAO,GAAG,eAAe,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,eAAe,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/F,MAAM,OAAO,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AACxD,KAAK,CAAC;AACN,IAAI,OAAO,MAAM;AACjB,MAAM,IAAI,EAAE,CAAC;AACb,MAAM,OAAO,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC;AAC9G,KAAK,CAAC;AACN,GAAG;AACH,CAAC,CAAC;;;;"}