@opentinyvue/vue-cascader-node 3.24.0 → 3.26.0

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.
@@ -1,7 +1,7 @@
1
1
  import { renderless, api } from '@opentinyvue/vue-renderless/cascader-node/vue';
2
2
  import { defineComponent, $prefix, setup, $props } from '@opentinyvue/vue-common';
3
3
  import { IconLoading, IconChevronRight } from '@opentinyvue/vue-icon';
4
- import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createBlock, withCtx, createTextVNode, createCommentVNode } from 'vue';
4
+ import { resolveComponent, openBlock, createElementBlock, normalizeClass, toDisplayString, createVNode, createBlock, withCtx, createTextVNode, createCommentVNode } from 'vue';
5
5
 
6
6
  function _createForOfIteratorHelperLoose(r, e) {
7
7
  var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
@@ -63,7 +63,16 @@ var _sfc_main = defineComponent({
63
63
  name: $prefix + "CascaderNode",
64
64
  components: {
65
65
  IconLoading: IconLoading(),
66
- IconChevronRight: IconChevronRight()
66
+ IconChevronRight: IconChevronRight(),
67
+ RenderNodeLabel: {
68
+ name: "AnyNode",
69
+ functional: true,
70
+ props: ["vnode"],
71
+ render: function render(h, ctx) {
72
+ var _ctx$props;
73
+ return h.vnode || ((_ctx$props = ctx.props) == null ? void 0 : _ctx$props.vnode);
74
+ }
75
+ }
67
76
  },
68
77
  inheritAttrs: false,
69
78
  emits: ["expand", "update:modelValue", "expand-change", "active-item-change", "change"],
@@ -86,6 +95,7 @@ var _sfc_main = defineComponent({
86
95
  });
87
96
  var _hoisted_1 = ["id"];
88
97
  function _sfc_render(_ctx, _cache, $props2, $setup, $data, $options) {
98
+ var _component_render_node_label = resolveComponent("render-node-label");
89
99
  var _component_icon_loading = resolveComponent("icon-loading");
90
100
  var _component_icon_chevron_right = resolveComponent("icon-chevron-right");
91
101
  return openBlock(), createElementBlock("div", {
@@ -96,19 +106,31 @@ function _sfc_render(_ctx, _cache, $props2, $setup, $data, $options) {
96
106
  return _ctx.handleNodeClick && _ctx.handleNodeClick.apply(_ctx, arguments);
97
107
  }),
98
108
  class: normalizeClass(_ctx.m(_ctx.gcls("cascader-node"), _ctx.gcls(!_ctx.state.isDisabled && _ctx.state.config.checkStrictly ? "is-selectable" : ""), _ctx.gcls(!_ctx.state.isDisabled && _ctx.state.inActivePath ? "in-active-path" : ""), _ctx.gcls(!_ctx.state.isDisabled && _ctx.state.inCheckedPath ? "in-checked-path" : ""), _ctx.gcls(!_ctx.state.isDisabled && _ctx.state.isChecked ? "in-active" : ""), _ctx.gcls(_ctx.state.isDisabled ? "cascader-node_disabled" : ""), _ctx.gcls(_ctx.state.isDisabled ? "in-active_disabled" : "")))
99
- }, [createElementVNode(
109
+ }, [typeof _ctx.state.nodeLabel === "string" ? (openBlock(), createElementBlock(
100
110
  "span",
101
111
  {
112
+ key: 0,
102
113
  class: normalizeClass([_ctx.node ? _ctx.gcls("cascader-node__label_disabled") : ""])
103
114
  },
104
115
  toDisplayString(_ctx.state.nodeLabel),
105
116
  3
106
117
  /* TEXT, CLASS */
107
- ), _ctx.node.loading ? (openBlock(), createBlock(_component_icon_loading, {
108
- key: 0,
118
+ )) : (openBlock(), createElementBlock(
119
+ "span",
120
+ {
121
+ key: 1,
122
+ class: normalizeClass([_ctx.node ? _ctx.gcls("cascader-node__label_disabled") : ""])
123
+ },
124
+ [createVNode(_component_render_node_label, {
125
+ vnode: _ctx.state.nodeLabel
126
+ }, null, 8, ["vnode"])],
127
+ 2
128
+ /* CLASS */
129
+ )), _ctx.node.loading ? (openBlock(), createBlock(_component_icon_loading, {
130
+ key: 2,
109
131
  class: normalizeClass(_ctx.gcls("cascader-node__postfix"))
110
132
  }, null, 8, ["class"])) : !_ctx.state.isLeaf ? (openBlock(), createBlock(_component_icon_chevron_right, {
111
- key: 1,
133
+ key: 3,
112
134
  class: normalizeClass(_ctx.m(_ctx.gcls("cascader-node__postfix"), _ctx.gcls(!_ctx.state.isDisabled && _ctx.state.inActivePath ? "node-active" : ""), _ctx.gcls(!_ctx.state.isDisabled && _ctx.state.inCheckedPath ? "node-active" : ""), _ctx.gcls(!_ctx.state.isDisabled && _ctx.state.isChecked ? "node-active" : "")))
113
135
  }, {
114
136
  default: withCtx(function() {
package/lib/pc.js CHANGED
@@ -7,16 +7,20 @@ function _extends() {
7
7
  return n;
8
8
  }, _extends.apply(null, arguments);
9
9
  }
10
- import { createVNode, resolveComponent } from "vue";
10
+ import { createVNode, withDirectives, resolveDirective, resolveComponent } from "vue";
11
11
  import { api, renderless } from "@opentinyvue/vue-renderless/cascader-node/vue";
12
12
  import { defineComponent, $props, h, setup as _setup, $prefix } from "@opentinyvue/vue-common";
13
13
  import Checkbox from "@opentinyvue/vue-checkbox";
14
14
  import Radio from "@opentinyvue/vue-radio";
15
15
  import { isEqual } from "@opentinyvue/utils";
16
16
  import { iconChevronRight, iconLoadingShadow, iconYes } from "@opentinyvue/vue-icon";
17
+ import { AutoTip } from "@opentinyvue/vue-directive";
17
18
  import "@opentinyvue/vue-theme/cascader-node/index.css";
18
19
  var _sfc_main = /* @__PURE__ */ defineComponent({
19
20
  name: $prefix + "CascaderNode",
21
+ directives: {
22
+ AutoTip
23
+ },
20
24
  components: {
21
25
  TinyCheckbox: Checkbox,
22
26
  TinyRadio: Radio,
@@ -120,9 +124,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
120
124
  node,
121
125
  data: node.data
122
126
  }) : null;
123
- return createVNode("span", {
127
+ return withDirectives(createVNode("span", {
124
128
  "class": "tiny-cascader-node__label"
125
- }, [vnode || node.label]);
129
+ }, [vnode || node.label]), [[resolveDirective("auto-tip")]]);
126
130
  };
127
131
  var state = this.state;
128
132
  var _state$config = state.config, checkStrictly = _state$config.checkStrictly, expandTrigger = _state$config.expandTrigger, multiple = _state$config.multiple;
package/package.json CHANGED
@@ -1,20 +1,21 @@
1
1
  {
2
2
  "name": "@opentinyvue/vue-cascader-node",
3
3
  "type": "module",
4
- "version": "3.24.0",
4
+ "version": "3.26.0",
5
5
  "description": "",
6
6
  "license": "MIT",
7
7
  "sideEffects": false,
8
8
  "main": "./lib/index.js",
9
9
  "module": "./lib/index.js",
10
10
  "dependencies": {
11
- "@opentinyvue/utils": "~3.24.0",
12
- "@opentinyvue/vue-checkbox": "~3.24.0",
13
- "@opentinyvue/vue-common": "~3.24.0",
14
- "@opentinyvue/vue-icon": "~3.24.0",
15
- "@opentinyvue/vue-radio": "~3.24.0",
16
- "@opentinyvue/vue-renderless": "~3.24.0",
17
- "@opentinyvue/vue-theme": "~3.24.0"
11
+ "@opentinyvue/vue-directive": "~3.26.0",
12
+ "@opentinyvue/utils": "~3.26.0",
13
+ "@opentinyvue/vue-checkbox": "~3.26.0",
14
+ "@opentinyvue/vue-common": "~3.26.0",
15
+ "@opentinyvue/vue-icon": "~3.26.0",
16
+ "@opentinyvue/vue-radio": "~3.26.0",
17
+ "@opentinyvue/vue-renderless": "~3.26.0",
18
+ "@opentinyvue/vue-theme": "~3.26.0"
18
19
  },
19
20
  "types": "index.d.ts",
20
21
  "scripts": {