@opentiny/vue-dropdown-item 2.8.0 → 3.4.7
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/index.d.ts +13 -13
- package/lib/index.js +74 -62
- package/lib/mobile.js +161 -205
- package/lib/pc.js +96 -131
- package/package.json +15 -12
- package/src/index.d.ts +37 -138
- package/src/index.vue.d.ts +50 -0
- package/src/mobile.vue.d.ts +22 -30
- package/src/pc.vue.d.ts +13 -30
- package/LICENSE +0 -22
- package/lib/mobile-first.js +0 -115
- package/src/mobile-first.vue.d.ts +0 -12
package/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2022 - present TinyVue Authors.
|
|
3
|
-
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license.
|
|
6
|
-
*
|
|
7
|
-
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
|
8
|
-
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
|
9
|
-
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
import DropdownItem from './src/index';
|
|
13
|
-
export default DropdownItem;
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 - present TinyVue Authors.
|
|
3
|
+
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license.
|
|
6
|
+
*
|
|
7
|
+
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
|
8
|
+
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
|
9
|
+
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
import DropdownItem from './src/index';
|
|
13
|
+
export default DropdownItem;
|
package/lib/index.js
CHANGED
|
@@ -1,33 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
return
|
|
1
|
+
import { $prefix, $props, $setup } from '@opentiny/vue-common';
|
|
2
|
+
import PCTemplate from './pc';
|
|
3
|
+
import MobileTemplate from './mobile';
|
|
4
|
+
|
|
5
|
+
function ownKeys(object, enumerableOnly) {
|
|
6
|
+
var keys = Object.keys(object);
|
|
7
|
+
if (Object.getOwnPropertySymbols) {
|
|
8
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
9
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
10
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
11
|
+
})), keys.push.apply(keys, symbols);
|
|
12
|
+
}
|
|
13
|
+
return keys;
|
|
14
|
+
}
|
|
15
|
+
function _objectSpread2(target) {
|
|
16
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
17
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
18
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
19
|
+
_defineProperty(target, key, source[key]);
|
|
20
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
21
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return target;
|
|
25
|
+
}
|
|
26
|
+
function _defineProperty(obj, key, value) {
|
|
27
|
+
key = _toPropertyKey(key);
|
|
28
|
+
if (key in obj) {
|
|
29
|
+
Object.defineProperty(obj, key, {
|
|
30
|
+
value: value,
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true
|
|
34
|
+
});
|
|
35
|
+
} else {
|
|
36
|
+
obj[key] = value;
|
|
37
|
+
}
|
|
38
|
+
return obj;
|
|
39
|
+
}
|
|
40
|
+
function _toPrimitive(input, hint) {
|
|
41
|
+
if (typeof input !== "object" || input === null) return input;
|
|
42
|
+
var prim = input[Symbol.toPrimitive];
|
|
43
|
+
if (prim !== undefined) {
|
|
44
|
+
var res = prim.call(input, hint || "default");
|
|
45
|
+
if (typeof res !== "object") return res;
|
|
46
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
47
|
+
}
|
|
48
|
+
return (hint === "string" ? String : Number)(input);
|
|
49
|
+
}
|
|
50
|
+
function _toPropertyKey(arg) {
|
|
51
|
+
var key = _toPrimitive(arg, "string");
|
|
52
|
+
return typeof key === "symbol" ? key : String(key);
|
|
14
53
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import MobileFirstTemplate from "./mobile-first.js";
|
|
19
|
-
var template = function template2(mode) {
|
|
20
|
-
if ("mobile" === (process.env.TINY_MODE || mode))
|
|
21
|
-
return MobileTemplate;
|
|
22
|
-
else if ("mobile-first" === (process.env.TINY_MODE || mode))
|
|
23
|
-
return MobileFirstTemplate;
|
|
24
|
-
else
|
|
25
|
-
return PcTemplate;
|
|
54
|
+
|
|
55
|
+
var template = function template(mode) {
|
|
56
|
+
if (process.env.TINY_MODE === 'pc') return PCTemplate;else if (process.env.TINY_MODE === 'mobile') return MobileTemplate;else return mode === 'mobile' ? MobileTemplate : PCTemplate;
|
|
26
57
|
};
|
|
27
|
-
var DropdownItem =
|
|
28
|
-
name: $prefix +
|
|
29
|
-
componentName:
|
|
30
|
-
props:
|
|
58
|
+
var DropdownItem = {
|
|
59
|
+
name: $prefix + 'DropdownItem',
|
|
60
|
+
componentName: 'TinyDropdownItem',
|
|
61
|
+
props: _objectSpread2(_objectSpread2({}, $props), {}, {
|
|
31
62
|
icon: [String, Object],
|
|
32
63
|
disabled: Boolean,
|
|
33
64
|
divided: Boolean,
|
|
@@ -42,15 +73,15 @@ var DropdownItem = defineComponent({
|
|
|
42
73
|
},
|
|
43
74
|
type: {
|
|
44
75
|
type: String,
|
|
45
|
-
default:
|
|
76
|
+
default: 'selection'
|
|
46
77
|
},
|
|
47
78
|
label: {
|
|
48
79
|
type: String,
|
|
49
|
-
default:
|
|
80
|
+
default: ''
|
|
50
81
|
},
|
|
51
82
|
itemData: {
|
|
52
83
|
type: Object,
|
|
53
|
-
default: function
|
|
84
|
+
default: function _default() {
|
|
54
85
|
return {};
|
|
55
86
|
}
|
|
56
87
|
},
|
|
@@ -60,44 +91,25 @@ var DropdownItem = defineComponent({
|
|
|
60
91
|
},
|
|
61
92
|
textField: {
|
|
62
93
|
type: String,
|
|
63
|
-
default:
|
|
64
|
-
},
|
|
65
|
-
selected: {
|
|
66
|
-
type: Boolean,
|
|
67
|
-
default: false
|
|
68
|
-
},
|
|
69
|
-
selectedField: {
|
|
70
|
-
type: String,
|
|
71
|
-
default: "selected"
|
|
72
|
-
},
|
|
73
|
-
multiStage: {
|
|
74
|
-
type: Boolean,
|
|
75
|
-
default: false
|
|
76
|
-
},
|
|
77
|
-
currentIndex: {
|
|
78
|
-
type: Number,
|
|
79
|
-
default: function _default3() {
|
|
80
|
-
return -1;
|
|
81
|
-
}
|
|
94
|
+
default: 'label'
|
|
82
95
|
}
|
|
83
96
|
}),
|
|
84
97
|
setup: function setup(props, context) {
|
|
85
98
|
return $setup({
|
|
86
|
-
props,
|
|
87
|
-
context,
|
|
88
|
-
template
|
|
99
|
+
props: props,
|
|
100
|
+
context: context,
|
|
101
|
+
template: template
|
|
89
102
|
});
|
|
90
103
|
}
|
|
91
|
-
}
|
|
92
|
-
|
|
104
|
+
};
|
|
105
|
+
|
|
93
106
|
DropdownItem.model = {
|
|
94
|
-
prop:
|
|
95
|
-
event:
|
|
107
|
+
prop: 'modelValue',
|
|
108
|
+
event: 'update:modelValue'
|
|
96
109
|
};
|
|
97
|
-
DropdownItem.install = function(Vue) {
|
|
110
|
+
DropdownItem.install = function (Vue) {
|
|
98
111
|
Vue.component(DropdownItem.name, DropdownItem);
|
|
99
112
|
};
|
|
100
|
-
DropdownItem.version =
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
};
|
|
113
|
+
DropdownItem.version = '3.4.7';
|
|
114
|
+
|
|
115
|
+
export { DropdownItem as default };
|
package/lib/mobile.js
CHANGED
|
@@ -1,219 +1,175 @@
|
|
|
1
|
-
import { renderless, api } from
|
|
2
|
-
import {
|
|
3
|
-
import { iconYes } from
|
|
4
|
-
import Popup from
|
|
5
|
-
import Button from
|
|
6
|
-
import Clickoutside from
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
context._registeredComponents.add(moduleIdentifier);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
options._ssrRegister = hook;
|
|
38
|
-
} else if (injectStyles) {
|
|
39
|
-
hook = shadowMode ? function() {
|
|
40
|
-
injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
|
|
41
|
-
} : injectStyles;
|
|
42
|
-
}
|
|
43
|
-
if (hook) {
|
|
44
|
-
if (options.functional) {
|
|
45
|
-
options._injectStyles = hook;
|
|
46
|
-
var originalRender = options.render;
|
|
47
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
48
|
-
hook.call(context);
|
|
49
|
-
return originalRender(h, context);
|
|
50
|
-
};
|
|
51
|
-
} else {
|
|
52
|
-
var existing = options.beforeCreate;
|
|
53
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
exports: scriptExports,
|
|
58
|
-
options
|
|
59
|
-
};
|
|
1
|
+
import { renderless, api } from '@opentiny/vue-renderless/dropdown-item/vue';
|
|
2
|
+
import { setup, props } 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
|
+
import { resolveComponent, resolveDirective, withDirectives, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, withCtx, renderSlot, Fragment, renderList, createElementVNode, createBlock, resolveDynamicComponent, toDisplayString, createCommentVNode, createTextVNode, vShow } from 'vue';
|
|
9
|
+
|
|
10
|
+
function _toConsumableArray(arr) {
|
|
11
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
12
|
+
}
|
|
13
|
+
function _arrayWithoutHoles(arr) {
|
|
14
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
15
|
+
}
|
|
16
|
+
function _iterableToArray(iter) {
|
|
17
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
18
|
+
}
|
|
19
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
20
|
+
if (!o) return;
|
|
21
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
22
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
23
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
24
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
25
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
26
|
+
}
|
|
27
|
+
function _arrayLikeToArray(arr, len) {
|
|
28
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
29
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
30
|
+
return arr2;
|
|
31
|
+
}
|
|
32
|
+
function _nonIterableSpread() {
|
|
33
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
60
34
|
}
|
|
61
35
|
|
|
62
|
-
var
|
|
36
|
+
var script = {
|
|
63
37
|
directives: {
|
|
64
|
-
Clickoutside
|
|
38
|
+
Clickoutside: Clickoutside
|
|
65
39
|
},
|
|
66
|
-
props: [].concat(props, [
|
|
40
|
+
props: [].concat(_toConsumableArray(props), ['modelValue', 'title', 'disabled', 'titleClass', 'options', 'icon', 'type']),
|
|
67
41
|
components: {
|
|
68
42
|
IconYes: iconYes(),
|
|
69
43
|
TinyPopup: Popup,
|
|
70
44
|
TinyButton: Button
|
|
71
45
|
},
|
|
72
|
-
emits: [
|
|
73
|
-
setup: function setup(
|
|
74
|
-
return
|
|
75
|
-
props:
|
|
76
|
-
context,
|
|
77
|
-
renderless,
|
|
78
|
-
api
|
|
46
|
+
emits: ['update:modelValue'],
|
|
47
|
+
setup: function setup$1(props, context) {
|
|
48
|
+
return setup({
|
|
49
|
+
props: props,
|
|
50
|
+
context: context,
|
|
51
|
+
renderless: renderless,
|
|
52
|
+
api: api
|
|
79
53
|
});
|
|
80
54
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var _hoisted_1 = {
|
|
58
|
+
key: 0,
|
|
59
|
+
class: "tiny-mobile-dropdown-item__options"
|
|
60
|
+
};
|
|
61
|
+
var _hoisted_2 = ["onClick"];
|
|
62
|
+
var _hoisted_3 = {
|
|
63
|
+
class: "tiny-mobile-dropdown-item__option-icon"
|
|
64
|
+
};
|
|
65
|
+
var _hoisted_4 = {
|
|
66
|
+
class: "tiny-mobile-dropdown-item__option-title"
|
|
67
|
+
};
|
|
68
|
+
var _hoisted_5 = {
|
|
69
|
+
class: "tiny-mobile-dropdown-item__option-value"
|
|
70
|
+
};
|
|
71
|
+
var _hoisted_6 = {
|
|
72
|
+
key: 1,
|
|
73
|
+
class: "tiny-mobile-dropdown-item__filter"
|
|
74
|
+
};
|
|
75
|
+
var _hoisted_7 = {
|
|
76
|
+
class: "tiny-mobile-dropdown-item__filter-wrap"
|
|
77
|
+
};
|
|
78
|
+
var _hoisted_8 = {
|
|
79
|
+
class: "tiny-mobile-dropdown-item__filter-title"
|
|
80
|
+
};
|
|
81
|
+
var _hoisted_9 = ["onClick"];
|
|
82
|
+
var _hoisted_10 = {
|
|
83
|
+
class: "tiny-mobile-dropdown-item__filter-operate"
|
|
84
|
+
};
|
|
85
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
86
|
+
var _component_icon_yes = resolveComponent("icon-yes");
|
|
87
|
+
var _component_tiny_button = resolveComponent("tiny-button");
|
|
88
|
+
var _component_tiny_popup = resolveComponent("tiny-popup");
|
|
89
|
+
var _directive_clickoutside = resolveDirective("clickoutside");
|
|
90
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
93
91
|
ref: "wrapper",
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
staticClass: "tiny-mobile-dropdown-item__options"
|
|
125
|
-
}, _vm._l(_vm.options, function(item, index) {
|
|
126
|
-
return _c("div", {
|
|
127
|
-
key: index,
|
|
128
|
-
staticClass: "tiny-mobile-dropdown-item__cell tiny-mobile-dropdown-item__option",
|
|
129
|
-
class: item.value === _vm.modelValue ? "is-active" : "",
|
|
130
|
-
attrs: {
|
|
131
|
-
"tabindex": "0"
|
|
132
|
-
},
|
|
133
|
-
on: {
|
|
134
|
-
"click": function click($event) {
|
|
135
|
-
return _vm.clickItem(item.value);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}, [_c("div", {
|
|
139
|
-
staticClass: "tiny-mobile-dropdown-item__option-icon"
|
|
140
|
-
}, [_vm._t("icon", function() {
|
|
141
|
-
return [_c(_vm.icon, {
|
|
142
|
-
tag: "component"
|
|
143
|
-
})];
|
|
144
|
-
})], 2), _c("div", {
|
|
145
|
-
staticClass: "tiny-mobile-dropdown-item__option-title"
|
|
146
|
-
}, [_vm._t("title", function() {
|
|
147
|
-
return [_c("span", {
|
|
148
|
-
style: {
|
|
149
|
-
color: item.value === _vm.modelValue && _vm.state.activeColor ? _vm.state.activeColor : ""
|
|
150
|
-
}
|
|
151
|
-
}, [_vm._v(_vm._s(item.text))])];
|
|
152
|
-
}, {
|
|
153
|
-
"titleData": item
|
|
154
|
-
})], 2), _c("div", {
|
|
155
|
-
staticClass: "tiny-mobile-dropdown-item__option-value"
|
|
156
|
-
}, [item.value === _vm.modelValue ? _c("icon-yes", {
|
|
157
|
-
attrs: {
|
|
158
|
-
"fill": _vm.state.activeColor ? _vm.state.activeColor : "#f36f64"
|
|
159
|
-
}
|
|
160
|
-
}) : _vm._e()], 1)]);
|
|
161
|
-
}), 0) : _vm._e(), _vm.type === "filter" ? _c("div", {
|
|
162
|
-
directives: [{
|
|
163
|
-
name: "clickoutside",
|
|
164
|
-
rawName: "v-clickoutside",
|
|
165
|
-
value: _vm.clickOutside,
|
|
166
|
-
expression: "clickOutside"
|
|
167
|
-
}],
|
|
168
|
-
staticClass: "tiny-mobile-dropdown-item__filter"
|
|
169
|
-
}, [_c("div", {
|
|
170
|
-
staticClass: "tiny-mobile-dropdown-item__filter-wrap"
|
|
171
|
-
}, _vm._l(_vm.options, function(item, key) {
|
|
172
|
-
return _c("div", {
|
|
173
|
-
key,
|
|
174
|
-
staticClass: "tiny-mobile-dropdown-item__cell tiny-mobile-dropdown-item__filter-item"
|
|
175
|
-
}, [_c("span", {
|
|
176
|
-
staticClass: "tiny-mobile-dropdown-item__filter-title"
|
|
177
|
-
}, [_vm._v(_vm._s(item.title))]), _c("ul", _vm._l(_vm.options.length === 0 ? item.data = [] : item.data, function(tag, tagkey) {
|
|
178
|
-
return _c("li", {
|
|
179
|
-
key: tagkey,
|
|
180
|
-
staticClass: "tiny-mobile-dropdown-item__filter-li",
|
|
181
|
-
class: [_vm.modelValue[key].indexOf(tag.value) > -1 ? "checked" : ""],
|
|
182
|
-
style: _vm.getOptionStyle(tag, _vm.modelValue[key]),
|
|
183
|
-
on: {
|
|
184
|
-
"click": function click($event) {
|
|
185
|
-
return _vm.tagClick(key, tag, $event);
|
|
92
|
+
class: normalizeClass(['tiny-mobile-dropdown-item--' + _ctx.state.direction, "tiny-mobile-dropdown-item"]),
|
|
93
|
+
onClick: _cache[1] || (_cache[1] = function () {
|
|
94
|
+
return _ctx.clickWrapper && _ctx.clickWrapper.apply(_ctx, arguments);
|
|
95
|
+
}),
|
|
96
|
+
style: normalizeStyle(_ctx.state.itemStyle)
|
|
97
|
+
}, [createVNode(_component_tiny_popup, {
|
|
98
|
+
modelValue: _ctx.state.showPopup,
|
|
99
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
|
|
100
|
+
return _ctx.state.showPopup = $event;
|
|
101
|
+
}),
|
|
102
|
+
popupClass: "tiny-mobile-dropdown-item__content",
|
|
103
|
+
overlay: _ctx.state.overlay,
|
|
104
|
+
"close-on-click-overlay": _ctx.state.closeOnClickOverlay,
|
|
105
|
+
closeable: false,
|
|
106
|
+
position: _ctx.state.direction === 'down' ? 'top' : 'bottom',
|
|
107
|
+
duration: _ctx.state.transition ? _ctx.state.duration : 0,
|
|
108
|
+
onOpen: _ctx.open,
|
|
109
|
+
onClose: _ctx.close,
|
|
110
|
+
onOpened: _ctx.opened,
|
|
111
|
+
onClosed: _ctx.closed
|
|
112
|
+
}, {
|
|
113
|
+
default: withCtx(function () {
|
|
114
|
+
return [renderSlot(_ctx.$slots, "default", {}, function () {
|
|
115
|
+
return [$props.type === 'selection' ? (openBlock(), createElementBlock("div", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList($props.options, function (item, index) {
|
|
116
|
+
return openBlock(), createElementBlock("div", {
|
|
117
|
+
class: normalizeClass(["tiny-mobile-dropdown-item__cell tiny-mobile-dropdown-item__option", item.value === $props.modelValue ? 'is-active' : '']),
|
|
118
|
+
key: index,
|
|
119
|
+
tabindex: "0",
|
|
120
|
+
onClick: function onClick($event) {
|
|
121
|
+
return _ctx.clickItem(item.value);
|
|
186
122
|
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
"
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
function
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
123
|
+
}, [createElementVNode("div", _hoisted_3, [renderSlot(_ctx.$slots, "icon", {}, function () {
|
|
124
|
+
return [(openBlock(), createBlock(resolveDynamicComponent($props.icon)))];
|
|
125
|
+
})]), createElementVNode("div", _hoisted_4, [renderSlot(_ctx.$slots, "title", {
|
|
126
|
+
titleData: item
|
|
127
|
+
}, function () {
|
|
128
|
+
return [createElementVNode("span", {
|
|
129
|
+
style: normalizeStyle({
|
|
130
|
+
color: item.value === $props.modelValue && _ctx.state.activeColor ? _ctx.state.activeColor : ''
|
|
131
|
+
})
|
|
132
|
+
}, toDisplayString(item.text), 5)];
|
|
133
|
+
})]), createElementVNode("div", _hoisted_5, [item.value === $props.modelValue ? (openBlock(), createBlock(_component_icon_yes, {
|
|
134
|
+
key: 0,
|
|
135
|
+
fill: _ctx.state.activeColor ? _ctx.state.activeColor : '#f36f64'
|
|
136
|
+
}, null, 8, ["fill"])) : createCommentVNode("", true)])], 10, _hoisted_2);
|
|
137
|
+
}), 128))])) : createCommentVNode("", true), $props.type === 'filter' ? withDirectives((openBlock(), createElementBlock("div", _hoisted_6, [createElementVNode("div", _hoisted_7, [(openBlock(true), createElementBlock(Fragment, null, renderList($props.options, function (item, key) {
|
|
138
|
+
return openBlock(), createElementBlock("div", {
|
|
139
|
+
key: key,
|
|
140
|
+
class: "tiny-mobile-dropdown-item__cell tiny-mobile-dropdown-item__filter-item"
|
|
141
|
+
}, [createElementVNode("span", _hoisted_8, toDisplayString(item.title), 1), createElementVNode("ul", null, [(openBlock(true), createElementBlock(Fragment, null, renderList($props.options.length === 0 ? item.data = [] : item.data, function (tag, tagkey) {
|
|
142
|
+
return openBlock(), createElementBlock("li", {
|
|
143
|
+
class: normalizeClass(["tiny-mobile-dropdown-item__filter-li", [$props.modelValue[key].indexOf(tag.value) > -1 ? 'checked' : '']]),
|
|
144
|
+
style: normalizeStyle(_ctx.getOptionStyle(tag, $props.modelValue[key])),
|
|
145
|
+
onClick: function onClick($event) {
|
|
146
|
+
return _ctx.tagClick(key, tag, $event);
|
|
147
|
+
},
|
|
148
|
+
key: tagkey
|
|
149
|
+
}, toDisplayString(tag.text), 15, _hoisted_9);
|
|
150
|
+
}), 128))])]);
|
|
151
|
+
}), 128))]), createElementVNode("div", _hoisted_10, [createVNode(_component_tiny_button, {
|
|
152
|
+
onClick: _ctx.reset
|
|
153
|
+
}, {
|
|
154
|
+
default: withCtx(function () {
|
|
155
|
+
return [createTextVNode("Reset")];
|
|
156
|
+
}),
|
|
157
|
+
_: 1
|
|
158
|
+
}, 8, ["onClick"]), createVNode(_component_tiny_button, {
|
|
159
|
+
type: "primary",
|
|
160
|
+
onClick: _ctx.confirm
|
|
161
|
+
}, {
|
|
162
|
+
default: withCtx(function () {
|
|
163
|
+
return [createTextVNode("OK")];
|
|
164
|
+
}),
|
|
165
|
+
_: 1
|
|
166
|
+
}, 8, ["onClick"])])])), [[_directive_clickoutside, _ctx.clickOutside]]) : createCommentVNode("", true)];
|
|
167
|
+
})];
|
|
168
|
+
}),
|
|
169
|
+
_: 3
|
|
170
|
+
}, 8, ["modelValue", "overlay", "close-on-click-overlay", "position", "duration", "onOpen", "onClose", "onOpened", "onClosed"])], 6)), [[vShow, _ctx.state.showWrapper]]);
|
|
213
171
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
export {
|
|
218
|
-
mobile as default
|
|
219
|
-
};
|
|
172
|
+
|
|
173
|
+
script.render = render;
|
|
174
|
+
|
|
175
|
+
export { script as default };
|