@opentiny/vue-drawer 2.14.0 → 2.16.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
@@ -12,7 +12,7 @@ function _extends() {
12
12
  };
13
13
  return _extends.apply(this, arguments);
14
14
  }
15
- import { $prefix, $setup, $props } from "@opentiny/vue-common";
15
+ import { defineComponent, $prefix, $setup, $props } from "@opentiny/vue-common";
16
16
  import PcTemplate from "./pc.js";
17
17
  import MobileFirstTemplate from "./mobile-first.js";
18
18
  var template = function template2(mode) {
@@ -92,7 +92,7 @@ var drawerProps = _extends({}, $props, {
92
92
  beforeClose: Function,
93
93
  tipsProps: Object
94
94
  });
95
- var Drawer = {
95
+ var Drawer = defineComponent({
96
96
  name: $prefix + "Drawer",
97
97
  props: drawerProps,
98
98
  setup: function setup(props, context) {
@@ -102,8 +102,8 @@ var Drawer = {
102
102
  template
103
103
  });
104
104
  }
105
- };
106
- var version = "2.14.0";
105
+ });
106
+ var version = "2.16.0";
107
107
  Drawer.model = {
108
108
  prop: "modelValue",
109
109
  event: "update:modelValue"
@@ -1,7 +1,8 @@
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";
1
+ import { renderless, api } from '@opentiny/vue-renderless/drawer/vue';
2
+ import { defineComponent, props, setup } from '@opentiny/vue-common';
3
+ import { IconClose } from '@opentiny/vue-icon';
4
+ import Button from '@opentiny/vue-button';
5
+
5
6
  function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
6
7
  var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
7
8
  if (render) {
@@ -56,21 +57,21 @@ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTe
56
57
  };
57
58
  }
58
59
 
59
- var __vue2_script = {
60
+ var __vue2_script = defineComponent({
60
61
  components: {
61
62
  TinyButton: Button,
62
63
  IconClose: IconClose()
63
64
  },
64
65
  props: [].concat(props, ["visible", "title", "showHeader", "showFooter", "customClass", "placement", "width", "mask", "dragable", "maskClosable", "lockScroll", "flex", "beforeClose"]),
65
- setup: function setup(props2, context) {
66
- return _setup({
66
+ setup: function setup$1(props2, context) {
67
+ return setup({
67
68
  props: props2,
68
69
  context,
69
70
  renderless,
70
71
  api
71
72
  });
72
73
  }
73
- };
74
+ });
74
75
  var render = function render2() {
75
76
  var _vm = this;
76
77
  var _h = _vm.$createElement;
@@ -118,14 +119,15 @@ var render = function render2() {
118
119
  "translate-x-0": ["left", "right"].includes(_vm.placement) && _vm.state.toggle
119
120
  }, _vm.customClass),
120
121
  style: {
121
- width: ["left", "right"].includes(_vm.placement) ? _vm.state.computedWidth : null
122
+ width: ["left", "right"].includes(_vm.placement) ? _vm.state.computedWidth : null,
123
+ height: ["top", "bottom"].includes(_vm.placement) && _vm.dragable && _vm.state.height ? _vm.state.height + "px" : null
122
124
  },
123
125
  attrs: {
124
126
  "data-tag": "tiny-drawer-main"
125
127
  }
126
128
  }, [_vm.dragable ? _c("div", {
127
129
  ref: "dragBar",
128
- class: ["h-full absolute top-0 w-2 cursor-e-resize", _vm.placement === "left" ? "-right-1" : "-left-1"],
130
+ class: ["absolute", ["left", "right"].includes(_vm.placement) && "cursor-e-resize h-full top-0 w-2", ["top", "bottom"].includes(_vm.placement) && "cursor-n-resize w-full h-2 left-0", _vm.placement === "left" && "-right-1", _vm.placement === "right" && "-left-1", _vm.placement === "top" && "-bottom-1", _vm.placement === "bottom" && "-top-1"],
129
131
  attrs: {
130
132
  "data-tag": "drawer-drag-bar"
131
133
  }
@@ -139,11 +141,12 @@ var render = function render2() {
139
141
  }
140
142
  }, [_vm._t("header", function() {
141
143
  return [_vm.title ? _c("div", {
142
- staticClass: "max-w-[80%] pr-4 text-left truncate"
144
+ staticClass: "max-w-[80%] pr-4 text-left truncate text-color-text-primary"
143
145
  }, [_vm._v(_vm._s(_vm.title))]) : _vm._e(), _c("div", {
144
146
  staticClass: "flex-1 flex items-center justify-end"
145
147
  }, [_vm._t("header-right", function() {
146
148
  return [_c("IconClose", {
149
+ staticClass: "fill-color-icon-primary",
147
150
  attrs: {
148
151
  "custom-class": "h-5 w-5 cursor-pointer"
149
152
  },
@@ -205,6 +208,5 @@ function __vue2_injectStyles(context) {
205
208
  var mobileFirst = /* @__PURE__ */ function() {
206
209
  return __component__.exports;
207
210
  }();
208
- export {
209
- mobileFirst as default
210
- };
211
+
212
+ export { mobileFirst as default };
package/lib/pc.js CHANGED
@@ -1,9 +1,10 @@
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, iconHelpCircle } from "@opentiny/vue-icon";
5
- import Button from "@opentiny/vue-button";
6
- import Tooltip from "@opentiny/vue-tooltip";
1
+ import { renderless, api } from '@opentiny/vue-renderless/drawer/vue';
2
+ import { defineComponent, props, setup } from '@opentiny/vue-common';
3
+ import '@opentiny/vue-theme/drawer/index.css';
4
+ import { iconClose, iconHelpCircle } from '@opentiny/vue-icon';
5
+ import Button from '@opentiny/vue-button';
6
+ import Tooltip from '@opentiny/vue-tooltip';
7
+
7
8
  function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
8
9
  var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
9
10
  if (render) {
@@ -58,7 +59,7 @@ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTe
58
59
  };
59
60
  }
60
61
 
61
- var __vue2_script = {
62
+ var __vue2_script = defineComponent({
62
63
  components: {
63
64
  TinyButton: Button,
64
65
  TinyTooltip: Tooltip,
@@ -66,15 +67,15 @@ var __vue2_script = {
66
67
  IconHelpCircle: iconHelpCircle()
67
68
  },
68
69
  props: [].concat(props, ["visible", "title", "showHeader", "showFooter", "customClass", "placement", "width", "mask", "dragable", "maskClosable", "lockScroll", "flex", "showClose", "zIndex", "beforeClose", "tipsProps"]),
69
- setup: function setup(props2, context) {
70
- return _setup({
70
+ setup: function setup$1(props2, context) {
71
+ return setup({
71
72
  props: props2,
72
73
  context,
73
74
  renderless,
74
75
  api
75
76
  });
76
77
  }
77
- };
78
+ });
78
79
  var render = function render2() {
79
80
  var _vm = this;
80
81
  var _h = _vm.$createElement;
@@ -123,6 +124,7 @@ var render = function render2() {
123
124
  }, "tiny-drawer-main", _vm.customClass],
124
125
  style: {
125
126
  width: ["left", "right"].includes(_vm.placement) ? _vm.state.computedWidth : null,
127
+ height: ["top", "bottom"].includes(_vm.placement) && _vm.dragable && _vm.state.height ? _vm.state.height + "px" : null,
126
128
  zIndex: _vm.zIndex
127
129
  },
128
130
  attrs: {
@@ -130,7 +132,7 @@ var render = function render2() {
130
132
  }
131
133
  }, [_vm.dragable ? _c("div", {
132
134
  ref: "dragBar",
133
- class: ["tiny-drawer__drag-bar"],
135
+ class: ["tiny-drawer__drag-bar", ["left", "right"].includes(_vm.placement) && "p-left-Right", ["top", "bottom"].includes(_vm.placement) && "p-top-Bottom", _vm.placement === "left" && "p-left", _vm.placement === "right" && "p-right", _vm.placement === "top" && "p-top", _vm.placement === "bottom" && "p-bottom"],
134
136
  attrs: {
135
137
  "data-tag": "drawer-drag-bar"
136
138
  }
@@ -220,6 +222,5 @@ function __vue2_injectStyles(context) {
220
222
  var pc = /* @__PURE__ */ function() {
221
223
  return __component__.exports;
222
224
  }();
223
- export {
224
- pc as default
225
- };
225
+
226
+ export { pc as default };
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@opentiny/vue-drawer",
3
- "version": "2.14.0",
3
+ "version": "2.16.0",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",
7
7
  "sideEffects": false,
8
8
  "type": "module",
9
9
  "dependencies": {
10
- "@opentiny/vue-button": "~2.14.0",
11
- "@opentiny/vue-tooltip": "~2.14.0",
12
- "@opentiny/vue-common": "~2.14.0",
13
- "@opentiny/vue-renderless": "~3.14.0",
14
- "@opentiny/vue-icon": "~2.14.0",
15
- "@opentiny/vue-theme": "~3.14.0"
10
+ "@opentiny/vue-button": "~2.16.0",
11
+ "@opentiny/vue-tooltip": "~2.16.0",
12
+ "@opentiny/vue-common": "~2.16.0",
13
+ "@opentiny/vue-renderless": "~3.16.0",
14
+ "@opentiny/vue-icon": "~2.16.0",
15
+ "@opentiny/vue-theme": "~3.16.0"
16
16
  },
17
17
  "license": "MIT",
18
18
  "types": "index.d.ts"
package/src/index.d.ts CHANGED
@@ -10,7 +10,7 @@ export declare const drawerProps: {
10
10
  type: BooleanConstructor;
11
11
  default: boolean;
12
12
  };
13
- customClass: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
13
+ customClass: (StringConstructor | ArrayConstructor | ObjectConstructor)[];
14
14
  placement: {
15
15
  type: StringConstructor;
16
16
  default: string;
@@ -61,71 +61,5 @@ export declare const drawerProps: {
61
61
  tiny_theme: StringConstructor;
62
62
  tiny_chart_theme: ObjectConstructor;
63
63
  };
64
- declare const _default: {
65
- name: string;
66
- props: {
67
- _constants: {
68
- type: ObjectConstructor;
69
- default: () => {
70
- SCROLL_LOCK_CLASS(mode: string): string;
71
- DEFAULT_WIDTH: string;
72
- };
73
- };
74
- visible: {
75
- type: BooleanConstructor;
76
- default: boolean;
77
- };
78
- customClass: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
79
- placement: {
80
- type: StringConstructor;
81
- default: string;
82
- };
83
- width: {
84
- type: StringConstructor;
85
- };
86
- title: StringConstructor;
87
- showClose: {
88
- type: BooleanConstructor;
89
- default: boolean;
90
- };
91
- showHeader: {
92
- type: BooleanConstructor;
93
- default: boolean;
94
- };
95
- showFooter: {
96
- type: BooleanConstructor;
97
- default: boolean;
98
- };
99
- mask: {
100
- type: BooleanConstructor;
101
- default: boolean;
102
- };
103
- maskClosable: {
104
- type: BooleanConstructor;
105
- default: boolean;
106
- };
107
- dragable: BooleanConstructor;
108
- lockScroll: {
109
- type: BooleanConstructor;
110
- default: boolean;
111
- };
112
- flex: {
113
- type: BooleanConstructor;
114
- default: boolean;
115
- };
116
- zIndex: {
117
- type: NumberConstructor;
118
- default: number;
119
- };
120
- beforeClose: FunctionConstructor;
121
- tipsProps: ObjectConstructor;
122
- tiny_mode: StringConstructor;
123
- tiny_mode_root: BooleanConstructor;
124
- tiny_template: (ObjectConstructor | FunctionConstructor)[];
125
- tiny_renderless: FunctionConstructor;
126
- tiny_theme: StringConstructor;
127
- tiny_chart_theme: ObjectConstructor;
128
- };
129
- setup(props: any, context: any): () => any;
130
- };
64
+ declare const _default: any;
131
65
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue/types/vue").ExtendedVue<import("vue").default, unknown, unknown, unknown, Record<"title" | "tiny_mode" | "tiny_mode_root" | "tiny_template" | "tiny_renderless" | "_constants" | "tiny_theme" | "tiny_chart_theme" | "width" | "mask" | "visible" | "showHeader" | "showFooter" | "customClass" | "maskClosable" | "lockScroll" | "flex" | "beforeClose" | "placement" | "dragable", any>>;
1
+ declare const _default: any;
2
2
  export default _default;
package/src/pc.vue.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue/types/vue").ExtendedVue<import("vue").default, unknown, unknown, unknown, Record<"title" | "tiny_mode" | "tiny_mode_root" | "tiny_template" | "tiny_renderless" | "_constants" | "tiny_theme" | "tiny_chart_theme" | "width" | "mask" | "visible" | "showHeader" | "showFooter" | "showClose" | "customClass" | "maskClosable" | "lockScroll" | "flex" | "beforeClose" | "placement" | "zIndex" | "dragable" | "tipsProps", any>>;
1
+ declare const _default: any;
2
2
  export default _default;