@opentinyvue/vue-floating-button 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 +22 -0
- package/index.d.ts +2 -0
- package/lib/index.js +79 -0
- package/lib/mobile-first.js +184 -0
- package/package.json +20 -0
- package/src/index.d.ts +50 -0
- package/src/mobile-first.vue.d.ts +2 -0
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
package/lib/index.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
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 MobileFirstTemplate from "./mobile-first.js";
|
|
12
|
+
var template = function template2(mode) {
|
|
13
|
+
var _process$env;
|
|
14
|
+
typeof process === "object" ? (_process$env = process.env) == null ? void 0 : _process$env.TINY_MODE : null;
|
|
15
|
+
return MobileFirstTemplate;
|
|
16
|
+
};
|
|
17
|
+
var floatingButtonProps = _extends({}, $props, {
|
|
18
|
+
position: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "right"
|
|
21
|
+
},
|
|
22
|
+
backgroundColor: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ""
|
|
25
|
+
},
|
|
26
|
+
icon: {
|
|
27
|
+
type: [Object, String],
|
|
28
|
+
default: "icon-plus"
|
|
29
|
+
},
|
|
30
|
+
resetTime: {
|
|
31
|
+
type: [String, Number],
|
|
32
|
+
default: 0
|
|
33
|
+
},
|
|
34
|
+
animated: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
},
|
|
38
|
+
expandList: {
|
|
39
|
+
type: Array,
|
|
40
|
+
default: function _default() {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
isExpand: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
vague: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
mask: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
elementSelector: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: ""
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
var FloatingButton = defineComponent({
|
|
62
|
+
name: $prefix + "FloatingButton",
|
|
63
|
+
props: floatingButtonProps,
|
|
64
|
+
setup: function setup(props, context) {
|
|
65
|
+
return $setup({
|
|
66
|
+
props,
|
|
67
|
+
context,
|
|
68
|
+
template
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
var version = "2.21.0";
|
|
73
|
+
FloatingButton.install = function(Vue) {
|
|
74
|
+
Vue.component(FloatingButton.name, FloatingButton);
|
|
75
|
+
};
|
|
76
|
+
FloatingButton.version = version;
|
|
77
|
+
export {
|
|
78
|
+
FloatingButton as default
|
|
79
|
+
};
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { renderless, api } from '@opentinyvue/vue-renderless/floating-button/vue';
|
|
2
|
+
import { defineComponent, props, setup } from '@opentinyvue/vue-common';
|
|
3
|
+
import { iconPlus } from '@opentinyvue/vue-icon';
|
|
4
|
+
|
|
5
|
+
function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
6
|
+
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
7
|
+
if (render) {
|
|
8
|
+
options.render = render;
|
|
9
|
+
options.staticRenderFns = staticRenderFns;
|
|
10
|
+
options._compiled = true;
|
|
11
|
+
}
|
|
12
|
+
var hook;
|
|
13
|
+
if (injectStyles) {
|
|
14
|
+
hook = injectStyles;
|
|
15
|
+
}
|
|
16
|
+
if (hook) {
|
|
17
|
+
if (options.functional) {
|
|
18
|
+
options._injectStyles = hook;
|
|
19
|
+
var originalRender = options.render;
|
|
20
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
21
|
+
hook.call(context);
|
|
22
|
+
return originalRender(h, context);
|
|
23
|
+
};
|
|
24
|
+
} else {
|
|
25
|
+
var existing = options.beforeCreate;
|
|
26
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
exports: scriptExports,
|
|
31
|
+
options
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var __vue2_script = defineComponent({
|
|
36
|
+
emits: ["click"],
|
|
37
|
+
props: [].concat(props, ["position", "backgroundColor", "icon", "resetTime", "animated", "expandList", "isExpand", "vague", "mask", "elementSelector"]),
|
|
38
|
+
components: {
|
|
39
|
+
IconPlus: iconPlus()
|
|
40
|
+
},
|
|
41
|
+
setup: function setup$1(props2, context) {
|
|
42
|
+
return setup({
|
|
43
|
+
props: props2,
|
|
44
|
+
context,
|
|
45
|
+
renderless,
|
|
46
|
+
api
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
var render = function render2() {
|
|
51
|
+
var _vm = this;
|
|
52
|
+
var _h = _vm.$createElement;
|
|
53
|
+
var _c = _vm._self._c || _h;
|
|
54
|
+
return _c("div", {
|
|
55
|
+
attrs: {
|
|
56
|
+
"data-tag": "tiny-floating-button-body"
|
|
57
|
+
}
|
|
58
|
+
}, [_vm.vague || _vm.mask ? _c("div", {
|
|
59
|
+
class: ["w-screen h-screen fixed top-0 bottom-0 left-0 right-0", {
|
|
60
|
+
"bg-color-fill-5 backdrop-blur-md": _vm.vague
|
|
61
|
+
}, {
|
|
62
|
+
"bg-black opacity-30": _vm.mask
|
|
63
|
+
}],
|
|
64
|
+
attrs: {
|
|
65
|
+
"data-tag": "tiny-floating-button-mask"
|
|
66
|
+
}
|
|
67
|
+
}) : _vm._e(), _c("div", {
|
|
68
|
+
class: ["rounded-full fixed bottom-11 leading-none", _vm.position === "center" ? "" : _vm.position === "left" ? !_vm.state.specialHiddenSpace && "left-3" : "right-3"],
|
|
69
|
+
style: _vm.state.style,
|
|
70
|
+
attrs: {
|
|
71
|
+
"data-tag": "tiny-floating-button"
|
|
72
|
+
}
|
|
73
|
+
}, [_c("button", {
|
|
74
|
+
ref: "floatingButton",
|
|
75
|
+
class: _vm.m("w-11 h-11 p-3 rounded-full", _vm.state.disabled ? "text-color-text-disabled bg-color-bg-3 border-transparent active:cursor-not-allowed" : _vm.backgroundColor === "white" ? "bg-color-bg-1" : "text-color-bg-1 bg-color-brand"),
|
|
76
|
+
attrs: {
|
|
77
|
+
"data-tag": "tiny-floating-button-main"
|
|
78
|
+
},
|
|
79
|
+
on: {
|
|
80
|
+
"click": function click($event) {
|
|
81
|
+
return _vm.handleClick($event, 0);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}, [_c(_vm.icon, {
|
|
85
|
+
tag: "component",
|
|
86
|
+
class: _vm.m("w-5 h-5 rotate-0 transition-transform duration-300 will-change-transform", _vm.state.disabled ? "fill-color-icon-disabled active:cursor-not-allowed" : _vm.backgroundColor === "white" ? "fill-color-icon-secondary" : "fill-color-bg-1", {
|
|
87
|
+
"rotate-45": _vm.state.isExpand
|
|
88
|
+
}),
|
|
89
|
+
attrs: {
|
|
90
|
+
"data-tag": "tiny-floating-button-icon"
|
|
91
|
+
}
|
|
92
|
+
})], 1), _vm.state.expandList && _vm.state.expandList.length >= 1 ? _c("div", {
|
|
93
|
+
class: _vm.m("absolute -bottom-5 -mb-0.5 -left-0.5 -z-10 transition-bottom ease-linear duration-100 cursor-pointer", {
|
|
94
|
+
"bottom-18 [&_span]:opacity-100 [&_span]:visible": _vm.state.isExpand && _vm.position === "right"
|
|
95
|
+
}, {
|
|
96
|
+
"bottom-16 -mb-1 [&_span]:opacity-100 [&_span]:visible": _vm.state.isExpand && _vm.position === "center"
|
|
97
|
+
}, {
|
|
98
|
+
"bottom-18 [&_span]:opacity-100 [&_span]:visible": _vm.state.isExpand && _vm.position === "left"
|
|
99
|
+
}),
|
|
100
|
+
attrs: {
|
|
101
|
+
"data-tag": "tiny-floating-button-expand-first"
|
|
102
|
+
},
|
|
103
|
+
on: {
|
|
104
|
+
"click": function click($event) {
|
|
105
|
+
return _vm.handleClick($event, 1);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}, [_c("button", {
|
|
109
|
+
class: _vm.m("w-11 h-11 rounded-full mx-0.5", _vm.state.disabled ? "text-color-text-disabled bg-color-bg-3 border-transparent active:cursor-not-allowed" : "bg-color-info-primary-subtler")
|
|
110
|
+
}, [_c(_vm.state.expandList && _vm.state.expandList[0].icon, {
|
|
111
|
+
tag: "component",
|
|
112
|
+
class: ["w-5 h-5", _vm.state.disabled ? "fill-color-icon-disabled active:cursor-not-allowed" : "fill-color-brand"],
|
|
113
|
+
attrs: {
|
|
114
|
+
"data-tag": "tiny-floating-button-icon"
|
|
115
|
+
}
|
|
116
|
+
})], 1), _c("span", {
|
|
117
|
+
class: ["text-center mt-0.5 text-xs w-12 leading-5 block opacity-0 transition-opacity ease-linear duration-100 invisible", !_vm.mask ? "text-color-fill-primary" : "text-color-bg-1"]
|
|
118
|
+
}, [_vm._v(_vm._s(_vm.state.expandList && _vm.state.expandList[0].title))])]) : _vm._e(), _vm.state.expandList && _vm.state.expandList.length >= 2 ? _c("div", {
|
|
119
|
+
class: _vm.m("absolute -bottom-5 -mb-0.5 -left-0.5 -z-10 transition-bottom ease-linear duration-100 cursor-pointer", {
|
|
120
|
+
"-left-18 bottom-11 mb-0 [&_span]:opacity-100 [&_span]:visible": _vm.state.isExpand && _vm.position === "right"
|
|
121
|
+
}, {
|
|
122
|
+
"-left-18 right-auto bottom-4.5 mb-0 [&_span]:opacity-100 [&_span]:visible": _vm.state.isExpand && _vm.position === "center"
|
|
123
|
+
}, {
|
|
124
|
+
"left-18 right-auto bottom-11 mb-0 [&_span]:opacity-100 [&_span]:visible": _vm.state.isExpand && _vm.position === "left"
|
|
125
|
+
}),
|
|
126
|
+
attrs: {
|
|
127
|
+
"data-tag": "tiny-floating-button-expand-second"
|
|
128
|
+
},
|
|
129
|
+
on: {
|
|
130
|
+
"click": function click($event) {
|
|
131
|
+
return _vm.handleClick($event, 2);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}, [_c("button", {
|
|
135
|
+
class: _vm.m("w-11 h-11 rounded-full mx-0.5", _vm.state.disabled ? "text-color-text-disabled bg-color-bg-3 border-transparent active:cursor-not-allowed" : "bg-color-success-subtler")
|
|
136
|
+
}, [_c(_vm.state.expandList && _vm.state.expandList[1].icon, {
|
|
137
|
+
tag: "component",
|
|
138
|
+
class: ["w-5 h-5", _vm.state.disabled ? "fill-color-icon-disabled active:cursor-not-allowed" : "fill-color-success-active"],
|
|
139
|
+
attrs: {
|
|
140
|
+
"data-tag": "tiny-floating-button-icon"
|
|
141
|
+
}
|
|
142
|
+
})], 1), _c("span", {
|
|
143
|
+
class: ["text-center text-xs mt-0.5 w-12 leading-5 block opacity-0 transition-opacity ease-linear duration-100 invisible", !_vm.mask ? "text-color-fill-primary" : "text-color-bg-1"]
|
|
144
|
+
}, [_vm._v(_vm._s(_vm.state.expandList && _vm.state.expandList[1].title))])]) : _vm._e(), _vm.state.expandList && _vm.state.expandList.length >= 3 ? _c("div", {
|
|
145
|
+
class: _vm.m("absolute -bottom-5 -mb-0.5 -left-0.5 -z-10 transition-bottom ease-linear duration-100 cursor-pointer", {
|
|
146
|
+
"-left-18 -bottom-9 -mb-1 [&_span]:opacity-100 [&_span]:visible": _vm.state.isExpand && _vm.position === "right"
|
|
147
|
+
}, {
|
|
148
|
+
"left-18 right-auto bottom-4.5 mb-0 [&_span]:opacity-100 [&_span]:visible": _vm.state.isExpand && _vm.position === "center"
|
|
149
|
+
}, {
|
|
150
|
+
"left-18 -bottom-9 -mb-1 right-auto [&_span]:opacity-100 [&_span]:visible": _vm.state.isExpand && _vm.position === "left"
|
|
151
|
+
}),
|
|
152
|
+
attrs: {
|
|
153
|
+
"data-tag": "tiny-floating-button-expand-third"
|
|
154
|
+
},
|
|
155
|
+
on: {
|
|
156
|
+
"click": function click($event) {
|
|
157
|
+
return _vm.handleClick($event, 3);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}, [_c("button", {
|
|
161
|
+
class: _vm.m("w-11 h-11 rounded-full mx-0.5", _vm.state.disabled ? "text-color-text-disabled bg-color-bg-3 border-transparent active:cursor-not-allowed" : "bg-color-warning-subtler")
|
|
162
|
+
}, [_c(_vm.state.expandList && _vm.state.expandList[2].icon, {
|
|
163
|
+
tag: "component",
|
|
164
|
+
class: ["w-5 h-5", _vm.state.disabled ? "fill-color-icon-disabled active:cursor-not-allowed" : "fill-color-alert-hover"],
|
|
165
|
+
attrs: {
|
|
166
|
+
"data-tag": "tiny-floating-button-icon"
|
|
167
|
+
}
|
|
168
|
+
})], 1), _c("span", {
|
|
169
|
+
class: ["text-center text-xs mt-0.5 w-12 leading-5 block opacity-0 transition-opacity ease-linear duration-100 invisible", !_vm.mask ? "text-color-fill-primary" : "text-color-bg-1"]
|
|
170
|
+
}, [_vm._v(_vm._s(_vm.state.expandList && _vm.state.expandList[2].title))])]) : _vm._e()])]);
|
|
171
|
+
};
|
|
172
|
+
var staticRenderFns = [];
|
|
173
|
+
var __cssModules = {};
|
|
174
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
|
|
175
|
+
function __vue2_injectStyles(context) {
|
|
176
|
+
for (var o in __cssModules) {
|
|
177
|
+
this[o] = __cssModules[o];
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
var mobileFirst = /* @__PURE__ */ function() {
|
|
181
|
+
return __component__.exports;
|
|
182
|
+
}();
|
|
183
|
+
|
|
184
|
+
export { mobileFirst as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opentinyvue/vue-floating-button",
|
|
3
|
+
"version": "2.21.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"module": "./lib/index.js",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./lib/index.js",
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@opentinyvue/vue-renderless": "~3.21.0",
|
|
11
|
+
"@opentinyvue/vue-common": "~2.21.0",
|
|
12
|
+
"@opentinyvue/vue-icon": "~2.21.0"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "pnpm -w build:ui $npm_package_name",
|
|
18
|
+
"//postversion": "pnpm build"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const floatingButtonProps: {
|
|
2
|
+
position: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
backgroundColor: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
icon: {
|
|
11
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
resetTime: {
|
|
15
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
16
|
+
default: number;
|
|
17
|
+
};
|
|
18
|
+
animated: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
expandList: {
|
|
23
|
+
type: ArrayConstructor;
|
|
24
|
+
default: () => never[];
|
|
25
|
+
};
|
|
26
|
+
isExpand: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: boolean;
|
|
29
|
+
};
|
|
30
|
+
vague: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
mask: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
elementSelector: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
tiny_mode: StringConstructor;
|
|
43
|
+
tiny_mode_root: BooleanConstructor;
|
|
44
|
+
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
45
|
+
tiny_renderless: FunctionConstructor;
|
|
46
|
+
tiny_theme: StringConstructor;
|
|
47
|
+
tiny_chart_theme: ObjectConstructor;
|
|
48
|
+
};
|
|
49
|
+
declare const _default: any;
|
|
50
|
+
export default _default;
|