jupiter-dynamic-forms 1.15.7 → 1.15.9
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/core/dynamic-form.d.ts.map +1 -1
- package/dist/core/form-field.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1495,6 +1495,7 @@ class XBRLFormBuilder {
|
|
|
1495
1495
|
const form$1 = {
|
|
1496
1496
|
loading: "Loading form...",
|
|
1497
1497
|
submit: "Validate",
|
|
1498
|
+
save: "Save",
|
|
1498
1499
|
saveDraft: "Save Draft",
|
|
1499
1500
|
errors: "Errors",
|
|
1500
1501
|
modified: "Modified",
|
|
@@ -1634,6 +1635,7 @@ const enTranslations = {
|
|
|
1634
1635
|
const form = {
|
|
1635
1636
|
loading: "Formulier laden...",
|
|
1636
1637
|
submit: "Valideren",
|
|
1638
|
+
save: "Opslaan",
|
|
1637
1639
|
saveDraft: "Concept opslaan",
|
|
1638
1640
|
errors: "Fouten",
|
|
1639
1641
|
modified: "Gewijzigd",
|
|
@@ -3241,7 +3243,8 @@ let JupiterFormField = class extends LitElement {
|
|
|
3241
3243
|
displayValue = effectiveValue !== null && effectiveValue !== void 0 ? String(effectiveValue) : "";
|
|
3242
3244
|
}
|
|
3243
3245
|
const isEmpty = displayValue === "" || displayValue === null || displayValue === void 0;
|
|
3244
|
-
|
|
3246
|
+
const isMonetary = this._isMonetaryType();
|
|
3247
|
+
return html`<span class="readonly-value ${isEmpty ? "empty" : ""} ${isMonetary ? "monetary" : ""}">${isEmpty ? "—" : displayValue}</span>`;
|
|
3245
3248
|
}
|
|
3246
3249
|
_renderInput(effectiveValue = this.value, effectiveDisabled = this.disabled) {
|
|
3247
3250
|
if (this.mode === "readonly") {
|
|
@@ -3838,6 +3841,7 @@ JupiterFormField.styles = css`
|
|
|
3838
3841
|
line-height: 1.4;
|
|
3839
3842
|
word-break: break-word;
|
|
3840
3843
|
min-height: 1.4em;
|
|
3844
|
+
text-align: left;
|
|
3841
3845
|
}
|
|
3842
3846
|
|
|
3843
3847
|
.readonly-value.empty {
|
|
@@ -3845,6 +3849,11 @@ JupiterFormField.styles = css`
|
|
|
3845
3849
|
font-style: italic;
|
|
3846
3850
|
}
|
|
3847
3851
|
|
|
3852
|
+
.readonly-value.monetary {
|
|
3853
|
+
text-align: right;
|
|
3854
|
+
width: 100%;
|
|
3855
|
+
}
|
|
3856
|
+
|
|
3848
3857
|
.checkbox-container {
|
|
3849
3858
|
display: flex;
|
|
3850
3859
|
align-items: center;
|
|
@@ -9476,7 +9485,15 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
9476
9485
|
concept.fields.forEach((field2) => {
|
|
9477
9486
|
var _a, _b, _c, _d;
|
|
9478
9487
|
const conceptData = this._formData[concept.id];
|
|
9479
|
-
|
|
9488
|
+
let fieldValue = conceptData == null ? void 0 : conceptData[field2.columnId];
|
|
9489
|
+
if ((fieldValue === void 0 || fieldValue === null || fieldValue === "") && this.masterData) {
|
|
9490
|
+
const baseConceptId = field2.conceptId || concept.id.split("__").slice(0, -1).join("__") || concept.id;
|
|
9491
|
+
const masterValue = this.masterData[baseConceptId];
|
|
9492
|
+
if (masterValue !== void 0 && masterValue !== null && masterValue !== "") {
|
|
9493
|
+
fieldValue = masterValue;
|
|
9494
|
+
console.warn(` 📦 [Submission] Using masterData for: ${baseConceptId} [${field2.columnId}] = ${JSON.stringify(fieldValue)}`);
|
|
9495
|
+
}
|
|
9496
|
+
}
|
|
9480
9497
|
if (fieldValue !== void 0 && fieldValue !== null && fieldValue !== "") {
|
|
9481
9498
|
const column2 = this._findColumnByIdInSection(field2.columnId, section2);
|
|
9482
9499
|
const fieldPeriodData = (_a = this._periodData[concept.id]) == null ? void 0 : _a[field2.columnId];
|
|
@@ -9725,7 +9742,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
9725
9742
|
}
|
|
9726
9743
|
}
|
|
9727
9744
|
_collectAllFields(concepts, sectionColumnIds, sectionColumns, allFields) {
|
|
9728
|
-
var _a, _b;
|
|
9745
|
+
var _a, _b, _c;
|
|
9729
9746
|
for (const concept of concepts) {
|
|
9730
9747
|
if (concept.abstract) {
|
|
9731
9748
|
if (concept.children && concept.children.length > 0) {
|
|
@@ -9738,16 +9755,15 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
9738
9755
|
for (const field2 of relevantFields) {
|
|
9739
9756
|
const conceptIdWithSuffix = concept.id;
|
|
9740
9757
|
const fieldConceptId = field2.conceptId;
|
|
9741
|
-
const isMasterDataField = this.masterData && this.masterData[fieldConceptId] !== void 0;
|
|
9742
|
-
if (isMasterDataField && this.masterData) {
|
|
9743
|
-
const masterValue = this.masterData[fieldConceptId];
|
|
9744
|
-
console.warn(` ⏭️ SKIPPING masterData field: ${fieldConceptId} [${field2.columnId}] = ${JSON.stringify(masterValue)}`);
|
|
9745
|
-
continue;
|
|
9746
|
-
}
|
|
9747
9758
|
let value = (_a = this._formData[conceptIdWithSuffix]) == null ? void 0 : _a[field2.columnId];
|
|
9748
9759
|
if (value === void 0 && conceptIdWithSuffix !== fieldConceptId) {
|
|
9749
9760
|
value = (_b = this._formData[fieldConceptId]) == null ? void 0 : _b[field2.columnId];
|
|
9750
9761
|
}
|
|
9762
|
+
const masterValue = (_c = this.masterData) == null ? void 0 : _c[fieldConceptId];
|
|
9763
|
+
if ((value === null || value === void 0 || typeof value === "string" && value.trim() === "") && masterValue !== void 0) {
|
|
9764
|
+
value = masterValue;
|
|
9765
|
+
console.warn(` 📦 Using masterData value for: ${fieldConceptId} [${field2.columnId}] = ${JSON.stringify(value)}`);
|
|
9766
|
+
}
|
|
9751
9767
|
let isEmpty = value === null || value === void 0 || typeof value === "string" && value.trim() === "";
|
|
9752
9768
|
if (isEmpty && concept.facts && concept.facts.length > 0) {
|
|
9753
9769
|
const column2 = sectionColumns.find((col) => col.id === field2.columnId);
|
|
@@ -10462,7 +10478,7 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
10462
10478
|
@click="${this._handleSubmit}"
|
|
10463
10479
|
?disabled="${this.disabled || this.readonly || this._submitDisabled}"
|
|
10464
10480
|
>
|
|
10465
|
-
${this.submitButtonLabel || I18n.t("form.submit")}
|
|
10481
|
+
${this.submitButtonLabel || (this.mode === "admin" ? I18n.t("form.save") : I18n.t("form.submit"))}
|
|
10466
10482
|
</button>
|
|
10467
10483
|
|
|
10468
10484
|
</div>
|