ll-plus 2.8.16 → 2.8.18
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/components/code-editor/index.d.ts +4 -3
- package/es/components/code-editor/src/code-editor.vue.d.ts +4 -4
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.mjs +143 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.mjs.map +1 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/config/index.mjs +8 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/config/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/index.mjs +2 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/loader/index.mjs +189 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/loader/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/compose.mjs +14 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/compose.mjs.map +1 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/curry.mjs +20 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/curry.mjs.map +1 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.mjs +15 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.mjs.map +1 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/isObject.mjs +6 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/isObject.mjs.map +1 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.mjs +21 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.mjs.map +1 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/validators/index.mjs +50 -0
- package/es/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/validators/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/state-local@1.0.7/node_modules/state-local/lib/es/state-local.mjs +194 -0
- package/es/node_modules/.pnpm/state-local@1.0.7/node_modules/state-local/lib/es/state-local.mjs.map +1 -0
- package/es/packages/components/code-editor/src/code-editor.vue2.mjs +14 -55
- package/es/packages/components/code-editor/src/code-editor.vue2.mjs.map +1 -1
- package/es/packages/components/operate-icon/src/operate-icon.vue2.mjs +30 -3
- package/es/packages/components/operate-icon/src/operate-icon.vue2.mjs.map +1 -1
- package/index.full.js +616 -144
- package/index.full.min.js +32 -22
- package/index.full.min.js.map +1 -1
- package/index.full.min.mjs +36 -26
- package/index.full.min.mjs.map +1 -1
- package/index.full.mjs +602 -111
- package/lib/components/code-editor/index.d.ts +4 -3
- package/lib/components/code-editor/src/code-editor.vue.d.ts +4 -4
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js +154 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/config/index.js +12 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/config/index.js.map +1 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/index.js +10 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/index.js.map +1 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/loader/index.js +193 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/loader/index.js.map +1 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/compose.js +18 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/compose.js.map +1 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/curry.js +24 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/curry.js.map +1 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js +19 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js.map +1 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/isObject.js +10 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/isObject.js.map +1 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js +26 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js.map +1 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/validators/index.js +56 -0
- package/lib/node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/validators/index.js.map +1 -0
- package/lib/node_modules/.pnpm/state-local@1.0.7/node_modules/state-local/lib/es/state-local.js +198 -0
- package/lib/node_modules/.pnpm/state-local@1.0.7/node_modules/state-local/lib/es/state-local.js.map +1 -0
- package/lib/packages/components/code-editor/src/code-editor.vue2.js +22 -83
- package/lib/packages/components/code-editor/src/code-editor.vue2.js.map +1 -1
- package/lib/packages/components/operate-icon/src/operate-icon.vue2.js +30 -3
- package/lib/packages/components/operate-icon/src/operate-icon.vue2.js.map +1 -1
- package/package.json +2 -4
- package/theme-chalk/css/index.css +1 -1
- package/theme-chalk/css/operate-icon.css +1 -1
- package/types/packages/components/code-editor/index.d.ts +4 -3
- package/types/packages/components/code-editor/src/code-editor.vue.d.ts +4 -4
package/lib/node_modules/.pnpm/state-local@1.0.7/node_modules/state-local/lib/es/state-local.js
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) {
|
|
6
|
+
if (key in obj) {
|
|
7
|
+
Object.defineProperty(obj, key, {
|
|
8
|
+
value: value,
|
|
9
|
+
enumerable: true,
|
|
10
|
+
configurable: true,
|
|
11
|
+
writable: true
|
|
12
|
+
});
|
|
13
|
+
} else {
|
|
14
|
+
obj[key] = value;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return obj;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function ownKeys(object, enumerableOnly) {
|
|
21
|
+
var keys = Object.keys(object);
|
|
22
|
+
|
|
23
|
+
if (Object.getOwnPropertySymbols) {
|
|
24
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
25
|
+
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
26
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
27
|
+
});
|
|
28
|
+
keys.push.apply(keys, symbols);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return keys;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function _objectSpread2(target) {
|
|
35
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
36
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
37
|
+
|
|
38
|
+
if (i % 2) {
|
|
39
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
40
|
+
_defineProperty(target, key, source[key]);
|
|
41
|
+
});
|
|
42
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
43
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
44
|
+
} else {
|
|
45
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
46
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function compose() {
|
|
55
|
+
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
56
|
+
fns[_key] = arguments[_key];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return function (x) {
|
|
60
|
+
return fns.reduceRight(function (y, f) {
|
|
61
|
+
return f(y);
|
|
62
|
+
}, x);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function curry(fn) {
|
|
67
|
+
return function curried() {
|
|
68
|
+
var _this = this;
|
|
69
|
+
|
|
70
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
71
|
+
args[_key2] = arguments[_key2];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return args.length >= fn.length ? fn.apply(this, args) : function () {
|
|
75
|
+
for (var _len3 = arguments.length, nextArgs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
76
|
+
nextArgs[_key3] = arguments[_key3];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return curried.apply(_this, [].concat(args, nextArgs));
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function isObject(value) {
|
|
85
|
+
return {}.toString.call(value).includes('Object');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function isEmpty(obj) {
|
|
89
|
+
return !Object.keys(obj).length;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function isFunction(value) {
|
|
93
|
+
return typeof value === 'function';
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function hasOwnProperty(object, property) {
|
|
97
|
+
return Object.prototype.hasOwnProperty.call(object, property);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function validateChanges(initial, changes) {
|
|
101
|
+
if (!isObject(changes)) errorHandler('changeType');
|
|
102
|
+
if (Object.keys(changes).some(function (field) {
|
|
103
|
+
return !hasOwnProperty(initial, field);
|
|
104
|
+
})) errorHandler('changeField');
|
|
105
|
+
return changes;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function validateSelector(selector) {
|
|
109
|
+
if (!isFunction(selector)) errorHandler('selectorType');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function validateHandler(handler) {
|
|
113
|
+
if (!(isFunction(handler) || isObject(handler))) errorHandler('handlerType');
|
|
114
|
+
if (isObject(handler) && Object.values(handler).some(function (_handler) {
|
|
115
|
+
return !isFunction(_handler);
|
|
116
|
+
})) errorHandler('handlersType');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function validateInitial(initial) {
|
|
120
|
+
if (!initial) errorHandler('initialIsRequired');
|
|
121
|
+
if (!isObject(initial)) errorHandler('initialType');
|
|
122
|
+
if (isEmpty(initial)) errorHandler('initialContent');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function throwError(errorMessages, type) {
|
|
126
|
+
throw new Error(errorMessages[type] || errorMessages["default"]);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
var errorMessages = {
|
|
130
|
+
initialIsRequired: 'initial state is required',
|
|
131
|
+
initialType: 'initial state should be an object',
|
|
132
|
+
initialContent: 'initial state shouldn\'t be an empty object',
|
|
133
|
+
handlerType: 'handler should be an object or a function',
|
|
134
|
+
handlersType: 'all handlers should be a functions',
|
|
135
|
+
selectorType: 'selector should be a function',
|
|
136
|
+
changeType: 'provided value of changes should be an object',
|
|
137
|
+
changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
|
|
138
|
+
"default": 'an unknown error accured in `state-local` package'
|
|
139
|
+
};
|
|
140
|
+
var errorHandler = curry(throwError)(errorMessages);
|
|
141
|
+
var validators = {
|
|
142
|
+
changes: validateChanges,
|
|
143
|
+
selector: validateSelector,
|
|
144
|
+
handler: validateHandler,
|
|
145
|
+
initial: validateInitial
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
function create(initial) {
|
|
149
|
+
var handler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
150
|
+
validators.initial(initial);
|
|
151
|
+
validators.handler(handler);
|
|
152
|
+
var state = {
|
|
153
|
+
current: initial
|
|
154
|
+
};
|
|
155
|
+
var didUpdate = curry(didStateUpdate)(state, handler);
|
|
156
|
+
var update = curry(updateState)(state);
|
|
157
|
+
var validate = curry(validators.changes)(initial);
|
|
158
|
+
var getChanges = curry(extractChanges)(state);
|
|
159
|
+
|
|
160
|
+
function getState() {
|
|
161
|
+
var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (state) {
|
|
162
|
+
return state;
|
|
163
|
+
};
|
|
164
|
+
validators.selector(selector);
|
|
165
|
+
return selector(state.current);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function setState(causedChanges) {
|
|
169
|
+
compose(didUpdate, update, validate, getChanges)(causedChanges);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return [getState, setState];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function extractChanges(state, causedChanges) {
|
|
176
|
+
return isFunction(causedChanges) ? causedChanges(state.current) : causedChanges;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function updateState(state, changes) {
|
|
180
|
+
state.current = _objectSpread2(_objectSpread2({}, state.current), changes);
|
|
181
|
+
return changes;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function didStateUpdate(state, handler, changes) {
|
|
185
|
+
isFunction(handler) ? handler(state.current) : Object.keys(changes).forEach(function (field) {
|
|
186
|
+
var _handler$field;
|
|
187
|
+
|
|
188
|
+
return (_handler$field = handler[field]) === null || _handler$field === void 0 ? void 0 : _handler$field.call(handler, state.current[field]);
|
|
189
|
+
});
|
|
190
|
+
return changes;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
var index = {
|
|
194
|
+
create: create
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
exports.default = index;
|
|
198
|
+
//# sourceMappingURL=state-local.js.map
|
package/lib/node_modules/.pnpm/state-local@1.0.7/node_modules/state-local/lib/es/state-local.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-local.js","sources":["../../../../../../../../../node_modules/.pnpm/state-local@1.0.7/node_modules/state-local/lib/es/state-local.js"],"sourcesContent":["function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction compose() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (x) {\n return fns.reduceRight(function (y, f) {\n return f(y);\n }, x);\n };\n}\n\nfunction curry(fn) {\n return function curried() {\n var _this = this;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return args.length >= fn.length ? fn.apply(this, args) : function () {\n for (var _len3 = arguments.length, nextArgs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n nextArgs[_key3] = arguments[_key3];\n }\n\n return curried.apply(_this, [].concat(args, nextArgs));\n };\n };\n}\n\nfunction isObject(value) {\n return {}.toString.call(value).includes('Object');\n}\n\nfunction isEmpty(obj) {\n return !Object.keys(obj).length;\n}\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\n\nfunction hasOwnProperty(object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n}\n\nfunction validateChanges(initial, changes) {\n if (!isObject(changes)) errorHandler('changeType');\n if (Object.keys(changes).some(function (field) {\n return !hasOwnProperty(initial, field);\n })) errorHandler('changeField');\n return changes;\n}\n\nfunction validateSelector(selector) {\n if (!isFunction(selector)) errorHandler('selectorType');\n}\n\nfunction validateHandler(handler) {\n if (!(isFunction(handler) || isObject(handler))) errorHandler('handlerType');\n if (isObject(handler) && Object.values(handler).some(function (_handler) {\n return !isFunction(_handler);\n })) errorHandler('handlersType');\n}\n\nfunction validateInitial(initial) {\n if (!initial) errorHandler('initialIsRequired');\n if (!isObject(initial)) errorHandler('initialType');\n if (isEmpty(initial)) errorHandler('initialContent');\n}\n\nfunction throwError(errorMessages, type) {\n throw new Error(errorMessages[type] || errorMessages[\"default\"]);\n}\n\nvar errorMessages = {\n initialIsRequired: 'initial state is required',\n initialType: 'initial state should be an object',\n initialContent: 'initial state shouldn\\'t be an empty object',\n handlerType: 'handler should be an object or a function',\n handlersType: 'all handlers should be a functions',\n selectorType: 'selector should be a function',\n changeType: 'provided value of changes should be an object',\n changeField: 'it seams you want to change a field in the state which is not specified in the \"initial\" state',\n \"default\": 'an unknown error accured in `state-local` package'\n};\nvar errorHandler = curry(throwError)(errorMessages);\nvar validators = {\n changes: validateChanges,\n selector: validateSelector,\n handler: validateHandler,\n initial: validateInitial\n};\n\nfunction create(initial) {\n var handler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n validators.initial(initial);\n validators.handler(handler);\n var state = {\n current: initial\n };\n var didUpdate = curry(didStateUpdate)(state, handler);\n var update = curry(updateState)(state);\n var validate = curry(validators.changes)(initial);\n var getChanges = curry(extractChanges)(state);\n\n function getState() {\n var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (state) {\n return state;\n };\n validators.selector(selector);\n return selector(state.current);\n }\n\n function setState(causedChanges) {\n compose(didUpdate, update, validate, getChanges)(causedChanges);\n }\n\n return [getState, setState];\n}\n\nfunction extractChanges(state, causedChanges) {\n return isFunction(causedChanges) ? causedChanges(state.current) : causedChanges;\n}\n\nfunction updateState(state, changes) {\n state.current = _objectSpread2(_objectSpread2({}, state.current), changes);\n return changes;\n}\n\nfunction didStateUpdate(state, handler, changes) {\n isFunction(handler) ? handler(state.current) : Object.keys(changes).forEach(function (field) {\n var _handler$field;\n\n return (_handler$field = handler[field]) === null || _handler$field === void 0 ? void 0 : _handler$field.call(handler, state.current[field]);\n });\n return changes;\n}\n\nvar index = {\n create: create\n};\n\nexport default index;\n"],"names":[],"mappings":";;;;AAAA,SAAS,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE;AAC1C,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE;AAClB,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE;AACpC,MAAM,KAAK,EAAE,KAAK;AAClB,MAAM,UAAU,EAAE,IAAI;AACtB,MAAM,YAAY,EAAE,IAAI;AACxB,MAAM,QAAQ,EAAE,IAAI;AACpB,KAAK,CAAC,CAAC;AACP,GAAG,MAAM;AACT,IAAI,GAAG,CAAC,GAAG,C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AO,EAAE;AACjD,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,UAAU,KAAK,EAAE;AAC/F,IAAI,IAAI,cAAc,CAAC;AACvB;AACA,IAAI,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACjJ,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,OAAO,CAAC;AACjB,CAAC;AACD;AACG,IAAC,KAAK,GAAG;AACZ,EAAE,MAAM,EAAE,MAAM;AAChB;;;;","x_google_ignoreList":[0]}
|
|
@@ -5,31 +5,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
require('./config/index.js');
|
|
7
7
|
require('../../../utils/index.js');
|
|
8
|
-
|
|
8
|
+
require('../../../../node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/index.js');
|
|
9
9
|
var codeEditor = require('./config/code-editor.js');
|
|
10
10
|
var createNamespace = require('../../../utils/create-namespace.js');
|
|
11
|
+
var index = require('../../../../node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.48.0/node_modules/@monaco-editor/loader/lib/es/loader/index.js');
|
|
11
12
|
var codeThemeList = require('./config/code-theme-list.js');
|
|
12
13
|
|
|
13
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
14
|
-
function _interopNamespaceDefault(e) {
|
|
15
|
-
var n = Object.create(null);
|
|
16
|
-
if (e) {
|
|
17
|
-
Object.keys(e).forEach(function (k) {
|
|
18
|
-
if (k !== 'default') {
|
|
19
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () { return e[k]; }
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
n.default = e;
|
|
28
|
-
return Object.freeze(n);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
var monaco__namespace = /*#__PURE__*/_interopNamespaceDefault(monaco);
|
|
32
|
-
|
|
33
14
|
"use strict";
|
|
34
15
|
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
35
16
|
...{ name: "LlCodeEditor" },
|
|
@@ -40,64 +21,21 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
40
21
|
const props = __props;
|
|
41
22
|
const emits = __emit;
|
|
42
23
|
const bem = createNamespace.createNamespace("code-editor");
|
|
43
|
-
|
|
44
|
-
getWorker(_, label) {
|
|
45
|
-
if (label === "json") {
|
|
46
|
-
return new Worker(
|
|
47
|
-
new URL(
|
|
48
|
-
"monaco-editor/esm/vs/language/json/json.worker.js",
|
|
49
|
-
(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('packages/components/code-editor/src/code-editor.vue2.js', document.baseURI).href))
|
|
50
|
-
),
|
|
51
|
-
{ type: "module" }
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
if (["css", "scss", "less"].includes(label)) {
|
|
55
|
-
return new Worker(
|
|
56
|
-
new URL(
|
|
57
|
-
"monaco-editor/esm/vs/language/css/css.worker.js",
|
|
58
|
-
(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('packages/components/code-editor/src/code-editor.vue2.js', document.baseURI).href))
|
|
59
|
-
),
|
|
60
|
-
{ type: "module" }
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
if (["html", "handlebars", "razor"].includes(label)) {
|
|
64
|
-
return new Worker(
|
|
65
|
-
new URL(
|
|
66
|
-
"monaco-editor/esm/vs/language/html/html.worker.js",
|
|
67
|
-
(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('packages/components/code-editor/src/code-editor.vue2.js', document.baseURI).href))
|
|
68
|
-
),
|
|
69
|
-
{ type: "module" }
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
if (["typescript", "javascript"].includes(label)) {
|
|
73
|
-
return new Worker(
|
|
74
|
-
new URL(
|
|
75
|
-
"monaco-editor/esm/vs/language/typescript/ts.worker.js",
|
|
76
|
-
(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('packages/components/code-editor/src/code-editor.vue2.js', document.baseURI).href))
|
|
77
|
-
),
|
|
78
|
-
{ type: "module" }
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
return new Worker(
|
|
82
|
-
new URL("monaco-editor/esm/vs/editor/editor.worker.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('packages/components/code-editor/src/code-editor.vue2.js', document.baseURI).href))),
|
|
83
|
-
{
|
|
84
|
-
type: "module"
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
};
|
|
24
|
+
let monaco;
|
|
89
25
|
let editor;
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
|
|
26
|
+
const editorRef = vue.ref();
|
|
27
|
+
const initMonacoEditor = async () => {
|
|
28
|
+
index.default.config({ "vs/nls": { availableLanguages: { "*": "zh-cn" } } });
|
|
29
|
+
monaco = await index.default.init();
|
|
30
|
+
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
|
|
93
31
|
noSemanticValidation: true,
|
|
94
32
|
noSyntaxValidation: false
|
|
95
33
|
});
|
|
96
|
-
|
|
97
|
-
target:
|
|
34
|
+
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
|
|
35
|
+
target: monaco.languages.typescript.ScriptTarget.ES2020,
|
|
98
36
|
allowNonTsExtensions: true
|
|
99
37
|
});
|
|
100
|
-
editor =
|
|
38
|
+
editor = monaco.editor.create(editorRef.value, {
|
|
101
39
|
value: props.value,
|
|
102
40
|
language: props.language,
|
|
103
41
|
theme: props.theme,
|
|
@@ -105,12 +43,12 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
105
43
|
...props.options,
|
|
106
44
|
readOnly: props.disabled
|
|
107
45
|
});
|
|
108
|
-
handleChangeTheme(props.theme);
|
|
109
46
|
editor.onDidChangeModelContent(() => {
|
|
110
47
|
const value = editor.getValue();
|
|
111
48
|
emits("update:value", value);
|
|
112
49
|
emits("change", value);
|
|
113
50
|
});
|
|
51
|
+
handleChangeTheme(props.theme);
|
|
114
52
|
emits("editor-mounted", editor);
|
|
115
53
|
};
|
|
116
54
|
const handleChangeTheme = async (theme) => {
|
|
@@ -120,13 +58,13 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
120
58
|
...find.data
|
|
121
59
|
};
|
|
122
60
|
try {
|
|
123
|
-
|
|
124
|
-
|
|
61
|
+
monaco.editor.defineTheme(theme, themeData);
|
|
62
|
+
monaco.editor.setTheme(theme);
|
|
125
63
|
} catch (error) {
|
|
126
|
-
|
|
64
|
+
monaco.editor.setTheme("vs");
|
|
127
65
|
}
|
|
128
66
|
} else {
|
|
129
|
-
|
|
67
|
+
monaco.editor.setTheme("vs");
|
|
130
68
|
}
|
|
131
69
|
};
|
|
132
70
|
vue.watch(
|
|
@@ -150,21 +88,22 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
150
88
|
vue.watch(
|
|
151
89
|
() => props.language,
|
|
152
90
|
(newValue) => {
|
|
153
|
-
|
|
91
|
+
monaco.editor.setModelLanguage(editor.getModel(), newValue);
|
|
154
92
|
}
|
|
155
93
|
);
|
|
156
94
|
vue.onBeforeUnmount(() => {
|
|
157
95
|
editor.dispose();
|
|
158
96
|
});
|
|
159
|
-
vue.onMounted(() => {
|
|
160
|
-
|
|
97
|
+
vue.onMounted(async () => {
|
|
98
|
+
await initMonacoEditor();
|
|
161
99
|
});
|
|
162
100
|
return (_ctx, _cache) => {
|
|
163
101
|
return vue.openBlock(), vue.createElementBlock(
|
|
164
102
|
"div",
|
|
165
103
|
{
|
|
166
|
-
|
|
167
|
-
|
|
104
|
+
id: "monaco-editor",
|
|
105
|
+
ref_key: "editorRef",
|
|
106
|
+
ref: editorRef,
|
|
168
107
|
class: vue.normalizeClass(vue.unref(bem).b()),
|
|
169
108
|
style: vue.normalizeStyle({
|
|
170
109
|
width: props.width,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-editor.vue2.js","sources":["../../../../../../packages/components/code-editor/src/code-editor.vue"],"sourcesContent":["<template>\n <div\n ref=\"
|
|
1
|
+
{"version":3,"file":"code-editor.vue2.js","sources":["../../../../../../packages/components/code-editor/src/code-editor.vue"],"sourcesContent":["<template>\n <div\n id=\"monaco-editor\"\n ref=\"editorRef\"\n :class=\"bem.b()\"\n :style=\"{\n width: props.width,\n height: props.height\n }\"\n />\n</template>\n\n<script lang=\"ts\" setup>\nimport { onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport {\n codeEditorProps,\n codeEditorEmits,\n defaultOptions,\n codeThemeList\n} from './config'\nimport { createNamespace } from '@ll-plus/utils'\n// @ts-ignore\n// import * as monaco from 'monaco-editor'\n// import { useMonacoEditor } from './config/hooks'\nimport loader from '@monaco-editor/loader'\n\ndefineOptions({ name: 'LlCodeEditor' })\n\nconst props = defineProps(codeEditorProps)\nconst emits = defineEmits(codeEditorEmits)\nconst bem = createNamespace('code-editor')\n\n// const { monacoRef, initMonaco } = useMonacoEditor()\nlet monaco: any\nlet editor: any\n// self.MonacoEnvironment = {\n// getWorker(_: string, label: string) {\n// if (label === 'json') {\n// return new Worker(\n// new URL(\n// 'monaco-editor/esm/vs/language/json/json.worker.js',\n// import.meta.url\n// ),\n// { type: 'module' }\n// )\n// }\n// if (['css', 'scss', 'less'].includes(label)) {\n// return new Worker(\n// new URL(\n// 'monaco-editor/esm/vs/language/css/css.worker.js',\n// import.meta.url\n// ),\n// { type: 'module' }\n// )\n// }\n// if (['html', 'handlebars', 'razor'].includes(label)) {\n// return new Worker(\n// new URL(\n// 'monaco-editor/esm/vs/language/html/html.worker.js',\n// import.meta.url\n// ),\n// { type: 'module' }\n// )\n// }\n// if (['typescript', 'javascript'].includes(label)) {\n// return new Worker(\n// new URL(\n// 'monaco-editor/esm/vs/language/typescript/ts.worker.js',\n// import.meta.url\n// ),\n// { type: 'module' }\n// )\n// }\n// return new Worker(\n// new URL('monaco-editor/esm/vs/editor/editor.worker.js', import.meta.url),\n// {\n// type: 'module'\n// }\n// )\n// }\n// }\n\nconst editorRef = ref()\nconst initMonacoEditor = async () => {\n loader.config({ 'vs/nls': { availableLanguages: { '*': 'zh-cn' } } })\n monaco = await loader.init()\n monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({\n noSemanticValidation: true,\n noSyntaxValidation: false\n })\n monaco.languages.typescript.javascriptDefaults.setCompilerOptions({\n target: monaco.languages.typescript.ScriptTarget.ES2020,\n allowNonTsExtensions: true\n })\n\n editor = monaco.editor.create(editorRef.value, {\n value: props.value,\n language: props.language,\n theme: props.theme,\n ...defaultOptions,\n ...props.options,\n readOnly: props.disabled\n })\n // 监听值的变化\n editor.onDidChangeModelContent(() => {\n const value = editor.getValue() //给父组件实时返回最新文本\n emits('update:value', value)\n emits('change', value)\n })\n handleChangeTheme(props.theme)\n\n emits('editor-mounted', editor)\n}\nconst handleChangeTheme = async (theme: string) => {\n const find = codeThemeList.find(item => item.value === theme)\n if (find) {\n const themeData = {\n ...find.data\n }\n try {\n monaco.editor.defineTheme(theme, themeData)\n monaco.editor.setTheme(theme)\n } catch (error) {\n monaco.editor.setTheme('vs')\n }\n } else {\n monaco.editor.setTheme('vs')\n }\n}\nwatch(\n () => props.value,\n newValue => {\n if (editor) {\n const value = editor.getValue()\n if (newValue !== value) {\n editor.setValue(newValue)\n }\n }\n }\n)\n\nwatch(\n () => props.options,\n newValue => {\n editor.updateOptions(newValue)\n },\n { deep: true }\n)\n\nwatch(\n () => props.language,\n newValue => {\n monaco.editor.setModelLanguage(editor.getModel()!, newValue)\n }\n)\n\nonBeforeUnmount(() => {\n editor.dispose()\n})\n\nonMounted(async () => {\n await initMonacoEditor()\n})\n</script>\n"],"names":["createNamespace","ref","loader","defaultOptions","codeThemeList","watch","onBeforeUnmount","onMounted"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4BA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AACd,IAAM,MAAA,GAAA,GAAMA,gCAAgB,aAAa,CAAA,CAAA;AAGzC,IAAI,IAAA,MAAA,CAAA;AACJ,IAAI,IAAA,MAAA,CAAA;AAgDJ,IAAA,MAAM,YAAYC,OAAI,EAAA,CAAA;AACtB,IAAA,MAAM,mBAAmB,YAAY;AACnC,MAAOC,aAAA,CAAA,MAAA,CAAO,EAAE,QAAA,EAAU,EAAE,kBAAA,EAAoB,EAAE,GAAK,EAAA,OAAA,EAAU,EAAA,EAAG,CAAA,CAAA;AACpE,MAAS,MAAA,GAAA,MAAMA,cAAO,IAAK,EAAA,CAAA;AAC3B,MAAO,MAAA,CAAA,SAAA,CAAU,UAAW,CAAA,kBAAA,CAAmB,qBAAsB,CAAA;AAAA,QACnE,oBAAsB,EAAA,IAAA;AAAA,QACtB,kBAAoB,EAAA,KAAA;AAAA,OACrB,CAAA,CAAA;AACD,MAAO,MAAA,CAAA,SAAA,CAAU,UAAW,CAAA,kBAAA,CAAmB,kBAAmB,CAAA;AAAA,QAChE,MAAQ,EAAA,MAAA,CAAO,SAAU,CAAA,UAAA,CAA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;AAAA,SAC7B;AAAA,OACK,MAAA;AACL,QAAO,MAAA,CAAA,MAAA,CAAO,SAAS,IAAI,CAAA,CAAA;AAAA,OAC7B;AAAA,KACF,CAAA;AACA,IAAAC,SAAA;AAAA,MACE,MAAM,KAAM,CAAA,KAAA;AAAA,MACZ,CAAY,QAAA,KAAA;AACV,QAAA,IAAI,MAAQ,EAAA;AACV,UAAM,MAAA,KAAA,GAAQ,OAAO,QAAS,EAAA,CAAA;AAC9B,UAAA,IAAI,aAAa,KAAO,EAAA;AACtB,YAAA,MAAA,CAAO,SAAS,QAAQ,CAAA,CAAA;AAAA,WAC1B;AAAA,SACF;AAAA,OACF;AAAA,KACF,CAAA;AAEA,IAAAA,SAAA;AAAA,MACE,MAAM,KAAM,CAAA,OAAA;AAAA,MACZ,CAAY,QAAA,KAAA;AACV,QAAA,MAAA,CAAO,cAAc,QAAQ,CAAA,CAAA;AAAA,OAC/B;AAAA,MACA,EAAE,MAAM,IAAK,EAAA;AAAA,KACf,CAAA;AAEA,IAAAA,SAAA;AAAA,MACE,MAAM,KAAM,CAAA,QAAA;AAAA,MACZ,CAAY,QAAA,KAAA;AACV,QAAA,MAAA,CAAO,MAAO,CAAA,gBAAA,CAAiB,MAAO,CAAA,QAAA,IAAa,QAAQ,CAAA,CAAA;AAAA,OAC7D;AAAA,KACF,CAAA;AAEA,IAAAC,mBAAA,CAAgB,MAAM;AACpB,MAAA,MAAA,CAAO,OAAQ,EAAA,CAAA;AAAA,KAChB,CAAA,CAAA;AAED,IAAAC,aAAA,CAAU,YAAY;AACpB,MAAA,MAAM,gBAAiB,EAAA,CAAA;AAAA,KACxB,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -75,7 +75,19 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
75
75
|
const length = list.length;
|
|
76
76
|
if (length >= props.showIconLimit && showDropdown) {
|
|
77
77
|
showIconList.value = list.slice(0, props.showIconLimit - 1).map((item) => ({ ...item, isShowTooltip: true }));
|
|
78
|
-
|
|
78
|
+
const sliceList = list.slice(props.showIconLimit - 1);
|
|
79
|
+
if (sliceList.length === 1) {
|
|
80
|
+
modalIconList.value = sliceList.map((item) => ({
|
|
81
|
+
...item,
|
|
82
|
+
isShowTitle: false,
|
|
83
|
+
isShowTooltip: true
|
|
84
|
+
}));
|
|
85
|
+
} else {
|
|
86
|
+
modalIconList.value = sliceList.map((item) => ({
|
|
87
|
+
...item,
|
|
88
|
+
isShowTitle: true
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
79
91
|
} else {
|
|
80
92
|
showIconList.value = list;
|
|
81
93
|
}
|
|
@@ -107,9 +119,24 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
107
119
|
128
|
|
108
120
|
/* KEYED_FRAGMENT */
|
|
109
121
|
)),
|
|
122
|
+
modalIconList.value.length === 1 ? (vue.openBlock(true), vue.createElementBlock(
|
|
123
|
+
vue.Fragment,
|
|
124
|
+
{ key: 0 },
|
|
125
|
+
vue.renderList(modalIconList.value, (item, index$1) => {
|
|
126
|
+
return vue.openBlock(), vue.createBlock(vue.unref(index.LlIconBase), vue.mergeProps({
|
|
127
|
+
key: index$1,
|
|
128
|
+
ref_for: true
|
|
129
|
+
}, item, {
|
|
130
|
+
data: _ctx.data,
|
|
131
|
+
"tooltip-class": `${vue.unref(bem).e("last-icon")}`
|
|
132
|
+
}), null, 16, ["data", "tooltip-class"]);
|
|
133
|
+
}),
|
|
134
|
+
128
|
|
135
|
+
/* KEYED_FRAGMENT */
|
|
136
|
+
)) : vue.createCommentVNode("v-if", true),
|
|
110
137
|
vue.createCommentVNode(" \u4E0B\u62C9\u63D0\u793A\u7684icon "),
|
|
111
|
-
_ctx.showDropdown && modalIconList.value.length ? (vue.openBlock(), vue.createBlock(_component_a_dropdown, {
|
|
112
|
-
key:
|
|
138
|
+
_ctx.showDropdown && modalIconList.value.length > 1 ? (vue.openBlock(), vue.createBlock(_component_a_dropdown, {
|
|
139
|
+
key: 1,
|
|
113
140
|
"overlay-class-name": `${vue.unref(bem).e("dropdown")} ${props.overlayClassName}`,
|
|
114
141
|
open: dropdownOpen.value,
|
|
115
142
|
trigger: _ctx.trigger,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operate-icon.vue2.js","sources":["../../../../../../packages/components/operate-icon/src/operate-icon.vue"],"sourcesContent":["<template>\n <div :class=\"operateIconClass\">\n <!-- 显示的icon -->\n <ll-icon-base\n v-for=\"(item, index) in showIconList\"\n v-bind=\"item\"\n :key=\"item.iconName\"\n :data=\"data\"\n :is-show=\"Object.keys(item).includes('isShow') ? item.isShow : true\"\n :tooltip-class=\"bem.e(marginButtonClass(index, showIconList.length - 1))\"\n />\n <!-- 下拉提示的icon -->\n <a-dropdown\n v-if=\"showDropdown && modalIconList.length\"\n :overlay-class-name=\"`${bem.e('dropdown')} ${props.overlayClassName}`\"\n :open=\"dropdownOpen\"\n :trigger=\"trigger\"\n @open-change=\"handleDropdownOpenChange\"\n >\n <div :class=\"bem.e('dropdown-container')\">\n <ll-icon-base\n :is-show-tooltip=\"false\"\n :is-show-container=\"showIconList[0].isShowContainer\"\n :icon-type=\"showIconList[0].iconType\"\n :data=\"data\"\n icon-name=\"icon-more\"\n :class=\"bem.e('icon-more')\"\n />\n </div>\n <template #overlay>\n <a-menu @click=\"handleDropdownParentClick\">\n <slot>\n <template v-for=\"item in modalIconList\">\n <a-menu-item\n v-if=\"Object.keys(item).includes('isShow') ? item.isShow : true\"\n :key=\"item.iconName\"\n >\n <ll-icon-base\n v-bind=\"item\"\n :data=\"data\"\n :icon-name=\"showDropdownItemIcon ? item.iconName : ''\"\n />\n </a-menu-item>\n </template>\n </slot>\n </a-menu>\n </template>\n </a-dropdown>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue'\n\nimport { createNamespace } from '@ll-plus/utils'\n\nimport { IconBaseProps, LlIconBase } from '@ll-plus/components'\nimport { operateIconEmits, operateIconProps } from './operate-icon'\n\n// 1.defineOptions\ndefineOptions({\n name: 'LlOperateIcon'\n})\n\n// 2.props/emits\nconst props = defineProps(operateIconProps)\nconst emits = defineEmits(operateIconEmits)\n\n// 3.ref/const\nconst showIconList = ref<IconBaseProps[]>([]) // 显示的icon列表\nconst modalIconList = ref<IconBaseProps[]>([]) // 弹窗的icon列表\nconst dropdownOpen = ref(false) // 下拉菜单的open\nconst defaultList = ref([\n // 默认的icon列表\n {\n iconType: computed(() => props.iconType || 'primary'), // default默认为灰色\n isShowContainer: false, // 是否显示icon容器\n iconName: 'icon-edit',\n tooltipTitle: '编辑',\n disabled: props.disabled,\n onClick: (e: Event, data: any) => {\n emits('edit', e, data)\n }\n },\n {\n iconType: computed(() => props.iconType || 'primary'), // default默认为灰色\n isShowContainer: false, // 是否显示icon容器\n iconName: 'icon-delete',\n tooltipTitle: '删除',\n disabled: props.disabled,\n onClick: (e: Event, data: any) => {\n emits('delete', e, data)\n }\n }\n])\nconst bem = createNamespace('operate-icon')\nconst operateIconClass = computed(() => {\n const isHasDropdown = props.showDropdown && modalIconList.value.length\n return `${bem.b()} ${\n isHasDropdown ? bem.m('has-dropdown') : bem.m('no-dropdown')\n }`\n})\n// 4.methods\n// 点击更多按钮\nconst marginButtonClass = (index, length) => {\n return index < length && props.showDropdown ? 'margin-tooltip' : ''\n}\nconst handleOpenChange = (open: boolean) => emits('onDropdownOpenChange', open)\n// 下拉菜单open\nconst handleDropdownOpenChange = (open: boolean) => {\n dropdownOpen.value = open\n handleOpenChange(open)\n}\nconst handleDropdownParentClick = () => {\n dropdownOpen.value = false\n handleOpenChange(false)\n}\n\n// 5.watch\nwatch(\n () => [props.list, props.showDropdown],\n (data: any) => {\n const [newList, showDropdown] = data\n const list = newList\n ? newList.filter(Boolean).filter(item => Boolean(item.isShow))\n : defaultList.value\n const length = list.length\n if (length >= props.showIconLimit && showDropdown) {\n showIconList.value = list\n .slice(0, props.showIconLimit - 1)\n .map(item => ({ ...item, isShowTooltip: true })) as IconBaseProps[]\n // 默认modal里面要icon后面跟文字\n
|
|
1
|
+
{"version":3,"file":"operate-icon.vue2.js","sources":["../../../../../../packages/components/operate-icon/src/operate-icon.vue"],"sourcesContent":["<template>\n <div :class=\"operateIconClass\">\n <!-- 显示的icon -->\n <ll-icon-base\n v-for=\"(item, index) in showIconList\"\n v-bind=\"item\"\n :key=\"item.iconName\"\n :data=\"data\"\n :is-show=\"Object.keys(item).includes('isShow') ? item.isShow : true\"\n :tooltip-class=\"bem.e(marginButtonClass(index, showIconList.length - 1))\"\n />\n <template v-if=\"modalIconList.length === 1\">\n <ll-icon-base\n v-for=\"(item, index) in modalIconList\"\n :key=\"index\"\n v-bind=\"item\"\n :data=\"data\"\n :tooltip-class=\"`${bem.e('last-icon')}`\"\n />\n </template>\n <!-- 下拉提示的icon -->\n <a-dropdown\n v-if=\"showDropdown && modalIconList.length > 1\"\n :overlay-class-name=\"`${bem.e('dropdown')} ${props.overlayClassName}`\"\n :open=\"dropdownOpen\"\n :trigger=\"trigger\"\n @open-change=\"handleDropdownOpenChange\"\n >\n <div :class=\"bem.e('dropdown-container')\">\n <ll-icon-base\n :is-show-tooltip=\"false\"\n :is-show-container=\"showIconList[0].isShowContainer\"\n :icon-type=\"showIconList[0].iconType\"\n :data=\"data\"\n icon-name=\"icon-more\"\n :class=\"bem.e('icon-more')\"\n />\n </div>\n <template #overlay>\n <a-menu @click=\"handleDropdownParentClick\">\n <slot>\n <template v-for=\"item in modalIconList\">\n <a-menu-item\n v-if=\"Object.keys(item).includes('isShow') ? item.isShow : true\"\n :key=\"item.iconName\"\n >\n <ll-icon-base\n v-bind=\"item\"\n :data=\"data\"\n :icon-name=\"showDropdownItemIcon ? item.iconName : ''\"\n />\n </a-menu-item>\n </template>\n </slot>\n </a-menu>\n </template>\n </a-dropdown>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue'\n\nimport { createNamespace } from '@ll-plus/utils'\n\nimport { IconBaseProps, LlIconBase } from '@ll-plus/components'\nimport { operateIconEmits, operateIconProps } from './operate-icon'\n\n// 1.defineOptions\ndefineOptions({\n name: 'LlOperateIcon'\n})\n\n// 2.props/emits\nconst props = defineProps(operateIconProps)\nconst emits = defineEmits(operateIconEmits)\n\n// 3.ref/const\nconst showIconList = ref<IconBaseProps[]>([]) // 显示的icon列表\nconst modalIconList = ref<IconBaseProps[]>([]) // 弹窗的icon列表\nconst dropdownOpen = ref(false) // 下拉菜单的open\nconst defaultList = ref([\n // 默认的icon列表\n {\n iconType: computed(() => props.iconType || 'primary'), // default默认为灰色\n isShowContainer: false, // 是否显示icon容器\n iconName: 'icon-edit',\n tooltipTitle: '编辑',\n disabled: props.disabled,\n onClick: (e: Event, data: any) => {\n emits('edit', e, data)\n }\n },\n {\n iconType: computed(() => props.iconType || 'primary'), // default默认为灰色\n isShowContainer: false, // 是否显示icon容器\n iconName: 'icon-delete',\n tooltipTitle: '删除',\n disabled: props.disabled,\n onClick: (e: Event, data: any) => {\n emits('delete', e, data)\n }\n }\n])\nconst bem = createNamespace('operate-icon')\nconst operateIconClass = computed(() => {\n const isHasDropdown = props.showDropdown && modalIconList.value.length\n return `${bem.b()} ${\n isHasDropdown ? bem.m('has-dropdown') : bem.m('no-dropdown')\n }`\n})\n// 4.methods\n// 点击更多按钮\nconst marginButtonClass = (index, length) => {\n return index < length && props.showDropdown ? 'margin-tooltip' : ''\n}\nconst handleOpenChange = (open: boolean) => emits('onDropdownOpenChange', open)\n// 下拉菜单open\nconst handleDropdownOpenChange = (open: boolean) => {\n dropdownOpen.value = open\n handleOpenChange(open)\n}\nconst handleDropdownParentClick = () => {\n dropdownOpen.value = false\n handleOpenChange(false)\n}\n\n// 5.watch\nwatch(\n () => [props.list, props.showDropdown],\n (data: any) => {\n const [newList, showDropdown] = data\n const list = newList\n ? newList.filter(Boolean).filter(item => Boolean(item.isShow))\n : defaultList.value\n const length = list.length\n if (length >= props.showIconLimit && showDropdown) {\n showIconList.value = list\n .slice(0, props.showIconLimit - 1)\n .map(item => ({ ...item, isShowTooltip: true })) as IconBaseProps[]\n // 默认modal里面要icon后面跟文字\n const sliceList = list.slice(props.showIconLimit - 1)\n if (sliceList.length === 1) {\n modalIconList.value = sliceList.map((item: any) => ({\n ...item,\n isShowTitle: false,\n isShowTooltip: true\n }))\n } else {\n modalIconList.value = sliceList.map((item: any) => ({\n ...item,\n isShowTitle: true\n }))\n }\n } else {\n showIconList.value = list as IconBaseProps[]\n }\n },\n { immediate: true, deep: true }\n)\n</script>\n"],"names":["ref","computed","createNamespace","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyEA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAGd,IAAM,MAAA,YAAA,GAAeA,OAAqB,CAAA,EAAE,CAAA,CAAA;AAC5C,IAAM,MAAA,aAAA,GAAgBA,OAAqB,CAAA,EAAE,CAAA,CAAA;AAC7C,IAAM,MAAA,YAAA,GAAeA,QAAI,KAAK,CAAA,CAAA;AAC9B,IAAA,MAAM,cAAcA,OAAI,CAAA;AAAA;AAAA,MAEtB;AAAA,QACE,QAAU,EAAAC,YAAA,CAAS,MAAM,KAAA,CAAM,YAAY,SAAS,CAAA;AAAA;AAAA,QACpD,eAAiB,EAAA,KAAA;AAAA;AAAA,QACjB,QAAU,EAAA,WAAA;AAAA,QACV,YAAc,EAAA,cAAA;AAAA,QACd,UAAU,KAAM,CAAA,QAAA;AAAA,QAChB,OAAA,EAAS,CAAC,CAAA,EAAU,IAAc,KAAA;AAChC,UAAM,KAAA,CAAA,MAAA,EAAQ,GAAG,IAAI,CAAA,CAAA;AAAA,SACvB;AAAA,OACF;AAAA,MACA;AAAA,QACE,QAAU,EAAAA,YAAA,CAAS,MAAM,KAAA,CAAM,YAAY,SAAS,CAAA;AAAA;AAAA,QACpD,eAAiB,EAAA,KAAA;AAAA;AAAA,QACjB,QAAU,EAAA,aAAA;AAAA,QACV,YAAc,EAAA,cA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E,SAAA,EAAW,IAAM,EAAA,IAAA,EAAM,IAAK,EAAA;AAAA,KAChC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ll-plus",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.18",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"lodash": "^4.17.21",
|
|
43
43
|
"lodash-es": "^4.17.21",
|
|
44
44
|
"lodash-unified": "^1.0.3",
|
|
45
|
-
"monaco-editor": "^0.48.0",
|
|
46
45
|
"vue-draggable-next": "^2.2.1",
|
|
47
46
|
"vuedraggable": "^4.0.1",
|
|
48
47
|
"@ant-design/icons-vue": "^7.0.1"
|
|
@@ -66,8 +65,7 @@
|
|
|
66
65
|
"@wangeditor/editor": "^5.1.23",
|
|
67
66
|
"@wangeditor/editor-for-vue": "^5.1.12",
|
|
68
67
|
"vue": "^3.4.21",
|
|
69
|
-
"ant-design-vue": "4.x"
|
|
70
|
-
"monaco-editor": "^0.48.0"
|
|
68
|
+
"ant-design-vue": "4.x"
|
|
71
69
|
},
|
|
72
70
|
"scripts": {
|
|
73
71
|
"test": "echo \"Error: no test specified\" && exit 1"
|