qgb-process 0.3.30 → 0.3.31-beta.2
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/lib/qgb-process.common.1.js +124 -122
- package/lib/qgb-process.common.js +7102 -5601
- package/lib/qgb-process.umd.1.js +124 -122
- package/lib/qgb-process.umd.js +7102 -5601
- package/lib/qgb-process.umd.min.1.js +1 -1
- package/lib/qgb-process.umd.min.js +105 -105
- package/package.json +1 -1
package/lib/qgb-process.umd.1.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// ESM COMPAT FLAG
|
|
8
8
|
__webpack_require__.r(__webpack_exports__);
|
|
9
9
|
|
|
10
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
10
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0920ade0-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/formBuilder/components/curTextArea.vue?vue&type=template&id=628c3faf&
|
|
11
11
|
var render = function render() {
|
|
12
12
|
var _vm = this,
|
|
13
13
|
_c = _vm._self._c;
|
|
@@ -58,6 +58,9 @@ var es_array_concat = __webpack_require__("99af");
|
|
|
58
58
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
|
|
59
59
|
var web_dom_collections_for_each = __webpack_require__("159b");
|
|
60
60
|
|
|
61
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.js
|
|
62
|
+
var es_promise = __webpack_require__("e6cf");
|
|
63
|
+
|
|
61
64
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
|
|
62
65
|
var es_regexp_exec = __webpack_require__("ac1f");
|
|
63
66
|
|
|
@@ -82,6 +85,7 @@ var html2canvas_default = /*#__PURE__*/__webpack_require__.n(html2canvas);
|
|
|
82
85
|
|
|
83
86
|
|
|
84
87
|
|
|
88
|
+
|
|
85
89
|
/* harmony default export */ var curTextAreavue_type_script_lang_js_ = ({
|
|
86
90
|
name: "",
|
|
87
91
|
mixins: [],
|
|
@@ -135,136 +139,134 @@ var html2canvas_default = /*#__PURE__*/__webpack_require__.n(html2canvas);
|
|
|
135
139
|
return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee() {
|
|
136
140
|
var self, edit, selection, emojiText, src, str, _str, range, i, textNode, rangeStartOffset, start;
|
|
137
141
|
return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee$(_context) {
|
|
138
|
-
while (1) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
_context.next = 19;
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
_context.next = 8;
|
|
158
|
-
return _this.getLabelData(item, pLabel);
|
|
159
|
-
case 8:
|
|
160
|
-
src = _context.sent;
|
|
161
|
-
emojiText = document.createElement("img");
|
|
162
|
-
// emojiText.contentEditable = true
|
|
163
|
-
emojiText.align = "middle";
|
|
164
|
-
emojiText.style.verticalAlign = "middle";
|
|
165
|
-
emojiText.style.margin = "3px";
|
|
166
|
-
// emojiText.style.display = "inline-block";
|
|
167
|
-
// emojiText.style.maxWidth = "150px";
|
|
168
|
-
// emojiText.style.minHeight = "30px";
|
|
169
|
-
emojiText.src = src;
|
|
170
|
-
emojiText.dataset.field = item.content ? item.content.field : item.field;
|
|
171
|
-
emojiText.dataset.label = item.content ? item.content.label : item.label;
|
|
172
|
-
// 从业务规则过来
|
|
173
|
-
if (!isCal) {
|
|
174
|
-
emojiText.dataset.field = item.field;
|
|
175
|
-
emojiText.dataset.label = item.label;
|
|
176
|
-
}
|
|
177
|
-
_context.next = 20;
|
|
142
|
+
while (1) switch (_context.prev = _context.next) {
|
|
143
|
+
case 0:
|
|
144
|
+
self = _this; // self.setSelection()
|
|
145
|
+
// 编辑框设置焦点
|
|
146
|
+
edit = _this.$refs.calText;
|
|
147
|
+
edit.focus();
|
|
148
|
+
|
|
149
|
+
// 获取选定对象
|
|
150
|
+
selection = getSelection(); // 判断是否有最后光标对象存在
|
|
151
|
+
if (self.lastEditRange) {
|
|
152
|
+
// 存在最后光标对象,选定对象清除所有光标并添加最后光标还原之前的状态
|
|
153
|
+
selection.removeAllRanges();
|
|
154
|
+
selection.addRange(self.lastEditRange);
|
|
155
|
+
}
|
|
156
|
+
if (!(item && (!type || type == "custom"))) {
|
|
157
|
+
_context.next = 19;
|
|
178
158
|
break;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
159
|
+
}
|
|
160
|
+
_context.next = 8;
|
|
161
|
+
return _this.getLabelData(item, pLabel);
|
|
162
|
+
case 8:
|
|
163
|
+
src = _context.sent;
|
|
164
|
+
emojiText = document.createElement("img");
|
|
165
|
+
// emojiText.contentEditable = true
|
|
166
|
+
emojiText.align = "middle";
|
|
167
|
+
emojiText.style.verticalAlign = "middle";
|
|
168
|
+
emojiText.style.margin = "3px";
|
|
169
|
+
// emojiText.style.display = "inline-block";
|
|
170
|
+
// emojiText.style.maxWidth = "150px";
|
|
171
|
+
// emojiText.style.minHeight = "30px";
|
|
172
|
+
emojiText.src = src;
|
|
173
|
+
emojiText.dataset.field = item.content ? item.content.field : item.field;
|
|
174
|
+
emojiText.dataset.label = item.content ? item.content.label : item.label;
|
|
175
|
+
// 从业务规则过来
|
|
176
|
+
if (!isCal) {
|
|
177
|
+
emojiText.dataset.field = item.field;
|
|
178
|
+
emojiText.dataset.label = item.label;
|
|
179
|
+
}
|
|
180
|
+
_context.next = 20;
|
|
181
|
+
break;
|
|
182
|
+
case 19:
|
|
183
|
+
if (type == "cal") {
|
|
184
|
+
str = item.label;
|
|
185
|
+
if (item.type) {
|
|
186
|
+
str = item.value;
|
|
193
187
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
188
|
+
emojiText = document.createTextNode(str);
|
|
189
|
+
emojiText.innerHTML = str;
|
|
190
|
+
} else {
|
|
191
|
+
emojiText = document.createElement("select");
|
|
192
|
+
_str = _this.calMark.reduce(function (total, item, index) {
|
|
193
|
+
return total + "<option value =\"".concat(item, "\">").concat(item, "</option>");
|
|
194
|
+
}, "");
|
|
195
|
+
emojiText.innerHTML = _str;
|
|
196
|
+
}
|
|
197
|
+
case 20:
|
|
198
|
+
range = selection.getRangeAt(0); // 判断选定对象范围是编辑框还是文本节点
|
|
199
|
+
if (selection.anchorNode.nodeName != "#text") {
|
|
200
|
+
// 如果是编辑框范围。则创建表情文本节点进行插入 当光标位置>0时
|
|
201
|
+
if (edit.childNodes.length > 0 && selection.anchorOffset > 0) {
|
|
202
|
+
// 如果文本框的子元素大于0,则表示有其他元素,则按照位置插入表情节点
|
|
203
|
+
for (i = 0; i < edit.childNodes.length; i++) {
|
|
204
|
+
if (i == selection.anchorOffset - 1) {
|
|
205
|
+
if (edit.childNodes[i].nextSibling) {
|
|
206
|
+
edit.insertBefore(emojiText, edit.childNodes[i].nextSibling);
|
|
207
|
+
} else {
|
|
208
|
+
edit.appendChild(emojiText);
|
|
207
209
|
}
|
|
208
210
|
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
211
|
+
}
|
|
212
|
+
} else if (edit.childNodes.length > 0 && selection.anchorOffset == 0) {
|
|
213
|
+
// 当光标位置==0时
|
|
214
|
+
for (i = 0; i < edit.childNodes.length; i++) {
|
|
215
|
+
if (i == selection.anchorOffset) {
|
|
216
|
+
// if (edit.childNodes[i].nextSibling) {
|
|
217
|
+
// edit.insertBefore(
|
|
218
|
+
// emojiText,
|
|
219
|
+
// edit.childNodes[i + 1].nextSibling
|
|
220
|
+
// );
|
|
221
|
+
// } else {
|
|
222
|
+
debugger;
|
|
223
|
+
edit.insertBefore(emojiText, edit.childNodes[0]);
|
|
224
|
+
// }
|
|
223
225
|
}
|
|
224
|
-
} else {
|
|
225
|
-
edit.appendChild(emojiText);
|
|
226
226
|
}
|
|
227
|
-
// else if (edit.childNodes.length > 0 && selection.anchorOffset == 0) {
|
|
228
|
-
// edit.insertBefore(emojiText, edit.childNodes[0]);
|
|
229
|
-
// }
|
|
230
|
-
|
|
231
|
-
range.setStart(selection.anchorNode, selection.anchorOffset + 1);
|
|
232
|
-
self.setSelection();
|
|
233
227
|
} else {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
// start += 2;
|
|
228
|
+
edit.appendChild(emojiText);
|
|
229
|
+
}
|
|
230
|
+
// else if (edit.childNodes.length > 0 && selection.anchorOffset == 0) {
|
|
231
|
+
// edit.insertBefore(emojiText, edit.childNodes[0]);
|
|
232
|
+
// }
|
|
233
|
+
|
|
234
|
+
range.setStart(selection.anchorNode, selection.anchorOffset + 1);
|
|
235
|
+
self.setSelection();
|
|
236
|
+
} else {
|
|
237
|
+
// 如果是文本节点则先获取光标对象
|
|
238
|
+
range = selection.getRangeAt(0); // 获取光标对象的范围界定对象,一般就是textNode对象
|
|
239
|
+
textNode = range.startContainer; // 获取光标位置
|
|
240
|
+
rangeStartOffset = range.startOffset; // 文本节点在光标位置处插入新的表情内容
|
|
241
|
+
edit.childNodes.forEach(function (item, index) {
|
|
242
|
+
if (item == textNode) {
|
|
243
|
+
start = index;
|
|
251
244
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
//
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
//
|
|
259
|
-
|
|
245
|
+
});
|
|
246
|
+
if (rangeStartOffset == 0) {
|
|
247
|
+
// textNode.before(emojiText);
|
|
248
|
+
range.insertNode(emojiText);
|
|
249
|
+
start += 1;
|
|
250
|
+
} else {
|
|
251
|
+
// textNode.after(emojiText);
|
|
252
|
+
range.insertNode(emojiText);
|
|
253
|
+
// start += 2;
|
|
260
254
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
255
|
+
// 创建新的光标对象
|
|
256
|
+
// var range = document.createRange();
|
|
257
|
+
// 光标对象的范围界定为新建的表情节点
|
|
258
|
+
// range.selectNodeContents(edit);
|
|
259
|
+
// range.setStart(edit, start);
|
|
260
|
+
// range.collapse(true);
|
|
261
|
+
// selection.removeAllRanges();
|
|
262
|
+
// selection.addRange(range);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
_this.lastEditRange = selection.getRangeAt(0);
|
|
266
|
+
edit.focus();
|
|
267
|
+
case 24:
|
|
268
|
+
case "end":
|
|
269
|
+
return _context.stop();
|
|
268
270
|
}
|
|
269
271
|
}, _callee);
|
|
270
272
|
}))();
|