@qualtrics/plugin-ui-react 1.3.3 → 1.4.0-alpha.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/.dockerignore +10 -0
- package/.eslintrc.js +1 -1
- package/Dockerfile +18 -0
- package/Makefile +33 -4
- package/README.md +28 -0
- package/dist/common/capture-event/capture-event.d.ts +13 -0
- package/dist/common/capture-event/capture-event.test.d.ts +1 -0
- package/dist/common/copy-text/copy-text.d.ts +8 -0
- package/dist/common/copy-text/copy-text.test.d.ts +1 -0
- package/dist/common/field-mapper/field-mapper-key/field-mapper-key.d.ts +12 -0
- package/dist/common/field-mapper/field-mapper-row/field-mapper-row.d.ts +17 -0
- package/dist/common/field-mapper/field-mapper-value/field-mapper-value.d.ts +11 -0
- package/dist/common/field-mapper/field-mapper.d.ts +20 -0
- package/dist/common/field-mapper/index.d.ts +4 -0
- package/dist/common/piped-text-input/piped-text-input.d.ts +2 -2
- package/dist/common/piped-text-select/piped-text-menu/piped-text-menu-item/piped-text-menu-item.d.ts +16 -0
- package/dist/common/piped-text-select/piped-text-menu/piped-text-submenu-item/piped-text-submenu-item.d.ts +13 -0
- package/dist/common/portal.d.ts +3 -0
- package/dist/hooks/use-id.d.ts +7 -0
- package/dist/index.d.ts +4 -1
- package/dist/lib/models/field-mapper-item.d.ts +7 -0
- package/dist/lib/models/piped-text-menu-item-data.d.ts +21 -0
- package/dist/lib/models/piped-text.d.ts +16 -0
- package/dist/lib/type-validation/validate-primitives.d.ts +1 -0
- package/dist/main.es.js +959 -172
- package/dist/main.js +963 -170
- package/jenkins.groovy +284 -0
- package/jenkinsPipelineUtils/jira.groovy +84 -0
- package/jenkinsPipelineUtils/notifications.groovy +34 -0
- package/jenkinsPipelineUtils/pipelineControls.groovy +56 -0
- package/jenkinsPipelineUtils/trs.groovy +30 -0
- package/package.json +7 -6
- package/test_results/junit.xml +101 -0
- package/.bee +0 -2
- package/Jenkinsfile +0 -109
- package/bee +0 -932
package/dist/main.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @license @qualtrics/plugin-ui-react 1.
|
|
1
|
+
/*! @license @qualtrics/plugin-ui-react 1.4.0-alpha.0
|
|
2
2
|
Qualtrics Software License Agreement
|
|
3
3
|
|
|
4
4
|
1. General.
|
|
@@ -57,19 +57,19 @@ import 'core-js/modules/es.array.for-each.js';
|
|
|
57
57
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
|
58
58
|
import React, { Component, useState, useEffect, useRef, useCallback } from 'react';
|
|
59
59
|
import _get from 'lodash.get';
|
|
60
|
-
import { Button, InputGroup, Input, Icon, IconTypes, LoadingSpinner, IconButton, Tooltip, SelectMenu, MenuItem, Label } from '@qualtrics/ui-react';
|
|
61
|
-
import { ErrorIcon, PipedTextIcon, RemoveItemIcon } from '@qualtrics/ui-react/icons';
|
|
60
|
+
import { Button, InputGroup, Input, Icon, IconTypes, LoadingSpinner, IconButton, Tooltip, SelectMenu, MenuItem, Label, Dropdown, DropdownButton, DropdownList, DropdownOption } from '@qualtrics/ui-react';
|
|
61
|
+
import { ErrorIcon, PipedTextIcon, RemoveItemIcon, CheckIcon, AddIcon } from '@qualtrics/ui-react/icons';
|
|
62
62
|
import 'core-js/modules/es.string.anchor.js';
|
|
63
|
+
import 'core-js/modules/es.array.filter.js';
|
|
63
64
|
import 'core-js/modules/es.string.trim.js';
|
|
64
65
|
import 'core-js/modules/es.array.map.js';
|
|
65
66
|
import 'core-js/modules/es.array.concat.js';
|
|
66
|
-
import 'core-js/modules/es.array.filter.js';
|
|
67
|
-
import 'regenerator-runtime/runtime.js';
|
|
68
67
|
import _cloneDeep from 'lodash.clonedeep';
|
|
69
68
|
import 'core-js/modules/es.array.is-array.js';
|
|
70
69
|
import { Manager, Reference, Popper } from 'react-popper';
|
|
71
70
|
import ReactDOM from 'react-dom';
|
|
72
71
|
import 'core-js/modules/web.timers.js';
|
|
72
|
+
import uuid, { v4 } from 'uuid';
|
|
73
73
|
import 'core-js/modules/es.function.name.js';
|
|
74
74
|
import 'core-js/modules/es.array.slice.js';
|
|
75
75
|
import 'core-js/modules/es.array.iterator.js';
|
|
@@ -77,7 +77,6 @@ import 'core-js/modules/web.dom-collections.iterator.js';
|
|
|
77
77
|
import 'core-js/modules/es.array.find.js';
|
|
78
78
|
import 'core-js/modules/es.object.assign.js';
|
|
79
79
|
import _cloneDeepWith from 'lodash.clonedeepwith';
|
|
80
|
-
import uuid from 'uuid';
|
|
81
80
|
import 'core-js/modules/es.regexp.exec.js';
|
|
82
81
|
import 'core-js/modules/es.string.search.js';
|
|
83
82
|
|
|
@@ -108,8 +107,8 @@ function styleInject(css, ref) {
|
|
|
108
107
|
}
|
|
109
108
|
}
|
|
110
109
|
|
|
111
|
-
var css_248z$
|
|
112
|
-
styleInject(css_248z$
|
|
110
|
+
var css_248z$j = ".react-app {\n background-color: RGBA(0, 0, 0, 0.1); }\n";
|
|
111
|
+
styleInject(css_248z$j);
|
|
113
112
|
|
|
114
113
|
function ownKeys(object, enumerableOnly) {
|
|
115
114
|
var keys = Object.keys(object);
|
|
@@ -137,6 +136,351 @@ function _objectSpread2(target) {
|
|
|
137
136
|
return target;
|
|
138
137
|
}
|
|
139
138
|
|
|
139
|
+
function _regeneratorRuntime() {
|
|
140
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
141
|
+
|
|
142
|
+
_regeneratorRuntime = function () {
|
|
143
|
+
return exports;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
var exports = {},
|
|
147
|
+
Op = Object.prototype,
|
|
148
|
+
hasOwn = Op.hasOwnProperty,
|
|
149
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
150
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
151
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
152
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
153
|
+
|
|
154
|
+
function define(obj, key, value) {
|
|
155
|
+
return Object.defineProperty(obj, key, {
|
|
156
|
+
value: value,
|
|
157
|
+
enumerable: !0,
|
|
158
|
+
configurable: !0,
|
|
159
|
+
writable: !0
|
|
160
|
+
}), obj[key];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
try {
|
|
164
|
+
define({}, "");
|
|
165
|
+
} catch (err) {
|
|
166
|
+
define = function (obj, key, value) {
|
|
167
|
+
return obj[key] = value;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
172
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
173
|
+
generator = Object.create(protoGenerator.prototype),
|
|
174
|
+
context = new Context(tryLocsList || []);
|
|
175
|
+
return generator._invoke = function (innerFn, self, context) {
|
|
176
|
+
var state = "suspendedStart";
|
|
177
|
+
return function (method, arg) {
|
|
178
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
179
|
+
|
|
180
|
+
if ("completed" === state) {
|
|
181
|
+
if ("throw" === method) throw arg;
|
|
182
|
+
return doneResult();
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
for (context.method = method, context.arg = arg;;) {
|
|
186
|
+
var delegate = context.delegate;
|
|
187
|
+
|
|
188
|
+
if (delegate) {
|
|
189
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
190
|
+
|
|
191
|
+
if (delegateResult) {
|
|
192
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
193
|
+
return delegateResult;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
198
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
199
|
+
context.dispatchException(context.arg);
|
|
200
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
201
|
+
state = "executing";
|
|
202
|
+
var record = tryCatch(innerFn, self, context);
|
|
203
|
+
|
|
204
|
+
if ("normal" === record.type) {
|
|
205
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
206
|
+
return {
|
|
207
|
+
value: record.arg,
|
|
208
|
+
done: context.done
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
}(innerFn, self, context), generator;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function tryCatch(fn, obj, arg) {
|
|
219
|
+
try {
|
|
220
|
+
return {
|
|
221
|
+
type: "normal",
|
|
222
|
+
arg: fn.call(obj, arg)
|
|
223
|
+
};
|
|
224
|
+
} catch (err) {
|
|
225
|
+
return {
|
|
226
|
+
type: "throw",
|
|
227
|
+
arg: err
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
exports.wrap = wrap;
|
|
233
|
+
var ContinueSentinel = {};
|
|
234
|
+
|
|
235
|
+
function Generator() {}
|
|
236
|
+
|
|
237
|
+
function GeneratorFunction() {}
|
|
238
|
+
|
|
239
|
+
function GeneratorFunctionPrototype() {}
|
|
240
|
+
|
|
241
|
+
var IteratorPrototype = {};
|
|
242
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
243
|
+
return this;
|
|
244
|
+
});
|
|
245
|
+
var getProto = Object.getPrototypeOf,
|
|
246
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
247
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
248
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
249
|
+
|
|
250
|
+
function defineIteratorMethods(prototype) {
|
|
251
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
252
|
+
define(prototype, method, function (arg) {
|
|
253
|
+
return this._invoke(method, arg);
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
259
|
+
function invoke(method, arg, resolve, reject) {
|
|
260
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
261
|
+
|
|
262
|
+
if ("throw" !== record.type) {
|
|
263
|
+
var result = record.arg,
|
|
264
|
+
value = result.value;
|
|
265
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
266
|
+
invoke("next", value, resolve, reject);
|
|
267
|
+
}, function (err) {
|
|
268
|
+
invoke("throw", err, resolve, reject);
|
|
269
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
270
|
+
result.value = unwrapped, resolve(result);
|
|
271
|
+
}, function (error) {
|
|
272
|
+
return invoke("throw", error, resolve, reject);
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
reject(record.arg);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
var previousPromise;
|
|
280
|
+
|
|
281
|
+
this._invoke = function (method, arg) {
|
|
282
|
+
function callInvokeWithMethodAndArg() {
|
|
283
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
284
|
+
invoke(method, arg, resolve, reject);
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
293
|
+
var method = delegate.iterator[context.method];
|
|
294
|
+
|
|
295
|
+
if (undefined === method) {
|
|
296
|
+
if (context.delegate = null, "throw" === context.method) {
|
|
297
|
+
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
298
|
+
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
return ContinueSentinel;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
305
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
306
|
+
var info = record.arg;
|
|
307
|
+
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function pushTryEntry(locs) {
|
|
311
|
+
var entry = {
|
|
312
|
+
tryLoc: locs[0]
|
|
313
|
+
};
|
|
314
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function resetTryEntry(entry) {
|
|
318
|
+
var record = entry.completion || {};
|
|
319
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function Context(tryLocsList) {
|
|
323
|
+
this.tryEntries = [{
|
|
324
|
+
tryLoc: "root"
|
|
325
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function values(iterable) {
|
|
329
|
+
if (iterable) {
|
|
330
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
331
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
332
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
333
|
+
|
|
334
|
+
if (!isNaN(iterable.length)) {
|
|
335
|
+
var i = -1,
|
|
336
|
+
next = function next() {
|
|
337
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
338
|
+
|
|
339
|
+
return next.value = undefined, next.done = !0, next;
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
return next.next = next;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
return {
|
|
347
|
+
next: doneResult
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function doneResult() {
|
|
352
|
+
return {
|
|
353
|
+
value: undefined,
|
|
354
|
+
done: !0
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
359
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
360
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
361
|
+
}, exports.mark = function (genFun) {
|
|
362
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
363
|
+
}, exports.awrap = function (arg) {
|
|
364
|
+
return {
|
|
365
|
+
__await: arg
|
|
366
|
+
};
|
|
367
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
368
|
+
return this;
|
|
369
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
370
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
371
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
372
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
373
|
+
return result.done ? result.value : iter.next();
|
|
374
|
+
});
|
|
375
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
376
|
+
return this;
|
|
377
|
+
}), define(Gp, "toString", function () {
|
|
378
|
+
return "[object Generator]";
|
|
379
|
+
}), exports.keys = function (object) {
|
|
380
|
+
var keys = [];
|
|
381
|
+
|
|
382
|
+
for (var key in object) keys.push(key);
|
|
383
|
+
|
|
384
|
+
return keys.reverse(), function next() {
|
|
385
|
+
for (; keys.length;) {
|
|
386
|
+
var key = keys.pop();
|
|
387
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
return next.done = !0, next;
|
|
391
|
+
};
|
|
392
|
+
}, exports.values = values, Context.prototype = {
|
|
393
|
+
constructor: Context,
|
|
394
|
+
reset: function (skipTempReset) {
|
|
395
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
396
|
+
},
|
|
397
|
+
stop: function () {
|
|
398
|
+
this.done = !0;
|
|
399
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
400
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
401
|
+
return this.rval;
|
|
402
|
+
},
|
|
403
|
+
dispatchException: function (exception) {
|
|
404
|
+
if (this.done) throw exception;
|
|
405
|
+
var context = this;
|
|
406
|
+
|
|
407
|
+
function handle(loc, caught) {
|
|
408
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
412
|
+
var entry = this.tryEntries[i],
|
|
413
|
+
record = entry.completion;
|
|
414
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
415
|
+
|
|
416
|
+
if (entry.tryLoc <= this.prev) {
|
|
417
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
418
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
419
|
+
|
|
420
|
+
if (hasCatch && hasFinally) {
|
|
421
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
422
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
423
|
+
} else if (hasCatch) {
|
|
424
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
425
|
+
} else {
|
|
426
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
427
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
abrupt: function (type, arg) {
|
|
433
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
434
|
+
var entry = this.tryEntries[i];
|
|
435
|
+
|
|
436
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
437
|
+
var finallyEntry = entry;
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
443
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
444
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
445
|
+
},
|
|
446
|
+
complete: function (record, afterLoc) {
|
|
447
|
+
if ("throw" === record.type) throw record.arg;
|
|
448
|
+
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
449
|
+
},
|
|
450
|
+
finish: function (finallyLoc) {
|
|
451
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
452
|
+
var entry = this.tryEntries[i];
|
|
453
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
catch: function (tryLoc) {
|
|
457
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
458
|
+
var entry = this.tryEntries[i];
|
|
459
|
+
|
|
460
|
+
if (entry.tryLoc === tryLoc) {
|
|
461
|
+
var record = entry.completion;
|
|
462
|
+
|
|
463
|
+
if ("throw" === record.type) {
|
|
464
|
+
var thrown = record.arg;
|
|
465
|
+
resetTryEntry(entry);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
return thrown;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
throw new Error("illegal catch attempt");
|
|
473
|
+
},
|
|
474
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
475
|
+
return this.delegate = {
|
|
476
|
+
iterator: values(iterable),
|
|
477
|
+
resultName: resultName,
|
|
478
|
+
nextLoc: nextLoc
|
|
479
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
480
|
+
}
|
|
481
|
+
}, exports;
|
|
482
|
+
}
|
|
483
|
+
|
|
140
484
|
function _typeof(obj) {
|
|
141
485
|
"@babel/helpers - typeof";
|
|
142
486
|
|
|
@@ -242,18 +586,17 @@ function _inherits(subClass, superClass) {
|
|
|
242
586
|
}
|
|
243
587
|
|
|
244
588
|
function _getPrototypeOf(o) {
|
|
245
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
589
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
246
590
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
247
591
|
};
|
|
248
592
|
return _getPrototypeOf(o);
|
|
249
593
|
}
|
|
250
594
|
|
|
251
595
|
function _setPrototypeOf(o, p) {
|
|
252
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
596
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
253
597
|
o.__proto__ = p;
|
|
254
598
|
return o;
|
|
255
599
|
};
|
|
256
|
-
|
|
257
600
|
return _setPrototypeOf(o, p);
|
|
258
601
|
}
|
|
259
602
|
|
|
@@ -580,7 +923,7 @@ function languageCodeAdapter(languageCode) {
|
|
|
580
923
|
return adaptedCode;
|
|
581
924
|
}
|
|
582
925
|
|
|
583
|
-
|
|
926
|
+
/******************************************************************************
|
|
584
927
|
Copyright (c) Microsoft Corporation.
|
|
585
928
|
|
|
586
929
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -661,8 +1004,8 @@ var Portal = function (_Component) {
|
|
|
661
1004
|
return Portal;
|
|
662
1005
|
}(Component);
|
|
663
1006
|
|
|
664
|
-
var css_248z$
|
|
665
|
-
styleInject(css_248z$
|
|
1007
|
+
var css_248z$i = ".q-popover {\n position: absolute;\n z-index: 1000;\n padding: 4px 0;\n font-size: 14px;\n line-height: 20px;\n color: #32363A;\n fill: #333;\n list-style: none;\n min-width: 160px;\n max-width: 500px;\n min-height: 10px;\n max-height: 99%;\n background: #fff;\n border-radius: 4px;\n box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 0px 10px 1px rgba(0, 0, 0, 0.14), 0 0px 10px 2px rgba(0, 0, 0, 0.12);\n z-index: 9000; }\n\nbody .q-popover {\n max-height: 50vh;\n overflow-y: scroll;\n max-width: 30vw; }\n";
|
|
1008
|
+
styleInject(css_248z$i);
|
|
666
1009
|
|
|
667
1010
|
var globalClickRegistry = new EventRegistry();
|
|
668
1011
|
var DEFAULT_PLACEMENT = 'bottom-start';
|
|
@@ -776,10 +1119,10 @@ function initGlobalListener() {
|
|
|
776
1119
|
});
|
|
777
1120
|
}
|
|
778
1121
|
|
|
779
|
-
var css_248z$
|
|
780
|
-
styleInject(css_248z$
|
|
1122
|
+
var css_248z$h = "div[role=\"menu\"] .piped-text-search-input-container {\n padding: 5px 10px; }\n\n.piped-text-search-input {\n padding: 10px 12px;\n user-select: none;\n box-sizing: border-box;\n overflow-x: hidden;\n text-overflow: ellipsis;\n align-content: center;\n padding: 4px 8px 8px; }\n .piped-text-search-input input.q-plugin-popover-input {\n box-sizing: border-box;\n height: 36px;\n padding: 7px 9px; }\n\n.piped-text-menu-empty-anchor {\n /* the margin-right hack was not in harmony with tao.\n now, the empty-anchor is truly empty */ }\n\n.piped-text-submenu-item-container {\n position: relative; }\n .piped-text-submenu-item-container .piped-text-menu .piped-text-submenu-anchor {\n position: absolute;\n z-index: -1;\n bottom: 0;\n top: 0;\n left: 0;\n right: 0;\n min-width: 100%; }\n\n.piped-text-menu-item, .piped-text-submenu-item {\n padding: 10px 12px;\n user-select: none;\n box-sizing: border-box;\n overflow-x: hidden;\n text-overflow: ellipsis; }\n .piped-text-menu-item:not(.piped-text-header):not(.piped-text-disabled):hover, .piped-text-submenu-item:not(.piped-text-header):not(.piped-text-disabled):hover {\n cursor: pointer;\n background: RGBA(50, 54, 58, 0.08); }\n .piped-text-menu-item.piped-text-header, .piped-text-submenu-item.piped-text-header {\n font-size: 12px;\n line-height: 16px;\n font-weight: 700;\n padding: 12px; }\n .piped-text-menu-item.piped-text-disabled:not(.piped-text-header), .piped-text-submenu-item.piped-text-disabled:not(.piped-text-header) {\n color: RGB(116, 119, 122); }\n\n.piped-text-submenu-item {\n padding-right: 24px; }\n\n.piped-text-information-message {\n padding: 10px 12px;\n user-select: none;\n box-sizing: border-box;\n overflow-x: hidden;\n text-overflow: ellipsis;\n color: #74777A;\n text-align: center;\n white-space: pre-line; }\n\n.piped-text-loading-spinner {\n width: fit-content;\n margin: 0 auto; }\n\n.piped-text-error-container {\n color: #BB0000; }\n .piped-text-error-container .piped-text-error-icon {\n padding: 8px 0; }\n .piped-text-error-container .piped-text-error-icon svg {\n fill: #BB0000;\n display: block;\n margin: 0 auto; }\n .piped-text-error-container .piped-text-error-text {\n text-align: center;\n white-space: pre-line;\n padding: 0 12px 8px; }\n\n.embedded-data-menu {\n padding: 10px 12px;\n user-select: none;\n box-sizing: border-box;\n overflow-x: hidden;\n text-overflow: ellipsis;\n align-content: center;\n padding: 4px 8px 8px; }\n .embedded-data-menu input.q-plugin-popover-input {\n box-sizing: border-box;\n height: 36px;\n padding: 7px 9px; }\n";
|
|
1123
|
+
styleInject(css_248z$h);
|
|
781
1124
|
|
|
782
|
-
var EmbeddedDataMenu = React.forwardRef(function (props, ref) {
|
|
1125
|
+
var EmbeddedDataMenu = React.forwardRef(function EmbeddedDataMeny(props, ref) {
|
|
783
1126
|
var _useState = useState(''),
|
|
784
1127
|
_useState2 = _slicedToArray(_useState, 2),
|
|
785
1128
|
inputValue = _useState2[0],
|
|
@@ -847,7 +1190,8 @@ var EmbeddedDataMenu = React.forwardRef(function (props, ref) {
|
|
|
847
1190
|
ignoreClickSelector: ignoreClickSelector,
|
|
848
1191
|
placement: props.placement || 'right-start'
|
|
849
1192
|
}, React.createElement("div", {
|
|
850
|
-
className: "embedded-data-menu"
|
|
1193
|
+
className: "embedded-data-menu",
|
|
1194
|
+
ref: ref
|
|
851
1195
|
}, React.createElement("div", null, React.createElement(InputGroup, null, React.createElement(Input, {
|
|
852
1196
|
onChange: handleInputChange,
|
|
853
1197
|
invalid: isInputInvalid,
|
|
@@ -862,8 +1206,151 @@ var EmbeddedDataMenu = React.forwardRef(function (props, ref) {
|
|
|
862
1206
|
}))))));
|
|
863
1207
|
});
|
|
864
1208
|
|
|
865
|
-
|
|
866
|
-
|
|
1209
|
+
/**
|
|
1210
|
+
* Copied from: https://gitlab-app.eng.qops.net/cfe/ui/-/blob/master/packages/ui-react/src/hooks/useId/useId.js
|
|
1211
|
+
* Returns an ID that is stable across renders.
|
|
1212
|
+
* @param {string=} defaultExternalId - ID to be used instead of a randomly generated ID. This ID is only considered on mount, so changes to this ID are ignored.
|
|
1213
|
+
* @returns {String} If an external ID is passed in, the external ID. Otherwise, a randomly generated ID.
|
|
1214
|
+
*/
|
|
1215
|
+
function useId(defaultExternalId) {
|
|
1216
|
+
var currentId = useState(function () {
|
|
1217
|
+
return defaultExternalId !== null && defaultExternalId !== void 0 ? defaultExternalId : v4();
|
|
1218
|
+
})[0];
|
|
1219
|
+
return currentId;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
var css_248z$g = "";
|
|
1223
|
+
styleInject(css_248z$g);
|
|
1224
|
+
|
|
1225
|
+
var css_248z$f = "";
|
|
1226
|
+
styleInject(css_248z$f);
|
|
1227
|
+
|
|
1228
|
+
// const WrappedPipedTextMenu = PipedTextMenu as PipedTextMenuType;
|
|
1229
|
+
var PipedTextSubmenuItem = React.forwardRef(function PipedTextSubmenuItem(props, ref) {
|
|
1230
|
+
var submenuAnchorRef = useRef(null);
|
|
1231
|
+
var submenuItemId = useId();
|
|
1232
|
+
var menuItem = props.menuItem;
|
|
1233
|
+
return (React.createElement("div", { "data-testid": "piped-text-submenu", className: "piped-text-submenu-item-container" },
|
|
1234
|
+
menuItem.show && (React.createElement(PipedTextMenu, { "aria-labelledby": submenuItemId,
|
|
1235
|
+
//@ts-ignore
|
|
1236
|
+
items: menuItem.submenu.items, show: menuItem.show, placement: "right-start", onClose: function () {
|
|
1237
|
+
menuItem.show = false;
|
|
1238
|
+
}, allowCustom: menuItem.submenu.allowCustom, customScheme: menuItem.submenu.customScheme, customInputMessage: menuItem.submenu.customInputMessage, searchPlaceholder: menuItem.submenu.searchPlaceholder, errorText: menuItem.submenu.errorText, onSelected: menuItemClicked, anchor: function (ref) { return (React.createElement("div", { ref: ref, className: "piped-text-submenu-anchor" })); }, anchorRef: submenuAnchorRef })),
|
|
1239
|
+
React.createElement("div", {
|
|
1240
|
+
// aria-haspopup="menu"
|
|
1241
|
+
// id={subMenuItemId}
|
|
1242
|
+
className: "piped-text-submenu-item",
|
|
1243
|
+
// role="menuitem"
|
|
1244
|
+
onMouseEnter: function () { return submenuHovered(menuItem); }, ref: submenuAnchorRef },
|
|
1245
|
+
React.createElement("div", { className: "label-text" }, menuItem.label),
|
|
1246
|
+
React.createElement("div", { className: "piped-text-icon" },
|
|
1247
|
+
React.createElement(Icon, { type: IconTypes.ChevronRight, size: "medium" })))));
|
|
1248
|
+
function menuItemClicked(menuItem) {
|
|
1249
|
+
props.onMenuItemClick(menuItem);
|
|
1250
|
+
}
|
|
1251
|
+
function submenuHovered(menuItem) {
|
|
1252
|
+
props.onSubmenuHover(menuItem);
|
|
1253
|
+
}
|
|
1254
|
+
});
|
|
1255
|
+
|
|
1256
|
+
var EMBEDDED_DATA_LOCATOR$1 = 'embeddedData';
|
|
1257
|
+
var PipedTextMenuItem = React.forwardRef(function PipedTextMenuItem(props, ref) {
|
|
1258
|
+
var submenuId = useId();
|
|
1259
|
+
return (React.createElement("div", { className: 'piped-text-menu-item-container', ref: ref }, getMenuItemContent(props.menuItem)));
|
|
1260
|
+
function getMenuItemContent(menuItem) {
|
|
1261
|
+
var innerContent, menuItemEl;
|
|
1262
|
+
var menuItemHeaderClass, menuItemDisabledClass, menuItemClassName;
|
|
1263
|
+
var isSubmenu = checkSubmenuMenuItemItem$1(menuItem);
|
|
1264
|
+
var isDecorated = checkDecoratedMenuItem$1(menuItem);
|
|
1265
|
+
var isEmbeddedDataMenuItem = checkEmbeddedDataMenuItem$1(menuItem);
|
|
1266
|
+
var isFocusable = checkMenuItemFocusable$1(menuItem);
|
|
1267
|
+
var role = isSubmenu
|
|
1268
|
+
? 'submenu'
|
|
1269
|
+
: 'menuitemradio';
|
|
1270
|
+
if (isSubmenu) {
|
|
1271
|
+
innerContent = (React.createElement(PipedTextSubmenuItem, { key: menuItem.key, menuItem: menuItem, onSubmenuHover: handleSubmenuHover, onMenuItemClick: handleMenuItemClick }));
|
|
1272
|
+
}
|
|
1273
|
+
else if (isDecorated) {
|
|
1274
|
+
menuItemHeaderClass = (menuItem.header === true)
|
|
1275
|
+
? 'piped-text-header'
|
|
1276
|
+
: '';
|
|
1277
|
+
menuItemDisabledClass = (menuItem.disabled === true)
|
|
1278
|
+
? 'piped-text-disabled'
|
|
1279
|
+
: '';
|
|
1280
|
+
menuItemClassName = "piped-text-menu-item ".concat(menuItemHeaderClass, " ").concat(menuItemDisabledClass);
|
|
1281
|
+
innerContent = (React.createElement("div", { className: menuItemClassName }, menuItem.label));
|
|
1282
|
+
}
|
|
1283
|
+
else if (isEmbeddedDataMenuItem) {
|
|
1284
|
+
innerContent = (React.createElement("div", { onClick: function () {
|
|
1285
|
+
handleEmbeddedDataItemClick(menuItem);
|
|
1286
|
+
}, onMouseEnter: function () { return handleMenuItemHovered(menuItem); } },
|
|
1287
|
+
React.createElement(EmbeddedDataMenu
|
|
1288
|
+
//@ts-ignore
|
|
1289
|
+
, {
|
|
1290
|
+
//@ts-ignore
|
|
1291
|
+
show: menuItem.show, onSelect: handleEmbeddedDataSelect, anchor: function (ref) { return (React.createElement("div", { ref: ref, className: "embedded-data-menu-anchor" })); } }),
|
|
1292
|
+
React.createElement("div", { className: "piped-text-menu-item" }, menuItem.label)));
|
|
1293
|
+
}
|
|
1294
|
+
else {
|
|
1295
|
+
innerContent = (React.createElement("div", { onClick: function () { return handleMenuItemClick(menuItem); }, onMouseEnter: function () { return handleMenuItemHovered(menuItem); } },
|
|
1296
|
+
React.createElement("div", { className: "piped-text-menu-item" }, menuItem.label)));
|
|
1297
|
+
}
|
|
1298
|
+
menuItemEl = (React.createElement("div", { "aria-haspopup": isSubmenu ? 'menu' : undefined, id: isSubmenu ? submenuId : undefined, role: role, className: "piped-text-menu-item-content", tabIndex: isFocusable ? -1 : undefined }, innerContent));
|
|
1299
|
+
return menuItemEl;
|
|
1300
|
+
}
|
|
1301
|
+
function handleEmbeddedDataItemClick(menuItem) {
|
|
1302
|
+
props.onEmbeddedDataItemClick(menuItem);
|
|
1303
|
+
}
|
|
1304
|
+
function handleMenuItemClick(menuItem) {
|
|
1305
|
+
props.onMenuItemClicked(menuItem);
|
|
1306
|
+
}
|
|
1307
|
+
function handleSubmenuHover(menuItem) {
|
|
1308
|
+
props.onSubmenuHover(menuItem);
|
|
1309
|
+
}
|
|
1310
|
+
function handleMenuItemHovered(menuItem) {
|
|
1311
|
+
props.onMenuItemHover(menuItem);
|
|
1312
|
+
}
|
|
1313
|
+
function handleEmbeddedDataSelect(edLocator) {
|
|
1314
|
+
var edMenuItem;
|
|
1315
|
+
/* Instead of returning the menuItem, we'll construct one that matches the interface.
|
|
1316
|
+
There is no mappable "menuItem" here, when ED values are added they can be different
|
|
1317
|
+
potentially every time, so we trigger events generically ad hoc
|
|
1318
|
+
*/
|
|
1319
|
+
edMenuItem = {
|
|
1320
|
+
value: {
|
|
1321
|
+
locator: edLocator,
|
|
1322
|
+
},
|
|
1323
|
+
};
|
|
1324
|
+
props.onMenuItemClicked(edMenuItem);
|
|
1325
|
+
}
|
|
1326
|
+
});
|
|
1327
|
+
function checkEmbeddedDataMenuItem$1(menuItem) {
|
|
1328
|
+
return menuItem.value === EMBEDDED_DATA_LOCATOR$1;
|
|
1329
|
+
}
|
|
1330
|
+
function checkDecoratedMenuItem$1(menuItem) {
|
|
1331
|
+
return (menuItem.header === true)
|
|
1332
|
+
|| (menuItem.disabled === true);
|
|
1333
|
+
}
|
|
1334
|
+
function checkSubmenuMenuItemItem$1(menuItem) {
|
|
1335
|
+
return !!menuItem.hasSubmenu;
|
|
1336
|
+
}
|
|
1337
|
+
function checkMenuItemFocusable$1(menuItem) {
|
|
1338
|
+
var isEmbeddedData, isSubmenu, isDefaultMenuItem;
|
|
1339
|
+
isEmbeddedData = checkEmbeddedDataMenuItem$1(menuItem);
|
|
1340
|
+
isSubmenu = checkSubmenuMenuItemItem$1(menuItem);
|
|
1341
|
+
isDefaultMenuItem = checkDefaultMenuItem$1(menuItem);
|
|
1342
|
+
return (isEmbeddedData
|
|
1343
|
+
|| isSubmenu
|
|
1344
|
+
|| isDefaultMenuItem);
|
|
1345
|
+
}
|
|
1346
|
+
function checkDefaultMenuItem$1(menuItem) {
|
|
1347
|
+
return !(checkEmbeddedDataMenuItem$1(menuItem)
|
|
1348
|
+
|| checkDecoratedMenuItem$1(menuItem)
|
|
1349
|
+
|| checkSubmenuMenuItemItem$1(menuItem));
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
var css_248z$e = "div[role=\"menu\"] .piped-text-search-input-container {\n padding: 5px 10px; }\n\n.piped-text-search-input {\n padding: 10px 12px;\n user-select: none;\n box-sizing: border-box;\n overflow-x: hidden;\n text-overflow: ellipsis;\n align-content: center;\n padding: 4px 8px 8px; }\n .piped-text-search-input input.q-plugin-popover-input {\n box-sizing: border-box;\n height: 36px;\n padding: 7px 9px; }\n\n.piped-text-menu-empty-anchor {\n /* the margin-right hack was not in harmony with tao.\n now, the empty-anchor is truly empty */ }\n\n.piped-text-submenu-item-container {\n position: relative; }\n .piped-text-submenu-item-container .piped-text-menu .piped-text-submenu-anchor {\n position: absolute;\n z-index: -1;\n bottom: 0;\n top: 0;\n left: 0;\n right: 0;\n min-width: 100%; }\n\n.piped-text-menu-item, .piped-text-submenu-item {\n padding: 10px 12px;\n user-select: none;\n box-sizing: border-box;\n overflow-x: hidden;\n text-overflow: ellipsis; }\n .piped-text-menu-item:not(.piped-text-header):not(.piped-text-disabled):hover, .piped-text-submenu-item:not(.piped-text-header):not(.piped-text-disabled):hover {\n cursor: pointer;\n background: RGBA(50, 54, 58, 0.08); }\n .piped-text-menu-item.piped-text-header, .piped-text-submenu-item.piped-text-header {\n font-size: 12px;\n line-height: 16px;\n font-weight: 700;\n padding: 12px; }\n .piped-text-menu-item.piped-text-disabled:not(.piped-text-header), .piped-text-submenu-item.piped-text-disabled:not(.piped-text-header) {\n color: RGB(116, 119, 122); }\n\n.piped-text-submenu-item {\n padding-right: 24px; }\n\n.piped-text-information-message {\n padding: 10px 12px;\n user-select: none;\n box-sizing: border-box;\n overflow-x: hidden;\n text-overflow: ellipsis;\n color: #74777A;\n text-align: center;\n white-space: pre-line; }\n\n.piped-text-loading-spinner {\n width: fit-content;\n margin: 0 auto; }\n\n.piped-text-error-container {\n color: #BB0000; }\n .piped-text-error-container .piped-text-error-icon {\n padding: 8px 0; }\n .piped-text-error-container .piped-text-error-icon svg {\n fill: #BB0000;\n display: block;\n margin: 0 auto; }\n .piped-text-error-container .piped-text-error-text {\n text-align: center;\n white-space: pre-line;\n padding: 0 12px 8px; }\n";
|
|
1353
|
+
styleInject(css_248z$e);
|
|
867
1354
|
|
|
868
1355
|
var EMBEDDED_DATA_LOCATOR = 'embeddedData';
|
|
869
1356
|
var PipedTextMenu = React.forwardRef(function PipedTextMenu(props, ref) {
|
|
@@ -896,31 +1383,64 @@ var PipedTextMenu = React.forwardRef(function PipedTextMenu(props, ref) {
|
|
|
896
1383
|
setSearchValue = _useState8[1];
|
|
897
1384
|
|
|
898
1385
|
var _useState9 = useState(undefined),
|
|
899
|
-
_useState10 = _slicedToArray(_useState9, 2)
|
|
900
|
-
|
|
901
|
-
setIsSubmenu = _useState10[1];
|
|
1386
|
+
_useState10 = _slicedToArray(_useState9, 2);
|
|
1387
|
+
_useState10[0];
|
|
1388
|
+
var setIsSubmenu = _useState10[1];
|
|
1389
|
+
|
|
1390
|
+
var _useState11 = useState([]),
|
|
1391
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
1392
|
+
itemsToRender = _useState12[0],
|
|
1393
|
+
setItemsToRender = _useState12[1];
|
|
1394
|
+
|
|
1395
|
+
var externalAriaLabelledBy = props['aria-labelledby'];
|
|
1396
|
+
var popoverAriaLabelledBy = useId();
|
|
1397
|
+
|
|
1398
|
+
var _useState13 = useState([]),
|
|
1399
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
1400
|
+
menuChildren = _useState14[0],
|
|
1401
|
+
setMenuChildren = _useState14[1];
|
|
1402
|
+
|
|
1403
|
+
var _useState15 = useState(-1),
|
|
1404
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
1405
|
+
higlightedItemIndex = _useState16[0],
|
|
1406
|
+
setHighlightedItemIndex = _useState16[1];
|
|
1407
|
+
|
|
1408
|
+
var _useState17 = useState([]),
|
|
1409
|
+
_useState18 = _slicedToArray(_useState17, 2);
|
|
1410
|
+
_useState18[0];
|
|
1411
|
+
var setFocusMenuItems = _useState18[1];
|
|
902
1412
|
|
|
903
1413
|
var onClose = props.onClose || function () {
|
|
904
1414
|
return undefined;
|
|
905
1415
|
};
|
|
906
1416
|
|
|
907
|
-
var
|
|
908
|
-
|
|
909
|
-
popoverEl =
|
|
910
|
-
setPopoverEl =
|
|
1417
|
+
var _useState19 = useState(null),
|
|
1418
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
1419
|
+
popoverEl = _useState20[0],
|
|
1420
|
+
setPopoverEl = _useState20[1];
|
|
911
1421
|
|
|
912
1422
|
var popoverRefCb = useCallback(function (el) {
|
|
913
1423
|
setPopoverEl(el);
|
|
914
1424
|
}, []);
|
|
915
1425
|
|
|
916
|
-
var
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
setSearchBoxEl =
|
|
1426
|
+
var _useState21 = useState(null),
|
|
1427
|
+
_useState22 = _slicedToArray(_useState21, 2);
|
|
1428
|
+
_useState22[0];
|
|
1429
|
+
var setSearchBoxEl = _useState22[1];
|
|
920
1430
|
|
|
921
1431
|
var searchBoxRefCb = useCallback(function (el) {
|
|
922
1432
|
setSearchBoxEl(el);
|
|
923
1433
|
}, []);
|
|
1434
|
+
useEffect(function () {
|
|
1435
|
+
var nextMenuChildren;
|
|
1436
|
+
nextMenuChildren = getPipedTextMenuItems(itemsToRender);
|
|
1437
|
+
setMenuChildren(nextMenuChildren);
|
|
1438
|
+
}, [itemsToRender]);
|
|
1439
|
+
useEffect(function () {
|
|
1440
|
+
var nextItemsToRender;
|
|
1441
|
+
nextItemsToRender = (menuItems || []).filter(matchesSearch);
|
|
1442
|
+
setItemsToRender(nextItemsToRender);
|
|
1443
|
+
}, [searchValue, menuItems]);
|
|
924
1444
|
useEffect(function () {
|
|
925
1445
|
var anchorRefEl = _get(props, 'anchorRef.current');
|
|
926
1446
|
|
|
@@ -929,17 +1449,11 @@ var PipedTextMenu = React.forwardRef(function PipedTextMenu(props, ref) {
|
|
|
929
1449
|
var nextIsSubmenu = anchorRefElRole === 'menuitem';
|
|
930
1450
|
setIsSubmenu(nextIsSubmenu);
|
|
931
1451
|
}
|
|
932
|
-
|
|
933
|
-
if (isSubmenu === true) ; else if (isSubmenu === false) {
|
|
934
|
-
if (popoverEl !== null) {
|
|
935
|
-
popoverEl.focus();
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
}, [popoverEl, searchBoxEl, props.anchorRef, isSubmenu]);
|
|
1452
|
+
}, [popoverEl]);
|
|
939
1453
|
useEffect(function () {
|
|
940
|
-
_asyncToGenerator(
|
|
1454
|
+
_asyncToGenerator(_regeneratorRuntime().mark(function _callee() {
|
|
941
1455
|
var newMenuItems;
|
|
942
|
-
return
|
|
1456
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
943
1457
|
while (1) {
|
|
944
1458
|
switch (_context.prev = _context.next) {
|
|
945
1459
|
case 0:
|
|
@@ -1040,7 +1554,7 @@ var PipedTextMenu = React.forwardRef(function PipedTextMenu(props, ref) {
|
|
|
1040
1554
|
return JSON.stringify(item).toLowerCase().includes(searchVal);
|
|
1041
1555
|
};
|
|
1042
1556
|
|
|
1043
|
-
var menuItemClicked = function menuItemClicked(menuItem
|
|
1557
|
+
var menuItemClicked = function menuItemClicked(menuItem) {
|
|
1044
1558
|
if (!menuItem.disabled) {
|
|
1045
1559
|
props.onSelected(menuItem);
|
|
1046
1560
|
}
|
|
@@ -1053,118 +1567,47 @@ var PipedTextMenu = React.forwardRef(function PipedTextMenu(props, ref) {
|
|
|
1053
1567
|
reRenderMenus();
|
|
1054
1568
|
};
|
|
1055
1569
|
|
|
1056
|
-
var handleEmbeddedDataSelect = function handleEmbeddedDataSelect(edLocator) {
|
|
1057
|
-
var edMenuItem;
|
|
1058
|
-
edMenuItem = {
|
|
1059
|
-
value: {
|
|
1060
|
-
locator: edLocator
|
|
1061
|
-
}
|
|
1062
|
-
};
|
|
1063
|
-
props.onSelected(edMenuItem);
|
|
1064
|
-
};
|
|
1065
|
-
|
|
1066
|
-
var SubmenuItem = function SubmenuItem(props) {
|
|
1067
|
-
var submenuAnchorRef = useRef(null);
|
|
1068
|
-
var menuItem = props.menuItem;
|
|
1069
|
-
return React.createElement("div", {
|
|
1070
|
-
"data-testid": "piped-text-submenu",
|
|
1071
|
-
className: "piped-text-submenu-item-container"
|
|
1072
|
-
}, menuItem.show && React.createElement(PipedTextMenu, {
|
|
1073
|
-
items: menuItem.submenu.items,
|
|
1074
|
-
show: menuItem.show,
|
|
1075
|
-
placement: "right-start",
|
|
1076
|
-
onClose: function onClose() {
|
|
1077
|
-
menuItem.show = false;
|
|
1078
|
-
},
|
|
1079
|
-
allowCustom: menuItem.submenu.allowCustom,
|
|
1080
|
-
customScheme: menuItem.submenu.customScheme,
|
|
1081
|
-
customInputMessage: menuItem.submenu.customInputMessage,
|
|
1082
|
-
searchPlaceholder: menuItem.submenu.searchPlaceholder,
|
|
1083
|
-
errorText: menuItem.submenu.errorText,
|
|
1084
|
-
onSelected: menuItemClicked,
|
|
1085
|
-
anchor: function anchor(ref) {
|
|
1086
|
-
return React.createElement("div", {
|
|
1087
|
-
ref: ref,
|
|
1088
|
-
className: "piped-text-submenu-anchor"
|
|
1089
|
-
});
|
|
1090
|
-
},
|
|
1091
|
-
anchorRef: submenuAnchorRef
|
|
1092
|
-
}), React.createElement("div", {
|
|
1093
|
-
className: "piped-text-submenu-item",
|
|
1094
|
-
"aria-haspopup": "menu",
|
|
1095
|
-
role: "menuitem",
|
|
1096
|
-
onMouseEnter: function onMouseEnter($e) {
|
|
1097
|
-
return submenuHovered(menuItem);
|
|
1098
|
-
},
|
|
1099
|
-
ref: submenuAnchorRef
|
|
1100
|
-
}, React.createElement("div", {
|
|
1101
|
-
className: "label-text"
|
|
1102
|
-
}, menuItem.label), React.createElement("div", {
|
|
1103
|
-
className: "piped-text-icon"
|
|
1104
|
-
}, React.createElement(Icon, {
|
|
1105
|
-
type: IconTypes.ChevronRight,
|
|
1106
|
-
size: "medium"
|
|
1107
|
-
}))));
|
|
1108
|
-
};
|
|
1109
|
-
|
|
1110
1570
|
var getPipedTextMenuItems = function getPipedTextMenuItems(menuItems) {
|
|
1571
|
+
var pipedTextMenuItems, nextFocusMenuItems;
|
|
1572
|
+
pipedTextMenuItems = [];
|
|
1573
|
+
nextFocusMenuItems = [];
|
|
1574
|
+
|
|
1111
1575
|
if (menuItems.length === 0 && props.allowCustom === true && props.customInputMessage) {
|
|
1112
1576
|
return React.createElement("div", null, React.createElement("div", {
|
|
1113
1577
|
className: "piped-text-information-message"
|
|
1114
1578
|
}, props.customInputMessage));
|
|
1115
1579
|
}
|
|
1116
1580
|
|
|
1117
|
-
|
|
1118
|
-
var
|
|
1581
|
+
pipedTextMenuItems = menuItems.map(function (menuItem) {
|
|
1582
|
+
var isFocusable, menuItemEl;
|
|
1583
|
+
var menuItemRef = React.createRef();
|
|
1584
|
+
isFocusable = checkMenuItemFocusable(menuItem);
|
|
1585
|
+
menuItemEl = React.createElement(PipedTextMenuItem, {
|
|
1586
|
+
key: menuItem.key,
|
|
1587
|
+
menuItem: menuItem,
|
|
1588
|
+
onSubmenuHover: function onSubmenuHover(menuItem) {
|
|
1589
|
+
submenuHovered(menuItem);
|
|
1590
|
+
},
|
|
1591
|
+
onMenuItemClicked: function onMenuItemClicked(menuItem) {
|
|
1592
|
+
menuItemClicked(menuItem);
|
|
1593
|
+
},
|
|
1594
|
+
onMenuItemHover: function onMenuItemHover(menuItem) {
|
|
1595
|
+
menuItemHovered();
|
|
1596
|
+
},
|
|
1597
|
+
onEmbeddedDataItemClick: function onEmbeddedDataItemClick(menuItem) {
|
|
1598
|
+
embeddedDataItemClicked(menuItem);
|
|
1599
|
+
},
|
|
1600
|
+
ref: menuItemRef
|
|
1601
|
+
});
|
|
1119
1602
|
|
|
1120
|
-
if (
|
|
1121
|
-
|
|
1122
|
-
key: menuItem.key,
|
|
1123
|
-
menuItem: menuItem
|
|
1124
|
-
});
|
|
1125
|
-
} else if (menuItem.header === true || menuItem.disabled === true) {
|
|
1126
|
-
menuItemHeaderClass = menuItem.header === true ? 'piped-text-header' : '';
|
|
1127
|
-
menuItemDisabledClass = menuItem.disabled === true ? 'piped-text-disabled' : '';
|
|
1128
|
-
menuItemClassName = "piped-text-menu-item ".concat(menuItemHeaderClass, " ").concat(menuItemDisabledClass);
|
|
1129
|
-
return React.createElement("div", {
|
|
1130
|
-
key: menuItem.key,
|
|
1131
|
-
className: menuItemClassName
|
|
1132
|
-
}, menuItem.label);
|
|
1133
|
-
} else if (menuItem.value === EMBEDDED_DATA_LOCATOR) {
|
|
1134
|
-
return React.createElement("div", {
|
|
1135
|
-
key: menuItem.key,
|
|
1136
|
-
onClick: function onClick($e) {
|
|
1137
|
-
return embeddedDataItemClicked(menuItem);
|
|
1138
|
-
},
|
|
1139
|
-
onMouseEnter: function onMouseEnter($e) {
|
|
1140
|
-
return menuItemHovered();
|
|
1141
|
-
}
|
|
1142
|
-
}, React.createElement(EmbeddedDataMenu, {
|
|
1143
|
-
show: menuItem.show,
|
|
1144
|
-
onSelect: handleEmbeddedDataSelect,
|
|
1145
|
-
anchor: function anchor(ref) {
|
|
1146
|
-
return React.createElement("div", {
|
|
1147
|
-
ref: ref,
|
|
1148
|
-
className: "embedded-data-menu-anchor"
|
|
1149
|
-
});
|
|
1150
|
-
}
|
|
1151
|
-
}), React.createElement("div", {
|
|
1152
|
-
className: "piped-text-menu-item"
|
|
1153
|
-
}, menuItem.label));
|
|
1154
|
-
} else {
|
|
1155
|
-
return React.createElement("div", {
|
|
1156
|
-
key: menuItem.key,
|
|
1157
|
-
onMouseEnter: function onMouseEnter($e) {
|
|
1158
|
-
return menuItemHovered();
|
|
1159
|
-
},
|
|
1160
|
-
onClick: function onClick($e) {
|
|
1161
|
-
return menuItemClicked(menuItem);
|
|
1162
|
-
}
|
|
1163
|
-
}, React.createElement("div", {
|
|
1164
|
-
className: "piped-text-menu-item"
|
|
1165
|
-
}, menuItem.label));
|
|
1603
|
+
if (isFocusable) {
|
|
1604
|
+
nextFocusMenuItems.push(menuItemEl);
|
|
1166
1605
|
}
|
|
1606
|
+
|
|
1607
|
+
return menuItemEl;
|
|
1167
1608
|
});
|
|
1609
|
+
setFocusMenuItems(nextFocusMenuItems);
|
|
1610
|
+
return pipedTextMenuItems;
|
|
1168
1611
|
};
|
|
1169
1612
|
|
|
1170
1613
|
var handleSearchSubmit = function handleSearchSubmit(e) {
|
|
@@ -1217,7 +1660,6 @@ var PipedTextMenu = React.forwardRef(function PipedTextMenu(props, ref) {
|
|
|
1217
1660
|
if (isLoadError) {
|
|
1218
1661
|
return getLoadError();
|
|
1219
1662
|
} else {
|
|
1220
|
-
var itemsToRender = (menuItems || []).filter(matchesSearch);
|
|
1221
1663
|
return React.createElement("div", {
|
|
1222
1664
|
className: "piped-text-popover-menu"
|
|
1223
1665
|
}, React.createElement("div", {
|
|
@@ -1237,7 +1679,7 @@ var PipedTextMenu = React.forwardRef(function PipedTextMenu(props, ref) {
|
|
|
1237
1679
|
return handleSearchInputClick($e);
|
|
1238
1680
|
},
|
|
1239
1681
|
ref: searchBoxRefCb
|
|
1240
|
-
}))), menuItems === undefined ? getLoadingSpinner() :
|
|
1682
|
+
}))), menuItems === undefined ? getLoadingSpinner() : menuChildren);
|
|
1241
1683
|
}
|
|
1242
1684
|
};
|
|
1243
1685
|
|
|
@@ -1250,20 +1692,35 @@ var PipedTextMenu = React.forwardRef(function PipedTextMenu(props, ref) {
|
|
|
1250
1692
|
anchor: props.anchor,
|
|
1251
1693
|
ignoreClickSelector: props.ignoreClickSelector
|
|
1252
1694
|
}, React.createElement("div", {
|
|
1695
|
+
id: popoverAriaLabelledBy,
|
|
1696
|
+
"aria-labelledby": externalAriaLabelledBy,
|
|
1697
|
+
role: "menu",
|
|
1253
1698
|
className: "piped-text-popover-container",
|
|
1254
1699
|
ref: popoverRefCb,
|
|
1255
1700
|
onFocus: function onFocus($e) {
|
|
1256
1701
|
return handleFocus($e);
|
|
1257
1702
|
},
|
|
1703
|
+
onKeyDown: function onKeyDown($e) {
|
|
1704
|
+
return handleKeyDown($e);
|
|
1705
|
+
},
|
|
1258
1706
|
tabIndex: props.tabIndex !== undefined ? props.tabIndex : -1
|
|
1259
1707
|
}, getMenuContent()), React.createElement(OptionsPlaceholder, {
|
|
1260
1708
|
optionsRef: optionsRef
|
|
1261
1709
|
})));
|
|
1262
1710
|
|
|
1711
|
+
function handleKeyDown(evt) {
|
|
1712
|
+
var nextFocusElIdx;
|
|
1713
|
+
|
|
1714
|
+
if (evt.key === 'ArrowDown') {
|
|
1715
|
+
if (higlightedItemIndex < menuChildren.length) {
|
|
1716
|
+
nextFocusElIdx = higlightedItemIndex + 1;
|
|
1717
|
+
menuChildren[nextFocusElIdx];
|
|
1718
|
+
setHighlightedItemIndex(nextFocusElIdx);
|
|
1719
|
+
}
|
|
1720
|
+
} else if (evt.key === 'ArrowUp') ;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1263
1723
|
function handleFocus(evt) {
|
|
1264
|
-
if (!isSubmenu && searchBoxEl !== null) {
|
|
1265
|
-
searchBoxEl.focus();
|
|
1266
|
-
}
|
|
1267
1724
|
|
|
1268
1725
|
evt.stopPropagation();
|
|
1269
1726
|
}
|
|
@@ -1306,8 +1763,32 @@ function pipedTextDataAdapter(pipedTextData, recursed) {
|
|
|
1306
1763
|
return pipedTextData;
|
|
1307
1764
|
}
|
|
1308
1765
|
|
|
1309
|
-
|
|
1310
|
-
|
|
1766
|
+
function checkDefaultMenuItem(menuItem) {
|
|
1767
|
+
return !(checkEmbeddedDataMenuItem(menuItem) || checkDecoratedMenuItem(menuItem) || checkSubmenuMenuItemItem(menuItem));
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
function checkEmbeddedDataMenuItem(menuItem) {
|
|
1771
|
+
return menuItem.value === EMBEDDED_DATA_LOCATOR;
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
function checkDecoratedMenuItem(menuItem) {
|
|
1775
|
+
return menuItem.header === true || menuItem.disabled === true;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
function checkSubmenuMenuItemItem(menuItem) {
|
|
1779
|
+
return !!menuItem.hasSubmenu;
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
function checkMenuItemFocusable(menuItem) {
|
|
1783
|
+
var isEmbeddedData, isSubmenu, isDefaultMenuItem;
|
|
1784
|
+
isEmbeddedData = checkEmbeddedDataMenuItem(menuItem);
|
|
1785
|
+
isSubmenu = checkSubmenuMenuItemItem(menuItem);
|
|
1786
|
+
isDefaultMenuItem = checkDefaultMenuItem(menuItem);
|
|
1787
|
+
return isEmbeddedData || isSubmenu || isDefaultMenuItem;
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
var css_248z$d = ".piped-text-dropdown button[type=button].popover-toggle-button {\n min-width: 128px; }\n\n.piped-text-popover-container {\n padding: 0; }\n .piped-text-popover-container > * {\n min-height: 32px; }\n .piped-text-popover-container .piped-text-submenu-item .label-text, .piped-text-popover-container .piped-text-submenu-item > .piped-text-icon {\n display: inline-block;\n vertical-align: middle;\n overflow-wrap: break-word;\n word-wrap: break-word;\n -webkit-hyphens: auto;\n -ms-hyphens: auto;\n -moz-hyphens: auto;\n hyphens: auto; }\n .piped-text-popover-container .piped-text-submenu-item .piped-text-icon {\n display: inline-block;\n box-sizing: content-box;\n position: absolute;\n right: 0;\n max-width: 24px;\n min-width: 24px;\n max-height: 24px; }\n .piped-text-popover-container .piped-text-submenu-item .piped-text-icon > svg {\n position: relative;\n margin-left: -5px;\n margin-top: -3px; }\n";
|
|
1791
|
+
styleInject(css_248z$d);
|
|
1311
1792
|
|
|
1312
1793
|
var defaultAnchor = function defaultAnchor(ref) {
|
|
1313
1794
|
return React.createElement("div", {
|
|
@@ -1329,6 +1810,7 @@ function PipedTextSelect(props) {
|
|
|
1329
1810
|
|
|
1330
1811
|
var defaultAnchorRef = useRef(null);
|
|
1331
1812
|
var externalAnchor = props.anchor;
|
|
1813
|
+
var ariaLabelledBy = props['aria-labelledby'];
|
|
1332
1814
|
useEffect(function () {
|
|
1333
1815
|
return function () {
|
|
1334
1816
|
return onClose();
|
|
@@ -1368,7 +1850,8 @@ function PipedTextSelect(props) {
|
|
|
1368
1850
|
items: pipedTextItems,
|
|
1369
1851
|
anchor: actualAnchor,
|
|
1370
1852
|
anchorRef: anchorRef,
|
|
1371
|
-
ignoreClickSelector: props.ignoreClickSelector
|
|
1853
|
+
ignoreClickSelector: props.ignoreClickSelector,
|
|
1854
|
+
"aria-labelledby": ariaLabelledBy
|
|
1372
1855
|
}));
|
|
1373
1856
|
|
|
1374
1857
|
function initializePipedText() {
|
|
@@ -1378,12 +1861,13 @@ function PipedTextSelect(props) {
|
|
|
1378
1861
|
}
|
|
1379
1862
|
}
|
|
1380
1863
|
|
|
1381
|
-
var css_248z$
|
|
1382
|
-
styleInject(css_248z$
|
|
1864
|
+
var css_248z$c = ".piped-text-input .piped-text-input-toggle, .piped-text-input .piped-text-select-container {\n display: inline-block; }\n\n.piped-text-input .piped-text-input-toggle {\n display: flex; }\n .piped-text-input .piped-text-input-toggle input {\n flex: 1 1;\n box-sizing: border-box; }\n .piped-text-input .piped-text-input-toggle input:first-child {\n border-right: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .piped-text-input .piped-text-input-toggle.multiline-input textarea {\n flex: 1 1;\n box-sizing: border-box; }\n .piped-text-input .piped-text-input-toggle input + button, .piped-text-input .piped-text-input-toggle textarea + button {\n margin-left: 4px; }\n\n.piped-text-input .addon-text-container {\n /*\n These styles are intended to match CFE QDS components,\n notably FormField and InputField.\n See: https://gitlab-app.eng.qops.net/cfe/ui/-/blob/master/packages/ui-react/src/FormField/Caption.less\n */\n margin-top: 6px; }\n .piped-text-input .addon-text-container .helper-text, .piped-text-input .addon-text-container .error-text {\n font-size: 12px; }\n .piped-text-input .addon-text-container .helper-text {\n color: #74777a;\n fill: #74777a; }\n .piped-text-input .addon-text-container .helper-text + .error-text {\n margin-top: 4px; }\n .piped-text-input .addon-text-container .error-text {\n display: flex;\n align-items: center;\n color: #b00;\n fill: #b00; }\n .piped-text-input .addon-text-container .error-text .error-text-icon svg {\n margin-left: -2px;\n margin-right: 3px;\n width: 16px;\n height: 16px; }\n";
|
|
1865
|
+
styleInject(css_248z$c);
|
|
1383
1866
|
|
|
1384
1867
|
function PipedTextInput(props) {
|
|
1385
1868
|
var _a = useState(false), showMenu = _a[0], setShowMenu = _a[1];
|
|
1386
1869
|
var _b = useState(), cursorPosition = _b[0], setCursorPosition = _b[1];
|
|
1870
|
+
var pipedTextButtonId = useId();
|
|
1387
1871
|
var pipedTextButtonRef = useRef(null);
|
|
1388
1872
|
/*
|
|
1389
1873
|
This has to be an Object type ref instead of 'string' or React will lose
|
|
@@ -1419,10 +1903,10 @@ function PipedTextInput(props) {
|
|
|
1419
1903
|
React.createElement(Input, __assign({ value: inputRefValue.value, onChange: function (evt) {
|
|
1420
1904
|
onInputChange(evt);
|
|
1421
1905
|
}, onBlur: onInputBlur, placeholder: placeholder, multiline: multiline }, restProps)),
|
|
1422
|
-
React.createElement(IconButton, { "aria-label": "PipedText", "aria-haspopup": "menu", "aria-expanded": showMenu ? true : undefined, role: "button", onClick: toggleMenu, ref: pipedTextButtonRef },
|
|
1906
|
+
React.createElement(IconButton, { id: pipedTextButtonId, "aria-label": "PipedText", "aria-haspopup": "menu", "aria-expanded": showMenu ? true : undefined, role: "button", onClick: toggleMenu, ref: pipedTextButtonRef },
|
|
1423
1907
|
React.createElement(PipedTextIcon, null)),
|
|
1424
1908
|
React.createElement("div", { className: "piped-text-select-container" },
|
|
1425
|
-
React.createElement(PipedTextSelect, { items: items, onSelect: pipedTextSelected, show: showMenu, onClose: handleClose, ignoreClickSelector: "piped-text-input-toggle", anchorRef: pipedTextButtonRef }))),
|
|
1909
|
+
React.createElement(PipedTextSelect, { items: items, onSelect: pipedTextSelected, show: showMenu, onClose: handleClose, ignoreClickSelector: "piped-text-input-toggle", anchorRef: pipedTextButtonRef, "aria-labelledby": pipedTextButtonId }))),
|
|
1426
1910
|
showAddonText() && (React.createElement("div", { className: "addon-text-container" },
|
|
1427
1911
|
helperText && (React.createElement("div", { className: "helper-text" }, helperText)),
|
|
1428
1912
|
errorText && (React.createElement("div", { className: "error-text" },
|
|
@@ -1494,8 +1978,8 @@ function PipedTextInput(props) {
|
|
|
1494
1978
|
}
|
|
1495
1979
|
}
|
|
1496
1980
|
|
|
1497
|
-
var css_248z$
|
|
1498
|
-
styleInject(css_248z$
|
|
1981
|
+
var css_248z$b = ".field-row {\n min-width: 475px;\n display: flex;\n align-items: center; }\n .field-row .field-selector, .field-row .field-input, .field-row .delete-row, .field-row .required-indicator {\n display: inline-block; }\n .field-row .field-selector, .field-row .field-input {\n padding: 0 10px; }\n .field-row .custom-field-name, .field-row .field-input, .field-row .delete-row {\n box-sizing: border-box; }\n .field-row .field-selector {\n min-width: 30%; }\n .field-row .field-selector.required-field button:hover {\n cursor: not-allowed; }\n .field-row .field-selector .required-indicator-container {\n padding-left: 12px;\n display: flex;\n color: #32363A; }\n .field-row .field-selector .required-indicator-container .required-indicator-text {\n min-width: 0;\n font-size: 14px; }\n .field-row .field-selector .required-indicator-container .required-indicator-symbol {\n margin-top: -2px; }\n .field-row .field-selector .left-align {\n text-align: left; }\n .field-row .field-selector .custom-field-name {\n padding-left: 16px;\n padding-right: 30px; }\n .field-row .field-selector .custom-field-name input {\n text-align: center;\n display: inline-block;\n width: 100%;\n padding: 0; }\n .field-row .field-input-container {\n display: flex;\n flex: 1 0;\n align-items: center; }\n .field-row .field-input-container .field-input {\n flex: 1;\n min-width: 0;\n margin-right: 4px; }\n .field-row .field-input-container .delete-row {\n max-width: 36px;\n margin-left: 12px;\n vertical-align: middle; }\n .field-row .field-input-container .delete-row .icon-wrapper {\n display: block;\n width: fit-content;\n margin: 0 auto;\n min-width: 41px; }\n .field-row .field-input-container .delete-row .icon-wrapper:hover {\n cursor: pointer; }\n .field-row .full-width {\n width: 100%; }\n";
|
|
1982
|
+
styleInject(css_248z$b);
|
|
1499
1983
|
|
|
1500
1984
|
function FieldRow(props) {
|
|
1501
1985
|
var _useState = useState(props.children),
|
|
@@ -1669,8 +2153,8 @@ function FieldRow(props) {
|
|
|
1669
2153
|
}, getRowDelete())));
|
|
1670
2154
|
}
|
|
1671
2155
|
|
|
1672
|
-
var css_248z$
|
|
1673
|
-
styleInject(css_248z$
|
|
2156
|
+
var css_248z$a = "";
|
|
2157
|
+
styleInject(css_248z$a);
|
|
1674
2158
|
|
|
1675
2159
|
function FieldItem(props) {
|
|
1676
2160
|
var label = props.name || undefined;
|
|
@@ -1687,8 +2171,8 @@ function FieldItem(props) {
|
|
|
1687
2171
|
}, label);
|
|
1688
2172
|
}
|
|
1689
2173
|
|
|
1690
|
-
var css_248z$
|
|
1691
|
-
styleInject(css_248z$
|
|
2174
|
+
var css_248z$9 = ".task-fields {\n margin-right: 100px; }\n .task-fields .add-field-button .add-field-button-label {\n padding: 0 3px; }\n .task-fields .field-headers {\n margin-bottom: 10px;\n padding-left: 12px; }\n .task-fields .field-headers .field-row {\n color: #6A6D70;\n font-weight: bold; }\n .task-fields .field-headers .field-row .field-selector label, .task-fields .field-headers .field-row .field-input label {\n font-size: 12px; }\n .task-fields .field-headers .field-row .field-selector {\n padding-top: 0;\n padding-right: 24px;\n padding-bottom: 0;\n padding-left: 0; }\n .task-fields .field-headers .field-row .field-input {\n padding-top: 0;\n padding-right: 0;\n padding-bottom: 0;\n padding-left: 12px; }\n .task-fields .field-rows {\n padding-bottom: 12px; }\n .task-fields .field-rows .field-row {\n border-top: 1px solid #E5E5E5; }\n .task-fields .field-rows .field-row .field-selector {\n padding-top: 8px;\n padding-right: 12px;\n padding-bottom: 8px;\n padding-left: 12px; }\n .task-fields .field-rows .field-row .field-input {\n border-left: 1px solid #E5E5E5;\n padding-top: 8px;\n padding-right: 0;\n padding-bottom: 8px;\n padding-left: 12px; }\n\n.q-popover .field-item {\n padding: 5px 32px; }\n .q-popover .field-item:hover {\n cursor: pointer;\n user-select: none;\n background: #007ac0;\n color: #fff;\n fill: #fff; }\n";
|
|
2175
|
+
styleInject(css_248z$9);
|
|
1692
2176
|
|
|
1693
2177
|
var uuidv4 = uuid.v4;
|
|
1694
2178
|
var CUSTOM_TYPE = 'custom';
|
|
@@ -2073,8 +2557,8 @@ function AddFieldHeaders(props) {
|
|
|
2073
2557
|
}
|
|
2074
2558
|
}
|
|
2075
2559
|
|
|
2076
|
-
var css_248z$
|
|
2077
|
-
styleInject(css_248z$
|
|
2560
|
+
var css_248z$8 = ".select-item .item {\n padding: 5px 32px;\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n width: 100%; }\n .select-item .item .checked-container, .select-item .item .item-content {\n display: inline-block; }\n .select-item .item .checked-container {\n margin-bottom: -3px;\n transition: opacity cubic-bezier(0.4, 0, 0.2, 1) 0.1s; }\n .select-item .item .checked-container.checked {\n opacity: 1; }\n .select-item .item .checked-container:not(.checked) {\n opacity: 0; }\n .select-item .item:hover {\n cursor: pointer;\n user-select: none;\n background: #007ac0;\n color: #fff;\n fill: #fff; }\n";
|
|
2561
|
+
styleInject(css_248z$8);
|
|
2078
2562
|
|
|
2079
2563
|
function SelectItem(props) {
|
|
2080
2564
|
var checked = props.checked || false;
|
|
@@ -2096,8 +2580,8 @@ function SelectItem(props) {
|
|
|
2096
2580
|
}, children)));
|
|
2097
2581
|
}
|
|
2098
2582
|
|
|
2099
|
-
var css_248z$
|
|
2100
|
-
styleInject(css_248z$
|
|
2583
|
+
var css_248z$7 = "";
|
|
2584
|
+
styleInject(css_248z$7);
|
|
2101
2585
|
|
|
2102
2586
|
function MultiselectDropdown(props) {
|
|
2103
2587
|
var _useState = useState(false),
|
|
@@ -2152,8 +2636,8 @@ function MultiselectDropdown(props) {
|
|
|
2152
2636
|
})));
|
|
2153
2637
|
}
|
|
2154
2638
|
|
|
2155
|
-
var css_248z = ".dynamic-search-input .search-input {\n box-sizing: border-box; }\n\n.dynamic-search-popover-child {\n padding: 5px 32px; }\n .dynamic-search-popover-child:hover {\n cursor: pointer;\n user-select: none;\n background: #007ac0;\n color: #fff;\n fill: #fff; }\n";
|
|
2156
|
-
styleInject(css_248z);
|
|
2639
|
+
var css_248z$6 = ".dynamic-search-input .search-input {\n box-sizing: border-box; }\n\n.dynamic-search-popover-child {\n padding: 5px 32px; }\n .dynamic-search-popover-child:hover {\n cursor: pointer;\n user-select: none;\n background: #007ac0;\n color: #fff;\n fill: #fff; }\n";
|
|
2640
|
+
styleInject(css_248z$6);
|
|
2157
2641
|
|
|
2158
2642
|
function DynamicSearchInput(props) {
|
|
2159
2643
|
var _useState = useState(false),
|
|
@@ -2218,9 +2702,9 @@ function DynamicSearchInput(props) {
|
|
|
2218
2702
|
};
|
|
2219
2703
|
|
|
2220
2704
|
var defaultSearch = function () {
|
|
2221
|
-
var _ref = _asyncToGenerator(
|
|
2705
|
+
var _ref = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(value) {
|
|
2222
2706
|
var results;
|
|
2223
|
-
return
|
|
2707
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2224
2708
|
while (1) {
|
|
2225
2709
|
switch (_context.prev = _context.next) {
|
|
2226
2710
|
case 0:
|
|
@@ -2253,9 +2737,9 @@ function DynamicSearchInput(props) {
|
|
|
2253
2737
|
}();
|
|
2254
2738
|
|
|
2255
2739
|
var handleInputChange = function () {
|
|
2256
|
-
var _ref2 = _asyncToGenerator(
|
|
2740
|
+
var _ref2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee2(event) {
|
|
2257
2741
|
var inputVal, searchFunc, results, resultsType, nextSearchResults;
|
|
2258
|
-
return
|
|
2742
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2259
2743
|
while (1) {
|
|
2260
2744
|
switch (_context2.prev = _context2.next) {
|
|
2261
2745
|
case 0:
|
|
@@ -2336,4 +2820,307 @@ function SearchItem(props) {
|
|
|
2336
2820
|
}, props.children);
|
|
2337
2821
|
}
|
|
2338
2822
|
|
|
2339
|
-
|
|
2823
|
+
var css_248z$5 = ".capture-event .capture-event-controls {\n display: flex;\n align-items: center;\n gap: 10px;\n margin-bottom: 15px; }\n .capture-event .capture-event-controls .waiting-message {\n display: flex;\n align-items: center; }\n .capture-event .capture-event-controls .waiting-message .waiting-label {\n color: #74777a;\n margin-left: 8px; }\n\n.capture-event .payload-block {\n text-align: left; }\n .capture-event .payload-block .payload-label {\n text-decoration: underline;\n margin-bottom: 3px; }\n";
|
|
2824
|
+
styleInject(css_248z$5);
|
|
2825
|
+
|
|
2826
|
+
function CaptureEvent(props) {
|
|
2827
|
+
var _a = useState(props.payload), payload = _a[0]; _a[1];
|
|
2828
|
+
var _b = useState(props.capturing || false), capturing = _b[0], setCapturing = _b[1];
|
|
2829
|
+
var _c = useState(props.waitingForEventTranslation), waitingLabel = _c[0], setWaitingLabel = _c[1];
|
|
2830
|
+
return (React.createElement("div", { className: "capture-event" },
|
|
2831
|
+
React.createElement("div", { className: "capture-event-controls" },
|
|
2832
|
+
getCaptureEventButton(),
|
|
2833
|
+
capturing && (React.createElement("div", { className: "waiting-message" },
|
|
2834
|
+
React.createElement(LoadingSpinner, { show: true, size: 'small' }),
|
|
2835
|
+
React.createElement("div", { className: "waiting-label" }, waitingLabel)))),
|
|
2836
|
+
payload && (React.createElement("div", { className: "payload-block" },
|
|
2837
|
+
React.createElement("div", { className: "payload-label" }, "".concat(props.payloadTranslation, ":")),
|
|
2838
|
+
React.createElement("div", { className: "payload" },
|
|
2839
|
+
React.createElement("pre", null, payload))))));
|
|
2840
|
+
function getCaptureEventButton() {
|
|
2841
|
+
if (capturing) {
|
|
2842
|
+
return (React.createElement("div", { className: "capture-event-button-container" },
|
|
2843
|
+
React.createElement(Button, { kind: "secondary", onClick: cancelCapture }, props.cancelCaptureTranslation)));
|
|
2844
|
+
}
|
|
2845
|
+
else {
|
|
2846
|
+
return (React.createElement("div", { className: "capture-event-button-container" },
|
|
2847
|
+
React.createElement(Button, { kind: "primary", onClick: startCapture }, props.captureNextEventTranslation)));
|
|
2848
|
+
}
|
|
2849
|
+
}
|
|
2850
|
+
function startCapture() {
|
|
2851
|
+
setCapturing(true);
|
|
2852
|
+
props.onStart();
|
|
2853
|
+
}
|
|
2854
|
+
function cancelCapture() {
|
|
2855
|
+
setCapturing(false);
|
|
2856
|
+
setWaitingLabel(props.waitingForEventTranslation);
|
|
2857
|
+
props.onCancel();
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
|
|
2861
|
+
var css_248z$4 = ".copy-text {\n display: flex;\n column-gap: 8px; }\n .copy-text .input-container {\n width: 100%; }\n .copy-text .input-container .input-textbox {\n width: 100%; }\n .copy-text .copy-button-container .selected-button {\n display: flex; }\n .copy-text .copy-button-container .selected-button .selected-button-text {\n display: flex;\n align-self: center; }\n";
|
|
2862
|
+
styleInject(css_248z$4);
|
|
2863
|
+
|
|
2864
|
+
var COPY_BUTTON_SELECTED_TEXT_TIME = 1.5 * 1000; // seconds * milliseconds
|
|
2865
|
+
function CopyText(props) {
|
|
2866
|
+
var _a = useState(false), copyButtonSelected = _a[0], setCopyButtonSelected = _a[1];
|
|
2867
|
+
return (React.createElement("div", { className: "copy-text" },
|
|
2868
|
+
React.createElement("div", { className: "input-container" },
|
|
2869
|
+
React.createElement(Input, { className: "input-textbox", defaultValue: props.text, "aria-readonly": true, readOnly: true })),
|
|
2870
|
+
React.createElement("div", { className: "copy-button-container" },
|
|
2871
|
+
React.createElement(Button, { kind: "secondary", disabled: copyButtonSelected, onClick: copyTextToClipboard }, getCopyButtonContent()))));
|
|
2872
|
+
function copyTextToClipboard() {
|
|
2873
|
+
try {
|
|
2874
|
+
navigator.clipboard.writeText(props.text);
|
|
2875
|
+
setCopyButtonSelected(true);
|
|
2876
|
+
setTimeout(function () { return setCopyButtonSelected(false); }, COPY_BUTTON_SELECTED_TEXT_TIME);
|
|
2877
|
+
}
|
|
2878
|
+
catch (err) {
|
|
2879
|
+
console.error('Failed to copy text');
|
|
2880
|
+
console.error(err);
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
function getCopyButtonContent() {
|
|
2884
|
+
if (copyButtonSelected) {
|
|
2885
|
+
return (React.createElement("div", { className: "selected-button" },
|
|
2886
|
+
React.createElement("div", { className: "selected-button-icon" },
|
|
2887
|
+
React.createElement(CheckIcon, null)),
|
|
2888
|
+
React.createElement("div", { className: "selected-button-text" }, props.copySelectedTranslation)));
|
|
2889
|
+
}
|
|
2890
|
+
else {
|
|
2891
|
+
return (React.createElement("div", { className: "default-button" }, props.copyTranslation));
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
var css_248z$3 = ".field-mapper {\n padding-bottom: 12px; }\n .field-mapper .field-mapper-row-container .field-mapper-row {\n border-top: 1px solid #E5E5E5; }\n .field-mapper .field-mapper-row-container.field-mapper-header-row {\n margin-bottom: 10px;\n padding-left: 12px; }\n .field-mapper .field-mapper-row-container.field-mapper-header-row .field-mapper-row {\n border: 0; }\n .field-mapper .field-mapper-row-container.field-mapper-header-row .field-mapper-key, .field-mapper .field-mapper-row-container.field-mapper-header-row .field-mapper-value {\n border: 0;\n display: flex;\n align-items: center; }\n .field-mapper .field-mapper-row-container.field-mapper-header-row .field-mapper-key .field-mapper-header-cell, .field-mapper .field-mapper-row-container.field-mapper-header-row .field-mapper-value .field-mapper-header-cell {\n color: #6A6D70;\n font-weight: bold;\n font-size: 12px; }\n .field-mapper .field-mapper-row-container.field-mapper-header-row .field-mapper-key {\n padding-top: 0;\n padding-right: 24px;\n padding-bottom: 0;\n padding-left: 0; }\n .field-mapper .field-mapper-row-container.field-mapper-header-row .field-mapper-value {\n padding-top: 0;\n padding-right: 0;\n padding-bottom: 0;\n padding-left: 12px; }\n .field-mapper .add-field-button-container {\n padding-top: 12px; }\n";
|
|
2897
|
+
styleInject(css_248z$3);
|
|
2898
|
+
|
|
2899
|
+
function isString(val) {
|
|
2900
|
+
return (typeof val) === 'string';
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
var css_248z$2 = ".field-mapper-row .field-mapper-row-content {\n display: flex; }\n .field-mapper-row .field-mapper-row-content .field-mapper-key-container {\n flex: 4; }\n .field-mapper-row .field-mapper-row-content .field-mapper-value-container {\n flex: 7; }\n .field-mapper-row .field-mapper-row-content .remove-row-container {\n min-height: 100%;\n padding: 8px 12px;\n border-left: 1px solid #E5E5E5; }\n .field-mapper-row .field-mapper-row-content .remove-row-container.hide-remove-button {\n border: 0; }\n .field-mapper-row .field-mapper-row-content .remove-row-container .empty-remove-button {\n min-width: 36px; }\n";
|
|
2904
|
+
styleInject(css_248z$2);
|
|
2905
|
+
|
|
2906
|
+
var css_248z$1 = ".field-mapper-key {\n display: flex;\n align-items: center;\n padding-top: 8px;\n padding-right: 12px;\n padding-bottom: 8px;\n padding-left: 12px;\n height: 100%; }\n .field-mapper-key .required-field-container {\n display: flex; }\n .field-mapper-key .required-field-container .required-field-text {\n min-width: 0;\n font-size: 14px; }\n .field-mapper-key .required-field-container .required-field-symbol {\n margin-top: -2px; }\n";
|
|
2907
|
+
styleInject(css_248z$1);
|
|
2908
|
+
|
|
2909
|
+
var FieldMapperKey = React.forwardRef(function FieldMapperKey(props, ref) {
|
|
2910
|
+
var _a, _b, _c, _d, _e;
|
|
2911
|
+
var availableFields;
|
|
2912
|
+
var onFieldKeyChange;
|
|
2913
|
+
availableFields = Array.isArray(props.availableFields)
|
|
2914
|
+
? props.availableFields
|
|
2915
|
+
: [];
|
|
2916
|
+
onFieldKeyChange = (typeof props.onFieldKeyChange === 'function')
|
|
2917
|
+
? props.onFieldKeyChange
|
|
2918
|
+
: function () { return undefined; };
|
|
2919
|
+
return (React.createElement("div", { className: "field-mapper-key", ref: ref }, (React.Children.count(props.children) > 0)
|
|
2920
|
+
? props.children
|
|
2921
|
+
: (React.createElement("div", { className: "field-mapper-key-dropdown" }, fieldMapperKeyDropdownDisabled()
|
|
2922
|
+
? (React.createElement(Button, { disabled: true }, (_a = props.selectedField) === null || _a === void 0 ? void 0 : _a.label))
|
|
2923
|
+
: (((_b = props.selectedField) === null || _b === void 0 ? void 0 : _b.required) === true)
|
|
2924
|
+
? (React.createElement("div", { className: "required-field-container" },
|
|
2925
|
+
React.createElement("div", { className: "required-field-text" }, (_c = props.selectedField) === null || _c === void 0 ? void 0 : _c.label),
|
|
2926
|
+
React.createElement("div", { className: "required-field-symbol" }, "*")))
|
|
2927
|
+
: (React.createElement(Dropdown, { onChange: handleFieldKeyChange },
|
|
2928
|
+
React.createElement(DropdownButton, { label: (_d = props.selectedField) === null || _d === void 0 ? void 0 : _d.label }),
|
|
2929
|
+
React.createElement(DropdownList, null, (_e = props.availableFields) === null || _e === void 0 ? void 0 : _e.map(function (fieldItem) {
|
|
2930
|
+
return (React.createElement(DropdownOption, { key: fieldItem.key, label: fieldItem.label, value: fieldItem.value }));
|
|
2931
|
+
}))))))));
|
|
2932
|
+
function handleFieldKeyChange(value) {
|
|
2933
|
+
var foundSelectedFieldKey;
|
|
2934
|
+
foundSelectedFieldKey = availableFields.find(function (availableField) {
|
|
2935
|
+
return availableField.value === value;
|
|
2936
|
+
});
|
|
2937
|
+
if (foundSelectedFieldKey === undefined) {
|
|
2938
|
+
return;
|
|
2939
|
+
}
|
|
2940
|
+
onFieldKeyChange(props.selectedField, foundSelectedFieldKey);
|
|
2941
|
+
}
|
|
2942
|
+
function fieldMapperKeyDropdownDisabled() {
|
|
2943
|
+
var hasAvailableFields;
|
|
2944
|
+
hasAvailableFields = (availableFields === null || availableFields === void 0 ? void 0 : availableFields.length) > 0;
|
|
2945
|
+
return !hasAvailableFields;
|
|
2946
|
+
}
|
|
2947
|
+
});
|
|
2948
|
+
|
|
2949
|
+
var css_248z = ".field-mapper-value {\n border-left: 1px solid #E5E5E5;\n padding-top: 8px;\n padding-right: 12px;\n padding-bottom: 8px;\n padding-left: 12px;\n height: 100%; }\n";
|
|
2950
|
+
styleInject(css_248z);
|
|
2951
|
+
|
|
2952
|
+
var FieldMapperValue = React.forwardRef(function FieldMapperValue(props, ref) {
|
|
2953
|
+
var _a, _b;
|
|
2954
|
+
return (React.createElement("div", { className: "field-mapper-value" }, (React.Children.count(props.children) > 0)
|
|
2955
|
+
? props.children
|
|
2956
|
+
: (React.createElement("div", { className: "piped-text-input-value-container" },
|
|
2957
|
+
React.createElement(PipedTextInput, { items: (_a = props.pipedTextItems) !== null && _a !== void 0 ? _a : [], onChange: (_b = props.onChange) !== null && _b !== void 0 ? _b : (function () { return undefined; }) })))));
|
|
2958
|
+
});
|
|
2959
|
+
|
|
2960
|
+
var FieldMapperRow = React.forwardRef(function FieldMapperRow(props, ref) {
|
|
2961
|
+
return (React.createElement("div", { className: "field-mapper-row", ref: ref },
|
|
2962
|
+
React.createElement("div", { className: "field-mapper-row-content" },
|
|
2963
|
+
React.Children.map(props.children, function (child) {
|
|
2964
|
+
return getWrappedKeyValue(child);
|
|
2965
|
+
}),
|
|
2966
|
+
React.createElement("div", { className: 'remove-row-container' + ((props.showRemove === false) ? ' hide-remove-button' : '') }, (props.showRemove === false)
|
|
2967
|
+
? (React.createElement("div", { className: "empty-remove-button" }))
|
|
2968
|
+
: (React.createElement(IconButton
|
|
2969
|
+
/*
|
|
2970
|
+
TODO: Require an i18n string to be passed in for a11y labels
|
|
2971
|
+
*/
|
|
2972
|
+
, { "aria-label": "Remove", onClick: function ($e) { return handleRemoveClick(); } },
|
|
2973
|
+
React.createElement(RemoveItemIcon, null)))))));
|
|
2974
|
+
function handleRemoveClick(evt) {
|
|
2975
|
+
var _a;
|
|
2976
|
+
(_a = props.onFieldRemove) === null || _a === void 0 ? void 0 : _a.call(props, props.selectedField);
|
|
2977
|
+
}
|
|
2978
|
+
function getWrappedKeyValue(child) {
|
|
2979
|
+
var _a, _b, _c, _d;
|
|
2980
|
+
var wrappedEl;
|
|
2981
|
+
var fieldMapperKeyProps, fieldMapperValueProps;
|
|
2982
|
+
var includeAvailableFields, includeSelectedField;
|
|
2983
|
+
var includePipedTextItems, includeOnChange;
|
|
2984
|
+
fieldMapperKeyProps = {};
|
|
2985
|
+
fieldMapperValueProps = {};
|
|
2986
|
+
switch (child.type) {
|
|
2987
|
+
case FieldMapperKey:
|
|
2988
|
+
includeAvailableFields = (!Array.isArray(child.props.availableFields)
|
|
2989
|
+
&& (((_a = props.availableFields) === null || _a === void 0 ? void 0 : _a.length) > 0));
|
|
2990
|
+
includeSelectedField = (((typeof child.props.selectedField) !== 'object')
|
|
2991
|
+
&& (props.selectedField !== undefined));
|
|
2992
|
+
if (includeAvailableFields) {
|
|
2993
|
+
fieldMapperKeyProps.availableFields = (_c = (_b = props.availableFields) === null || _b === void 0 ? void 0 : _b.slice()) !== null && _c !== void 0 ? _c : [];
|
|
2994
|
+
}
|
|
2995
|
+
if (includeSelectedField) {
|
|
2996
|
+
fieldMapperKeyProps.selectedField = Object.assign({}, props.selectedField);
|
|
2997
|
+
}
|
|
2998
|
+
if (React.isValidElement(child)
|
|
2999
|
+
&& (includeAvailableFields
|
|
3000
|
+
|| includeSelectedField)) {
|
|
3001
|
+
child = React.cloneElement(child, fieldMapperKeyProps);
|
|
3002
|
+
}
|
|
3003
|
+
wrappedEl = (React.createElement("div", { className: "field-mapper-key-container" }, child));
|
|
3004
|
+
break;
|
|
3005
|
+
case FieldMapperValue:
|
|
3006
|
+
includePipedTextItems = (!Array.isArray(child.props.pipedTextItems)
|
|
3007
|
+
&& (((_d = props.pipedTextItems) === null || _d === void 0 ? void 0 : _d.length) > 0));
|
|
3008
|
+
includeOnChange = (((typeof child.props.onChange) !== 'function')
|
|
3009
|
+
&& ((typeof props.onChange) === 'function'));
|
|
3010
|
+
if (includePipedTextItems) {
|
|
3011
|
+
fieldMapperValueProps.pipedTextItems = props.pipedTextItems;
|
|
3012
|
+
}
|
|
3013
|
+
if (includeOnChange) {
|
|
3014
|
+
fieldMapperValueProps.onChange = function (value) {
|
|
3015
|
+
props.onChange(props.selectedField, value);
|
|
3016
|
+
};
|
|
3017
|
+
}
|
|
3018
|
+
if (React.isValidElement(child)
|
|
3019
|
+
&& includePipedTextItems) {
|
|
3020
|
+
child = React.cloneElement(child, fieldMapperValueProps);
|
|
3021
|
+
}
|
|
3022
|
+
wrappedEl = (React.createElement("div", { className: "field-mapper-value-container" }, child));
|
|
3023
|
+
break;
|
|
3024
|
+
default:
|
|
3025
|
+
wrappedEl = child;
|
|
3026
|
+
}
|
|
3027
|
+
return wrappedEl;
|
|
3028
|
+
}
|
|
3029
|
+
});
|
|
3030
|
+
|
|
3031
|
+
var MISSING_TRANSLATION_WARNING = '{{MISSING_I18N_STRING}}';
|
|
3032
|
+
var FieldMapper = React.forwardRef(function FieldMapper(props, ref) {
|
|
3033
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3034
|
+
return (React.createElement("div", { className: 'field-mapper ' + ((_a = props.className) !== null && _a !== void 0 ? _a : ''), ref: ref },
|
|
3035
|
+
hasHeaderRow() && (React.createElement("div", { className: "field-mapper-row-container field-mapper-header-row" },
|
|
3036
|
+
React.createElement(FieldMapperRow, { showRemove: false },
|
|
3037
|
+
React.createElement(FieldMapperKey, null,
|
|
3038
|
+
React.createElement("div", { className: "field-mapper-header-cell field-mapper-key-header" }, (_b = props.fieldKeysHeaderText) !== null && _b !== void 0 ? _b : '')),
|
|
3039
|
+
React.createElement(FieldMapperValue, null,
|
|
3040
|
+
React.createElement("div", { className: "field-mapper-header-cell field-mapper-value-header" }, (_c = props.fieldValuesHeaderText) !== null && _c !== void 0 ? _c : ''))))),
|
|
3041
|
+
React.createElement("div", { className: "field-mapper-row-container" }, React.Children.map(props.children, function (child) {
|
|
3042
|
+
return getWrappedFieldRow(child);
|
|
3043
|
+
})),
|
|
3044
|
+
React.createElement("div", { className: "add-field-button-container" }, isAddFieldDisabled()
|
|
3045
|
+
? (React.createElement(Button, { disabled: true, kind: "secondary", className: "add-field-button" },
|
|
3046
|
+
React.createElement("div", { className: "add-field-icon" },
|
|
3047
|
+
React.createElement(AddIcon, null)),
|
|
3048
|
+
React.createElement("div", { className: "add-field-button-label" }, (_d = props.addFieldLabel) !== null && _d !== void 0 ? _d : MISSING_TRANSLATION_WARNING)))
|
|
3049
|
+
: (React.createElement(Dropdown, null,
|
|
3050
|
+
React.createElement(DropdownButton, null,
|
|
3051
|
+
React.createElement(Button, { className: "add-field-button", kind: "secondary" },
|
|
3052
|
+
React.createElement("div", { className: "add-field-icon" },
|
|
3053
|
+
React.createElement(AddIcon, null)),
|
|
3054
|
+
React.createElement("div", { className: "add-field-button-label" }, (_e = props.addFieldLabel) !== null && _e !== void 0 ? _e : MISSING_TRANSLATION_WARNING))),
|
|
3055
|
+
React.createElement(DropdownList, null, (_f = props.availableFields) === null || _f === void 0 ? void 0 : _f.map(function (fieldItem) {
|
|
3056
|
+
return (React.createElement(DropdownOption, { key: fieldItem.key, value: fieldItem.value, label: fieldItem.label, onSelect: function ($e) {
|
|
3057
|
+
handleDropdownSelect(fieldItem.value);
|
|
3058
|
+
} }));
|
|
3059
|
+
})))))));
|
|
3060
|
+
function hasHeaderRow() {
|
|
3061
|
+
return (isString(props.fieldKeysHeaderText)
|
|
3062
|
+
|| isString(props.fieldValuesHeaderText));
|
|
3063
|
+
}
|
|
3064
|
+
function getWrappedFieldRow(child) {
|
|
3065
|
+
var _a, _b, _c;
|
|
3066
|
+
var wrappedEl;
|
|
3067
|
+
var fieldMapperRowProps;
|
|
3068
|
+
var includeAvailableFields, includeOnFieldRemove, includePipedTextItems, includeOnFieldValueChange, includeShowRemove;
|
|
3069
|
+
fieldMapperRowProps = {};
|
|
3070
|
+
switch (child.type) {
|
|
3071
|
+
case FieldMapperRow:
|
|
3072
|
+
wrappedEl = child;
|
|
3073
|
+
break;
|
|
3074
|
+
default:
|
|
3075
|
+
wrappedEl = (React.createElement(FieldMapperRow, null, child));
|
|
3076
|
+
}
|
|
3077
|
+
includeAvailableFields = (!Array.isArray(wrappedEl.props.availableFields)
|
|
3078
|
+
&& (((_a = props.availableFields) === null || _a === void 0 ? void 0 : _a.length) > 0));
|
|
3079
|
+
includeOnFieldRemove = (((typeof wrappedEl.props.onFieldRemove) !== 'function')
|
|
3080
|
+
&& ((typeof props.onFieldRemove) === 'function'));
|
|
3081
|
+
includePipedTextItems = (!Array.isArray(wrappedEl.props.pipedTextItems)
|
|
3082
|
+
&& (((_b = props.pipedTextItems) === null || _b === void 0 ? void 0 : _b.length) > 0));
|
|
3083
|
+
includeOnFieldValueChange = (((typeof wrappedEl.props.onChange) !== 'function')
|
|
3084
|
+
&& (typeof props.onFieldValueChange === 'function'));
|
|
3085
|
+
includeShowRemove = (((typeof wrappedEl.props.showRemove !== 'boolean'))
|
|
3086
|
+
&& ((typeof ((_c = child.props.selectedField) === null || _c === void 0 ? void 0 : _c.required)) === 'boolean'));
|
|
3087
|
+
if (includeAvailableFields) {
|
|
3088
|
+
fieldMapperRowProps.availableFields = props.availableFields.slice();
|
|
3089
|
+
}
|
|
3090
|
+
if (includeOnFieldRemove) {
|
|
3091
|
+
fieldMapperRowProps.onFieldRemove = function (fieldItem) {
|
|
3092
|
+
return props.onFieldRemove(fieldItem);
|
|
3093
|
+
};
|
|
3094
|
+
}
|
|
3095
|
+
if (includePipedTextItems) {
|
|
3096
|
+
fieldMapperRowProps.pipedTextItems = props.pipedTextItems;
|
|
3097
|
+
}
|
|
3098
|
+
if (includeOnFieldValueChange) {
|
|
3099
|
+
fieldMapperRowProps.onChange = function (fieldItem, inputValue) {
|
|
3100
|
+
return props.onFieldValueChange(fieldItem, inputValue);
|
|
3101
|
+
};
|
|
3102
|
+
}
|
|
3103
|
+
if (includeShowRemove) {
|
|
3104
|
+
fieldMapperRowProps.showRemove = !child.props.selectedField.required;
|
|
3105
|
+
}
|
|
3106
|
+
wrappedEl = React.cloneElement(wrappedEl, fieldMapperRowProps);
|
|
3107
|
+
return wrappedEl;
|
|
3108
|
+
}
|
|
3109
|
+
function handleDropdownSelect(value) {
|
|
3110
|
+
var foundFieldMapperItem;
|
|
3111
|
+
foundFieldMapperItem = props.availableFields.find(function (availableField) {
|
|
3112
|
+
return availableField.value === value;
|
|
3113
|
+
});
|
|
3114
|
+
if (foundFieldMapperItem) {
|
|
3115
|
+
props.onFieldAdd(foundFieldMapperItem);
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
function isAddFieldDisabled() {
|
|
3119
|
+
var hasAvailableFields;
|
|
3120
|
+
hasAvailableFields = ((Array.isArray(props.availableFields))
|
|
3121
|
+
&& (props.availableFields.length > 0));
|
|
3122
|
+
return !hasAvailableFields;
|
|
3123
|
+
}
|
|
3124
|
+
});
|
|
3125
|
+
|
|
3126
|
+
export { CaptureEvent, CopyText, DynamicSearchInput, FieldItem, FieldMapper, FieldMapperKey, FieldMapperRow, FieldMapperValue, MultiselectDropdown, PipedTextInput, PipedTextSelect, PluginSdkService, Popover, SelectItem, TaskFields, languageCodeAdapter };
|