fangguo-component 1.1.2 → 1.1.4

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 (150) hide show
  1. package/dist/ArgHover.css +20 -1
  2. package/dist/ArgHover.vue_vue_type_style_index_0_lang-CSymSDRl.js +56 -0
  3. package/dist/ButtonGroup-DqViorHX.js +134 -0
  4. package/dist/ButtonGroup.css +35 -1
  5. package/dist/CitySelect.vue_vue_type_script_setup_true_lang-DZp6834K.js +224 -0
  6. package/dist/ContentTitle-By0Zk1u7.js +30 -0
  7. package/dist/ContentTitle.css +6 -1
  8. package/dist/CustomInputV2-BqhBSO53.js +157 -0
  9. package/dist/CustomInputV2.css +5 -1
  10. package/dist/CustomMultipleInput-DRMTUtkE.js +125 -0
  11. package/dist/CustomMultipleInput.css +8 -1
  12. package/dist/DragResizable.css +126 -1
  13. package/dist/DragResizable.vue_vue_type_style_index_0_lang-BePpQHve.js +331 -0
  14. package/dist/DragSort-5WetnkmW.js +98 -0
  15. package/dist/DragSort.css +5 -1
  16. package/dist/ErrorImage-Ao9kEEUg.js +36 -0
  17. package/dist/ErrorImage.css +4 -1
  18. package/dist/FgCascader.css +37 -1
  19. package/dist/FgCascader.vue_vue_type_style_index_0_lang-CM8FxFLJ.js +2424 -0
  20. package/dist/HSelect-BFkWiCFi.js +671 -0
  21. package/dist/HSelect.css +80 -1
  22. package/dist/HSelectAll.vue_vue_type_script_setup_true_lang-BZX7ch2I.js +50 -0
  23. package/dist/HSelectSJ-DZmtdyjF.js +671 -0
  24. package/dist/HSelectSJ.css +88 -1
  25. package/dist/IdentifyAddress.vue_vue_type_script_setup_true_lang-BCIOF-Oy.js +5202 -0
  26. package/dist/ImageLoupe.vue_vue_type_script_setup_true_lang-BaXHYlDu.js +92 -0
  27. package/dist/LazyComponent.vue_vue_type_script_setup_true_lang-D5KGqlj4.js +107 -0
  28. package/dist/LazyPopover.vue_vue_type_script_setup_true_lang-B2vtU4f4.js +34 -0
  29. package/dist/LoadingBtn-DWm2cY9k.js +87 -0
  30. package/dist/LoadingBtn.css +12 -1
  31. package/dist/MInput-s_P63myh.js +114 -0
  32. package/dist/MInput.css +21 -1
  33. package/dist/MyTable-CHvxPYgk.js +94 -0
  34. package/dist/MyTable.css +33 -1
  35. package/dist/NoRender.vue_vue_type_script_setup_true_lang-B0G6jxPg.js +31 -0
  36. package/dist/SelectAddress-CCepDxu8.js +254 -0
  37. package/dist/SelectAddress.css +18 -1
  38. package/dist/SelectAll.vue_vue_type_script_setup_true_lang-CyzY8ams.js +101 -0
  39. package/dist/SelectAll2.vue_vue_type_script_setup_true_lang-CrsaohxU.js +103 -0
  40. package/dist/SelectCustomAll.css +8 -1
  41. package/dist/SelectCustomAll.vue_vue_type_style_index_0_lang-BEZwlGXa.js +111 -0
  42. package/dist/SelectTimePicker.vue_vue_type_script_setup_true_lang-Dk4TpTBN.js +48 -0
  43. package/dist/SelectTree-DHbWogEU.js +1276 -0
  44. package/dist/SelectTree.css +74 -1
  45. package/dist/SvgIcon-DIg0upEk.js +33 -0
  46. package/dist/TextCopy-th0FAxwl.js +44 -0
  47. package/dist/TextCopy.css +7 -1
  48. package/dist/TextEllipsisTooltip.vue_vue_type_script_setup_true_lang-DVE1CxPm.js +174 -0
  49. package/dist/VirtualTable-Cm_L7q9W.js +703 -0
  50. package/dist/VirtualTable.css +185 -1
  51. package/dist/_commonjsHelpers-DnzVkjQg.js +38 -0
  52. package/dist/_plugin-vue_export-helper-1tPrXgE0.js +10 -0
  53. package/dist/common-B1nSpTGn.js +9669 -0
  54. package/dist/components/VirtualTable/index.js +2 -2
  55. package/dist/components/argHover/index.js +2 -2
  56. package/dist/components/buttonGroup/index.js +2 -2
  57. package/dist/components/cascader/index.js +2 -2
  58. package/dist/components/citySelect/index.js +2 -2
  59. package/dist/components/contentTitle/index.js +2 -2
  60. package/dist/components/customInputV2/index.js +2 -2
  61. package/dist/components/customMultipleInput/index.js +2 -2
  62. package/dist/components/dragResizable/index.js +2 -2
  63. package/dist/components/dragSort/index.js +2 -2
  64. package/dist/components/errorImage/index.js +2 -2
  65. package/dist/components/hSelect/index.js +2 -2
  66. package/dist/components/hSelectAll/index.js +2 -2
  67. package/dist/components/hSelectSJ/index.js +2 -2
  68. package/dist/components/identifyAddress/index.js +2 -2
  69. package/dist/components/imageLoupe/index.js +2 -2
  70. package/dist/components/index.js +62 -62
  71. package/dist/components/lazyComponent/index.js +2 -2
  72. package/dist/components/lazyPopover/index.js +2 -2
  73. package/dist/components/loadingBtn/index.js +2 -2
  74. package/dist/components/mInput/index.js +2 -2
  75. package/dist/components/myTable/index.js +2 -2
  76. package/dist/components/noRender/index.js +2 -2
  77. package/dist/components/selectAddress/index.js +2 -2
  78. package/dist/components/selectAll/index.js +2 -2
  79. package/dist/components/selectAll2/index.js +2 -2
  80. package/dist/components/selectCustomAll/index.js +2 -2
  81. package/dist/components/selectTimePicker/index.js +2 -2
  82. package/dist/components/selectTree/index.js +2 -2
  83. package/dist/components/svgIcon/index.js +2 -2
  84. package/dist/components/textCopy/index.js +2 -2
  85. package/dist/components/textEllipsisTooltip/index.js +2 -2
  86. package/dist/dateShortcuts-DjFC_Txu.js +27 -0
  87. package/dist/directive/index.js +2 -2
  88. package/dist/directive/loading/index.js +2 -2
  89. package/dist/hooks/index.js +2 -2
  90. package/dist/hooks/usePagination/index.js +2 -2
  91. package/dist/index-BPnixsfc.js +103 -0
  92. package/dist/index-C9zyi90j.js +165 -0
  93. package/dist/index-CSMWzzp0.js +8 -0
  94. package/dist/index-DfQiknXJ.js +8 -0
  95. package/dist/index-DzdLpetc.js +29184 -0
  96. package/dist/index-uQXqC9BF.js +68 -0
  97. package/dist/index.css +1 -1
  98. package/dist/index.js +204 -194
  99. package/dist/loading-CGrVcnNl.js +47 -0
  100. package/dist/loading.css +110 -1
  101. package/dist/tools/ImageParserUtils/index.js +17239 -9074
  102. package/dist/tools/common/index.js +86 -86
  103. package/dist/tools/index.js +95 -95
  104. package/dist/usePagination-C63IRXjZ.js +29 -0
  105. package/dist/vue-virtual-scroller.esm-ZgBoGAjX.js +1507 -0
  106. package/package.json +1 -1
  107. package/dist/ArgHover.vue_vue_type_style_index_0_lang-CMhRP09M.js +0 -54
  108. package/dist/ButtonGroup-C0yZEkxK.js +0 -103
  109. package/dist/CitySelect.vue_vue_type_script_setup_true_lang-8EbHD3Nt.js +0 -159
  110. package/dist/ContentTitle-mqrusLjx.js +0 -24
  111. package/dist/CustomInputV2-uARhbFc8.js +0 -135
  112. package/dist/CustomMultipleInput-DDaqoHVU.js +0 -109
  113. package/dist/DragResizable.vue_vue_type_style_index_0_lang-CHv0gJmo.js +0 -179
  114. package/dist/DragSort-CfDeFAIG.js +0 -66
  115. package/dist/ErrorImage-CTP_5sal.js +0 -32
  116. package/dist/FgCascader.vue_vue_type_style_index_0_lang-BUZDDcVn.js +0 -1656
  117. package/dist/HSelect-Drf6YBwO.js +0 -468
  118. package/dist/HSelectAll.vue_vue_type_script_setup_true_lang-Blq9xpfa.js +0 -36
  119. package/dist/HSelectSJ-D3GrXmvj.js +0 -462
  120. package/dist/IdentifyAddress.vue_vue_type_script_setup_true_lang-BJheMI1q.js +0 -4743
  121. package/dist/ImageLoupe.vue_vue_type_script_setup_true_lang-BlX4VbRi.js +0 -79
  122. package/dist/LazyComponent.vue_vue_type_script_setup_true_lang-vNk68D8E.js +0 -82
  123. package/dist/LazyPopover.vue_vue_type_script_setup_true_lang-DcOrcH0T.js +0 -33
  124. package/dist/LoadingBtn-BhbhNboo.js +0 -66
  125. package/dist/MInput-CpoW17Wh.js +0 -101
  126. package/dist/MyTable-DmwyEVJb.js +0 -68
  127. package/dist/NoRender.vue_vue_type_script_setup_true_lang-Do36nSsV.js +0 -30
  128. package/dist/SelectAddress-B4oK5erq.js +0 -173
  129. package/dist/SelectAll.vue_vue_type_script_setup_true_lang-BC3q2U8f.js +0 -79
  130. package/dist/SelectAll2.vue_vue_type_script_setup_true_lang-CaET5eli.js +0 -74
  131. package/dist/SelectCustomAll.vue_vue_type_style_index_0_lang-_wCRO217.js +0 -83
  132. package/dist/SelectTimePicker.vue_vue_type_script_setup_true_lang-Bj0KMOKv.js +0 -45
  133. package/dist/SelectTree-Dm5259kY.js +0 -911
  134. package/dist/SvgIcon-C2ah8E0Z.js +0 -30
  135. package/dist/TextCopy-hOj-Wj2H.js +0 -41
  136. package/dist/TextEllipsisTooltip.vue_vue_type_script_setup_true_lang-aZbEQmbM.js +0 -112
  137. package/dist/VirtualTable-BWugJiQ5.js +0 -349
  138. package/dist/_commonjsHelpers-ByYUsBRP.js +0 -33
  139. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  140. package/dist/common-BIEgCXbl.js +0 -7030
  141. package/dist/dateShortcuts-DDPtAhDI.js +0 -26
  142. package/dist/index-BRcBDlVs.js +0 -68
  143. package/dist/index-CeWudY6u.js +0 -8
  144. package/dist/index-DIX8TpoT.js +0 -118
  145. package/dist/index-DpPsTMp0.js +0 -8
  146. package/dist/index-epuVZjZV.js +0 -103
  147. package/dist/index-uf7oyYDF.js +0 -16847
  148. package/dist/loading-DJVNc0eN.js +0 -36
  149. package/dist/usePagination-CwShBEjA.js +0 -20
  150. package/dist/vue-virtual-scroller.esm-CH-jx4ri.js +0 -1051
@@ -0,0 +1,1507 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { nextTick, pushScopeId, popScopeId, openBlock, createBlock, withScopeId, markRaw, shallowReactive, h, resolveComponent, resolveDirective, withDirectives, createElementBlock, normalizeClass, renderSlot, createCommentVNode, resolveDynamicComponent, normalizeStyle, withCtx, Fragment, renderList, mergeProps, toHandlers, createVNode, normalizeProps, guardReactiveProps } from "vue";
21
+ function getInternetExplorerVersion() {
22
+ var ua = window.navigator.userAgent;
23
+ var msie = ua.indexOf("MSIE ");
24
+ if (msie > 0) {
25
+ return parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)), 10);
26
+ }
27
+ var trident = ua.indexOf("Trident/");
28
+ if (trident > 0) {
29
+ var rv = ua.indexOf("rv:");
30
+ return parseInt(ua.substring(rv + 3, ua.indexOf(".", rv)), 10);
31
+ }
32
+ var edge = ua.indexOf("Edge/");
33
+ if (edge > 0) {
34
+ return parseInt(ua.substring(edge + 5, ua.indexOf(".", edge)), 10);
35
+ }
36
+ return -1;
37
+ }
38
+ let isIE;
39
+ function initCompat() {
40
+ if (!initCompat.init) {
41
+ initCompat.init = true;
42
+ isIE = getInternetExplorerVersion() !== -1;
43
+ }
44
+ }
45
+ var script$3 = {
46
+ name: "ResizeObserver",
47
+ props: {
48
+ emitOnMount: {
49
+ type: Boolean,
50
+ default: false
51
+ },
52
+ ignoreWidth: {
53
+ type: Boolean,
54
+ default: false
55
+ },
56
+ ignoreHeight: {
57
+ type: Boolean,
58
+ default: false
59
+ }
60
+ },
61
+ emits: [
62
+ "notify"
63
+ ],
64
+ mounted() {
65
+ initCompat();
66
+ nextTick(() => {
67
+ this._w = this.$el.offsetWidth;
68
+ this._h = this.$el.offsetHeight;
69
+ if (this.emitOnMount) {
70
+ this.emitSize();
71
+ }
72
+ });
73
+ const object = document.createElement("object");
74
+ this._resizeObject = object;
75
+ object.setAttribute("aria-hidden", "true");
76
+ object.setAttribute("tabindex", -1);
77
+ object.onload = this.addResizeHandlers;
78
+ object.type = "text/html";
79
+ if (isIE) {
80
+ this.$el.appendChild(object);
81
+ }
82
+ object.data = "about:blank";
83
+ if (!isIE) {
84
+ this.$el.appendChild(object);
85
+ }
86
+ },
87
+ beforeUnmount() {
88
+ this.removeResizeHandlers();
89
+ },
90
+ methods: {
91
+ compareAndNotify() {
92
+ if (!this.ignoreWidth && this._w !== this.$el.offsetWidth || !this.ignoreHeight && this._h !== this.$el.offsetHeight) {
93
+ this._w = this.$el.offsetWidth;
94
+ this._h = this.$el.offsetHeight;
95
+ this.emitSize();
96
+ }
97
+ },
98
+ emitSize() {
99
+ this.$emit("notify", {
100
+ width: this._w,
101
+ height: this._h
102
+ });
103
+ },
104
+ addResizeHandlers() {
105
+ this._resizeObject.contentDocument.defaultView.addEventListener("resize", this.compareAndNotify);
106
+ this.compareAndNotify();
107
+ },
108
+ removeResizeHandlers() {
109
+ if (this._resizeObject && this._resizeObject.onload) {
110
+ if (!isIE && this._resizeObject.contentDocument) {
111
+ this._resizeObject.contentDocument.defaultView.removeEventListener("resize", this.compareAndNotify);
112
+ }
113
+ this.$el.removeChild(this._resizeObject);
114
+ this._resizeObject.onload = null;
115
+ this._resizeObject = null;
116
+ }
117
+ }
118
+ }
119
+ };
120
+ const _withId = /* @__PURE__ */ withScopeId("data-v-b329ee4c");
121
+ pushScopeId("data-v-b329ee4c");
122
+ const _hoisted_1$1 = {
123
+ class: "resize-observer",
124
+ tabindex: "-1"
125
+ };
126
+ popScopeId();
127
+ const render$2 = /* @__PURE__ */ _withId((_ctx, _cache, $props, $setup, $data, $options) => {
128
+ return openBlock(), createBlock("div", _hoisted_1$1);
129
+ });
130
+ script$3.render = render$2;
131
+ script$3.__scopeId = "data-v-b329ee4c";
132
+ script$3.__file = "src/components/ResizeObserver.vue";
133
+ function _typeof$1(obj) {
134
+ "@babel/helpers - typeof";
135
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
136
+ _typeof$1 = function(obj2) {
137
+ return typeof obj2;
138
+ };
139
+ } else {
140
+ _typeof$1 = function(obj2) {
141
+ return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
142
+ };
143
+ }
144
+ return _typeof$1(obj);
145
+ }
146
+ function _classCallCheck(instance, Constructor) {
147
+ if (!(instance instanceof Constructor)) {
148
+ throw new TypeError("Cannot call a class as a function");
149
+ }
150
+ }
151
+ function _defineProperties(target, props2) {
152
+ for (var i = 0; i < props2.length; i++) {
153
+ var descriptor = props2[i];
154
+ descriptor.enumerable = descriptor.enumerable || false;
155
+ descriptor.configurable = true;
156
+ if ("value" in descriptor) descriptor.writable = true;
157
+ Object.defineProperty(target, descriptor.key, descriptor);
158
+ }
159
+ }
160
+ function _createClass(Constructor, protoProps, staticProps) {
161
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
162
+ return Constructor;
163
+ }
164
+ function _toConsumableArray(arr) {
165
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
166
+ }
167
+ function _arrayWithoutHoles(arr) {
168
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
169
+ }
170
+ function _iterableToArray(iter) {
171
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
172
+ }
173
+ function _unsupportedIterableToArray(o, minLen) {
174
+ if (!o) return;
175
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
176
+ var n = Object.prototype.toString.call(o).slice(8, -1);
177
+ if (n === "Object" && o.constructor) n = o.constructor.name;
178
+ if (n === "Map" || n === "Set") return Array.from(o);
179
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
180
+ }
181
+ function _arrayLikeToArray(arr, len) {
182
+ if (len == null || len > arr.length) len = arr.length;
183
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
184
+ return arr2;
185
+ }
186
+ function _nonIterableSpread() {
187
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
188
+ }
189
+ function processOptions(value) {
190
+ var options;
191
+ if (typeof value === "function") {
192
+ options = {
193
+ callback: value
194
+ };
195
+ } else {
196
+ options = value;
197
+ }
198
+ return options;
199
+ }
200
+ function throttle(callback, delay) {
201
+ var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
202
+ var timeout;
203
+ var lastState;
204
+ var currentArgs;
205
+ var throttled = function throttled2(state) {
206
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
207
+ args[_key - 1] = arguments[_key];
208
+ }
209
+ currentArgs = args;
210
+ if (timeout && state === lastState) return;
211
+ var leading = options.leading;
212
+ if (typeof leading === "function") {
213
+ leading = leading(state, lastState);
214
+ }
215
+ if ((!timeout || state !== lastState) && leading) {
216
+ callback.apply(void 0, [state].concat(_toConsumableArray(currentArgs)));
217
+ }
218
+ lastState = state;
219
+ clearTimeout(timeout);
220
+ timeout = setTimeout(function() {
221
+ callback.apply(void 0, [state].concat(_toConsumableArray(currentArgs)));
222
+ timeout = 0;
223
+ }, delay);
224
+ };
225
+ throttled._clear = function() {
226
+ clearTimeout(timeout);
227
+ timeout = null;
228
+ };
229
+ return throttled;
230
+ }
231
+ function deepEqual(val1, val2) {
232
+ if (val1 === val2) return true;
233
+ if (_typeof$1(val1) === "object") {
234
+ for (var key in val1) {
235
+ if (!deepEqual(val1[key], val2[key])) {
236
+ return false;
237
+ }
238
+ }
239
+ return true;
240
+ }
241
+ return false;
242
+ }
243
+ var VisibilityState = /* @__PURE__ */ (function() {
244
+ function VisibilityState2(el, options, vnode) {
245
+ _classCallCheck(this, VisibilityState2);
246
+ this.el = el;
247
+ this.observer = null;
248
+ this.frozen = false;
249
+ this.createObserver(options, vnode);
250
+ }
251
+ _createClass(VisibilityState2, [{
252
+ key: "createObserver",
253
+ value: function createObserver(options, vnode) {
254
+ var _this = this;
255
+ if (this.observer) {
256
+ this.destroyObserver();
257
+ }
258
+ if (this.frozen) return;
259
+ this.options = processOptions(options);
260
+ this.callback = function(result, entry) {
261
+ _this.options.callback(result, entry);
262
+ if (result && _this.options.once) {
263
+ _this.frozen = true;
264
+ _this.destroyObserver();
265
+ }
266
+ };
267
+ if (this.callback && this.options.throttle) {
268
+ var _ref = this.options.throttleOptions || {}, _leading = _ref.leading;
269
+ this.callback = throttle(this.callback, this.options.throttle, {
270
+ leading: function leading(state) {
271
+ return _leading === "both" || _leading === "visible" && state || _leading === "hidden" && !state;
272
+ }
273
+ });
274
+ }
275
+ this.oldResult = void 0;
276
+ this.observer = new IntersectionObserver(function(entries) {
277
+ var entry = entries[0];
278
+ if (entries.length > 1) {
279
+ var intersectingEntry = entries.find(function(e) {
280
+ return e.isIntersecting;
281
+ });
282
+ if (intersectingEntry) {
283
+ entry = intersectingEntry;
284
+ }
285
+ }
286
+ if (_this.callback) {
287
+ var result = entry.isIntersecting && entry.intersectionRatio >= _this.threshold;
288
+ if (result === _this.oldResult) return;
289
+ _this.oldResult = result;
290
+ _this.callback(result, entry);
291
+ }
292
+ }, this.options.intersection);
293
+ nextTick(function() {
294
+ if (_this.observer) {
295
+ _this.observer.observe(_this.el);
296
+ }
297
+ });
298
+ }
299
+ }, {
300
+ key: "destroyObserver",
301
+ value: function destroyObserver() {
302
+ if (this.observer) {
303
+ this.observer.disconnect();
304
+ this.observer = null;
305
+ }
306
+ if (this.callback && this.callback._clear) {
307
+ this.callback._clear();
308
+ this.callback = null;
309
+ }
310
+ }
311
+ }, {
312
+ key: "threshold",
313
+ get: function get() {
314
+ return this.options.intersection && typeof this.options.intersection.threshold === "number" ? this.options.intersection.threshold : 0;
315
+ }
316
+ }]);
317
+ return VisibilityState2;
318
+ })();
319
+ function beforeMount(el, _ref2, vnode) {
320
+ var value = _ref2.value;
321
+ if (!value) return;
322
+ if (typeof IntersectionObserver === "undefined") {
323
+ console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");
324
+ } else {
325
+ var state = new VisibilityState(el, value, vnode);
326
+ el._vue_visibilityState = state;
327
+ }
328
+ }
329
+ function updated(el, _ref3, vnode) {
330
+ var value = _ref3.value, oldValue = _ref3.oldValue;
331
+ if (deepEqual(value, oldValue)) return;
332
+ var state = el._vue_visibilityState;
333
+ if (!value) {
334
+ unmounted(el);
335
+ return;
336
+ }
337
+ if (state) {
338
+ state.createObserver(value, vnode);
339
+ } else {
340
+ beforeMount(el, {
341
+ value
342
+ }, vnode);
343
+ }
344
+ }
345
+ function unmounted(el) {
346
+ var state = el._vue_visibilityState;
347
+ if (state) {
348
+ state.destroyObserver();
349
+ delete el._vue_visibilityState;
350
+ }
351
+ }
352
+ var ObserveVisibility = {
353
+ beforeMount,
354
+ updated,
355
+ unmounted
356
+ };
357
+ function mitt(n) {
358
+ return { all: n = n || /* @__PURE__ */ new Map(), on: function(t, e) {
359
+ var i = n.get(t);
360
+ i && i.push(e) || n.set(t, [e]);
361
+ }, off: function(t, e) {
362
+ var i = n.get(t);
363
+ i && i.splice(i.indexOf(e) >>> 0, 1);
364
+ }, emit: function(t, e) {
365
+ (n.get(t) || []).slice().map(function(n2) {
366
+ n2(e);
367
+ }), (n.get("*") || []).slice().map(function(n2) {
368
+ n2(t, e);
369
+ });
370
+ } };
371
+ }
372
+ var config = {
373
+ itemsLimit: 1e3
374
+ };
375
+ var regex = /(auto|scroll)/;
376
+ function parents(node, ps) {
377
+ if (node.parentNode === null) {
378
+ return ps;
379
+ }
380
+ return parents(node.parentNode, ps.concat([node]));
381
+ }
382
+ var style = function style2(node, prop) {
383
+ return getComputedStyle(node, null).getPropertyValue(prop);
384
+ };
385
+ var overflow = function overflow2(node) {
386
+ return style(node, "overflow") + style(node, "overflow-y") + style(node, "overflow-x");
387
+ };
388
+ var scroll = function scroll2(node) {
389
+ return regex.test(overflow(node));
390
+ };
391
+ function getScrollParent(node) {
392
+ if (!(node instanceof HTMLElement || node instanceof SVGElement)) {
393
+ return;
394
+ }
395
+ var ps = parents(node.parentNode, []);
396
+ for (var i = 0; i < ps.length; i += 1) {
397
+ if (scroll(ps[i])) {
398
+ return ps[i];
399
+ }
400
+ }
401
+ return document.scrollingElement || document.documentElement;
402
+ }
403
+ function _typeof(obj) {
404
+ "@babel/helpers - typeof";
405
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
406
+ return typeof obj2;
407
+ } : function(obj2) {
408
+ return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
409
+ }, _typeof(obj);
410
+ }
411
+ var props = {
412
+ items: {
413
+ type: Array,
414
+ required: true
415
+ },
416
+ keyField: {
417
+ type: String,
418
+ default: "id"
419
+ },
420
+ direction: {
421
+ type: String,
422
+ default: "vertical",
423
+ validator: function validator(value) {
424
+ return ["vertical", "horizontal"].includes(value);
425
+ }
426
+ },
427
+ listTag: {
428
+ type: String,
429
+ default: "div"
430
+ },
431
+ itemTag: {
432
+ type: String,
433
+ default: "div"
434
+ }
435
+ };
436
+ function simpleArray() {
437
+ return this.items.length && _typeof(this.items[0]) !== "object";
438
+ }
439
+ var supportsPassive = false;
440
+ if (typeof window !== "undefined") {
441
+ supportsPassive = false;
442
+ try {
443
+ var opts = Object.defineProperty({}, "passive", {
444
+ get: function get() {
445
+ supportsPassive = true;
446
+ }
447
+ });
448
+ window.addEventListener("test", null, opts);
449
+ } catch (e) {
450
+ }
451
+ }
452
+ let uid = 0;
453
+ var script$2 = {
454
+ name: "RecycleScroller",
455
+ components: {
456
+ ResizeObserver: script$3
457
+ },
458
+ directives: {
459
+ ObserveVisibility
460
+ },
461
+ props: __spreadProps(__spreadValues({}, props), {
462
+ itemSize: {
463
+ type: Number,
464
+ default: null
465
+ },
466
+ gridItems: {
467
+ type: Number,
468
+ default: void 0
469
+ },
470
+ itemSecondarySize: {
471
+ type: Number,
472
+ default: void 0
473
+ },
474
+ minItemSize: {
475
+ type: [Number, String],
476
+ default: null
477
+ },
478
+ sizeField: {
479
+ type: String,
480
+ default: "size"
481
+ },
482
+ typeField: {
483
+ type: String,
484
+ default: "type"
485
+ },
486
+ buffer: {
487
+ type: Number,
488
+ default: 200
489
+ },
490
+ pageMode: {
491
+ type: Boolean,
492
+ default: false
493
+ },
494
+ prerender: {
495
+ type: Number,
496
+ default: 0
497
+ },
498
+ emitUpdate: {
499
+ type: Boolean,
500
+ default: false
501
+ },
502
+ updateInterval: {
503
+ type: Number,
504
+ default: 0
505
+ },
506
+ skipHover: {
507
+ type: Boolean,
508
+ default: false
509
+ },
510
+ listTag: {
511
+ type: String,
512
+ default: "div"
513
+ },
514
+ itemTag: {
515
+ type: String,
516
+ default: "div"
517
+ },
518
+ listClass: {
519
+ type: [String, Object, Array],
520
+ default: ""
521
+ },
522
+ itemClass: {
523
+ type: [String, Object, Array],
524
+ default: ""
525
+ }
526
+ }),
527
+ emits: [
528
+ "resize",
529
+ "visible",
530
+ "hidden",
531
+ "update",
532
+ "scroll-start",
533
+ "scroll-end"
534
+ ],
535
+ data() {
536
+ return {
537
+ pool: [],
538
+ totalSize: 0,
539
+ ready: false,
540
+ hoverKey: null
541
+ };
542
+ },
543
+ computed: {
544
+ sizes() {
545
+ if (this.itemSize === null) {
546
+ const sizes = {
547
+ "-1": { accumulator: 0 }
548
+ };
549
+ const items = this.items;
550
+ const field = this.sizeField;
551
+ const minItemSize = this.minItemSize;
552
+ let computedMinSize = 1e4;
553
+ let accumulator = 0;
554
+ let current;
555
+ for (let i = 0, l = items.length; i < l; i++) {
556
+ current = items[i][field] || minItemSize;
557
+ if (current < computedMinSize) {
558
+ computedMinSize = current;
559
+ }
560
+ accumulator += current;
561
+ sizes[i] = { accumulator, size: current };
562
+ }
563
+ this.$_computedMinItemSize = computedMinSize;
564
+ return sizes;
565
+ }
566
+ return [];
567
+ },
568
+ simpleArray,
569
+ itemIndexByKey() {
570
+ const { keyField, items } = this;
571
+ const result = {};
572
+ for (let i = 0, l = items.length; i < l; i++) {
573
+ result[items[i][keyField]] = i;
574
+ }
575
+ return result;
576
+ }
577
+ },
578
+ watch: {
579
+ items() {
580
+ this.updateVisibleItems(true);
581
+ },
582
+ pageMode() {
583
+ this.applyPageMode();
584
+ this.updateVisibleItems(false);
585
+ },
586
+ sizes: {
587
+ handler() {
588
+ this.updateVisibleItems(false);
589
+ },
590
+ deep: true
591
+ },
592
+ gridItems() {
593
+ this.updateVisibleItems(true);
594
+ },
595
+ itemSecondarySize() {
596
+ this.updateVisibleItems(true);
597
+ }
598
+ },
599
+ created() {
600
+ this.$_startIndex = 0;
601
+ this.$_endIndex = 0;
602
+ this.$_views = /* @__PURE__ */ new Map();
603
+ this.$_unusedViews = /* @__PURE__ */ new Map();
604
+ this.$_scrollDirty = false;
605
+ this.$_lastUpdateScrollPosition = 0;
606
+ if (this.prerender) {
607
+ this.$_prerender = true;
608
+ this.updateVisibleItems(false);
609
+ }
610
+ if (this.gridItems && !this.itemSize) {
611
+ console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems");
612
+ }
613
+ },
614
+ mounted() {
615
+ this.applyPageMode();
616
+ this.$nextTick(() => {
617
+ this.$_prerender = false;
618
+ this.updateVisibleItems(true);
619
+ this.ready = true;
620
+ });
621
+ },
622
+ activated() {
623
+ const lastPosition = this.$_lastUpdateScrollPosition;
624
+ if (typeof lastPosition === "number") {
625
+ this.$nextTick(() => {
626
+ this.scrollToPosition(lastPosition);
627
+ });
628
+ }
629
+ },
630
+ beforeUnmount() {
631
+ this.removeListeners();
632
+ },
633
+ methods: {
634
+ addView(pool, index, item, key, type) {
635
+ const nr = markRaw({
636
+ id: uid++,
637
+ index,
638
+ used: true,
639
+ key,
640
+ type
641
+ });
642
+ const view = shallowReactive({
643
+ item,
644
+ position: 0,
645
+ nr
646
+ });
647
+ pool.push(view);
648
+ return view;
649
+ },
650
+ unuseView(view, fake = false) {
651
+ const unusedViews = this.$_unusedViews;
652
+ const type = view.nr.type;
653
+ let unusedPool = unusedViews.get(type);
654
+ if (!unusedPool) {
655
+ unusedPool = [];
656
+ unusedViews.set(type, unusedPool);
657
+ }
658
+ unusedPool.push(view);
659
+ if (!fake) {
660
+ view.nr.used = false;
661
+ view.position = -9999;
662
+ }
663
+ },
664
+ handleResize() {
665
+ this.$emit("resize");
666
+ if (this.ready) this.updateVisibleItems(false);
667
+ },
668
+ handleScroll(event) {
669
+ if (!this.$_scrollDirty) {
670
+ this.$_scrollDirty = true;
671
+ if (this.$_updateTimeout) return;
672
+ const requestUpdate = () => requestAnimationFrame(() => {
673
+ this.$_scrollDirty = false;
674
+ const { continuous } = this.updateVisibleItems(false, true);
675
+ if (!continuous) {
676
+ clearTimeout(this.$_refreshTimout);
677
+ this.$_refreshTimout = setTimeout(this.handleScroll, this.updateInterval + 100);
678
+ }
679
+ });
680
+ requestUpdate();
681
+ if (this.updateInterval) {
682
+ this.$_updateTimeout = setTimeout(() => {
683
+ this.$_updateTimeout = 0;
684
+ if (this.$_scrollDirty) requestUpdate();
685
+ }, this.updateInterval);
686
+ }
687
+ }
688
+ },
689
+ handleVisibilityChange(isVisible, entry) {
690
+ if (this.ready) {
691
+ if (isVisible || entry.boundingClientRect.width !== 0 || entry.boundingClientRect.height !== 0) {
692
+ this.$emit("visible");
693
+ requestAnimationFrame(() => {
694
+ this.updateVisibleItems(false);
695
+ });
696
+ } else {
697
+ this.$emit("hidden");
698
+ }
699
+ }
700
+ },
701
+ updateVisibleItems(checkItem, checkPositionDiff = false) {
702
+ const itemSize = this.itemSize;
703
+ const gridItems = this.gridItems || 1;
704
+ const itemSecondarySize = this.itemSecondarySize || itemSize;
705
+ const minItemSize = this.$_computedMinItemSize;
706
+ const typeField = this.typeField;
707
+ const keyField = this.simpleArray ? null : this.keyField;
708
+ const items = this.items;
709
+ const count = items.length;
710
+ const sizes = this.sizes;
711
+ const views = this.$_views;
712
+ const unusedViews = this.$_unusedViews;
713
+ const pool = this.pool;
714
+ const itemIndexByKey = this.itemIndexByKey;
715
+ let startIndex, endIndex;
716
+ let totalSize;
717
+ let visibleStartIndex, visibleEndIndex;
718
+ if (!count) {
719
+ startIndex = endIndex = visibleStartIndex = visibleEndIndex = totalSize = 0;
720
+ } else if (this.$_prerender) {
721
+ startIndex = visibleStartIndex = 0;
722
+ endIndex = visibleEndIndex = Math.min(this.prerender, items.length);
723
+ totalSize = null;
724
+ } else {
725
+ const scroll3 = this.getScroll();
726
+ if (checkPositionDiff) {
727
+ let positionDiff = scroll3.start - this.$_lastUpdateScrollPosition;
728
+ if (positionDiff < 0) positionDiff = -positionDiff;
729
+ if (itemSize === null && positionDiff < minItemSize || positionDiff < itemSize) {
730
+ return {
731
+ continuous: true
732
+ };
733
+ }
734
+ }
735
+ this.$_lastUpdateScrollPosition = scroll3.start;
736
+ const buffer = this.buffer;
737
+ scroll3.start -= buffer;
738
+ scroll3.end += buffer;
739
+ let beforeSize = 0;
740
+ if (this.$refs.before) {
741
+ beforeSize = this.$refs.before.scrollHeight;
742
+ scroll3.start -= beforeSize;
743
+ }
744
+ if (this.$refs.after) {
745
+ const afterSize = this.$refs.after.scrollHeight;
746
+ scroll3.end += afterSize;
747
+ }
748
+ if (itemSize === null) {
749
+ let h2;
750
+ let a = 0;
751
+ let b = count - 1;
752
+ let i = ~~(count / 2);
753
+ let oldI;
754
+ do {
755
+ oldI = i;
756
+ h2 = sizes[i].accumulator;
757
+ if (h2 < scroll3.start) {
758
+ a = i;
759
+ } else if (i < count - 1 && sizes[i + 1].accumulator > scroll3.start) {
760
+ b = i;
761
+ }
762
+ i = ~~((a + b) / 2);
763
+ } while (i !== oldI);
764
+ i < 0 && (i = 0);
765
+ startIndex = i;
766
+ totalSize = sizes[count - 1].accumulator;
767
+ for (endIndex = i; endIndex < count && sizes[endIndex].accumulator < scroll3.end; endIndex++) ;
768
+ if (endIndex === -1) {
769
+ endIndex = items.length - 1;
770
+ } else {
771
+ endIndex++;
772
+ endIndex > count && (endIndex = count);
773
+ }
774
+ for (visibleStartIndex = startIndex; visibleStartIndex < count && beforeSize + sizes[visibleStartIndex].accumulator < scroll3.start; visibleStartIndex++) ;
775
+ for (visibleEndIndex = visibleStartIndex; visibleEndIndex < count && beforeSize + sizes[visibleEndIndex].accumulator < scroll3.end; visibleEndIndex++) ;
776
+ } else {
777
+ startIndex = ~~(scroll3.start / itemSize * gridItems);
778
+ const remainer = startIndex % gridItems;
779
+ startIndex -= remainer;
780
+ endIndex = Math.ceil(scroll3.end / itemSize * gridItems);
781
+ visibleStartIndex = Math.max(0, Math.floor((scroll3.start - beforeSize) / itemSize * gridItems));
782
+ visibleEndIndex = Math.floor((scroll3.end - beforeSize) / itemSize * gridItems);
783
+ startIndex < 0 && (startIndex = 0);
784
+ endIndex > count && (endIndex = count);
785
+ visibleStartIndex < 0 && (visibleStartIndex = 0);
786
+ visibleEndIndex > count && (visibleEndIndex = count);
787
+ totalSize = Math.ceil(count / gridItems) * itemSize;
788
+ }
789
+ }
790
+ if (endIndex - startIndex > config.itemsLimit) {
791
+ this.itemsLimitError();
792
+ }
793
+ this.totalSize = totalSize;
794
+ let view;
795
+ const continuous = startIndex <= this.$_endIndex && endIndex >= this.$_startIndex;
796
+ if (continuous) {
797
+ for (let i = 0, l = pool.length; i < l; i++) {
798
+ view = pool[i];
799
+ if (view.nr.used) {
800
+ if (checkItem) {
801
+ view.nr.index = itemIndexByKey[view.item[keyField]];
802
+ }
803
+ if (view.nr.index == null || view.nr.index < startIndex || view.nr.index >= endIndex) {
804
+ this.unuseView(view);
805
+ }
806
+ }
807
+ }
808
+ }
809
+ const unusedIndex = continuous ? null : /* @__PURE__ */ new Map();
810
+ let item, type;
811
+ let v;
812
+ for (let i = startIndex; i < endIndex; i++) {
813
+ item = items[i];
814
+ const key = keyField ? item[keyField] : item;
815
+ if (key == null) {
816
+ throw new Error(`Key is ${key} on item (keyField is '${keyField}')`);
817
+ }
818
+ view = views.get(key);
819
+ if (!itemSize && !sizes[i].size) {
820
+ if (view) this.unuseView(view);
821
+ continue;
822
+ }
823
+ type = item[typeField];
824
+ let unusedPool = unusedViews.get(type);
825
+ let newlyUsedView = false;
826
+ if (!view) {
827
+ if (continuous) {
828
+ if (unusedPool && unusedPool.length) {
829
+ view = unusedPool.pop();
830
+ } else {
831
+ view = this.addView(pool, i, item, key, type);
832
+ }
833
+ } else {
834
+ v = unusedIndex.get(type) || 0;
835
+ if (!unusedPool || v >= unusedPool.length) {
836
+ view = this.addView(pool, i, item, key, type);
837
+ this.unuseView(view, true);
838
+ unusedPool = unusedViews.get(type);
839
+ }
840
+ view = unusedPool[v];
841
+ unusedIndex.set(type, v + 1);
842
+ }
843
+ views.delete(view.nr.key);
844
+ view.nr.used = true;
845
+ view.nr.index = i;
846
+ view.nr.key = key;
847
+ view.nr.type = type;
848
+ views.set(key, view);
849
+ newlyUsedView = true;
850
+ } else {
851
+ if (!view.nr.used) {
852
+ view.nr.used = true;
853
+ newlyUsedView = true;
854
+ if (unusedPool) {
855
+ const index = unusedPool.indexOf(view);
856
+ if (index !== -1) unusedPool.splice(index, 1);
857
+ }
858
+ }
859
+ }
860
+ view.item = item;
861
+ if (newlyUsedView) {
862
+ if (i === items.length - 1) this.$emit("scroll-end");
863
+ if (i === 0) this.$emit("scroll-start");
864
+ }
865
+ if (itemSize === null) {
866
+ view.position = sizes[i - 1].accumulator;
867
+ view.offset = 0;
868
+ } else {
869
+ view.position = Math.floor(i / gridItems) * itemSize;
870
+ view.offset = i % gridItems * itemSecondarySize;
871
+ }
872
+ }
873
+ this.$_startIndex = startIndex;
874
+ this.$_endIndex = endIndex;
875
+ if (this.emitUpdate) this.$emit("update", startIndex, endIndex, visibleStartIndex, visibleEndIndex);
876
+ clearTimeout(this.$_sortTimer);
877
+ this.$_sortTimer = setTimeout(this.sortViews, this.updateInterval + 300);
878
+ return {
879
+ continuous
880
+ };
881
+ },
882
+ getListenerTarget() {
883
+ let target = getScrollParent(this.$el);
884
+ if (window.document && (target === window.document.documentElement || target === window.document.body)) {
885
+ target = window;
886
+ }
887
+ return target;
888
+ },
889
+ getScroll() {
890
+ const { $el: el, direction } = this;
891
+ const isVertical = direction === "vertical";
892
+ let scrollState;
893
+ if (this.pageMode) {
894
+ const bounds = el.getBoundingClientRect();
895
+ const boundsSize = isVertical ? bounds.height : bounds.width;
896
+ let start = -(isVertical ? bounds.top : bounds.left);
897
+ let size = isVertical ? window.innerHeight : window.innerWidth;
898
+ if (start < 0) {
899
+ size += start;
900
+ start = 0;
901
+ }
902
+ if (start + size > boundsSize) {
903
+ size = boundsSize - start;
904
+ }
905
+ scrollState = {
906
+ start,
907
+ end: start + size
908
+ };
909
+ } else if (isVertical) {
910
+ scrollState = {
911
+ start: el.scrollTop,
912
+ end: el.scrollTop + el.clientHeight
913
+ };
914
+ } else {
915
+ scrollState = {
916
+ start: el.scrollLeft,
917
+ end: el.scrollLeft + el.clientWidth
918
+ };
919
+ }
920
+ return scrollState;
921
+ },
922
+ applyPageMode() {
923
+ if (this.pageMode) {
924
+ this.addListeners();
925
+ } else {
926
+ this.removeListeners();
927
+ }
928
+ },
929
+ addListeners() {
930
+ this.listenerTarget = this.getListenerTarget();
931
+ this.listenerTarget.addEventListener("scroll", this.handleScroll, supportsPassive ? {
932
+ passive: true
933
+ } : false);
934
+ this.listenerTarget.addEventListener("resize", this.handleResize);
935
+ },
936
+ removeListeners() {
937
+ if (!this.listenerTarget) {
938
+ return;
939
+ }
940
+ this.listenerTarget.removeEventListener("scroll", this.handleScroll);
941
+ this.listenerTarget.removeEventListener("resize", this.handleResize);
942
+ this.listenerTarget = null;
943
+ },
944
+ scrollToItem(index) {
945
+ let scroll3;
946
+ const gridItems = this.gridItems || 1;
947
+ if (this.itemSize === null) {
948
+ scroll3 = index > 0 ? this.sizes[index - 1].accumulator : 0;
949
+ } else {
950
+ scroll3 = Math.floor(index / gridItems) * this.itemSize;
951
+ }
952
+ this.scrollToPosition(scroll3);
953
+ },
954
+ scrollToPosition(position) {
955
+ const direction = this.direction === "vertical" ? { scroll: "scrollTop", start: "top" } : { scroll: "scrollLeft", start: "left" };
956
+ let viewport;
957
+ let scrollDirection;
958
+ let scrollDistance;
959
+ if (this.pageMode) {
960
+ const viewportEl = getScrollParent(this.$el);
961
+ const scrollTop = viewportEl.tagName === "HTML" ? 0 : viewportEl[direction.scroll];
962
+ const bounds = viewportEl.getBoundingClientRect();
963
+ const scroller = this.$el.getBoundingClientRect();
964
+ const scrollerPosition = scroller[direction.start] - bounds[direction.start];
965
+ viewport = viewportEl;
966
+ scrollDirection = direction.scroll;
967
+ scrollDistance = position + scrollTop + scrollerPosition;
968
+ } else {
969
+ viewport = this.$el;
970
+ scrollDirection = direction.scroll;
971
+ scrollDistance = position;
972
+ }
973
+ viewport[scrollDirection] = scrollDistance;
974
+ },
975
+ itemsLimitError() {
976
+ setTimeout(() => {
977
+ console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.", "Scroller:", this.$el);
978
+ console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.");
979
+ });
980
+ throw new Error("Rendered items limit reached");
981
+ },
982
+ sortViews() {
983
+ this.pool.sort((viewA, viewB) => viewA.nr.index - viewB.nr.index);
984
+ }
985
+ }
986
+ };
987
+ const _hoisted_1 = {
988
+ key: 0,
989
+ ref: "before",
990
+ class: "vue-recycle-scroller__slot"
991
+ };
992
+ const _hoisted_2 = {
993
+ key: 1,
994
+ ref: "after",
995
+ class: "vue-recycle-scroller__slot"
996
+ };
997
+ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
998
+ const _component_ResizeObserver = resolveComponent("ResizeObserver");
999
+ const _directive_observe_visibility = resolveDirective("observe-visibility");
1000
+ return withDirectives((openBlock(), createElementBlock(
1001
+ "div",
1002
+ {
1003
+ class: normalizeClass(["vue-recycle-scroller", {
1004
+ ready: $data.ready,
1005
+ "page-mode": $props.pageMode,
1006
+ [`direction-${_ctx.direction}`]: true
1007
+ }]),
1008
+ onScrollPassive: _cache[0] || (_cache[0] = (...args) => $options.handleScroll && $options.handleScroll(...args))
1009
+ },
1010
+ [
1011
+ _ctx.$slots.before ? (openBlock(), createElementBlock(
1012
+ "div",
1013
+ _hoisted_1,
1014
+ [
1015
+ renderSlot(_ctx.$slots, "before")
1016
+ ],
1017
+ 512
1018
+ /* NEED_PATCH */
1019
+ )) : createCommentVNode("v-if", true),
1020
+ (openBlock(), createBlock(resolveDynamicComponent($props.listTag), {
1021
+ ref: "wrapper",
1022
+ style: normalizeStyle({ [_ctx.direction === "vertical" ? "minHeight" : "minWidth"]: $data.totalSize + "px" }),
1023
+ class: normalizeClass(["vue-recycle-scroller__item-wrapper", $props.listClass])
1024
+ }, {
1025
+ default: withCtx(() => [
1026
+ (openBlock(true), createElementBlock(
1027
+ Fragment,
1028
+ null,
1029
+ renderList($data.pool, (view) => {
1030
+ return openBlock(), createBlock(resolveDynamicComponent($props.itemTag), mergeProps({
1031
+ key: view.nr.id,
1032
+ style: $data.ready ? {
1033
+ transform: `translate${_ctx.direction === "vertical" ? "Y" : "X"}(${view.position}px) translate${_ctx.direction === "vertical" ? "X" : "Y"}(${view.offset}px)`,
1034
+ width: $props.gridItems ? `${_ctx.direction === "vertical" ? $props.itemSecondarySize || $props.itemSize : $props.itemSize}px` : void 0,
1035
+ height: $props.gridItems ? `${_ctx.direction === "horizontal" ? $props.itemSecondarySize || $props.itemSize : $props.itemSize}px` : void 0
1036
+ } : null,
1037
+ class: ["vue-recycle-scroller__item-view", [
1038
+ $props.itemClass,
1039
+ {
1040
+ hover: !$props.skipHover && $data.hoverKey === view.nr.key
1041
+ }
1042
+ ]]
1043
+ }, toHandlers($props.skipHover ? {} : {
1044
+ mouseenter: () => {
1045
+ $data.hoverKey = view.nr.key;
1046
+ },
1047
+ mouseleave: () => {
1048
+ $data.hoverKey = null;
1049
+ }
1050
+ })), {
1051
+ default: withCtx(() => [
1052
+ renderSlot(_ctx.$slots, "default", {
1053
+ item: view.item,
1054
+ index: view.nr.index,
1055
+ active: view.nr.used
1056
+ })
1057
+ ]),
1058
+ _: 2
1059
+ /* DYNAMIC */
1060
+ }, 1040, ["style", "class"]);
1061
+ }),
1062
+ 128
1063
+ /* KEYED_FRAGMENT */
1064
+ )),
1065
+ renderSlot(_ctx.$slots, "empty")
1066
+ ]),
1067
+ _: 3
1068
+ /* FORWARDED */
1069
+ }, 8, ["style", "class"])),
1070
+ _ctx.$slots.after ? (openBlock(), createElementBlock(
1071
+ "div",
1072
+ _hoisted_2,
1073
+ [
1074
+ renderSlot(_ctx.$slots, "after")
1075
+ ],
1076
+ 512
1077
+ /* NEED_PATCH */
1078
+ )) : createCommentVNode("v-if", true),
1079
+ createVNode(_component_ResizeObserver, { onNotify: $options.handleResize }, null, 8, ["onNotify"])
1080
+ ],
1081
+ 34
1082
+ /* CLASS, HYDRATE_EVENTS */
1083
+ )), [
1084
+ [_directive_observe_visibility, $options.handleVisibilityChange]
1085
+ ]);
1086
+ }
1087
+ script$2.render = render$1;
1088
+ script$2.__file = "src/components/RecycleScroller.vue";
1089
+ var script$1 = {
1090
+ name: "DynamicScroller",
1091
+ components: {
1092
+ RecycleScroller: script$2
1093
+ },
1094
+ provide() {
1095
+ if (typeof ResizeObserver !== "undefined") {
1096
+ this.$_resizeObserver = new ResizeObserver((entries) => {
1097
+ requestAnimationFrame(() => {
1098
+ if (!Array.isArray(entries)) {
1099
+ return;
1100
+ }
1101
+ for (const entry of entries) {
1102
+ if (entry.target && entry.target.$_vs_onResize) {
1103
+ let width, height;
1104
+ if (entry.borderBoxSize) {
1105
+ const resizeObserverSize = entry.borderBoxSize[0];
1106
+ width = resizeObserverSize.inlineSize;
1107
+ height = resizeObserverSize.blockSize;
1108
+ } else {
1109
+ width = entry.contentRect.width;
1110
+ height = entry.contentRect.height;
1111
+ }
1112
+ entry.target.$_vs_onResize(entry.target.$_vs_id, width, height);
1113
+ }
1114
+ }
1115
+ });
1116
+ });
1117
+ }
1118
+ return {
1119
+ vscrollData: this.vscrollData,
1120
+ vscrollParent: this,
1121
+ vscrollResizeObserver: this.$_resizeObserver
1122
+ };
1123
+ },
1124
+ inheritAttrs: false,
1125
+ props: __spreadProps(__spreadValues({}, props), {
1126
+ minItemSize: {
1127
+ type: [Number, String],
1128
+ required: true
1129
+ }
1130
+ }),
1131
+ emits: [
1132
+ "resize",
1133
+ "visible"
1134
+ ],
1135
+ data() {
1136
+ return {
1137
+ vscrollData: {
1138
+ active: true,
1139
+ sizes: {},
1140
+ keyField: this.keyField,
1141
+ simpleArray: false
1142
+ }
1143
+ };
1144
+ },
1145
+ computed: {
1146
+ simpleArray,
1147
+ itemsWithSize() {
1148
+ const result = [];
1149
+ const { items, keyField, simpleArray: simpleArray2 } = this;
1150
+ const sizes = this.vscrollData.sizes;
1151
+ const l = items.length;
1152
+ for (let i = 0; i < l; i++) {
1153
+ const item = items[i];
1154
+ const id = simpleArray2 ? i : item[keyField];
1155
+ let size = sizes[id];
1156
+ if (typeof size === "undefined" && !this.$_undefinedMap[id]) {
1157
+ size = 0;
1158
+ }
1159
+ result.push({
1160
+ item,
1161
+ id,
1162
+ size
1163
+ });
1164
+ }
1165
+ return result;
1166
+ }
1167
+ },
1168
+ watch: {
1169
+ items() {
1170
+ this.forceUpdate();
1171
+ },
1172
+ simpleArray: {
1173
+ handler(value) {
1174
+ this.vscrollData.simpleArray = value;
1175
+ },
1176
+ immediate: true
1177
+ },
1178
+ direction(value) {
1179
+ this.forceUpdate(true);
1180
+ },
1181
+ itemsWithSize(next, prev) {
1182
+ const scrollTop = this.$el.scrollTop;
1183
+ let prevActiveTop = 0;
1184
+ let activeTop = 0;
1185
+ const length = Math.min(next.length, prev.length);
1186
+ for (let i = 0; i < length; i++) {
1187
+ if (prevActiveTop >= scrollTop) {
1188
+ break;
1189
+ }
1190
+ prevActiveTop += prev[i].size || this.minItemSize;
1191
+ activeTop += next[i].size || this.minItemSize;
1192
+ }
1193
+ const offset = activeTop - prevActiveTop;
1194
+ if (offset === 0) {
1195
+ return;
1196
+ }
1197
+ this.$el.scrollTop += offset;
1198
+ }
1199
+ },
1200
+ beforeCreate() {
1201
+ this.$_updates = [];
1202
+ this.$_undefinedSizes = 0;
1203
+ this.$_undefinedMap = {};
1204
+ this.$_events = mitt();
1205
+ },
1206
+ activated() {
1207
+ this.vscrollData.active = true;
1208
+ },
1209
+ deactivated() {
1210
+ this.vscrollData.active = false;
1211
+ },
1212
+ unmounted() {
1213
+ this.$_events.all.clear();
1214
+ },
1215
+ methods: {
1216
+ onScrollerResize() {
1217
+ const scroller = this.$refs.scroller;
1218
+ if (scroller) {
1219
+ this.forceUpdate();
1220
+ }
1221
+ this.$emit("resize");
1222
+ },
1223
+ onScrollerVisible() {
1224
+ this.$_events.emit("vscroll:update", { force: false });
1225
+ this.$emit("visible");
1226
+ },
1227
+ forceUpdate(clear = false) {
1228
+ if (clear || this.simpleArray) {
1229
+ this.vscrollData.sizes = {};
1230
+ }
1231
+ this.$_events.emit("vscroll:update", { force: true });
1232
+ },
1233
+ scrollToItem(index) {
1234
+ const scroller = this.$refs.scroller;
1235
+ if (scroller) scroller.scrollToItem(index);
1236
+ },
1237
+ getItemSize(item, index = void 0) {
1238
+ const id = this.simpleArray ? index != null ? index : this.items.indexOf(item) : item[this.keyField];
1239
+ return this.vscrollData.sizes[id] || 0;
1240
+ },
1241
+ scrollToBottom() {
1242
+ if (this.$_scrollingToBottom) return;
1243
+ this.$_scrollingToBottom = true;
1244
+ const el = this.$el;
1245
+ this.$nextTick(() => {
1246
+ el.scrollTop = el.scrollHeight + 5e3;
1247
+ const cb = () => {
1248
+ el.scrollTop = el.scrollHeight + 5e3;
1249
+ requestAnimationFrame(() => {
1250
+ el.scrollTop = el.scrollHeight + 5e3;
1251
+ if (this.$_undefinedSizes === 0) {
1252
+ this.$_scrollingToBottom = false;
1253
+ } else {
1254
+ requestAnimationFrame(cb);
1255
+ }
1256
+ });
1257
+ };
1258
+ requestAnimationFrame(cb);
1259
+ });
1260
+ }
1261
+ }
1262
+ };
1263
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
1264
+ const _component_RecycleScroller = resolveComponent("RecycleScroller");
1265
+ return openBlock(), createBlock(_component_RecycleScroller, mergeProps({
1266
+ ref: "scroller",
1267
+ items: $options.itemsWithSize,
1268
+ "min-item-size": $props.minItemSize,
1269
+ direction: _ctx.direction,
1270
+ "key-field": "id",
1271
+ "list-tag": _ctx.listTag,
1272
+ "item-tag": _ctx.itemTag
1273
+ }, _ctx.$attrs, {
1274
+ onResize: $options.onScrollerResize,
1275
+ onVisible: $options.onScrollerVisible
1276
+ }), {
1277
+ default: withCtx(({ item: itemWithSize, index, active }) => [
1278
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
1279
+ item: itemWithSize.item,
1280
+ index,
1281
+ active,
1282
+ itemWithSize
1283
+ })))
1284
+ ]),
1285
+ before: withCtx(() => [
1286
+ renderSlot(_ctx.$slots, "before")
1287
+ ]),
1288
+ after: withCtx(() => [
1289
+ renderSlot(_ctx.$slots, "after")
1290
+ ]),
1291
+ empty: withCtx(() => [
1292
+ renderSlot(_ctx.$slots, "empty")
1293
+ ]),
1294
+ _: 3
1295
+ /* FORWARDED */
1296
+ }, 16, ["items", "min-item-size", "direction", "list-tag", "item-tag", "onResize", "onVisible"]);
1297
+ }
1298
+ script$1.render = render;
1299
+ script$1.__file = "src/components/DynamicScroller.vue";
1300
+ var script = {
1301
+ name: "DynamicScrollerItem",
1302
+ inject: [
1303
+ "vscrollData",
1304
+ "vscrollParent",
1305
+ "vscrollResizeObserver"
1306
+ ],
1307
+ props: {
1308
+ // eslint-disable-next-line vue/require-prop-types
1309
+ item: {
1310
+ required: true
1311
+ },
1312
+ watchData: {
1313
+ type: Boolean,
1314
+ default: false
1315
+ },
1316
+ /**
1317
+ * Indicates if the view is actively used to display an item.
1318
+ */
1319
+ active: {
1320
+ type: Boolean,
1321
+ required: true
1322
+ },
1323
+ index: {
1324
+ type: Number,
1325
+ default: void 0
1326
+ },
1327
+ sizeDependencies: {
1328
+ type: [Array, Object],
1329
+ default: null
1330
+ },
1331
+ emitResize: {
1332
+ type: Boolean,
1333
+ default: false
1334
+ },
1335
+ tag: {
1336
+ type: String,
1337
+ default: "div"
1338
+ }
1339
+ },
1340
+ emits: [
1341
+ "resize"
1342
+ ],
1343
+ computed: {
1344
+ id() {
1345
+ if (this.vscrollData.simpleArray) return this.index;
1346
+ if (this.vscrollData.keyField in this.item) return this.item[this.vscrollData.keyField];
1347
+ throw new Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`);
1348
+ },
1349
+ size() {
1350
+ return this.vscrollData.sizes[this.id] || 0;
1351
+ },
1352
+ finalActive() {
1353
+ return this.active && this.vscrollData.active;
1354
+ }
1355
+ },
1356
+ watch: {
1357
+ watchData: "updateWatchData",
1358
+ id(value, oldValue) {
1359
+ this.$el.$_vs_id = this.id;
1360
+ if (!this.size) {
1361
+ this.onDataUpdate();
1362
+ }
1363
+ if (this.$_sizeObserved) {
1364
+ const oldSize = this.vscrollData.sizes[oldValue];
1365
+ const size = this.vscrollData.sizes[value];
1366
+ if (oldSize != null && oldSize !== size) {
1367
+ this.applySize(oldSize);
1368
+ }
1369
+ }
1370
+ },
1371
+ finalActive(value) {
1372
+ if (!this.size) {
1373
+ if (value) {
1374
+ if (!this.vscrollParent.$_undefinedMap[this.id]) {
1375
+ this.vscrollParent.$_undefinedSizes++;
1376
+ this.vscrollParent.$_undefinedMap[this.id] = true;
1377
+ }
1378
+ } else {
1379
+ if (this.vscrollParent.$_undefinedMap[this.id]) {
1380
+ this.vscrollParent.$_undefinedSizes--;
1381
+ this.vscrollParent.$_undefinedMap[this.id] = false;
1382
+ }
1383
+ }
1384
+ }
1385
+ if (this.vscrollResizeObserver) {
1386
+ if (value) {
1387
+ this.observeSize();
1388
+ } else {
1389
+ this.unobserveSize();
1390
+ }
1391
+ } else if (value && this.$_pendingVScrollUpdate === this.id) {
1392
+ this.updateSize();
1393
+ }
1394
+ }
1395
+ },
1396
+ created() {
1397
+ if (this.$isServer) return;
1398
+ this.$_forceNextVScrollUpdate = null;
1399
+ this.updateWatchData();
1400
+ if (!this.vscrollResizeObserver) {
1401
+ for (const k in this.sizeDependencies) {
1402
+ this.$watch(() => this.sizeDependencies[k], this.onDataUpdate);
1403
+ }
1404
+ this.vscrollParent.$_events.on("vscroll:update", this.onVscrollUpdate);
1405
+ }
1406
+ },
1407
+ mounted() {
1408
+ if (this.finalActive) {
1409
+ this.updateSize();
1410
+ this.observeSize();
1411
+ }
1412
+ },
1413
+ beforeUnmount() {
1414
+ this.vscrollParent.$_events.off("vscroll:update", this.onVscrollUpdate);
1415
+ this.unobserveSize();
1416
+ },
1417
+ methods: {
1418
+ updateSize() {
1419
+ if (this.finalActive) {
1420
+ if (this.$_pendingSizeUpdate !== this.id) {
1421
+ this.$_pendingSizeUpdate = this.id;
1422
+ this.$_forceNextVScrollUpdate = null;
1423
+ this.$_pendingVScrollUpdate = null;
1424
+ this.computeSize(this.id);
1425
+ }
1426
+ } else {
1427
+ this.$_forceNextVScrollUpdate = this.id;
1428
+ }
1429
+ },
1430
+ updateWatchData() {
1431
+ if (this.watchData && !this.vscrollResizeObserver) {
1432
+ this.$_watchData = this.$watch("item", () => {
1433
+ this.onDataUpdate();
1434
+ }, {
1435
+ deep: true
1436
+ });
1437
+ } else if (this.$_watchData) {
1438
+ this.$_watchData();
1439
+ this.$_watchData = null;
1440
+ }
1441
+ },
1442
+ onVscrollUpdate({ force }) {
1443
+ if (!this.finalActive && force) {
1444
+ this.$_pendingVScrollUpdate = this.id;
1445
+ }
1446
+ if (this.$_forceNextVScrollUpdate === this.id || force || !this.size) {
1447
+ this.updateSize();
1448
+ }
1449
+ },
1450
+ onDataUpdate() {
1451
+ this.updateSize();
1452
+ },
1453
+ computeSize(id) {
1454
+ this.$nextTick(() => {
1455
+ if (this.id === id) {
1456
+ const width = this.$el.offsetWidth;
1457
+ const height = this.$el.offsetHeight;
1458
+ this.applyWidthHeight(width, height);
1459
+ }
1460
+ this.$_pendingSizeUpdate = null;
1461
+ });
1462
+ },
1463
+ applyWidthHeight(width, height) {
1464
+ const size = ~~(this.vscrollParent.direction === "vertical" ? height : width);
1465
+ if (size && this.size !== size) {
1466
+ this.applySize(size);
1467
+ }
1468
+ },
1469
+ applySize(size) {
1470
+ if (this.vscrollParent.$_undefinedMap[this.id]) {
1471
+ this.vscrollParent.$_undefinedSizes--;
1472
+ this.vscrollParent.$_undefinedMap[this.id] = void 0;
1473
+ }
1474
+ this.vscrollData.sizes[this.id] = size;
1475
+ if (this.emitResize) this.$emit("resize", this.id);
1476
+ },
1477
+ observeSize() {
1478
+ if (!this.vscrollResizeObserver) return;
1479
+ if (this.$_sizeObserved) return;
1480
+ this.vscrollResizeObserver.observe(this.$el);
1481
+ this.$el.$_vs_id = this.id;
1482
+ this.$el.$_vs_onResize = this.onResize;
1483
+ this.$_sizeObserved = true;
1484
+ },
1485
+ unobserveSize() {
1486
+ if (!this.vscrollResizeObserver) return;
1487
+ if (!this.$_sizeObserved) return;
1488
+ this.vscrollResizeObserver.unobserve(this.$el);
1489
+ this.$el.$_vs_onResize = void 0;
1490
+ this.$_sizeObserved = false;
1491
+ },
1492
+ onResize(id, width, height) {
1493
+ if (this.id === id) {
1494
+ this.applyWidthHeight(width, height);
1495
+ }
1496
+ }
1497
+ },
1498
+ render() {
1499
+ return h(this.tag, this.$slots.default());
1500
+ }
1501
+ };
1502
+ script.__file = "src/components/DynamicScrollerItem.vue";
1503
+ export {
1504
+ script as a,
1505
+ script$2 as b,
1506
+ script$1 as s
1507
+ };