@opentinyvue/vue-collapse-item 2.22.0 → 3.22.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.
package/lib/index.js CHANGED
@@ -58,7 +58,7 @@ var CollapseItem = defineComponent({
58
58
  });
59
59
  }
60
60
  });
61
- var version = "2.22.0";
61
+ var version = "3.22.0";
62
62
  CollapseItem.install = function(Vue) {
63
63
  Vue.component(CollapseItem.name, CollapseItem);
64
64
  };
@@ -2,38 +2,42 @@ import { renderless, api } from '@opentinyvue/vue-renderless/collapse-item/vue';
2
2
  import { defineComponent, props, setup } from '@opentinyvue/vue-common';
3
3
  import CollapseTransition from '@opentinyvue/vue-collapse-transition';
4
4
  import { IconArrowBottom } from '@opentinyvue/vue-icon';
5
+ import { resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, withKeys, withModifiers, renderSlot, createTextVNode, toDisplayString, createVNode, withCtx, withDirectives, vShow } from 'vue';
5
6
 
6
- function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
7
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
8
- if (render) {
9
- options.render = render;
10
- options.staticRenderFns = staticRenderFns;
11
- options._compiled = true;
7
+ function _createForOfIteratorHelperLoose(r, e) {
8
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
9
+ if (t) return (t = t.call(r)).next.bind(t);
10
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
11
+ t && (r = t);
12
+ var o = 0;
13
+ return function() {
14
+ return o >= r.length ? { done: true } : { done: false, value: r[o++] };
15
+ };
12
16
  }
13
- var hook;
14
- if (injectStyles) {
15
- hook = injectStyles;
16
- }
17
- if (hook) {
18
- if (options.functional) {
19
- options._injectStyles = hook;
20
- var originalRender = options.render;
21
- options.render = function renderWithStyleInjection(h, context) {
22
- hook.call(context);
23
- return originalRender(h, context);
24
- };
25
- } else {
26
- var existing = options.beforeCreate;
27
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
28
- }
17
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
18
+ }
19
+ function _unsupportedIterableToArray(r, a) {
20
+ if (r) {
21
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
22
+ var t = {}.toString.call(r).slice(8, -1);
23
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
29
24
  }
30
- return {
31
- exports: scriptExports,
32
- options
33
- };
34
25
  }
26
+ function _arrayLikeToArray(r, a) {
27
+ (null == a || a > r.length) && (a = r.length);
28
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
29
+ return n;
30
+ }
31
+ var _export_sfc = function _export_sfc2(sfc, props) {
32
+ var target = sfc.__vccOpts || sfc;
33
+ for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
34
+ var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
35
+ target[key] = val;
36
+ }
37
+ return target;
38
+ };
35
39
 
36
- var __vue2_script = defineComponent({
40
+ var _sfc_main = defineComponent({
37
41
  props: [].concat(props, ["title", "titleRight", "name", "disabled"]),
38
42
  components: {
39
43
  CollapseTransition,
@@ -48,109 +52,103 @@ var __vue2_script = defineComponent({
48
52
  });
49
53
  }
50
54
  });
51
- var render = function render2() {
52
- var _vm = this;
53
- var _h = _vm.$createElement;
54
- var _c = _vm._self._c || _h;
55
- return _c("div", {
56
- staticClass: "border-b-0.5 sm:border-b border-solid border-color-border-separator last:border-0",
57
- attrs: {
58
- "data-tag": "tiny-collapse-item"
59
- }
60
- }, [_c("div", {
61
- attrs: {
62
- "role": "tab",
63
- "data-tag": "tiny-collapse-item-tab",
64
- "aria-expanded": _vm.state.isActive,
65
- "aria-controls": "tiny-collapse-content-" + _vm.state.id,
66
- "aria-describedby": "tiny-collapse-content-" + _vm.state.id
67
- }
68
- }, [_c("div", {
69
- staticClass: "flex relative items-center h-12 sm:h-10 py-0 sm:pr-0 pl-4 pr-10 text-sm font-bold justify-between whitespace-nowrap",
70
- class: _vm.disabled ? "text-color-text-disabled" : "text-color-text-primary sm:[&:has(.peer:hover)_[role=title]]:text-color-brand",
71
- attrs: {
72
- "data-tag": "tiny-collapse-item-body",
73
- "id": "tiny-collapse-head-" + _vm.state.id,
74
- "tabindex": _vm.disabled ? void 0 : 0
75
- },
76
- on: {
77
- "keyup": function keyup($event) {
78
- if (!$event.type.indexOf("key") && _vm._k($event.keyCode, "space", 32, $event.key, [" ", "Spacebar"]) && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) return null;
79
- $event.stopPropagation();
80
- return _vm.handleEnterClick.apply(null, arguments);
81
- },
82
- "focus": _vm.handleFocus,
83
- "blur": function blur($event) {
84
- _vm.state.focusing = false;
85
- }
86
- }
87
- }, [_c("div", {
88
- staticClass: "whitespace-nowrap overflow-hidden overflow-ellipsis inline-block peer",
89
- class: [_vm.disabled ? "cursor-not-allowed" : "cursor-pointer sm:hover:text-color-brand"],
90
- attrs: {
55
+ var _hoisted_1 = {
56
+ "data-tag": "tiny-collapse-item",
57
+ class: "border-b-0.5 sm:border-b border-solid border-color-border-separator last:border-0"
58
+ };
59
+ var _hoisted_2 = ["aria-expanded", "aria-controls", "aria-describedby"];
60
+ var _hoisted_3 = ["id", "tabindex"];
61
+ var _hoisted_4 = {
62
+ "data-tag": "tiny-collapse-item-titleright",
63
+ class: "text-xs font-normal"
64
+ };
65
+ var _hoisted_5 = ["aria-hidden", "aria-labelledby", "id"];
66
+ var _hoisted_6 = {
67
+ class: "pb-6 pt-0 px-4 sm:pt-0 sm:pr-0 sm:pl-4 sm:pb-4 text-xs text-color-text-primary leading-relaxed"
68
+ };
69
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
70
+ var _component_icon_arrow_bottom = resolveComponent("icon-arrow-bottom");
71
+ var _component_collapse_transition = resolveComponent("collapse-transition");
72
+ return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", {
73
+ role: "tab",
74
+ "data-tag": "tiny-collapse-item-tab",
75
+ "aria-expanded": _ctx.state.isActive,
76
+ "aria-controls": "tiny-collapse-content-" + _ctx.state.id,
77
+ "aria-describedby": "tiny-collapse-content-" + _ctx.state.id
78
+ }, [createElementVNode("div", {
79
+ "data-tag": "tiny-collapse-item-body",
80
+ class: normalizeClass(["flex relative items-center h-12 sm:h-10 py-0 sm:pr-0 pl-4 pr-10 text-sm font-bold justify-between whitespace-nowrap", _ctx.disabled ? "text-color-text-disabled" : "text-color-text-primary sm:[&:has(.peer:hover)_[role=title]]:text-color-brand"]),
81
+ id: "tiny-collapse-head-" + _ctx.state.id,
82
+ tabindex: _ctx.disabled ? void 0 : 0,
83
+ onKeyup: _cache[2] || (_cache[2] = withKeys(withModifiers(function() {
84
+ return _ctx.handleEnterClick && _ctx.handleEnterClick.apply(_ctx, arguments);
85
+ }, ["stop"]), ["space", "enter"])),
86
+ onFocus: _cache[3] || (_cache[3] = function() {
87
+ return _ctx.handleFocus && _ctx.handleFocus.apply(_ctx, arguments);
88
+ }),
89
+ onBlur: _cache[4] || (_cache[4] = function($event) {
90
+ return _ctx.state.focusing = false;
91
+ })
92
+ }, [createElementVNode(
93
+ "div",
94
+ {
91
95
  "data-tag": "tiny-collapse-item-title",
92
- "role": "title"
96
+ class: normalizeClass(["whitespace-nowrap overflow-hidden overflow-ellipsis inline-block peer", [_ctx.disabled ? "cursor-not-allowed" : "cursor-pointer sm:hover:text-color-brand"]]),
97
+ role: "title",
98
+ onClick: _cache[0] || (_cache[0] = function() {
99
+ return _ctx.handleHeaderClick && _ctx.handleHeaderClick.apply(_ctx, arguments);
100
+ })
93
101
  },
94
- on: {
95
- "click": _vm.handleHeaderClick
96
- }
97
- }, [_vm._t("title", function() {
98
- return [_vm._v(" " + _vm._s(_vm.title))];
99
- })], 2), _c("div", {
100
- staticClass: "text-xs font-normal",
101
- attrs: {
102
- "data-tag": "tiny-collapse-item-titleright"
103
- }
104
- }, [_vm._t("title-right", function() {
105
- return [_vm._v(_vm._s(_vm.titleRight))];
106
- })], 2), _c("div", {
107
- staticClass: "absolute sm:left-0 right-3.5 text-xs mr-1 w-3 peer",
108
- class: [_vm.disabled ? "fill-color-text-disabled cursor-not-allowed" : "fill-color-icon-secondary cursor-pointer sm:peer-hover:fill-color-brand sm:hover:fill-color-brand"],
109
- attrs: {
110
- "data-tag": "tiny-collapse-item-icon"
102
+ [renderSlot(_ctx.$slots, "title", {}, function() {
103
+ return [createTextVNode(
104
+ toDisplayString(_ctx.title),
105
+ 1
106
+ /* TEXT */
107
+ )];
108
+ })],
109
+ 2
110
+ /* CLASS */
111
+ ), createElementVNode("div", _hoisted_4, [renderSlot(_ctx.$slots, "title-right", {}, function() {
112
+ return [createTextVNode(
113
+ toDisplayString(_ctx.titleRight),
114
+ 1
115
+ /* TEXT */
116
+ )];
117
+ })]), createElementVNode(
118
+ "div",
119
+ {
120
+ "data-tag": "tiny-collapse-item-icon",
121
+ class: normalizeClass(["absolute sm:left-0 right-3.5 text-xs mr-1 w-3 peer", [_ctx.disabled ? "fill-color-text-disabled cursor-not-allowed" : "fill-color-icon-secondary cursor-pointer sm:peer-hover:fill-color-brand sm:hover:fill-color-brand"]]),
122
+ onClick: _cache[1] || (_cache[1] = function() {
123
+ return _ctx.handleHeaderClick && _ctx.handleHeaderClick.apply(_ctx, arguments);
124
+ })
111
125
  },
112
- on: {
113
- "click": _vm.handleHeaderClick
114
- }
115
- }, [_vm._t("icon", function() {
116
- return [_c("icon-arrow-bottom", {
117
- class: [_vm.state.isActive ? "sm:rotate-0 rotate-180" : "sm:-rotate-90 rotate-0"],
118
- attrs: {
119
- "custom-class": "w-2.5 h-2.5 sm:w-3 sm:h-3 transition-transform duration-300"
120
- }
121
- })];
122
- }, {
123
- "active": _vm.state.isActive,
124
- "disabled": _vm.disabled
125
- })], 2)])]), _c("collapse-transition", [_c("div", {
126
- directives: [{
127
- name: "show",
128
- rawName: "v-show",
129
- value: _vm.state.isActive,
130
- expression: "state.isActive"
131
- }],
132
- staticClass: "will-change-[height] bg-color-bg-1 overflow-hidden box-border",
133
- attrs: {
134
- "data-tag": "tiny-collapse-item-active",
135
- "role": "tabpanel",
136
- "aria-hidden": !_vm.state.isActive,
137
- "aria-labelledby": "tiny-collapse-head-" + _vm.state.id,
138
- "id": "tiny-collapse-content-" + _vm.state.id
139
- }
140
- }, [_c("div", {
141
- staticClass: "pb-6 pt-0 px-4 sm:pt-0 sm:pr-0 sm:pl-4 sm:pb-4 text-xs text-color-text-primary leading-relaxed"
142
- }, [_vm._t("default")], 2)])])], 1);
143
- };
144
- var staticRenderFns = [];
145
- var __cssModules = {};
146
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
147
- function __vue2_injectStyles(context) {
148
- for (var o in __cssModules) {
149
- this[o] = __cssModules[o];
150
- }
126
+ [renderSlot(_ctx.$slots, "icon", {
127
+ active: _ctx.state.isActive,
128
+ disabled: _ctx.disabled
129
+ }, function() {
130
+ return [createVNode(_component_icon_arrow_bottom, {
131
+ "custom-class": "w-2.5 h-2.5 sm:w-3 sm:h-3 transition-transform duration-300",
132
+ class: normalizeClass([_ctx.state.isActive ? "sm:rotate-0 rotate-180" : "sm:-rotate-90 rotate-0"])
133
+ }, null, 8, ["class"])];
134
+ })],
135
+ 2
136
+ /* CLASS */
137
+ )], 42, _hoisted_3)], 8, _hoisted_2), createVNode(_component_collapse_transition, null, {
138
+ default: withCtx(function() {
139
+ return [withDirectives(createElementVNode("div", {
140
+ "data-tag": "tiny-collapse-item-active",
141
+ class: "will-change-[height] bg-color-bg-1 overflow-hidden box-border",
142
+ role: "tabpanel",
143
+ "aria-hidden": !_ctx.state.isActive,
144
+ "aria-labelledby": "tiny-collapse-head-" + _ctx.state.id,
145
+ id: "tiny-collapse-content-" + _ctx.state.id
146
+ }, [createElementVNode("div", _hoisted_6, [renderSlot(_ctx.$slots, "default")])], 8, _hoisted_5), [[vShow, _ctx.state.isActive]])];
147
+ }),
148
+ _: 3
149
+ /* FORWARDED */
150
+ })]);
151
151
  }
152
- var mobileFirst = /* @__PURE__ */ function() {
153
- return __component__.exports;
154
- }();
152
+ var mobileFirst = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
155
153
 
156
154
  export { mobileFirst as default };
package/lib/pc.js CHANGED
@@ -2,38 +2,42 @@ import { renderless, api } from '@opentinyvue/vue-renderless/collapse-item/vue';
2
2
  import { defineComponent, props, setup } from '@opentinyvue/vue-common';
3
3
  import CollapseTransition from '@opentinyvue/vue-collapse-transition';
4
4
  import { iconChevronRight } from '@opentinyvue/vue-icon';
5
+ import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, withKeys, withModifiers, renderSlot, createBlock, resolveDynamicComponent, createTextVNode, toDisplayString, createVNode, withCtx, withDirectives, vShow } from 'vue';
5
6
 
6
- function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
7
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
8
- if (render) {
9
- options.render = render;
10
- options.staticRenderFns = staticRenderFns;
11
- options._compiled = true;
7
+ function _createForOfIteratorHelperLoose(r, e) {
8
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
9
+ if (t) return (t = t.call(r)).next.bind(t);
10
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
11
+ t && (r = t);
12
+ var o = 0;
13
+ return function() {
14
+ return o >= r.length ? { done: true } : { done: false, value: r[o++] };
15
+ };
12
16
  }
13
- var hook;
14
- if (injectStyles) {
15
- hook = injectStyles;
16
- }
17
- if (hook) {
18
- if (options.functional) {
19
- options._injectStyles = hook;
20
- var originalRender = options.render;
21
- options.render = function renderWithStyleInjection(h, context) {
22
- hook.call(context);
23
- return originalRender(h, context);
24
- };
25
- } else {
26
- var existing = options.beforeCreate;
27
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
28
- }
17
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
18
+ }
19
+ function _unsupportedIterableToArray(r, a) {
20
+ if (r) {
21
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
22
+ var t = {}.toString.call(r).slice(8, -1);
23
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
29
24
  }
30
- return {
31
- exports: scriptExports,
32
- options
33
- };
34
25
  }
26
+ function _arrayLikeToArray(r, a) {
27
+ (null == a || a > r.length) && (a = r.length);
28
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
29
+ return n;
30
+ }
31
+ var _export_sfc = function _export_sfc2(sfc, props) {
32
+ var target = sfc.__vccOpts || sfc;
33
+ for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
34
+ var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
35
+ target[key] = val;
36
+ }
37
+ return target;
38
+ };
35
39
 
36
- var __vue2_script = defineComponent({
40
+ var _sfc_main = /* @__PURE__ */ defineComponent({
37
41
  props: [].concat(props, ["title", "titleRight", "name", "disabled", "expandIcon"]),
38
42
  components: {
39
43
  CollapseTransition,
@@ -48,107 +52,103 @@ var __vue2_script = defineComponent({
48
52
  });
49
53
  }
50
54
  });
51
- var render = function render2() {
52
- var _vm = this;
53
- var _h = _vm.$createElement;
54
- var _c = _vm._self._c || _h;
55
- return _c("div", {
56
- staticClass: "tiny-collapse-item",
57
- class: {
58
- "is-active": _vm.state.isActive,
59
- "is-disabled": _vm.disabled
60
- }
61
- }, [_c("div", {
62
- attrs: {
63
- "role": "tab",
64
- "aria-expanded": _vm.state.isActive,
65
- "aria-controls": "tiny-collapse-content-" + _vm.state.id,
66
- "aria-describedby": "tiny-collapse-content-" + _vm.state.id
67
- }
68
- }, [_c("div", {
69
- staticClass: "tiny-collapse-item__header",
70
- class: {
71
- focusing: _vm.state.focusing,
72
- "is-active": _vm.state.isActive
73
- },
74
- attrs: {
75
- "role": "button",
76
- "id": "tiny-collapse-head-" + _vm.state.id,
77
- "tabindex": _vm.disabled ? void 0 : 0
55
+ var _hoisted_1 = ["aria-expanded", "aria-controls", "aria-describedby"];
56
+ var _hoisted_2 = ["id", "tabindex"];
57
+ var _hoisted_3 = {
58
+ class: "tiny-collapse-item__title__right"
59
+ };
60
+ var _hoisted_4 = ["aria-hidden", "aria-labelledby", "id"];
61
+ var _hoisted_5 = {
62
+ class: "tiny-collapse-item__content"
63
+ };
64
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
65
+ var _component_collapse_transition = resolveComponent("collapse-transition");
66
+ return openBlock(), createElementBlock(
67
+ "div",
68
+ {
69
+ class: normalizeClass(["tiny-collapse-item", {
70
+ "is-active": _ctx.state.isActive,
71
+ "is-disabled": _ctx.disabled
72
+ }])
78
73
  },
79
- on: {
80
- "keyup": function keyup($event) {
81
- if (!$event.type.indexOf("key") && _vm._k($event.keyCode, "space", 32, $event.key, [" ", "Spacebar"]) && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) return null;
82
- $event.stopPropagation();
83
- return _vm.handleEnterClick.apply(null, arguments);
84
- },
85
- "focus": _vm.handleFocus,
86
- "blur": function blur($event) {
87
- _vm.state.focusing = false;
74
+ [createElementVNode("div", {
75
+ role: "tab",
76
+ "aria-expanded": _ctx.state.isActive,
77
+ "aria-controls": "tiny-collapse-content-" + _ctx.state.id,
78
+ "aria-describedby": "tiny-collapse-content-" + _ctx.state.id
79
+ }, [createElementVNode("div", {
80
+ class: normalizeClass(["tiny-collapse-item__header", {
81
+ focusing: _ctx.state.focusing,
82
+ "is-active": _ctx.state.isActive
83
+ }]),
84
+ role: "button",
85
+ id: "tiny-collapse-head-" + _ctx.state.id,
86
+ tabindex: _ctx.disabled ? void 0 : 0,
87
+ onKeyup: _cache[2] || (_cache[2] = withKeys(withModifiers(function() {
88
+ return _ctx.handleEnterClick && _ctx.handleEnterClick.apply(_ctx, arguments);
89
+ }, ["stop"]), ["space", "enter"])),
90
+ onFocus: _cache[3] || (_cache[3] = function() {
91
+ return _ctx.handleFocus && _ctx.handleFocus.apply(_ctx, arguments);
92
+ }),
93
+ onBlur: _cache[4] || (_cache[4] = function($event) {
94
+ return _ctx.state.focusing = false;
95
+ }),
96
+ onClick: _cache[5] || (_cache[5] = function() {
97
+ return _ctx.handleHeaderContainerClick && _ctx.handleHeaderContainerClick.apply(_ctx, arguments);
98
+ })
99
+ }, [createElementVNode(
100
+ "div",
101
+ {
102
+ class: normalizeClass(["tiny-collapse-item__arrow", {
103
+ "is-active": _ctx.state.isActive
104
+ }]),
105
+ onClick: _cache[0] || (_cache[0] = withModifiers(function() {
106
+ return _ctx.handleHeaderClick && _ctx.handleHeaderClick.apply(_ctx, arguments);
107
+ }, ["stop"]))
88
108
  },
89
- "click": _vm.handleHeaderContainerClick
90
- }
91
- }, [_c("div", {
92
- staticClass: "tiny-collapse-item__arrow",
93
- class: {
94
- "is-active": _vm.state.isActive
95
- },
96
- on: {
97
- "click": function click($event) {
98
- $event.stopPropagation();
99
- return _vm.handleHeaderClick.apply(null, arguments);
100
- }
101
- }
102
- }, [_vm._t("icon", function() {
103
- return [_c(_vm.state.arrowIcon, {
104
- tag: "component",
105
- staticClass: "tiny-collapse-item__arrow-icon tiny-svg-size",
106
- class: {
107
- "is-active": _vm.state.isActive
108
- }
109
- })];
110
- })], 2), _c("div", {
111
- staticClass: "tiny-collapse-item__word-overflow",
112
- on: {
113
- "click": function click($event) {
114
- $event.stopPropagation();
115
- return _vm.handleHeaderClick.apply(null, arguments);
116
- }
117
- }
118
- }, [_vm._t("title", function() {
119
- return [_vm._v(_vm._s(_vm.title))];
120
- })], 2), _c("div", {
121
- staticClass: "tiny-collapse-item__title__right"
122
- }, [_vm._t("title-right", function() {
123
- return [_vm._v(_vm._s(_vm.titleRight))];
124
- })], 2)]), _c("collapse-transition", [_c("div", {
125
- directives: [{
126
- name: "show",
127
- rawName: "v-show",
128
- value: _vm.state.isActive,
129
- expression: "state.isActive"
130
- }],
131
- staticClass: "tiny-collapse-item__wrap",
132
- attrs: {
133
- "role": "tabpanel",
134
- "aria-hidden": !_vm.state.isActive,
135
- "aria-labelledby": "tiny-collapse-head-" + _vm.state.id,
136
- "id": "tiny-collapse-content-" + _vm.state.id
137
- }
138
- }, [_c("div", {
139
- staticClass: "tiny-collapse-item__content"
140
- }, [_vm._t("default")], 2)])])], 1)]);
141
- };
142
- var staticRenderFns = [];
143
- var __cssModules = {};
144
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
145
- function __vue2_injectStyles(context) {
146
- for (var o in __cssModules) {
147
- this[o] = __cssModules[o];
148
- }
109
+ [renderSlot(_ctx.$slots, "icon", {}, function() {
110
+ return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.state.arrowIcon), {
111
+ class: normalizeClass(["tiny-collapse-item__arrow-icon tiny-svg-size", {
112
+ "is-active": _ctx.state.isActive
113
+ }])
114
+ }, null, 8, ["class"]))];
115
+ })],
116
+ 2
117
+ /* CLASS */
118
+ ), createElementVNode("div", {
119
+ class: "tiny-collapse-item__word-overflow",
120
+ onClick: _cache[1] || (_cache[1] = withModifiers(function() {
121
+ return _ctx.handleHeaderClick && _ctx.handleHeaderClick.apply(_ctx, arguments);
122
+ }, ["stop"]))
123
+ }, [renderSlot(_ctx.$slots, "title", {}, function() {
124
+ return [createTextVNode(
125
+ toDisplayString(_ctx.title),
126
+ 1
127
+ /* TEXT */
128
+ )];
129
+ })]), createElementVNode("div", _hoisted_3, [renderSlot(_ctx.$slots, "title-right", {}, function() {
130
+ return [createTextVNode(
131
+ toDisplayString(_ctx.titleRight),
132
+ 1
133
+ /* TEXT */
134
+ )];
135
+ })])], 42, _hoisted_2), createVNode(_component_collapse_transition, null, {
136
+ default: withCtx(function() {
137
+ return [withDirectives(createElementVNode("div", {
138
+ class: "tiny-collapse-item__wrap",
139
+ role: "tabpanel",
140
+ "aria-hidden": !_ctx.state.isActive,
141
+ "aria-labelledby": "tiny-collapse-head-" + _ctx.state.id,
142
+ id: "tiny-collapse-content-" + _ctx.state.id
143
+ }, [createElementVNode("div", _hoisted_5, [renderSlot(_ctx.$slots, "default")])], 8, _hoisted_4), [[vShow, _ctx.state.isActive]])];
144
+ }),
145
+ _: 3
146
+ /* FORWARDED */
147
+ })], 8, _hoisted_1)],
148
+ 2
149
+ /* CLASS */
150
+ );
149
151
  }
150
- var pc = /* @__PURE__ */ function() {
151
- return __component__.exports;
152
- }();
152
+ var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
153
153
 
154
154
  export { pc as default };
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@opentinyvue/vue-collapse-item",
3
- "version": "2.22.0",
3
+ "version": "3.22.0",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",
7
7
  "sideEffects": false,
8
8
  "type": "module",
9
9
  "dependencies": {
10
- "@opentinyvue/vue-common": "~2.22.0",
10
+ "@opentinyvue/vue-common": "~3.22.0",
11
11
  "@opentinyvue/vue-renderless": "~3.22.0",
12
- "@opentinyvue/vue-icon": "~2.22.0",
12
+ "@opentinyvue/vue-icon": "~3.22.0",
13
13
  "@opentinyvue/vue-theme": "~3.22.0",
14
- "@opentinyvue/vue-collapse-transition": "~2.22.0"
14
+ "@opentinyvue/vue-collapse-transition": "~3.22.0"
15
15
  },
16
16
  "license": "MIT",
17
17
  "types": "index.d.ts",
package/src/index.d.ts CHANGED
@@ -25,5 +25,58 @@ export declare const collapseItemProps: {
25
25
  tiny_theme: StringConstructor;
26
26
  tiny_chart_theme: ObjectConstructor;
27
27
  };
28
- declare const _default: any;
28
+ declare const _default: import("@vue/runtime-core").DefineComponent<{
29
+ _constants: {
30
+ type: ObjectConstructor;
31
+ default: () => {
32
+ INTERVAL: number;
33
+ };
34
+ };
35
+ title: StringConstructor;
36
+ titleRight: StringConstructor;
37
+ name: {
38
+ type: (StringConstructor | NumberConstructor)[];
39
+ default(): any;
40
+ };
41
+ expandIcon: {
42
+ type: (StringConstructor | ObjectConstructor)[];
43
+ };
44
+ disabled: BooleanConstructor;
45
+ tiny_mode: StringConstructor;
46
+ tiny_mode_root: BooleanConstructor;
47
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
48
+ tiny_renderless: FunctionConstructor;
49
+ tiny_theme: StringConstructor;
50
+ tiny_chart_theme: ObjectConstructor;
51
+ }, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
52
+ [key: string]: any;
53
+ }>, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
54
+ _constants: {
55
+ type: ObjectConstructor;
56
+ default: () => {
57
+ INTERVAL: number;
58
+ };
59
+ };
60
+ title: StringConstructor;
61
+ titleRight: StringConstructor;
62
+ name: {
63
+ type: (StringConstructor | NumberConstructor)[];
64
+ default(): any;
65
+ };
66
+ expandIcon: {
67
+ type: (StringConstructor | ObjectConstructor)[];
68
+ };
69
+ disabled: BooleanConstructor;
70
+ tiny_mode: StringConstructor;
71
+ tiny_mode_root: BooleanConstructor;
72
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
73
+ tiny_renderless: FunctionConstructor;
74
+ tiny_theme: StringConstructor;
75
+ tiny_chart_theme: ObjectConstructor;
76
+ }>>, {
77
+ name: string | number;
78
+ disabled: boolean;
79
+ tiny_mode_root: boolean;
80
+ _constants: Record<string, any>;
81
+ }, {}>;
29
82
  export default _default;
@@ -1,2 +1,38 @@
1
- declare const _default: any;
1
+ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
2
+ name?: any;
3
+ disabled?: any;
4
+ title?: any;
5
+ tiny_mode?: any;
6
+ tiny_mode_root?: any;
7
+ tiny_template?: any;
8
+ tiny_renderless?: any;
9
+ _constants?: any;
10
+ tiny_theme?: any;
11
+ tiny_chart_theme?: any;
12
+ titleRight?: any;
13
+ }>, any, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<Readonly<{
14
+ name?: any;
15
+ disabled?: any;
16
+ title?: any;
17
+ tiny_mode?: any;
18
+ tiny_mode_root?: any;
19
+ tiny_template?: any;
20
+ tiny_renderless?: any;
21
+ _constants?: any;
22
+ tiny_theme?: any;
23
+ tiny_chart_theme?: any;
24
+ titleRight?: any;
25
+ }>>>, {
26
+ readonly name?: any;
27
+ readonly disabled?: any;
28
+ readonly title?: any;
29
+ readonly tiny_mode?: any;
30
+ readonly tiny_mode_root?: any;
31
+ readonly tiny_template?: any;
32
+ readonly tiny_renderless?: any;
33
+ readonly _constants?: any;
34
+ readonly tiny_theme?: any;
35
+ readonly tiny_chart_theme?: any;
36
+ readonly titleRight?: any;
37
+ }, {}>;
2
38
  export default _default;
package/src/pc.vue.d.ts CHANGED
@@ -1,2 +1,42 @@
1
- declare const _default: any;
1
+ import type { ICollapseItemApi } from '@opentinyvue/vue-renderless/types/collapse-item.type';
2
+ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
3
+ name?: any;
4
+ disabled?: any;
5
+ title?: any;
6
+ tiny_mode?: any;
7
+ tiny_mode_root?: any;
8
+ tiny_template?: any;
9
+ tiny_renderless?: any;
10
+ _constants?: any;
11
+ tiny_theme?: any;
12
+ tiny_chart_theme?: any;
13
+ expandIcon?: any;
14
+ titleRight?: any;
15
+ }>, ICollapseItemApi, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<Readonly<{
16
+ name?: any;
17
+ disabled?: any;
18
+ title?: any;
19
+ tiny_mode?: any;
20
+ tiny_mode_root?: any;
21
+ tiny_template?: any;
22
+ tiny_renderless?: any;
23
+ _constants?: any;
24
+ tiny_theme?: any;
25
+ tiny_chart_theme?: any;
26
+ expandIcon?: any;
27
+ titleRight?: any;
28
+ }>>>, {
29
+ readonly name?: any;
30
+ readonly disabled?: any;
31
+ readonly title?: any;
32
+ readonly tiny_mode?: any;
33
+ readonly tiny_mode_root?: any;
34
+ readonly tiny_template?: any;
35
+ readonly tiny_renderless?: any;
36
+ readonly _constants?: any;
37
+ readonly tiny_theme?: any;
38
+ readonly tiny_chart_theme?: any;
39
+ readonly expandIcon?: any;
40
+ readonly titleRight?: any;
41
+ }, {}>;
2
42
  export default _default;