@opentiny/vue-renderless 3.6.8 → 3.8.2

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 (317) 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/button-group/vue.js +5 -4
  13. package/calendar/index.js +2 -2
  14. package/calendar-bar/index.js +268 -0
  15. package/calendar-bar/vue.js +87 -0
  16. package/card/index.js +84 -0
  17. package/card/vue.js +70 -0
  18. package/card-group/index.js +16 -0
  19. package/card-group/vue.js +21 -0
  20. package/card-template/index.js +1 -1
  21. package/carousel/index.js +89 -2
  22. package/carousel/vue.js +14 -5
  23. package/carousel-item/index.js +8 -0
  24. package/carousel-item/vue.js +7 -3
  25. package/cascader/index.js +6 -6
  26. package/cascader/vue.js +3 -3
  27. package/cascader-menu/vue.js +2 -2
  28. package/cascader-panel/index.js +4 -4
  29. package/cascader-panel/node.js +4 -4
  30. package/cascader-panel/vue.js +2 -2
  31. package/cascader-select/index.js +179 -0
  32. package/cascader-select/vue.js +74 -0
  33. package/cell/vue.js +16 -0
  34. package/chart-bar/index.js +3 -3
  35. package/chart-boxplot/index.js +2 -2
  36. package/chart-candle/index.js +3 -3
  37. package/chart-core/deps/utils.js +7 -7
  38. package/chart-core/index.js +2 -2
  39. package/chart-funnel/index.js +3 -3
  40. package/chart-gauge/index.js +3 -3
  41. package/chart-graph/index.js +1 -1
  42. package/chart-heatmap/index.js +2 -2
  43. package/chart-line/index.js +3 -3
  44. package/chart-liquidfill/index.js +2 -2
  45. package/chart-map/index.js +3 -3
  46. package/chart-pie/index.js +3 -3
  47. package/chart-radar/index.js +3 -3
  48. package/chart-sankey/index.js +3 -3
  49. package/chart-scatter/index.js +4 -4
  50. package/chart-sunburst/index.js +1 -1
  51. package/chart-tree/index.js +2 -2
  52. package/chart-waterfall/index.js +3 -3
  53. package/chart-wordcloud/index.js +2 -2
  54. package/checkbox/index.js +21 -0
  55. package/checkbox/vue.js +16 -3
  56. package/checkbox-button/vue.js +1 -1
  57. package/collapse-item/vue.js +1 -1
  58. package/column-list-group/index.js +0 -0
  59. package/column-list-group/vue.js +14 -0
  60. package/column-list-item/index.js +50 -0
  61. package/column-list-item/vue.js +39 -0
  62. package/common/array.js +3 -3
  63. package/common/bigInt.js +5 -2
  64. package/common/dataset/index.js +3 -3
  65. package/common/date.js +2 -2
  66. package/common/deps/ResizeObserver.js +1 -1
  67. package/common/deps/clickoutside.js +1 -1
  68. package/common/deps/date-util.js +4 -4
  69. package/common/deps/date.js +2 -2
  70. package/common/deps/debounce.js +1 -1
  71. package/common/deps/dom.js +1 -1
  72. package/common/deps/fullscreen/apis.js +3 -3
  73. package/common/deps/fullscreen/screenfull.js +1 -1
  74. package/common/deps/infinite-scroll.js +176 -0
  75. package/common/deps/letter-only.js +1 -1
  76. package/common/deps/number-only.js +1 -1
  77. package/common/deps/observe-visibility.js +106 -0
  78. package/common/deps/popper.js +20 -22
  79. package/common/deps/popup-manager.js +2 -2
  80. package/common/deps/repeat-click.js +1 -1
  81. package/common/deps/resize-event.js +1 -1
  82. package/common/deps/tree-model/node.js +5 -5
  83. package/common/deps/tree-model/tree-store.js +3 -3
  84. package/common/deps/upload-ajax.js +2 -2
  85. package/common/deps/vue-popper.js +6 -6
  86. package/common/deps/vue-popup.js +4 -4
  87. package/common/index.js +2 -2
  88. package/common/object.js +1 -1
  89. package/common/runtime.js +24 -24
  90. package/common/string.js +23 -4
  91. package/common/validate/rules/range.js +2 -2
  92. package/common/validate/rules/required.js +1 -1
  93. package/common/validate/rules/type.js +3 -3
  94. package/common/validate/schema.js +1 -1
  95. package/common/validate/util.js +1 -1
  96. package/common/validate/validations/array.js +1 -1
  97. package/common/validate/validations/date.js +1 -1
  98. package/common/validate/validations/enum.js +1 -1
  99. package/common/validate/validations/float.js +1 -1
  100. package/common/validate/validations/integer.js +1 -1
  101. package/common/validate/validations/method.js +1 -1
  102. package/common/validate/validations/number.js +1 -1
  103. package/common/validate/validations/pattern.js +1 -1
  104. package/common/validate/validations/string.js +1 -1
  105. package/common/validate/validations/type.js +1 -1
  106. package/container/index.js +1 -1
  107. package/crop/index.js +2 -2
  108. package/currency/index.js +2 -2
  109. package/date-panel/index.js +7 -7
  110. package/date-panel/vue.js +3 -2
  111. package/date-picker-mobile/index.js +250 -0
  112. package/date-picker-mobile/vue.js +86 -0
  113. package/date-range/index.js +1 -1
  114. package/date-range/vue.js +1 -1
  115. package/date-table/index.js +3 -3
  116. package/date-table/vue.js +1 -1
  117. package/dialog-box/index.js +6 -4
  118. package/dialog-box/vue.js +1 -1
  119. package/dialog-select/index.js +345 -0
  120. package/dialog-select/vue.js +110 -0
  121. package/drawer/index.js +83 -0
  122. package/drawer/vue.js +51 -0
  123. package/drop-times/index.js +1 -1
  124. package/dropdown/index.js +2 -2
  125. package/dropdown/vue.js +4 -3
  126. package/dropdown-item/index.js +5 -1
  127. package/dropdown-item/mf.js +79 -0
  128. package/dropdown-item/vue.js +9 -6
  129. package/dropdown-menu/index.js +30 -1
  130. package/dropdown-menu/vue.js +17 -7
  131. package/dynamic-scroller/index.js +117 -0
  132. package/dynamic-scroller/vue.js +88 -0
  133. package/dynamic-scroller-item/index.js +147 -0
  134. package/dynamic-scroller-item/vue.js +92 -0
  135. package/espace/index.js +1 -1
  136. package/espace/vue.js +1 -1
  137. package/exception/vue.js +3 -1
  138. package/fall-menu/index.js +4 -4
  139. package/file-upload/index.js +872 -408
  140. package/file-upload/vue.js +87 -36
  141. package/filter/index.js +131 -0
  142. package/filter/tag-group.js +43 -0
  143. package/filter/vue.js +73 -0
  144. package/filter-bar/index.js +9 -0
  145. package/filter-bar/vue.js +16 -0
  146. package/filter-box/index.js +17 -0
  147. package/filter-box/vue.js +19 -0
  148. package/filter-panel/index.js +42 -0
  149. package/filter-panel/vue.js +33 -0
  150. package/floatbar/index.js +1 -1
  151. package/flowchart/index.js +721 -0
  152. package/flowchart/vue.js +81 -0
  153. package/form/index.js +15 -1
  154. package/form/vue.js +10 -4
  155. package/form-item/index.js +46 -6
  156. package/form-item/vue.js +27 -3
  157. package/fullscreen/index.js +1 -1
  158. package/fullscreen/vue.js +1 -1
  159. package/grid/plugins/export.js +2 -2
  160. package/grid/plugins/exportExcel.js +2 -2
  161. package/grid/plugins/resize.js +1 -1
  162. package/grid/static/base/helperEqualCompare.js +1 -1
  163. package/grid/static/base/isPlainObject.js +1 -1
  164. package/grid/utils/common.js +3 -3
  165. package/grid/utils/dom.js +3 -3
  166. package/grid/utils/event.js +2 -2
  167. package/guide/index.js +168 -0
  168. package/guide/vue.js +36 -0
  169. package/hrapprover/index.js +1 -1
  170. package/image/index.js +8 -4
  171. package/image/vue.js +12 -6
  172. package/image-viewer/index.js +3 -3
  173. package/image-viewer/vue.js +16 -6
  174. package/input/index.js +34 -1
  175. package/input/vue.js +22 -6
  176. package/ip-address/index.js +1 -1
  177. package/ip-address/vue.js +1 -1
  178. package/link-menu/index.js +2 -2
  179. package/link-menu/vue.js +2 -2
  180. package/loading/index.js +2 -2
  181. package/loading/vue.js +2 -1
  182. package/locales/index.js +1 -1
  183. package/logout/index.js +1 -1
  184. package/milestone/index.js +5 -1
  185. package/modal/index.js +68 -39
  186. package/modal/vue.js +15 -12
  187. package/month-range/index.js +1 -1
  188. package/month-range/vue.js +1 -1
  189. package/month-table/index.js +5 -5
  190. package/month-table/vue.js +1 -1
  191. package/multi-select/index.js +5 -2
  192. package/multi-select/vue.js +4 -5
  193. package/nav-menu/index.js +6 -6
  194. package/notify/index.js +3 -3
  195. package/numeric/index.js +15 -5
  196. package/numeric/vue.js +15 -6
  197. package/option/index.js +1 -1
  198. package/package.json +2 -1
  199. package/pager/vue.js +10 -0
  200. package/pager-item/index.js +1 -1
  201. package/panel/index.js +1 -1
  202. package/picker/index.js +7 -7
  203. package/picker/vue.js +1 -1
  204. package/picker-column/index.js +1 -1
  205. package/popconfirm/index.js +25 -0
  206. package/popconfirm/vue.js +22 -0
  207. package/popeditor/index.js +7 -7
  208. package/popeditor/vue.js +2 -2
  209. package/popover/index.js +11 -3
  210. package/popover/vue.js +33 -10
  211. package/popup/index.js +4 -4
  212. package/pull-refresh/index.js +8 -11
  213. package/pull-refresh/vue.js +7 -7
  214. package/radio/index.js +17 -0
  215. package/radio/vue.js +18 -3
  216. package/radio-button/index.js +8 -0
  217. package/radio-button/vue.js +19 -4
  218. package/radio-group/index.js +1 -1
  219. package/radio-group/vue.js +5 -2
  220. package/rate/index.js +4 -2
  221. package/rate/vue.js +1 -1
  222. package/record/index.js +190 -0
  223. package/record/vue.js +44 -0
  224. package/recycle-scroller/index.js +470 -0
  225. package/recycle-scroller/vue.js +135 -0
  226. package/river/index.js +371 -0
  227. package/river/river.js +352 -0
  228. package/river/vue.js +77 -0
  229. package/roles/index.js +1 -1
  230. package/scrollbar/vue-bar.js +1 -1
  231. package/scrollbar/vue.js +1 -1
  232. package/search/index.js +3 -3
  233. package/select/index.js +21 -14
  234. package/select/vue.js +38 -15
  235. package/select-dropdown/vue.js +1 -1
  236. package/select-mobile/index.js +111 -0
  237. package/select-mobile/vue.js +58 -0
  238. package/select-view/index.js +170 -0
  239. package/select-view/vue.js +82 -0
  240. package/selected-box/index.js +216 -0
  241. package/selected-box/vue.js +98 -0
  242. package/slide-bar/index.js +1 -1
  243. package/slider/index.js +49 -4
  244. package/slider/vue.js +15 -4
  245. package/split/vue.js +1 -1
  246. package/standard-list-item/index.js +18 -0
  247. package/standard-list-item/vue.js +22 -0
  248. package/steps/index.js +30 -0
  249. package/steps/slide-bar.js +122 -0
  250. package/steps/vue.js +15 -3
  251. package/switch/index.js +1 -1
  252. package/switch/vue.js +2 -1
  253. package/tab-bar/index.js +2 -2
  254. package/tab-item/index.js +3 -3
  255. package/tab-item/vue.js +4 -3
  256. package/tab-item-mf/index.js +0 -0
  257. package/tab-item-mf/vue.js +16 -0
  258. package/tab-nav/index.js +78 -4
  259. package/tab-nav/vue.js +11 -3
  260. package/tabbar-item/index.js +1 -1
  261. package/tabbar-item/vue.js +1 -1
  262. package/tabs/index.js +8 -9
  263. package/tabs/vue.js +1 -1
  264. package/tabs-mf/index.js +109 -0
  265. package/tabs-mf/vue-bar.js +49 -0
  266. package/tabs-mf/vue-nav-item.js +22 -0
  267. package/tabs-mf/vue-nav.js +13 -0
  268. package/tabs-mf/vue.js +45 -0
  269. package/tabs-mf/wheel.js +71 -0
  270. package/tag/index.js +8 -2
  271. package/tag/vue.js +13 -5
  272. package/tag-group/index.js +24 -0
  273. package/tag-group/vue.js +29 -0
  274. package/tall-storage/index.js +1 -1
  275. package/tall-storage/vue.js +1 -1
  276. package/time/index.js +1 -1
  277. package/time/vue.js +2 -2
  278. package/time-line/index.js +28 -7
  279. package/time-line/vue.js +9 -4
  280. package/time-panel/index.js +2 -2
  281. package/time-panel/vue.js +1 -1
  282. package/time-picker-mobile/index.js +30 -0
  283. package/time-picker-mobile/vue.js +30 -0
  284. package/time-range/index.js +1 -1
  285. package/time-range/vue.js +1 -1
  286. package/time-spinner/index.js +2 -2
  287. package/time-spinner/vue.js +1 -1
  288. package/toggle-menu/index.js +2 -2
  289. package/toggle-menu/vue.js +1 -1
  290. package/tooltip/index.js +30 -3
  291. package/tooltip/vue.js +34 -13
  292. package/top-box/index.js +3 -3
  293. package/transfer/index.js +1 -1
  294. package/transfer-panel/index.js +2 -2
  295. package/tree/index.js +6 -6
  296. package/tree/vue.js +1 -1
  297. package/tree-node/index.js +1 -1
  298. package/upload/index.js +1 -1
  299. package/upload/vue.js +2 -2
  300. package/upload-dragger/index.js +5 -1
  301. package/upload-dragger/vue.js +9 -3
  302. package/upload-list/index.js +158 -8
  303. package/upload-list/vue.js +77 -25
  304. package/user/index.js +86 -70
  305. package/user/vue.js +15 -5
  306. package/user-account/vue.js +1 -1
  307. package/user-contact/index.js +49 -3
  308. package/user-contact/vue.js +17 -8
  309. package/user-head-group/vue.js +17 -0
  310. package/user-link/index.js +10 -2
  311. package/user-link/vue.js +11 -6
  312. package/wheel/index.js +1 -1
  313. package/wizard/index.js +3 -3
  314. package/year-range/index.js +125 -0
  315. package/year-range/vue.js +88 -0
  316. package/year-table/index.js +175 -11
  317. package/year-table/vue.js +17 -5
@@ -0,0 +1,81 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import {
3
+ compute,
4
+ computeMf,
5
+ isMf,
6
+ drawArrow,
7
+ buildAfterNode,
8
+ buildAfterLink,
9
+ drawAfterLink,
10
+ refresh,
11
+ getAllItem,
12
+ initDropdowns,
13
+ getVars,
14
+ isLinkHover,
15
+ omitText,
16
+ buildHoverState,
17
+ addListeners,
18
+ removeListeners,
19
+ setListeners,
20
+ hitTest,
21
+ clearHoverAfterLink,
22
+ clickNode,
23
+ clearDropdown,
24
+ antialiasing
25
+ } from "./index";
26
+ const api = ["state", "clearHoverAfterLink", "clickNode", "getVars", "omitText", "refresh", "clearDropdown"];
27
+ const renderless = (props, { reactive, markRaw, onMounted, onBeforeUnmount }, { vm, nextTick, emit, mode }) => {
28
+ const state = reactive({
29
+ afterData: null,
30
+ refreshKey: 0,
31
+ wrapperStyle: "",
32
+ dropdowns: {}
33
+ });
34
+ const api2 = {
35
+ state,
36
+ omitText,
37
+ getVars: getVars(),
38
+ initDropdowns: initDropdowns(),
39
+ buildAfterNode: buildAfterNode(props),
40
+ buildAfterLink: buildAfterLink(),
41
+ isLinkHover: isLinkHover(state),
42
+ clearDropdown: clearDropdown(state),
43
+ getAllItem: getAllItem(props),
44
+ buildHoverState: buildHoverState(props),
45
+ removeListeners: removeListeners({ state, vm }),
46
+ isMf: isMf(mode),
47
+ drawArrow: drawArrow({ state, vm, props }),
48
+ antialiasing: antialiasing(vm)
49
+ };
50
+ Object.assign(api2, {
51
+ compute: compute({ api: api2, markRaw, props, state }),
52
+ computeMf: computeMf({ api: api2, markRaw, props, state }),
53
+ drawAfterLink: drawAfterLink({ api: api2, props, state, vm }),
54
+ refresh: refresh({ api: api2, nextTick, state }),
55
+ addListeners: addListeners({ api: api2, state, vm }),
56
+ setListeners: setListeners({ api: api2, emit, props, state, vm }),
57
+ hitTest: hitTest({ api: api2, state, vm }),
58
+ clearHoverAfterLink: clearHoverAfterLink({ api: api2, state, vm }),
59
+ clickNode: clickNode({ api: api2, emit })
60
+ });
61
+ if (api2.isMf()) {
62
+ api2.computeMf();
63
+ } else {
64
+ api2.compute();
65
+ }
66
+ onMounted(() => {
67
+ nextTick(() => {
68
+ api2.antialiasing();
69
+ api2.drawAfterLink();
70
+ api2.addListeners();
71
+ });
72
+ });
73
+ onBeforeUnmount(() => {
74
+ api2.removeListeners();
75
+ });
76
+ return api2;
77
+ };
78
+ export {
79
+ api,
80
+ renderless
81
+ };
package/form/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { merge } from "@opentiny/vue-renderless/common/object";
2
+ import { merge } from "../common/object";
3
3
  const watchRules = ({ api, props, state }) => (newRules = {}, oldRules = {}) => {
4
4
  const newValidFields = Object.keys(newRules);
5
5
  const oldValidFields = Object.keys(oldRules);
@@ -131,6 +131,18 @@ const bindDialogEvent = ({ api, dialog, state }) => {
131
131
  });
132
132
  }
133
133
  };
134
+ const showTooltip = ({ vm, state }) => (dom, val) => {
135
+ const tooltip = vm.$refs.tooltip;
136
+ tooltip.state.referenceElm = dom;
137
+ tooltip.state.popperElm && (tooltip.state.popperElm.style.display = "none");
138
+ tooltip.doDestroy();
139
+ state.tooltipVisible = true;
140
+ state.displayedValue = val;
141
+ setTimeout(tooltip.updatePopper, 20);
142
+ };
143
+ const hideTooltip = ({ state }) => () => {
144
+ state.tooltipVisible = false;
145
+ };
134
146
  export {
135
147
  bindDialogEvent,
136
148
  clearValidate,
@@ -138,8 +150,10 @@ export {
138
150
  created,
139
151
  deregisterLabelWidth,
140
152
  getLabelWidthIndex,
153
+ hideTooltip,
141
154
  registerLabelWidth,
142
155
  resetFields,
156
+ showTooltip,
143
157
  updateTip,
144
158
  validate,
145
159
  validateField,
package/form/vue.js CHANGED
@@ -11,7 +11,9 @@ import {
11
11
  registerLabelWidth,
12
12
  deregisterLabelWidth,
13
13
  updateTip,
14
- bindDialogEvent
14
+ bindDialogEvent,
15
+ showTooltip,
16
+ hideTooltip
15
17
  } from "./index";
16
18
  const api = [
17
19
  "state",
@@ -22,9 +24,11 @@ const api = [
22
24
  "getLabelWidthIndex",
23
25
  "registerLabelWidth",
24
26
  "deregisterLabelWidth",
25
- "updateTip"
27
+ "updateTip",
28
+ "showTooltip",
29
+ "hideTooltip"
26
30
  ];
27
- const renderless = (props, { computed, inject, provide, reactive, watch }, { parent }) => {
31
+ const renderless = (props, { computed, inject, provide, reactive, watch }, { vm, parent }) => {
28
32
  const api2 = {};
29
33
  const dialog = inject("dialog", null);
30
34
  const state = reactive({
@@ -58,7 +62,9 @@ const renderless = (props, { computed, inject, provide, reactive, watch }, { par
58
62
  getLabelWidthIndex: getLabelWidthIndex(state),
59
63
  registerLabelWidth: registerLabelWidth({ api: api2, state }),
60
64
  deregisterLabelWidth: deregisterLabelWidth({ api: api2, state }),
61
- watchRules: watchRules({ api: api2, props, state })
65
+ watchRules: watchRules({ api: api2, props, state }),
66
+ showTooltip: showTooltip({ vm, state }),
67
+ hideTooltip: hideTooltip({ state })
62
68
  });
63
69
  api2.created();
64
70
  provide("form", parent);
@@ -1,9 +1,10 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { POSITION, VALIDATE_STATE } from "@opentiny/vue-renderless/common";
3
- import { merge } from "@opentiny/vue-renderless/common/object";
4
- import Validator from "@opentiny/vue-renderless/common/validate";
5
- import { isNull } from "@opentiny/vue-renderless/common/type";
6
- import debounce from "@opentiny/vue-renderless/common/deps/debounce";
2
+ import { POSITION, VALIDATE_STATE } from "../common";
3
+ import { omitText } from "../common/string";
4
+ import { merge } from "../common/object";
5
+ import Validator from "../common/validate";
6
+ import { isNull } from "../common/type";
7
+ import debounce from "../common/deps/debounce";
7
8
  const watchError = (state) => (value) => {
8
9
  if (!isNull(value) && state.getValidateType === "tip") {
9
10
  state.canShowTip = true;
@@ -64,7 +65,7 @@ const computedContentStyle = ({ props, state }) => () => {
64
65
  };
65
66
  const computedForm = ({ constants, instance, state }) => () => {
66
67
  const { FORM_NAME, FORM_ITEM_NAME } = constants;
67
- let parent = instance.$parent;
68
+ let parent = instance.$parent.$parent;
68
69
  let parentName = parent.$options.componentName;
69
70
  while (parentName !== FORM_NAME) {
70
71
  if (parentName === FORM_ITEM_NAME) {
@@ -291,8 +292,44 @@ const wrapValidate = ({ validateFunc, props }) => {
291
292
  return validateFunc;
292
293
  }
293
294
  };
295
+ const handleMouseenter = ({ state }) => (e) => {
296
+ if (!state.isDisplayOnly || !state.typeName || !state.form)
297
+ return;
298
+ const dom = e.target;
299
+ const text = dom.textContent;
300
+ const font = window.getComputedStyle(dom).font;
301
+ const rect = dom.getBoundingClientRect();
302
+ let res = {};
303
+ let overHeight = false;
304
+ if (["text", "password", "number"].includes(state.typeName)) {
305
+ res = omitText(text, font, rect.width);
306
+ }
307
+ if (state.typeName === "textarea" && dom && dom.scrollHeight > dom.offsetHeight) {
308
+ overHeight = true;
309
+ }
310
+ if (res.o || overHeight) {
311
+ state.form.showTooltip(dom, state.displayedValue);
312
+ }
313
+ };
314
+ const handleMouseleave = (state) => () => {
315
+ state.form && state.form.hideTooltip();
316
+ };
317
+ const getDisplayedValue = ({ state }) => (param) => {
318
+ if (!state.formInstance.displayOnly)
319
+ return;
320
+ const valueSplit = state.formInstance.valueSplit || "; ";
321
+ state.typeName = param.type;
322
+ state.isBasicComp = true;
323
+ state.displayedValue = state.displayedValue + (state.displayedValue && param.val ? valueSplit : "") + param.val;
324
+ };
325
+ const clearDisplayedValue = ({ state }) => () => {
326
+ state.typeName = "";
327
+ state.isBasicComp = false;
328
+ state.displayedValue = "";
329
+ };
294
330
  export {
295
331
  addValidateEvents,
332
+ clearDisplayedValue,
296
333
  clearValidate,
297
334
  computedContentStyle,
298
335
  computedFieldValue,
@@ -301,10 +338,13 @@ export {
301
338
  computedIsRequired,
302
339
  computedLabelStyle,
303
340
  computedValueStyle,
341
+ getDisplayedValue,
304
342
  getFilteredRule,
305
343
  getPropByPath,
306
344
  getRules,
307
345
  getValueByPath,
346
+ handleMouseenter,
347
+ handleMouseleave,
308
348
  mounted,
309
349
  onFieldBlur,
310
350
  onFieldChange,
package/form-item/vue.js CHANGED
@@ -22,7 +22,11 @@ import {
22
22
  computedFieldValue,
23
23
  computedGetValidateType,
24
24
  updateTip,
25
- wrapValidate
25
+ wrapValidate,
26
+ getDisplayedValue,
27
+ clearDisplayedValue,
28
+ handleMouseenter,
29
+ handleMouseleave
26
30
  } from "./index";
27
31
  const api = [
28
32
  "state",
@@ -36,7 +40,10 @@ const api = [
36
40
  "updateComputedLabelWidth",
37
41
  "addValidateEvents",
38
42
  "removeValidateEvents",
39
- "updateTip"
43
+ "updateTip",
44
+ "getDisplayedValue",
45
+ "handleMouseenter",
46
+ "handleMouseleave"
40
47
  ];
41
48
  const initState = ({ reactive, computed, api: api2, mode, inject, props }) => {
42
49
  const state = reactive({
@@ -52,7 +59,12 @@ const initState = ({ reactive, computed, api: api2, mode, inject, props }) => {
52
59
  canShowTip: false,
53
60
  // 兼容 2.0 validation 的 required
54
61
  validationRequired: false,
62
+ validateType: "text",
55
63
  tooltip: null,
64
+ displayedValue: "",
65
+ isBasicComp: false,
66
+ showTooltip: false,
67
+ typeName: "",
56
68
  formInstance: inject("form", null),
57
69
  labelFor: computed(() => props.for || props.prop),
58
70
  labelStyle: computed(() => api2.computedLabelStyle()),
@@ -61,8 +73,16 @@ const initState = ({ reactive, computed, api: api2, mode, inject, props }) => {
61
73
  form: computed(() => api2.computedForm()),
62
74
  fieldValue: computed(() => api2.computedFieldValue()),
63
75
  isRequired: computed(() => api2.computedIsRequired()),
76
+ formInline: computed(() => state.formInstance.inline),
64
77
  formSize: computed(() => state.formInstance.size),
65
78
  formItemSize: computed(() => props.size || state.formSize),
79
+ isDisplayOnly: computed(() => state.formInstance.displayOnly),
80
+ labelPosition: computed(() => state.formInstance.labelPosition),
81
+ hideRequiredAsterisk: computed(() => state.formInstance.hideRequiredAsterisk),
82
+ labelSuffix: computed(() => state.formInstance.labelSuffix),
83
+ labelWidth: computed(() => state.formInstance.labelWidth),
84
+ showMessage: computed(() => state.formInstance.showMessage),
85
+ inlineMessage: computed(() => state.formInstance.inlineMessage),
66
86
  sizeClass: computed(() => state.formItemSize),
67
87
  getValidateType: computed(() => api2.computedGetValidateType())
68
88
  });
@@ -94,7 +114,11 @@ const initApi = ({ api: api2, state, dispatch, broadcast, refs, props, constants
94
114
  onFieldBlur: onFieldBlur(api2),
95
115
  onFieldChange: onFieldChange({ api: api2, state }),
96
116
  addValidateEvents: addValidateEvents({ api: api2, instance, props, state }),
97
- validate: wrapValidate({ validateFunc: validate({ api: api2, props, state, t }), props })
117
+ validate: wrapValidate({ validateFunc: validate({ api: api2, props, state, t }), props }),
118
+ getDisplayedValue: getDisplayedValue({ state }),
119
+ clearDisplayedValue: clearDisplayedValue({ state }),
120
+ handleMouseenter: handleMouseenter({ state }),
121
+ handleMouseleave: handleMouseleave(state)
98
122
  });
99
123
  };
100
124
  const initWatch = ({ watch, api: api2, props }) => {
@@ -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 toggle = ({ state, api }) => (value) => {
4
4
  if (value === void 0) {
5
5
  if (state.isFullscreen) {
package/fullscreen/vue.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import sf from "@opentiny/vue-renderless/common/deps/fullscreen/screenfull";
2
+ import sf from "../common/deps/fullscreen/screenfull";
3
3
  import { exit, enter, toggle, request, getState, shadeClick, keypressCallback, fullScreenCallback, onChangeFullscreen, computeWrapperStyle } from "./index";
4
4
  const api = ["state", "exit", "enter", "toggle", "request", "getState", "shadeClick", "keypressCallback", "fullScreenCallback", "onChangeFullscreen"];
5
5
  const renderless = (props, { reactive, computed, watch }, { vm, emit }) => {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  __spreadValues
3
3
  } from "../../chunk-PKUHTIDK.js";
4
- import { xss } from "@opentiny/vue-renderless/common/xss.js";
5
- import browser from "@opentiny/vue-renderless/common/browser";
4
+ import { xss } from "../../common/xss.js";
5
+ import browser from "../../common/browser";
6
6
  import { toTreeArray } from "../static";
7
7
  import { getCellValue, getFuncText } from "../utils";
8
8
  import { exportExcel } from "./exportExcel";
@@ -1,6 +1,6 @@
1
1
  import "../../chunk-PKUHTIDK.js";
2
- import { extend } from "@opentiny/vue-renderless/common/object";
3
- import browser from "@opentiny/vue-renderless/common/browser";
2
+ import { extend } from "../../common/object";
3
+ import browser from "../../common/browser";
4
4
  const isIE = browser.name === "ie";
5
5
  const rgbRegExp = /^rgba?\((\d+),\s(\d+),\s(\d+)([\s\S]*)\)$/;
6
6
  const hexRegExp = /^#([a-zA-Z0-9]{3}|[a-zA-Z0-9]{6})$/;
@@ -1,5 +1,5 @@
1
1
  import "../../chunk-PKUHTIDK.js";
2
- import browser from "@opentiny/vue-renderless/common/browser";
2
+ import browser from "../../common/browser";
3
3
  import { remove } from "../static";
4
4
  let resizeTimeout;
5
5
  let defaultInterval = 250;
@@ -1,5 +1,5 @@
1
1
  import "../../../chunk-PKUHTIDK.js";
2
- import { isDate, isRegExp } from "@opentiny/vue-renderless/common/type";
2
+ import { isDate, isRegExp } from "../../../common/type";
3
3
  import isNumber from "./isNumber";
4
4
  import isString from "./isString";
5
5
  import isBoolean from "./isBoolean";
@@ -1,5 +1,5 @@
1
1
  import "../../../chunk-PKUHTIDK.js";
2
- import { isPlainObject } from "@opentiny/vue-renderless/common/type";
2
+ import { isPlainObject } from "../../../common/type";
3
3
  var isPlainObject_default = isPlainObject;
4
4
  export {
5
5
  isPlainObject_default as default
@@ -1,7 +1,7 @@
1
1
  import "../../chunk-PKUHTIDK.js";
2
- import { extend } from "@opentiny/vue-renderless/common/object";
3
- import { isNull } from "@opentiny/vue-renderless/common/type";
4
- import { find } from "@opentiny/vue-renderless/common/array";
2
+ import { extend } from "../../common/object";
3
+ import { isNull } from "../../common/type";
4
+ import { find } from "../../common/array";
5
5
  import { get, isFunction, set, findTree } from "../static";
6
6
  const gridSize = ["medium", "small", "mini"];
7
7
  const getSize = ({ size, $parent }) => size || ($parent && gridSize.includes($parent.size) ? $parent.size : null);
package/grid/utils/dom.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "../../chunk-PKUHTIDK.js";
2
2
  import { getRowid } from "./common";
3
- import { hasClass } from "@opentiny/vue-renderless/common/deps/dom";
3
+ import { hasClass } from "../../common/deps/dom";
4
4
  import { arrayIndexOf } from "../static";
5
5
  const ATTR_NAME = "data-rowid";
6
6
  const CELL_CLS = ".tiny-grid-cell";
@@ -66,12 +66,12 @@ function setBodyLeft(body, td, $table, column, move) {
66
66
  const { left, right } = td.getBoundingClientRect();
67
67
  let offset = 0;
68
68
  if (isLeftArrow && fixedDom) {
69
- const div = fixedDom.querySelector("td.fixed__hidden");
69
+ const div = fixedDom.querySelector("td.fixed__column");
70
70
  const division = div ? div.getBoundingClientRect().left : fixedDom.getBoundingClientRect().right;
71
71
  division > left && (offset = left - division);
72
72
  }
73
73
  if (isRightArrow && fixedDom) {
74
- const div = fixedDom.querySelector("td:not(.fixed__hidden)") || fixedDom;
74
+ const div = fixedDom.querySelector("td:not(.fixed__column)") || fixedDom;
75
75
  const division = div.getBoundingClientRect().left;
76
76
  division < right && (offset = right - division);
77
77
  }
@@ -1,7 +1,7 @@
1
1
  import "../../chunk-PKUHTIDK.js";
2
- import browser from "@opentiny/vue-renderless/common/browser";
2
+ import browser from "../../common/browser";
3
3
  import { remove } from "../static";
4
- import { on } from "@opentiny/vue-renderless/common/deps/dom";
4
+ import { on } from "../../common/deps/dom";
5
5
  const wheelName = browser.isDoc && /Firefox/i.test(navigator.userAgent) ? "DOMMouseScroll" : "mousewheel";
6
6
  const eventStore = [];
7
7
  const GlobalEvent = {
package/guide/index.js ADDED
@@ -0,0 +1,168 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import { xss } from "../common/xss";
3
+ const createShepherd = ({ state, props, Shepherd, offset }) => () => {
4
+ const tour = newTour(state, Shepherd, offset);
5
+ state.tour = tour;
6
+ const result = {};
7
+ const deepCopy = getItemCopy(props, tour, result);
8
+ if (state.domData && state.domData !== 0) {
9
+ state.domData.forEach((item, i) => {
10
+ let steps = itemStep(item, state, deepCopy, i, Shepherd);
11
+ const step = tour.addStep(steps);
12
+ if (steps.hightBox && steps.hightBox.length != 0) {
13
+ step.on("show", () => {
14
+ steps.hightBox.forEach((item2) => {
15
+ document.querySelector(item2).classList.add("tiny-guide__z-top");
16
+ });
17
+ });
18
+ step.on("hide", () => {
19
+ steps.hightBox.forEach((item2) => {
20
+ document.querySelector(item2).classList.remove("tiny-guide__z-top");
21
+ });
22
+ });
23
+ step.on("complete", () => {
24
+ steps.hightBox.forEach((item2) => {
25
+ document.querySelector(item2).classList.remove("tiny-guide__z-top");
26
+ });
27
+ });
28
+ step.on("cancel", () => {
29
+ steps.hightBox.forEach((item2) => {
30
+ document.querySelector(item2).classList.remove("tiny-guide__z-top");
31
+ });
32
+ });
33
+ step.on("destroy", () => {
34
+ steps.hightBox.forEach((item2) => {
35
+ document.querySelector(item2).classList.remove("tiny-guide__z-top");
36
+ });
37
+ });
38
+ } else {
39
+ callBack(step, item);
40
+ }
41
+ });
42
+ }
43
+ state.tour.start();
44
+ if (props.width || props.height) {
45
+ document.querySelector(".tiny-guide.shepherd-element").style.width = `${props.width}px`;
46
+ document.querySelector(".tiny-guide.shepherd-element").style.height = `${props.height}px`;
47
+ }
48
+ };
49
+ const mounted = ({ state, api }) => () => {
50
+ if (state.showStep) {
51
+ api.createShepherd();
52
+ }
53
+ };
54
+ const getItemCopy = (props, tour, result) => {
55
+ const { domData } = props;
56
+ result = domData.map((item) => {
57
+ const itemCopy = JSON.parse(JSON.stringify(item));
58
+ itemCopy.button = item.button.map((e) => {
59
+ const eCopy = JSON.parse(JSON.stringify(e));
60
+ eCopy.action = tour[e.action];
61
+ return eCopy;
62
+ });
63
+ return itemCopy;
64
+ });
65
+ return result;
66
+ };
67
+ const newTour = (state, Shepherd, offset) => {
68
+ const tour = new Shepherd.Tour({
69
+ useModalOverlay: true,
70
+ defaultStepOptions: {
71
+ modalOverlayOpeningPadding: state.modalOverlayOpeningPadding,
72
+ modalOverlayOpeningRadius: state.modalOverlayOpeningRadius,
73
+ arrow: state.arrow,
74
+ highlightClass: state.lightClass,
75
+ classes: "tiny-guide",
76
+ floatingUIOptions: {
77
+ middleware: [
78
+ offset({
79
+ mainAxis: state.mainAxis,
80
+ crossAxis: state.crossAxis,
81
+ alignmentAxis: state.alignmentAxis
82
+ })
83
+ ]
84
+ }
85
+ }
86
+ });
87
+ return tour;
88
+ };
89
+ const itemStep = (item, state, deepCopy, index, Shepherd) => {
90
+ let steps = {
91
+ text: xss.filterUrl(item.text),
92
+ title: xss.filterUrl(item.title),
93
+ classes: item.classes,
94
+ attachTo: {
95
+ element: item.domElement,
96
+ on: item.popPosition || state.popPosition
97
+ },
98
+ hightBox: item.hightBox || null,
99
+ buttons: deepCopy[index].button,
100
+ cancelIcon: {
101
+ enabled: true
102
+ },
103
+ id: item.id,
104
+ scrollTo: true,
105
+ scrollToHandler(el) {
106
+ if (el.getBoundingClientRect().top > document.documentElement.clientHeight) {
107
+ if (document.documentElement.scrollTop > 0) {
108
+ window.scrollTo(0, document.documentElement.scrollTop + el.getBoundingClientRect().top / 2);
109
+ } else {
110
+ window.scrollTo(0, el.getBoundingClientRect().top - document.documentElement.clientHeight / 2);
111
+ }
112
+ }
113
+ },
114
+ when: {
115
+ show() {
116
+ const currentStep = Shepherd.activeTour && Shepherd.activeTour.getCurrentStep();
117
+ const currentStepElement = currentStep && currentStep.getElement();
118
+ const footer = currentStepElement && currentStepElement.querySelector(".shepherd-footer");
119
+ const progress = document.createElement("span");
120
+ progress.classList.add("progress-style");
121
+ progress.innerText = `${Shepherd.activeTour && Shepherd.activeTour.steps.indexOf(currentStep) + 1}/${Shepherd.activeTour && Shepherd.activeTour.steps.length}`;
122
+ footer && footer.insertBefore(progress, currentStepElement.querySelector(".shepherd-button"));
123
+ }
124
+ }
125
+ };
126
+ return steps;
127
+ };
128
+ const callBack = (step, item) => {
129
+ step.on("before-show", () => {
130
+ if (typeof item.beforeShow === "function") {
131
+ item.beforeShow();
132
+ }
133
+ });
134
+ step.on("show", () => {
135
+ if (typeof item.show === "function") {
136
+ item.show();
137
+ }
138
+ });
139
+ step.on("before-hide", () => {
140
+ if (typeof item.beforeHide === "function") {
141
+ item.beforeHide();
142
+ }
143
+ });
144
+ step.on("hide", () => {
145
+ if (typeof item.hide === "function") {
146
+ item.hide();
147
+ }
148
+ });
149
+ step.on("complete", () => {
150
+ if (typeof item.complete === "function") {
151
+ item.complete();
152
+ }
153
+ });
154
+ step.on("cancel", () => {
155
+ if (typeof item.cancel === "function") {
156
+ item.cancel();
157
+ }
158
+ });
159
+ step.on("destroy", () => {
160
+ if (typeof item.destroy === "function") {
161
+ item.destroy();
162
+ }
163
+ });
164
+ };
165
+ export {
166
+ createShepherd,
167
+ mounted
168
+ };
package/guide/vue.js ADDED
@@ -0,0 +1,36 @@
1
+ import {
2
+ __spreadProps,
3
+ __spreadValues
4
+ } from "../chunk-PKUHTIDK.js";
5
+ import { createShepherd, mounted } from "./index";
6
+ const api = ["state"];
7
+ const renderless = (props, { reactive, onMounted, watch }, utils, { Shepherd, offset }) => {
8
+ const state = reactive({
9
+ tour: null,
10
+ tour1: null,
11
+ showStep: false,
12
+ domData: props.domData || null,
13
+ mainAxis: props.mainAxis,
14
+ crossAxis: props.crossAxis,
15
+ alignmentAxis: props.alignmentAxis,
16
+ popPosition: props.popPosition,
17
+ modalOverlayOpeningPadding: props.modalOverlayOpeningPadding,
18
+ modalOverlayOpeningRadius: props.modalOverlayOpeningRadius,
19
+ arrow: props.arrow,
20
+ lightClass: props.lightClass
21
+ });
22
+ let baseApi = {
23
+ state,
24
+ createShepherd: createShepherd({ state, props, Shepherd, offset })
25
+ };
26
+ const api2 = __spreadProps(__spreadValues({}, baseApi), {
27
+ mounted: mounted({ state, api: baseApi })
28
+ });
29
+ watch(() => props.showStep, api2.createShepherd);
30
+ onMounted(api2.mounted);
31
+ return api2;
32
+ };
33
+ export {
34
+ api,
35
+ renderless
36
+ };
@@ -1,5 +1,5 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { extend } from "@opentiny/vue-renderless/common/object";
2
+ import { extend } from "../common/object";
3
3
  const getHrList = ({ api, props, state }) => (deptCode) => {
4
4
  state.loading = true;
5
5
  const params = {
package/image/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { on, off, getScrollContainer, isInContainer } from "@opentiny/vue-renderless/common/deps/dom";
3
- import { typeOf } from "@opentiny/vue-renderless/common/type";
4
- import "@opentiny/vue-renderless/common/deps/requestAnimationFrame";
5
- import { rafThrottle } from "@opentiny/vue-renderless/image-viewer";
2
+ import { on, off, getScrollContainer, isInContainer } from "../common/deps/dom";
3
+ import { typeOf } from "../common/type";
4
+ import "../common/deps/requestAnimationFrame";
5
+ import { rafThrottle } from "../image-viewer";
6
6
  const isSupportObjectFit = () => document.documentElement.style.objectFit !== void 0;
7
7
  const isHtmlElement = (node) => node && node.nodeType === Node.ELEMENT_NODE;
8
8
  const computedGetImageStyle = ({ props, api }) => () => {
@@ -34,6 +34,9 @@ const handleLoad = ({ state, emit }) => (event, img) => {
34
34
  state.loading = false;
35
35
  emit("load", event);
36
36
  };
37
+ const deleteHander = (emit) => (event) => {
38
+ emit("delete", event);
39
+ };
37
40
  const handleError = ({ state, emit }) => (event) => {
38
41
  state.loading = false;
39
42
  state.error = true;
@@ -109,6 +112,7 @@ export {
109
112
  computedGetAlignCenter,
110
113
  computedGetImageStyle,
111
114
  computedGetPreview,
115
+ deleteHander,
112
116
  getImageStyle,
113
117
  handleError,
114
118
  handleLazyLoad,