solid-ui 2.4.22-6ae4df24 → 2.4.22-72c4afee

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.
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.versionInfo = void 0;
7
7
  var versionInfo = {
8
- buildTime: '2022-05-10T15:38:52Z',
9
- commit: '6ae4df243e825dee4607d8bde360d12bd9de6925',
8
+ buildTime: '2022-05-10T17:01:21Z',
9
+ commit: '72c4afee56908963538f4a84ec9c770c7ec241ff',
10
10
  npmInfo: {
11
11
  'solid-ui': '2.4.22',
12
12
  npm: '6.14.16',
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/versionInfo.ts"],"names":["versionInfo","buildTime","commit","npmInfo","npm","ares","brotli","cldr","icu","llhttp","modules","napi","nghttp2","node","openssl","tz","unicode","uv","v8","zlib"],"mappings":";;;;;;AAAO,IAAMA,WAAW,GAAG;AACzBC,EAAAA,SAAS,EAAE,sBADc;AAEzBC,EAAAA,MAAM,EAAE,0CAFiB;AAGzBC,EAAAA,OAAO,EACT;AACE,gBAAY,QADd;AAEEC,IAAAA,GAAG,EAAE,SAFP;AAGEC,IAAAA,IAAI,EAAE,QAHR;AAIEC,IAAAA,MAAM,EAAE,OAJV;AAKEC,IAAAA,IAAI,EAAE,MALR;AAMEC,IAAAA,GAAG,EAAE,MANP;AAOEC,IAAAA,MAAM,EAAE,OAPV;AAQEC,IAAAA,OAAO,EAAE,IARX;AASEC,IAAAA,IAAI,EAAE,GATR;AAUEC,IAAAA,OAAO,EAAE,QAVX;AAWEC,IAAAA,IAAI,EAAE,SAXR;AAYEC,IAAAA,OAAO,EAAE,QAZX;AAaEC,IAAAA,EAAE,EAAE,QAbN;AAcEC,IAAAA,OAAO,EAAE,MAdX;AAeEC,IAAAA,EAAE,EAAE,QAfN;AAgBEC,IAAAA,EAAE,EAAE,oBAhBN;AAiBEC,IAAAA,IAAI,EAAE;AAjBR;AAJ2B,CAApB","sourcesContent":["export const versionInfo = {\n buildTime: '2022-05-10T15:38:52Z',\n commit: '6ae4df243e825dee4607d8bde360d12bd9de6925',\n npmInfo:\n{\n 'solid-ui': '2.4.22',\n npm: '6.14.16',\n ares: '1.18.1',\n brotli: '1.0.9',\n cldr: '40.0',\n icu: '70.1',\n llhttp: '2.1.4',\n modules: '83',\n napi: '8',\n nghttp2: '1.42.0',\n node: '14.19.1',\n openssl: '1.1.1n',\n tz: '2021a3',\n unicode: '14.0',\n uv: '1.42.0',\n v8: '8.4.371.23-node.85',\n zlib: '1.2.11'\n}\n}\n"],"file":"versionInfo.js"}
1
+ {"version":3,"sources":["../src/versionInfo.ts"],"names":["versionInfo","buildTime","commit","npmInfo","npm","ares","brotli","cldr","icu","llhttp","modules","napi","nghttp2","node","openssl","tz","unicode","uv","v8","zlib"],"mappings":";;;;;;AAAO,IAAMA,WAAW,GAAG;AACzBC,EAAAA,SAAS,EAAE,sBADc;AAEzBC,EAAAA,MAAM,EAAE,0CAFiB;AAGzBC,EAAAA,OAAO,EACT;AACE,gBAAY,QADd;AAEEC,IAAAA,GAAG,EAAE,SAFP;AAGEC,IAAAA,IAAI,EAAE,QAHR;AAIEC,IAAAA,MAAM,EAAE,OAJV;AAKEC,IAAAA,IAAI,EAAE,MALR;AAMEC,IAAAA,GAAG,EAAE,MANP;AAOEC,IAAAA,MAAM,EAAE,OAPV;AAQEC,IAAAA,OAAO,EAAE,IARX;AASEC,IAAAA,IAAI,EAAE,GATR;AAUEC,IAAAA,OAAO,EAAE,QAVX;AAWEC,IAAAA,IAAI,EAAE,SAXR;AAYEC,IAAAA,OAAO,EAAE,QAZX;AAaEC,IAAAA,EAAE,EAAE,QAbN;AAcEC,IAAAA,OAAO,EAAE,MAdX;AAeEC,IAAAA,EAAE,EAAE,QAfN;AAgBEC,IAAAA,EAAE,EAAE,oBAhBN;AAiBEC,IAAAA,IAAI,EAAE;AAjBR;AAJ2B,CAApB","sourcesContent":["export const versionInfo = {\n buildTime: '2022-05-10T17:01:21Z',\n commit: '72c4afee56908963538f4a84ec9c770c7ec241ff',\n npmInfo:\n{\n 'solid-ui': '2.4.22',\n npm: '6.14.16',\n ares: '1.18.1',\n brotli: '1.0.9',\n cldr: '40.0',\n icu: '70.1',\n llhttp: '2.1.4',\n modules: '83',\n napi: '8',\n nghttp2: '1.42.0',\n node: '14.19.1',\n openssl: '1.1.1n',\n tz: '2021a3',\n unicode: '14.0',\n uv: '1.42.0',\n v8: '8.4.371.23-node.85',\n zlib: '1.2.11'\n}\n}\n"],"file":"versionInfo.js"}
@@ -591,7 +591,7 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
591
591
  // delete button and move buttons
592
592
 
593
593
  if (kb.updater.editable(dataDoc.uri)) {
594
- buttons.deleteButtonWithCheck(dom, subField, utils.label(property), deleteThisItem);
594
+ buttons.deleteButtonWithCheck(dom, subField, multipleUIlabel, deleteThisItem);
595
595
 
596
596
  if (ordered) {
597
597
  // Add controsl in a frame
@@ -691,6 +691,9 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
691
691
  return shim;
692
692
  }
693
693
 
694
+ var multipleUIlabel = kb.any(form, ui('label'));
695
+ if (!multipleUIlabel) multipleUIlabel = utils.label(property, true); // Init capital
696
+
694
697
  var min = kb.any(form, ui('min')); // This is the minimum number -- default 0
695
698
 
696
699
  min = min ? 0 + min.value : 0;
@@ -727,16 +730,13 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
727
730
  if (kb.updater.editable(dataDoc.uri)) {
728
731
  var tail = box.appendChild(dom.createElement('div'));
729
732
  tail.style.padding = '0.5em';
730
- var label = kb.any(form, ui('label'));
731
- if (!label) label = utils.label(property, true); // Init capital
732
-
733
733
  var img = tail.appendChild(dom.createElement('img'));
734
734
  img.setAttribute('src', plusIconURI); // plus sign
735
735
 
736
736
  img.setAttribute('style', 'margin: 0.2em; width: 1.5em; height:1.5em');
737
- img.title = 'Click to add one or more ' + label;
737
+ img.title = 'Click to add another ' + multipleUIlabel;
738
738
  var prompt = dom.createElement('span');
739
- prompt.textContent = (values.length === 0 ? 'Add one or more ' : 'Add more ') + utils.predicateLabel(property, reverse);
739
+ prompt.textContent = (values.length === 0 ? 'Add another ' : 'Add ') + multipleUIlabel;
740
740
  tail.addEventListener('click', /*#__PURE__*/function () {
741
741
  var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(_eventNotUsed) {
742
742
  return _regenerator["default"].wrap(function _callee5$(_context5) {
@@ -1033,7 +1033,6 @@ _fieldFunction.field[ns.ui('Classifier').uri] = function (dom, container, alread
1033
1033
  ** -- radio buttons
1034
1034
  ** -- auto-complete typing
1035
1035
  **
1036
- ** Todo: Deal with multiple. Maybe merge with multiple code.
1037
1036
  */
1038
1037
 
1039
1038
 
@@ -1042,6 +1041,9 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
1042
1041
  var kb = _solidLogic.store;
1043
1042
  var formDoc = form.doc ? form.doc() : null; // @@ if blank no way to know
1044
1043
 
1044
+ var uiMultipleInUse = false; // this signals to ui:choice that it is part of a ui:multiple
1045
+
1046
+ var multiSelect = false;
1045
1047
  var p;
1046
1048
  var box = dom.createElement('div');
1047
1049
  box.setAttribute('class', 'choiceBox'); // Set flexDirection column?
@@ -1072,20 +1074,20 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
1072
1074
 
1073
1075
  var possible = [];
1074
1076
  var possibleProperties;
1075
- var multiple = false;
1076
1077
  var firstSelectOptionText = '* Select for ' + utils.label(subject, true) + ' *'; // if we do NOT have a container it means it is a ui:Multiple
1077
1078
  // only important for the first option text in select
1078
1079
 
1079
1080
  if (!container) {
1080
- multiple = true;
1081
+ uiMultipleInUse = true;
1081
1082
  firstSelectOptionText = utils.label(subject, true);
1082
1083
  }
1083
1084
 
1084
1085
  var opts = {
1085
1086
  form: form,
1086
1087
  subForm: subForm,
1087
- multiple: multiple,
1088
+ multiSelect: multiSelect,
1088
1089
  firstSelectOptionText: firstSelectOptionText,
1090
+ uiMultipleInUse: uiMultipleInUse,
1089
1091
  disambiguate: false
1090
1092
  };
1091
1093
  possible = kb.each(undefined, ns.rdf('type'), uiFrom, formDoc);
@@ -1506,9 +1508,10 @@ function makeDescription(dom, kb, subject, predicate, dataDoc, callbackFunction)
1506
1508
  // @param subject - a term, the subject of the statement(s) being edited.
1507
1509
  // @param predicate - a term, the predicate of the statement(s) being edited
1508
1510
  // @param possible - a list of terms, the possible value the object can take
1509
- // @param options.multiple - Boolean - Whether more than one at a time is allowed
1511
+ // @param options.multiSelect - Boolean - Whether more than one at a time is allowed
1510
1512
  // @param options.firstSelectOptionText - a string to be displayed as the
1511
- // option for none selected (for non multiple)
1513
+ // option for none selected (for non multiSelect)
1514
+ // @param options.uiMultipleInUse - signals that the ui:choise is used with a ui:multiple
1512
1515
  // @param options.mint - User may create thing if this sent to the prompt string eg "New foo"
1513
1516
  // @param options.subForm - If mint, then the form to be used for minting the new thing
1514
1517
  // @param dataDoc - The web document being edited
@@ -1645,8 +1648,8 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, uiFrom, opt
1645
1648
  };
1646
1649
 
1647
1650
  var select = dom.createElement('select');
1648
- select.setAttribute('style', style.formSelectSTyle); // if (options.multiple) select.setAttribute('multiple', 'true') // use case merged with ui:Multiple
1649
-
1651
+ select.setAttribute('style', style.formSelectSTyle);
1652
+ if (options.multiSelect) select.setAttribute('multiSelect', 'true');
1650
1653
  select.currentURI = null;
1651
1654
 
1652
1655
  select.refresh = function () {
@@ -1697,7 +1700,7 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, uiFrom, opt
1697
1700
  select.insertBefore(mint, select.firstChild);
1698
1701
  }
1699
1702
 
1700
- if (!select.currentURI && options.multiple) {
1703
+ if (!select.currentURI && options.uiMultipleInUse) {
1701
1704
  var prompt = dom.createElement('option');
1702
1705
  prompt.appendChild(dom.createTextNode(options.firstSelectOptionText));
1703
1706
  prompt.disabled = true;
@@ -1723,11 +1726,11 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, uiFrom, opt
1723
1726
  function makeSelectForCategory(dom, kb, subject, category, dataDoc, callbackFunction) {
1724
1727
  var du = kb.any(category, ns.owl('disjointUnionOf'));
1725
1728
  var subs;
1726
- var multiple = false;
1729
+ var multiSelect = false;
1727
1730
 
1728
1731
  if (!du) {
1729
1732
  subs = kb.each(undefined, ns.rdfs('subClassOf'), category);
1730
- multiple = true;
1733
+ multiSelect = true;
1731
1734
  } else {
1732
1735
  subs = du.elements;
1733
1736
  }
@@ -1735,15 +1738,15 @@ function makeSelectForCategory(dom, kb, subject, category, dataDoc, callbackFunc
1735
1738
  log.debug('Select list length ' + subs.length);
1736
1739
 
1737
1740
  if (subs.length === 0) {
1738
- return (0, _error.errorMessageBlock)(dom, "Can't do " + (multiple ? 'multiple ' : '') + 'selector with no subclasses of category: ' + category);
1741
+ return (0, _error.errorMessageBlock)(dom, "Can't do " + (multiSelect ? 'multiple ' : '') + 'selector with no subclasses of category: ' + category);
1739
1742
  }
1740
1743
 
1741
1744
  if (subs.length === 1) {
1742
- return (0, _error.errorMessageBlock)(dom, "Can't do " + (multiple ? 'multiple ' : '') + 'selector with only 1 subclass of category: ' + category + ':' + subs[1]);
1745
+ return (0, _error.errorMessageBlock)(dom, "Can't do " + (multiSelect ? 'multiple ' : '') + 'selector with only 1 subclass of category: ' + category + ':' + subs[1]);
1743
1746
  }
1744
1747
 
1745
1748
  return makeSelectForOptions(dom, kb, subject, ns.rdf('type'), subs, null, {
1746
- multiple: multiple
1749
+ multiSelect: multiSelect
1747
1750
  }, dataDoc, callbackFunction);
1748
1751
  }
1749
1752
  /** Make SELECT element to select subclasses recurively