@opentinyvue/vue-dropdown 2.21.0 → 2.22.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.
- package/lib/index.js +7 -2
- package/lib/mobile-first.js +1 -1
- package/lib/pc.js +12 -5
- package/package.json +12 -11
- package/src/index.d.ts +4 -0
package/lib/index.js
CHANGED
|
@@ -7,7 +7,7 @@ function _extends() {
|
|
|
7
7
|
return n;
|
|
8
8
|
}, _extends.apply(null, arguments);
|
|
9
9
|
}
|
|
10
|
-
import { defineComponent, $
|
|
10
|
+
import { defineComponent, $props, $setup, $prefix } from "@opentinyvue/vue-common";
|
|
11
11
|
import PcTemplate from "./pc.js";
|
|
12
12
|
import MobileFirstTemplate from "./mobile-first.js";
|
|
13
13
|
import "@opentinyvue/vue-theme/dropdown/index.css";
|
|
@@ -24,6 +24,11 @@ var template = function template2(mode) {
|
|
|
24
24
|
};
|
|
25
25
|
var dropdownProps = _extends({}, $props, {
|
|
26
26
|
modelValue: [String, Number],
|
|
27
|
+
// tiny新增
|
|
28
|
+
visible: {
|
|
29
|
+
type: [Boolean, void 0],
|
|
30
|
+
default: void 0
|
|
31
|
+
},
|
|
27
32
|
type: String,
|
|
28
33
|
trigger: String,
|
|
29
34
|
// 默认主题为 'hover'
|
|
@@ -110,7 +115,7 @@ var Dropdown = defineComponent({
|
|
|
110
115
|
});
|
|
111
116
|
}
|
|
112
117
|
});
|
|
113
|
-
var version = "2.
|
|
118
|
+
var version = "2.undefined";
|
|
114
119
|
Dropdown.install = function(Vue) {
|
|
115
120
|
Vue.component(Dropdown.name, Dropdown);
|
|
116
121
|
};
|
package/lib/mobile-first.js
CHANGED
|
@@ -2,7 +2,7 @@ import { renderless, api } from '@opentinyvue/vue-renderless/dropdown/vue';
|
|
|
2
2
|
import { defineComponent, $prefix, directive, setup, h, $props } from '@opentinyvue/vue-common';
|
|
3
3
|
import Button from '@opentinyvue/vue-button';
|
|
4
4
|
import ButtonGroup from '@opentinyvue/vue-button-group';
|
|
5
|
-
import Clickoutside from '@opentinyvue/vue-
|
|
5
|
+
import { Clickoutside } from '@opentinyvue/vue-directive';
|
|
6
6
|
import { IconChevronDown, IconChevronUp, IconArrowBottom } from '@opentinyvue/vue-icon';
|
|
7
7
|
|
|
8
8
|
function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
package/lib/pc.js
CHANGED
|
@@ -2,7 +2,7 @@ import { renderless, api } from '@opentinyvue/vue-renderless/dropdown/vue';
|
|
|
2
2
|
import { defineComponent, $prefix, directive, setup, h, $props } from '@opentinyvue/vue-common';
|
|
3
3
|
import Button from '@opentinyvue/vue-button';
|
|
4
4
|
import ButtonGroup from '@opentinyvue/vue-button-group';
|
|
5
|
-
import Clickoutside from '@opentinyvue/vue-
|
|
5
|
+
import { Clickoutside } from '@opentinyvue/vue-directive';
|
|
6
6
|
import DropdownMenu from '@opentinyvue/vue-dropdown-menu';
|
|
7
7
|
import { iconDownWard } from '@opentinyvue/vue-icon';
|
|
8
8
|
|
|
@@ -60,6 +60,11 @@ var __vue2_script = defineComponent({
|
|
|
60
60
|
props: _extends({}, $props, {
|
|
61
61
|
type: String,
|
|
62
62
|
trigger: String,
|
|
63
|
+
// tiny新增
|
|
64
|
+
visible: {
|
|
65
|
+
type: [Boolean, void 0],
|
|
66
|
+
default: void 0
|
|
67
|
+
},
|
|
63
68
|
size: {
|
|
64
69
|
type: String,
|
|
65
70
|
default: ""
|
|
@@ -124,7 +129,7 @@ var __vue2_script = defineComponent({
|
|
|
124
129
|
default: false
|
|
125
130
|
}
|
|
126
131
|
}),
|
|
127
|
-
emits: ["visible-change", "item-click", "button-click", "menu-item-click", "handle-click", "is-disabled", "selected-index"],
|
|
132
|
+
emits: ["visible-change", "item-click", "button-click", "menu-item-click", "handle-click", "is-disabled", "selected-index", "update:visible"],
|
|
128
133
|
setup: function setup$1(props, context) {
|
|
129
134
|
return setup({
|
|
130
135
|
props,
|
|
@@ -138,13 +143,14 @@ var __vue2_script = defineComponent({
|
|
|
138
143
|
var _state$designConfig, _state$designConfig$i, _state$designConfig2, _state$designConfig2$;
|
|
139
144
|
var h2 = arguments[0];
|
|
140
145
|
var splitButton = this.splitButton, type = this.type, disabled = this.disabled, handleMainButtonClick = this.handleMainButtonClick, menuOptions = this.menuOptions, title = this.title, suffixIcon = this.suffixIcon, prefixIcon = this.prefixIcon;
|
|
141
|
-
var slots = this.slots, size = this.size, state = this.state, border = this.border, showIcon = this.showIcon, round = this.round, clickOutside = this.clickOutside;
|
|
146
|
+
var slots = this.slots, size = this.size, state = this.state, border = this.border, showIcon = this.showIcon, round = this.round, clickOutside = this.clickOutside, visible = this.visible;
|
|
142
147
|
var params = {
|
|
143
148
|
visible: state.visible
|
|
144
149
|
};
|
|
145
150
|
var triggerElm = null;
|
|
146
151
|
var triggerClass = "tiny-dropdown__trigger tiny-dropdown-trigger";
|
|
147
|
-
var
|
|
152
|
+
var addVisibleClass = state.visibleIsBoolean ? visible : state.visible;
|
|
153
|
+
var visibleClass = addVisibleClass ? "tiny-dropdown--visible tiny-dropdown-visible" : "";
|
|
148
154
|
var IconDown = suffixIcon || ((_state$designConfig = state.designConfig) == null ? void 0 : (_state$designConfig$i = _state$designConfig.icons) == null ? void 0 : _state$designConfig$i.dropdownIcon) || iconDownWard();
|
|
149
155
|
var IconPre = prefixIcon;
|
|
150
156
|
var ButtonIconDown = ((_state$designConfig2 = state.designConfig) == null ? void 0 : (_state$designConfig2$ = _state$designConfig2.icons) == null ? void 0 : _state$designConfig2$.dropdownIcon) || iconDownWard();
|
|
@@ -195,6 +201,7 @@ var __vue2_script = defineComponent({
|
|
|
195
201
|
"ref": "trigger",
|
|
196
202
|
"attrs": {
|
|
197
203
|
"round": round,
|
|
204
|
+
"size": size,
|
|
198
205
|
"disabled": disabled,
|
|
199
206
|
"type": type,
|
|
200
207
|
"reset-time": 0
|
|
@@ -218,7 +225,7 @@ var __vue2_script = defineComponent({
|
|
|
218
225
|
"class": "tiny-dropdown",
|
|
219
226
|
"directives": [{
|
|
220
227
|
name: "clickoutside",
|
|
221
|
-
value: clickOutside
|
|
228
|
+
value: !state.visibleIsBoolean && clickOutside
|
|
222
229
|
}],
|
|
223
230
|
"attrs": {
|
|
224
231
|
"aria-disabled": disabled
|
package/package.json
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentinyvue/vue-dropdown",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "2.22.1",
|
|
4
5
|
"description": "",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"sideEffects": false,
|
|
5
8
|
"main": "./lib/index.js",
|
|
6
9
|
"module": "./lib/index.js",
|
|
7
|
-
"sideEffects": false,
|
|
8
|
-
"type": "module",
|
|
9
10
|
"dependencies": {
|
|
10
|
-
"@opentinyvue/vue-
|
|
11
|
-
"@opentinyvue/vue-
|
|
12
|
-
"@opentinyvue/vue-
|
|
13
|
-
"@opentinyvue/vue-
|
|
14
|
-
"@opentinyvue/vue-
|
|
15
|
-
"@opentinyvue/vue-icon": "~2.
|
|
16
|
-
"@opentinyvue/vue-
|
|
11
|
+
"@opentinyvue/vue-button": "~2.22.0",
|
|
12
|
+
"@opentinyvue/vue-button-group": "~2.22.0",
|
|
13
|
+
"@opentinyvue/vue-common": "~2.22.0",
|
|
14
|
+
"@opentinyvue/vue-directive": "~2.22.0",
|
|
15
|
+
"@opentinyvue/vue-dropdown-menu": "~2.22.0",
|
|
16
|
+
"@opentinyvue/vue-icon": "~2.22.0",
|
|
17
|
+
"@opentinyvue/vue-renderless": "~3.22.0",
|
|
18
|
+
"@opentinyvue/vue-theme": "~3.22.0"
|
|
17
19
|
},
|
|
18
|
-
"license": "MIT",
|
|
19
20
|
"types": "index.d.ts",
|
|
20
21
|
"scripts": {
|
|
21
22
|
"build": "pnpm -w build:ui $npm_package_name",
|
package/src/index.d.ts
CHANGED