@opentinyvue/vue-float-button 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
@@ -113,7 +113,7 @@ var FloatButton = defineComponent({
113
113
  });
114
114
  }
115
115
  });
116
- var version = "2.22.0";
116
+ var version = "3.22.0";
117
117
  FloatButton.install = function(Vue) {
118
118
  Vue.component(FloatButton.name, FloatButton);
119
119
  };
package/lib/pc.js CHANGED
@@ -2,38 +2,42 @@ import { renderless, api } from '@opentinyvue/vue-renderless/float-button/vue';
2
2
  import { defineComponent, props, setup } from '@opentinyvue/vue-common';
3
3
  import { iconLoading, iconClose } from '@opentinyvue/vue-icon';
4
4
  import '@opentinyvue/vue-theme/float-button/index.css';
5
+ import { resolveComponent, withDirectives, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, createCommentVNode, resolveDynamicComponent, toDisplayString, renderSlot, 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
  emits: ["click", "mouseout", "mouseover"],
38
42
  props: [].concat(props, ["type", "open", "description", "size", "icon", "resetTime", "tooltip", "loading", "disabled", "href", "target", "top", "bottom", "right", "left", "trigger", "shape", "backTop", "visibilityHeight", "element"]),
39
43
  components: {
@@ -49,58 +53,66 @@ var __vue2_script = defineComponent({
49
53
  });
50
54
  }
51
55
  });
52
- var render = function render2() {
53
- var _vm = this;
54
- var _h = _vm.$createElement;
55
- var _c = _vm._self._c || _h;
56
- return _c("button", {
57
- directives: [{
58
- name: "show",
59
- rawName: "v-show",
60
- value: _vm.state.show,
61
- expression: "state.show"
62
- }],
63
- ref: "tinyFloatButton",
64
- staticClass: "tiny-float-button",
65
- class: [_vm.type ? "tiny-float-button--" + _vm.type : "", _vm.size ? "tiny-float-button--" + _vm.size : "", {
66
- "is-disabled": _vm.state.buttonDisabled,
67
- "is-loading": _vm.loading,
68
- "is-icon": _vm.icon && !_vm.loading && (_vm.description || _vm.slots.default),
69
- "is-only-icon": _vm.icon && !_vm.loading && !(_vm.description || _vm.slots.default),
70
- "is-circle": _vm.shape === "circle",
71
- "is-square": _vm.shape === "square"
72
- }],
73
- style: {
74
- top: _vm.top,
75
- bottom: _vm.bottom,
76
- right: _vm.right,
77
- left: _vm.left
78
- },
79
- on: {
80
- "click": _vm.handleClick
81
- }
82
- }, [_vm.loading ? _c("icon-loading", {
83
- staticClass: "tiny-icon-loading tiny-svg-size"
84
- }) : _vm._e(), _vm.icon && !_vm.loading && !_vm.state.open ? _c(_vm.icon, {
85
- tag: "component",
86
- class: {
87
- "is-text": _vm.description || _vm.slots.default
88
- }
89
- }) : _vm._e(), !_vm.loading && _vm.state.open ? _c("icon-close") : _vm._e(), _vm.description && !_vm.state.open ? _c("div", [_vm._v(_vm._s(_vm.description))]) : _vm._e(), _vm.state.open ? _c("div", {
90
- ref: "tinyFloatButtonOpen",
91
- staticClass: "tiny-float-button--open"
92
- }, [_vm._t("default")], 2) : _vm._e()], 1);
56
+ var _hoisted_1 = {
57
+ key: 3
93
58
  };
94
- var staticRenderFns = [];
95
- var __cssModules = {};
96
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
97
- function __vue2_injectStyles(context) {
98
- for (var o in __cssModules) {
99
- this[o] = __cssModules[o];
100
- }
59
+ var _hoisted_2 = {
60
+ key: 4,
61
+ ref: "tinyFloatButtonOpen",
62
+ class: "tiny-float-button--open"
63
+ };
64
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
65
+ var _component_icon_loading = resolveComponent("icon-loading");
66
+ var _component_icon_close = resolveComponent("icon-close");
67
+ return withDirectives((openBlock(), createElementBlock(
68
+ "button",
69
+ {
70
+ ref: "tinyFloatButton",
71
+ class: normalizeClass(["tiny-float-button", [_ctx.type ? "tiny-float-button--" + _ctx.type : "", _ctx.size ? "tiny-float-button--" + _ctx.size : "", {
72
+ "is-disabled": _ctx.state.buttonDisabled,
73
+ "is-loading": _ctx.loading,
74
+ "is-icon": _ctx.icon && !_ctx.loading && (_ctx.description || _ctx.slots.default),
75
+ "is-only-icon": _ctx.icon && !_ctx.loading && !(_ctx.description || _ctx.slots.default),
76
+ "is-circle": _ctx.shape === "circle",
77
+ "is-square": _ctx.shape === "square"
78
+ }]]),
79
+ onClick: _cache[0] || (_cache[0] = function() {
80
+ return _ctx.handleClick && _ctx.handleClick.apply(_ctx, arguments);
81
+ }),
82
+ style: normalizeStyle({
83
+ top: _ctx.top,
84
+ bottom: _ctx.bottom,
85
+ right: _ctx.right,
86
+ left: _ctx.left
87
+ })
88
+ },
89
+ [_ctx.loading ? (openBlock(), createBlock(_component_icon_loading, {
90
+ key: 0,
91
+ class: "tiny-icon-loading tiny-svg-size"
92
+ })) : createCommentVNode("v-if", true), _ctx.icon && !_ctx.loading && !_ctx.state.open ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), {
93
+ key: 1,
94
+ class: normalizeClass({
95
+ "is-text": _ctx.description || _ctx.slots.default
96
+ })
97
+ }, null, 8, ["class"])) : createCommentVNode("v-if", true), !_ctx.loading && _ctx.state.open ? (openBlock(), createBlock(_component_icon_close, {
98
+ key: 2
99
+ })) : createCommentVNode("v-if", true), _ctx.description && !_ctx.state.open ? (openBlock(), createElementBlock(
100
+ "div",
101
+ _hoisted_1,
102
+ toDisplayString(_ctx.description),
103
+ 1
104
+ /* TEXT */
105
+ )) : createCommentVNode("v-if", true), _ctx.state.open ? (openBlock(), createElementBlock(
106
+ "div",
107
+ _hoisted_2,
108
+ [renderSlot(_ctx.$slots, "default")],
109
+ 512
110
+ /* NEED_PATCH */
111
+ )) : createCommentVNode("v-if", true)],
112
+ 6
113
+ /* CLASS, STYLE */
114
+ )), [[vShow, _ctx.state.show]]);
101
115
  }
102
- var pc = /* @__PURE__ */ function() {
103
- return __component__.exports;
104
- }();
116
+ var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
105
117
 
106
118
  export { pc as default };
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@opentinyvue/vue-float-button",
3
3
  "type": "module",
4
- "version": "2.22.0",
4
+ "version": "3.22.0",
5
5
  "description": "",
6
6
  "license": "MIT",
7
7
  "sideEffects": false,
8
8
  "main": "./lib/index.js",
9
9
  "module": "./lib/index.js",
10
10
  "dependencies": {
11
- "@opentinyvue/utils": "~2.22.0",
12
- "@opentinyvue/vue-common": "~2.22.0",
13
- "@opentinyvue/vue-icon": "~2.22.0",
11
+ "@opentinyvue/utils": "~3.22.0",
12
+ "@opentinyvue/vue-common": "~3.22.0",
13
+ "@opentinyvue/vue-icon": "~3.22.0",
14
14
  "@opentinyvue/vue-renderless": "~3.22.0",
15
15
  "@opentinyvue/vue-theme": "~3.22.0"
16
16
  },
package/src/index.d.ts CHANGED
@@ -80,5 +80,191 @@ export declare const floatButtonProps: {
80
80
  tiny_theme: StringConstructor;
81
81
  tiny_chart_theme: ObjectConstructor;
82
82
  };
83
- declare const _default: any;
83
+ declare const _default: import("@vue/runtime-core").DefineComponent<{
84
+ trigger: {
85
+ default: string;
86
+ type: StringConstructor;
87
+ validator(val: string): boolean;
88
+ };
89
+ open: BooleanConstructor;
90
+ shape: {
91
+ type: StringConstructor;
92
+ default: string;
93
+ validator(val: string): boolean;
94
+ };
95
+ top: {
96
+ type: StringConstructor;
97
+ default: string;
98
+ };
99
+ bottom: {
100
+ type: StringConstructor;
101
+ default: string;
102
+ };
103
+ right: {
104
+ type: StringConstructor;
105
+ default: string;
106
+ };
107
+ left: {
108
+ type: StringConstructor;
109
+ default: string;
110
+ };
111
+ href: {
112
+ type: StringConstructor;
113
+ default: string;
114
+ };
115
+ target: {
116
+ type: StringConstructor;
117
+ default: string;
118
+ };
119
+ type: {
120
+ type: StringConstructor;
121
+ default: string;
122
+ };
123
+ icon: {
124
+ type: (StringConstructor | ObjectConstructor)[];
125
+ default: string;
126
+ };
127
+ description: {
128
+ type: StringConstructor;
129
+ default: string;
130
+ };
131
+ tooltip: {
132
+ type: StringConstructor;
133
+ default: string;
134
+ };
135
+ resetTime: {
136
+ type: NumberConstructor;
137
+ default: number;
138
+ };
139
+ size: {
140
+ type: StringConstructor;
141
+ default: string;
142
+ validator(val: string): boolean;
143
+ };
144
+ loading: BooleanConstructor;
145
+ disabled: BooleanConstructor;
146
+ backTop: BooleanConstructor;
147
+ visibilityHeight: {
148
+ default: number;
149
+ type: NumberConstructor;
150
+ };
151
+ element: {
152
+ default: HTMLElement | null;
153
+ type: ObjectConstructor | {
154
+ new (): HTMLElement;
155
+ prototype: HTMLElement;
156
+ };
157
+ };
158
+ tiny_mode: StringConstructor;
159
+ tiny_mode_root: BooleanConstructor;
160
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
161
+ tiny_renderless: FunctionConstructor;
162
+ tiny_theme: StringConstructor;
163
+ tiny_chart_theme: ObjectConstructor;
164
+ }, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
165
+ [key: string]: any;
166
+ }>, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
167
+ trigger: {
168
+ default: string;
169
+ type: StringConstructor;
170
+ validator(val: string): boolean;
171
+ };
172
+ open: BooleanConstructor;
173
+ shape: {
174
+ type: StringConstructor;
175
+ default: string;
176
+ validator(val: string): boolean;
177
+ };
178
+ top: {
179
+ type: StringConstructor;
180
+ default: string;
181
+ };
182
+ bottom: {
183
+ type: StringConstructor;
184
+ default: string;
185
+ };
186
+ right: {
187
+ type: StringConstructor;
188
+ default: string;
189
+ };
190
+ left: {
191
+ type: StringConstructor;
192
+ default: string;
193
+ };
194
+ href: {
195
+ type: StringConstructor;
196
+ default: string;
197
+ };
198
+ target: {
199
+ type: StringConstructor;
200
+ default: string;
201
+ };
202
+ type: {
203
+ type: StringConstructor;
204
+ default: string;
205
+ };
206
+ icon: {
207
+ type: (StringConstructor | ObjectConstructor)[];
208
+ default: string;
209
+ };
210
+ description: {
211
+ type: StringConstructor;
212
+ default: string;
213
+ };
214
+ tooltip: {
215
+ type: StringConstructor;
216
+ default: string;
217
+ };
218
+ resetTime: {
219
+ type: NumberConstructor;
220
+ default: number;
221
+ };
222
+ size: {
223
+ type: StringConstructor;
224
+ default: string;
225
+ validator(val: string): boolean;
226
+ };
227
+ loading: BooleanConstructor;
228
+ disabled: BooleanConstructor;
229
+ backTop: BooleanConstructor;
230
+ visibilityHeight: {
231
+ default: number;
232
+ type: NumberConstructor;
233
+ };
234
+ element: {
235
+ default: HTMLElement | null;
236
+ type: ObjectConstructor | {
237
+ new (): HTMLElement;
238
+ prototype: HTMLElement;
239
+ };
240
+ };
241
+ tiny_mode: StringConstructor;
242
+ tiny_mode_root: BooleanConstructor;
243
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
244
+ tiny_renderless: FunctionConstructor;
245
+ tiny_theme: StringConstructor;
246
+ tiny_chart_theme: ObjectConstructor;
247
+ }>>, {
248
+ disabled: boolean;
249
+ icon: string | Record<string, any>;
250
+ href: string;
251
+ top: string;
252
+ right: string;
253
+ bottom: string;
254
+ left: string;
255
+ size: string;
256
+ type: string;
257
+ target: string;
258
+ element: any;
259
+ loading: boolean;
260
+ tiny_mode_root: boolean;
261
+ trigger: string;
262
+ resetTime: number;
263
+ description: string;
264
+ shape: string;
265
+ open: boolean;
266
+ tooltip: string;
267
+ backTop: boolean;
268
+ visibilityHeight: number;
269
+ }, {}>;
84
270
  export default _default;
package/src/pc.vue.d.ts CHANGED
@@ -1,2 +1,91 @@
1
- declare const _default: any;
1
+ import type { IFloatButtonApi } from '@opentinyvue/vue-renderless/types/float-button.type';
2
+ declare const _default: import("@vue/runtime-core").DefineComponent<Readonly<{
3
+ disabled?: any;
4
+ icon?: any;
5
+ href?: any;
6
+ top?: any;
7
+ right?: any;
8
+ bottom?: any;
9
+ left?: any;
10
+ size?: any;
11
+ type?: any;
12
+ target?: any;
13
+ element?: any;
14
+ loading?: any;
15
+ tiny_mode?: any;
16
+ tiny_mode_root?: any;
17
+ tiny_template?: any;
18
+ tiny_renderless?: any;
19
+ _constants?: any;
20
+ tiny_theme?: any;
21
+ tiny_chart_theme?: any;
22
+ trigger?: any;
23
+ resetTime?: any;
24
+ description?: any;
25
+ shape?: any;
26
+ open?: any;
27
+ tooltip?: any;
28
+ backTop?: any;
29
+ visibilityHeight?: any;
30
+ }>, IFloatButtonApi, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("click" | "mouseout" | "mouseover")[], "click" | "mouseout" | "mouseover", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<Readonly<{
31
+ disabled?: any;
32
+ icon?: any;
33
+ href?: any;
34
+ top?: any;
35
+ right?: any;
36
+ bottom?: any;
37
+ left?: any;
38
+ size?: any;
39
+ type?: any;
40
+ target?: any;
41
+ element?: any;
42
+ loading?: any;
43
+ tiny_mode?: any;
44
+ tiny_mode_root?: any;
45
+ tiny_template?: any;
46
+ tiny_renderless?: any;
47
+ _constants?: any;
48
+ tiny_theme?: any;
49
+ tiny_chart_theme?: any;
50
+ trigger?: any;
51
+ resetTime?: any;
52
+ description?: any;
53
+ shape?: any;
54
+ open?: any;
55
+ tooltip?: any;
56
+ backTop?: any;
57
+ visibilityHeight?: any;
58
+ }>>> & {
59
+ onClick?: ((...args: any[]) => any) | undefined;
60
+ onMouseout?: ((...args: any[]) => any) | undefined;
61
+ onMouseover?: ((...args: any[]) => any) | undefined;
62
+ }, {
63
+ readonly disabled?: any;
64
+ readonly icon?: any;
65
+ readonly href?: any;
66
+ readonly top?: any;
67
+ readonly right?: any;
68
+ readonly bottom?: any;
69
+ readonly left?: any;
70
+ readonly size?: any;
71
+ readonly type?: any;
72
+ readonly target?: any;
73
+ readonly element?: any;
74
+ readonly loading?: any;
75
+ readonly tiny_mode?: any;
76
+ readonly tiny_mode_root?: any;
77
+ readonly tiny_template?: any;
78
+ readonly tiny_renderless?: any;
79
+ readonly _constants?: any;
80
+ readonly tiny_theme?: any;
81
+ readonly tiny_chart_theme?: any;
82
+ readonly trigger?: any;
83
+ readonly resetTime?: any;
84
+ readonly description?: any;
85
+ readonly shape?: any;
86
+ readonly open?: any;
87
+ readonly tooltip?: any;
88
+ readonly backTop?: any;
89
+ readonly visibilityHeight?: any;
90
+ }, {}>;
2
91
  export default _default;