zs_library 0.4.25 → 0.5.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/dist/components/desktop/context/config/context.d.ts +3 -2
- package/dist/components/desktop/items/group-item.d.ts +1 -1
- package/dist/components/desktop/sortable.d.ts +4 -0
- package/dist/components/desktop/utils.d.ts +0 -27
- package/dist/components/index.d.ts +6 -0
- package/dist/components/map-view/calculateVisibleAreas.d.ts +17 -0
- package/dist/components/map-view/index.d.ts +42 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3000 -1820
- package/package.json +150 -146
|
@@ -6,7 +6,7 @@ import { SortItem } from '../../types';
|
|
|
6
6
|
* 需要跨多个组件传递的配置,使用 context 传递
|
|
7
7
|
*/
|
|
8
8
|
export interface SortableConfig<D, C> {
|
|
9
|
-
theme
|
|
9
|
+
theme: Theme;
|
|
10
10
|
/**
|
|
11
11
|
* 是否不显示名称
|
|
12
12
|
*/
|
|
@@ -18,7 +18,8 @@ export interface SortableConfig<D, C> {
|
|
|
18
18
|
/**
|
|
19
19
|
* 自定义分页点容器
|
|
20
20
|
*/
|
|
21
|
-
pagingDotsBuilder?: (dots: React.ReactNode) => React.JSX.Element;
|
|
21
|
+
pagingDotsBuilder?: (dots: React.ReactNode) => React.JSX.Element;
|
|
22
|
+
/**
|
|
22
23
|
* 自定义分页点
|
|
23
24
|
* @param item 分页项数据
|
|
24
25
|
* @param index 分页项索引
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SortItem } from '../types';
|
|
2
2
|
import { SortableItemProps } from './sortable-item';
|
|
3
|
-
interface SortableGroupItemProps<D, C> extends SortableItemProps<D, C> {
|
|
3
|
+
export interface SortableGroupItemProps<D, C> extends SortableItemProps<D, C> {
|
|
4
4
|
data: SortItem<D, C>;
|
|
5
5
|
}
|
|
6
6
|
declare const SortableGroupItem: <D, C>(props: SortableGroupItemProps<D, C>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -26,6 +26,10 @@ export interface SortableProps<D, C> {
|
|
|
26
26
|
* 点击 item 事件
|
|
27
27
|
*/
|
|
28
28
|
onItemClick?: (item: SortItem<D, C>) => void;
|
|
29
|
+
/**
|
|
30
|
+
* 自定义额外项目,将显示在子项列表末尾
|
|
31
|
+
*/
|
|
32
|
+
extraItems?: (listItem: SortItem<D, C>) => React.ReactNode;
|
|
29
33
|
}
|
|
30
34
|
declare const Sortable: <D, C>(props: SortableProps<D, C>) => import("react/jsx-runtime").JSX.Element;
|
|
31
35
|
export default Sortable;
|
|
@@ -1,34 +1,7 @@
|
|
|
1
|
-
import { Theme } from './theme';
|
|
2
1
|
import { SortItem } from './types';
|
|
3
2
|
declare class SortableUtils {
|
|
4
3
|
/** 清理重复id */
|
|
5
4
|
static uniqueArray: (array: SortItem[]) => SortItem<any, any>[];
|
|
6
|
-
static getTheme: (theme?: Theme) => {
|
|
7
|
-
light: {
|
|
8
|
-
itemNameColor?: string;
|
|
9
|
-
itemIconBackgroundColor?: string;
|
|
10
|
-
itemIconShadowColor?: string;
|
|
11
|
-
groupItemIconBackgroundColor?: string;
|
|
12
|
-
groupItemIconShadowColor?: string;
|
|
13
|
-
groupItemModalBackgroundColor?: string;
|
|
14
|
-
contextMenuTextColor?: string;
|
|
15
|
-
contextMenuActiveColor?: string;
|
|
16
|
-
contextMenuBackgroundColor?: string;
|
|
17
|
-
contextMenuShadowColor?: string;
|
|
18
|
-
};
|
|
19
|
-
dark: {
|
|
20
|
-
itemNameColor?: string;
|
|
21
|
-
itemIconBackgroundColor?: string;
|
|
22
|
-
itemIconShadowColor?: string;
|
|
23
|
-
groupItemIconBackgroundColor?: string;
|
|
24
|
-
groupItemIconShadowColor?: string;
|
|
25
|
-
groupItemModalBackgroundColor?: string;
|
|
26
|
-
contextMenuTextColor?: string;
|
|
27
|
-
contextMenuActiveColor?: string;
|
|
28
|
-
contextMenuBackgroundColor?: string;
|
|
29
|
-
contextMenuShadowColor?: string;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
5
|
static quickJSONCheck: (str: any) => boolean;
|
|
33
6
|
}
|
|
34
7
|
export default SortableUtils;
|
|
@@ -2,6 +2,10 @@ export { default as Desktop } from './desktop';
|
|
|
2
2
|
export type { DesktopHandle, DesktopProps } from './desktop';
|
|
3
3
|
export { default as DesktopSortable } from './desktop/sortable';
|
|
4
4
|
export type { SortableProps as DesktopSortableProps } from './desktop/sortable';
|
|
5
|
+
export { default as DesktopGroupItem } from './desktop/items/group-item';
|
|
6
|
+
export type { SortableGroupItemProps as DesktopGroupItemProps } from './desktop/items/group-item';
|
|
7
|
+
export { default as DesktopAppItem } from './desktop/items/sortable-item';
|
|
8
|
+
export type { SortableItemProps as DesktopAppItemProps } from './desktop/items/sortable-item';
|
|
5
9
|
export { SortableConfigProvider as DesktopSortableConfigProvider } from './desktop/context/config/context';
|
|
6
10
|
export type { SortableConfigProviderProps as DesktopSortableConfigProviderProps } from './desktop/context/config/context';
|
|
7
11
|
export { SortableStateProvider as DesktopSortableStateProvider } from './desktop/context/state/context';
|
|
@@ -20,3 +24,5 @@ export { useMotionValue as useDockDesktopMouseX } from 'framer-motion';
|
|
|
20
24
|
export type { DesktopIconContainerProps as DockDesktopItemProps } from './dock/dock-desktop';
|
|
21
25
|
export type { MobileIconContainerProps as DockMobileItemProps } from './dock/dock-mobile';
|
|
22
26
|
export { default as Editor } from './editor';
|
|
27
|
+
export { default as GeoMap } from './map-view';
|
|
28
|
+
export type { GeoMapProps } from './map-view';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MapRef } from 'react-map-gl/maplibre';
|
|
2
|
+
import { FeatureCollection } from 'geojson';
|
|
3
|
+
/**
|
|
4
|
+
* 计算当前视图范围内的省份
|
|
5
|
+
* 即使省份只有一小部分在可视范围内也会被计入
|
|
6
|
+
*/
|
|
7
|
+
export declare const calculateVisibleAreas: (mapRef: MapRef | null, geoData: FeatureCollection | null, areaCenters: Array<{
|
|
8
|
+
name: string;
|
|
9
|
+
longitude: number;
|
|
10
|
+
latitude: number;
|
|
11
|
+
code: string;
|
|
12
|
+
}>) => Array<{
|
|
13
|
+
name: string;
|
|
14
|
+
longitude: number;
|
|
15
|
+
latitude: number;
|
|
16
|
+
code: string;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FeatureCollection } from 'geojson';
|
|
3
|
+
export interface GeoMapProps {
|
|
4
|
+
/** 初始缩放级别 */
|
|
5
|
+
initialZoom?: number;
|
|
6
|
+
/** 初始中心点经度 */
|
|
7
|
+
initialLongitude?: number;
|
|
8
|
+
/** 初始中心点纬度 */
|
|
9
|
+
initialLatitude?: number;
|
|
10
|
+
/** 自定义样式 */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** 区域ID长度与缩放级别的映射关系 */
|
|
13
|
+
zoomLevels?: {
|
|
14
|
+
[key: number]: number;
|
|
15
|
+
};
|
|
16
|
+
/** 地图样式 URL */
|
|
17
|
+
mapStyle?: string;
|
|
18
|
+
/** 地图容器样式 */
|
|
19
|
+
style?: React.CSSProperties;
|
|
20
|
+
/** 视图范围内省份变化时的回调函数 */
|
|
21
|
+
onVisibleAreasChanged?: (visibleAreas: Array<{
|
|
22
|
+
name: string;
|
|
23
|
+
longitude: number;
|
|
24
|
+
latitude: number;
|
|
25
|
+
code: string;
|
|
26
|
+
}>) => void;
|
|
27
|
+
/** 显示区级数据的最小缩放级别 */
|
|
28
|
+
districtMinZoom?: number;
|
|
29
|
+
/** 显示市级数据的最小缩放级别 */
|
|
30
|
+
cityMinZoom?: number;
|
|
31
|
+
/** 自定义请求地理数据的方法 */
|
|
32
|
+
fetchGeoData?: (areaId: string) => Promise<FeatureCollection>;
|
|
33
|
+
/** 其他子组件 */
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* GeoMap 组件 - 基于react-map-gl和maplibre-gl的地理数据可视化组件
|
|
38
|
+
*
|
|
39
|
+
* 根据缩放级别自动加载和卸载不同级别的地理数据
|
|
40
|
+
*/
|
|
41
|
+
declare const GeoMap: React.FC<GeoMapProps>;
|
|
42
|
+
export default GeoMap;
|