@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
@@ -1,5 +1,5 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { cloneDeep } from "@opentiny/vue-renderless/chart-core/deps/utils";
2
+ import { cloneDeep } from "../chart-core/deps/utils";
3
3
  const created = ({ props, state, refs, nextTick }) => () => {
4
4
  nextTick(() => {
5
5
  state.dataSource = cloneDeep(props.dataSource);
@@ -163,7 +163,10 @@ const getLabelsStyle = (state) => {
163
163
  const over25Labels = state.labelLevelsInfo.filter((i) => i && !i.isOver25);
164
164
  let widthInfo = over25Labels;
165
165
  const len = state.dataSource.length;
166
- if (!widthInfo.length || widthInfo.length === state.labelLevelsInfo.length || len >= 4) {
166
+ if (len >= 4) {
167
+ return getStyleConfig(state.labelLevelsInfo, { width: `${(1 / len * 100).toFixed(2)}%` });
168
+ }
169
+ if (!widthInfo.length || widthInfo.length === state.labelLevelsInfo.length) {
167
170
  return getStyleConfig(state.labelLevelsInfo, { maxWidth: `${(1 / len * 100).toFixed(2)}%` });
168
171
  }
169
172
  let fillArr;
@@ -18,7 +18,7 @@ const api = [
18
18
  "clickWheelItem",
19
19
  "loadDefault"
20
20
  ];
21
- const initState = ({ computed, reactive }) => {
21
+ const initState = (reactive) => {
22
22
  const state = reactive({
23
23
  dataSource: [],
24
24
  wheelData: [],
@@ -30,8 +30,7 @@ const initState = ({ computed, reactive }) => {
30
30
  wheelText: "",
31
31
  headerInfo: [],
32
32
  defaultSelectedIndexs: [],
33
- defaultSelectedArray: [],
34
- isActive: computed(() => state.headerInfo.some((item) => item.isUP))
33
+ defaultSelectedArray: []
35
34
  });
36
35
  return state;
37
36
  };
@@ -61,9 +60,9 @@ const initWatch = ({ watch, props, state, refs, nextTick }) => {
61
60
  }
62
61
  );
63
62
  };
64
- const renderless = (props, { computed, onMounted, reactive, watch }, { emit, nextTick, refs }) => {
63
+ const renderless = (props, { onMounted, reactive, watch }, { emit, nextTick, refs }) => {
65
64
  const api2 = {};
66
- const state = initState({ computed, reactive });
65
+ const state = initState(reactive);
67
66
  initApi({ api: api2, props, state, emit, nextTick, refs });
68
67
  initWatch({ watch, props, state, refs, nextTick });
69
68
  onMounted(() => {
package/nav-menu/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { isEmptyObject, isObject } from "@opentiny/vue-renderless/common/type";
3
- import PopupManager from "@opentiny/vue-renderless/common/deps/popup-manager";
4
- import { mapTree } from "@opentiny/vue-renderless/grid/static";
5
- import { transformTreeData } from "@opentiny/vue-renderless/common/array";
6
- import { on, off } from "@opentiny/vue-renderless/common/deps/dom";
7
- import { xss } from "@opentiny/vue-renderless/common/xss.js";
2
+ import { isEmptyObject, isObject } from "../common/type";
3
+ import PopupManager from "../common/deps/popup-manager";
4
+ import { mapTree } from "../grid/static";
5
+ import { transformTreeData } from "../common/array";
6
+ import { on, off } from "../common/deps/dom";
7
+ import { xss } from "../common/xss.js";
8
8
  const { nextZIndex } = PopupManager;
9
9
  const computedIsShowMore = ({ props, state }) => () => !/^(retract|fixed|hidden)$/.test(props.overflow) && state.more && state.more.length;
10
10
  const computedPopClass = (state) => () => !state.showMore && state.subMenus && state.subMenus.length === 1 ? "single" : "";
package/notify/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { KEY_CODE } from "@opentiny/vue-renderless/common";
3
- import { on, off } from "@opentiny/vue-renderless/common/deps/dom";
4
- import PopupManager from "@opentiny/vue-renderless/common/deps/popup-manager";
2
+ import { KEY_CODE } from "../common";
3
+ import { on, off } from "../common/deps/dom";
4
+ import PopupManager from "../common/deps/popup-manager";
5
5
  const startTimer = ({ api, state }) => () => {
6
6
  if (state.duration > 0) {
7
7
  state.timer = setTimeout(() => {
package/numeric/index.js CHANGED
@@ -2,11 +2,11 @@ import {
2
2
  __spreadProps,
3
3
  __spreadValues
4
4
  } from "../chunk-PKUHTIDK.js";
5
- import { formatNumber, roundFixed } from "@opentiny/vue-renderless/common/decimal";
6
- import { getMiniDecimal, lessEquals, equalsDecimal } from "@opentiny/vue-renderless/common/bigInt";
7
- import { isNumber, isNull } from "@opentiny/vue-renderless/common/type";
8
- import { MOUSEDELTA } from "@opentiny/vue-renderless/common";
9
- import { on, off } from "@opentiny/vue-renderless/common/deps/dom";
5
+ import { formatNumber, roundFixed } from "../common/decimal";
6
+ import { getMiniDecimal, lessEquals, equalsDecimal } from "../common/bigInt";
7
+ import { isNumber, isNull } from "../common/type";
8
+ import { MOUSEDELTA } from "../common";
9
+ import { on, off } from "../common/deps/dom";
10
10
  const initService = (service) => {
11
11
  const { utils = {} } = service || {};
12
12
  const noopFn = () => null;
@@ -263,11 +263,21 @@ const getUnitPrecision = ({ service, props }) => {
263
263
  rounding = isNumber(format.rounding) ? format.rounding : serFra.rounding;
264
264
  return __spreadValues(__spreadValues(__spreadProps(__spreadValues({}, defaultFmt), { fraction, rounding }), serFmt), format);
265
265
  };
266
+ const dispatchDisplayedValue = ({ state, api, dispatch }) => () => {
267
+ if (state.isDisplayOnly) {
268
+ dispatch("FormItem", "displayed-value-changed", { type: "numeric", val: api.getDisplayedValue() });
269
+ }
270
+ };
271
+ const getDisplayedValue = ({ state, props }) => () => {
272
+ return state.displayValue || state.displayValue === 0 ? state.displayValue + " " + (props.unit || "") : "-";
273
+ };
266
274
  export {
267
275
  decrease,
276
+ dispatchDisplayedValue,
268
277
  displayValue,
269
278
  focus,
270
279
  getDecimal,
280
+ getDisplayedValue,
271
281
  getNumPecision,
272
282
  getPrecision,
273
283
  getUnitPrecision,
package/numeric/vue.js CHANGED
@@ -22,7 +22,9 @@ import {
22
22
  getUnitPrecision,
23
23
  getDecimal,
24
24
  unmounted,
25
- initService
25
+ initService,
26
+ dispatchDisplayedValue,
27
+ getDisplayedValue
26
28
  } from "./index";
27
29
  const api = ["state", "decrease", "increase", "handleBlur", "handleFocus", "handleInput", "handleInputChange", "mouseEvent", "focus", "select"];
28
30
  const initState = ({ reactive, computed, props, api: api2, $service, parent }) => {
@@ -42,7 +44,8 @@ const initState = ({ reactive, computed, props, api: api2, $service, parent }) =
42
44
  minDisabled: computed(() => !props.circulate && api2.internalDecrease({ val: props.modelValue, step: props.step }) < props.min || state.formDisabled),
43
45
  maxDisabled: computed(() => !props.circulate && api2.internalIncrease({ val: props.modelValue, step: props.step }) > props.max || state.formDisabled),
44
46
  controlsAtRight: computed(() => props.controls && props.controlsPosition === "right"),
45
- format: computed(() => getUnitPrecision({ service: $service, props }))
47
+ format: computed(() => getUnitPrecision({ service: $service, props })),
48
+ isDisplayOnly: computed(() => props.displayOnly || (parent.tinyForm || {}).displayOnly)
46
49
  });
47
50
  return state;
48
51
  };
@@ -69,12 +72,15 @@ const initApi = ({ api: api2, props, state, parent, refs, emit, dispatch, consta
69
72
  mouseEvent: mouseEvent({ api: api2, props, state }),
70
73
  handleBlur: handleBlur({ constants, dispatch, emit, props, state, api: api2 }),
71
74
  watchValue: watchValue({ api: api2, state }),
72
- setCurrentValue: setCurrentValue({ api: api2, constants, dispatch, emit, props, state })
75
+ setCurrentValue: setCurrentValue({ api: api2, constants, dispatch, emit, props, state }),
76
+ dispatchDisplayedValue: dispatchDisplayedValue({ api: api2, state, dispatch }),
77
+ getDisplayedValue: getDisplayedValue({ state, props })
73
78
  });
74
79
  api2.getDecimal(0);
75
80
  };
76
- const initWatch = ({ watch, props, api: api2 }) => {
81
+ const initWatch = ({ state, watch, props, api: api2 }) => {
77
82
  watch(() => props.modelValue, api2.watchValue, { immediate: true });
83
+ watch(() => state.isDisplayOnly, api2.dispatchDisplayedValue);
78
84
  };
79
85
  const renderless = (props, { computed, onMounted, onUpdated, onUnmounted, reactive, watch, inject }, { parent, emit, refs, constants, dispatch, service }) => {
80
86
  const api2 = {};
@@ -82,8 +88,11 @@ const renderless = (props, { computed, onMounted, onUpdated, onUnmounted, reacti
82
88
  const state = initState({ reactive, computed, props, api: api2, $service, parent });
83
89
  parent.tinyForm = parent.tinyForm || inject("form", null);
84
90
  initApi({ api: api2, props, state, parent, refs, emit, dispatch, constants });
85
- initWatch({ watch, props, api: api2 });
86
- onMounted(api2.mounted);
91
+ initWatch({ state, watch, props, api: api2 });
92
+ onMounted(() => {
93
+ api2.dispatchDisplayedValue();
94
+ api2.mounted();
95
+ });
87
96
  onUpdated(api2.updated);
88
97
  onUnmounted(api2.unmounted);
89
98
  return api2;
package/option/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { getObj } from "@opentiny/vue-renderless/common/object";
2
+ import { getObj } from "../common/object";
3
3
  const escapeRegexpString = (value = "") => String(value).replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
4
4
  const isEqual = ({ select, state }) => (a, b) => {
5
5
  if (!state.isObject) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-renderless",
3
- "version": "3.6.8",
3
+ "version": "3.8.2",
4
4
  "description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
5
5
  "homepage": "https://opentiny.design/tiny-vue",
6
6
  "keywords": [
@@ -19,6 +19,7 @@
19
19
  "sideEffects": false,
20
20
  "scripts": {
21
21
  "build": "tsup",
22
+ "build:fast": "npm run build && npm run release",
22
23
  "postversion": "pnpm build",
23
24
  "release": "esno ./scripts/postbuild.ts && cp README.md dist"
24
25
  },
package/pager/vue.js ADDED
@@ -0,0 +1,10 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ const api = [];
3
+ function renderless() {
4
+ const api2 = {};
5
+ return api2;
6
+ }
7
+ export {
8
+ api,
9
+ renderless
10
+ };
@@ -88,7 +88,7 @@ const onPagerClick = ({ emit, props, vm }) => (event) => {
88
88
  };
89
89
  if (props.isBeforePageChange && newPage !== currentPage) {
90
90
  let params = { newPage, currentPage, callback };
91
- vm.$parent.beforePagerChangeHandler(params);
91
+ vm.$parent.$parent.beforePagerChangeHandler(params);
92
92
  } else {
93
93
  callback();
94
94
  }
package/panel/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { emitEvent } from "@opentiny/vue-renderless/common/event";
2
+ import { emitEvent } from "../common/event";
3
3
  const toggle = ({ api, state }) => () => {
4
4
  state.isShow ? api.collapse() : api.expand();
5
5
  };
package/picker/index.js CHANGED
@@ -2,13 +2,13 @@ import {
2
2
  __spreadProps,
3
3
  __spreadValues
4
4
  } from "../chunk-PKUHTIDK.js";
5
- import { toDate, getDateWithNewTimezone, getStrTimezone, getLocalTimezone } from "@opentiny/vue-renderless/common/date";
6
- import { isNumber, isDate } from "@opentiny/vue-renderless/common/type";
7
- import userPopper from "@opentiny/vue-renderless/common/deps/vue-popper";
8
- import { DATEPICKER } from "@opentiny/vue-renderless/common";
9
- import { formatDate, parseDate, isDateObject, getWeekNumber } from "@opentiny/vue-renderless/common/deps/date-util";
10
- import { extend } from "@opentiny/vue-renderless/common/object";
11
- import globalTimezone from "@opentiny/vue-renderless/picker/timezone";
5
+ import { toDate, getDateWithNewTimezone, getStrTimezone, getLocalTimezone } from "../common/date";
6
+ import { isNumber, isDate } from "../common/type";
7
+ import userPopper from "../common/deps/vue-popper";
8
+ import { DATEPICKER } from "../common";
9
+ import { formatDate, parseDate, isDateObject, getWeekNumber } from "../common/deps/date-util";
10
+ import { extend } from "../common/object";
11
+ import globalTimezone from "../picker/timezone";
12
12
  const iso8601Reg = /^\d{4}-\d{2}-\d{2}(.)\d{2}:\d{2}:\d{2}(.+)$/;
13
13
  const getPanel = ({ DatePanel, DateRangePanel, MonthRangePanel, TimePanel, TimeRangePanel, TimeSelect }) => (type) => {
14
14
  if (type === DATEPICKER.DateRange || type === DATEPICKER.DateTimeRange) {
package/picker/vue.js CHANGED
@@ -52,7 +52,7 @@ import {
52
52
  initGlobalTimezone,
53
53
  emitDbTime
54
54
  } from "./index";
55
- import { DATEPICKER } from "@opentiny/vue-renderless/common";
55
+ import { DATEPICKER } from "../common";
56
56
  const api = [
57
57
  "state",
58
58
  "btnClick",
@@ -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 computedWrapperStyle = (state) => () => {
4
4
  const wrapperStyle = {
5
5
  transform: `translate3d(0, ${state.offset + state.baseOffset}px, 0)`,
@@ -0,0 +1,25 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ const hide = ({ state, emit }) => () => {
3
+ state.isLock = true;
4
+ setTimeout(() => {
5
+ state.isLock = false;
6
+ }, 300);
7
+ state.showPopover = false;
8
+ emit("hide", state);
9
+ };
10
+ const show = ({ state, emit, props }) => (trigger) => {
11
+ if (trigger && props.trigger !== trigger || state.isLock || state.showPopover) {
12
+ return;
13
+ }
14
+ state.showPopover = true;
15
+ emit("show", state);
16
+ };
17
+ const confirm = ({ state, emit }) => () => {
18
+ state.showPopover = false;
19
+ emit("confirm", state);
20
+ };
21
+ export {
22
+ confirm,
23
+ hide,
24
+ show
25
+ };
@@ -0,0 +1,22 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import { show, hide, confirm } from "./index";
3
+ const api = ["state", "show", "hide", "confirm"];
4
+ const renderless = (props, { computed, reactive }, { emit, constants }) => {
5
+ const api2 = {};
6
+ const state = reactive({
7
+ isLock: false,
8
+ showPopover: false,
9
+ getIcon: computed(() => typeof props.type === "object" ? props.type : constants.ICON_MAP[props.type])
10
+ });
11
+ Object.assign(api2, {
12
+ state,
13
+ show: show({ state, emit, props }),
14
+ hide: hide({ state, emit }),
15
+ confirm: confirm({ state, emit })
16
+ });
17
+ return api2;
18
+ };
19
+ export {
20
+ api,
21
+ renderless
22
+ };
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  __spreadValues
3
3
  } from "../chunk-PKUHTIDK.js";
4
- import { find } from "@opentiny/vue-renderless/common/array";
5
- import { typeOf, isNull } from "@opentiny/vue-renderless/common/type";
6
- import { getDataset } from "@opentiny/vue-renderless/common/dataset";
7
- import { isNullOrEmpty } from "@opentiny/vue-renderless/common/string";
8
- import { isEqual } from "@opentiny/vue-renderless/common/object";
9
- import { eachTree } from "@opentiny/vue-renderless/grid/static";
10
- import { on, off } from "@opentiny/vue-renderless/common/deps/dom";
4
+ import { find } from "../common/array";
5
+ import { typeOf, isNull } from "../common/type";
6
+ import { getDataset } from "../common/dataset";
7
+ import { isNullOrEmpty } from "../common/string";
8
+ import { isEqual } from "../common/object";
9
+ import { eachTree } from "../grid/static";
10
+ import { on, off } from "../common/deps/dom";
11
11
  const computedGetTitle = ({ constants, props, t }) => props.title || t(constants.TITLE);
12
12
  const computedModalWidth = ({ constants, props }) => {
13
13
  let modalWidth = 0;
package/popeditor/vue.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  __spreadValues
3
3
  } from "../chunk-PKUHTIDK.js";
4
- import debounce from "@opentiny/vue-renderless/common/deps/debounce";
5
- import userPopper from "@opentiny/vue-renderless/common/deps/vue-popper";
4
+ import debounce from "../common/deps/debounce";
5
+ import userPopper from "../common/deps/vue-popper";
6
6
  import {
7
7
  computedGetTitle,
8
8
  computedTreeOp,
package/popover/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { on, off, addClass, removeClass } from "@opentiny/vue-renderless/common/deps/dom";
3
- import { guid } from "@opentiny/vue-renderless/common/string";
4
- import { KEY_CODE } from "@opentiny/vue-renderless/common";
2
+ import { on, off, addClass, removeClass } from "../common/deps/dom";
3
+ import { guid } from "../common/string";
4
+ import { KEY_CODE } from "../common";
5
5
  const processTrigger = ({ api, state, props, nextTick }) => {
6
6
  const { referenceElm, popperElm } = state;
7
7
  if (props.trigger === "click") {
@@ -155,6 +155,13 @@ const wrapMounted = ({ api, props, refs, state }) => () => {
155
155
  }
156
156
  state.referenceElm && api.mounted();
157
157
  };
158
+ const observeCallback = ({ state, vm }) => (mutationsList) => {
159
+ for (let mutation of mutationsList) {
160
+ if (mutation.type === "attributes" && mutation.attributeName === "x-placement") {
161
+ state.xPlacement = vm.$refs.popper.getAttribute("x-placement") || "bottom";
162
+ }
163
+ }
164
+ };
158
165
  export {
159
166
  cleanup,
160
167
  computedTooltipId,
@@ -173,5 +180,6 @@ export {
173
180
  handleMouseEnter,
174
181
  handleMouseLeave,
175
182
  mounted,
183
+ observeCallback,
176
184
  wrapMounted
177
185
  };
package/popover/vue.js CHANGED
@@ -17,9 +17,10 @@ import {
17
17
  handleDocumentClick,
18
18
  cleanup,
19
19
  wrapMounted,
20
- handleItemClick
20
+ handleItemClick,
21
+ observeCallback
21
22
  } from "./index";
22
- import userPopper from "@opentiny/vue-renderless/common/deps/vue-popper";
23
+ import userPopper from "../common/deps/vue-popper";
23
24
  const api = ["state", "handleAfterEnter", "handleAfterLeave", "handleItemClick"];
24
25
  const initState = ({ reactive, computed, api: api2, popperElm, showPopper, referenceElm }) => {
25
26
  const state = reactive({
@@ -32,7 +33,7 @@ const initState = ({ reactive, computed, api: api2, popperElm, showPopper, refer
32
33
  });
33
34
  return state;
34
35
  };
35
- const initApi = ({ api: api2, props, state, refs, emit, doDestroy, constants, nextTick }) => {
36
+ const initApi = ({ api: api2, props, state, refs, emit, doDestroy, constants, nextTick, vm }) => {
36
37
  Object.assign(api2, {
37
38
  state,
38
39
  mounted: mounted({ api: api2, state, constants, props, nextTick }),
@@ -53,10 +54,11 @@ const initApi = ({ api: api2, props, state, refs, emit, doDestroy, constants, ne
53
54
  handleMouseEnter: handleMouseEnter({ props, state }),
54
55
  handleDocumentClick: handleDocumentClick({ refs, state }),
55
56
  wrapMounted: wrapMounted({ api: api2, props, refs, state }),
56
- handleItemClick: handleItemClick({ emit, state })
57
+ handleItemClick: handleItemClick({ emit, state }),
58
+ observeCallback: observeCallback({ vm, state })
57
59
  });
58
60
  };
59
- const initWatch = ({ watch, props, state, emit }) => {
61
+ const initWatch = ({ watch, props, state, emit, api: api2, nextTick }) => {
60
62
  watch(
61
63
  () => state.showPopper,
62
64
  (val) => {
@@ -67,23 +69,44 @@ const initWatch = ({ watch, props, state, emit }) => {
67
69
  },
68
70
  { immediate: true }
69
71
  );
72
+ watch(
73
+ () => props.reference,
74
+ (val, oldVal) => {
75
+ if (val !== oldVal) {
76
+ api2.destroyed();
77
+ nextTick(() => {
78
+ api2.wrapMounted();
79
+ });
80
+ }
81
+ }
82
+ );
70
83
  };
71
- const renderless = (props, { reactive, computed, watch, toRefs, onBeforeUnmount, onMounted, onUnmounted, onActivated, onDeactivated }, { $prefix, emit, refs, slots, nextTick }) => {
84
+ const renderless = (props, { reactive, computed, watch, toRefs, onBeforeUnmount, onMounted, onUnmounted, onActivated, onDeactivated }, { $prefix, emit, vm, refs, slots, nextTick }) => {
72
85
  const api2 = {};
73
86
  const constants = { IDPREFIX: `${$prefix.toLowerCase()}-popover` };
74
87
  const options = { emit, onBeforeUnmount, nextTick, reactive, props, watch, onDeactivated, refs, slots, toRefs };
75
88
  const { showPopper, popperElm, referenceElm, doDestroy } = userPopper(options);
76
89
  const state = initState({ reactive, computed, api: api2, popperElm, showPopper, referenceElm });
77
- initApi({ api: api2, constants, props, state, refs, emit, doDestroy, nextTick });
90
+ initApi({ api: api2, constants, props, state, refs, emit, doDestroy, nextTick, vm });
78
91
  onDeactivated(() => {
79
92
  api2.destroyed();
80
93
  api2.cleanup();
81
94
  });
82
- onMounted(api2.wrapMounted);
95
+ onMounted(() => {
96
+ api2.wrapMounted();
97
+ if (props.genArrowByHtml) {
98
+ const config = { attributes: true, childList: false, subtree: false };
99
+ api2.observer = new MutationObserver(api2.observeCallback);
100
+ api2.observer.observe(vm.$refs.popper, config);
101
+ }
102
+ });
83
103
  onActivated(api2.mounted);
84
- onUnmounted(api2.destroyed);
104
+ onUnmounted(() => {
105
+ api2.destroyed();
106
+ api2.observer && api2.observer.disconnect();
107
+ });
85
108
  onBeforeUnmount(api2.cleanup);
86
- initWatch({ watch, props, state, emit });
109
+ initWatch({ watch, props, state, emit, api: api2, nextTick });
87
110
  return api2;
88
111
  };
89
112
  export {
package/popup/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  __spreadValues
3
3
  } from "../chunk-PKUHTIDK.js";
4
- import { on, off } from "@opentiny/vue-renderless/common/deps/dom";
5
- import { touchStart, touchMove } from "@opentiny/vue-renderless/common/deps/touch";
6
- import { getScroller } from "@opentiny/vue-renderless/dropdown-menu";
7
- import { isNull } from "@opentiny/vue-renderless/common/type";
4
+ import { on, off } from "../common/deps/dom";
5
+ import { touchStart, touchMove } from "../common/deps/touch";
6
+ import { getScroller } from "../dropdown-menu";
7
+ import { isNull } from "../common/type";
8
8
  const getStyle = (props) => () => {
9
9
  const style = __spreadValues({}, props.popupStyle);
10
10
  if (!isNull(props.duration)) {
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  __spreadValues
3
3
  } from "../chunk-PKUHTIDK.js";
4
- import { on, off } from "@opentiny/vue-renderless/common/deps/dom";
4
+ import { on, off } from "../common/deps/dom";
5
5
  const initPullRefresh = ({ t, props, state }) => () => {
6
+ var _a, _b, _c;
6
7
  const defaultOption = {
7
8
  pullingUpText: t("ui.pullRefresh.pullingUp"),
8
9
  pullingDownText: t("ui.pullRefresh.pullingDown"),
@@ -17,17 +18,16 @@ const initPullRefresh = ({ t, props, state }) => () => {
17
18
  paddingTop: state.pullDown.headHeight + "px",
18
19
  paddingBottom: state.pullUp.footHeight + "px"
19
20
  };
21
+ state.loosingText = (_a = props.loosingText) != null ? _a : t("ui.pullRefresh.loosing");
22
+ state.successText = (_b = props.successText) != null ? _b : t("ui.pullRefresh.success");
23
+ state.failedText = (_c = props.failedText) != null ? _c : t("ui.pullRefresh.failed");
20
24
  };
21
25
  const onTouchstart = (state) => (event) => {
22
26
  state.draggposition = event.touches[0].clientY;
23
27
  };
24
- const onTouchmove = ({ props, state, refs }) => (event) => {
28
+ const onTouchmove = ({ props, state }) => (event) => {
25
29
  if (event.touches[0].clientY < state.draggposition) {
26
- const scrollBottom = refs.content.scrollHeight - refs.content.clientHeight - refs.content.scrollTop;
27
- if (scrollBottom > 10) {
28
- return;
29
- }
30
- if (!state.pullUp.pullUpDisabled && state.pullUp.handler) {
30
+ if (!state.pullUp.pullUpDisabled) {
31
31
  if (props.hasMore) {
32
32
  state.translate3d = (event.touches[0].clientY - state.draggposition) / 2;
33
33
  state.pullUpReplaces = Math.abs(state.translate3d) > state.pullUp.footHeight ? state.loosingText : state.pullUp.pullingUpText;
@@ -35,10 +35,7 @@ const onTouchmove = ({ props, state, refs }) => (event) => {
35
35
  }
36
36
  }
37
37
  } else {
38
- if (refs.content.scrollTop > 10) {
39
- return;
40
- }
41
- if (!state.pullDown.pullDownDisabled && state.pullDown.handler) {
38
+ if (!state.pullDown.pullDownDisabled) {
42
39
  state.translate3d = (event.touches[0].clientY - state.draggposition) / 2;
43
40
  state.pullDownReplaces = Math.abs(state.translate3d) > state.pullDown.headHeight ? state.loosingText : state.pullDown.pullingDownText;
44
41
  state.pullUpReplaces = "";
@@ -1,7 +1,7 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
2
  import { mountedHandler, beforeUnmountHandler, handlerModelValue, onTouchstart, onTouchmove, onTouchend, initPullRefresh, clearPullRefresh } from "./index";
3
3
  const api = ["state"];
4
- const renderless = (props, { watch, onMounted, computed, reactive, onBeforeUnmount }, { t, refs }) => {
4
+ const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount }, { t, refs }) => {
5
5
  const api2 = {};
6
6
  const state = reactive({
7
7
  pullUpReplaces: "",
@@ -11,10 +11,10 @@ const renderless = (props, { watch, onMounted, computed, reactive, onBeforeUnmou
11
11
  draggposition: 0,
12
12
  pullUpLoading: false,
13
13
  pullDownLoading: false,
14
- loosingText: computed(() => props.loosingText || t("ui.pullRefresh.loosing")),
15
- successText: computed(() => props.successText || t("ui.pullRefresh.success")),
16
- failedText: computed(() => props.failedText || t("ui.pullRefresh.failed")),
17
- noMoreText: computed(() => !props.hasMore ? t("ui.pullRefresh.noMore") : ""),
14
+ loosingText: "",
15
+ successText: "",
16
+ failedText: "",
17
+ noMoreText: "",
18
18
  pullUp: null,
19
19
  pullDown: null,
20
20
  successDuration: props.successDuration,
@@ -23,7 +23,7 @@ const renderless = (props, { watch, onMounted, computed, reactive, onBeforeUnmou
23
23
  Object.assign(api2, {
24
24
  state,
25
25
  onTouchstart: onTouchstart(state),
26
- onTouchmove: onTouchmove({ props, state, refs }),
26
+ onTouchmove: onTouchmove({ props, state }),
27
27
  onTouchend: onTouchend({ api: api2, props, state }),
28
28
  mountedHandler: mountedHandler({ api: api2, refs }),
29
29
  beforeUnmountHandler: beforeUnmountHandler({ api: api2, refs }),
@@ -35,7 +35,7 @@ const renderless = (props, { watch, onMounted, computed, reactive, onBeforeUnmou
35
35
  () => props.hasMore,
36
36
  (value) => {
37
37
  if (!value) {
38
- state.pullUpLoading = false;
38
+ state.noMoreText = t("ui.pullRefresh.noMore");
39
39
  api2.clearPullRefresh();
40
40
  }
41
41
  }
package/radio/index.js CHANGED
@@ -35,7 +35,24 @@ const toggleEvent = ({ props, refs, type }) => {
35
35
  radioEl[type + "EventListener"](ev, props.events[ev]);
36
36
  });
37
37
  };
38
+ const dispatchDisplayedValue = ({ state, dispatch, api }) => () => {
39
+ if (state.isDisplayOnly) {
40
+ dispatch("FormItem", "displayed-value-changed", {
41
+ type: "radio",
42
+ val: api.getDisplayedValue()
43
+ });
44
+ }
45
+ };
46
+ const getDisplayedValue = ({ vm, state, props }) => () => {
47
+ if (state.model === props.label) {
48
+ return vm.$refs.label && vm.$refs.label.innerText || props.text || props.label;
49
+ } else {
50
+ return "";
51
+ }
52
+ };
38
53
  export {
54
+ dispatchDisplayedValue,
55
+ getDisplayedValue,
39
56
  getModel,
40
57
  handleChange,
41
58
  isDisabled,
package/radio/vue.js CHANGED
@@ -1,7 +1,18 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { handleChange, isGroup, radioSize, isDisabled, tabIndex, getModel, setModel, toggleEvent } from "./index";
2
+ import {
3
+ handleChange,
4
+ isGroup,
5
+ radioSize,
6
+ isDisabled,
7
+ tabIndex,
8
+ getModel,
9
+ setModel,
10
+ toggleEvent,
11
+ dispatchDisplayedValue,
12
+ getDisplayedValue
13
+ } from "./index";
3
14
  const api = ["state", "handleChange"];
4
- const renderless = (props, { onMounted, onBeforeUnmount, computed, reactive, inject }, { refs, parent, emit, constants, nextTick, dispatch }) => {
15
+ const renderless = (props, { onMounted, onBeforeUnmount, computed, reactive, inject, watch }, { refs, vm, parent, emit, constants, nextTick, dispatch }) => {
5
16
  parent.tinyForm = parent.tinyForm || inject("form", null);
6
17
  const api2 = {};
7
18
  const state = reactive({
@@ -25,9 +36,13 @@ const renderless = (props, { onMounted, onBeforeUnmount, computed, reactive, inj
25
36
  tabIndex: tabIndex({ props, state }),
26
37
  isDisabled: isDisabled({ props, state }),
27
38
  setModel: setModel({ constants, dispatch, emit, props, refs, state }),
28
- handleChange: handleChange({ constants, dispatch, emit, state, nextTick })
39
+ handleChange: handleChange({ constants, dispatch, emit, state, nextTick }),
40
+ dispatchDisplayedValue: dispatchDisplayedValue({ state, api: api2, dispatch }),
41
+ getDisplayedValue: getDisplayedValue({ vm, state, props })
29
42
  });
43
+ watch(() => state.isDisplayOnly, api2.dispatchDisplayedValue);
30
44
  onMounted(() => {
45
+ api2.dispatchDisplayedValue();
31
46
  dispatch("Tooltip", "tooltip-update");
32
47
  toggleEvent({ props, refs, type: "add" });
33
48
  });