@opentiny/vue-dynamic-scroller 2.8.2 → 3.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/pc.js +79 -111
  2. package/package.json +3 -3
package/lib/pc.js CHANGED
@@ -1,61 +1,53 @@
1
1
  import { renderless, api } from "@opentiny/vue-renderless/dynamic-scroller/vue";
2
2
  import { defineComponent, props, setup as _setup, emitter } from "@opentiny/vue-common";
3
3
  import RecycleScroller from "@opentiny/vue-recycle-scroller";
4
- function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
5
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
6
- if (render) {
7
- options.render = render;
8
- options.staticRenderFns = staticRenderFns;
9
- options._compiled = true;
10
- }
11
- if (functionalTemplate) {
12
- options.functional = true;
13
- }
14
- if (scopeId) {
15
- options._scopeId = "data-v-" + scopeId;
16
- }
17
- var hook;
18
- if (moduleIdentifier) {
19
- hook = function hook2(context) {
20
- context = context || // cached call
21
- this.$vnode && this.$vnode.ssrContext || // stateful
22
- this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
23
- if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
24
- context = __VUE_SSR_CONTEXT__;
25
- }
26
- if (injectStyles) {
27
- injectStyles.call(this, context);
28
- }
29
- if (context && context._registeredComponents) {
30
- context._registeredComponents.add(moduleIdentifier);
31
- }
4
+ import { resolveComponent, openBlock, createBlock, mergeProps, withCtx, renderSlot, normalizeProps, guardReactiveProps } from "vue";
5
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
6
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
7
+ if (it)
8
+ return (it = it.call(o)).next.bind(it);
9
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
10
+ if (it)
11
+ o = it;
12
+ var i = 0;
13
+ return function() {
14
+ if (i >= o.length)
15
+ return { done: true };
16
+ return { done: false, value: o[i++] };
32
17
  };
33
- options._ssrRegister = hook;
34
- } else if (injectStyles) {
35
- hook = shadowMode ? function() {
36
- injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
37
- } : injectStyles;
38
- }
39
- if (hook) {
40
- if (options.functional) {
41
- options._injectStyles = hook;
42
- var originalRender = options.render;
43
- options.render = function renderWithStyleInjection(h, context) {
44
- hook.call(context);
45
- return originalRender(h, context);
46
- };
47
- } else {
48
- var existing = options.beforeCreate;
49
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
50
- }
51
18
  }
52
- return {
53
- exports: scriptExports,
54
- options
55
- };
19
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
56
20
  }
21
+ function _unsupportedIterableToArray(o, minLen) {
22
+ if (!o)
23
+ return;
24
+ if (typeof o === "string")
25
+ return _arrayLikeToArray(o, minLen);
26
+ var n = Object.prototype.toString.call(o).slice(8, -1);
27
+ if (n === "Object" && o.constructor)
28
+ n = o.constructor.name;
29
+ if (n === "Map" || n === "Set")
30
+ return Array.from(o);
31
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
32
+ return _arrayLikeToArray(o, minLen);
33
+ }
34
+ function _arrayLikeToArray(arr, len) {
35
+ if (len == null || len > arr.length)
36
+ len = arr.length;
37
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
38
+ arr2[i] = arr[i];
39
+ return arr2;
40
+ }
41
+ var _export_sfc = function _export_sfc2(sfc, props) {
42
+ var target = sfc.__vccOpts || sfc;
43
+ for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
44
+ var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
45
+ target[key] = val;
46
+ }
47
+ return target;
48
+ };
57
49
 
58
- var __vue2_script = defineComponent({
50
+ var _sfc_main = defineComponent({
59
51
  inheritAttrs: false,
60
52
  emits: ["resize", "visible"],
61
53
  props: [].concat(props, ["items", "keyField", "direction", "listTag", "itemTag", "minItemSize"]),
@@ -74,68 +66,44 @@ var __vue2_script = defineComponent({
74
66
  });
75
67
  }
76
68
  });
77
- var render = function render2() {
78
- var _vm = this;
79
- var _h = _vm.$createElement;
80
- var _c = _vm._self._c || _h;
81
- return _c("tiny-recycle-scroller", _vm._b({
69
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
70
+ var _component_tiny_recycle_scroller = resolveComponent("tiny-recycle-scroller");
71
+ return openBlock(), createBlock(_component_tiny_recycle_scroller, mergeProps({
82
72
  ref: "scroller",
83
- staticClass: "tiny-dynamic-scroller",
84
- attrs: {
85
- "items": _vm.state.itemsWithSize,
86
- "min-item-size": _vm.minItemSize,
87
- "direction": _vm.direction,
88
- "key-field": _vm.keyField,
89
- "list-tag": _vm.listTag,
90
- "item-tag": _vm.itemTag
91
- },
92
- on: {
93
- "resize": _vm.onScrollerResize,
94
- "visible": _vm.onScrollerVisible
95
- },
96
- scopedSlots: _vm._u([{
97
- key: "default",
98
- fn: function fn(_ref) {
99
- var itemWithSize = _ref.item, index = _ref.index, active = _ref.active;
100
- return [_vm._t("default", null, null, {
101
- item: itemWithSize.item,
102
- index,
103
- active,
104
- itemWithSize
105
- })];
106
- }
107
- }, {
108
- key: "before",
109
- fn: function fn() {
110
- return [_vm._t("before")];
111
- },
112
- proxy: true
113
- }, {
114
- key: "after",
115
- fn: function fn() {
116
- return [_vm._t("after")];
117
- },
118
- proxy: true
119
- }, {
120
- key: "empty",
121
- fn: function fn() {
122
- return [_vm._t("empty")];
123
- },
124
- proxy: true
125
- }], null, true)
126
- }, "tiny-recycle-scroller", _vm.$attrs, false));
127
- };
128
- var staticRenderFns = [];
129
- var __cssModules = {};
130
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
131
- function __vue2_injectStyles(context) {
132
- for (var o in __cssModules) {
133
- this[o] = __cssModules[o];
134
- }
73
+ class: "tiny-dynamic-scroller",
74
+ items: _ctx.state.itemsWithSize,
75
+ "min-item-size": _ctx.minItemSize,
76
+ direction: _ctx.direction,
77
+ "key-field": _ctx.keyField,
78
+ "list-tag": _ctx.listTag,
79
+ "item-tag": _ctx.itemTag
80
+ }, _ctx.$attrs, {
81
+ onResize: _ctx.onScrollerResize,
82
+ onVisible: _ctx.onScrollerVisible
83
+ }), {
84
+ default: withCtx(function(_ref) {
85
+ var itemWithSize = _ref.item, index = _ref.index, active = _ref.active;
86
+ return [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
87
+ item: itemWithSize.item,
88
+ index,
89
+ active,
90
+ itemWithSize
91
+ })))];
92
+ }),
93
+ before: withCtx(function() {
94
+ return [renderSlot(_ctx.$slots, "before")];
95
+ }),
96
+ after: withCtx(function() {
97
+ return [renderSlot(_ctx.$slots, "after")];
98
+ }),
99
+ empty: withCtx(function() {
100
+ return [renderSlot(_ctx.$slots, "empty")];
101
+ }),
102
+ _: 3
103
+ /* FORWARDED */
104
+ }, 16, ["items", "min-item-size", "direction", "key-field", "list-tag", "item-tag", "onResize", "onVisible"]);
135
105
  }
136
- var pc = /* @__PURE__ */ function() {
137
- return __component__.exports;
138
- }();
106
+ var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
139
107
  export {
140
108
  pc as default
141
109
  };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@opentiny/vue-dynamic-scroller",
3
- "version": "2.8.2",
3
+ "version": "3.8.2",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",
7
7
  "dependencies": {
8
- "@opentiny/vue-common": "~2.8.2",
8
+ "@opentiny/vue-common": "~3.8.2",
9
9
  "@opentiny/vue-renderless": "~3.8.2",
10
- "@opentiny/vue-recycle-scroller": "~2.8.2"
10
+ "@opentiny/vue-recycle-scroller": "~3.8.2"
11
11
  },
12
12
  "license": "MIT",
13
13
  "types": "index.d.ts"