@opentiny/vue-renderless 3.13.1 → 3.14.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.
Files changed (321) hide show
  1. package/action-sheet/index.js +20 -13
  2. package/action-sheet/vue.js +8 -7
  3. package/amount/index.js +100 -25
  4. package/amount/vue.js +102 -26
  5. package/anchor/index.js +1 -0
  6. package/area/index.js +8 -8
  7. package/area/vue.js +5 -5
  8. package/async-flowchart/index.js +16 -3
  9. package/autocomplete/index.js +58 -14
  10. package/autocomplete/vue.js +40 -12
  11. package/badge/index.js +12 -0
  12. package/badge/vue.js +6 -4
  13. package/breadcrumb/vue.js +3 -1
  14. package/breadcrumb-item/vue.js +6 -2
  15. package/button/index.js +5 -1
  16. package/calendar/index.js +2 -86
  17. package/calendar-bar/index.js +18 -4
  18. package/calendar-view/index.js +5 -1
  19. package/calendar-view/vue.js +16 -3
  20. package/card-group/vue.js +4 -2
  21. package/cascader/index.js +86 -34
  22. package/cascader/vue.js +61 -20
  23. package/cascader-menu/index.js +7 -7
  24. package/cascader-menu/vue.js +2 -3
  25. package/cascader-mobile/index.js +36 -23
  26. package/cascader-mobile/vue.js +6 -0
  27. package/cascader-node/index.js +13 -1
  28. package/cascader-node/vue.js +15 -4
  29. package/cascader-panel/index.js +1 -1
  30. package/cascader-select/column-index.js +150 -0
  31. package/cascader-select/column.js +120 -0
  32. package/cascader-select/index.js +29 -165
  33. package/cascader-select/usePicker.js +251 -0
  34. package/cascader-select/useTouch.js +65 -0
  35. package/cascader-select/vue.js +35 -47
  36. package/cell/vue.js +2 -1
  37. package/chart-bar/index.js +2 -3
  38. package/chart-core/deps/constants.js +43 -43
  39. package/chart-core/index.js +1 -1
  40. package/chart-gauge/index.js +2 -2
  41. package/chart-heatmap/index.js +17 -10
  42. package/chart-line/index.js +8 -9
  43. package/chart-tree/index.js +2 -2
  44. package/chart-waterfall/index.js +4 -6
  45. package/checkbox/index.js +18 -1
  46. package/checkbox/vue.js +15 -7
  47. package/checkbox-group/vue.js +1 -0
  48. package/col/vue.js +1 -1
  49. package/collapse/index.js +3 -3
  50. package/color-select-panel/vue.js +0 -7
  51. package/column-list-item/index.js +17 -1
  52. package/column-list-item/vue.js +8 -3
  53. package/common/date.js +7 -5
  54. package/common/deps/clickoutside.js +6 -2
  55. package/common/deps/dom.js +19 -4
  56. package/common/deps/popper.js +44 -11
  57. package/common/deps/resize-event.js +1 -0
  58. package/common/deps/touch-emulator.js +4 -1
  59. package/common/deps/tree-model/node.js +2 -2
  60. package/common/deps/tree-model/tree-store.js +2 -13
  61. package/common/deps/useRect.js +25 -0
  62. package/common/deps/vue-popper.js +38 -20
  63. package/common/index.js +2 -2
  64. package/common/runtime.js +1 -1
  65. package/common/string.js +2 -2
  66. package/common/type.js +2 -1
  67. package/common/validate/rules/enum.js +1 -1
  68. package/common/validate/rules/pattern.js +2 -2
  69. package/common/validate/rules/range.js +8 -5
  70. package/common/validate/rules/required.js +1 -1
  71. package/common/validate/rules/type.js +5 -5
  72. package/common/validate/rules/whitespace.js +1 -1
  73. package/common/validate/util.js +15 -16
  74. package/common/validate/validations/integer.js +1 -1
  75. package/common/validate/validations/method.js +1 -1
  76. package/currency/index.js +74 -7
  77. package/currency/vue.js +21 -5
  78. package/date-panel/index.js +16 -0
  79. package/date-panel/vue.js +8 -2
  80. package/date-picker-mobile/index.js +12 -0
  81. package/date-picker-mobile/vue.js +7 -1
  82. package/date-range/vue.js +14 -6
  83. package/date-table/index.js +5 -0
  84. package/date-table/vue.js +3 -1
  85. package/dialog-box/index.js +46 -14
  86. package/dialog-box/vue.js +30 -7
  87. package/dialog-select/index.js +6 -3
  88. package/dialog-select/vue.js +8 -4
  89. package/drawer/index.js +27 -5
  90. package/drawer/vue.js +14 -7
  91. package/dropdown/index.js +7 -7
  92. package/dropdown/vue.js +6 -2
  93. package/dropdown-item/index.js +9 -1
  94. package/dropdown-item/mf.js +6 -10
  95. package/dropdown-item/vue.js +20 -7
  96. package/dropdown-menu/index.js +20 -7
  97. package/dropdown-menu/vue.js +4 -3
  98. package/exception/index.js +2 -7
  99. package/exception/vue.js +7 -10
  100. package/fall-menu/index.js +5 -1
  101. package/fall-menu/vue.js +13 -2
  102. package/file-upload/index.js +68 -18
  103. package/file-upload/vue.js +38 -8
  104. package/filter-box/index.js +1 -0
  105. package/float-button/index.js +42 -0
  106. package/float-button/vue.js +101 -0
  107. package/floating-button/index.js +62 -16
  108. package/floating-button/vue.js +27 -9
  109. package/flowchart/index.js +134 -25
  110. package/flowchart/node.js +13 -4
  111. package/flowchart/vue.js +16 -4
  112. package/form/vue.js +8 -0
  113. package/form-item/index.js +5 -5
  114. package/form-item/vue.js +3 -1
  115. package/fullscreen/index.js +5 -5
  116. package/fullscreen/vue.js +3 -3
  117. package/grid/plugins/export.js +5 -2
  118. package/grid/utils/column.js +1 -0
  119. package/grid/utils/dom.js +7 -1
  120. package/image/index.js +6 -1
  121. package/image/vue.js +6 -3
  122. package/image-viewer/index.js +62 -51
  123. package/image-viewer/vue.js +17 -5
  124. package/input/index.js +81 -20
  125. package/input/vue.js +44 -18
  126. package/ip-address/index.js +61 -19
  127. package/ip-address/vue.js +22 -4
  128. package/link/vue.js +3 -1
  129. package/loading/index.js +2 -2
  130. package/loading/vue.js +8 -2
  131. package/logout/index.js +1 -1
  132. package/menu/index.js +15 -2
  133. package/menu/vue.js +22 -17
  134. package/mind-map/index.js +47 -0
  135. package/mind-map/vue.js +53 -0
  136. package/modal/index.js +44 -4
  137. package/modal/vue.js +18 -4
  138. package/multi-select/index.js +186 -11
  139. package/multi-select/vue.js +60 -15
  140. package/multi-select-item/index.js +23 -0
  141. package/multi-select-item/vue.js +31 -0
  142. package/numeric/index.js +46 -12
  143. package/numeric/vue.js +44 -19
  144. package/option/index.js +27 -9
  145. package/option/vue.js +37 -21
  146. package/option-group/index.js +3 -3
  147. package/package.json +1 -1
  148. package/pager/index.js +18 -4
  149. package/pager/vue.js +16 -5
  150. package/picker/index.js +258 -49
  151. package/picker/mb.js +42 -0
  152. package/picker/vue.js +70 -17
  153. package/picker-column/index.js +1 -1
  154. package/pop-upload/vue.js +3 -0
  155. package/popconfirm/index.js +3 -6
  156. package/popconfirm/vue.js +1 -1
  157. package/popeditor/index.js +71 -32
  158. package/popeditor/vue.js +15 -11
  159. package/popover/index.js +4 -4
  160. package/popover/vue.js +6 -6
  161. package/popup/index.js +3 -3
  162. package/popup/vue.js +5 -5
  163. package/pull-refresh/index.js +13 -13
  164. package/pull-refresh/vue.js +5 -4
  165. package/radio/index.js +0 -17
  166. package/radio/vue.js +4 -10
  167. package/rate/index.js +1 -1
  168. package/rate/vue.js +0 -2
  169. package/record/index.js +4 -1
  170. package/rich-text/clipboard.js +54 -0
  171. package/rich-text/index.js +192 -0
  172. package/rich-text/module/file-upload.js +107 -0
  173. package/rich-text/module/image-drop.js +63 -0
  174. package/rich-text/module/image-upload.js +89 -0
  175. package/rich-text/options.js +141 -0
  176. package/rich-text/table-module.js +382 -0
  177. package/rich-text/vue.js +102 -0
  178. package/{rich-text-edtior → rich-text-editor}/index.js +2 -2
  179. package/{rich-text-edtior → rich-text-editor}/vue.js +2 -5
  180. package/scrollbar/index.js +11 -11
  181. package/scrollbar/vue-bar.js +3 -3
  182. package/scrollbar/vue.js +5 -5
  183. package/search/index.js +9 -9
  184. package/search/vue.js +8 -6
  185. package/select/index.js +457 -389
  186. package/select/vue.js +257 -161
  187. package/select-dropdown/index.js +61 -3
  188. package/select-dropdown/vue.js +85 -8
  189. package/select-view/index.js +3 -1
  190. package/selected-box/index.js +2 -0
  191. package/selected-box/vue.js +6 -3
  192. package/signature/index.js +241 -0
  193. package/signature/vue.js +88 -0
  194. package/skeleton/index.js +14 -0
  195. package/skeleton/vue.js +15 -0
  196. package/skeleton-item/vue.js +15 -0
  197. package/slider/index.js +70 -17
  198. package/slider/vue.js +16 -7
  199. package/split/index.js +5 -3
  200. package/split/vue.js +4 -6
  201. package/standard-list-item/index.js +15 -1
  202. package/standard-list-item/vue.js +6 -5
  203. package/steps/index.js +25 -2
  204. package/steps/slide-bar.js +8 -1
  205. package/steps/vue.js +15 -3
  206. package/tab-item-mf/vue.js +14 -8
  207. package/tab-nav/index.js +30 -5
  208. package/tab-nav/vue.js +16 -4
  209. package/tabbar/vue.js +9 -3
  210. package/tabbar-item/vue.js +3 -2
  211. package/tabs/index.js +16 -4
  212. package/tabs/vue.js +2 -1
  213. package/tabs-mf/index.js +20 -6
  214. package/tabs-mf/vue-nav.js +26 -11
  215. package/tabs-mf/vue.js +7 -7
  216. package/tabs-mf/wheel.js +1 -0
  217. package/tag/index.js +1 -1
  218. package/tag-group/index.js +2 -1
  219. package/time/index.js +5 -2
  220. package/time/vue.js +1 -1
  221. package/time-line/index.js +3 -3
  222. package/time-line/vue.js +2 -2
  223. package/time-picker-mobile/index.js +24 -5
  224. package/time-picker-mobile/vue.js +17 -7
  225. package/time-range/index.js +2 -0
  226. package/timeline-item/vue.js +1 -1
  227. package/tooltip/index.js +6 -3
  228. package/tooltip/vue.js +4 -4
  229. package/transfer/index.js +20 -22
  230. package/transfer/vue.js +1 -6
  231. package/transfer-panel/vue.js +3 -5
  232. package/tree/index.js +21 -4
  233. package/tree/vue.js +10 -8
  234. package/tree-menu/index.js +31 -5
  235. package/tree-menu/vue.js +28 -15
  236. package/tree-node/index.js +18 -18
  237. package/tree-node/vue.js +6 -5
  238. package/types/action-sheet.type.d.ts +118 -1
  239. package/types/alert.type.d.ts +1 -1
  240. package/types/amount.type.d.ts +168 -1
  241. package/types/area.type.d.ts +134 -1
  242. package/types/async-flowchart.type.d.ts +72 -0
  243. package/types/autocomplete.type.d.ts +199 -1
  244. package/types/badge.type.d.ts +3 -1
  245. package/types/breadcrumb-item.type.d.ts +2 -0
  246. package/types/breadcrumb.type.d.ts +2 -0
  247. package/types/button-group.type.d.ts +3 -3
  248. package/types/button.type.d.ts +4 -0
  249. package/types/cascader-menu.type.d.ts +3 -4
  250. package/types/cascader-node.type.d.ts +5 -2
  251. package/types/cascader-panel.type-2bd03be3.d.ts +241 -0
  252. package/types/cascader-panel.type.d.ts +3 -241
  253. package/types/cascader.type.d.ts +329 -1
  254. package/types/checkbox.type.d.ts +9 -3
  255. package/types/collapse.type.d.ts +20 -3
  256. package/types/date-picker.type.d.ts +37 -0
  257. package/types/dialog-box.type.d.ts +13 -3
  258. package/types/drawer.type.d.ts +133 -1
  259. package/types/{dropdown-item.type-8ea6c633.d.ts → dropdown-item.type-8475a549.d.ts} +7 -13
  260. package/types/dropdown-item.type.d.ts +1 -1
  261. package/types/dropdown-menu.type.d.ts +1 -1
  262. package/types/dropdown.type.d.ts +1 -5
  263. package/types/fall-menu.type.d.ts +94 -1
  264. package/types/file-upload.type.d.ts +1 -1
  265. package/types/float-button.type.d.ts +123 -0
  266. package/types/form-item.type.d.ts +1 -1
  267. package/types/{form.type-d0fd42f3.d.ts → form.type-222799ae.d.ts} +5 -2
  268. package/types/form.type.d.ts +1 -1
  269. package/types/{index-e0250f63.d.ts → index-b012f687.d.ts} +9 -0
  270. package/types/input.type.d.ts +1 -5
  271. package/types/ip-address.type.d.ts +160 -1
  272. package/types/link.type.d.ts +6 -3
  273. package/types/loading.type.d.ts +7 -0
  274. package/types/milestone.type.d.ts +1 -1
  275. package/types/mind-map.type.d.ts +20 -0
  276. package/types/modal.type.d.ts +29 -2
  277. package/types/numeric.type.d.ts +41 -10
  278. package/types/pager.type.d.ts +13 -1
  279. package/types/picker.type.d.ts +18 -0
  280. package/types/popconfirm.type.d.ts +86 -1
  281. package/types/popeditor.type.d.ts +5 -1
  282. package/types/popover.type.d.ts +3 -3
  283. package/types/progress.type.d.ts +3 -1
  284. package/types/radio.type.d.ts +0 -4
  285. package/types/rate.type.d.ts +236 -1
  286. package/types/search.type.d.ts +88 -1
  287. package/types/shared.type.d.ts +1 -1
  288. package/types/skeleton-item.type.d.ts +38 -0
  289. package/types/skeleton.type.d.ts +45 -0
  290. package/types/slider.type.d.ts +49 -10
  291. package/types/steps.type.d.ts +15 -4
  292. package/types/switch.type.d.ts +3 -3
  293. package/types/tab-bar.type.d.ts +1 -1
  294. package/types/tab-nav.type.d.ts +7 -2
  295. package/types/tabs.type.d.ts +9 -1
  296. package/types/tag-group.type.d.ts +64 -1
  297. package/types/{time-line.type-d7daa669.d.ts → time-line.type-b155cb4f.d.ts} +12 -0
  298. package/types/time-line.type.d.ts +1 -1
  299. package/types/timeline-item.type.d.ts +1 -1
  300. package/types/tooltip.type.d.ts +2 -2
  301. package/types/transfer.type.d.ts +185 -1
  302. package/types/tree-menu.type.d.ts +210 -1
  303. package/types/upload-dragger.type.d.ts +2 -2
  304. package/types/{upload-list.type-343e8c11.d.ts → upload-list.type-a29aea50.d.ts} +31 -8
  305. package/types/upload-list.type.d.ts +1 -1
  306. package/types/upload.type.d.ts +1 -1
  307. package/types/user-head.type.d.ts +146 -1
  308. package/types/wizard.type.d.ts +1 -0
  309. package/upload/index.js +64 -34
  310. package/upload/vue.js +9 -5
  311. package/upload-dragger/index.js +22 -20
  312. package/upload-list/index.js +24 -18
  313. package/upload-list/vue.js +9 -4
  314. package/user/index.js +34 -25
  315. package/user/vue.js +1 -1
  316. package/user-head/index.js +3 -3
  317. package/watermark/index.js +11 -0
  318. package/wheel/index.js +3 -0
  319. package/wizard/vue.js +4 -2
  320. package/common/deps/modal-queue.js +0 -6
  321. package/common/deps/requestAnimationFrame.js +0 -25
@@ -0,0 +1,251 @@
1
+ import {
2
+ __spreadProps,
3
+ __spreadValues
4
+ } from "../chunk-G2ADBYYC.js";
5
+ const DEFAULT_FILED_NAMES = {
6
+ text: "label",
7
+ value: "id",
8
+ children: "children"
9
+ };
10
+ const createSourceData = ({ props, state, api }) => () => {
11
+ if (!api.validProps())
12
+ return;
13
+ const { options, valueField, textField, type } = props;
14
+ if (type === "cascade")
15
+ return options;
16
+ const values = api.parseType(state.defaultValues.slice());
17
+ const types = Array.from({ length: values.length });
18
+ const ranges = Array.from({ length: values.length });
19
+ const indices = Array.from({ length: values.length });
20
+ const visibleOptions = options.map((opt, i) => {
21
+ let slicedValues, existOption;
22
+ if (Array.isArray(opt)) {
23
+ if (opt.length === 0)
24
+ return [];
25
+ let index = opt.findIndex((item) => item[valueField] === values[i]);
26
+ index = index === -1 ? 0 : index;
27
+ types[i] = "a";
28
+ ranges[i] = [0, opt.length - 1];
29
+ indices[i] = index;
30
+ slicedValues = api.sliceValue(0, opt.length - 1);
31
+ existOption = (i2) => opt[i2];
32
+ } else if (opt && typeof opt === "object") {
33
+ let range;
34
+ if (Array.isArray(opt.range)) {
35
+ range = opt.range.slice(0, 2);
36
+ } else if (typeof opt.rangeMethod === "function") {
37
+ range = opt.rangeMethod(...values);
38
+ state.isOldCascadeType = true;
39
+ }
40
+ types[i] = "o";
41
+ ranges[i] = api.parseType(range);
42
+ slicedValues = api.sliceValue(ranges[i][0], ranges[i][1]);
43
+ existOption = (i2) => opt.optionMethod(i2, ...values);
44
+ }
45
+ if (!slicedValues || !existOption)
46
+ return [];
47
+ return slicedValues.map((slicedValue) => {
48
+ const option = slicedValue === null ? { [valueField]: null, [textField]: "" } : existOption(slicedValue);
49
+ return option;
50
+ });
51
+ });
52
+ return visibleOptions;
53
+ };
54
+ const changeHandler = ({ state, columnFieldNames, columnsType, api }) => (columnIndex, option) => {
55
+ const fields = columnFieldNames.value;
56
+ if (option && Object.keys(option).length) {
57
+ state.defaultValues = state.defaultValues ? state.defaultValues : [];
58
+ if (columnsType.value === "cascade") {
59
+ state.defaultValues[columnIndex] = option[fields.value] || "";
60
+ let index = columnIndex;
61
+ let cursor = option;
62
+ while (cursor && cursor[fields.children] && cursor[fields.children][0]) {
63
+ state.defaultValues[index + 1] = cursor[fields.children][0][fields.value];
64
+ index++;
65
+ cursor = cursor[fields.children][0];
66
+ }
67
+ if (cursor && cursor[fields.children] && cursor[fields.children].length === 0) {
68
+ state.defaultValues = state.defaultValues.slice(0, index + 1);
69
+ }
70
+ } else {
71
+ state.defaultValues[columnIndex] = Object.prototype.hasOwnProperty.call(option, fields.value) ? option[fields.value] : "";
72
+ }
73
+ api.change(columnIndex);
74
+ }
75
+ };
76
+ const formatCascade = ({ columnFieldNames }) => (columns, defaultValues) => {
77
+ const formatted = [];
78
+ const fields = columnFieldNames.value;
79
+ let cursor = {
80
+ text: "",
81
+ value: "",
82
+ [fields.children]: columns
83
+ };
84
+ let columnIndex = 0;
85
+ while (cursor && cursor[fields.children]) {
86
+ const options = cursor[fields.children];
87
+ const value = defaultValues[columnIndex];
88
+ let index = options.findIndex((columnItem) => columnItem[fields.value] === value);
89
+ if (index === -1)
90
+ index = 0;
91
+ cursor = cursor[fields.children][index];
92
+ columnIndex++;
93
+ formatted.push(options);
94
+ }
95
+ return formatted.slice();
96
+ };
97
+ const columnFieldNamesComputed = ({ props, computed }) => computed(() => {
98
+ return __spreadProps(__spreadValues({}, DEFAULT_FILED_NAMES), {
99
+ text: props.textField,
100
+ value: props.valueField,
101
+ children: props.childrenField
102
+ });
103
+ });
104
+ const defaultIndexes = ({ state, computed, columnFieldNames, columnsList }) => computed(() => {
105
+ const fields = columnFieldNames.value;
106
+ return columnsList.value.map((column, index) => {
107
+ const targetIndex = column.findIndex((item) => item[fields.value] === state.defaultValues[index]);
108
+ return targetIndex === -1 ? 0 : targetIndex;
109
+ });
110
+ });
111
+ const confirmDisabled = ({ props, state, columnsList }) => () => {
112
+ if (typeof props.disabled !== "function") {
113
+ return false;
114
+ }
115
+ state.isDisabled = columnsList.value.some((column, columnIndex) => {
116
+ return props.disabled(state.defaultValues[columnIndex], ...state.defaultValues);
117
+ });
118
+ };
119
+ const change = ({ api, state, columnFieldNames, columnsList }) => () => {
120
+ if (api.isSameValue(state.oldValues, state.defaultValues))
121
+ return;
122
+ state.oldValues = state.defaultValues.slice();
123
+ if (state.isOldCascadeType) {
124
+ state.formattedColumns = api.createSourceData();
125
+ }
126
+ api.getColumnsList();
127
+ api.confirmDisabled();
128
+ const fields = columnFieldNames.value;
129
+ state.selectedOptions = columnsList.value.map((column, index) => {
130
+ return column.find((item) => item[fields.value] === state.defaultValues[index]) || column[0];
131
+ });
132
+ };
133
+ const columnsTypeComputed = ({ state, computed, columnFieldNames }) => computed(() => {
134
+ const firstColumn = state.formattedColumns[0];
135
+ const fields = columnFieldNames.value;
136
+ if (firstColumn) {
137
+ if (Array.isArray(firstColumn)) {
138
+ return "multiple";
139
+ }
140
+ if (fields.children in firstColumn) {
141
+ return "cascade";
142
+ }
143
+ }
144
+ return "single";
145
+ });
146
+ const getColumnsList = ({ state, api, columnsType, columnsList }) => () => {
147
+ let result = [];
148
+ switch (columnsType.value) {
149
+ case "multiple":
150
+ result = state.formattedColumns;
151
+ break;
152
+ case "cascade":
153
+ result = api.formatCascade(state.formattedColumns, state.defaultValues ? state.defaultValues : []);
154
+ break;
155
+ default:
156
+ result = [state.formattedColumns];
157
+ break;
158
+ }
159
+ columnsList.value = result;
160
+ };
161
+ const setValue = ({ api, state }) => (value) => {
162
+ if (!api.isSameValue(value, state.defaultValues)) {
163
+ state.defaultValues = (value || []).slice();
164
+ api.change();
165
+ }
166
+ };
167
+ const isSameValue = (valA, valB) => JSON.stringify(valA) === JSON.stringify(valB);
168
+ const sliceValue = (min, max) => {
169
+ const values = [min];
170
+ Array.from({ length: max - min }).map((v, i) => values.push(min + i + 1));
171
+ return values;
172
+ };
173
+ const validArr = (arr) => Array.isArray(arr) && arr.length;
174
+ const validProps = ({ props }) => () => {
175
+ const { modelValue, options } = props;
176
+ return validArr(modelValue) && validArr(options) && modelValue.length === options.length;
177
+ };
178
+ const parseType = ({ props }) => (values) => {
179
+ const { valueType } = props;
180
+ return values.map(valueType === "number" ? Number : valueType === "string" ? String : (i) => i);
181
+ };
182
+ const init = ({ api, state }) => () => {
183
+ state.isInit = true;
184
+ state.formattedColumns = api.createSourceData();
185
+ api.getColumnsList();
186
+ };
187
+ const usePicker = (args) => {
188
+ const { ref, reactive, watch, computed, toRefs, props } = args;
189
+ const state = reactive({
190
+ formattedColumns: [],
191
+ defaultValues: [],
192
+ selectedOptions: [],
193
+ oldValues: [],
194
+ isOldCascadeType: false,
195
+ isDisabled: false,
196
+ isInit: false
197
+ });
198
+ const api = {};
199
+ const columnsList = ref([]);
200
+ const pickerColumn = ref([]);
201
+ const columnFieldNames = columnFieldNamesComputed({ props, computed });
202
+ const columnsType = columnsTypeComputed({ state, computed, columnFieldNames });
203
+ Object.assign(api, {
204
+ change: change({ api, state, columnFieldNames, columnsList }),
205
+ changeHandler: changeHandler({ state, columnFieldNames, columnsType, api }),
206
+ formatCascade: formatCascade({ columnFieldNames }),
207
+ setValue: setValue({ api, state }),
208
+ validProps: validProps({ props }),
209
+ parseType: parseType({ props }),
210
+ init: init({ api, state }),
211
+ isSameValue,
212
+ sliceValue,
213
+ getColumnsList: getColumnsList({ state, api, columnsType, columnsList }),
214
+ confirmDisabled: confirmDisabled({ props, state, columnsList }),
215
+ defaultIndexes: defaultIndexes({ state, computed, columnFieldNames, columnsList }),
216
+ createSourceData: createSourceData({ props, state, api })
217
+ });
218
+ initWatch({ props, api, state, watch });
219
+ return __spreadProps(__spreadValues({}, toRefs(state)), {
220
+ columnsType,
221
+ columnsList,
222
+ columnFieldNames,
223
+ changeHandler: api.changeHandler,
224
+ defaultIndexes: api.defaultIndexes,
225
+ pickerColumn,
226
+ isSameValue: api.isSameValue,
227
+ setValue: api.setValue
228
+ });
229
+ };
230
+ const initWatch = ({ props, api, state, watch }) => {
231
+ watch(
232
+ () => props.modelValue,
233
+ (newValues) => {
234
+ api.setValue(newValues);
235
+ },
236
+ { deep: true, immediate: true }
237
+ );
238
+ watch(
239
+ () => props.options,
240
+ () => props.visible && api.init(),
241
+ { deep: true, immediate: true }
242
+ );
243
+ watch(
244
+ () => props.visible,
245
+ () => props.visible && !state.isInit && api.init(),
246
+ { deep: true, immediate: true }
247
+ );
248
+ };
249
+ export {
250
+ usePicker
251
+ };
@@ -0,0 +1,65 @@
1
+ import "../chunk-G2ADBYYC.js";
2
+ const MIN_DISTANCE = 10;
3
+ const getDirection = (x, y) => {
4
+ if (x > y && x > MIN_DISTANCE)
5
+ return "horizontal";
6
+ if (y > x && y > MIN_DISTANCE)
7
+ return "vertical";
8
+ return "";
9
+ };
10
+ function useTouch({ ref }) {
11
+ const startX = ref(0);
12
+ const startY = ref(0);
13
+ const moveX = ref(0);
14
+ const moveY = ref(0);
15
+ const deltaX = ref(0);
16
+ const deltaY = ref(0);
17
+ const offsetX = ref(0);
18
+ const offsetY = ref(0);
19
+ const direction = ref("");
20
+ const isVertical = () => direction.value === "vertical";
21
+ const isHorizontal = () => direction.value === "horizontal";
22
+ const move = (event) => {
23
+ const touchEvent = event.touches[0];
24
+ deltaX.value = touchEvent.clientX - startX.value;
25
+ deltaY.value = touchEvent.clientY - startY.value;
26
+ moveY.value = touchEvent.clientY;
27
+ moveX.value = touchEvent.clientX;
28
+ offsetY.value = Math.abs(deltaY.value);
29
+ offsetX.value = Math.abs(deltaX.value);
30
+ if (!direction.value) {
31
+ direction.value = getDirection(offsetX.value, offsetY.value);
32
+ }
33
+ };
34
+ const reset = () => {
35
+ deltaX.value = 0;
36
+ offsetX.value = 0;
37
+ offsetY.value = 0;
38
+ deltaY.value = 0;
39
+ direction.value = "";
40
+ };
41
+ const start = (event) => {
42
+ reset();
43
+ startY.value = event.touches[0].clientY;
44
+ startX.value = event.touches[0].clientX;
45
+ };
46
+ return {
47
+ start,
48
+ move,
49
+ reset,
50
+ startY,
51
+ startX,
52
+ moveY,
53
+ moveX,
54
+ deltaY,
55
+ deltaX,
56
+ offsetY,
57
+ offsetX,
58
+ isVertical,
59
+ direction,
60
+ isHorizontal
61
+ };
62
+ }
63
+ export {
64
+ useTouch
65
+ };
@@ -1,67 +1,55 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- import {
3
- init,
4
- handleTouchstart,
5
- handleTouchend,
6
- handleTouchmove,
7
- watchActionSheetVisible,
8
- calcSelector,
9
- close,
10
- confirm,
11
- styleOpt,
12
- statusOpt,
13
- computedConfirmDisabled,
14
- parseType
15
- } from "./index";
16
- import throttle from "../common/deps/throttle";
2
+ import { watchActionSheetVisible, close, confirm, columnStyle } from "./index";
3
+ import { usePicker } from "./usePicker";
17
4
  const api = [
18
5
  "state",
19
- "handleTouchstart",
20
- "handleTouchend",
21
- "throttledHandleTouchmove",
22
6
  "close",
23
7
  "confirm",
24
- "styleOpt",
25
- "statusOpt"
8
+ "columnsType",
9
+ "columnsList",
10
+ "columnFieldNames",
11
+ "changeHandler",
12
+ "defaultValues",
13
+ "isDisabled",
14
+ "selectedOptions",
15
+ "columnStyle"
26
16
  ];
27
- const renderless = (props, { reactive, computed, onBeforeMount, watch }, { emit, vm }) => {
17
+ const renderless = (props, { reactive, computed, watch, ref, toRefs }, { emit, vm }) => {
28
18
  const state = reactive({
29
19
  actionSheetVisible: false,
30
- visibleOptionCount: 5,
31
- selectorCount: 1,
32
- selector0: {},
33
- selector1: {},
34
- selector2: {},
35
- confirmDisabled: computed(() => api2.computedConfirmDisabled())
20
+ visibleOptionNum: 5
36
21
  });
22
+ const {
23
+ changeHandler,
24
+ defaultValues,
25
+ columnsList,
26
+ columnsType,
27
+ columnFieldNames,
28
+ selectedOptions,
29
+ setValue,
30
+ isDisabled
31
+ } = usePicker({ ref, reactive, watch, computed, toRefs, props, emit });
37
32
  const api2 = {
38
- state,
39
- styleOpt,
40
- statusOpt,
41
- handleTouchstart: handleTouchstart(state),
42
- handleTouchend: handleTouchend(state),
43
- watchActionSheetVisible: watchActionSheetVisible({ emit, state, vm }),
44
- close: close(state),
45
- computedConfirmDisabled: computedConfirmDisabled(state),
46
- parseType: parseType(props)
33
+ state
47
34
  };
48
35
  Object.assign(api2, {
49
- init: init({ api: api2, props, state }),
50
- throttledHandleTouchmove: throttle(20, handleTouchmove({ api: api2, props, state })),
51
- calcSelector: calcSelector(api2),
52
- confirm: confirm({ api: api2, emit, props, state, vm })
53
- });
54
- onBeforeMount(() => {
55
- api2.init();
36
+ close: close(state),
37
+ confirm: confirm({ api: api2, emit, props, state, defaultValues, selectedOptions, isDisabled, vm }),
38
+ watchActionSheetVisible: watchActionSheetVisible({ emit, api: api2, props }),
39
+ columnsType,
40
+ columnsList,
41
+ columnFieldNames,
42
+ changeHandler,
43
+ defaultValues,
44
+ selectedOptions,
45
+ setValue,
46
+ isDisabled,
47
+ columnStyle: columnStyle({ props, computed })
56
48
  });
57
49
  watch(
58
50
  () => props.visible,
59
51
  (value) => state.actionSheetVisible = value
60
52
  );
61
- watch(
62
- () => props.modelValue,
63
- (value) => api2.init(value)
64
- );
65
53
  watch(
66
54
  () => state.actionSheetVisible,
67
55
  (value) => api2.watchActionSheetVisible(value)
package/cell/vue.js CHANGED
@@ -3,7 +3,8 @@ const api = ["state"];
3
3
  const renderless = (props, { reactive, computed, inject }, { parent }) => {
4
4
  parent.tinyForm = parent.tinyForm || inject("form", null);
5
5
  const state = reactive({
6
- isDisplayOnly: computed(() => (parent.tinyForm || {}).displayOnly)
6
+ isDisplayOnly: computed(() => (parent.tinyForm || {}).displayOnly),
7
+ isDisabled: computed(() => props.disabled || (parent.tinyForm || {}).disabled)
7
8
  });
8
9
  const api2 = {
9
10
  state
@@ -30,8 +30,7 @@ const getBarDimAxis = (args) => {
30
30
  },
31
31
  show: axisVisible,
32
32
  axisTick: { show: true, alignWithLabel: true, lineStyle: { color: "#191919", opacity: 0.1, width: 2 } },
33
- axisLine: { show: true, lineStyle: { color: "#191919", opacity: 0.1, width: 2 } },
34
- axisPointer: { type: "shadow", z: 1, shadowStyle: { color: "#f5f5f5" } }
33
+ axisLine: { show: true, lineStyle: { color: "#191919", opacity: 0.1, width: 2 } }
35
34
  }));
36
35
  };
37
36
  const factoryFmt = ({ meaAxisType, i, digit }) => (val) => getFormated(val, meaAxisType[i], digit);
@@ -74,7 +73,7 @@ const getBarTooltip = (args) => {
74
73
  });
75
74
  return tplt.join("");
76
75
  };
77
- return { trigger: "axis", formatter };
76
+ return { trigger: "axis", formatter, axisPointer: { type: "shadow", z: 1, shadowStyle: { color: "#f5f5f5" } } };
78
77
  };
79
78
  const getValueData = (seriesTemp, dims) => {
80
79
  const max = Math.max(...dims);
@@ -1,47 +1,29 @@
1
1
  import "../../chunk-G2ADBYYC.js";
2
- const sf = () => ({ show: false });
2
+ const SF = () => ({ show: false });
3
3
  const DEFAULT_THEME = {
4
- categoryAxis: { axisLine: sf(), axisTick: sf(), splitLine: sf() },
5
- valueAxis: { axisLine: sf() },
4
+ categoryAxis: { axisLine: SF(), axisTick: SF(), splitLine: SF() },
5
+ valueAxis: { axisLine: SF() },
6
6
  line: { smooth: true },
7
7
  grid: { containLabel: true, left: 10, right: 10 }
8
8
  };
9
- let DEFAULT_COLORS = ["#19d4ae", "#5ab1ef", "#fa6e86", "#ffb980", "#0067a6", "#c4b4e4"];
10
- DEFAULT_COLORS = DEFAULT_COLORS.concat(["#d87a80", "#9cbbff", "#d9d0c7", "#87a997", "#d49ea2", "#5b4947", "#7ba3a8"]);
9
+ const DEFAULT_COLORS = [
10
+ "#19d4ae",
11
+ "#5ab1ef",
12
+ "#fa6e86",
13
+ "#ffb980",
14
+ "#0067a6",
15
+ "#c4b4e4",
16
+ "#d87a80",
17
+ "#9cbbff",
18
+ "#d9d0c7",
19
+ "#87a997",
20
+ "#d49ea2",
21
+ "#5b4947",
22
+ "#7ba3a8"
23
+ ];
11
24
  const HEAT_MAP_COLOR = ["#5990FD", "#2DA769", "#EEBA18", "#F43146"];
12
25
  const HEAT_BMAP_COLOR = ["blue", "blue", "green", "yellow", "red"];
13
- const SAAS_DEFAULT_COLORS_10 = [
14
- "#6d8ff0",
15
- "#00a874",
16
- "#bd72f0",
17
- "#54bcce",
18
- "#fdc000",
19
- "#9185f0",
20
- "#82dbb1",
21
- "#f46087",
22
- "#2070f3",
23
- "#ee8ddb"
24
- ];
25
- const SAAS_DEFAULT_COLORS_18 = [
26
- "#2070f3",
27
- "#50c291",
28
- "#bd72f0",
29
- "#54bcce",
30
- "#fdc000",
31
- "#6d8ff0",
32
- "#71c14c",
33
- "#87d5e5",
34
- "#9185f0",
35
- "#82dbb1",
36
- "#ada6ed",
37
- "#97da7e",
38
- "#f46087",
39
- "#ee8ddb",
40
- "#f09596",
41
- "#f36900",
42
- "#daa61b",
43
- "#efb9e3"
44
- ];
26
+ const HEAT_DEFAULT_COLOR = ["#fff", "#6D8FF0"];
45
27
  const _SAAS_DEFAULT_COLORS1 = ["#2070F3", "#55CCD9", "#715AF8", "#8AC8F3", "#EB74DF", "#87C859", "#D19F00"];
46
28
  const _SAAS_DEFAULT_COLORS2 = ["#36C18D", "#CB8EFB", "#ED448A", "#F7C45C", "#E7434A", "#2A8290", "#EE8DDB"];
47
29
  const _SAAS_DEFAULT_COLORS3 = ["#278661", "#4FA700", "#5CACFF", "#9185F0", "#B62BF7", "#26616B", "#F46465"];
@@ -108,21 +90,39 @@ const itemLabel = (seriesName, onlyLabel) => [
108
90
  `${onlyLabel ? "" : "margin-right:25px;"}`,
109
91
  `">${seriesName}</span>`
110
92
  ].join("");
111
- const itemContent = (content) => ['<span style="', "float:right;", "font-size:14px;", "color:#191919;", `">${content}</span>`].join("");
93
+ const itemContent = (content) => {
94
+ return ['<span style="', `float:right;`, `font-size:14px;`, `color:#191919;`, `">${content}</span>`].join("");
95
+ };
112
96
  const STATIC_PROPS = ["initOptions", "loading", "dataEmpty", "judgeWidth", "widthChangeDelay"];
113
- let ECHARTS_SETTINGS = ["grid", "dataZoom", "visualMap", "toolbox", "title", "legend", "xAxis"];
114
- ECHARTS_SETTINGS = ECHARTS_SETTINGS.concat(["yAxis", "radar", "tooltip", "axisPointer", "brush", "geo"]);
115
- ECHARTS_SETTINGS = ECHARTS_SETTINGS.concat(["timeline", "graphic", "series", "backgroundColor", "textStyle"]);
97
+ const ECHARTS_SETTINGS = [
98
+ "grid",
99
+ "dataZoom",
100
+ "visualMap",
101
+ "toolbox",
102
+ "title",
103
+ "legend",
104
+ "xAxis",
105
+ "yAxis",
106
+ "radar",
107
+ "tooltip",
108
+ "axisPointer",
109
+ "brush",
110
+ "geo",
111
+ "timeline",
112
+ "graphic",
113
+ "series",
114
+ "backgroundColor",
115
+ "textStyle"
116
+ ];
116
117
  export {
117
118
  DEFAULT_COLORS,
118
119
  DEFAULT_CONFIG,
119
120
  DEFAULT_THEME,
120
121
  ECHARTS_SETTINGS,
121
122
  HEAT_BMAP_COLOR,
123
+ HEAT_DEFAULT_COLOR,
122
124
  HEAT_MAP_COLOR,
123
125
  SAAS_DEFAULT_COLORS,
124
- SAAS_DEFAULT_COLORS_10,
125
- SAAS_DEFAULT_COLORS_18,
126
126
  SAAS_DEFAULT_SAME_COLORS,
127
127
  STATIC_PROPS,
128
128
  itemContent,
@@ -127,7 +127,7 @@ const dataHandler = ({ api, props, state, echartsLib, t, vm }) => () => {
127
127
  if (props.beforeConfig) {
128
128
  data = props.beforeConfig(data);
129
129
  }
130
- let options = api.chartHandler(columns, rows, props.settings, extra);
130
+ let options = api.chartHandler(columns, rows, props.settings, extra, props.extend);
131
131
  if (options) {
132
132
  if (typeof options.then === "function") {
133
133
  options.then(api.optionsHandler);
@@ -52,10 +52,10 @@ function getSeries(args) {
52
52
  axisLabel: { formatter: formatter2 },
53
53
  itemStyle: { color: "#6D8FF0" },
54
54
  pointer: getPoint(),
55
- axisLine: { roundCap: true },
55
+ axisLine: { roundCap: true, lineStyle: { width: 8, color: [[1, "rgba(25,25,25,0.1)"]] } },
56
56
  progress: { show: true, roundCap: true, width: 8, color: "#6D8FF0" },
57
57
  axisTick: { show: false },
58
- splitLine: { length: 8, distance: 0, lineStyle: { width: 1, color: "rgba(25,25,25,0.10)" } },
58
+ splitLine: { length: 8, distance: 0, lineStyle: { width: 1, color: "rgba(25,25,25,0.1)" } },
59
59
  title: { offsetCenter: [0, "25%"], color: "#191919", fontSize: 14 }
60
60
  };
61
61
  if (seriesItem) {
@@ -2,7 +2,7 @@ import {
2
2
  __spreadValues
3
3
  } from "../chunk-G2ADBYYC.js";
4
4
  import { getFormated, getBmap, getAmap, getMapJSON } from "../chart-core/deps/utils";
5
- import { HEAT_MAP_COLOR, itemPoint, itemLabel, itemContent } from "../chart-core/deps/constants";
5
+ import { HEAT_MAP_COLOR, HEAT_DEFAULT_COLOR, itemPoint, itemLabel, itemContent } from "../chart-core/deps/constants";
6
6
  const getAxisList = (rows, label) => {
7
7
  const result = [];
8
8
  rows.forEach((row) => !result.includes(row[label]) && result.push(row[label]));
@@ -20,7 +20,7 @@ const getData = (args) => {
20
20
  xIndex = innerXAxisList.indexOf(row[xDim]);
21
21
  extra = extraMetrics.map((m) => row[m] || "-");
22
22
  value = metrics ? row[metrics] : 1;
23
- return { value: [xIndex, yIndex, value].concat(extra), label: { show: true, color: "#191919" } };
23
+ return { value: [xIndex, yIndex, value].concat(extra) };
24
24
  });
25
25
  }
26
26
  return result;
@@ -37,7 +37,7 @@ let getAxis = (list, name, type) => ({
37
37
  zlevel: 1
38
38
  });
39
39
  const getVisualMap = (args) => {
40
- const { innerMin: min, innerMax: max, type, heatColor, series } = args;
40
+ const { innerMin: min, innerMax: max, type, heatColor, series, visualMapConfig } = args;
41
41
  let { extra } = {};
42
42
  if (type === "map") {
43
43
  extra = {};
@@ -47,8 +47,9 @@ const getVisualMap = (args) => {
47
47
  } else {
48
48
  extra = { dimension: 2 };
49
49
  }
50
- const defaultColor = type === "map" || type === "bmap" || type === "amap" ? HEAT_MAP_COLOR : ["#fff", "#6D8FF0"];
51
- return Object.assign(extra, {
50
+ const visualMapColor = visualMapConfig && visualMapConfig.color;
51
+ const defaultColor = type === "map" || type === "bmap" || type === "amap" ? HEAT_MAP_COLOR : visualMapColor || HEAT_DEFAULT_COLOR;
52
+ let result = Object.assign(extra, {
52
53
  min,
53
54
  max,
54
55
  calculable: true,
@@ -57,11 +58,16 @@ const getVisualMap = (args) => {
57
58
  orient: "vertical",
58
59
  align: "left",
59
60
  borderColor: "#6D8FF0",
60
- inverse: true,
61
- inRange: { color: heatColor || defaultColor }
61
+ inverse: true
62
62
  });
63
+ if (type !== "cartesian" || !visualMapColor) {
64
+ Object.assign(result, {
65
+ inRange: { color: heatColor || defaultColor }
66
+ });
67
+ }
68
+ return Object.assign(result, visualMapConfig);
63
69
  };
64
- const getSeries = (args) => [{ type: "heatmap", data: args.chartData }];
70
+ const getSeries = (args) => [{ type: "heatmap", data: args.chartData, label: { show: true, color: "#191919" } }];
65
71
  const getTooltip = (args) => {
66
72
  const { dataType, innerXAxisList, innerYAxisList, digit, extraMetrics, metrics } = args;
67
73
  function formatter({ color, data }) {
@@ -123,7 +129,7 @@ const getResult = (args) => {
123
129
  }
124
130
  return res;
125
131
  };
126
- const heatmap = (columns, rows, settings, extra) => {
132
+ const heatmap = (columns, rows, settings, extra, extend) => {
127
133
  const { type = "cartesian" } = settings;
128
134
  const { dimension = [columns[0], columns[1]] } = settings;
129
135
  const { dataType = "normal", min, max, digit, bmap, amap, geo, key, v = "2.0", url } = settings;
@@ -131,6 +137,7 @@ const heatmap = (columns, rows, settings, extra) => {
131
137
  const { heatColor, yAxisName, xAxisName, beforeRegisterMapOnce, specialAreas = {} } = settings;
132
138
  const { metrics = columns[2], mapURLProfix = "https://unpkg.com/echarts@3.6.2/map/json/" } = settings;
133
139
  const { tooltipVisible, echartsLib: echarts } = extra;
140
+ const visualMapConfig = extend && extend.visualMap;
134
141
  let { xAxisList: innerXAxisList, yAxisList: innerYAxisList } = settings;
135
142
  let { chartData = [], extraMetrics = [], mainColumn = dimension.concat([metrics]) } = {};
136
143
  columns.forEach((column) => !~mainColumn.indexOf(column) && extraMetrics.push(column));
@@ -145,7 +152,7 @@ const heatmap = (columns, rows, settings, extra) => {
145
152
  const xAxis = getAxis(innerXAxisList, xAxisName, "x");
146
153
  const yAxis = getAxis(innerYAxisList, yAxisName, "y");
147
154
  const series = getSeries({ chartData });
148
- const visualMap = getVisualMap({ innerMin, innerMax, type, heatColor, series });
155
+ const visualMap = getVisualMap({ innerMin, innerMax, type, heatColor, series, visualMapConfig });
149
156
  const tooltipParams = { dataType, innerXAxisList, innerYAxisList, digit, extraMetrics, metrics };
150
157
  const tooltip = tooltipVisible && getTooltip(tooltipParams);
151
158
  const options = { visualMap, series, grid: { left: 25, right: 80, width: "auto", height: "auto" } };