@fiduswriter/bibliography-manager 0.1.0
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/LICENSE +661 -0
- package/README.md +20 -0
- package/dist/database/index.js +172 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/server_connector.js +47 -0
- package/dist/database/server_connector.js.map +1 -0
- package/dist/export/index.js +23 -0
- package/dist/export/index.js.map +1 -0
- package/dist/form/cats.js +22 -0
- package/dist/form/cats.js.map +1 -0
- package/dist/form/fields/date.js +28 -0
- package/dist/form/fields/date.js.map +1 -0
- package/dist/form/fields/key.js +100 -0
- package/dist/form/fields/key.js.map +1 -0
- package/dist/form/fields/key_list.js +37 -0
- package/dist/form/fields/key_list.js.map +1 -0
- package/dist/form/fields/literal.js +43 -0
- package/dist/form/fields/literal.js.map +1 -0
- package/dist/form/fields/literal_list.js +36 -0
- package/dist/form/fields/literal_list.js.map +1 -0
- package/dist/form/fields/literal_long.js +42 -0
- package/dist/form/fields/literal_long.js.map +1 -0
- package/dist/form/fields/name.js +121 -0
- package/dist/form/fields/name.js.map +1 -0
- package/dist/form/fields/name_list.js +36 -0
- package/dist/form/fields/name_list.js.map +1 -0
- package/dist/form/fields/range.js +89 -0
- package/dist/form/fields/range.js.map +1 -0
- package/dist/form/fields/range_list.js +36 -0
- package/dist/form/fields/range_list.js.map +1 -0
- package/dist/form/fields/tag_list.js +30 -0
- package/dist/form/fields/tag_list.js.map +1 -0
- package/dist/form/fields/title.js +46 -0
- package/dist/form/fields/title.js.map +1 -0
- package/dist/form/fields/uri.js +40 -0
- package/dist/form/fields/uri.js.map +1 -0
- package/dist/form/fields/verbatim.js +19 -0
- package/dist/form/fields/verbatim.js.map +1 -0
- package/dist/form/index.js +344 -0
- package/dist/form/index.js.map +1 -0
- package/dist/form/strings.js +89 -0
- package/dist/form/strings.js.map +1 -0
- package/dist/form/templates.js +59 -0
- package/dist/form/templates.js.map +1 -0
- package/dist/import/bibliography_import.js +83 -0
- package/dist/import/bibliography_import.js.map +1 -0
- package/dist/import/dialog.js +71 -0
- package/dist/import/dialog.js.map +1 -0
- package/dist/import/index.js +3 -0
- package/dist/import/index.js.map +1 -0
- package/dist/import/templates.js +12 -0
- package/dist/import/templates.js.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/overview/index.js +453 -0
- package/dist/overview/index.js.map +1 -0
- package/dist/overview/menu.js +91 -0
- package/dist/overview/menu.js.map +1 -0
- package/dist/overview/templates.js +24 -0
- package/dist/overview/templates.js.map +1 -0
- package/dist/plugins/bibliography_overview/index.js +2 -0
- package/dist/plugins/bibliography_overview/index.js.map +1 -0
- package/dist/schema/literal.js +24 -0
- package/dist/schema/literal.js.map +1 -0
- package/dist/schema/literal_long.js +40 -0
- package/dist/schema/literal_long.js.map +1 -0
- package/dist/schema/title.js +31 -0
- package/dist/schema/title.js.map +1 -0
- package/dist/tools.js +53 -0
- package/dist/tools.js.map +1 -0
- package/package.json +55 -0
- package/src/database/index.js +234 -0
- package/src/database/server_connector.js +57 -0
- package/src/export/index.js +27 -0
- package/src/form/cats.js +24 -0
- package/src/form/fields/date.js +31 -0
- package/src/form/fields/key.js +113 -0
- package/src/form/fields/key_list.js +45 -0
- package/src/form/fields/literal.js +48 -0
- package/src/form/fields/literal_list.js +42 -0
- package/src/form/fields/literal_long.js +47 -0
- package/src/form/fields/name.js +152 -0
- package/src/form/fields/name_list.js +42 -0
- package/src/form/fields/range.js +104 -0
- package/src/form/fields/range_list.js +42 -0
- package/src/form/fields/tag_list.js +33 -0
- package/src/form/fields/title.js +51 -0
- package/src/form/fields/uri.js +43 -0
- package/src/form/fields/verbatim.js +21 -0
- package/src/form/index.js +424 -0
- package/src/form/strings.js +122 -0
- package/src/form/templates.js +70 -0
- package/src/import/bibliography_import.js +104 -0
- package/src/import/dialog.js +95 -0
- package/src/import/index.js +2 -0
- package/src/import/templates.js +12 -0
- package/src/index.js +5 -0
- package/src/overview/index.js +548 -0
- package/src/overview/menu.js +106 -0
- package/src/overview/templates.js +30 -0
- package/src/plugins/bibliography_overview/index.js +1 -0
- package/src/schema/literal.js +34 -0
- package/src/schema/literal_long.js +50 -0
- package/src/schema/title.js +42 -0
- package/src/tools.js +58 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { activateWait, addAlert, deactivateWait } from "fwtoolkit";
|
|
2
|
+
import { BibliographyDBServerConnector } from "./server_connector";
|
|
3
|
+
const FW_LOCALSTORAGE_VERSION = "1.2";
|
|
4
|
+
export class BibliographyDB {
|
|
5
|
+
constructor(app) {
|
|
6
|
+
this.app = app;
|
|
7
|
+
this.db = {};
|
|
8
|
+
this.cats = [];
|
|
9
|
+
this.sc = new BibliographyDBServerConnector();
|
|
10
|
+
}
|
|
11
|
+
/** Get the bibliography from the server and create as this.db.
|
|
12
|
+
* @function getDB
|
|
13
|
+
*/
|
|
14
|
+
getDB() {
|
|
15
|
+
const localStorageVersion = window.localStorage.getItem("version");
|
|
16
|
+
let lastModified = Number.parseInt(window.localStorage.getItem("last_modified_biblist")), numberOfEntries = Number.parseInt(window.localStorage.getItem("number_of_entries")), localStorageOwnerId = Number.parseInt(window.localStorage.getItem("owner_id"));
|
|
17
|
+
// A dictionary to look up bib fields by their fw type name.
|
|
18
|
+
// Needed for translation to CSL and Biblatex.
|
|
19
|
+
//Fill BibDB
|
|
20
|
+
if (Number.isNaN(lastModified)) {
|
|
21
|
+
lastModified = -1;
|
|
22
|
+
}
|
|
23
|
+
if (Number.isNaN(numberOfEntries)) {
|
|
24
|
+
numberOfEntries = -1;
|
|
25
|
+
}
|
|
26
|
+
if (Number.isNaN(localStorageOwnerId)) {
|
|
27
|
+
localStorageOwnerId = -1;
|
|
28
|
+
}
|
|
29
|
+
if (localStorageVersion != FW_LOCALSTORAGE_VERSION) {
|
|
30
|
+
lastModified = -1;
|
|
31
|
+
numberOfEntries = -1;
|
|
32
|
+
localStorageOwnerId = -1;
|
|
33
|
+
}
|
|
34
|
+
activateWait();
|
|
35
|
+
return this.sc
|
|
36
|
+
.getDB(lastModified, numberOfEntries, localStorageOwnerId)
|
|
37
|
+
.then(({ bibCats, bibList, lastModified, numberOfEntries, userId }) => {
|
|
38
|
+
bibCats.forEach(bibCat => this.cats.push(bibCat));
|
|
39
|
+
if (bibList) {
|
|
40
|
+
try {
|
|
41
|
+
window.localStorage.setItem("biblist", JSON.stringify(bibList));
|
|
42
|
+
window.localStorage.setItem("last_modified_biblist", lastModified);
|
|
43
|
+
window.localStorage.setItem("number_of_entries", numberOfEntries);
|
|
44
|
+
window.localStorage.setItem("owner_id", userId);
|
|
45
|
+
window.localStorage.setItem("version", FW_LOCALSTORAGE_VERSION);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
// The local storage was likely too small
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
bibList = JSON.parse(window.localStorage.getItem("biblist"));
|
|
54
|
+
}
|
|
55
|
+
bibList.forEach(({ id, bibDBEntry }) => {
|
|
56
|
+
this.db[id] = bibDBEntry;
|
|
57
|
+
});
|
|
58
|
+
deactivateWait();
|
|
59
|
+
return;
|
|
60
|
+
})
|
|
61
|
+
.catch(error => {
|
|
62
|
+
addAlert("error", gettext("Could not obtain bibliography data"));
|
|
63
|
+
deactivateWait();
|
|
64
|
+
throw error;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** Saves a bibliography entry to the database on the server.
|
|
68
|
+
* @function saveBibEntries
|
|
69
|
+
* @param tmpDB The bibliography DB with temporary IDs to be send to the server.
|
|
70
|
+
*/
|
|
71
|
+
saveBibEntries(tmpDB, isNew) {
|
|
72
|
+
return this.sc
|
|
73
|
+
.saveBibEntries(tmpDB, isNew)
|
|
74
|
+
.then(idTranslations => this.updateLocalBibEntries(tmpDB, idTranslations))
|
|
75
|
+
.catch(error => {
|
|
76
|
+
addAlert("error", gettext("The bibliography could not be updated"));
|
|
77
|
+
if (this.app.isOffline()) {
|
|
78
|
+
addAlert("info", gettext("You are currently offline. Please try again when you are back online."));
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
updateLocalBibEntries(tmpDB, idTranslations) {
|
|
86
|
+
idTranslations.forEach(bibTrans => {
|
|
87
|
+
this.db[bibTrans[1]] = tmpDB[bibTrans[0]];
|
|
88
|
+
});
|
|
89
|
+
addAlert("success", gettext("The bibliography has been updated."));
|
|
90
|
+
return idTranslations;
|
|
91
|
+
}
|
|
92
|
+
/** Update or create new category
|
|
93
|
+
* @function saveCategories
|
|
94
|
+
* @param cats The category objects to add.
|
|
95
|
+
*/
|
|
96
|
+
saveCategories(cats) {
|
|
97
|
+
activateWait();
|
|
98
|
+
return this.sc
|
|
99
|
+
.saveCategories(cats)
|
|
100
|
+
.then(bibCats => {
|
|
101
|
+
// Replace the old with the new categories, but don't lose the link to the array (so delete each, then add each).
|
|
102
|
+
while (this.cats.length > 0) {
|
|
103
|
+
this.cats.pop();
|
|
104
|
+
}
|
|
105
|
+
while (bibCats.length > 0) {
|
|
106
|
+
this.cats.push(bibCats.pop());
|
|
107
|
+
}
|
|
108
|
+
addAlert("success", gettext("The categories have been updated"));
|
|
109
|
+
deactivateWait();
|
|
110
|
+
return this.cats;
|
|
111
|
+
})
|
|
112
|
+
.catch(error => {
|
|
113
|
+
addAlert("error", gettext("The categories could not be updated"));
|
|
114
|
+
deactivateWait();
|
|
115
|
+
if (this.app.isOffline()) {
|
|
116
|
+
addAlert("info", gettext("You are currently offline. Please try again when you are back online."));
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
throw error;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/** Delete a categories
|
|
124
|
+
* @function deleteCategory
|
|
125
|
+
* @param ids A list of ids to delete.
|
|
126
|
+
*/
|
|
127
|
+
deleteCategory(ids) {
|
|
128
|
+
return this.sc.deleteCategory(ids).then(() => {
|
|
129
|
+
const deletedPks = ids.slice();
|
|
130
|
+
const deletedBibCats = [];
|
|
131
|
+
this.cats.forEach(bibCat => {
|
|
132
|
+
if (ids.indexOf(bibCat.id) !== -1) {
|
|
133
|
+
deletedBibCats.push(bibCat);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
deletedBibCats.forEach(bibCat => {
|
|
137
|
+
const index = this.cats.indexOf(bibCat);
|
|
138
|
+
this.cats.splice(index, 1);
|
|
139
|
+
});
|
|
140
|
+
return deletedPks;
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/** Delete a list of bibliography items both locally and on the server.
|
|
144
|
+
* @function deleteBibEntries
|
|
145
|
+
* @param ids A list of bibliography item ids that are to be deleted.
|
|
146
|
+
*/
|
|
147
|
+
deleteBibEntries(ids) {
|
|
148
|
+
activateWait();
|
|
149
|
+
ids = ids.map(id => Number.parseInt(id));
|
|
150
|
+
return this.sc
|
|
151
|
+
.deleteBibEntries(ids)
|
|
152
|
+
.then(() => {
|
|
153
|
+
ids.forEach(id => {
|
|
154
|
+
delete this.db[id];
|
|
155
|
+
});
|
|
156
|
+
addAlert("success", gettext("The bibliography item(s) have been deleted"));
|
|
157
|
+
deactivateWait();
|
|
158
|
+
return ids;
|
|
159
|
+
})
|
|
160
|
+
.catch(error => {
|
|
161
|
+
addAlert("error", "The bibliography item(s) could not be deleted");
|
|
162
|
+
deactivateWait();
|
|
163
|
+
if (this.app.isOffline()) {
|
|
164
|
+
addAlert("info", gettext("You are currently offline. Please try again when you are back online."));
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/database/index.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,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"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { post, postJson } from "fwtoolkit/network";
|
|
2
|
+
// class for server calls of BibliographyDB.
|
|
3
|
+
export class BibliographyDBServerConnector {
|
|
4
|
+
constructor() { }
|
|
5
|
+
getDB(lastModified, numberOfEntries, localStorageOwnerId) {
|
|
6
|
+
return postJson("/api/bibliography/biblist/", {
|
|
7
|
+
last_modified: lastModified,
|
|
8
|
+
number_of_entries: numberOfEntries,
|
|
9
|
+
user_id: localStorageOwnerId
|
|
10
|
+
}).then(({ json }) => {
|
|
11
|
+
return {
|
|
12
|
+
bibCats: json["bib_categories"],
|
|
13
|
+
bibList: json.hasOwnProperty("bib_list")
|
|
14
|
+
? json["bib_list"].map(item => this.serverBibItemToBibDB(item))
|
|
15
|
+
: false,
|
|
16
|
+
lastModified: json["last_modified"],
|
|
17
|
+
numberOfEntries: json["number_of_entries"],
|
|
18
|
+
userId: json["user_id"]
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/** Converts a bibliography item as it arrives from the server to a BibDB object.
|
|
23
|
+
* @function serverBibItemToBibDB
|
|
24
|
+
* @param item The bibliography item from the server.
|
|
25
|
+
*/
|
|
26
|
+
serverBibItemToBibDB(bibDBEntry) {
|
|
27
|
+
return { id: bibDBEntry["id"], bibDBEntry };
|
|
28
|
+
}
|
|
29
|
+
saveBibEntries(tmpDB, isNew) {
|
|
30
|
+
return postJson("/api/bibliography/save/", {
|
|
31
|
+
is_new: isNew,
|
|
32
|
+
bibs: tmpDB
|
|
33
|
+
}).then(({ json }) => json["id_translations"]);
|
|
34
|
+
}
|
|
35
|
+
saveCategories(cats) {
|
|
36
|
+
return postJson("/api/bibliography/save_category/", cats).then(({ json }) => {
|
|
37
|
+
return json.entries;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
deleteCategory(ids) {
|
|
41
|
+
return post("/api/bibliography/delete_category/", { ids });
|
|
42
|
+
}
|
|
43
|
+
deleteBibEntries(ids) {
|
|
44
|
+
return post("/api/bibliography/delete/", { ids });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=server_connector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server_connector.js","sourceRoot":"","sources":["../../src/database/server_connector.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAA;AAEhD,4CAA4C;AAC5C,MAAM,OAAO,6BAA6B;IACtC,gBAAe,CAAC;IAEhB,KAAK,CAAC,YAAY,EAAE,eAAe,EAAE,mBAAmB;QACpD,OAAO,QAAQ,CAAC,4BAA4B,EAAE;YAC1C,aAAa,EAAE,YAAY;YAC3B,iBAAiB,EAAE,eAAe;YAClC,OAAO,EAAE,mBAAmB;SAC/B,CAAC,CAAC,IAAI,CAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE;YACf,OAAO;gBACH,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC;gBAC/B,OAAO,EAAE,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC;oBACpC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CACxB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAClC;oBACH,CAAC,CAAC,KAAK;gBACX,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC;gBACnC,eAAe,EAAE,IAAI,CAAC,mBAAmB,CAAC;gBAC1C,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC;aAC1B,CAAA;QACL,CAAC,CAAC,CAAA;IACN,CAAC;IAED;;;OAGG;IACH,oBAAoB,CAAC,UAAU;QAC3B,OAAO,EAAC,EAAE,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,UAAU,EAAC,CAAA;IAC7C,CAAC;IAED,cAAc,CAAC,KAAK,EAAE,KAAK;QACvB,OAAO,QAAQ,CAAC,yBAAyB,EAAE;YACvC,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,KAAK;SACd,CAAC,CAAC,IAAI,CAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAChD,CAAC;IAED,cAAc,CAAC,IAAI;QACf,OAAO,QAAQ,CAAC,kCAAkC,EAAE,IAAI,CAAC,CAAC,IAAI,CAC1D,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE;YACP,OAAO,IAAI,CAAC,OAAO,CAAA;QACvB,CAAC,CACJ,CAAA;IACL,CAAC;IAED,cAAc,CAAC,GAAG;QACd,OAAO,IAAI,CAAC,oCAAoC,EAAE,EAAC,GAAG,EAAC,CAAC,CAAA;IAC5D,CAAC;IAED,gBAAgB,CAAC,GAAG;QAChB,OAAO,IAAI,CAAC,2BAA2B,EAAE,EAAC,GAAG,EAAC,CAAC,CAAA;IACnD,CAAC;CACJ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ZipFileCreator } from "@fiduswriter/document/exporter/tools/zip";
|
|
2
|
+
import download from "downloadjs";
|
|
3
|
+
export class BibLatexFileExporter {
|
|
4
|
+
constructor(bibDB, pks) {
|
|
5
|
+
this.pks = pks; // A list of pk values of the bibliography items to be exported.
|
|
6
|
+
this.bibDB = bibDB; // The bibliography database to export from.
|
|
7
|
+
}
|
|
8
|
+
init() {
|
|
9
|
+
import("bibliojson").then(({ BibLatexExporter }) => {
|
|
10
|
+
const exporter = new BibLatexExporter(this.bibDB.db, this.pks);
|
|
11
|
+
const zipper = new ZipFileCreator([
|
|
12
|
+
{
|
|
13
|
+
filename: "bibliography.bib",
|
|
14
|
+
contents: exporter.output
|
|
15
|
+
}
|
|
16
|
+
]);
|
|
17
|
+
zipper
|
|
18
|
+
.init()
|
|
19
|
+
.then(blob => download(blob, "bibliography.zip", "application/zip"));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/export/index.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,0CAA0C,CAAA;AACvE,OAAO,QAAQ,MAAM,YAAY,CAAA;AAEjC,MAAM,OAAO,oBAAoB;IAC7B,YAAY,KAAK,EAAE,GAAG;QAClB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA,CAAC,gEAAgE;QAC/E,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA,CAAC,4CAA4C;IACnE,CAAC;IAED,IAAI;QACA,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,EAAC,gBAAgB,EAAC,EAAE,EAAE;YAC7C,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;YAE9D,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC;gBAC9B;oBACI,QAAQ,EAAE,kBAAkB;oBAC5B,QAAQ,EAAE,QAAQ,CAAC,MAAM;iBAC5B;aACJ,CAAC,CAAA;YACF,MAAM;iBACD,IAAI,EAAE;iBACN,IAAI,CAAC,IAAI,CAAC,EAAE,CACT,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,iBAAiB,CAAC,CACxD,CAAA;QACT,CAAC,CAAC,CAAA;IACN,CAAC;CACJ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CheckableList } from "fwtoolkit";
|
|
2
|
+
export class CatsForm {
|
|
3
|
+
constructor(dom, initialValue = [], options = []) {
|
|
4
|
+
this.dom = dom;
|
|
5
|
+
this.checkableList = new CheckableList({
|
|
6
|
+
dom,
|
|
7
|
+
options: options.map(option => ({
|
|
8
|
+
id: option.id,
|
|
9
|
+
label: option.category_title
|
|
10
|
+
})),
|
|
11
|
+
initialValue,
|
|
12
|
+
multiple: true
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
init() {
|
|
16
|
+
// CheckableList is already rendered by the constructor.
|
|
17
|
+
}
|
|
18
|
+
get value() {
|
|
19
|
+
return this.checkableList.value;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=cats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cats.js","sourceRoot":"","sources":["../../src/form/cats.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,WAAW,CAAA;AAEvC,MAAM,OAAO,QAAQ;IACjB,YAAY,GAAG,EAAE,YAAY,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE;QAC5C,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC;YACnC,GAAG;YACH,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBAC5B,EAAE,EAAE,MAAM,CAAC,EAAE;gBACb,KAAK,EAAE,MAAM,CAAC,cAAc;aAC/B,CAAC,CAAC;YACH,YAAY;YACZ,QAAQ,EAAE,IAAI;SACjB,CAAC,CAAA;IACN,CAAC;IAED,IAAI;QACA,wDAAwD;IAC5D,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAA;IACnC,CAAC;CACJ"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { edtfParse } from "bibliojson";
|
|
2
|
+
export class DateFieldForm {
|
|
3
|
+
constructor(dom, initialValue = "", placeHolder = "") {
|
|
4
|
+
this.dom = dom;
|
|
5
|
+
this.initialValue = initialValue;
|
|
6
|
+
this.placeHolder = placeHolder;
|
|
7
|
+
}
|
|
8
|
+
init() {
|
|
9
|
+
this.dom.innerHTML = `<input class="fw-date" type="text" value="${this.initialValue}" placeholder="${this.placeHolder}">`;
|
|
10
|
+
}
|
|
11
|
+
get value() {
|
|
12
|
+
const formValue = this.dom.querySelector("input.fw-date").value;
|
|
13
|
+
// If the form has not been filled out, don't consider this form
|
|
14
|
+
return formValue.length > 0 ? formValue : false;
|
|
15
|
+
}
|
|
16
|
+
check() {
|
|
17
|
+
const formValue = this.value;
|
|
18
|
+
if (formValue) {
|
|
19
|
+
const checkValue = edtfParse(formValue).valid;
|
|
20
|
+
if (!checkValue) {
|
|
21
|
+
this.dom.classList.add("fw-fomt-error");
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../../src/form/fields/date.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAA;AAEpC,MAAM,OAAO,aAAa;IACtB,YAAY,GAAG,EAAE,YAAY,GAAG,EAAE,EAAE,WAAW,GAAG,EAAE;QAChD,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;QAChC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;IAClC,CAAC;IAED,IAAI;QACA,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,6CAA6C,IAAI,CAAC,YAAY,kBAAkB,IAAI,CAAC,WAAW,IAAI,CAAA;IAC7H,CAAC;IAED,IAAI,KAAK;QACL,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,KAAK,CAAA;QAC/D,gEAAgE;QAChE,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAA;IACnD,CAAC;IAED,KAAK;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAA;QAC5B,IAAI,SAAS,EAAE,CAAC;YACZ,MAAM,UAAU,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,KAAK,CAAA;YAC7C,IAAI,CAAC,UAAU,EAAE,CAAC;gBACd,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;gBACvC,OAAO,KAAK,CAAA;YAChB,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAA;IACf,CAAC;CACJ"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { TypeSwitch } from "fwtoolkit";
|
|
2
|
+
import { getBibOptionTitle } from "../strings";
|
|
3
|
+
import { LiteralFieldForm } from "./literal";
|
|
4
|
+
export class KeyFieldForm {
|
|
5
|
+
constructor(dom, initialValue, _unused, fieldType = undefined) {
|
|
6
|
+
this.currentValue = {};
|
|
7
|
+
this.dom = dom;
|
|
8
|
+
this.fieldType = fieldType;
|
|
9
|
+
// We set the mode based on the type of value
|
|
10
|
+
if (typeof initialValue === "object") {
|
|
11
|
+
this.predefined = false;
|
|
12
|
+
this.currentValue["custom"] = initialValue;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
this.predefined = true;
|
|
16
|
+
this.currentValue["predefined"] = initialValue;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
init() {
|
|
20
|
+
this.typeSwitch = new TypeSwitch({
|
|
21
|
+
dom: this.dom,
|
|
22
|
+
label1: gettext("From list"),
|
|
23
|
+
label2: gettext("Custom"),
|
|
24
|
+
initialMode: this.predefined ? 1 : 2,
|
|
25
|
+
disabled: this.fieldType.strict,
|
|
26
|
+
beforeChange: () => {
|
|
27
|
+
const formValue = this.value;
|
|
28
|
+
if (formValue) {
|
|
29
|
+
if (this.predefined) {
|
|
30
|
+
this.currentValue["predefined"] = formValue;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
this.currentValue["custom"] = formValue;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
onChange: mode => {
|
|
38
|
+
this.predefined = mode === 1;
|
|
39
|
+
this.drawForm();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
this.drawForm();
|
|
43
|
+
}
|
|
44
|
+
drawForm() {
|
|
45
|
+
if (this.predefined) {
|
|
46
|
+
this.drawSelectionListForm();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
this.drawCustomInputForm();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
drawSelectionListForm() {
|
|
53
|
+
this.typeSwitch.innerElement.innerHTML = `
|
|
54
|
+
<select class='key-selection'><option value=''></option></select>
|
|
55
|
+
<div class="fw-select-arrow fa fa-caret-down"></div>
|
|
56
|
+
`;
|
|
57
|
+
const selectEl = this.typeSwitch.innerElement.querySelector(".key-selection");
|
|
58
|
+
if (Array.isArray(this.fieldType.options)) {
|
|
59
|
+
this.fieldType.options.forEach(option => {
|
|
60
|
+
selectEl.insertAdjacentHTML("beforeend", `<option value="${option}">${getBibOptionTitle(option)}</option>`);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
Object.keys(this.fieldType.options).forEach(option => {
|
|
65
|
+
selectEl.insertAdjacentHTML("beforeend", `<option value="${option}">${getBibOptionTitle(option)}</option>`);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (this.currentValue["predefined"]) {
|
|
69
|
+
selectEl.value = this.currentValue["predefined"];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
drawCustomInputForm() {
|
|
73
|
+
this.fields = {};
|
|
74
|
+
this.typeSwitch.innerElement.innerHTML = `<div class='custom-input field-part field-part-single'></div>`;
|
|
75
|
+
this.fields["custom"] = new LiteralFieldForm(this.typeSwitch.innerElement.querySelector(".custom-input"), this.currentValue["custom"]);
|
|
76
|
+
this.fields.custom.init();
|
|
77
|
+
}
|
|
78
|
+
get value() {
|
|
79
|
+
if (this.predefined) {
|
|
80
|
+
const selectEl = this.typeSwitch.innerElement.querySelector(".key-selection");
|
|
81
|
+
const selectionValue = selectEl.options[selectEl.selectedIndex].value;
|
|
82
|
+
if (selectionValue === "") {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
return selectionValue;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
if (!this.fields.custom.value) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
return this.fields.custom.value;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
check() {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key.js","sourceRoot":"","sources":["../../../src/form/fields/key.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAA;AACpC,OAAO,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAC,gBAAgB,EAAC,MAAM,WAAW,CAAA;AAE1C,MAAM,OAAO,YAAY;IACrB,YAAY,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,GAAG,SAAS;QACzD,IAAI,CAAC,YAAY,GAAG,EAAE,CAAA;QACtB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,6CAA6C;QAC7C,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;YACnC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAA;YACvB,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAA;QAC9C,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,UAAU,GAAG,IAAI,CAAA;YACtB,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,GAAG,YAAY,CAAA;QAClD,CAAC;IACL,CAAC;IAED,IAAI;QACA,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAA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AQ,CAAC,aAAa,CAAC,CAAC,KAAK,CAAA;YAClD,IAAI,cAAc,KAAK,EAAE,EAAE,CAAC;gBACxB,OAAO,KAAK,CAAA;YAChB,CAAC;iBAAM,CAAC;gBACJ,OAAO,cAAc,CAAA;YACzB,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;gBAC5B,OAAO,KAAK,CAAA;YAChB,CAAC;YACD,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAA;QACnC,CAAC;IACL,CAAC;IAED,KAAK;QACD,OAAO,IAAI,CAAA;IACf,CAAC;CACJ"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { InputList } from "fwtoolkit";
|
|
2
|
+
import { KeyFieldForm } from "./key";
|
|
3
|
+
export class KeyListForm {
|
|
4
|
+
constructor(dom, initialValue = [""], _unused, fieldType = undefined) {
|
|
5
|
+
this.dom = dom;
|
|
6
|
+
this.fieldType = fieldType;
|
|
7
|
+
this.fieldHandlers = new WeakMap();
|
|
8
|
+
this.inputList = new InputList({
|
|
9
|
+
dom,
|
|
10
|
+
initialValues: initialValue,
|
|
11
|
+
emptyValue: "",
|
|
12
|
+
renderItem: value => ({
|
|
13
|
+
html: `<div class="key-field"></div>`,
|
|
14
|
+
bind: el => {
|
|
15
|
+
const fieldHandler = new KeyFieldForm(el.firstElementChild, value, false, this.fieldType);
|
|
16
|
+
fieldHandler.init();
|
|
17
|
+
this.fieldHandlers.set(el, fieldHandler);
|
|
18
|
+
}
|
|
19
|
+
}),
|
|
20
|
+
getValue: el => this.fieldHandlers.get(el).value
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
init() {
|
|
24
|
+
// InputList is already rendered by the constructor.
|
|
25
|
+
}
|
|
26
|
+
get value() {
|
|
27
|
+
const formValue = this.inputList.values.filter(value => value !== false);
|
|
28
|
+
if (formValue.length === 0) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return formValue;
|
|
32
|
+
}
|
|
33
|
+
check() {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=key_list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key_list.js","sourceRoot":"","sources":["../../../src/form/fields/key_list.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,WAAW,CAAA;AACnC,OAAO,EAAC,YAAY,EAAC,MAAM,OAAO,CAAA;AAElC,MAAM,OAAO,WAAW;IACpB,YAAY,GAAG,EAAE,YAAY,GAAG,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,GAAG,SAAS;QAChE,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,aAAa,GAAG,IAAI,OAAO,EAAE,CAAA;QAClC,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC;YAC3B,GAAG;YACH,aAAa,EAAE,YAAY;YAC3B,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;gBAClB,IAAI,EAAE,+BAA+B;gBACrC,IAAI,EAAE,EAAE,CAAC,EAAE;oBACP,MAAM,YAAY,GAAG,IAAI,YAAY,CACjC,EAAE,CAAC,iBAAiB,EACpB,KAAK,EACL,KAAK,EACL,IAAI,CAAC,SAAS,CACjB,CAAA;oBACD,YAAY,CAAC,IAAI,EAAE,CAAA;oBACnB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,EAAE,YAAY,CAAC,CAAA;gBAC5C,CAAC;aACJ,CAAC;YACF,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK;SACnD,CAAC,CAAA;IACN,CAAC;IAED,IAAI;QACA,oDAAoD;IACxD,CAAC;IAED,IAAI,KAAK;QACL,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,CAAA;QACxE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,KAAK,CAAA;QAChB,CAAC;QACD,OAAO,SAAS,CAAA;IACpB,CAAC;IAED,KAAK;QACD,OAAO,IAAI,CAAA;IACf,CAAC;CACJ"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { toggleMark } from "prosemirror-commands";
|
|
2
|
+
import { InlineInput, icon } from "fwtoolkit";
|
|
3
|
+
import { litSchema } from "../../schema/literal";
|
|
4
|
+
export class LiteralFieldForm {
|
|
5
|
+
constructor(dom, initialValue = [], placeHolder = false) {
|
|
6
|
+
this.inlineInput = new InlineInput(dom, {
|
|
7
|
+
schema: litSchema,
|
|
8
|
+
nodeType: "literal",
|
|
9
|
+
initialValue,
|
|
10
|
+
placeholder: placeHolder,
|
|
11
|
+
tools: [
|
|
12
|
+
{
|
|
13
|
+
command: toggleMark(litSchema.marks.strong),
|
|
14
|
+
dom: icon("strong", gettext("Strong"))
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
command: toggleMark(litSchema.marks.em),
|
|
18
|
+
dom: icon("em", gettext("Emphasis"))
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
command: toggleMark(litSchema.marks.smallcaps),
|
|
22
|
+
dom: icon("smallcaps", gettext("Small caps"))
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
command: toggleMark(litSchema.marks.sub),
|
|
26
|
+
dom: icon("sub", gettext("Subscript₊"))
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
command: toggleMark(litSchema.marks.sup),
|
|
30
|
+
dom: icon("sup", gettext("Supscript²"))
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
init() { }
|
|
36
|
+
get value() {
|
|
37
|
+
return this.inlineInput.value;
|
|
38
|
+
}
|
|
39
|
+
check() {
|
|
40
|
+
return this.inlineInput.check();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=literal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literal.js","sourceRoot":"","sources":["../../../src/form/fields/literal.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAC,WAAW,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AAE3C,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAE9C,MAAM,OAAO,gBAAgB;IACzB,YAAY,GAAG,EAAE,YAAY,GAAG,EAAE,EAAE,WAAW,GAAG,KAAK;QACnD,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,GAAG,EAAE;YACpC,MAAM,EAAE,SAAS;YACjB,QAAQ,EAAE,SAAS;YACnB,YAAY;YACZ,WAAW,EAAE,WAAW;YACxB,KAAK,EAAE;gBACH;oBACI,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;oBAC3C,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;iBACzC;gBACD;oBACI,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;oBACvC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;iBACvC;gBACD;oBACI,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC;oBAC9C,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;iBAChD;gBACD;oBACI,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC;oBACxC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;iBAC1C;gBACD;oBACI,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC;oBACxC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;iBAC1C;aACJ;SACJ,CAAC,CAAA;IACN,CAAC;IAED,IAAI,KAAI,CAAC;IAET,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAA;IACjC,CAAC;IAED,KAAK;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAA;IACnC,CAAC;CACJ"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { InputList } from "fwtoolkit";
|
|
2
|
+
import { LiteralFieldForm } from "./literal";
|
|
3
|
+
export class LiteralListForm {
|
|
4
|
+
constructor(dom, initialValue = [[]]) {
|
|
5
|
+
this.dom = dom;
|
|
6
|
+
this.fieldHandlers = new WeakMap();
|
|
7
|
+
this.inputList = new InputList({
|
|
8
|
+
dom,
|
|
9
|
+
initialValues: initialValue,
|
|
10
|
+
emptyValue: [],
|
|
11
|
+
renderItem: value => ({
|
|
12
|
+
html: `<div class="literal-field"></div>`,
|
|
13
|
+
bind: el => {
|
|
14
|
+
const fieldHandler = new LiteralFieldForm(el.firstElementChild, value);
|
|
15
|
+
fieldHandler.init();
|
|
16
|
+
this.fieldHandlers.set(el, fieldHandler);
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
19
|
+
getValue: el => this.fieldHandlers.get(el).value
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
init() {
|
|
23
|
+
// InputList is already rendered by the constructor.
|
|
24
|
+
}
|
|
25
|
+
get value() {
|
|
26
|
+
const formValue = this.inputList.values.filter(value => value !== false);
|
|
27
|
+
if (formValue.length === 0) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
return formValue;
|
|
31
|
+
}
|
|
32
|
+
check() {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=literal_list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literal_list.js","sourceRoot":"","sources":["../../../src/form/fields/literal_list.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,WAAW,CAAA;AACnC,OAAO,EAAC,gBAAgB,EAAC,MAAM,WAAW,CAAA;AAE1C,MAAM,OAAO,eAAe;IACxB,YAAY,GAAG,EAAE,YAAY,GAAG,CAAC,EAAE,CAAC;QAChC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,aAAa,GAAG,IAAI,OAAO,EAAE,CAAA;QAClC,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC;YAC3B,GAAG;YACH,aAAa,EAAE,YAAY;YAC3B,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;gBAClB,IAAI,EAAE,mCAAmC;gBACzC,IAAI,EAAE,EAAE,CAAC,EAAE;oBACP,MAAM,YAAY,GAAG,IAAI,gBAAgB,CACrC,EAAE,CAAC,iBAAiB,EACpB,KAAK,CACR,CAAA;oBACD,YAAY,CAAC,IAAI,EAAE,CAAA;oBACnB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,EAAE,YAAY,CAAC,CAAA;gBAC5C,CAAC;aACJ,CAAC;YACF,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK;SACnD,CAAC,CAAA;IACN,CAAC;IAED,IAAI;QACA,oDAAoD;IACxD,CAAC;IAED,IAAI,KAAK;QACL,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,CAAA;QACxE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,KAAK,CAAA;QAChB,CAAC;QACD,OAAO,SAAS,CAAA;IACpB,CAAC;IAED,KAAK;QACD,OAAO,IAAI,CAAA;IACf,CAAC;CACJ"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { toggleMark } from "prosemirror-commands";
|
|
2
|
+
import { InlineInput, icon } from "fwtoolkit";
|
|
3
|
+
import { longLitSchema } from "../../schema/literal_long";
|
|
4
|
+
export class LiteralLongFieldForm {
|
|
5
|
+
constructor(dom, initialValue = []) {
|
|
6
|
+
this.inlineInput = new InlineInput(dom, {
|
|
7
|
+
schema: longLitSchema,
|
|
8
|
+
nodeType: "longliteral",
|
|
9
|
+
initialValue,
|
|
10
|
+
tools: [
|
|
11
|
+
{
|
|
12
|
+
command: toggleMark(longLitSchema.marks.strong),
|
|
13
|
+
dom: icon("strong", gettext("Strong"))
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
command: toggleMark(longLitSchema.marks.em),
|
|
17
|
+
dom: icon("em", gettext("Emphasis"))
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
command: toggleMark(longLitSchema.marks.smallcaps),
|
|
21
|
+
dom: icon("smallcaps", gettext("Small caps"))
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
command: toggleMark(longLitSchema.marks.sub),
|
|
25
|
+
dom: icon("sub", gettext("Subscript₊"))
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
command: toggleMark(longLitSchema.marks.sup),
|
|
29
|
+
dom: icon("sup", gettext("Supscript²"))
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
init() { }
|
|
35
|
+
get value() {
|
|
36
|
+
return this.inlineInput.value;
|
|
37
|
+
}
|
|
38
|
+
check() {
|
|
39
|
+
return this.inlineInput.check();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=literal_long.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literal_long.js","sourceRoot":"","sources":["../../../src/form/fields/literal_long.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAC,WAAW,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AAE3C,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAA;AAEvD,MAAM,OAAO,oBAAoB;IAC7B,YAAY,GAAG,EAAE,YAAY,GAAG,EAAE;QAC9B,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,GAAG,EAAE;YACpC,MAAM,EAAE,aAAa;YACrB,QAAQ,EAAE,aAAa;YACvB,YAAY;YACZ,KAAK,EAAE;gBACH;oBACI,OAAO,EAAE,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;oBAC/C,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;iBACzC;gBACD;oBACI,OAAO,EAAE,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;oBAC3C,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;iBACvC;gBACD;oBACI,OAAO,EAAE,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC;oBAClD,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;iBAChD;gBACD;oBACI,OAAO,EAAE,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC;oBAC5C,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;iBAC1C;gBACD;oBACI,OAAO,EAAE,UAAU,CAAC,aAAa,CAAC,KAAK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