qidian-vue-ui 1.1.0 → 1.1.2

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.
@@ -42,7 +42,7 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
42
42
  },
43
43
  setup(__props) {
44
44
  vue.useCssVars((_ctx) => ({
45
- "v3d70b876": _ctx.ellipsis
45
+ "v4b8b74b0": _ctx.ellipsis
46
46
  }));
47
47
  const props = __props;
48
48
  const contentRef = vue.useTemplateRef("content");
@@ -50,7 +50,7 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
50
50
  function checkEllipsis() {
51
51
  const el = contentRef.value;
52
52
  if (!el) return;
53
- isEllipsis.value = el.scrollWidth > el.clientWidth || el.scrollHeight > el.clientHeight;
53
+ isEllipsis.value = el.scrollWidth > el.clientWidth || props.ellipsis > 1 && el.scrollHeight > el.clientHeight;
54
54
  }
55
55
  vue.watch(
56
56
  () => props.content,
@@ -69,9 +69,13 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
69
69
  }, {
70
70
  content: vue.withCtx(() => [
71
71
  vue.renderSlot(_ctx.$slots, "content", {}, () => [
72
- __props.preWrap ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$3, vue.toDisplayString(__props.content), 1)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
72
+ __props.preWrap ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$3, [
73
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
74
+ vue.createTextVNode(vue.toDisplayString(__props.content), 1)
75
+ ], true)
76
+ ])) : vue.renderSlot(_ctx.$slots, "default", { key: 1 }, () => [
73
77
  vue.createTextVNode(vue.toDisplayString(__props.content), 1)
74
- ], 64))
78
+ ], true)
75
79
  ], true)
76
80
  ]),
77
81
  default: vue.withCtx(() => [
@@ -100,7 +104,7 @@ const _export_sfc = (sfc, props) => {
100
104
  }
101
105
  return target;
102
106
  };
103
- const index$2 = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-75d8db87"]]);
107
+ const index$2 = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-06bb89ce"]]);
104
108
  const qdCardProps = {
105
109
  bordered: false
106
110
  };
@@ -12762,8 +12766,8 @@ const QdConfigProvider = vue.defineComponent({
12762
12766
  vue.watchEffect(async () => {
12763
12767
  const localeMap = {
12764
12768
  "zh-CN": () => Promise.resolve().then(() => zhCN$1),
12765
- "zh-TW": () => Promise.resolve().then(() => require("./zh-TW-w8O0TRDq.js")),
12766
- "en-US": () => Promise.resolve().then(() => require("./en-US-Bb6i2MkM.js"))
12769
+ "zh-TW": () => Promise.resolve().then(() => require("./zh-TW-BaUou-85.js")),
12770
+ "en-US": () => Promise.resolve().then(() => require("./en-US-CPayU4wS.js"))
12767
12771
  };
12768
12772
  const loadLocale = localeMap[props.locale] || localeMap["zh-CN"];
12769
12773
  const [err, res] = await to(
@@ -13969,8 +13973,10 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
13969
13973
  config: {},
13970
13974
  context: {}
13971
13975
  },
13972
- setup(__props, { expose: __expose }) {
13976
+ emits: ["vIfChange"],
13977
+ setup(__props, { emit: __emit }) {
13973
13978
  const props = __props;
13979
+ const emit = __emit;
13974
13980
  const currentContext = vue.computed(() => props.config.context || props.context || {});
13975
13981
  const vIfValue = vue.computed(() => {
13976
13982
  const vIf = props.config.vIf;
@@ -14063,8 +14069,10 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
14063
14069
  });
14064
14070
  return componentProps2;
14065
14071
  });
14066
- const expose = { vIf: shouldRender };
14067
- __expose(expose);
14072
+ vue.watch(shouldRender, (newV, oldV) => {
14073
+ if (newV === oldV) return;
14074
+ emit("vIfChange", newV);
14075
+ }, { immediate: true });
14068
14076
  return (_ctx, _cache) => {
14069
14077
  return shouldRender.value ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(resolvedComponent.value), vue.normalizeProps(vue.mergeProps({ key: 0 }, componentProps.value)), vue.createSlots({ _: 2 }, [
14070
14078
  vue.renderList(__props.config.slots, (slotConfig, slotName) => {
@@ -18166,6 +18174,10 @@ const _hoisted_1$3 = {
18166
18174
  const _hoisted_2$2 = {
18167
18175
  class: "qd-crud-table__toolbar"
18168
18176
  };
18177
+ const _hoisted_3$1 = {
18178
+ key: 0,
18179
+ class: "qd-crud-table__toolbar-separator"
18180
+ };
18169
18181
  const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
18170
18182
  ...{
18171
18183
  name: "QdCrudTable"
@@ -18475,6 +18487,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
18475
18487
  expose: __expose,
18476
18488
  emit: __emit
18477
18489
  }) {
18490
+ const vHasPermi = hasPermiDirective;
18478
18491
  const props = __props;
18479
18492
  const emit = __emit;
18480
18493
  const {
@@ -18502,6 +18515,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
18502
18515
  } = useModal();
18503
18516
  const treeIsExpand = vue.computed(() => !!expandedTreeNodes.value?.length);
18504
18517
  const dialogFormMap = vue.reactive({});
18518
+ const rowActionsVIfMap = vue.reactive({});
18505
18519
  const reProps = vue.computed(() => {
18506
18520
  const {
18507
18521
  data: data2,
@@ -18921,10 +18935,40 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
18921
18935
  }
18922
18936
  return res;
18923
18937
  }
18924
- function setActionVIf(el, action) {
18925
- if (!el) return;
18926
- const crVIf = el.vIf;
18927
- action._vIf = crVIf && hasPermiOr(action.permi);
18938
+ function setActionVIf(rendererVIf, action, cellIndex) {
18939
+ const vIf = rendererVIf && hasPermiOr(action.permi, false);
18940
+ if (!cellIndex) {
18941
+ action._vIf = vIf;
18942
+ return;
18943
+ }
18944
+ const {
18945
+ colIndex,
18946
+ rowIndex,
18947
+ index: index2
18948
+ } = cellIndex;
18949
+ rowActionsVIfMap[`${colIndex}.${rowIndex}.${index2}`] = vIf;
18950
+ }
18951
+ function getActionSeparator(action, cellIndex) {
18952
+ const {
18953
+ index: index2,
18954
+ colIndex,
18955
+ rowIndex
18956
+ } = cellIndex;
18957
+ if (index2 <= 0) return false;
18958
+ if (isEmpty(colIndex) && isEmpty(rowIndex)) {
18959
+ if (action._vIf === false) return false;
18960
+ for (let i = index2 - 1; i >= 0; i--) {
18961
+ const previousAction = reProps.value.actions[i];
18962
+ if (previousAction._vIf !== false) return true;
18963
+ }
18964
+ return false;
18965
+ }
18966
+ if (rowActionsVIfMap[`${colIndex}.${rowIndex}.${index2}`] === false) return false;
18967
+ for (let i = index2 - 1; i >= 0; i--) {
18968
+ const previousVIf = rowActionsVIfMap[`${colIndex}.${rowIndex}.${i}`];
18969
+ if (previousVIf !== false) return true;
18970
+ }
18971
+ return false;
18928
18972
  }
18929
18973
  const expose = {};
18930
18974
  vue.onMounted(() => {
@@ -18971,13 +19015,14 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
18971
19015
  }, {
18972
19016
  default: vue.withCtx(() => [vue.createElementVNode("div", _hoisted_2$2, [vue.createVNode(vue.unref(tdesignVueNext.Space), {
18973
19017
  align: "center",
18974
- size: "small"
19018
+ size: 0
18975
19019
  }, {
18976
19020
  default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "actions", {}, () => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(reProps.value.actions, (item, index2) => {
18977
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [item._vIf !== false ? (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$i), {
18978
- key: item.uid || index2,
18979
- ref_for: true,
18980
- ref: (el) => setActionVIf(el, item),
19021
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
19022
+ key: item.uid || index2
19023
+ }, [getActionSeparator(item, {
19024
+ index: index2
19025
+ }) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$1)) : vue.createCommentVNode("", true), vue.withDirectives(vue.createVNode(vue.unref(_sfc_main$i), {
18981
19026
  context: getConfigRendererCtx(item),
18982
19027
  config: {
18983
19028
  is: vue.unref(tdesignVueNext.Button),
@@ -18985,9 +19030,10 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
18985
19030
  form: void 0,
18986
19031
  onClick: buildActionOnClick(item),
18987
19032
  disabled: buildActionDisabled(item)
18988
- }
18989
- }, null, 8, ["context", "config"])) : vue.createCommentVNode("", true)], 64);
18990
- }), 256))], true)]),
19033
+ },
19034
+ onVIfChange: (vIf) => setActionVIf(vIf, item)
19035
+ }, null, 8, ["context", "config", "onVIfChange"]), [[vue.unref(vHasPermi), item.permi]])], 64);
19036
+ }), 128))], true)]),
18991
19037
  _: 3
18992
19038
  }), vue.createVNode(vue.unref(tdesignVueNext.Space), {
18993
19039
  align: "center",
@@ -19078,22 +19124,30 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
19078
19124
  onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => {
19079
19125
  }, ["stop"]))
19080
19126
  }, {
19081
- separator: vue.withCtx(() => [vue.createVNode(vue.unref(tdesignVueNext.Divider), {
19082
- layout: "vertical"
19083
- })]),
19084
19127
  default: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(reProps.value.rowActions, (item, index2) => {
19085
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [item._vIf !== false ? (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$i), {
19086
- key: item.uid || index2,
19087
- ref_for: true,
19088
- ref: (el) => setActionVIf(el, item),
19128
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
19129
+ key: item.uid || index2
19130
+ }, [getActionSeparator(item, {
19131
+ colIndex: slotProps.colIndex,
19132
+ rowIndex: slotProps.rowIndex,
19133
+ index: index2
19134
+ }) ? (vue.openBlock(), vue.createBlock(vue.unref(tdesignVueNext.Divider), {
19135
+ key: 0,
19136
+ layout: "vertical"
19137
+ })) : vue.createCommentVNode("", true), vue.withDirectives(vue.createVNode(vue.unref(_sfc_main$i), {
19089
19138
  context: getConfigRendererCtx(item, slotProps),
19090
19139
  config: {
19091
19140
  is: vue.unref(tdesignVueNext.Link),
19092
19141
  ...item,
19093
19142
  onClick: buildActionOnClick(item, slotProps)
19094
- }
19095
- }, null, 8, ["context", "config"])) : vue.createCommentVNode("", true)], 64);
19096
- }), 256))]),
19143
+ },
19144
+ onVIfChange: (vIf) => setActionVIf(vIf, item, {
19145
+ colIndex: slotProps.colIndex,
19146
+ rowIndex: slotProps.rowIndex,
19147
+ index: index2
19148
+ })
19149
+ }, null, 8, ["context", "config", "onVIfChange"]), [[vue.unref(vHasPermi), item.permi]])], 64);
19150
+ }), 128))]),
19097
19151
  _: 2
19098
19152
  }, 1024)) : vue.createCommentVNode("", true)], true)]),
19099
19153
  _: 2
@@ -19120,7 +19174,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
19120
19174
  };
19121
19175
  }
19122
19176
  });
19123
- const table = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-c40b7121"]]);
19177
+ const table = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-6b2f8b58"]]);
19124
19178
  const _hoisted_1$2 = {
19125
19179
  key: 0,
19126
19180
  class: "qd-crud-list__header"
@@ -28319,7 +28373,7 @@ class NodeFilterFactory extends BaseFilterFactory {
28319
28373
  }
28320
28374
  class NodeCanvasFactory extends BaseCanvasFactory {
28321
28375
  _createCanvas(width, height) {
28322
- const require$1 = process.getBuiltinModule("module").createRequire(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("index-BgWliOe9.js", document.baseURI).href);
28376
+ const require$1 = process.getBuiltinModule("module").createRequire(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("index-CvEL8STK.js", document.baseURI).href);
28323
28377
  const canvas = require$1("@napi-rs/canvas");
28324
28378
  return canvas.createCanvas(width, height);
28325
28379
  }
@@ -55403,4 +55457,4 @@ exports.useDictDynamic = useDictDynamic;
55403
55457
  exports.useDisabled = useDisabled;
55404
55458
  exports.useModal = useModal;
55405
55459
  exports.useReadonly = useReadonly;
55406
- //# sourceMappingURL=index-BgWliOe9.js.map
55460
+ //# sourceMappingURL=index-CvEL8STK.js.map