antd-mobile 5.11.0 → 5.11.1

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 (37) hide show
  1. package/2x/cjs/components/cascade-picker/cascade-picker-utils.d.ts +2 -2
  2. package/2x/cjs/components/cascade-picker/cascade-picker-utils.js +37 -16
  3. package/2x/cjs/components/cascade-picker/cascade-picker.js +2 -7
  4. package/2x/cjs/components/cascade-picker-view/cascade-picker-view.js +2 -7
  5. package/2x/cjs/components/swiper/index.d.ts +16 -1
  6. package/2x/cjs/components/swiper/swiper.d.ts +16 -1
  7. package/2x/es/components/cascade-picker/cascade-picker-utils.d.ts +2 -2
  8. package/2x/es/components/cascade-picker/cascade-picker-utils.js +35 -15
  9. package/2x/es/components/cascade-picker/cascade-picker.js +3 -7
  10. package/2x/es/components/cascade-picker-view/cascade-picker-view.js +3 -7
  11. package/2x/es/components/swiper/index.d.ts +16 -1
  12. package/2x/es/components/swiper/swiper.d.ts +16 -1
  13. package/2x/package.json +1 -1
  14. package/bundle/antd-mobile.cjs.js +34 -47
  15. package/bundle/antd-mobile.es.js +34 -47
  16. package/cjs/components/cascade-picker/cascade-picker-utils.d.ts +2 -2
  17. package/cjs/components/cascade-picker/cascade-picker-utils.js +37 -16
  18. package/cjs/components/cascade-picker/cascade-picker.js +2 -7
  19. package/cjs/components/cascade-picker-view/cascade-picker-view.js +2 -7
  20. package/cjs/components/swiper/index.d.ts +16 -1
  21. package/cjs/components/swiper/swiper.d.ts +16 -1
  22. package/es/components/cascade-picker/cascade-picker-utils.d.ts +2 -2
  23. package/es/components/cascade-picker/cascade-picker-utils.js +35 -15
  24. package/es/components/cascade-picker/cascade-picker.js +3 -7
  25. package/es/components/cascade-picker-view/cascade-picker-view.js +3 -7
  26. package/es/components/swiper/index.d.ts +16 -1
  27. package/es/components/swiper/swiper.d.ts +16 -1
  28. package/package.json +1 -1
  29. package/umd/antd-mobile.js +1 -1
  30. package/2x/cjs/components/cascade-picker/use-cascade-picker-options.d.ts +0 -5
  31. package/2x/cjs/components/cascade-picker/use-cascade-picker-options.js +0 -40
  32. package/2x/es/components/cascade-picker/use-cascade-picker-options.d.ts +0 -5
  33. package/2x/es/components/cascade-picker/use-cascade-picker-options.js +0 -32
  34. package/cjs/components/cascade-picker/use-cascade-picker-options.d.ts +0 -5
  35. package/cjs/components/cascade-picker/use-cascade-picker-options.js +0 -40
  36. package/es/components/cascade-picker/use-cascade-picker-options.d.ts +0 -5
  37. package/es/components/cascade-picker/use-cascade-picker-options.js +0 -32
@@ -1,5 +0,0 @@
1
- import { CascadePickerOption } from './cascade-picker';
2
- export declare function useCascadePickerOptions(options: CascadePickerOption[]): {
3
- depth: number;
4
- subOptionsRecord: Record<string, CascadePickerOption[]>;
5
- };
@@ -1,40 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useCascadePickerOptions = useCascadePickerOptions;
7
-
8
- var _react = require("react");
9
-
10
- function useCascadePickerOptions(options) {
11
- return (0, _react.useMemo)(() => {
12
- let depth = 1;
13
- const subOptionsRecord = {};
14
-
15
- function traverse(option, currentDepth) {
16
- if (!option.children) {
17
- return;
18
- }
19
-
20
- subOptionsRecord[option.value] = option.children;
21
- const nextDepth = currentDepth + 1;
22
-
23
- if (nextDepth > depth) {
24
- depth = nextDepth;
25
- }
26
-
27
- option.children.forEach(option => {
28
- traverse(option, nextDepth);
29
- });
30
- }
31
-
32
- options.forEach(option => {
33
- traverse(option, 1);
34
- });
35
- return {
36
- depth,
37
- subOptionsRecord
38
- };
39
- }, [options]);
40
- }
@@ -1,5 +0,0 @@
1
- import { CascadePickerOption } from './cascade-picker';
2
- export declare function useCascadePickerOptions(options: CascadePickerOption[]): {
3
- depth: number;
4
- subOptionsRecord: Record<string, CascadePickerOption[]>;
5
- };
@@ -1,32 +0,0 @@
1
- import { useMemo } from 'react';
2
- export function useCascadePickerOptions(options) {
3
- return useMemo(() => {
4
- let depth = 1;
5
- const subOptionsRecord = {};
6
-
7
- function traverse(option, currentDepth) {
8
- if (!option.children) {
9
- return;
10
- }
11
-
12
- subOptionsRecord[option.value] = option.children;
13
- const nextDepth = currentDepth + 1;
14
-
15
- if (nextDepth > depth) {
16
- depth = nextDepth;
17
- }
18
-
19
- option.children.forEach(option => {
20
- traverse(option, nextDepth);
21
- });
22
- }
23
-
24
- options.forEach(option => {
25
- traverse(option, 1);
26
- });
27
- return {
28
- depth,
29
- subOptionsRecord
30
- };
31
- }, [options]);
32
- }
@@ -1,5 +0,0 @@
1
- import { CascadePickerOption } from './cascade-picker';
2
- export declare function useCascadePickerOptions(options: CascadePickerOption[]): {
3
- depth: number;
4
- subOptionsRecord: Record<string, CascadePickerOption[]>;
5
- };
@@ -1,40 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useCascadePickerOptions = useCascadePickerOptions;
7
-
8
- var _react = require("react");
9
-
10
- function useCascadePickerOptions(options) {
11
- return (0, _react.useMemo)(() => {
12
- let depth = 1;
13
- const subOptionsRecord = {};
14
-
15
- function traverse(option, currentDepth) {
16
- if (!option.children) {
17
- return;
18
- }
19
-
20
- subOptionsRecord[option.value] = option.children;
21
- const nextDepth = currentDepth + 1;
22
-
23
- if (nextDepth > depth) {
24
- depth = nextDepth;
25
- }
26
-
27
- option.children.forEach(option => {
28
- traverse(option, nextDepth);
29
- });
30
- }
31
-
32
- options.forEach(option => {
33
- traverse(option, 1);
34
- });
35
- return {
36
- depth,
37
- subOptionsRecord
38
- };
39
- }, [options]);
40
- }
@@ -1,5 +0,0 @@
1
- import { CascadePickerOption } from './cascade-picker';
2
- export declare function useCascadePickerOptions(options: CascadePickerOption[]): {
3
- depth: number;
4
- subOptionsRecord: Record<string, CascadePickerOption[]>;
5
- };
@@ -1,32 +0,0 @@
1
- import { useMemo } from 'react';
2
- export function useCascadePickerOptions(options) {
3
- return useMemo(() => {
4
- let depth = 1;
5
- const subOptionsRecord = {};
6
-
7
- function traverse(option, currentDepth) {
8
- if (!option.children) {
9
- return;
10
- }
11
-
12
- subOptionsRecord[option.value] = option.children;
13
- const nextDepth = currentDepth + 1;
14
-
15
- if (nextDepth > depth) {
16
- depth = nextDepth;
17
- }
18
-
19
- option.children.forEach(option => {
20
- traverse(option, nextDepth);
21
- });
22
- }
23
-
24
- options.forEach(option => {
25
- traverse(option, 1);
26
- });
27
- return {
28
- depth,
29
- subOptionsRecord
30
- };
31
- }, [options]);
32
- }