@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.
Files changed (105) hide show
  1. package/README.md +25 -28
  2. package/README.zh-CN.md +107 -0
  3. package/__tests__/search-box.spec.ts +0 -0
  4. package/{es → dist/es}/index.es.js +5 -1
  5. package/{es → dist/es}/index.vue.es2.js +1 -12
  6. package/{lib → dist/lib}/index.cjs.js +4 -0
  7. package/{lib → dist/lib}/index.vue.cjs2.js +53 -64
  8. package/package.json +66 -64
  9. package/scripts/pre-release.cjs +8 -0
  10. package/src/composables/use-checkbox.ts +90 -0
  11. package/src/composables/use-custom.ts +53 -0
  12. package/src/composables/use-datepicker.ts +90 -0
  13. package/src/composables/use-dropdown.ts +251 -0
  14. package/src/composables/use-edit.ts +119 -0
  15. package/src/composables/use-init.ts +69 -0
  16. package/src/composables/use-match.ts +193 -0
  17. package/src/composables/use-num-range.ts +86 -0
  18. package/src/composables/use-placeholder.ts +43 -0
  19. package/src/composables/use-tag.ts +54 -0
  20. package/src/index.less +376 -0
  21. package/src/index.ts +13 -0
  22. package/src/index.type.ts +192 -0
  23. package/src/index.vue +1138 -0
  24. package/src/smb-theme.ts +15 -0
  25. package/src/theme.json +135 -0
  26. package/src/utils/clone.ts +37 -0
  27. package/src/utils/date.ts +724 -0
  28. package/src/utils/dropdown.ts +27 -0
  29. package/src/utils/en_US.ts +41 -0
  30. package/src/utils/index.ts +11 -0
  31. package/src/utils/tag.ts +80 -0
  32. package/src/utils/type.ts +6 -0
  33. package/src/utils/validate.ts +234 -0
  34. package/src/utils/zh_CN.ts +41 -0
  35. package/src/vars.less +56 -0
  36. package/vite.config.theme.ts +20 -0
  37. package/vite.config.ts +60 -0
  38. /package/{es → dist/es}/composables/use-checkbox.es.js +0 -0
  39. /package/{es → dist/es}/composables/use-custom.es.js +0 -0
  40. /package/{es → dist/es}/composables/use-datepicker.es.js +0 -0
  41. /package/{es → dist/es}/composables/use-dropdown.es.js +0 -0
  42. /package/{es → dist/es}/composables/use-edit.es.js +0 -0
  43. /package/{es → dist/es}/composables/use-init.es.js +0 -0
  44. /package/{es → dist/es}/composables/use-match.es.js +0 -0
  45. /package/{es → dist/es}/composables/use-num-range.es.js +0 -0
  46. /package/{es → dist/es}/composables/use-placeholder.es.js +0 -0
  47. /package/{es → dist/es}/composables/use-tag.es.js +0 -0
  48. /package/{es → dist/es}/index-VrLZbD8H.css +0 -0
  49. /package/{es → dist/es}/index.type.es.js +0 -0
  50. /package/{es → dist/es}/index.vue.es.js +0 -0
  51. /package/{es → dist/es}/smb-theme.es.js +0 -0
  52. /package/{es → dist/es}/utils/clone.es.js +0 -0
  53. /package/{es → dist/es}/utils/date.es.js +0 -0
  54. /package/{es → dist/es}/utils/dropdown.es.js +0 -0
  55. /package/{es → dist/es}/utils/en_US.es.js +0 -0
  56. /package/{es → dist/es}/utils/index.es.js +0 -0
  57. /package/{es → dist/es}/utils/tag.es.js +0 -0
  58. /package/{es → dist/es}/utils/type.es.js +0 -0
  59. /package/{es → dist/es}/utils/validate.es.js +0 -0
  60. /package/{es → dist/es}/utils/zh_CN.es.js +0 -0
  61. /package/{index.css → dist/index.css} +0 -0
  62. /package/{lib → dist/lib}/composables/use-checkbox.cjs.js +0 -0
  63. /package/{lib → dist/lib}/composables/use-custom.cjs.js +0 -0
  64. /package/{lib → dist/lib}/composables/use-datepicker.cjs.js +0 -0
  65. /package/{lib → dist/lib}/composables/use-dropdown.cjs.js +0 -0
  66. /package/{lib → dist/lib}/composables/use-edit.cjs.js +0 -0
  67. /package/{lib → dist/lib}/composables/use-init.cjs.js +0 -0
  68. /package/{lib → dist/lib}/composables/use-match.cjs.js +0 -0
  69. /package/{lib → dist/lib}/composables/use-num-range.cjs.js +0 -0
  70. /package/{lib → dist/lib}/composables/use-placeholder.cjs.js +0 -0
  71. /package/{lib → dist/lib}/composables/use-tag.cjs.js +0 -0
  72. /package/{lib → dist/lib}/index-VrLZbD8H.css +0 -0
  73. /package/{lib → dist/lib}/index.type.cjs.js +0 -0
  74. /package/{lib → dist/lib}/index.vue.cjs.js +0 -0
  75. /package/{lib → dist/lib}/smb-theme.cjs.js +0 -0
  76. /package/{lib → dist/lib}/utils/clone.cjs.js +0 -0
  77. /package/{lib → dist/lib}/utils/date.cjs.js +0 -0
  78. /package/{lib → dist/lib}/utils/dropdown.cjs.js +0 -0
  79. /package/{lib → dist/lib}/utils/en_US.cjs.js +0 -0
  80. /package/{lib → dist/lib}/utils/index.cjs.js +0 -0
  81. /package/{lib → dist/lib}/utils/tag.cjs.js +0 -0
  82. /package/{lib → dist/lib}/utils/type.cjs.js +0 -0
  83. /package/{lib → dist/lib}/utils/validate.cjs.js +0 -0
  84. /package/{lib → dist/lib}/utils/zh_CN.cjs.js +0 -0
  85. /package/{types → dist/types}/composables/use-checkbox.d.ts +0 -0
  86. /package/{types → dist/types}/composables/use-custom.d.ts +0 -0
  87. /package/{types → dist/types}/composables/use-datepicker.d.ts +0 -0
  88. /package/{types → dist/types}/composables/use-dropdown.d.ts +0 -0
  89. /package/{types → dist/types}/composables/use-edit.d.ts +0 -0
  90. /package/{types → dist/types}/composables/use-init.d.ts +0 -0
  91. /package/{types → dist/types}/composables/use-match.d.ts +0 -0
  92. /package/{types → dist/types}/composables/use-num-range.d.ts +0 -0
  93. /package/{types → dist/types}/composables/use-placeholder.d.ts +0 -0
  94. /package/{types → dist/types}/composables/use-tag.d.ts +0 -0
  95. /package/{types → dist/types}/index.type.d.ts +0 -0
  96. /package/{types → dist/types}/smb-theme.d.ts +0 -0
  97. /package/{types → dist/types}/utils/clone.d.ts +0 -0
  98. /package/{types → dist/types}/utils/date.d.ts +0 -0
  99. /package/{types → dist/types}/utils/dropdown.d.ts +0 -0
  100. /package/{types → dist/types}/utils/en_US.d.ts +0 -0
  101. /package/{types → dist/types}/utils/index.d.ts +0 -0
  102. /package/{types → dist/types}/utils/tag.d.ts +0 -0
  103. /package/{types → dist/types}/utils/type.d.ts +0 -0
  104. /package/{types → dist/types}/utils/validate.d.ts +0 -0
  105. /package/{types → dist/types}/utils/zh_CN.d.ts +0 -0
package/README.md CHANGED
@@ -1,30 +1,39 @@
1
- # TinySearchBox comprehensive search
1
+ # TinySearchBox
2
2
 
3
- <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
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
- [![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors-)
5
+ English | [简体中文](README.zh-CN.md)
6
6
 
7
- <!-- ALL-CONTRIBUTORS-BADGE:END -->
7
+ ## Advantages
8
8
 
9
- TinySearchBox is a powerful and easy-to-use comprehensive search component developed based on tiny Vue. Support multiple criteria filtering such as single choice, multiple choice, time, and time interval.
9
+ TinySearchBox has the following advantages:
10
10
 
11
- [English](README.md) | 简体中文
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
- ## Project advantages
15
+ ![TinySearchBox](TinySearchBox.png)
14
16
 
15
- TinySearchBox has the following characteristics and advantages:
17
+ ## Quick Start
16
18
 
17
- -Contains multiple types of conditional filtering, ready to use out of the box.
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
- import styles:
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
 
@@ -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
+ ![TinySearchBox](TinySearchBox.png)
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 locale, { t } from "@opentiny/vue-locale";
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;