@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
@@ -0,0 +1,15 @@
1
+ export const tvpSearchBoxSmbTheme = {
2
+ 'tvp-search-box-right-search-icon-display': 'none',
3
+ 'tvp-search-box-left-icon-display': 'inline',
4
+ 'tvp-search-box-help-icon-margin-right': 'var(--ti-common-space-0)',
5
+ 'tvp-search-box-padding-left': 'var(--ti-common-space-8x)',
6
+ 'tvp-search-box-close-icon-margin-right': 'var(--ti-common-space-base)',
7
+ 'tvp-search-box-separator-icon-margin-right': 'var(--ti-common-space-base)',
8
+ 'tvp-search-box-dropdown-btn-group-margin-top': 'var(--ti-common-space-2x)',
9
+ 'tvp-search-box-dropdown-btn-group-padding-top': 'var(--ti-common-space-4x)',
10
+ 'tvp-search-box-dropdown-btn-group-padding-bottom': 'var(--ti-common-space-2x)',
11
+ 'tvp-search-box-dropdown-btn-min-width': 'var(--ti-common-size-18x)',
12
+ 'tvp-search-box-dropdown-padding-vertical': 'var(--ti-common-space-4x)',
13
+ 'tvp-search-box-input-padding-left': 'var(--ti-common-space-0)',
14
+ 'tvp-search-box-dropdown-header-text-color': 'var(--ti-common-color-border)'
15
+ }
package/src/theme.json ADDED
@@ -0,0 +1,135 @@
1
+ {
2
+ "--tvp-search-box-border-color": {
3
+ "id": "--tvp-search-box-border-color",
4
+ "key": "--tvp-search-box-border-color",
5
+ "variable": "var(--ti-common-color-line-normal)",
6
+ "value": "var(--ti-common-color-line-normal)",
7
+ "desc": "输入框边框色",
8
+ "descEn": "Text box border color",
9
+ "component": "search-box",
10
+ "componentDesc": "",
11
+ "componentDescEn": "",
12
+ "selector": ".tvp-search-box",
13
+ "type": "",
14
+ "group": "",
15
+ "isImportant": "false",
16
+ "ui": "",
17
+ "show": 1,
18
+ "configurable": 1,
19
+ "isOpen": true
20
+ },
21
+ "--tvp-search-box-border-radius": {
22
+ "id": "--tvp-search-box-border-radius",
23
+ "key": "--tvp-search-box-border-radius",
24
+ "variable": "var(--ti-common-border-radius-normal)",
25
+ "value": "var(--ti-common-border-radius-normal)",
26
+ "desc": "输入框圆角",
27
+ "descEn": "Filler corner of the input box",
28
+ "component": "search-box",
29
+ "componentDesc": "",
30
+ "componentDescEn": "",
31
+ "selector": ".tvp-search-box",
32
+ "type": "",
33
+ "group": "",
34
+ "isImportant": "false",
35
+ "ui": "",
36
+ "show": 1,
37
+ "configurable": 1,
38
+ "isOpen": true
39
+ },
40
+ "--tvp-search-box-tag-hover-text-color": {
41
+ "id": "--tvp-search-box-tag-hover-text-color",
42
+ "key": "--tvp-search-box-tag-hover-text-color",
43
+ "variable": "var(--ti-common-color-icon-hover)",
44
+ "value": "var(--ti-common-color-icon-hover)",
45
+ "desc": "标签悬浮文本色",
46
+ "descEn": "Label floating text natural color",
47
+ "component": "search-box",
48
+ "componentDesc": "",
49
+ "componentDescEn": "",
50
+ "selector": ".tvp-search-box",
51
+ "type": "",
52
+ "group": "",
53
+ "isImportant": "false",
54
+ "ui": "",
55
+ "show": 1,
56
+ "configurable": 1,
57
+ "isOpen": true
58
+ },
59
+ "--tvp-search-box-tag-hover-fill-color": {
60
+ "id": "--tvp-search-box-tag-hover-fill-color",
61
+ "key": "--tvp-search-box-tag-hover-fill-color",
62
+ "variable": "var(--tvp-search-box-tag-hover-text-color)",
63
+ "value": "var(--tvp-search-box-tag-hover-text-color)",
64
+ "desc": "标签悬浮关闭图标填充色",
65
+ "descEn": "Label Hover Close Icon Fill Color",
66
+ "component": "search-box",
67
+ "componentDesc": "",
68
+ "componentDescEn": "",
69
+ "selector": ".tvp-search-box",
70
+ "type": "",
71
+ "group": "",
72
+ "isImportant": "false",
73
+ "ui": "",
74
+ "show": 1,
75
+ "configurable": 1,
76
+ "isOpen": true
77
+ },
78
+ "--tvp-search-box-dropdown-header-text-color": {
79
+ "id": "--tvp-search-box-dropdown-header-text-color",
80
+ "key": "--tvp-search-box-dropdown-header-text-color",
81
+ "variable": "var(--ti-common-color-text-weaken)",
82
+ "value": "var(--ti-common-color-text-weaken)",
83
+ "desc": "下拉框头部文本色",
84
+ "descEn": "Text color of the drop-down list box header",
85
+ "component": "search-box",
86
+ "componentDesc": "",
87
+ "componentDescEn": "",
88
+ "selector": ".tvp-search-box",
89
+ "type": "",
90
+ "group": "",
91
+ "isImportant": "false",
92
+ "ui": "",
93
+ "show": 1,
94
+ "configurable": 1,
95
+ "isOpen": true
96
+ },
97
+ "--tvp-search-box-search-filter-bg-color": {
98
+ "id": "--tvp-search-box-search-filter-bg-color",
99
+ "key": "--tvp-search-box-search-filter-bg-color",
100
+ "variable": "var(--ti-common-color-bg-white-emphasize)",
101
+ "value": "var(--ti-common-color-bg-white-emphasize)",
102
+ "desc": "搜索过滤下拉框列表项背景色",
103
+ "descEn": "Background color of the search drop-down list box",
104
+ "component": "search-box",
105
+ "componentDesc": "",
106
+ "componentDescEn": "",
107
+ "selector": ".tvp-search-box",
108
+ "type": "",
109
+ "group": "",
110
+ "isImportant": "false",
111
+ "ui": "",
112
+ "show": 1,
113
+ "configurable": 1,
114
+ "isOpen": true
115
+ },
116
+ "--tvp-search-box-search-filter-text-color": {
117
+ "id": "--tvp-search-box-search-filter-text-color",
118
+ "key": "--tvp-search-box-search-filter-text-color",
119
+ "variable": "var(--ti-common-color-icon-active)",
120
+ "value": "var(--ti-common-color-icon-active)",
121
+ "desc": "搜索过滤下拉框列表项文本色",
122
+ "descEn": "Text color of the search drop-down list box",
123
+ "component": "search-box",
124
+ "componentDesc": "",
125
+ "componentDescEn": "",
126
+ "selector": ".tvp-search-box",
127
+ "type": "",
128
+ "group": "",
129
+ "isImportant": "false",
130
+ "ui": "",
131
+ "show": 1,
132
+ "configurable": 1,
133
+ "isOpen": true
134
+ }
135
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * 深拷贝方法
3
+ * @param obj 元数据
4
+ * @returns
5
+ */
6
+ export const deepClone = (obj) => {
7
+ const objClone = Array.isArray(obj) ? [] : {}
8
+ if (obj && typeof obj === 'object') {
9
+ const keys = Object.keys(obj)
10
+ if (keys.length) {
11
+ keys.forEach((key) => {
12
+ if (obj[key] && typeof obj[key] === 'object') {
13
+ objClone[key] = deepClone(obj[key])
14
+ } else {
15
+ objClone[key] = obj[key]
16
+ }
17
+ })
18
+ } else {
19
+ return obj
20
+ }
21
+ }
22
+
23
+ return objClone
24
+ }
25
+
26
+ /**
27
+ * 过滤复制对象的key值
28
+ * @param obj 复制对象
29
+ * @param keysToOmit key值
30
+ */
31
+ export const omitObj = (obj, keysToOmit = ['mergeTag', 'options', 'idMapKey']) => {
32
+ const result = { ...obj }
33
+ keysToOmit.forEach((key) => {
34
+ delete result[key]
35
+ })
36
+ return result
37
+ }