@jetlinks-web/components 2.0.1 → 2.0.2-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetlinks-web/components",
3
- "version": "2.0.1",
3
+ "version": "2.0.2-1",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "module": "index.ts",
@@ -21,8 +21,8 @@
21
21
  "echarts": "^5.4.3",
22
22
  "monaco-editor": "^0.40.0",
23
23
  "@jetlinks-web/constants": "^1.0.2",
24
- "@jetlinks-web/utils": "^1.0.6",
25
- "@jetlinks-web/hooks": "^1.0.10"
24
+ "@jetlinks-web/hooks": "^1.0.11",
25
+ "@jetlinks-web/utils": "^1.0.6"
26
26
  },
27
27
  "devDependencies": {
28
28
  "lodash-es": "^4.17.21",
@@ -1,17 +1,17 @@
1
- import type {PropType} from "vue";
2
- import { configProviderProps } from 'ant-design-vue/lib/config-provider/context';
3
-
4
- export type MapConfigType = {
5
- mapStyle?: any
6
- JSKey?: string
7
- WebKey?: string
8
- }
9
- export const configProps = () => ({
10
- ...configProviderProps(),
11
- IconConfig: {
12
- type: Object as PropType<{ scriptUrl: string }>
13
- },
14
- MapConfig: {
15
- type: Object as PropType<MapConfigType>
16
- }
17
- })
1
+ import type {PropType} from "vue";
2
+ import { configProviderProps } from 'ant-design-vue/es/config-provider/context';
3
+
4
+ export type MapConfigType = {
5
+ mapStyle?: any
6
+ JSKey?: string
7
+ WebKey?: string
8
+ }
9
+ export const configProps = () => ({
10
+ ...configProviderProps(),
11
+ IconConfig: {
12
+ type: Object as PropType<{ scriptUrl: string }>
13
+ },
14
+ MapConfig: {
15
+ type: Object as PropType<MapConfigType>
16
+ }
17
+ })
@@ -1,42 +1,40 @@
1
- import {defineComponent, provide, reactive} from 'vue'
2
- import { configProps } from './context'
3
- import type { MapConfigType } from './context'
4
- import { ComponentsEnum, MAPConfig } from '@jetlinks-web/constants'
5
- import { ConfigProvider } from 'ant-design-vue'
6
- import {omit} from 'lodash-es'
7
- import Empty from '../Empty'
8
-
9
- const JConfigProvider = defineComponent({
10
- name: 'JConfigProvider',
11
- inheritAttrs: false,
12
- props: {
13
- ...configProps()
14
- },
15
- setup(props, { slots }) {
16
-
17
- const _iconConfig = reactive(props.IconConfig || {})
18
- const _mapConfig = reactive<MapConfigType>(props.MapConfig || {})
19
-
20
- provide(ComponentsEnum.Icon, _iconConfig) // 全局Icon 配置
21
-
22
- provide(MAPConfig, _mapConfig) // 全局地图配置
23
-
24
- return () => {
25
- return (
26
- <ConfigProvider
27
- {...omit(props, ['IconConfig', 'MapConfig'])}
28
- v-slots={{
29
- renderEmpty: () => (slots.renderEmpty?.() || <Empty />),
30
- ...slots,
31
- }}
32
- >
33
- { slots.default?.() }
34
- </ConfigProvider>
35
- )
36
- }
37
- }
38
- })
39
-
40
- JConfigProvider.config = ConfigProvider.config
41
-
42
- export default JConfigProvider
1
+ import {defineComponent, provide, reactive} from 'vue'
2
+ import { configProps } from './context'
3
+ import type { MapConfigType } from './context'
4
+ import { ComponentsEnum, MAPConfig } from '@jetlinks-web/constants'
5
+ import { ConfigProvider } from 'ant-design-vue'
6
+ import {omit} from 'lodash-es'
7
+ import Empty from '../Empty'
8
+
9
+ const JConfigProvider = defineComponent({
10
+ name: 'JConfigProvider',
11
+ inheritAttrs: false,
12
+ props: {
13
+ ...configProps()
14
+ },
15
+ setup(props, { slots }) {
16
+
17
+ const _iconConfig = reactive(props.IconConfig || {})
18
+ const _mapConfig = reactive<MapConfigType>(props.MapConfig || {})
19
+
20
+ provide(ComponentsEnum.Icon, _iconConfig) // 全局Icon 配置
21
+
22
+ provide(MAPConfig, _mapConfig) // 全局地图配置
23
+
24
+ return () => {
25
+
26
+ return h(
27
+ ConfigProvider,
28
+ {...omit(props, ['IconConfig', 'MapConfig'])},
29
+ {
30
+ default: slots.default,
31
+ renderEmpty: () => (slots.renderEmpty?.() || <Empty />)
32
+ }
33
+ )
34
+ }
35
+ }
36
+ })
37
+
38
+ JConfigProvider.config = ConfigProvider.config
39
+
40
+ export default JConfigProvider