@opentinyvue/vue-filter-bar 2.21.0 → 3.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/lib/index.js +1 -1
- package/lib/mobile-first.js +74 -85
- package/package.json +3 -3
- package/src/index.d.ts +23 -1
- package/src/mobile-first.vue.d.ts +33 -1
package/lib/index.js
CHANGED
package/lib/mobile-first.js
CHANGED
|
@@ -1,36 +1,40 @@
|
|
|
1
1
|
import { renderless, api } from '@opentinyvue/vue-renderless/filter-bar/vue';
|
|
2
2
|
import { defineComponent, setup, $props } from '@opentinyvue/vue-common';
|
|
3
3
|
import { IconUnfilter, IconChevronDown, IconArrowBottom } from '@opentinyvue/vue-icon';
|
|
4
|
+
import { resolveComponent, openBlock, createElementBlock, Fragment, renderList, normalizeClass, withModifiers, renderSlot, createElementVNode, toDisplayString, createVNode } from 'vue';
|
|
4
5
|
|
|
5
|
-
function
|
|
6
|
-
var
|
|
7
|
-
if (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
7
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
8
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
9
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
10
|
+
t && (r = t);
|
|
11
|
+
var o = 0;
|
|
12
|
+
return function() {
|
|
13
|
+
return o >= r.length ? { done: true } : { done: false, value: r[o++] };
|
|
14
|
+
};
|
|
11
15
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var originalRender = options.render;
|
|
20
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
21
|
-
hook.call(context);
|
|
22
|
-
return originalRender(h, context);
|
|
23
|
-
};
|
|
24
|
-
} else {
|
|
25
|
-
var existing = options.beforeCreate;
|
|
26
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
27
|
-
}
|
|
16
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
17
|
+
}
|
|
18
|
+
function _unsupportedIterableToArray(r, a) {
|
|
19
|
+
if (r) {
|
|
20
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
21
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
22
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
28
23
|
}
|
|
29
|
-
return {
|
|
30
|
-
exports: scriptExports,
|
|
31
|
-
options
|
|
32
|
-
};
|
|
33
24
|
}
|
|
25
|
+
function _arrayLikeToArray(r, a) {
|
|
26
|
+
(null == a || a > r.length) && (a = r.length);
|
|
27
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
28
|
+
return n;
|
|
29
|
+
}
|
|
30
|
+
var _export_sfc = function _export_sfc2(sfc, props) {
|
|
31
|
+
var target = sfc.__vccOpts || sfc;
|
|
32
|
+
for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
|
|
33
|
+
var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
|
|
34
|
+
target[key] = val;
|
|
35
|
+
}
|
|
36
|
+
return target;
|
|
37
|
+
};
|
|
34
38
|
|
|
35
39
|
function _extends() {
|
|
36
40
|
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
@@ -41,7 +45,7 @@ function _extends() {
|
|
|
41
45
|
return n;
|
|
42
46
|
}, _extends.apply(null, arguments);
|
|
43
47
|
}
|
|
44
|
-
var
|
|
48
|
+
var _sfc_main = defineComponent({
|
|
45
49
|
components: {
|
|
46
50
|
IconUnfilter: IconUnfilter(),
|
|
47
51
|
IconChevronDown: IconChevronDown(),
|
|
@@ -61,65 +65,50 @@ var __vue2_script = defineComponent({
|
|
|
61
65
|
});
|
|
62
66
|
}
|
|
63
67
|
});
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var _c = _vm._self._c || _h;
|
|
68
|
-
return _c("div", {
|
|
69
|
-
staticClass: "relative text-sm text-color-text-primary w-full h-11 flex items-center justify-center px-4 border-b-0.5 border-color-border-separator",
|
|
70
|
-
attrs: {
|
|
71
|
-
"data-tag": "tiny-filter-bar"
|
|
72
|
-
}
|
|
73
|
-
}, [_vm._l(_vm.data, function(item, index) {
|
|
74
|
-
return _c("div", {
|
|
75
|
-
key: index,
|
|
76
|
-
class: ["flex-1 flex items-center justify-center cursor-pointer overflow-hidden mx-3", {
|
|
77
|
-
"text-color-brand": _vm.modelValue === index
|
|
78
|
-
}],
|
|
79
|
-
attrs: {
|
|
80
|
-
"data-tag": "tiny-filter-bar-body"
|
|
81
|
-
},
|
|
82
|
-
on: {
|
|
83
|
-
"click": function click($event) {
|
|
84
|
-
$event.stopPropagation();
|
|
85
|
-
return _vm.click(index);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}, [_vm._t("default", function() {
|
|
89
|
-
return [_c("span", {
|
|
90
|
-
staticClass: "truncate",
|
|
91
|
-
attrs: {
|
|
92
|
-
"data-tag": "tiny-filter-bar-item",
|
|
93
|
-
"title": item
|
|
94
|
-
}
|
|
95
|
-
}, [_vm._v(_vm._s(item))]), _c("IconArrowBottom", {
|
|
96
|
-
class: _vm.modelValue !== index ? "text-color-icon-placeholder rotate-0" : "rotate-180",
|
|
97
|
-
attrs: {
|
|
98
|
-
"custom-class": "flex-none w-3 h-3 ml-2 fill-current transition-transform duration-300"
|
|
99
|
-
}
|
|
100
|
-
})];
|
|
101
|
-
}, {
|
|
102
|
-
"data": item,
|
|
103
|
-
"index": index,
|
|
104
|
-
"active": _vm.modelValue === index
|
|
105
|
-
})], 2);
|
|
106
|
-
}), _c("div", {
|
|
107
|
-
staticClass: "h-full flex items-center justify-center truncate",
|
|
108
|
-
attrs: {
|
|
109
|
-
"data-tag": "tiny-filter-bar-icon"
|
|
110
|
-
}
|
|
111
|
-
}, [_vm._t("icon")], 2)], 2);
|
|
68
|
+
var _hoisted_1 = {
|
|
69
|
+
"data-tag": "tiny-filter-bar",
|
|
70
|
+
class: "relative text-sm text-color-text-primary w-full h-11 flex items-center justify-center px-4 border-b-0.5 border-color-border-separator"
|
|
112
71
|
};
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
var
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
72
|
+
var _hoisted_2 = ["onClick"];
|
|
73
|
+
var _hoisted_3 = ["title"];
|
|
74
|
+
var _hoisted_4 = {
|
|
75
|
+
class: "h-full flex items-center justify-center truncate",
|
|
76
|
+
"data-tag": "tiny-filter-bar-icon"
|
|
77
|
+
};
|
|
78
|
+
function _sfc_render(_ctx, _cache, $props2, $setup, $data, $options) {
|
|
79
|
+
var _component_IconArrowBottom = resolveComponent("IconArrowBottom");
|
|
80
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [(openBlock(true), createElementBlock(
|
|
81
|
+
Fragment,
|
|
82
|
+
null,
|
|
83
|
+
renderList(_ctx.data, function(item, index) {
|
|
84
|
+
return openBlock(), createElementBlock("div", {
|
|
85
|
+
"data-tag": "tiny-filter-bar-body",
|
|
86
|
+
key: index,
|
|
87
|
+
class: normalizeClass(["flex-1 flex items-center justify-center cursor-pointer overflow-hidden mx-3", {
|
|
88
|
+
"text-color-brand": _ctx.modelValue === index
|
|
89
|
+
}]),
|
|
90
|
+
onClick: withModifiers(function($event) {
|
|
91
|
+
return _ctx.click(index);
|
|
92
|
+
}, ["stop"])
|
|
93
|
+
}, [renderSlot(_ctx.$slots, "default", {
|
|
94
|
+
data: item,
|
|
95
|
+
index,
|
|
96
|
+
active: _ctx.modelValue === index
|
|
97
|
+
}, function() {
|
|
98
|
+
return [createElementVNode("span", {
|
|
99
|
+
"data-tag": "tiny-filter-bar-item",
|
|
100
|
+
class: "truncate",
|
|
101
|
+
title: item
|
|
102
|
+
}, toDisplayString(item), 9, _hoisted_3), createVNode(_component_IconArrowBottom, {
|
|
103
|
+
"custom-class": "flex-none w-3 h-3 ml-2 fill-current transition-transform duration-300",
|
|
104
|
+
class: normalizeClass(_ctx.modelValue !== index ? "text-color-icon-placeholder rotate-0" : "rotate-180")
|
|
105
|
+
}, null, 8, ["class"])];
|
|
106
|
+
})], 10, _hoisted_2);
|
|
107
|
+
}),
|
|
108
|
+
128
|
|
109
|
+
/* KEYED_FRAGMENT */
|
|
110
|
+
)), createElementVNode("div", _hoisted_4, [renderSlot(_ctx.$slots, "icon")])]);
|
|
120
111
|
}
|
|
121
|
-
var mobileFirst = /* @__PURE__ */
|
|
122
|
-
return __component__.exports;
|
|
123
|
-
}();
|
|
112
|
+
var mobileFirst = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
124
113
|
|
|
125
114
|
export { mobileFirst as default };
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentinyvue/vue-filter-bar",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.21.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
|
-
"@opentinyvue/vue-common": "~
|
|
10
|
+
"@opentinyvue/vue-common": "~3.21.0",
|
|
11
11
|
"@opentinyvue/vue-renderless": "~3.21.0",
|
|
12
|
-
"@opentinyvue/vue-icon": "~
|
|
12
|
+
"@opentinyvue/vue-icon": "~3.21.0"
|
|
13
13
|
},
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"types": "index.d.ts",
|
package/src/index.d.ts
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("@vue/runtime-core").DefineComponent<{
|
|
2
|
+
modelValue: NumberConstructor;
|
|
3
|
+
data: ArrayConstructor;
|
|
4
|
+
tiny_mode: StringConstructor;
|
|
5
|
+
tiny_mode_root: BooleanConstructor;
|
|
6
|
+
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
7
|
+
tiny_renderless: FunctionConstructor;
|
|
8
|
+
tiny_theme: StringConstructor;
|
|
9
|
+
tiny_chart_theme: ObjectConstructor;
|
|
10
|
+
}, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
13
|
+
modelValue: NumberConstructor;
|
|
14
|
+
data: ArrayConstructor;
|
|
15
|
+
tiny_mode: StringConstructor;
|
|
16
|
+
tiny_mode_root: BooleanConstructor;
|
|
17
|
+
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
18
|
+
tiny_renderless: FunctionConstructor;
|
|
19
|
+
tiny_theme: StringConstructor;
|
|
20
|
+
tiny_chart_theme: ObjectConstructor;
|
|
21
|
+
}>>, {
|
|
22
|
+
tiny_mode_root: boolean;
|
|
23
|
+
}, {}>;
|
|
2
24
|
export default _default;
|
|
@@ -1,2 +1,34 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("@vue/runtime-core").DefineComponent<{
|
|
2
|
+
modelValue: NumberConstructor;
|
|
3
|
+
data: ArrayConstructor;
|
|
4
|
+
tiny_mode: StringConstructor;
|
|
5
|
+
tiny_mode_root: BooleanConstructor;
|
|
6
|
+
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
7
|
+
tiny_renderless: FunctionConstructor;
|
|
8
|
+
tiny_theme: StringConstructor;
|
|
9
|
+
tiny_chart_theme: ObjectConstructor;
|
|
10
|
+
}, {
|
|
11
|
+
t: (this: any, path: any, options?: any) => any;
|
|
12
|
+
vm: any;
|
|
13
|
+
f: (props: any, attrs?: {}) => {};
|
|
14
|
+
a: (attrs: any, filters: any, include: any) => {};
|
|
15
|
+
d: (props: any) => void;
|
|
16
|
+
dp: (props: any) => void;
|
|
17
|
+
gcls: (key: any) => any;
|
|
18
|
+
m: (...cssClasses: any[]) => string;
|
|
19
|
+
}, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("click" | "update:modelValue")[], "click" | "update:modelValue", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
20
|
+
modelValue: NumberConstructor;
|
|
21
|
+
data: ArrayConstructor;
|
|
22
|
+
tiny_mode: StringConstructor;
|
|
23
|
+
tiny_mode_root: BooleanConstructor;
|
|
24
|
+
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
25
|
+
tiny_renderless: FunctionConstructor;
|
|
26
|
+
tiny_theme: StringConstructor;
|
|
27
|
+
tiny_chart_theme: ObjectConstructor;
|
|
28
|
+
}>> & {
|
|
29
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
30
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
tiny_mode_root: boolean;
|
|
33
|
+
}, {}>;
|
|
2
34
|
export default _default;
|