@jetlinks-web/components 2.0.2 → 2.0.3

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 (237) hide show
  1. package/es/AMap/Map.js +124 -0
  2. package/es/AMap/index.js +2 -0
  3. package/es/AMap/util.js +56 -0
  4. package/es/BadgeStatus/Badge.js +54 -0
  5. package/es/BadgeStatus/color.js +21 -0
  6. package/es/BadgeStatus/index.js +3 -0
  7. package/es/CardSelect/CardSelect.js +123 -0
  8. package/es/CardSelect/index.js +2 -0
  9. package/es/CheckButton/CheckButton.js +121 -0
  10. package/es/CheckButton/index.js +2 -0
  11. package/es/ConfigProvider/context.js +12 -0
  12. package/es/ConfigProvider/index.js +31 -0
  13. package/es/Echarts/Echarts.js +47 -0
  14. package/es/Echarts/index.js +2 -0
  15. package/es/Ellipsis/Ellipsis.js +189 -0
  16. package/es/Ellipsis/index.js +2 -0
  17. package/es/Empty/Empty.js +56 -0
  18. package/es/Empty/image.js +2 -0
  19. package/es/Empty/index.js +2 -0
  20. package/es/FullPage/FullPage.js +31 -0
  21. package/es/FullPage/index.js +2 -0
  22. package/es/Icon/icon.js +42 -0
  23. package/{src/Icon/index.ts → es/Icon/index.js} +2 -3
  24. package/es/MonacoEditor/Monaco.js +238 -0
  25. package/es/MonacoEditor/index.js +2 -0
  26. package/es/PermissionButton/index.js +117 -0
  27. package/es/ProLayout/Basic/BasicLayout.js +259 -0
  28. package/es/ProLayout/Basic/Header.js +97 -0
  29. package/es/ProLayout/PageContainer/index.js +324 -0
  30. package/es/ProLayout/PageContainer/typings.js +1 -0
  31. package/es/ProLayout/RouteContext.js +22 -0
  32. package/es/ProLayout/SiderMenu/BaseMenu.js +285 -0
  33. package/es/ProLayout/SiderMenu/SiderMenu.js +278 -0
  34. package/es/ProLayout/SiderMenu/index.js +2 -0
  35. package/es/ProLayout/SiderMenu/typings.js +1 -0
  36. package/es/ProLayout/TopHeader/index.js +163 -0
  37. package/es/ProLayout/defaultSettings.js +66 -0
  38. package/{src/ProLayout/index.ts → es/ProLayout/index.js} +4 -6
  39. package/{src → es}/ProLayout/style/default.less +4 -4
  40. package/es/ProLayout/style/index.js +1 -0
  41. package/es/ProLayout/typings.js +1 -0
  42. package/es/ProLayout/util.js +61 -0
  43. package/es/ProTable/index.js +411 -0
  44. package/es/ProTable/proTableTypes.js +11 -0
  45. package/es/ProTable/style/index.css +65 -0
  46. package/es/ProTable/style/index.js +1 -0
  47. package/es/Scrollbar/Bar.js +114 -0
  48. package/es/Scrollbar/Scrollbar.js +212 -0
  49. package/es/Scrollbar/Thumb.js +189 -0
  50. package/es/Scrollbar/constants.js +1 -0
  51. package/es/Scrollbar/index.js +2 -0
  52. package/es/Scrollbar/scrollbarProps.js +100 -0
  53. package/es/Scrollbar/thumbProps.js +10 -0
  54. package/es/Scrollbar/util.js +30 -0
  55. package/es/Search/Advanced/History.js +183 -0
  56. package/es/Search/Advanced/SaveHistory.js +153 -0
  57. package/es/Search/Advanced/index.js +520 -0
  58. package/es/Search/Item.js +497 -0
  59. package/es/Search/Search.js +249 -0
  60. package/es/Search/hooks/index.js +1 -0
  61. package/es/Search/hooks/useSearchItems.js +40 -0
  62. package/es/Search/index.js +4 -0
  63. package/es/Search/setting.js +91 -0
  64. package/es/Search/style/Item.less +33 -0
  65. package/es/Search/style/Search.less +179 -0
  66. package/es/Search/style/index.js +2 -0
  67. package/es/Search/typing.js +1 -0
  68. package/es/Search/util.js +234 -0
  69. package/es/ValueItem/ValueItem.js +233 -0
  70. package/es/ValueItem/index.js +2 -0
  71. package/es/ValueItem/util.js +16 -0
  72. package/es/index.js +24 -0
  73. package/es/style/index.js +3 -0
  74. package/es/style/variable.css +0 -0
  75. package/{src → es}/style/variable.less +0 -2
  76. package/es/style.js +3 -0
  77. package/lib/AMap/Map.js +124 -0
  78. package/lib/AMap/index.js +9 -0
  79. package/lib/AMap/util.js +62 -0
  80. package/lib/BadgeStatus/Badge.js +54 -0
  81. package/lib/BadgeStatus/color.js +27 -0
  82. package/lib/BadgeStatus/index.js +22 -0
  83. package/lib/CardSelect/CardSelect.js +123 -0
  84. package/lib/CardSelect/index.js +9 -0
  85. package/lib/CheckButton/CheckButton.js +121 -0
  86. package/lib/CheckButton/index.js +9 -0
  87. package/lib/ConfigProvider/context.js +19 -0
  88. package/lib/ConfigProvider/index.js +37 -0
  89. package/lib/Echarts/Echarts.js +47 -0
  90. package/lib/Echarts/index.js +9 -0
  91. package/lib/Ellipsis/Ellipsis.js +189 -0
  92. package/lib/Ellipsis/index.js +9 -0
  93. package/lib/Empty/Empty.js +56 -0
  94. package/lib/Empty/image.js +8 -0
  95. package/lib/Empty/index.js +9 -0
  96. package/lib/FullPage/FullPage.js +31 -0
  97. package/lib/FullPage/index.js +9 -0
  98. package/lib/Icon/icon.js +52 -0
  99. package/lib/Icon/index.js +9 -0
  100. package/lib/MonacoEditor/Monaco.js +238 -0
  101. package/lib/MonacoEditor/index.js +9 -0
  102. package/lib/PermissionButton/index.js +124 -0
  103. package/lib/ProLayout/Basic/BasicLayout.js +268 -0
  104. package/lib/ProLayout/Basic/BasicLayout.less +66 -0
  105. package/lib/ProLayout/Basic/Header.js +103 -0
  106. package/lib/ProLayout/Basic/Header.less +8 -0
  107. package/lib/ProLayout/PageContainer/index.js +327 -0
  108. package/lib/ProLayout/PageContainer/index.less +103 -0
  109. package/lib/ProLayout/PageContainer/typings.js +5 -0
  110. package/lib/ProLayout/RouteContext.js +28 -0
  111. package/lib/ProLayout/SiderMenu/BaseMenu.js +290 -0
  112. package/lib/ProLayout/SiderMenu/SiderMenu.js +287 -0
  113. package/lib/ProLayout/SiderMenu/index.js +20 -0
  114. package/lib/ProLayout/SiderMenu/index.less +212 -0
  115. package/lib/ProLayout/SiderMenu/typings.js +5 -0
  116. package/lib/ProLayout/TopHeader/index.js +168 -0
  117. package/lib/ProLayout/TopHeader/index.less +174 -0
  118. package/lib/ProLayout/defaultSettings.js +72 -0
  119. package/lib/ProLayout/index.js +16 -0
  120. package/lib/ProLayout/style/default.less +4 -0
  121. package/lib/ProLayout/style/index.js +3 -0
  122. package/lib/ProLayout/style/style.less +7 -0
  123. package/lib/ProLayout/typings.js +5 -0
  124. package/lib/ProLayout/util.js +72 -0
  125. package/lib/ProTable/index.js +417 -0
  126. package/lib/ProTable/proTableTypes.js +17 -0
  127. package/lib/ProTable/style/index.css +65 -0
  128. package/lib/ProTable/style/index.js +3 -0
  129. package/lib/ProTable/style/index.less +92 -0
  130. package/lib/Scrollbar/Bar.js +114 -0
  131. package/lib/Scrollbar/Scrollbar.js +212 -0
  132. package/lib/Scrollbar/Thumb.js +189 -0
  133. package/lib/Scrollbar/constants.js +7 -0
  134. package/lib/Scrollbar/index.js +9 -0
  135. package/{src/Scrollbar/scrollbar.ts → lib/Scrollbar/scrollbarProps.js} +106 -108
  136. package/lib/Scrollbar/thumbProps.js +16 -0
  137. package/lib/Scrollbar/util.js +37 -0
  138. package/lib/Search/Advanced/History.js +183 -0
  139. package/lib/Search/Advanced/SaveHistory.js +153 -0
  140. package/lib/Search/Advanced/index.js +520 -0
  141. package/lib/Search/Item.js +497 -0
  142. package/lib/Search/Search.js +249 -0
  143. package/lib/Search/hooks/index.js +16 -0
  144. package/lib/Search/hooks/useSearchItems.js +47 -0
  145. package/lib/Search/index.js +16 -0
  146. package/lib/Search/setting.js +97 -0
  147. package/lib/Search/style/Item.less +33 -0
  148. package/lib/Search/style/Search.less +179 -0
  149. package/lib/Search/style/index.js +4 -0
  150. package/lib/Search/typing.js +5 -0
  151. package/lib/Search/util.js +241 -0
  152. package/lib/ValueItem/ValueItem.js +233 -0
  153. package/lib/ValueItem/index.js +9 -0
  154. package/lib/ValueItem/util.js +22 -0
  155. package/lib/index.js +158 -0
  156. package/lib/style/components.less +1 -0
  157. package/lib/style/index.js +4 -0
  158. package/lib/style/variable.css +0 -0
  159. package/lib/style/variable.less +2 -0
  160. package/lib/style.js +5 -0
  161. package/package.json +122 -13
  162. package/index.ts +0 -64
  163. package/src/AMap/Map.vue +0 -110
  164. package/src/AMap/index.ts +0 -1
  165. package/src/AMap/util.ts +0 -56
  166. package/src/BadgeStatus/Badge.vue +0 -41
  167. package/src/BadgeStatus/color.ts +0 -25
  168. package/src/BadgeStatus/index.ts +0 -4
  169. package/src/CardSelect/CardSelect.vue +0 -136
  170. package/src/CardSelect/index.ts +0 -3
  171. package/src/CheckButton/CheckButton.vue +0 -146
  172. package/src/CheckButton/index.md +0 -27
  173. package/src/CheckButton/index.ts +0 -3
  174. package/src/ConfigProvider/context.ts +0 -17
  175. package/src/ConfigProvider/index.tsx +0 -42
  176. package/src/Echarts/Echarts.vue +0 -43
  177. package/src/Echarts/index.ts +0 -3
  178. package/src/Ellipsis/Ellipsis.vue +0 -182
  179. package/src/Ellipsis/index.ts +0 -3
  180. package/src/Empty/Empty.vue +0 -43
  181. package/src/Empty/image.ts +0 -3
  182. package/src/Empty/index.ts +0 -2
  183. package/src/FullPage/FullPage.vue +0 -30
  184. package/src/FullPage/index.ts +0 -3
  185. package/src/Icon/icon.tsx +0 -40
  186. package/src/MonacoEditor/Monaco.vue +0 -242
  187. package/src/MonacoEditor/index.md +0 -26
  188. package/src/MonacoEditor/index.ts +0 -2
  189. package/src/PermissionButton/index.tsx +0 -110
  190. package/src/ProLayout/Basic/BasicLayout.tsx +0 -392
  191. package/src/ProLayout/Basic/Header.tsx +0 -115
  192. package/src/ProLayout/PageContainer/index.tsx +0 -441
  193. package/src/ProLayout/PageContainer/typings.ts +0 -56
  194. package/src/ProLayout/RouteContext.ts +0 -87
  195. package/src/ProLayout/SiderMenu/BaseMenu.tsx +0 -296
  196. package/src/ProLayout/SiderMenu/SiderMenu.tsx +0 -320
  197. package/src/ProLayout/SiderMenu/index.ts +0 -2
  198. package/src/ProLayout/SiderMenu/typings.ts +0 -49
  199. package/src/ProLayout/TopHeader/index.tsx +0 -210
  200. package/src/ProLayout/defaultSettings.ts +0 -106
  201. package/src/ProLayout/style/index.ts +0 -1
  202. package/src/ProLayout/typings.ts +0 -87
  203. package/src/ProLayout/util.ts +0 -64
  204. package/src/ProTable/index.md +0 -53
  205. package/src/ProTable/index.tsx +0 -551
  206. package/src/ProTable/proTableTypes.ts +0 -70
  207. package/src/ProTable/style/index.ts +0 -1
  208. package/src/Scrollbar/Bar.vue +0 -75
  209. package/src/Scrollbar/Scrollbar.vue +0 -260
  210. package/src/Scrollbar/Thumb.vue +0 -163
  211. package/src/Scrollbar/constants.ts +0 -10
  212. package/src/Scrollbar/index.ts +0 -4
  213. package/src/Scrollbar/thumb.ts +0 -16
  214. package/src/Scrollbar/util.ts +0 -38
  215. package/src/Search/Advanced/History.vue +0 -140
  216. package/src/Search/Advanced/SaveHistory.vue +0 -108
  217. package/src/Search/Advanced/index.vue +0 -435
  218. package/src/Search/Item.vue +0 -525
  219. package/src/Search/Search.vue +0 -398
  220. package/src/Search/hooks/index.ts +0 -1
  221. package/src/Search/hooks/useSearchItems.ts +0 -68
  222. package/src/Search/index.md +0 -57
  223. package/src/Search/index.ts +0 -5
  224. package/src/Search/setting.ts +0 -55
  225. package/src/Search/typing.ts +0 -76
  226. package/src/Search/util.ts +0 -263
  227. package/src/ValueItem/ValueItem.vue +0 -192
  228. package/src/ValueItem/index.ts +0 -3
  229. package/src/ValueItem/util.ts +0 -16
  230. package/src/style/index.ts +0 -3
  231. /package/{src → es}/ProLayout/Basic/BasicLayout.less +0 -0
  232. /package/{src → es}/ProLayout/Basic/Header.less +0 -0
  233. /package/{src → es}/ProLayout/PageContainer/index.less +0 -0
  234. /package/{src → es}/ProLayout/SiderMenu/index.less +0 -0
  235. /package/{src → es}/ProLayout/TopHeader/index.less +0 -0
  236. /package/{src → es}/ProLayout/style/style.less +0 -0
  237. /package/{src → es}/ProTable/style/index.less +0 -0
@@ -0,0 +1,234 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _extends from "@babel/runtime/helpers/esm/extends";
3
+ import { cloneDeep, isArray, isFunction, isString } from 'lodash-es';
4
+ import { termType } from './setting';
5
+ import './typing';
6
+ /**
7
+ * 处理like,nlike特殊值
8
+ * @param v
9
+ */
10
+ export var handleLikeValue = function handleLikeValue(v) {
11
+ if (isString(v)) {
12
+ return v.split('').reduce(function (pre, next) {
13
+ var _next = next;
14
+ if (next === '\\') {
15
+ _next = '\\\\';
16
+ } else if (next === '%') {
17
+ _next = '\\%';
18
+ }
19
+ return pre + _next;
20
+ }, '');
21
+ }
22
+ return v;
23
+ };
24
+ var handleItemValue = function handleItemValue(item, columnOptionMap) {
25
+ var _item = columnOptionMap.get(item.column);
26
+ if (!_item) return item;
27
+ if (_item.rename) {
28
+ item.column = _item.rename;
29
+ }
30
+ if (_item.handleValue && isFunction(_item.handleValue)) {
31
+ item.value = _item.handleValue(item.value, item);
32
+ }
33
+ if (['like', 'nlike'].includes(item.termType) && !!item.value) {
34
+ item.value = "%".concat(handleLikeValue(item.value), "%");
35
+ }
36
+ return item;
37
+ };
38
+ var isEmpty = function isEmpty(v) {
39
+ return v === undefined || v === null || v === '' || isArray(v) && v.length === 0;
40
+ };
41
+ var handleArrayToTerms = function handleArrayToTerms(terms, columnOptionMap) {
42
+ return terms.map(function (item) {
43
+ if (item.terms) {
44
+ var filterTerms = item.terms.filter(function (filterItem) {
45
+ return filterItem && !isEmpty(filterItem.value) && filterItem.termType !== undefined && filterItem.column !== undefined;
46
+ });
47
+ item.terms = filterTerms.map(function (result) {
48
+ return handleItemValue(result, columnOptionMap);
49
+ });
50
+ }
51
+ return item;
52
+ }).filter(function (item) {
53
+ var _item$terms;
54
+ return (_item$terms = item.terms) === null || _item$terms === void 0 ? void 0 : _item$terms.length;
55
+ });
56
+ };
57
+ /**
58
+ * 处理为外部使用
59
+ * @terms {Array} 表单数据
60
+ * @columnOptionMap {Map} column的Map对象
61
+ */
62
+ export var termsParamsFormat = function termsParamsFormat(terms, columnOptionMap) {
63
+ var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'adv';
64
+ var searchType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'terms';
65
+ // 过滤掉terms中value无效的item
66
+ var cloneParams = cloneDeep(terms);
67
+ if (searchType === 'terms') {
68
+ return type === 'adv' ? {
69
+ terms: handleArrayToTerms(cloneParams.terms, columnOptionMap)
70
+ } : cloneParams.filter(function (item) {
71
+ return item && !isEmpty(item.value) && item.column !== undefined;
72
+ }).map(function (item) {
73
+ return handleItemValue(item, columnOptionMap);
74
+ });
75
+ } else if (searchType == 'object') {
76
+ var result = {};
77
+ cloneParams.filter(function (item) {
78
+ return item && item.value !== undefined && item.value !== '';
79
+ }).forEach(function (item) {
80
+ _extends(result, _defineProperty({}, item.column, item.value));
81
+ });
82
+ return result;
83
+ }
84
+ };
85
+ /**
86
+ * TreeSelect过滤
87
+ * @param value 过滤值
88
+ * @param treeNode
89
+ * @param key
90
+ */
91
+ export var filterTreeSelectNode = function filterTreeSelectNode(value, treeNode) {
92
+ var _treeNode$key;
93
+ var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'name';
94
+ return (_treeNode$key = treeNode[key]) === null || _treeNode$key === void 0 ? void 0 : _treeNode$key.includes(value);
95
+ };
96
+ /**
97
+ * Select过滤
98
+ * @param value 过滤值
99
+ * @param option
100
+ * @param key
101
+ */
102
+ export var filterSelectNode = function filterSelectNode(value, option) {
103
+ var _option$key;
104
+ var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'label';
105
+ return (_option$key = option[key]) === null || _option$key === void 0 ? void 0 : _option$key.includes(value);
106
+ };
107
+ export var handleQData = function handleQData(terms) {
108
+ // 排序, null 往后放
109
+ terms.terms.forEach(function (a) {
110
+ for (var i = 0; i < a.terms.length; i++) {
111
+ for (var j = 0; j < a.terms.length - i - 1; j++) {
112
+ if (!a.terms[j] && a.terms[j + 1]) {
113
+ var temp = a.terms[j];
114
+ a.terms[j] = a.terms[j + 1];
115
+ a.terms[j + 1] = temp;
116
+ }
117
+ }
118
+ }
119
+ });
120
+ return terms;
121
+ };
122
+ export var hasExpand = function hasExpand(terms) {
123
+ var itemCount = 0;
124
+ terms.forEach(function (a) {
125
+ a.terms.forEach(function (b) {
126
+ if (b) {
127
+ itemCount += 1;
128
+ }
129
+ });
130
+ });
131
+ return itemCount >= 2;
132
+ };
133
+ export var compatibleOldTerms = function compatibleOldTerms(q) {
134
+ var _terms = [{
135
+ terms: [null, null, null]
136
+ }, {
137
+ terms: [null, null, null],
138
+ type: 'and'
139
+ }];
140
+ try {
141
+ var _terms$terms;
142
+ var terms = JSON.parse(q || '{}');
143
+ (_terms$terms = terms.terms) === null || _terms$terms === void 0 ? void 0 : _terms$terms.forEach(function (a, aIndex) {
144
+ var _a$terms;
145
+ a === null || a === void 0 ? void 0 : (_a$terms = a.terms) === null || _a$terms === void 0 ? void 0 : _a$terms.forEach(function (b, bIndex) {
146
+ _terms[aIndex].terms[bIndex] = b;
147
+ });
148
+ if (a.type) {
149
+ _terms[aIndex].type = a.type;
150
+ }
151
+ });
152
+ return {
153
+ terms: _terms
154
+ };
155
+ } catch (e) {
156
+ return {
157
+ terms: _terms
158
+ };
159
+ }
160
+ };
161
+ export var handleParamsToString = function handleParamsToString() {
162
+ var terms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
163
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'and';
164
+ var _terms = [{
165
+ terms: [null, null, null]
166
+ }, {
167
+ terms: [null, null, null],
168
+ type: type
169
+ }];
170
+ var termsIndex = 0;
171
+ var termsStar = 0;
172
+ terms.forEach(function (item, index) {
173
+ if (index > 2) {
174
+ termsIndex = 1;
175
+ termsStar = 4;
176
+ }
177
+ _terms[termsIndex].terms[index - termsStar] = item;
178
+ });
179
+ return JSON.stringify({
180
+ terms: _terms
181
+ });
182
+ };
183
+ export var getTermTypeFn = function getTermTypeFn(type) {
184
+ // if (column?.includes('id') && type === 'string') {
185
+ // // 默认id为 eq
186
+ // return 'eq';
187
+ // }
188
+ switch (type) {
189
+ case 'select':
190
+ case 'treeSelect':
191
+ case 'number':
192
+ return 'eq';
193
+ case 'date':
194
+ case 'time':
195
+ return 'gt';
196
+ case 'timeRange':
197
+ case 'rangePicker':
198
+ return 'btw';
199
+ default:
200
+ return 'like';
201
+ }
202
+ };
203
+ export var getTermTypes = function getTermTypes(types) {
204
+ return termType.filter(function (item) {
205
+ return types.includes(item.value);
206
+ });
207
+ };
208
+ export var getTermOptions = function getTermOptions(type, column) {
209
+ var keys = [];
210
+ switch (type) {
211
+ case 'select':
212
+ case 'treeSelect':
213
+ keys = ['not', 'eq', 'in', 'nin'];
214
+ break;
215
+ case 'time':
216
+ case 'date':
217
+ keys = ['gt', 'lt', 'gte', 'lte'];
218
+ break;
219
+ case 'timeRange':
220
+ case 'rangePicker':
221
+ keys = ['btw', 'nbtw'];
222
+ break;
223
+ case 'number':
224
+ keys = ['eq', 'not', 'gt', 'lt', 'gte', 'lte'];
225
+ break;
226
+ default:
227
+ keys = ['like', 'nlike'];
228
+ // column?.includes('id') && type === 'string'
229
+ // ? ['eq']
230
+ // : ['like', 'nlike'];
231
+ break;
232
+ }
233
+ return keys.length ? getTermTypes(keys) : termType;
234
+ };
@@ -0,0 +1,233 @@
1
+ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
2
+ const op = ops[i];
3
+ const fn = ops[i + 1];
4
+ i += 2;
5
+ if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
6
+ return undefined;
7
+ }
8
+ if (op === 'access' || op === 'optionalAccess') {
9
+ lastAccessLHS = value;
10
+ value = fn(value);
11
+ }
12
+ else if (op === 'call' || op === 'optionalCall') {
13
+ value = fn((...args) => value.call(lastAccessLHS, ...args));
14
+ lastAccessLHS = undefined;
15
+ }
16
+ } return value; }
17
+ /* Analyzed bindings: {
18
+ "modelValue": "props",
19
+ "itemType": "props",
20
+ "mode": "props",
21
+ "placeholder": "props",
22
+ "options": "props",
23
+ "style": "props",
24
+ "class": "props",
25
+ "valueFormat": "props",
26
+ "action": "props",
27
+ "headers": "props",
28
+ "CSSProperties": "setup-const",
29
+ "PropType": "setup-const",
30
+ "ref": "setup-const",
31
+ "watch": "setup-const",
32
+ "componentsType": "setup-maybe-ref",
33
+ "MonacoEditor": "setup-maybe-ref",
34
+ "Select": "setup-maybe-ref",
35
+ "DatePicker": "setup-maybe-ref",
36
+ "TimePicker": "setup-maybe-ref",
37
+ "Input": "setup-maybe-ref",
38
+ "InputNumber": "setup-maybe-ref",
39
+ "InputPassword": "setup-maybe-ref",
40
+ "Upload": "setup-maybe-ref",
41
+ "Modal": "setup-maybe-ref",
42
+ "emit": "setup-const",
43
+ "props": "setup-reactive-const",
44
+ "typeMap": "setup-maybe-ref",
45
+ "myValue": "setup-ref",
46
+ "modalVisible": "setup-ref",
47
+ "objectValue": "setup-ref",
48
+ "handleItemModalSubmit": "setup-const",
49
+ "onChange": "setup-const",
50
+ "handleFileChange": "setup-const"
51
+ } */
52
+ import { defineComponent as _defineComponent } from 'vue';
53
+ import { unref as _unref, mergeProps as _mergeProps, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock } from "vue";
54
+ const _hoisted_1 = { class: "value-item-warp" };
55
+ const _hoisted_2 = { style: { "width": "100%", "height": "300px" } };
56
+ import { ref, watch } from 'vue';
57
+ import { componentsType } from './util';
58
+ import { MonacoEditor } from '../../';
59
+ import { Select, DatePicker, TimePicker, Input, InputNumber, InputPassword, Upload, Modal, } from 'ant-design-vue';
60
+ const __sfc_main__ = _defineComponent({
61
+ props: {
62
+ // 组件双向绑定的值
63
+ modelValue: {
64
+ type: [Number, String],
65
+ default: '',
66
+ },
67
+ // 组件类型
68
+ itemType: {
69
+ type: String,
70
+ default: () => 'string',
71
+ },
72
+ // 多选框
73
+ mode: {
74
+ type: String,
75
+ default: '',
76
+ },
77
+ placeholder: String,
78
+ options: Array,
79
+ style: Object,
80
+ class: String,
81
+ valueFormat: String,
82
+ action: [String, Promise],
83
+ headers: Object,
84
+ },
85
+ emits: ["update:modelValue", "change"],
86
+ setup(__props, { emit: __emit }) {
87
+ const emit = __emit;
88
+ const props = __props;
89
+ const typeMap = new Map(Object.entries(componentsType));
90
+ const myValue = ref(undefined);
91
+ const modalVisible = ref(false);
92
+ const objectValue = ref('');
93
+ const handleItemModalSubmit = () => {
94
+ myValue.value = objectValue.value.replace(/[\r\n]\s*/g, '');
95
+ modalVisible.value = false;
96
+ emit('update:modelValue', objectValue.value);
97
+ emit('change', objectValue.value);
98
+ };
99
+ const onChange = (e) => {
100
+ emit('update:modelValue', myValue.value);
101
+ emit('change', e);
102
+ };
103
+ const handleFileChange = (info) => {
104
+ if (info.file.status === 'done') {
105
+ const url = _optionalChain([info, 'access', _2 => _2.file, 'access', _3 => _3.response, 'optionalAccess', _4 => _4.result]);
106
+ myValue.value = url;
107
+ emit('update:modelValue', url);
108
+ emit('change', url);
109
+ }
110
+ };
111
+ watch(() => props.modelValue, () => {
112
+ myValue.value = props.modelValue;
113
+ if (props.itemType === 'object') {
114
+ objectValue.value = props.modelValue;
115
+ }
116
+ }, { immediate: true });
117
+ return (_ctx, _cache) => {
118
+ const _component_AIcon = _resolveComponent("AIcon");
119
+ return (_openBlock(), _createElementBlock("div", _hoisted_1, [
120
+ (_unref(typeMap).get(__props.itemType) === 'select')
121
+ ? (_openBlock(), _createBlock(_unref(Select), _mergeProps({
122
+ key: 0,
123
+ value: myValue.value,
124
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => ((myValue).value = $event)),
125
+ allowClear: ""
126
+ }, props, {
127
+ onChange: _cache[1] || (_cache[1] = (_, options) => onChange(options))
128
+ }), null, 16 /* FULL_PROPS */, ["value"]))
129
+ : (_unref(typeMap).get(__props.itemType) === 'date')
130
+ ? (_openBlock(), _createBlock(_unref(DatePicker), _mergeProps({
131
+ key: 1,
132
+ value: myValue.value,
133
+ "onUpdate:value": _cache[2] || (_cache[2] = ($event) => ((myValue).value = $event)),
134
+ valueFormat: __props.valueFormat || 'YYYY-MM-DD HH:mm:ss',
135
+ allowClear: "",
136
+ showTime: ""
137
+ }, props, { onChange: onChange }), null, 16 /* FULL_PROPS */, ["value", "valueFormat"]))
138
+ : (_unref(typeMap).get(__props.itemType) === 'time')
139
+ ? (_openBlock(), _createBlock(_unref(TimePicker), _mergeProps({
140
+ key: 2,
141
+ value: myValue.value,
142
+ "onUpdate:value": _cache[3] || (_cache[3] = ($event) => ((myValue).value = $event)),
143
+ valueFormat: __props.valueFormat || 'HH:mm:ss',
144
+ allowClear: ""
145
+ }, props, { onChange: onChange }), null, 16 /* FULL_PROPS */, ["value", "valueFormat"]))
146
+ : (_unref(typeMap).get(__props.itemType) === 'inputNumber')
147
+ ? (_openBlock(), _createBlock(_unref(InputNumber), _mergeProps({
148
+ key: 3,
149
+ value: myValue.value,
150
+ "onUpdate:value": _cache[4] || (_cache[4] = ($event) => ((myValue).value = $event)),
151
+ allowClear: ""
152
+ }, props, { onChange: onChange }), null, 16 /* FULL_PROPS */, ["value"]))
153
+ : (_unref(typeMap).get(__props.itemType) === 'object')
154
+ ? (_openBlock(), _createBlock(_unref(Input), _mergeProps({
155
+ key: 4,
156
+ value: myValue.value,
157
+ "onUpdate:value": _cache[6] || (_cache[6] = ($event) => ((myValue).value = $event)),
158
+ allowClear: ""
159
+ }, props, { onChange: onChange }), {
160
+ addonAfter: _withCtx(() => [
161
+ _createVNode(_component_AIcon, {
162
+ type: "FormOutlined",
163
+ onClick: _cache[5] || (_cache[5] = ($event) => (modalVisible.value = true))
164
+ })
165
+ ]),
166
+ _: 1 /* STABLE */
167
+ }, 16 /* FULL_PROPS */, ["value"]))
168
+ : (_unref(typeMap).get(__props.itemType) === 'file')
169
+ ? (_openBlock(), _createBlock(_unref(Input), _mergeProps({
170
+ key: 5,
171
+ value: myValue.value,
172
+ "onUpdate:value": _cache[7] || (_cache[7] = ($event) => ((myValue).value = $event)),
173
+ allowClear: "",
174
+ placeholder: "请输入链接"
175
+ }, props, { onChange: onChange }), {
176
+ addonAfter: _withCtx(() => [
177
+ _createVNode(_unref(Upload), {
178
+ action: __props.action,
179
+ headers: __props.headers,
180
+ showUploadList: false,
181
+ name: "file",
182
+ onChange: handleFileChange
183
+ }, {
184
+ default: _withCtx(() => [
185
+ _createVNode(_component_AIcon, { type: "UploadOutlined" })
186
+ ]),
187
+ _: 1 /* STABLE */
188
+ }, 8 /* PROPS */, ["action", "headers"])
189
+ ]),
190
+ _: 1 /* STABLE */
191
+ }, 16 /* FULL_PROPS */, ["value"]))
192
+ : (_unref(typeMap).get(__props.itemType) === 'password')
193
+ ? (_openBlock(), _createBlock(_unref(InputPassword), _mergeProps({
194
+ key: 6,
195
+ value: myValue.value,
196
+ "onUpdate:value": _cache[8] || (_cache[8] = ($event) => ((myValue).value = $event)),
197
+ allowClear: "",
198
+ type: "password"
199
+ }, props, { onChange: onChange }), null, 16 /* FULL_PROPS */, ["value"]))
200
+ : (_openBlock(), _createBlock(_unref(Input), _mergeProps({
201
+ key: 7,
202
+ value: myValue.value,
203
+ "onUpdate:value": _cache[9] || (_cache[9] = ($event) => ((myValue).value = $event)),
204
+ allowClear: "",
205
+ type: "text"
206
+ }, props, { onChange: onChange }), null, 16 /* FULL_PROPS */, ["value"])),
207
+ _createCommentVNode(" 代码编辑器弹窗 "),
208
+ _createVNode(_unref(Modal), {
209
+ visible: modalVisible.value,
210
+ "onUpdate:visible": _cache[11] || (_cache[11] = ($event) => ((modalVisible).value = $event)),
211
+ zIndex: 1100,
212
+ "cancel-text": "取消",
213
+ "ok-text": "确认",
214
+ title: "编辑",
215
+ width: "700px",
216
+ onCancel: _cache[12] || (_cache[12] = ($event) => (modalVisible.value = false)),
217
+ onOk: handleItemModalSubmit
218
+ }, {
219
+ default: _withCtx(() => [
220
+ _createElementVNode("div", _hoisted_2, [
221
+ _createVNode(_unref(MonacoEditor), {
222
+ modelValue: objectValue.value,
223
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => ((objectValue).value = $event))
224
+ }, null, 8 /* PROPS */, ["modelValue"])
225
+ ])
226
+ ]),
227
+ _: 1 /* STABLE */
228
+ }, 8 /* PROPS */, ["visible"])
229
+ ]));
230
+ };
231
+ }
232
+ });
233
+ export default __sfc_main__;
@@ -0,0 +1,2 @@
1
+ import ValueItem from './ValueItem.js';
2
+ export default ValueItem;
@@ -0,0 +1,16 @@
1
+ export var componentsType = {
2
+ int: 'inputNumber',
3
+ long: 'inputNumber',
4
+ float: 'inputNumber',
5
+ double: 'inputNumber',
6
+ string: 'input',
7
+ array: 'input',
8
+ password: 'password',
9
+ enum: 'select',
10
+ boolean: 'select',
11
+ date: 'date',
12
+ time: 'time',
13
+ object: 'object',
14
+ geoPoint: 'geoPoint',
15
+ file: 'file'
16
+ };
package/es/index.js ADDED
@@ -0,0 +1,24 @@
1
+ import InitAMap from './AMap';
2
+ import BadgeStatus from './BadgeStatus';
3
+ import CardSelect from './CardSelect';
4
+ import CheckButton from './CheckButton';
5
+ import ConfigProvider from './ConfigProvider';
6
+ import Echarts from './Echarts';
7
+ import Ellipsis from './Ellipsis';
8
+ import Empty from './Empty';
9
+ import FullPage from './FullPage';
10
+ import AIcon from './Icon';
11
+ import MonacoEditor from './MonacoEditor';
12
+ import PermissionButton from './PermissionButton';
13
+ import ProLayout, { PageContainer } from './ProLayout';
14
+ import ProTable from './ProTable';
15
+ import Scrollbar from './Scrollbar';
16
+ import Search, { AdvancedSearch } from './Search';
17
+ import ValueItem from './ValueItem';
18
+ export * from './style';
19
+ export { BadgeStatus, CardSelect, CheckButton, Echarts, Ellipsis, Empty, FullPage, AIcon, MonacoEditor, PermissionButton, ValueItem, ProTable, Scrollbar, Search, AdvancedSearch, ConfigProvider };
20
+ export default {
21
+ install: function install(app) {
22
+ app.component('JAMap', InitAMap).component('JBadgeStatus', BadgeStatus).component('JCardSelect', CardSelect).component('JCheckButton', CheckButton).component('JConfigProvider', ConfigProvider).component('JEcharts', Echarts).component('JEllipsis', Ellipsis).component('JEmpty', Empty).component('JFullPage', FullPage).component('AIcon', AIcon).component('JMonacoEditor', MonacoEditor).component('JPermissionButton', PermissionButton).component('JProLayout', ProLayout).component('JPageContainer', PageContainer).component('JProTable', ProTable).component('JScrollbar', Scrollbar).component('JSearch', Search).component('JAdvancedSearch', AdvancedSearch).component('JValueItem', ValueItem);
23
+ }
24
+ };
@@ -0,0 +1,3 @@
1
+ import '../ProLayout/style';
2
+ import '../ProTable/style';
3
+ import '../ProLayout/style';
File without changes
@@ -1,4 +1,2 @@
1
- @import 'ant-design-vue/es/style/themes/index.less';
2
-
3
1
  @text-color-title: #000;
4
2
  @text-color-subtitle: #263237;
package/es/style.js ADDED
@@ -0,0 +1,3 @@
1
+ import './ProLayout/style';
2
+ import './ProTable/style';
3
+ import './Search/style';
@@ -0,0 +1,124 @@
1
+ /* Analyzed bindings: {
2
+ "style": "props",
3
+ "class": "props",
4
+ "AMapUI": "props",
5
+ "center": "props",
6
+ "plugins": "props",
7
+ "zooms": "props",
8
+ "JSKey": "props",
9
+ "WebKey": "props",
10
+ "ref": "setup-const",
11
+ "computed": "setup-const",
12
+ "initAMapApiLoader": "setup-maybe-ref",
13
+ "ElAmap": "setup-maybe-ref",
14
+ "getAMapUiPromise": "setup-maybe-ref",
15
+ "MapProps": "setup-maybe-ref",
16
+ "MAPConfig": "setup-maybe-ref",
17
+ "Empty": "setup-maybe-ref",
18
+ "emit": "setup-const",
19
+ "props": "setup-reactive-const",
20
+ "config": "setup-maybe-ref",
21
+ "_mapStyle": "setup-ref",
22
+ "hasAMapKey": "setup-ref",
23
+ "uiLoading": "setup-ref",
24
+ "map": "setup-ref",
25
+ "isOpenUi": "setup-ref",
26
+ "getAMapUI": "setup-const",
27
+ "initMap": "setup-const"
28
+ } */
29
+ import { defineComponent as _defineComponent } from 'vue';
30
+ import { renderSlot as _renderSlot, unref as _unref, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from "vue";
31
+ import { ref, computed } from 'vue';
32
+ import { initAMapApiLoader, ElAmap } from '@vuemap/vue-amap';
33
+ import { getAMapUiPromise } from '@jetlinks-web/utils';
34
+ import { MapProps } from './util';
35
+ import { MAPConfig } from "@jetlinks-web/constants";
36
+ import Empty from '../Empty';
37
+ import '@vuemap/vue-amap/dist/style.css';
38
+ const __sfc_main__ = _defineComponent({
39
+ props: {
40
+ ...MapProps(),
41
+ style: Object,
42
+ class: String,
43
+ AMapUI: [String, Boolean],
44
+ center: Array,
45
+ plugins: Array,
46
+ zooms: {
47
+ type: Array,
48
+ default: [3, 20]
49
+ },
50
+ JSKey: String,
51
+ WebKey: String,
52
+ },
53
+ emits: [
54
+ 'initMap',
55
+ ],
56
+ setup(__props, { emit: __emit }) {
57
+ const emit = __emit;
58
+ const props = __props;
59
+ const config = inject(MAPConfig);
60
+ const _mapStyle = computed(() => {
61
+ if (props.mapStyle) {
62
+ return `amap://styles/${props.mapStyle}`;
63
+ }
64
+ if (config.mapStyle) {
65
+ return config.mapStyle;
66
+ }
67
+ return undefined;
68
+ });
69
+ const hasAMapKey = computed(() => {
70
+ return !!(props.JSKey || config.JSKey);
71
+ });
72
+ initAMapApiLoader({
73
+ key: props.JSKey || config.JSKey || '',
74
+ securityJsCode: props.WebKey || config.WebKey,
75
+ plugins: props.plugins
76
+ });
77
+ const uiLoading = ref(false);
78
+ const map = ref(null);
79
+ const isOpenUi = computed(() => {
80
+ return 'AMapUI' in props || props.AMapUI;
81
+ });
82
+ const getAMapUI = () => {
83
+ const version = typeof props.AMapUI === 'string' ? props.AMapUI : '1.1';
84
+ getAMapUiPromise(version).then(() => {
85
+ uiLoading.value = true;
86
+ });
87
+ };
88
+ const initMap = (e) => {
89
+ map.value = e;
90
+ emit('initMap', e);
91
+ if (isOpenUi.value) {
92
+ getAMapUI();
93
+ }
94
+ };
95
+ return (_ctx, _cache) => {
96
+ return (_openBlock(), _createElementBlock("div", {
97
+ style: _normalizeStyle(props.style || { width: '100%', height: '100%' }),
98
+ class: _normalizeClass(props.class)
99
+ }, [
100
+ (hasAMapKey.value)
101
+ ? (_openBlock(), _createBlock(_unref(ElAmap), _mergeProps({
102
+ key: 0,
103
+ "map-style": _mapStyle.value
104
+ }, {
105
+ ...props,
106
+ ..._ctx.$attrs
107
+ }, { onInit: initMap }), {
108
+ default: _withCtx(() => [
109
+ (uiLoading.value)
110
+ ? _renderSlot(_ctx.$slots, "default", { key: 0 })
111
+ : _renderSlot(_ctx.$slots, "default", { key: 1 })
112
+ ]),
113
+ _: 3 /* FORWARDED */
114
+ }, 16 /* FULL_PROPS */, ["map-style"]))
115
+ : (_openBlock(), _createBlock(_unref(Empty), {
116
+ key: 1,
117
+ description: "请配置高德地图key",
118
+ style: { "padding": "20%" }
119
+ }))
120
+ ], 6 /* CLASS, STYLE */));
121
+ };
122
+ }
123
+ });
124
+ export default __sfc_main__;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _Map = _interopRequireDefault(require("./Map.js"));
9
+ var _default = exports.default = _Map.default;