qgb-process 0.3.31-beta.1 → 0.3.31-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/qgb-process.common.1.js +120 -122
- package/lib/qgb-process.common.js +5867 -5513
- package/lib/qgb-process.umd.1.js +120 -122
- package/lib/qgb-process.umd.js +5867 -5513
- package/lib/qgb-process.umd.min.js +99 -99
- 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;
|
|
@@ -139,136 +139,134 @@ var html2canvas_default = /*#__PURE__*/__webpack_require__.n(html2canvas);
|
|
|
139
139
|
return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee() {
|
|
140
140
|
var self, edit, selection, emojiText, src, str, _str, range, i, textNode, rangeStartOffset, start;
|
|
141
141
|
return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee$(_context) {
|
|
142
|
-
while (1) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
_context.next = 19;
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
_context.next = 8;
|
|
162
|
-
return _this.getLabelData(item, pLabel);
|
|
163
|
-
case 8:
|
|
164
|
-
src = _context.sent;
|
|
165
|
-
emojiText = document.createElement("img");
|
|
166
|
-
// emojiText.contentEditable = true
|
|
167
|
-
emojiText.align = "middle";
|
|
168
|
-
emojiText.style.verticalAlign = "middle";
|
|
169
|
-
emojiText.style.margin = "3px";
|
|
170
|
-
// emojiText.style.display = "inline-block";
|
|
171
|
-
// emojiText.style.maxWidth = "150px";
|
|
172
|
-
// emojiText.style.minHeight = "30px";
|
|
173
|
-
emojiText.src = src;
|
|
174
|
-
emojiText.dataset.field = item.content ? item.content.field : item.field;
|
|
175
|
-
emojiText.dataset.label = item.content ? item.content.label : item.label;
|
|
176
|
-
// 从业务规则过来
|
|
177
|
-
if (!isCal) {
|
|
178
|
-
emojiText.dataset.field = item.field;
|
|
179
|
-
emojiText.dataset.label = item.label;
|
|
180
|
-
}
|
|
181
|
-
_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;
|
|
182
158
|
break;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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;
|
|
197
187
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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);
|
|
211
209
|
}
|
|
212
210
|
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
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
|
+
// }
|
|
227
225
|
}
|
|
228
|
-
} else {
|
|
229
|
-
edit.appendChild(emojiText);
|
|
230
226
|
}
|
|
231
|
-
// else if (edit.childNodes.length > 0 && selection.anchorOffset == 0) {
|
|
232
|
-
// edit.insertBefore(emojiText, edit.childNodes[0]);
|
|
233
|
-
// }
|
|
234
|
-
|
|
235
|
-
range.setStart(selection.anchorNode, selection.anchorOffset + 1);
|
|
236
|
-
self.setSelection();
|
|
237
227
|
} else {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
// 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;
|
|
255
244
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
//
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
//
|
|
263
|
-
|
|
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;
|
|
264
254
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
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();
|
|
272
270
|
}
|
|
273
271
|
}, _callee);
|
|
274
272
|
}))();
|