solid-ui 2.4.22-68b7539f → 2.4.22-6ae4df24

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/main.js CHANGED
@@ -15192,8 +15192,8 @@ Object.defineProperty(exports, "__esModule", ({
15192
15192
  }));
15193
15193
  exports.versionInfo = void 0;
15194
15194
  var versionInfo = {
15195
- buildTime: '2022-05-06T16:10:20Z',
15196
- commit: '68b7539f641a205961c371a2b1e6787306576255',
15195
+ buildTime: '2022-05-10T15:38:52Z',
15196
+ commit: '6ae4df243e825dee4607d8bde360d12bd9de6925',
15197
15197
  npmInfo: {
15198
15198
  'solid-ui': '2.4.22',
15199
15199
  npm: '6.14.16',
@@ -17745,7 +17745,7 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
17745
17745
 
17746
17746
  var _shim = dom.createElement('div');
17747
17747
 
17748
- _shim.appendChild(subField); // Subfield has its own laytout
17748
+ _shim.appendChild(subField); // Subfield has its own layout
17749
17749
 
17750
17750
 
17751
17751
  frame.appendChild(_shim);
@@ -17830,14 +17830,16 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
17830
17830
  if (kb.updater.editable(dataDoc.uri)) {
17831
17831
  var tail = box.appendChild(dom.createElement('div'));
17832
17832
  tail.style.padding = '0.5em';
17833
+ var label = kb.any(form, ui('label'));
17834
+ if (!label) label = utils.label(property, true); // Init capital
17835
+
17833
17836
  var img = tail.appendChild(dom.createElement('img'));
17834
17837
  img.setAttribute('src', plusIconURI); // plus sign
17835
17838
 
17836
17839
  img.setAttribute('style', 'margin: 0.2em; width: 1.5em; height:1.5em');
17837
- img.title = 'Click to add one or more ' + utils.predicateLabel(property, reverse);
17838
- var prompt = tail.appendChild(dom.createElement('span'));
17839
- prompt.textContent = (values.length === 0 ? 'Add one or more ' : 'Add more ') + utils.predicateLabel(property, reverse); // utils.label(property)
17840
-
17840
+ img.title = 'Click to add one or more ' + label;
17841
+ var prompt = dom.createElement('span');
17842
+ prompt.textContent = (values.length === 0 ? 'Add one or more ' : 'Add more ') + utils.predicateLabel(property, reverse);
17841
17843
  tail.addEventListener('click', /*#__PURE__*/function () {
17842
17844
  var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(_eventNotUsed) {
17843
17845
  return _regenerator["default"].wrap(function _callee5$(_context5) {
@@ -17859,6 +17861,7 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
17859
17861
  return _ref3.apply(this, arguments);
17860
17862
  };
17861
17863
  }(), true);
17864
+ tail.appendChild(prompt);
17862
17865
  }
17863
17866
 
17864
17867
  function createListIfNecessary() {
@@ -18140,16 +18143,18 @@ _fieldFunction.field[ns.ui('Classifier').uri] = function (dom, container, alread
18140
18143
  _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, subject, form, dataDoc, callbackFunction) {
18141
18144
  var ui = ns.ui;
18142
18145
  var kb = _solidLogic.store;
18143
- var multiple = false;
18144
18146
  var formDoc = form.doc ? form.doc() : null; // @@ if blank no way to know
18145
18147
 
18146
18148
  var p;
18147
- var box = dom.createElement('div'); // Set flexDirection column?
18149
+ var box = dom.createElement('div');
18150
+ box.setAttribute('class', 'choiceBox'); // Set flexDirection column?
18148
18151
 
18149
18152
  if (container) container.appendChild(box);
18150
18153
  var lhs = dom.createElement('div');
18154
+ lhs.setAttribute('class', 'formFieldName choiceBox-label');
18151
18155
  box.appendChild(lhs);
18152
18156
  var rhs = dom.createElement('div');
18157
+ rhs.setAttribute('class', 'formFieldValue choiceBox-selectBox');
18153
18158
  box.appendChild(rhs);
18154
18159
  var property = kb.any(form, ui('property'));
18155
18160
 
@@ -18158,13 +18163,27 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
18158
18163
  }
18159
18164
 
18160
18165
  lhs.appendChild((0, _basic.fieldLabel)(dom, property, form));
18166
+ var uiFrom = kb.any(form, ui('from'));
18167
+
18168
+ if (!uiFrom) {
18169
+ return (0, _error.errorMessageBlock)(dom, "No 'from' for Choice: " + form);
18170
+ }
18171
+
18161
18172
  var subForm = kb.any(form, ui('use')); // Optional
18162
18173
 
18163
18174
  var follow = kb.anyJS(form, ui('follow'), null, formDoc); // data doc moves to new subject?
18164
18175
 
18165
18176
  var possible = [];
18166
18177
  var possibleProperties;
18167
- var firstSelectOptionText = '* Select from ' + utils.label(subject, true) + ' *';
18178
+ var multiple = false;
18179
+ var firstSelectOptionText = '* Select for ' + utils.label(subject, true) + ' *'; // if we do NOT have a container it means it is a ui:Multiple
18180
+ // only important for the first option text in select
18181
+
18182
+ if (!container) {
18183
+ multiple = true;
18184
+ firstSelectOptionText = utils.label(subject, true);
18185
+ }
18186
+
18168
18187
  var opts = {
18169
18188
  form: form,
18170
18189
  subForm: subForm,
@@ -18172,12 +18191,6 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
18172
18191
  firstSelectOptionText: firstSelectOptionText,
18173
18192
  disambiguate: false
18174
18193
  };
18175
- var uiFrom = kb.any(form, ui('from'));
18176
-
18177
- if (!uiFrom) {
18178
- return (0, _error.errorMessageBlock)(dom, "No 'from' for Choice: " + form);
18179
- }
18180
-
18181
18194
  possible = kb.each(undefined, ns.rdf('type'), uiFrom, formDoc);
18182
18195
 
18183
18196
  for (var x in kb.findMembersNT(uiFrom)) {
@@ -18220,7 +18233,7 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
18220
18233
  opts.disambiguate = true;
18221
18234
  }
18222
18235
 
18223
- var sortedPossible = sortByLabel(possible); // TODO: this checks for any occurance regardles if it is set to true or false
18236
+ var sortedPossible = sortByLabel(possible); // TODO: this checks for any occurrence, regardless of true or false setting
18224
18237
 
18225
18238
  if (kb.any(form, ui('canMintNew'))) {
18226
18239
  opts.mint = '* Create new *'; // @@ could be better
@@ -18664,7 +18677,7 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, uiFrom, opt
18664
18677
  var opt = select.options[_i];
18665
18678
 
18666
18679
  if (opt.selected && opt.AJAR_mint) {
18667
- // not sure if this if is used because I cannot find mintClass
18680
+ // not sure if this 'if' is used because I cannot find mintClass
18668
18681
  if (options.mintClass) {
18669
18682
  var thisForm = promptForNew(dom, kb, subject, predicate, options.mintClass, null, dataDoc, function (ok, body) {
18670
18683
  if (!ok) {
@@ -18680,7 +18693,7 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, uiFrom, opt
18680
18693
  }
18681
18694
 
18682
18695
  is.push($rdf.st(subject, predicate, kb.sym(newObject), dataDoc));
18683
- if (uiFrom) is.push($rdf.st(newObject, ns.rdf('type'), kb.sym(uiFrom), dataDoc)); // not sure if this if is used because I cannot find mintStatementsFun
18696
+ if (uiFrom) is.push($rdf.st(newObject, ns.rdf('type'), kb.sym(uiFrom), dataDoc)); // not sure if this 'if' is used because I cannot find mintStatementsFun
18684
18697
 
18685
18698
  if (options.mintStatementsFun) {
18686
18699
  is = is.concat(options.mintStatementsFun(newObject));
@@ -18722,19 +18735,21 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, uiFrom, opt
18722
18735
  kb.updater.update(ds, is, function (uri, success, errorBody) {
18723
18736
  actual = getActual(); // refresh
18724
18737
 
18725
- if (!success) return select.parentNode.appendChild((0, _error.errorMessageBlock)(dom, 'Error updating data in select: ' + errorBody));
18726
- if (callbackFunction) callbackFunction(success, {
18727
- widget: 'select',
18728
- event: 'new'
18729
- });
18738
+ if (!success) select.parentNode.appendChild((0, _error.errorMessageBlock)(dom, 'Error updating select: ' + errorBody));
18739
+ });
18740
+ if (callbackFunction) callbackFunction(ok, {
18741
+ widget: 'select',
18742
+ event: 'new'
18730
18743
  });
18731
- } else return select.parentNode.appendChild((0, _error.errorMessageBlock)(dom, 'Error updating data in field of select: ' + body));
18744
+ } else {
18745
+ select.parentNode.appendChild((0, _error.errorMessageBlock)(dom, 'Error updating data in field of select: ' + body));
18746
+ }
18732
18747
  });
18733
18748
  };
18734
18749
 
18735
18750
  var select = dom.createElement('select');
18736
- select.setAttribute('style', style.formSelectSTyle);
18737
- if (options.multiple) select.setAttribute('multiple', 'true');
18751
+ select.setAttribute('style', style.formSelectSTyle); // if (options.multiple) select.setAttribute('multiple', 'true') // use case merged with ui:Multiple
18752
+
18738
18753
  select.currentURI = null;
18739
18754
 
18740
18755
  select.refresh = function () {
@@ -18785,13 +18800,13 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, uiFrom, opt
18785
18800
  select.insertBefore(mint, select.firstChild);
18786
18801
  }
18787
18802
 
18788
- if (!select.currentURI && !options.multiple) {
18803
+ if (!select.currentURI && options.multiple) {
18789
18804
  var prompt = dom.createElement('option');
18790
18805
  prompt.appendChild(dom.createTextNode(options.firstSelectOptionText));
18791
- prompt.selected = true;
18792
18806
  prompt.disabled = true;
18793
18807
  prompt.value = true;
18794
18808
  prompt.hidden = true;
18809
+ prompt.selected = true;
18795
18810
  select.insertBefore(prompt, select.firstChild);
18796
18811
  }
18797
18812