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.
@@ -10983,7 +10983,7 @@ function attachmentList(dom, subject, div) {
10983
10983
  var attachmentRight = attachmentOne.appendChild(dom.createElement('td'));
10984
10984
  var attachmentTable = attachmentRight.appendChild(dom.createElement('table'));
10985
10985
  attachmentTable.appendChild(dom.createElement('tr')) // attachmentTableTop
10986
- ;
10986
+ ;
10987
10987
  attachmentOuter.refresh = refresh; // Participate in downstream changes
10988
10988
  // ;(attachmentTable as any).refresh = refresh <- outer should be best?
10989
10989
 
@@ -18385,6 +18385,8 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
18385
18385
  field.style = inputStyle;
18386
18386
  rhs.appendChild(field);
18387
18387
  field.setAttribute('type', params.type ? params.type : 'text');
18388
+ var fieldType = (field.getAttribute('type') || '').toLowerCase();
18389
+ var deferWhileFocused = fieldType === 'date' || fieldType === 'datetime-local';
18388
18390
  var size = kb.anyJS(form, _ns__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.ui('size')) || _styleConstants__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.textInputSize || 20;
18389
18391
  field.setAttribute('size', size);
18390
18392
  var maxLength = kb.any(form, _ns__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.ui('maxLength'));
@@ -18408,7 +18410,7 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
18408
18410
  }
18409
18411
  if (!kb.updater.editable(doc.uri)) {
18410
18412
  field.readOnly = true // was: disabled. readOnly is better
18411
- ;
18413
+ ;
18412
18414
  field.style = _style__WEBPACK_IMPORTED_MODULE_3__/* .style */ .i.textInputStyleUneditable + paramStyle;
18413
18415
  if (suppressEmptyUneditable && field.value === '') {
18414
18416
  box.style.display = 'none'; // clutter
@@ -18423,9 +18425,18 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
18423
18425
  }
18424
18426
  }, true);
18425
18427
  field.addEventListener('change', function (_e) {
18428
+ if (deferWhileFocused && dom.activeElement === field) {
18429
+ if (field.dataset) {
18430
+ field.dataset.deferredChange = 'true';
18431
+ }
18432
+ return;
18433
+ }
18426
18434
  // i.e. lose focus with changed data
18427
18435
  if (params.pattern && !field.value.match(params.pattern)) return;
18428
- field.disabled = true; // See if this stops getting two dates from fumbling e.g the chrome datepicker.
18436
+ var disabledForSave = !deferWhileFocused;
18437
+ if (disabledForSave) {
18438
+ field.disabled = true; // See if this stops getting two dates from fumbling e.g the chrome datepicker.
18439
+ }
18429
18440
  field.setAttribute('style', inputStyle + 'color: gray;'); // pending
18430
18441
  var ds = kb.statementsMatching(subject, property); // remove any multiple values
18431
18442
  var result;
@@ -18493,7 +18504,9 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
18493
18504
  updateMany(ds, is, function (uri, ok, body) {
18494
18505
  // kb.updater.update(ds, is, function (uri, ok, body) {
18495
18506
  if (ok) {
18496
- field.disabled = false;
18507
+ if (disabledForSave) {
18508
+ field.disabled = false;
18509
+ }
18497
18510
  field.setAttribute('style', inputStyle);
18498
18511
  } else {
18499
18512
  box.appendChild((0,_error__WEBPACK_IMPORTED_MODULE_6__/* .errorMessageBlock */ .F)(dom, body));
@@ -18501,6 +18514,15 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
18501
18514
  callbackFunction(ok, body);
18502
18515
  });
18503
18516
  }, true);
18517
+ field.addEventListener('blur', function (_e) {
18518
+ if (deferWhileFocused && field.dataset && field.dataset.deferredChange === 'true') {
18519
+ delete field.dataset.deferredChange;
18520
+ var event = new Event('change', {
18521
+ bubbles: true
18522
+ });
18523
+ field.dispatchEvent(event);
18524
+ }
18525
+ }, true);
18504
18526
  return box;
18505
18527
  }
18506
18528
 
@@ -20221,7 +20243,7 @@ function cameraCaptureControl(dom, store, getImageDoc, doneCallback) {
20221
20243
  // if (!confirm('Save picture to ' + destination + ' ?')) return
20222
20244
  _debug__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm('Putting ' + blob.size + ' bytes of ' + contentType + ' to ' + destination)
20223
20245
  // @@ TODO Remove casting
20224
- ;
20246
+ ;
20225
20247
  store.fetcher.webOperation('PUT', destination.uri, {
20226
20248
  data: blob,
20227
20249
  contentType: contentType