@opentiny/vue-dynamic-scroller 2.7.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.
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 - present TinyVue Authors.
4
+ Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import DynamicScroller from './src/index';
2
+ export default DynamicScroller;
package/lib/index.js ADDED
@@ -0,0 +1,68 @@
1
+ function _extends() {
2
+ _extends = Object.assign ? Object.assign.bind() : function(target) {
3
+ for (var i = 1; i < arguments.length; i++) {
4
+ var source = arguments[i];
5
+ for (var key in source) {
6
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
7
+ target[key] = source[key];
8
+ }
9
+ }
10
+ }
11
+ return target;
12
+ };
13
+ return _extends.apply(this, arguments);
14
+ }
15
+ import { defineComponent, $prefix, $props, $setup } from "@opentiny/vue-common";
16
+ import PcTemplate from "./pc.js";
17
+ import RecycleScroller from "@opentiny/vue-recycle-scroller";
18
+ var template = function template2(mode) {
19
+ return PcTemplate;
20
+ };
21
+ var DynamicScroller = defineComponent({
22
+ name: $prefix + "DynamicScroller",
23
+ props: _extends({}, $props, {
24
+ items: {
25
+ type: Array,
26
+ required: true
27
+ },
28
+ keyField: {
29
+ type: String,
30
+ default: "id"
31
+ },
32
+ direction: {
33
+ type: String,
34
+ default: "vertical",
35
+ validator: function validator(value) {
36
+ return ["vertical", "horizontal"].includes(value);
37
+ }
38
+ },
39
+ listTag: {
40
+ type: String,
41
+ default: "div"
42
+ },
43
+ itemTag: {
44
+ type: String,
45
+ default: "div"
46
+ },
47
+ minItemSize: {
48
+ type: [Number, String],
49
+ required: true
50
+ }
51
+ }),
52
+ setup: function setup(props, context) {
53
+ return $setup({
54
+ props,
55
+ context,
56
+ template
57
+ });
58
+ }
59
+ });
60
+ var version = "5.0.0-mf.0";
61
+ DynamicScroller.IdState = RecycleScroller.IdState;
62
+ DynamicScroller.install = function(Vue) {
63
+ Vue.component(DynamicScroller.name, DynamicScroller);
64
+ };
65
+ DynamicScroller.version = version;
66
+ export {
67
+ DynamicScroller as default
68
+ };
package/lib/pc.js ADDED
@@ -0,0 +1,132 @@
1
+ import { renderless, api } from "@opentiny/vue-renderless/dynamic-scroller/vue";
2
+ import { defineComponent, props, setup as _setup, emitter } from "@opentiny/vue-common";
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
+ }
32
+ };
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
+ }
52
+ return {
53
+ exports: scriptExports,
54
+ options
55
+ };
56
+ }
57
+
58
+ var _sfc_main = defineComponent({
59
+ inheritAttrs: false,
60
+ emits: ["resize", "visible"],
61
+ props: [].concat(props, ["items", "keyField", "direction", "listTag", "itemTag", "minItemSize"]),
62
+ components: {
63
+ TinyRecycleScroller: RecycleScroller
64
+ },
65
+ setup: function setup(props2, context) {
66
+ return _setup({
67
+ props: props2,
68
+ context,
69
+ renderless,
70
+ api,
71
+ extendOptions: {
72
+ emitter
73
+ }
74
+ });
75
+ }
76
+ });
77
+ var _sfc_render = function render() {
78
+ var _vm = this, _c = _vm._self._c;
79
+ _vm._self._setupProxy;
80
+ return _c("tiny-recycle-scroller", _vm._b({
81
+ ref: "scroller",
82
+ staticClass: "tiny-dynamic-scroller",
83
+ attrs: {
84
+ "items": _vm.state.itemsWithSize,
85
+ "min-item-size": _vm.minItemSize,
86
+ "direction": _vm.direction,
87
+ "key-field": _vm.keyField,
88
+ "list-tag": _vm.listTag,
89
+ "item-tag": _vm.itemTag
90
+ },
91
+ on: {
92
+ "resize": _vm.onScrollerResize,
93
+ "visible": _vm.onScrollerVisible
94
+ },
95
+ scopedSlots: _vm._u([{
96
+ key: "default",
97
+ fn: function fn(_ref) {
98
+ var itemWithSize = _ref.item, index = _ref.index, active = _ref.active;
99
+ return [_vm._t("default", null, null, {
100
+ item: itemWithSize.item,
101
+ index,
102
+ active,
103
+ itemWithSize
104
+ })];
105
+ }
106
+ }, {
107
+ key: "before",
108
+ fn: function fn() {
109
+ return [_vm._t("before")];
110
+ },
111
+ proxy: true
112
+ }, {
113
+ key: "after",
114
+ fn: function fn() {
115
+ return [_vm._t("after")];
116
+ },
117
+ proxy: true
118
+ }, {
119
+ key: "empty",
120
+ fn: function fn() {
121
+ return [_vm._t("empty")];
122
+ },
123
+ proxy: true
124
+ }], null, true)
125
+ }, "tiny-recycle-scroller", _vm.$attrs, false));
126
+ };
127
+ var _sfc_staticRenderFns = [];
128
+ var __component__ = /* @__PURE__ */ normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, null, null, null);
129
+ var pc = __component__.exports;
130
+ export {
131
+ pc as default
132
+ };
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@opentiny/vue-dynamic-scroller",
3
+ "version": "2.7.0",
4
+ "description": "",
5
+ "main": "./lib/index.js",
6
+ "module": "./lib/index.js",
7
+ "sideEffects": false,
8
+ "dependencies": {
9
+ "@opentiny/vue-common": "~2.7.0",
10
+ "@opentiny/vue-renderless": "~3.9.0",
11
+ "@opentiny/vue-recycle-scroller": "~2.7.0"
12
+ },
13
+ "license": "MIT",
14
+ "types": "index.d.ts"
15
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,72 @@
1
+ declare const _default: import("@opentiny/vue-common").DefineComponent<{
2
+ items: {
3
+ type: ArrayConstructor;
4
+ required: true;
5
+ };
6
+ keyField: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ direction: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ validator: (value: unknown) => boolean;
14
+ };
15
+ listTag: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
19
+ itemTag: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ minItemSize: {
24
+ type: (NumberConstructor | StringConstructor)[];
25
+ required: true;
26
+ };
27
+ tiny_mode: StringConstructor;
28
+ tiny_mode_root: BooleanConstructor;
29
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
30
+ tiny_renderless: FunctionConstructor;
31
+ tiny_theme: StringConstructor;
32
+ tiny_chart_theme: ObjectConstructor;
33
+ }, () => import("vue").VNode, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("@opentiny/vue-common").ExtractPropTypes<{
34
+ items: {
35
+ type: ArrayConstructor;
36
+ required: true;
37
+ };
38
+ keyField: {
39
+ type: StringConstructor;
40
+ default: string;
41
+ };
42
+ direction: {
43
+ type: StringConstructor;
44
+ default: string;
45
+ validator: (value: unknown) => boolean;
46
+ };
47
+ listTag: {
48
+ type: StringConstructor;
49
+ default: string;
50
+ };
51
+ itemTag: {
52
+ type: StringConstructor;
53
+ default: string;
54
+ };
55
+ minItemSize: {
56
+ type: (NumberConstructor | StringConstructor)[];
57
+ required: true;
58
+ };
59
+ tiny_mode: StringConstructor;
60
+ tiny_mode_root: BooleanConstructor;
61
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
62
+ tiny_renderless: FunctionConstructor;
63
+ tiny_theme: StringConstructor;
64
+ tiny_chart_theme: ObjectConstructor;
65
+ }>>, {
66
+ tiny_mode_root: boolean;
67
+ direction: string;
68
+ keyField: string;
69
+ listTag: string;
70
+ itemTag: string;
71
+ }>;
72
+ export default _default;
@@ -0,0 +1,8 @@
1
+ declare const _sfc_main: import("@opentiny/vue-common").DefineComponent<Readonly<{
2
+ [x: string]: any;
3
+ }>, any, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, ("visible" | "resize")[], string, Readonly<import("@opentiny/vue-common").ExtractPropTypes<Readonly<{
4
+ [x: string]: any;
5
+ }>>>, {
6
+ [x: string]: any;
7
+ }>;
8
+ export default _sfc_main;