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.
@@ -4572,31 +4572,9 @@ _forms_fieldFunction__WEBPACK_IMPORTED_MODULE_4__/* .field */ .ZZ[_ns__WEBPACK_I
4572
4572
  if (!ok) return callbackFunction(ok, body);
4573
4573
  return callbackFunction(ok, body);
4574
4574
  };
4575
- // Create container for label and select
4576
- var outerBox = dom.createElement('div');
4577
- outerBox.setAttribute('class', 'classifierBox');
4578
- // Render label
4579
- var labelDiv = dom.createElement('div');
4580
- labelDiv.setAttribute('class', 'formFieldName classifierBox-label');
4581
- // Use fieldLabel to render ui:label if present
4582
- labelDiv.appendChild((0,_forms_basic__WEBPACK_IMPORTED_MODULE_8__/* .fieldLabel */ .bk)(dom, category, form));
4583
- outerBox.appendChild(labelDiv);
4584
- // Render select
4585
- var selectBox = dom.createElement('div');
4586
- selectBox.setAttribute('class', 'formFieldValue classifierBox-selectBox');
4587
- var selectElement = makeSelectForNestedCategory(dom, kb, subject, category, dataDoc, checkOptions);
4588
- // Set readonly if not editable
4589
- if (selectElement && selectElement.querySelector && selectElement.querySelector('select')) {
4590
- var select = selectElement.querySelector('select');
4591
- if (select && !kb.updater.editable(dataDoc.uri)) {
4592
- select.readOnly = true;
4593
- select.style = _style__WEBPACK_IMPORTED_MODULE_10__/* .style */ .i.textInputStyleUneditable;
4594
- }
4595
- }
4596
- selectBox.appendChild(selectElement);
4597
- outerBox.appendChild(selectBox);
4598
- if (container) container.appendChild(outerBox);
4599
- return outerBox;
4575
+ var box = makeSelectForNestedCategory(dom, kb, subject, category, dataDoc, checkOptions);
4576
+ if (container) container.appendChild(box);
4577
+ return box;
4600
4578
  };
4601
4579
 
4602
4580
  /** Choice field
@@ -18407,6 +18385,8 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
18407
18385
  field.style = inputStyle;
18408
18386
  rhs.appendChild(field);
18409
18387
  field.setAttribute('type', params.type ? params.type : 'text');
18388
+ var fieldType = (field.getAttribute('type') || '').toLowerCase();
18389
+ var deferWhileFocused = fieldType === 'date' || fieldType === 'datetime-local';
18410
18390
  var size = kb.anyJS(form, _ns__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.ui('size')) || _styleConstants__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.textInputSize || 20;
18411
18391
  field.setAttribute('size', size);
18412
18392
  var maxLength = kb.any(form, _ns__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.ui('maxLength'));
@@ -18445,9 +18425,18 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
18445
18425
  }
18446
18426
  }, true);
18447
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
+ }
18448
18434
  // i.e. lose focus with changed data
18449
18435
  if (params.pattern && !field.value.match(params.pattern)) return;
18450
- 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
+ }
18451
18440
  field.setAttribute('style', inputStyle + 'color: gray;'); // pending
18452
18441
  var ds = kb.statementsMatching(subject, property); // remove any multiple values
18453
18442
  var result;
@@ -18515,7 +18504,9 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
18515
18504
  updateMany(ds, is, function (uri, ok, body) {
18516
18505
  // kb.updater.update(ds, is, function (uri, ok, body) {
18517
18506
  if (ok) {
18518
- field.disabled = false;
18507
+ if (disabledForSave) {
18508
+ field.disabled = false;
18509
+ }
18519
18510
  field.setAttribute('style', inputStyle);
18520
18511
  } else {
18521
18512
  box.appendChild((0,_error__WEBPACK_IMPORTED_MODULE_6__/* .errorMessageBlock */ .F)(dom, body));
@@ -18523,6 +18514,15 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
18523
18514
  callbackFunction(ok, body);
18524
18515
  });
18525
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);
18526
18526
  return box;
18527
18527
  }
18528
18528
 
@@ -18744,7 +18744,7 @@ function tabWidget(options) {
18744
18744
  _getColors2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(_getColors, 2),
18745
18745
  selectedColor = _getColors2[0],
18746
18746
  color = _getColors2[1];
18747
- var bodyMainStyle = "display: grid; width: auto; height: 100%; border: 0.1em; border-style: solid; border-color: ".concat(selectedColor, "; padding: 1em;");
18747
+ var bodyMainStyle = "flex: 2; width: auto; height: 100%; border: 0.1em; border-style: solid; border-color: ".concat(selectedColor, "; padding: 1em;");
18748
18748
  var rootElement = dom.createElement('div'); // 20200117a
18749
18749
 
18750
18750
  rootElement.setAttribute('style', _style__WEBPACK_IMPORTED_MODULE_9__/* .style */ .i.tabsRootElement);