solid-ui 2.4.23 → 2.4.24
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 +2159 -5039
- package/dist/main.js.map +1 -1
- package/lib/acl/access-controller.js +4 -67
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.js +59 -137
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.js +14 -54
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.js +32 -107
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.js +0 -92
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/acl/index.js +1 -3
- package/lib/acl/index.js.map +1 -1
- package/lib/acl/styles.js +1 -2
- package/lib/acl/styles.js.map +1 -1
- package/lib/chat/bookmarks.js +8 -80
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +109 -180
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js +6 -91
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +33 -185
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/message.js +37 -150
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +23 -96
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/thread.js +33 -91
- package/lib/chat/thread.js.map +1 -1
- package/lib/create/create.js +19 -51
- package/lib/create/create.js.map +1 -1
- package/lib/create/index.js +0 -2
- package/lib/create/index.js.map +1 -1
- package/lib/debug.js +0 -8
- package/lib/debug.js.map +1 -1
- package/lib/folders.js +4 -27
- package/lib/folders.js.map +1 -1
- package/lib/footer/index.js +2 -24
- package/lib/footer/index.js.map +1 -1
- package/lib/footer/styleMap.js.map +1 -1
- package/lib/header/empty-profile.js.map +1 -1
- package/lib/header/index.js +3 -72
- package/lib/header/index.js.map +1 -1
- package/lib/header/styleMap.js +4 -3
- package/lib/header/styleMap.js.map +1 -1
- package/lib/iconBase.js +3 -4
- package/lib/iconBase.js.map +1 -1
- package/lib/index.js +5 -46
- package/lib/index.js.map +1 -1
- package/lib/jss/index.js +3 -9
- package/lib/jss/index.js.map +1 -1
- package/lib/log.js +15 -51
- package/lib/log.js.map +1 -1
- package/lib/login/login.js +74 -303
- package/lib/login/login.js.map +1 -1
- package/lib/matrix/index.js +0 -2
- package/lib/matrix/index.js.map +1 -1
- package/lib/matrix/matrix.js +7 -55
- package/lib/matrix/matrix.js.map +1 -1
- package/lib/media/index.js +0 -2
- package/lib/media/index.js.map +1 -1
- package/lib/media/media-capture.js +13 -33
- package/lib/media/media-capture.js.map +1 -1
- package/lib/messageArea.js +23 -64
- package/lib/messageArea.js.map +1 -1
- package/lib/noun_Camera_1618446_000000.js.map +1 -1
- package/lib/ns.js +5 -7
- package/lib/ns.js.map +1 -1
- package/lib/pad.js +48 -234
- package/lib/pad.js.map +1 -1
- package/lib/participation.js +10 -65
- package/lib/participation.js.map +1 -1
- package/lib/preferences.js +21 -42
- package/lib/preferences.js.map +1 -1
- package/lib/signup/config-default.js +1 -8
- package/lib/signup/config-default.js.map +1 -1
- package/lib/signup/signup.js +6 -13
- package/lib/signup/signup.js.map +1 -1
- package/lib/stories/decorators.js +0 -2
- package/lib/stories/decorators.js.map +1 -1
- package/lib/style.js +8 -5
- package/lib/style.js.map +1 -1
- package/lib/style_multiSelect.js +1 -5
- package/lib/style_multiSelect.js.map +1 -1
- package/lib/table.js +309 -322
- package/lib/table.js.map +1 -1
- package/lib/tabs.js +20 -100
- package/lib/tabs.js.map +1 -1
- package/lib/utils/headerFooterHelpers.js +4 -52
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/utils/index.js +41 -135
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/label.js +13 -34
- package/lib/utils/label.js.map +1 -1
- package/lib/versionInfo.js +4 -4
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/buttons/iconLinks.js +0 -8
- package/lib/widgets/buttons/iconLinks.js.map +1 -1
- package/lib/widgets/buttons.js +115 -291
- package/lib/widgets/buttons.js.map +1 -1
- package/lib/widgets/dragAndDrop.js +12 -41
- package/lib/widgets/dragAndDrop.js.map +1 -1
- package/lib/widgets/error.js +3 -9
- package/lib/widgets/error.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +8 -71
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.js +13 -65
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +15 -107
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +6 -55
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.js +12 -131
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/lib/widgets/forms/basic.js +12 -55
- package/lib/widgets/forms/basic.js.map +1 -1
- package/lib/widgets/forms/comment.js +1 -15
- package/lib/widgets/forms/comment.js.map +1 -1
- package/lib/widgets/forms/fieldFunction.js +3 -16
- package/lib/widgets/forms/fieldFunction.js.map +1 -1
- package/lib/widgets/forms/fieldParams.js +0 -12
- package/lib/widgets/forms/fieldParams.js.map +1 -1
- package/lib/widgets/forms/formStyle.js +1 -14
- package/lib/widgets/forms/formStyle.js.map +1 -1
- package/lib/widgets/forms.js +70 -474
- package/lib/widgets/forms.js.map +1 -1
- package/lib/widgets/index.js +0 -21
- package/lib/widgets/index.js.map +1 -1
- package/lib/widgets/multiSelect.js +48 -171
- package/lib/widgets/multiSelect.js.map +1 -1
- package/lib/widgets/peoplePicker.js +20 -90
- package/lib/widgets/peoplePicker.js.map +1 -1
- package/lib/widgets/widgetHelpers.js +2 -9
- package/lib/widgets/widgetHelpers.js.map +1 -1
- package/package.json +28 -28
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment.js","names":["store","solidLogicSingleton","commentField","dom","container","already","subject","form","_doc","_callbackFunction","kb","contents","any","ns","ui","uri","mostSpecificClassURI","params","fieldParams","undefined","box","createElement","appendChild","p","element","textContent","style","setAttribute"],"sources":["../../../src/widgets/forms/comment.ts"],"sourcesContent":["import { solidLogicSingleton } from 'solid-logic'\nimport * as ns from '../../ns'\nimport { mostSpecificClassURI } from './fieldFunction'\nimport { fieldParams } from './fieldParams'\n\nconst store = solidLogicSingleton.store\n\n/**\n * A [[FieldFunction]] for a simple comment box. It will look for\n * the first (form, ns.ui('contents'), ?) triple it can find in\n * store and use the value of the object of that triple as\n * the comment text.\n *\n * @param dom The DOM\n * @param container If set, the result will be appended to it as a child\n * @param already Unused\n * @param subject Unused\n * @param form RDF node with `ns.ui('contents')` attribute\n * @param _doc Unused\n * @param _callbackFunction Unused\n *\n * @returns a DOM element containing the comment.\n */\nexport function commentField (\n dom: HTMLDocument,\n container: HTMLElement | undefined,\n already: any,\n subject: any,\n form,\n _doc,\n _callbackFunction\n) {\n const kb = store\n let contents: any = kb.any(form, ns.ui('contents'))\n if (!contents) {\n contents = 'Error: No contents in comment field.'\n }\n const uri = mostSpecificClassURI(form)\n let params = fieldParams[uri]\n if (params === undefined) {\n params = {}\n } // non-bottom field types can do this\n\n const box = dom.createElement('div')\n if (container) container.appendChild(box)\n const p = box.appendChild(dom.createElement(params.element || 'p'))\n p.textContent = contents\n\n let style: any = kb.any(form, ns.ui('style'))\n if (style === undefined) {\n style = params.style ? params.style : ''\n }\n if (style) p.setAttribute('style', style as any)\n\n return box\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"comment.js","names":["store","solidLogicSingleton","commentField","dom","container","already","subject","form","_doc","_callbackFunction","kb","contents","any","ns","ui","uri","mostSpecificClassURI","params","fieldParams","undefined","box","createElement","appendChild","p","element","textContent","style","setAttribute"],"sources":["../../../src/widgets/forms/comment.ts"],"sourcesContent":["import { solidLogicSingleton } from 'solid-logic'\nimport * as ns from '../../ns'\nimport { mostSpecificClassURI } from './fieldFunction'\nimport { fieldParams } from './fieldParams'\n\nconst store = solidLogicSingleton.store\n\n/**\n * A [[FieldFunction]] for a simple comment box. It will look for\n * the first (form, ns.ui('contents'), ?) triple it can find in\n * store and use the value of the object of that triple as\n * the comment text.\n *\n * @param dom The DOM\n * @param container If set, the result will be appended to it as a child\n * @param already Unused\n * @param subject Unused\n * @param form RDF node with `ns.ui('contents')` attribute\n * @param _doc Unused\n * @param _callbackFunction Unused\n *\n * @returns a DOM element containing the comment.\n */\nexport function commentField (\n dom: HTMLDocument,\n container: HTMLElement | undefined,\n already: any,\n subject: any,\n form,\n _doc,\n _callbackFunction\n) {\n const kb = store\n let contents: any = kb.any(form, ns.ui('contents'))\n if (!contents) {\n contents = 'Error: No contents in comment field.'\n }\n const uri = mostSpecificClassURI(form)\n let params = fieldParams[uri]\n if (params === undefined) {\n params = {}\n } // non-bottom field types can do this\n\n const box = dom.createElement('div')\n if (container) container.appendChild(box)\n const p = box.appendChild(dom.createElement(params.element || 'p'))\n p.textContent = contents\n\n let style: any = kb.any(form, ns.ui('style'))\n if (style === undefined) {\n style = params.style ? params.style : ''\n }\n if (style) p.setAttribute('style', style as any)\n\n return box\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AAA2C;AAAA;AAE3C,IAAMA,KAAK,GAAGC,+BAAmB,CAACD,KAAK;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,YAAY,CAC1BC,GAAiB,EACjBC,SAAkC,EAClCC,OAAY,EACZC,OAAY,EACZC,IAAI,EACJC,IAAI,EACJC,iBAAiB,EACjB;EACA,IAAMC,EAAE,GAAGV,KAAK;EAChB,IAAIW,QAAa,GAAGD,EAAE,CAACE,GAAG,CAACL,IAAI,EAAEM,EAAE,CAACC,EAAE,CAAC,UAAU,CAAC,CAAC;EACnD,IAAI,CAACH,QAAQ,EAAE;IACbA,QAAQ,GAAG,sCAAsC;EACnD;EACA,IAAMI,GAAG,GAAG,IAAAC,mCAAoB,EAACT,IAAI,CAAC;EACtC,IAAIU,MAAM,GAAGC,wBAAW,CAACH,GAAG,CAAC;EAC7B,IAAIE,MAAM,KAAKE,SAAS,EAAE;IACxBF,MAAM,GAAG,CAAC,CAAC;EACb,CAAC,CAAC;;EAEF,IAAMG,GAAG,GAAGjB,GAAG,CAACkB,aAAa,CAAC,KAAK,CAAC;EACpC,IAAIjB,SAAS,EAAEA,SAAS,CAACkB,WAAW,CAACF,GAAG,CAAC;EACzC,IAAMG,CAAC,GAAGH,GAAG,CAACE,WAAW,CAACnB,GAAG,CAACkB,aAAa,CAACJ,MAAM,CAACO,OAAO,IAAI,GAAG,CAAC,CAAC;EACnED,CAAC,CAACE,WAAW,GAAGd,QAAQ;EAExB,IAAIe,KAAU,GAAGhB,EAAE,CAACE,GAAG,CAACL,IAAI,EAAEM,EAAE,CAACC,EAAE,CAAC,OAAO,CAAC,CAAC;EAC7C,IAAIY,KAAK,KAAKP,SAAS,EAAE;IACvBO,KAAK,GAAGT,MAAM,CAACS,KAAK,GAAGT,MAAM,CAACS,KAAK,GAAG,EAAE;EAC1C;EACA,IAAIA,KAAK,EAAEH,CAAC,CAACI,YAAY,CAAC,OAAO,EAAED,KAAK,CAAQ;EAEhD,OAAON,GAAG;AACZ"}
|
|
@@ -6,13 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.field = void 0;
|
|
7
7
|
exports.fieldFunction = fieldFunction;
|
|
8
8
|
exports.mostSpecificClassURI = mostSpecificClassURI;
|
|
9
|
-
|
|
10
9
|
var _solidLogic = require("solid-logic");
|
|
11
|
-
|
|
12
10
|
var _log = require("../../log");
|
|
13
|
-
|
|
14
11
|
var _error = require("../error");
|
|
15
|
-
|
|
16
12
|
var store = _solidLogic.solidLogicSingleton.store;
|
|
17
13
|
var field = {}; // Form field functions by URI of field type.
|
|
18
14
|
|
|
@@ -24,37 +20,29 @@ var field = {}; // Form field functions by URI of field type.
|
|
|
24
20
|
* @param x a form field, e.g. `namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#fullNameField')`
|
|
25
21
|
* @returns the URI of the most specific known class, e.g. `http://www.w3.org/ns/ui#SingleLineTextField`
|
|
26
22
|
*/
|
|
27
|
-
|
|
28
23
|
exports.field = field;
|
|
29
|
-
|
|
30
24
|
function mostSpecificClassURI(x) {
|
|
31
25
|
var kb = store;
|
|
32
26
|
var ft = kb.findTypeURIs(x);
|
|
33
27
|
var bot = kb.bottomTypeURIs(ft); // most specific
|
|
34
|
-
|
|
35
28
|
var bots = [];
|
|
36
|
-
|
|
37
29
|
for (var b in bot) {
|
|
38
30
|
bots.push(b);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
}
|
|
32
|
+
// if (bots.length > 1) throw "Didn't expect "+x+" to have multiple bottom types: "+bots
|
|
42
33
|
return bots[0];
|
|
43
34
|
}
|
|
35
|
+
|
|
44
36
|
/**
|
|
45
37
|
* Returns a function that creates a form widget
|
|
46
38
|
* @param dom unused
|
|
47
39
|
* @param fieldInQuestion the field for which to create a form, e.g. namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#fullNameField')
|
|
48
40
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
41
|
function fieldFunction(dom, fieldInQuestion) {
|
|
52
42
|
var uri = mostSpecificClassURI(fieldInQuestion); // What type
|
|
53
43
|
// const uri = field.uri
|
|
54
|
-
|
|
55
44
|
var fun = field[uri];
|
|
56
45
|
(0, _log.debug)('paneUtils: Going to implement field ' + fieldInQuestion + ' of type ' + uri);
|
|
57
|
-
|
|
58
46
|
if (!fun) {
|
|
59
47
|
return function (dom2, container) {
|
|
60
48
|
var box = (0, _error.errorMessageBlock)(dom2, 'No handler for field ' + fieldInQuestion + ' of type ' + uri);
|
|
@@ -62,7 +50,6 @@ function fieldFunction(dom, fieldInQuestion) {
|
|
|
62
50
|
return box;
|
|
63
51
|
};
|
|
64
52
|
}
|
|
65
|
-
|
|
66
53
|
return fun;
|
|
67
54
|
}
|
|
68
55
|
//# sourceMappingURL=fieldFunction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldFunction.js","names":["store","solidLogicSingleton","field","mostSpecificClassURI","x","kb","ft","findTypeURIs","bot","bottomTypeURIs","bots","b","push","fieldFunction","dom","fieldInQuestion","uri","fun","debug","dom2","container","box","errorMessageBlock","appendChild"],"sources":["../../../src/widgets/forms/fieldFunction.ts"],"sourcesContent":["import { Node } from 'rdflib'\nimport { solidLogicSingleton } from 'solid-logic'\nimport { debug } from '../../log'\nimport { errorMessageBlock } from '../error'\n\nconst store = solidLogicSingleton.store\n\nexport type FieldFunction = (\n dom: HTMLDocument, // the DOM\n container: HTMLElement | undefined, // if defined, the box will be appended to it\n already: { }, // used to avoid looping in nested forms\n subject: Node, // the thing for which data will be loaded into the form element\n form: Node, // the RDF declaration for what the form should have\n doc: Node, // the online RDF document for data binding (form input values will be read/saved automatically)\n callbackFunction: (ok: boolean, errorMessage: string) => void // this will be called when data changes (TODO: check this with unit tests)\n) => HTMLElement\n\nexport const field: { [classUri: string]: FieldFunction } = {} // Form field functions by URI of field type.\n\n/**\n * Which class of field is this? Relies on http://www.w3.org/2000/01/rdf-schema#subClassOf and\n * https://linkeddata.github.io/rdflib.js/doc/classes/formula.html#bottomtypeuris\n * to find the most specific RDF type if there are multiple.\n *\n * @param x a form field, e.g. `namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#fullNameField')`\n * @returns the URI of the most specific known class, e.g. `http://www.w3.org/ns/ui#SingleLineTextField`\n */\nexport function mostSpecificClassURI (x: Node): string {\n const kb = store\n const ft = kb.findTypeURIs(x as any)\n const bot = kb.bottomTypeURIs(ft) // most specific\n const bots: any[] = []\n for (const b in bot) bots.push(b)\n // if (bots.length > 1) throw \"Didn't expect \"+x+\" to have multiple bottom types: \"+bots\n return bots[0]\n}\n\n/**\n * Returns a function that creates a form widget\n * @param dom unused\n * @param fieldInQuestion the field for which to create a form, e.g. namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#fullNameField')\n */\nexport function fieldFunction (dom: any /* unused */, fieldInQuestion: Node): FieldFunction {\n const uri = mostSpecificClassURI(fieldInQuestion) // What type\n // const uri = field.uri\n const fun = field[uri]\n debug(\n 'paneUtils: Going to implement field ' + fieldInQuestion + ' of type ' + uri\n )\n if (!fun) {\n return function (dom2: HTMLDocument, container?: HTMLElement): HTMLElement {\n const box = errorMessageBlock(\n dom2,\n 'No handler for field ' + fieldInQuestion + ' of type ' + uri\n )\n if (container) container.appendChild(box)\n\n return box\n }\n }\n return fun\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"fieldFunction.js","names":["store","solidLogicSingleton","field","mostSpecificClassURI","x","kb","ft","findTypeURIs","bot","bottomTypeURIs","bots","b","push","fieldFunction","dom","fieldInQuestion","uri","fun","debug","dom2","container","box","errorMessageBlock","appendChild"],"sources":["../../../src/widgets/forms/fieldFunction.ts"],"sourcesContent":["import { Node } from 'rdflib'\nimport { solidLogicSingleton } from 'solid-logic'\nimport { debug } from '../../log'\nimport { errorMessageBlock } from '../error'\n\nconst store = solidLogicSingleton.store\n\nexport type FieldFunction = (\n dom: HTMLDocument, // the DOM\n container: HTMLElement | undefined, // if defined, the box will be appended to it\n already: { }, // used to avoid looping in nested forms\n subject: Node, // the thing for which data will be loaded into the form element\n form: Node, // the RDF declaration for what the form should have\n doc: Node, // the online RDF document for data binding (form input values will be read/saved automatically)\n callbackFunction: (ok: boolean, errorMessage: string) => void // this will be called when data changes (TODO: check this with unit tests)\n) => HTMLElement\n\nexport const field: { [classUri: string]: FieldFunction } = {} // Form field functions by URI of field type.\n\n/**\n * Which class of field is this? Relies on http://www.w3.org/2000/01/rdf-schema#subClassOf and\n * https://linkeddata.github.io/rdflib.js/doc/classes/formula.html#bottomtypeuris\n * to find the most specific RDF type if there are multiple.\n *\n * @param x a form field, e.g. `namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#fullNameField')`\n * @returns the URI of the most specific known class, e.g. `http://www.w3.org/ns/ui#SingleLineTextField`\n */\nexport function mostSpecificClassURI (x: Node): string {\n const kb = store\n const ft = kb.findTypeURIs(x as any)\n const bot = kb.bottomTypeURIs(ft) // most specific\n const bots: any[] = []\n for (const b in bot) bots.push(b)\n // if (bots.length > 1) throw \"Didn't expect \"+x+\" to have multiple bottom types: \"+bots\n return bots[0]\n}\n\n/**\n * Returns a function that creates a form widget\n * @param dom unused\n * @param fieldInQuestion the field for which to create a form, e.g. namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#fullNameField')\n */\nexport function fieldFunction (dom: any /* unused */, fieldInQuestion: Node): FieldFunction {\n const uri = mostSpecificClassURI(fieldInQuestion) // What type\n // const uri = field.uri\n const fun = field[uri]\n debug(\n 'paneUtils: Going to implement field ' + fieldInQuestion + ' of type ' + uri\n )\n if (!fun) {\n return function (dom2: HTMLDocument, container?: HTMLElement): HTMLElement {\n const box = errorMessageBlock(\n dom2,\n 'No handler for field ' + fieldInQuestion + ' of type ' + uri\n )\n if (container) container.appendChild(box)\n\n return box\n }\n }\n return fun\n}\n"],"mappings":";;;;;;;;AACA;AACA;AACA;AAEA,IAAMA,KAAK,GAAGC,+BAAmB,CAACD,KAAK;AAYhC,IAAME,KAA4C,GAAG,CAAC,CAAC,EAAC;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA;AAQO,SAASC,oBAAoB,CAAEC,CAAO,EAAU;EACrD,IAAMC,EAAE,GAAGL,KAAK;EAChB,IAAMM,EAAE,GAAGD,EAAE,CAACE,YAAY,CAACH,CAAC,CAAQ;EACpC,IAAMI,GAAG,GAAGH,EAAE,CAACI,cAAc,CAACH,EAAE,CAAC,EAAC;EAClC,IAAMI,IAAW,GAAG,EAAE;EACtB,KAAK,IAAMC,CAAC,IAAIH,GAAG;IAAEE,IAAI,CAACE,IAAI,CAACD,CAAC,CAAC;EAAA;EACjC;EACA,OAAOD,IAAI,CAAC,CAAC,CAAC;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASG,aAAa,CAAEC,GAAQ,EAAeC,eAAqB,EAAiB;EAC1F,IAAMC,GAAG,GAAGb,oBAAoB,CAACY,eAAe,CAAC,EAAC;EAClD;EACA,IAAME,GAAG,GAAGf,KAAK,CAACc,GAAG,CAAC;EACtB,IAAAE,UAAK,EACH,sCAAsC,GAAGH,eAAe,GAAG,WAAW,GAAGC,GAAG,CAC7E;EACD,IAAI,CAACC,GAAG,EAAE;IACR,OAAO,UAAUE,IAAkB,EAAEC,SAAuB,EAAe;MACzE,IAAMC,GAAG,GAAG,IAAAC,wBAAiB,EAC3BH,IAAI,EACJ,uBAAuB,GAAGJ,eAAe,GAAG,WAAW,GAAGC,GAAG,CAC9D;MACD,IAAII,SAAS,EAAEA,SAAS,CAACG,WAAW,CAACF,GAAG,CAAC;MAEzC,OAAOA,GAAG;IACZ,CAAC;EACH;EACA,OAAOJ,GAAG;AACZ"}
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.fieldParams = void 0;
|
|
11
|
-
|
|
12
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
10
|
var ns = _interopRequireWildcard(require("../../ns"));
|
|
15
|
-
|
|
16
11
|
var _style = require("../../style");
|
|
17
|
-
|
|
18
12
|
var _fieldParams;
|
|
19
|
-
|
|
20
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
15
|
/**
|
|
25
16
|
* The fieldParams object defines various constants
|
|
26
17
|
* for use in various form fields. Depending on the
|
|
@@ -75,17 +66,14 @@ var fieldParams = (_fieldParams = {}, (0, _defineProperty2["default"])(_fieldPar
|
|
|
75
66
|
size: 30,
|
|
76
67
|
uriPrefix: 'mailto:',
|
|
77
68
|
pattern: /^\s*.*@.*\..*\s*$/ // @@ Get the right regexp here
|
|
78
|
-
|
|
79
69
|
}), (0, _defineProperty2["default"])(_fieldParams, ns.ui('Group').uri, {
|
|
80
70
|
style: _style.formGroupStyle
|
|
81
71
|
}), (0, _defineProperty2["default"])(_fieldParams, ns.ui('Comment').uri, {
|
|
82
72
|
element: 'p',
|
|
83
73
|
style: _style.commentStyle // was `padding: 0.1em 1.5em; color: ${formHeadingColor}; white-space: pre-wrap;`
|
|
84
|
-
|
|
85
74
|
}), (0, _defineProperty2["default"])(_fieldParams, ns.ui('Heading').uri, {
|
|
86
75
|
element: 'h3',
|
|
87
76
|
style: _style.formHeadingStyle // was: `font-size: 110%; font-weight: bold; color: ${formHeadingColor}; padding: 0.2em;`
|
|
88
|
-
|
|
89
77
|
}), _fieldParams);
|
|
90
78
|
exports.fieldParams = fieldParams;
|
|
91
79
|
//# sourceMappingURL=fieldParams.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldParams.js","names":["fieldParams","ns","ui","uri","size","type","style","dt","pattern","namedNode","uriPrefix","formGroupStyle","element","commentStyle","formHeadingStyle"],"sources":["../../../src/widgets/forms/fieldParams.ts"],"sourcesContent":["import * as ns from '../../ns'\nimport { commentStyle, formHeadingStyle, formGroupStyle } from '../../style'\n\nexport type FieldParamsObject = {\n size?: number, // input element size attribute\n type?: string, // input element type attribute. Default: 'text' (not for Comment and Heading)\n element?: string, // element type to use (Comment and Heading only)\n style?: string, // style to use\n dt?: string, // xsd data type for the RDF Literal corresponding to the field value. Default: xsd:string\n uriPrefix?: string, // e.g. 'mailto:', will be removed when displaying value to user. Overrides dt.\n namedNode?: boolean, // if true, field value corresponds to the URI of an RDF NamedNode. Overrides dt and uriPrefix.\n pattern?: RegExp // for client-side input validation; field will go red if violated, green if ok\n}\n\n/**\n * The fieldParams object defines various constants\n * for use in various form fields. Depending on the\n * field in questions, different values may be read\n * from here.\n */\nexport const fieldParams: { [ fieldUri: string ]: FieldParamsObject } = {\n /**\n * Text field\n *\n * For possible date popups see e.g. http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm\n * or use HTML5: http://www.w3.org/TR/2011/WD-html-markup-20110113/input.date.html\n */\n [ns.ui('ColorField').uri]: {\n size: 9,\n type: 'color',\n style: 'height: 3em;', // around 1.5em is padding\n dt: 'color',\n pattern: /^\\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\\s*$/\n }, // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color\n\n [ns.ui('DateField').uri]: {\n size: 20,\n type: 'date',\n dt: 'date',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\\s*$/\n },\n\n [ns.ui('DateTimeField').uri]: {\n size: 20,\n type: 'datetime-local', // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime\n dt: 'dateTime',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\\s*$/\n },\n\n [ns.ui('TimeField').uri]: {\n size: 10,\n type: 'time',\n dt: 'time',\n pattern: /^\\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\\s*$/\n },\n\n [ns.ui('IntegerField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'integer',\n pattern: /^\\s*-?[0-9]+\\s*$/\n },\n\n [ns.ui('DecimalField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'decimal',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?\\s*$/\n },\n\n [ns.ui('FloatField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'float',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?((e|E)-?[0-9]*)?\\s*$/\n },\n\n [ns.ui('SingleLineTextField').uri]: {\n\n },\n [ns.ui('NamedNodeURIField').uri]: {\n namedNode: true\n },\n [ns.ui('TextField').uri]: {\n\n },\n\n [ns.ui('PhoneField').uri]: {\n size: 20,\n uriPrefix: 'tel:',\n pattern: /^\\+?[\\d-]+[\\d]*$/\n },\n\n [ns.ui('EmailField').uri]: {\n size: 30,\n uriPrefix: 'mailto:',\n pattern: /^\\s*.*@.*\\..*\\s*$/ // @@ Get the right regexp here\n },\n\n [ns.ui('Group').uri]: {\n style: formGroupStyle\n },\n\n /**\n * Non-interactive fields\n */\n [ns.ui('Comment').uri]: {\n element: 'p',\n style: commentStyle // was `padding: 0.1em 1.5em; color: ${formHeadingColor}; white-space: pre-wrap;`\n },\n [ns.ui('Heading').uri]: {\n element: 'h3',\n style: formHeadingStyle // was: `font-size: 110%; font-weight: bold; color: ${formHeadingColor}; padding: 0.2em;`\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"fieldParams.js","names":["fieldParams","ns","ui","uri","size","type","style","dt","pattern","namedNode","uriPrefix","formGroupStyle","element","commentStyle","formHeadingStyle"],"sources":["../../../src/widgets/forms/fieldParams.ts"],"sourcesContent":["import * as ns from '../../ns'\nimport { commentStyle, formHeadingStyle, formGroupStyle } from '../../style'\n\nexport type FieldParamsObject = {\n size?: number, // input element size attribute\n type?: string, // input element type attribute. Default: 'text' (not for Comment and Heading)\n element?: string, // element type to use (Comment and Heading only)\n style?: string, // style to use\n dt?: string, // xsd data type for the RDF Literal corresponding to the field value. Default: xsd:string\n uriPrefix?: string, // e.g. 'mailto:', will be removed when displaying value to user. Overrides dt.\n namedNode?: boolean, // if true, field value corresponds to the URI of an RDF NamedNode. Overrides dt and uriPrefix.\n pattern?: RegExp // for client-side input validation; field will go red if violated, green if ok\n}\n\n/**\n * The fieldParams object defines various constants\n * for use in various form fields. Depending on the\n * field in questions, different values may be read\n * from here.\n */\nexport const fieldParams: { [ fieldUri: string ]: FieldParamsObject } = {\n /**\n * Text field\n *\n * For possible date popups see e.g. http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm\n * or use HTML5: http://www.w3.org/TR/2011/WD-html-markup-20110113/input.date.html\n */\n [ns.ui('ColorField').uri]: {\n size: 9,\n type: 'color',\n style: 'height: 3em;', // around 1.5em is padding\n dt: 'color',\n pattern: /^\\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\\s*$/\n }, // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color\n\n [ns.ui('DateField').uri]: {\n size: 20,\n type: 'date',\n dt: 'date',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\\s*$/\n },\n\n [ns.ui('DateTimeField').uri]: {\n size: 20,\n type: 'datetime-local', // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime\n dt: 'dateTime',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\\s*$/\n },\n\n [ns.ui('TimeField').uri]: {\n size: 10,\n type: 'time',\n dt: 'time',\n pattern: /^\\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\\s*$/\n },\n\n [ns.ui('IntegerField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'integer',\n pattern: /^\\s*-?[0-9]+\\s*$/\n },\n\n [ns.ui('DecimalField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'decimal',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?\\s*$/\n },\n\n [ns.ui('FloatField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'float',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?((e|E)-?[0-9]*)?\\s*$/\n },\n\n [ns.ui('SingleLineTextField').uri]: {\n\n },\n [ns.ui('NamedNodeURIField').uri]: {\n namedNode: true\n },\n [ns.ui('TextField').uri]: {\n\n },\n\n [ns.ui('PhoneField').uri]: {\n size: 20,\n uriPrefix: 'tel:',\n pattern: /^\\+?[\\d-]+[\\d]*$/\n },\n\n [ns.ui('EmailField').uri]: {\n size: 30,\n uriPrefix: 'mailto:',\n pattern: /^\\s*.*@.*\\..*\\s*$/ // @@ Get the right regexp here\n },\n\n [ns.ui('Group').uri]: {\n style: formGroupStyle\n },\n\n /**\n * Non-interactive fields\n */\n [ns.ui('Comment').uri]: {\n element: 'p',\n style: commentStyle // was `padding: 0.1em 1.5em; color: ${formHeadingColor}; white-space: pre-wrap;`\n },\n [ns.ui('Heading').uri]: {\n element: 'h3',\n style: formHeadingStyle // was: `font-size: 110%; font-weight: bold; color: ${formHeadingColor}; padding: 0.2em;`\n }\n}\n"],"mappings":";;;;;;;;;AAAA;AACA;AAA4E;AAAA;AAAA;AAa5E;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,WAAwD,sEAOlEC,EAAE,CAACC,EAAE,CAAC,YAAY,CAAC,CAACC,GAAG,EAAG;EACzBC,IAAI,EAAE,CAAC;EACPC,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,cAAc;EAAE;EACvBC,EAAE,EAAE,OAAO;EACXC,OAAO,EAAE;AACX,CAAC,kDAEAP,EAAE,CAACC,EAAE,CAAC,WAAW,CAAC,CAACC,GAAG,EAAG;EACxBC,IAAI,EAAE,EAAE;EACRC,IAAI,EAAE,MAAM;EACZE,EAAE,EAAE,MAAM;EACVC,OAAO,EAAE;AACX,CAAC,kDAEAP,EAAE,CAACC,EAAE,CAAC,eAAe,CAAC,CAACC,GAAG,EAAG;EAC5BC,IAAI,EAAE,EAAE;EACRC,IAAI,EAAE,gBAAgB;EAAE;EACxBE,EAAE,EAAE,UAAU;EACdC,OAAO,EAAE;AACX,CAAC,kDAEAP,EAAE,CAACC,EAAE,CAAC,WAAW,CAAC,CAACC,GAAG,EAAG;EACxBC,IAAI,EAAE,EAAE;EACRC,IAAI,EAAE,MAAM;EACZE,EAAE,EAAE,MAAM;EACVC,OAAO,EAAE;AACX,CAAC,kDAEAP,EAAE,CAACC,EAAE,CAAC,cAAc,CAAC,CAACC,GAAG,EAAG;EAC3BC,IAAI,EAAE,EAAE;EACRE,KAAK,EAAE,oBAAoB;EAC3BC,EAAE,EAAE,SAAS;EACbC,OAAO,EAAE;AACX,CAAC,kDAEAP,EAAE,CAACC,EAAE,CAAC,cAAc,CAAC,CAACC,GAAG,EAAG;EAC3BC,IAAI,EAAE,EAAE;EACRE,KAAK,EAAE,oBAAoB;EAC3BC,EAAE,EAAE,SAAS;EACbC,OAAO,EAAE;AACX,CAAC,kDAEAP,EAAE,CAACC,EAAE,CAAC,YAAY,CAAC,CAACC,GAAG,EAAG;EACzBC,IAAI,EAAE,EAAE;EACRE,KAAK,EAAE,oBAAoB;EAC3BC,EAAE,EAAE,OAAO;EACXC,OAAO,EAAE;AACX,CAAC,kDAEAP,EAAE,CAACC,EAAE,CAAC,qBAAqB,CAAC,CAACC,GAAG,EAAG,CAEpC,CAAC,kDACAF,EAAE,CAACC,EAAE,CAAC,mBAAmB,CAAC,CAACC,GAAG,EAAG;EAChCM,SAAS,EAAE;AACb,CAAC,kDACAR,EAAE,CAACC,EAAE,CAAC,WAAW,CAAC,CAACC,GAAG,EAAG,CAE1B,CAAC,kDAEAF,EAAE,CAACC,EAAE,CAAC,YAAY,CAAC,CAACC,GAAG,EAAG;EACzBC,IAAI,EAAE,EAAE;EACRM,SAAS,EAAE,MAAM;EACjBF,OAAO,EAAE;AACX,CAAC,kDAEAP,EAAE,CAACC,EAAE,CAAC,YAAY,CAAC,CAACC,GAAG,EAAG;EACzBC,IAAI,EAAE,EAAE;EACRM,SAAS,EAAE,SAAS;EACpBF,OAAO,EAAE,mBAAmB,CAAC;AAC/B,CAAC,kDAEAP,EAAE,CAACC,EAAE,CAAC,OAAO,CAAC,CAACC,GAAG,EAAG;EACpBG,KAAK,EAAEK;AACT,CAAC,kDAKAV,EAAE,CAACC,EAAE,CAAC,SAAS,CAAC,CAACC,GAAG,EAAG;EACtBS,OAAO,EAAE,GAAG;EACZN,KAAK,EAAEO,mBAAY,CAAC;AACtB,CAAC,kDACAZ,EAAE,CAACC,EAAE,CAAC,SAAS,CAAC,CAACC,GAAG,EAAG;EACtBS,OAAO,EAAE,IAAI;EACbN,KAAK,EAAEQ,uBAAgB,CAAC;AAC1B,CAAC,gBACF;AAAA"}
|
|
@@ -1,50 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.setFieldStyle = setFieldStyle;
|
|
9
|
-
|
|
10
8
|
var ns = _interopRequireWildcard(require("../../ns"));
|
|
11
|
-
|
|
12
9
|
var _solidLogic = require("solid-logic");
|
|
13
|
-
|
|
14
10
|
var _fieldParams = require("./fieldParams");
|
|
15
|
-
|
|
16
11
|
var _fieldFunction = require("./fieldFunction");
|
|
17
|
-
|
|
18
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
13
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
14
|
var STYLE_URI_PREFIX = 'https://www.w3.org/ns/css#';
|
|
15
|
+
|
|
23
16
|
/* eslint-disable no-console */
|
|
24
17
|
|
|
25
18
|
function setFieldStyle(ele, field) {
|
|
26
19
|
var classUri = (0, _fieldFunction.mostSpecificClassURI)(field);
|
|
27
20
|
var params = _fieldParams.fieldParams[classUri] || {};
|
|
28
|
-
|
|
29
21
|
var style = _solidLogic.store.any(field, ns.ui('style'));
|
|
30
|
-
|
|
31
22
|
if (!style) {
|
|
32
23
|
if (params.style) {
|
|
33
24
|
ele.setAttribute('style', params.style);
|
|
34
25
|
}
|
|
35
|
-
|
|
36
26
|
return;
|
|
37
27
|
}
|
|
38
|
-
|
|
39
28
|
if (style.termType === 'Literal') {
|
|
40
29
|
if (style) ele.setAttribute('style', style.value);
|
|
41
30
|
} else {
|
|
42
31
|
var sts = _solidLogic.store.statementsMatching(style, null, null, field.doc());
|
|
43
|
-
|
|
44
32
|
sts.forEach(function (st) {
|
|
45
33
|
if (st.predicate.uri && st.predicate.uri.startsWith(STYLE_URI_PREFIX)) {
|
|
46
34
|
var cssAttribute = st.predicate.uri.slice(STYLE_URI_PREFIX.length);
|
|
47
|
-
|
|
48
35
|
try {
|
|
49
36
|
ele.style[cssAttribute] = st.object.value;
|
|
50
37
|
} catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formStyle.js","names":["STYLE_URI_PREFIX","setFieldStyle","ele","field","classUri","mostSpecificClassURI","params","fieldParams","style","store","any","ns","ui","setAttribute","termType","value","sts","statementsMatching","doc","forEach","st","predicate","uri","startsWith","cssAttribute","slice","length","object","err","console","warn","tagName"],"sources":["../../../src/widgets/forms/formStyle.ts"],"sourcesContent":["import * as ns from '../../ns'\nimport { Node } from 'rdflib'\nimport { store } from 'solid-logic'\nimport { fieldParams } from './fieldParams'\n\nimport { mostSpecificClassURI } from './fieldFunction'\n\nconst STYLE_URI_PREFIX = 'https://www.w3.org/ns/css#'\n\n/* eslint-disable no-console */\n\nexport function setFieldStyle (ele:HTMLElement, field:Node) {\n const classUri = mostSpecificClassURI(field)\n const params = fieldParams[classUri] || {}\n\n const style = store.any(field as any, ns.ui('style'))\n if (!style) {\n if (params.style) {\n ele.setAttribute('style', params.style)\n }\n return\n }\n if (style.termType === 'Literal') {\n if (style) ele.setAttribute('style', style.value)\n } else {\n const sts = store.statementsMatching(style as any, null, null, (field as any).doc())\n sts.forEach(st => {\n if (st.predicate.uri && st.predicate.uri.startsWith(STYLE_URI_PREFIX)) {\n const cssAttribute = st.predicate.uri.slice(STYLE_URI_PREFIX.length)\n try {\n ele.style[cssAttribute] = st.object.value\n } catch (err) {\n console.warn(`setFieldStyle: Error setting element style ${cssAttribute} to \"${st.object.value}\"`)\n console.warn(`setFieldStyle: ... Element tagName was \"${ele.tagName || '???'}\"`)\n }\n }\n })\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"formStyle.js","names":["STYLE_URI_PREFIX","setFieldStyle","ele","field","classUri","mostSpecificClassURI","params","fieldParams","style","store","any","ns","ui","setAttribute","termType","value","sts","statementsMatching","doc","forEach","st","predicate","uri","startsWith","cssAttribute","slice","length","object","err","console","warn","tagName"],"sources":["../../../src/widgets/forms/formStyle.ts"],"sourcesContent":["import * as ns from '../../ns'\nimport { Node } from 'rdflib'\nimport { store } from 'solid-logic'\nimport { fieldParams } from './fieldParams'\n\nimport { mostSpecificClassURI } from './fieldFunction'\n\nconst STYLE_URI_PREFIX = 'https://www.w3.org/ns/css#'\n\n/* eslint-disable no-console */\n\nexport function setFieldStyle (ele:HTMLElement, field:Node) {\n const classUri = mostSpecificClassURI(field)\n const params = fieldParams[classUri] || {}\n\n const style = store.any(field as any, ns.ui('style'))\n if (!style) {\n if (params.style) {\n ele.setAttribute('style', params.style)\n }\n return\n }\n if (style.termType === 'Literal') {\n if (style) ele.setAttribute('style', style.value)\n } else {\n const sts = store.statementsMatching(style as any, null, null, (field as any).doc())\n sts.forEach(st => {\n if (st.predicate.uri && st.predicate.uri.startsWith(STYLE_URI_PREFIX)) {\n const cssAttribute = st.predicate.uri.slice(STYLE_URI_PREFIX.length)\n try {\n ele.style[cssAttribute] = st.object.value\n } catch (err) {\n console.warn(`setFieldStyle: Error setting element style ${cssAttribute} to \"${st.object.value}\"`)\n console.warn(`setFieldStyle: ... Element tagName was \"${ele.tagName || '???'}\"`)\n }\n }\n })\n }\n}\n"],"mappings":";;;;;;;AAAA;AAEA;AACA;AAEA;AAAsD;AAAA;AAEtD,IAAMA,gBAAgB,GAAG,4BAA4B;;AAErD;;AAEO,SAASC,aAAa,CAAEC,GAAe,EAAEC,KAAU,EAAE;EAC1D,IAAMC,QAAQ,GAAG,IAAAC,mCAAoB,EAACF,KAAK,CAAC;EAC5C,IAAMG,MAAM,GAAGC,wBAAW,CAACH,QAAQ,CAAC,IAAI,CAAC,CAAC;EAE1C,IAAMI,KAAK,GAAGC,iBAAK,CAACC,GAAG,CAACP,KAAK,EAASQ,EAAE,CAACC,EAAE,CAAC,OAAO,CAAC,CAAC;EACrD,IAAI,CAACJ,KAAK,EAAE;IACV,IAAIF,MAAM,CAACE,KAAK,EAAE;MAChBN,GAAG,CAACW,YAAY,CAAC,OAAO,EAAEP,MAAM,CAACE,KAAK,CAAC;IACzC;IACA;EACF;EACA,IAAIA,KAAK,CAACM,QAAQ,KAAK,SAAS,EAAE;IAChC,IAAIN,KAAK,EAAEN,GAAG,CAACW,YAAY,CAAC,OAAO,EAAEL,KAAK,CAACO,KAAK,CAAC;EACnD,CAAC,MAAM;IACL,IAAMC,GAAG,GAAGP,iBAAK,CAACQ,kBAAkB,CAACT,KAAK,EAAS,IAAI,EAAE,IAAI,EAAGL,KAAK,CAASe,GAAG,EAAE,CAAC;IACpFF,GAAG,CAACG,OAAO,CAAC,UAAAC,EAAE,EAAI;MAChB,IAAIA,EAAE,CAACC,SAAS,CAACC,GAAG,IAAIF,EAAE,CAACC,SAAS,CAACC,GAAG,CAACC,UAAU,CAACvB,gBAAgB,CAAC,EAAE;QACrE,IAAMwB,YAAY,GAAGJ,EAAE,CAACC,SAAS,CAACC,GAAG,CAACG,KAAK,CAACzB,gBAAgB,CAAC0B,MAAM,CAAC;QACpE,IAAI;UACFxB,GAAG,CAACM,KAAK,CAACgB,YAAY,CAAC,GAAGJ,EAAE,CAACO,MAAM,CAACZ,KAAK;QAC3C,CAAC,CAAC,OAAOa,GAAG,EAAE;UACZC,OAAO,CAACC,IAAI,sDAA+CN,YAAY,mBAAQJ,EAAE,CAACO,MAAM,CAACZ,KAAK,QAAI;UAClGc,OAAO,CAACC,IAAI,sDAA8C5B,GAAG,CAAC6B,OAAO,IAAI,KAAK,QAAI;QACpF;MACF;IACF,CAAC,CAAC;EACJ;AACF"}
|