solid-ui 2.4.22-fd0ccabe → 2.4.22-fd705c8d
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 +2059 -1163
- package/dist/main.js.map +1 -1
- package/lib/acl/access-controller.js +9 -14
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.js +10 -15
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.js +9 -13
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.js +7 -11
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.js +13 -19
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/acl/index.js.map +1 -1
- package/lib/acl/styles.js.map +1 -1
- package/lib/acl/types.js.map +1 -1
- package/lib/chat/bookmarks.js +14 -19
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +9 -15
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js +12 -17
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +29 -37
- 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 +10 -23
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/thread.js +4 -9
- package/lib/chat/thread.js.map +1 -1
- package/lib/create/create.js.map +1 -1
- package/lib/create/index.js.map +1 -1
- package/lib/create/types.js.map +1 -1
- package/lib/debug.js.map +1 -1
- package/lib/folders.js.map +1 -1
- package/lib/footer/index.js +8 -10
- package/lib/footer/index.js.map +1 -1
- package/lib/footer/styleMap.js.map +1 -1
- package/lib/header/empty-profile.js.map +1 -1
- package/lib/header/index.js +9 -17
- package/lib/header/index.js.map +1 -1
- package/lib/header/styleMap.js.map +1 -1
- package/lib/iconBase.js.map +1 -1
- package/lib/icons/solid_logo.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/jss/index.js.map +1 -1
- package/lib/log.js.map +1 -1
- package/lib/login/login.js +21 -63
- package/lib/login/login.js.map +1 -1
- package/lib/matrix/index.js.map +1 -1
- package/lib/matrix/matrix.js.map +1 -1
- package/lib/matrix/types.js.map +1 -1
- package/lib/media/index.js.map +1 -1
- package/lib/media/media-capture.js +4 -20
- package/lib/media/media-capture.js.map +1 -1
- package/lib/messageArea.js.map +1 -1
- package/lib/noun_Camera_1618446_000000.js.map +1 -1
- package/lib/ns.js.map +1 -1
- package/lib/pad.js.map +1 -1
- package/lib/participation.js.map +1 -1
- package/lib/preferences.js.map +1 -1
- package/lib/signup/config-default.js.map +1 -1
- package/lib/signup/signup.js.map +1 -1
- package/lib/stories/decorators.js.map +1 -1
- package/lib/style.js.map +1 -1
- package/lib/style_multiSelect.js +67 -0
- package/lib/style_multiSelect.js.map +1 -0
- package/lib/table.js.map +1 -1
- package/lib/tabs.d.ts +1 -1
- package/lib/tabs.d.ts.map +1 -1
- package/lib/tabs.js +38 -22
- package/lib/tabs.js.map +1 -1
- package/lib/typings.d.js.map +1 -1
- package/lib/utils/headerFooterHelpers.js +5 -7
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/label.js +1 -1
- package/lib/utils/label.js.map +1 -1
- package/lib/versionInfo.js +5 -5
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/buttons/iconLinks.js.map +1 -1
- package/lib/widgets/buttons.js.map +1 -1
- package/lib/widgets/dragAndDrop.js.map +1 -1
- package/lib/widgets/error.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +17 -15
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.js +5 -8
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +21 -19
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +8 -15
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.js +22 -27
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/lib/widgets/forms/basic.js.map +1 -1
- package/lib/widgets/forms/comment.js.map +1 -1
- package/lib/widgets/forms/fieldFunction.js.map +1 -1
- package/lib/widgets/forms/fieldParams.js.map +1 -1
- package/lib/widgets/forms/formStyle.js.map +1 -1
- package/lib/widgets/forms.js +504 -203
- package/lib/widgets/forms.js.map +1 -1
- package/lib/widgets/index.js.map +1 -1
- package/lib/widgets/multiSelect.js +784 -0
- package/lib/widgets/multiSelect.js.map +1 -0
- package/lib/widgets/peoplePicker.js.map +1 -1
- package/lib/widgets/widgetHelpers.js.map +1 -1
- package/package.json +5 -3
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
exports.renderAutocompleteControl = renderAutocompleteControl;
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
13
|
|
|
14
14
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
15
|
|
|
@@ -27,7 +27,7 @@ var _autocompletePicker = require("./autocompletePicker");
|
|
|
27
27
|
|
|
28
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
29
|
|
|
30
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
30
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(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; }
|
|
31
31
|
|
|
32
32
|
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(_e) { throw _e; }, 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(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
33
33
|
|
|
@@ -35,6 +35,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
35
35
|
|
|
36
36
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
37
37
|
|
|
38
|
+
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" == (0, _typeof2["default"])(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; }
|
|
39
|
+
|
|
38
40
|
var WEBID_NOUN = 'Solid ID';
|
|
39
41
|
var GREEN_PLUS = _iconBase.icons.iconBase + 'noun_34653_green.svg';
|
|
40
42
|
var SEARCH_ICON = _iconBase.icons.iconBase + 'noun_Search_875351.svg';
|
|
@@ -47,10 +49,10 @@ function renderAutocompleteControl(_x, _x2, _x3, _x4, _x5, _x6) {
|
|
|
47
49
|
|
|
48
50
|
|
|
49
51
|
function _renderAutocompleteControl() {
|
|
50
|
-
_renderAutocompleteControl = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
52
|
+
_renderAutocompleteControl = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(dom, person, barOptions, acOptions, addOneIdAndRefresh, deleteOne) {
|
|
51
53
|
var autoCompleteDone, _autoCompleteDone, greenButtonHandler, _greenButtonHandler, removeDecorated, displayAutocomplete, _displayAutocomplete, searchButtonHandler, _searchButtonHandler, droppedURIHandler, _droppedURIHandler, acceptButton, cancelButton, deleteButtonContainer, noun, deleteButton, editButton, editing, syncEditingStatus, decoration, decoratedAutocomplete, creationArea, plus;
|
|
52
54
|
|
|
53
|
-
return
|
|
55
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
54
56
|
while (1) {
|
|
55
57
|
switch (_context6.prev = _context6.next) {
|
|
56
58
|
case 0:
|
|
@@ -68,10 +70,10 @@ function _renderAutocompleteControl() {
|
|
|
68
70
|
};
|
|
69
71
|
|
|
70
72
|
_droppedURIHandler = function _droppedURIHandler3() {
|
|
71
|
-
_droppedURIHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
73
|
+
_droppedURIHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(uris) {
|
|
72
74
|
var _iterator, _step, webid;
|
|
73
75
|
|
|
74
|
-
return
|
|
76
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
75
77
|
while (1) {
|
|
76
78
|
switch (_context5.prev = _context5.next) {
|
|
77
79
|
case 0:
|
|
@@ -126,8 +128,8 @@ function _renderAutocompleteControl() {
|
|
|
126
128
|
};
|
|
127
129
|
|
|
128
130
|
_searchButtonHandler = function _searchButtonHandler3() {
|
|
129
|
-
_searchButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
130
|
-
return
|
|
131
|
+
_searchButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_event) {
|
|
132
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
131
133
|
while (1) {
|
|
132
134
|
switch (_context4.prev = _context4.next) {
|
|
133
135
|
case 0:
|
|
@@ -160,8 +162,8 @@ function _renderAutocompleteControl() {
|
|
|
160
162
|
};
|
|
161
163
|
|
|
162
164
|
_displayAutocomplete = function _displayAutocomplete3() {
|
|
163
|
-
_displayAutocomplete = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
164
|
-
return
|
|
165
|
+
_displayAutocomplete = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
166
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
165
167
|
while (1) {
|
|
166
168
|
switch (_context3.prev = _context3.next) {
|
|
167
169
|
case 0:
|
|
@@ -208,9 +210,9 @@ function _renderAutocompleteControl() {
|
|
|
208
210
|
};
|
|
209
211
|
|
|
210
212
|
_greenButtonHandler = function _greenButtonHandler3() {
|
|
211
|
-
_greenButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
213
|
+
_greenButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_event) {
|
|
212
214
|
var webid;
|
|
213
|
-
return
|
|
215
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
214
216
|
while (1) {
|
|
215
217
|
switch (_context2.prev = _context2.next) {
|
|
216
218
|
case 0:
|
|
@@ -245,8 +247,8 @@ function _renderAutocompleteControl() {
|
|
|
245
247
|
};
|
|
246
248
|
|
|
247
249
|
_autoCompleteDone = function _autoCompleteDone3() {
|
|
248
|
-
_autoCompleteDone = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
249
|
-
return
|
|
250
|
+
_autoCompleteDone = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(object, name) {
|
|
251
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
250
252
|
while (1) {
|
|
251
253
|
switch (_context.prev = _context.next) {
|
|
252
254
|
case 0:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/widgets/forms/autocomplete/autocompleteBar.ts"],"names":["WEBID_NOUN","GREEN_PLUS","icons","iconBase","SEARCH_ICON","EDIT_ICON","renderAutocompleteControl","dom","person","barOptions","acOptions","addOneIdAndRefresh","deleteOne","autoCompleteDone","greenButtonHandler","removeDecorated","displayAutocomplete","searchButtonHandler","droppedURIHandler","syncEditingStatus","editing","editButton","acceptButton","cancelButton","uris","webid","_event","decoratedAutocomplete","creationArea","removeChild","undefined","createElement","setAttribute","decoration","appendChild","deleteButtonContainer","widgets","askName","store","ns","vcard","object","name","permanent","continueButton","noun","targetClass","utils","label","deleteButton","deleteButtonWithCheck","button","style","display","flexDirection","currentObject","editable","width","manualURIEntry","plus","idNoun","makeDropTarget","dbLookup"],"mappings":";;;;;;;;;;;;;;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;;;AAIA,IAAMA,UAAU,GAAG,UAAnB;AAEA,IAAMC,UAAU,GAAGC,gBAAMC,QAAN,GAAiB,sBAApC;AACA,IAAMC,WAAW,GAAGF,gBAAMC,QAAN,GAAiB,wBAArC;AACA,IAAME,SAAS,GAAGH,gBAAMC,QAAN,GAAiB,iBAAnC,C,CACA;;SAEsBG,yB;;EAwHpB;AAEF;;;;6GA1HO,kBAA0CC,GAA1C,EACLC,MADK,EAELC,UAFK,EAGLC,SAHK,EAILC,kBAJK,EAKLC,SALK;AAAA,QAMUC,gBANV,qBAkBUC,kBAlBV,uBA0BIC,eA1BJ,EAiCUC,mBAjCV,wBAmDUC,mBAnDV,wBA4DUC,iBA5DV,kHAkFIC,iBAlFJ;;AAAA;AAAA;AAAA;AAAA;AAkFIA,YAAAA,iBAlFJ,iCA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AAA,YAAY,CAACM,WAAb,CAAyBE,OAAO,CAACe,MAAR,CAAe5C,GAAf,EAAoBH,WAApB,EAAiCK,UAAU,CAACmD,MAA5C,EAAoD3C,mBAApD,CAAzB;AACD;AACF;;AACDE,YAAAA,iBAAiB;AAtHZ,8CAuHES,YAvHF;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G","sourcesContent":["/* The Autocomplete Control with decorations\n\nThis control has the buttons which control the state between editing, viewing, searching, accepting\nand so on. See the state diagram in the documentation. The AUtocomplete Picker does the main work.\n\n*/\nimport * as ns from '../../../ns'\nimport { icons } from '../../../iconBase'\nimport { store } from 'solid-logic'\nimport * as widgets from '../../../widgets'\nimport * as utils from '../../../utils'\n\nimport { renderAutoComplete, AutocompleteDecoration, setVisible } from './autocompletePicker' // dbpediaParameters\n\nimport { NamedNode } from 'rdflib'\n\nconst WEBID_NOUN = 'Solid ID'\n\nconst GREEN_PLUS = icons.iconBase + 'noun_34653_green.svg'\nconst SEARCH_ICON = icons.iconBase + 'noun_Search_875351.svg'\nconst EDIT_ICON = icons.iconBase + 'noun_253504.svg'\n// const DELETE_ICON = icons.iconBase + 'noun_2188_red.svg'\n\nexport async function renderAutocompleteControl (dom:HTMLDocument,\n person:NamedNode,\n barOptions,\n acOptions,\n addOneIdAndRefresh,\n deleteOne): Promise<HTMLElement> {\n async function autoCompleteDone (object, name) {\n if (acOptions.permanent) { // remember to set this in publicid panel\n setVisible(editButton, true)\n setVisible(acceptButton, false)\n setVisible(cancelButton, false)\n } else {\n // console.log('temporary - removed decoratiion')\n removeDecorated()\n }\n return addOneIdAndRefresh(object, name)\n }\n\n async function greenButtonHandler (_event) {\n const webid = await widgets.askName(dom, store, creationArea, ns.vcard('url'), undefined, WEBID_NOUN)\n if (!webid) {\n return // cancelled by user\n }\n return addOneIdAndRefresh(person, webid)\n }\n\n function removeDecorated () {\n if (decoratedAutocomplete) {\n creationArea.removeChild(decoratedAutocomplete)\n decoratedAutocomplete = undefined\n }\n }\n\n async function displayAutocomplete () {\n decoratedAutocomplete = dom.createElement('div') as HTMLElement\n decoratedAutocomplete.setAttribute('style', 'display: flex; flex-flow: wrap;')\n decoratedAutocomplete.appendChild(await renderAutoComplete(dom, acOptions, decoration, autoCompleteDone))\n // console.log('@@ acceptButton', acceptButton)\n decoratedAutocomplete.appendChild(acceptButton)\n // console.log('@@ cancelButton', cancelButton)\n\n decoratedAutocomplete.appendChild(cancelButton)\n // console.log('@@ editButton', editButton)\n\n decoratedAutocomplete.appendChild(editButton)\n // console.log('@@ deleteButtonContainer', deleteButtonContainer)\n\n decoratedAutocomplete.appendChild(deleteButtonContainer)\n creationArea.appendChild(decoratedAutocomplete)\n }\n\n async function searchButtonHandler (_event) {\n if (decoratedAutocomplete) {\n creationArea.removeChild(decoratedAutocomplete)\n decoratedAutocomplete = undefined\n } else {\n await displayAutocomplete()\n }\n }\n\n async function droppedURIHandler (uris) {\n for (const webid of uris) { // normally one but can be more than one\n await addOneIdAndRefresh(person, webid)\n }\n }\n\n const acceptButton = widgets.continueButton(dom)\n acceptButton.setAttribute('data-testid', 'accept-button')\n\n const cancelButton = widgets.cancelButton(dom)\n cancelButton.setAttribute('data-testid', 'cancel-button')\n const deleteButtonContainer = dom.createElement('div')\n const noun = acOptions.targetClass ? utils.label(acOptions.targetClass) : 'item'\n const deleteButton = widgets.deleteButtonWithCheck(dom, deleteButtonContainer, noun, deleteOne) // need to knock out this UI or caller does that\n deleteButton.setAttribute('data-testid', 'delete-button')\n const editButton = widgets.button(dom, EDIT_ICON, 'Edit', _event => {\n editing = !editing\n syncEditingStatus()\n })\n editButton.setAttribute('data-testid', 'edit-button')\n let editing = true\n\n function syncEditingStatus () {\n if (editing) {\n setVisible(editButton, false)\n setVisible(acceptButton, false) // not till got it\n setVisible(cancelButton, false)\n } else {\n setVisible(editButton, true)\n setVisible(acceptButton, false)\n setVisible(cancelButton, false)\n }\n }\n\n const decoration:AutocompleteDecoration = {\n acceptButton, cancelButton, editButton, deleteButton\n }\n\n let decoratedAutocomplete = undefined as HTMLElement | undefined\n\n const creationArea = dom.createElement('div')\n creationArea.style.display = 'flex'\n creationArea.style.flexDirection = 'row'\n\n if (acOptions.permanent || acOptions.currentObject) {\n await displayAutocomplete()\n }\n if (barOptions.editable) {\n // creationArea.appendChild(await renderAutoComplete(dom, barOptions, autoCompleteDone)) wait for searchButton\n creationArea.style.width = '100%'\n if (barOptions.manualURIEntry) {\n const plus = creationArea.appendChild(widgets.button(dom, GREEN_PLUS, barOptions.idNoun, greenButtonHandler))\n widgets.makeDropTarget(plus, droppedURIHandler, undefined)\n }\n if (barOptions.dbLookup && !acOptions.currentObject && !acOptions.permanent) {\n creationArea.appendChild(widgets.button(dom, SEARCH_ICON, barOptions.idNoun, searchButtonHandler))\n }\n }\n syncEditingStatus()\n return creationArea\n} // renderAutocompleteControl\n\n// ends\n"],"file":"autocompleteBar.js"}
|
|
1
|
+
{"version":3,"file":"autocompleteBar.js","names":["WEBID_NOUN","GREEN_PLUS","icons","iconBase","SEARCH_ICON","EDIT_ICON","renderAutocompleteControl","dom","person","barOptions","acOptions","addOneIdAndRefresh","deleteOne","autoCompleteDone","greenButtonHandler","removeDecorated","displayAutocomplete","searchButtonHandler","droppedURIHandler","syncEditingStatus","editing","setVisible","editButton","acceptButton","cancelButton","uris","webid","_event","decoratedAutocomplete","creationArea","removeChild","undefined","createElement","setAttribute","renderAutoComplete","decoration","appendChild","deleteButtonContainer","widgets","askName","store","ns","vcard","object","name","permanent","continueButton","noun","targetClass","utils","label","deleteButton","deleteButtonWithCheck","button","style","display","flexDirection","currentObject","editable","width","manualURIEntry","plus","idNoun","makeDropTarget","dbLookup"],"sources":["../../../../src/widgets/forms/autocomplete/autocompleteBar.ts"],"sourcesContent":["/* The Autocomplete Control with decorations\n\nThis control has the buttons which control the state between editing, viewing, searching, accepting\nand so on. See the state diagram in the documentation. The AUtocomplete Picker does the main work.\n\n*/\nimport * as ns from '../../../ns'\nimport { icons } from '../../../iconBase'\nimport { store } from 'solid-logic'\nimport * as widgets from '../../../widgets'\nimport * as utils from '../../../utils'\n\nimport { renderAutoComplete, AutocompleteDecoration, setVisible } from './autocompletePicker' // dbpediaParameters\n\nimport { NamedNode } from 'rdflib'\n\nconst WEBID_NOUN = 'Solid ID'\n\nconst GREEN_PLUS = icons.iconBase + 'noun_34653_green.svg'\nconst SEARCH_ICON = icons.iconBase + 'noun_Search_875351.svg'\nconst EDIT_ICON = icons.iconBase + 'noun_253504.svg'\n// const DELETE_ICON = icons.iconBase + 'noun_2188_red.svg'\n\nexport async function renderAutocompleteControl (dom:HTMLDocument,\n person:NamedNode,\n barOptions,\n acOptions,\n addOneIdAndRefresh,\n deleteOne): Promise<HTMLElement> {\n async function autoCompleteDone (object, name) {\n if (acOptions.permanent) { // remember to set this in publicid panel\n setVisible(editButton, true)\n setVisible(acceptButton, false)\n setVisible(cancelButton, false)\n } else {\n // console.log('temporary - removed decoratiion')\n removeDecorated()\n }\n return addOneIdAndRefresh(object, name)\n }\n\n async function greenButtonHandler (_event) {\n const webid = await widgets.askName(dom, store, creationArea, ns.vcard('url'), undefined, WEBID_NOUN)\n if (!webid) {\n return // cancelled by user\n }\n return addOneIdAndRefresh(person, webid)\n }\n\n function removeDecorated () {\n if (decoratedAutocomplete) {\n creationArea.removeChild(decoratedAutocomplete)\n decoratedAutocomplete = undefined\n }\n }\n\n async function displayAutocomplete () {\n decoratedAutocomplete = dom.createElement('div') as HTMLElement\n decoratedAutocomplete.setAttribute('style', 'display: flex; flex-flow: wrap;')\n decoratedAutocomplete.appendChild(await renderAutoComplete(dom, acOptions, decoration, autoCompleteDone))\n // console.log('@@ acceptButton', acceptButton)\n decoratedAutocomplete.appendChild(acceptButton)\n // console.log('@@ cancelButton', cancelButton)\n\n decoratedAutocomplete.appendChild(cancelButton)\n // console.log('@@ editButton', editButton)\n\n decoratedAutocomplete.appendChild(editButton)\n // console.log('@@ deleteButtonContainer', deleteButtonContainer)\n\n decoratedAutocomplete.appendChild(deleteButtonContainer)\n creationArea.appendChild(decoratedAutocomplete)\n }\n\n async function searchButtonHandler (_event) {\n if (decoratedAutocomplete) {\n creationArea.removeChild(decoratedAutocomplete)\n decoratedAutocomplete = undefined\n } else {\n await displayAutocomplete()\n }\n }\n\n async function droppedURIHandler (uris) {\n for (const webid of uris) { // normally one but can be more than one\n await addOneIdAndRefresh(person, webid)\n }\n }\n\n const acceptButton = widgets.continueButton(dom)\n acceptButton.setAttribute('data-testid', 'accept-button')\n\n const cancelButton = widgets.cancelButton(dom)\n cancelButton.setAttribute('data-testid', 'cancel-button')\n const deleteButtonContainer = dom.createElement('div')\n const noun = acOptions.targetClass ? utils.label(acOptions.targetClass) : 'item'\n const deleteButton = widgets.deleteButtonWithCheck(dom, deleteButtonContainer, noun, deleteOne) // need to knock out this UI or caller does that\n deleteButton.setAttribute('data-testid', 'delete-button')\n const editButton = widgets.button(dom, EDIT_ICON, 'Edit', _event => {\n editing = !editing\n syncEditingStatus()\n })\n editButton.setAttribute('data-testid', 'edit-button')\n let editing = true\n\n function syncEditingStatus () {\n if (editing) {\n setVisible(editButton, false)\n setVisible(acceptButton, false) // not till got it\n setVisible(cancelButton, false)\n } else {\n setVisible(editButton, true)\n setVisible(acceptButton, false)\n setVisible(cancelButton, false)\n }\n }\n\n const decoration:AutocompleteDecoration = {\n acceptButton, cancelButton, editButton, deleteButton\n }\n\n let decoratedAutocomplete = undefined as HTMLElement | undefined\n\n const creationArea = dom.createElement('div')\n creationArea.style.display = 'flex'\n creationArea.style.flexDirection = 'row'\n\n if (acOptions.permanent || acOptions.currentObject) {\n await displayAutocomplete()\n }\n if (barOptions.editable) {\n // creationArea.appendChild(await renderAutoComplete(dom, barOptions, autoCompleteDone)) wait for searchButton\n creationArea.style.width = '100%'\n if (barOptions.manualURIEntry) {\n const plus = creationArea.appendChild(widgets.button(dom, GREEN_PLUS, barOptions.idNoun, greenButtonHandler))\n widgets.makeDropTarget(plus, droppedURIHandler, undefined)\n }\n if (barOptions.dbLookup && !acOptions.currentObject && !acOptions.permanent) {\n creationArea.appendChild(widgets.button(dom, SEARCH_ICON, barOptions.idNoun, searchButtonHandler))\n }\n }\n syncEditingStatus()\n return creationArea\n} // renderAutocompleteControl\n\n// ends\n"],"mappings":";;;;;;;;;;;;;;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;;;+CAXA,oJ;;AAeA,IAAMA,UAAU,GAAG,UAAnB;AAEA,IAAMC,UAAU,GAAGC,eAAA,CAAMC,QAAN,GAAiB,sBAApC;AACA,IAAMC,WAAW,GAAGF,eAAA,CAAMC,QAAN,GAAiB,wBAArC;AACA,IAAME,SAAS,GAAGH,eAAA,CAAMC,QAAN,GAAiB,iBAAnC,C,CACA;;SAEsBG,yB;;EAwHpB;AAEF;;;;2GA1HO,kBAA0CC,GAA1C,EACLC,MADK,EAELC,UAFK,EAGLC,SAHK,EAILC,kBAJK,EAKLC,SALK;IAAA,IAMUC,gBANV,qBAkBUC,kBAlBV,uBA0BIC,eA1BJ,EAiCUC,mBAjCV,wBAmDUC,mBAnDV,wBA4DUC,iBA5DV,kHAkFIC,iBAlFJ;;IAAA;MAAA;QAAA;UAAA;YAkFIA,iBAlFJ,iCAkFyB;cAC5B,IAAIC,OAAJ,EAAa;gBACX,IAAAC,8BAAA,EAAWC,UAAX,EAAuB,KAAvB;gBACA,IAAAD,8BAAA,EAAWE,YAAX,EAAyB,KAAzB,EAFW,CAEqB;;gBAChC,IAAAF,8BAAA,EAAWG,YAAX,EAAyB,KAAzB;cACD,CAJD,MAIO;gBACL,IAAAH,8BAAA,EAAWC,UAAX,EAAuB,IAAvB;gBACA,IAAAD,8BAAA,EAAWE,YAAX,EAAyB,KAAzB;gBACA,IAAAF,8BAAA,EAAWG,YAAX,EAAyB,KAAzB;cACD;YACF,CA5FI;;YAAA;cAAA,iGA4DL,kBAAkCC,IAAlC;gBAAA;;gBAAA;kBAAA;oBAAA;sBAAA;wBAAA,uCACsBA,IADtB;wBAAA;;wBAAA;;sBAAA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AmBE,aAAnB,GAAmC,KAAnC;;YAtGK,MAwGD9C,SAAS,CAACmC,SAAV,IAAuBnC,SAAS,CAAC+C,aAxGhC;cAAA;cAAA;YAAA;;YAAA;YAAA,OAyGGzC,mBAAmB,EAzGtB;;UAAA;YA2GL,IAAIP,UAAU,CAACiD,QAAf,EAAyB;cACvB;cACA7B,YAAY,CAACyB,KAAb,CAAmBK,KAAnB,GAA2B,MAA3B;;cACA,IAAIlD,UAAU,CAACmD,cAAf,EAA+B;gBACvBC,IADuB,GAChBhC,YAAY,CAACO,WAAb,CAAyBE,OAAO,CAACe,MAAR,CAAe9C,GAAf,EAAoBN,UAApB,EAAgCQ,UAAU,CAACqD,MAA3C,EAAmDhD,kBAAnD,CAAzB,CADgB;gBAE7BwB,OAAO,CAACyB,cAAR,CAAuBF,IAAvB,EAA6B3C,iBAA7B,EAAgDa,SAAhD;cACD;;cACD,IAAItB,UAAU,CAACuD,QAAX,IAAuB,CAACtD,SAAS,CAAC+C,aAAlC,IAAmD,CAAC/C,SAAS,CAACmC,SAAlE,EAA6E;gBAC3EhB,YAAY,CAACO,WAAb,CAAyBE,OAAO,CAACe,MAAR,CAAe9C,GAAf,EAAoBH,WAApB,EAAiCK,UAAU,CAACqD,MAA5C,EAAoD7C,mBAApD,CAAzB;cACD;YACF;;YACDE,iBAAiB;YAtHZ,kCAuHEU,YAvHF;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C"}
|
|
@@ -9,8 +9,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.autocompleteField = autocompleteField;
|
|
11
11
|
|
|
12
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
13
|
|
|
16
14
|
var ns = _interopRequireWildcard(require("../../../ns"));
|
|
@@ -29,8 +27,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
29
27
|
|
|
30
28
|
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; }
|
|
31
29
|
|
|
32
|
-
/* Form field for doing autocompleete
|
|
33
|
-
*/
|
|
30
|
+
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; }
|
|
34
31
|
|
|
35
32
|
/**
|
|
36
33
|
* Render a autocomplete form field
|
|
@@ -65,10 +62,10 @@ function autocompleteField(dom, container, already, subject, form, doc, callback
|
|
|
65
62
|
}
|
|
66
63
|
|
|
67
64
|
function _addOneIdAndRefresh() {
|
|
68
|
-
_addOneIdAndRefresh = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
65
|
+
_addOneIdAndRefresh = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(result, name) {
|
|
69
66
|
var oldValue, oldName, deletables, insertables, _kb$updater2;
|
|
70
67
|
|
|
71
|
-
return
|
|
68
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
72
69
|
while (1) {
|
|
73
70
|
switch (_context.prev = _context.next) {
|
|
74
71
|
case 0:
|
|
@@ -135,10 +132,10 @@ function autocompleteField(dom, container, already, subject, form, doc, callback
|
|
|
135
132
|
}
|
|
136
133
|
|
|
137
134
|
function _deleteOne() {
|
|
138
|
-
_deleteOne = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
135
|
+
_deleteOne = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_result, _name) {
|
|
139
136
|
var oldValue, deletables, insertables, _kb$updater3, e2;
|
|
140
137
|
|
|
141
|
-
return
|
|
138
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
142
139
|
while (1) {
|
|
143
140
|
switch (_context2.prev = _context2.next) {
|
|
144
141
|
case 0:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/widgets/forms/autocomplete/autocompleteField.ts"],"names":["autocompleteField","dom","container","already","subject","form","doc","callbackFunction","addOneIdAndRefresh","result","name","Error","oldValue","kb","the","property","oldName","any","labelProperty","equals","sameTerm","deletables","statementsMatching","concat","insertables","updater","updateMany","box","appendChild","widgets","errorMessageBlock","deleteOne","_result","_name","e2","termType","store","formDoc","createElement","lhs","setAttribute","style","formFieldNameBoxStyle","rhs","ns","ui","schema","dataSource","queryParams","label","anyJS","logo","targetClass","objectURIBase","undefined","endpoint","searchByNameQuery","insitituteDetailsQuery","searchByNameURI","suppressEmptyUneditable","editable","uri","autocompleteOptions","permanent","size","obj","currentObject","currentName","display","fieldLabel","barOptions","dbLookup","then","control","err"],"mappings":";;;;;;;;;;;;;;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AARA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,iBAAT,CACLC,GADK,EAELC,SAFK,EAGLC,OAHK,EAILC,OAJK,EAKLC,IALK,EAMLC,GANK,EAOLC,gBAPK,EAQQ;AAAA;;AAAA,WACEC,kBADF;AAAA;AAAA;;AAAA;AAAA,wGACb,iBAAmCC,MAAnC,EAA+DC,IAA/D;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,kBACOA,IADP;AAAA;AAAA;AAAA;;AAAA,oBAEU,IAAIC,KAAJ,CAAU,kCAAV,CAFV;;AAAA;AAIQC,cAAAA,QAJR,GAImBC,EAAE,CAACC,GAAH,CAAOV,OAAP,EAAgBW,QAAhB,EAAiC,IAAjC,EAAuCT,GAAvC,CAJnB;;AAAA,mBAKMM,QALN;AAAA;AAAA;AAAA;;AAMUI,cAAAA,OANV,GAMoBH,EAAE,CAACI,GAAH,CAAOL,QAAP,EAAwBM,aAAxB,EAA8C,IAA9C,EAAoDZ,GAApD,CANp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AAlC;AACD;;AAEDiC,EAAAA,GAAG,CAACX,WAAJ,CAAgBC,OAAO,CAACwC,UAAR,CAAmBpE,GAAnB,EAAwBc,QAAxB,EAAyCV,IAAzC,CAAhB;AAEA,MAAMiE,UAAU,GAAG;AACjBV,IAAAA,QAAQ,EAARA,QADiB;AAEjBW,IAAAA,QAAQ,EAAE;AAFO,GAAnB;AAKA,kDAA0BtE,GAA1B,EAA+BG,OAA/B,EAAqDkE,UAArD,EAAiER,mBAAjE,EAAsFtD,kBAAtF,EAA0GuB,SAA1G,EAAqHyC,IAArH,CAA0H,UAACC,OAAD,EAAa;AACrI9B,IAAAA,GAAG,CAACf,WAAJ,CAAgB6C,OAAhB;AACD,GAFD,EAEG,UAACC,GAAD,EAAS;AACV/B,IAAAA,GAAG,CAACf,WAAJ,CAAgBC,OAAO,CAACC,iBAAR,CAA0B7B,GAA1B,yCAA+DI,IAA/D,eAAwEqE,GAAxE,GAA+E,MAA/E,EAAuFA,GAAvF,CAAhB,EADU,CACmG;AAC9G,GAJD;AAKA,SAAO/C,GAAP;AACD,C,CAED","sourcesContent":["/* Form field for doing autocompleete\n */\nimport * as ns from '../../../ns'\nimport { store } from 'solid-logic'\nimport * as widgets from '../../../widgets'\nimport * as style from '../../../style'\nimport { renderAutocompleteControl } from './autocompleteBar'\nimport { QueryParameters } from './publicData'\nimport { NamedNode, BlankNode, Literal, Variable, st } from 'rdflib'\nimport { AutocompleteOptions } from './autocompletePicker'\n/**\n * Render a autocomplete form field\n *\n * The autocomplete form searches for an object in a definitive public database,\n * and allows the user to search for it by name, displaying a list of objects whose names match\n * the input to date, and letting the user either click on one of the list,\n * or just go on untill there is only one. The process then returns two values,\n * the URiI of the object and its name.\n *\n * @param dom The HTML Document object aka Document Object Model\n * @param container If present, the created widget will be appended to this\n * @param already A hash table of (form, subject) kept to prevent recursive forms looping\n * @param subject The thing about which the form displays/edits data\n * @param form The form or field to be rendered\n * @param doc The web document in which the data is\n * @param callbackFunction Called when data is changed so other parts can be refreshed.\n *\n * Form properties:\n * @param ui:property The property to store the object itself\n * @param ui:labelProperty The property used to store the name of the object\n * @param ui:category The class of objects to be searched, if fixed (else dep on class of subject)\n *\n * @returns The HTML widget created\n */\n// eslint-disable-next-line complexity\nexport function autocompleteField (\n dom: HTMLDocument,\n container: HTMLElement | undefined,\n already,\n subject: NamedNode | BlankNode | Variable,\n form: NamedNode,\n doc: NamedNode | undefined,\n callbackFunction: (_ok: boolean, _errorMessage: string) => void\n): HTMLElement {\n async function addOneIdAndRefresh (result:NamedNode | Literal, name: Literal) {\n if (!name) {\n throw new Error('autocompleteField: No name set.')\n }\n const oldValue = kb.the(subject, property as any, null, doc)\n if (oldValue) {\n const oldName = kb.any(oldValue as any, labelProperty as any, null, doc)\n if (oldValue.equals(result) && oldName && oldName.sameTerm(name)) {\n // console.log('No change: same values.')\n return\n }\n }\n const deletables = oldValue\n ? kb.statementsMatching(subject, property as any, oldValue, doc)\n .concat(kb.statementsMatching(oldValue as any, labelProperty as any, null, doc))\n : []\n // console.log('autocompleteField Deletables ' + deletables.map(st => st.toNT()))\n const insertables = [st(subject, property as any, result, doc),\n st(result as any, labelProperty as any, name, doc)] // @@ track the language of the name too!\n // console.log(`AC form: ${deletables.length} to delete and ${insertables.length} to insert`)\n try {\n // console.log('@@@ AC updating ', deletables, insertables)\n await kb.updater?.updateMany(deletables, insertables)\n } catch (err) {\n callbackFunction(false, err)\n box.appendChild(widgets.errorMessageBlock(dom, 'Autocomplete form data update error:' + err, null, err))\n return\n }\n callbackFunction(true, '')\n }\n\n async function deleteOne (_result:NamedNode | Literal, _name: Literal) {\n const oldValue = kb.the(subject, property as any, null, doc)\n if (!oldValue) {\n callbackFunction(false, 'NO data to elete')\n box.appendChild(widgets.errorMessageBlock(dom, 'Autocomplete delete: no old data!'))\n return\n }\n // const oldName = kb.any(oldValue as any, labelProperty as any, null, doc)\n const deletables = kb.statementsMatching(subject, property as any, oldValue, doc)\n .concat(kb.statementsMatching(oldValue as any, labelProperty as any, null, doc))\n // console.log('autocompleteField Deletables ' + deletables.map(st => st.toNT()))\n const insertables = []\n // console.log(`AC form delete: ${deletables.length} to delete and ${insertables.length} to insert`)\n try {\n // console.log('@@@ AC updating ', deletables, insertables)\n await kb.updater?.updateMany(deletables, insertables)\n } catch (err) {\n const e2 = new Error('Autocomplete form data delete error:' + err)\n callbackFunction(false, err)\n box.appendChild(widgets.errorMessageBlock(dom, e2, null, err))\n return\n }\n callbackFunction(true, '') // changed\n }\n\n if (subject.termType !== 'NamedNode') {\n throw new Error('Sorry this field only works on NamedNode subjects (for editable)')\n }\n const kb = store\n const formDoc = form.doc ? form.doc() : null // @@ if blank no way to know\n\n const box = dom.createElement('div')\n if (container) container.appendChild(box)\n const lhs = dom.createElement('div')\n lhs.setAttribute('class', 'formFieldName')\n lhs.setAttribute('style', style.formFieldNameBoxStyle)\n box.appendChild(lhs)\n const rhs = dom.createElement('div')\n rhs.setAttribute('class', 'formFieldValue')\n box.appendChild(rhs)\n\n const property = kb.any(form, ns.ui('property'))\n if (!property) {\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No property given for autocomplete field: ' + form)\n )\n }\n const labelProperty = kb.any(form, ns.ui('labelProperty')) || ns.schema('name')\n\n // Parse the data source into query options\n\n const dataSource = kb.any(form, ns.ui('dataSource')) as NamedNode | undefined\n if (!dataSource) {\n // console.log('@@ connectedStatements ACF ', kb.connectedStatements(form).map(x => x.toNT()).join('\\n'))\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No data source given for autocomplete field: ' + form)\n )\n }\n const queryParams:QueryParameters = {\n // targetClass: kb.any(dataSource, ns.ui('targetClass'), null, dataSource.doc()) as NamedNode | undefined,\n label: kb.anyJS(dataSource, ns.schema('name'), null, dataSource.doc()),\n logo: (kb.any(dataSource, ns.schema('logo'), null, dataSource.doc())) as NamedNode | undefined\n }\n\n // @@ Should we pass the target class in from the data source definition or use a current type of the subject\n const targetClass = (kb.any(form, ns.ui('targetClass'), null, form.doc()) || // class in form takes pecedence\n kb.any(dataSource, ns.ui('targetClass'), null, dataSource.doc())) as NamedNode | undefined\n if (targetClass) {\n queryParams.targetClass = targetClass\n }\n\n queryParams.objectURIBase = (kb.any(dataSource, ns.ui('objectURIBase'), null, dataSource.doc()) || undefined) as NamedNode | undefined\n\n /*\n if (!queryParams.targetClass) {\n const klass = kb.any(subject, ns.rdf('type')) as NamedNode | undefined\n // @@ be more selective of which class if many\n // @@ todo: Take ALL classes, and compare them with those the data source knows about\n // with translation where necessary. Find most specific of the classes for the search.\n if (!klass) throw new Error('Autocomplete: No class specified or is current type of' + subject)\n queryParams.targetClass = klass\n }\n */\n const endpoint = kb.anyJS(dataSource, ns.ui('endpoint'), null, dataSource.doc()) as string | undefined\n if (endpoint) { // SPARQL\n queryParams.endpoint = endpoint\n\n queryParams.searchByNameQuery = kb.anyJS(dataSource, ns.ui('searchByNameQuery'), null, dataSource.doc())\n if (!queryParams.searchByNameQuery) {\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No searchByNameQuery given for endpoint data Source: ' + form))\n }\n queryParams.insitituteDetailsQuery = kb.anyJS(dataSource, ns.ui('insitituteDetailsQuery'), null, dataSource.doc())\n } else {\n // return box.appendChild(\n // widgets.errorMessageBlock(dom, 'Error: No SPARQL endpoint given for autocomplete field: ' + form))\n const searchByNameURI = kb.anyJS(dataSource, ns.ui('searchByNameURI'))\n if (!searchByNameURI) {\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No searchByNameURI OR sparql endpoint given for dataSource: ' + dataSource)\n )\n }\n queryParams.searchByNameURI = searchByNameURI\n }\n // It can be cleaner to just remove empty fields if you can't edit them anyway\n const suppressEmptyUneditable = kb.anyJS(form, ns.ui('suppressEmptyUneditable'), null, formDoc)\n const editable = kb.updater?.editable((doc as NamedNode).uri)\n\n const autocompleteOptions:AutocompleteOptions = { // cancelButton?: HTMLElement,\n permanent: true,\n targetClass: queryParams.targetClass, // @@ simplify?\n queryParams\n }\n\n autocompleteOptions.size = kb.anyJS(form, ns.ui('size'), null, formDoc) || undefined\n\n let obj = kb.any(subject, property as any, undefined, doc)\n if (!obj) {\n obj = kb.any(form, ns.ui('default'))\n if (obj) {\n autocompleteOptions.currentObject = obj as NamedNode\n autocompleteOptions.currentName = kb.any(autocompleteOptions.currentObject, labelProperty, null, doc) as Literal\n } else { // No data or default. Should we suprress the whole field?\n if (suppressEmptyUneditable && !editable) {\n box.style.display = 'none' // clutter removal\n return box\n }\n }\n } else { // get object and name from target data:\n autocompleteOptions.currentObject = obj as NamedNode\n autocompleteOptions.currentName = kb.any(autocompleteOptions.currentObject, labelProperty, null, doc) as Literal\n }\n\n lhs.appendChild(widgets.fieldLabel(dom, property as any, form))\n\n const barOptions = {\n editable,\n dbLookup: true\n }\n\n renderAutocompleteControl(dom, subject as NamedNode, barOptions, autocompleteOptions, addOneIdAndRefresh, deleteOne).then((control) => {\n rhs.appendChild(control)\n }, (err) => {\n rhs.appendChild(widgets.errorMessageBlock(dom, `Error rendering autocomplete ${form}: ${err}`, '#fee', err)) //\n })\n return box\n}\n\n// ends\n"],"file":"autocompleteField.js"}
|
|
1
|
+
{"version":3,"file":"autocompleteField.js","names":["autocompleteField","dom","container","already","subject","form","doc","callbackFunction","addOneIdAndRefresh","result","name","Error","oldValue","kb","the","property","oldName","any","labelProperty","equals","sameTerm","deletables","statementsMatching","concat","insertables","st","updater","updateMany","box","appendChild","widgets","errorMessageBlock","deleteOne","_result","_name","e2","termType","store","formDoc","createElement","lhs","setAttribute","style","formFieldNameBoxStyle","rhs","ns","ui","schema","dataSource","queryParams","label","anyJS","logo","targetClass","objectURIBase","undefined","endpoint","searchByNameQuery","insitituteDetailsQuery","searchByNameURI","suppressEmptyUneditable","editable","uri","autocompleteOptions","permanent","size","obj","currentObject","currentName","display","fieldLabel","barOptions","dbLookup","renderAutocompleteControl","then","control","err"],"sources":["../../../../src/widgets/forms/autocomplete/autocompleteField.ts"],"sourcesContent":["/* Form field for doing autocompleete\n */\nimport * as ns from '../../../ns'\nimport { store } from 'solid-logic'\nimport * as widgets from '../../../widgets'\nimport * as style from '../../../style'\nimport { renderAutocompleteControl } from './autocompleteBar'\nimport { QueryParameters } from './publicData'\nimport { NamedNode, BlankNode, Literal, Variable, st } from 'rdflib'\nimport { AutocompleteOptions } from './autocompletePicker'\n/**\n * Render a autocomplete form field\n *\n * The autocomplete form searches for an object in a definitive public database,\n * and allows the user to search for it by name, displaying a list of objects whose names match\n * the input to date, and letting the user either click on one of the list,\n * or just go on untill there is only one. The process then returns two values,\n * the URiI of the object and its name.\n *\n * @param dom The HTML Document object aka Document Object Model\n * @param container If present, the created widget will be appended to this\n * @param already A hash table of (form, subject) kept to prevent recursive forms looping\n * @param subject The thing about which the form displays/edits data\n * @param form The form or field to be rendered\n * @param doc The web document in which the data is\n * @param callbackFunction Called when data is changed so other parts can be refreshed.\n *\n * Form properties:\n * @param ui:property The property to store the object itself\n * @param ui:labelProperty The property used to store the name of the object\n * @param ui:category The class of objects to be searched, if fixed (else dep on class of subject)\n *\n * @returns The HTML widget created\n */\n// eslint-disable-next-line complexity\nexport function autocompleteField (\n dom: HTMLDocument,\n container: HTMLElement | undefined,\n already,\n subject: NamedNode | BlankNode | Variable,\n form: NamedNode,\n doc: NamedNode | undefined,\n callbackFunction: (_ok: boolean, _errorMessage: string) => void\n): HTMLElement {\n async function addOneIdAndRefresh (result:NamedNode | Literal, name: Literal) {\n if (!name) {\n throw new Error('autocompleteField: No name set.')\n }\n const oldValue = kb.the(subject, property as any, null, doc)\n if (oldValue) {\n const oldName = kb.any(oldValue as any, labelProperty as any, null, doc)\n if (oldValue.equals(result) && oldName && oldName.sameTerm(name)) {\n // console.log('No change: same values.')\n return\n }\n }\n const deletables = oldValue\n ? kb.statementsMatching(subject, property as any, oldValue, doc)\n .concat(kb.statementsMatching(oldValue as any, labelProperty as any, null, doc))\n : []\n // console.log('autocompleteField Deletables ' + deletables.map(st => st.toNT()))\n const insertables = [st(subject, property as any, result, doc),\n st(result as any, labelProperty as any, name, doc)] // @@ track the language of the name too!\n // console.log(`AC form: ${deletables.length} to delete and ${insertables.length} to insert`)\n try {\n // console.log('@@@ AC updating ', deletables, insertables)\n await kb.updater?.updateMany(deletables, insertables)\n } catch (err) {\n callbackFunction(false, err)\n box.appendChild(widgets.errorMessageBlock(dom, 'Autocomplete form data update error:' + err, null, err))\n return\n }\n callbackFunction(true, '')\n }\n\n async function deleteOne (_result:NamedNode | Literal, _name: Literal) {\n const oldValue = kb.the(subject, property as any, null, doc)\n if (!oldValue) {\n callbackFunction(false, 'NO data to elete')\n box.appendChild(widgets.errorMessageBlock(dom, 'Autocomplete delete: no old data!'))\n return\n }\n // const oldName = kb.any(oldValue as any, labelProperty as any, null, doc)\n const deletables = kb.statementsMatching(subject, property as any, oldValue, doc)\n .concat(kb.statementsMatching(oldValue as any, labelProperty as any, null, doc))\n // console.log('autocompleteField Deletables ' + deletables.map(st => st.toNT()))\n const insertables = []\n // console.log(`AC form delete: ${deletables.length} to delete and ${insertables.length} to insert`)\n try {\n // console.log('@@@ AC updating ', deletables, insertables)\n await kb.updater?.updateMany(deletables, insertables)\n } catch (err) {\n const e2 = new Error('Autocomplete form data delete error:' + err)\n callbackFunction(false, err)\n box.appendChild(widgets.errorMessageBlock(dom, e2, null, err))\n return\n }\n callbackFunction(true, '') // changed\n }\n\n if (subject.termType !== 'NamedNode') {\n throw new Error('Sorry this field only works on NamedNode subjects (for editable)')\n }\n const kb = store\n const formDoc = form.doc ? form.doc() : null // @@ if blank no way to know\n\n const box = dom.createElement('div')\n if (container) container.appendChild(box)\n const lhs = dom.createElement('div')\n lhs.setAttribute('class', 'formFieldName')\n lhs.setAttribute('style', style.formFieldNameBoxStyle)\n box.appendChild(lhs)\n const rhs = dom.createElement('div')\n rhs.setAttribute('class', 'formFieldValue')\n box.appendChild(rhs)\n\n const property = kb.any(form, ns.ui('property'))\n if (!property) {\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No property given for autocomplete field: ' + form)\n )\n }\n const labelProperty = kb.any(form, ns.ui('labelProperty')) || ns.schema('name')\n\n // Parse the data source into query options\n\n const dataSource = kb.any(form, ns.ui('dataSource')) as NamedNode | undefined\n if (!dataSource) {\n // console.log('@@ connectedStatements ACF ', kb.connectedStatements(form).map(x => x.toNT()).join('\\n'))\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No data source given for autocomplete field: ' + form)\n )\n }\n const queryParams:QueryParameters = {\n // targetClass: kb.any(dataSource, ns.ui('targetClass'), null, dataSource.doc()) as NamedNode | undefined,\n label: kb.anyJS(dataSource, ns.schema('name'), null, dataSource.doc()),\n logo: (kb.any(dataSource, ns.schema('logo'), null, dataSource.doc())) as NamedNode | undefined\n }\n\n // @@ Should we pass the target class in from the data source definition or use a current type of the subject\n const targetClass = (kb.any(form, ns.ui('targetClass'), null, form.doc()) || // class in form takes pecedence\n kb.any(dataSource, ns.ui('targetClass'), null, dataSource.doc())) as NamedNode | undefined\n if (targetClass) {\n queryParams.targetClass = targetClass\n }\n\n queryParams.objectURIBase = (kb.any(dataSource, ns.ui('objectURIBase'), null, dataSource.doc()) || undefined) as NamedNode | undefined\n\n /*\n if (!queryParams.targetClass) {\n const klass = kb.any(subject, ns.rdf('type')) as NamedNode | undefined\n // @@ be more selective of which class if many\n // @@ todo: Take ALL classes, and compare them with those the data source knows about\n // with translation where necessary. Find most specific of the classes for the search.\n if (!klass) throw new Error('Autocomplete: No class specified or is current type of' + subject)\n queryParams.targetClass = klass\n }\n */\n const endpoint = kb.anyJS(dataSource, ns.ui('endpoint'), null, dataSource.doc()) as string | undefined\n if (endpoint) { // SPARQL\n queryParams.endpoint = endpoint\n\n queryParams.searchByNameQuery = kb.anyJS(dataSource, ns.ui('searchByNameQuery'), null, dataSource.doc())\n if (!queryParams.searchByNameQuery) {\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No searchByNameQuery given for endpoint data Source: ' + form))\n }\n queryParams.insitituteDetailsQuery = kb.anyJS(dataSource, ns.ui('insitituteDetailsQuery'), null, dataSource.doc())\n } else {\n // return box.appendChild(\n // widgets.errorMessageBlock(dom, 'Error: No SPARQL endpoint given for autocomplete field: ' + form))\n const searchByNameURI = kb.anyJS(dataSource, ns.ui('searchByNameURI'))\n if (!searchByNameURI) {\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No searchByNameURI OR sparql endpoint given for dataSource: ' + dataSource)\n )\n }\n queryParams.searchByNameURI = searchByNameURI\n }\n // It can be cleaner to just remove empty fields if you can't edit them anyway\n const suppressEmptyUneditable = kb.anyJS(form, ns.ui('suppressEmptyUneditable'), null, formDoc)\n const editable = kb.updater?.editable((doc as NamedNode).uri)\n\n const autocompleteOptions:AutocompleteOptions = { // cancelButton?: HTMLElement,\n permanent: true,\n targetClass: queryParams.targetClass, // @@ simplify?\n queryParams\n }\n\n autocompleteOptions.size = kb.anyJS(form, ns.ui('size'), null, formDoc) || undefined\n\n let obj = kb.any(subject, property as any, undefined, doc)\n if (!obj) {\n obj = kb.any(form, ns.ui('default'))\n if (obj) {\n autocompleteOptions.currentObject = obj as NamedNode\n autocompleteOptions.currentName = kb.any(autocompleteOptions.currentObject, labelProperty, null, doc) as Literal\n } else { // No data or default. Should we suprress the whole field?\n if (suppressEmptyUneditable && !editable) {\n box.style.display = 'none' // clutter removal\n return box\n }\n }\n } else { // get object and name from target data:\n autocompleteOptions.currentObject = obj as NamedNode\n autocompleteOptions.currentName = kb.any(autocompleteOptions.currentObject, labelProperty, null, doc) as Literal\n }\n\n lhs.appendChild(widgets.fieldLabel(dom, property as any, form))\n\n const barOptions = {\n editable,\n dbLookup: true\n }\n\n renderAutocompleteControl(dom, subject as NamedNode, barOptions, autocompleteOptions, addOneIdAndRefresh, deleteOne).then((control) => {\n rhs.appendChild(control)\n }, (err) => {\n rhs.appendChild(widgets.errorMessageBlock(dom, `Error rendering autocomplete ${form}: ${err}`, '#fee', err)) //\n })\n return box\n}\n\n// ends\n"],"mappings":";;;;;;;;;;;;;AAEA;;AACA;;AACA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|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
10
10
|
exports.renderAutoComplete = renderAutoComplete;
|
|
11
11
|
exports.setVisible = setVisible;
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
14
14
|
|
|
15
15
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
16
16
|
|
|
@@ -28,7 +28,7 @@ var _language = require("./language");
|
|
|
28
28
|
|
|
29
29
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
30
30
|
|
|
31
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
31
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(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; }
|
|
32
32
|
|
|
33
33
|
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(_e) { throw _e; }, 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(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
34
34
|
|
|
@@ -36,6 +36,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
36
36
|
|
|
37
37
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
38
38
|
|
|
39
|
+
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" == (0, _typeof2["default"])(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; }
|
|
40
|
+
|
|
39
41
|
var AUTOCOMPLETE_THRESHOLD = 4; // don't check until this many characters typed
|
|
40
42
|
|
|
41
43
|
var AUTOCOMPLETE_ROWS = 20; // 20?
|
|
@@ -66,10 +68,10 @@ function renderAutoComplete(_x, _x2, _x3, _x4) {
|
|
|
66
68
|
|
|
67
69
|
|
|
68
70
|
function _renderAutoComplete() {
|
|
69
|
-
_renderAutoComplete = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
71
|
+
_renderAutoComplete = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(dom, acOptions, decoration, callback) {
|
|
70
72
|
var complain, finish, gotIt, _gotIt, acceptButtonHandler, _acceptButtonHandler, cancelButtonHandler, _cancelButtonHandler, nameMatch, clearList, inputEventHHandler, _inputEventHHandler, loadBindingsAndFilterByLanguage, _loadBindingsAndFilterByLanguage, filterByName, refreshList, _refreshList, initialize, targetClass, lastBindings, loadedEnough, inputEventHandlerLock, allDisplayed, lastFilter, numberOfRows, div, foundName, foundObject, table, head, cell, searchInput, size, searchInputStyle;
|
|
71
73
|
|
|
72
|
-
return
|
|
74
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
73
75
|
while (1) {
|
|
74
76
|
switch (_context8.prev = _context8.next) {
|
|
75
77
|
case 0:
|
|
@@ -107,10 +109,10 @@ function _renderAutoComplete() {
|
|
|
107
109
|
};
|
|
108
110
|
|
|
109
111
|
_refreshList = function _refreshList3() {
|
|
110
|
-
_refreshList = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
112
|
+
_refreshList = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
111
113
|
var rowForBinding, compareBindingsByName, languagePrefs, filter, slimmed, displayable, _iterator, _step, binding;
|
|
112
114
|
|
|
113
|
-
return
|
|
115
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
114
116
|
while (1) {
|
|
115
117
|
switch (_context7.prev = _context7.next) {
|
|
116
118
|
case 0:
|
|
@@ -128,8 +130,8 @@ function _renderAutoComplete() {
|
|
|
128
130
|
var object = (0, _publicData.bindingToTerm)(binding.subject);
|
|
129
131
|
var nameTerm = (0, _publicData.bindingToTerm)(binding.name);
|
|
130
132
|
row.addEventListener('click', /*#__PURE__*/function () {
|
|
131
|
-
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
132
|
-
return
|
|
133
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_event) {
|
|
134
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
133
135
|
while (1) {
|
|
134
136
|
switch (_context6.prev = _context6.next) {
|
|
135
137
|
case 0:
|
|
@@ -253,9 +255,9 @@ function _renderAutoComplete() {
|
|
|
253
255
|
};
|
|
254
256
|
|
|
255
257
|
_loadBindingsAndFilterByLanguage = function _loadBindingsAndFilte2() {
|
|
256
|
-
_loadBindingsAndFilterByLanguage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
258
|
+
_loadBindingsAndFilterByLanguage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(filter, languagePrefs) {
|
|
257
259
|
var bindings, slimmed;
|
|
258
|
-
return
|
|
260
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
259
261
|
while (1) {
|
|
260
262
|
switch (_context5.prev = _context5.next) {
|
|
261
263
|
case 0:
|
|
@@ -303,8 +305,8 @@ function _renderAutoComplete() {
|
|
|
303
305
|
};
|
|
304
306
|
|
|
305
307
|
_inputEventHHandler = function _inputEventHHandler3() {
|
|
306
|
-
_inputEventHHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
307
|
-
return
|
|
308
|
+
_inputEventHHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_event) {
|
|
309
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
308
310
|
while (1) {
|
|
309
311
|
switch (_context4.prev = _context4.next) {
|
|
310
312
|
case 0:
|
|
@@ -352,8 +354,8 @@ function _renderAutoComplete() {
|
|
|
352
354
|
};
|
|
353
355
|
|
|
354
356
|
_cancelButtonHandler = function _cancelButtonHandler3() {
|
|
355
|
-
_cancelButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
356
|
-
return
|
|
357
|
+
_cancelButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_event) {
|
|
358
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
357
359
|
while (1) {
|
|
358
360
|
switch (_context3.prev = _context3.next) {
|
|
359
361
|
case 0:
|
|
@@ -382,8 +384,8 @@ function _renderAutoComplete() {
|
|
|
382
384
|
};
|
|
383
385
|
|
|
384
386
|
_acceptButtonHandler = function _acceptButtonHandler3() {
|
|
385
|
-
_acceptButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
386
|
-
return
|
|
387
|
+
_acceptButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_event) {
|
|
388
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
387
389
|
while (1) {
|
|
388
390
|
switch (_context2.prev = _context2.next) {
|
|
389
391
|
case 0:
|
|
@@ -407,8 +409,8 @@ function _renderAutoComplete() {
|
|
|
407
409
|
};
|
|
408
410
|
|
|
409
411
|
_gotIt = function _gotIt3() {
|
|
410
|
-
_gotIt = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
411
|
-
return
|
|
412
|
+
_gotIt = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(object, name) {
|
|
413
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
412
414
|
while (1) {
|
|
413
415
|
switch (_context.prev = _context.next) {
|
|
414
416
|
case 0:
|