solid-ui 3.0.4-5b6f345 → 3.0.4-6638467

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
@@ -8264,31 +8286,9 @@ field[src_ns.ui('Classifier').uri] = function (dom, container, already, subject,
8264
8286
  if (!ok) return callbackFunction(ok, body);
8265
8287
  return callbackFunction(ok, body);
8266
8288
  };
8267
- // Create container for label and select
8268
- var outerBox = dom.createElement('div');
8269
- outerBox.setAttribute('class', 'classifierBox');
8270
- // Render label
8271
- var labelDiv = dom.createElement('div');
8272
- labelDiv.setAttribute('class', 'formFieldName classifierBox-label');
8273
- // Use fieldLabel to render ui:label if present
8274
- labelDiv.appendChild(fieldLabel(dom, category, form));
8275
- outerBox.appendChild(labelDiv);
8276
- // Render select
8277
- var selectBox = dom.createElement('div');
8278
- selectBox.setAttribute('class', 'formFieldValue classifierBox-selectBox');
8279
- var selectElement = makeSelectForNestedCategory(dom, kb, subject, category, dataDoc, checkOptions);
8280
- // Set readonly if not editable
8281
- if (selectElement && selectElement.querySelector && selectElement.querySelector('select')) {
8282
- var select = selectElement.querySelector('select');
8283
- if (select && !kb.updater.editable(dataDoc.uri)) {
8284
- select.readOnly = true;
8285
- select.style = style.textInputStyleUneditable;
8286
- }
8287
- }
8288
- selectBox.appendChild(selectElement);
8289
- outerBox.appendChild(selectBox);
8290
- if (container) container.appendChild(outerBox);
8291
- return outerBox;
8289
+ var box = makeSelectForNestedCategory(dom, kb, subject, category, dataDoc, checkOptions);
8290
+ if (container) container.appendChild(box);
8291
+ return box;
8292
8292
  };
8293
8293
 
8294
8294
  /** Choice field
@@ -24226,7 +24226,7 @@ function tabWidget(options) {
24226
24226
  _getColors2 = _slicedToArray(_getColors, 2),
24227
24227
  selectedColor = _getColors2[0],
24228
24228
  color = _getColors2[1];
24229
- var bodyMainStyle = "display: grid; width: auto; height: 100%; border: 0.1em; border-style: solid; border-color: ".concat(selectedColor, "; padding: 1em;");
24229
+ var bodyMainStyle = "flex: 2; width: auto; height: 100%; border: 0.1em; border-style: solid; border-color: ".concat(selectedColor, "; padding: 1em;");
24230
24230
  var rootElement = dom.createElement('div'); // 20200117a
24231
24231
 
24232
24232
  rootElement.setAttribute('style', style.tabsRootElement);