@opentiny/vue-drawer 2.7.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 +111 -0
- package/lib/mobile-first.js +194 -0
- package/lib/pc.js +187 -0
- package/package.json +15 -0
- package/src/index.d.ts +66 -0
- package/src/mobile-first.vue.d.ts +15 -0
- package/src/pc.vue.d.ts +15 -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,111 @@
|
|
|
1
|
+
function _extends() {
|
|
2
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
3
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
4
|
+
var source = arguments[i];
|
|
5
|
+
for (var key in source) {
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7
|
+
target[key] = source[key];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
return _extends.apply(this, arguments);
|
|
14
|
+
}
|
|
15
|
+
import { $prefix, $props, $setup } from "@opentiny/vue-common";
|
|
16
|
+
import PcTemplate from "./pc.js";
|
|
17
|
+
import MobileFirstTemplate from "./mobile-first.js";
|
|
18
|
+
var template = function template2(mode) {
|
|
19
|
+
if ("pc" === (process.env.TINY_MODE || mode)) {
|
|
20
|
+
return PcTemplate;
|
|
21
|
+
}
|
|
22
|
+
if ("mobile-first" === (process.env.TINY_MODE || mode)) {
|
|
23
|
+
return MobileFirstTemplate;
|
|
24
|
+
}
|
|
25
|
+
return PcTemplate;
|
|
26
|
+
};
|
|
27
|
+
var $constants = {
|
|
28
|
+
SCROLL_LOCK_CLASS: function SCROLL_LOCK_CLASS(mode) {
|
|
29
|
+
var scrollLockClasses = {
|
|
30
|
+
"mobile-first": "overflow-hidden"
|
|
31
|
+
};
|
|
32
|
+
return scrollLockClasses[mode] || "";
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var Drawer = {
|
|
36
|
+
name: $prefix + "Drawer",
|
|
37
|
+
props: _extends({}, $props, {
|
|
38
|
+
_constants: {
|
|
39
|
+
type: Object,
|
|
40
|
+
default: function _default() {
|
|
41
|
+
return $constants;
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
visible: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
customClass: [String, Object, Array],
|
|
49
|
+
placement: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "right"
|
|
52
|
+
},
|
|
53
|
+
width: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "500px"
|
|
56
|
+
},
|
|
57
|
+
title: String,
|
|
58
|
+
showClose: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: true
|
|
61
|
+
},
|
|
62
|
+
showHeader: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: true
|
|
65
|
+
},
|
|
66
|
+
showFooter: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
69
|
+
},
|
|
70
|
+
mask: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: true
|
|
73
|
+
},
|
|
74
|
+
maskClosable: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: true
|
|
77
|
+
},
|
|
78
|
+
dragable: Boolean,
|
|
79
|
+
lockScroll: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: true
|
|
82
|
+
},
|
|
83
|
+
flex: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false
|
|
86
|
+
},
|
|
87
|
+
zIndex: {
|
|
88
|
+
type: Number,
|
|
89
|
+
default: 2e3
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
92
|
+
setup: function setup(props, context) {
|
|
93
|
+
return $setup({
|
|
94
|
+
props,
|
|
95
|
+
context,
|
|
96
|
+
template
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var version = "2.7.0";
|
|
101
|
+
Drawer.model = {
|
|
102
|
+
prop: "modelValue",
|
|
103
|
+
event: "update:modelValue"
|
|
104
|
+
};
|
|
105
|
+
Drawer.install = function(Vue) {
|
|
106
|
+
Vue.component(Drawer.name, Drawer);
|
|
107
|
+
};
|
|
108
|
+
Drawer.version = version;
|
|
109
|
+
export {
|
|
110
|
+
Drawer as default
|
|
111
|
+
};
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { renderless, api } from "@opentiny/vue-renderless/drawer/vue";
|
|
2
|
+
import { props, setup as _setup } from "@opentiny/vue-common";
|
|
3
|
+
import { IconClose } from "@opentiny/vue-icon";
|
|
4
|
+
import Button from "@opentiny/vue-button";
|
|
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
|
+
if (functionalTemplate) {
|
|
13
|
+
options.functional = true;
|
|
14
|
+
}
|
|
15
|
+
if (scopeId) {
|
|
16
|
+
options._scopeId = "data-v-" + scopeId;
|
|
17
|
+
}
|
|
18
|
+
var hook;
|
|
19
|
+
if (moduleIdentifier) {
|
|
20
|
+
hook = function hook2(context) {
|
|
21
|
+
context = context || // cached call
|
|
22
|
+
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
23
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
|
|
24
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
|
|
25
|
+
context = __VUE_SSR_CONTEXT__;
|
|
26
|
+
}
|
|
27
|
+
if (injectStyles) {
|
|
28
|
+
injectStyles.call(this, context);
|
|
29
|
+
}
|
|
30
|
+
if (context && context._registeredComponents) {
|
|
31
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
options._ssrRegister = hook;
|
|
35
|
+
} else if (injectStyles) {
|
|
36
|
+
hook = shadowMode ? function() {
|
|
37
|
+
injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
|
|
38
|
+
} : injectStyles;
|
|
39
|
+
}
|
|
40
|
+
if (hook) {
|
|
41
|
+
if (options.functional) {
|
|
42
|
+
options._injectStyles = hook;
|
|
43
|
+
var originalRender = options.render;
|
|
44
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
45
|
+
hook.call(context);
|
|
46
|
+
return originalRender(h, context);
|
|
47
|
+
};
|
|
48
|
+
} else {
|
|
49
|
+
var existing = options.beforeCreate;
|
|
50
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
exports: scriptExports,
|
|
55
|
+
options
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var _sfc_main = {
|
|
60
|
+
components: {
|
|
61
|
+
TinyButton: Button,
|
|
62
|
+
IconClose: IconClose()
|
|
63
|
+
},
|
|
64
|
+
props: [].concat(props, ["visible", "title", "showHeader", "showFooter", "customClass", "placement", "width", "mask", "dragable", "maskClosable", "lockScroll", "flex"]),
|
|
65
|
+
setup: function setup(props2, context) {
|
|
66
|
+
return _setup({
|
|
67
|
+
props: props2,
|
|
68
|
+
context,
|
|
69
|
+
renderless,
|
|
70
|
+
api
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var _sfc_render = function render() {
|
|
75
|
+
var _vm = this, _c = _vm._self._c;
|
|
76
|
+
return _c("div", {
|
|
77
|
+
directives: [{
|
|
78
|
+
name: "show",
|
|
79
|
+
rawName: "v-show",
|
|
80
|
+
value: _vm.visible,
|
|
81
|
+
expression: "visible"
|
|
82
|
+
}],
|
|
83
|
+
staticClass: "text-sm",
|
|
84
|
+
attrs: {
|
|
85
|
+
"data-tag": "tiny-drawer"
|
|
86
|
+
}
|
|
87
|
+
}, [_vm.mask ? _c("div", {
|
|
88
|
+
ref: "mask",
|
|
89
|
+
class: _vm.m("fixed z-50 left-0 right-0 top-0 bottom-0 w-full h-full transition-opacity ease-linear duration-200", {
|
|
90
|
+
"bg-color-bg-7": _vm.state.toggle
|
|
91
|
+
}),
|
|
92
|
+
on: {
|
|
93
|
+
"click": function click($event) {
|
|
94
|
+
_vm.maskClosable && _vm.close();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}) : _vm._e(), _c("div", {
|
|
98
|
+
ref: "drawerBox",
|
|
99
|
+
class: _vm.m("fixed w-full max-w-full flex flex-col bg-color-bg-1 z-50 shadow-sm border-color-border-separator", {
|
|
100
|
+
"transition-all ease-linear duration-200": !_vm.state.dragEvent.isDrag
|
|
101
|
+
}, {
|
|
102
|
+
"h-full": ["left", "right"].includes(_vm.placement)
|
|
103
|
+
}, {
|
|
104
|
+
"max-h-full": ["top", "bottom"].includes(_vm.placement)
|
|
105
|
+
}, {
|
|
106
|
+
"left-0 bottom-0 translate-y-full border-t-0.5": _vm.placement === "bottom"
|
|
107
|
+
}, {
|
|
108
|
+
"left-0 top-0 -translate-y-full border-b-0.5": _vm.placement === "top"
|
|
109
|
+
}, {
|
|
110
|
+
"translate-y-0": ["top", "bottom"].includes(_vm.placement) && _vm.state.toggle
|
|
111
|
+
}, {
|
|
112
|
+
"left-0 top-0 -translate-x-full border-r-0.5": _vm.placement === "left"
|
|
113
|
+
}, {
|
|
114
|
+
"right-0 top-0 translate-x-full border-l-0.5": _vm.placement === "right"
|
|
115
|
+
}, {
|
|
116
|
+
"translate-x-0": ["left", "right"].includes(_vm.placement) && _vm.state.toggle
|
|
117
|
+
}, _vm.customClass),
|
|
118
|
+
style: {
|
|
119
|
+
width: ["left", "right"].includes(_vm.placement) ? _vm.state.computedWidth : null
|
|
120
|
+
},
|
|
121
|
+
attrs: {
|
|
122
|
+
"data-tag": "tiny-drawer-main"
|
|
123
|
+
}
|
|
124
|
+
}, [_vm.dragable ? _c("div", {
|
|
125
|
+
ref: "dragBar",
|
|
126
|
+
class: ["h-full absolute top-0 w-2 cursor-e-resize", _vm.placement === "left" ? "-right-1" : "-left-1"],
|
|
127
|
+
attrs: {
|
|
128
|
+
"data-tag": "drawer-drag-bar"
|
|
129
|
+
}
|
|
130
|
+
}) : _vm._e(), _c("div", {
|
|
131
|
+
class: ["flex-auto flex-col flex max-h-full overflow-hidden"]
|
|
132
|
+
}, [_vm.showHeader ? _c("div", {
|
|
133
|
+
ref: "header",
|
|
134
|
+
staticClass: "flex-none flex leading-6 p-4 text-base items-center",
|
|
135
|
+
attrs: {
|
|
136
|
+
"data-tag": "drawer-header"
|
|
137
|
+
}
|
|
138
|
+
}, [_vm._t("header", function() {
|
|
139
|
+
return [_vm.title ? _c("div", {
|
|
140
|
+
staticClass: "max-w-[80%] pr-4 text-left truncate"
|
|
141
|
+
}, [_vm._v(_vm._s(_vm.title))]) : _vm._e(), _c("div", {
|
|
142
|
+
staticClass: "flex-1 flex items-center justify-end"
|
|
143
|
+
}, [_vm._t("header-right", function() {
|
|
144
|
+
return [_c("IconClose", {
|
|
145
|
+
attrs: {
|
|
146
|
+
"custom-class": "h-5 w-5 cursor-pointer"
|
|
147
|
+
},
|
|
148
|
+
on: {
|
|
149
|
+
"click": _vm.close
|
|
150
|
+
}
|
|
151
|
+
})];
|
|
152
|
+
})], 2)];
|
|
153
|
+
})], 2) : _vm._e(), _c("div", {
|
|
154
|
+
ref: "body",
|
|
155
|
+
class: ["flex-auto overflow-auto", {
|
|
156
|
+
"flex flex-col": _vm.flex
|
|
157
|
+
}],
|
|
158
|
+
attrs: {
|
|
159
|
+
"data-tag": "drawer-body"
|
|
160
|
+
}
|
|
161
|
+
}, [_vm._t("default")], 2), _vm.showFooter ? _c("div", {
|
|
162
|
+
ref: "footer",
|
|
163
|
+
staticClass: "px-4 py-3",
|
|
164
|
+
attrs: {
|
|
165
|
+
"data-tag": "drawer-footer"
|
|
166
|
+
}
|
|
167
|
+
}, [_c("div", {
|
|
168
|
+
staticClass: "flex-1 text-right"
|
|
169
|
+
}, [_vm._t("footer", function() {
|
|
170
|
+
return [_c("tiny-button", {
|
|
171
|
+
attrs: {
|
|
172
|
+
"tiny_mode": "mobile-first"
|
|
173
|
+
},
|
|
174
|
+
on: {
|
|
175
|
+
"click": _vm.close
|
|
176
|
+
}
|
|
177
|
+
}, [_vm._v(_vm._s(_vm.t("ui.button.cancel")))]), _c("tiny-button", {
|
|
178
|
+
staticClass: "ml-2",
|
|
179
|
+
attrs: {
|
|
180
|
+
"tiny_mode": "mobile-first",
|
|
181
|
+
"type": "primary"
|
|
182
|
+
},
|
|
183
|
+
on: {
|
|
184
|
+
"click": _vm.confirm
|
|
185
|
+
}
|
|
186
|
+
}, [_vm._v(_vm._s(_vm.t("ui.button.confirm")))])];
|
|
187
|
+
})], 2)]) : _vm._e()])])]);
|
|
188
|
+
};
|
|
189
|
+
var _sfc_staticRenderFns = [];
|
|
190
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, null, null, null);
|
|
191
|
+
var mobileFirst = __component__.exports;
|
|
192
|
+
export {
|
|
193
|
+
mobileFirst as default
|
|
194
|
+
};
|
package/lib/pc.js
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { renderless, api } from "@opentiny/vue-renderless/drawer/vue";
|
|
2
|
+
import { props, setup as _setup } from "@opentiny/vue-common";
|
|
3
|
+
import "@opentiny/vue-theme/drawer/index.css";
|
|
4
|
+
import { IconClose } from "@opentiny/vue-icon";
|
|
5
|
+
import Button from "@opentiny/vue-button";
|
|
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;
|
|
12
|
+
}
|
|
13
|
+
if (functionalTemplate) {
|
|
14
|
+
options.functional = true;
|
|
15
|
+
}
|
|
16
|
+
if (scopeId) {
|
|
17
|
+
options._scopeId = "data-v-" + scopeId;
|
|
18
|
+
}
|
|
19
|
+
var hook;
|
|
20
|
+
if (moduleIdentifier) {
|
|
21
|
+
hook = function hook2(context) {
|
|
22
|
+
context = context || // cached call
|
|
23
|
+
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
24
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
|
|
25
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
|
|
26
|
+
context = __VUE_SSR_CONTEXT__;
|
|
27
|
+
}
|
|
28
|
+
if (injectStyles) {
|
|
29
|
+
injectStyles.call(this, context);
|
|
30
|
+
}
|
|
31
|
+
if (context && context._registeredComponents) {
|
|
32
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
options._ssrRegister = hook;
|
|
36
|
+
} else if (injectStyles) {
|
|
37
|
+
hook = shadowMode ? function() {
|
|
38
|
+
injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
|
|
39
|
+
} : injectStyles;
|
|
40
|
+
}
|
|
41
|
+
if (hook) {
|
|
42
|
+
if (options.functional) {
|
|
43
|
+
options._injectStyles = hook;
|
|
44
|
+
var originalRender = options.render;
|
|
45
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
46
|
+
hook.call(context);
|
|
47
|
+
return originalRender(h, context);
|
|
48
|
+
};
|
|
49
|
+
} else {
|
|
50
|
+
var existing = options.beforeCreate;
|
|
51
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
exports: scriptExports,
|
|
56
|
+
options
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
var _sfc_main = {
|
|
61
|
+
components: {
|
|
62
|
+
TinyButton: Button,
|
|
63
|
+
IconClose: IconClose()
|
|
64
|
+
},
|
|
65
|
+
props: [].concat(props, ["visible", "title", "showHeader", "showFooter", "customClass", "placement", "width", "mask", "dragable", "maskClosable", "lockScroll", "flex", "showClose", "zIndex"]),
|
|
66
|
+
setup: function setup(props2, context) {
|
|
67
|
+
return _setup({
|
|
68
|
+
props: props2,
|
|
69
|
+
context,
|
|
70
|
+
renderless,
|
|
71
|
+
api
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
var _sfc_render = function render() {
|
|
76
|
+
var _vm = this, _c = _vm._self._c;
|
|
77
|
+
return _c("div", {
|
|
78
|
+
directives: [{
|
|
79
|
+
name: "show",
|
|
80
|
+
rawName: "v-show",
|
|
81
|
+
value: _vm.visible,
|
|
82
|
+
expression: "visible"
|
|
83
|
+
}],
|
|
84
|
+
staticClass: "tiny-drawer",
|
|
85
|
+
attrs: {
|
|
86
|
+
"data-tag": "tiny-drawer"
|
|
87
|
+
}
|
|
88
|
+
}, [_vm.mask ? _c("div", {
|
|
89
|
+
ref: "mask",
|
|
90
|
+
class: ["tiny-drawer__mask", {
|
|
91
|
+
"show-bg-color": _vm.state.toggle
|
|
92
|
+
}],
|
|
93
|
+
style: {
|
|
94
|
+
zIndex: _vm.zIndex
|
|
95
|
+
},
|
|
96
|
+
on: {
|
|
97
|
+
"click": function click($event) {
|
|
98
|
+
_vm.maskClosable && _vm.close();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}) : _vm._e(), _c("div", {
|
|
102
|
+
ref: "drawerBox",
|
|
103
|
+
class: ["tiny-drawer__main", {
|
|
104
|
+
"is-left": _vm.placement === "left",
|
|
105
|
+
"is-right": _vm.placement === "right",
|
|
106
|
+
"is-top": _vm.placement === "top",
|
|
107
|
+
"is-bottom": _vm.placement === "bottom",
|
|
108
|
+
"drag-effects": !_vm.state.dragEvent.isDrag
|
|
109
|
+
}, _vm.customClass],
|
|
110
|
+
style: {
|
|
111
|
+
width: ["left", "right"].includes(_vm.placement) ? _vm.state.computedWidth : null,
|
|
112
|
+
zIndex: _vm.zIndex
|
|
113
|
+
},
|
|
114
|
+
attrs: {
|
|
115
|
+
"data-tag": "tiny-drawer-main"
|
|
116
|
+
}
|
|
117
|
+
}, [_vm.dragable ? _c("div", {
|
|
118
|
+
ref: "dragBar",
|
|
119
|
+
class: ["tiny-drawer__drag-bar"],
|
|
120
|
+
attrs: {
|
|
121
|
+
"data-tag": "drawer-drag-bar"
|
|
122
|
+
}
|
|
123
|
+
}) : _vm._e(), _c("div", {
|
|
124
|
+
staticClass: "tiny-drawer__box"
|
|
125
|
+
}, [_vm.showHeader ? _c("div", {
|
|
126
|
+
ref: "header",
|
|
127
|
+
staticClass: "tiny-drawer__header-wrapper",
|
|
128
|
+
attrs: {
|
|
129
|
+
"data-tag": "drawer-header"
|
|
130
|
+
}
|
|
131
|
+
}, [_vm._t("header", function() {
|
|
132
|
+
return [_c("div", {
|
|
133
|
+
staticClass: "tiny-drawer__header"
|
|
134
|
+
}, [_vm.title ? _c("div", {
|
|
135
|
+
staticClass: "tiny-drawer__title"
|
|
136
|
+
}, [_vm._v(_vm._s(_vm.title))]) : _vm._e(), _c("div", {
|
|
137
|
+
staticClass: "tiny-drawer__header-right"
|
|
138
|
+
}, [_vm._t("header-right")], 2)])];
|
|
139
|
+
}), _vm.showClose ? _c("button", {
|
|
140
|
+
staticClass: "tiny-drawer__headerbtn",
|
|
141
|
+
attrs: {
|
|
142
|
+
"type": "button",
|
|
143
|
+
"aria-label": "Close"
|
|
144
|
+
},
|
|
145
|
+
on: {
|
|
146
|
+
"click": _vm.close
|
|
147
|
+
}
|
|
148
|
+
}, [_c("icon-close", {
|
|
149
|
+
staticClass: "tiny-svg-size tiny-drawer__close"
|
|
150
|
+
})], 1) : _vm._e()], 2) : _vm._e(), _c("div", {
|
|
151
|
+
ref: "body",
|
|
152
|
+
class: ["tiny-drawer__body", {
|
|
153
|
+
"flex flex-col": _vm.flex
|
|
154
|
+
}],
|
|
155
|
+
attrs: {
|
|
156
|
+
"data-tag": "drawer-body"
|
|
157
|
+
}
|
|
158
|
+
}, [_vm._t("default")], 2), _vm.showFooter ? _c("div", {
|
|
159
|
+
ref: "footer",
|
|
160
|
+
staticClass: "tiny-drawer__footer",
|
|
161
|
+
attrs: {
|
|
162
|
+
"data-tag": "drawer-footer"
|
|
163
|
+
}
|
|
164
|
+
}, [_vm._t("footer", function() {
|
|
165
|
+
return [_c("tiny-button", {
|
|
166
|
+
attrs: {
|
|
167
|
+
"type": "primary"
|
|
168
|
+
},
|
|
169
|
+
on: {
|
|
170
|
+
"click": _vm.confirm
|
|
171
|
+
}
|
|
172
|
+
}, [_vm._v(_vm._s(_vm.t("ui.button.confirm")))]), _c("tiny-button", {
|
|
173
|
+
attrs: {
|
|
174
|
+
"plain": ""
|
|
175
|
+
},
|
|
176
|
+
on: {
|
|
177
|
+
"click": _vm.close
|
|
178
|
+
}
|
|
179
|
+
}, [_vm._v(_vm._s(_vm.t("ui.button.cancel")))])];
|
|
180
|
+
})], 2) : _vm._e()])])]);
|
|
181
|
+
};
|
|
182
|
+
var _sfc_staticRenderFns = [];
|
|
183
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, null, null, null);
|
|
184
|
+
var pc = __component__.exports;
|
|
185
|
+
export {
|
|
186
|
+
pc as default
|
|
187
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opentiny/vue-drawer",
|
|
3
|
+
"version": "2.7.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "./lib/index.js",
|
|
6
|
+
"module": "./lib/index.js",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@opentiny/vue-button": "~2.7.0",
|
|
10
|
+
"@opentiny/vue-common": "~2.7.0",
|
|
11
|
+
"@opentiny/vue-renderless": "~3.9.0"
|
|
12
|
+
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"types": "index.d.ts"
|
|
15
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
name: string;
|
|
3
|
+
props: {
|
|
4
|
+
_constants: {
|
|
5
|
+
type: ObjectConstructor;
|
|
6
|
+
default: () => {
|
|
7
|
+
SCROLL_LOCK_CLASS(mode: any): any;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
visible: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
customClass: (ObjectConstructor | ArrayConstructor | StringConstructor)[];
|
|
15
|
+
placement: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
width: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
title: StringConstructor;
|
|
24
|
+
showClose: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
showHeader: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
showFooter: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
36
|
+
mask: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
40
|
+
maskClosable: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
|
+
dragable: BooleanConstructor;
|
|
45
|
+
lockScroll: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
49
|
+
flex: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
53
|
+
zIndex: {
|
|
54
|
+
type: NumberConstructor;
|
|
55
|
+
default: number;
|
|
56
|
+
};
|
|
57
|
+
tiny_mode: StringConstructor;
|
|
58
|
+
tiny_mode_root: BooleanConstructor;
|
|
59
|
+
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
60
|
+
tiny_renderless: FunctionConstructor;
|
|
61
|
+
tiny_theme: StringConstructor;
|
|
62
|
+
tiny_chart_theme: ObjectConstructor;
|
|
63
|
+
};
|
|
64
|
+
setup(props: any, context: any): () => import("vue").VNode;
|
|
65
|
+
};
|
|
66
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const _sfc_main: {
|
|
2
|
+
components: undefined;
|
|
3
|
+
props: string[];
|
|
4
|
+
setup(props: any, context: any): {
|
|
5
|
+
t: (this: any, path: any, options?: any) => any;
|
|
6
|
+
vm: any;
|
|
7
|
+
f: (props: any, attrs?: {}) => {};
|
|
8
|
+
a: (attrs: any, filters: any, include: any) => {};
|
|
9
|
+
d: (props: any) => void;
|
|
10
|
+
dp: (props: any) => void;
|
|
11
|
+
gcls: (key: any) => any;
|
|
12
|
+
m: (...cssClasses: any[]) => string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default _sfc_main;
|
package/src/pc.vue.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const _sfc_main: {
|
|
2
|
+
components: undefined;
|
|
3
|
+
props: string[];
|
|
4
|
+
setup(props: any, context: any): {
|
|
5
|
+
t: (this: any, path: any, options?: any) => any;
|
|
6
|
+
vm: any;
|
|
7
|
+
f: (props: any, attrs?: {}) => {};
|
|
8
|
+
a: (attrs: any, filters: any, include: any) => {};
|
|
9
|
+
d: (props: any) => void;
|
|
10
|
+
dp: (props: any) => void;
|
|
11
|
+
gcls: (key: any) => any;
|
|
12
|
+
m: (...cssClasses: any[]) => string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default _sfc_main;
|