@opentinyvue/vue-dropdown-item 2.21.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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 - present TinyVue Authors.
4
+ Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/index.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) 2022 - present TinyVue Authors.
3
+ * Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license.
6
+ *
7
+ * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
8
+ * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
9
+ * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
10
+ *
11
+ */
12
+ import DropdownItem from './src/index';
13
+ export default DropdownItem;
package/lib/index.js ADDED
@@ -0,0 +1,132 @@
1
+ function _extends() {
2
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
3
+ for (var e = 1; e < arguments.length; e++) {
4
+ var t = arguments[e];
5
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
6
+ }
7
+ return n;
8
+ }, _extends.apply(null, arguments);
9
+ }
10
+ import { defineComponent, $prefix, $setup, $props } from "@opentinyvue/vue-common";
11
+ import PcTemplate from "./pc.js";
12
+ import MobileTemplate from "./mobile.js";
13
+ import MobileFirstTemplate from "./mobile-first.js";
14
+ var template = function template2(mode) {
15
+ var _process$env;
16
+ var tinyMode = typeof process === "object" ? (_process$env = process.env) == null ? void 0 : _process$env.TINY_MODE : null;
17
+ if ("pc" === (tinyMode || mode)) {
18
+ return PcTemplate;
19
+ }
20
+ if ("mobile" === (tinyMode || mode)) {
21
+ return MobileTemplate;
22
+ }
23
+ if ("mobile-first" === (tinyMode || mode)) {
24
+ return MobileFirstTemplate;
25
+ }
26
+ return PcTemplate;
27
+ };
28
+ var $constants = {
29
+ ICON_MAP: {
30
+ leftWardArrow: "icon-left-ward-arrow"
31
+ }
32
+ };
33
+ var dropdownItemProps = _extends({}, $props, {
34
+ _constants: {
35
+ type: Object,
36
+ default: function _default() {
37
+ return $constants;
38
+ }
39
+ },
40
+ icon: [String, Object],
41
+ disabled: Boolean,
42
+ divided: Boolean,
43
+ itemData: {
44
+ type: [String, Object],
45
+ default: ""
46
+ },
47
+ title: String,
48
+ label: String,
49
+ level: String,
50
+ titleClass: String,
51
+ options: {
52
+ type: Array,
53
+ default: function _default2() {
54
+ return [];
55
+ }
56
+ },
57
+ // mobile 属性,可选值 selection | filter | sort
58
+ type: {
59
+ type: String,
60
+ default: "selection"
61
+ },
62
+ // 是否选中,勾选状态功能
63
+ selected: {
64
+ type: Boolean,
65
+ default: false
66
+ },
67
+ // 暂没找到使用的地方
68
+ selectedField: {
69
+ type: String,
70
+ default: "selected"
71
+ },
72
+ // 暂没找到使用的地方
73
+ multiStage: {
74
+ type: Boolean,
75
+ default: false
76
+ },
77
+ currentIndex: {
78
+ type: Number,
79
+ default: function _default3() {
80
+ return -1;
81
+ }
82
+ },
83
+ tooltipContent: {
84
+ type: String,
85
+ default: ""
86
+ },
87
+ // 以下为 tiny 新增
88
+ appendToBody: {
89
+ type: Boolean,
90
+ default: true
91
+ },
92
+ textField: {
93
+ type: String,
94
+ default: "label"
95
+ },
96
+ tip: {
97
+ type: [String, Function],
98
+ default: ""
99
+ },
100
+ tipPosition: {
101
+ type: String,
102
+ default: "right"
103
+ },
104
+ effect: {
105
+ type: String,
106
+ default: "light"
107
+ }
108
+ });
109
+ var DropdownItem = defineComponent({
110
+ name: $prefix + "DropdownItem",
111
+ componentName: "TinyDropdownItem",
112
+ props: dropdownItemProps,
113
+ setup: function setup(props, context) {
114
+ return $setup({
115
+ props,
116
+ context,
117
+ template
118
+ });
119
+ }
120
+ });
121
+ var version = "2.21.0";
122
+ DropdownItem.model = {
123
+ prop: "modelValue",
124
+ event: "update:modelValue"
125
+ };
126
+ DropdownItem.install = function(Vue) {
127
+ Vue.component(DropdownItem.name, DropdownItem);
128
+ };
129
+ DropdownItem.version = version;
130
+ export {
131
+ DropdownItem as default
132
+ };
@@ -0,0 +1,90 @@
1
+ import { defineComponent, props, setup } from '@opentinyvue/vue-common';
2
+ import { renderless, api } from '@opentinyvue/vue-renderless/dropdown-item/mf';
3
+
4
+ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
5
+ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
6
+ if (render) {
7
+ options.render = render;
8
+ options.staticRenderFns = staticRenderFns;
9
+ options._compiled = true;
10
+ }
11
+ var hook;
12
+ if (injectStyles) {
13
+ hook = injectStyles;
14
+ }
15
+ if (hook) {
16
+ if (options.functional) {
17
+ options._injectStyles = hook;
18
+ var originalRender = options.render;
19
+ options.render = function renderWithStyleInjection(h, context) {
20
+ hook.call(context);
21
+ return originalRender(h, context);
22
+ };
23
+ } else {
24
+ var existing = options.beforeCreate;
25
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
26
+ }
27
+ }
28
+ return {
29
+ exports: scriptExports,
30
+ options
31
+ };
32
+ }
33
+
34
+ var __vue2_script = defineComponent({
35
+ emits: ["update:modelValue", "change", "closed", "open", "opened", "close", "confirm", "reset"],
36
+ props: [].concat(props, ["disabled", "icon", "itemData", "selected", "label", "level", "currentIndex", "tooltipContent"]),
37
+ setup: function setup$1(props2, context) {
38
+ return setup({
39
+ props: props2,
40
+ context,
41
+ renderless,
42
+ api
43
+ });
44
+ }
45
+ });
46
+ var render = function render2() {
47
+ var _vm = this;
48
+ var _h = _vm.$createElement;
49
+ var _c = _vm._self._c || _h;
50
+ return _c("li", {
51
+ class: _vm.m("rounded-sm list-none leading-10 sm:leading-8 outline-0 min-w-[theme(spacing.18)] max-w-[theme(spacing.52)] w-full [&_svg]:sm:w-3.5 [&_svg]:sm:h-3.5 [&_svg]:sm:mr-1.5 [&_svg]:mr-2 [&_svg]:align-text-bottom", _vm.disabled ? "cursor-not-allowed text-color-text-disabled [&_svg]:fill-color-text-disabled" : "text-color-text-primary active:bg-color-bg-4 visited:text-color-brand hover:bg-color-bg-2 focus:bg-color-bg-4 cursor-pointer", {
52
+ "text-color-brand-focus bg-color-fill-6": _vm.dataStore.checkedStatus && _vm.selected
53
+ }, _vm.dataStore.multiStage ? "!px-0 mb-1" : "[&:not(:last-of-type)]:mb-1"),
54
+ attrs: {
55
+ "data-tag": "tiny-dropdown-item",
56
+ "aria-disabled": _vm.disabled,
57
+ "tabindex": _vm.disabled ? null : -1
58
+ },
59
+ on: {
60
+ "mouseenter": _vm.mouseEnter,
61
+ "mouseleave": _vm.mouseLeave,
62
+ "click": function click($event) {
63
+ $event.stopPropagation();
64
+ return _vm.handleClick.apply(null, arguments);
65
+ }
66
+ }
67
+ }, [_c("div", {
68
+ ref: "level",
69
+ class: ["sm:text-xs text-sm", _vm.level === "2" ? "mx-6 overflow-hidden text-ellipsis whitespace-nowrap" : "mx-4 sm:mx-3 overflow-hidden text-ellipsis whitespace-nowrap"],
70
+ attrs: {
71
+ "data-tag": "tiny-dropdown-level"
72
+ }
73
+ }, [_vm.icon ? _c(_vm.icon, {
74
+ tag: "component",
75
+ staticClass: "sm:w-3.5 sm:h-3.5 sm:mr-1.5 mr-2 align-text-bottom"
76
+ }) : _vm._e(), _vm._t("default")], 2)]);
77
+ };
78
+ var staticRenderFns = [];
79
+ var __cssModules = {};
80
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
81
+ function __vue2_injectStyles(context) {
82
+ for (var o in __cssModules) {
83
+ this[o] = __cssModules[o];
84
+ }
85
+ }
86
+ var mobileFirst = /* @__PURE__ */ function() {
87
+ return __component__.exports;
88
+ }();
89
+
90
+ export { mobileFirst as default };
package/lib/mobile.js ADDED
@@ -0,0 +1,195 @@
1
+ import { renderless, api } from '@opentinyvue/vue-renderless/dropdown-item/vue';
2
+ import { defineComponent, directive, props, setup } from '@opentinyvue/vue-common';
3
+ import { iconYes } from '@opentinyvue/vue-icon';
4
+ import Popup from '@opentinyvue/vue-popup';
5
+ import Button from '@opentinyvue/vue-button';
6
+ import Clickoutside from '@opentinyvue/vue-renderless/common/deps/clickoutside';
7
+ import '@opentinyvue/vue-theme-mobile/dropdown-item/index.css';
8
+
9
+ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
10
+ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
11
+ if (render) {
12
+ options.render = render;
13
+ options.staticRenderFns = staticRenderFns;
14
+ options._compiled = true;
15
+ }
16
+ var hook;
17
+ if (injectStyles) {
18
+ hook = injectStyles;
19
+ }
20
+ if (hook) {
21
+ if (options.functional) {
22
+ options._injectStyles = hook;
23
+ var originalRender = options.render;
24
+ options.render = function renderWithStyleInjection(h, context) {
25
+ hook.call(context);
26
+ return originalRender(h, context);
27
+ };
28
+ } else {
29
+ var existing = options.beforeCreate;
30
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
31
+ }
32
+ }
33
+ return {
34
+ exports: scriptExports,
35
+ options
36
+ };
37
+ }
38
+
39
+ var __vue2_script = defineComponent({
40
+ directives: directive({
41
+ Clickoutside
42
+ }),
43
+ props: [].concat(props, ["modelValue", "title", "disabled", "titleClass", "options", "icon", "type"]),
44
+ components: {
45
+ IconYes: iconYes(),
46
+ TinyPopup: Popup,
47
+ TinyButton: Button
48
+ },
49
+ emits: ["update:modelValue", "open", "opened", "click", "change", "closed", "close", "reset", "confirm", "item-click"],
50
+ setup: function setup$1(props2, context) {
51
+ return setup({
52
+ props: props2,
53
+ context,
54
+ renderless,
55
+ api
56
+ });
57
+ }
58
+ });
59
+ var render = function render2() {
60
+ var _vm = this;
61
+ var _h = _vm.$createElement;
62
+ var _c = _vm._self._c || _h;
63
+ return _c("div", {
64
+ directives: [{
65
+ name: "show",
66
+ rawName: "v-show",
67
+ value: _vm.state.showWrapper,
68
+ expression: "state.showWrapper"
69
+ }],
70
+ ref: "wrapper",
71
+ staticClass: "tiny-mobile-dropdown-item",
72
+ class: "tiny-mobile-dropdown-item--" + _vm.state.direction,
73
+ style: _vm.state.itemStyle,
74
+ on: {
75
+ "click": _vm.clickWrapper
76
+ }
77
+ }, [_c("tiny-popup", {
78
+ attrs: {
79
+ "popup-class": "tiny-mobile-dropdown-item__content",
80
+ "overlay": _vm.state.overlay,
81
+ "close-on-click-overlay": _vm.state.closeOnClickOverlay,
82
+ "closeable": false,
83
+ "position": _vm.state.direction === "down" ? "top" : "bottom",
84
+ "duration": _vm.state.transition ? _vm.state.duration : 0
85
+ },
86
+ on: {
87
+ "open": _vm.open,
88
+ "close": _vm.close,
89
+ "opened": _vm.opened,
90
+ "closed": _vm.closed
91
+ },
92
+ model: {
93
+ value: _vm.state.showPopup,
94
+ callback: function callback($$v) {
95
+ _vm.$set(_vm.state, "showPopup", $$v);
96
+ },
97
+ expression: "state.showPopup"
98
+ }
99
+ }, [_vm._t("default", function() {
100
+ return [_vm.type === "selection" ? _c("div", {
101
+ staticClass: "tiny-mobile-dropdown-item__options"
102
+ }, _vm._l(_vm.options, function(item, index) {
103
+ return _c("div", {
104
+ key: index,
105
+ staticClass: "tiny-mobile-dropdown-item__cell tiny-mobile-dropdown-item__option",
106
+ class: item.value === _vm.modelValue ? "is-active" : "",
107
+ attrs: {
108
+ "tabindex": "0"
109
+ },
110
+ on: {
111
+ "click": function click($event) {
112
+ return _vm.clickItem(item.value);
113
+ }
114
+ }
115
+ }, [_c("div", {
116
+ staticClass: "tiny-mobile-dropdown-item__option-icon"
117
+ }, [_vm._t("icon", function() {
118
+ return [_c(_vm.icon, {
119
+ tag: "component"
120
+ })];
121
+ })], 2), _c("div", {
122
+ staticClass: "tiny-mobile-dropdown-item__option-title"
123
+ }, [_vm._t("title", function() {
124
+ return [_c("span", {
125
+ style: {
126
+ color: item.value === _vm.modelValue && _vm.state.activeColor ? _vm.state.activeColor : ""
127
+ }
128
+ }, [_vm._v(_vm._s(item.text))])];
129
+ }, {
130
+ "titleData": item
131
+ })], 2), _c("div", {
132
+ staticClass: "tiny-mobile-dropdown-item__option-value"
133
+ }, [item.value === _vm.modelValue ? _c("icon-yes", {
134
+ attrs: {
135
+ "fill": _vm.state.activeColor ? _vm.state.activeColor : "#f36f64"
136
+ }
137
+ }) : _vm._e()], 1)]);
138
+ }), 0) : _vm._e(), _vm.type === "filter" ? _c("div", {
139
+ directives: [{
140
+ name: "clickoutside",
141
+ rawName: "v-clickoutside",
142
+ value: _vm.clickOutside,
143
+ expression: "clickOutside"
144
+ }],
145
+ staticClass: "tiny-mobile-dropdown-item__filter"
146
+ }, [_c("div", {
147
+ staticClass: "tiny-mobile-dropdown-item__filter-wrap"
148
+ }, _vm._l(_vm.options, function(item, key) {
149
+ return _c("div", {
150
+ key,
151
+ staticClass: "tiny-mobile-dropdown-item__cell tiny-mobile-dropdown-item__filter-item"
152
+ }, [_c("span", {
153
+ staticClass: "tiny-mobile-dropdown-item__filter-title"
154
+ }, [_vm._v(_vm._s(item.title))]), _c("ul", _vm._l(_vm.options.length === 0 ? item.data = [] : item.data, function(tag, tagkey) {
155
+ return _c("li", {
156
+ key: tagkey,
157
+ staticClass: "tiny-mobile-dropdown-item__filter-li",
158
+ class: [_vm.modelValue[key].indexOf(tag.value) > -1 ? "checked" : ""],
159
+ style: _vm.getOptionStyle(tag, _vm.modelValue[key]),
160
+ on: {
161
+ "click": function click($event) {
162
+ return _vm.tagClick(key, tag, $event);
163
+ }
164
+ }
165
+ }, [_vm._v(" " + _vm._s(tag.text) + " ")]);
166
+ }), 0)]);
167
+ }), 0), _c("div", {
168
+ staticClass: "tiny-mobile-dropdown-item__filter-operate"
169
+ }, [_c("tiny-button", {
170
+ on: {
171
+ "click": _vm.reset
172
+ }
173
+ }, [_vm._v(" Reset ")]), _c("tiny-button", {
174
+ attrs: {
175
+ "type": "primary"
176
+ },
177
+ on: {
178
+ "click": _vm.confirm
179
+ }
180
+ }, [_vm._v(" OK ")])], 1)]) : _vm._e()];
181
+ })], 2)], 1);
182
+ };
183
+ var staticRenderFns = [];
184
+ var __cssModules = {};
185
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
186
+ function __vue2_injectStyles(context) {
187
+ for (var o in __cssModules) {
188
+ this[o] = __cssModules[o];
189
+ }
190
+ }
191
+ var mobile = /* @__PURE__ */ function() {
192
+ return __component__.exports;
193
+ }();
194
+
195
+ export { mobile as default };
package/lib/pc.js ADDED
@@ -0,0 +1,160 @@
1
+ import { defineComponent, $prefix, props, setup } from '@opentinyvue/vue-common';
2
+ import { renderless, api } from '@opentinyvue/vue-renderless/dropdown-item/vue';
3
+ import { iconLeftWardArrow } from '@opentinyvue/vue-icon';
4
+ import '@opentinyvue/vue-theme/dropdown-item/index.css';
5
+ import { AutoTip } from '@opentinyvue/vue-directive';
6
+
7
+ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
8
+ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
9
+ if (render) {
10
+ options.render = render;
11
+ options.staticRenderFns = staticRenderFns;
12
+ options._compiled = true;
13
+ }
14
+ var hook;
15
+ if (injectStyles) {
16
+ hook = injectStyles;
17
+ }
18
+ if (hook) {
19
+ if (options.functional) {
20
+ options._injectStyles = hook;
21
+ var originalRender = options.render;
22
+ options.render = function renderWithStyleInjection(h, context) {
23
+ hook.call(context);
24
+ return originalRender(h, context);
25
+ };
26
+ } else {
27
+ var existing = options.beforeCreate;
28
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
29
+ }
30
+ }
31
+ return {
32
+ exports: scriptExports,
33
+ options
34
+ };
35
+ }
36
+
37
+ var __vue2_script = defineComponent({
38
+ name: $prefix + "DropdownItem",
39
+ componentName: $prefix + "DropdownItem",
40
+ directives: {
41
+ AutoTip
42
+ },
43
+ emits: ["item-click", "update:modelValue", "change", "closed", "open", "opened", "close", "confirm", "reset"],
44
+ props: [].concat(props, [
45
+ "disabled",
46
+ "divided",
47
+ "icon",
48
+ "itemData",
49
+ "selected",
50
+ "currentIndex",
51
+ "title",
52
+ "titleClass",
53
+ "options",
54
+ "type",
55
+ "label",
56
+ "selectedField",
57
+ "multiStage",
58
+ // tiny新增
59
+ "appendToBody",
60
+ "textField",
61
+ "tip",
62
+ "tipPosition",
63
+ "effect",
64
+ "isMono"
65
+ ]),
66
+ components: {
67
+ IconLeftWardArrow: iconLeftWardArrow()
68
+ },
69
+ setup: function setup$1(props2, context) {
70
+ return setup({
71
+ props: props2,
72
+ context,
73
+ renderless,
74
+ api,
75
+ mono: props2.isMono
76
+ });
77
+ }
78
+ });
79
+ var render = function render2() {
80
+ var _vm = this;
81
+ var _h = _vm.$createElement;
82
+ var _c = _vm._self._c || _h;
83
+ return _c("li", {
84
+ directives: [{
85
+ name: "auto-tip",
86
+ rawName: "v-auto-tip",
87
+ value: _vm.state.computedTip ? {
88
+ always: true,
89
+ content: _vm.state.computedTip,
90
+ effect: _vm.effect,
91
+ placement: _vm.tipPosition
92
+ } : false,
93
+ expression: "\n state.computedTip ? { always: true, content: state.computedTip, effect, placement: tipPosition } : false\n "
94
+ }],
95
+ ref: "dropdownItem",
96
+ class: ["tiny-dropdown-item", "tiny-dropdown-menu__item", _vm.state.sizeClass, _vm.disabled ? "is-disabled" : "", _vm.divided ? "tiny-dropdown-item--divided tiny-dropdown-menu__item--divided" : "", _vm.state.checkedStatus && _vm.selected ? "tiny-dropdown-item--check-status" : "", _vm.itemData.children && _vm.itemData.children.length ? "has-children" : ""],
97
+ attrs: {
98
+ "aria-disabled": _vm.disabled,
99
+ "tabindex": _vm.disabled ? null : -1
100
+ },
101
+ on: {
102
+ "click": function click($event) {
103
+ $event.stopPropagation();
104
+ return _vm.handleClick.apply(null, arguments);
105
+ },
106
+ "mousedown": function mousedown($event) {
107
+ $event.stopPropagation();
108
+ }
109
+ }
110
+ }, [_c("div", {
111
+ staticClass: "tiny-dropdown-item__wrap"
112
+ }, [_vm.itemData.children && _vm.itemData.children.length ? _c("span", {
113
+ staticClass: "tiny-dropdown-item__expand tiny-dropdown-menu__item-expand"
114
+ }, [_c(_vm.state.getIcon, {
115
+ tag: "component"
116
+ })], 1) : _vm._e(), _c("div", {
117
+ staticClass: "tiny-dropdown-item__content tiny-dropdown-menu__item-content"
118
+ }, [_vm.icon ? _c(_vm.icon, {
119
+ tag: "component",
120
+ staticClass: "tiny-svg-size tiny-dropdown-item__pre-icon"
121
+ }) : _vm._e(), _c("span", {
122
+ staticClass: "tiny-dropdown-item__label"
123
+ }, [_vm._t("default", function() {
124
+ return [_c("span", [_vm._v(_vm._s(_vm.label))])];
125
+ }, {
126
+ "itemData": _vm.itemData
127
+ })], 2)], 1), _vm.itemData.children && _vm.itemData.children.length ? _c("ul", {
128
+ class: ["tiny-dropdown-menu", "tiny-dropdown-item--child tiny-dropdown-menu__item--child", _vm.state.popperClass]
129
+ }, _vm._l(_vm.itemData.children, function(item, index) {
130
+ return _c("tiny-dropdown-item", {
131
+ key: index,
132
+ attrs: {
133
+ "label": item[_vm.state.textField],
134
+ "item-data": item,
135
+ "_constants": _vm._constants,
136
+ "icon": item.icon,
137
+ "is-mono": true,
138
+ "disabled": item.disabled,
139
+ "divided": item.divided,
140
+ "tip": item.tip,
141
+ "tip-position": item.tipPosition
142
+ }
143
+ }, [_vm._t("default", null, {
144
+ "itemData": item
145
+ })], 2);
146
+ }), 1) : _vm._e()])]);
147
+ };
148
+ var staticRenderFns = [];
149
+ var __cssModules = {};
150
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
151
+ function __vue2_injectStyles(context) {
152
+ for (var o in __cssModules) {
153
+ this[o] = __cssModules[o];
154
+ }
155
+ }
156
+ var pc = /* @__PURE__ */ function() {
157
+ return __component__.exports;
158
+ }();
159
+
160
+ export { pc as default };
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@opentinyvue/vue-dropdown-item",
3
+ "type": "module",
4
+ "version": "2.21.0",
5
+ "description": "",
6
+ "license": "MIT",
7
+ "sideEffects": false,
8
+ "main": "./lib/index.js",
9
+ "module": "./lib/index.js",
10
+ "dependencies": {
11
+ "@opentinyvue/vue-button": "~2.21.0",
12
+ "@opentinyvue/vue-common": "~2.21.0",
13
+ "@opentinyvue/vue-directive": "~2.21.0",
14
+ "@opentinyvue/vue-icon": "~2.21.0",
15
+ "@opentinyvue/vue-popup": "~2.21.0",
16
+ "@opentinyvue/vue-renderless": "~3.21.0",
17
+ "@opentinyvue/vue-theme": "~3.21.0",
18
+ "@opentinyvue/vue-theme-mobile": "~3.21.0"
19
+ },
20
+ "types": "index.d.ts",
21
+ "scripts": {
22
+ "build": "pnpm -w build:ui $npm_package_name",
23
+ "//postversion": "pnpm build"
24
+ }
25
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Copyright (c) 2022 - present TinyVue Authors.
3
+ * Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license.
6
+ *
7
+ * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
8
+ * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
9
+ * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
10
+ *
11
+ */
12
+ export declare const $constants: {
13
+ ICON_MAP: {
14
+ leftWardArrow: string;
15
+ };
16
+ };
17
+ export declare const dropdownItemProps: {
18
+ _constants: {
19
+ type: ObjectConstructor;
20
+ default: () => {
21
+ ICON_MAP: {
22
+ leftWardArrow: string;
23
+ };
24
+ };
25
+ };
26
+ icon: (StringConstructor | ObjectConstructor)[];
27
+ disabled: BooleanConstructor;
28
+ divided: BooleanConstructor;
29
+ itemData: {
30
+ type: (StringConstructor | ObjectConstructor)[];
31
+ default: string;
32
+ };
33
+ title: StringConstructor;
34
+ label: StringConstructor;
35
+ level: StringConstructor;
36
+ titleClass: StringConstructor;
37
+ options: {
38
+ type: ArrayConstructor;
39
+ default: () => never[];
40
+ };
41
+ type: {
42
+ type: StringConstructor;
43
+ default: string;
44
+ };
45
+ selected: {
46
+ type: BooleanConstructor;
47
+ default: boolean;
48
+ };
49
+ selectedField: {
50
+ type: StringConstructor;
51
+ default: string;
52
+ };
53
+ multiStage: {
54
+ type: BooleanConstructor;
55
+ default: boolean;
56
+ };
57
+ currentIndex: {
58
+ type: NumberConstructor;
59
+ default: () => number;
60
+ };
61
+ tooltipContent: {
62
+ type: StringConstructor;
63
+ default: string;
64
+ };
65
+ appendToBody: {
66
+ type: BooleanConstructor;
67
+ default: boolean;
68
+ };
69
+ textField: {
70
+ type: StringConstructor;
71
+ default: string;
72
+ };
73
+ tip: {
74
+ type: (StringConstructor | FunctionConstructor)[];
75
+ default: string;
76
+ };
77
+ tipPosition: {
78
+ type: StringConstructor;
79
+ default: string;
80
+ };
81
+ effect: {
82
+ type: StringConstructor;
83
+ default: string;
84
+ };
85
+ tiny_mode: StringConstructor;
86
+ tiny_mode_root: BooleanConstructor;
87
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
88
+ tiny_renderless: FunctionConstructor;
89
+ tiny_theme: StringConstructor;
90
+ tiny_chart_theme: ObjectConstructor;
91
+ };
92
+ declare const _default: any;
93
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;