solid-ui 2.4.22-b82de984 → 2.4.22-bd15a33e
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 +46 -25
- package/dist/main.js.map +1 -1
- package/lib/versionInfo.js +2 -2
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/buttons.d.ts.map +1 -1
- package/lib/widgets/buttons.js +2 -0
- package/lib/widgets/buttons.js.map +1 -1
- package/lib/widgets/forms.js +42 -23
- package/lib/widgets/forms.js.map +1 -1
- package/package.json +1 -1
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-
|
|
15196
|
-
commit: '
|
|
15195
|
+
buildTime: '2022-05-12T08:44:48Z',
|
|
15196
|
+
commit: 'bd15a33eaa093067e315cfdf60c465d4563d5638',
|
|
15197
15197
|
npmInfo: {
|
|
15198
15198
|
'solid-ui': '2.4.22',
|
|
15199
15199
|
npm: '6.14.16',
|
|
@@ -16280,6 +16280,7 @@ function openHrefInOutlineMode(e) {
|
|
|
16280
16280
|
|
|
16281
16281
|
if (dom.outlineManager) {
|
|
16282
16282
|
// @@ TODO Remove the use of document as a global object
|
|
16283
|
+
// TODO fix dependency cycle to solid-panes by calling outlineManager
|
|
16283
16284
|
;
|
|
16284
16285
|
dom.outlineManager.GotoSubject(_solidLogic.store.sym(uri), true, undefined, true, undefined);
|
|
16285
16286
|
} else if (window && window.panes && window.panes.getOutliner) {
|
|
@@ -16407,6 +16408,7 @@ function linkButton(dom, object) {
|
|
|
16407
16408
|
b.textContent = 'Goto ' + utils.label(object);
|
|
16408
16409
|
b.addEventListener('click', function (_event) {
|
|
16409
16410
|
// b.parentNode.removeChild(b)
|
|
16411
|
+
// TODO fix dependency cycle to solid-panes by calling outlineManager
|
|
16410
16412
|
;
|
|
16411
16413
|
dom.outlineManager.GotoSubject(object, true, undefined, true, undefined);
|
|
16412
16414
|
}, true);
|
|
@@ -17262,10 +17264,11 @@ _fieldFunction.field[ns.ui('Form').uri] = _fieldFunction.field[ns.ui('Group').ur
|
|
|
17262
17264
|
|
|
17263
17265
|
if (already[key]) {
|
|
17264
17266
|
// been there done that
|
|
17265
|
-
box.appendChild(dom.createTextNode('Group: see above ' + key));
|
|
17266
|
-
|
|
17267
|
+
box.appendChild(dom.createTextNode('Group: see above ' + key)); // TODO fix dependency cycle to solid-panes by calling outlineManager
|
|
17268
|
+
// const plist = [$rdf.st(subject, ns.owl('sameAs'), subject)] // @@ need prev subject
|
|
17269
|
+
// dom.outlineManager.appendPropertyTRs(box, plist)
|
|
17270
|
+
// dom.appendChild(plist)
|
|
17267
17271
|
|
|
17268
|
-
dom.outlineManager.appendPropertyTRs(box, plist);
|
|
17269
17272
|
return box;
|
|
17270
17273
|
}
|
|
17271
17274
|
|
|
@@ -17694,7 +17697,7 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
|
|
|
17694
17697
|
// delete button and move buttons
|
|
17695
17698
|
|
|
17696
17699
|
if (kb.updater.editable(dataDoc.uri)) {
|
|
17697
|
-
buttons.deleteButtonWithCheck(dom, subField,
|
|
17700
|
+
buttons.deleteButtonWithCheck(dom, subField, multipleUIlabel, deleteThisItem);
|
|
17698
17701
|
|
|
17699
17702
|
if (ordered) {
|
|
17700
17703
|
// Add controsl in a frame
|
|
@@ -17745,7 +17748,7 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
|
|
|
17745
17748
|
|
|
17746
17749
|
var _shim = dom.createElement('div');
|
|
17747
17750
|
|
|
17748
|
-
_shim.appendChild(subField); // Subfield has its own
|
|
17751
|
+
_shim.appendChild(subField); // Subfield has its own layout
|
|
17749
17752
|
|
|
17750
17753
|
|
|
17751
17754
|
frame.appendChild(_shim);
|
|
@@ -17794,6 +17797,8 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
|
|
|
17794
17797
|
return shim;
|
|
17795
17798
|
}
|
|
17796
17799
|
|
|
17800
|
+
var multipleUIlabel = kb.any(form, ui('label'));
|
|
17801
|
+
if (!multipleUIlabel) multipleUIlabel = utils.label(property);
|
|
17797
17802
|
var min = kb.any(form, ui('min')); // This is the minimum number -- default 0
|
|
17798
17803
|
|
|
17799
17804
|
min = min ? 0 + min.value : 0;
|
|
@@ -17834,10 +17839,9 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
|
|
|
17834
17839
|
img.setAttribute('src', plusIconURI); // plus sign
|
|
17835
17840
|
|
|
17836
17841
|
img.setAttribute('style', 'margin: 0.2em; width: 1.5em; height:1.5em');
|
|
17837
|
-
img.title = 'Click to add
|
|
17838
|
-
var prompt =
|
|
17839
|
-
prompt.textContent = (values.length === 0 ? 'Add
|
|
17840
|
-
|
|
17842
|
+
img.title = 'Click to add another ' + multipleUIlabel;
|
|
17843
|
+
var prompt = dom.createElement('span');
|
|
17844
|
+
prompt.textContent = (values.length === 0 ? 'Add another ' : 'Add ') + multipleUIlabel;
|
|
17841
17845
|
tail.addEventListener('click', /*#__PURE__*/function () {
|
|
17842
17846
|
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(_eventNotUsed) {
|
|
17843
17847
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
@@ -17859,6 +17863,7 @@ _fieldFunction.field[ns.ui('Multiple').uri] = function (dom, container, already,
|
|
|
17859
17863
|
return _ref3.apply(this, arguments);
|
|
17860
17864
|
};
|
|
17861
17865
|
}(), true);
|
|
17866
|
+
tail.appendChild(prompt);
|
|
17862
17867
|
}
|
|
17863
17868
|
|
|
17864
17869
|
function createListIfNecessary() {
|
|
@@ -18133,16 +18138,18 @@ _fieldFunction.field[ns.ui('Classifier').uri] = function (dom, container, alread
|
|
|
18133
18138
|
** -- radio buttons
|
|
18134
18139
|
** -- auto-complete typing
|
|
18135
18140
|
**
|
|
18136
|
-
**
|
|
18141
|
+
** TODO: according to ontology ui:choice can also have ns.ui('default') - this is not implemented yet
|
|
18137
18142
|
*/
|
|
18138
18143
|
|
|
18139
18144
|
|
|
18140
18145
|
_fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, subject, form, dataDoc, callbackFunction) {
|
|
18141
18146
|
var ui = ns.ui;
|
|
18142
18147
|
var kb = _solidLogic.store;
|
|
18143
|
-
var multiple = false;
|
|
18144
18148
|
var formDoc = form.doc ? form.doc() : null; // @@ if blank no way to know
|
|
18145
18149
|
|
|
18150
|
+
var uiMultipleInUse = false; // this signals to ui:choice that it is part of a ui:multiple
|
|
18151
|
+
|
|
18152
|
+
var multiSelect = false;
|
|
18146
18153
|
var p;
|
|
18147
18154
|
var box = dom.createElement('div');
|
|
18148
18155
|
box.setAttribute('class', 'choiceBox'); // Set flexDirection column?
|
|
@@ -18173,12 +18180,24 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
|
|
|
18173
18180
|
|
|
18174
18181
|
var possible = [];
|
|
18175
18182
|
var possibleProperties;
|
|
18176
|
-
var firstSelectOptionText = '* Select
|
|
18183
|
+
var firstSelectOptionText = '* Select for ' + utils.label(subject, true) + ' *'; // if we do NOT have a container it means it is a ui:Multiple
|
|
18184
|
+
// only important for the first option text in select
|
|
18185
|
+
|
|
18186
|
+
if (!container) {
|
|
18187
|
+
uiMultipleInUse = true;
|
|
18188
|
+
firstSelectOptionText = utils.label(subject, true);
|
|
18189
|
+
}
|
|
18190
|
+
|
|
18191
|
+
if (subject.termType === 'BlankNode') {
|
|
18192
|
+
firstSelectOptionText = '* Select for ' + utils.label(property) + ' *';
|
|
18193
|
+
}
|
|
18194
|
+
|
|
18177
18195
|
var opts = {
|
|
18178
18196
|
form: form,
|
|
18179
18197
|
subForm: subForm,
|
|
18180
|
-
|
|
18198
|
+
multiSelect: multiSelect,
|
|
18181
18199
|
firstSelectOptionText: firstSelectOptionText,
|
|
18200
|
+
uiMultipleInUse: uiMultipleInUse,
|
|
18182
18201
|
disambiguate: false
|
|
18183
18202
|
};
|
|
18184
18203
|
possible = kb.each(undefined, ns.rdf('type'), uiFrom, formDoc);
|
|
@@ -18464,7 +18483,8 @@ function promptForNew(dom, kb, subject, predicate, theClass, form, dataDoc, call
|
|
|
18464
18483
|
b.setAttribute('type', 'button');
|
|
18465
18484
|
b.setAttribute('style', 'float: right;');
|
|
18466
18485
|
b.innerHTML = 'Goto ' + utils.label(theClass);
|
|
18467
|
-
b.addEventListener('click',
|
|
18486
|
+
b.addEventListener('click', // TODO fix dependency cycle to solid-panes by calling outlineManager
|
|
18487
|
+
function (_e) {
|
|
18468
18488
|
dom.outlineManager.GotoSubject(theClass, true, undefined, true, undefined);
|
|
18469
18489
|
}, false);
|
|
18470
18490
|
return box;
|
|
@@ -18599,9 +18619,10 @@ function makeDescription(dom, kb, subject, predicate, dataDoc, callbackFunction)
|
|
|
18599
18619
|
// @param subject - a term, the subject of the statement(s) being edited.
|
|
18600
18620
|
// @param predicate - a term, the predicate of the statement(s) being edited
|
|
18601
18621
|
// @param possible - a list of terms, the possible value the object can take
|
|
18602
|
-
// @param options.
|
|
18622
|
+
// @param options.multiSelect - Boolean - Whether more than one at a time is allowed
|
|
18603
18623
|
// @param options.firstSelectOptionText - a string to be displayed as the
|
|
18604
|
-
// option for none selected (for non
|
|
18624
|
+
// option for none selected (for non multiSelect)
|
|
18625
|
+
// @param options.uiMultipleInUse - signals that the ui:choise is used with a ui:multiple
|
|
18605
18626
|
// @param options.mint - User may create thing if this sent to the prompt string eg "New foo"
|
|
18606
18627
|
// @param options.subForm - If mint, then the form to be used for minting the new thing
|
|
18607
18628
|
// @param dataDoc - The web document being edited
|
|
@@ -18739,7 +18760,7 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, uiFrom, opt
|
|
|
18739
18760
|
|
|
18740
18761
|
var select = dom.createElement('select');
|
|
18741
18762
|
select.setAttribute('style', style.formSelectSTyle);
|
|
18742
|
-
if (options.
|
|
18763
|
+
if (options.multiSelect) select.setAttribute('multiSelect', 'true');
|
|
18743
18764
|
select.currentURI = null;
|
|
18744
18765
|
|
|
18745
18766
|
select.refresh = function () {
|
|
@@ -18790,7 +18811,7 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, uiFrom, opt
|
|
|
18790
18811
|
select.insertBefore(mint, select.firstChild);
|
|
18791
18812
|
}
|
|
18792
18813
|
|
|
18793
|
-
if (!select.currentURI &&
|
|
18814
|
+
if (!select.currentURI && options.uiMultipleInUse) {
|
|
18794
18815
|
var prompt = dom.createElement('option');
|
|
18795
18816
|
prompt.appendChild(dom.createTextNode(options.firstSelectOptionText));
|
|
18796
18817
|
prompt.disabled = true;
|
|
@@ -18816,11 +18837,11 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, uiFrom, opt
|
|
|
18816
18837
|
function makeSelectForCategory(dom, kb, subject, category, dataDoc, callbackFunction) {
|
|
18817
18838
|
var du = kb.any(category, ns.owl('disjointUnionOf'));
|
|
18818
18839
|
var subs;
|
|
18819
|
-
var
|
|
18840
|
+
var multiSelect = false;
|
|
18820
18841
|
|
|
18821
18842
|
if (!du) {
|
|
18822
18843
|
subs = kb.each(undefined, ns.rdfs('subClassOf'), category);
|
|
18823
|
-
|
|
18844
|
+
multiSelect = true;
|
|
18824
18845
|
} else {
|
|
18825
18846
|
subs = du.elements;
|
|
18826
18847
|
}
|
|
@@ -18828,15 +18849,15 @@ function makeSelectForCategory(dom, kb, subject, category, dataDoc, callbackFunc
|
|
|
18828
18849
|
log.debug('Select list length ' + subs.length);
|
|
18829
18850
|
|
|
18830
18851
|
if (subs.length === 0) {
|
|
18831
|
-
return (0, _error.errorMessageBlock)(dom, "Can't do " + (
|
|
18852
|
+
return (0, _error.errorMessageBlock)(dom, "Can't do " + (multiSelect ? 'multiple ' : '') + 'selector with no subclasses of category: ' + category);
|
|
18832
18853
|
}
|
|
18833
18854
|
|
|
18834
18855
|
if (subs.length === 1) {
|
|
18835
|
-
return (0, _error.errorMessageBlock)(dom, "Can't do " + (
|
|
18856
|
+
return (0, _error.errorMessageBlock)(dom, "Can't do " + (multiSelect ? 'multiple ' : '') + 'selector with only 1 subclass of category: ' + category + ':' + subs[1]);
|
|
18836
18857
|
}
|
|
18837
18858
|
|
|
18838
18859
|
return makeSelectForOptions(dom, kb, subject, ns.rdf('type'), subs, null, {
|
|
18839
|
-
|
|
18860
|
+
multiSelect: multiSelect
|
|
18840
18861
|
}, dataDoc, callbackFunction);
|
|
18841
18862
|
}
|
|
18842
18863
|
/** Make SELECT element to select subclasses recurively
|