@opentinyvue/vue-cascader-select 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 +132 -0
- package/lib/mobile-first.js +313 -0
- package/package.json +21 -0
- package/src/Column.vue.d.ts +2 -0
- package/src/index.d.ts +92 -0
- package/src/mobile-first.vue.d.ts +2 -0
- package/src/token.d.ts +11 -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,132 @@
|
|
|
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 { $prefix, $props, $setup } from "@opentinyvue/vue-common";
|
|
11
|
+
import MobileFirstTemplate from "./mobile-first.js";
|
|
12
|
+
var $constants = {};
|
|
13
|
+
var template = function template2() {
|
|
14
|
+
return MobileFirstTemplate;
|
|
15
|
+
};
|
|
16
|
+
var CascaderSelect = {
|
|
17
|
+
name: $prefix + "CascaderSelect",
|
|
18
|
+
props: _extends({}, $props, {
|
|
19
|
+
_constants: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: function _default() {
|
|
22
|
+
return $constants;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
modelValue: {
|
|
26
|
+
type: Array,
|
|
27
|
+
default: function _default2() {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultValue: {
|
|
32
|
+
type: Array,
|
|
33
|
+
default: function _default3() {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
options: {
|
|
38
|
+
type: Array,
|
|
39
|
+
default: function _default4() {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
threeDimensional: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
swipeDuration: {
|
|
48
|
+
type: [Number, String],
|
|
49
|
+
default: 1e3
|
|
50
|
+
},
|
|
51
|
+
visibleOptionNum: {
|
|
52
|
+
type: [Number, String],
|
|
53
|
+
default: 5
|
|
54
|
+
},
|
|
55
|
+
optionHeight: {
|
|
56
|
+
type: [Number, String],
|
|
57
|
+
default: 36
|
|
58
|
+
},
|
|
59
|
+
fieldNames: {
|
|
60
|
+
type: Object,
|
|
61
|
+
default: function _default5() {
|
|
62
|
+
return {
|
|
63
|
+
text: "label",
|
|
64
|
+
value: "id",
|
|
65
|
+
children: "children"
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
visible: Boolean,
|
|
70
|
+
valueType: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: "number"
|
|
73
|
+
},
|
|
74
|
+
valueField: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: "id"
|
|
77
|
+
},
|
|
78
|
+
textField: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: "label"
|
|
81
|
+
},
|
|
82
|
+
childrenField: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: "children"
|
|
85
|
+
},
|
|
86
|
+
disabled: Function,
|
|
87
|
+
textColor: {
|
|
88
|
+
type: Object,
|
|
89
|
+
default: function _default6() {
|
|
90
|
+
return {
|
|
91
|
+
default: "",
|
|
92
|
+
first: "",
|
|
93
|
+
second: "",
|
|
94
|
+
third: "",
|
|
95
|
+
disabled: ""
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
lockScroll: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: true
|
|
102
|
+
},
|
|
103
|
+
customClass: [String, Object, Array],
|
|
104
|
+
panelCustomClass: [String, Object, Array],
|
|
105
|
+
type: {
|
|
106
|
+
type: String,
|
|
107
|
+
validator: function validator(value) {
|
|
108
|
+
return ~["cascade", "single"].indexOf(value);
|
|
109
|
+
},
|
|
110
|
+
default: "single"
|
|
111
|
+
}
|
|
112
|
+
}),
|
|
113
|
+
setup: function setup(props, context) {
|
|
114
|
+
return $setup({
|
|
115
|
+
props,
|
|
116
|
+
context,
|
|
117
|
+
template
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
var version = "2.21.0";
|
|
122
|
+
CascaderSelect.model = {
|
|
123
|
+
prop: "modelValue",
|
|
124
|
+
event: "update:modelValue"
|
|
125
|
+
};
|
|
126
|
+
CascaderSelect.install = function(Vue) {
|
|
127
|
+
Vue.component(CascaderSelect.name, CascaderSelect);
|
|
128
|
+
};
|
|
129
|
+
CascaderSelect.version = version;
|
|
130
|
+
export {
|
|
131
|
+
CascaderSelect as default
|
|
132
|
+
};
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { renderless as renderless$1, api as api$1 } from '@opentinyvue/vue-renderless/cascader-select/vue';
|
|
2
|
+
import { defineComponent, $prefix, $props, setup, props } from '@opentinyvue/vue-common';
|
|
3
|
+
import { renderless, api } from '@opentinyvue/vue-renderless/cascader-select/column';
|
|
4
|
+
import ActionSheet from '@opentinyvue/vue-action-sheet';
|
|
5
|
+
import Button from '@opentinyvue/vue-button';
|
|
6
|
+
|
|
7
|
+
function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
8
|
+
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
9
|
+
if (render) {
|
|
10
|
+
options.render = render;
|
|
11
|
+
options.staticRenderFns = staticRenderFns;
|
|
12
|
+
options._compiled = true;
|
|
13
|
+
}
|
|
14
|
+
var hook;
|
|
15
|
+
if (injectStyles) {
|
|
16
|
+
hook = injectStyles;
|
|
17
|
+
}
|
|
18
|
+
if (hook) {
|
|
19
|
+
if (options.functional) {
|
|
20
|
+
options._injectStyles = hook;
|
|
21
|
+
var originalRender = options.render;
|
|
22
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
23
|
+
hook.call(context);
|
|
24
|
+
return originalRender(h, context);
|
|
25
|
+
};
|
|
26
|
+
} else {
|
|
27
|
+
var existing = options.beforeCreate;
|
|
28
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
exports: scriptExports,
|
|
33
|
+
options
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function _extends() {
|
|
38
|
+
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
39
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
40
|
+
var t = arguments[e];
|
|
41
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
42
|
+
}
|
|
43
|
+
return n;
|
|
44
|
+
}, _extends.apply(null, arguments);
|
|
45
|
+
}
|
|
46
|
+
var classes = {
|
|
47
|
+
"header-item": "cursor-pointer px-4 flex items-center justify-center min-w-[50px] h-full text-sm",
|
|
48
|
+
"picker-column": "flex relative before:content-[''] before:absolute before:top-1/2 before:h-[var(--lineHeight)] before:w-full before:border-t before:border-b before:border-color-bg-3 before:scale-90 before:-translate-y-1/2",
|
|
49
|
+
"picker-columnitem": "flex-1 h-full relative",
|
|
50
|
+
"picker-bar": "flex h-12 items-center justify-between",
|
|
51
|
+
"col-list": "relative block w-full h-full overflow-hidden text-center scrolling-touch",
|
|
52
|
+
"col-roller": "absolute block top-1/2 w-full z1 -translate-y-1/2 [transform-style:preserve-3d] h-[var(--lineHeight)]",
|
|
53
|
+
"col-roller-item": "block [backface-visibility:hidden] absolute top-0 w-full h-9 leading-9 text-color-text-primary truncate",
|
|
54
|
+
"col-item-tile": "block text-center w-full truncate",
|
|
55
|
+
"col-roller-mask": "absolute w-full h-full block [background-image:linear-gradient(180deg,rgba(255,255,255,0.9),rgba(255,255,255,0.4)),linear-gradient(0deg,rgba(255,255,255,0.9),rgba(255,255,255,0.4))] [background-position:top,bottom] bg-no-repeat z-1"
|
|
56
|
+
};
|
|
57
|
+
var __vue2_script$1 = defineComponent({
|
|
58
|
+
name: $prefix + "CascaderSelectColumn",
|
|
59
|
+
props: _extends({}, $props, {
|
|
60
|
+
// 当前选中项
|
|
61
|
+
value: [String, Number],
|
|
62
|
+
defaultValue: [String, Number],
|
|
63
|
+
columnsType: String,
|
|
64
|
+
column: {
|
|
65
|
+
type: Array,
|
|
66
|
+
default: function _default() {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
// 是否开启3D效果
|
|
71
|
+
threeDimensional: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: true
|
|
74
|
+
},
|
|
75
|
+
swipeDuration: {
|
|
76
|
+
type: [Number, String],
|
|
77
|
+
default: 1e3
|
|
78
|
+
},
|
|
79
|
+
visibleOptionNum: {
|
|
80
|
+
type: [Number, String],
|
|
81
|
+
default: 7
|
|
82
|
+
},
|
|
83
|
+
optionHeight: {
|
|
84
|
+
type: [Number, String],
|
|
85
|
+
default: 36
|
|
86
|
+
},
|
|
87
|
+
fieldNames: {
|
|
88
|
+
type: Object,
|
|
89
|
+
default: function _default2() {
|
|
90
|
+
return {};
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
disabled: Boolean,
|
|
94
|
+
visible: Boolean,
|
|
95
|
+
textColor: {
|
|
96
|
+
type: Object,
|
|
97
|
+
default: function _default3() {
|
|
98
|
+
return {};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}),
|
|
102
|
+
emits: ["click", "change"],
|
|
103
|
+
setup: function setup$1(props2, context) {
|
|
104
|
+
return setup({
|
|
105
|
+
props: props2,
|
|
106
|
+
context,
|
|
107
|
+
renderless,
|
|
108
|
+
api,
|
|
109
|
+
classes,
|
|
110
|
+
mono: true
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
var render$1 = function render$12() {
|
|
115
|
+
var _vm = this;
|
|
116
|
+
var _h = _vm.$createElement;
|
|
117
|
+
var _c = _vm._self._c || _h;
|
|
118
|
+
return _c("div", {
|
|
119
|
+
class: _vm.gcls("col-list"),
|
|
120
|
+
attrs: {
|
|
121
|
+
"data-tag": "tiny-cascader-picker__list"
|
|
122
|
+
},
|
|
123
|
+
on: {
|
|
124
|
+
"touchstart": _vm.onTouchStart,
|
|
125
|
+
"touchmove": _vm.onTouchMove,
|
|
126
|
+
"touchend": _vm.onTouchEnd
|
|
127
|
+
}
|
|
128
|
+
}, [_c("div", {
|
|
129
|
+
ref: "roller",
|
|
130
|
+
class: _vm.gcls("col-roller"),
|
|
131
|
+
style: _vm.threeDimensional ? _vm.state.touchRollerStyle : _vm.state.touchTileStyle,
|
|
132
|
+
attrs: {
|
|
133
|
+
"data-tag": "tiny-cascader-picker-roller"
|
|
134
|
+
},
|
|
135
|
+
on: {
|
|
136
|
+
"transitionend": _vm.stopMomentum
|
|
137
|
+
}
|
|
138
|
+
}, _vm._l(_vm.column, function(item, index) {
|
|
139
|
+
var _vm$m, _vm$m2, _vm$m3, _vm$m4;
|
|
140
|
+
return _c("div", {
|
|
141
|
+
key: item[_vm.fieldNames.value] || index
|
|
142
|
+
}, [item && item[_vm.fieldNames.text] && _vm.threeDimensional ? _c("div", {
|
|
143
|
+
class: _vm.m(_vm.gcls("col-roller-item"), {
|
|
144
|
+
"invisible opacity-0": _vm.isHidden(index + 1)
|
|
145
|
+
}, {
|
|
146
|
+
"text-color-brand": item === _vm.column[_vm.state.currIndex - 1]
|
|
147
|
+
}, {
|
|
148
|
+
"text-color-icon-disabled": item === _vm.column[_vm.state.currIndex - 1] && _vm.disabled
|
|
149
|
+
}),
|
|
150
|
+
style: _vm.setRollerStyle(index + 1),
|
|
151
|
+
attrs: {
|
|
152
|
+
"data-tag": "tiny-cascader-picker-roller-item"
|
|
153
|
+
}
|
|
154
|
+
}, [_vm._v(" " + _vm._s(item[_vm.fieldNames.text]) + " ")]) : _vm._e(), item && item[_vm.fieldNames.text] && !_vm.threeDimensional ? _c("div", {
|
|
155
|
+
class: _vm.m(_vm.gcls("col-item-tile"), _vm.textColor.default || "text-color-text-primary", (_vm$m = {}, _vm$m[_vm.textColor.third || "text-color-icon-placeholder"] = _vm.OptionStyle(item, _vm.column, 2), _vm$m), (_vm$m2 = {}, _vm$m2[_vm.textColor.second || "text-color-icon-secondary"] = _vm.OptionStyle(item, _vm.column, 1), _vm$m2), (_vm$m3 = {}, _vm$m3[_vm.textColor.first || "text-color-icon-focus"] = _vm.OptionStyle(item, _vm.column, 0), _vm$m3), (_vm$m4 = {}, _vm$m4[_vm.textColor.disabled || "text-color-icon-disabled"] = _vm.OptionStyle(item, _vm.column, 0) && _vm.disabled, _vm$m4)),
|
|
156
|
+
style: {
|
|
157
|
+
height: _vm.pxCheck(_vm.optionHeight),
|
|
158
|
+
lineHeight: _vm.pxCheck(_vm.optionHeight)
|
|
159
|
+
},
|
|
160
|
+
attrs: {
|
|
161
|
+
"data-tag": "tiny-cascader-picker-roller-item-tile"
|
|
162
|
+
}
|
|
163
|
+
}, [_vm._v(" " + _vm._s(item[_vm.fieldNames.text]) + " ")]) : _vm._e()]);
|
|
164
|
+
}), 0), _c("div", {
|
|
165
|
+
class: _vm.gcls("col-roller-mask"),
|
|
166
|
+
style: _vm.state.maskStyles,
|
|
167
|
+
attrs: {
|
|
168
|
+
"data-tag": "tiny-cascader-picker-roller-mask"
|
|
169
|
+
}
|
|
170
|
+
})]);
|
|
171
|
+
};
|
|
172
|
+
var staticRenderFns$1 = [];
|
|
173
|
+
var __cssModules$1 = {};
|
|
174
|
+
var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, render$1, staticRenderFns$1, false, __vue2_injectStyles$1);
|
|
175
|
+
function __vue2_injectStyles$1(context) {
|
|
176
|
+
for (var o in __cssModules$1) {
|
|
177
|
+
this[o] = __cssModules$1[o];
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
var PickerColumn = /* @__PURE__ */ function() {
|
|
181
|
+
return __component__$1.exports;
|
|
182
|
+
}();
|
|
183
|
+
var __vue2_script = defineComponent({
|
|
184
|
+
components: {
|
|
185
|
+
PickerColumn,
|
|
186
|
+
TinyActionSheet: ActionSheet,
|
|
187
|
+
TinyButton: Button
|
|
188
|
+
},
|
|
189
|
+
emits: ["cancel", "change", "confirm", "update:modelValue", "update:visible"],
|
|
190
|
+
props: [].concat(props, ["modelValue", "options", "threeDimensional", "swipeDuration", "visibleOptionNum", "optionHeight", "fieldNames", "visible", "valueType", "valueField", "textField", "childrenField", "disabled", "textColor", "lockScroll", "customClass", "panelCustomClass", "type", "defaultValue"]),
|
|
191
|
+
setup: function setup2(props2, context) {
|
|
192
|
+
return setup({
|
|
193
|
+
props: props2,
|
|
194
|
+
context,
|
|
195
|
+
renderless: renderless$1,
|
|
196
|
+
api: api$1,
|
|
197
|
+
classes
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
var render = function render2() {
|
|
202
|
+
var _vm = this;
|
|
203
|
+
var _h = _vm.$createElement;
|
|
204
|
+
var _c = _vm._self._c || _h;
|
|
205
|
+
return _c("div", {
|
|
206
|
+
attrs: {
|
|
207
|
+
"data-tag": "tiny-mobile-cascader-select"
|
|
208
|
+
}
|
|
209
|
+
}, [_c("tiny-action-sheet", {
|
|
210
|
+
attrs: {
|
|
211
|
+
"custom-class": _vm.m("rounded-t-lg bg-color-bg-1", _vm.customClass),
|
|
212
|
+
"lock-scroll": _vm.lockScroll,
|
|
213
|
+
"visible": _vm.state.actionSheetVisible
|
|
214
|
+
},
|
|
215
|
+
on: {
|
|
216
|
+
"update:visible": function updateVisible($event) {
|
|
217
|
+
_vm.state.actionSheetVisible = $event;
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
scopedSlots: _vm._u([{
|
|
221
|
+
key: "header-left",
|
|
222
|
+
fn: function fn() {
|
|
223
|
+
return [_vm._t("header-left")];
|
|
224
|
+
},
|
|
225
|
+
proxy: true
|
|
226
|
+
}], null, true)
|
|
227
|
+
}, [_c("div", {
|
|
228
|
+
staticClass: "w-full h-max rounded-t-lg bg-color-bg-1 select-none overflow-hidden",
|
|
229
|
+
attrs: {
|
|
230
|
+
"data-tag": "tiny-mobile-cascader-select-body"
|
|
231
|
+
},
|
|
232
|
+
on: {
|
|
233
|
+
"click": function click($event) {
|
|
234
|
+
$event.stopPropagation();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}, [_c("div", {
|
|
238
|
+
ref: "selectPanel",
|
|
239
|
+
class: _vm.m("w-full h-max grid", _vm.panelCustomClass),
|
|
240
|
+
attrs: {
|
|
241
|
+
"data-tag": "tiny-mobile-cascader-select-selectpanel"
|
|
242
|
+
}
|
|
243
|
+
}, [_c("div", {
|
|
244
|
+
staticClass: "relative text-sm",
|
|
245
|
+
attrs: {
|
|
246
|
+
"data-tag": "tiny-cascader-select-picker"
|
|
247
|
+
}
|
|
248
|
+
}, [_vm._t("top"), _c("div", {
|
|
249
|
+
class: _vm.gcls("picker-column"),
|
|
250
|
+
style: _vm.columnStyle,
|
|
251
|
+
attrs: {
|
|
252
|
+
"data-tag": "tiny-cascader-picker__column"
|
|
253
|
+
}
|
|
254
|
+
}, _vm._l(_vm.columnsList, function(column, columnIndex) {
|
|
255
|
+
return _c("div", {
|
|
256
|
+
key: columnIndex,
|
|
257
|
+
class: _vm.gcls("picker-columnitem"),
|
|
258
|
+
attrs: {
|
|
259
|
+
"data-tag": "tiny-cascader-picker__columnitem"
|
|
260
|
+
}
|
|
261
|
+
}, [columnIndex > 0 ? _vm._t("split") : _vm._e(), _c("picker-column", {
|
|
262
|
+
ref: "swipeRef",
|
|
263
|
+
refInFor: true,
|
|
264
|
+
attrs: {
|
|
265
|
+
"column": column,
|
|
266
|
+
"disabled": _vm.isDisabled,
|
|
267
|
+
"text-color": _vm.textColor,
|
|
268
|
+
"columns-type": _vm.columnsType,
|
|
269
|
+
"field-names": _vm.columnFieldNames,
|
|
270
|
+
"value": _vm.defaultValues[columnIndex],
|
|
271
|
+
"default-value": _vm.defaultValue[columnIndex],
|
|
272
|
+
"three-dimensional": _vm.threeDimensional,
|
|
273
|
+
"swipe-duration": _vm.swipeDuration,
|
|
274
|
+
"visible-option-num": _vm.visibleOptionNum,
|
|
275
|
+
"option-height": _vm.optionHeight,
|
|
276
|
+
"visible": _vm.state.actionSheetVisible
|
|
277
|
+
},
|
|
278
|
+
on: {
|
|
279
|
+
"change": function change(option) {
|
|
280
|
+
_vm.changeHandler(columnIndex, option);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
})], 2);
|
|
284
|
+
}), 0), _vm._t("default")], 2)]), _c("div", {
|
|
285
|
+
staticClass: "w-full h-11 mt-4 flex justify-center items-center",
|
|
286
|
+
attrs: {
|
|
287
|
+
"data-tag": "tiny-mobile-cascader-select-button"
|
|
288
|
+
}
|
|
289
|
+
}, [_c("tiny-button", {
|
|
290
|
+
attrs: {
|
|
291
|
+
"type": "primary",
|
|
292
|
+
"size": "large",
|
|
293
|
+
"custom-class": _vm.m("h-10 sm:h-10 w-full sm:w-auto mx-4 sm:mx-0 flex justify-center items-center", _vm.isDisabled ? "bg-color-icon-disabled" : "bg-color-icon-focus"),
|
|
294
|
+
"disabled": _vm.isDisabled
|
|
295
|
+
},
|
|
296
|
+
on: {
|
|
297
|
+
"click": _vm.confirm
|
|
298
|
+
}
|
|
299
|
+
}, [_vm._v(_vm._s(_vm.t("ui.button.confirm")))])], 1)])])], 1);
|
|
300
|
+
};
|
|
301
|
+
var staticRenderFns = [];
|
|
302
|
+
var __cssModules = {};
|
|
303
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
|
|
304
|
+
function __vue2_injectStyles(context) {
|
|
305
|
+
for (var o in __cssModules) {
|
|
306
|
+
this[o] = __cssModules[o];
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
var mobileFirst = /* @__PURE__ */ function() {
|
|
310
|
+
return __component__.exports;
|
|
311
|
+
}();
|
|
312
|
+
|
|
313
|
+
export { mobileFirst as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opentinyvue/vue-cascader-select",
|
|
3
|
+
"version": "2.21.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "./lib/index.js",
|
|
6
|
+
"module": "./lib/index.js",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"type": "module",
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@opentinyvue/vue-action-sheet": "~2.21.0",
|
|
11
|
+
"@opentinyvue/vue-button": "~2.21.0",
|
|
12
|
+
"@opentinyvue/vue-common": "~2.21.0",
|
|
13
|
+
"@opentinyvue/vue-renderless": "~3.21.0"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"types": "index.d.ts",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "pnpm -w build:ui $npm_package_name",
|
|
19
|
+
"//postversion": "pnpm build"
|
|
20
|
+
}
|
|
21
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
name: string;
|
|
3
|
+
props: {
|
|
4
|
+
_constants: {
|
|
5
|
+
type: ObjectConstructor;
|
|
6
|
+
default: () => {};
|
|
7
|
+
};
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: ArrayConstructor;
|
|
10
|
+
default: () => never[];
|
|
11
|
+
};
|
|
12
|
+
defaultValue: {
|
|
13
|
+
type: ArrayConstructor;
|
|
14
|
+
default: () => never[];
|
|
15
|
+
};
|
|
16
|
+
options: {
|
|
17
|
+
type: ArrayConstructor;
|
|
18
|
+
default: () => never[];
|
|
19
|
+
};
|
|
20
|
+
threeDimensional: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
swipeDuration: {
|
|
25
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
26
|
+
default: number;
|
|
27
|
+
};
|
|
28
|
+
visibleOptionNum: {
|
|
29
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
optionHeight: {
|
|
33
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
34
|
+
default: number;
|
|
35
|
+
};
|
|
36
|
+
fieldNames: {
|
|
37
|
+
type: ObjectConstructor;
|
|
38
|
+
default: () => {
|
|
39
|
+
text: string;
|
|
40
|
+
value: string;
|
|
41
|
+
children: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
visible: BooleanConstructor;
|
|
45
|
+
valueType: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
default: string;
|
|
48
|
+
};
|
|
49
|
+
valueField: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
default: string;
|
|
52
|
+
};
|
|
53
|
+
textField: {
|
|
54
|
+
type: StringConstructor;
|
|
55
|
+
default: string;
|
|
56
|
+
};
|
|
57
|
+
childrenField: {
|
|
58
|
+
type: StringConstructor;
|
|
59
|
+
default: string;
|
|
60
|
+
};
|
|
61
|
+
disabled: FunctionConstructor;
|
|
62
|
+
textColor: {
|
|
63
|
+
type: ObjectConstructor;
|
|
64
|
+
default: () => {
|
|
65
|
+
default: string;
|
|
66
|
+
first: string;
|
|
67
|
+
second: string;
|
|
68
|
+
third: string;
|
|
69
|
+
disabled: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
lockScroll: {
|
|
73
|
+
type: BooleanConstructor;
|
|
74
|
+
default: boolean;
|
|
75
|
+
};
|
|
76
|
+
customClass: (StringConstructor | ArrayConstructor | ObjectConstructor)[];
|
|
77
|
+
panelCustomClass: (StringConstructor | ArrayConstructor | ObjectConstructor)[];
|
|
78
|
+
type: {
|
|
79
|
+
type: StringConstructor;
|
|
80
|
+
validator: (value: any) => number;
|
|
81
|
+
default: string;
|
|
82
|
+
};
|
|
83
|
+
tiny_mode: StringConstructor;
|
|
84
|
+
tiny_mode_root: BooleanConstructor;
|
|
85
|
+
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
86
|
+
tiny_renderless: FunctionConstructor;
|
|
87
|
+
tiny_theme: StringConstructor;
|
|
88
|
+
tiny_chart_theme: ObjectConstructor;
|
|
89
|
+
};
|
|
90
|
+
setup(props: any, context: any): () => any;
|
|
91
|
+
};
|
|
92
|
+
export default _default;
|
package/src/token.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const classes: {
|
|
2
|
+
'header-item': string;
|
|
3
|
+
'picker-column': string;
|
|
4
|
+
'picker-columnitem': string;
|
|
5
|
+
'picker-bar': string;
|
|
6
|
+
'col-list': string;
|
|
7
|
+
'col-roller': string;
|
|
8
|
+
'col-roller-item': string;
|
|
9
|
+
'col-item-tile': string;
|
|
10
|
+
'col-roller-mask': string;
|
|
11
|
+
};
|