@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
File without changes
@@ -0,0 +1,14 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ const api = ["state"];
3
+ const renderless = (props, { reactive }) => {
4
+ const api2 = {};
5
+ const state = reactive({});
6
+ Object.assign(api2, {
7
+ state
8
+ });
9
+ return api2;
10
+ };
11
+ export {
12
+ api,
13
+ renderless
14
+ };
@@ -0,0 +1,50 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import { isNull } from "../common/type";
3
+ const handelIconClick = ({ emit }) => (item, index) => {
4
+ if (item.disabled)
5
+ return;
6
+ emit("icon-click", item, index);
7
+ };
8
+ const handleChange = ({ constants, dispatch, emit, state, nextTick }) => () => {
9
+ nextTick(() => {
10
+ emit("change", state.model);
11
+ state.isGroup && dispatch(constants.COLUMN_GROUP, "change", [state.model]);
12
+ });
13
+ };
14
+ const getIsGroup = ({ constants, parent: $parent, state }) => () => {
15
+ let parent = $parent;
16
+ while (parent) {
17
+ if (parent.$options.componentName !== constants.COLUMN_GROUP) {
18
+ parent = parent.$parent;
19
+ } else {
20
+ state.columnGroup = parent;
21
+ return true;
22
+ }
23
+ }
24
+ return false;
25
+ };
26
+ const getSize = ({ props, state }) => () => state.isGroup ? state.columnGroup.size || props.size : props.size;
27
+ const isDisabled = ({ props, state }) => () => props.checkboxDisabled || state.columnGroup.disabled;
28
+ const getModel = ({ props, state }) => () => {
29
+ const model = state.isGroup ? state.store : props.modelValue !== void 0 ? props.modelValue : state.selfModel;
30
+ return isNull(model) ? [] : model;
31
+ };
32
+ const setModel = ({ constants, dispatch, emit, state }) => (val) => {
33
+ if (state.isGroup) {
34
+ dispatch(constants.COLUMN_GROUP, "update:modelValue", [val]);
35
+ } else {
36
+ emit("update:modelValue", val);
37
+ state.selfModel = val;
38
+ }
39
+ };
40
+ const computedStore = ({ state, props }) => () => state.isGroup ? state.columnGroup.modelValue : props.modelValue;
41
+ export {
42
+ computedStore,
43
+ getIsGroup,
44
+ getModel,
45
+ getSize,
46
+ handelIconClick,
47
+ handleChange,
48
+ isDisabled,
49
+ setModel
50
+ };
@@ -0,0 +1,39 @@
1
+ import "../chunk-PKUHTIDK.js";
2
+ import { handelIconClick, handleChange, getIsGroup, getSize, isDisabled, getModel, setModel, computedStore } from "./index";
3
+ const api = ["state", "handelIconClick"];
4
+ const renderless = (props, { reactive, watch, computed }, { vm, parent, emit, constants, nextTick, dispatch }) => {
5
+ const api2 = {};
6
+ const state = reactive({
7
+ columnGroup: {},
8
+ itemChecked: props.modelValue,
9
+ sliceNum: computed(() => props.size === "small" ? 1 : 2),
10
+ iconNum: computed(() => props.size === "small" ? 2 : 3),
11
+ effectOptions: computed(() => props.options.filter((item) => !item.hidden)),
12
+ showCheckbox: computed(() => props.showCheckbox || state.columnGroup.showCheckbox),
13
+ store: computed(() => api2.computedStore()),
14
+ getIsGroup: computed(() => api2.getIsGroup()),
15
+ size: computed(() => api2.getSize()),
16
+ disabled: computed(() => api2.isDisabled()),
17
+ model: computed({
18
+ get: () => api2.getModel(),
19
+ set: (val) => api2.setModel(val)
20
+ })
21
+ });
22
+ Object.assign(api2, {
23
+ state,
24
+ getSize: getSize({ props, state }),
25
+ getModel: getModel({ props, state }),
26
+ getIsGroup: getIsGroup({ constants, parent, state }),
27
+ isDisabled: isDisabled({ props, state }),
28
+ setModel: setModel({ constants, dispatch, emit, props, vm, state }),
29
+ handleChange: handleChange({ constants, dispatch, emit, state, nextTick }),
30
+ computedStore: computedStore({ state, props }),
31
+ handelIconClick: handelIconClick({ emit })
32
+ });
33
+ watch(() => state.model, api2.handleChange, { deep: true });
34
+ return api2;
35
+ };
36
+ export {
37
+ api,
38
+ renderless
39
+ };
package/common/array.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  __spreadValues
3
3
  } from "../chunk-PKUHTIDK.js";
4
- import { SORT } from "@opentiny/vue-renderless/common";
5
- import { isSame } from "@opentiny/vue-renderless/common/type";
6
- import { getObj } from "@opentiny/vue-renderless/common/object";
4
+ import { SORT } from "./index";
5
+ import { isSame } from "./type";
6
+ import { getObj } from "./object";
7
7
  const indexOf = (arr, data, predicate = isSame) => {
8
8
  if (Array.isArray(arr) && typeof predicate === "function") {
9
9
  for (let i = 0, len = arr.length; i < len; i++) {
package/common/bigInt.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { fillChar } from "@opentiny/vue-renderless/common/string";
2
+ import { fillChar } from "./string";
3
3
  const BigInt = window.BigInt;
4
4
  function supportBigInt() {
5
5
  return typeof BigInt === "function";
@@ -116,7 +116,10 @@ class BigIntDecimal {
116
116
  num2str(mergedValue);
117
117
  }
118
118
  const f = Function;
119
- const convertBigInt = (str) => f(`return BigInt(${str})`)();
119
+ const convertBigInt = (str) => {
120
+ const validStr = str.replace(/^0+/, "") || "0";
121
+ return f(`return BigInt(${validStr})`)();
122
+ };
120
123
  if (validateNumber(mergedValue)) {
121
124
  const trimRet = trimNumber(mergedValue);
122
125
  this.negative = trimRet.negative;
@@ -2,9 +2,9 @@ import {
2
2
  __objRest,
3
3
  __spreadValues
4
4
  } from "../../chunk-PKUHTIDK.js";
5
- import { format } from "@opentiny/vue-renderless/common/string";
6
- import { isObject } from "@opentiny/vue-renderless/common/type";
7
- import { transformTreeData } from "@opentiny/vue-renderless/common/array";
5
+ import { format } from "../string";
6
+ import { isObject } from "../type";
7
+ import { transformTreeData } from "../array";
8
8
  const getFilterStr = (filters) => {
9
9
  const filterArr = {};
10
10
  Object.keys(filters).forEach((property) => {
package/common/date.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { isDate, isNumber, isNumeric } from "@opentiny/vue-renderless/common/type";
3
- import { fillChar } from "@opentiny/vue-renderless/common/string";
2
+ import { isDate, isNumber, isNumeric } from "./type";
3
+ import { fillChar } from "./string";
4
4
  const daysInMonths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
5
5
  const yyyymmddReg = new RegExp(
6
6
  "^(\\d{4})(/|-)(((0)?[1-9])|(1[0-2]))((/|-)(((0)?[1-9])|([1-2][0-9])|(3[0-1])))?( ((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?$"
@@ -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 "./dom";
3
3
  const MapShim = function() {
4
4
  if (typeof Map !== "undefined") {
5
5
  return Map;
@@ -1,5 +1,5 @@
1
1
  import "../../chunk-PKUHTIDK.js";
2
- import { on } from "@opentiny/vue-renderless/common/deps/dom";
2
+ import { on } from "./dom";
3
3
  const isServer = typeof window === "undefined";
4
4
  const nodeList = [];
5
5
  const nameSpace = "@@clickoutsideContext";
@@ -1,8 +1,8 @@
1
1
  import "../../chunk-PKUHTIDK.js";
2
- import fecha from "@opentiny/vue-renderless/common/deps/date";
3
- import { isNull } from "@opentiny/vue-renderless/common/type";
4
- import { isLeapYear } from "@opentiny/vue-renderless/common/date";
5
- import { DATEPICKER } from "@opentiny/vue-renderless/common";
2
+ import fecha from "./date";
3
+ import { isNull } from "../type";
4
+ import { isLeapYear } from "../date";
5
+ import { DATEPICKER } from "../index";
6
6
  const weeks = DATEPICKER.Weeks;
7
7
  const months = DATEPICKER.MonhtList;
8
8
  const defaultYMD = DATEPICKER.DateFormats.date;
@@ -1,6 +1,6 @@
1
1
  import "../../chunk-PKUHTIDK.js";
2
- import { DATEPICKER } from "@opentiny/vue-renderless/common";
3
- import { isNull, isDate } from "@opentiny/vue-renderless/common/type";
2
+ import { DATEPICKER } from "../index";
3
+ import { isNull, isDate } from "../type";
4
4
  const fecha = {};
5
5
  const digitsReg = ["\\d\\d?", "\\d{3}", "\\d{4}"];
6
6
  const twoDigits = digitsReg[0];
@@ -1,5 +1,5 @@
1
1
  import "../../chunk-PKUHTIDK.js";
2
- import throttle from "@opentiny/vue-renderless/common/deps/throttle";
2
+ import throttle from "./throttle";
3
3
  function debounce_default(delay, atBegin, callback) {
4
4
  return callback === void 0 ? throttle(delay, atBegin, false) : throttle(delay, callback, atBegin !== false);
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import "../../chunk-PKUHTIDK.js";
2
- import { hasOwn, isObject, isNull } from "@opentiny/vue-renderless/common/type";
2
+ import { hasOwn, isObject, isNull } from "../type";
3
3
  const isServer = typeof window === "undefined";
4
4
  const SPECIAL_CHARS_REGEXP = /([:\-_]+(.))/g;
5
5
  const MOZ_HACK_REGEXP = /^moz([A-Z])/;
@@ -1,7 +1,7 @@
1
1
  import "../../../chunk-PKUHTIDK.js";
2
- import { extend } from "@opentiny/vue-renderless/common/object";
3
- import { on, off } from "@opentiny/vue-renderless/common/deps/dom";
4
- import screenfull from "@opentiny/vue-renderless/common/deps/fullscreen/screenfull";
2
+ import { extend } from "../../object";
3
+ import { on, off } from "../dom";
4
+ import screenfull from "./screenfull";
5
5
  const defaults = {
6
6
  callback: () => void 0,
7
7
  fullscreenClass: "fullscreen",
@@ -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 "../dom";
3
3
  const fullscreenApi = ["fullscreenElement", "fullscreenEnabled", "requestFullscreen", "exitFullscreen", "fullscreenchange", "fullscreenerror"];
4
4
  const fullscreenApiMoz = [
5
5
  "mozFullScreenElement",
@@ -0,0 +1,176 @@
1
+ import "../../chunk-PKUHTIDK.js";
2
+ import throttle from "./throttle";
3
+ const CONTEXT_KEY = "@@infinitescrollContext";
4
+ const OBSERVER_CHECK_INTERVAL = 50;
5
+ const ATTR_DEFAULT_DELAY = 200;
6
+ const ATTR_DEFAULT_DISTANCE = 0;
7
+ const attrs = {
8
+ delay: { type: Number, default: ATTR_DEFAULT_DELAY },
9
+ disabled: { type: Boolean, default: false },
10
+ distance: { type: Number, default: ATTR_DEFAULT_DISTANCE },
11
+ immediate: { type: Boolean, default: true }
12
+ };
13
+ const isNull = (val) => val === null;
14
+ const parseAttrValue = (attrVal, type, defaultVal) => {
15
+ if (isNull(attrVal))
16
+ return defaultVal;
17
+ if (type === Boolean) {
18
+ return attrVal !== "false";
19
+ } else if (type === Number) {
20
+ return Number(attrVal);
21
+ }
22
+ };
23
+ const computeScrollOptions = (el, instance) => Object.entries(attrs).reduce((accumulator, [name, option]) => {
24
+ const { type, default: defaultValue } = option;
25
+ const attrKey = `infinite-scroll-${name}`;
26
+ const $attrValue = instance.$el.getAttribute(attrKey);
27
+ const attrValue = el.getAttribute(attrKey);
28
+ let value;
29
+ if (isNull(attrValue) && isNull($attrValue) || !isNull(attrValue)) {
30
+ value = parseAttrValue(attrValue, type, defaultValue);
31
+ }
32
+ if (isNull(attrValue) && !isNull($attrValue)) {
33
+ value = parseAttrValue($attrValue, type, defaultValue);
34
+ }
35
+ accumulator[name] = Number.isNaN(value) ? defaultValue : value;
36
+ return accumulator;
37
+ }, {});
38
+ const stopObserver = (el) => {
39
+ const { observer } = el[CONTEXT_KEY];
40
+ if (observer) {
41
+ observer.disconnect();
42
+ delete el[CONTEXT_KEY].observer;
43
+ }
44
+ };
45
+ const accumOffsetTop = (el) => {
46
+ let totalOffset = 0;
47
+ let parent = el;
48
+ while (parent) {
49
+ totalOffset += parent.offsetTop;
50
+ parent = parent.offsetParent;
51
+ }
52
+ return totalOffset;
53
+ };
54
+ const distanceOffsetTop = (el, containerEl) => Math.abs(accumOffsetTop(el) - accumOffsetTop(containerEl));
55
+ const scroller = (el, cb) => {
56
+ const { container, containerEl, instance, observer, lastScrollTop } = el[CONTEXT_KEY];
57
+ const { disabled, distance } = computeScrollOptions(el, instance);
58
+ const { clientHeight, scrollHeight, scrollTop } = containerEl;
59
+ const deltaTop = scrollTop - lastScrollTop;
60
+ el[CONTEXT_KEY].lastScrollTop = scrollTop;
61
+ if (observer || disabled || deltaTop < 0)
62
+ return;
63
+ let isTrigger = false;
64
+ if (container === el) {
65
+ isTrigger = scrollHeight - (clientHeight + scrollTop) <= distance;
66
+ } else {
67
+ const { clientTop, scrollHeight: height } = el;
68
+ const offsetTop = distanceOffsetTop(el, containerEl);
69
+ isTrigger = scrollTop + clientHeight >= offsetTop + clientTop + height - distance;
70
+ }
71
+ if (isTrigger) {
72
+ cb.call(instance);
73
+ }
74
+ };
75
+ function observerChecker(el, cb) {
76
+ const { containerEl, instance } = el[CONTEXT_KEY];
77
+ const { disabled } = computeScrollOptions(el, instance);
78
+ if (disabled || containerEl.clientHeight === 0)
79
+ return;
80
+ if (containerEl.scrollHeight <= containerEl.clientHeight) {
81
+ cb.call(instance);
82
+ } else {
83
+ stopObserver(el);
84
+ }
85
+ }
86
+ const cached = (fn) => {
87
+ const cache = /* @__PURE__ */ Object.create(null);
88
+ return (str) => cache[str] || (cache[str] = fn(str));
89
+ };
90
+ const camelizeRE = /-(\w)/g;
91
+ const camelize = cached((str) => str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""));
92
+ const getElementStyle = (elem, styleKey) => {
93
+ if (!elem || !styleKey)
94
+ return "";
95
+ let key = camelize(styleKey);
96
+ if (key === "float")
97
+ key = "cssFloat";
98
+ try {
99
+ const styleValue = elem.style[key];
100
+ if (styleValue)
101
+ return styleValue;
102
+ const computedStyle = document.defaultView ? document.defaultView.getComputedStyle(elem, "") : null;
103
+ return computedStyle ? computedStyle[key] : "";
104
+ } catch (e) {
105
+ return elem.style[key];
106
+ }
107
+ };
108
+ const canScroll = (el, isVertical) => {
109
+ const overflowKey = { undefined: "overflow", true: "overflow-y", false: "overflow-x" }[String(isVertical)];
110
+ const overflowVal = getElementStyle(el, overflowKey);
111
+ return ["scroll", "auto", "overlay"].some((s) => overflowVal.includes(s));
112
+ };
113
+ const getScrollContainer = (el, isVertical) => {
114
+ let parentEl = el;
115
+ while (parentEl) {
116
+ if ([window, document, document.documentElement].includes(parentEl))
117
+ return window;
118
+ if (canScroll(parentEl, isVertical))
119
+ return parentEl;
120
+ parentEl = parentEl.parentNode;
121
+ }
122
+ return parentEl;
123
+ };
124
+ const bind = (el, binding, vnode) => {
125
+ const instance = binding.instance || vnode.context;
126
+ const { value: cb } = binding;
127
+ if (typeof cb !== "function") {
128
+ throw new TypeError('[TINY Error][InfiniteScroll] "v-infinite-scroll" binding value must be a function');
129
+ }
130
+ instance.$nextTick(() => {
131
+ const { delay, immediate } = computeScrollOptions(el, instance);
132
+ const container = getScrollContainer(el, true);
133
+ const containerEl = container === window ? document.documentElement : container;
134
+ const onScroll = throttle(delay, scroller.bind(null, el, cb));
135
+ if (!container)
136
+ return;
137
+ el[CONTEXT_KEY] = { instance, container, containerEl, delay, cb, onScroll, lastScrollTop: containerEl.scrollTop };
138
+ if (immediate) {
139
+ const observer = new MutationObserver(throttle(OBSERVER_CHECK_INTERVAL, observerChecker.bind(null, el, cb)));
140
+ el[CONTEXT_KEY].observer = observer;
141
+ observer.observe(el, { childList: true, subtree: true });
142
+ observerChecker(el, cb);
143
+ }
144
+ container.addEventListener("scroll", onScroll);
145
+ });
146
+ };
147
+ const update = (el, binding, vnode) => {
148
+ if (!el[CONTEXT_KEY]) {
149
+ const instance = binding.instance || vnode.context;
150
+ return instance.$nextTick();
151
+ } else {
152
+ const { containerEl, cb, observer } = el[CONTEXT_KEY];
153
+ if (containerEl.clientHeight && observer) {
154
+ observerChecker(el, cb);
155
+ }
156
+ }
157
+ };
158
+ const unbind = (el) => {
159
+ const { container, onScroll } = el[CONTEXT_KEY];
160
+ if (container)
161
+ container.removeEventListener("scroll", onScroll);
162
+ stopObserver(el);
163
+ };
164
+ const InfiniteScroll = {
165
+ bind,
166
+ update,
167
+ unbind,
168
+ beforeMount: bind,
169
+ updated: update,
170
+ unmounted: unbind
171
+ };
172
+ var infinite_scroll_default = InfiniteScroll;
173
+ export {
174
+ infinite_scroll_default as default,
175
+ getScrollContainer
176
+ };
@@ -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 "./dom";
3
3
  const checkValue = (event) => {
4
4
  if (event.charCode >= 48 && event.charCode <= 57) {
5
5
  event.preventDefault();
@@ -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 "./dom";
3
3
  const checkValue = (event) => {
4
4
  event.target.value = event.target.value.replace(/[^0-9]/g, "");
5
5
  if (event.charCode >= 48 && event.charCode <= 57) {
@@ -0,0 +1,106 @@
1
+ import "../../chunk-PKUHTIDK.js";
2
+ import throttle from "./throttle";
3
+ import { isEqual } from "../object";
4
+ const CONTEXT_KEY = "@@observevisibilityContext";
5
+ const processOptions = (value) => {
6
+ let options;
7
+ if (typeof value === "function") {
8
+ options = { callback: value };
9
+ } else {
10
+ options = value;
11
+ }
12
+ return options;
13
+ };
14
+ const createObserver = ({ options, instance, state }) => {
15
+ if (state.observer) {
16
+ destroyObserver(state);
17
+ }
18
+ if (state.frozen)
19
+ return;
20
+ state.options = processOptions(options);
21
+ state.callback = (result, entry) => {
22
+ state.options.callback(result, entry);
23
+ if (result && state.options.once) {
24
+ state.frozen = true;
25
+ destroyObserver(state);
26
+ }
27
+ };
28
+ if (state.callback && state.options.throttle) {
29
+ state.callback = throttle(state.options.throttleDelay || 20, state.callback);
30
+ }
31
+ state.observer = new IntersectionObserver((entries) => {
32
+ let entry = entries[0];
33
+ if (entries.length > 1) {
34
+ const intersectingEntry = entries.find((e) => e.isIntersecting);
35
+ if (intersectingEntry) {
36
+ entry = intersectingEntry;
37
+ }
38
+ }
39
+ if (state.callback) {
40
+ state.callback(entry.isIntersecting, entry);
41
+ }
42
+ }, state.options.intersection);
43
+ instance.$nextTick(() => {
44
+ if (state.observer) {
45
+ state.observer.observe(state.el);
46
+ }
47
+ });
48
+ };
49
+ const destroyObserver = (state) => {
50
+ if (state.observer) {
51
+ state.observer.disconnect();
52
+ state.observer = null;
53
+ }
54
+ if (state.callback) {
55
+ state.callback = null;
56
+ }
57
+ };
58
+ const createVisibilityState = ({ el, options, instance }) => {
59
+ const state = { el, observer: null, frozen: false };
60
+ createObserver({ options, instance, state });
61
+ return state;
62
+ };
63
+ const bind = (el, { value, instance }, { context }) => {
64
+ if (!value)
65
+ return;
66
+ if (typeof IntersectionObserver === "undefined") {
67
+ throw new TypeError("[TINY Error][ObserveVisibility] IntersectionObserver API is not available in your browser");
68
+ } else {
69
+ instance = instance || context;
70
+ el[CONTEXT_KEY] = createVisibilityState({ el, options: value, instance });
71
+ }
72
+ };
73
+ const update = (el, { value, oldValue, instance }, { context }) => {
74
+ if (isEqual(value, oldValue))
75
+ return;
76
+ const state = el[CONTEXT_KEY];
77
+ if (!value) {
78
+ unbind(el);
79
+ return;
80
+ }
81
+ instance = instance || context;
82
+ if (state) {
83
+ createObserver({ options: value, instance, state });
84
+ } else {
85
+ bind(el, { value, instance }, { context });
86
+ }
87
+ };
88
+ const unbind = (el) => {
89
+ const state = el[CONTEXT_KEY];
90
+ if (state) {
91
+ destroyObserver(state);
92
+ delete el[CONTEXT_KEY];
93
+ }
94
+ };
95
+ const ObserveVisibility = {
96
+ bind,
97
+ update,
98
+ unbind,
99
+ beforeMount: bind,
100
+ updated: update,
101
+ unmounted: unbind
102
+ };
103
+ var observe_visibility_default = ObserveVisibility;
104
+ export {
105
+ observe_visibility_default as default
106
+ };
@@ -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 PopupManager from "@opentiny/vue-renderless/common/deps/popup-manager";
6
- import { typeOf } from "@opentiny/vue-renderless/common/type";
7
- import { xss } from "@opentiny/vue-renderless/common/xss.js";
4
+ import { on, off } from "./dom";
5
+ import PopupManager from "./popup-manager";
6
+ import { typeOf } from "../type";
7
+ import { xss } from "../xss";
8
8
  const win = window;
9
9
  const positions = ["left", "right", "top", "bottom"];
10
10
  const modifiers = ["shift", "offset", "preventOverflow", "keepTogether", "arrow", "flip", "applyStyle"];
@@ -128,24 +128,13 @@ const getOffsetRectRelativeToCustomParent = (el, parent, fixed) => {
128
128
  };
129
129
  return rect;
130
130
  };
131
- const getScrollTopValue = (el) => el == document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : el.scrollTop;
132
- const getScrollLeftValue = (el) => el == document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : el.scrollLeft;
131
+ const getScrollTopValue = (el) => el === document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : el.scrollTop;
132
+ const getScrollLeftValue = (el) => el === document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : el.scrollLeft;
133
133
  const getMaxWH = (body, html) => {
134
134
  const height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
135
135
  const width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);
136
136
  return { width, height };
137
137
  };
138
- const adjustArrowStyle = (arrowStyle, side, arrowRect, popperRect, popperOptions) => {
139
- let params = popperOptions.placement.split("-");
140
- if (popperOptions.adjustArrow && ~["top", "bottom"].indexOf(params[0]) && side === "left") {
141
- if (params[1] === "start") {
142
- arrowStyle.left = 8;
143
- } else if (!params[1]) {
144
- arrowStyle.left = (popperRect.width - arrowRect.width) / 2;
145
- }
146
- }
147
- return arrowStyle;
148
- };
149
138
  const getOuterSizes = (el) => {
150
139
  let _display = el.style.display;
151
140
  let _visibility = el.style.visibility;
@@ -594,25 +583,34 @@ Popper.prototype.modifiers.arrow = function(data) {
594
583
  let popper = getPopperClientRect(data.offsets.popper);
595
584
  let reference = data.offsets.reference;
596
585
  let isVertical = ~["left", "right"].indexOf(placement);
597
- let len = isVertical ? "height" : "width";
586
+ let calcProp = isVertical ? "height" : "width";
598
587
  let opSide = isVertical ? "bottom" : "right";
599
588
  let altSide = isVertical ? "left" : "top";
600
589
  let side = isVertical ? "top" : "left";
601
590
  let popperRect = this.popperOuterSize ? this.popperOuterSize : this.popperOuterSize = getOuterSizes(this._popper);
602
591
  let arrowRect = getOuterSizes(arrow);
603
- let arrowSize = arrowRect[len];
592
+ let arrowSize = arrowRect[calcProp];
604
593
  if (reference[opSide] - arrowSize < popper[side]) {
605
594
  data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);
606
595
  }
607
596
  if (reference[side] + arrowSize > popper[opSide]) {
608
597
  data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
609
598
  }
610
- let center = reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);
599
+ let center = reference[side] + (arrowOffset || reference[calcProp] / 2 - arrowSize / 2);
611
600
  let sideValue = center - popper[side];
612
- sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);
601
+ sideValue = Math.max(Math.min(popper[calcProp] - arrowSize - 8, sideValue), 8);
613
602
  arrowStyle[side] = sideValue;
614
603
  arrowStyle[altSide] = "";
615
- data.offsets.arrow = adjustArrowStyle(arrowStyle, side, arrowRect, popperRect, this._options);
604
+ const popperOptions = this._options;
605
+ const params = popperOptions.placement.split("-");
606
+ if (popperOptions.adjustArrow && ~["top", "bottom"].indexOf(params[0]) && side === "left") {
607
+ if (params[1] === "start") {
608
+ arrowStyle.left = 8;
609
+ } else if (!params[1]) {
610
+ arrowStyle.left = (popperRect.width - arrowRect.width) / 2;
611
+ }
612
+ }
613
+ data.offsets.arrow = arrowStyle;
616
614
  data.arrowElement = arrow;
617
615
  return data;
618
616
  };
@@ -1,6 +1,6 @@
1
1
  import "../../chunk-PKUHTIDK.js";
2
- import { KEY_CODE } from "@opentiny/vue-renderless/common";
3
- import { addClass, removeClass, on } from "@opentiny/vue-renderless/common/deps/dom";
2
+ import { KEY_CODE } from "../index";
3
+ import { addClass, removeClass, on } from "./dom";
4
4
  let hasModal = false;
5
5
  const isServer = typeof window === "undefined";
6
6
  const instances = {};
@@ -1,5 +1,5 @@
1
1
  import "../../chunk-PKUHTIDK.js";
2
- import { on, once } from "@opentiny/vue-renderless/common/deps/dom";
2
+ import { on, once } from "./dom";
3
3
  var repeat_click_default = (el, binding) => {
4
4
  let interval = null;
5
5
  let startTime;
@@ -1,5 +1,5 @@
1
1
  import "../../chunk-PKUHTIDK.js";
2
- import ResizeObserver from "@opentiny/vue-renderless/common/deps/ResizeObserver";
2
+ import ResizeObserver from "./ResizeObserver";
3
3
  const isServer = typeof window === "undefined";
4
4
  const cacheKey = "__resizeListeners__";
5
5
  const resizeHandler = (entries) => {