@tarojs/components-advanced 3.6.9 → 3.6.10-alpha.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 (78) hide show
  1. package/dist/components/index.d.ts +1 -0
  2. package/dist/components/index.js +1 -0
  3. package/dist/components/index.js.map +1 -1
  4. package/dist/components/virtual-list/index.d.ts +48 -27
  5. package/dist/components/virtual-list/index.js.map +1 -1
  6. package/dist/components/virtual-list/list-set.d.ts +4 -0
  7. package/dist/components/virtual-list/list-set.js +24 -59
  8. package/dist/components/virtual-list/list-set.js.map +1 -1
  9. package/dist/components/virtual-list/preset.d.ts +23 -8
  10. package/dist/components/virtual-list/preset.js +116 -60
  11. package/dist/components/virtual-list/preset.js.map +1 -1
  12. package/dist/components/virtual-list/react/index.d.ts +1 -1
  13. package/dist/components/virtual-list/react/index.js +8 -16
  14. package/dist/components/virtual-list/react/index.js.map +1 -1
  15. package/dist/components/virtual-list/react/list.d.ts +5 -4
  16. package/dist/components/virtual-list/react/list.js +138 -124
  17. package/dist/components/virtual-list/react/list.js.map +1 -1
  18. package/dist/components/virtual-list/react/validate.d.ts +1 -1
  19. package/dist/components/virtual-list/react/validate.js +8 -14
  20. package/dist/components/virtual-list/react/validate.js.map +1 -1
  21. package/dist/components/virtual-list/react/wrapper.d.ts +3 -0
  22. package/dist/components/virtual-list/react/wrapper.js +58 -0
  23. package/dist/components/virtual-list/react/wrapper.js.map +1 -0
  24. package/dist/components/virtual-list/utils.d.ts +1 -4
  25. package/dist/components/virtual-list/utils.js +1 -28
  26. package/dist/components/virtual-list/utils.js.map +1 -1
  27. package/dist/components/virtual-list/vue/list.d.ts +406 -50
  28. package/dist/components/virtual-list/vue/list.js +198 -169
  29. package/dist/components/virtual-list/vue/list.js.map +1 -1
  30. package/dist/components/virtual-waterfall/constants.d.ts +2 -0
  31. package/dist/components/virtual-waterfall/constants.js +4 -0
  32. package/dist/components/virtual-waterfall/constants.js.map +1 -0
  33. package/dist/components/virtual-waterfall/index.d.ts +251 -0
  34. package/dist/components/virtual-waterfall/index.js +6 -0
  35. package/dist/components/virtual-waterfall/index.js.map +1 -0
  36. package/dist/components/virtual-waterfall/list-map.d.ts +50 -0
  37. package/dist/components/virtual-waterfall/list-map.js +280 -0
  38. package/dist/components/virtual-waterfall/list-map.js.map +1 -0
  39. package/dist/components/virtual-waterfall/preset.d.ts +60 -0
  40. package/dist/components/virtual-waterfall/preset.js +170 -0
  41. package/dist/components/virtual-waterfall/preset.js.map +1 -0
  42. package/dist/components/virtual-waterfall/react/index.d.ts +4 -0
  43. package/dist/components/virtual-waterfall/react/index.js +26 -0
  44. package/dist/components/virtual-waterfall/react/index.js.map +1 -0
  45. package/dist/components/virtual-waterfall/react/waterfall.d.ts +42 -0
  46. package/dist/components/virtual-waterfall/react/waterfall.js +316 -0
  47. package/dist/components/virtual-waterfall/react/waterfall.js.map +1 -0
  48. package/dist/components/virtual-waterfall/react/wrapper.d.ts +3 -0
  49. package/dist/components/virtual-waterfall/react/wrapper.js +50 -0
  50. package/dist/components/virtual-waterfall/react/wrapper.js.map +1 -0
  51. package/dist/components/virtual-waterfall/vue/index.d.ts +17 -0
  52. package/dist/components/virtual-waterfall/vue/index.js +12 -0
  53. package/dist/components/virtual-waterfall/vue/index.js.map +1 -0
  54. package/dist/components/virtual-waterfall/vue/waterfall.d.ts +443 -0
  55. package/dist/components/virtual-waterfall/vue/waterfall.js +410 -0
  56. package/dist/components/virtual-waterfall/vue/waterfall.js.map +1 -0
  57. package/dist/index.js +4 -1
  58. package/dist/index.js.map +1 -1
  59. package/dist/utils/convert.d.ts +2 -2
  60. package/dist/utils/convert.js.map +1 -1
  61. package/dist/utils/dom.d.ts +7 -0
  62. package/dist/utils/dom.js +45 -0
  63. package/dist/utils/dom.js.map +1 -0
  64. package/dist/utils/helper.d.ts +10 -0
  65. package/dist/utils/helper.js +51 -0
  66. package/dist/utils/helper.js.map +1 -0
  67. package/dist/utils/index.d.ts +2 -0
  68. package/dist/utils/index.js +3 -1
  69. package/dist/utils/index.js.map +1 -1
  70. package/dist/utils/lodash.d.ts +3 -1
  71. package/dist/utils/lodash.js +30 -1
  72. package/dist/utils/lodash.js.map +1 -1
  73. package/dist/utils/vue-render.d.ts +4 -0
  74. package/dist/{components/virtual-list/vue/render.js → utils/vue-render.js} +2 -2
  75. package/dist/utils/vue-render.js.map +1 -0
  76. package/package.json +8 -6
  77. package/dist/components/virtual-list/vue/render.d.ts +0 -4
  78. package/dist/components/virtual-list/vue/render.js.map +0 -1
@@ -1,5 +1,7 @@
1
1
  export { convertNumber2PX, convertPX2Int } from './convert.js';
2
- export { omit } from './lodash.js';
2
+ export { getRectSize, getRectSizeSync, getScrollViewContextNode } from './dom.js';
3
+ export { defaultItemKey, getOffsetForIndexAndAlignment } from './helper.js';
4
+ export { debounce, omit, throttle } from './lodash.js';
3
5
  export { getMiddleNumber, isCosDistributing } from './math.js';
4
6
  export { cancelTimeout, requestTimeout } from './timer.js';
5
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1,2 +1,4 @@
1
1
  declare function omit<T extends Record<string, unknown> = Record<string, any>, P extends string = ''>(obj?: T, fields?: P[]): Omit<T, P>;
2
- export { omit };
2
+ declare function throttle(fn: any, threshold?: number, scope?: any): (...args: any[]) => void;
3
+ declare function debounce(fn: any, ms?: number, scope?: any): (...args: any[]) => void;
4
+ export { omit, throttle, debounce };
@@ -5,6 +5,35 @@ function omit(obj = {}, fields = []) {
5
5
  });
6
6
  return shallow;
7
7
  }
8
+ function throttle(fn, threshold = 250, scope) {
9
+ let lastTime = 0;
10
+ let deferTimer;
11
+ return function (...args) {
12
+ const context = scope || this;
13
+ const now = Date.now();
14
+ if (now - lastTime > threshold) {
15
+ fn.apply(this, args);
16
+ lastTime = now;
17
+ }
18
+ else {
19
+ clearTimeout(deferTimer);
20
+ deferTimer = setTimeout(() => {
21
+ lastTime = now;
22
+ fn.apply(context, args);
23
+ }, threshold);
24
+ }
25
+ };
26
+ }
27
+ function debounce(fn, ms = 250, scope) {
28
+ let timer;
29
+ return function (...args) {
30
+ const context = scope || this;
31
+ clearTimeout(timer);
32
+ timer = setTimeout(function () {
33
+ fn.apply(context, args);
34
+ }, ms);
35
+ };
36
+ }
8
37
 
9
- export { omit };
38
+ export { debounce, omit, throttle };
10
39
  //# sourceMappingURL=lodash.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lodash.js","sources":["../../src/utils/lodash.ts"],"sourcesContent":["export function omit<\n T extends Record<string, unknown> = Record<string, any>,\n P extends string = ''\n> (obj: T = ({} as T), fields: P[] = []): Omit<T, P> {\n const shallow = { ...obj }\n fields.forEach((key) => {\n delete shallow[key]\n })\n return shallow\n}\n"],"names":[],"mappings":"SAAgB,IAAI,CAGjB,MAAU,EAAQ,EAAE,SAAc,EAAE,EAAA;AACrC,IAAA,MAAM,OAAO,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,GAAG,CAAE,CAAA;AAC1B,IAAA,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,KAAI;AACrB,QAAA,OAAO,OAAO,CAAC,GAAG,CAAC,CAAA;AACrB,KAAC,CAAC,CAAA;AACF,IAAA,OAAO,OAAO,CAAA;AAChB;;;;"}
1
+ {"version":3,"file":"lodash.js","sources":["../../src/utils/lodash.ts"],"sourcesContent":["export function omit<\n T extends Record<string, unknown> = Record<string, any>,\n P extends string = ''\n> (obj: T = ({} as T), fields: P[] = []): Omit<T, P> {\n const shallow = { ...obj }\n fields.forEach((key) => {\n delete shallow[key]\n })\n return shallow\n}\n\nexport function throttle (fn, threshold = 250, scope?) {\n let lastTime = 0\n let deferTimer: ReturnType<typeof setTimeout>\n return function (...args) {\n const context = scope || this\n const now = Date.now()\n if (now - lastTime > threshold) {\n fn.apply(this, args)\n lastTime = now\n } else {\n clearTimeout(deferTimer)\n deferTimer = setTimeout(() => {\n lastTime = now\n fn.apply(context, args)\n }, threshold)\n }\n }\n}\n\nexport function debounce (fn, ms = 250, scope?) {\n let timer: ReturnType<typeof setTimeout>\n\n return function (...args) {\n const context = scope || this\n clearTimeout(timer)\n timer = setTimeout(function () {\n fn.apply(context, args)\n }, ms)\n }\n}\n"],"names":[],"mappings":"SAAgB,IAAI,CAGjB,MAAU,EAAQ,EAAE,SAAc,EAAE,EAAA;AACrC,IAAA,MAAM,OAAO,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,GAAG,CAAE,CAAA;AAC1B,IAAA,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,KAAI;AACrB,QAAA,OAAO,OAAO,CAAC,GAAG,CAAC,CAAA;AACrB,KAAC,CAAC,CAAA;AACF,IAAA,OAAO,OAAO,CAAA;AAChB,CAAC;AAEK,SAAU,QAAQ,CAAE,EAAE,EAAE,SAAS,GAAG,GAAG,EAAE,KAAM,EAAA;IACnD,IAAI,QAAQ,GAAG,CAAC,CAAA;AAChB,IAAA,IAAI,UAAyC,CAAA;IAC7C,OAAO,UAAU,GAAG,IAAI,EAAA;AACtB,QAAA,MAAM,OAAO,GAAG,KAAK,IAAI,IAAI,CAAA;AAC7B,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;AACtB,QAAA,IAAI,GAAG,GAAG,QAAQ,GAAG,SAAS,EAAE;AAC9B,YAAA,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;YACpB,QAAQ,GAAG,GAAG,CAAA;AACf,SAAA;AAAM,aAAA;YACL,YAAY,CAAC,UAAU,CAAC,CAAA;AACxB,YAAA,UAAU,GAAG,UAAU,CAAC,MAAK;gBAC3B,QAAQ,GAAG,GAAG,CAAA;AACd,gBAAA,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;aACxB,EAAE,SAAS,CAAC,CAAA;AACd,SAAA;AACH,KAAC,CAAA;AACH,CAAC;AAEK,SAAU,QAAQ,CAAE,EAAE,EAAE,EAAE,GAAG,GAAG,EAAE,KAAM,EAAA;AAC5C,IAAA,IAAI,KAAoC,CAAA;IAExC,OAAO,UAAU,GAAG,IAAI,EAAA;AACtB,QAAA,MAAM,OAAO,GAAG,KAAK,IAAI,IAAI,CAAA;QAC7B,YAAY,CAAC,KAAK,CAAC,CAAA;QACnB,KAAK,GAAG,UAAU,CAAC,YAAA;AACjB,YAAA,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;SACxB,EAAE,EAAE,CAAC,CAAA;AACR,KAAC,CAAA;AACH;;;;"}
@@ -0,0 +1,4 @@
1
+ declare function vueRenderFunc(componentName: string, options?: Record<string, any>, children?: any): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
2
+ [key: string]: any;
3
+ }>;
4
+ export { vueRenderFunc as default };
@@ -1,4 +1,4 @@
1
- import { __rest } from '../../../node_modules/.pnpm/registry.npmjs.org_tslib@2.5.0/node_modules/tslib/tslib.es6.js';
1
+ import { __rest } from '../node_modules/.pnpm/registry.npmjs.org_tslib@2.5.0/node_modules/tslib/tslib.es6.js';
2
2
  import { h } from 'vue';
3
3
 
4
4
  function render (componentName, options, children) {
@@ -15,4 +15,4 @@ function render (componentName, options, children) {
15
15
  }
16
16
 
17
17
  export { render as default };
18
- //# sourceMappingURL=render.js.map
18
+ //# sourceMappingURL=vue-render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vue-render.js","sources":["../../src/utils/vue-render.ts"],"sourcesContent":["import { h } from 'vue'\n\nexport default function (componentName: string, options?: Record<string, any>, children?: any) {\n const { attrs = {}, on = {}, props = {}, slots = {}, ...el } = options\n if (process.env.FRAMEWORK === 'vue3') {\n // Events\n Object.keys(on).forEach(key => {\n const name = `on${key.charAt(0).toUpperCase()}${key.slice(1)}`\n el[name] = on[key]\n })\n return h(componentName, { ...attrs, ...props, ...slots, ... el }, children)\n }\n return h(componentName, options, children)\n}\n"],"names":[],"mappings":";;;AAEc,eAAA,EAAW,aAAqB,EAAE,OAA6B,EAAE,QAAc,EAAA;IAC3F,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAA,GAAY,OAAO,EAAd,EAAE,GAAA,MAAA,CAAK,OAAO,EAAhE,CAAsD,OAAA,EAAA,IAAA,EAAA,OAAA,EAAA,OAAA,CAAA,CAAU,CAAA;AACtE,IAAA,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,MAAM,EAAE;;QAEpC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,IAAG;YAC5B,MAAM,IAAI,GAAG,CAAK,EAAA,EAAA,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA,EAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;YAC9D,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AACpB,SAAC,CAAC,CAAA;AACF,QAAA,OAAO,CAAC,CAAC,aAAa,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAO,KAAK,CAAK,EAAA,KAAK,CAAK,EAAA,KAAK,CAAM,EAAA,EAAE,CAAI,EAAA,QAAQ,CAAC,CAAA;AAC5E,KAAA;IACD,OAAO,CAAC,CAAC,aAAa,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;AAC5C;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/components-advanced",
3
- "version": "3.6.9",
3
+ "version": "3.6.10-alpha.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,12 +16,14 @@
16
16
  "author": "ZakaryCode",
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
+ "classnames": "^2.2.5",
20
+ "csstype": "^3.1.1",
19
21
  "memoize-one": "^6.0.0",
20
22
  "postcss": "^8.4.18",
21
- "@tarojs/components": "3.6.9",
22
- "@tarojs/shared": "3.6.9",
23
- "@tarojs/runtime": "3.6.9",
24
- "@tarojs/taro": "3.6.9"
23
+ "@tarojs/components": "3.6.10-alpha.2",
24
+ "@tarojs/runtime": "3.6.10-alpha.2",
25
+ "@tarojs/shared": "3.6.10-alpha.2",
26
+ "@tarojs/taro": "3.6.10-alpha.2"
25
27
  },
26
28
  "devDependencies": {
27
29
  "@babel/cli": "^7.14.5",
@@ -38,7 +40,7 @@
38
40
  "rollup-plugin-ts": "^3.0.2",
39
41
  "typescript": "^4.7.4",
40
42
  "vue": "^3.0.0",
41
- "babel-preset-taro": "3.6.9"
43
+ "babel-preset-taro": "3.6.10-alpha.2"
42
44
  },
43
45
  "peerDependencies": {
44
46
  "react": ">=17"
@@ -1,4 +0,0 @@
1
- declare function renderFunc(componentName: string, options?: Record<string, any>, children?: any): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
2
- [key: string]: any;
3
- }>;
4
- export { renderFunc as default };
@@ -1 +0,0 @@
1
- {"version":3,"file":"render.js","sources":["../../../../src/components/virtual-list/vue/render.ts"],"sourcesContent":["import { h } from 'vue'\n\nexport default function (componentName: string, options?: Record<string, any>, children?: any) {\n const { attrs = {}, on = {}, props = {}, slots = {}, ...el } = options\n if (process.env.FRAMEWORK === 'vue3') {\n // Events\n Object.keys(on).forEach(key => {\n const name = `on${key.charAt(0).toUpperCase()}${key.slice(1)}`\n el[name] = on[key]\n })\n return h(componentName, { ...attrs, ...props, ...slots, ... el }, children)\n }\n return h(componentName, options, children)\n}\n"],"names":[],"mappings":";;;AAEc,eAAA,EAAW,aAAqB,EAAE,OAA6B,EAAE,QAAc,EAAA;IAC3F,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAA,GAAY,OAAO,EAAd,EAAE,GAAA,MAAA,CAAK,OAAO,EAAhE,CAAsD,OAAA,EAAA,IAAA,EAAA,OAAA,EAAA,OAAA,CAAA,CAAU,CAAA;AACtE,IAAA,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,MAAM,EAAE;;QAEpC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,IAAG;YAC5B,MAAM,IAAI,GAAG,CAAK,EAAA,EAAA,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA,EAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;YAC9D,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AACpB,SAAC,CAAC,CAAA;AACF,QAAA,OAAO,CAAC,CAAC,aAAa,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAO,KAAK,CAAK,EAAA,KAAK,CAAK,EAAA,KAAK,CAAM,EAAA,EAAE,CAAI,EAAA,QAAQ,CAAC,CAAA;AAC5E,KAAA;IACD,OAAO,CAAC,CAAC,aAAa,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;AAC5C;;;;"}