diff --git a/packages/li-analysis-assets/src/widgets/AdministrativeSelectControl/constant.ts b/packages/li-analysis-assets/src/widgets/AdministrativeSelectControl/constant.ts deleted file mode 100644 index adbd1d00..00000000 --- a/packages/li-analysis-assets/src/widgets/AdministrativeSelectControl/constant.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { TooltipPlacement } from 'antd/es/tooltip'; - -export const CLS_PREFIX = 'li-administrative-select'; - -// 城市列表 -export const CityUrl = 'https://npm.elemecdn.com/static-geo-atlas@latest/geo-data/administrative-data/area-tree.json'; - -// 边界数据 -export const BoundsUrl = 'https://unpkg.com/static-geo-atlas@latest/geo-data/choropleth-data/'; - -export const POPOVER_PLACEMENT_LEGEND = new Map([ - ['topleft', 'bottomLeft'], - ['lefttop', 'bottomLeft'], - ['topright', 'bottomRight'], - ['righttop', 'bottomRight'], - ['bottomleft', 'topLeft'], - ['leftbottom', 'topLeft'], - ['bottomright', 'topRight'], - ['rightbottom', 'topRight'], - [undefined, 'rightTop'], -]); - -export const HotCityList = [ - { adcode: '100000', name: '全国', level: 'country' }, - { adcode: '110000', name: '北京', level: 'province' }, - { adcode: '120000', name: '天津', level: 'province' }, - { adcode: '210100', name: '沈阳', level: 'city' }, - { adcode: '210200', name: '大连', level: 'city' }, - { adcode: '310000', name: '上海', level: 'province' }, - { adcode: '320100', name: '南京', level: 'city' }, - { adcode: '320500', name: '苏州', level: 'city' }, - { adcode: '330100', name: '杭州', level: 'city' }, - { adcode: '370200', name: '青岛', level: 'city' }, - { adcode: '410100', name: '郑州', level: 'city' }, - { adcode: '420100', name: '武汉', level: 'city' }, - { adcode: '430100', name: '长沙', level: 'city' }, - { adcode: '440100', name: '广州', level: 'city' }, - { adcode: '440300', name: '深圳', level: 'city' }, - { adcode: '500000', name: '重庆', level: 'province' }, - { adcode: '510100', name: '成都', level: 'city' }, - { adcode: '610100', name: '西安', level: 'city' }, - { adcode: '810000', name: '香港', level: 'province' }, - { adcode: '820000', name: '澳门', level: 'province' }, -]; diff --git a/packages/li-analysis-assets/src/widgets/AdministrativeSelectControl/constant.tsx b/packages/li-analysis-assets/src/widgets/AdministrativeSelectControl/constant.tsx new file mode 100644 index 00000000..627e14c3 --- /dev/null +++ b/packages/li-analysis-assets/src/widgets/AdministrativeSelectControl/constant.tsx @@ -0,0 +1,62 @@ +import type { TooltipPlacement } from 'antd/es/tooltip'; +import React from 'react'; + +export const CLS_PREFIX = 'li-administrative-select'; + +// 城市列表 +export const CityUrl = 'https://npm.elemecdn.com/static-geo-atlas@latest/geo-data/administrative-data/area-tree.json'; + +// 边界数据 +export const BoundsUrl = 'https://unpkg.com/static-geo-atlas@latest/geo-data/choropleth-data/'; + +export const POPOVER_PLACEMENT_LEGEND = new Map([ + ['topleft', 'bottomLeft'], + ['lefttop', 'bottomLeft'], + ['topright', 'bottomRight'], + ['righttop', 'bottomRight'], + ['bottomleft', 'topLeft'], + ['leftbottom', 'topLeft'], + ['bottomright', 'topRight'], + ['rightbottom', 'topRight'], + [undefined, 'rightTop'], +]); + +export const HotCityList = [ + { adcode: '100000', name: '全国', level: 'country' }, + { adcode: '110000', name: '北京', level: 'province' }, + { adcode: '120000', name: '天津', level: 'province' }, + { adcode: '210100', name: '沈阳', level: 'city' }, + { adcode: '210200', name: '大连', level: 'city' }, + { adcode: '310000', name: '上海', level: 'province' }, + { adcode: '320100', name: '南京', level: 'city' }, + { adcode: '320500', name: '苏州', level: 'city' }, + { adcode: '330100', name: '杭州', level: 'city' }, + { adcode: '370200', name: '青岛', level: 'city' }, + { adcode: '410100', name: '郑州', level: 'city' }, + { adcode: '420100', name: '武汉', level: 'city' }, + { adcode: '430100', name: '长沙', level: 'city' }, + { adcode: '440100', name: '广州', level: 'city' }, + { adcode: '440300', name: '深圳', level: 'city' }, + { adcode: '500000', name: '重庆', level: 'province' }, + { adcode: '510100', name: '成都', level: 'city' }, + { adcode: '610100', name: '西安', level: 'city' }, + { adcode: '810000', name: '香港', level: 'province' }, + { adcode: '820000', name: '澳门', level: 'province' }, +]; + +export const ICON = () => { + return ( + + + + + ); +}; diff --git a/packages/li-analysis-assets/src/widgets/AdministrativeSelectControl/index.ts b/packages/li-analysis-assets/src/widgets/AdministrativeSelectControl/index.ts index fffcf53c..e2e2ad0e 100644 --- a/packages/li-analysis-assets/src/widgets/AdministrativeSelectControl/index.ts +++ b/packages/li-analysis-assets/src/widgets/AdministrativeSelectControl/index.ts @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component/index'; import registerForm from './registerForm'; +import { ICON } from './constant'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '选择行政名地图切换到行政区域', type: 'Auto', category: 'MapControl', + icon: ICON, }, defaultProperties: { position: 'lefttop', diff --git a/packages/li-analysis-assets/src/widgets/AnalysisLayout/Component/constant.ts b/packages/li-analysis-assets/src/widgets/AnalysisLayout/Component/constant.ts deleted file mode 100644 index 7bd9f43f..00000000 --- a/packages/li-analysis-assets/src/widgets/AnalysisLayout/Component/constant.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** 组件名称, 前缀 */ -export const CLS_PREFIX = 'li-analysis-layout'; diff --git a/packages/li-analysis-assets/src/widgets/AnalysisLayout/Component/constants.tsx b/packages/li-analysis-assets/src/widgets/AnalysisLayout/Component/constants.tsx new file mode 100644 index 00000000..48d10699 --- /dev/null +++ b/packages/li-analysis-assets/src/widgets/AnalysisLayout/Component/constants.tsx @@ -0,0 +1,15 @@ +import React from 'react'; +/** 组件名称, 前缀 */ +export const CLS_PREFIX = 'li-analysis-layout'; + +export const ICON = () => { + return ( + + + + ); +}; diff --git a/packages/li-analysis-assets/src/widgets/AnalysisLayout/Component/index.tsx b/packages/li-analysis-assets/src/widgets/AnalysisLayout/Component/index.tsx index a55976f4..b42cc05d 100644 --- a/packages/li-analysis-assets/src/widgets/AnalysisLayout/Component/index.tsx +++ b/packages/li-analysis-assets/src/widgets/AnalysisLayout/Component/index.tsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import React, { useEffect, useMemo, useState } from 'react'; import FloatPanel from '../FloatPanel'; import type { Properties } from '../registerForm'; -import { CLS_PREFIX } from './constant'; +import { CLS_PREFIX } from './constants'; import useStyle from './style'; export interface AnalysisLayoutProps diff --git a/packages/li-analysis-assets/src/widgets/AnalysisLayout/index.tsx b/packages/li-analysis-assets/src/widgets/AnalysisLayout/index.tsx index 6cb9836c..e4495f25 100644 --- a/packages/li-analysis-assets/src/widgets/AnalysisLayout/index.tsx +++ b/packages/li-analysis-assets/src/widgets/AnalysisLayout/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './Component/constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '用于分析场景的布局,带有侧边栏、底部栏、折叠面板', type: 'Layout', category: 'Layout', + icon: ICON, }, defaultProperties: { showSidePanel: false, diff --git a/packages/li-analysis-assets/src/widgets/DrawControl/index.tsx b/packages/li-analysis-assets/src/widgets/DrawControl/index.tsx index 1c230fef..32094b41 100644 --- a/packages/li-analysis-assets/src/widgets/DrawControl/index.tsx +++ b/packages/li-analysis-assets/src/widgets/DrawControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component/index'; import registerForm from './registerForm'; +import { DrawIcon } from './Component/contants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '地图上绘制点、线、面、圆数据', type: 'Auto', category: 'MapControl', + icon: DrawIcon, }, defaultProperties: { position: 'topright', diff --git a/packages/li-analysis-assets/src/widgets/FilterControl/constants.tsx b/packages/li-analysis-assets/src/widgets/FilterControl/constants.tsx new file mode 100644 index 00000000..c06bdd07 --- /dev/null +++ b/packages/li-analysis-assets/src/widgets/FilterControl/constants.tsx @@ -0,0 +1,9 @@ +import React from 'react'; + +export const ICON = () => { + return ( + + + + ); +}; diff --git a/packages/li-analysis-assets/src/widgets/FilterControl/index.tsx b/packages/li-analysis-assets/src/widgets/FilterControl/index.tsx index d0a9b056..43e9d18a 100644 --- a/packages/li-analysis-assets/src/widgets/FilterControl/index.tsx +++ b/packages/li-analysis-assets/src/widgets/FilterControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '在地图上的实时筛选数据,支持默认值设置', type: 'Auto', category: 'DataAnalysis', + icon: ICON, }, defaultProperties: { defaultFilters: [], diff --git a/packages/li-analysis-assets/src/widgets/FilterWidget/constants.tsx b/packages/li-analysis-assets/src/widgets/FilterWidget/constants.tsx new file mode 100644 index 00000000..65e17612 --- /dev/null +++ b/packages/li-analysis-assets/src/widgets/FilterWidget/constants.tsx @@ -0,0 +1,12 @@ +import React from 'react'; + +export const ICON = () => { + return ( + + + + ); +}; diff --git a/packages/li-analysis-assets/src/widgets/FilterWidget/index.tsx b/packages/li-analysis-assets/src/widgets/FilterWidget/index.tsx index cf851271..f10bd4cf 100644 --- a/packages/li-analysis-assets/src/widgets/FilterWidget/index.tsx +++ b/packages/li-analysis-assets/src/widgets/FilterWidget/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component/index'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '用于动态添加筛选条件来过滤数据', type: 'Atom', category: 'DataAnalysis', + icon: ICON, }, defaultProperties: { showAddFilter: false, diff --git a/packages/li-analysis-assets/src/widgets/LegendWidget/index.tsx b/packages/li-analysis-assets/src/widgets/LegendWidget/index.tsx index 45346030..714db8f2 100644 --- a/packages/li-analysis-assets/src/widgets/LegendWidget/index.tsx +++ b/packages/li-analysis-assets/src/widgets/LegendWidget/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { LegendWidgetSvg } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '显示地图上图层的图例信息', type: 'Auto', category: 'MapControl', + icon: LegendWidgetSvg, }, defaultProperties: { position: 'bottomright', diff --git a/packages/li-analysis-assets/src/widgets/LocationSearchControl/constants.ts b/packages/li-analysis-assets/src/widgets/LocationSearchControl/constants.ts deleted file mode 100644 index 15bce71f..00000000 --- a/packages/li-analysis-assets/src/widgets/LocationSearchControl/constants.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** 组件名称, 前缀 */ -export const CLS_PREFIX = 'li-analysis-location-search-control'; diff --git a/packages/li-analysis-assets/src/widgets/LocationSearchControl/constants.tsx b/packages/li-analysis-assets/src/widgets/LocationSearchControl/constants.tsx new file mode 100644 index 00000000..98b99b2c --- /dev/null +++ b/packages/li-analysis-assets/src/widgets/LocationSearchControl/constants.tsx @@ -0,0 +1,26 @@ +import React from 'react'; +/** 组件名称, 前缀 */ +export const CLS_PREFIX = 'li-analysis-location-search-control'; + +export const ICON = () => { + return ( + + + + + + + ); +}; diff --git a/packages/li-analysis-assets/src/widgets/LocationSearchControl/index.tsx b/packages/li-analysis-assets/src/widgets/LocationSearchControl/index.tsx index 9548485a..6738cd22 100644 --- a/packages/li-analysis-assets/src/widgets/LocationSearchControl/index.tsx +++ b/packages/li-analysis-assets/src/widgets/LocationSearchControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: 'POI 查询地理位置', type: 'Auto', category: 'MapControl', + icon: ICON, }, defaultProperties: { position: 'lefttop', diff --git a/packages/li-analysis-assets/src/widgets/MeasureControl/index.tsx b/packages/li-analysis-assets/src/widgets/MeasureControl/index.tsx index 79fc4b5e..2f7b3687 100644 --- a/packages/li-analysis-assets/src/widgets/MeasureControl/index.tsx +++ b/packages/li-analysis-assets/src/widgets/MeasureControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { DrawSvg } from './Component/constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '地图上测量距离与面积', type: 'Auto', category: 'MapControl', + icon: DrawSvg, }, defaultProperties: { position: 'topright', diff --git a/packages/li-analysis-assets/src/widgets/MiniChart/Component/Chart/index.tsx b/packages/li-analysis-assets/src/widgets/MiniChart/Component/Chart/index.tsx index e1bba0d0..7840b54d 100644 --- a/packages/li-analysis-assets/src/widgets/MiniChart/Component/Chart/index.tsx +++ b/packages/li-analysis-assets/src/widgets/MiniChart/Component/Chart/index.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import React from 'react'; -import { CLS_PREFIX } from '../../constant'; +import { CLS_PREFIX } from '../../constants'; import IntervalLine from './IntervalLine'; import Pie from './Pie'; import useStyle from './style'; diff --git a/packages/li-analysis-assets/src/widgets/MiniChart/Component/helper.ts b/packages/li-analysis-assets/src/widgets/MiniChart/Component/helper.ts index 1a050b00..2aa88f7b 100644 --- a/packages/li-analysis-assets/src/widgets/MiniChart/Component/helper.ts +++ b/packages/li-analysis-assets/src/widgets/MiniChart/Component/helper.ts @@ -1,6 +1,6 @@ import type { DatasetField, LocalOrRemoteDataset } from '@antv/li-sdk'; import { isNumber, isString } from 'lodash-es'; -import type { AggregationMethodType } from '../constant'; +import type { AggregationMethodType } from '../constants'; const sortItem = ({ start, diff --git a/packages/li-analysis-assets/src/widgets/MiniChart/constant.ts b/packages/li-analysis-assets/src/widgets/MiniChart/constant.ts deleted file mode 100644 index 0c9f188d..00000000 --- a/packages/li-analysis-assets/src/widgets/MiniChart/constant.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** 组件名称, 前缀 */ -export const CLS_PREFIX = 'li-analysis-mini-chart'; - -export const ChartTypeList = [ - { value: 'line', label: '折线图' }, - { value: 'column', label: '柱状图' }, - { value: 'pie', label: '饼图' }, -]; - -export type AggregationMethodType = 'sum' | 'avel' | 'max' | 'min' | 'count'; - -export const AggregationMethod = [ - { value: 'count', label: '计数' }, - { value: 'sum', label: '求和' }, - { value: 'avel', label: '平均值' }, - { value: 'max', label: '最大值' }, - { value: 'min', label: '最小值' }, -]; diff --git a/packages/li-analysis-assets/src/widgets/MiniChart/constants.tsx b/packages/li-analysis-assets/src/widgets/MiniChart/constants.tsx new file mode 100644 index 00000000..ebdd038d --- /dev/null +++ b/packages/li-analysis-assets/src/widgets/MiniChart/constants.tsx @@ -0,0 +1,34 @@ +import React from 'react'; +/** 组件名称, 前缀 */ +export const CLS_PREFIX = 'li-analysis-mini-chart'; + +export const ChartTypeList = [ + { value: 'line', label: '折线图' }, + { value: 'column', label: '柱状图' }, + { value: 'pie', label: '饼图' }, +]; + +export type AggregationMethodType = 'sum' | 'avel' | 'max' | 'min' | 'count'; + +export const AggregationMethod = [ + { value: 'count', label: '计数' }, + { value: 'sum', label: '求和' }, + { value: 'avel', label: '平均值' }, + { value: 'max', label: '最大值' }, + { value: 'min', label: '最小值' }, +]; + +export const ICON = () => { + return ( + + + + + ); +}; diff --git a/packages/li-analysis-assets/src/widgets/MiniChart/index.tsx b/packages/li-analysis-assets/src/widgets/MiniChart/index.tsx index abc6a568..74126407 100644 --- a/packages/li-analysis-assets/src/widgets/MiniChart/index.tsx +++ b/packages/li-analysis-assets/src/widgets/MiniChart/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './register-form'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '以图表的形式展示数据', type: 'Atom', category: 'DataAnalysis', + icon: ICON, }, defaultProperties: { chartType: 'column', diff --git a/packages/li-analysis-assets/src/widgets/MiniChart/register-form/index.tsx b/packages/li-analysis-assets/src/widgets/MiniChart/register-form/index.tsx index dd073b86..9f333aef 100644 --- a/packages/li-analysis-assets/src/widgets/MiniChart/register-form/index.tsx +++ b/packages/li-analysis-assets/src/widgets/MiniChart/register-form/index.tsx @@ -1,8 +1,8 @@ import type { WidgetRegisterForm, WidgetRegisterFormProps } from '@antv/li-sdk'; import { getDatasetSelectFormSchema } from '@antv/li-sdk'; import type { ChartType } from '../Component/Chart/type'; -import type { AggregationMethodType } from '../constant'; -import { AggregationMethod, ChartTypeList } from '../constant'; +import type { AggregationMethodType } from '../constants'; +import { AggregationMethod, ChartTypeList } from '../constants'; import lineColumnSchema from './line-column-schema'; import pieSchema from './pie-schema'; diff --git a/packages/li-analysis-assets/src/widgets/PropertiesPanel/Component.tsx b/packages/li-analysis-assets/src/widgets/PropertiesPanel/Component.tsx index ec9c8238..0ba2860e 100644 --- a/packages/li-analysis-assets/src/widgets/PropertiesPanel/Component.tsx +++ b/packages/li-analysis-assets/src/widgets/PropertiesPanel/Component.tsx @@ -6,7 +6,7 @@ import cls from 'classnames'; import { isObject, isString } from 'lodash-es'; import React, { useEffect, useMemo, useRef, useState } from 'react'; import useStyle from './ComponenStyle'; -import { CLS_PREFIX } from './constant'; +import { CLS_PREFIX } from './constants'; import { isImageUrl } from './helper'; import type { Properties } from './registerForm'; diff --git a/packages/li-analysis-assets/src/widgets/PropertiesPanel/constant.ts b/packages/li-analysis-assets/src/widgets/PropertiesPanel/constant.ts deleted file mode 100644 index fd78697d..00000000 --- a/packages/li-analysis-assets/src/widgets/PropertiesPanel/constant.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** 组件名称, 前缀 */ -export const CLS_PREFIX = 'li-analysis-properties-panel'; diff --git a/packages/li-analysis-assets/src/widgets/PropertiesPanel/constants.tsx b/packages/li-analysis-assets/src/widgets/PropertiesPanel/constants.tsx new file mode 100644 index 00000000..87cbf27b --- /dev/null +++ b/packages/li-analysis-assets/src/widgets/PropertiesPanel/constants.tsx @@ -0,0 +1,19 @@ +import React from 'react'; +/** 组件名称, 前缀 */ +export const CLS_PREFIX = 'li-analysis-properties-panel'; + +export const ICON = () => { + return ( + + + + + ); +}; diff --git a/packages/li-analysis-assets/src/widgets/PropertiesPanel/index.tsx b/packages/li-analysis-assets/src/widgets/PropertiesPanel/index.tsx index e20a05e2..09987984 100644 --- a/packages/li-analysis-assets/src/widgets/PropertiesPanel/index.tsx +++ b/packages/li-analysis-assets/src/widgets/PropertiesPanel/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,7 +11,7 @@ export default implementWidget({ description: '面板形式展示图层的额外信息', category: 'LayerInteraction', type: 'Auto', - icon: '', + icon: ICON, defaultProperties: { isOpen: true, items: [], diff --git a/packages/li-analysis-assets/src/widgets/RightClickMenu/Component.tsx b/packages/li-analysis-assets/src/widgets/RightClickMenu/Component.tsx index 9dad0a2c..c7a62cc2 100644 --- a/packages/li-analysis-assets/src/widgets/RightClickMenu/Component.tsx +++ b/packages/li-analysis-assets/src/widgets/RightClickMenu/Component.tsx @@ -5,9 +5,7 @@ import cls from 'classnames'; import React from 'react'; import useStyle from './ComponenStyle'; import type { Properties } from './registerForm'; - -/** 组件名称, 前缀 */ -const CLS_PREFIX = 'li-analysis-right-click-menu'; +import { CLS_PREFIX } from './constants'; export interface RightClickMenuProps extends ImplementWidgetProps, Properties {} diff --git a/packages/li-analysis-assets/src/widgets/RightClickMenu/constants.tsx b/packages/li-analysis-assets/src/widgets/RightClickMenu/constants.tsx new file mode 100644 index 00000000..b1e7fd4d --- /dev/null +++ b/packages/li-analysis-assets/src/widgets/RightClickMenu/constants.tsx @@ -0,0 +1,14 @@ +import React from 'react'; +/** 组件名称, 前缀 */ +export const CLS_PREFIX = 'li-analysis-right-click-menu'; + +export const ICON = () => { + return ( + + + + ); +}; diff --git a/packages/li-analysis-assets/src/widgets/RightClickMenu/index.tsx b/packages/li-analysis-assets/src/widgets/RightClickMenu/index.tsx index 1528850e..19b04003 100644 --- a/packages/li-analysis-assets/src/widgets/RightClickMenu/index.tsx +++ b/packages/li-analysis-assets/src/widgets/RightClickMenu/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '地图右键展示菜单', type: 'Auto', category: 'MapInteraction', + icon: ICON, }, defaultProperties: { showRightMenu: true, diff --git a/packages/li-analysis-assets/src/widgets/SpreadSheetTable/Component/index.tsx b/packages/li-analysis-assets/src/widgets/SpreadSheetTable/Component/index.tsx index ac4c1b66..c63778e3 100644 --- a/packages/li-analysis-assets/src/widgets/SpreadSheetTable/Component/index.tsx +++ b/packages/li-analysis-assets/src/widgets/SpreadSheetTable/Component/index.tsx @@ -7,7 +7,7 @@ import { useSize } from 'ahooks'; import classNames from 'classnames'; import { mapValues } from 'lodash-es'; import React, { useEffect, useMemo, useRef } from 'react'; -import { CLS_PREFIX } from '../constant'; +import { CLS_PREFIX } from '../constants'; import type { Properties } from '../registerForm'; import { getThemeCfg } from './helper'; import useStyle from './style'; diff --git a/packages/li-analysis-assets/src/widgets/SpreadSheetTable/constant.ts b/packages/li-analysis-assets/src/widgets/SpreadSheetTable/constant.ts deleted file mode 100644 index da2f4c12..00000000 --- a/packages/li-analysis-assets/src/widgets/SpreadSheetTable/constant.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** 组件名称, 前缀 */ -export const CLS_PREFIX = 'li-analysis-spread-sheet-table'; diff --git a/packages/li-analysis-assets/src/widgets/SpreadSheetTable/constants.tsx b/packages/li-analysis-assets/src/widgets/SpreadSheetTable/constants.tsx new file mode 100644 index 00000000..531de955 --- /dev/null +++ b/packages/li-analysis-assets/src/widgets/SpreadSheetTable/constants.tsx @@ -0,0 +1,14 @@ +import React from 'react'; +/** 组件名称, 前缀 */ +export const CLS_PREFIX = 'li-analysis-spread-sheet-table'; + +export const ICON = () => { + return ( + + + + ); +}; diff --git a/packages/li-analysis-assets/src/widgets/SpreadSheetTable/index.tsx b/packages/li-analysis-assets/src/widgets/SpreadSheetTable/index.tsx index aadc8ead..7c7fba47 100644 --- a/packages/li-analysis-assets/src/widgets/SpreadSheetTable/index.tsx +++ b/packages/li-analysis-assets/src/widgets/SpreadSheetTable/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '以表格的形式展示数据', type: 'Atom', category: 'DataAnalysis', + icon: ICON, }, defaultProperties: { layoutWidthType: 'colAdaptive', diff --git a/packages/li-analysis-assets/src/widgets/SwipeControl/index.tsx b/packages/li-analysis-assets/src/widgets/SwipeControl/index.tsx index d4d16bd2..47d78fc4 100644 --- a/packages/li-analysis-assets/src/widgets/SwipeControl/index.tsx +++ b/packages/li-analysis-assets/src/widgets/SwipeControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { SwipeSvg } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '用于分屏对比两个地图上叠加图层', type: 'Auto', category: 'MapControl', + icon: SwipeSvg, }, defaultProperties: { position: 'topright', diff --git a/packages/li-analysis-assets/src/widgets/TimeLine/Component/constants.tsx b/packages/li-analysis-assets/src/widgets/TimeLine/Component/constants.tsx index ff9b2c10..938ddc4b 100644 --- a/packages/li-analysis-assets/src/widgets/TimeLine/Component/constants.tsx +++ b/packages/li-analysis-assets/src/widgets/TimeLine/Component/constants.tsx @@ -5,7 +5,7 @@ import React from 'react'; export const CLS_PREFIX = 'li-analysis-time-line-panel'; export const TimeAxisSvg = () => ( - + ); diff --git a/packages/li-analysis-assets/src/widgets/TimeLine/index.tsx b/packages/li-analysis-assets/src/widgets/TimeLine/index.tsx index 48d57581..16cd5113 100644 --- a/packages/li-analysis-assets/src/widgets/TimeLine/index.tsx +++ b/packages/li-analysis-assets/src/widgets/TimeLine/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { TimeAxisSvg } from './Component/constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '用于在时间维度对数据进行筛选', type: 'Auto', category: 'DataAnalysis', + icon: TimeAxisSvg, }, component, registerForm, diff --git a/packages/li-analysis-assets/src/widgets/VectorTilesLoaderControl/index.tsx b/packages/li-analysis-assets/src/widgets/VectorTilesLoaderControl/index.tsx index ad69b615..1c382d56 100644 --- a/packages/li-analysis-assets/src/widgets/VectorTilesLoaderControl/index.tsx +++ b/packages/li-analysis-assets/src/widgets/VectorTilesLoaderControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { VectorTileSvg } from './Component/constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '用于加载矢量瓦片图层,方便可视化验证矢量瓦片数据', type: 'Auto', category: 'MapControl', + icon: VectorTileSvg, }, defaultProperties: { position: 'topleft', diff --git a/packages/li-core-assets/src/widgets/BaseLayout/Component.tsx b/packages/li-core-assets/src/widgets/BaseLayout/Component.tsx index 00ea2fd7..f7dcb8c1 100644 --- a/packages/li-core-assets/src/widgets/BaseLayout/Component.tsx +++ b/packages/li-core-assets/src/widgets/BaseLayout/Component.tsx @@ -2,10 +2,9 @@ import type { ImplementWidgetProps } from '@antv/li-sdk'; import { MapContainer } from '@antv/li-sdk'; import classNames from 'classnames'; import React, { useMemo } from 'react'; -import { CLS_PREFIX } from './constant'; +import { CLS_PREFIX } from './constants'; import type { Properties } from './registerForm'; import useStyle from './ComponenStyle'; - export interface BaseLayoutProps extends Properties, ImplementWidgetProps<'content' | 'controls' | 'sidePanel'> { children?: React.ReactNode; } diff --git a/packages/li-core-assets/src/widgets/BaseLayout/constant.ts b/packages/li-core-assets/src/widgets/BaseLayout/constant.ts deleted file mode 100644 index 76704529..00000000 --- a/packages/li-core-assets/src/widgets/BaseLayout/constant.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** 组件名称, 前缀 */ -export const CLS_PREFIX = 'li-base-layout'; diff --git a/packages/li-core-assets/src/widgets/BaseLayout/constants.tsx b/packages/li-core-assets/src/widgets/BaseLayout/constants.tsx new file mode 100644 index 00000000..5b4dee02 --- /dev/null +++ b/packages/li-core-assets/src/widgets/BaseLayout/constants.tsx @@ -0,0 +1,15 @@ +import React from 'react'; +/** 组件名称, 前缀 */ +export const CLS_PREFIX = 'li-base-layout'; + +export const ICON = () => { + return ( + + + + ); +}; diff --git a/packages/li-core-assets/src/widgets/BaseLayout/index.tsx b/packages/li-core-assets/src/widgets/BaseLayout/index.tsx index 07e71ae7..5bf4da8c 100644 --- a/packages/li-core-assets/src/widgets/BaseLayout/index.tsx +++ b/packages/li-core-assets/src/widgets/BaseLayout/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '基础的布局组件,带有侧边栏', type: 'Layout', category: 'Layout', + icon: ICON, }, defaultProperties: { showSidePanel: true, diff --git a/packages/li-core-assets/src/widgets/ExportImageControl/constants.tsx b/packages/li-core-assets/src/widgets/ExportImageControl/constants.tsx new file mode 100644 index 00000000..c6a3108d --- /dev/null +++ b/packages/li-core-assets/src/widgets/ExportImageControl/constants.tsx @@ -0,0 +1,9 @@ +import React from 'react'; + +export const ICON = () => { + return ( + + ); +}; diff --git a/packages/li-core-assets/src/widgets/ExportImageControl/index.tsx b/packages/li-core-assets/src/widgets/ExportImageControl/index.tsx index 10bddced..81d3a75d 100644 --- a/packages/li-core-assets/src/widgets/ExportImageControl/index.tsx +++ b/packages/li-core-assets/src/widgets/ExportImageControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '地图截图并导出', type: 'Auto', category: 'MapControl', + icon: ICON, }, defaultProperties: { position: 'topright', diff --git a/packages/li-core-assets/src/widgets/FullscreenControl/constants.tsx b/packages/li-core-assets/src/widgets/FullscreenControl/constants.tsx new file mode 100644 index 00000000..5b395c4e --- /dev/null +++ b/packages/li-core-assets/src/widgets/FullscreenControl/constants.tsx @@ -0,0 +1,9 @@ +import React from 'react'; + +export const ICON = () => { + return ( + + ); +}; diff --git a/packages/li-core-assets/src/widgets/FullscreenControl/index.tsx b/packages/li-core-assets/src/widgets/FullscreenControl/index.tsx index fc69dec7..f8a4f5db 100644 --- a/packages/li-core-assets/src/widgets/FullscreenControl/index.tsx +++ b/packages/li-core-assets/src/widgets/FullscreenControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '全屏模式下看地图', type: 'Auto', category: 'MapControl', + icon: ICON, }, defaultProperties: { position: 'topright', diff --git a/packages/li-core-assets/src/widgets/GeoLocateControl/constants.tsx b/packages/li-core-assets/src/widgets/GeoLocateControl/constants.tsx new file mode 100644 index 00000000..25a6bc58 --- /dev/null +++ b/packages/li-core-assets/src/widgets/GeoLocateControl/constants.tsx @@ -0,0 +1,9 @@ +import React from 'react'; + +export const ICON = () => { + return ( + + ); +}; diff --git a/packages/li-core-assets/src/widgets/GeoLocateControl/index.tsx b/packages/li-core-assets/src/widgets/GeoLocateControl/index.tsx index 8cec7beb..c3cb1a1b 100644 --- a/packages/li-core-assets/src/widgets/GeoLocateControl/index.tsx +++ b/packages/li-core-assets/src/widgets/GeoLocateControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '使用 GPS 定位到地图上', type: 'Auto', category: 'MapControl', + icon: ICON, }, defaultProperties: { position: 'bottomright' as const, diff --git a/packages/li-core-assets/src/widgets/LayerPopup/constants.tsx b/packages/li-core-assets/src/widgets/LayerPopup/constants.tsx new file mode 100644 index 00000000..996158a6 --- /dev/null +++ b/packages/li-core-assets/src/widgets/LayerPopup/constants.tsx @@ -0,0 +1,13 @@ +import React from 'react'; + +export const ICON = () => { + return ( + + + + ); +}; diff --git a/packages/li-core-assets/src/widgets/LayerPopup/index.tsx b/packages/li-core-assets/src/widgets/LayerPopup/index.tsx index 5a90d45d..44e68a36 100644 --- a/packages/li-core-assets/src/widgets/LayerPopup/index.tsx +++ b/packages/li-core-assets/src/widgets/LayerPopup/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '弹窗形式展示图层的额外信息', type: 'Auto', category: 'LayerInteraction', + icon: ICON, }, defaultProperties: { isOpen: true, diff --git a/packages/li-core-assets/src/widgets/LogoControl/constants.tsx b/packages/li-core-assets/src/widgets/LogoControl/constants.tsx new file mode 100644 index 00000000..f558286b --- /dev/null +++ b/packages/li-core-assets/src/widgets/LogoControl/constants.tsx @@ -0,0 +1,12 @@ +import React from 'react'; + +export const ICON = () => { + return ( + + + + ); +}; diff --git a/packages/li-core-assets/src/widgets/LogoControl/index.tsx b/packages/li-core-assets/src/widgets/LogoControl/index.tsx index fb7359bd..5f4a892f 100644 --- a/packages/li-core-assets/src/widgets/LogoControl/index.tsx +++ b/packages/li-core-assets/src/widgets/LogoControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '自定义 Logo 图标', type: 'Auto', category: 'MapControl', + icon: ICON, }, defaultProperties: { position: 'leftbottom' as const, diff --git a/packages/li-core-assets/src/widgets/MapThemeControl/constants.ts b/packages/li-core-assets/src/widgets/MapThemeControl/constants.ts deleted file mode 100644 index 41f7df9d..00000000 --- a/packages/li-core-assets/src/widgets/MapThemeControl/constants.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const POPOVER_PLACEMENT = new Map([ - ['topleft', 'right-start'], - ['topright', 'left-start'], - ['bottomleft', 'right-end'], - ['bottomright', 'left-end'], - [undefined, 'left-start'], -]); diff --git a/packages/li-core-assets/src/widgets/MapThemeControl/constants.tsx b/packages/li-core-assets/src/widgets/MapThemeControl/constants.tsx new file mode 100644 index 00000000..fb74ac21 --- /dev/null +++ b/packages/li-core-assets/src/widgets/MapThemeControl/constants.tsx @@ -0,0 +1,17 @@ +import React from 'react'; + +export const POPOVER_PLACEMENT = new Map([ + ['topleft', 'right-start'], + ['topright', 'left-start'], + ['bottomleft', 'right-end'], + ['bottomright', 'left-end'], + [undefined, 'left-start'], +]); + +export const ICON = () => { + return ( + + ); +}; diff --git a/packages/li-core-assets/src/widgets/MapThemeControl/index.tsx b/packages/li-core-assets/src/widgets/MapThemeControl/index.tsx index a4961332..5a9b947d 100644 --- a/packages/li-core-assets/src/widgets/MapThemeControl/index.tsx +++ b/packages/li-core-assets/src/widgets/MapThemeControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '地图底图主题样式切换', type: 'Auto', category: 'MapControl', + icon: ICON, }, defaultProperties: { position: 'topright', diff --git a/packages/li-core-assets/src/widgets/MapViewSettingControl/ComponenStyle.ts b/packages/li-core-assets/src/widgets/MapViewSettingControl/ComponenStyle.ts index ebbe2bd4..02ce788f 100644 --- a/packages/li-core-assets/src/widgets/MapViewSettingControl/ComponenStyle.ts +++ b/packages/li-core-assets/src/widgets/MapViewSettingControl/ComponenStyle.ts @@ -21,6 +21,7 @@ const useStyle = () => { background-color: ${colorBgContainer}; border-radius: ${borderRadius}px; cursor: pointer; + font-size: 16px; svg { color: ${colorTextDescription}; diff --git a/packages/li-core-assets/src/widgets/MapViewSettingControl/constants.tsx b/packages/li-core-assets/src/widgets/MapViewSettingControl/constants.tsx index 20c6de20..f0fa7518 100644 --- a/packages/li-core-assets/src/widgets/MapViewSettingControl/constants.tsx +++ b/packages/li-core-assets/src/widgets/MapViewSettingControl/constants.tsx @@ -19,12 +19,10 @@ export const POPOVER_PLACEMENT_MAP = new Map ( - - - - - - - + + ); diff --git a/packages/li-core-assets/src/widgets/MapViewSettingControl/index.tsx b/packages/li-core-assets/src/widgets/MapViewSettingControl/index.tsx index 97e35ae0..78c8fe10 100644 --- a/packages/li-core-assets/src/widgets/MapViewSettingControl/index.tsx +++ b/packages/li-core-assets/src/widgets/MapViewSettingControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { MapViewSettingControlSvg } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '调整地图视角', type: 'Auto', category: 'MapControl', + icon: MapViewSettingControlSvg, }, defaultProperties: { position: 'topright', diff --git a/packages/li-core-assets/src/widgets/MouseLocationControl/constants.tsx b/packages/li-core-assets/src/widgets/MouseLocationControl/constants.tsx new file mode 100644 index 00000000..3002cab4 --- /dev/null +++ b/packages/li-core-assets/src/widgets/MouseLocationControl/constants.tsx @@ -0,0 +1,12 @@ +import React from 'react'; + +export const ICON = () => { + return ( + + + + ); +}; diff --git a/packages/li-core-assets/src/widgets/MouseLocationControl/index.tsx b/packages/li-core-assets/src/widgets/MouseLocationControl/index.tsx index 50f51b58..b7bbadf3 100644 --- a/packages/li-core-assets/src/widgets/MouseLocationControl/index.tsx +++ b/packages/li-core-assets/src/widgets/MouseLocationControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '显示光标在地图上的经纬度信息', type: 'Auto', category: 'MapControl', + icon: ICON, }, defaultProperties: { position: 'leftbottom', diff --git a/packages/li-core-assets/src/widgets/ScaleControl/constants.tsx b/packages/li-core-assets/src/widgets/ScaleControl/constants.tsx new file mode 100644 index 00000000..4b8fd76d --- /dev/null +++ b/packages/li-core-assets/src/widgets/ScaleControl/constants.tsx @@ -0,0 +1,10 @@ +import React from 'react'; + +export const ICON = () => { + return ( + + + + + ); +}; diff --git a/packages/li-core-assets/src/widgets/ScaleControl/index.tsx b/packages/li-core-assets/src/widgets/ScaleControl/index.tsx index 2ccc3a30..3806f589 100644 --- a/packages/li-core-assets/src/widgets/ScaleControl/index.tsx +++ b/packages/li-core-assets/src/widgets/ScaleControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '地图比例尺', type: 'Auto', category: 'MapControl', + icon: ICON, }, defaultProperties: { position: 'rightbottom', diff --git a/packages/li-core-assets/src/widgets/ZoomControl/constants.tsx b/packages/li-core-assets/src/widgets/ZoomControl/constants.tsx new file mode 100644 index 00000000..647f3735 --- /dev/null +++ b/packages/li-core-assets/src/widgets/ZoomControl/constants.tsx @@ -0,0 +1,11 @@ +import React from 'react'; + +export const ICON = () => { + return ( + + + + + + ); +}; diff --git a/packages/li-core-assets/src/widgets/ZoomControl/index.tsx b/packages/li-core-assets/src/widgets/ZoomControl/index.tsx index 984141db..aacc922b 100644 --- a/packages/li-core-assets/src/widgets/ZoomControl/index.tsx +++ b/packages/li-core-assets/src/widgets/ZoomControl/index.tsx @@ -1,6 +1,7 @@ import { implementWidget } from '@antv/li-sdk'; import component from './Component'; import registerForm from './registerForm'; +import { ICON } from './constants'; export default implementWidget({ version: 'v0.1', @@ -10,6 +11,7 @@ export default implementWidget({ description: '地图层级缩放器', type: 'Auto', category: 'MapControl', + icon: ICON, }, defaultProperties: { position: 'bottomright', diff --git a/packages/li-editor/src/widgets/WidgetsPanel/AddWidgetsPanel/WidgetList.tsx b/packages/li-editor/src/widgets/WidgetsPanel/AddWidgetsPanel/WidgetList.tsx index a409845d..014661d5 100644 --- a/packages/li-editor/src/widgets/WidgetsPanel/AddWidgetsPanel/WidgetList.tsx +++ b/packages/li-editor/src/widgets/WidgetsPanel/AddWidgetsPanel/WidgetList.tsx @@ -1,4 +1,4 @@ -import { CheckOutlined, GroupOutlined } from '@ant-design/icons'; +import Icon, { CheckOutlined, GroupOutlined } from '@ant-design/icons'; import type { ImplementWidget } from '@antv/li-sdk'; import { Card, Empty, Tooltip } from 'antd'; import classNames from 'classnames'; @@ -50,6 +50,8 @@ const WidgetList: React.FC = (props) => { item.metadata.description ); + const Image = item.metadata.icon ? : ; + return ( = (props) => { })} >
handleClickItem(item)} className="li-add-widgets-panel__content-item-content"> -
- -
+
{Image}
diff --git a/packages/li-editor/src/widgets/WidgetsPanel/AddWidgetsPanel/index.less b/packages/li-editor/src/widgets/WidgetsPanel/AddWidgetsPanel/index.less index ca38f74c..350754f9 100644 --- a/packages/li-editor/src/widgets/WidgetsPanel/AddWidgetsPanel/index.less +++ b/packages/li-editor/src/widgets/WidgetsPanel/AddWidgetsPanel/index.less @@ -1,4 +1,4 @@ -@import '../../../theme/index.less'; +@import url('../../../theme/index.less'); .@{prefix}-add-widgets-panel { position: relative; @@ -35,11 +35,12 @@ display: flex; align-items: center; padding: 10px; + &__img { margin-right: 10px; + font-size: 40px; + svg { - width: 40px; - height: 40px; color: @primary-color-1; } } @@ -98,8 +99,8 @@ } &-item:hover { - box-shadow: 0 5px 12px 4px rgba(0, 0, 0, 0.09), 0 3px 6px 0 rgba(0, 0, 0, 0.12), - 0 1px 2px -2px rgba(0, 0, 0, 0.16); + box-shadow: 0 5px 12px 4px rgb(0 0 0 / 9%), 0 3px 6px 0 rgb(0 0 0 / 12%), + 0 1px 2px -2px rgb(0 0 0 / 16%); } } } diff --git a/packages/li-sdk/src/specs/metadata.ts b/packages/li-sdk/src/specs/metadata.ts index c4d80d79..31e509d3 100644 --- a/packages/li-sdk/src/specs/metadata.ts +++ b/packages/li-sdk/src/specs/metadata.ts @@ -28,7 +28,7 @@ export type LayerMetadata = Metadata & { /** 图层资产分类 */ category?: string; /** 图层图标,用于图层市场展示 */ - icon?: string | React.FC; + icon?: React.ComponentType>; /** 图层颜色,用于图层列表展示 */ color?: string; }; @@ -71,7 +71,7 @@ export type WidgetMetadata = Metadata & { /** 组件资产分类,支持自定义分类 */ category?: WidgetCategory | string; /** 组件图标,用于组件市场展示 */ - icon?: string; + icon?: React.ComponentType>; }; /**