mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 21:21:08 +01:00
FIX: minor fixes
This commit is contained in:
parent
1f6bd4a2d3
commit
841c0804b6
3 changed files with 6 additions and 4 deletions
|
|
@ -1 +1,2 @@
|
||||||
export { default as FormulaField } from "./formulaField.mjs"
|
export { default as FormulaField } from "./formulaField.mjs";
|
||||||
|
export {default as ForeignDocumentUUIDField} from "./foreignDocumentUUIDField.mjs";
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
/**
|
/**
|
||||||
* A class extending DocumentUUIDField to allow selecting a foreign document reference
|
* A subclass of {@link foundry.data.fields.DocumentUUIDField} to allow selecting a foreign document reference
|
||||||
* that resolves to either the document, the index(for items in compenidums) or the UUID string.
|
* that resolves to either the document, the index(for items in compenidums) or the UUID string.
|
||||||
*/
|
*/
|
||||||
export default class ForeignDocumentUUIDField extends foundry.data.fields.DocumentUUIDField {
|
export default class ForeignDocumentUUIDField extends foundry.data.fields.DocumentUUIDField {
|
||||||
|
/** @inheritdoc */
|
||||||
static get _defaults() {
|
static get _defaults() {
|
||||||
return foundry.utils.mergeObject(super._defaults, {
|
return foundry.utils.mergeObject(super._defaults, {
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
@ -11,6 +12,7 @@ export default class ForeignDocumentUUIDField extends foundry.data.fields.Docume
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**@override */
|
||||||
initialize(value, _model, _options = {}) {
|
initialize(value, _model, _options = {}) {
|
||||||
if (this.idOnly) return value;
|
if (this.idOnly) return value;
|
||||||
return () => {
|
return () => {
|
||||||
|
|
@ -23,7 +25,7 @@ export default class ForeignDocumentUUIDField extends foundry.data.fields.Docume
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
/**@override */
|
||||||
toObject(value) {
|
toObject(value) {
|
||||||
return value?.uuid ?? value;
|
return value?.uuid ?? value;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -438,7 +438,6 @@
|
||||||
"documentTypes": {
|
"documentTypes": {
|
||||||
"Actor": {
|
"Actor": {
|
||||||
"pc": {},
|
"pc": {},
|
||||||
"npc": {},
|
|
||||||
"adversary": {},
|
"adversary": {},
|
||||||
"environment": {}
|
"environment": {}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue