@jetlinks-web/components 2.0.2 → 2.0.3

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 (237) hide show
  1. package/es/AMap/Map.js +124 -0
  2. package/es/AMap/index.js +2 -0
  3. package/es/AMap/util.js +56 -0
  4. package/es/BadgeStatus/Badge.js +54 -0
  5. package/es/BadgeStatus/color.js +21 -0
  6. package/es/BadgeStatus/index.js +3 -0
  7. package/es/CardSelect/CardSelect.js +123 -0
  8. package/es/CardSelect/index.js +2 -0
  9. package/es/CheckButton/CheckButton.js +121 -0
  10. package/es/CheckButton/index.js +2 -0
  11. package/es/ConfigProvider/context.js +12 -0
  12. package/es/ConfigProvider/index.js +31 -0
  13. package/es/Echarts/Echarts.js +47 -0
  14. package/es/Echarts/index.js +2 -0
  15. package/es/Ellipsis/Ellipsis.js +189 -0
  16. package/es/Ellipsis/index.js +2 -0
  17. package/es/Empty/Empty.js +56 -0
  18. package/es/Empty/image.js +2 -0
  19. package/es/Empty/index.js +2 -0
  20. package/es/FullPage/FullPage.js +31 -0
  21. package/es/FullPage/index.js +2 -0
  22. package/es/Icon/icon.js +42 -0
  23. package/{src/Icon/index.ts → es/Icon/index.js} +2 -3
  24. package/es/MonacoEditor/Monaco.js +238 -0
  25. package/es/MonacoEditor/index.js +2 -0
  26. package/es/PermissionButton/index.js +117 -0
  27. package/es/ProLayout/Basic/BasicLayout.js +259 -0
  28. package/es/ProLayout/Basic/Header.js +97 -0
  29. package/es/ProLayout/PageContainer/index.js +324 -0
  30. package/es/ProLayout/PageContainer/typings.js +1 -0
  31. package/es/ProLayout/RouteContext.js +22 -0
  32. package/es/ProLayout/SiderMenu/BaseMenu.js +285 -0
  33. package/es/ProLayout/SiderMenu/SiderMenu.js +278 -0
  34. package/es/ProLayout/SiderMenu/index.js +2 -0
  35. package/es/ProLayout/SiderMenu/typings.js +1 -0
  36. package/es/ProLayout/TopHeader/index.js +163 -0
  37. package/es/ProLayout/defaultSettings.js +66 -0
  38. package/{src/ProLayout/index.ts → es/ProLayout/index.js} +4 -6
  39. package/{src → es}/ProLayout/style/default.less +4 -4
  40. package/es/ProLayout/style/index.js +1 -0
  41. package/es/ProLayout/typings.js +1 -0
  42. package/es/ProLayout/util.js +61 -0
  43. package/es/ProTable/index.js +411 -0
  44. package/es/ProTable/proTableTypes.js +11 -0
  45. package/es/ProTable/style/index.css +65 -0
  46. package/es/ProTable/style/index.js +1 -0
  47. package/es/Scrollbar/Bar.js +114 -0
  48. package/es/Scrollbar/Scrollbar.js +212 -0
  49. package/es/Scrollbar/Thumb.js +189 -0
  50. package/es/Scrollbar/constants.js +1 -0
  51. package/es/Scrollbar/index.js +2 -0
  52. package/es/Scrollbar/scrollbarProps.js +100 -0
  53. package/es/Scrollbar/thumbProps.js +10 -0
  54. package/es/Scrollbar/util.js +30 -0
  55. package/es/Search/Advanced/History.js +183 -0
  56. package/es/Search/Advanced/SaveHistory.js +153 -0
  57. package/es/Search/Advanced/index.js +520 -0
  58. package/es/Search/Item.js +497 -0
  59. package/es/Search/Search.js +249 -0
  60. package/es/Search/hooks/index.js +1 -0
  61. package/es/Search/hooks/useSearchItems.js +40 -0
  62. package/es/Search/index.js +4 -0
  63. package/es/Search/setting.js +91 -0
  64. package/es/Search/style/Item.less +33 -0
  65. package/es/Search/style/Search.less +179 -0
  66. package/es/Search/style/index.js +2 -0
  67. package/es/Search/typing.js +1 -0
  68. package/es/Search/util.js +234 -0
  69. package/es/ValueItem/ValueItem.js +233 -0
  70. package/es/ValueItem/index.js +2 -0
  71. package/es/ValueItem/util.js +16 -0
  72. package/es/index.js +24 -0
  73. package/es/style/index.js +3 -0
  74. package/es/style/variable.css +0 -0
  75. package/{src → es}/style/variable.less +0 -2
  76. package/es/style.js +3 -0
  77. package/lib/AMap/Map.js +124 -0
  78. package/lib/AMap/index.js +9 -0
  79. package/lib/AMap/util.js +62 -0
  80. package/lib/BadgeStatus/Badge.js +54 -0
  81. package/lib/BadgeStatus/color.js +27 -0
  82. package/lib/BadgeStatus/index.js +22 -0
  83. package/lib/CardSelect/CardSelect.js +123 -0
  84. package/lib/CardSelect/index.js +9 -0
  85. package/lib/CheckButton/CheckButton.js +121 -0
  86. package/lib/CheckButton/index.js +9 -0
  87. package/lib/ConfigProvider/context.js +19 -0
  88. package/lib/ConfigProvider/index.js +37 -0
  89. package/lib/Echarts/Echarts.js +47 -0
  90. package/lib/Echarts/index.js +9 -0
  91. package/lib/Ellipsis/Ellipsis.js +189 -0
  92. package/lib/Ellipsis/index.js +9 -0
  93. package/lib/Empty/Empty.js +56 -0
  94. package/lib/Empty/image.js +8 -0
  95. package/lib/Empty/index.js +9 -0
  96. package/lib/FullPage/FullPage.js +31 -0
  97. package/lib/FullPage/index.js +9 -0
  98. package/lib/Icon/icon.js +52 -0
  99. package/lib/Icon/index.js +9 -0
  100. package/lib/MonacoEditor/Monaco.js +238 -0
  101. package/lib/MonacoEditor/index.js +9 -0
  102. package/lib/PermissionButton/index.js +124 -0
  103. package/lib/ProLayout/Basic/BasicLayout.js +268 -0
  104. package/lib/ProLayout/Basic/BasicLayout.less +66 -0
  105. package/lib/ProLayout/Basic/Header.js +103 -0
  106. package/lib/ProLayout/Basic/Header.less +8 -0
  107. package/lib/ProLayout/PageContainer/index.js +327 -0
  108. package/lib/ProLayout/PageContainer/index.less +103 -0
  109. package/lib/ProLayout/PageContainer/typings.js +5 -0
  110. package/lib/ProLayout/RouteContext.js +28 -0
  111. package/lib/ProLayout/SiderMenu/BaseMenu.js +290 -0
  112. package/lib/ProLayout/SiderMenu/SiderMenu.js +287 -0
  113. package/lib/ProLayout/SiderMenu/index.js +20 -0
  114. package/lib/ProLayout/SiderMenu/index.less +212 -0
  115. package/lib/ProLayout/SiderMenu/typings.js +5 -0
  116. package/lib/ProLayout/TopHeader/index.js +168 -0
  117. package/lib/ProLayout/TopHeader/index.less +174 -0
  118. package/lib/ProLayout/defaultSettings.js +72 -0
  119. package/lib/ProLayout/index.js +16 -0
  120. package/lib/ProLayout/style/default.less +4 -0
  121. package/lib/ProLayout/style/index.js +3 -0
  122. package/lib/ProLayout/style/style.less +7 -0
  123. package/lib/ProLayout/typings.js +5 -0
  124. package/lib/ProLayout/util.js +72 -0
  125. package/lib/ProTable/index.js +417 -0
  126. package/lib/ProTable/proTableTypes.js +17 -0
  127. package/lib/ProTable/style/index.css +65 -0
  128. package/lib/ProTable/style/index.js +3 -0
  129. package/lib/ProTable/style/index.less +92 -0
  130. package/lib/Scrollbar/Bar.js +114 -0
  131. package/lib/Scrollbar/Scrollbar.js +212 -0
  132. package/lib/Scrollbar/Thumb.js +189 -0
  133. package/lib/Scrollbar/constants.js +7 -0
  134. package/lib/Scrollbar/index.js +9 -0
  135. package/{src/Scrollbar/scrollbar.ts → lib/Scrollbar/scrollbarProps.js} +106 -108
  136. package/lib/Scrollbar/thumbProps.js +16 -0
  137. package/lib/Scrollbar/util.js +37 -0
  138. package/lib/Search/Advanced/History.js +183 -0
  139. package/lib/Search/Advanced/SaveHistory.js +153 -0
  140. package/lib/Search/Advanced/index.js +520 -0
  141. package/lib/Search/Item.js +497 -0
  142. package/lib/Search/Search.js +249 -0
  143. package/lib/Search/hooks/index.js +16 -0
  144. package/lib/Search/hooks/useSearchItems.js +47 -0
  145. package/lib/Search/index.js +16 -0
  146. package/lib/Search/setting.js +97 -0
  147. package/lib/Search/style/Item.less +33 -0
  148. package/lib/Search/style/Search.less +179 -0
  149. package/lib/Search/style/index.js +4 -0
  150. package/lib/Search/typing.js +5 -0
  151. package/lib/Search/util.js +241 -0
  152. package/lib/ValueItem/ValueItem.js +233 -0
  153. package/lib/ValueItem/index.js +9 -0
  154. package/lib/ValueItem/util.js +22 -0
  155. package/lib/index.js +158 -0
  156. package/lib/style/components.less +1 -0
  157. package/lib/style/index.js +4 -0
  158. package/lib/style/variable.css +0 -0
  159. package/lib/style/variable.less +2 -0
  160. package/lib/style.js +5 -0
  161. package/package.json +122 -13
  162. package/index.ts +0 -64
  163. package/src/AMap/Map.vue +0 -110
  164. package/src/AMap/index.ts +0 -1
  165. package/src/AMap/util.ts +0 -56
  166. package/src/BadgeStatus/Badge.vue +0 -41
  167. package/src/BadgeStatus/color.ts +0 -25
  168. package/src/BadgeStatus/index.ts +0 -4
  169. package/src/CardSelect/CardSelect.vue +0 -136
  170. package/src/CardSelect/index.ts +0 -3
  171. package/src/CheckButton/CheckButton.vue +0 -146
  172. package/src/CheckButton/index.md +0 -27
  173. package/src/CheckButton/index.ts +0 -3
  174. package/src/ConfigProvider/context.ts +0 -17
  175. package/src/ConfigProvider/index.tsx +0 -42
  176. package/src/Echarts/Echarts.vue +0 -43
  177. package/src/Echarts/index.ts +0 -3
  178. package/src/Ellipsis/Ellipsis.vue +0 -182
  179. package/src/Ellipsis/index.ts +0 -3
  180. package/src/Empty/Empty.vue +0 -43
  181. package/src/Empty/image.ts +0 -3
  182. package/src/Empty/index.ts +0 -2
  183. package/src/FullPage/FullPage.vue +0 -30
  184. package/src/FullPage/index.ts +0 -3
  185. package/src/Icon/icon.tsx +0 -40
  186. package/src/MonacoEditor/Monaco.vue +0 -242
  187. package/src/MonacoEditor/index.md +0 -26
  188. package/src/MonacoEditor/index.ts +0 -2
  189. package/src/PermissionButton/index.tsx +0 -110
  190. package/src/ProLayout/Basic/BasicLayout.tsx +0 -392
  191. package/src/ProLayout/Basic/Header.tsx +0 -115
  192. package/src/ProLayout/PageContainer/index.tsx +0 -441
  193. package/src/ProLayout/PageContainer/typings.ts +0 -56
  194. package/src/ProLayout/RouteContext.ts +0 -87
  195. package/src/ProLayout/SiderMenu/BaseMenu.tsx +0 -296
  196. package/src/ProLayout/SiderMenu/SiderMenu.tsx +0 -320
  197. package/src/ProLayout/SiderMenu/index.ts +0 -2
  198. package/src/ProLayout/SiderMenu/typings.ts +0 -49
  199. package/src/ProLayout/TopHeader/index.tsx +0 -210
  200. package/src/ProLayout/defaultSettings.ts +0 -106
  201. package/src/ProLayout/style/index.ts +0 -1
  202. package/src/ProLayout/typings.ts +0 -87
  203. package/src/ProLayout/util.ts +0 -64
  204. package/src/ProTable/index.md +0 -53
  205. package/src/ProTable/index.tsx +0 -551
  206. package/src/ProTable/proTableTypes.ts +0 -70
  207. package/src/ProTable/style/index.ts +0 -1
  208. package/src/Scrollbar/Bar.vue +0 -75
  209. package/src/Scrollbar/Scrollbar.vue +0 -260
  210. package/src/Scrollbar/Thumb.vue +0 -163
  211. package/src/Scrollbar/constants.ts +0 -10
  212. package/src/Scrollbar/index.ts +0 -4
  213. package/src/Scrollbar/thumb.ts +0 -16
  214. package/src/Scrollbar/util.ts +0 -38
  215. package/src/Search/Advanced/History.vue +0 -140
  216. package/src/Search/Advanced/SaveHistory.vue +0 -108
  217. package/src/Search/Advanced/index.vue +0 -435
  218. package/src/Search/Item.vue +0 -525
  219. package/src/Search/Search.vue +0 -398
  220. package/src/Search/hooks/index.ts +0 -1
  221. package/src/Search/hooks/useSearchItems.ts +0 -68
  222. package/src/Search/index.md +0 -57
  223. package/src/Search/index.ts +0 -5
  224. package/src/Search/setting.ts +0 -55
  225. package/src/Search/typing.ts +0 -76
  226. package/src/Search/util.ts +0 -263
  227. package/src/ValueItem/ValueItem.vue +0 -192
  228. package/src/ValueItem/index.ts +0 -3
  229. package/src/ValueItem/util.ts +0 -16
  230. package/src/style/index.ts +0 -3
  231. /package/{src → es}/ProLayout/Basic/BasicLayout.less +0 -0
  232. /package/{src → es}/ProLayout/Basic/Header.less +0 -0
  233. /package/{src → es}/ProLayout/PageContainer/index.less +0 -0
  234. /package/{src → es}/ProLayout/SiderMenu/index.less +0 -0
  235. /package/{src → es}/ProLayout/TopHeader/index.less +0 -0
  236. /package/{src → es}/ProLayout/style/style.less +0 -0
  237. /package/{src → es}/ProTable/style/index.less +0 -0
package/es/AMap/Map.js ADDED
@@ -0,0 +1,124 @@
1
+ /* Analyzed bindings: {
2
+ "style": "props",
3
+ "class": "props",
4
+ "AMapUI": "props",
5
+ "center": "props",
6
+ "plugins": "props",
7
+ "zooms": "props",
8
+ "JSKey": "props",
9
+ "WebKey": "props",
10
+ "ref": "setup-const",
11
+ "computed": "setup-const",
12
+ "initAMapApiLoader": "setup-maybe-ref",
13
+ "ElAmap": "setup-maybe-ref",
14
+ "getAMapUiPromise": "setup-maybe-ref",
15
+ "MapProps": "setup-maybe-ref",
16
+ "MAPConfig": "setup-maybe-ref",
17
+ "Empty": "setup-maybe-ref",
18
+ "emit": "setup-const",
19
+ "props": "setup-reactive-const",
20
+ "config": "setup-maybe-ref",
21
+ "_mapStyle": "setup-ref",
22
+ "hasAMapKey": "setup-ref",
23
+ "uiLoading": "setup-ref",
24
+ "map": "setup-ref",
25
+ "isOpenUi": "setup-ref",
26
+ "getAMapUI": "setup-const",
27
+ "initMap": "setup-const"
28
+ } */
29
+ import { defineComponent as _defineComponent } from 'vue';
30
+ import { renderSlot as _renderSlot, unref as _unref, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from "vue";
31
+ import { ref, computed } from 'vue';
32
+ import { initAMapApiLoader, ElAmap } from '@vuemap/vue-amap';
33
+ import { getAMapUiPromise } from '@jetlinks-web/utils';
34
+ import { MapProps } from './util';
35
+ import { MAPConfig } from "@jetlinks-web/constants";
36
+ import Empty from '../Empty';
37
+ import '@vuemap/vue-amap/dist/style.css';
38
+ const __sfc_main__ = _defineComponent({
39
+ props: {
40
+ ...MapProps(),
41
+ style: Object,
42
+ class: String,
43
+ AMapUI: [String, Boolean],
44
+ center: Array,
45
+ plugins: Array,
46
+ zooms: {
47
+ type: Array,
48
+ default: [3, 20]
49
+ },
50
+ JSKey: String,
51
+ WebKey: String,
52
+ },
53
+ emits: [
54
+ 'initMap',
55
+ ],
56
+ setup(__props, { emit: __emit }) {
57
+ const emit = __emit;
58
+ const props = __props;
59
+ const config = inject(MAPConfig);
60
+ const _mapStyle = computed(() => {
61
+ if (props.mapStyle) {
62
+ return `amap://styles/${props.mapStyle}`;
63
+ }
64
+ if (config.mapStyle) {
65
+ return config.mapStyle;
66
+ }
67
+ return undefined;
68
+ });
69
+ const hasAMapKey = computed(() => {
70
+ return !!(props.JSKey || config.JSKey);
71
+ });
72
+ initAMapApiLoader({
73
+ key: props.JSKey || config.JSKey || '',
74
+ securityJsCode: props.WebKey || config.WebKey,
75
+ plugins: props.plugins
76
+ });
77
+ const uiLoading = ref(false);
78
+ const map = ref(null);
79
+ const isOpenUi = computed(() => {
80
+ return 'AMapUI' in props || props.AMapUI;
81
+ });
82
+ const getAMapUI = () => {
83
+ const version = typeof props.AMapUI === 'string' ? props.AMapUI : '1.1';
84
+ getAMapUiPromise(version).then(() => {
85
+ uiLoading.value = true;
86
+ });
87
+ };
88
+ const initMap = (e) => {
89
+ map.value = e;
90
+ emit('initMap', e);
91
+ if (isOpenUi.value) {
92
+ getAMapUI();
93
+ }
94
+ };
95
+ return (_ctx, _cache) => {
96
+ return (_openBlock(), _createElementBlock("div", {
97
+ style: _normalizeStyle(props.style || { width: '100%', height: '100%' }),
98
+ class: _normalizeClass(props.class)
99
+ }, [
100
+ (hasAMapKey.value)
101
+ ? (_openBlock(), _createBlock(_unref(ElAmap), _mergeProps({
102
+ key: 0,
103
+ "map-style": _mapStyle.value
104
+ }, {
105
+ ...props,
106
+ ..._ctx.$attrs
107
+ }, { onInit: initMap }), {
108
+ default: _withCtx(() => [
109
+ (uiLoading.value)
110
+ ? _renderSlot(_ctx.$slots, "default", { key: 0 })
111
+ : _renderSlot(_ctx.$slots, "default", { key: 1 })
112
+ ]),
113
+ _: 3 /* FORWARDED */
114
+ }, 16 /* FULL_PROPS */, ["map-style"]))
115
+ : (_openBlock(), _createBlock(_unref(Empty), {
116
+ key: 1,
117
+ description: "请配置高德地图key",
118
+ style: { "padding": "20%" }
119
+ }))
120
+ ], 6 /* CLASS, STYLE */));
121
+ };
122
+ }
123
+ });
124
+ export default __sfc_main__;
@@ -0,0 +1,2 @@
1
+ import Map from './Map.js';
2
+ export default Map;
@@ -0,0 +1,56 @@
1
+ export var MapProps = function MapProps() {
2
+ return {
3
+ // 响应式
4
+ center: Array,
5
+ labelzIndex: Number,
6
+ lang: String,
7
+ mapStyle: String,
8
+ // 静态属性
9
+ vid: String,
10
+ amapManager: Object,
11
+ defaultCursor: String,
12
+ animateEnable: {
13
+ type: Boolean,
14
+ default: true
15
+ },
16
+ isHotspot: Boolean,
17
+ rotateEnable: {
18
+ type: Boolean,
19
+ default: true
20
+ },
21
+ resizeEnable: {
22
+ type: Boolean,
23
+ default: true
24
+ },
25
+ showIndoorMap: Boolean,
26
+ expandZoomRange: Boolean,
27
+ dragEnable: {
28
+ type: Boolean,
29
+ default: true
30
+ },
31
+ zoomEnable: {
32
+ type: Boolean,
33
+ default: true
34
+ },
35
+ doubleClickZoom: {
36
+ type: Boolean,
37
+ default: true
38
+ },
39
+ keyboardEnable: {
40
+ type: Boolean,
41
+ default: true
42
+ },
43
+ jogEnable: {
44
+ type: Boolean,
45
+ default: true
46
+ },
47
+ scrollWheel: {
48
+ type: Boolean,
49
+ default: true
50
+ },
51
+ touchZoom: {
52
+ type: Boolean,
53
+ default: true
54
+ }
55
+ };
56
+ };
@@ -0,0 +1,54 @@
1
+ /* Analyzed bindings: {
2
+ "text": "props",
3
+ "status": "props",
4
+ "statusNames": "props",
5
+ "computed": "setup-const",
6
+ "getHexColor": "setup-maybe-ref",
7
+ "props": "setup-reactive-const",
8
+ "_color": "setup-ref"
9
+ } */
10
+ import { defineComponent as _defineComponent } from 'vue';
11
+ import { resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock } from "vue";
12
+ import { computed } from 'vue';
13
+ import { getHexColor } from './color';
14
+ const __sfc_main__ = _defineComponent({
15
+ props: {
16
+ text: {
17
+ type: String,
18
+ },
19
+ status: {
20
+ type: [String, Number],
21
+ default: 'default',
22
+ },
23
+ /**
24
+ * 自定义status值颜色
25
+ * @example {
26
+ * 1: 'success',
27
+ * 0: 'error'
28
+ * }
29
+ */
30
+ statusNames: {
31
+ type: Object,
32
+ default: () => ({
33
+ 'success': 'success',
34
+ 'warning': 'warning',
35
+ 'error': 'error',
36
+ 'default': 'default',
37
+ })
38
+ },
39
+ },
40
+ setup(__props) {
41
+ const props = __props;
42
+ const _color = computed(() => {
43
+ return getHexColor(props.status, props.statusNames, 1);
44
+ });
45
+ return (_ctx, _cache) => {
46
+ const _component_a_badge = _resolveComponent("a-badge");
47
+ return (_openBlock(), _createBlock(_component_a_badge, {
48
+ color: _color.value,
49
+ text: __props.text
50
+ }, null, 8 /* PROPS */, ["color", "text"]));
51
+ };
52
+ }
53
+ });
54
+ export default __sfc_main__;
@@ -0,0 +1,21 @@
1
+ var colorMap = {
2
+ 'success': '36, 178, 118',
3
+ 'warning': '255, 144, 0',
4
+ 'error': '229, 0, 18',
5
+ 'processing': '9, 46, 231',
6
+ 'default': '102, 102, 102'
7
+ };
8
+ export var getHexColor = function getHexColor(code, statusNames) {
9
+ var pe = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.1;
10
+ if (!code) {
11
+ return "rgba(102, 102, 102, ".concat(pe, ")");
12
+ }
13
+ if (colorMap[code]) {
14
+ return "rgba(".concat(colorMap[code], ", ").concat(pe, ")");
15
+ }
16
+ if (Object.keys(statusNames).length) {
17
+ return statusNames[code];
18
+ }
19
+ return;
20
+ };
21
+ export default colorMap;
@@ -0,0 +1,3 @@
1
+ import BadgeStatus from './Badge.js';
2
+ export * from './color';
3
+ export default BadgeStatus;
@@ -0,0 +1,123 @@
1
+ /* Analyzed bindings: {
2
+ "layout": "props",
3
+ "options": "props",
4
+ "disabled": "props",
5
+ "multiple": "props",
6
+ "column": "props",
7
+ "value": "props",
8
+ "itemLayout": "props",
9
+ "has": "setup-maybe-ref",
10
+ "props": "setup-reactive-const",
11
+ "emit": "setup-const",
12
+ "selectKeys": "setup-maybe-ref",
13
+ "CardSelectStyle": "setup-maybe-ref",
14
+ "isMultiple": "setup-maybe-ref",
15
+ "handleSelect": "setup-const"
16
+ } */
17
+ import { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle } from "vue";
18
+ const _hoisted_1 = ["onClick"];
19
+ const _hoisted_2 = { class: "j-card-select-item-content" };
20
+ const _hoisted_3 = { class: "j-card-select-title" };
21
+ const _hoisted_4 = { class: "j-card-select-describe" };
22
+ import { has } from 'lodash-es';
23
+ const __sfc_main__ = {
24
+ props: {
25
+ layout: {
26
+ type: String,
27
+ default: 'horizontal'
28
+ },
29
+ options: {
30
+ type: Array,
31
+ default: () => [],
32
+ },
33
+ disabled: {
34
+ type: Boolean,
35
+ default: false,
36
+ },
37
+ multiple: {
38
+ type: Boolean,
39
+ default: false,
40
+ },
41
+ column: {
42
+ type: Number,
43
+ default: 3,
44
+ },
45
+ value: {
46
+ type: [String, Array],
47
+ default: undefined,
48
+ },
49
+ itemLayout: {
50
+ type: String,
51
+ default: 'horizontal'
52
+ }
53
+ },
54
+ emits: ['select', 'change', 'update:value'],
55
+ setup(__props, { emit: __emit }) {
56
+ const props = __props;
57
+ const emit = __emit;
58
+ const selectKeys = ref([]);
59
+ const CardSelectStyle = computed(() => {
60
+ const _column = props.column > 0 && props.layout === 'horizontal' ? props.column : 1;
61
+ return {
62
+ 'grid-template-columns': `repeat(${_column}, 1fr)`
63
+ };
64
+ });
65
+ const isMultiple = computed(() => {
66
+ return has(props, 'multiple') && props.multiple !== false;
67
+ });
68
+ const handleSelect = (key, node) => {
69
+ if (props.disabled || node.disabled) {
70
+ return;
71
+ }
72
+ const selectKeysSet = new Set(selectKeys.value);
73
+ const isActive = selectKeysSet.has(key);
74
+ if (isMultiple.value) {
75
+ if (isActive) {
76
+ selectKeysSet.delete(key);
77
+ }
78
+ else {
79
+ selectKeysSet.add(key);
80
+ }
81
+ selectKeys.value = [...selectKeysSet.values()];
82
+ const nodes = props.options.filter(item => selectKeys.value.includes(item.value));
83
+ emit('select', selectKeys.value, nodes);
84
+ emit('change', selectKeys.value, nodes);
85
+ emit('update:value', selectKeys.value);
86
+ }
87
+ else {
88
+ selectKeys.value = [key];
89
+ emit('select', key, node);
90
+ emit('change', key, node);
91
+ emit('update:value', key);
92
+ }
93
+ };
94
+ watch(() => props.value, () => {
95
+ selectKeys.value = isMultiple.value ? props.value : [props.value];
96
+ }, { immediate: true });
97
+ return (_ctx, _cache) => {
98
+ return (_openBlock(), _createElementBlock("div", {
99
+ class: "j-card-select",
100
+ style: _normalizeStyle(_unref(CardSelectStyle))
101
+ }, [
102
+ (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.options, (item) => {
103
+ return (_openBlock(), _createElementBlock("div", {
104
+ class: _normalizeClass({
105
+ 'j-card-select-item': true,
106
+ 'disabled': __props.disabled || item.disabled,
107
+ 'active': _unref(selectKeys).includes(item.value)
108
+ }),
109
+ onClick: () => handleSelect(item.value, item)
110
+ }, [
111
+ _renderSlot(_ctx.$slots, "itemRender", { node: item }, () => [
112
+ _createElementVNode("div", _hoisted_2, [
113
+ _createElementVNode("div", _hoisted_3, _toDisplayString(item.label), 1 /* TEXT */),
114
+ _createElementVNode("div", _hoisted_4, _toDisplayString(item.describe), 1 /* TEXT */)
115
+ ])
116
+ ])
117
+ ], 10 /* CLASS, PROPS */, _hoisted_1));
118
+ }), 256 /* UNKEYED_FRAGMENT */))
119
+ ], 4 /* STYLE */));
120
+ };
121
+ }
122
+ };
123
+ export default __sfc_main__;
@@ -0,0 +1,2 @@
1
+ import CardSelect from "./CardSelect.js";
2
+ export default CardSelect;
@@ -0,0 +1,121 @@
1
+ /* Analyzed bindings: {
2
+ "value": "props",
3
+ "options": "props",
4
+ "multiple": "props",
5
+ "disabled": "props",
6
+ "class": "props",
7
+ "style": "props",
8
+ "computed": "setup-const",
9
+ "CSSProperties": "setup-const",
10
+ "PropType": "setup-const",
11
+ "ref": "setup-const",
12
+ "watch": "setup-const",
13
+ "isArray": "setup-maybe-ref",
14
+ "props": "setup-reactive-const",
15
+ "emit": "setup-const",
16
+ "myValue": "setup-ref",
17
+ "optionsMap": "setup-ref",
18
+ "_options": "setup-ref",
19
+ "selected": "setup-const"
20
+ } */
21
+ import { defineComponent as _defineComponent } from 'vue';
22
+ import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
23
+ const _withScopeId = n => (_pushScopeId("data-v-1712546546166"), n = n(), _popScopeId(), n);
24
+ const _hoisted_1 = ["onClick"];
25
+ import { computed, ref, watch } from 'vue';
26
+ import { isArray } from '@jetlinks-web/utils';
27
+ const __sfc_main__ = _defineComponent({
28
+ props: {
29
+ value: {
30
+ type: [String, Array],
31
+ default: undefined,
32
+ },
33
+ options: {
34
+ type: Array,
35
+ default: () => [],
36
+ },
37
+ multiple: {
38
+ type: Boolean,
39
+ default: false,
40
+ },
41
+ disabled: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
45
+ class: {
46
+ type: String,
47
+ default: undefined,
48
+ },
49
+ style: {
50
+ type: Object,
51
+ default: () => ({}),
52
+ },
53
+ },
54
+ emits: ['update:value', 'change', 'select'],
55
+ setup(__props, { emit: __emit }) {
56
+ const props = __props;
57
+ const emit = __emit;
58
+ const myValue = ref();
59
+ const optionsMap = ref(new Map());
60
+ const _options = computed(() => {
61
+ props.options.forEach((item) => {
62
+ if (props.disabled) {
63
+ item.display = props.disabled;
64
+ }
65
+ optionsMap.value.set(item.value, item);
66
+ });
67
+ return props.options;
68
+ });
69
+ watch(() => props.value, () => {
70
+ if (props.value) {
71
+ myValue.value = isArray(props.value) ? props.value : [props.value];
72
+ }
73
+ else {
74
+ myValue.value = [];
75
+ }
76
+ }, { immediate: true, deep: true });
77
+ const selected = (key, disabled) => {
78
+ if (disabled)
79
+ return;
80
+ const values = new Set(myValue.value);
81
+ if (values.has(key)) {
82
+ values.delete(key);
83
+ }
84
+ else {
85
+ if (!props.multiple) {
86
+ values.clear();
87
+ }
88
+ values.add(key);
89
+ }
90
+ myValue.value = [...values.values()];
91
+ const optionsItems = myValue.value.map((_key) => {
92
+ return optionsMap.value.get(_key);
93
+ });
94
+ const _value = props.multiple ? myValue.value : myValue.value[0];
95
+ emit('update:value', _value);
96
+ emit('change', _value, props.multiple ? optionsItems : optionsItems[0]);
97
+ emit('select', _value, props.multiple ? optionsItems : optionsItems[0]);
98
+ };
99
+ return (_ctx, _cache) => {
100
+ return (_openBlock(), _createElementBlock("div", {
101
+ class: _normalizeClass(['j-check-button', props.class]),
102
+ style: _normalizeStyle(__props.style)
103
+ }, [
104
+ (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_options.value, (item) => {
105
+ return (_openBlock(), _createElementBlock("div", {
106
+ key: item.value,
107
+ class: _normalizeClass([
108
+ 'j-check-button-item',
109
+ myValue.value.includes(item.value) ? 'selected' : '',
110
+ item.disabled ? 'disabled' : '',
111
+ ]),
112
+ onClick: () => {
113
+ selected(item.value, item.disabled);
114
+ }
115
+ }, _toDisplayString(item.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_1));
116
+ }), 128 /* KEYED_FRAGMENT */))
117
+ ], 6 /* CLASS, STYLE */));
118
+ };
119
+ }
120
+ });
121
+ export default __sfc_main__;
@@ -0,0 +1,2 @@
1
+ import CheckButton from './CheckButton.js';
2
+ export default CheckButton;
@@ -0,0 +1,12 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import { configProviderProps } from 'ant-design-vue/es/config-provider/context';
3
+ export var configProps = function configProps() {
4
+ return _objectSpread(_objectSpread({}, configProviderProps()), {}, {
5
+ IconConfig: {
6
+ type: Object
7
+ },
8
+ MapConfig: {
9
+ type: Object
10
+ }
11
+ });
12
+ };
@@ -0,0 +1,31 @@
1
+ import { createVNode as _createVNode } from "vue";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import { defineComponent, provide, reactive, h } from 'vue';
4
+ import { configProps } from './context';
5
+ import { ComponentsEnum, MAPConfig } from '@jetlinks-web/constants';
6
+ import { ConfigProvider } from 'ant-design-vue';
7
+ import { omit } from 'lodash-es';
8
+ import Empty from '../Empty';
9
+ var JConfigProvider = defineComponent({
10
+ name: 'JConfigProvider',
11
+ inheritAttrs: false,
12
+ props: _objectSpread({}, configProps()),
13
+ setup: function setup(props, _ref) {
14
+ var slots = _ref.slots;
15
+ var _iconConfig = reactive(props.IconConfig || {});
16
+ var _mapConfig = reactive(props.MapConfig || {});
17
+ provide(ComponentsEnum.Icon, _iconConfig); // 全局Icon 配置
18
+ provide(MAPConfig, _mapConfig); // 全局地图配置
19
+ return function () {
20
+ return h(ConfigProvider, _objectSpread({}, omit(props, ['IconConfig', 'MapConfig'])), {
21
+ default: slots.default,
22
+ renderEmpty: function renderEmpty() {
23
+ var _slots$renderEmpty;
24
+ return ((_slots$renderEmpty = slots.renderEmpty) === null || _slots$renderEmpty === void 0 ? void 0 : _slots$renderEmpty.call(slots)) || _createVNode(Empty, null, null);
25
+ }
26
+ });
27
+ };
28
+ }
29
+ });
30
+ JConfigProvider.config = ConfigProvider.config;
31
+ export default JConfigProvider;
@@ -0,0 +1,47 @@
1
+ /* Analyzed bindings: {
2
+ "options": "props",
3
+ "style": "props",
4
+ "CSSProperties": "setup-const",
5
+ "nextTick": "setup-const",
6
+ "ref": "setup-const",
7
+ "watch": "setup-const",
8
+ "Ref": "setup-const",
9
+ "useECharts": "setup-maybe-ref",
10
+ "props": "setup-reactive-const",
11
+ "echartsDom": "setup-ref",
12
+ "setOptions": "setup-maybe-ref"
13
+ } */
14
+ import { defineComponent as _defineComponent } from 'vue';
15
+ import { normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
16
+ import { nextTick, ref, watch, } from 'vue';
17
+ import { useECharts } from '@jetlinks-web/hooks';
18
+ const __sfc_main__ = _defineComponent({
19
+ props: {
20
+ options: {
21
+ type: Object,
22
+ default: undefined,
23
+ },
24
+ style: Object,
25
+ },
26
+ setup(__props) {
27
+ const props = __props;
28
+ const echartsDom = ref();
29
+ const { setOptions } = useECharts(echartsDom.value);
30
+ watch(() => JSON.stringify(props.options), () => {
31
+ if (props.options) {
32
+ nextTick(() => {
33
+ setOptions(props.options);
34
+ });
35
+ }
36
+ }, { immediate: true });
37
+ return (_ctx, _cache) => {
38
+ return (_openBlock(), _createElementBlock("div", {
39
+ ref_key: "echartsDom",
40
+ ref: echartsDom,
41
+ class: "echarts-warp",
42
+ style: _normalizeStyle(__props.style)
43
+ }, null, 4 /* STYLE */));
44
+ };
45
+ }
46
+ });
47
+ export default __sfc_main__;
@@ -0,0 +1,2 @@
1
+ import Echarts from './Echarts.js';
2
+ export default Echarts;