solid-ui 3.0.4-e7336b6 → 3.0.4-f2d852f

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
@@ -4091,7 +4091,7 @@ function attachmentList(dom, subject, div) {
4091
4091
  var attachmentRight = attachmentOne.appendChild(dom.createElement('td'));
4092
4092
  var attachmentTable = attachmentRight.appendChild(dom.createElement('table'));
4093
4093
  attachmentTable.appendChild(dom.createElement('tr')) // attachmentTableTop
4094
- ;
4094
+ ;
4095
4095
  attachmentOuter.refresh = refresh; // Participate in downstream changes
4096
4096
  // ;(attachmentTable as any).refresh = refresh <- outer should be best?
4097
4097
 
@@ -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'));
@@ -4936,7 +4938,7 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
4936
4938
  }
4937
4939
  if (!kb.updater.editable(doc.uri)) {
4938
4940
  field.readOnly = true // was: disabled. readOnly is better
4939
- ;
4941
+ ;
4940
4942
  field.style = style.textInputStyleUneditable + paramStyle;
4941
4943
  if (suppressEmptyUneditable && field.value === '') {
4942
4944
  box.style.display = 'none'; // clutter
@@ -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
@@ -12826,7 +12848,7 @@ function cameraCaptureControl(dom, store, getImageDoc, doneCallback) {
12826
12848
  // if (!confirm('Save picture to ' + destination + ' ?')) return
12827
12849
  src_debug/* log */.Rm('Putting ' + blob.size + ' bytes of ' + contentType + ' to ' + destination)
12828
12850
  // @@ TODO Remove casting
12829
- ;
12851
+ ;
12830
12852
  store.fetcher.webOperation('PUT', destination.uri, {
12831
12853
  data: blob,
12832
12854
  contentType: contentType