@opentiny/vue-dropdown-item 3.8.0 → 3.8.3
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 +22 -7
- package/lib/mobile.js +3 -5
- package/lib/pc.js +4 -4
- package/package.json +7 -6
- package/src/index.d.ts +25 -8
package/lib/index.js
CHANGED
|
@@ -17,17 +17,32 @@ import PcTemplate from "./pc.js";
|
|
|
17
17
|
import MobileTemplate from "./mobile.js";
|
|
18
18
|
import MobileFirstTemplate from "./mobile-first.js";
|
|
19
19
|
var template = function template2(mode) {
|
|
20
|
-
if ("
|
|
20
|
+
if ("pc" === (process.env.TINY_MODE || mode)) {
|
|
21
|
+
return PcTemplate;
|
|
22
|
+
}
|
|
23
|
+
if ("mobile" === (process.env.TINY_MODE || mode)) {
|
|
21
24
|
return MobileTemplate;
|
|
22
|
-
|
|
25
|
+
}
|
|
26
|
+
if ("mobile-first" === (process.env.TINY_MODE || mode)) {
|
|
23
27
|
return MobileFirstTemplate;
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
}
|
|
29
|
+
return PcTemplate;
|
|
30
|
+
};
|
|
31
|
+
var $constants = {
|
|
32
|
+
ICON_MAP: {
|
|
33
|
+
leftWardArrow: "icon-delta-left"
|
|
34
|
+
}
|
|
26
35
|
};
|
|
27
36
|
var DropdownItem = defineComponent({
|
|
28
37
|
name: $prefix + "DropdownItem",
|
|
29
38
|
componentName: "TinyDropdownItem",
|
|
30
39
|
props: _extends({}, $props, {
|
|
40
|
+
_constants: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: function _default() {
|
|
43
|
+
return $constants;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
31
46
|
icon: [String, Object],
|
|
32
47
|
disabled: Boolean,
|
|
33
48
|
divided: Boolean,
|
|
@@ -36,7 +51,7 @@ var DropdownItem = defineComponent({
|
|
|
36
51
|
titleClass: String,
|
|
37
52
|
options: {
|
|
38
53
|
type: Array,
|
|
39
|
-
default: function
|
|
54
|
+
default: function _default2() {
|
|
40
55
|
return [];
|
|
41
56
|
}
|
|
42
57
|
},
|
|
@@ -50,7 +65,7 @@ var DropdownItem = defineComponent({
|
|
|
50
65
|
},
|
|
51
66
|
itemData: {
|
|
52
67
|
type: Object,
|
|
53
|
-
default: function
|
|
68
|
+
default: function _default3() {
|
|
54
69
|
return {};
|
|
55
70
|
}
|
|
56
71
|
},
|
|
@@ -76,7 +91,7 @@ var DropdownItem = defineComponent({
|
|
|
76
91
|
},
|
|
77
92
|
currentIndex: {
|
|
78
93
|
type: Number,
|
|
79
|
-
default: function
|
|
94
|
+
default: function _default4() {
|
|
80
95
|
return -1;
|
|
81
96
|
}
|
|
82
97
|
}
|
package/lib/mobile.js
CHANGED
|
@@ -5,7 +5,7 @@ import Popup from "@opentiny/vue-popup";
|
|
|
5
5
|
import Button from "@opentiny/vue-button";
|
|
6
6
|
import Clickoutside from "@opentiny/vue-renderless/common/deps/clickoutside";
|
|
7
7
|
import "@opentiny/vue-theme-mobile/dropdown-item/index.css";
|
|
8
|
-
import { resolveComponent, resolveDirective, withDirectives, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, withCtx, renderSlot, Fragment, renderList, createElementVNode, createBlock, resolveDynamicComponent, toDisplayString, createCommentVNode,
|
|
8
|
+
import { resolveComponent, resolveDirective, withDirectives, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, withCtx, renderSlot, Fragment, renderList, createElementVNode, createBlock, resolveDynamicComponent, toDisplayString, createCommentVNode, createTextVNode, vShow } from "vue";
|
|
9
9
|
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
10
10
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
11
11
|
if (it)
|
|
@@ -99,8 +99,6 @@ var _hoisted_9 = ["onClick"];
|
|
|
99
99
|
var _hoisted_10 = {
|
|
100
100
|
class: "tiny-mobile-dropdown-item__filter-operate"
|
|
101
101
|
};
|
|
102
|
-
var _hoisted_11 = /* @__PURE__ */ createTextVNode(" Reset ");
|
|
103
|
-
var _hoisted_12 = /* @__PURE__ */ createTextVNode(" OK ");
|
|
104
102
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
105
103
|
var _component_icon_yes = resolveComponent("icon-yes");
|
|
106
104
|
var _component_tiny_button = resolveComponent("tiny-button");
|
|
@@ -204,7 +202,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
204
202
|
onClick: _ctx.reset
|
|
205
203
|
}, {
|
|
206
204
|
default: withCtx(function() {
|
|
207
|
-
return [
|
|
205
|
+
return [createTextVNode(" Reset ")];
|
|
208
206
|
}),
|
|
209
207
|
_: 1
|
|
210
208
|
/* STABLE */
|
|
@@ -213,7 +211,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
213
211
|
onClick: _ctx.confirm
|
|
214
212
|
}, {
|
|
215
213
|
default: withCtx(function() {
|
|
216
|
-
return [
|
|
214
|
+
return [createTextVNode(" OK ")];
|
|
217
215
|
}),
|
|
218
216
|
_: 1
|
|
219
217
|
/* STABLE */
|
package/lib/pc.js
CHANGED
|
@@ -2,7 +2,7 @@ import { defineComponent, $prefix, props, setup as _setup } from "@opentiny/vue-
|
|
|
2
2
|
import { renderless, api } from "@opentiny/vue-renderless/dropdown-item/vue";
|
|
3
3
|
import { iconDeltaLeft } from "@opentiny/vue-icon";
|
|
4
4
|
import "@opentiny/vue-theme/dropdown-item/index.css";
|
|
5
|
-
import { resolveComponent, openBlock, createElementBlock, Fragment, createCommentVNode, createElementVNode, normalizeClass, withModifiers,
|
|
5
|
+
import { resolveComponent, openBlock, createElementBlock, Fragment, createCommentVNode, createElementVNode, normalizeClass, withModifiers, createBlock, resolveDynamicComponent, renderSlot, toDisplayString, renderList, withCtx } from "vue";
|
|
6
6
|
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
7
7
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
8
8
|
if (it)
|
|
@@ -77,7 +77,6 @@ var _hoisted_4 = {
|
|
|
77
77
|
class: "tiny-dropdown-item__content tiny-dropdown-menu__item-content"
|
|
78
78
|
};
|
|
79
79
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
80
|
-
var _component_icon_delta_left = resolveComponent("icon-delta-left");
|
|
81
80
|
var _component_tiny_dropdown_item = resolveComponent("tiny-dropdown-item");
|
|
82
81
|
return openBlock(), createElementBlock(
|
|
83
82
|
Fragment,
|
|
@@ -85,7 +84,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
85
84
|
[createCommentVNode(" TINY-TODO: tiny-dropdown-menu__item命名不规范,后续统一有个迭代去掉 "), createElementVNode("li", {
|
|
86
85
|
class: normalizeClass(["tiny-dropdown-item tiny-dropdown-menu__item", {
|
|
87
86
|
"is-disabled": _ctx.disabled,
|
|
88
|
-
"tiny-dropdown-item--divided tiny-dropdown-menu__item--divided": _ctx.divided
|
|
87
|
+
"tiny-dropdown-item--divided tiny-dropdown-menu__item--divided": _ctx.divided,
|
|
88
|
+
"has-children": _ctx.itemData.children && _ctx.itemData.children.length
|
|
89
89
|
}]),
|
|
90
90
|
ref: "dropdownItem",
|
|
91
91
|
onClick: _cache[0] || (_cache[0] = function() {
|
|
@@ -95,7 +95,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
95
95
|
}, ["stop"])),
|
|
96
96
|
"aria-disabled": _ctx.disabled,
|
|
97
97
|
tabindex: _ctx.disabled ? null : -1
|
|
98
|
-
}, [createElementVNode("div", _hoisted_2, [_ctx.itemData.children && _ctx.itemData.children.length ? (openBlock(), createElementBlock("span", _hoisted_3, [
|
|
98
|
+
}, [createElementVNode("div", _hoisted_2, [_ctx.itemData.children && _ctx.itemData.children.length ? (openBlock(), createElementBlock("span", _hoisted_3, [(openBlock(), createBlock(resolveDynamicComponent(_ctx.state.getIcon)))])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_4, [_ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), {
|
|
99
99
|
key: 0,
|
|
100
100
|
class: "tiny-svg-size"
|
|
101
101
|
})) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default", {
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/vue-dropdown-item",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib/index.js",
|
|
7
|
+
"sideEffects": false,
|
|
7
8
|
"dependencies": {
|
|
8
|
-
"@opentiny/vue-common": "~3.8.
|
|
9
|
-
"@opentiny/vue-icon": "~3.8.
|
|
10
|
-
"@opentiny/vue-renderless": "~3.8.
|
|
11
|
-
"@opentiny/vue-popup": "~3.8.
|
|
12
|
-
"@opentiny/vue-button": "~3.8.
|
|
9
|
+
"@opentiny/vue-common": "~3.8.3",
|
|
10
|
+
"@opentiny/vue-icon": "~3.8.3",
|
|
11
|
+
"@opentiny/vue-renderless": "~3.8.3",
|
|
12
|
+
"@opentiny/vue-popup": "~3.8.3",
|
|
13
|
+
"@opentiny/vue-button": "~3.8.3"
|
|
13
14
|
},
|
|
14
15
|
"license": "MIT",
|
|
15
16
|
"types": "index.d.ts",
|
package/src/index.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
declare const _default: import("@vue/runtime-core").DefineComponent<{
|
|
2
|
-
|
|
2
|
+
_constants: {
|
|
3
|
+
type: ObjectConstructor;
|
|
4
|
+
default: () => {
|
|
5
|
+
ICON_MAP: {
|
|
6
|
+
leftWardArrow: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
icon: (ObjectConstructor | StringConstructor)[];
|
|
3
11
|
disabled: BooleanConstructor;
|
|
4
12
|
divided: BooleanConstructor;
|
|
5
13
|
command: {};
|
|
@@ -47,14 +55,22 @@ declare const _default: import("@vue/runtime-core").DefineComponent<{
|
|
|
47
55
|
};
|
|
48
56
|
tiny_mode: StringConstructor;
|
|
49
57
|
tiny_mode_root: BooleanConstructor;
|
|
50
|
-
tiny_template: (
|
|
58
|
+
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
51
59
|
tiny_renderless: FunctionConstructor;
|
|
52
60
|
tiny_theme: StringConstructor;
|
|
53
61
|
tiny_chart_theme: ObjectConstructor;
|
|
54
62
|
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
55
63
|
[key: string]: any;
|
|
56
64
|
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
57
|
-
|
|
65
|
+
_constants: {
|
|
66
|
+
type: ObjectConstructor;
|
|
67
|
+
default: () => {
|
|
68
|
+
ICON_MAP: {
|
|
69
|
+
leftWardArrow: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
icon: (ObjectConstructor | StringConstructor)[];
|
|
58
74
|
disabled: BooleanConstructor;
|
|
59
75
|
divided: BooleanConstructor;
|
|
60
76
|
command: {};
|
|
@@ -102,21 +118,22 @@ declare const _default: import("@vue/runtime-core").DefineComponent<{
|
|
|
102
118
|
};
|
|
103
119
|
tiny_mode: StringConstructor;
|
|
104
120
|
tiny_mode_root: BooleanConstructor;
|
|
105
|
-
tiny_template: (
|
|
121
|
+
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
106
122
|
tiny_renderless: FunctionConstructor;
|
|
107
123
|
tiny_theme: StringConstructor;
|
|
108
124
|
tiny_chart_theme: ObjectConstructor;
|
|
109
125
|
}>>, {
|
|
110
|
-
type: string;
|
|
111
|
-
disabled: boolean;
|
|
112
|
-
tiny_mode_root: boolean;
|
|
113
126
|
label: string;
|
|
114
127
|
options: unknown[];
|
|
115
128
|
textField: string;
|
|
129
|
+
type: string;
|
|
130
|
+
tiny_mode_root: boolean;
|
|
131
|
+
_constants: Record<string, any>;
|
|
132
|
+
disabled: boolean;
|
|
133
|
+
appendToBody: boolean;
|
|
116
134
|
selected: boolean;
|
|
117
135
|
divided: boolean;
|
|
118
136
|
itemData: Record<string, any>;
|
|
119
|
-
appendToBody: boolean;
|
|
120
137
|
selectedField: string;
|
|
121
138
|
multiStage: boolean;
|
|
122
139
|
currentIndex: number;
|