chbim-time-axis-v2 0.0.9 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11823,7 +11823,7 @@ const _hoisted_4$1 = ["onMouseenter", "onContextmenu"];
11823
11823
  const _hoisted_5$1 = ["onMousedown", "onContextmenu"];
11824
11824
  const _hoisted_6$1 = ["onMousedown"];
11825
11825
  const _hoisted_7$1 = {
11826
- key: 1,
11826
+ key: 0,
11827
11827
  class: "barLabel"
11828
11828
  };
11829
11829
  const _hoisted_8$1 = ["onMousedown"];
@@ -12302,7 +12302,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12302
12302
  name: b.name || "",
12303
12303
  color: b.color,
12304
12304
  startTime: b.startTime,
12305
- endTime: b.endTime
12305
+ endTime: b.endTime,
12306
+ attr: b.attr,
12307
+ class: b.class
12306
12308
  });
12307
12309
  }
12308
12310
  });
@@ -12317,7 +12319,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12317
12319
  id: i.id,
12318
12320
  name: i.name || "",
12319
12321
  color: i.color,
12320
- time: i.time
12322
+ time: i.time,
12323
+ attr: i.attr,
12324
+ class: i.class
12321
12325
  });
12322
12326
  }
12323
12327
  });
@@ -12609,7 +12613,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12609
12613
  }, null, 4)) : createCommentVNode("", true),
12610
12614
  bar.hasMainBar && bar.originalTask.type !== "block" && bar.originalTask.type !== "instant" ? (openBlock(), createElementBlock("div", {
12611
12615
  key: 1,
12612
- class: "taskBar draggable",
12616
+ class: normalizeClass(["taskBar draggable", bar.originalTask.class]),
12613
12617
  style: normalizeStyle({
12614
12618
  left: bar.left + "px",
12615
12619
  width: bar.width + "px",
@@ -12617,7 +12621,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12617
12621
  }),
12618
12622
  onMousedown: (e) => handleDragStart(e, bar.originalTask),
12619
12623
  onContextmenu: withModifiers(
12620
- (e) => _ctx.$emit("bar-contextmenu", { event: e, task: bar.originalTask }),
12624
+ (e) => _ctx.$emit("bar-contextmenu", {
12625
+ event: e,
12626
+ task: bar.originalTask,
12627
+ time: getTimeFromEvent(e)
12628
+ }),
12621
12629
  ["stop", "prevent"]
12622
12630
  )
12623
12631
  }, [
@@ -12629,20 +12637,22 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12629
12637
  ["stop"]
12630
12638
  )
12631
12639
  }, null, 40, _hoisted_6$1)) : createCommentVNode("", true),
12632
- bar.width > 50 ? (openBlock(), createElementBlock("span", _hoisted_7$1, toDisplayString(bar.name), 1)) : createCommentVNode("", true),
12640
+ renderSlot(_ctx.$slots, "barContent", { bar }, () => [
12641
+ bar.width > 50 ? (openBlock(), createElementBlock("span", _hoisted_7$1, toDisplayString(bar.name), 1)) : createCommentVNode("", true)
12642
+ ], true),
12633
12643
  bar.originalTask.type !== "group" ? (openBlock(), createElementBlock("div", {
12634
- key: 2,
12644
+ key: 1,
12635
12645
  class: "resize-handle right",
12636
12646
  onMousedown: withModifiers(
12637
12647
  (e) => handleResizeStart(e, bar.originalTask, "right"),
12638
12648
  ["stop"]
12639
12649
  )
12640
12650
  }, null, 40, _hoisted_8$1)) : createCommentVNode("", true)
12641
- ], 44, _hoisted_5$1)) : createCommentVNode("", true),
12651
+ ], 46, _hoisted_5$1)) : createCommentVNode("", true),
12642
12652
  bar.originalTask.type === "block" && bar.blocks ? (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(bar.blocks, (blk, idx) => {
12643
12653
  return openBlock(), createElementBlock("div", {
12644
12654
  key: idx,
12645
- class: "taskBar draggable",
12655
+ class: normalizeClass(["taskBar draggable", blk.class]),
12646
12656
  style: normalizeStyle({
12647
12657
  left: blk.left + "px",
12648
12658
  width: blk.width + "px",
@@ -12655,7 +12665,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12655
12665
  (e) => _ctx.$emit("bar-contextmenu", {
12656
12666
  event: e,
12657
12667
  task: bar.originalTask,
12658
- block: blk
12668
+ block: blk,
12669
+ time: getTimeFromEvent(e)
12659
12670
  }),
12660
12671
  ["stop", "prevent"]
12661
12672
  )
@@ -12667,7 +12678,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12667
12678
  ["stop"]
12668
12679
  )
12669
12680
  }, null, 40, _hoisted_10$1),
12670
- blk.width > 50 ? (openBlock(), createElementBlock("span", _hoisted_11$1, toDisplayString(blk.name), 1)) : createCommentVNode("", true),
12681
+ renderSlot(_ctx.$slots, "blockContent", {
12682
+ block: blk,
12683
+ task: bar.originalTask
12684
+ }, () => [
12685
+ blk.width > 50 ? (openBlock(), createElementBlock("span", _hoisted_11$1, toDisplayString(blk.name), 1)) : createCommentVNode("", true)
12686
+ ], true),
12671
12687
  createElementVNode("div", {
12672
12688
  class: "resize-handle right",
12673
12689
  onMousedown: withModifiers(
@@ -12675,21 +12691,16 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12675
12691
  ["stop"]
12676
12692
  )
12677
12693
  }, null, 40, _hoisted_12$1)
12678
- ], 44, _hoisted_9$1);
12694
+ ], 46, _hoisted_9$1);
12679
12695
  }), 128)) : createCommentVNode("", true),
12680
12696
  bar.instants ? (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList(bar.instants, (inst, idx) => {
12681
12697
  return openBlock(), createElementBlock("div", {
12682
12698
  key: inst.id,
12683
- class: "instantTaskPoint draggable",
12699
+ class: normalizeClass(["instantTaskPoint draggable", inst.class]),
12684
12700
  style: normalizeStyle({
12685
12701
  left: inst.left - 10 + "px",
12686
- width: "18px",
12687
- height: "18px",
12688
12702
  backgroundColor: inst.color || "#ffffff",
12689
- top: "6px",
12690
- borderRadius: "50%",
12691
- position: "absolute",
12692
- cursor: "pointer"
12703
+ position: "absolute"
12693
12704
  }),
12694
12705
  title: `${inst.name ? inst.name + "\n" : ""}${unref(dayjs)(
12695
12706
  inst.time
@@ -12699,11 +12710,17 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12699
12710
  (e) => _ctx.$emit("bar-contextmenu", {
12700
12711
  event: e,
12701
12712
  task: bar.originalTask,
12702
- instant: inst
12713
+ instant: inst,
12714
+ time: getTimeFromEvent(e)
12703
12715
  }),
12704
12716
  ["stop", "prevent"]
12705
12717
  )
12706
- }, null, 44, _hoisted_13$1);
12718
+ }, [
12719
+ renderSlot(_ctx.$slots, "instantContent", {
12720
+ instant: inst,
12721
+ task: bar.originalTask
12722
+ }, void 0, true)
12723
+ ], 46, _hoisted_13$1);
12707
12724
  }), 128)) : createCommentVNode("", true)
12708
12725
  ], 46, _hoisted_4$1);
12709
12726
  }), 128))
@@ -12720,8 +12737,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12720
12737
  };
12721
12738
  }
12722
12739
  });
12723
- const TimelineChart_vue_vue_type_style_index_0_scoped_1692bade_lang = "";
12724
- const TimelineChart = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-1692bade"]]);
12740
+ const TimelineChart_vue_vue_type_style_index_0_scoped_7a1f218b_lang = "";
12741
+ const TimelineChart = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-7a1f218b"]]);
12725
12742
  const _hoisted_1 = { class: "toolbar" };
12726
12743
  const _hoisted_2 = { style: { "flex": "1", "display": "flex", "align-items": "center", "height": "100%" } };
12727
12744
  const _hoisted_3 = { class: "left-controls" };
@@ -12771,7 +12788,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12771
12788
  tasks: {}
12772
12789
  },
12773
12790
  emits: ["taskUpdate", "update:tasks", "add", "delete", "task-enter", "task-leave"],
12774
- setup(__props, { emit: __emit }) {
12791
+ setup(__props, { expose: __expose, emit: __emit }) {
12775
12792
  const props = __props;
12776
12793
  const emit = __emit;
12777
12794
  const contextMenuVisible = ref(false);
@@ -12779,8 +12796,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12779
12796
  const contextMenuTask = ref(null);
12780
12797
  const contextMenuBlock = ref(null);
12781
12798
  const contextMenuInstant = ref(null);
12799
+ const contextMenuTime = ref(null);
12782
12800
  const openBarContextMenu = (payload) => {
12783
- const { event, task, block, instant } = payload;
12801
+ const { event, task, block, instant, time } = payload;
12784
12802
  event.preventDefault();
12785
12803
  event.stopPropagation();
12786
12804
  closeBuiltinMenu();
@@ -12799,12 +12817,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12799
12817
  contextMenuTask.value = task;
12800
12818
  contextMenuBlock.value = block || null;
12801
12819
  contextMenuInstant.value = instant || null;
12820
+ contextMenuTime.value = time || null;
12802
12821
  };
12803
12822
  const closeContextMenu = () => {
12804
12823
  contextMenuVisible.value = false;
12805
12824
  contextMenuTask.value = null;
12806
12825
  contextMenuBlock.value = null;
12807
12826
  contextMenuInstant.value = null;
12827
+ contextMenuTime.value = null;
12808
12828
  };
12809
12829
  const builtinMenuVisible = ref(false);
12810
12830
  const builtinMenuStyle = ref({});
@@ -12987,8 +13007,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12987
13007
  const processedChildren = process(rawChildren);
12988
13008
  let minTime = Number.MAX_SAFE_INTEGER;
12989
13009
  let maxTime = Number.MIN_SAFE_INTEGER;
12990
- if (rawChildren.length > 0) {
12991
- rawChildren.forEach((child) => {
13010
+ if (processedChildren.length > 0) {
13011
+ processedChildren.forEach((child) => {
12992
13012
  const start = new Date(child.startTime).getTime();
12993
13013
  const end = new Date(child.endTime).getTime();
12994
13014
  if (!isNaN(start)) {
@@ -13394,6 +13414,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13394
13414
  if (isMinimized.value)
13395
13415
  isMaximized.value = false;
13396
13416
  };
13417
+ __expose({
13418
+ toggleMaximize,
13419
+ toggleMinimize
13420
+ });
13397
13421
  return (_ctx, _cache) => {
13398
13422
  return openBlock(), createElementBlock("div", {
13399
13423
  class: normalizeClass(["cesiumGanttRoot", { maximized: isMaximized.value, minimized: isMinimized.value }])
@@ -13509,7 +13533,35 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13509
13533
  onRowMouseleave: handleRowMouseLeave,
13510
13534
  onBarContextmenu: openBarContextMenu,
13511
13535
  onRowContextmenu: openRowContextMenu
13512
- }, null, 8, ["tasks", "currentTime", "scale", "viewStartTime", "viewEndTime", "hoveredTaskId"])
13536
+ }, createSlots({ _: 2 }, [
13537
+ _ctx.$slots.barContent ? {
13538
+ name: "barContent",
13539
+ fn: withCtx(({ bar }) => [
13540
+ renderSlot(_ctx.$slots, "barContent", { bar }, void 0, true)
13541
+ ]),
13542
+ key: "0"
13543
+ } : void 0,
13544
+ _ctx.$slots.blockContent ? {
13545
+ name: "blockContent",
13546
+ fn: withCtx(({ block, task }) => [
13547
+ renderSlot(_ctx.$slots, "blockContent", {
13548
+ block,
13549
+ task
13550
+ }, void 0, true)
13551
+ ]),
13552
+ key: "1"
13553
+ } : void 0,
13554
+ _ctx.$slots.instantContent ? {
13555
+ name: "instantContent",
13556
+ fn: withCtx(({ instant, task }) => [
13557
+ renderSlot(_ctx.$slots, "instantContent", {
13558
+ instant,
13559
+ task
13560
+ }, void 0, true)
13561
+ ]),
13562
+ key: "2"
13563
+ } : void 0
13564
+ ]), 1032, ["tasks", "currentTime", "scale", "viewStartTime", "viewEndTime", "hoveredTaskId"])
13513
13565
  ])
13514
13566
  ], 512), [
13515
13567
  [vShow, !isMinimized.value]
@@ -13525,6 +13577,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13525
13577
  task: contextMenuTask.value,
13526
13578
  block: contextMenuBlock.value,
13527
13579
  instant: contextMenuInstant.value,
13580
+ time: contextMenuTime.value,
13528
13581
  close: closeContextMenu
13529
13582
  }, () => [
13530
13583
  contextMenuTask.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
@@ -13567,8 +13620,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13567
13620
  };
13568
13621
  }
13569
13622
  });
13570
- const CesiumGantt_vue_vue_type_style_index_0_scoped_e6696098_lang = "";
13571
- const CesiumGantt = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e6696098"]]);
13623
+ const CesiumGantt_vue_vue_type_style_index_0_scoped_ddc42e1a_lang = "";
13624
+ const CesiumGantt = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ddc42e1a"]]);
13572
13625
  CesiumGantt.install = (app) => {
13573
13626
  app.component("CesiumGantt", CesiumGantt);
13574
13627
  };