qidian-vue-ui 1.1.0 → 1.1.1

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.
@@ -12762,8 +12762,8 @@ const QdConfigProvider = vue.defineComponent({
12762
12762
  vue.watchEffect(async () => {
12763
12763
  const localeMap = {
12764
12764
  "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"))
12765
+ "zh-TW": () => Promise.resolve().then(() => require("./zh-TW-Cl433j3a.js")),
12766
+ "en-US": () => Promise.resolve().then(() => require("./en-US-DLi0cBJj.js"))
12767
12767
  };
12768
12768
  const loadLocale = localeMap[props.locale] || localeMap["zh-CN"];
12769
12769
  const [err, res] = await to(
@@ -13969,8 +13969,10 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
13969
13969
  config: {},
13970
13970
  context: {}
13971
13971
  },
13972
- setup(__props, { expose: __expose }) {
13972
+ emits: ["vIfChange"],
13973
+ setup(__props, { emit: __emit }) {
13973
13974
  const props = __props;
13975
+ const emit = __emit;
13974
13976
  const currentContext = vue.computed(() => props.config.context || props.context || {});
13975
13977
  const vIfValue = vue.computed(() => {
13976
13978
  const vIf = props.config.vIf;
@@ -14063,8 +14065,10 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
14063
14065
  });
14064
14066
  return componentProps2;
14065
14067
  });
14066
- const expose = { vIf: shouldRender };
14067
- __expose(expose);
14068
+ vue.watch(shouldRender, (newV, oldV) => {
14069
+ if (newV === oldV) return;
14070
+ emit("vIfChange", newV);
14071
+ }, { immediate: true });
14068
14072
  return (_ctx, _cache) => {
14069
14073
  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
14074
  vue.renderList(__props.config.slots, (slotConfig, slotName) => {
@@ -18166,6 +18170,10 @@ const _hoisted_1$3 = {
18166
18170
  const _hoisted_2$2 = {
18167
18171
  class: "qd-crud-table__toolbar"
18168
18172
  };
18173
+ const _hoisted_3$1 = {
18174
+ key: 0,
18175
+ class: "qd-crud-table__toolbar-separator"
18176
+ };
18169
18177
  const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
18170
18178
  ...{
18171
18179
  name: "QdCrudTable"
@@ -18475,6 +18483,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
18475
18483
  expose: __expose,
18476
18484
  emit: __emit
18477
18485
  }) {
18486
+ const vHasPermi = hasPermiDirective;
18478
18487
  const props = __props;
18479
18488
  const emit = __emit;
18480
18489
  const {
@@ -18502,6 +18511,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
18502
18511
  } = useModal();
18503
18512
  const treeIsExpand = vue.computed(() => !!expandedTreeNodes.value?.length);
18504
18513
  const dialogFormMap = vue.reactive({});
18514
+ const rowActionsVIfMap = vue.reactive({});
18505
18515
  const reProps = vue.computed(() => {
18506
18516
  const {
18507
18517
  data: data2,
@@ -18921,10 +18931,40 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
18921
18931
  }
18922
18932
  return res;
18923
18933
  }
18924
- function setActionVIf(el, action) {
18925
- if (!el) return;
18926
- const crVIf = el.vIf;
18927
- action._vIf = crVIf && hasPermiOr(action.permi);
18934
+ function setActionVIf(rendererVIf, action, cellIndex) {
18935
+ const vIf = rendererVIf && hasPermiOr(action.permi, false);
18936
+ if (!cellIndex) {
18937
+ action._vIf = vIf;
18938
+ return;
18939
+ }
18940
+ const {
18941
+ colIndex,
18942
+ rowIndex,
18943
+ index: index2
18944
+ } = cellIndex;
18945
+ rowActionsVIfMap[`${colIndex}.${rowIndex}.${index2}`] = vIf;
18946
+ }
18947
+ function getActionSeparator(action, cellIndex) {
18948
+ const {
18949
+ index: index2,
18950
+ colIndex,
18951
+ rowIndex
18952
+ } = cellIndex;
18953
+ if (index2 <= 0) return false;
18954
+ if (isEmpty(colIndex) && isEmpty(rowIndex)) {
18955
+ if (action._vIf === false) return false;
18956
+ for (let i = index2 - 1; i >= 0; i--) {
18957
+ const previousAction = reProps.value.actions[i];
18958
+ if (previousAction._vIf !== false) return true;
18959
+ }
18960
+ return false;
18961
+ }
18962
+ if (rowActionsVIfMap[`${colIndex}.${rowIndex}.${index2}`] === false) return false;
18963
+ for (let i = index2 - 1; i >= 0; i--) {
18964
+ const previousVIf = rowActionsVIfMap[`${colIndex}.${rowIndex}.${i}`];
18965
+ if (previousVIf !== false) return true;
18966
+ }
18967
+ return false;
18928
18968
  }
18929
18969
  const expose = {};
18930
18970
  vue.onMounted(() => {
@@ -18971,13 +19011,14 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
18971
19011
  }, {
18972
19012
  default: vue.withCtx(() => [vue.createElementVNode("div", _hoisted_2$2, [vue.createVNode(vue.unref(tdesignVueNext.Space), {
18973
19013
  align: "center",
18974
- size: "small"
19014
+ size: 0
18975
19015
  }, {
18976
19016
  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),
19017
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
19018
+ key: item.uid || index2
19019
+ }, [getActionSeparator(item, {
19020
+ index: index2
19021
+ }) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$1)) : vue.createCommentVNode("", true), vue.withDirectives(vue.createVNode(vue.unref(_sfc_main$i), {
18981
19022
  context: getConfigRendererCtx(item),
18982
19023
  config: {
18983
19024
  is: vue.unref(tdesignVueNext.Button),
@@ -18985,9 +19026,10 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
18985
19026
  form: void 0,
18986
19027
  onClick: buildActionOnClick(item),
18987
19028
  disabled: buildActionDisabled(item)
18988
- }
18989
- }, null, 8, ["context", "config"])) : vue.createCommentVNode("", true)], 64);
18990
- }), 256))], true)]),
19029
+ },
19030
+ onVIfChange: (vIf) => setActionVIf(vIf, item)
19031
+ }, null, 8, ["context", "config", "onVIfChange"]), [[vue.unref(vHasPermi), item.permi]])], 64);
19032
+ }), 128))], true)]),
18991
19033
  _: 3
18992
19034
  }), vue.createVNode(vue.unref(tdesignVueNext.Space), {
18993
19035
  align: "center",
@@ -19078,22 +19120,30 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
19078
19120
  onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => {
19079
19121
  }, ["stop"]))
19080
19122
  }, {
19081
- separator: vue.withCtx(() => [vue.createVNode(vue.unref(tdesignVueNext.Divider), {
19082
- layout: "vertical"
19083
- })]),
19084
19123
  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),
19124
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
19125
+ key: item.uid || index2
19126
+ }, [getActionSeparator(item, {
19127
+ colIndex: slotProps.colIndex,
19128
+ rowIndex: slotProps.rowIndex,
19129
+ index: index2
19130
+ }) ? (vue.openBlock(), vue.createBlock(vue.unref(tdesignVueNext.Divider), {
19131
+ key: 0,
19132
+ layout: "vertical"
19133
+ })) : vue.createCommentVNode("", true), vue.withDirectives(vue.createVNode(vue.unref(_sfc_main$i), {
19089
19134
  context: getConfigRendererCtx(item, slotProps),
19090
19135
  config: {
19091
19136
  is: vue.unref(tdesignVueNext.Link),
19092
19137
  ...item,
19093
19138
  onClick: buildActionOnClick(item, slotProps)
19094
- }
19095
- }, null, 8, ["context", "config"])) : vue.createCommentVNode("", true)], 64);
19096
- }), 256))]),
19139
+ },
19140
+ onVIfChange: (vIf) => setActionVIf(vIf, item, {
19141
+ colIndex: slotProps.colIndex,
19142
+ rowIndex: slotProps.rowIndex,
19143
+ index: index2
19144
+ })
19145
+ }, null, 8, ["context", "config", "onVIfChange"]), [[vue.unref(vHasPermi), item.permi]])], 64);
19146
+ }), 128))]),
19097
19147
  _: 2
19098
19148
  }, 1024)) : vue.createCommentVNode("", true)], true)]),
19099
19149
  _: 2
@@ -19120,7 +19170,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
19120
19170
  };
19121
19171
  }
19122
19172
  });
19123
- const table = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-c40b7121"]]);
19173
+ const table = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-5082b588"]]);
19124
19174
  const _hoisted_1$2 = {
19125
19175
  key: 0,
19126
19176
  class: "qd-crud-list__header"
@@ -28319,7 +28369,7 @@ class NodeFilterFactory extends BaseFilterFactory {
28319
28369
  }
28320
28370
  class NodeCanvasFactory extends BaseCanvasFactory {
28321
28371
  _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);
28372
+ 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-BCeJc-jC.js", document.baseURI).href);
28323
28373
  const canvas = require$1("@napi-rs/canvas");
28324
28374
  return canvas.createCanvas(width, height);
28325
28375
  }
@@ -55403,4 +55453,4 @@ exports.useDictDynamic = useDictDynamic;
55403
55453
  exports.useDisabled = useDisabled;
55404
55454
  exports.useModal = useModal;
55405
55455
  exports.useReadonly = useReadonly;
55406
- //# sourceMappingURL=index-BgWliOe9.js.map
55456
+ //# sourceMappingURL=index-BCeJc-jC.js.map