ixbrl-viewer 1.4.1__py3-none-any.whl → 1.4.86__py3-none-any.whl
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.
- iXBRLViewerPlugin/__init__.py +231 -127
- iXBRLViewerPlugin/_version.py +33 -3
- iXBRLViewerPlugin/constants.py +96 -2
- iXBRLViewerPlugin/featureConfig.py +8 -1
- iXBRLViewerPlugin/iXBRLViewer.py +356 -214
- iXBRLViewerPlugin/plugin.py +12 -0
- iXBRLViewerPlugin/ui.py +81 -50
- iXBRLViewerPlugin/viewer/dist/ixbrlviewer.js +1 -1
- iXBRLViewerPlugin/viewer/dist/ixbrlviewer.js.LICENSE.txt +12 -5
- iXBRLViewerPlugin/viewer/i18next-parser.config.js +1 -1
- iXBRLViewerPlugin/viewer/src/data/utr.json +1244 -0
- iXBRLViewerPlugin/viewer/src/html/fact-details.html +69 -38
- iXBRLViewerPlugin/viewer/src/html/footer-logo.html +4 -0
- iXBRLViewerPlugin/viewer/src/html/footnote-details.html +2 -2
- iXBRLViewerPlugin/viewer/src/html/inspector.html +352 -197
- iXBRLViewerPlugin/viewer/src/i18n/cy/balancetypes.json +1 -0
- iXBRLViewerPlugin/viewer/src/i18n/cy/currencies.json +13 -0
- iXBRLViewerPlugin/viewer/src/i18n/cy/datatypes.json +9 -0
- iXBRLViewerPlugin/viewer/src/i18n/cy/labelroles.json +24 -0
- iXBRLViewerPlugin/viewer/src/i18n/cy/referenceparts.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/cy/scale.json +16 -0
- iXBRLViewerPlugin/viewer/src/i18n/cy/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/cy/translation.json +179 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/balancetypes.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/currencies.json +13 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/datatypes.json +9 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/labelroles.json +24 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/referenceparts.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/scale.json +15 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/translation.json +179 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/balancetypes.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/currencies.json +13 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/datatypes.json +9 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/labelroles.json +24 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/referenceparts.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/scale.json +15 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/translation.json +179 -0
- iXBRLViewerPlugin/viewer/src/i18n/en/balancetypes.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/en/datatypes.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/en/labelroles.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/en/scale.json +16 -0
- iXBRLViewerPlugin/viewer/src/i18n/en/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/en/translation.json +73 -23
- iXBRLViewerPlugin/viewer/src/i18n/es/balancetypes.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/es/datatypes.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/es/labelroles.json +24 -0
- iXBRLViewerPlugin/viewer/src/i18n/es/scale.json +16 -0
- iXBRLViewerPlugin/viewer/src/i18n/es/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/es/translation.json +87 -37
- iXBRLViewerPlugin/viewer/src/i18n/fr/balancetypes.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/fr/currencies.json +13 -0
- iXBRLViewerPlugin/viewer/src/i18n/fr/datatypes.json +9 -0
- iXBRLViewerPlugin/viewer/src/i18n/fr/labelroles.json +24 -0
- iXBRLViewerPlugin/viewer/src/i18n/fr/referenceparts.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/fr/scale.json +15 -0
- iXBRLViewerPlugin/viewer/src/i18n/fr/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/fr/translation.json +179 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/balancetypes.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/currencies.json +13 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/datatypes.json +9 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/labelroles.json +24 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/referenceparts.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/scale.json +15 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/translation.json +179 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/balancetypes.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/currencies.json +13 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/datatypes.json +9 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/labelroles.json +24 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/referenceparts.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/scale.json +15 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/translation.json +179 -0
- iXBRLViewerPlugin/viewer/src/icons/calculator.svg +13 -0
- iXBRLViewerPlugin/viewer/src/icons/circle-cross.svg +11 -0
- iXBRLViewerPlugin/viewer/src/icons/circle-tick.svg +11 -0
- iXBRLViewerPlugin/viewer/src/icons/dark-mode.svg +4 -0
- iXBRLViewerPlugin/viewer/src/icons/dimension.svg +1 -5
- iXBRLViewerPlugin/viewer/src/icons/member.svg +2 -5
- iXBRLViewerPlugin/viewer/src/icons/multi-tag.svg +10 -0
- iXBRLViewerPlugin/viewer/src/img/arelle-dark.svg +179 -0
- iXBRLViewerPlugin/viewer/src/img/inline-viewer-dark.svg +59 -0
- iXBRLViewerPlugin/viewer/src/js/accordian.js +5 -4
- iXBRLViewerPlugin/viewer/src/js/aspect.js +29 -10
- iXBRLViewerPlugin/viewer/src/js/aspect.test.js +40 -31
- iXBRLViewerPlugin/viewer/src/js/balance.js +14 -0
- iXBRLViewerPlugin/viewer/src/js/calculation.js +213 -0
- iXBRLViewerPlugin/viewer/src/js/calculation.test.js +306 -0
- iXBRLViewerPlugin/viewer/src/js/calculationInspector.js +187 -0
- iXBRLViewerPlugin/viewer/src/js/chart.js +26 -24
- iXBRLViewerPlugin/viewer/src/js/chart.test.js +10 -9
- iXBRLViewerPlugin/viewer/src/js/concept.js +37 -4
- iXBRLViewerPlugin/viewer/src/js/concept.test.js +30 -6
- iXBRLViewerPlugin/viewer/src/js/datatype.js +20 -0
- iXBRLViewerPlugin/viewer/src/js/datatype.test.js +62 -0
- iXBRLViewerPlugin/viewer/src/js/dialog.js +6 -4
- iXBRLViewerPlugin/viewer/src/js/docOrderIndex.js +7 -7
- iXBRLViewerPlugin/viewer/src/js/fact.js +156 -59
- iXBRLViewerPlugin/viewer/src/js/fact.test.js +160 -29
- iXBRLViewerPlugin/viewer/src/js/factset.js +64 -15
- iXBRLViewerPlugin/viewer/src/js/factset.test.js +102 -31
- iXBRLViewerPlugin/viewer/src/js/footnote.js +8 -2
- iXBRLViewerPlugin/viewer/src/js/index.js +11 -3
- iXBRLViewerPlugin/viewer/src/js/inspector.js +747 -221
- iXBRLViewerPlugin/viewer/src/js/inspector.test.js +143 -25
- iXBRLViewerPlugin/viewer/src/js/interval.js +70 -0
- iXBRLViewerPlugin/viewer/src/js/interval.test.js +153 -0
- iXBRLViewerPlugin/viewer/src/js/ixbrlviewer.js +391 -262
- iXBRLViewerPlugin/viewer/src/js/ixbrlviewer.test.js +134 -20
- iXBRLViewerPlugin/viewer/src/js/ixnode.js +1 -1
- iXBRLViewerPlugin/viewer/src/js/menu.js +25 -7
- iXBRLViewerPlugin/viewer/src/js/number-matcher.js +7 -3
- iXBRLViewerPlugin/viewer/src/js/number-matcher.test.js +4 -0
- iXBRLViewerPlugin/viewer/src/js/outline.js +34 -13
- iXBRLViewerPlugin/viewer/src/js/outline.test.js +97 -91
- iXBRLViewerPlugin/viewer/src/js/period.js +0 -1
- iXBRLViewerPlugin/viewer/src/js/report.js +260 -351
- iXBRLViewerPlugin/viewer/src/js/report.test.js +95 -27
- iXBRLViewerPlugin/viewer/src/js/reportset.js +264 -0
- iXBRLViewerPlugin/viewer/src/js/reportset.test.js +357 -0
- iXBRLViewerPlugin/viewer/src/js/search.js +72 -38
- iXBRLViewerPlugin/viewer/src/js/search.test.js +184 -84
- iXBRLViewerPlugin/viewer/src/js/summary.js +34 -8
- iXBRLViewerPlugin/viewer/src/js/summary.test.js +69 -25
- iXBRLViewerPlugin/viewer/src/js/tableExport.js +9 -9
- iXBRLViewerPlugin/viewer/src/js/taxonomynamer.js +34 -0
- iXBRLViewerPlugin/viewer/src/js/taxonomynamer.test.js +32 -0
- iXBRLViewerPlugin/viewer/src/js/test-utils.js +46 -0
- iXBRLViewerPlugin/viewer/src/js/theme.js +50 -0
- iXBRLViewerPlugin/viewer/src/js/unit.js +90 -32
- iXBRLViewerPlugin/viewer/src/js/unit.test.js +62 -25
- iXBRLViewerPlugin/viewer/src/js/util.js +94 -0
- iXBRLViewerPlugin/viewer/src/js/util.test.js +33 -1
- iXBRLViewerPlugin/viewer/src/js/utr.js +27 -0
- iXBRLViewerPlugin/viewer/src/js/viewer.js +205 -181
- iXBRLViewerPlugin/viewer/src/js/viewerOptions.js +0 -2
- iXBRLViewerPlugin/viewer/src/less/accordian.less +10 -6
- iXBRLViewerPlugin/viewer/src/less/block-list.less +16 -5
- iXBRLViewerPlugin/viewer/src/less/calculation-inspector.less +83 -0
- iXBRLViewerPlugin/viewer/src/less/chart.less +8 -5
- iXBRLViewerPlugin/viewer/src/less/colours-dark-mode.less +40 -0
- iXBRLViewerPlugin/viewer/src/less/colours.less +32 -20
- iXBRLViewerPlugin/viewer/src/less/common.less +3 -3
- iXBRLViewerPlugin/viewer/src/less/components.less +6 -4
- iXBRLViewerPlugin/viewer/src/less/core.less +2 -0
- iXBRLViewerPlugin/viewer/src/less/dialog.less +21 -14
- iXBRLViewerPlugin/viewer/src/less/form-controls.less +33 -11
- iXBRLViewerPlugin/viewer/src/less/inspector.less +1045 -726
- iXBRLViewerPlugin/viewer/src/less/loader.less +2 -2
- iXBRLViewerPlugin/viewer/src/less/menu.less +33 -15
- iXBRLViewerPlugin/viewer/src/less/summary.less +16 -6
- iXBRLViewerPlugin/viewer/src/less/tabs.less +9 -9
- iXBRLViewerPlugin/viewer/src/less/text-block-viewer.less +2 -0
- iXBRLViewerPlugin/viewer/src/less/text-mixins.less +2 -1
- iXBRLViewerPlugin/viewer/src/less/validation-report.less +2 -3
- iXBRLViewerPlugin/viewer/src/less/viewer.less +105 -74
- iXBRLViewerPlugin/viewer/webpack.common.js +19 -9
- iXBRLViewerPlugin/xhtmlserialize.py +59 -45
- {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info}/METADATA +181 -50
- ixbrl_viewer-1.4.86.dist-info/RECORD +217 -0
- {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info}/WHEEL +1 -1
- ixbrl_viewer-1.4.1.dist-info/LICENSE → ixbrl_viewer-1.4.86.dist-info/licenses/LICENSE.md +8 -14
- {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info}/top_level.txt +0 -1
- iXBRLViewerPlugin/viewer/src/js/calculations.js +0 -111
- iXBRLViewerPlugin/viewer/src/js/interact.min.js +0 -6
- ixbrl_viewer-1.4.1.dist-info/RECORD +0 -155
- tests/__init__.py +0 -0
- tests/puppeteer/framework/core_elements.js +0 -117
- tests/puppeteer/framework/page_objects/doc_frame.js +0 -105
- tests/puppeteer/framework/page_objects/fact_details_panel.js +0 -80
- tests/puppeteer/framework/page_objects/search_panel.js +0 -76
- tests/puppeteer/framework/page_objects/toolbar.js +0 -18
- tests/puppeteer/framework/utils.js +0 -3
- tests/puppeteer/framework/viewer_page.js +0 -103
- tests/puppeteer/puppeteer_test_run_via_intellij.jpg +0 -0
- tests/puppeteer/test_filings/filing_documents_smoke_test.zip +0 -0
- tests/puppeteer/test_filings/highlights.zip +0 -0
- tests/puppeteer/tests/fact_properties.test.js +0 -78
- tests/puppeteer/tests/highlight.test.js +0 -186
- tests/puppeteer/tests/search.test.js +0 -86
- tests/puppeteer/tools/generate.sh +0 -15
- tests/unit_tests/__init__.py +0 -0
- tests/unit_tests/iXBRLViewerPlugin/__init__.py +0 -0
- tests/unit_tests/iXBRLViewerPlugin/mock_arelle.py +0 -39
- tests/unit_tests/iXBRLViewerPlugin/test_iXBRLViewer.py +0 -641
- tests/unit_tests/iXBRLViewerPlugin/test_xhtmlserialize.py +0 -310
- {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info}/entry_points.txt +0 -0
- {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info/licenses}/NOTICE +0 -0
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
// See COPYRIGHT.md for copyright information
|
|
2
2
|
|
|
3
|
-
import { Fact } from "./fact.js";
|
|
4
3
|
import { FactSet } from "./factset.js";
|
|
5
|
-
import {
|
|
4
|
+
import { Fact } from "./fact.js";
|
|
5
|
+
import { NAMESPACE_ISO4217, viewerUniqueId } from "./util.js";
|
|
6
|
+
import { ReportSet } from "./reportset.js";
|
|
7
|
+
import './test-utils.js';
|
|
6
8
|
|
|
7
9
|
var i = 0;
|
|
8
10
|
|
|
9
11
|
var testReportData = {
|
|
10
12
|
"prefixes": {
|
|
11
13
|
"eg": "http://www.example.com",
|
|
12
|
-
"iso4217":
|
|
14
|
+
"iso4217": NAMESPACE_ISO4217,
|
|
13
15
|
"e": "http://example.com/entity",
|
|
14
16
|
},
|
|
15
17
|
"concepts": {
|
|
@@ -71,12 +73,13 @@ var testReportData = {
|
|
|
71
73
|
}
|
|
72
74
|
};
|
|
73
75
|
|
|
74
|
-
function
|
|
76
|
+
function testReportSet(facts) {
|
|
75
77
|
// Deep copy of standing data
|
|
76
|
-
|
|
78
|
+
const data = JSON.parse(JSON.stringify(testReportData));
|
|
77
79
|
data.facts = facts;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
const reportset = new ReportSet(data);
|
|
81
|
+
reportset._initialize();
|
|
82
|
+
return reportset;
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
function testFact(aspectData) {
|
|
@@ -84,42 +87,46 @@ function testFact(aspectData) {
|
|
|
84
87
|
return factData;
|
|
85
88
|
}
|
|
86
89
|
|
|
90
|
+
function getFact(reportSet, id) {
|
|
91
|
+
return reportSet.getItemById(viewerUniqueId(0, id));
|
|
92
|
+
}
|
|
93
|
+
|
|
87
94
|
describe("Minimally unique labels (non-dimensional)", () => {
|
|
88
|
-
|
|
95
|
+
const reportSet = testReportSet({
|
|
89
96
|
"f1": testFact({"c": "eg:Concept1", "p": "2018-01-01"}),
|
|
90
97
|
"f2": testFact({"c": "eg:Concept2", "p": "2018-01-01"}),
|
|
91
98
|
"f3": testFact({"c": "eg:Concept2", "p": "2019-01-01"}),
|
|
92
99
|
"f4": testFact({"c": "eg:Concept2", "p": "2019-01-01"}),
|
|
93
100
|
});
|
|
94
101
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
102
|
+
const f1 = getFact(reportSet, "f1");
|
|
103
|
+
const f2 = getFact(reportSet, "f2");
|
|
104
|
+
const f3 = getFact(reportSet, "f3");
|
|
105
|
+
const f4 = getFact(reportSet, "f4");
|
|
99
106
|
|
|
100
107
|
test("Different concept", () => {
|
|
101
|
-
|
|
108
|
+
const fs = new FactSet([ f1, f2 ]);
|
|
102
109
|
expect(fs._allDimensions()).toEqual([]);
|
|
103
110
|
expect(fs.minimallyUniqueLabel(f1)).toEqual("Concept 1");
|
|
104
111
|
expect(fs.minimallyUniqueLabel(f2)).toEqual("Concept 2");
|
|
105
112
|
});
|
|
106
113
|
|
|
107
114
|
test("Different period", () => {
|
|
108
|
-
|
|
115
|
+
const fs = new FactSet([ f2, f3 ]);
|
|
109
116
|
expect(fs._allDimensions()).toEqual([]);
|
|
110
117
|
expect(fs.minimallyUniqueLabel(f2)).toEqual("31 Dec 2017");
|
|
111
118
|
expect(fs.minimallyUniqueLabel(f3)).toEqual("31 Dec 2018");
|
|
112
119
|
});
|
|
113
120
|
|
|
114
121
|
test("Different concept and period, concept takes precedence", () => {
|
|
115
|
-
|
|
122
|
+
const fs = new FactSet([ f1, f4 ]);
|
|
116
123
|
expect(fs._allDimensions()).toEqual([]);
|
|
117
124
|
expect(fs.minimallyUniqueLabel(f1)).toEqual("Concept 1");
|
|
118
125
|
expect(fs.minimallyUniqueLabel(f4)).toEqual("Concept 2");
|
|
119
126
|
});
|
|
120
127
|
|
|
121
128
|
test("Mix of period and concept differences", () => {
|
|
122
|
-
|
|
129
|
+
const fs = new FactSet([ f1, f2, f3 ]);
|
|
123
130
|
expect(fs._allDimensions()).toEqual([]);
|
|
124
131
|
expect(fs.minimallyUniqueLabel(f1)).toEqual("Concept 1, 31 Dec 2017");
|
|
125
132
|
expect(fs.minimallyUniqueLabel(f2)).toEqual("Concept 2, 31 Dec 2017");
|
|
@@ -128,27 +135,27 @@ describe("Minimally unique labels (non-dimensional)", () => {
|
|
|
128
135
|
});
|
|
129
136
|
|
|
130
137
|
describe("Minimally unique labels (dimensional)", () => {
|
|
131
|
-
|
|
138
|
+
const reportSet = testReportSet({
|
|
132
139
|
"f1": testFact({"c": "eg:Concept1", "p": "2018-01-01", "eg:Dimension1": "eg:DimensionValue1"}),
|
|
133
140
|
"f2": testFact({"c": "eg:Concept1", "p": "2018-01-01", "eg:Dimension1": "eg:DimensionValue2"}),
|
|
134
141
|
"f3": testFact({"c": "eg:Concept1", "p": "2019-01-01", "eg:Dimension1": "eg:DimensionValue2"}),
|
|
135
142
|
"f4": testFact({"c": "eg:Concept1", "p": "2018-01-01" }),
|
|
136
143
|
});
|
|
137
144
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
145
|
+
const f1 = getFact(reportSet, "f1");
|
|
146
|
+
const f2 = getFact(reportSet, "f2");
|
|
147
|
+
const f3 = getFact(reportSet, "f3");
|
|
148
|
+
const f4 = getFact(reportSet, "f4");
|
|
142
149
|
|
|
143
150
|
test("Same concept & period, different dimension value", () => {
|
|
144
|
-
|
|
151
|
+
const fs = new FactSet([ f1, f2 ]);
|
|
145
152
|
expect(fs._allDimensions()).toEqual(["eg:Dimension1"]);
|
|
146
153
|
expect(fs.minimallyUniqueLabel(f1)).toEqual("Dimension Value 1");
|
|
147
154
|
expect(fs.minimallyUniqueLabel(f2)).toEqual("Dimension Value 2");
|
|
148
155
|
});
|
|
149
156
|
|
|
150
157
|
test("Different period, different dimension value", () => {
|
|
151
|
-
|
|
158
|
+
const fs = new FactSet([ f1, f3 ]);
|
|
152
159
|
expect(fs._allDimensions()).toEqual(["eg:Dimension1"]);
|
|
153
160
|
/* Different period takes precedence */
|
|
154
161
|
expect(fs.minimallyUniqueLabel(f1)).toEqual("31 Dec 2017");
|
|
@@ -156,7 +163,7 @@ describe("Minimally unique labels (dimensional)", () => {
|
|
|
156
163
|
});
|
|
157
164
|
|
|
158
165
|
test("Dimension present on one fact only", () => {
|
|
159
|
-
|
|
166
|
+
const fs = new FactSet([ f1, f4 ]);
|
|
160
167
|
expect(fs._allDimensions()).toEqual(["eg:Dimension1"]);
|
|
161
168
|
/* Concept is included even though it's the same across all to avoid an
|
|
162
169
|
* empty label */
|
|
@@ -167,16 +174,16 @@ describe("Minimally unique labels (dimensional)", () => {
|
|
|
167
174
|
});
|
|
168
175
|
|
|
169
176
|
describe("Minimally unique labels (duplicate facts)", () => {
|
|
170
|
-
|
|
177
|
+
const reportSet = testReportSet({
|
|
171
178
|
"f1": testFact({"c": "eg:Concept1", "p": "2018-01-01", "eg:Dimension1": "eg:DimensionValue1"}),
|
|
172
179
|
"f2": testFact({"c": "eg:Concept1", "p": "2018-01-01", "eg:Dimension1": "eg:DimensionValue1"}),
|
|
173
180
|
});
|
|
174
181
|
|
|
175
|
-
|
|
176
|
-
|
|
182
|
+
const f1 = getFact(reportSet, "f1");
|
|
183
|
+
const f2 = getFact(reportSet, "f2");
|
|
177
184
|
|
|
178
185
|
test("Two facts, all aspects the same", () => {
|
|
179
|
-
|
|
186
|
+
const fs = new FactSet([ f1, f2 ]);
|
|
180
187
|
expect(fs._allDimensions()).toEqual(["eg:Dimension1"]);
|
|
181
188
|
expect(fs.minimallyUniqueLabel(f1)).toEqual("Concept 1");
|
|
182
189
|
expect(fs.minimallyUniqueLabel(f2)).toEqual("Concept 1");
|
|
@@ -184,13 +191,13 @@ describe("Minimally unique labels (duplicate facts)", () => {
|
|
|
184
191
|
});
|
|
185
192
|
|
|
186
193
|
describe("Minimally unique labels (missing labels)", () => {
|
|
187
|
-
|
|
194
|
+
const reportSet = testReportSet({
|
|
188
195
|
"f1": testFact({"c": "eg:Concept1", "p": "2018-01-01" }),
|
|
189
196
|
"f2": testFact({"c": "eg:Concept4", "p": "2018-01-01" }),
|
|
190
197
|
});
|
|
191
198
|
|
|
192
|
-
|
|
193
|
-
|
|
199
|
+
const f1 = getFact(reportSet, "f1");
|
|
200
|
+
const f2 = getFact(reportSet, "f2");
|
|
194
201
|
|
|
195
202
|
test("Two facts, one has no label", () => {
|
|
196
203
|
var fs = new FactSet([ f1, f2 ]);
|
|
@@ -199,3 +206,67 @@ describe("Minimally unique labels (missing labels)", () => {
|
|
|
199
206
|
expect(fs.minimallyUniqueLabel(f2)).toEqual("eg:Concept4");
|
|
200
207
|
});
|
|
201
208
|
});
|
|
209
|
+
|
|
210
|
+
function numericTestFact(value, decimals) {
|
|
211
|
+
var factData = { "d": decimals, "v": value, "a": { "c": "eg:Concept1", "u": "eg:pure" }};
|
|
212
|
+
return factData;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
describe("Consistency", () => {
|
|
216
|
+
const reportSet = testReportSet({
|
|
217
|
+
"f1": numericTestFact(150, -1), // 145-155
|
|
218
|
+
"f2": numericTestFact(200, -2), // 150-250
|
|
219
|
+
"f3": numericTestFact(140, -1), // 135-145
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
const f1 = getFact(reportSet, "f1");
|
|
223
|
+
const f2 = getFact(reportSet, "f2");
|
|
224
|
+
const f3 = getFact(reportSet, "f3");
|
|
225
|
+
|
|
226
|
+
test("Inconsistent fact set", () => {
|
|
227
|
+
const factSet = new FactSet([f1, f2, f3]);
|
|
228
|
+
expect(factSet.valueIntersection()).toBeUndefined();
|
|
229
|
+
expect(factSet.isConsistent()).toBeFalsy();
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
test("Consistent fact sets - overlap", () => {
|
|
233
|
+
const factSet = new FactSet([f1, f2]);
|
|
234
|
+
const intersection = factSet.valueIntersection();
|
|
235
|
+
expect(intersection.a).toEqualDecimal(150);
|
|
236
|
+
expect(intersection.b).toEqualDecimal(155);
|
|
237
|
+
expect(factSet.isConsistent()).toBeTruthy();
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
test("Consistent fact sets - bounds coincide", () => {
|
|
241
|
+
const factSet = new FactSet([f1, f3]);
|
|
242
|
+
const intersection = factSet.valueIntersection();
|
|
243
|
+
expect(intersection.a).toEqualDecimal(145);
|
|
244
|
+
expect(intersection.b).toEqualDecimal(145);
|
|
245
|
+
expect(factSet.isConsistent()).toBeTruthy();
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
describe("Most precise", () => {
|
|
251
|
+
const reportSet = testReportSet({
|
|
252
|
+
"f1": numericTestFact(150, -1),
|
|
253
|
+
"f2": numericTestFact(200, 0),
|
|
254
|
+
"f3": numericTestFact(140, 2),
|
|
255
|
+
"f4": numericTestFact(160, undefined)
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
const f1 = getFact(reportSet, "f1");
|
|
259
|
+
const f2 = getFact(reportSet, "f2");
|
|
260
|
+
const f3 = getFact(reportSet, "f3");
|
|
261
|
+
const f4 = getFact(reportSet, "f4");
|
|
262
|
+
|
|
263
|
+
test("Most precise - finite decimals", () => {
|
|
264
|
+
const factSet = new FactSet([f1, f2, f3]);
|
|
265
|
+
expect(factSet.mostPrecise()).toEqual(f3);
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
test("Most precise - mixture of finite and infinite", () => {
|
|
269
|
+
const factSet = new FactSet([f1, f2, f3, f4]);
|
|
270
|
+
expect(factSet.mostPrecise()).toEqual(f4);
|
|
271
|
+
});
|
|
272
|
+
});
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
export class Footnote {
|
|
4
4
|
constructor(report, footnoteId, title) {
|
|
5
|
-
this.
|
|
5
|
+
this.vuid = footnoteId;
|
|
6
6
|
this.linkedFacts = [];
|
|
7
7
|
this.title = title;
|
|
8
|
-
this.ixNode = report.getIXNodeForItemId(footnoteId);
|
|
8
|
+
this.ixNode = report.reportSet.getIXNodeForItemId(footnoteId);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
// Facts that are the source of relationships to this fact.
|
|
@@ -21,6 +21,12 @@ export class Footnote {
|
|
|
21
21
|
return this.textContent();
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
readableValueHTML() {
|
|
25
|
+
const span = document.createElement("span");
|
|
26
|
+
span.append(document.createTextNode(this.textContent()));
|
|
27
|
+
return span;
|
|
28
|
+
}
|
|
29
|
+
|
|
24
30
|
isTextBlock() {
|
|
25
31
|
return false;
|
|
26
32
|
}
|
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
import $ from 'jquery'
|
|
4
4
|
import { iXBRLViewer } from "./ixbrlviewer.js";
|
|
5
5
|
|
|
6
|
+
const scriptSrc = document.currentScript.src;
|
|
7
|
+
|
|
6
8
|
$(() => {
|
|
7
|
-
const
|
|
8
|
-
showValidationWarningOnStart: true
|
|
9
|
-
}
|
|
9
|
+
const options = {
|
|
10
|
+
showValidationWarningOnStart: true,
|
|
11
|
+
};
|
|
12
|
+
const configUrl = new URL("ixbrlviewer.config.json", scriptSrc);
|
|
13
|
+
if (configUrl.protocol != 'file:') {
|
|
14
|
+
options["configUrl"] = configUrl;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const iv = new iXBRLViewer(options);
|
|
10
18
|
iv.load();
|
|
11
19
|
});
|