solid-ui 2.4.22-d52421dc → 2.4.22-d6a4e62e
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/dist/main.js +9579 -9553
- package/dist/main.js.map +1 -1
- package/lib/acl/access-controller.js +14 -9
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.js +15 -10
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.js +13 -9
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.js +11 -7
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.js +18 -13
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/chat/bookmarks.js +21 -18
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +15 -9
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js +17 -12
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +37 -29
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/message.js +14 -14
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +23 -10
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/thread.js +9 -4
- package/lib/chat/thread.js.map +1 -1
- package/lib/footer/index.js +10 -8
- package/lib/footer/index.js.map +1 -1
- package/lib/header/index.js +17 -9
- package/lib/header/index.js.map +1 -1
- package/lib/iconBase.js +3 -2
- package/lib/iconBase.js.map +1 -1
- package/lib/login/login.d.ts +9 -8
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/login.js +303 -313
- package/lib/login/login.js.map +1 -1
- package/lib/media/media-capture.js +20 -4
- package/lib/media/media-capture.js.map +1 -1
- package/lib/tabs.d.ts.map +1 -1
- package/lib/tabs.js +21 -18
- package/lib/tabs.js.map +1 -1
- package/lib/utils/headerFooterHelpers.js +7 -5
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/versionInfo.d.ts +9 -9
- package/lib/versionInfo.js +13 -13
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/error.d.ts +0 -12
- package/lib/widgets/error.d.ts.map +1 -1
- package/lib/widgets/error.js +5 -0
- package/lib/widgets/error.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +15 -17
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.js +8 -5
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +19 -21
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +15 -8
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.js +27 -22
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/lib/widgets/forms.js +270 -27
- package/lib/widgets/forms.js.map +1 -1
- package/package.json +46 -44
package/lib/widgets/forms.js
CHANGED
|
@@ -22,6 +22,12 @@ Object.defineProperty(exports, "field", {
|
|
|
22
22
|
return _fieldFunction.field;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
+
Object.defineProperty(exports, "fieldFunction", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _fieldFunction.fieldFunction;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
25
31
|
Object.defineProperty(exports, "fieldLabel", {
|
|
26
32
|
enumerable: true,
|
|
27
33
|
get: function get() {
|
|
@@ -45,8 +51,15 @@ exports.formsFor = formsFor;
|
|
|
45
51
|
exports.makeDescription = makeDescription;
|
|
46
52
|
exports.makeSelectForCategory = makeSelectForCategory;
|
|
47
53
|
exports.makeSelectForChoice = makeSelectForChoice;
|
|
54
|
+
exports.makeSelectForClassifierOptions = makeSelectForClassifierOptions;
|
|
48
55
|
exports.makeSelectForNestedCategory = makeSelectForNestedCategory;
|
|
49
56
|
exports.makeSelectForOptions = makeSelectForOptions;
|
|
57
|
+
Object.defineProperty(exports, "mostSpecificClassURI", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function get() {
|
|
60
|
+
return _fieldFunction.mostSpecificClassURI;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
50
63
|
exports.newButton = newButton;
|
|
51
64
|
exports.newThing = newThing;
|
|
52
65
|
exports.promptForNew = promptForNew;
|
|
@@ -60,6 +73,8 @@ Object.defineProperty(exports, "renderNameValuePair", {
|
|
|
60
73
|
exports.sortByLabel = sortByLabel;
|
|
61
74
|
exports.sortBySequence = sortBySequence;
|
|
62
75
|
|
|
76
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
77
|
+
|
|
63
78
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
64
79
|
|
|
65
80
|
var buttons = _interopRequireWildcard(require("./buttons"));
|
|
@@ -100,8 +115,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
100
115
|
|
|
101
116
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
102
117
|
|
|
103
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; 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); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { 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); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; 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; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
104
|
-
|
|
105
118
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
106
119
|
|
|
107
120
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -354,9 +367,9 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
|
|
|
354
367
|
|
|
355
368
|
|
|
356
369
|
function _addItem() {
|
|
357
|
-
_addItem = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
370
|
+
_addItem = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
|
358
371
|
var object, toBeInserted, msg;
|
|
359
|
-
return
|
|
372
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
360
373
|
while (1) {
|
|
361
374
|
switch (_context6.prev = _context6.next) {
|
|
362
375
|
case 0:
|
|
@@ -419,9 +432,9 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
|
|
|
419
432
|
|
|
420
433
|
|
|
421
434
|
function _deleteThisItem() {
|
|
422
|
-
_deleteThisItem = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
435
|
+
_deleteThisItem = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
423
436
|
var i, del;
|
|
424
|
-
return
|
|
437
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
425
438
|
while (1) {
|
|
426
439
|
switch (_context3.prev = _context3.next) {
|
|
427
440
|
case 0:
|
|
@@ -494,9 +507,9 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
|
|
|
494
507
|
|
|
495
508
|
|
|
496
509
|
function _moveThisItem() {
|
|
497
|
-
_moveThisItem = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
510
|
+
_moveThisItem = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(event, upwards) {
|
|
498
511
|
var i;
|
|
499
|
-
return
|
|
512
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
500
513
|
while (1) {
|
|
501
514
|
switch (_context4.prev = _context4.next) {
|
|
502
515
|
case 0:
|
|
@@ -601,8 +614,8 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
|
|
|
601
614
|
frame.style.gridTemplateColumns = 'auto 3em';
|
|
602
615
|
frame.style.gridTemplateRows = '50% 50%';
|
|
603
616
|
var moveUpButton = buttons.button(dom, _iconBase.icons.iconBase + 'noun_1369237.svg', 'Move Up', /*#__PURE__*/function () {
|
|
604
|
-
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
605
|
-
return
|
|
617
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(event) {
|
|
618
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
606
619
|
while (1) {
|
|
607
620
|
switch (_context.prev = _context.next) {
|
|
608
621
|
case 0:
|
|
@@ -621,8 +634,8 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
|
|
|
621
634
|
};
|
|
622
635
|
}());
|
|
623
636
|
var moveDownButton = buttons.button(dom, _iconBase.icons.iconBase + 'noun_1369241.svg', 'Move Down', /*#__PURE__*/function () {
|
|
624
|
-
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
625
|
-
return
|
|
637
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(event) {
|
|
638
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
626
639
|
while (1) {
|
|
627
640
|
switch (_context2.prev = _context2.next) {
|
|
628
641
|
case 0:
|
|
@@ -738,8 +751,8 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
|
|
|
738
751
|
var prompt = dom.createElement('span');
|
|
739
752
|
prompt.textContent = (values.length === 0 ? 'Add another ' : 'Add ') + multipleUIlabel;
|
|
740
753
|
tail.addEventListener('click', /*#__PURE__*/function () {
|
|
741
|
-
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
742
|
-
return
|
|
754
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(_eventNotUsed) {
|
|
755
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
743
756
|
while (1) {
|
|
744
757
|
switch (_context5.prev = _context5.next) {
|
|
745
758
|
case 0:
|
|
@@ -778,8 +791,8 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
|
|
|
778
791
|
}
|
|
779
792
|
|
|
780
793
|
function _saveListThenRefresh() {
|
|
781
|
-
_saveListThenRefresh = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
782
|
-
return
|
|
794
|
+
_saveListThenRefresh = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
795
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
783
796
|
while (1) {
|
|
784
797
|
switch (_context7.prev = _context7.next) {
|
|
785
798
|
case 0:
|
|
@@ -836,9 +849,9 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
|
|
|
836
849
|
}
|
|
837
850
|
|
|
838
851
|
function _asyncStuff() {
|
|
839
|
-
_asyncStuff = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
852
|
+
_asyncStuff = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
|
840
853
|
var extra, j;
|
|
841
|
-
return
|
|
854
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
842
855
|
while (1) {
|
|
843
856
|
switch (_context8.prev = _context8.next) {
|
|
844
857
|
case 0:
|
|
@@ -1067,8 +1080,7 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
|
|
|
1067
1080
|
}
|
|
1068
1081
|
|
|
1069
1082
|
var subForm = kb.any(form, ui('use')); // Optional
|
|
1070
|
-
|
|
1071
|
-
var follow = kb.anyJS(form, ui('follow'), null, formDoc); // data doc moves to new subject?
|
|
1083
|
+
// const follow = kb.anyJS(form, ui('follow'), null, formDoc) // data doc moves to new subject?
|
|
1072
1084
|
|
|
1073
1085
|
var opts = {
|
|
1074
1086
|
form: form,
|
|
@@ -1541,6 +1553,225 @@ function makeDescription(dom, kb, subject, predicate, dataDoc, callbackFunction)
|
|
|
1541
1553
|
|
|
1542
1554
|
return group;
|
|
1543
1555
|
}
|
|
1556
|
+
/** Make SELECT element to select options
|
|
1557
|
+
//
|
|
1558
|
+
// @param subject - a term, the subject of the statement(s) being edited.
|
|
1559
|
+
// @param predicate - a term, the predicate of the statement(s) being edited
|
|
1560
|
+
// @param possible - a list of terms, the possible value the object can take
|
|
1561
|
+
// @param options.multiple - Boolean - Whether more than one at a time is allowed
|
|
1562
|
+
// @param options.nullLabel - a string to be displayed as the
|
|
1563
|
+
// option for none selected (for non multiple)
|
|
1564
|
+
// @param options.mint - User may create thing if this sent to the prompt string eg "New foo"
|
|
1565
|
+
// @param options.subForm - If mint, then the form to be used for minting the new thing
|
|
1566
|
+
// @param dataDoc - The web document being edited
|
|
1567
|
+
// @param callbackFunction - takes (boolean ok, string errorBody)
|
|
1568
|
+
*/
|
|
1569
|
+
|
|
1570
|
+
|
|
1571
|
+
function makeSelectForClassifierOptions(dom, kb, subject, predicate, possible, options, dataDoc, callbackFunction) {
|
|
1572
|
+
log.debug('Select list length now ' + possible.length);
|
|
1573
|
+
var n = 0;
|
|
1574
|
+
var uris = {}; // Count them
|
|
1575
|
+
|
|
1576
|
+
var editable = kb.updater.editable(dataDoc.uri);
|
|
1577
|
+
|
|
1578
|
+
for (var i = 0; i < possible.length; i++) {
|
|
1579
|
+
var sub = possible[i]; // @@ Maybe; make this so it works with blank nodes too
|
|
1580
|
+
|
|
1581
|
+
if (!sub.uri) debug.warn("makeSelectForClassifierOptions: option does not have an uri: ".concat(sub, ", with predicate: ").concat(predicate));
|
|
1582
|
+
if (!sub.uri || sub.uri in uris) continue;
|
|
1583
|
+
uris[sub.uri] = true;
|
|
1584
|
+
n++;
|
|
1585
|
+
} // uris is now the set of possible options
|
|
1586
|
+
|
|
1587
|
+
|
|
1588
|
+
if (n === 0 && !options.mint) {
|
|
1589
|
+
return (0, _error.errorMessageBlock)(dom, "Can't do selector with no options, subject= " + subject + ' property = ' + predicate + '.');
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
log.debug('makeSelectForClassifierOptions: dataDoc=' + dataDoc);
|
|
1593
|
+
var actual;
|
|
1594
|
+
|
|
1595
|
+
var getActual = function getActual() {
|
|
1596
|
+
actual = {};
|
|
1597
|
+
|
|
1598
|
+
if (predicate.sameTerm(ns.rdf('type'))) {
|
|
1599
|
+
actual = kb.findTypeURIs(subject);
|
|
1600
|
+
} else {
|
|
1601
|
+
kb.each(subject, predicate, null, dataDoc).forEach(function (x) {
|
|
1602
|
+
actual[x.uri] = true;
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
return actual;
|
|
1607
|
+
};
|
|
1608
|
+
|
|
1609
|
+
actual = getActual();
|
|
1610
|
+
|
|
1611
|
+
var onChange = function onChange(_e) {
|
|
1612
|
+
select.disabled = true; // until data written back - gives user feedback too
|
|
1613
|
+
|
|
1614
|
+
var ds = [];
|
|
1615
|
+
var is = [];
|
|
1616
|
+
|
|
1617
|
+
var removeValue = function removeValue(t) {
|
|
1618
|
+
if (kb.holds(subject, predicate, t, dataDoc)) {
|
|
1619
|
+
ds.push($rdf.st(subject, predicate, t, dataDoc));
|
|
1620
|
+
}
|
|
1621
|
+
};
|
|
1622
|
+
|
|
1623
|
+
var newObject;
|
|
1624
|
+
|
|
1625
|
+
for (var _i = 0; _i < select.options.length; _i++) {
|
|
1626
|
+
var opt = select.options[_i];
|
|
1627
|
+
|
|
1628
|
+
if (opt.selected && opt.AJAR_mint) {
|
|
1629
|
+
if (options.mintClass) {
|
|
1630
|
+
var thisForm = promptForNew(dom, kb, subject, predicate, options.mintClass, null, dataDoc, function (ok, body) {
|
|
1631
|
+
if (!ok) {
|
|
1632
|
+
callbackFunction(ok, body, {
|
|
1633
|
+
change: 'new'
|
|
1634
|
+
}); // @@ if ok, need some form of refresh of the select for the new thing
|
|
1635
|
+
}
|
|
1636
|
+
});
|
|
1637
|
+
select.parentNode.appendChild(thisForm);
|
|
1638
|
+
newObject = thisForm.AJAR_subject;
|
|
1639
|
+
} else {
|
|
1640
|
+
newObject = newThing(dataDoc);
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
is.push($rdf.st(subject, predicate, newObject, dataDoc));
|
|
1644
|
+
|
|
1645
|
+
if (options.mintStatementsFun) {
|
|
1646
|
+
is = is.concat(options.mintStatementsFun(newObject));
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
if (!opt.AJAR_uri) continue; // a prompt or mint
|
|
1651
|
+
|
|
1652
|
+
if (opt.selected && !(opt.AJAR_uri in actual)) {
|
|
1653
|
+
// new class
|
|
1654
|
+
is.push($rdf.st(subject, predicate, kb.sym(opt.AJAR_uri), dataDoc));
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
if (!opt.selected && opt.AJAR_uri in actual) {
|
|
1658
|
+
// old class
|
|
1659
|
+
removeValue(kb.sym(opt.AJAR_uri));
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
if (opt.selected) select.currentURI = opt.AJAR_uri;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
var sel = select.subSelect; // All subclasses must also go
|
|
1666
|
+
|
|
1667
|
+
while (sel && sel.currentURI) {
|
|
1668
|
+
removeValue(kb.sym(sel.currentURI));
|
|
1669
|
+
sel = sel.subSelect;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
sel = select.superSelect; // All superclasses are redundant
|
|
1673
|
+
|
|
1674
|
+
while (sel && sel.currentURI) {
|
|
1675
|
+
removeValue(kb.sym(sel.currentURI));
|
|
1676
|
+
sel = sel.superSelect;
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
function doneNew(ok, _body) {
|
|
1680
|
+
callbackFunction(ok, {
|
|
1681
|
+
widget: 'select',
|
|
1682
|
+
event: 'new'
|
|
1683
|
+
});
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
log.info('makeSelectForClassifierOptions: data doc = ' + dataDoc);
|
|
1687
|
+
kb.updater.update(ds, is, function (uri, ok, body) {
|
|
1688
|
+
actual = getActual(); // refresh
|
|
1689
|
+
|
|
1690
|
+
if (ok) {
|
|
1691
|
+
select.disabled = false; // data written back
|
|
1692
|
+
|
|
1693
|
+
if (newObject) {
|
|
1694
|
+
var fn = (0, _fieldFunction.fieldFunction)(dom, options.subForm);
|
|
1695
|
+
fn(dom, select.parentNode, {}, newObject, options.subForm, dataDoc, doneNew);
|
|
1696
|
+
}
|
|
1697
|
+
} else {
|
|
1698
|
+
return select.parentNode.appendChild((0, _error.errorMessageBlock)(dom, 'Error updating data in select: ' + body));
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
if (callbackFunction) callbackFunction(ok, {
|
|
1702
|
+
widget: 'select',
|
|
1703
|
+
event: 'change'
|
|
1704
|
+
});
|
|
1705
|
+
});
|
|
1706
|
+
};
|
|
1707
|
+
|
|
1708
|
+
var select = dom.createElement('select');
|
|
1709
|
+
select.setAttribute('style', style.formSelectSTyle);
|
|
1710
|
+
if (options.multiple) select.setAttribute('multiple', 'true');
|
|
1711
|
+
select.currentURI = null;
|
|
1712
|
+
|
|
1713
|
+
select.refresh = function () {
|
|
1714
|
+
actual = getActual(); // refresh
|
|
1715
|
+
|
|
1716
|
+
for (var _i2 = 0; _i2 < select.children.length; _i2++) {
|
|
1717
|
+
var option = select.children[_i2];
|
|
1718
|
+
|
|
1719
|
+
if (option.AJAR_uri) {
|
|
1720
|
+
option.selected = option.AJAR_uri in actual;
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
select.disabled = false; // unlocked any conflict we had got into
|
|
1725
|
+
};
|
|
1726
|
+
|
|
1727
|
+
for (var uri in uris) {
|
|
1728
|
+
var c = kb.sym(uri);
|
|
1729
|
+
var option = dom.createElement('option');
|
|
1730
|
+
|
|
1731
|
+
if (options.disambiguate) {
|
|
1732
|
+
option.appendChild(dom.createTextNode(utils.labelWithOntology(c, true))); // Init. cap
|
|
1733
|
+
} else {
|
|
1734
|
+
option.appendChild(dom.createTextNode(utils.label(c, true))); // Init.
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
var backgroundColor = kb.any(c, kb.sym('http://www.w3.org/ns/ui#backgroundColor'));
|
|
1738
|
+
|
|
1739
|
+
if (backgroundColor) {
|
|
1740
|
+
option.setAttribute('style', 'background-color: ' + backgroundColor.value + '; ');
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
option.AJAR_uri = uri;
|
|
1744
|
+
|
|
1745
|
+
if (uri in actual) {
|
|
1746
|
+
option.setAttribute('selected', 'true');
|
|
1747
|
+
select.currentURI = uri; // dump("Already in class: "+ uri+"\n")
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
select.appendChild(option);
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
if (editable && options.mint) {
|
|
1754
|
+
var mint = dom.createElement('option');
|
|
1755
|
+
mint.appendChild(dom.createTextNode(options.mint));
|
|
1756
|
+
mint.AJAR_mint = true; // Flag it
|
|
1757
|
+
|
|
1758
|
+
select.insertBefore(mint, select.firstChild);
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
if (select.currentURI == null && !options.multiple) {
|
|
1762
|
+
var prompt = dom.createElement('option');
|
|
1763
|
+
prompt.appendChild(dom.createTextNode(options.nullLabel));
|
|
1764
|
+
select.insertBefore(prompt, select.firstChild);
|
|
1765
|
+
prompt.selected = true;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
if (editable) {
|
|
1769
|
+
select.addEventListener('change', onChange, false);
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
return select;
|
|
1773
|
+
} // makeSelectForClassifierOptions
|
|
1774
|
+
|
|
1544
1775
|
/** Make SELECT element to select options
|
|
1545
1776
|
//
|
|
1546
1777
|
// @param subject - a term, the subject of the statement(s) being edited.
|
|
@@ -1608,8 +1839,8 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, options, da
|
|
|
1608
1839
|
}
|
|
1609
1840
|
};
|
|
1610
1841
|
|
|
1611
|
-
for (var
|
|
1612
|
-
var opt = select.options[
|
|
1842
|
+
for (var _i3 = 0; _i3 < select.options.length; _i3++) {
|
|
1843
|
+
var opt = select.options[_i3];
|
|
1613
1844
|
if (!opt.AJAR_uri) continue; // a prompt or mint
|
|
1614
1845
|
|
|
1615
1846
|
if (opt.selected && !(opt.AJAR_uri in actual)) {
|
|
@@ -1663,8 +1894,8 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, options, da
|
|
|
1663
1894
|
select.refresh = function () {
|
|
1664
1895
|
actual = getActual(); // refresh
|
|
1665
1896
|
|
|
1666
|
-
for (var
|
|
1667
|
-
var option = select.children[
|
|
1897
|
+
for (var _i4 = 0; _i4 < select.children.length; _i4++) {
|
|
1898
|
+
var option = select.children[_i4];
|
|
1668
1899
|
|
|
1669
1900
|
if (option.AJAR_uri) {
|
|
1670
1901
|
option.selected = option.AJAR_uri in actual;
|
|
@@ -1723,15 +1954,27 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, options, da
|
|
|
1723
1954
|
function makeSelectForCategory(dom, kb, subject, category, dataDoc, callbackFunction) {
|
|
1724
1955
|
var du = kb.any(category, ns.owl('disjointUnionOf'));
|
|
1725
1956
|
var subs;
|
|
1957
|
+
var multiple = false;
|
|
1726
1958
|
|
|
1727
1959
|
if (!du) {
|
|
1728
1960
|
subs = kb.each(undefined, ns.rdfs('subClassOf'), category);
|
|
1961
|
+
multiple = true;
|
|
1729
1962
|
} else {
|
|
1730
1963
|
subs = du.elements;
|
|
1731
1964
|
}
|
|
1732
1965
|
|
|
1733
1966
|
log.debug('Select list length ' + subs.length);
|
|
1734
|
-
|
|
1967
|
+
|
|
1968
|
+
if (subs.length === 0) {
|
|
1969
|
+
return (0, _error.errorMessageBlock)(dom, "Can't do " + (multiple ? 'multiple ' : '') + 'selector with no subclasses of category: ' + category);
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
if (subs.length === 1) {
|
|
1973
|
+
return (0, _error.errorMessageBlock)(dom, "Can't do " + (multiple ? 'multiple ' : '') + 'selector with only 1 subclass of category: ' + category + ':' + subs[1]);
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1976
|
+
return makeSelectForClassifierOptions(dom, kb, subject, ns.rdf('type'), subs, {
|
|
1977
|
+
multiple: multiple,
|
|
1735
1978
|
nullLabel: '* Select type *'
|
|
1736
1979
|
}, dataDoc, callbackFunction);
|
|
1737
1980
|
}
|
|
@@ -2071,8 +2314,8 @@ function makeSelectForChoice(dom, container, kb, subject, predicate, inputPossib
|
|
|
2071
2314
|
var is = [];
|
|
2072
2315
|
var newObject;
|
|
2073
2316
|
|
|
2074
|
-
for (var
|
|
2075
|
-
var opt = select.options[
|
|
2317
|
+
for (var _i5 = 0; _i5 < select.options.length; _i5++) {
|
|
2318
|
+
var opt = select.options[_i5];
|
|
2076
2319
|
|
|
2077
2320
|
if (opt.selected && opt.AJAR_mint) {
|
|
2078
2321
|
// not sure if this 'if' is used because I cannot find mintClass
|