@opentiny/vue-dropdown-item 2.20.0 → 2.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
@@ -2,15 +2,13 @@ function _extends() {
2
2
  return _extends = Object.assign ? Object.assign.bind() : function(n) {
3
3
  for (var e = 1; e < arguments.length; e++) {
4
4
  var t = arguments[e];
5
- for (var r in t)
6
- ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
5
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
7
6
  }
8
7
  return n;
9
8
  }, _extends.apply(null, arguments);
10
9
  }
11
- import { defineComponent, $prefix, $setup, $props } from "@opentiny/vue-common";
10
+ import { defineComponent, $props, $setup, $prefix } from "@opentiny/vue-common";
12
11
  import PcTemplate from "./pc.js";
13
- import MobileTemplate from "./mobile.js";
14
12
  import MobileFirstTemplate from "./mobile-first.js";
15
13
  var template = function template2(mode) {
16
14
  var _process$env;
@@ -18,9 +16,6 @@ var template = function template2(mode) {
18
16
  if ("pc" === (tinyMode || mode)) {
19
17
  return PcTemplate;
20
18
  }
21
- if ("mobile" === (tinyMode || mode)) {
22
- return MobileTemplate;
23
- }
24
19
  if ("mobile-first" === (tinyMode || mode)) {
25
20
  return MobileFirstTemplate;
26
21
  }
@@ -119,7 +114,7 @@ var DropdownItem = defineComponent({
119
114
  });
120
115
  }
121
116
  });
122
- var version = "2.20.0";
117
+ var version = "2.undefined";
123
118
  DropdownItem.model = {
124
119
  prop: "modelValue",
125
120
  event: "update:modelValue"
@@ -8,33 +8,9 @@ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTe
8
8
  options.staticRenderFns = staticRenderFns;
9
9
  options._compiled = true;
10
10
  }
11
- if (functionalTemplate) {
12
- options.functional = true;
13
- }
14
- if (scopeId) {
15
- options._scopeId = "data-v-" + scopeId;
16
- }
17
11
  var hook;
18
- if (moduleIdentifier) {
19
- hook = function hook2(context) {
20
- context = context || // cached call
21
- this.$vnode && this.$vnode.ssrContext || // stateful
22
- this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
23
- if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
24
- context = __VUE_SSR_CONTEXT__;
25
- }
26
- if (injectStyles) {
27
- injectStyles.call(this, context);
28
- }
29
- if (context && context._registeredComponents) {
30
- context._registeredComponents.add(moduleIdentifier);
31
- }
32
- };
33
- options._ssrRegister = hook;
34
- } else if (injectStyles) {
35
- hook = shadowMode ? function() {
36
- injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
37
- } : injectStyles;
12
+ if (injectStyles) {
13
+ hook = injectStyles;
38
14
  }
39
15
  if (hook) {
40
16
  if (options.functional) {
@@ -101,7 +77,7 @@ var render = function render2() {
101
77
  };
102
78
  var staticRenderFns = [];
103
79
  var __cssModules = {};
104
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
80
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
105
81
  function __vue2_injectStyles(context) {
106
82
  for (var o in __cssModules) {
107
83
  this[o] = __cssModules[o];
package/lib/pc.js CHANGED
@@ -11,33 +11,9 @@ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTe
11
11
  options.staticRenderFns = staticRenderFns;
12
12
  options._compiled = true;
13
13
  }
14
- if (functionalTemplate) {
15
- options.functional = true;
16
- }
17
- if (scopeId) {
18
- options._scopeId = "data-v-" + scopeId;
19
- }
20
14
  var hook;
21
- if (moduleIdentifier) {
22
- hook = function hook2(context) {
23
- context = context || // cached call
24
- this.$vnode && this.$vnode.ssrContext || // stateful
25
- this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
26
- if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
27
- context = __VUE_SSR_CONTEXT__;
28
- }
29
- if (injectStyles) {
30
- injectStyles.call(this, context);
31
- }
32
- if (context && context._registeredComponents) {
33
- context._registeredComponents.add(moduleIdentifier);
34
- }
35
- };
36
- options._ssrRegister = hook;
37
- } else if (injectStyles) {
38
- hook = shadowMode ? function() {
39
- injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
40
- } : injectStyles;
15
+ if (injectStyles) {
16
+ hook = injectStyles;
41
17
  }
42
18
  if (hook) {
43
19
  if (options.functional) {
@@ -171,7 +147,7 @@ var render = function render2() {
171
147
  };
172
148
  var staticRenderFns = [];
173
149
  var __cssModules = {};
174
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
150
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
175
151
  function __vue2_injectStyles(context) {
176
152
  for (var o in __cssModules) {
177
153
  this[o] = __cssModules[o];
package/package.json CHANGED
@@ -1,21 +1,18 @@
1
1
  {
2
2
  "name": "@opentiny/vue-dropdown-item",
3
3
  "type": "module",
4
- "version": "2.20.0",
4
+ "version": "2.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
- "@opentiny/vue-button": "~2.20.0",
12
- "@opentiny/vue-common": "~2.20.0",
13
- "@opentiny/vue-directive": "~2.20.0",
14
- "@opentiny/vue-icon": "~2.20.0",
15
- "@opentiny/vue-popup": "~2.20.0",
16
- "@opentiny/vue-renderless": "~3.20.0",
17
- "@opentiny/vue-theme": "~3.20.0",
18
- "@opentiny/vue-theme-mobile": "~3.20.0"
11
+ "@opentiny/vue-common": "~2.22.0",
12
+ "@opentiny/vue-directive": "~2.22.0",
13
+ "@opentiny/vue-icon": "~2.22.0",
14
+ "@opentiny/vue-renderless": "~3.22.0",
15
+ "@opentiny/vue-theme": "~3.22.0"
19
16
  },
20
17
  "types": "index.d.ts",
21
18
  "scripts": {
package/lib/mobile.js DELETED
@@ -1,219 +0,0 @@
1
- import { renderless, api } from '@opentiny/vue-renderless/dropdown-item/vue';
2
- import { defineComponent, directive, props, setup } from '@opentiny/vue-common';
3
- import { iconYes } from '@opentiny/vue-icon';
4
- import Popup from '@opentiny/vue-popup';
5
- import Button from '@opentiny/vue-button';
6
- import Clickoutside from '@opentiny/vue-renderless/common/deps/clickoutside';
7
- import '@opentiny/vue-theme-mobile/dropdown-item/index.css';
8
-
9
- function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
10
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
11
- if (render) {
12
- options.render = render;
13
- options.staticRenderFns = staticRenderFns;
14
- options._compiled = true;
15
- }
16
- if (functionalTemplate) {
17
- options.functional = true;
18
- }
19
- if (scopeId) {
20
- options._scopeId = "data-v-" + scopeId;
21
- }
22
- var hook;
23
- if (moduleIdentifier) {
24
- hook = function hook2(context) {
25
- context = context || // cached call
26
- this.$vnode && this.$vnode.ssrContext || // stateful
27
- this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
28
- if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
29
- context = __VUE_SSR_CONTEXT__;
30
- }
31
- if (injectStyles) {
32
- injectStyles.call(this, context);
33
- }
34
- if (context && context._registeredComponents) {
35
- context._registeredComponents.add(moduleIdentifier);
36
- }
37
- };
38
- options._ssrRegister = hook;
39
- } else if (injectStyles) {
40
- hook = shadowMode ? function() {
41
- injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
42
- } : injectStyles;
43
- }
44
- if (hook) {
45
- if (options.functional) {
46
- options._injectStyles = hook;
47
- var originalRender = options.render;
48
- options.render = function renderWithStyleInjection(h, context) {
49
- hook.call(context);
50
- return originalRender(h, context);
51
- };
52
- } else {
53
- var existing = options.beforeCreate;
54
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
55
- }
56
- }
57
- return {
58
- exports: scriptExports,
59
- options
60
- };
61
- }
62
-
63
- var __vue2_script = defineComponent({
64
- directives: directive({
65
- Clickoutside
66
- }),
67
- props: [].concat(props, ["modelValue", "title", "disabled", "titleClass", "options", "icon", "type"]),
68
- components: {
69
- IconYes: iconYes(),
70
- TinyPopup: Popup,
71
- TinyButton: Button
72
- },
73
- emits: ["update:modelValue", "open", "opened", "click", "change", "closed", "close", "reset", "confirm", "item-click"],
74
- setup: function setup$1(props2, context) {
75
- return setup({
76
- props: props2,
77
- context,
78
- renderless,
79
- api
80
- });
81
- }
82
- });
83
- var render = function render2() {
84
- var _vm = this;
85
- var _h = _vm.$createElement;
86
- var _c = _vm._self._c || _h;
87
- return _c("div", {
88
- directives: [{
89
- name: "show",
90
- rawName: "v-show",
91
- value: _vm.state.showWrapper,
92
- expression: "state.showWrapper"
93
- }],
94
- ref: "wrapper",
95
- staticClass: "tiny-mobile-dropdown-item",
96
- class: "tiny-mobile-dropdown-item--" + _vm.state.direction,
97
- style: _vm.state.itemStyle,
98
- on: {
99
- "click": _vm.clickWrapper
100
- }
101
- }, [_c("tiny-popup", {
102
- attrs: {
103
- "popup-class": "tiny-mobile-dropdown-item__content",
104
- "overlay": _vm.state.overlay,
105
- "close-on-click-overlay": _vm.state.closeOnClickOverlay,
106
- "closeable": false,
107
- "position": _vm.state.direction === "down" ? "top" : "bottom",
108
- "duration": _vm.state.transition ? _vm.state.duration : 0
109
- },
110
- on: {
111
- "open": _vm.open,
112
- "close": _vm.close,
113
- "opened": _vm.opened,
114
- "closed": _vm.closed
115
- },
116
- model: {
117
- value: _vm.state.showPopup,
118
- callback: function callback($$v) {
119
- _vm.$set(_vm.state, "showPopup", $$v);
120
- },
121
- expression: "state.showPopup"
122
- }
123
- }, [_vm._t("default", function() {
124
- return [_vm.type === "selection" ? _c("div", {
125
- staticClass: "tiny-mobile-dropdown-item__options"
126
- }, _vm._l(_vm.options, function(item, index) {
127
- return _c("div", {
128
- key: index,
129
- staticClass: "tiny-mobile-dropdown-item__cell tiny-mobile-dropdown-item__option",
130
- class: item.value === _vm.modelValue ? "is-active" : "",
131
- attrs: {
132
- "tabindex": "0"
133
- },
134
- on: {
135
- "click": function click($event) {
136
- return _vm.clickItem(item.value);
137
- }
138
- }
139
- }, [_c("div", {
140
- staticClass: "tiny-mobile-dropdown-item__option-icon"
141
- }, [_vm._t("icon", function() {
142
- return [_c(_vm.icon, {
143
- tag: "component"
144
- })];
145
- })], 2), _c("div", {
146
- staticClass: "tiny-mobile-dropdown-item__option-title"
147
- }, [_vm._t("title", function() {
148
- return [_c("span", {
149
- style: {
150
- color: item.value === _vm.modelValue && _vm.state.activeColor ? _vm.state.activeColor : ""
151
- }
152
- }, [_vm._v(_vm._s(item.text))])];
153
- }, {
154
- "titleData": item
155
- })], 2), _c("div", {
156
- staticClass: "tiny-mobile-dropdown-item__option-value"
157
- }, [item.value === _vm.modelValue ? _c("icon-yes", {
158
- attrs: {
159
- "fill": _vm.state.activeColor ? _vm.state.activeColor : "#f36f64"
160
- }
161
- }) : _vm._e()], 1)]);
162
- }), 0) : _vm._e(), _vm.type === "filter" ? _c("div", {
163
- directives: [{
164
- name: "clickoutside",
165
- rawName: "v-clickoutside",
166
- value: _vm.clickOutside,
167
- expression: "clickOutside"
168
- }],
169
- staticClass: "tiny-mobile-dropdown-item__filter"
170
- }, [_c("div", {
171
- staticClass: "tiny-mobile-dropdown-item__filter-wrap"
172
- }, _vm._l(_vm.options, function(item, key) {
173
- return _c("div", {
174
- key,
175
- staticClass: "tiny-mobile-dropdown-item__cell tiny-mobile-dropdown-item__filter-item"
176
- }, [_c("span", {
177
- staticClass: "tiny-mobile-dropdown-item__filter-title"
178
- }, [_vm._v(_vm._s(item.title))]), _c("ul", _vm._l(_vm.options.length === 0 ? item.data = [] : item.data, function(tag, tagkey) {
179
- return _c("li", {
180
- key: tagkey,
181
- staticClass: "tiny-mobile-dropdown-item__filter-li",
182
- class: [_vm.modelValue[key].indexOf(tag.value) > -1 ? "checked" : ""],
183
- style: _vm.getOptionStyle(tag, _vm.modelValue[key]),
184
- on: {
185
- "click": function click($event) {
186
- return _vm.tagClick(key, tag, $event);
187
- }
188
- }
189
- }, [_vm._v(" " + _vm._s(tag.text) + " ")]);
190
- }), 0)]);
191
- }), 0), _c("div", {
192
- staticClass: "tiny-mobile-dropdown-item__filter-operate"
193
- }, [_c("tiny-button", {
194
- on: {
195
- "click": _vm.reset
196
- }
197
- }, [_vm._v(" Reset ")]), _c("tiny-button", {
198
- attrs: {
199
- "type": "primary"
200
- },
201
- on: {
202
- "click": _vm.confirm
203
- }
204
- }, [_vm._v(" OK ")])], 1)]) : _vm._e()];
205
- })], 2)], 1);
206
- };
207
- var staticRenderFns = [];
208
- var __cssModules = {};
209
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
210
- function __vue2_injectStyles(context) {
211
- for (var o in __cssModules) {
212
- this[o] = __cssModules[o];
213
- }
214
- }
215
- var mobile = /* @__PURE__ */ function() {
216
- return __component__.exports;
217
- }();
218
-
219
- export { mobile as default };
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;