solid-ui 2.4.32 → 2.4.33-7939606c
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/{670.solid-ui.min.js → 789.solid-ui.min.js} +1 -1
- package/dist/841.solid-ui.min.js +3 -0
- package/dist/841.solid-ui.min.js.map +1 -0
- package/dist/solid-ui.js +6854 -3587
- package/dist/solid-ui.js.map +1 -1
- package/dist/solid-ui.min.js +1 -1
- package/dist/solid-ui.min.js.LICENSE.txt +7 -0
- package/dist/solid-ui.min.js.map +1 -1
- package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js +1 -1
- package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js.map +1 -1
- package/lib/acl/access-controller.js +6 -7
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.js +5 -6
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.js +3 -3
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.js +15 -15
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.js +8 -9
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/acl/index.js.map +1 -1
- package/lib/acl/types.js.map +1 -1
- package/lib/chat/bookmarks.js +13 -48
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +230 -106
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js +141 -139
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +619 -433
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/keys.js +7 -7
- package/lib/chat/keys.js.map +1 -1
- package/lib/chat/message.js +331 -199
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +460 -277
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/signature.js.map +1 -1
- package/lib/chat/thread.js +300 -209
- package/lib/chat/thread.js.map +1 -1
- package/lib/create/create.js +1 -1
- package/lib/create/create.js.map +1 -1
- package/lib/create/index.js.map +1 -1
- package/lib/create/types.js.map +1 -1
- package/lib/debug.js.map +1 -1
- package/lib/folders.js +1 -1
- package/lib/folders.js.map +1 -1
- package/lib/footer/index.js +3 -3
- package/lib/footer/index.js.map +1 -1
- package/lib/header/empty-profile.js.map +1 -1
- package/lib/header/index.js +5 -5
- package/lib/header/index.js.map +1 -1
- package/lib/iconBase.js.map +1 -1
- package/lib/icons/solid_logo.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/log.js.map +1 -1
- package/lib/login/login.js +15 -15
- package/lib/login/login.js.map +1 -1
- package/lib/matrix/index.js.map +1 -1
- package/lib/matrix/matrix.js +1 -1
- package/lib/matrix/matrix.js.map +1 -1
- package/lib/matrix/types.js.map +1 -1
- package/lib/media/index.js.map +1 -1
- package/lib/media/media-capture.js +2 -2
- package/lib/media/media-capture.js.map +1 -1
- package/lib/messageArea.js +1 -1
- package/lib/messageArea.js.map +1 -1
- package/lib/noun_Camera_1618446_000000.js.map +1 -1
- package/lib/ns.js +1 -1
- package/lib/ns.js.map +1 -1
- package/lib/pad.js +29 -32
- package/lib/pad.js.map +1 -1
- package/lib/participation.js +11 -13
- package/lib/participation.js.map +1 -1
- package/lib/preferences.js +5 -1
- package/lib/preferences.js.map +1 -1
- package/lib/signup/config-default.js.map +1 -1
- package/lib/signup/signup.js.map +1 -1
- package/lib/stories/decorators.js.map +1 -1
- package/lib/style.js.map +1 -1
- package/lib/styleConstants.js.map +1 -1
- package/lib/style_multiSelect.js.map +1 -1
- package/lib/table.js +1 -1
- package/lib/table.js.map +1 -1
- package/lib/tabs.js +19 -23
- package/lib/tabs.js.map +1 -1
- package/lib/typings.d.js.map +1 -1
- package/lib/utils/headerFooterHelpers.js +1 -1
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/keyHelpers/accessData.d.ts +2 -2
- package/lib/utils/keyHelpers/accessData.d.ts.map +1 -1
- package/lib/utils/keyHelpers/accessData.js +60 -116
- package/lib/utils/keyHelpers/accessData.js.map +1 -1
- package/lib/utils/keyHelpers/acl.js +16 -16
- package/lib/utils/keyHelpers/acl.js.map +1 -1
- package/lib/utils/keyHelpers/otherHelpers.d.ts +3 -0
- package/lib/utils/keyHelpers/otherHelpers.d.ts.map +1 -0
- package/lib/utils/keyHelpers/otherHelpers.js +22 -0
- package/lib/utils/keyHelpers/otherHelpers.js.map +1 -0
- package/lib/utils/label.js +1 -1
- package/lib/utils/label.js.map +1 -1
- package/lib/versionInfo.d.ts +17 -10
- package/lib/versionInfo.d.ts.map +1 -1
- package/lib/versionInfo.js +26 -19
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/buttons/iconLinks.js.map +1 -1
- package/lib/widgets/buttons.js +1 -1
- package/lib/widgets/buttons.js.map +1 -1
- package/lib/widgets/dragAndDrop.js +1 -1
- package/lib/widgets/dragAndDrop.js.map +1 -1
- package/lib/widgets/error.js +1 -1
- package/lib/widgets/error.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +10 -10
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.js +3 -3
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +12 -12
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +3 -3
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.js +10 -10
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/lib/widgets/forms/basic.js +1 -1
- package/lib/widgets/forms/basic.js.map +1 -1
- package/lib/widgets/forms/comment.js +1 -1
- package/lib/widgets/forms/comment.js.map +1 -1
- package/lib/widgets/forms/fieldFunction.js.map +1 -1
- package/lib/widgets/forms/fieldParams.js +1 -1
- package/lib/widgets/forms/fieldParams.js.map +1 -1
- package/lib/widgets/forms/formStyle.js +1 -1
- package/lib/widgets/forms/formStyle.js.map +1 -1
- package/lib/widgets/forms.js +13 -13
- package/lib/widgets/forms.js.map +1 -1
- package/lib/widgets/index.js +1 -1
- package/lib/widgets/index.js.map +1 -1
- package/lib/widgets/multiSelect.js +2 -3
- package/lib/widgets/multiSelect.js.map +1 -1
- package/lib/widgets/peoplePicker.js +6 -11
- package/lib/widgets/peoplePicker.js.map +1 -1
- package/lib/widgets/widgetHelpers.js.map +1 -1
- package/package.json +21 -21
- package/dist/805.solid-ui.min.js +0 -3
- package/dist/805.solid-ui.min.js.map +0 -1
- /package/dist/{805.solid-ui.min.js.LICENSE.txt → 841.solid-ui.min.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dragAndDrop.js","names":["debug","_interopRequireWildcard","require","mime","style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","makeDropTarget","ele","droppedURIHandler","droppedFileHandler","dragoverListener","preventDefault","dataTransfer","dropEffect","dragenterListener","log","localStyle","savedStyle","dragEvent","dragleaveListener","dropEvent","dropListener","types","join","uris","text","length","type","getData","split","files","f","name","size","lastModifiedDate","toLocaleDateString","slice","restoreStyle","addTargetListeners","addEventListener","makeDraggable","tr","obj","setAttribute","fontWeight","setData","uri","outerHTML","stopPropagation","uploadFiles","fetcher","fileBase","imageBase","successHandler","reader","FileReader","onload","theFile","data","target","result","suffix","byteLength","contentType","lookup","msg","alert","Error","extension","endsWith","folderName","startsWith","destURI","encodeURIComponent","webOperation","then","_response","error","readAsArrayBuffer"],"sources":["../../src/widgets/dragAndDrop.js"],"sourcesContent":["/* Drag and drop common functionality\n *\n * It is easy to make something draggable, or to make it a drag target!\n * Just call the functions below. In a Solid world, any part of the UI which\n * represents one thing which has a URI, should be made draggable using makeDraggable.\n * Any list of things should typically allow you to drag new members of the list\n * onto it.\n * The file upload function, uploadFiles, is provided as often as someone drags a file from the computer\n * desktop. You may want to upload it into the pod.\n */\nimport * as debug from '../debug'\nimport * as mime from 'mime-types'\nimport * as style from '../style'\n\n/* global FileReader alert */\n\nexport function makeDropTarget (ele, droppedURIHandler, droppedFileHandler) {\n const dragoverListener = function (e) {\n e.preventDefault() // Need this; otherwise, drop does not work.\n e.dataTransfer.dropEffect = 'copy'\n }\n\n const dragenterListener = function (e) {\n debug.log('dragenter event dropEffect: ' + e.dataTransfer.dropEffect)\n if (this.localStyle) {\n // necessary not sure when\n if (!this.savedStyle) {\n this.savedStyle = style.dragEvent\n }\n }\n\n e.dataTransfer.dropEffect = 'link'\n debug.log('dragenter event dropEffect 2: ' + e.dataTransfer.dropEffect)\n }\n const dragleaveListener = function (e) {\n debug.log('dragleave event dropEffect: ' + e.dataTransfer.dropEffect)\n if (this.savedStyle) {\n this.localStyle = this.savedStyle\n } else {\n this.localStyle = style.dropEvent\n }\n }\n\n const dropListener = function (e) {\n if (e.preventDefault) e.preventDefault() // stops the browser from redirecting off to the text.\n debug.log('Drop event. dropEffect: ' + e.dataTransfer.dropEffect)\n debug.log(\n 'Drop event. types: ' +\n (e.dataTransfer.types ? e.dataTransfer.types.join(', ') : 'NOPE')\n )\n\n let uris = null\n let text\n if (e.dataTransfer.types) {\n for (let t = 0; t < e.dataTransfer.types.length; t++) {\n const type = e.dataTransfer.types[t]\n if (type === 'text/uri-list') {\n uris = e.dataTransfer.getData(type).split('\\n') // @ ignore those starting with #\n debug.log('Dropped text/uri-list: ' + uris)\n } else if (type === 'text/plain') {\n text = e.dataTransfer.getData(type)\n } else if (type === 'Files' && droppedFileHandler) {\n const files = e.dataTransfer.files // FileList object.\n for (let i = 0; files[i]; i++) {\n const f = files[i]\n debug.log(\n 'Filename: ' +\n f.name +\n ', type: ' +\n (f.type || 'n/a') +\n ' size: ' +\n f.size +\n ' bytes, last modified: ' +\n (f.lastModifiedDate\n ? f.lastModifiedDate.toLocaleDateString()\n : 'n/a')\n )\n }\n droppedFileHandler(files)\n }\n }\n if (uris === null && text && text.slice(0, 4) === 'http') {\n uris = text\n debug.log(\"Waring: Poor man's drop: using text for URI\") // chrome disables text/uri-list??\n }\n } else {\n // ... however, if we're IE, we don't have the .types property, so we'll just get the Text value\n uris = [e.dataTransfer.getData('Text')]\n debug.log('WARNING non-standard drop event: ' + uris[0])\n }\n debug.log('Dropped URI list (2): ' + uris)\n if (uris) {\n droppedURIHandler(uris)\n }\n this.localStyle = style.restoreStyle // restore style\n return false\n } // dropListener\n\n const addTargetListeners = function (ele) {\n if (!ele) {\n debug.log('@@@ addTargetListeners: ele ' + ele)\n }\n ele.addEventListener('dragover', dragoverListener)\n ele.addEventListener('dragenter', dragenterListener)\n ele.addEventListener('dragleave', dragleaveListener)\n ele.addEventListener('drop', dropListener)\n }\n addTargetListeners(ele, droppedURIHandler)\n} // listen for dropped URIs\n\n// Make an HTML element draggable as a URI-identified thing\n//\n// Possibly later set the drag image too?\n//\nexport function makeDraggable (tr, obj) {\n tr.setAttribute('draggable', 'true') // Stop the image being dragged instead - just the TR\n\n tr.addEventListener(\n 'dragstart',\n function (e) {\n tr.style.fontWeight = 'bold'\n e.dataTransfer.setData('text/uri-list', obj.uri)\n e.dataTransfer.setData('text/plain', obj.uri)\n e.dataTransfer.setData('text/html', tr.outerHTML)\n debug.log(\n 'Dragstart: ' + tr + ' -> ' + obj + 'de: ' + e.dataTransfer.dropEffect\n )\n },\n false\n )\n\n tr.addEventListener(\n 'drag',\n function (e) {\n e.preventDefault()\n e.stopPropagation()\n // debug.log('Drag: dropEffect: ' + e.dataTransfer.dropEffect)\n },\n false\n )\n\n tr.addEventListener(\n 'dragend',\n function (e) {\n tr.style.fontWeight = 'normal'\n debug.log('Dragend dropeffect: ' + e.dataTransfer.dropEffect)\n debug.log('Dragend: ' + tr + ' -> ' + obj)\n },\n false\n )\n}\n\n/** uploadFiles\n**\n** Generic uploader of local files to the web\n** typically called from dropped file handler\n**\n** @param {Fetcher} fetcher instance of class Fetcher as in kb.fetcher\n** @param {Array<File>} files Array of file objects\n** @param {String} fileBase URI of folder in which to put files (except images) (no trailing slash)\n** @param {String } imageBase URI of folder in which to put images\n** @param successHandler function(file, uploadedURI) Called after EACH success upload\n** With file object an final URI as params\n*/\n\nexport function uploadFiles (fetcher, files, fileBase, imageBase, successHandler) {\n for (let i = 0; files[i]; i++) {\n const f = files[i]\n debug.log(\n ' dropped: Filename: ' +\n f.name +\n ', type: ' +\n (f.type || 'n/a') +\n ' size: ' +\n f.size +\n ' bytes, last modified: ' +\n (f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a')\n ) // See e.g. https://www.html5rocks.com/en/tutorials/file/dndfiles/\n\n // @@ Add: progress bar(s)\n const reader = new FileReader()\n reader.onload = (function (theFile) {\n return function (e) {\n const data = e.target.result\n let suffix = ''\n debug.log(' File read byteLength : ' + data.byteLength)\n let contentType = theFile.type\n if (!theFile.type || theFile.type === '') {\n // Not known by browser\n contentType = mime.lookup(theFile.name)\n if (!contentType) {\n const msg =\n 'Filename needs to have an extension which gives a type we know: ' +\n theFile.name\n debug.log(msg)\n alert(msg)\n throw new Error(msg)\n }\n } else {\n const extension = mime.extension(theFile.type)\n // Note not simple: eg .mp3 => audio/mpeg; .mpga => audio/mpeg; audio/mp3 => .mp3\n if (extension && extension !== 'false' && !theFile.name.endsWith('.' + extension) && // Not already has preferred extension? and ...\n theFile.type !== mime.lookup(theFile.name)) { // the mime type of this ext is not the right one?\n suffix = '_.' + extension\n // console.log('MIME TYPE MISMATCH: ' + mime.lookup(theFile.name) + ': adding extension: ' + suffix)\n }\n }\n const folderName = theFile.type.startsWith('image/')\n ? imageBase || fileBase\n : fileBase\n const destURI =\n folderName +\n (folderName.endsWith('/') ? '' : '/') +\n encodeURIComponent(theFile.name) +\n suffix\n\n fetcher\n .webOperation('PUT', destURI, {\n data,\n contentType\n })\n .then(\n _response => {\n debug.log(' Upload: put OK: ' + destURI)\n successHandler(theFile, destURI)\n },\n error => {\n const msg = ' Upload: FAIL ' + destURI + ', Error: ' + error\n debug.log(msg)\n alert(msg)\n throw new Error(msg)\n }\n )\n }\n })(f)\n reader.readAsArrayBuffer(f)\n }\n}\n"],"mappings":";;;;;;;;;AAUA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,uBAAA,CAAAC,OAAA;AAAiC,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CA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AAS,EAAI;UACXhG,KAAK,CAACmC,GAAG,CAAC,mBAAmB,GAAGyD,OAAO,CAAC;UACxCnB,cAAc,CAACI,OAAO,EAAEe,OAAO,CAAC;QAClC,CAAC,EACD,UAAAK,KAAK,EAAI;UACP,IAAMZ,GAAG,GAAG,gBAAgB,GAAGO,OAAO,GAAG,WAAW,GAAGK,KAAK;UAC5DjG,KAAK,CAACmC,GAAG,CAACkD,GAAG,CAAC;UACdC,KAAK,CAACD,GAAG,CAAC;UACV,MAAM,IAAIE,KAAK,CAACF,GAAG,CAAC;QACtB,CACF,CAAC;MACL,CAAC;IACH,CAAC,CAAElC,CAAC,CAAC;IACLuB,MAAM,CAACwB,iBAAiB,CAAC/C,CAAC,CAAC;EAC7B;AACF"}
|
|
1
|
+
{"version":3,"file":"dragAndDrop.js","names":["debug","_interopRequireWildcard","require","mime","style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","makeDropTarget","ele","droppedURIHandler","droppedFileHandler","dragoverListener","preventDefault","dataTransfer","dropEffect","dragenterListener","log","localStyle","savedStyle","dragEvent","dragleaveListener","dropEvent","dropListener","types","join","uris","text","length","type","getData","split","files","f","name","size","lastModifiedDate","toLocaleDateString","slice","restoreStyle","addTargetListeners","addEventListener","makeDraggable","tr","obj","setAttribute","fontWeight","setData","uri","outerHTML","stopPropagation","uploadFiles","fetcher","fileBase","imageBase","successHandler","reader","FileReader","onload","theFile","data","target","result","suffix","byteLength","contentType","lookup","msg","alert","Error","extension","endsWith","folderName","startsWith","destURI","encodeURIComponent","webOperation","then","_response","error","readAsArrayBuffer"],"sources":["../../src/widgets/dragAndDrop.js"],"sourcesContent":["/* Drag and drop common functionality\n *\n * It is easy to make something draggable, or to make it a drag target!\n * Just call the functions below. In a Solid world, any part of the UI which\n * represents one thing which has a URI, should be made draggable using makeDraggable.\n * Any list of things should typically allow you to drag new members of the list\n * onto it.\n * The file upload function, uploadFiles, is provided as often as someone drags a file from the computer\n * desktop. You may want to upload it into the pod.\n */\nimport * as debug from '../debug'\nimport * as mime from 'mime-types'\nimport * as style from '../style'\n\n/* global FileReader alert */\n\nexport function makeDropTarget (ele, droppedURIHandler, droppedFileHandler) {\n const dragoverListener = function (e) {\n e.preventDefault() // Need this; otherwise, drop does not work.\n e.dataTransfer.dropEffect = 'copy'\n }\n\n const dragenterListener = function (e) {\n debug.log('dragenter event dropEffect: ' + e.dataTransfer.dropEffect)\n if (this.localStyle) {\n // necessary not sure when\n if (!this.savedStyle) {\n this.savedStyle = style.dragEvent\n }\n }\n\n e.dataTransfer.dropEffect = 'link'\n debug.log('dragenter event dropEffect 2: ' + e.dataTransfer.dropEffect)\n }\n const dragleaveListener = function (e) {\n debug.log('dragleave event dropEffect: ' + e.dataTransfer.dropEffect)\n if (this.savedStyle) {\n this.localStyle = this.savedStyle\n } else {\n this.localStyle = style.dropEvent\n }\n }\n\n const dropListener = function (e) {\n if (e.preventDefault) e.preventDefault() // stops the browser from redirecting off to the text.\n debug.log('Drop event. dropEffect: ' + e.dataTransfer.dropEffect)\n debug.log(\n 'Drop event. types: ' +\n (e.dataTransfer.types ? e.dataTransfer.types.join(', ') : 'NOPE')\n )\n\n let uris = null\n let text\n if (e.dataTransfer.types) {\n for (let t = 0; t < e.dataTransfer.types.length; t++) {\n const type = e.dataTransfer.types[t]\n if (type === 'text/uri-list') {\n uris = e.dataTransfer.getData(type).split('\\n') // @ ignore those starting with #\n debug.log('Dropped text/uri-list: ' + uris)\n } else if (type === 'text/plain') {\n text = e.dataTransfer.getData(type)\n } else if (type === 'Files' && droppedFileHandler) {\n const files = e.dataTransfer.files // FileList object.\n for (let i = 0; files[i]; i++) {\n const f = files[i]\n debug.log(\n 'Filename: ' +\n f.name +\n ', type: ' +\n (f.type || 'n/a') +\n ' size: ' +\n f.size +\n ' bytes, last modified: ' +\n (f.lastModifiedDate\n ? f.lastModifiedDate.toLocaleDateString()\n : 'n/a')\n )\n }\n droppedFileHandler(files)\n }\n }\n if (uris === null && text && text.slice(0, 4) === 'http') {\n uris = text\n debug.log(\"Waring: Poor man's drop: using text for URI\") // chrome disables text/uri-list??\n }\n } else {\n // ... however, if we're IE, we don't have the .types property, so we'll just get the Text value\n uris = [e.dataTransfer.getData('Text')]\n debug.log('WARNING non-standard drop event: ' + uris[0])\n }\n debug.log('Dropped URI list (2): ' + uris)\n if (uris) {\n droppedURIHandler(uris)\n }\n this.localStyle = style.restoreStyle // restore style\n return false\n } // dropListener\n\n const addTargetListeners = function (ele) {\n if (!ele) {\n debug.log('@@@ addTargetListeners: ele ' + ele)\n }\n ele.addEventListener('dragover', dragoverListener)\n ele.addEventListener('dragenter', dragenterListener)\n ele.addEventListener('dragleave', dragleaveListener)\n ele.addEventListener('drop', dropListener)\n }\n addTargetListeners(ele, droppedURIHandler)\n} // listen for dropped URIs\n\n// Make an HTML element draggable as a URI-identified thing\n//\n// Possibly later set the drag image too?\n//\nexport function makeDraggable (tr, obj) {\n tr.setAttribute('draggable', 'true') // Stop the image being dragged instead - just the TR\n\n tr.addEventListener(\n 'dragstart',\n function (e) {\n tr.style.fontWeight = 'bold'\n e.dataTransfer.setData('text/uri-list', obj.uri)\n e.dataTransfer.setData('text/plain', obj.uri)\n e.dataTransfer.setData('text/html', tr.outerHTML)\n debug.log(\n 'Dragstart: ' + tr + ' -> ' + obj + 'de: ' + e.dataTransfer.dropEffect\n )\n },\n false\n )\n\n tr.addEventListener(\n 'drag',\n function (e) {\n e.preventDefault()\n e.stopPropagation()\n // debug.log('Drag: dropEffect: ' + e.dataTransfer.dropEffect)\n },\n false\n )\n\n tr.addEventListener(\n 'dragend',\n function (e) {\n tr.style.fontWeight = 'normal'\n debug.log('Dragend dropeffect: ' + e.dataTransfer.dropEffect)\n debug.log('Dragend: ' + tr + ' -> ' + obj)\n },\n false\n )\n}\n\n/** uploadFiles\n**\n** Generic uploader of local files to the web\n** typically called from dropped file handler\n**\n** @param {Fetcher} fetcher instance of class Fetcher as in kb.fetcher\n** @param {Array<File>} files Array of file objects\n** @param {String} fileBase URI of folder in which to put files (except images) (no trailing slash)\n** @param {String } imageBase URI of folder in which to put images\n** @param successHandler function(file, uploadedURI) Called after EACH success upload\n** With file object an final URI as params\n*/\n\nexport function uploadFiles (fetcher, files, fileBase, imageBase, successHandler) {\n for (let i = 0; files[i]; i++) {\n const f = files[i]\n debug.log(\n ' dropped: Filename: ' +\n f.name +\n ', type: ' +\n (f.type || 'n/a') +\n ' size: ' +\n f.size +\n ' bytes, last modified: ' +\n (f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a')\n ) // See e.g. https://www.html5rocks.com/en/tutorials/file/dndfiles/\n\n // @@ Add: progress bar(s)\n const reader = new FileReader()\n reader.onload = (function (theFile) {\n return function (e) {\n const data = e.target.result\n let suffix = ''\n debug.log(' File read byteLength : ' + data.byteLength)\n let contentType = theFile.type\n if (!theFile.type || theFile.type === '') {\n // Not known by browser\n contentType = mime.lookup(theFile.name)\n if (!contentType) {\n const msg =\n 'Filename needs to have an extension which gives a type we know: ' +\n theFile.name\n debug.log(msg)\n alert(msg)\n throw new Error(msg)\n }\n } else {\n const extension = mime.extension(theFile.type)\n // Note not simple: eg .mp3 => audio/mpeg; .mpga => audio/mpeg; audio/mp3 => .mp3\n if (extension && extension !== 'false' && !theFile.name.endsWith('.' + extension) && // Not already has preferred extension? and ...\n theFile.type !== mime.lookup(theFile.name)) { // the mime type of this ext is not the right one?\n suffix = '_.' + extension\n // console.log('MIME TYPE MISMATCH: ' + mime.lookup(theFile.name) + ': adding extension: ' + suffix)\n }\n }\n const folderName = theFile.type.startsWith('image/')\n ? imageBase || fileBase\n : fileBase\n const destURI =\n folderName +\n (folderName.endsWith('/') ? '' : '/') +\n encodeURIComponent(theFile.name) +\n suffix\n\n fetcher\n .webOperation('PUT', destURI, {\n data,\n contentType\n })\n .then(\n _response => {\n debug.log(' Upload: put OK: ' + destURI)\n successHandler(theFile, destURI)\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AClC,CAAC,EACD,UAAAK,KAAK,EAAI;UACP,IAAMZ,GAAG,GAAG,gBAAgB,GAAGO,OAAO,GAAG,WAAW,GAAGK,KAAK;UAC5DhG,KAAK,CAACkC,GAAG,CAACkD,GAAG,CAAC;UACdC,KAAK,CAACD,GAAG,CAAC;UACV,MAAM,IAAIE,KAAK,CAACF,GAAG,CAAC;QACtB,CACF,CAAC;MACL,CAAC;IACH,CAAC,CAAElC,CAAC,CAAC;IACLuB,MAAM,CAACwB,iBAAiB,CAAC/C,CAAC,CAAC;EAC7B;AACF","ignoreList":[]}
|
package/lib/widgets/error.js
CHANGED
|
@@ -10,7 +10,7 @@ var _widgets = require("../widgets");
|
|
|
10
10
|
var style = _interopRequireWildcard(require("../style"));
|
|
11
11
|
var _styleConstants = _interopRequireDefault(require("../styleConstants"));
|
|
12
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
14
14
|
/**
|
|
15
15
|
* Create an error message block
|
|
16
16
|
* @param dom The DOM on which dom.createElement will be called
|
package/lib/widgets/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","names":["_widgets","require","style","_interopRequireWildcard","_styleConstants","_interopRequireDefault","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","
|
|
1
|
+
{"version":3,"file":"error.js","names":["_widgets","require","style","_interopRequireWildcard","_styleConstants","_interopRequireDefault","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","errorMessageBlock","dom","err","backgroundColor","err2","div","createElement","errorObject","Error","console","error","concat","stack","textContent","message","appendChild","cancelButton","parentNode","removeChild","errorCancelButton","setAttribute","errorMessageBlockStyle","styleConstants","defaultErrorBackgroundColor"],"sources":["../../src/widgets/error.ts"],"sourcesContent":["/**\n * Create an error message block\n * @param dom The DOM on which dom.createElement will be called\n * @param err The error message string to display (or an error object)\n * @param backgroundColor Background color. Default: '#fee'\n * @param err2 Is the second param is a string, you can put the original Error in here\n * @returns A div element with the err string\n *\n * This will return a DOM element you can put in the UI as a notice for the user\n * Meanwhile the stack is dumped to the console for the developer, so you actually know\n * where it happened!\n */\n/* eslint-disable no-console */\nimport { cancelButton } from '../widgets'\nimport * as style from '../style'\nimport styleConstants from '../styleConstants'\n\nexport function errorMessageBlock (dom: HTMLDocument, err: string | Error, backgroundColor?: string, err2?: Error): HTMLDivElement {\n const div = dom.createElement('div')\n\n /* tslint:disable-next-line */ // Too complex for TS?\n // @ts-ignore\n const errorObject:Error = err2 || err instanceof Error ? err : null\n\n if (errorObject) {\n console.error(`errorMessageBlock: ${errorObject} at: ${errorObject.stack || '??'}`, errorObject) // @@ pick one\n div.textContent = errorObject.message\n } else {\n div.textContent = err as string\n }\n\n div.appendChild(cancelButton(dom, () => { if (div.parentNode) div.parentNode.removeChild(div) }))\n .style = style.errorCancelButton\n\n div.setAttribute('style', style.errorMessageBlockStyle)\n div.style.backgroundColor = (backgroundColor || styleConstants.defaultErrorBackgroundColor)\n return div\n}\n"],"mappings":";;;;;;;;AAaA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,eAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAA8C,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,cAAAR,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAf9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKO,SAASW,iBAAiBA,CAAEC,GAAiB,EAAEC,GAAmB,EAAEC,eAAwB,EAAEC,IAAY,EAAkB;EACjI,IAAMC,GAAG,GAAGJ,GAAG,CAACK,aAAa,CAAC,KAAK,CAAC;;EAEpC,+BAA+B;EAC/B;EACA,IAAMC,WAAiB,GAAGH,IAAI,IAAIF,GAAG,YAAYM,KAAK,GAAGN,GAAG,GAAG,IAAI;EAEnE,IAAIK,WAAW,EAAE;IACfE,OAAO,CAACC,KAAK,uBAAAC,MAAA,CAAuBJ,WAAW,WAAAI,MAAA,CAAQJ,WAAW,CAACK,KAAK,IAAI,IAAI,GAAIL,WAAW,CAAC,EAAC;IACjGF,GAAG,CAACQ,WAAW,GAAGN,WAAW,CAACO,OAAO;EACvC,CAAC,MAAM;IACLT,GAAG,CAACQ,WAAW,GAAGX,GAAa;EACjC;EAEAG,GAAG,CAACU,WAAW,CAAC,IAAAC,qBAAY,EAACf,GAAG,EAAE,YAAM;IAAE,IAAII,GAAG,CAACY,UAAU,EAAEZ,GAAG,CAACY,UAAU,CAACC,WAAW,CAACb,GAAG,CAAC;EAAC,CAAC,CAAC,CAAC,CAC9F7B,KAAK,GAAGA,KAAK,CAAC2C,iBAAiB;EAElCd,GAAG,CAACe,YAAY,CAAC,OAAO,EAAE5C,KAAK,CAAC6C,sBAAsB,CAAC;EACvDhB,GAAG,CAAC7B,KAAK,CAAC2B,eAAe,GAAIA,eAAe,IAAImB,0BAAc,CAACC,2BAA4B;EAC3F,OAAOlB,GAAG;AACZ","ignoreList":[]}
|
|
@@ -15,10 +15,10 @@ var widgets = _interopRequireWildcard(require("../../../widgets"));
|
|
|
15
15
|
var utils = _interopRequireWildcard(require("../../../utils"));
|
|
16
16
|
var _autocompletePicker = require("./autocompletePicker");
|
|
17
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
19
|
-
function _createForOfIteratorHelper(
|
|
20
|
-
function _unsupportedIterableToArray(
|
|
21
|
-
function _arrayLikeToArray(
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
19
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
20
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
21
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } /* The Autocomplete Control with decorations
|
|
22
22
|
|
|
23
23
|
This control has the buttons which control the state between editing, viewing, searching, accepting
|
|
24
24
|
and so on. See the state diagram in the documentation. The AUtocomplete Picker does the main work.
|
|
@@ -36,7 +36,7 @@ function renderAutocompleteControl(_x, _x2, _x3, _x4, _x5, _x6) {
|
|
|
36
36
|
} // renderAutocompleteControl
|
|
37
37
|
// ends
|
|
38
38
|
function _renderAutocompleteControl() {
|
|
39
|
-
_renderAutocompleteControl = (0, _asyncToGenerator2["default"])(
|
|
39
|
+
_renderAutocompleteControl = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6(dom, person, barOptions, acOptions, addOneIdAndRefresh, deleteOne) {
|
|
40
40
|
var autoCompleteDone, _autoCompleteDone, greenButtonHandler, _greenButtonHandler, removeDecorated, displayAutocomplete, _displayAutocomplete, searchButtonHandler, _searchButtonHandler, droppedURIHandler, _droppedURIHandler, acceptButton, cancelButton, deleteButtonContainer, noun, deleteButton, editButton, editing, syncEditingStatus, decoration, decoratedAutocomplete, creationArea, plus;
|
|
41
41
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
42
42
|
while (1) switch (_context6.prev = _context6.next) {
|
|
@@ -53,7 +53,7 @@ function _renderAutocompleteControl() {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
_droppedURIHandler = function _droppedURIHandler3() {
|
|
56
|
-
_droppedURIHandler = (0, _asyncToGenerator2["default"])(
|
|
56
|
+
_droppedURIHandler = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(uris) {
|
|
57
57
|
var _iterator, _step, webid;
|
|
58
58
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
59
59
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -95,7 +95,7 @@ function _renderAutocompleteControl() {
|
|
|
95
95
|
return _droppedURIHandler.apply(this, arguments);
|
|
96
96
|
};
|
|
97
97
|
_searchButtonHandler = function _searchButtonHandler3() {
|
|
98
|
-
_searchButtonHandler = (0, _asyncToGenerator2["default"])(
|
|
98
|
+
_searchButtonHandler = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(_event) {
|
|
99
99
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
100
100
|
while (1) switch (_context4.prev = _context4.next) {
|
|
101
101
|
case 0:
|
|
@@ -122,7 +122,7 @@ function _renderAutocompleteControl() {
|
|
|
122
122
|
return _searchButtonHandler.apply(this, arguments);
|
|
123
123
|
};
|
|
124
124
|
_displayAutocomplete = function _displayAutocomplete3() {
|
|
125
|
-
_displayAutocomplete = (0, _asyncToGenerator2["default"])(
|
|
125
|
+
_displayAutocomplete = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
126
126
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
127
127
|
while (1) switch (_context3.prev = _context3.next) {
|
|
128
128
|
case 0:
|
|
@@ -164,7 +164,7 @@ function _renderAutocompleteControl() {
|
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
166
|
_greenButtonHandler = function _greenButtonHandler3() {
|
|
167
|
-
_greenButtonHandler = (0, _asyncToGenerator2["default"])(
|
|
167
|
+
_greenButtonHandler = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(_event) {
|
|
168
168
|
var webid;
|
|
169
169
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
170
170
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -192,7 +192,7 @@ function _renderAutocompleteControl() {
|
|
|
192
192
|
return _greenButtonHandler.apply(this, arguments);
|
|
193
193
|
};
|
|
194
194
|
_autoCompleteDone = function _autoCompleteDone3() {
|
|
195
|
-
_autoCompleteDone = (0, _asyncToGenerator2["default"])(
|
|
195
|
+
_autoCompleteDone = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(object, name) {
|
|
196
196
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
197
197
|
while (1) switch (_context.prev = _context.next) {
|
|
198
198
|
case 0:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocompleteBar.js","names":["ns","_interopRequireWildcard","require","_iconBase","_solidLogic","widgets","utils","_autocompletePicker","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","F","s","done","value","_e","f","TypeError","normalCompletion","didErr","err","step","next","_e2","minLen","_arrayLikeToArray","toString","slice","constructor","name","from","test","arr","len","arr2","WEBID_NOUN","GREEN_PLUS","icons","iconBase","SEARCH_ICON","EDIT_ICON","renderAutocompleteControl","_x","_x2","_x3","_x4","_x5","_x6","_renderAutocompleteControl","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee6","dom","person","barOptions","acOptions","addOneIdAndRefresh","deleteOne","autoCompleteDone","_autoCompleteDone","greenButtonHandler","_greenButtonHandler","removeDecorated","displayAutocomplete","_displayAutocomplete","searchButtonHandler","_searchButtonHandler","droppedURIHandler","_droppedURIHandler","acceptButton","cancelButton","deleteButtonContainer","noun","deleteButton","editButton","editing","syncEditingStatus","decoration","decoratedAutocomplete","creationArea","plus","wrap","_callee6$","_context6","prev","_syncEditingStatus","setVisible","_droppedURIHandler3","_callee5","uris","_iterator","_step","webid","_callee5$","_context5","t0","finish","stop","_droppedURIHandler2","_x11","_searchButtonHandler3","_callee4","_event","_callee4$","_context4","removeChild","undefined","_searchButtonHandler2","_x10","_displayAutocomplete3","_callee3","_callee3$","_context3","createElement","setAttribute","renderAutoComplete","t1","sent","appendChild","_displayAutocomplete2","_removeDecorated","_greenButtonHandler3","_callee2","_callee2$","_context2","askName","store","vcard","abrupt","_greenButtonHandler2","_x9","_autoCompleteDone3","_callee","object","_callee$","_context","permanent","_autoCompleteDone2","_x7","_x8","continueButton","targetClass","label","deleteButtonWithCheck","button","style","display","flexDirection","currentObject","editable","width","manualURIEntry","idNoun","makeDropTarget","dbLookup"],"sources":["../../../../src/widgets/forms/autocomplete/autocompleteBar.ts"],"sourcesContent":["/* The Autocomplete Control with decorations\n\nThis control has the buttons which control the state between editing, viewing, searching, accepting\nand so on. See the state diagram in the documentation. The AUtocomplete Picker does the main work.\n\n*/\nimport * as ns from '../../../ns'\nimport { icons } from '../../../iconBase'\nimport { store } from 'solid-logic'\nimport * as widgets from '../../../widgets'\nimport * as utils from '../../../utils'\n\nimport { renderAutoComplete, AutocompleteDecoration, setVisible } from './autocompletePicker' // dbpediaParameters\n\nimport { NamedNode } from 'rdflib'\n\nconst WEBID_NOUN = 'Solid ID'\n\nconst GREEN_PLUS = icons.iconBase + 'noun_34653_green.svg'\nconst SEARCH_ICON = icons.iconBase + 'noun_Search_875351.svg'\nconst EDIT_ICON = icons.iconBase + 'noun_253504.svg'\n// const DELETE_ICON = icons.iconBase + 'noun_2188_red.svg'\n\nexport async function renderAutocompleteControl (dom:HTMLDocument,\n person:NamedNode,\n barOptions,\n acOptions,\n addOneIdAndRefresh,\n deleteOne): Promise<HTMLElement> {\n async function autoCompleteDone (object, name) {\n if (acOptions.permanent) { // remember to set this in publicid panel\n setVisible(editButton, true)\n setVisible(acceptButton, false)\n setVisible(cancelButton, false)\n } else {\n // console.log('temporary - removed decoratiion')\n removeDecorated()\n }\n return addOneIdAndRefresh(object, name)\n }\n\n async function greenButtonHandler (_event) {\n const webid = await widgets.askName(dom, store, creationArea, ns.vcard('url'), undefined, WEBID_NOUN)\n if (!webid) {\n return // cancelled by user\n }\n return addOneIdAndRefresh(person, webid)\n }\n\n function removeDecorated () {\n if (decoratedAutocomplete) {\n creationArea.removeChild(decoratedAutocomplete)\n decoratedAutocomplete = undefined\n }\n }\n\n async function displayAutocomplete () {\n decoratedAutocomplete = dom.createElement('div') as HTMLElement\n decoratedAutocomplete.setAttribute('style', 'display: flex; flex-flow: wrap;')\n decoratedAutocomplete.appendChild(await renderAutoComplete(dom, acOptions, decoration, autoCompleteDone))\n // console.log('@@ acceptButton', acceptButton)\n decoratedAutocomplete.appendChild(acceptButton)\n // console.log('@@ cancelButton', cancelButton)\n\n decoratedAutocomplete.appendChild(cancelButton)\n // console.log('@@ editButton', editButton)\n\n decoratedAutocomplete.appendChild(editButton)\n // console.log('@@ deleteButtonContainer', deleteButtonContainer)\n\n decoratedAutocomplete.appendChild(deleteButtonContainer)\n creationArea.appendChild(decoratedAutocomplete)\n }\n\n async function searchButtonHandler (_event) {\n if (decoratedAutocomplete) {\n creationArea.removeChild(decoratedAutocomplete)\n decoratedAutocomplete = undefined\n } else {\n await displayAutocomplete()\n }\n }\n\n async function droppedURIHandler (uris) {\n for (const webid of uris) { // normally one but can be more than one\n await addOneIdAndRefresh(person, webid)\n }\n }\n\n const acceptButton = widgets.continueButton(dom)\n acceptButton.setAttribute('data-testid', 'accept-button')\n\n const cancelButton = widgets.cancelButton(dom)\n cancelButton.setAttribute('data-testid', 'cancel-button')\n const deleteButtonContainer = dom.createElement('div')\n const noun = acOptions.targetClass ? utils.label(acOptions.targetClass) : 'item'\n const deleteButton = widgets.deleteButtonWithCheck(dom, deleteButtonContainer, noun, deleteOne) // need to knock out this UI or caller does that\n deleteButton.setAttribute('data-testid', 'delete-button')\n const editButton = widgets.button(dom, EDIT_ICON, 'Edit', _event => {\n editing = !editing\n syncEditingStatus()\n })\n editButton.setAttribute('data-testid', 'edit-button')\n let editing = true\n\n function syncEditingStatus () {\n if (editing) {\n setVisible(editButton, false)\n setVisible(acceptButton, false) // not till got it\n setVisible(cancelButton, false)\n } else {\n setVisible(editButton, true)\n setVisible(acceptButton, false)\n setVisible(cancelButton, false)\n }\n }\n\n const decoration:AutocompleteDecoration = {\n acceptButton, cancelButton, editButton, deleteButton\n }\n\n let decoratedAutocomplete = undefined as HTMLElement | undefined\n\n const creationArea = dom.createElement('div')\n creationArea.style.display = 'flex'\n creationArea.style.flexDirection = 'row'\n\n if (acOptions.permanent || acOptions.currentObject) {\n await displayAutocomplete()\n }\n if (barOptions.editable) {\n // creationArea.appendChild(await renderAutoComplete(dom, barOptions, autoCompleteDone)) wait for searchButton\n creationArea.style.width = '100%'\n if (barOptions.manualURIEntry) {\n const plus = creationArea.appendChild(widgets.button(dom, GREEN_PLUS, barOptions.idNoun, greenButtonHandler))\n widgets.makeDropTarget(plus, droppedURIHandler, undefined)\n }\n if (barOptions.dbLookup && !acOptions.currentObject && !acOptions.permanent) {\n creationArea.appendChild(widgets.button(dom, SEARCH_ICON, barOptions.idNoun, searchButtonHandler))\n }\n }\n syncEditingStatus()\n return creationArea\n} // renderAutocompleteControl\n\n// ends\n"],"mappings":";;;;;;;;;;AAMA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,KAAA,GAAAL,uBAAA,CAAAC,OAAA;AAEA,IAAAK,mBAAA,GAAAL,OAAA;AAA6F,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,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AACmL,cAAc,CAACzE,IAAI,EAAEb,iBAAiB,EAAEuC,SAAS,CAAC;YAC5D;YACA,IAAIpD,UAAU,CAACoG,QAAQ,IAAI,CAACnG,SAAS,CAAC6F,aAAa,IAAI,CAAC7F,SAAS,CAACiF,SAAS,EAAE;cAC3EzD,YAAY,CAACuC,WAAW,CAAChJ,OAAO,CAAC0K,MAAM,CAAC5F,GAAG,EAAEhB,WAAW,EAAEkB,UAAU,CAACkG,MAAM,EAAEvF,mBAAmB,CAAC,CAAC;YACpG;UACF;UACAW,iBAAiB,CAAC,CAAC;UAAA,OAAAO,SAAA,CAAA6C,MAAA,WACZjD,YAAY;QAAA;QAAA;UAAA,OAAAI,SAAA,CAAAc,IAAA;MAAA;IAAA,GAAA9C,QAAA;EAAA,CACpB;EAAA,OAAAN,0BAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"autocompleteBar.js","names":["ns","_interopRequireWildcard","require","_iconBase","_solidLogic","widgets","utils","_autocompletePicker","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_createForOfIteratorHelper","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","_n","F","s","done","value","f","TypeError","o","next","_arrayLikeToArray","toString","slice","constructor","name","from","test","WEBID_NOUN","GREEN_PLUS","icons","iconBase","SEARCH_ICON","EDIT_ICON","renderAutocompleteControl","_x","_x2","_x3","_x4","_x5","_x6","_renderAutocompleteControl","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee6","dom","person","barOptions","acOptions","addOneIdAndRefresh","deleteOne","autoCompleteDone","_autoCompleteDone","greenButtonHandler","_greenButtonHandler","removeDecorated","displayAutocomplete","_displayAutocomplete","searchButtonHandler","_searchButtonHandler","droppedURIHandler","_droppedURIHandler","acceptButton","cancelButton","deleteButtonContainer","noun","deleteButton","editButton","editing","syncEditingStatus","decoration","decoratedAutocomplete","creationArea","plus","wrap","_callee6$","_context6","prev","_syncEditingStatus","setVisible","_droppedURIHandler3","_callee5","uris","_iterator","_step","webid","_callee5$","_context5","t0","finish","stop","_droppedURIHandler2","_x11","_searchButtonHandler3","_callee4","_event","_callee4$","_context4","removeChild","undefined","_searchButtonHandler2","_x10","_displayAutocomplete3","_callee3","_callee3$","_context3","createElement","setAttribute","renderAutoComplete","t1","sent","appendChild","_displayAutocomplete2","_removeDecorated","_greenButtonHandler3","_callee2","_callee2$","_context2","askName","store","vcard","abrupt","_greenButtonHandler2","_x9","_autoCompleteDone3","_callee","object","_callee$","_context","permanent","_autoCompleteDone2","_x7","_x8","continueButton","targetClass","label","deleteButtonWithCheck","button","style","display","flexDirection","currentObject","editable","width","manualURIEntry","idNoun","makeDropTarget","dbLookup"],"sources":["../../../../src/widgets/forms/autocomplete/autocompleteBar.ts"],"sourcesContent":["/* The Autocomplete Control with decorations\n\nThis control has the buttons which control the state between editing, viewing, searching, accepting\nand so on. See the state diagram in the documentation. The AUtocomplete Picker does the main work.\n\n*/\nimport * as ns from '../../../ns'\nimport { icons } from '../../../iconBase'\nimport { store } from 'solid-logic'\nimport * as widgets from '../../../widgets'\nimport * as utils from '../../../utils'\n\nimport { renderAutoComplete, AutocompleteDecoration, setVisible } from './autocompletePicker' // dbpediaParameters\n\nimport { NamedNode } from 'rdflib'\n\nconst WEBID_NOUN = 'Solid ID'\n\nconst GREEN_PLUS = icons.iconBase + 'noun_34653_green.svg'\nconst SEARCH_ICON = icons.iconBase + 'noun_Search_875351.svg'\nconst EDIT_ICON = icons.iconBase + 'noun_253504.svg'\n// const DELETE_ICON = icons.iconBase + 'noun_2188_red.svg'\n\nexport async function renderAutocompleteControl (dom:HTMLDocument,\n person:NamedNode,\n barOptions,\n acOptions,\n addOneIdAndRefresh,\n deleteOne): Promise<HTMLElement> {\n async function autoCompleteDone (object, name) {\n if (acOptions.permanent) { // remember to set this in publicid panel\n setVisible(editButton, true)\n setVisible(acceptButton, false)\n setVisible(cancelButton, false)\n } else {\n // console.log('temporary - removed decoratiion')\n removeDecorated()\n }\n return addOneIdAndRefresh(object, name)\n }\n\n async function greenButtonHandler (_event) {\n const webid = await widgets.askName(dom, store, creationArea, ns.vcard('url'), undefined, WEBID_NOUN)\n if (!webid) {\n return // cancelled by user\n }\n return addOneIdAndRefresh(person, webid)\n }\n\n function removeDecorated () {\n if (decoratedAutocomplete) {\n creationArea.removeChild(decoratedAutocomplete)\n decoratedAutocomplete = undefined\n }\n }\n\n async function displayAutocomplete () {\n decoratedAutocomplete = dom.createElement('div') as HTMLElement\n decoratedAutocomplete.setAttribute('style', 'display: flex; flex-flow: wrap;')\n decoratedAutocomplete.appendChild(await renderAutoComplete(dom, acOptions, decoration, autoCompleteDone))\n // console.log('@@ acceptButton', acceptButton)\n decoratedAutocomplete.appendChild(acceptButton)\n // console.log('@@ cancelButton', cancelButton)\n\n decoratedAutocomplete.appendChild(cancelButton)\n // console.log('@@ editButton', editButton)\n\n decoratedAutocomplete.appendChild(editButton)\n // console.log('@@ deleteButtonContainer', deleteButtonContainer)\n\n decoratedAutocomplete.appendChild(deleteButtonContainer)\n creationArea.appendChild(decoratedAutocomplete)\n }\n\n async function searchButtonHandler (_event) {\n if (decoratedAutocomplete) {\n creationArea.removeChild(decoratedAutocomplete)\n decoratedAutocomplete = undefined\n } else {\n await displayAutocomplete()\n }\n }\n\n async function droppedURIHandler (uris) {\n for (const webid of uris) { // normally one but can be more than one\n await addOneIdAndRefresh(person, webid)\n }\n }\n\n const acceptButton = widgets.continueButton(dom)\n acceptButton.setAttribute('data-testid', 'accept-button')\n\n const cancelButton = widgets.cancelButton(dom)\n cancelButton.setAttribute('data-testid', 'cancel-button')\n const deleteButtonContainer = dom.createElement('div')\n const noun = acOptions.targetClass ? utils.label(acOptions.targetClass) : 'item'\n const deleteButton = widgets.deleteButtonWithCheck(dom, deleteButtonContainer, noun, deleteOne) // need to knock out this UI or caller does that\n deleteButton.setAttribute('data-testid', 'delete-button')\n const editButton = widgets.button(dom, EDIT_ICON, 'Edit', _event => {\n editing = !editing\n syncEditingStatus()\n })\n editButton.setAttribute('data-testid', 'edit-button')\n let editing = true\n\n function syncEditingStatus () {\n if (editing) {\n setVisible(editButton, false)\n setVisible(acceptButton, false) // not till got it\n setVisible(cancelButton, false)\n } else {\n setVisible(editButton, true)\n setVisible(acceptButton, false)\n setVisible(cancelButton, false)\n }\n }\n\n const decoration:AutocompleteDecoration = {\n acceptButton, cancelButton, editButton, deleteButton\n }\n\n let decoratedAutocomplete = undefined as HTMLElement | undefined\n\n const creationArea = dom.createElement('div')\n creationArea.style.display = 'flex'\n creationArea.style.flexDirection = 'row'\n\n if (acOptions.permanent || acOptions.currentObject) {\n await displayAutocomplete()\n }\n if (barOptions.editable) {\n // creationArea.appendChild(await renderAutoComplete(dom, barOptions, autoCompleteDone)) wait for searchButton\n creationArea.style.width = '100%'\n if (barOptions.manualURIEntry) {\n const plus = creationArea.appendChild(widgets.button(dom, GREEN_PLUS, barOptions.idNoun, greenButtonHandler))\n widgets.makeDropTarget(plus, droppedURIHandler, undefined)\n }\n if (barOptions.dbLookup && !acOptions.currentObject && !acOptions.permanent) {\n creationArea.appendChild(widgets.button(dom, SEARCH_ICON, barOptions.idNoun, searchButtonHandler))\n }\n }\n syncEditingStatus()\n return creationArea\n} // renderAutocompleteControl\n\n// ends\n"],"mappings":";;;;;;;;;;AAMA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,KAAA,GAAAL,uBAAA,CAAAC,OAAA;AAEA,IAAAK,mBAAA,GAAAL,OAAA;AAA6F,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,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AAS,CAAC;YAC5D;YACA,IAAIpD,UAAU,CAACoG,QAAQ,IAAI,CAACnG,SAAS,CAAC6F,aAAa,IAAI,CAAC7F,SAAS,CAACiF,SAAS,EAAE;cAC3EzD,YAAY,CAACuC,WAAW,CAACpI,OAAO,CAAC8J,MAAM,CAAC5F,GAAG,EAAEhB,WAAW,EAAEkB,UAAU,CAACkG,MAAM,EAAEvF,mBAAmB,CAAC,CAAC;YACpG;UACF;UACAW,iBAAiB,CAAC,CAAC;UAAA,OAAAO,SAAA,CAAA6C,MAAA,WACZjD,YAAY;QAAA;QAAA;UAAA,OAAAI,SAAA,CAAAc,IAAA;MAAA;IAAA,GAAA9C,QAAA;EAAA,CACpB;EAAA,OAAAN,0BAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA","ignoreList":[]}
|
|
@@ -15,7 +15,7 @@ var style = _interopRequireWildcard(require("../../../style"));
|
|
|
15
15
|
var _autocompleteBar = require("./autocompleteBar");
|
|
16
16
|
var _rdflib = require("rdflib");
|
|
17
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
19
19
|
/* Form field for doing autocompleete
|
|
20
20
|
*/
|
|
21
21
|
|
|
@@ -50,7 +50,7 @@ function autocompleteField(dom, container, already, subject, form, doc, callback
|
|
|
50
50
|
return _addOneIdAndRefresh.apply(this, arguments);
|
|
51
51
|
}
|
|
52
52
|
function _addOneIdAndRefresh() {
|
|
53
|
-
_addOneIdAndRefresh = (0, _asyncToGenerator2["default"])(
|
|
53
|
+
_addOneIdAndRefresh = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(result, name) {
|
|
54
54
|
var oldValue, oldName, deletables, insertables, _kb$updater2;
|
|
55
55
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
56
56
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -102,7 +102,7 @@ function autocompleteField(dom, container, already, subject, form, doc, callback
|
|
|
102
102
|
return _deleteOne.apply(this, arguments);
|
|
103
103
|
}
|
|
104
104
|
function _deleteOne() {
|
|
105
|
-
_deleteOne = (0, _asyncToGenerator2["default"])(
|
|
105
|
+
_deleteOne = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(_result, _name) {
|
|
106
106
|
var oldValue, deletables, insertables, _kb$updater3, e2;
|
|
107
107
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
108
108
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocompleteField.js","names":["ns","_interopRequireWildcard","require","_solidLogic","widgets","style","_autocompleteBar","_rdflib","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","autocompleteField","dom","container","already","subject","form","doc","callbackFunction","_kb$updater","addOneIdAndRefresh","_x","_x2","_addOneIdAndRefresh","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","result","name","oldValue","oldName","deletables","insertables","_kb$updater2","wrap","_callee$","_context","prev","next","Error","kb","the","property","any","labelProperty","equals","sameTerm","abrupt","statementsMatching","concat","st","updater","updateMany","t0","box","appendChild","errorMessageBlock","stop","deleteOne","_x3","_x4","_deleteOne","_callee2","_result","_name","_kb$updater3","e2","_callee2$","_context2","termType","store","formDoc","createElement","lhs","setAttribute","formFieldNameBoxStyle","rhs","ui","schema","dataSource","queryParams","label","anyJS","logo","targetClass","objectURIBase","undefined","endpoint","searchByNameQuery","insitituteDetailsQuery","searchByNameURI","suppressEmptyUneditable","editable","uri","autocompleteOptions","permanent","size","obj","currentObject","currentName","display","fieldLabel","barOptions","dbLookup","renderAutocompleteControl","then","control","err"],"sources":["../../../../src/widgets/forms/autocomplete/autocompleteField.ts"],"sourcesContent":["/* Form field for doing autocompleete\n */\nimport * as ns from '../../../ns'\nimport { store } from 'solid-logic'\nimport * as widgets from '../../../widgets'\nimport * as style from '../../../style'\nimport { renderAutocompleteControl } from './autocompleteBar'\nimport { QueryParameters } from './publicData'\nimport { NamedNode, BlankNode, Literal, Variable, st } from 'rdflib'\nimport { AutocompleteOptions } from './autocompletePicker'\n/**\n * Render a autocomplete form field\n *\n * The autocomplete form searches for an object in a definitive public database,\n * and allows the user to search for it by name, displaying a list of objects whose names match\n * the input to date, and letting the user either click on one of the list,\n * or just go on untill there is only one. The process then returns two values,\n * the URiI of the object and its name.\n *\n * @param dom The HTML Document object aka Document Object Model\n * @param container If present, the created widget will be appended to this\n * @param already A hash table of (form, subject) kept to prevent recursive forms looping\n * @param subject The thing about which the form displays/edits data\n * @param form The form or field to be rendered\n * @param doc The web document in which the data is\n * @param callbackFunction Called when data is changed so other parts can be refreshed.\n *\n * Form properties:\n * @param ui:property The property to store the object itself\n * @param ui:labelProperty The property used to store the name of the object\n * @param ui:category The class of objects to be searched, if fixed (else dep on class of subject)\n *\n * @returns The HTML widget created\n */\n// eslint-disable-next-line complexity\nexport function autocompleteField (\n dom: HTMLDocument,\n container: HTMLElement | undefined,\n already,\n subject: NamedNode | BlankNode | Variable,\n form: NamedNode,\n doc: NamedNode | undefined,\n callbackFunction: (_ok: boolean, _errorMessage: string) => void\n): HTMLElement {\n async function addOneIdAndRefresh (result:NamedNode | Literal, name: Literal) {\n if (!name) {\n throw new Error('autocompleteField: No name set.')\n }\n const oldValue = kb.the(subject, property as any, null, doc)\n if (oldValue) {\n const oldName = kb.any(oldValue as any, labelProperty as any, null, doc)\n if (oldValue.equals(result) && oldName && oldName.sameTerm(name)) {\n // console.log('No change: same values.')\n return\n }\n }\n const deletables = oldValue\n ? kb.statementsMatching(subject, property as any, oldValue, doc)\n .concat(kb.statementsMatching(oldValue as any, labelProperty as any, null, doc))\n : []\n // console.log('autocompleteField Deletables ' + deletables.map(st => st.toNT()))\n const insertables = [st(subject, property as any, result, doc),\n st(result as any, labelProperty as any, name, doc)] // @@ track the language of the name too!\n // console.log(`AC form: ${deletables.length} to delete and ${insertables.length} to insert`)\n try {\n // console.log('@@@ AC updating ', deletables, insertables)\n await kb.updater?.updateMany(deletables, insertables)\n } catch (err) {\n callbackFunction(false, err)\n box.appendChild(widgets.errorMessageBlock(dom, 'Autocomplete form data update error:' + err, null, err))\n return\n }\n callbackFunction(true, '')\n }\n\n async function deleteOne (_result:NamedNode | Literal, _name: Literal) {\n const oldValue = kb.the(subject, property as any, null, doc)\n if (!oldValue) {\n callbackFunction(false, 'NO data to elete')\n box.appendChild(widgets.errorMessageBlock(dom, 'Autocomplete delete: no old data!'))\n return\n }\n // const oldName = kb.any(oldValue as any, labelProperty as any, null, doc)\n const deletables = kb.statementsMatching(subject, property as any, oldValue, doc)\n .concat(kb.statementsMatching(oldValue as any, labelProperty as any, null, doc))\n // console.log('autocompleteField Deletables ' + deletables.map(st => st.toNT()))\n const insertables = []\n // console.log(`AC form delete: ${deletables.length} to delete and ${insertables.length} to insert`)\n try {\n // console.log('@@@ AC updating ', deletables, insertables)\n await kb.updater?.updateMany(deletables, insertables)\n } catch (err) {\n const e2 = new Error('Autocomplete form data delete error:' + err)\n callbackFunction(false, err)\n box.appendChild(widgets.errorMessageBlock(dom, e2, null, err))\n return\n }\n callbackFunction(true, '') // changed\n }\n\n if (subject.termType !== 'NamedNode') {\n throw new Error('Sorry this field only works on NamedNode subjects (for editable)')\n }\n const kb = store\n const formDoc = form.doc ? form.doc() : null // @@ if blank no way to know\n\n const box = dom.createElement('div')\n if (container) container.appendChild(box)\n const lhs = dom.createElement('div')\n lhs.setAttribute('class', 'formFieldName')\n lhs.setAttribute('style', style.formFieldNameBoxStyle)\n box.appendChild(lhs)\n const rhs = dom.createElement('div')\n rhs.setAttribute('class', 'formFieldValue')\n box.appendChild(rhs)\n\n const property = kb.any(form, ns.ui('property'))\n if (!property) {\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No property given for autocomplete field: ' + form)\n )\n }\n const labelProperty = kb.any(form, ns.ui('labelProperty')) || ns.schema('name')\n\n // Parse the data source into query options\n\n const dataSource = kb.any(form, ns.ui('dataSource')) as NamedNode | undefined\n if (!dataSource) {\n // console.log('@@ connectedStatements ACF ', kb.connectedStatements(form).map(x => x.toNT()).join('\\n'))\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No data source given for autocomplete field: ' + form)\n )\n }\n const queryParams:QueryParameters = {\n // targetClass: kb.any(dataSource, ns.ui('targetClass'), null, dataSource.doc()) as NamedNode | undefined,\n label: kb.anyJS(dataSource, ns.schema('name'), null, dataSource.doc()),\n logo: (kb.any(dataSource, ns.schema('logo'), null, dataSource.doc())) as NamedNode | undefined\n }\n\n // @@ Should we pass the target class in from the data source definition or use a current type of the subject\n const targetClass = (kb.any(form, ns.ui('targetClass'), null, form.doc()) || // class in form takes pecedence\n kb.any(dataSource, ns.ui('targetClass'), null, dataSource.doc())) as NamedNode | undefined\n if (targetClass) {\n queryParams.targetClass = targetClass\n }\n\n queryParams.objectURIBase = (kb.any(dataSource, ns.ui('objectURIBase'), null, dataSource.doc()) || undefined) as NamedNode | undefined\n\n /*\n if (!queryParams.targetClass) {\n const klass = kb.any(subject, ns.rdf('type')) as NamedNode | undefined\n // @@ be more selective of which class if many\n // @@ todo: Take ALL classes, and compare them with those the data source knows about\n // with translation where necessary. Find most specific of the classes for the search.\n if (!klass) throw new Error('Autocomplete: No class specified or is current type of' + subject)\n queryParams.targetClass = klass\n }\n */\n const endpoint = kb.anyJS(dataSource, ns.ui('endpoint'), null, dataSource.doc()) as string | undefined\n if (endpoint) { // SPARQL\n queryParams.endpoint = endpoint\n\n queryParams.searchByNameQuery = kb.anyJS(dataSource, ns.ui('searchByNameQuery'), null, dataSource.doc())\n if (!queryParams.searchByNameQuery) {\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No searchByNameQuery given for endpoint data Source: ' + form))\n }\n queryParams.insitituteDetailsQuery = kb.anyJS(dataSource, ns.ui('insitituteDetailsQuery'), null, dataSource.doc())\n } else {\n // return box.appendChild(\n // widgets.errorMessageBlock(dom, 'Error: No SPARQL endpoint given for autocomplete field: ' + form))\n const searchByNameURI = kb.anyJS(dataSource, ns.ui('searchByNameURI'))\n if (!searchByNameURI) {\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No searchByNameURI OR sparql endpoint given for dataSource: ' + dataSource)\n )\n }\n queryParams.searchByNameURI = searchByNameURI\n }\n // It can be cleaner to just remove empty fields if you can't edit them anyway\n const suppressEmptyUneditable = kb.anyJS(form, ns.ui('suppressEmptyUneditable'), null, formDoc)\n const editable = kb.updater?.editable((doc as NamedNode).uri)\n\n const autocompleteOptions:AutocompleteOptions = { // cancelButton?: HTMLElement,\n permanent: true,\n targetClass: queryParams.targetClass, // @@ simplify?\n queryParams\n }\n\n autocompleteOptions.size = kb.anyJS(form, ns.ui('size'), null, formDoc) || undefined\n\n let obj = kb.any(subject, property as any, undefined, doc)\n if (!obj) {\n obj = kb.any(form, ns.ui('default'))\n if (obj) {\n autocompleteOptions.currentObject = obj as NamedNode\n autocompleteOptions.currentName = kb.any(autocompleteOptions.currentObject, labelProperty, null, doc) as Literal\n } else { // No data or default. Should we suprress the whole field?\n if (suppressEmptyUneditable && !editable) {\n box.style.display = 'none' // clutter removal\n return box\n }\n }\n } else { // get object and name from target data:\n autocompleteOptions.currentObject = obj as NamedNode\n autocompleteOptions.currentName = kb.any(autocompleteOptions.currentObject, labelProperty, null, doc) as Literal\n }\n\n lhs.appendChild(widgets.fieldLabel(dom, property as any, form))\n\n const barOptions = {\n editable,\n dbLookup: true\n }\n\n renderAutocompleteControl(dom, subject as NamedNode, barOptions, autocompleteOptions, addOneIdAndRefresh, deleteOne).then((control) => {\n rhs.appendChild(control)\n }, (err) => {\n rhs.appendChild(widgets.errorMessageBlock(dom, `Error rendering autocomplete ${form}: ${err}`, '#fee', err)) //\n })\n return box\n}\n\n// ends\n"],"mappings":";;;;;;;;;;AAEA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AAAoE,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CA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;EAEA2D,GAAG,CAAClB,WAAW,CAACxE,OAAO,CAACsH,UAAU,CAAC5F,GAAG,EAAEiC,QAAQ,EAAS7B,IAAI,CAAC,CAAC;EAE/D,IAAMyF,UAAU,GAAG;IACjBV,QAAQ,EAARA,QAAQ;IACRW,QAAQ,EAAE;EACZ,CAAC;EAED,IAAAC,0CAAyB,EAAC/F,GAAG,EAAEG,OAAO,EAAe0F,UAAU,EAAER,mBAAmB,EAAE7E,kBAAkB,EAAEyC,SAAS,CAAC,CAAC+C,IAAI,CAAC,UAACC,OAAO,EAAK;IACrI9B,GAAG,CAACrB,WAAW,CAACmD,OAAO,CAAC;EAC1B,CAAC,EAAE,UAACC,GAAG,EAAK;IACV/B,GAAG,CAACrB,WAAW,CAACxE,OAAO,CAACyE,iBAAiB,CAAC/C,GAAG,kCAAAwC,MAAA,CAAkCpC,IAAI,QAAAoC,MAAA,CAAK0D,GAAG,GAAI,MAAM,EAAEA,GAAG,CAAC,CAAC,EAAC;EAC/G,CAAC,CAAC;EACF,OAAOrD,GAAG;AACZ;;AAEA"}
|
|
1
|
+
{"version":3,"file":"autocompleteField.js","names":["ns","_interopRequireWildcard","require","_solidLogic","widgets","style","_autocompleteBar","_rdflib","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","autocompleteField","dom","container","already","subject","form","doc","callbackFunction","_kb$updater","addOneIdAndRefresh","_x","_x2","_addOneIdAndRefresh","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","result","name","oldValue","oldName","deletables","insertables","_kb$updater2","wrap","_callee$","_context","prev","next","Error","kb","the","property","any","labelProperty","equals","sameTerm","abrupt","statementsMatching","concat","st","updater","updateMany","t0","box","appendChild","errorMessageBlock","stop","deleteOne","_x3","_x4","_deleteOne","_callee2","_result","_name","_kb$updater3","e2","_callee2$","_context2","termType","store","formDoc","createElement","lhs","setAttribute","formFieldNameBoxStyle","rhs","ui","schema","dataSource","queryParams","label","anyJS","logo","targetClass","objectURIBase","undefined","endpoint","searchByNameQuery","insitituteDetailsQuery","searchByNameURI","suppressEmptyUneditable","editable","uri","autocompleteOptions","permanent","size","obj","currentObject","currentName","display","fieldLabel","barOptions","dbLookup","renderAutocompleteControl","then","control","err"],"sources":["../../../../src/widgets/forms/autocomplete/autocompleteField.ts"],"sourcesContent":["/* Form field for doing autocompleete\n */\nimport * as ns from '../../../ns'\nimport { store } from 'solid-logic'\nimport * as widgets from '../../../widgets'\nimport * as style from '../../../style'\nimport { renderAutocompleteControl } from './autocompleteBar'\nimport { QueryParameters } from './publicData'\nimport { NamedNode, BlankNode, Literal, Variable, st } from 'rdflib'\nimport { AutocompleteOptions } from './autocompletePicker'\n/**\n * Render a autocomplete form field\n *\n * The autocomplete form searches for an object in a definitive public database,\n * and allows the user to search for it by name, displaying a list of objects whose names match\n * the input to date, and letting the user either click on one of the list,\n * or just go on untill there is only one. The process then returns two values,\n * the URiI of the object and its name.\n *\n * @param dom The HTML Document object aka Document Object Model\n * @param container If present, the created widget will be appended to this\n * @param already A hash table of (form, subject) kept to prevent recursive forms looping\n * @param subject The thing about which the form displays/edits data\n * @param form The form or field to be rendered\n * @param doc The web document in which the data is\n * @param callbackFunction Called when data is changed so other parts can be refreshed.\n *\n * Form properties:\n * @param ui:property The property to store the object itself\n * @param ui:labelProperty The property used to store the name of the object\n * @param ui:category The class of objects to be searched, if fixed (else dep on class of subject)\n *\n * @returns The HTML widget created\n */\n// eslint-disable-next-line complexity\nexport function autocompleteField (\n dom: HTMLDocument,\n container: HTMLElement | undefined,\n already,\n subject: NamedNode | BlankNode | Variable,\n form: NamedNode,\n doc: NamedNode | undefined,\n callbackFunction: (_ok: boolean, _errorMessage: string) => void\n): HTMLElement {\n async function addOneIdAndRefresh (result:NamedNode | Literal, name: Literal) {\n if (!name) {\n throw new Error('autocompleteField: No name set.')\n }\n const oldValue = kb.the(subject, property as any, null, doc)\n if (oldValue) {\n const oldName = kb.any(oldValue as any, labelProperty as any, null, doc)\n if (oldValue.equals(result) && oldName && oldName.sameTerm(name)) {\n // console.log('No change: same values.')\n return\n }\n }\n const deletables = oldValue\n ? kb.statementsMatching(subject, property as any, oldValue, doc)\n .concat(kb.statementsMatching(oldValue as any, labelProperty as any, null, doc))\n : []\n // console.log('autocompleteField Deletables ' + deletables.map(st => st.toNT()))\n const insertables = [st(subject, property as any, result, doc),\n st(result as any, labelProperty as any, name, doc)] // @@ track the language of the name too!\n // console.log(`AC form: ${deletables.length} to delete and ${insertables.length} to insert`)\n try {\n // console.log('@@@ AC updating ', deletables, insertables)\n await kb.updater?.updateMany(deletables, insertables)\n } catch (err) {\n callbackFunction(false, err)\n box.appendChild(widgets.errorMessageBlock(dom, 'Autocomplete form data update error:' + err, null, err))\n return\n }\n callbackFunction(true, '')\n }\n\n async function deleteOne (_result:NamedNode | Literal, _name: Literal) {\n const oldValue = kb.the(subject, property as any, null, doc)\n if (!oldValue) {\n callbackFunction(false, 'NO data to elete')\n box.appendChild(widgets.errorMessageBlock(dom, 'Autocomplete delete: no old data!'))\n return\n }\n // const oldName = kb.any(oldValue as any, labelProperty as any, null, doc)\n const deletables = kb.statementsMatching(subject, property as any, oldValue, doc)\n .concat(kb.statementsMatching(oldValue as any, labelProperty as any, null, doc))\n // console.log('autocompleteField Deletables ' + deletables.map(st => st.toNT()))\n const insertables = []\n // console.log(`AC form delete: ${deletables.length} to delete and ${insertables.length} to insert`)\n try {\n // console.log('@@@ AC updating ', deletables, insertables)\n await kb.updater?.updateMany(deletables, insertables)\n } catch (err) {\n const e2 = new Error('Autocomplete form data delete error:' + err)\n callbackFunction(false, err)\n box.appendChild(widgets.errorMessageBlock(dom, e2, null, err))\n return\n }\n callbackFunction(true, '') // changed\n }\n\n if (subject.termType !== 'NamedNode') {\n throw new Error('Sorry this field only works on NamedNode subjects (for editable)')\n }\n const kb = store\n const formDoc = form.doc ? form.doc() : null // @@ if blank no way to know\n\n const box = dom.createElement('div')\n if (container) container.appendChild(box)\n const lhs = dom.createElement('div')\n lhs.setAttribute('class', 'formFieldName')\n lhs.setAttribute('style', style.formFieldNameBoxStyle)\n box.appendChild(lhs)\n const rhs = dom.createElement('div')\n rhs.setAttribute('class', 'formFieldValue')\n box.appendChild(rhs)\n\n const property = kb.any(form, ns.ui('property'))\n if (!property) {\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No property given for autocomplete field: ' + form)\n )\n }\n const labelProperty = kb.any(form, ns.ui('labelProperty')) || ns.schema('name')\n\n // Parse the data source into query options\n\n const dataSource = kb.any(form, ns.ui('dataSource')) as NamedNode | undefined\n if (!dataSource) {\n // console.log('@@ connectedStatements ACF ', kb.connectedStatements(form).map(x => x.toNT()).join('\\n'))\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No data source given for autocomplete field: ' + form)\n )\n }\n const queryParams:QueryParameters = {\n // targetClass: kb.any(dataSource, ns.ui('targetClass'), null, dataSource.doc()) as NamedNode | undefined,\n label: kb.anyJS(dataSource, ns.schema('name'), null, dataSource.doc()),\n logo: (kb.any(dataSource, ns.schema('logo'), null, dataSource.doc())) as NamedNode | undefined\n }\n\n // @@ Should we pass the target class in from the data source definition or use a current type of the subject\n const targetClass = (kb.any(form, ns.ui('targetClass'), null, form.doc()) || // class in form takes pecedence\n kb.any(dataSource, ns.ui('targetClass'), null, dataSource.doc())) as NamedNode | undefined\n if (targetClass) {\n queryParams.targetClass = targetClass\n }\n\n queryParams.objectURIBase = (kb.any(dataSource, ns.ui('objectURIBase'), null, dataSource.doc()) || undefined) as NamedNode | undefined\n\n /*\n if (!queryParams.targetClass) {\n const klass = kb.any(subject, ns.rdf('type')) as NamedNode | undefined\n // @@ be more selective of which class if many\n // @@ todo: Take ALL classes, and compare them with those the data source knows about\n // with translation where necessary. Find most specific of the classes for the search.\n if (!klass) throw new Error('Autocomplete: No class specified or is current type of' + subject)\n queryParams.targetClass = klass\n }\n */\n const endpoint = kb.anyJS(dataSource, ns.ui('endpoint'), null, dataSource.doc()) as string | undefined\n if (endpoint) { // SPARQL\n queryParams.endpoint = endpoint\n\n queryParams.searchByNameQuery = kb.anyJS(dataSource, ns.ui('searchByNameQuery'), null, dataSource.doc())\n if (!queryParams.searchByNameQuery) {\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No searchByNameQuery given for endpoint data Source: ' + form))\n }\n queryParams.insitituteDetailsQuery = kb.anyJS(dataSource, ns.ui('insitituteDetailsQuery'), null, dataSource.doc())\n } else {\n // return box.appendChild(\n // widgets.errorMessageBlock(dom, 'Error: No SPARQL endpoint given for autocomplete field: ' + form))\n const searchByNameURI = kb.anyJS(dataSource, ns.ui('searchByNameURI'))\n if (!searchByNameURI) {\n return box.appendChild(\n widgets.errorMessageBlock(dom, 'Error: No searchByNameURI OR sparql endpoint given for dataSource: ' + dataSource)\n )\n }\n queryParams.searchByNameURI = searchByNameURI\n }\n // It can be cleaner to just remove empty fields if you can't edit them anyway\n const suppressEmptyUneditable = kb.anyJS(form, ns.ui('suppressEmptyUneditable'), null, formDoc)\n const editable = kb.updater?.editable((doc as NamedNode).uri)\n\n const autocompleteOptions:AutocompleteOptions = { // cancelButton?: HTMLElement,\n permanent: true,\n targetClass: queryParams.targetClass, // @@ simplify?\n queryParams\n }\n\n autocompleteOptions.size = kb.anyJS(form, ns.ui('size'), null, formDoc) || undefined\n\n let obj = kb.any(subject, property as any, undefined, doc)\n if (!obj) {\n obj = kb.any(form, ns.ui('default'))\n if (obj) {\n autocompleteOptions.currentObject = obj as NamedNode\n autocompleteOptions.currentName = kb.any(autocompleteOptions.currentObject, labelProperty, null, doc) as Literal\n } else { // No data or default. Should we suprress the whole field?\n if (suppressEmptyUneditable && !editable) {\n box.style.display = 'none' // clutter removal\n return box\n }\n }\n } else { // get object and name from target data:\n autocompleteOptions.currentObject = obj as NamedNode\n autocompleteOptions.currentName = kb.any(autocompleteOptions.currentObject, labelProperty, null, doc) as Literal\n }\n\n lhs.appendChild(widgets.fieldLabel(dom, property as any, form))\n\n const barOptions = {\n editable,\n dbLookup: true\n }\n\n renderAutocompleteControl(dom, subject as NamedNode, barOptions, autocompleteOptions, addOneIdAndRefresh, deleteOne).then((control) => {\n rhs.appendChild(control)\n }, (err) => {\n rhs.appendChild(widgets.errorMessageBlock(dom, `Error rendering autocomplete ${form}: ${err}`, '#fee', err)) //\n })\n return box\n}\n\n// ends\n"],"mappings":";;;;;;;;;;AAEA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AAAoE,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,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,SAAS,CAAC,CAAC+C,IAAI,CAAC,UAACC,OAAO,EAAK;IACrI9B,GAAG,CAACrB,WAAW,CAACmD,OAAO,CAAC;EAC1B,CAAC,EAAE,UAACC,GAAG,EAAK;IACV/B,GAAG,CAACrB,WAAW,CAACvE,OAAO,CAACwE,iBAAiB,CAAC/C,GAAG,kCAAAwC,MAAA,CAAkCpC,IAAI,QAAAoC,MAAA,CAAK0D,GAAG,GAAI,MAAM,EAAEA,GAAG,CAAC,CAAC,EAAC;EAC/G,CAAC,CAAC;EACF,OAAOrD,GAAG;AACZ;;AAEA","ignoreList":[]}
|
|
@@ -17,10 +17,10 @@ var _solidLogic = require("solid-logic");
|
|
|
17
17
|
var _publicData = require("./publicData");
|
|
18
18
|
var _language = require("./language");
|
|
19
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
21
|
-
function _createForOfIteratorHelper(
|
|
22
|
-
function _unsupportedIterableToArray(
|
|
23
|
-
function _arrayLikeToArray(
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
21
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
22
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
23
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } /* Autocomplete Picker: Create and edit data using public data
|
|
24
24
|
**
|
|
25
25
|
** As the data source is passed as a parameter, all kinds of APIa and query services can be used
|
|
26
26
|
**
|
|
@@ -52,7 +52,7 @@ function renderAutoComplete(_x, _x2, _x3, _x4) {
|
|
|
52
52
|
} // renderAutoComplete
|
|
53
53
|
// ENDS
|
|
54
54
|
function _renderAutoComplete() {
|
|
55
|
-
_renderAutoComplete = (0, _asyncToGenerator2["default"])(
|
|
55
|
+
_renderAutoComplete = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(dom, acOptions, decoration, callback) {
|
|
56
56
|
var complain, finish, gotIt, _gotIt, acceptButtonHandler, _acceptButtonHandler, cancelButtonHandler, _cancelButtonHandler, nameMatch, clearList, inputEventHHandler, _inputEventHHandler, loadBindingsAndFilterByLanguage, _loadBindingsAndFilterByLanguage, filterByName, refreshList, _refreshList, initialize, targetClass, lastBindings, loadedEnough, inputEventHandlerLock, allDisplayed, lastFilter, numberOfRows, div, foundName, foundObject, table, head, cell, searchInput, size, searchInputStyle;
|
|
57
57
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
58
58
|
while (1) switch (_context8.prev = _context8.next) {
|
|
@@ -85,7 +85,7 @@ function _renderAutoComplete() {
|
|
|
85
85
|
clearList();
|
|
86
86
|
};
|
|
87
87
|
_refreshList = function _refreshList3() {
|
|
88
|
-
_refreshList = (0, _asyncToGenerator2["default"])(
|
|
88
|
+
_refreshList = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
89
89
|
var rowForBinding, compareBindingsByName, languagePrefs, filter, slimmed, displayable, _iterator, _step, binding;
|
|
90
90
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
91
91
|
while (1) switch (_context7.prev = _context7.next) {
|
|
@@ -102,7 +102,7 @@ function _renderAutoComplete() {
|
|
|
102
102
|
var object = (0, _publicData.bindingToTerm)(binding.subject);
|
|
103
103
|
var nameTerm = (0, _publicData.bindingToTerm)(binding.name);
|
|
104
104
|
row.addEventListener('click', /*#__PURE__*/function () {
|
|
105
|
-
var _ref = (0, _asyncToGenerator2["default"])(
|
|
105
|
+
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6(_event) {
|
|
106
106
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
107
107
|
while (1) switch (_context6.prev = _context6.next) {
|
|
108
108
|
case 0:
|
|
@@ -203,7 +203,7 @@ function _renderAutoComplete() {
|
|
|
203
203
|
});
|
|
204
204
|
};
|
|
205
205
|
_loadBindingsAndFilterByLanguage = function _loadBindingsAndFilte2() {
|
|
206
|
-
_loadBindingsAndFilterByLanguage = (0, _asyncToGenerator2["default"])(
|
|
206
|
+
_loadBindingsAndFilterByLanguage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(filter, languagePrefs) {
|
|
207
207
|
var bindings, slimmed;
|
|
208
208
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
209
209
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -243,7 +243,7 @@ function _renderAutoComplete() {
|
|
|
243
243
|
return _loadBindingsAndFilterByLanguage.apply(this, arguments);
|
|
244
244
|
};
|
|
245
245
|
_inputEventHHandler = function _inputEventHHandler3() {
|
|
246
|
-
_inputEventHHandler = (0, _asyncToGenerator2["default"])(
|
|
246
|
+
_inputEventHHandler = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(_event) {
|
|
247
247
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
248
248
|
while (1) switch (_context4.prev = _context4.next) {
|
|
249
249
|
case 0:
|
|
@@ -281,7 +281,7 @@ function _renderAutoComplete() {
|
|
|
281
281
|
return true;
|
|
282
282
|
};
|
|
283
283
|
_cancelButtonHandler = function _cancelButtonHandler3() {
|
|
284
|
-
_cancelButtonHandler = (0, _asyncToGenerator2["default"])(
|
|
284
|
+
_cancelButtonHandler = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(_event) {
|
|
285
285
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
286
286
|
while (1) switch (_context3.prev = _context3.next) {
|
|
287
287
|
case 0:
|
|
@@ -305,7 +305,7 @@ function _renderAutoComplete() {
|
|
|
305
305
|
return _cancelButtonHandler.apply(this, arguments);
|
|
306
306
|
};
|
|
307
307
|
_acceptButtonHandler = function _acceptButtonHandler3() {
|
|
308
|
-
_acceptButtonHandler = (0, _asyncToGenerator2["default"])(
|
|
308
|
+
_acceptButtonHandler = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(_event) {
|
|
309
309
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
310
310
|
while (1) switch (_context2.prev = _context2.next) {
|
|
311
311
|
case 0:
|
|
@@ -325,7 +325,7 @@ function _renderAutoComplete() {
|
|
|
325
325
|
return _acceptButtonHandler.apply(this, arguments);
|
|
326
326
|
};
|
|
327
327
|
_gotIt = function _gotIt3() {
|
|
328
|
-
_gotIt = (0, _asyncToGenerator2["default"])(
|
|
328
|
+
_gotIt = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(object, name) {
|
|
329
329
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
330
330
|
while (1) switch (_context.prev = _context.next) {
|
|
331
331
|
case 0:
|