solid-ui 2.4.22-3cf5d0a6 → 2.4.22-3e0d1a42

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-09T14:00:08Z',
9
- commit: '3cf5d0a69738775a31b3b4f67fa6a846e5829bb7',
8
+ buildTime: '2022-05-10T17:01:23Z',
9
+ commit: '3e0d1a42e042cb5542cbc183d7ae53eec6498254',
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-09T14:00:08Z',\n commit: '3cf5d0a69738775a31b3b4f67fa6a846e5829bb7',\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:23Z',\n commit: '3e0d1a42e042cb5542cbc183d7ae53eec6498254',\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
@@ -642,7 +642,7 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
642
642
 
643
643
  var _shim = dom.createElement('div');
644
644
 
645
- _shim.appendChild(subField); // Subfield has its own laytout
645
+ _shim.appendChild(subField); // Subfield has its own layout
646
646
 
647
647
 
648
648
  frame.appendChild(_shim);
@@ -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;
@@ -731,10 +734,9 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
731
734
  img.setAttribute('src', plusIconURI); // plus sign
732
735
 
733
736
  img.setAttribute('style', 'margin: 0.2em; width: 1.5em; height:1.5em');
734
- img.title = 'Click to add one or more ' + utils.predicateLabel(property, reverse);
735
- var prompt = tail.appendChild(dom.createElement('span'));
736
- prompt.textContent = (values.length === 0 ? 'Add one or more ' : 'Add more ') + utils.predicateLabel(property, reverse); // utils.label(property)
737
-
737
+ img.title = 'Click to add another ' + multipleUIlabel;
738
+ var prompt = dom.createElement('span');
739
+ prompt.textContent = (values.length === 0 ? 'Add another ' : 'Add ') + multipleUIlabel;
738
740
  tail.addEventListener('click', /*#__PURE__*/function () {
739
741
  var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(_eventNotUsed) {
740
742
  return _regenerator["default"].wrap(function _callee5$(_context5) {
@@ -756,6 +758,7 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
756
758
  return _ref3.apply(this, arguments);
757
759
  };
758
760
  }(), true);
761
+ tail.appendChild(prompt);
759
762
  }
760
763
 
761
764
  function createListIfNecessary() {
@@ -1030,16 +1033,17 @@ _fieldFunction.field[ns.ui('Classifier').uri] = function (dom, container, alread
1030
1033
  ** -- radio buttons
1031
1034
  ** -- auto-complete typing
1032
1035
  **
1033
- ** Todo: Deal with multiple. Maybe merge with multiple code.
1034
1036
  */
1035
1037
 
1036
1038
 
1037
1039
  _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, subject, form, dataDoc, callbackFunction) {
1038
1040
  var ui = ns.ui;
1039
1041
  var kb = _solidLogic.store;
1040
- var multiple = false;
1041
1042
  var formDoc = form.doc ? form.doc() : null; // @@ if blank no way to know
1042
1043
 
1044
+ var uiMultipleInUse = false; // this signals to ui:choice that it is part of a ui:multiple
1045
+
1046
+ var multiSelect = false;
1043
1047
  var p;
1044
1048
  var box = dom.createElement('div');
1045
1049
  box.setAttribute('class', 'choiceBox'); // Set flexDirection column?
@@ -1070,12 +1074,20 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
1070
1074
 
1071
1075
  var possible = [];
1072
1076
  var possibleProperties;
1073
- var firstSelectOptionText = '* Select from ' + utils.label(subject, true) + ' *';
1077
+ var firstSelectOptionText = '* Select for ' + utils.label(subject, true) + ' *'; // if we do NOT have a container it means it is a ui:Multiple
1078
+ // only important for the first option text in select
1079
+
1080
+ if (!container) {
1081
+ uiMultipleInUse = true;
1082
+ firstSelectOptionText = utils.label(subject, true);
1083
+ }
1084
+
1074
1085
  var opts = {
1075
1086
  form: form,
1076
1087
  subForm: subForm,
1077
- multiple: multiple,
1088
+ multiSelect: multiSelect,
1078
1089
  firstSelectOptionText: firstSelectOptionText,
1090
+ uiMultipleInUse: uiMultipleInUse,
1079
1091
  disambiguate: false
1080
1092
  };
1081
1093
  possible = kb.each(undefined, ns.rdf('type'), uiFrom, formDoc);
@@ -1120,7 +1132,7 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
1120
1132
  opts.disambiguate = true;
1121
1133
  }
1122
1134
 
1123
- var sortedPossible = sortByLabel(possible); // TODO: this checks for any occurance regardles if it is set to true or false
1135
+ var sortedPossible = sortByLabel(possible); // TODO: this checks for any occurrence, regardless of true or false setting
1124
1136
 
1125
1137
  if (kb.any(form, ui('canMintNew'))) {
1126
1138
  opts.mint = '* Create new *'; // @@ could be better
@@ -1496,9 +1508,10 @@ function makeDescription(dom, kb, subject, predicate, dataDoc, callbackFunction)
1496
1508
  // @param subject - a term, the subject of the statement(s) being edited.
1497
1509
  // @param predicate - a term, the predicate of the statement(s) being edited
1498
1510
  // @param possible - a list of terms, the possible value the object can take
1499
- // @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
1500
1512
  // @param options.firstSelectOptionText - a string to be displayed as the
1501
- // 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
1502
1515
  // @param options.mint - User may create thing if this sent to the prompt string eg "New foo"
1503
1516
  // @param options.subForm - If mint, then the form to be used for minting the new thing
1504
1517
  // @param dataDoc - The web document being edited
@@ -1636,7 +1649,7 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, uiFrom, opt
1636
1649
 
1637
1650
  var select = dom.createElement('select');
1638
1651
  select.setAttribute('style', style.formSelectSTyle);
1639
- if (options.multiple) select.setAttribute('multiple', 'true');
1652
+ if (options.multiSelect) select.setAttribute('multiSelect', 'true');
1640
1653
  select.currentURI = null;
1641
1654
 
1642
1655
  select.refresh = function () {
@@ -1687,7 +1700,7 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, uiFrom, opt
1687
1700
  select.insertBefore(mint, select.firstChild);
1688
1701
  }
1689
1702
 
1690
- if (!select.currentURI && !options.multiple) {
1703
+ if (!select.currentURI && options.uiMultipleInUse) {
1691
1704
  var prompt = dom.createElement('option');
1692
1705
  prompt.appendChild(dom.createTextNode(options.firstSelectOptionText));
1693
1706
  prompt.disabled = true;
@@ -1713,11 +1726,11 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, uiFrom, opt
1713
1726
  function makeSelectForCategory(dom, kb, subject, category, dataDoc, callbackFunction) {
1714
1727
  var du = kb.any(category, ns.owl('disjointUnionOf'));
1715
1728
  var subs;
1716
- var multiple = false;
1729
+ var multiSelect = false;
1717
1730
 
1718
1731
  if (!du) {
1719
1732
  subs = kb.each(undefined, ns.rdfs('subClassOf'), category);
1720
- multiple = true;
1733
+ multiSelect = true;
1721
1734
  } else {
1722
1735
  subs = du.elements;
1723
1736
  }
@@ -1725,15 +1738,15 @@ function makeSelectForCategory(dom, kb, subject, category, dataDoc, callbackFunc
1725
1738
  log.debug('Select list length ' + subs.length);
1726
1739
 
1727
1740
  if (subs.length === 0) {
1728
- 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);
1729
1742
  }
1730
1743
 
1731
1744
  if (subs.length === 1) {
1732
- 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]);
1733
1746
  }
1734
1747
 
1735
1748
  return makeSelectForOptions(dom, kb, subject, ns.rdf('type'), subs, null, {
1736
- multiple: multiple
1749
+ multiSelect: multiSelect
1737
1750
  }, dataDoc, callbackFunction);
1738
1751
  }
1739
1752
  /** Make SELECT element to select subclasses recurively