@opentiny/vue-renderless 3.6.8 → 3.8.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 (314) hide show
  1. package/action-sheet/index.js +28 -1
  2. package/action-sheet/vue.js +10 -4
  3. package/alert/index.js +24 -2
  4. package/alert/vue.js +15 -11
  5. package/amount/index.js +4 -4
  6. package/anchor/index.js +1 -1
  7. package/autocomplete/vue.js +3 -3
  8. package/autonavi-map/index.js +1 -1
  9. package/badge/vue.js +6 -6
  10. package/baidu-map/index.js +1 -1
  11. package/bulletin-board/index.js +1 -1
  12. package/calendar/index.js +2 -2
  13. package/calendar-bar/index.js +268 -0
  14. package/calendar-bar/vue.js +87 -0
  15. package/card/index.js +84 -0
  16. package/card/vue.js +70 -0
  17. package/card-group/index.js +16 -0
  18. package/card-group/vue.js +21 -0
  19. package/card-template/index.js +1 -1
  20. package/carousel/index.js +89 -2
  21. package/carousel/vue.js +14 -5
  22. package/carousel-item/index.js +8 -0
  23. package/carousel-item/vue.js +7 -3
  24. package/cascader/index.js +6 -6
  25. package/cascader/vue.js +3 -3
  26. package/cascader-menu/vue.js +2 -2
  27. package/cascader-panel/index.js +4 -4
  28. package/cascader-panel/node.js +4 -4
  29. package/cascader-panel/vue.js +2 -2
  30. package/cascader-select/index.js +179 -0
  31. package/cascader-select/vue.js +74 -0
  32. package/cell/vue.js +16 -0
  33. package/chart-bar/index.js +3 -3
  34. package/chart-boxplot/index.js +2 -2
  35. package/chart-candle/index.js +3 -3
  36. package/chart-core/deps/utils.js +7 -7
  37. package/chart-core/index.js +2 -2
  38. package/chart-funnel/index.js +3 -3
  39. package/chart-gauge/index.js +3 -3
  40. package/chart-graph/index.js +1 -1
  41. package/chart-heatmap/index.js +2 -2
  42. package/chart-line/index.js +3 -3
  43. package/chart-liquidfill/index.js +2 -2
  44. package/chart-map/index.js +3 -3
  45. package/chart-pie/index.js +3 -3
  46. package/chart-radar/index.js +3 -3
  47. package/chart-sankey/index.js +3 -3
  48. package/chart-scatter/index.js +4 -4
  49. package/chart-sunburst/index.js +1 -1
  50. package/chart-tree/index.js +2 -2
  51. package/chart-waterfall/index.js +3 -3
  52. package/chart-wordcloud/index.js +2 -2
  53. package/checkbox/index.js +21 -0
  54. package/checkbox/vue.js +16 -3
  55. package/checkbox-button/vue.js +1 -1
  56. package/collapse-item/vue.js +1 -1
  57. package/column-list-group/index.js +0 -0
  58. package/column-list-group/vue.js +14 -0
  59. package/column-list-item/index.js +50 -0
  60. package/column-list-item/vue.js +39 -0
  61. package/common/array.js +3 -3
  62. package/common/bigInt.js +5 -2
  63. package/common/dataset/index.js +3 -3
  64. package/common/date.js +2 -2
  65. package/common/deps/ResizeObserver.js +1 -1
  66. package/common/deps/clickoutside.js +1 -1
  67. package/common/deps/date-util.js +4 -4
  68. package/common/deps/date.js +2 -2
  69. package/common/deps/debounce.js +1 -1
  70. package/common/deps/dom.js +1 -1
  71. package/common/deps/fullscreen/apis.js +3 -3
  72. package/common/deps/fullscreen/screenfull.js +1 -1
  73. package/common/deps/infinite-scroll.js +176 -0
  74. package/common/deps/letter-only.js +1 -1
  75. package/common/deps/number-only.js +1 -1
  76. package/common/deps/observe-visibility.js +106 -0
  77. package/common/deps/popper.js +20 -22
  78. package/common/deps/popup-manager.js +2 -2
  79. package/common/deps/repeat-click.js +1 -1
  80. package/common/deps/resize-event.js +1 -1
  81. package/common/deps/tree-model/node.js +5 -5
  82. package/common/deps/tree-model/tree-store.js +3 -3
  83. package/common/deps/upload-ajax.js +2 -2
  84. package/common/deps/vue-popper.js +4 -4
  85. package/common/deps/vue-popup.js +4 -4
  86. package/common/index.js +2 -2
  87. package/common/object.js +1 -1
  88. package/common/runtime.js +24 -24
  89. package/common/string.js +23 -4
  90. package/common/validate/rules/range.js +2 -2
  91. package/common/validate/rules/required.js +1 -1
  92. package/common/validate/rules/type.js +3 -3
  93. package/common/validate/schema.js +1 -1
  94. package/common/validate/util.js +1 -1
  95. package/common/validate/validations/array.js +1 -1
  96. package/common/validate/validations/date.js +1 -1
  97. package/common/validate/validations/enum.js +1 -1
  98. package/common/validate/validations/float.js +1 -1
  99. package/common/validate/validations/integer.js +1 -1
  100. package/common/validate/validations/method.js +1 -1
  101. package/common/validate/validations/number.js +1 -1
  102. package/common/validate/validations/pattern.js +1 -1
  103. package/common/validate/validations/string.js +1 -1
  104. package/common/validate/validations/type.js +1 -1
  105. package/container/index.js +1 -1
  106. package/crop/index.js +2 -2
  107. package/currency/index.js +2 -2
  108. package/date-panel/index.js +7 -7
  109. package/date-panel/vue.js +3 -2
  110. package/date-picker-mobile/index.js +250 -0
  111. package/date-picker-mobile/vue.js +86 -0
  112. package/date-range/index.js +1 -1
  113. package/date-range/vue.js +1 -1
  114. package/date-table/index.js +3 -3
  115. package/date-table/vue.js +1 -1
  116. package/dialog-box/index.js +6 -4
  117. package/dialog-box/vue.js +1 -1
  118. package/dialog-select/index.js +345 -0
  119. package/dialog-select/vue.js +110 -0
  120. package/drawer/index.js +83 -0
  121. package/drawer/vue.js +51 -0
  122. package/drop-times/index.js +1 -1
  123. package/dropdown/index.js +2 -2
  124. package/dropdown/vue.js +1 -1
  125. package/dropdown-item/index.js +1 -1
  126. package/dropdown-item/mf.js +79 -0
  127. package/dropdown-menu/index.js +30 -1
  128. package/dropdown-menu/vue.js +17 -7
  129. package/dynamic-scroller/index.js +117 -0
  130. package/dynamic-scroller/vue.js +88 -0
  131. package/dynamic-scroller-item/index.js +147 -0
  132. package/dynamic-scroller-item/vue.js +92 -0
  133. package/espace/index.js +1 -1
  134. package/espace/vue.js +1 -1
  135. package/exception/vue.js +3 -1
  136. package/fall-menu/index.js +4 -4
  137. package/file-upload/index.js +872 -408
  138. package/file-upload/vue.js +87 -36
  139. package/filter/index.js +131 -0
  140. package/filter/tag-group.js +43 -0
  141. package/filter/vue.js +73 -0
  142. package/filter-bar/index.js +9 -0
  143. package/filter-bar/vue.js +16 -0
  144. package/filter-box/index.js +17 -0
  145. package/filter-box/vue.js +19 -0
  146. package/filter-panel/index.js +42 -0
  147. package/filter-panel/vue.js +33 -0
  148. package/floatbar/index.js +1 -1
  149. package/flowchart/index.js +721 -0
  150. package/flowchart/vue.js +81 -0
  151. package/form/index.js +15 -1
  152. package/form/vue.js +10 -4
  153. package/form-item/index.js +46 -6
  154. package/form-item/vue.js +27 -3
  155. package/fullscreen/index.js +1 -1
  156. package/fullscreen/vue.js +1 -1
  157. package/grid/plugins/export.js +2 -2
  158. package/grid/plugins/exportExcel.js +2 -2
  159. package/grid/plugins/resize.js +1 -1
  160. package/grid/static/base/helperEqualCompare.js +1 -1
  161. package/grid/static/base/isPlainObject.js +1 -1
  162. package/grid/utils/common.js +3 -3
  163. package/grid/utils/dom.js +3 -3
  164. package/grid/utils/event.js +2 -2
  165. package/guide/index.js +168 -0
  166. package/guide/vue.js +36 -0
  167. package/hrapprover/index.js +1 -1
  168. package/image/index.js +8 -4
  169. package/image/vue.js +12 -6
  170. package/image-viewer/index.js +3 -3
  171. package/image-viewer/vue.js +16 -6
  172. package/input/index.js +34 -1
  173. package/input/vue.js +22 -6
  174. package/ip-address/index.js +1 -1
  175. package/ip-address/vue.js +1 -1
  176. package/link-menu/index.js +2 -2
  177. package/link-menu/vue.js +2 -2
  178. package/loading/index.js +2 -2
  179. package/loading/vue.js +2 -1
  180. package/locales/index.js +1 -1
  181. package/logout/index.js +1 -1
  182. package/milestone/index.js +5 -1
  183. package/modal/index.js +68 -39
  184. package/modal/vue.js +15 -12
  185. package/month-range/index.js +1 -1
  186. package/month-range/vue.js +1 -1
  187. package/month-table/index.js +5 -5
  188. package/month-table/vue.js +1 -1
  189. package/multi-select/index.js +5 -2
  190. package/multi-select/vue.js +4 -5
  191. package/nav-menu/index.js +6 -6
  192. package/notify/index.js +3 -3
  193. package/numeric/index.js +15 -5
  194. package/numeric/vue.js +15 -6
  195. package/option/index.js +1 -1
  196. package/package.json +2 -1
  197. package/pager-item/index.js +1 -1
  198. package/panel/index.js +1 -1
  199. package/picker/index.js +7 -7
  200. package/picker/vue.js +1 -1
  201. package/picker-column/index.js +1 -1
  202. package/popconfirm/index.js +25 -0
  203. package/popconfirm/vue.js +22 -0
  204. package/popeditor/index.js +7 -7
  205. package/popeditor/vue.js +2 -2
  206. package/popover/index.js +11 -3
  207. package/popover/vue.js +33 -10
  208. package/popup/index.js +4 -4
  209. package/pull-refresh/index.js +8 -11
  210. package/pull-refresh/vue.js +7 -7
  211. package/radio/index.js +17 -0
  212. package/radio/vue.js +18 -3
  213. package/radio-button/index.js +8 -0
  214. package/radio-button/vue.js +19 -4
  215. package/radio-group/index.js +1 -1
  216. package/radio-group/vue.js +5 -2
  217. package/rate/index.js +4 -2
  218. package/rate/vue.js +1 -1
  219. package/record/index.js +190 -0
  220. package/record/vue.js +44 -0
  221. package/recycle-scroller/index.js +470 -0
  222. package/recycle-scroller/vue.js +135 -0
  223. package/river/index.js +371 -0
  224. package/river/river.js +352 -0
  225. package/river/vue.js +77 -0
  226. package/roles/index.js +1 -1
  227. package/scrollbar/vue-bar.js +1 -1
  228. package/scrollbar/vue.js +1 -1
  229. package/search/index.js +3 -3
  230. package/select/index.js +17 -14
  231. package/select/vue.js +14 -8
  232. package/select-dropdown/vue.js +1 -1
  233. package/select-mobile/index.js +111 -0
  234. package/select-mobile/vue.js +58 -0
  235. package/select-view/index.js +170 -0
  236. package/select-view/vue.js +82 -0
  237. package/selected-box/index.js +216 -0
  238. package/selected-box/vue.js +98 -0
  239. package/slide-bar/index.js +1 -1
  240. package/slider/index.js +49 -4
  241. package/slider/vue.js +15 -4
  242. package/split/vue.js +1 -1
  243. package/standard-list-item/index.js +18 -0
  244. package/standard-list-item/vue.js +22 -0
  245. package/steps/index.js +30 -0
  246. package/steps/slide-bar.js +122 -0
  247. package/steps/vue.js +15 -3
  248. package/switch/index.js +1 -1
  249. package/switch/vue.js +2 -1
  250. package/tab-bar/index.js +2 -2
  251. package/tab-item/index.js +2 -2
  252. package/tab-item/vue.js +1 -1
  253. package/tab-item-mf/index.js +0 -0
  254. package/tab-item-mf/vue.js +16 -0
  255. package/tab-nav/index.js +78 -4
  256. package/tab-nav/vue.js +11 -3
  257. package/tabbar-item/index.js +1 -1
  258. package/tabbar-item/vue.js +1 -1
  259. package/tabs/index.js +8 -9
  260. package/tabs/vue.js +1 -1
  261. package/tabs-mf/index.js +109 -0
  262. package/tabs-mf/vue-bar.js +49 -0
  263. package/tabs-mf/vue-nav-item.js +22 -0
  264. package/tabs-mf/vue-nav.js +13 -0
  265. package/tabs-mf/vue.js +45 -0
  266. package/tabs-mf/wheel.js +71 -0
  267. package/tag/index.js +8 -2
  268. package/tag/vue.js +13 -5
  269. package/tag-group/index.js +24 -0
  270. package/tag-group/vue.js +29 -0
  271. package/tall-storage/index.js +1 -1
  272. package/tall-storage/vue.js +1 -1
  273. package/time/index.js +1 -1
  274. package/time/vue.js +2 -2
  275. package/time-line/index.js +28 -7
  276. package/time-line/vue.js +9 -4
  277. package/time-panel/index.js +2 -2
  278. package/time-panel/vue.js +1 -1
  279. package/time-picker-mobile/index.js +30 -0
  280. package/time-picker-mobile/vue.js +30 -0
  281. package/time-range/index.js +1 -1
  282. package/time-range/vue.js +1 -1
  283. package/time-spinner/index.js +2 -2
  284. package/time-spinner/vue.js +1 -1
  285. package/toggle-menu/index.js +2 -2
  286. package/toggle-menu/vue.js +1 -1
  287. package/tooltip/index.js +30 -3
  288. package/tooltip/vue.js +33 -12
  289. package/top-box/index.js +3 -3
  290. package/transfer/index.js +1 -1
  291. package/transfer-panel/index.js +2 -2
  292. package/tree/index.js +6 -6
  293. package/tree/vue.js +1 -1
  294. package/tree-node/index.js +1 -1
  295. package/upload/index.js +1 -1
  296. package/upload/vue.js +2 -2
  297. package/upload-dragger/index.js +5 -1
  298. package/upload-dragger/vue.js +9 -3
  299. package/upload-list/index.js +158 -8
  300. package/upload-list/vue.js +77 -25
  301. package/user/index.js +86 -70
  302. package/user/vue.js +15 -5
  303. package/user-account/vue.js +1 -1
  304. package/user-contact/index.js +49 -3
  305. package/user-contact/vue.js +17 -8
  306. package/user-head-group/vue.js +17 -0
  307. package/user-link/index.js +10 -2
  308. package/user-link/vue.js +11 -6
  309. package/wheel/index.js +1 -1
  310. package/wizard/index.js +3 -3
  311. package/year-range/index.js +125 -0
  312. package/year-range/vue.js +88 -0
  313. package/year-table/index.js +175 -11
  314. package/year-table/vue.js +17 -5
@@ -0,0 +1,345 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import { arrayEach, findIndexOf, find } from "../grid/static";
3
+ const computedGridColumns = (props) => () => {
4
+ const { popseletor, gridOp, multi, valueField, textField } = props;
5
+ const { columns = [] } = gridOp || {};
6
+ let gridColumns = [];
7
+ if (popseletor === "grid") {
8
+ const operColType = multi ? "selection" : "radio";
9
+ if (columns.length) {
10
+ const operColIndex = findIndexOf(columns, (column) => column.type === operColType);
11
+ gridColumns = columns.slice(0);
12
+ if (!~operColIndex) {
13
+ gridColumns = [{ type: operColType, width: 60 }, ...columns.slice(0)];
14
+ }
15
+ } else {
16
+ gridColumns = [
17
+ { type: operColType, width: 60 },
18
+ { field: valueField, title: String(valueField).toUpperCase() },
19
+ { field: textField, title: String(textField).toUpperCase() }
20
+ ];
21
+ }
22
+ }
23
+ return gridColumns;
24
+ };
25
+ const queryGridData = ({ api, props, state }) => () => {
26
+ const { popseletor, remoteSearch } = props;
27
+ if (popseletor === "grid") {
28
+ if (typeof remoteSearch === "function") {
29
+ state.multiGridStore.loading = true;
30
+ remoteSearch().then(() => {
31
+ state.multiGridStore.loading = false;
32
+ api.setChecked();
33
+ }).finally(() => {
34
+ state.multiGridStore.loading = false;
35
+ state.multiGridStore.inited = true;
36
+ });
37
+ } else {
38
+ state.multiGridStore.inited = true;
39
+ }
40
+ }
41
+ };
42
+ const multiGridSelectAll = ({ api, props, state }) => ({ selection, checked }) => {
43
+ if (checked) {
44
+ arrayEach(selection, (item) => {
45
+ const index = findIndexOf(state.selectedValues, (val) => val == item[props.valueField]);
46
+ if (!~index) {
47
+ state.selectedValues = [...state.selectedValues, item[props.valueField]];
48
+ state.selectedDatas = [...state.selectedDatas, item];
49
+ state.selectedChanged = true;
50
+ }
51
+ });
52
+ } else {
53
+ state.selectedValues = [];
54
+ state.selectedDatas = [];
55
+ state.selectedChanged = true;
56
+ }
57
+ api.selectedBoxInit();
58
+ };
59
+ const multiGridSelectChange = ({ api, props, state }) => ({ row, checked }) => {
60
+ const index = findIndexOf(state.selectedValues, (val) => val == row[props.valueField]);
61
+ if (checked) {
62
+ if (!~index) {
63
+ state.selectedValues = [...state.selectedValues, row[props.valueField]];
64
+ state.selectedDatas = [...state.selectedDatas, row];
65
+ state.selectedChanged = true;
66
+ }
67
+ } else {
68
+ if (~index) {
69
+ state.selectedValues = [...state.selectedValues.slice(0, index), ...state.selectedValues.slice(index + 1)];
70
+ state.selectedDatas = [...state.selectedDatas.slice(0, index), ...state.selectedDatas.slice(index + 1)];
71
+ state.selectedChanged = true;
72
+ }
73
+ }
74
+ api.selectedBoxInit();
75
+ };
76
+ const selectedBoxInit = ({ props, vm, nextTick }) => () => {
77
+ const { multi, showSelectedBox } = props;
78
+ if (multi && showSelectedBox && vm.$refs.selectedBox) {
79
+ nextTick(() => {
80
+ vm.$refs.selectedBox.init();
81
+ });
82
+ }
83
+ };
84
+ const selectedBoxClear = ({ props, state, vm }) => () => {
85
+ const { multi, popseletor } = props;
86
+ if (multi && popseletor === "grid") {
87
+ vm.$refs.multiGrid.clearSelection();
88
+ }
89
+ if (multi && popseletor === "tree") {
90
+ arrayEach(state.selectedValues, (value) => vm.$refs.multiTree.setCheckedByNodeKey(value, false));
91
+ }
92
+ state.selectedValues = [];
93
+ state.selectedDatas = [];
94
+ state.selectedChanged = true;
95
+ };
96
+ const selectedBoxDelete = ({ props, state, vm }) => ({ option: row }) => {
97
+ const { multi, popseletor } = props;
98
+ if (multi && popseletor === "grid") {
99
+ vm.$refs.multiGrid.setSelection(
100
+ find(vm.$refs.multiGrid.$refs.tinyTable.selection, (item) => item[props.valueField] === row[props.valueField]),
101
+ false
102
+ );
103
+ }
104
+ if (multi && popseletor === "tree") {
105
+ vm.$refs.multiTree.setCheckedByNodeKey(row[props.valueField], false);
106
+ }
107
+ const index = findIndexOf(state.selectedValues, (val) => val == row[props.valueField]);
108
+ if (~index) {
109
+ state.selectedValues = [...state.selectedValues.slice(0, index), ...state.selectedValues.slice(index + 1)];
110
+ state.selectedDatas = [...state.selectedDatas.slice(0, index), ...state.selectedDatas.slice(index + 1)];
111
+ state.selectedChanged = true;
112
+ }
113
+ };
114
+ const selectedBoxDrag = ({ props, state }) => ({ state: { select } }) => {
115
+ if (select && select.length) {
116
+ const datas = select.map((opt) => String(opt[props.valueField])).map((strVal) => state.selectedDatas.find((opt) => strVal === String(opt[props.valueField])));
117
+ const values = datas.map((opt) => opt[props.valueField]);
118
+ state.selectedDatas = datas;
119
+ state.selectedValues = values;
120
+ state.selectedChanged = true;
121
+ }
122
+ };
123
+ const doMultiTreeFilter = ({ props, state, nextTick, vm }) => () => {
124
+ const { popseletor, treeOp = {} } = props;
125
+ if (popseletor === "tree") {
126
+ if (state.multiTreeStore.filterText) {
127
+ if (treeOp.queryPidsBySearch) {
128
+ treeOp.queryPidsBySearch(state.multiTreeStore.filterText, (expandedKeys) => {
129
+ if (state.multiTreeStore.expandedKeys && state.multiTreeStore.expandedKeys.length) {
130
+ state.multiTreeStore.lastValidExpandedKeys = state.multiTreeStore.expandedKeys;
131
+ }
132
+ state.multiTreeStore.viewType = "plain";
133
+ state.multiTreeStore.expandedKeys = expandedKeys;
134
+ });
135
+ }
136
+ } else {
137
+ state.multiTreeStore.viewType = "tree";
138
+ if (state.multiTreeStore.expandedKeys && state.multiTreeStore.expandedKeys.length) {
139
+ const currentValidExpandedKeys = state.multiTreeStore.expandedKeys;
140
+ state.multiTreeStore.expandedKeys = [];
141
+ nextTick(() => {
142
+ state.multiTreeStore.expandedKeys = currentValidExpandedKeys;
143
+ });
144
+ } else {
145
+ state.multiTreeStore.expandedKeys = state.multiTreeStore.lastValidExpandedKeys;
146
+ }
147
+ vm.$refs.multiTree.filter("");
148
+ }
149
+ }
150
+ };
151
+ const multiTreeAfterLoad = ({ api, props, state, vm }) => () => {
152
+ const { popseletor, treeOp = {}, valueField } = props;
153
+ const { lookupStore } = state;
154
+ if (popseletor === "tree") {
155
+ vm.$refs.multiTree.filter(state.multiTreeStore.filterText);
156
+ if (state.multiTreeStore.inited) {
157
+ state.multiTreeStore.checkedKeys = state.selectedValues;
158
+ } else {
159
+ const checkedKeys = lookupStore.datas.map((row) => row[valueField]);
160
+ state.multiTreeStore.checkedKeys = checkedKeys;
161
+ if (treeOp.queryPidsByIds && checkedKeys.length) {
162
+ treeOp.queryPidsByIds(checkedKeys, (expandedKeys) => {
163
+ state.multiTreeStore.expandedKeys = expandedKeys.slice(0);
164
+ api.setChecked();
165
+ state.multiTreeStore.inited = true;
166
+ });
167
+ } else {
168
+ api.setChecked();
169
+ state.multiTreeStore.inited = true;
170
+ }
171
+ }
172
+ }
173
+ };
174
+ const multiTreeFilterNode = (props) => (value, data) => {
175
+ const { popseletor } = props;
176
+ if (popseletor === "tree") {
177
+ if (!value)
178
+ return true;
179
+ return ~data.label.indexOf(value);
180
+ }
181
+ return true;
182
+ };
183
+ const multiTreeFilterPlain = ({ api, props, state }) => (data) => {
184
+ const { popseletor } = props;
185
+ if (popseletor === "tree") {
186
+ return api.multiTreeFilterNode(state.multiTreeStore.filterText, data);
187
+ }
188
+ return true;
189
+ };
190
+ const multiTreeLeavePlain = ({ props, state }) => (plainNode) => {
191
+ const { popseletor } = props;
192
+ if (popseletor === "tree") {
193
+ state.multiTreeStore.viewType = "tree";
194
+ state.multiTreeStore.expandedKeys = plainNode.parentNodeKeys;
195
+ state.multiTreeStore.highlight = plainNode.nodeKey;
196
+ }
197
+ };
198
+ const getTreeSelect = ({ vm, props }) => {
199
+ const { selectedBoxOp } = props;
200
+ const { pkField = "id", showField = [] } = (selectedBoxOp || {}).config || {};
201
+ const keyNames = [pkField, ...showField];
202
+ const checkedNodes = vm.$refs.multiTree.state.store.getCheckedNodes();
203
+ const { nodes: plainNodes } = vm.$refs.multiTree.state.plainNodeStore;
204
+ const datas = [];
205
+ arrayEach(checkedNodes, (item) => {
206
+ const plainNode = find(plainNodes, (plainNode2) => plainNode2.node.data[props.valueField] === item[props.valueField]);
207
+ const tmp = { _$title: plainNode.title, _$auxi: plainNode.auxi };
208
+ arrayEach(keyNames, (keyName) => tmp[keyName] = item[keyName]);
209
+ datas.push(tmp);
210
+ });
211
+ return datas;
212
+ };
213
+ const getTreeRadio = (vm) => {
214
+ const { nodes: plainNodes } = vm.$refs.multiTree.state.plainNodeStore;
215
+ const currentRadio = vm.$refs.multiTree.state.currentRadio;
216
+ const plainNode = find(plainNodes, (plainNode2) => plainNode2.node.id === currentRadio.value);
217
+ return [plainNode.node.data];
218
+ };
219
+ const multiTreeCheck = ({ api, props, state, vm, nextTick }) => () => {
220
+ const { multi, popseletor } = props;
221
+ if (popseletor === "tree") {
222
+ nextTick(() => {
223
+ const datas = multi ? getTreeSelect({ vm, props }) : getTreeRadio(vm);
224
+ const values = datas.map((item) => item[props.valueField]);
225
+ state.selectedDatas = datas;
226
+ state.selectedValues = values;
227
+ state.selectedChanged = true;
228
+ multi && api.selectedBoxInit();
229
+ });
230
+ }
231
+ };
232
+ const emitChange = ({ props, state, emit }) => () => {
233
+ if (state.selectedChanged) {
234
+ const { valueField, textField } = props;
235
+ const { selectedDatas } = state;
236
+ const texts = [];
237
+ const values = [];
238
+ arrayEach(selectedDatas, (item) => {
239
+ texts.push(item[textField]);
240
+ values.push(item[valueField]);
241
+ });
242
+ emit("change", values, texts, selectedDatas);
243
+ state.selectedChanged = false;
244
+ }
245
+ };
246
+ const onFooterCancel = ({ api, props }) => () => {
247
+ if (!props.beforeClose || props.beforeClose("cancel")) {
248
+ api.emitClose();
249
+ }
250
+ };
251
+ const onFooterConfirm = ({ api, props }) => () => {
252
+ if (!props.beforeClose || props.beforeClose("confirm")) {
253
+ api.emitChange();
254
+ api.emitClose();
255
+ }
256
+ };
257
+ const emitClose = (emit) => () => emit("update:visible", false);
258
+ const setChecked = ({ api, props, state }) => () => {
259
+ const { multi, popseletor, valueField } = props;
260
+ const { multiGridStore, multiTreeStore, lookupStore } = state;
261
+ if (popseletor === "grid" && !multiGridStore.inited || popseletor === "tree" && !multiTreeStore.inited) {
262
+ if (lookupStore.datas && lookupStore.datas.length) {
263
+ state.selectedDatas = lookupStore.datas;
264
+ state.selectedValues = lookupStore.datas.map((row) => row[valueField]);
265
+ } else {
266
+ state.selectedDatas = [];
267
+ state.selectedValues = [];
268
+ }
269
+ multi && api.selectedBoxInit();
270
+ }
271
+ };
272
+ const computedConfig = ({ props, state }) => () => {
273
+ const { multi, popseletor, gridOp } = props;
274
+ const { selectConfig = {}, radioConfig = {} } = gridOp || {};
275
+ const { selectedValues } = state;
276
+ let config = {};
277
+ if (popseletor === "grid") {
278
+ if (multi) {
279
+ config = Object.assign(config, selectConfig, { checkRowKeys: selectedValues });
280
+ } else {
281
+ config = Object.assign(config, radioConfig, { checkRowKey: selectedValues[0] });
282
+ }
283
+ }
284
+ return config;
285
+ };
286
+ const doAutoLookup = ({ props, state, emit }) => () => {
287
+ const { autoLookup, lookupMethod, multi, popseletor, valueField, textField } = props;
288
+ if (autoLookup && lookupMethod) {
289
+ let rowKeys = [];
290
+ if (popseletor === "grid") {
291
+ const { gridOp } = props;
292
+ const { selectConfig, radioConfig } = gridOp || {};
293
+ const { checkRowKeys = [] } = selectConfig || {};
294
+ const { checkRowKey = "" } = radioConfig || {};
295
+ rowKeys = multi ? checkRowKeys : [checkRowKey];
296
+ }
297
+ if (popseletor === "tree") {
298
+ const { treeOp } = props;
299
+ const { defaultCheckedKeys = [] } = treeOp || {};
300
+ rowKeys = defaultCheckedKeys;
301
+ }
302
+ lookupMethod(rowKeys).then((datas) => {
303
+ state.lookupStore.datas = datas;
304
+ const values = datas.map((row) => row[valueField]);
305
+ const texts = datas.map((row) => row[textField]);
306
+ emit("change", values, texts, datas);
307
+ });
308
+ }
309
+ };
310
+ const multiTreeRadio = ({ api, props }) => () => {
311
+ const { multi, popseletor } = props;
312
+ if (!multi && popseletor === "tree") {
313
+ api.multiTreeCheck();
314
+ }
315
+ };
316
+ const multiGridRadioChange = ({ props, state }) => ({ row }) => {
317
+ state.selectedValues = [row[props.valueField]];
318
+ state.selectedDatas = [row];
319
+ state.selectedChanged = true;
320
+ };
321
+ export {
322
+ computedConfig,
323
+ computedGridColumns,
324
+ doAutoLookup,
325
+ doMultiTreeFilter,
326
+ emitChange,
327
+ emitClose,
328
+ multiGridRadioChange,
329
+ multiGridSelectAll,
330
+ multiGridSelectChange,
331
+ multiTreeAfterLoad,
332
+ multiTreeCheck,
333
+ multiTreeFilterNode,
334
+ multiTreeFilterPlain,
335
+ multiTreeLeavePlain,
336
+ multiTreeRadio,
337
+ onFooterCancel,
338
+ onFooterConfirm,
339
+ queryGridData,
340
+ selectedBoxClear,
341
+ selectedBoxDelete,
342
+ selectedBoxDrag,
343
+ selectedBoxInit,
344
+ setChecked
345
+ };
@@ -0,0 +1,110 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import {
3
+ computedGridColumns,
4
+ queryGridData,
5
+ multiGridSelectAll,
6
+ multiGridSelectChange,
7
+ selectedBoxInit,
8
+ selectedBoxClear,
9
+ selectedBoxDelete,
10
+ selectedBoxDrag,
11
+ doMultiTreeFilter,
12
+ multiTreeAfterLoad,
13
+ multiTreeFilterNode,
14
+ multiTreeFilterPlain,
15
+ multiTreeLeavePlain,
16
+ multiTreeCheck,
17
+ emitChange,
18
+ onFooterCancel,
19
+ onFooterConfirm,
20
+ emitClose,
21
+ setChecked,
22
+ computedConfig,
23
+ doAutoLookup,
24
+ multiTreeRadio,
25
+ multiGridRadioChange
26
+ } from "./index";
27
+ const api = [
28
+ "state",
29
+ "queryGridData",
30
+ "multiGridSelectAll",
31
+ "multiGridSelectChange",
32
+ "selectedBoxClear",
33
+ "selectedBoxDelete",
34
+ "selectedBoxDrag",
35
+ "doMultiTreeFilter",
36
+ "multiTreeAfterLoad",
37
+ "multiTreeFilterNode",
38
+ "multiTreeFilterPlain",
39
+ "multiTreeLeavePlain",
40
+ "multiTreeCheck",
41
+ "emitChange",
42
+ "onFooterCancel",
43
+ "onFooterConfirm",
44
+ "multiTreeRadio",
45
+ "multiGridRadioChange"
46
+ ];
47
+ const renderless = (props, { reactive, computed, watch }, { vm, nextTick, emit }) => {
48
+ const state = reactive({
49
+ splitValue: props.multi ? 0.7 : 1,
50
+ gridColumns: computed(() => api2.computedGridColumns()),
51
+ selectedChanged: false,
52
+ selectedDatas: [],
53
+ selectedValues: [],
54
+ multiGridStore: {
55
+ selectConfig: computed(() => api2.computedConfig()),
56
+ radioConfig: computed(() => api2.computedConfig()),
57
+ inited: false,
58
+ loading: false
59
+ },
60
+ multiTreeStore: {
61
+ viewType: "tree",
62
+ expandedKeys: [],
63
+ checkedKeys: [],
64
+ highlight: null,
65
+ filterText: "",
66
+ inited: false
67
+ },
68
+ lookupStore: {
69
+ datas: []
70
+ }
71
+ });
72
+ const api2 = {
73
+ state,
74
+ computedGridColumns: computedGridColumns(props),
75
+ selectedBoxInit: selectedBoxInit({ props, vm, nextTick }),
76
+ selectedBoxClear: selectedBoxClear({ props, state, vm }),
77
+ selectedBoxDelete: selectedBoxDelete({ props, state, vm }),
78
+ selectedBoxDrag: selectedBoxDrag({ props, state }),
79
+ doMultiTreeFilter: doMultiTreeFilter({ props, state, nextTick, vm }),
80
+ multiTreeFilterNode: multiTreeFilterNode(props),
81
+ multiTreeLeavePlain: multiTreeLeavePlain({ props, state }),
82
+ emitChange: emitChange({ props, state, emit }),
83
+ emitClose: emitClose(emit),
84
+ computedConfig: computedConfig({ props, state }),
85
+ doAutoLookup: doAutoLookup({ props, state, emit }),
86
+ multiGridRadioChange: multiGridRadioChange({ props, state })
87
+ };
88
+ Object.assign(api2, {
89
+ multiGridSelectAll: multiGridSelectAll({ api: api2, props, state }),
90
+ multiGridSelectChange: multiGridSelectChange({ api: api2, props, state }),
91
+ multiTreeAfterLoad: multiTreeAfterLoad({ api: api2, props, state, vm }),
92
+ multiTreeCheck: multiTreeCheck({ api: api2, props, state, vm, nextTick }),
93
+ multiTreeFilterPlain: multiTreeFilterPlain({ api: api2, props, state }),
94
+ onFooterCancel: onFooterCancel({ api: api2, props }),
95
+ onFooterConfirm: onFooterConfirm({ api: api2, props }),
96
+ queryGridData: queryGridData({ api: api2, props, state }),
97
+ setChecked: setChecked({ api: api2, props, state }),
98
+ multiTreeRadio: multiTreeRadio({ api: api2, props })
99
+ });
100
+ watch(
101
+ () => props.visible,
102
+ (value) => value && !state.multiGridStore.inited && api2.queryGridData()
103
+ );
104
+ api2.doAutoLookup();
105
+ return api2;
106
+ };
107
+ export {
108
+ api,
109
+ renderless
110
+ };
@@ -0,0 +1,83 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import debounce from "../common/deps/debounce";
3
+ const close = ({ emit, state }) => () => {
4
+ state.toggle = false;
5
+ emit("close", state);
6
+ };
7
+ const watchVisible = ({ state }) => (bool) => {
8
+ setTimeout(() => {
9
+ state.toggle = bool;
10
+ }, 0);
11
+ };
12
+ const watchToggle = ({ emit }) => (bool) => {
13
+ setTimeout(() => {
14
+ emit("update:visible", bool);
15
+ }, 200);
16
+ };
17
+ const confirm = ({ emit, state }) => () => {
18
+ state.toggle = false;
19
+ emit("confirm", state);
20
+ };
21
+ const mousedown = ({ state, vm }) => (event2) => {
22
+ event2.preventDefault();
23
+ const touch = event2.touches ? event2.touches[0] : event2;
24
+ const drawerBox = vm.$refs.drawerBox;
25
+ state.dragEvent.isDrag = true;
26
+ state.dragEvent.x = touch.clientX;
27
+ state.dragEvent.offsetWidth = drawerBox.offsetWidth;
28
+ };
29
+ const mousemove = ({ state, props }) => debounce(1, (event2) => {
30
+ if (!state.dragEvent.isDrag) {
31
+ return;
32
+ }
33
+ event2.preventDefault();
34
+ const { placement } = props;
35
+ const {
36
+ dragEvent: { x, offsetWidth }
37
+ } = state;
38
+ const { touches, targetTouches, changedTouches } = event2;
39
+ const touch = touches && touches[0] || targetTouches && targetTouches[0] || changedTouches && changedTouches[0];
40
+ const { clientX } = touch || event2;
41
+ const offsetX = clientX - x;
42
+ if (placement === "left") {
43
+ state.width = offsetWidth + offsetX;
44
+ } else if (placement === "right") {
45
+ state.width = offsetWidth - offsetX;
46
+ }
47
+ });
48
+ const mouseup = ({ state }) => () => {
49
+ if (!state.dragEvent.isDrag) {
50
+ return;
51
+ }
52
+ event.preventDefault();
53
+ state.dragEvent.isDrag = false;
54
+ };
55
+ const addDragEvent = ({ api, vm }) => () => {
56
+ const el = vm.$refs.dragBar;
57
+ el.addEventListener("mousedown", api.mousedown);
58
+ document.addEventListener("mousemove", api.mousemove);
59
+ document.addEventListener("mouseup", api.mouseup);
60
+ el.addEventListener("touchstart", api.mousedown);
61
+ el.addEventListener("touchmove", api.mousemove);
62
+ el.addEventListener("touchend", api.mouseup);
63
+ };
64
+ const removeDragEvent = ({ api, vm }) => () => {
65
+ const el = vm.$refs.dragBar;
66
+ el.removeEventListener("mousedown", api.mousedown);
67
+ document.removeEventListener("mousemove", api.mousemove);
68
+ document.removeEventListener("mouseup", api.mouseup);
69
+ el.removeEventListener("touchstart", api.mousedown);
70
+ el.removeEventListener("touchmove", api.mousemove);
71
+ el.removeEventListener("touchend", api.mouseup);
72
+ };
73
+ export {
74
+ addDragEvent,
75
+ close,
76
+ confirm,
77
+ mousedown,
78
+ mousemove,
79
+ mouseup,
80
+ removeDragEvent,
81
+ watchToggle,
82
+ watchVisible
83
+ };
package/drawer/vue.js ADDED
@@ -0,0 +1,51 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import {
3
+ close,
4
+ watchVisible,
5
+ watchToggle,
6
+ confirm,
7
+ mousedown,
8
+ mouseup,
9
+ mousemove,
10
+ addDragEvent,
11
+ removeDragEvent
12
+ } from "./index";
13
+ const api = ["state", "close", "confirm"];
14
+ const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, computed }, { emit, vm }) => {
15
+ const api2 = {};
16
+ const state = reactive({
17
+ toggle: false,
18
+ width: 0,
19
+ dragEvent: { x: 0, isDrag: false, offsetWidth: 0 },
20
+ computedWidth: computed(() => state.width ? state.width + "px" : props.width)
21
+ });
22
+ Object.assign(api2, {
23
+ state,
24
+ confirm: confirm({ state, emit }),
25
+ close: close({ emit, state }),
26
+ mousedown: mousedown({ state, vm }),
27
+ mousemove: mousemove({ state, props }),
28
+ mouseup: mouseup({ state }),
29
+ addDragEvent: addDragEvent({ api: api2, vm }),
30
+ removeDragEvent: removeDragEvent({ api: api2, vm }),
31
+ watchVisible: watchVisible({ state }),
32
+ watchToggle: watchToggle({ emit })
33
+ });
34
+ onMounted(() => {
35
+ props.dragable && api2.addDragEvent();
36
+ });
37
+ onBeforeUnmount(() => {
38
+ props.dragable && api2.removeDragEvent();
39
+ });
40
+ watch(() => props.visible, api2.watchVisible, { immediate: true });
41
+ watch(() => state.toggle, api2.watchToggle);
42
+ watch(
43
+ () => props.width,
44
+ () => state.width = 0
45
+ );
46
+ return api2;
47
+ };
48
+ export {
49
+ api,
50
+ renderless
51
+ };
@@ -1,5 +1,5 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { format } from "@opentiny/vue-renderless/common/date";
2
+ import { format } from "../common/date";
3
3
  const init = ({ state, props }) => () => {
4
4
  let list = [];
5
5
  let value;
package/dropdown/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { KEY_CODE } from "@opentiny/vue-renderless/common";
3
- import { addClass, removeClass, on, off } from "@opentiny/vue-renderless/common/deps/dom";
2
+ import { KEY_CODE } from "../common";
3
+ import { addClass, removeClass, on, off } from "../common/deps/dom";
4
4
  const watchVisible = ({ broadcast, emit, nextTick }) => (value) => {
5
5
  broadcast("TinyDropdownMenu", "visible", value);
6
6
  nextTick(() => emit("visible-change", value));
package/dropdown/vue.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { guid } from "@opentiny/vue-renderless/common/string";
2
+ import { guid } from "../common/string";
3
3
  import {
4
4
  watchVisible,
5
5
  watchFocusing,
@@ -1,5 +1,5 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { on, off } from "@opentiny/vue-renderless/common/deps/dom";
2
+ import { on, off } from "../common/deps/dom";
3
3
  const getTitle = (props) => () => {
4
4
  if (props.title) {
5
5
  return props.title;