@opentiny/vue-search-box 0.0.2 → 0.1.1-alpha.1
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/README.md +25 -28
- package/README.zh-CN.md +107 -0
- package/__tests__/search-box.spec.ts +0 -0
- package/{es → dist/es}/index.es.js +5 -1
- package/{es → dist/es}/index.vue.es2.js +1 -12
- package/{lib → dist/lib}/index.cjs.js +4 -0
- package/{lib → dist/lib}/index.vue.cjs2.js +53 -64
- package/package.json +66 -64
- package/scripts/pre-release.cjs +8 -0
- package/src/composables/use-checkbox.ts +90 -0
- package/src/composables/use-custom.ts +53 -0
- package/src/composables/use-datepicker.ts +90 -0
- package/src/composables/use-dropdown.ts +251 -0
- package/src/composables/use-edit.ts +119 -0
- package/src/composables/use-init.ts +69 -0
- package/src/composables/use-match.ts +193 -0
- package/src/composables/use-num-range.ts +86 -0
- package/src/composables/use-placeholder.ts +43 -0
- package/src/composables/use-tag.ts +54 -0
- package/src/index.less +376 -0
- package/src/index.ts +13 -0
- package/src/index.type.ts +192 -0
- package/src/index.vue +1138 -0
- package/src/smb-theme.ts +15 -0
- package/src/theme.json +135 -0
- package/src/utils/clone.ts +37 -0
- package/src/utils/date.ts +724 -0
- package/src/utils/dropdown.ts +27 -0
- package/src/utils/en_US.ts +41 -0
- package/src/utils/index.ts +11 -0
- package/src/utils/tag.ts +80 -0
- package/src/utils/type.ts +6 -0
- package/src/utils/validate.ts +234 -0
- package/src/utils/zh_CN.ts +41 -0
- package/src/vars.less +56 -0
- package/vite.config.theme.ts +20 -0
- package/vite.config.ts +60 -0
- /package/{es → dist/es}/composables/use-checkbox.es.js +0 -0
- /package/{es → dist/es}/composables/use-custom.es.js +0 -0
- /package/{es → dist/es}/composables/use-datepicker.es.js +0 -0
- /package/{es → dist/es}/composables/use-dropdown.es.js +0 -0
- /package/{es → dist/es}/composables/use-edit.es.js +0 -0
- /package/{es → dist/es}/composables/use-init.es.js +0 -0
- /package/{es → dist/es}/composables/use-match.es.js +0 -0
- /package/{es → dist/es}/composables/use-num-range.es.js +0 -0
- /package/{es → dist/es}/composables/use-placeholder.es.js +0 -0
- /package/{es → dist/es}/composables/use-tag.es.js +0 -0
- /package/{es → dist/es}/index-VrLZbD8H.css +0 -0
- /package/{es → dist/es}/index.type.es.js +0 -0
- /package/{es → dist/es}/index.vue.es.js +0 -0
- /package/{es → dist/es}/smb-theme.es.js +0 -0
- /package/{es → dist/es}/utils/clone.es.js +0 -0
- /package/{es → dist/es}/utils/date.es.js +0 -0
- /package/{es → dist/es}/utils/dropdown.es.js +0 -0
- /package/{es → dist/es}/utils/en_US.es.js +0 -0
- /package/{es → dist/es}/utils/index.es.js +0 -0
- /package/{es → dist/es}/utils/tag.es.js +0 -0
- /package/{es → dist/es}/utils/type.es.js +0 -0
- /package/{es → dist/es}/utils/validate.es.js +0 -0
- /package/{es → dist/es}/utils/zh_CN.es.js +0 -0
- /package/{index.css → dist/index.css} +0 -0
- /package/{lib → dist/lib}/composables/use-checkbox.cjs.js +0 -0
- /package/{lib → dist/lib}/composables/use-custom.cjs.js +0 -0
- /package/{lib → dist/lib}/composables/use-datepicker.cjs.js +0 -0
- /package/{lib → dist/lib}/composables/use-dropdown.cjs.js +0 -0
- /package/{lib → dist/lib}/composables/use-edit.cjs.js +0 -0
- /package/{lib → dist/lib}/composables/use-init.cjs.js +0 -0
- /package/{lib → dist/lib}/composables/use-match.cjs.js +0 -0
- /package/{lib → dist/lib}/composables/use-num-range.cjs.js +0 -0
- /package/{lib → dist/lib}/composables/use-placeholder.cjs.js +0 -0
- /package/{lib → dist/lib}/composables/use-tag.cjs.js +0 -0
- /package/{lib → dist/lib}/index-VrLZbD8H.css +0 -0
- /package/{lib → dist/lib}/index.type.cjs.js +0 -0
- /package/{lib → dist/lib}/index.vue.cjs.js +0 -0
- /package/{lib → dist/lib}/smb-theme.cjs.js +0 -0
- /package/{lib → dist/lib}/utils/clone.cjs.js +0 -0
- /package/{lib → dist/lib}/utils/date.cjs.js +0 -0
- /package/{lib → dist/lib}/utils/dropdown.cjs.js +0 -0
- /package/{lib → dist/lib}/utils/en_US.cjs.js +0 -0
- /package/{lib → dist/lib}/utils/index.cjs.js +0 -0
- /package/{lib → dist/lib}/utils/tag.cjs.js +0 -0
- /package/{lib → dist/lib}/utils/type.cjs.js +0 -0
- /package/{lib → dist/lib}/utils/validate.cjs.js +0 -0
- /package/{lib → dist/lib}/utils/zh_CN.cjs.js +0 -0
- /package/{types → dist/types}/composables/use-checkbox.d.ts +0 -0
- /package/{types → dist/types}/composables/use-custom.d.ts +0 -0
- /package/{types → dist/types}/composables/use-datepicker.d.ts +0 -0
- /package/{types → dist/types}/composables/use-dropdown.d.ts +0 -0
- /package/{types → dist/types}/composables/use-edit.d.ts +0 -0
- /package/{types → dist/types}/composables/use-init.d.ts +0 -0
- /package/{types → dist/types}/composables/use-match.d.ts +0 -0
- /package/{types → dist/types}/composables/use-num-range.d.ts +0 -0
- /package/{types → dist/types}/composables/use-placeholder.d.ts +0 -0
- /package/{types → dist/types}/composables/use-tag.d.ts +0 -0
- /package/{types → dist/types}/index.type.d.ts +0 -0
- /package/{types → dist/types}/smb-theme.d.ts +0 -0
- /package/{types → dist/types}/utils/clone.d.ts +0 -0
- /package/{types → dist/types}/utils/date.d.ts +0 -0
- /package/{types → dist/types}/utils/dropdown.d.ts +0 -0
- /package/{types → dist/types}/utils/en_US.d.ts +0 -0
- /package/{types → dist/types}/utils/index.d.ts +0 -0
- /package/{types → dist/types}/utils/tag.d.ts +0 -0
- /package/{types → dist/types}/utils/type.d.ts +0 -0
- /package/{types → dist/types}/utils/validate.d.ts +0 -0
- /package/{types → dist/types}/utils/zh_CN.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,30 +1,39 @@
|
|
|
1
|
-
# TinySearchBox
|
|
1
|
+
# TinySearchBox
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TinySearchBox is a comprehensive search component based on Vue3. It uses the TinyVue component library and follows the OpenTiny design specifications. It is easy to use and powerful. It supports single selection, multiple selection, time, time range and so on.
|
|
4
4
|
|
|
5
|
-
[
|
|
5
|
+
English | [简体中文](README.zh-CN.md)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Advantages
|
|
8
8
|
|
|
9
|
-
TinySearchBox
|
|
9
|
+
TinySearchBox has the following advantages:
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
- Gather the filtering criteria into one input box for higher filtering efficiency and a better user experience
|
|
12
|
+
- Supports multiple types of conditional filtering such as single selection, multiple selection, time, time interval, number size, and number interval
|
|
13
|
+
- Powerful search functions, supporting fuzzy search, custom search, etc.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+

|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
## Quick Start
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
-Powerful search function, supporting fuzzy search, single choice, multiple choice, time, time interval, number size, number interval, as well as custom search, etc.
|
|
19
|
-
|
|
20
|
-
## quick start
|
|
21
|
-
|
|
22
|
-
install TinySearchBox
|
|
19
|
+
Install TinySearchBox:
|
|
23
20
|
|
|
24
21
|
```shell
|
|
25
22
|
npm i @opentiny/vue-search-box
|
|
26
23
|
```
|
|
27
24
|
|
|
25
|
+
Import TinySearchBox:
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
import TinySearchBox from '@opentiny/vue-search-box';
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Import styles:
|
|
32
|
+
|
|
33
|
+
```css
|
|
34
|
+
@import '@opentiny/vue-search-box/index.css';
|
|
35
|
+
```
|
|
36
|
+
|
|
28
37
|
html:
|
|
29
38
|
|
|
30
39
|
```html
|
|
@@ -81,19 +90,7 @@ html:
|
|
|
81
90
|
</template>
|
|
82
91
|
```
|
|
83
92
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
```css
|
|
87
|
-
@import '@opentiny/vue-search-box/index.css';
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Initialize TinySearchBox:
|
|
91
|
-
|
|
92
|
-
```javascript
|
|
93
|
-
import TinySearchBox from '@opentiny/vue-search-box';
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Local development
|
|
93
|
+
## Development
|
|
97
94
|
|
|
98
95
|
```shell
|
|
99
96
|
git clone git@github.com:opentiny/tiny-search-box.git
|
|
@@ -102,7 +99,7 @@ pnpm i
|
|
|
102
99
|
pnpm dev
|
|
103
100
|
```
|
|
104
101
|
|
|
105
|
-
Open a browser to access:[http://localhost:5173/](http://localhost:5173/)
|
|
102
|
+
Open a browser to access:[http://localhost:5173/tiny-search-box/](http://localhost:5173/tiny-search-box/)
|
|
106
103
|
|
|
107
104
|
## License
|
|
108
105
|
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# TinySearchBox 综合搜索组件
|
|
2
|
+
|
|
3
|
+
TinySearchBox 是一个基于 Vue3 的综合搜索组件,使用 TinyVue 组件库,遵循 OpenTiny 设计规范,简单易用、功能强大,支持单选、多选、时间、时间区间等多条件筛选。
|
|
4
|
+
|
|
5
|
+
[English](README.md) | 简体中文
|
|
6
|
+
|
|
7
|
+
## 项目优势
|
|
8
|
+
|
|
9
|
+
TinySearchBox 主要有以下特点和优势:
|
|
10
|
+
|
|
11
|
+
- 将筛选条件聚拢在一个输入框中,筛选效率更高、用户体验更好
|
|
12
|
+
- 支持单选、多选、时间、时间区间、数字大小、数字区间等多种类型条件筛选
|
|
13
|
+
- 强大的搜索功能,支持模糊搜索、自定义搜索等
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
## 快速上手
|
|
18
|
+
|
|
19
|
+
安装 TinySearchBox
|
|
20
|
+
|
|
21
|
+
```shell
|
|
22
|
+
npm i @opentiny/vue-search-box
|
|
23
|
+
```
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
导入 TinySearchBox 综合搜索:
|
|
27
|
+
|
|
28
|
+
```javascript
|
|
29
|
+
import TinySearchBox from '@opentiny/vue-search-box';
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
引入样式:
|
|
33
|
+
|
|
34
|
+
```css
|
|
35
|
+
@import '@opentiny/vue-search-box/index.css';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
在模板中使用:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<script setup>
|
|
42
|
+
const tags = ref([]);
|
|
43
|
+
const items = ref([
|
|
44
|
+
{
|
|
45
|
+
label: '名称',
|
|
46
|
+
field: 'testName',
|
|
47
|
+
replace: true,
|
|
48
|
+
placeholder: '我是自定义名称的占位符',
|
|
49
|
+
options: [
|
|
50
|
+
{
|
|
51
|
+
label: 'test-1'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: 'test-2'
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: '可用地区',
|
|
60
|
+
field: 'testRegion',
|
|
61
|
+
type: 'checkbox',
|
|
62
|
+
mergeTag: true,
|
|
63
|
+
placeholder: '我是自定义可选地区的占位符',
|
|
64
|
+
editAttrDisabled: true, // 编辑状态此属性禁用,不可变更
|
|
65
|
+
options: [
|
|
66
|
+
{
|
|
67
|
+
label: '华南区',
|
|
68
|
+
id: '2-1'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: '华北区',
|
|
72
|
+
id: '2-2'
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: '大小',
|
|
78
|
+
field: 'size',
|
|
79
|
+
type: 'numRange',
|
|
80
|
+
placeholder: '我是自定义大小的占位符',
|
|
81
|
+
unit: 'GB',
|
|
82
|
+
start: -1,
|
|
83
|
+
min: -1,
|
|
84
|
+
max: 20
|
|
85
|
+
}
|
|
86
|
+
]);
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<template>
|
|
90
|
+
<tiny-search-box v-model="tags" :items="items"></tiny-search-box>
|
|
91
|
+
</template>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 本地开发
|
|
95
|
+
|
|
96
|
+
```shell
|
|
97
|
+
git clone git@github.com:opentiny/tiny-search-box.git
|
|
98
|
+
cd tiny-search-box
|
|
99
|
+
pnpm i
|
|
100
|
+
pnpm dev
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
打开浏览器访问:[http://localhost:5173/tiny-search-box/](http://localhost:5173/tiny-search-box/)
|
|
104
|
+
|
|
105
|
+
## License
|
|
106
|
+
|
|
107
|
+
[MIT](LICENSE)
|
|
File without changes
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import "./index.vue.es.js";
|
|
2
|
+
import { zhCN } from "./utils/zh_CN.es.js";
|
|
3
|
+
import { enUS } from "./utils/en_US.es.js";
|
|
2
4
|
/* empty css */
|
|
3
5
|
import "./index.type.es.js";
|
|
4
6
|
import _sfc_main from "./index.vue.es2.js";
|
|
@@ -6,5 +8,7 @@ _sfc_main.install = function(app) {
|
|
|
6
8
|
app.component(_sfc_main.name, _sfc_main);
|
|
7
9
|
};
|
|
8
10
|
export {
|
|
9
|
-
_sfc_main as default
|
|
11
|
+
_sfc_main as default,
|
|
12
|
+
enUS,
|
|
13
|
+
zhCN
|
|
10
14
|
};
|
|
@@ -15,7 +15,7 @@ import TinyPopover from "@opentiny/vue-popover";
|
|
|
15
15
|
import TinySelect from "@opentiny/vue-select";
|
|
16
16
|
import TinyOption from "@opentiny/vue-option";
|
|
17
17
|
import { iconSearch, iconClose, iconHelpQuery } from "@opentiny/vue-icon";
|
|
18
|
-
import
|
|
18
|
+
import { t } from "@opentiny/vue-locale";
|
|
19
19
|
import { useTag } from "./composables/use-tag.es.js";
|
|
20
20
|
import { useDropdown } from "./composables/use-dropdown.es.js";
|
|
21
21
|
import { useMatch } from "./composables/use-match.es.js";
|
|
@@ -30,9 +30,6 @@ import { showPopover, showDropdown } from "./utils/dropdown.es.js";
|
|
|
30
30
|
/* empty css */
|
|
31
31
|
import { deepClone } from "./utils/clone.es.js";
|
|
32
32
|
import { format } from "./utils/date.es.js";
|
|
33
|
-
import { zhCN } from "./utils/zh_CN.es.js";
|
|
34
|
-
import { enUS } from "./utils/en_US.es.js";
|
|
35
|
-
import { createI18n } from "vue-i18n";
|
|
36
33
|
const _hoisted_1 = { class: "tvp-search-box__tag-value" };
|
|
37
34
|
const _hoisted_2 = {
|
|
38
35
|
key: 0,
|
|
@@ -223,14 +220,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
223
220
|
"first-level-select"
|
|
224
221
|
],
|
|
225
222
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
226
|
-
locale.initI18n({
|
|
227
|
-
i18n: "zhCN",
|
|
228
|
-
createI18n,
|
|
229
|
-
messages: {
|
|
230
|
-
zhCN: { ...zhCN },
|
|
231
|
-
enUS: { ...enUS }
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
223
|
const props = __props;
|
|
235
224
|
const emits = __emit;
|
|
236
225
|
const state = reactive({
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
require("./index.vue.cjs.js");
|
|
4
|
+
const zh_CN = require("./utils/zh_CN.cjs.js");
|
|
5
|
+
const en_US = require("./utils/en_US.cjs.js");
|
|
4
6
|
;/* empty css */
|
|
5
7
|
require("./index.type.cjs.js");
|
|
6
8
|
const index_vue_vue_type_script_setup_true_lang = require("./index.vue.cjs2.js");
|
|
7
9
|
index_vue_vue_type_script_setup_true_lang.default.install = function(app) {
|
|
8
10
|
app.component(index_vue_vue_type_script_setup_true_lang.default.name, index_vue_vue_type_script_setup_true_lang.default);
|
|
9
11
|
};
|
|
12
|
+
exports.zhCN = zh_CN.zhCN;
|
|
13
|
+
exports.enUS = en_US.enUS;
|
|
10
14
|
exports.default = index_vue_vue_type_script_setup_true_lang.default;
|