@jetlinks-web/components 2.0.2-2 → 2.0.2-5

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 (227) 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 +43 -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 +255 -0
  28. package/es/ProLayout/Basic/Header.js +93 -0
  29. package/es/ProLayout/PageContainer/index.js +318 -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 +262 -0
  33. package/es/ProLayout/SiderMenu/SiderMenu.js +258 -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 +155 -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 +406 -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 +10 -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/util.js +30 -0
  54. package/es/Search/Advanced/History.js +183 -0
  55. package/es/Search/Advanced/SaveHistory.js +153 -0
  56. package/es/Search/Advanced/index.js +520 -0
  57. package/es/Search/Item.js +497 -0
  58. package/es/Search/Search.js +249 -0
  59. package/es/Search/hooks/index.js +1 -0
  60. package/es/Search/hooks/useSearchItems.js +40 -0
  61. package/es/Search/index.js +4 -0
  62. package/es/Search/setting.js +91 -0
  63. package/es/Search/typing.js +1 -0
  64. package/es/Search/util.js +234 -0
  65. package/es/ValueItem/ValueItem.js +233 -0
  66. package/es/ValueItem/index.js +2 -0
  67. package/es/ValueItem/util.js +16 -0
  68. package/es/index.js +24 -0
  69. package/es/style/index.js +3 -0
  70. package/es/style/variable.css +0 -0
  71. package/{src → es}/style/variable.less +0 -2
  72. package/lib/AMap/Map.js +124 -0
  73. package/lib/AMap/index.js +9 -0
  74. package/lib/AMap/util.js +62 -0
  75. package/lib/BadgeStatus/Badge.js +54 -0
  76. package/lib/BadgeStatus/color.js +27 -0
  77. package/lib/BadgeStatus/index.js +22 -0
  78. package/lib/CardSelect/CardSelect.js +123 -0
  79. package/lib/CardSelect/index.js +9 -0
  80. package/lib/CheckButton/CheckButton.js +121 -0
  81. package/lib/CheckButton/index.js +9 -0
  82. package/lib/ConfigProvider/context.js +19 -0
  83. package/lib/ConfigProvider/index.js +37 -0
  84. package/lib/Echarts/Echarts.js +47 -0
  85. package/lib/Echarts/index.js +9 -0
  86. package/lib/Ellipsis/Ellipsis.js +189 -0
  87. package/lib/Ellipsis/index.js +9 -0
  88. package/lib/Empty/Empty.js +56 -0
  89. package/lib/Empty/image.js +8 -0
  90. package/lib/Empty/index.js +9 -0
  91. package/lib/FullPage/FullPage.js +31 -0
  92. package/lib/FullPage/index.js +9 -0
  93. package/lib/Icon/icon.js +52 -0
  94. package/lib/Icon/index.js +9 -0
  95. package/lib/MonacoEditor/Monaco.js +238 -0
  96. package/lib/MonacoEditor/index.js +9 -0
  97. package/lib/PermissionButton/index.js +124 -0
  98. package/lib/ProLayout/Basic/BasicLayout.js +264 -0
  99. package/lib/ProLayout/Basic/BasicLayout.less +66 -0
  100. package/lib/ProLayout/Basic/Header.js +99 -0
  101. package/lib/ProLayout/Basic/Header.less +8 -0
  102. package/lib/ProLayout/PageContainer/index.js +323 -0
  103. package/lib/ProLayout/PageContainer/index.less +103 -0
  104. package/lib/ProLayout/PageContainer/typings.js +5 -0
  105. package/lib/ProLayout/RouteContext.js +28 -0
  106. package/lib/ProLayout/SiderMenu/BaseMenu.js +268 -0
  107. package/lib/ProLayout/SiderMenu/SiderMenu.js +267 -0
  108. package/lib/ProLayout/SiderMenu/index.js +20 -0
  109. package/lib/ProLayout/SiderMenu/index.less +212 -0
  110. package/lib/ProLayout/SiderMenu/typings.js +5 -0
  111. package/lib/ProLayout/TopHeader/index.js +161 -0
  112. package/lib/ProLayout/TopHeader/index.less +174 -0
  113. package/lib/ProLayout/defaultSettings.js +72 -0
  114. package/lib/ProLayout/index.js +16 -0
  115. package/lib/ProLayout/style/default.less +4 -0
  116. package/lib/ProLayout/style/index.js +3 -0
  117. package/lib/ProLayout/style/style.less +7 -0
  118. package/lib/ProLayout/typings.js +5 -0
  119. package/lib/ProLayout/util.js +72 -0
  120. package/lib/ProTable/index.js +412 -0
  121. package/lib/ProTable/proTableTypes.js +17 -0
  122. package/lib/ProTable/style/index.css +65 -0
  123. package/lib/ProTable/style/index.js +3 -0
  124. package/lib/ProTable/style/index.less +92 -0
  125. package/lib/Scrollbar/Bar.js +114 -0
  126. package/lib/Scrollbar/Scrollbar.js +212 -0
  127. package/lib/Scrollbar/Thumb.js +16 -0
  128. package/lib/Scrollbar/constants.js +7 -0
  129. package/lib/Scrollbar/index.js +9 -0
  130. package/{src/Scrollbar/scrollbar.ts → lib/Scrollbar/scrollbarProps.js} +106 -108
  131. package/lib/Scrollbar/util.js +37 -0
  132. package/lib/Search/Advanced/History.js +183 -0
  133. package/lib/Search/Advanced/SaveHistory.js +153 -0
  134. package/lib/Search/Advanced/index.js +520 -0
  135. package/lib/Search/Item.js +497 -0
  136. package/lib/Search/Search.js +249 -0
  137. package/lib/Search/hooks/index.js +16 -0
  138. package/lib/Search/hooks/useSearchItems.js +47 -0
  139. package/lib/Search/index.js +16 -0
  140. package/lib/Search/setting.js +97 -0
  141. package/lib/Search/typing.js +5 -0
  142. package/lib/Search/util.js +241 -0
  143. package/lib/ValueItem/ValueItem.js +233 -0
  144. package/lib/ValueItem/index.js +9 -0
  145. package/lib/ValueItem/util.js +22 -0
  146. package/lib/index.js +158 -0
  147. package/lib/style/components.less +1 -0
  148. package/lib/style/index.js +4 -0
  149. package/lib/style/variable.css +0 -0
  150. package/lib/style/variable.less +2 -0
  151. package/package.json +120 -11
  152. package/index.ts +0 -64
  153. package/src/AMap/Map.vue +0 -110
  154. package/src/AMap/index.ts +0 -1
  155. package/src/AMap/util.ts +0 -56
  156. package/src/BadgeStatus/Badge.vue +0 -41
  157. package/src/BadgeStatus/color.ts +0 -25
  158. package/src/BadgeStatus/index.ts +0 -4
  159. package/src/CardSelect/CardSelect.vue +0 -136
  160. package/src/CardSelect/index.ts +0 -3
  161. package/src/CheckButton/CheckButton.vue +0 -146
  162. package/src/CheckButton/index.md +0 -27
  163. package/src/CheckButton/index.ts +0 -3
  164. package/src/ConfigProvider/context.ts +0 -17
  165. package/src/ConfigProvider/index.tsx +0 -40
  166. package/src/Echarts/Echarts.vue +0 -43
  167. package/src/Echarts/index.ts +0 -3
  168. package/src/Ellipsis/Ellipsis.vue +0 -182
  169. package/src/Ellipsis/index.ts +0 -3
  170. package/src/Empty/Empty.vue +0 -43
  171. package/src/Empty/image.ts +0 -3
  172. package/src/Empty/index.ts +0 -2
  173. package/src/FullPage/FullPage.vue +0 -30
  174. package/src/FullPage/index.ts +0 -3
  175. package/src/Icon/icon.tsx +0 -40
  176. package/src/MonacoEditor/Monaco.vue +0 -242
  177. package/src/MonacoEditor/index.md +0 -26
  178. package/src/MonacoEditor/index.ts +0 -2
  179. package/src/PermissionButton/index.tsx +0 -110
  180. package/src/ProLayout/Basic/BasicLayout.tsx +0 -395
  181. package/src/ProLayout/Basic/Header.tsx +0 -115
  182. package/src/ProLayout/PageContainer/index.tsx +0 -441
  183. package/src/ProLayout/PageContainer/typings.ts +0 -56
  184. package/src/ProLayout/RouteContext.ts +0 -87
  185. package/src/ProLayout/SiderMenu/BaseMenu.tsx +0 -296
  186. package/src/ProLayout/SiderMenu/SiderMenu.tsx +0 -320
  187. package/src/ProLayout/SiderMenu/index.ts +0 -2
  188. package/src/ProLayout/SiderMenu/typings.ts +0 -49
  189. package/src/ProLayout/TopHeader/index.tsx +0 -210
  190. package/src/ProLayout/defaultSettings.ts +0 -106
  191. package/src/ProLayout/style/index.ts +0 -1
  192. package/src/ProLayout/typings.ts +0 -87
  193. package/src/ProLayout/util.ts +0 -64
  194. package/src/ProTable/index.md +0 -53
  195. package/src/ProTable/index.tsx +0 -551
  196. package/src/ProTable/proTableTypes.ts +0 -70
  197. package/src/ProTable/style/index.ts +0 -1
  198. package/src/Scrollbar/Bar.vue +0 -75
  199. package/src/Scrollbar/Scrollbar.vue +0 -260
  200. package/src/Scrollbar/Thumb.vue +0 -163
  201. package/src/Scrollbar/constants.ts +0 -10
  202. package/src/Scrollbar/index.ts +0 -4
  203. package/src/Scrollbar/thumb.ts +0 -16
  204. package/src/Scrollbar/util.ts +0 -38
  205. package/src/Search/Advanced/History.vue +0 -140
  206. package/src/Search/Advanced/SaveHistory.vue +0 -108
  207. package/src/Search/Advanced/index.vue +0 -435
  208. package/src/Search/Item.vue +0 -525
  209. package/src/Search/Search.vue +0 -398
  210. package/src/Search/hooks/index.ts +0 -1
  211. package/src/Search/hooks/useSearchItems.ts +0 -68
  212. package/src/Search/index.md +0 -57
  213. package/src/Search/index.ts +0 -5
  214. package/src/Search/setting.ts +0 -55
  215. package/src/Search/typing.ts +0 -76
  216. package/src/Search/util.ts +0 -263
  217. package/src/ValueItem/ValueItem.vue +0 -192
  218. package/src/ValueItem/index.ts +0 -3
  219. package/src/ValueItem/util.ts +0 -16
  220. package/src/style/index.ts +0 -3
  221. /package/{src → es}/ProLayout/Basic/BasicLayout.less +0 -0
  222. /package/{src → es}/ProLayout/Basic/Header.less +0 -0
  223. /package/{src → es}/ProLayout/PageContainer/index.less +0 -0
  224. /package/{src → es}/ProLayout/SiderMenu/index.less +0 -0
  225. /package/{src → es}/ProLayout/TopHeader/index.less +0 -0
  226. /package/{src → es}/ProLayout/style/style.less +0 -0
  227. /package/{src → es}/ProTable/style/index.less +0 -0
@@ -0,0 +1,189 @@
1
+ /* Analyzed bindings: {
2
+ "expandTrigger": "props",
3
+ "lineClamp": "props",
4
+ "tooltip": "props",
5
+ "Tooltip": "setup-maybe-ref",
6
+ "computed": "setup-const",
7
+ "mergeProps": "setup-const",
8
+ "ref": "setup-const",
9
+ "useAttrs": "setup-const",
10
+ "props": "setup-reactive-const",
11
+ "jEllipsis": "literal-const",
12
+ "jEllipsisCursorClass": "literal-const",
13
+ "jEllipsisLineClampClass": "literal-const",
14
+ "expandedRef": "setup-ref",
15
+ "tooltipRef": "setup-ref",
16
+ "triggerRef": "setup-ref",
17
+ "visible": "setup-ref",
18
+ "attrs": "setup-maybe-ref",
19
+ "handleClickRef": "setup-ref",
20
+ "triggerAttrs": "setup-const",
21
+ "showTooltip": "setup-const",
22
+ "ellipsisStyleRef": "setup-ref",
23
+ "syncEllipsisStyle": "setup-const",
24
+ "syncTriggerClass": "setup-const",
25
+ "syncCursorStyle": "setup-const",
26
+ "getTooltipDisabled": "setup-const"
27
+ } */
28
+ import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, createElementVNode as _createElementVNode, unref as _unref, withCtx as _withCtx, createBlock as _createBlock } from "vue";
29
+ import { Tooltip } from 'ant-design-vue';
30
+ import { computed, mergeProps, ref, useAttrs } from 'vue';
31
+ const jEllipsis = 'j-ellipsis';
32
+ const jEllipsisCursorClass = 'j-ellipsis-cursor';
33
+ const jEllipsisLineClampClass = 'j-ellipsis-line-clamp';
34
+ const __sfc_main__ = Object.assign({
35
+ name: 'Ellipsis',
36
+ }, {
37
+ props: {
38
+ expandTrigger: {
39
+ type: String,
40
+ default: undefined,
41
+ },
42
+ /** multiline ellipsis */
43
+ lineClamp: {
44
+ type: [Number, String],
45
+ default: 1,
46
+ },
47
+ tooltip: {
48
+ type: [Boolean, Object],
49
+ default: true,
50
+ },
51
+ },
52
+ setup(__props) {
53
+ const props = __props;
54
+ // define class name
55
+ const expandedRef = ref(false);
56
+ const tooltipRef = ref(null);
57
+ const triggerRef = ref(null);
58
+ const visible = ref(false);
59
+ const attrs = useAttrs();
60
+ const handleClickRef = computed(() => {
61
+ return props.expandTrigger === 'click'
62
+ ? () => {
63
+ const { value: expanded } = expandedRef;
64
+ expandedRef.value = !expanded;
65
+ }
66
+ : undefined;
67
+ });
68
+ function triggerAttrs() {
69
+ return {
70
+ ...mergeProps(attrs, {
71
+ class: [
72
+ jEllipsis,
73
+ props.lineClamp !== undefined ? jEllipsisLineClampClass : undefined,
74
+ props.expandTrigger === 'click' ? jEllipsisCursorClass : undefined,
75
+ ],
76
+ style: ellipsisStyleRef.value,
77
+ }),
78
+ };
79
+ }
80
+ const showTooltip = () => {
81
+ const { value: trigger } = triggerRef;
82
+ if (trigger) {
83
+ visible.value = trigger.scrollHeight > trigger.offsetHeight;
84
+ }
85
+ };
86
+ const ellipsisStyleRef = computed(() => {
87
+ const { lineClamp } = props;
88
+ const { value: expanded } = expandedRef;
89
+ if (lineClamp !== undefined) {
90
+ return {
91
+ textOverflow: '',
92
+ '-webkit-line-clamp': expanded ? '' : lineClamp,
93
+ };
94
+ }
95
+ else {
96
+ return {
97
+ textOverflow: expanded ? '' : 'ellipsis',
98
+ '-webkit-line-clamp': '',
99
+ };
100
+ }
101
+ });
102
+ const syncEllipsisStyle = (trigger) => {
103
+ if (!trigger)
104
+ return;
105
+ const latestStyle = ellipsisStyleRef.value;
106
+ const lineClampClass = jEllipsisLineClampClass;
107
+ if (props.lineClamp !== undefined) {
108
+ syncTriggerClass(trigger, lineClampClass, 'add');
109
+ }
110
+ else {
111
+ syncTriggerClass(trigger, lineClampClass, 'remove');
112
+ }
113
+ for (const key in latestStyle) {
114
+ if (trigger.style[key] !== latestStyle[key]) {
115
+ trigger.style[key] = latestStyle[key];
116
+ }
117
+ }
118
+ };
119
+ const syncTriggerClass = (trigger, styleClass, action) => {
120
+ if (action === 'add') {
121
+ if (!trigger.classList.contains(styleClass)) {
122
+ trigger.classList.add(styleClass);
123
+ }
124
+ }
125
+ else {
126
+ if (trigger.classList.contains(styleClass)) {
127
+ trigger.classList.remove(styleClass);
128
+ }
129
+ }
130
+ };
131
+ const syncCursorStyle = (trigger, tooltipDisabled) => {
132
+ if (props.expandTrigger === 'click' && !tooltipDisabled) {
133
+ syncTriggerClass(trigger, jEllipsisCursorClass, 'add');
134
+ }
135
+ else {
136
+ syncTriggerClass(trigger, jEllipsisCursorClass, 'remove');
137
+ }
138
+ };
139
+ const getTooltipDisabled = () => {
140
+ let tooltipDisabled = false;
141
+ const { value: expanded } = expandedRef;
142
+ if (expanded)
143
+ return true;
144
+ const { value: trigger } = triggerRef;
145
+ if (trigger) {
146
+ syncEllipsisStyle(trigger);
147
+ tooltipDisabled = trigger.scrollHeight <= trigger.offsetHeight;
148
+ syncCursorStyle(trigger, tooltipDisabled);
149
+ }
150
+ return tooltipDisabled;
151
+ };
152
+ return (_ctx, _cache) => {
153
+ return (_openBlock(), _createBlock(_unref(Tooltip), _mergeProps({
154
+ ref_key: "tooltipRef",
155
+ ref: tooltipRef,
156
+ placement: "top"
157
+ }, __props.tooltip, { visible: visible.value }), {
158
+ default: _withCtx(() => [
159
+ (__props.tooltip)
160
+ ? (_openBlock(), _createElementBlock("div", {
161
+ key: 0,
162
+ class: _normalizeClass([jEllipsisLineClampClass, jEllipsis, 'j-ellipsis-deep'])
163
+ }, [
164
+ _renderSlot(_ctx.$slots, "default"),
165
+ _renderSlot(_ctx.$slots, "tooltip")
166
+ ], 2 /* CLASS */))
167
+ : _createCommentVNode("v-if", true),
168
+ _createElementVNode("span", _mergeProps({
169
+ ref_key: "triggerRef",
170
+ ref: triggerRef
171
+ }, triggerAttrs(), {
172
+ onClick: _cache[0] || (_cache[0] = (...args) => (handleClickRef.value && handleClickRef.value(...args))),
173
+ onMouseleave: _cache[1] || (_cache[1] = $event => (visible.value = false)),
174
+ onMouseenter: _cache[2] || (_cache[2] = $event => {
175
+ ;
176
+ [
177
+ props.expandTrigger === 'click'
178
+ ? getTooltipDisabled()
179
+ : showTooltip(),
180
+ ];
181
+ })
182
+ }), null, 16 /* FULL_PROPS */)
183
+ ]),
184
+ _: 3 /* FORWARDED */
185
+ }, 16 /* FULL_PROPS */, ["visible"]));
186
+ };
187
+ }
188
+ });
189
+ export default __sfc_main__;
@@ -0,0 +1,2 @@
1
+ import Ellipsis from './Ellipsis.js';
2
+ export default Ellipsis;
@@ -0,0 +1,56 @@
1
+ /* Analyzed bindings: {
2
+ "description": "props",
3
+ "image": "props",
4
+ "imageStyle": "props",
5
+ "Empty": "setup-maybe-ref",
6
+ "useSlots": "setup-const",
7
+ "NoData": "setup-maybe-ref",
8
+ "omit": "setup-maybe-ref",
9
+ "slots": "setup-maybe-ref",
10
+ "renderArr": "setup-maybe-ref",
11
+ "props": "setup-reactive-const",
12
+ "baseProps": "setup-maybe-ref"
13
+ } */
14
+ import { defineComponent as _defineComponent } from 'vue';
15
+ import { unref as _unref, renderSlot as _renderSlot, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, withCtx as _withCtx, renderList as _renderList, createSlots as _createSlots, openBlock as _openBlock, createBlock as _createBlock } from "vue";
16
+ import { Empty } from 'ant-design-vue';
17
+ import { useSlots } from 'vue';
18
+ import NoData from './image';
19
+ import { omit } from 'lodash-es';
20
+ const __sfc_main__ = _defineComponent({
21
+ props: {
22
+ description: {
23
+ type: String,
24
+ default: '暂无数据',
25
+ },
26
+ image: {
27
+ type: String,
28
+ default: NoData,
29
+ },
30
+ imageStyle: {
31
+ type: Object,
32
+ default: () => {
33
+ return { height: '60px' };
34
+ },
35
+ },
36
+ },
37
+ setup(__props) {
38
+ const slots = useSlots();
39
+ const renderArr = Object.keys(slots);
40
+ const props = __props;
41
+ const baseProps = omit(props, ...renderArr);
42
+ return (_ctx, _cache) => {
43
+ return (_openBlock(), _createBlock(_unref(Empty), _normalizeProps(_guardReactiveProps(_unref(baseProps))), _createSlots({ _: 2 /* DYNAMIC */ }, [
44
+ _renderList(_unref(renderArr), (item) => {
45
+ return {
46
+ name: item,
47
+ fn: _withCtx((scope) => [
48
+ _renderSlot(_ctx.$slots, item, { scope: scope })
49
+ ])
50
+ };
51
+ })
52
+ ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */));
53
+ };
54
+ }
55
+ });
56
+ export default __sfc_main__;
@@ -0,0 +1,2 @@
1
+ var img = 'data:image/png;base64,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';
2
+ export default img;
@@ -0,0 +1,2 @@
1
+ import Empty from './Empty.js';
2
+ export default Empty;
@@ -0,0 +1,31 @@
1
+ /* Analyzed bindings: {
2
+ "ref": "setup-const",
3
+ "useElementBounding": "setup-maybe-ref",
4
+ "fullPage": "setup-ref",
5
+ "y": "setup-maybe-ref"
6
+ } */
7
+ import { defineComponent as _defineComponent } from 'vue';
8
+ import { unref as _unref, renderSlot as _renderSlot, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
9
+ const _withScopeId = n => (_pushScopeId("data-v-1712541386176"), n = n(), _popScopeId(), n);
10
+ const _hoisted_1 = { class: "full-page-warp-content" };
11
+ import { ref } from 'vue';
12
+ import { useElementBounding } from '@vueuse/core';
13
+ const __sfc_main__ = _defineComponent({
14
+ setup(__props) {
15
+ const fullPage = ref(null);
16
+ const { y } = useElementBounding(fullPage);
17
+ return (_ctx, _cache) => {
18
+ return (_openBlock(), _createElementBlock("div", {
19
+ class: "full-page-warp",
20
+ ref_key: "fullPage",
21
+ ref: fullPage,
22
+ style: _normalizeStyle({ minHeight: `calc(100vh - ${_unref(y) + 24}px)` })
23
+ }, [
24
+ _createElementVNode("div", _hoisted_1, [
25
+ _renderSlot(_ctx.$slots, "default")
26
+ ])
27
+ ], 4 /* STYLE */));
28
+ };
29
+ }
30
+ });
31
+ export default __sfc_main__;
@@ -0,0 +1,2 @@
1
+ import FullPage from './FullPage.js';
2
+ export default FullPage;
@@ -0,0 +1,43 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import { createVNode as _createVNode } from "vue";
3
+ import { defineComponent, createVNode, watchEffect } from 'vue';
4
+ import * as aIcon from '@ant-design/icons-vue';
5
+ import { createFromIconfontCN } from '@ant-design/icons-vue';
6
+ import { useIcon } from '@jetlinks-web/hooks';
7
+ var MyIcon = createFromIconfontCN({
8
+ scriptUrl: '//at.alicdn.com/t/c/font_3183515_i7oma42he.js' // 在 iconfont.cn 上生成
9
+ });
10
+ var AntdIcon = function AntdIcon(props) {
11
+ return createVNode(aIcon[props.type]);
12
+ };
13
+ var Icon = function Icon(props) {
14
+ return Object.keys(aIcon).includes(props.type) ? _createVNode(AntdIcon, props, null) : _createVNode(MyIcon, props, null);
15
+ };
16
+ export default defineComponent({
17
+ name: 'AIcon',
18
+ // 传入组件配置
19
+ props: ['type', 'scriptUrl', 'class'],
20
+ emits: ['click'],
21
+ setup: function setup(props, _ref) {
22
+ var emit = _ref.emit,
23
+ attrs = _ref.attrs;
24
+ var config = useIcon();
25
+ watchEffect(function () {
26
+ var url = props.scriptUrl || config.scriptUrl;
27
+ if (url) {
28
+ MyIcon = createFromIconfontCN({
29
+ scriptUrl: url
30
+ });
31
+ }
32
+ });
33
+ var click = function click() {
34
+ emit('click');
35
+ };
36
+ return function () {
37
+ return _createVNode(Icon, _objectSpread(_objectSpread({}, props), {}, {
38
+ "style": attrs.style,
39
+ "onClick": click
40
+ }), null);
41
+ };
42
+ }
43
+ });
@@ -1,3 +1,2 @@
1
- import AIcon from './icon';
2
-
3
- export default AIcon;
1
+ import AIcon from './icon';
2
+ export default AIcon;
@@ -0,0 +1,238 @@
1
+ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
2
+ const op = ops[i];
3
+ const fn = ops[i + 1];
4
+ i += 2;
5
+ if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
6
+ return undefined;
7
+ }
8
+ if (op === 'access' || op === 'optionalAccess') {
9
+ lastAccessLHS = value;
10
+ value = fn(value);
11
+ }
12
+ else if (op === 'call' || op === 'optionalCall') {
13
+ value = fn((...args) => value.call(lastAccessLHS, ...args));
14
+ lastAccessLHS = undefined;
15
+ }
16
+ } return value; }
17
+ /* Analyzed bindings: {
18
+ "modelValue": "props",
19
+ "theme": "props",
20
+ "language": "props",
21
+ "codeTips": "props",
22
+ "init": "props",
23
+ "registrationTips": "props",
24
+ "registrationTypescript": "props",
25
+ "blurFormat": "props",
26
+ "readOnly": "props",
27
+ "options": "props",
28
+ "ref": "setup-const",
29
+ "onMounted": "setup-const",
30
+ "watch": "setup-const",
31
+ "onUnmounted": "setup-const",
32
+ "toRaw": "setup-const",
33
+ "nextTick": "setup-const",
34
+ "monaco": "setup-const",
35
+ "omit": "setup-maybe-ref",
36
+ "props": "setup-reactive-const",
37
+ "emit": "setup-const",
38
+ "dom": "setup-ref",
39
+ "instance": "setup-ref",
40
+ "monacoProviderRef": "setup-ref",
41
+ "monacoTypescriptProviderRef": "setup-ref",
42
+ "handleSuggestions": "setup-const",
43
+ "disposeRegister": "setup-const",
44
+ "registerCompletionItemProvider": "setup-const",
45
+ "disposeTypescript": "setup-const",
46
+ "registerTypescript": "setup-const",
47
+ "editorFormat": "setup-const",
48
+ "insert": "setup-const"
49
+ } */
50
+ import { openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
51
+ import { ref, onMounted, watch, onUnmounted, toRaw, nextTick } from 'vue';
52
+ import * as monaco from 'monaco-editor';
53
+ import { omit } from 'lodash-es';
54
+ const __sfc_main__ = {
55
+ props: {
56
+ modelValue: [String, Number],
57
+ theme: { type: String, default: 'vs-dark' },
58
+ language: { type: String, default: 'json' },
59
+ codeTips: { type: Array, default: () => [] },
60
+ init: { type: Function, default: undefined },
61
+ registrationTips: { type: Object, default: () => ({}) },
62
+ registrationTypescript: { type: Object, default: () => ({}) },
63
+ blurFormat: { type: Boolean, default: true },
64
+ readOnly: { type: Boolean, default: false },
65
+ options: { type: Object, default: () => ({}) },
66
+ },
67
+ emits: [
68
+ 'update:modelValue',
69
+ 'blur',
70
+ 'focus',
71
+ 'change',
72
+ 'errorChange',
73
+ ],
74
+ setup(__props, { expose: __expose, emit: __emit }) {
75
+ const props = __props;
76
+ const emit = __emit;
77
+ const dom = ref();
78
+ const instance = ref();
79
+ const monacoProviderRef = ref();
80
+ const monacoTypescriptProviderRef = ref();
81
+ // codeTipItem.dispose() // 销毁自定义提示
82
+ const handleSuggestions = (suggestions, range) => {
83
+ return Array.isArray(suggestions)
84
+ ? suggestions.map((item) => ({ ...item, range }))
85
+ : [];
86
+ };
87
+ const disposeRegister = () => {
88
+ _optionalChain([monacoProviderRef, 'access', _ => _.value, 'optionalAccess', _2 => _2.dispose, 'call', _3 => _3()]);
89
+ monacoProviderRef.value = null;
90
+ };
91
+ /**
92
+ * 代码提示注册
93
+ */
94
+ const registerCompletionItemProvider = () => {
95
+ disposeRegister();
96
+ if (monaco.languages && _optionalChain([props, 'access', _4 => _4.registrationTips, 'optionalAccess', _5 => _5.suggestions])) {
97
+ const { name, suggestions } = props.registrationTips;
98
+ monacoProviderRef.value =
99
+ monaco.languages.registerCompletionItemProvider(name || 'json', {
100
+ provideCompletionItems: function (model, position) {
101
+ const word = model.getWordUntilPosition(position); // 获取提示代码范围位置
102
+ const range = {
103
+ startLineNumber: position.lineNumber,
104
+ endLineNumber: position.lineNumber,
105
+ startColumn: word.startColumn,
106
+ endColumn: word.endColumn,
107
+ };
108
+ return {
109
+ suggestions: handleSuggestions(suggestions, range),
110
+ };
111
+ },
112
+ });
113
+ }
114
+ };
115
+ const disposeTypescript = () => {
116
+ _optionalChain([monacoTypescriptProviderRef, 'access', _6 => _6.value, 'optionalAccess', _7 => _7.dispose, 'call', _8 => _8()]);
117
+ monacoTypescriptProviderRef.value = null;
118
+ };
119
+ const registerTypescript = () => {
120
+ disposeTypescript();
121
+ if (monaco.languages && _optionalChain([props, 'access', _9 => _9.registrationTypescript, 'optionalAccess', _10 => _10.typescript])) {
122
+ const { name, typescript } = props.registrationTypescript;
123
+ monacoTypescriptProviderRef.value =
124
+ monaco.languages.typescript.javascriptDefaults.addExtraLib(typescript);
125
+ }
126
+ };
127
+ /**
128
+ * 代码格式化
129
+ */
130
+ const editorFormat = () => {
131
+ if (!instance.value)
132
+ return;
133
+ _optionalChain([toRaw, 'call', _11 => _11(instance.value), 'access', _12 => _12.getAction, 'call', _13 => _13('editor.action.formatDocument'), 'optionalAccess', _14 => _14.run, 'call', _15 => _15()]);
134
+ if (props.hasOwnProperty('readOnly')) {
135
+ setTimeout(() => {
136
+ toRaw(instance.value).updateOptions({
137
+ readOnly: props.readOnly !== false,
138
+ });
139
+ }, 100);
140
+ }
141
+ };
142
+ monaco.editor.onDidChangeMarkers(([uri]) => {
143
+ const markers = monaco.editor.getModelMarkers({ resource: uri });
144
+ emit('errorChange', markers);
145
+ });
146
+ onMounted(async () => {
147
+ const _model = monaco.editor.createModel(props.modelValue, props.language);
148
+ instance.value = monaco.editor.create(dom.value, {
149
+ model: _model,
150
+ tabSize: 2,
151
+ automaticLayout: true,
152
+ scrollBeyondLastLine: false,
153
+ theme: props.theme,
154
+ formatOnPaste: true,
155
+ ...(omit(props.options, ['readOnly']) || {}),
156
+ });
157
+ instance.value.onDidChangeModelContent(() => {
158
+ //
159
+ const value = toRaw(instance.value).getValue();
160
+ nextTick(() => {
161
+ emit('update:modelValue', value);
162
+ emit('change', value);
163
+ });
164
+ });
165
+ instance.value.onDidBlurEditorText(() => {
166
+ emit('blur');
167
+ if (props.blurFormat) {
168
+ editorFormat();
169
+ }
170
+ });
171
+ instance.value.onDidFocusEditorText(() => {
172
+ emit('focus');
173
+ });
174
+ if (props.modelValue) {
175
+ setTimeout(() => {
176
+ editorFormat();
177
+ }, 200);
178
+ }
179
+ _optionalChain([props, 'access', _16 => _16.init, 'optionalCall', _17 => _17(instance.value, monaco)]);
180
+ });
181
+ /**
182
+ * 光标位置插入内容
183
+ * @param {String} val
184
+ * @param position
185
+ */
186
+ const insert = (val, position) => {
187
+ if (!instance.value)
188
+ return;
189
+ const _position = position || toRaw(instance.value).getPosition();
190
+ const value = toRaw(instance.value).getValue();
191
+ if (position && position.lineNumber) {
192
+ toRaw(instance.value).setPosition(position);
193
+ }
194
+ toRaw(instance.value).executeEdits(value, [
195
+ {
196
+ range: new monaco.Range(_optionalChain([_position, 'optionalAccess', _18 => _18.lineNumber]), _optionalChain([_position, 'optionalAccess', _19 => _19.column]), _optionalChain([_position, 'optionalAccess', _20 => _20.lineNumber]), _optionalChain([_position, 'optionalAccess', _21 => _21.column])),
197
+ text: val,
198
+ },
199
+ ]);
200
+ };
201
+ watch(() => props.modelValue, (val) => {
202
+ if (!instance.value ||
203
+ (instance.value &&
204
+ props.modelValue === toRaw(instance.value).getValue()))
205
+ return;
206
+ // setValue之前获取光标位置
207
+ const position = toRaw(instance.value).getPosition();
208
+ // setValue之后光标位置改变
209
+ toRaw(instance.value).setValue(val);
210
+ // 设置光标位置为setValue之前的位置
211
+ toRaw(instance.value).setPosition(position);
212
+ editorFormat();
213
+ });
214
+ watch(() => JSON.stringify(props.registrationTips), () => {
215
+ registerCompletionItemProvider();
216
+ }, { immediate: true });
217
+ watch(() => JSON.stringify(props.registrationTypescript), () => {
218
+ registerTypescript();
219
+ }, { immediate: true });
220
+ onUnmounted(() => {
221
+ disposeRegister();
222
+ disposeTypescript();
223
+ _optionalChain([toRaw, 'call', _22 => _22(instance.value), 'access', _23 => _23.editor, 'optionalAccess', _24 => _24.dispose, 'optionalCall', _25 => _25()]);
224
+ });
225
+ __expose({
226
+ editorFormat,
227
+ insert,
228
+ });
229
+ return (_ctx, _cache) => {
230
+ return (_openBlock(), _createElementBlock("div", {
231
+ ref_key: "dom",
232
+ ref: dom,
233
+ class: "j-monaco-editor"
234
+ }, null, 512 /* NEED_PATCH */));
235
+ };
236
+ }
237
+ };
238
+ export default __sfc_main__;
@@ -0,0 +1,2 @@
1
+ import Monaco from './Monaco.js';
2
+ export default Monaco;