@vipl520/dk-ui 1.0.48 → 1.0.49

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.
package/dist/index.js CHANGED
@@ -2918,7 +2918,7 @@
2918
2918
  const _hoisted_21$1 = { class: "file-name over" };
2919
2919
  const _hoisted_22$1 = { class: "right" };
2920
2920
  const _hoisted_23$1 = { class: "block p-10px" };
2921
- const _hoisted_24$1 = {
2921
+ const _hoisted_24 = {
2922
2922
  key: 1,
2923
2923
  style: { "display": "flex", "align-items": "center", "justify-content": "center", "height": "340px" }
2924
2924
  };
@@ -3418,7 +3418,7 @@
3418
3418
  ])
3419
3419
  ])), [
3420
3420
  [_directive_loading, loading.value]
3421
- ]) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_24$1, [
3421
+ ]) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_24, [
3422
3422
  vue.createVNode(_component_el_empty, { description: "\u6682\u65E0\u6570\u636E" })
3423
3423
  ])),
3424
3424
  (vue.openBlock(), vue.createBlock(_component_dk_form, {
@@ -5365,8 +5365,8 @@
5365
5365
  default: () => ({})
5366
5366
  },
5367
5367
  height: {
5368
- type: Number,
5369
- default: 180
5368
+ type: [Number, String],
5369
+ default: "auto"
5370
5370
  },
5371
5371
  help: {
5372
5372
  type: String,
@@ -5490,50 +5490,46 @@
5490
5490
  const _hoisted_5$d = { class: "name-header-operations" };
5491
5491
  const _hoisted_6$b = { class: "name-header-operations" };
5492
5492
  const _hoisted_7$b = { class: "name-header-operations" };
5493
- const _hoisted_8$9 = ["title"];
5494
- const _hoisted_9$7 = ["onMouseenter"];
5495
- const _hoisted_10$5 = ["onUpdate:modelValue", "onBlur"];
5496
- const _hoisted_11$5 = ["width", "height", "viewBox", "data-link-anchor", "innerHTML"];
5497
- const _hoisted_12$4 = /* @__PURE__ */ vue.createElementVNode(
5493
+ const _hoisted_8$9 = ["title", "onClick"];
5494
+ const _hoisted_9$7 = ["onUpdate:modelValue", "onBlur"];
5495
+ const _hoisted_10$5 = ["width", "height", "viewBox", "data-link-anchor", "innerHTML"];
5496
+ const _hoisted_11$5 = /* @__PURE__ */ vue.createElementVNode(
5498
5497
  "div",
5499
5498
  { style: { "position": "absolute", "display": "none", "width": "100%", "height": "100%" } },
5500
5499
  null,
5501
5500
  -1
5502
5501
  /* HOISTED */
5503
5502
  );
5504
- const _hoisted_13$3 = { class: "anchor-wrapper" };
5505
- const _hoisted_14$3 = ["onMousedown"];
5506
- const _hoisted_15$2 = /* @__PURE__ */ vue.createElementVNode(
5503
+ const _hoisted_12$4 = { class: "anchor-wrapper" };
5504
+ const _hoisted_13$3 = ["onMousedown"];
5505
+ const _hoisted_14$3 = /* @__PURE__ */ vue.createElementVNode(
5507
5506
  "span",
5508
5507
  { class: "title" },
5509
5508
  " \u5916\u8FB9\u8DDD ",
5510
5509
  -1
5511
5510
  /* HOISTED */
5512
5511
  );
5513
- const _hoisted_16$2 = { class: "thumnail border" };
5514
- const _hoisted_17$1 = ["title"];
5515
- const _hoisted_18 = ["onMouseenter"];
5516
- const _hoisted_19 = ["onUpdate:modelValue", "onBlur"];
5517
- const _hoisted_20 = ["width", "height", "viewBox", "data-link-anchor", "innerHTML"];
5518
- const _hoisted_21 = { class: "anchor-wrapper" };
5519
- const _hoisted_22 = ["onMousedown"];
5520
- const _hoisted_23 = /* @__PURE__ */ vue.createElementVNode(
5512
+ const _hoisted_15$2 = { class: "thumnail border" };
5513
+ const _hoisted_16$2 = ["title", "onClick"];
5514
+ const _hoisted_17$1 = ["onUpdate:modelValue", "onBlur"];
5515
+ const _hoisted_18 = ["width", "height", "viewBox", "data-link-anchor", "innerHTML"];
5516
+ const _hoisted_19 = { class: "anchor-wrapper" };
5517
+ const _hoisted_20 = ["onMousedown"];
5518
+ const _hoisted_21 = /* @__PURE__ */ vue.createElementVNode(
5521
5519
  "span",
5522
5520
  { class: "title" },
5523
5521
  " \u5185\u8FB9\u8DDD ",
5524
5522
  -1
5525
5523
  /* HOISTED */
5526
5524
  );
5527
- const _hoisted_24 = { class: "title" };
5528
- const _hoisted_25 = { class: "content-unit left-0" };
5529
- const _hoisted_26 = /* @__PURE__ */ vue.createElementVNode(
5525
+ const _hoisted_22 = { class: "title" };
5526
+ const _hoisted_23 = /* @__PURE__ */ vue.createElementVNode(
5530
5527
  "span",
5531
5528
  null,
5532
5529
  " x ",
5533
5530
  -1
5534
5531
  /* HOISTED */
5535
5532
  );
5536
- const _hoisted_27 = { class: "content-unit right-0" };
5537
5533
  const __default__$p = vue.defineComponent({
5538
5534
  name: "DkStyleBoxInput"
5539
5535
  });
@@ -5563,13 +5559,17 @@
5563
5559
  width: props.modelValue.width || "",
5564
5560
  height: props.modelValue.height || ""
5565
5561
  });
5566
- vue.ref(props.height);
5567
- vue.watch(
5568
- () => props.height,
5569
- () => {
5570
- console.log("height", props.height);
5562
+ const box = vue.ref(null);
5563
+ const { width } = core.useElementSize(box);
5564
+ const height = vue.computed(() => {
5565
+ console.log("props.height", props.height);
5566
+ if (props.height === "auto") {
5567
+ const h = width.value / 1.8;
5568
+ return h > 300 ? 300 : h;
5569
+ } else {
5570
+ return props.height;
5571
5571
  }
5572
- );
5572
+ });
5573
5573
  vue.watch(
5574
5574
  () => props.modelValue,
5575
5575
  (newVal, oldVal) => {
@@ -5662,17 +5662,16 @@
5662
5662
  stopChangeBound.value = handleMouseUp.bind(event);
5663
5663
  document.addEventListener("mouseup", stopChangeBound.value);
5664
5664
  dragging.value = true;
5665
- const height2 = props.height;
5666
5665
  const wrapperElement = document.querySelector(".wrapper");
5667
- const width = wrapperElement ? wrapperElement.offsetWidth : 0;
5666
+ const width2 = wrapperElement ? wrapperElement.offsetWidth : 0;
5668
5667
  const multiples = {
5669
5668
  margin: 0.9,
5670
5669
  padding: 0.9 * 0.7
5671
5670
  };
5672
5671
  const { clientX, clientY } = event;
5673
- const setCursorAndDimensions = (cursor, left, top, width2, height3) => {
5672
+ const setCursorAndDimensions = (cursor, left, top, width3, height2) => {
5674
5673
  document.body.style.cursor = cursor;
5675
- Object.assign(positionStyle, { left, top, width: width2, height: height3, display: "block" });
5674
+ Object.assign(positionStyle, { left, top, width: width3, height: height2, display: "block" });
5676
5675
  };
5677
5676
  startPosition.x = clientX;
5678
5677
  startPosition.y = clientY;
@@ -5680,16 +5679,16 @@
5680
5679
  setCursorAndDimensions(
5681
5680
  "ew-resize",
5682
5681
  clientX + "px",
5683
- clientY - height2 * 0.5 * multiples[type] + "px",
5682
+ clientY - height.value * 0.5 * multiples[type] + "px",
5684
5683
  "0.1px",
5685
- height2 * multiples[type] + "px"
5684
+ height.value * multiples[type] + "px"
5686
5685
  );
5687
5686
  } else {
5688
5687
  setCursorAndDimensions(
5689
5688
  "ns-resize",
5690
- clientX - width * 0.5 * multiples[type] + "px",
5689
+ clientX - width2 * 0.5 * multiples[type] + "px",
5691
5690
  clientY + "px",
5692
- width * multiples[type] + "px",
5691
+ width2 * multiples[type] + "px",
5693
5692
  "0.1px"
5694
5693
  );
5695
5694
  }
@@ -5868,9 +5867,11 @@
5868
5867
  vue.createElementVNode(
5869
5868
  "div",
5870
5869
  {
5870
+ ref_key: "box",
5871
+ ref: box,
5871
5872
  tabindex: "0",
5872
5873
  class: "wrapper",
5873
- style: vue.normalizeStyle([{ "margin-top": "10px" }, { height: props.height + "px" }])
5874
+ style: vue.normalizeStyle([{ "margin-top": "10px" }, { height: height.value + "px" }])
5874
5875
  },
5875
5876
  [
5876
5877
  vue.createElementVNode(
@@ -5890,11 +5891,16 @@
5890
5891
  return vue.openBlock(), vue.createElementBlock("div", { key }, [
5891
5892
  vue.createElementVNode("span", {
5892
5893
  title: item.title,
5893
- class: vue.normalizeClass(`anchor-tip-${item.position} value-indicator`)
5894
+ class: vue.normalizeClass(`anchor-tip-${item.position} value-indicator`),
5895
+ onClick: ($event) => onDblclick(item.value, key)
5894
5896
  }, [
5895
- vue.createElementVNode("span", {
5896
- onMouseenter: ($event) => onDblclick(item.value, key)
5897
- }, vue.toDisplayString(getValue(styles[item.value])), 41, _hoisted_9$7)
5897
+ vue.createElementVNode(
5898
+ "span",
5899
+ null,
5900
+ vue.toDisplayString(getValue(styles[item.value])),
5901
+ 1
5902
+ /* TEXT */
5903
+ )
5898
5904
  ], 10, _hoisted_8$9),
5899
5905
  vue.withDirectives(vue.createElementVNode("input", {
5900
5906
  ref_for: true,
@@ -5903,7 +5909,7 @@
5903
5909
  "onUpdate:modelValue": ($event) => styles[item.value] = $event,
5904
5910
  class: vue.normalizeClass("input-box anchor-tip-" + item.position + (showStyles[item.value] ? " show" : "")),
5905
5911
  onBlur: ($event) => onBlur(item.value)
5906
- }, null, 42, _hoisted_10$5), [
5912
+ }, null, 42, _hoisted_9$7), [
5907
5913
  [vue.vModelText, styles[item.value]]
5908
5914
  ]),
5909
5915
  (vue.openBlock(), vue.createElementBlock("svg", {
@@ -5915,15 +5921,15 @@
5915
5921
  style: vue.normalizeStyle(item.svg.style),
5916
5922
  class: "esm-modal-svg",
5917
5923
  innerHTML: item.svg.content
5918
- }, null, 12, _hoisted_11$5))
5924
+ }, null, 12, _hoisted_10$5))
5919
5925
  ]);
5920
5926
  }),
5921
5927
  128
5922
5928
  /* KEYED_FRAGMENT */
5923
5929
  ))
5924
5930
  ]),
5925
- _hoisted_12$4,
5926
- vue.createElementVNode("div", _hoisted_13$3, [
5931
+ _hoisted_11$5,
5932
+ vue.createElementVNode("div", _hoisted_12$4, [
5927
5933
  (vue.openBlock(), vue.createElementBlock(
5928
5934
  vue.Fragment,
5929
5935
  null,
@@ -5934,16 +5940,16 @@
5934
5940
  onMousemove: handleMouseMove,
5935
5941
  onMousedown: ($event) => handleMouseDown("margin", item, $event),
5936
5942
  onMouseup: handleMouseUp
5937
- }, null, 42, _hoisted_14$3);
5943
+ }, null, 42, _hoisted_13$3);
5938
5944
  }),
5939
5945
  64
5940
5946
  /* STABLE_FRAGMENT */
5941
5947
  ))
5942
5948
  ]),
5943
- _hoisted_15$2,
5949
+ _hoisted_14$3,
5944
5950
  vue.createCommentVNode("\u5916\u8FB9\u8DDD Margin END"),
5945
5951
  vue.createCommentVNode("\u5185\u8FB9\u8DDD Padding"),
5946
- vue.createElementVNode("div", _hoisted_16$2, [
5952
+ vue.createElementVNode("div", _hoisted_15$2, [
5947
5953
  vue.createElementVNode(
5948
5954
  "div",
5949
5955
  {
@@ -5960,12 +5966,17 @@
5960
5966
  return vue.openBlock(), vue.createElementBlock("div", { key }, [
5961
5967
  vue.createElementVNode("span", {
5962
5968
  title: item.title,
5963
- class: vue.normalizeClass(`anchor-tip-${item.position} value-indicator`)
5969
+ class: vue.normalizeClass(`anchor-tip-${item.position} value-indicator`),
5970
+ onClick: ($event) => onDblclick(item.value, key + 4)
5964
5971
  }, [
5965
- vue.createElementVNode("span", {
5966
- onMouseenter: ($event) => onDblclick(item.value, key + 4)
5967
- }, vue.toDisplayString(getValue(styles[item.value])), 41, _hoisted_18)
5968
- ], 10, _hoisted_17$1),
5972
+ vue.createElementVNode(
5973
+ "span",
5974
+ null,
5975
+ vue.toDisplayString(getValue(styles[item.value])),
5976
+ 1
5977
+ /* TEXT */
5978
+ )
5979
+ ], 10, _hoisted_16$2),
5969
5980
  vue.withDirectives(vue.createElementVNode("input", {
5970
5981
  ref_for: true,
5971
5982
  ref_key: "inputField",
@@ -5973,7 +5984,7 @@
5973
5984
  "onUpdate:modelValue": ($event) => styles[item.value] = $event,
5974
5985
  class: vue.normalizeClass("input-box anchor-tip-" + item.position + (showStyles[item.value] ? " show" : "")),
5975
5986
  onBlur: ($event) => onBlur(item.value)
5976
- }, null, 42, _hoisted_19), [
5987
+ }, null, 42, _hoisted_17$1), [
5977
5988
  [vue.vModelText, styles[item.value]]
5978
5989
  ]),
5979
5990
  (vue.openBlock(), vue.createElementBlock("svg", {
@@ -5985,14 +5996,14 @@
5985
5996
  style: vue.normalizeStyle(item.svg.style),
5986
5997
  class: "esm-modal-svg",
5987
5998
  innerHTML: item.svg.content
5988
- }, null, 12, _hoisted_20))
5999
+ }, null, 12, _hoisted_18))
5989
6000
  ]);
5990
6001
  }),
5991
6002
  128
5992
6003
  /* KEYED_FRAGMENT */
5993
6004
  ))
5994
6005
  ]),
5995
- vue.createElementVNode("div", _hoisted_21, [
6006
+ vue.createElementVNode("div", _hoisted_19, [
5996
6007
  (vue.openBlock(), vue.createElementBlock(
5997
6008
  vue.Fragment,
5998
6009
  null,
@@ -6003,13 +6014,13 @@
6003
6014
  onMousemove: handleMouseMove,
6004
6015
  onMousedown: ($event) => handleMouseDown("padding", item, $event),
6005
6016
  onMouseup: handleMouseUp
6006
- }, null, 42, _hoisted_22);
6017
+ }, null, 42, _hoisted_20);
6007
6018
  }),
6008
6019
  64
6009
6020
  /* STABLE_FRAGMENT */
6010
6021
  ))
6011
6022
  ]),
6012
- _hoisted_23,
6023
+ _hoisted_21,
6013
6024
  vue.createCommentVNode("\u5185\u8FB9\u8DDD END"),
6014
6025
  vue.createElementVNode(
6015
6026
  "div",
@@ -6019,16 +6030,17 @@
6019
6030
  onMouseleave: _cache[10] || (_cache[10] = ($event) => onMouseMove("widthHeight", "leave", $event))
6020
6031
  },
6021
6032
  [
6022
- vue.createElementVNode("span", _hoisted_24, [
6023
- vue.createElementVNode("span", _hoisted_25, [
6033
+ vue.createElementVNode("span", _hoisted_22, [
6034
+ vue.createElementVNode("span", {
6035
+ class: "content-unit left-0",
6036
+ onClick: _cache[3] || (_cache[3] = ($event) => onDblclick("width", 9))
6037
+ }, [
6024
6038
  vue.createElementVNode(
6025
6039
  "em",
6026
- {
6027
- onMouseenter: _cache[3] || (_cache[3] = ($event) => onDblclick("width", 9))
6028
- },
6040
+ null,
6029
6041
  vue.toDisplayString(getValue(styles["width"])),
6030
- 33
6031
- /* TEXT, HYDRATE_EVENTS */
6042
+ 1
6043
+ /* TEXT */
6032
6044
  )
6033
6045
  ]),
6034
6046
  vue.withDirectives(vue.createElementVNode(
@@ -6046,16 +6058,17 @@
6046
6058
  ), [
6047
6059
  [vue.vModelText, styles.width]
6048
6060
  ]),
6049
- _hoisted_26,
6050
- vue.createElementVNode("span", _hoisted_27, [
6061
+ _hoisted_23,
6062
+ vue.createElementVNode("span", {
6063
+ class: "content-unit right-0",
6064
+ onClick: _cache[6] || (_cache[6] = ($event) => onDblclick("height", 9))
6065
+ }, [
6051
6066
  vue.createElementVNode(
6052
6067
  "em",
6053
- {
6054
- onMouseenter: _cache[6] || (_cache[6] = ($event) => onDblclick("height", 9))
6055
- },
6068
+ null,
6056
6069
  vue.toDisplayString(getValue(styles["height"])),
6057
- 33
6058
- /* TEXT, HYDRATE_EVENTS */
6070
+ 1
6071
+ /* TEXT */
6059
6072
  )
6060
6073
  ]),
6061
6074
  vue.withDirectives(vue.createElementVNode(