jupiter-dynamic-forms 1.14.9 → 1.15.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/dist/core/dynamic-form.d.ts.map +1 -1
- package/dist/core/filter-roles-dialog.d.ts.map +1 -1
- package/dist/core/form-field.d.ts +6 -0
- package/dist/core/form-field.d.ts.map +1 -1
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +85 -19
- package/dist/index.mjs.map +1 -1
- package/dist/utils/xbrl-validation.d.ts +1 -1
- package/dist/utils/xbrl-validation.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1593,7 +1593,21 @@ const admin$1 = {
|
|
|
1593
1593
|
};
|
|
1594
1594
|
const validation$1 = {
|
|
1595
1595
|
summary: "Please fix the following errors before submitting:",
|
|
1596
|
-
errorsFound: "errors found"
|
|
1596
|
+
errorsFound: "errors found",
|
|
1597
|
+
unitRequired: "Unit is required. Please select a unit via the period icon."
|
|
1598
|
+
};
|
|
1599
|
+
const xbrlValidation$1 = {
|
|
1600
|
+
patternMismatch: "Value does not match required pattern: {{pattern}}",
|
|
1601
|
+
invalidPattern: "Invalid pattern configuration: {{pattern}}",
|
|
1602
|
+
exactLength: "Value must be exactly {{required}} characters (current: {{current}})",
|
|
1603
|
+
minLength: "Value must be at least {{required}} characters (current: {{current}})",
|
|
1604
|
+
maxLength: "Value must not exceed {{required}} characters (current: {{current}})",
|
|
1605
|
+
totalDigits: "Value must not exceed {{required}} total digits (current: {{current}})",
|
|
1606
|
+
ruleSummaryPattern: "Must match pattern: {{pattern}}",
|
|
1607
|
+
ruleSummaryExactLength: "Must be exactly {{required}} characters",
|
|
1608
|
+
ruleSummaryMinLength: "Minimum {{required}} characters",
|
|
1609
|
+
ruleSummaryMaxLength: "Maximum {{required}} characters",
|
|
1610
|
+
ruleSummaryTotalDigits: "Maximum {{required}} total digits"
|
|
1597
1611
|
};
|
|
1598
1612
|
const error$1 = {
|
|
1599
1613
|
popup: {
|
|
@@ -1614,6 +1628,7 @@ const enTranslations = {
|
|
|
1614
1628
|
field: field$1,
|
|
1615
1629
|
admin: admin$1,
|
|
1616
1630
|
validation: validation$1,
|
|
1631
|
+
xbrlValidation: xbrlValidation$1,
|
|
1617
1632
|
error: error$1
|
|
1618
1633
|
};
|
|
1619
1634
|
const form = {
|
|
@@ -1717,7 +1732,21 @@ const admin = {
|
|
|
1717
1732
|
};
|
|
1718
1733
|
const validation = {
|
|
1719
1734
|
summary: "Corrigeer de volgende fouten voordat u indient:",
|
|
1720
|
-
errorsFound: "fouten gevonden"
|
|
1735
|
+
errorsFound: "fouten gevonden",
|
|
1736
|
+
unitRequired: "Eenheid is verplicht. Selecteer een eenheid via het periodeicoon."
|
|
1737
|
+
};
|
|
1738
|
+
const xbrlValidation = {
|
|
1739
|
+
patternMismatch: "Waarde voldoet niet aan het vereiste patroon: {{pattern}}",
|
|
1740
|
+
invalidPattern: "Ongeldige patternconfiguratie: {{pattern}}",
|
|
1741
|
+
exactLength: "Waarde moet exact {{required}} tekens bevatten (huidig: {{current}})",
|
|
1742
|
+
minLength: "Waarde moet minimaal {{required}} tekens bevatten (huidig: {{current}})",
|
|
1743
|
+
maxLength: "Waarde mag niet meer dan {{required}} tekens bevatten (huidig: {{current}})",
|
|
1744
|
+
totalDigits: "Waarde mag niet meer dan {{required}} cijfers bevatten (huidig: {{current}})",
|
|
1745
|
+
ruleSummaryPattern: "Moet overeenkomen met patroon: {{pattern}}",
|
|
1746
|
+
ruleSummaryExactLength: "Moet exact {{required}} tekens bevatten",
|
|
1747
|
+
ruleSummaryMinLength: "Minimaal {{required}} tekens",
|
|
1748
|
+
ruleSummaryMaxLength: "Maximaal {{required}} tekens",
|
|
1749
|
+
ruleSummaryTotalDigits: "Maximaal {{required}} cijfers"
|
|
1721
1750
|
};
|
|
1722
1751
|
const error = {
|
|
1723
1752
|
popup: {
|
|
@@ -1738,6 +1767,7 @@ const nlTranslations = {
|
|
|
1738
1767
|
field,
|
|
1739
1768
|
admin,
|
|
1740
1769
|
validation,
|
|
1770
|
+
xbrlValidation,
|
|
1741
1771
|
error
|
|
1742
1772
|
};
|
|
1743
1773
|
const translations = {
|
|
@@ -2338,7 +2368,7 @@ class XBRLValidator {
|
|
|
2338
2368
|
if (!regex.test(value)) {
|
|
2339
2369
|
return {
|
|
2340
2370
|
type: "pattern",
|
|
2341
|
-
message:
|
|
2371
|
+
message: I18n.t("xbrlValidation.patternMismatch", { pattern }),
|
|
2342
2372
|
expectedValue: pattern,
|
|
2343
2373
|
actualValue: value
|
|
2344
2374
|
};
|
|
@@ -2347,7 +2377,7 @@ class XBRLValidator {
|
|
|
2347
2377
|
console.error(`Invalid regex pattern: ${pattern}`, error2);
|
|
2348
2378
|
return {
|
|
2349
2379
|
type: "pattern",
|
|
2350
|
-
message:
|
|
2380
|
+
message: I18n.t("xbrlValidation.invalidPattern", { pattern }),
|
|
2351
2381
|
expectedValue: pattern,
|
|
2352
2382
|
actualValue: value
|
|
2353
2383
|
};
|
|
@@ -2361,7 +2391,7 @@ class XBRLValidator {
|
|
|
2361
2391
|
if (value.length !== requiredLength) {
|
|
2362
2392
|
return {
|
|
2363
2393
|
type: "length",
|
|
2364
|
-
message:
|
|
2394
|
+
message: I18n.t("xbrlValidation.exactLength", { required: requiredLength, current: value.length }),
|
|
2365
2395
|
expectedValue: requiredLength,
|
|
2366
2396
|
actualValue: value.length
|
|
2367
2397
|
};
|
|
@@ -2375,7 +2405,7 @@ class XBRLValidator {
|
|
|
2375
2405
|
if (value.length < minLength) {
|
|
2376
2406
|
return {
|
|
2377
2407
|
type: "minLength",
|
|
2378
|
-
message:
|
|
2408
|
+
message: I18n.t("xbrlValidation.minLength", { required: minLength, current: value.length }),
|
|
2379
2409
|
expectedValue: minLength,
|
|
2380
2410
|
actualValue: value.length
|
|
2381
2411
|
};
|
|
@@ -2389,7 +2419,7 @@ class XBRLValidator {
|
|
|
2389
2419
|
if (value.length > maxLength) {
|
|
2390
2420
|
return {
|
|
2391
2421
|
type: "maxLength",
|
|
2392
|
-
message:
|
|
2422
|
+
message: I18n.t("xbrlValidation.maxLength", { required: maxLength, current: value.length }),
|
|
2393
2423
|
expectedValue: maxLength,
|
|
2394
2424
|
actualValue: value.length
|
|
2395
2425
|
};
|
|
@@ -2404,7 +2434,7 @@ class XBRLValidator {
|
|
|
2404
2434
|
if (digitsOnly.length > totalDigits) {
|
|
2405
2435
|
return {
|
|
2406
2436
|
type: "totalDigits",
|
|
2407
|
-
message:
|
|
2437
|
+
message: I18n.t("xbrlValidation.totalDigits", { required: totalDigits, current: digitsOnly.length }),
|
|
2408
2438
|
expectedValue: totalDigits,
|
|
2409
2439
|
actualValue: digitsOnly.length
|
|
2410
2440
|
};
|
|
@@ -2426,19 +2456,19 @@ class XBRLValidator {
|
|
|
2426
2456
|
const validation2 = datatype.validation;
|
|
2427
2457
|
const rules = [];
|
|
2428
2458
|
if (validation2.pattern) {
|
|
2429
|
-
rules.push(
|
|
2459
|
+
rules.push(I18n.t("xbrlValidation.ruleSummaryPattern", { pattern: validation2.pattern }));
|
|
2430
2460
|
}
|
|
2431
2461
|
if (validation2.length !== void 0) {
|
|
2432
|
-
rules.push(
|
|
2462
|
+
rules.push(I18n.t("xbrlValidation.ruleSummaryExactLength", { required: validation2.length }));
|
|
2433
2463
|
}
|
|
2434
2464
|
if (validation2.minLength !== void 0) {
|
|
2435
|
-
rules.push(
|
|
2465
|
+
rules.push(I18n.t("xbrlValidation.ruleSummaryMinLength", { required: validation2.minLength }));
|
|
2436
2466
|
}
|
|
2437
2467
|
if (validation2.maxLength !== void 0) {
|
|
2438
|
-
rules.push(
|
|
2468
|
+
rules.push(I18n.t("xbrlValidation.ruleSummaryMaxLength", { required: validation2.maxLength }));
|
|
2439
2469
|
}
|
|
2440
2470
|
if (validation2.totalDigits !== void 0) {
|
|
2441
|
-
rules.push(
|
|
2471
|
+
rules.push(I18n.t("xbrlValidation.ruleSummaryTotalDigits", { required: validation2.totalDigits }));
|
|
2442
2472
|
}
|
|
2443
2473
|
return rules;
|
|
2444
2474
|
}
|
|
@@ -2931,6 +2961,7 @@ let JupiterFormField = class extends LitElement {
|
|
|
2931
2961
|
_handleBlur() {
|
|
2932
2962
|
this._touched = true;
|
|
2933
2963
|
this._validateXBRLDatatype();
|
|
2964
|
+
this._validateUnitSelection();
|
|
2934
2965
|
console.log(`🟦 [FormField] Blur event - fieldId: ${this.field.id}, conceptId: ${this.conceptId}, columnId: ${this.columnId}`);
|
|
2935
2966
|
console.log(`🟦 [FormField] Current _xbrlErrors:`, this._xbrlErrors);
|
|
2936
2967
|
console.log(`🟦 [FormField] Current value:`, this.value);
|
|
@@ -3029,6 +3060,32 @@ let JupiterFormField = class extends LitElement {
|
|
|
3029
3060
|
console.log(`✅ [FormField] XBRL Validation passed for ${this.conceptId}`);
|
|
3030
3061
|
}
|
|
3031
3062
|
}
|
|
3063
|
+
/**
|
|
3064
|
+
* Validates that a unit is selected when units are available and a value has been entered.
|
|
3065
|
+
* Appends a unit error to _xbrlErrors if validation fails.
|
|
3066
|
+
* Called after _validateXBRLDatatype() so it can append to existing errors.
|
|
3067
|
+
*/
|
|
3068
|
+
_validateUnitSelection() {
|
|
3069
|
+
if (this.value === null || this.value === void 0 || this.value === "") {
|
|
3070
|
+
return;
|
|
3071
|
+
}
|
|
3072
|
+
const availableUnits = this._collectUnitsForConceptType();
|
|
3073
|
+
if (availableUnits.length === 0) {
|
|
3074
|
+
return;
|
|
3075
|
+
}
|
|
3076
|
+
if (!this.unit) {
|
|
3077
|
+
this._xbrlErrors = [
|
|
3078
|
+
...this._xbrlErrors,
|
|
3079
|
+
{
|
|
3080
|
+
type: "unit",
|
|
3081
|
+
message: I18n.t("validation.unitRequired"),
|
|
3082
|
+
expectedValue: availableUnits.map((u2) => u2.label).join(", "),
|
|
3083
|
+
actualValue: ""
|
|
3084
|
+
}
|
|
3085
|
+
];
|
|
3086
|
+
console.log(`❌ [FormField] Unit validation failed for ${this.conceptId}: unit is required but not selected`);
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3032
3089
|
_handlePeriodIconClick() {
|
|
3033
3090
|
this._availableUnits = this._collectUnitsForConceptType();
|
|
3034
3091
|
console.log(`📊 [FormField] Collected ${this._availableUnits.length} units for concept ${this.conceptId}:`, this._availableUnits);
|
|
@@ -6336,6 +6393,9 @@ let JupiterFilterRolesDialog = class extends LitElement {
|
|
|
6336
6393
|
${dimensions.map((dimension) => {
|
|
6337
6394
|
var _a2, _b;
|
|
6338
6395
|
const allMembers = this._getAllDimensionMembers(dimension.members);
|
|
6396
|
+
if (allMembers.length === 0) {
|
|
6397
|
+
return html``;
|
|
6398
|
+
}
|
|
6339
6399
|
const dimensionLabel = ((_b = (_a2 = dimension.labels) == null ? void 0 : _a2.find((l2) => l2.role === "http://www.xbrl.org/2003/role/label")) == null ? void 0 : _b.label) || dimension.conceptName;
|
|
6340
6400
|
const isSingleMember = this._isSingleMemberDimension(dimension);
|
|
6341
6401
|
return html`
|
|
@@ -10300,16 +10360,21 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
10300
10360
|
<div class="error-popup-content">
|
|
10301
10361
|
<p>${I18n.t("error.popup.message")}</p>
|
|
10302
10362
|
<ul class="error-list">
|
|
10303
|
-
${this._xbrlFormErrors.map((error2) =>
|
|
10363
|
+
${this._xbrlFormErrors.map((error2) => {
|
|
10364
|
+
const concept = this._findConceptInAllSections(error2.conceptId);
|
|
10365
|
+
const column2 = this._findColumnById(error2.columnId);
|
|
10366
|
+
const fieldLabel = (concept == null ? void 0 : concept.label) || error2.conceptId;
|
|
10367
|
+
const columnTitle = (column2 == null ? void 0 : column2.title) || error2.columnId;
|
|
10368
|
+
return html`
|
|
10304
10369
|
<li>
|
|
10305
|
-
<strong>${I18n.t("error.popup.field")}</strong>
|
|
10306
|
-
<a
|
|
10307
|
-
href="javascript:void(0)"
|
|
10370
|
+
<strong>${I18n.t("error.popup.field")}</strong>
|
|
10371
|
+
<a
|
|
10372
|
+
href="javascript:void(0)"
|
|
10308
10373
|
class="error-field-link"
|
|
10309
10374
|
@click="${() => this._handleErrorFieldClick(error2.conceptId, error2.columnId, error2.sectionId)}"
|
|
10310
10375
|
title="${I18n.t("error.popup.clickToFocus")}"
|
|
10311
10376
|
>
|
|
10312
|
-
${
|
|
10377
|
+
${fieldLabel} (${columnTitle})
|
|
10313
10378
|
</a><br>
|
|
10314
10379
|
<strong>${I18n.t("error.popup.value")}</strong> ${error2.value}<br>
|
|
10315
10380
|
<strong>${I18n.t("error.popup.errors")}</strong>
|
|
@@ -10317,7 +10382,8 @@ let JupiterDynamicForm = class extends LitElement {
|
|
|
10317
10382
|
${error2.errors.map((err) => html`<li>${err.message}</li>`)}
|
|
10318
10383
|
</ul>
|
|
10319
10384
|
</li>
|
|
10320
|
-
|
|
10385
|
+
`;
|
|
10386
|
+
})}
|
|
10321
10387
|
</ul>
|
|
10322
10388
|
</div>
|
|
10323
10389
|
<div class="error-popup-footer">
|