@jetlinks-web/components 2.1.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/AMap/Map.js +2 -1
- package/es/AutoComplete/autoComplete.js +88 -0
- package/es/AutoComplete/index.js +5 -0
- package/es/BadgeStatus/Badge.js +2 -1
- package/es/CardSelect/CardSelect.js +2 -1
- package/es/CheckButton/CheckButton.js +2 -3
- package/es/Echarts/Echarts.js +1 -2
- package/es/EditTable/FormItem.js +1 -1
- package/es/FullPage/FullPage.js +1 -1
- package/es/Markdown/Markdown.js +122 -0
- package/es/Markdown/index.js +5 -0
- package/es/MonacoEditor/Monaco.js +1 -9
- package/es/MonacoEditor/style/index.css +4 -0
- package/es/MonacoEditor/style/index.js +1 -0
- package/es/MonacoEditor/style/index.less +4 -0
- package/es/RadioButton/RadioButton.js +67 -0
- package/es/RadioButton/index.js +6 -0
- package/es/Search/Advanced/SaveHistory.js +1 -1
- package/es/Search/Item.js +1 -1
- package/es/Search/Search.js +1 -1
- package/es/components.js +3 -1
- package/es/style/index.css +4 -0
- package/es/style/index.less +1 -0
- package/es/style.js +2 -1
- package/lib/AMap/Map.js +2 -1
- package/lib/AutoComplete/autoComplete.js +88 -0
- package/lib/AutoComplete/index.js +12 -0
- package/lib/BadgeStatus/Badge.js +2 -1
- package/lib/CardSelect/CardSelect.js +2 -1
- package/lib/CheckButton/CheckButton.js +2 -3
- package/lib/Echarts/Echarts.js +1 -2
- package/lib/EditTable/FormItem.js +1 -1
- package/lib/FullPage/FullPage.js +1 -1
- package/lib/Markdown/Markdown.js +129 -0
- package/lib/Markdown/index.js +12 -0
- package/lib/MonacoEditor/Monaco.js +1 -9
- package/lib/MonacoEditor/style/index.css +4 -0
- package/lib/MonacoEditor/style/index.js +3 -1
- package/lib/MonacoEditor/style/index.less +4 -0
- package/lib/RadioButton/RadioButton.js +67 -0
- package/lib/RadioButton/index.js +13 -0
- package/lib/Search/Advanced/SaveHistory.js +1 -1
- package/lib/Search/Item.js +1 -1
- package/lib/Search/Search.js +1 -1
- package/lib/components.js +14 -0
- package/lib/style/components.less +1 -0
- package/lib/style/index.css +4 -0
- package/lib/style/index.less +1 -0
- package/lib/style.js +2 -1
- package/package.json +21 -8
- package/es/MonacoEditor/grammars.js +0 -125
- package/es/MonacoEditor/tips.js +0 -1056
- package/lib/MonacoEditor/grammars.js +0 -137
- package/lib/MonacoEditor/tips.js +0 -1062
package/es/AMap/Map.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"ref": "setup-const",
|
|
11
11
|
"computed": "setup-const",
|
|
12
12
|
"inject": "setup-const",
|
|
13
|
+
"defineOptions": "setup-const",
|
|
13
14
|
"initAMapApiLoader": "setup-maybe-ref",
|
|
14
15
|
"ElAmap": "setup-maybe-ref",
|
|
15
16
|
"getAMapUiPromise": "setup-maybe-ref",
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
} */
|
|
30
31
|
import { defineComponent as _defineComponent } from 'vue';
|
|
31
32
|
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";
|
|
32
|
-
import { ref, computed, inject } from 'vue';
|
|
33
|
+
import { ref, computed, inject, } from 'vue';
|
|
33
34
|
import { initAMapApiLoader, ElAmap } from '@vuemap/vue-amap';
|
|
34
35
|
import { getAMapUiPromise } from '@jetlinks-web/utils';
|
|
35
36
|
import { MapProps } from './util';
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
"searchKey": "props",
|
|
19
|
+
"AutoComplete": "setup-maybe-ref",
|
|
20
|
+
"autoCompleteProps": "setup-maybe-ref",
|
|
21
|
+
"ref": "setup-const",
|
|
22
|
+
"defineOptions": "setup-const",
|
|
23
|
+
"props": "setup-reactive-const",
|
|
24
|
+
"emit": "setup-const",
|
|
25
|
+
"options": "setup-ref",
|
|
26
|
+
"onSearch": "setup-const",
|
|
27
|
+
"dropdownVisibleChange": "setup-const"
|
|
28
|
+
} */
|
|
29
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
30
|
+
import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, unref as _unref, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
31
|
+
import { AutoComplete } from 'ant-design-vue';
|
|
32
|
+
import { autoCompleteProps } from 'ant-design-vue/lib/auto-complete';
|
|
33
|
+
import { ref, } from 'vue';
|
|
34
|
+
const __sfc_main__ = _defineComponent({
|
|
35
|
+
...{
|
|
36
|
+
name: 'JAutoComplete'
|
|
37
|
+
},
|
|
38
|
+
props: {
|
|
39
|
+
...autoCompleteProps(),
|
|
40
|
+
searchKey: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: 'label',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
emits: ["select"],
|
|
46
|
+
setup(__props, { emit: __emit }) {
|
|
47
|
+
const props = __props;
|
|
48
|
+
const emit = __emit;
|
|
49
|
+
const options = ref(props.options);
|
|
50
|
+
/**
|
|
51
|
+
* 根据关键词提示
|
|
52
|
+
* @param searchText 关键词
|
|
53
|
+
*/
|
|
54
|
+
const onSearch = (searchText) => {
|
|
55
|
+
options.value = _optionalChain([props, 'access', _2 => _2.options, 'optionalAccess', _3 => _3.filter, 'call', _4 => _4((item) => !!_optionalChain([item, 'access', _5 => _5[props.searchKey], 'optionalAccess', _6 => _6.includes, 'call', _7 => _7(searchText)]))]) || [];
|
|
56
|
+
if (!options.value.length) {
|
|
57
|
+
options.value.unshift({ label: searchText, value: searchText });
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const dropdownVisibleChange = (open) => {
|
|
61
|
+
if (!open) {
|
|
62
|
+
// 关闭还原下拉options
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
options.value = props.options || [];
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return (_ctx, _cache) => {
|
|
69
|
+
return (_openBlock(), _createBlock(_unref(AutoComplete), _mergeProps(props, {
|
|
70
|
+
style: { "width": "100%" },
|
|
71
|
+
options: options.value,
|
|
72
|
+
onSearch: onSearch,
|
|
73
|
+
onDropdownVisibleChange: dropdownVisibleChange
|
|
74
|
+
}), {
|
|
75
|
+
option: _withCtx(({ value, label }) => [
|
|
76
|
+
_renderSlot(_ctx.$slots, "option", { value: value }, () => [
|
|
77
|
+
_createTextVNode(_toDisplayString(label || value), 1 /* TEXT */)
|
|
78
|
+
])
|
|
79
|
+
]),
|
|
80
|
+
default: _withCtx(() => [
|
|
81
|
+
_renderSlot(_ctx.$slots, "default")
|
|
82
|
+
]),
|
|
83
|
+
_: 3 /* FORWARDED */
|
|
84
|
+
}, 16 /* FULL_PROPS */, ["options"]));
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
export default __sfc_main__;
|
package/es/BadgeStatus/Badge.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"status": "props",
|
|
4
4
|
"statusNames": "props",
|
|
5
5
|
"computed": "setup-const",
|
|
6
|
+
"defineOptions": "setup-const",
|
|
6
7
|
"getHexColor": "setup-maybe-ref",
|
|
7
8
|
"Badge": "setup-maybe-ref",
|
|
8
9
|
"props": "setup-reactive-const",
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
} */
|
|
11
12
|
import { defineComponent as _defineComponent } from 'vue';
|
|
12
13
|
import { unref as _unref, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
13
|
-
import { computed } from 'vue';
|
|
14
|
+
import { computed, } from 'vue';
|
|
14
15
|
import { getHexColor } from './color';
|
|
15
16
|
import { Badge } from 'ant-design-vue';
|
|
16
17
|
const __sfc_main__ = _defineComponent({
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"computed": "setup-const",
|
|
11
11
|
"ref": "setup-const",
|
|
12
12
|
"watch": "setup-const",
|
|
13
|
+
"defineOptions": "setup-const",
|
|
13
14
|
"props": "setup-reactive-const",
|
|
14
15
|
"emit": "setup-const",
|
|
15
16
|
"selectKeys": "setup-ref",
|
|
@@ -23,7 +24,7 @@ const _hoisted_2 = { class: "j-card-select-item-content" };
|
|
|
23
24
|
const _hoisted_3 = { class: "j-card-select-title" };
|
|
24
25
|
const _hoisted_4 = { class: "j-card-select-describe" };
|
|
25
26
|
import { has } from 'lodash-es';
|
|
26
|
-
import { computed, ref, watch } from 'vue';
|
|
27
|
+
import { computed, ref, watch, } from 'vue';
|
|
27
28
|
const __sfc_main__ = Object.assign({
|
|
28
29
|
name: 'JCardSelect'
|
|
29
30
|
}, {
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
"class": "props",
|
|
7
7
|
"style": "props",
|
|
8
8
|
"computed": "setup-const",
|
|
9
|
-
"CSSProperties": "setup-const",
|
|
10
|
-
"PropType": "setup-const",
|
|
11
9
|
"ref": "setup-const",
|
|
12
10
|
"watch": "setup-const",
|
|
11
|
+
"defineOptions": "setup-const",
|
|
13
12
|
"isArray": "setup-maybe-ref",
|
|
14
13
|
"props": "setup-reactive-const",
|
|
15
14
|
"emit": "setup-const",
|
|
@@ -21,7 +20,7 @@
|
|
|
21
20
|
import { defineComponent as _defineComponent } from 'vue';
|
|
22
21
|
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle } from "vue";
|
|
23
22
|
const _hoisted_1 = ["onClick"];
|
|
24
|
-
import { computed, ref, watch } from 'vue';
|
|
23
|
+
import { computed, ref, watch, } from 'vue';
|
|
25
24
|
import { isArray } from '@jetlinks-web/utils';
|
|
26
25
|
const __sfc_main__ = _defineComponent({
|
|
27
26
|
...{
|
package/es/Echarts/Echarts.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/* Analyzed bindings: {
|
|
2
2
|
"options": "props",
|
|
3
3
|
"style": "props",
|
|
4
|
-
"CSSProperties": "setup-const",
|
|
5
4
|
"nextTick": "setup-const",
|
|
6
5
|
"ref": "setup-const",
|
|
7
6
|
"watch": "setup-const",
|
|
8
|
-
"
|
|
7
|
+
"defineOptions": "setup-const",
|
|
9
8
|
"useECharts": "setup-maybe-ref",
|
|
10
9
|
"props": "setup-reactive-const",
|
|
11
10
|
"echartsDom": "setup-ref",
|
package/es/EditTable/FormItem.js
CHANGED
|
@@ -48,7 +48,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
48
48
|
"onFieldChange": "setup-const"
|
|
49
49
|
} */
|
|
50
50
|
import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
51
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
51
|
+
const _withScopeId = n => (_pushScopeId("data-v-1725345293616"), n = n(), _popScopeId(), n);
|
|
52
52
|
const _hoisted_1 = { style: { "color": "#1d2129" } };
|
|
53
53
|
const _hoisted_2 = {
|
|
54
54
|
key: 0,
|
package/es/FullPage/FullPage.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
} */
|
|
7
7
|
import { defineComponent as _defineComponent } from 'vue';
|
|
8
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-
|
|
9
|
+
const _withScopeId = n => (_pushScopeId("data-v-1725345293925"), n = n(), _popScopeId(), n);
|
|
10
10
|
const _hoisted_1 = { class: "full-page-warp-content" };
|
|
11
11
|
import { ref } from 'vue';
|
|
12
12
|
import { useElementBounding } from '@vueuse/core';
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { h, onMounted, onUpdated, ref, defineComponent } from 'vue';
|
|
2
|
+
import MarkdownIt from 'markdown-it';
|
|
3
|
+
import MarkdownItAbbr from 'markdown-it-abbr';
|
|
4
|
+
import MarkdownItAnchor from 'markdown-it-anchor';
|
|
5
|
+
import MarkdownItDeflist from 'markdown-it-deflist';
|
|
6
|
+
import MarkdownItFootnote from 'markdown-it-footnote';
|
|
7
|
+
import MarkdownItHighlightjs from 'markdown-it-highlightjs';
|
|
8
|
+
import MarkdownItIns from 'markdown-it-ins';
|
|
9
|
+
import MarkdownItMark from 'markdown-it-mark';
|
|
10
|
+
import MarkdownItSub from 'markdown-it-sub';
|
|
11
|
+
import MarkdownItSup from 'markdown-it-sup';
|
|
12
|
+
import MarkdownItTaskLists from 'markdown-it-task-lists';
|
|
13
|
+
import MarkdownItTOC from 'markdown-it-toc-done-right';
|
|
14
|
+
var props = {
|
|
15
|
+
anchor: {
|
|
16
|
+
type: Object,
|
|
17
|
+
default: function _default() {
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
breaks: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
emoji: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default: function _default() {
|
|
28
|
+
return {};
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
highlight: {
|
|
32
|
+
type: Object,
|
|
33
|
+
default: function _default() {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
html: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false
|
|
40
|
+
},
|
|
41
|
+
langPrefix: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: 'language-'
|
|
44
|
+
},
|
|
45
|
+
linkify: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false
|
|
48
|
+
},
|
|
49
|
+
plugins: {
|
|
50
|
+
type: Array,
|
|
51
|
+
default: function _default() {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
quotes: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: '“”‘’'
|
|
58
|
+
},
|
|
59
|
+
source: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ''
|
|
62
|
+
},
|
|
63
|
+
tasklists: {
|
|
64
|
+
type: Object,
|
|
65
|
+
default: function _default() {
|
|
66
|
+
return {};
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
toc: {
|
|
70
|
+
type: Object,
|
|
71
|
+
default: function _default() {
|
|
72
|
+
return {};
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
typographer: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false
|
|
78
|
+
},
|
|
79
|
+
xhtmlOut: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: false
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
export default defineComponent({
|
|
85
|
+
name: 'JMarkdown',
|
|
86
|
+
props: props,
|
|
87
|
+
setup: function setup(props) {
|
|
88
|
+
var md = ref();
|
|
89
|
+
var renderMarkdown = function renderMarkdown() {
|
|
90
|
+
var markdown = new MarkdownIt().use(MarkdownItAbbr).use(MarkdownItAnchor, props.anchor).use(MarkdownItDeflist).use(MarkdownItFootnote).use(MarkdownItHighlightjs, props.highlight).use(MarkdownItIns).use(MarkdownItMark).use(MarkdownItSub).use(MarkdownItSup).use(MarkdownItTaskLists, props.tasklists).use(MarkdownItTOC, props.toc).set({
|
|
91
|
+
breaks: props.breaks,
|
|
92
|
+
html: props.html,
|
|
93
|
+
langPrefix: props.langPrefix,
|
|
94
|
+
linkify: props.linkify,
|
|
95
|
+
quotes: props.quotes,
|
|
96
|
+
typographer: props.typographer,
|
|
97
|
+
xhtmlOut: props.xhtmlOut
|
|
98
|
+
});
|
|
99
|
+
props.plugins.forEach(function (_ref) {
|
|
100
|
+
var plugin = _ref.plugin,
|
|
101
|
+
_ref$options = _ref.options,
|
|
102
|
+
options = _ref$options === void 0 ? {} : _ref$options;
|
|
103
|
+
markdown.use(plugin, options);
|
|
104
|
+
});
|
|
105
|
+
md.value = markdown.render(props.source);
|
|
106
|
+
};
|
|
107
|
+
onMounted(function () {
|
|
108
|
+
return renderMarkdown();
|
|
109
|
+
});
|
|
110
|
+
onUpdated(function () {
|
|
111
|
+
return renderMarkdown();
|
|
112
|
+
});
|
|
113
|
+
return function () {
|
|
114
|
+
return h('div', {
|
|
115
|
+
innerHTML: md.value,
|
|
116
|
+
style: {
|
|
117
|
+
height: '100%'
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
});
|
|
@@ -33,7 +33,6 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
33
33
|
"nextTick": "setup-const",
|
|
34
34
|
"monaco": "setup-const",
|
|
35
35
|
"omit": "setup-maybe-ref",
|
|
36
|
-
"loadGrammars": "setup-maybe-ref",
|
|
37
36
|
"props": "setup-reactive-const",
|
|
38
37
|
"emit": "setup-const",
|
|
39
38
|
"dom": "setup-ref",
|
|
@@ -52,7 +51,6 @@ import { openBlock as _openBlock, createElementBlock as _createElementBlock } fr
|
|
|
52
51
|
import { ref, onMounted, watch, onUnmounted, toRaw, nextTick } from 'vue';
|
|
53
52
|
import * as monaco from 'monaco-editor';
|
|
54
53
|
import { omit } from 'lodash-es';
|
|
55
|
-
import { loadGrammars } from './grammars';
|
|
56
54
|
const __sfc_main__ = Object.assign({
|
|
57
55
|
name: 'JMonacoEditor'
|
|
58
56
|
}, {
|
|
@@ -149,11 +147,6 @@ const __sfc_main__ = Object.assign({
|
|
|
149
147
|
});
|
|
150
148
|
onMounted(async () => {
|
|
151
149
|
const _model = monaco.editor.createModel(props.modelValue, props.language);
|
|
152
|
-
const defaultOptions = Object.assign({
|
|
153
|
-
suggest: {
|
|
154
|
-
preview: true,
|
|
155
|
-
},
|
|
156
|
-
}, omit(props.options, ['readOnly']));
|
|
157
150
|
instance.value = monaco.editor.create(dom.value, {
|
|
158
151
|
model: _model,
|
|
159
152
|
tabSize: 2,
|
|
@@ -161,9 +154,8 @@ const __sfc_main__ = Object.assign({
|
|
|
161
154
|
scrollBeyondLastLine: false,
|
|
162
155
|
theme: props.theme,
|
|
163
156
|
formatOnPaste: true,
|
|
164
|
-
...
|
|
157
|
+
...(omit(props.options, ['readOnly']) || {}),
|
|
165
158
|
});
|
|
166
|
-
loadGrammars(monaco, instance.value);
|
|
167
159
|
instance.value.onDidChangeModelContent(() => {
|
|
168
160
|
//
|
|
169
161
|
const value = toRaw(instance.value).getValue();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* Analyzed bindings: {
|
|
2
|
+
"value": "props",
|
|
3
|
+
"options": "props",
|
|
4
|
+
"columns": "props",
|
|
5
|
+
"defineOptions": "setup-const",
|
|
6
|
+
"props": "setup-reactive-const",
|
|
7
|
+
"emit": "setup-const",
|
|
8
|
+
"myValue": "setup-maybe-ref",
|
|
9
|
+
"styles": "setup-maybe-ref",
|
|
10
|
+
"onClick": "setup-const"
|
|
11
|
+
} */
|
|
12
|
+
import { unref as _unref, 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";
|
|
13
|
+
const _withScopeId = n => (_pushScopeId("data-v-1725345294479"), n = n(), _popScopeId(), n);
|
|
14
|
+
const _hoisted_1 = ["onClick"];
|
|
15
|
+
const __sfc_main__ = Object.assign({
|
|
16
|
+
name: 'JRadioButton',
|
|
17
|
+
}, {
|
|
18
|
+
props: {
|
|
19
|
+
value: {
|
|
20
|
+
type: [String, Number],
|
|
21
|
+
default: undefined
|
|
22
|
+
},
|
|
23
|
+
options: {
|
|
24
|
+
type: Array,
|
|
25
|
+
default: () => []
|
|
26
|
+
},
|
|
27
|
+
columns: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: 3
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
emits: ['update:value'],
|
|
33
|
+
setup(__props, { emit: __emit }) {
|
|
34
|
+
const props = __props;
|
|
35
|
+
const emit = __emit;
|
|
36
|
+
const myValue = ref(props.value);
|
|
37
|
+
const styles = computed(() => {
|
|
38
|
+
return {
|
|
39
|
+
'grid-template-columns': `repeat(${props.columns}, 1fr)`
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
const onClick = (record) => {
|
|
43
|
+
if (myValue.value !== record.value) {
|
|
44
|
+
myValue.value = record.value;
|
|
45
|
+
emit('update:value', record.value);
|
|
46
|
+
emit('select', record.value);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
watch(() => props.value, () => {
|
|
50
|
+
myValue.value = props.value;
|
|
51
|
+
});
|
|
52
|
+
return (_ctx, _cache) => {
|
|
53
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
54
|
+
class: "radio-button",
|
|
55
|
+
style: _normalizeStyle(_unref(styles))
|
|
56
|
+
}, [
|
|
57
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.options, (item) => {
|
|
58
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
59
|
+
onClick: $event => (onClick(item)),
|
|
60
|
+
class: _normalizeClass(["radio-button-item", { 'active': _unref(myValue) === item.value }])
|
|
61
|
+
}, _toDisplayString(item.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_1));
|
|
62
|
+
}), 256 /* UNKEYED_FRAGMENT */))
|
|
63
|
+
], 4 /* STYLE */));
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export default __sfc_main__;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
} */
|
|
22
22
|
import { defineComponent as _defineComponent } from 'vue';
|
|
23
23
|
import { unref as _unref, createVNode as _createVNode, withCtx as _withCtx, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
24
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
24
|
+
const _withScopeId = n => (_pushScopeId("data-v-1725345295640"), n = n(), _popScopeId(), n);
|
|
25
25
|
const _hoisted_1 = {
|
|
26
26
|
key: 0,
|
|
27
27
|
style: { "width": "240px" }
|
package/es/Search/Item.js
CHANGED
|
@@ -78,7 +78,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
78
78
|
} */
|
|
79
79
|
import { defineComponent as _defineComponent } from 'vue';
|
|
80
80
|
import { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, createVNode as _createVNode, Fragment as _Fragment, normalizeStyle as _normalizeStyle, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
81
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
81
|
+
const _withScopeId = n => (_pushScopeId("data-v-1725345294732"), n = n(), _popScopeId(), n);
|
|
82
82
|
const _hoisted_1 = { class: "JSearch-item" };
|
|
83
83
|
const _hoisted_2 = {
|
|
84
84
|
key: 0,
|
package/es/Search/Search.js
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
} */
|
|
37
37
|
import { defineComponent as _defineComponent } from 'vue';
|
|
38
38
|
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, unref as _unref, withCtx as _withCtx, createBlock as _createBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
39
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
39
|
+
const _withScopeId = n => (_pushScopeId("data-v-1725345294853"), n = n(), _popScopeId(), n);
|
|
40
40
|
const _hoisted_1 = { class: "JSearch-content simple" };
|
|
41
41
|
const _hoisted_2 = { class: "JSearch-items" };
|
|
42
42
|
import { Button, Row, Col, Form, FormItemRest, } from 'ant-design-vue';
|
package/es/components.js
CHANGED
|
@@ -17,4 +17,6 @@ export { default as Search, AdvancedSearch } from './Search';
|
|
|
17
17
|
export { default as ValueItem } from './ValueItem';
|
|
18
18
|
export { default as TimeFormat } from './TimeFormat';
|
|
19
19
|
export { default as DragModal } from './DragModal';
|
|
20
|
-
export { default as EditTable } from './EditTable';
|
|
20
|
+
export { default as EditTable } from './EditTable';
|
|
21
|
+
export { default as Markdown } from './Markdown';
|
|
22
|
+
export { default as AutoComplete } from './AutoComplete';
|
package/es/style/index.css
CHANGED
package/es/style/index.less
CHANGED
package/es/style.js
CHANGED
package/lib/AMap/Map.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"ref": "setup-const",
|
|
11
11
|
"computed": "setup-const",
|
|
12
12
|
"inject": "setup-const",
|
|
13
|
+
"defineOptions": "setup-const",
|
|
13
14
|
"initAMapApiLoader": "setup-maybe-ref",
|
|
14
15
|
"ElAmap": "setup-maybe-ref",
|
|
15
16
|
"getAMapUiPromise": "setup-maybe-ref",
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
} */
|
|
30
31
|
import { defineComponent as _defineComponent } from 'vue';
|
|
31
32
|
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";
|
|
32
|
-
import { ref, computed, inject } from 'vue';
|
|
33
|
+
import { ref, computed, inject, } from 'vue';
|
|
33
34
|
import { initAMapApiLoader, ElAmap } from '@vuemap/vue-amap';
|
|
34
35
|
import { getAMapUiPromise } from '@jetlinks-web/utils';
|
|
35
36
|
import { MapProps } from './util';
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
"searchKey": "props",
|
|
19
|
+
"AutoComplete": "setup-maybe-ref",
|
|
20
|
+
"autoCompleteProps": "setup-maybe-ref",
|
|
21
|
+
"ref": "setup-const",
|
|
22
|
+
"defineOptions": "setup-const",
|
|
23
|
+
"props": "setup-reactive-const",
|
|
24
|
+
"emit": "setup-const",
|
|
25
|
+
"options": "setup-ref",
|
|
26
|
+
"onSearch": "setup-const",
|
|
27
|
+
"dropdownVisibleChange": "setup-const"
|
|
28
|
+
} */
|
|
29
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
30
|
+
import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, unref as _unref, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
31
|
+
import { AutoComplete } from 'ant-design-vue';
|
|
32
|
+
import { autoCompleteProps } from 'ant-design-vue/lib/auto-complete';
|
|
33
|
+
import { ref, } from 'vue';
|
|
34
|
+
const __sfc_main__ = _defineComponent({
|
|
35
|
+
...{
|
|
36
|
+
name: 'JAutoComplete'
|
|
37
|
+
},
|
|
38
|
+
props: {
|
|
39
|
+
...autoCompleteProps(),
|
|
40
|
+
searchKey: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: 'label',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
emits: ["select"],
|
|
46
|
+
setup(__props, { emit: __emit }) {
|
|
47
|
+
const props = __props;
|
|
48
|
+
const emit = __emit;
|
|
49
|
+
const options = ref(props.options);
|
|
50
|
+
/**
|
|
51
|
+
* 根据关键词提示
|
|
52
|
+
* @param searchText 关键词
|
|
53
|
+
*/
|
|
54
|
+
const onSearch = (searchText) => {
|
|
55
|
+
options.value = _optionalChain([props, 'access', _2 => _2.options, 'optionalAccess', _3 => _3.filter, 'call', _4 => _4((item) => !!_optionalChain([item, 'access', _5 => _5[props.searchKey], 'optionalAccess', _6 => _6.includes, 'call', _7 => _7(searchText)]))]) || [];
|
|
56
|
+
if (!options.value.length) {
|
|
57
|
+
options.value.unshift({ label: searchText, value: searchText });
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const dropdownVisibleChange = (open) => {
|
|
61
|
+
if (!open) {
|
|
62
|
+
// 关闭还原下拉options
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
options.value = props.options || [];
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return (_ctx, _cache) => {
|
|
69
|
+
return (_openBlock(), _createBlock(_unref(AutoComplete), _mergeProps(props, {
|
|
70
|
+
style: { "width": "100%" },
|
|
71
|
+
options: options.value,
|
|
72
|
+
onSearch: onSearch,
|
|
73
|
+
onDropdownVisibleChange: dropdownVisibleChange
|
|
74
|
+
}), {
|
|
75
|
+
option: _withCtx(({ value, label }) => [
|
|
76
|
+
_renderSlot(_ctx.$slots, "option", { value: value }, () => [
|
|
77
|
+
_createTextVNode(_toDisplayString(label || value), 1 /* TEXT */)
|
|
78
|
+
])
|
|
79
|
+
]),
|
|
80
|
+
default: _withCtx(() => [
|
|
81
|
+
_renderSlot(_ctx.$slots, "default")
|
|
82
|
+
]),
|
|
83
|
+
_: 3 /* FORWARDED */
|
|
84
|
+
}, 16 /* FULL_PROPS */, ["options"]));
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
export default __sfc_main__;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _AutoComplete = _interopRequireDefault(require("./AutoComplete.js"));
|
|
9
|
+
_AutoComplete.default.install = function (app) {
|
|
10
|
+
app.component(_AutoComplete.default.name, _AutoComplete.default);
|
|
11
|
+
};
|
|
12
|
+
var _default = exports.default = _AutoComplete.default;
|