solid-ui 3.0.5-test.8 → 3.0.5

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/solid-ui.js CHANGED
@@ -4913,6 +4913,8 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
4913
4913
  field.style = inputStyle;
4914
4914
  rhs.appendChild(field);
4915
4915
  field.setAttribute('type', params.type ? params.type : 'text');
4916
+ var fieldType = (field.getAttribute('type') || '').toLowerCase();
4917
+ var deferWhileFocused = fieldType === 'date' || fieldType === 'datetime-local';
4916
4918
  var size = kb.anyJS(form, src_ns.ui('size')) || styleConstants.textInputSize || 20;
4917
4919
  field.setAttribute('size', size);
4918
4920
  var maxLength = kb.any(form, src_ns.ui('maxLength'));
@@ -4951,9 +4953,18 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
4951
4953
  }
4952
4954
  }, true);
4953
4955
  field.addEventListener('change', function (_e) {
4956
+ if (deferWhileFocused && dom.activeElement === field) {
4957
+ if (field.dataset) {
4958
+ field.dataset.deferredChange = 'true';
4959
+ }
4960
+ return;
4961
+ }
4954
4962
  // i.e. lose focus with changed data
4955
4963
  if (params.pattern && !field.value.match(params.pattern)) return;
4956
- field.disabled = true; // See if this stops getting two dates from fumbling e.g the chrome datepicker.
4964
+ var disabledForSave = !deferWhileFocused;
4965
+ if (disabledForSave) {
4966
+ field.disabled = true; // See if this stops getting two dates from fumbling, e.g., the chrome datepicker.
4967
+ }
4957
4968
  field.setAttribute('style', inputStyle + 'color: gray;'); // pending
4958
4969
  var ds = kb.statementsMatching(subject, property); // remove any multiple values
4959
4970
  var result;
@@ -5021,7 +5032,9 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
5021
5032
  updateMany(ds, is, function (uri, ok, body) {
5022
5033
  // kb.updater.update(ds, is, function (uri, ok, body) {
5023
5034
  if (ok) {
5024
- field.disabled = false;
5035
+ if (disabledForSave) {
5036
+ field.disabled = false;
5037
+ }
5025
5038
  field.setAttribute('style', inputStyle);
5026
5039
  } else {
5027
5040
  box.appendChild(errorMessageBlock(dom, body));
@@ -5029,6 +5042,15 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
5029
5042
  callbackFunction(ok, body);
5030
5043
  });
5031
5044
  }, true);
5045
+ field.addEventListener('blur', function (_e) {
5046
+ if (deferWhileFocused && field.dataset && field.dataset.deferredChange === 'true') {
5047
+ delete field.dataset.deferredChange;
5048
+ var event = new Event('change', {
5049
+ bubbles: true
5050
+ });
5051
+ field.dispatchEvent(event);
5052
+ }
5053
+ }, true);
5032
5054
  return box;
5033
5055
  }
5034
5056
  ;// ./src/widgets/forms/autocomplete/language.ts
@@ -11478,6 +11500,8 @@ var AccessGroups = /*#__PURE__*/function () {
11478
11500
  thing,
11479
11501
  _this$_store,
11480
11502
  message,
11503
+ detectedTypes,
11504
+ typeDetails,
11481
11505
  error,
11482
11506
  _args4 = arguments,
11483
11507
  _t2;
@@ -11511,7 +11535,9 @@ var AccessGroups = /*#__PURE__*/function () {
11511
11535
  _context4.next = 6;
11512
11536
  break;
11513
11537
  }
11514
- error = " Error: Drop fails to drop appropriate thing! ".concat(uri);
11538
+ detectedTypes = Object.keys(this.store.findTypeURIs(thing));
11539
+ typeDetails = detectedTypes.length > 0 ? "Detected RDF types: ".concat(detectedTypes.join(', ')) : 'No RDF type was detected for this URI.';
11540
+ error = "Error: Failed to add access target: ".concat(uri, " is not a recognized ACL target type.") + " Expected one of: vcard:WebID, vcard:Group, foaf:Person, foaf:Agent, solid:AppProvider, solid:AppProviderClass, or recognized ACL classes." + ' Hint: try dropping a WebID profile URI, a vcard:Group URI, or a web app origin.' + typeDetails;
11515
11541
  src_debug/* error */.z3(error);
11516
11542
  return _context4.abrupt("return", Promise.reject(new Error(error)));
11517
11543
  case 6: