@opentinyvue/vue-dropdown 3.21.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
@@ -7,7 +7,7 @@ function _extends() {
7
7
  return n;
8
8
  }, _extends.apply(null, arguments);
9
9
  }
10
- import { defineComponent, $prefix, $setup, $props } from "@opentinyvue/vue-common";
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 = "3.21.0";
118
+ var version = "3.22.0";
114
119
  Dropdown.install = function(Vue) {
115
120
  Vue.component(Dropdown.name, Dropdown);
116
121
  };
@@ -8,12 +8,12 @@ function _extends() {
8
8
  }, _extends.apply(null, arguments);
9
9
  }
10
10
  import { createVNode, resolveComponent, withDirectives, resolveDirective } from "vue";
11
- import { renderless, api } from "@opentinyvue/vue-renderless/dropdown/vue";
12
- import { defineComponent, $prefix, directive, $props, setup as _setup, h } from "@opentinyvue/vue-common";
11
+ import { api, renderless } from "@opentinyvue/vue-renderless/dropdown/vue";
12
+ import { defineComponent, $props, directive, setup as _setup, h, $prefix } from "@opentinyvue/vue-common";
13
13
  import Button from "@opentinyvue/vue-button";
14
14
  import ButtonGroup from "@opentinyvue/vue-button-group";
15
- import Clickoutside from "@opentinyvue/vue-renderless/common/deps/clickoutside";
16
- import { IconChevronDown, IconChevronUp, IconArrowBottom } from "@opentinyvue/vue-icon";
15
+ import { Clickoutside } from "@opentinyvue/vue-directive";
16
+ import { IconArrowBottom, IconChevronUp, IconChevronDown } from "@opentinyvue/vue-icon";
17
17
  var _sfc_main = /* @__PURE__ */ defineComponent({
18
18
  name: $prefix + "Dropdown",
19
19
  componentName: "TinyDropdown",
package/lib/pc.js CHANGED
@@ -8,11 +8,11 @@ function _extends() {
8
8
  }, _extends.apply(null, arguments);
9
9
  }
10
10
  import { createVNode, resolveComponent, withDirectives, resolveDirective } from "vue";
11
- import { renderless, api } from "@opentinyvue/vue-renderless/dropdown/vue";
12
- import { defineComponent, $prefix, directive, $props, setup as _setup, h } from "@opentinyvue/vue-common";
11
+ import { api, renderless } from "@opentinyvue/vue-renderless/dropdown/vue";
12
+ import { defineComponent, $props, directive, setup as _setup, h, $prefix } from "@opentinyvue/vue-common";
13
13
  import Button from "@opentinyvue/vue-button";
14
14
  import ButtonGroup from "@opentinyvue/vue-button-group";
15
- import Clickoutside from "@opentinyvue/vue-renderless/common/deps/clickoutside";
15
+ import { Clickoutside } from "@opentinyvue/vue-directive";
16
16
  import DropdownMenu from "@opentinyvue/vue-dropdown-menu";
17
17
  import { iconDownWard } from "@opentinyvue/vue-icon";
18
18
  var _sfc_main = /* @__PURE__ */ defineComponent({
@@ -30,6 +30,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
30
30
  props: _extends({}, $props, {
31
31
  type: String,
32
32
  trigger: String,
33
+ // tiny新增
34
+ visible: {
35
+ type: [Boolean, void 0],
36
+ default: void 0
37
+ },
33
38
  size: {
34
39
  type: String,
35
40
  default: ""
@@ -94,7 +99,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
94
99
  default: false
95
100
  }
96
101
  }),
97
- emits: ["visible-change", "item-click", "button-click", "menu-item-click", "handle-click", "is-disabled", "selected-index"],
102
+ emits: ["visible-change", "item-click", "button-click", "menu-item-click", "handle-click", "is-disabled", "selected-index", "update:visible"],
98
103
  setup: function setup(props, context) {
99
104
  return _setup({
100
105
  props,
@@ -107,13 +112,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
107
112
  render: function render() {
108
113
  var _state$designConfig, _state$designConfig$i, _state$designConfig2, _state$designConfig2$;
109
114
  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;
110
- var slots = this.slots, size = this.size, state = this.state, border = this.border, showIcon = this.showIcon, round = this.round, clickOutside = this.clickOutside;
115
+ 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;
111
116
  var params = {
112
117
  visible: state.visible
113
118
  };
114
119
  var triggerElm = null;
115
120
  var triggerClass = "tiny-dropdown__trigger tiny-dropdown-trigger";
116
- var visibleClass = state.visible ? "tiny-dropdown--visible tiny-dropdown-visible" : "";
121
+ var addVisibleClass = state.visibleIsBoolean ? visible : state.visible;
122
+ var visibleClass = addVisibleClass ? "tiny-dropdown--visible tiny-dropdown-visible" : "";
117
123
  var IconDown = suffixIcon || ((_state$designConfig = state.designConfig) == null ? void 0 : (_state$designConfig$i = _state$designConfig.icons) == null ? void 0 : _state$designConfig$i.dropdownIcon) || iconDownWard();
118
124
  var IconPre = prefixIcon;
119
125
  var ButtonIconDown = ((_state$designConfig2 = state.designConfig) == null ? void 0 : (_state$designConfig2$ = _state$designConfig2.icons) == null ? void 0 : _state$designConfig2$.dropdownIcon) || iconDownWard();
@@ -192,7 +198,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
192
198
  return withDirectives(createVNode("div", {
193
199
  "class": "tiny-dropdown",
194
200
  "aria-disabled": disabled
195
- }, [triggerElm, menuElm]), [[resolveDirective("clickoutside"), clickOutside]]);
201
+ }, [triggerElm, menuElm]), [[resolveDirective("clickoutside"), !state.visibleIsBoolean && clickOutside]]);
196
202
  }
197
203
  });
198
204
  export {
package/package.json CHANGED
@@ -1,21 +1,22 @@
1
1
  {
2
2
  "name": "@opentinyvue/vue-dropdown",
3
- "version": "3.21.0",
3
+ "type": "module",
4
+ "version": "3.22.0",
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-renderless": "~3.21.0",
11
- "@opentinyvue/vue-theme": "~3.21.0",
12
- "@opentinyvue/vue-button": "~3.21.0",
13
- "@opentinyvue/vue-button-group": "~3.21.0",
14
- "@opentinyvue/vue-common": "~3.21.0",
15
- "@opentinyvue/vue-icon": "~3.21.0",
16
- "@opentinyvue/vue-dropdown-menu": "~3.21.0"
11
+ "@opentinyvue/vue-button": "~3.22.0",
12
+ "@opentinyvue/vue-button-group": "~3.22.0",
13
+ "@opentinyvue/vue-common": "~3.22.0",
14
+ "@opentinyvue/vue-directive": "~3.22.0",
15
+ "@opentinyvue/vue-dropdown-menu": "~3.22.0",
16
+ "@opentinyvue/vue-icon": "~3.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
@@ -1,83 +1,9 @@
1
1
  export declare const dropdownProps: {
2
2
  modelValue: (StringConstructor | NumberConstructor)[];
3
- type: StringConstructor;
4
- trigger: StringConstructor;
5
- size: {
6
- type: StringConstructor;
7
- default: string;
8
- };
9
- disabled: {
10
- type: BooleanConstructor;
11
- default: boolean;
12
- };
13
- splitButton: BooleanConstructor;
14
- singleButton: {
15
- type: BooleanConstructor;
16
- default: boolean;
17
- };
18
- showTimeout: {
19
- type: NumberConstructor;
20
- default: number;
3
+ visible: {
4
+ type: (BooleanConstructor | undefined)[];
5
+ default: undefined;
21
6
  };
22
- hideTimeout: {
23
- type: NumberConstructor;
24
- default: number;
25
- };
26
- hideOnClick: {
27
- type: BooleanConstructor;
28
- default: boolean;
29
- };
30
- tabindex: {
31
- type: NumberConstructor;
32
- default: number;
33
- };
34
- border: {
35
- type: BooleanConstructor;
36
- default: boolean;
37
- };
38
- round: {
39
- type: BooleanConstructor;
40
- default: boolean;
41
- };
42
- showIcon: {
43
- type: BooleanConstructor;
44
- default: boolean;
45
- };
46
- showSelfIcon: {
47
- type: BooleanConstructor;
48
- default: boolean;
49
- };
50
- menuOptions: {
51
- type: ObjectConstructor;
52
- default: () => {
53
- options: never[];
54
- textField: string;
55
- popperClass: string;
56
- placement: string;
57
- };
58
- };
59
- title: {
60
- type: StringConstructor;
61
- default: string;
62
- };
63
- inheritWidth: {
64
- type: BooleanConstructor;
65
- default: boolean;
66
- };
67
- suffixIcon: ObjectConstructor;
68
- lazyShowPopper: {
69
- type: BooleanConstructor;
70
- default: boolean;
71
- };
72
- tiny_mode: StringConstructor;
73
- tiny_mode_root: BooleanConstructor;
74
- tiny_template: (ObjectConstructor | FunctionConstructor)[];
75
- tiny_renderless: FunctionConstructor;
76
- tiny_theme: StringConstructor;
77
- tiny_chart_theme: ObjectConstructor;
78
- };
79
- declare const _default: import("@vue/runtime-core").DefineComponent<{
80
- modelValue: (StringConstructor | NumberConstructor)[];
81
7
  type: StringConstructor;
82
8
  trigger: StringConstructor;
83
9
  size: {
@@ -153,102 +79,6 @@ declare const _default: import("@vue/runtime-core").DefineComponent<{
153
79
  tiny_renderless: FunctionConstructor;
154
80
  tiny_theme: StringConstructor;
155
81
  tiny_chart_theme: ObjectConstructor;
156
- }, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
157
- [key: string]: any;
158
- }>, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
159
- modelValue: (StringConstructor | NumberConstructor)[];
160
- type: StringConstructor;
161
- trigger: StringConstructor;
162
- size: {
163
- type: StringConstructor;
164
- default: string;
165
- };
166
- disabled: {
167
- type: BooleanConstructor;
168
- default: boolean;
169
- };
170
- splitButton: BooleanConstructor;
171
- singleButton: {
172
- type: BooleanConstructor;
173
- default: boolean;
174
- };
175
- showTimeout: {
176
- type: NumberConstructor;
177
- default: number;
178
- };
179
- hideTimeout: {
180
- type: NumberConstructor;
181
- default: number;
182
- };
183
- hideOnClick: {
184
- type: BooleanConstructor;
185
- default: boolean;
186
- };
187
- tabindex: {
188
- type: NumberConstructor;
189
- default: number;
190
- };
191
- border: {
192
- type: BooleanConstructor;
193
- default: boolean;
194
- };
195
- round: {
196
- type: BooleanConstructor;
197
- default: boolean;
198
- };
199
- showIcon: {
200
- type: BooleanConstructor;
201
- default: boolean;
202
- };
203
- showSelfIcon: {
204
- type: BooleanConstructor;
205
- default: boolean;
206
- };
207
- menuOptions: {
208
- type: ObjectConstructor;
209
- default: () => {
210
- options: never[];
211
- textField: string;
212
- popperClass: string;
213
- placement: string;
214
- };
215
- };
216
- title: {
217
- type: StringConstructor;
218
- default: string;
219
- };
220
- inheritWidth: {
221
- type: BooleanConstructor;
222
- default: boolean;
223
- };
224
- suffixIcon: ObjectConstructor;
225
- lazyShowPopper: {
226
- type: BooleanConstructor;
227
- default: boolean;
228
- };
229
- tiny_mode: StringConstructor;
230
- tiny_mode_root: BooleanConstructor;
231
- tiny_template: (ObjectConstructor | FunctionConstructor)[];
232
- tiny_renderless: FunctionConstructor;
233
- tiny_theme: StringConstructor;
234
- tiny_chart_theme: ObjectConstructor;
235
- }>>, {
236
- disabled: boolean;
237
- title: string;
238
- size: string;
239
- tiny_mode_root: boolean;
240
- splitButton: boolean;
241
- singleButton: boolean;
242
- showTimeout: number;
243
- hideTimeout: number;
244
- hideOnClick: boolean;
245
- tabindex: number;
246
- border: boolean;
247
- round: boolean;
248
- showIcon: boolean;
249
- showSelfIcon: boolean;
250
- menuOptions: Record<string, any>;
251
- inheritWidth: boolean;
252
- lazyShowPopper: boolean;
253
- }, {}>;
82
+ };
83
+ declare const _default: import("@vue/runtime-core").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("@vue/runtime-core").PublicProps>;
254
84
  export default _default;
package/src/pc.vue.d.ts CHANGED
@@ -1,173 +1,2 @@
1
- declare const _default: import("@vue/runtime-core").DefineComponent<{
2
- type: StringConstructor;
3
- trigger: StringConstructor;
4
- size: {
5
- type: StringConstructor;
6
- default: string;
7
- };
8
- disabled: {
9
- type: BooleanConstructor;
10
- default: boolean;
11
- };
12
- splitButton: BooleanConstructor;
13
- showTimeout: {
14
- type: NumberConstructor;
15
- default: number;
16
- };
17
- hideTimeout: {
18
- type: NumberConstructor;
19
- default: number;
20
- };
21
- hideOnClick: {
22
- type: BooleanConstructor;
23
- default: boolean;
24
- };
25
- tabindex: {
26
- type: NumberConstructor;
27
- default: number;
28
- };
29
- border: {
30
- type: BooleanConstructor;
31
- default: boolean;
32
- };
33
- round: {
34
- type: BooleanConstructor;
35
- default: boolean;
36
- };
37
- showIcon: {
38
- type: BooleanConstructor;
39
- default: boolean;
40
- };
41
- menuOptions: {
42
- type: ObjectConstructor;
43
- default: () => {
44
- options: never[];
45
- textField: string;
46
- popperClass: string;
47
- placement: string;
48
- };
49
- };
50
- title: {
51
- type: StringConstructor;
52
- default: string;
53
- };
54
- inheritWidth: {
55
- type: BooleanConstructor;
56
- default: boolean;
57
- };
58
- suffixIcon: ObjectConstructor;
59
- prefixIcon: ObjectConstructor;
60
- lazyShowPopper: {
61
- type: BooleanConstructor;
62
- default: boolean;
63
- };
64
- tiny_mode: StringConstructor;
65
- tiny_mode_root: BooleanConstructor;
66
- tiny_template: (ObjectConstructor | FunctionConstructor)[];
67
- tiny_renderless: FunctionConstructor;
68
- tiny_theme: StringConstructor;
69
- tiny_chart_theme: ObjectConstructor;
70
- }, {
71
- t: (this: any, path: any, options?: any) => any;
72
- vm: any;
73
- f: (props: any, attrs?: {}) => {};
74
- a: (attrs: any, filters: any, include: any) => {};
75
- d: (props: any) => void;
76
- dp: (props: any) => void;
77
- gcls: (key: any) => any;
78
- m: (...cssClasses: any[]) => string;
79
- }, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("item-click" | "visible-change" | "handle-click" | "is-disabled" | "menu-item-click" | "selected-index" | "button-click")[], "item-click" | "visible-change" | "handle-click" | "is-disabled" | "menu-item-click" | "selected-index" | "button-click", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
80
- type: StringConstructor;
81
- trigger: StringConstructor;
82
- size: {
83
- type: StringConstructor;
84
- default: string;
85
- };
86
- disabled: {
87
- type: BooleanConstructor;
88
- default: boolean;
89
- };
90
- splitButton: BooleanConstructor;
91
- showTimeout: {
92
- type: NumberConstructor;
93
- default: number;
94
- };
95
- hideTimeout: {
96
- type: NumberConstructor;
97
- default: number;
98
- };
99
- hideOnClick: {
100
- type: BooleanConstructor;
101
- default: boolean;
102
- };
103
- tabindex: {
104
- type: NumberConstructor;
105
- default: number;
106
- };
107
- border: {
108
- type: BooleanConstructor;
109
- default: boolean;
110
- };
111
- round: {
112
- type: BooleanConstructor;
113
- default: boolean;
114
- };
115
- showIcon: {
116
- type: BooleanConstructor;
117
- default: boolean;
118
- };
119
- menuOptions: {
120
- type: ObjectConstructor;
121
- default: () => {
122
- options: never[];
123
- textField: string;
124
- popperClass: string;
125
- placement: string;
126
- };
127
- };
128
- title: {
129
- type: StringConstructor;
130
- default: string;
131
- };
132
- inheritWidth: {
133
- type: BooleanConstructor;
134
- default: boolean;
135
- };
136
- suffixIcon: ObjectConstructor;
137
- prefixIcon: ObjectConstructor;
138
- lazyShowPopper: {
139
- type: BooleanConstructor;
140
- default: boolean;
141
- };
142
- tiny_mode: StringConstructor;
143
- tiny_mode_root: BooleanConstructor;
144
- tiny_template: (ObjectConstructor | FunctionConstructor)[];
145
- tiny_renderless: FunctionConstructor;
146
- tiny_theme: StringConstructor;
147
- tiny_chart_theme: ObjectConstructor;
148
- }>> & {
149
- "onItem-click"?: ((...args: any[]) => any) | undefined;
150
- "onVisible-change"?: ((...args: any[]) => any) | undefined;
151
- "onMenu-item-click"?: ((...args: any[]) => any) | undefined;
152
- "onIs-disabled"?: ((...args: any[]) => any) | undefined;
153
- "onSelected-index"?: ((...args: any[]) => any) | undefined;
154
- "onButton-click"?: ((...args: any[]) => any) | undefined;
155
- "onHandle-click"?: ((...args: any[]) => any) | undefined;
156
- }, {
157
- disabled: boolean;
158
- title: string;
159
- size: string;
160
- tiny_mode_root: boolean;
161
- splitButton: boolean;
162
- showTimeout: number;
163
- hideTimeout: number;
164
- hideOnClick: boolean;
165
- tabindex: number;
166
- border: boolean;
167
- round: boolean;
168
- showIcon: boolean;
169
- menuOptions: Record<string, any>;
170
- inheritWidth: boolean;
171
- lazyShowPopper: boolean;
172
- }, {}>;
1
+ declare const _default: import("@vue/runtime-core").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("@vue/runtime-core").PublicProps>;
173
2
  export default _default;