@opentinyvue/vue-filter-bar 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 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
@@ -0,0 +1,2 @@
1
+ import FilterBar from './src/index';
2
+ export default FilterBar;
package/lib/index.js ADDED
@@ -0,0 +1,42 @@
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 { defineComponent, $prefix, $props, $setup } from "@opentinyvue/vue-common";
11
+ import MobileFirstTemplate from "./mobile-first.js";
12
+ var template = function template2(mode) {
13
+ var _process$env;
14
+ typeof process === "object" ? (_process$env = process.env) == null ? void 0 : _process$env.TINY_MODE : null;
15
+ return MobileFirstTemplate;
16
+ };
17
+ var FilterBar = defineComponent({
18
+ name: $prefix + "FilterBar",
19
+ props: _extends({}, $props, {
20
+ modelValue: Number,
21
+ data: Array
22
+ }),
23
+ setup: function setup(props, context) {
24
+ return $setup({
25
+ props,
26
+ context,
27
+ template
28
+ });
29
+ }
30
+ });
31
+ var version = "2.21.0";
32
+ FilterBar.model = {
33
+ prop: "modelValue",
34
+ event: "update:modelValue"
35
+ };
36
+ FilterBar.install = function(Vue) {
37
+ Vue.component(FilterBar.name, FilterBar);
38
+ };
39
+ FilterBar.version = version;
40
+ export {
41
+ FilterBar as default
42
+ };
@@ -0,0 +1,125 @@
1
+ import { renderless, api } from '@opentinyvue/vue-renderless/filter-bar/vue';
2
+ import { defineComponent, setup, $props } from '@opentinyvue/vue-common';
3
+ import { IconUnfilter, IconChevronDown, IconArrowBottom } from '@opentinyvue/vue-icon';
4
+
5
+ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
6
+ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
7
+ if (render) {
8
+ options.render = render;
9
+ options.staticRenderFns = staticRenderFns;
10
+ options._compiled = true;
11
+ }
12
+ var hook;
13
+ if (injectStyles) {
14
+ hook = injectStyles;
15
+ }
16
+ if (hook) {
17
+ if (options.functional) {
18
+ options._injectStyles = hook;
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
+ }
28
+ }
29
+ return {
30
+ exports: scriptExports,
31
+ options
32
+ };
33
+ }
34
+
35
+ function _extends() {
36
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
37
+ for (var e = 1; e < arguments.length; e++) {
38
+ var t = arguments[e];
39
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
40
+ }
41
+ return n;
42
+ }, _extends.apply(null, arguments);
43
+ }
44
+ var __vue2_script = defineComponent({
45
+ components: {
46
+ IconUnfilter: IconUnfilter(),
47
+ IconChevronDown: IconChevronDown(),
48
+ IconArrowBottom: IconArrowBottom()
49
+ },
50
+ emits: ["click", "update:modelValue"],
51
+ props: _extends({}, $props, {
52
+ modelValue: Number,
53
+ data: Array
54
+ }),
55
+ setup: function setup$1(props, context) {
56
+ return setup({
57
+ props,
58
+ context,
59
+ renderless,
60
+ api
61
+ });
62
+ }
63
+ });
64
+ var render = function render2() {
65
+ var _vm = this;
66
+ var _h = _vm.$createElement;
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);
112
+ };
113
+ var staticRenderFns = [];
114
+ var __cssModules = {};
115
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
116
+ function __vue2_injectStyles(context) {
117
+ for (var o in __cssModules) {
118
+ this[o] = __cssModules[o];
119
+ }
120
+ }
121
+ var mobileFirst = /* @__PURE__ */ function() {
122
+ return __component__.exports;
123
+ }();
124
+
125
+ export { mobileFirst as default };
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@opentinyvue/vue-filter-bar",
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-common": "~2.21.0",
11
+ "@opentinyvue/vue-renderless": "~3.21.0",
12
+ "@opentinyvue/vue-icon": "~2.21.0"
13
+ },
14
+ "license": "MIT",
15
+ "types": "index.d.ts",
16
+ "scripts": {
17
+ "build": "pnpm -w build:ui $npm_package_name",
18
+ "//postversion": "pnpm build"
19
+ }
20
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;