ixbrl-viewer 1.4.28__py3-none-any.whl → 1.4.30__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.

Potentially problematic release.


This version of ixbrl-viewer might be problematic. Click here for more details.

@@ -23,6 +23,7 @@
23
23
  "calculationIsConsistent": "Calculation is consistent",
24
24
  "calculationIsInconsistent": "Calculation is inconsistent",
25
25
  "calculationUnchecked": "Calculation not checked due to presence of duplicate facts",
26
+ "calculationUncheckedIncorrectVersion": "Calculation 1.1 relationships not checked in legacy calculation mode",
26
27
  "change": "Change",
27
28
  "changeFromIn": "From {{from}} in ",
28
29
  "changePercentageDecrease": "{{decrease}}% decrease on ",
@@ -4,6 +4,7 @@ import Decimal from 'decimal.js';
4
4
  import { setDefault } from './util.js';
5
5
  import { Interval } from './interval.js';
6
6
  import { FactSet } from './factset.js';
7
+ import { CALC11_ARCROLE, CALC_ARCROLE } from './util.js';
7
8
 
8
9
  export class Calculation {
9
10
 
@@ -18,13 +19,16 @@ export class Calculation {
18
19
  const fact = this.fact;
19
20
  const report = fact.report;
20
21
  if (!this._conceptToFact) {
21
- const rels = report.getChildRelationships(fact.conceptName(), "calc")
22
22
  const ctf = {};
23
- for (const [elr, rr] of Object.entries(rels)) {
24
- ctf[elr] = {};
25
- if (rr.length > 0) {
26
- const otherFacts = report.getAlignedFacts(fact, {"c": rr.map(r => r.t )});
27
- otherFacts.forEach(otherFact => setDefault(ctf[elr], otherFact.conceptName(), new FactSet()).add(otherFact));
23
+ for (const version of [CALC_ARCROLE, CALC11_ARCROLE]) {
24
+ const rels = report.getChildRelationships(fact.conceptName(), version)
25
+ for (const [elr, rr] of Object.entries(rels)) {
26
+ setDefault(ctf, version, {});
27
+ ctf[version][elr] = {};
28
+ if (rr.length > 0) {
29
+ const otherFacts = report.getAlignedFacts(fact, {"c": rr.map(r => r.t )});
30
+ otherFacts.forEach(otherFact => setDefault(ctf[version][elr], otherFact.conceptName(), new FactSet()).add(otherFact));
31
+ }
28
32
  }
29
33
  }
30
34
  this._conceptToFact = ctf;
@@ -40,11 +44,13 @@ export class Calculation {
40
44
  resolvedCalculations() {
41
45
  const calculations = [];
42
46
  const ctf = this.calculationFacts();
43
- for (const [elr, concepts] of Object.entries(ctf)) {
44
- if (Object.keys(concepts).length > 0) {
45
- calculations.push(this.resolvedCalculation(elr));
46
- }
47
- }
47
+ for (const [version, o] of Object.entries(ctf)) {
48
+ for (const [elr, concepts] of Object.entries(o)) {
49
+ if (Object.keys(concepts).length > 0) {
50
+ calculations.push(this.resolvedCalculation(elr, version));
51
+ }
52
+ }
53
+ }
48
54
  return calculations;
49
55
  }
50
56
 
@@ -55,34 +61,36 @@ export class Calculation {
55
61
  const ctf = this.calculationFacts();
56
62
  let bestMatchELR = "";
57
63
  let bestMatchCount = -1;
58
- for (const [elr, rr] of Object.entries(ctf)) {
59
- let matchCount = 0;
60
- for (const [concept, calcFactSet] of Object.entries(rr)) {
61
- let matched = 0;
62
- for (const calcFact of calcFactSet.items()) {
63
- if (facts.includes(calcFact.vuid)) {
64
- matched = 1;
65
- }
64
+ for (const [version, o] of Object.entries(ctf)) {
65
+ for (const [elr, rr] of Object.entries(o)) {
66
+ let matchCount = 0;
67
+ for (const [concept, calcFactSet] of Object.entries(rr)) {
68
+ let matched = 0;
69
+ for (const calcFact of calcFactSet.items()) {
70
+ if (facts.includes(calcFact.vuid)) {
71
+ matched = 1;
72
+ }
73
+ }
74
+ matchCount += matched;
66
75
  }
67
- matchCount += matched;
68
- }
69
- if (matchCount/Object.keys(rr).length > bestMatchCount) {
70
- bestMatchCount = matchCount/Object.keys(rr).length;
71
- bestMatchELR = elr;
72
- }
73
- }
76
+ if (matchCount/Object.keys(rr).length > bestMatchCount) {
77
+ bestMatchCount = matchCount/Object.keys(rr).length;
78
+ bestMatchELR = elr;
79
+ }
80
+ }
81
+ }
74
82
  return bestMatchELR;
75
83
  }
76
84
 
77
85
  /*
78
86
  * Returns a ResolvedCalculation object for the specified ELR
79
87
  */
80
- resolvedCalculation(elr) {
81
- const calcFacts = this.calculationFacts()[elr];
88
+ resolvedCalculation(elr, version) {
89
+ const calcFacts = this.calculationFacts()[version][elr];
82
90
  const report = this.fact.report;
83
- const rels = report.getChildRelationships(this.fact.conceptName(), "calc")[elr];
91
+ const rels = report.getChildRelationships(this.fact.conceptName(), version)[elr];
84
92
  const resolvedCalcClass = this.calc11 ? ResolvedCalc11Calculation : ResolvedLegacyCalculation;
85
- const resolvedCalculation = new resolvedCalcClass(elr, this.fact);
93
+ const resolvedCalculation = new resolvedCalcClass(elr, this.fact, version);
86
94
  for (const r of rels) {
87
95
  const factset = calcFacts[r.t] ?? new FactSet();
88
96
  resolvedCalculation.addRow(new CalculationContribution(report.getConcept(r.t), r.w, factset));
@@ -120,11 +128,12 @@ class CalculationContribution {
120
128
 
121
129
  class AbstractResolvedCalculation {
122
130
 
123
- constructor(elr, fact) {
131
+ constructor(elr, fact, relationshipVersion) {
124
132
  this.totalFact = fact;
125
133
  this.totalFactSet = new FactSet(fact.report.getAlignedFacts(fact));
126
134
  this.elr = elr;
127
135
  this.rows = [];
136
+ this.relationshipVersion = relationshipVersion;
128
137
  }
129
138
 
130
139
  addRow(contribution) {
@@ -171,13 +180,17 @@ export class ResolvedCalc11Calculation extends AbstractResolvedCalculation {
171
180
  export class ResolvedLegacyCalculation extends AbstractResolvedCalculation {
172
181
 
173
182
  binds() {
174
- return super.binds() && this.rows.every((r) => r.facts.completeDuplicates());
183
+ return this.relationshipVersion == CALC_ARCROLE && super.binds() && this.rows.every((r) => r.facts.completeDuplicates());
175
184
  }
176
185
 
177
186
  unchecked() {
178
187
  return super.binds() && !this.binds();
179
188
  }
180
189
 
190
+ uncheckedDueToVersionMismatch() {
191
+ return this.relationshipVersion !== CALC_ARCROLE;
192
+ }
193
+
181
194
  calculatedTotal() {
182
195
  let total = new Decimal(0);
183
196
 
@@ -821,7 +821,12 @@ export class Inspector {
821
821
  calcStatusIcon
822
822
  .addClass("unchecked-flag")
823
823
  .attr("title", i18next.t('factDetails.calculationUnchecked'))
824
- calcStatusText.text(i18next.t('factDetails.calculationUnchecked'));
824
+ if (rCalc.uncheckedDueToVersionMismatch()) {
825
+ calcStatusText.text(i18next.t('factDetails.calculationUncheckedIncorrectVersion'));
826
+ }
827
+ else {
828
+ calcStatusText.text(i18next.t('factDetails.calculationUnchecked'));
829
+ }
825
830
  }
826
831
 
827
832
  a.addCard(cardTitle, calcBody, rCalc.elr == selectedELR);
@@ -9,6 +9,9 @@ export const SHOW_FACT = 'SHOW_FACT';
9
9
 
10
10
  export const NAMESPACE_ISO4217 = 'http://www.xbrl.org/2003/iso4217';
11
11
 
12
+ export const CALC_ARCROLE = "calc";
13
+ export const CALC11_ARCROLE = "calc11";
14
+
12
15
  // The number of distinct highlight colors defined in inspector.less
13
16
  export const HIGHLIGHT_COLORS = 3;
14
17
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ixbrl-viewer
3
- Version: 1.4.28
3
+ Version: 1.4.30
4
4
  Summary: The Arelle iXBRL Viewer allows iXBRL reports to be viewed interactively in a web browser.
5
5
  Author-email: "arelle.org" <support@arelle.org>
6
6
  License: Apache-2.0
@@ -34,11 +34,11 @@ Requires-Dist: lxml <6,>=4
34
34
  Provides-Extra: arelle
35
35
  Requires-Dist: arelle-release ==2.* ; extra == 'arelle'
36
36
  Provides-Extra: dev
37
- Requires-Dist: flake8 ==7.0.0 ; extra == 'dev'
37
+ Requires-Dist: flake8 ==7.1.0 ; extra == 'dev'
38
38
  Requires-Dist: lxml-stubs ==0.5.1 ; extra == 'dev'
39
- Requires-Dist: mypy ==1.10.0 ; extra == 'dev'
40
- Requires-Dist: pytest ==8.2.1 ; extra == 'dev'
41
- Requires-Dist: typing-extensions ==4.12.0 ; extra == 'dev'
39
+ Requires-Dist: mypy ==1.10.1 ; extra == 'dev'
40
+ Requires-Dist: pytest ==8.2.2 ; extra == 'dev'
41
+ Requires-Dist: typing-extensions ==4.12.2 ; extra == 'dev'
42
42
 
43
43
  # Arelle iXBRL Viewer
44
44
 
@@ -1,8 +1,9 @@
1
- iXBRLViewerPlugin/__init__.py,sha256=11uzkyzBvzgrFDf5EKwBZZ70iZER9LBCY7-6Eu3kXFM,15808
2
- iXBRLViewerPlugin/_version.py,sha256=xRKV1NGkyiyyNzFGzdbk5IVPLceRrq8H5_kp9SYw6Qc,413
1
+ iXBRLViewerPlugin/__init__.py,sha256=BFWR1sX8KWwiMvveKY5UPw3ZwTLiMr6VIzTvonNYJos,16417
2
+ iXBRLViewerPlugin/_version.py,sha256=AKORFSWSP6Q3-Xu9DF8xtUcFuGx5tdjyE2oy0d4RfXM,413
3
3
  iXBRLViewerPlugin/constants.py,sha256=gXwZxPp5PJETC-sOvLxOToSe5pIjmQv2WMhZMNoPpKw,1062
4
4
  iXBRLViewerPlugin/featureConfig.py,sha256=tOViPYmN32i2uIf_T9HGgbkkv41VoTpTjqhn4w9rTgw,194
5
- iXBRLViewerPlugin/iXBRLViewer.py,sha256=7imzjiyaTMxqFuI-TcGu3nzo7JQvIvHIsJ9XMZ-BIW0,27825
5
+ iXBRLViewerPlugin/iXBRLViewer.py,sha256=YRrtWkYmTNPcgWAJmctGMm0zgjpA9_auL8t3xM-6yd8,28472
6
+ iXBRLViewerPlugin/plugin.py,sha256=d-x2i1WzfyMNZ4OnhxP9txkpZtPoDtKvgzghh_uB84g,232
6
7
  iXBRLViewerPlugin/stubviewer.html,sha256=hc5BeIR7y3ojGRux_Hy5oqEAHdlQ34kk3lL5eH-B4AU,158
7
8
  iXBRLViewerPlugin/ui.py,sha256=OismWQzm_T16j-6O8cfGZ7qLMKIMIA36rRlb9mbOOh0,10512
8
9
  iXBRLViewerPlugin/xhtmlserialize.py,sha256=2fV88KD5XOXqDzYaQgovbvuUQINF0n6E-6Nw174zniY,6771
@@ -11,14 +12,14 @@ iXBRLViewerPlugin/viewer/version.js,sha256=7b5si8UmaS7QqALQIP-wJ0I8onKFox8VyaAiU
11
12
  iXBRLViewerPlugin/viewer/webpack.common.js,sha256=hpXufjShXAESQh8Ds7ViJ_tbr8XSb7EdqQLRvyu_mQg,1691
12
13
  iXBRLViewerPlugin/viewer/webpack.dev.js,sha256=R9AwY_TBrg9otvXpDxT1UsGg5eMqi4aXW7C7EIsHzZk,551
13
14
  iXBRLViewerPlugin/viewer/webpack.prod.js,sha256=vfLowWC1EOty0zbq9P-usGaJ3w-JoERpJrYaE9MfoSE,499
14
- iXBRLViewerPlugin/viewer/dist/ixbrlviewer.js,sha256=1azWxmA_bsZo8_9mDeSf3EyEMqLjILYQKk6pgWRnx_k,800179
15
+ iXBRLViewerPlugin/viewer/dist/ixbrlviewer.js,sha256=IlXOwJKbn0ndpKKXJe7_la6CFuD0cDMF7IRsq6YdZlU,800937
15
16
  iXBRLViewerPlugin/viewer/dist/ixbrlviewer.js.LICENSE.txt,sha256=2bD4VShd311WquXvtJNpD0aHN3ru67ZeolE1OxkV5Ys,1832
16
17
  iXBRLViewerPlugin/viewer/src/html/fact-details.html,sha256=P9BJw1OK4nIYfoT4KPwW1WP94ZeD7v1nisvSKMeSnU8,1495
17
18
  iXBRLViewerPlugin/viewer/src/html/footnote-details.html,sha256=9I7y0KM7xsPzbiZheuHkm1k4nHNXD8S9qxvD_Y0I1Us,278
18
19
  iXBRLViewerPlugin/viewer/src/html/inspector.html,sha256=Uze8Y_uSeeYqz_eMNkABc2VP2yRvlfIdg8Zo-kOfTTo,20062
19
20
  iXBRLViewerPlugin/viewer/src/i18n/en/currencies.json,sha256=p2vXnQcaRWX3tDY8E52AaIeKhbmcNNhPfTBHlL5AL_U,315
20
21
  iXBRLViewerPlugin/viewer/src/i18n/en/referenceparts.json,sha256=rp0p7aWt0U2Ny3ai_fadZhdV-LWx-9-tgKWQmggoewM,207
21
- iXBRLViewerPlugin/viewer/src/i18n/en/translation.json,sha256=g7PNlozn0xVXN8bg_JGAaXjy6lyae8nzSPGpBR79B0A,4915
22
+ iXBRLViewerPlugin/viewer/src/i18n/en/translation.json,sha256=UD9iueMSeOWWY3SHjLVSzlteG67TwzDUFR7wtsqH3Vs,5031
22
23
  iXBRLViewerPlugin/viewer/src/i18n/es/currencies.json,sha256=YzzYkYpUAgYFBDROUosaxoVbft5zPXKJ4zI9Zb2nsqQ,171
23
24
  iXBRLViewerPlugin/viewer/src/i18n/es/referenceparts.json,sha256=X6l9IS1w9LSItMaS14q9gqDIu1jaeHthuhOogaBLRTI,237
24
25
  iXBRLViewerPlugin/viewer/src/i18n/es/translation.json,sha256=PtjbAS002o6kb2eKlyV5K3UeTs0LPgIfDb0WkldI0_A,4177
@@ -60,7 +61,7 @@ iXBRLViewerPlugin/viewer/src/img/powered-by-workiva.svg,sha256=Zf2JArzszZCn7zCkH
60
61
  iXBRLViewerPlugin/viewer/src/js/accordian.js,sha256=l1OgFe55zuLnr2QwN8cJe3qa4bb_b9P0RjYl_FRgwKk,1858
61
62
  iXBRLViewerPlugin/viewer/src/js/aspect.js,sha256=E8biCCoCIB9rEZoum4AmwtC1jJ3c4b8WjjXkoIsuBtY,2120
62
63
  iXBRLViewerPlugin/viewer/src/js/aspect.test.js,sha256=ctDakUsDdJ65uuW70WcnsRW7keVBOsxWrKqD6PZsPC8,4269
63
- iXBRLViewerPlugin/viewer/src/js/calculation.js,sha256=JJvoyC09QuzL5-TbiB7iC1Wdygtg6GvfV-4p3VIySGw,6060
64
+ iXBRLViewerPlugin/viewer/src/js/calculation.js,sha256=tB5Tzr6aMrnERkBlLcPjJ0_SfGUT94FvXUbUR0id1iU,6778
64
65
  iXBRLViewerPlugin/viewer/src/js/calculation.test.js,sha256=XjrEimf3frSjpWh8PX0eu7ZX3ZLOlJd95op5FMEvUwA,11223
65
66
  iXBRLViewerPlugin/viewer/src/js/calculationInspector.js,sha256=TLShvzn-OJDS0tJ72K6dYpmQ970WuY74_xp9-ssrMSE,8534
66
67
  iXBRLViewerPlugin/viewer/src/js/chart.js,sha256=ZRoL4QZM1TnDw96HhA0kpvLZSaCvLMjLMIO7Kxo_LpA,7066
@@ -77,7 +78,7 @@ iXBRLViewerPlugin/viewer/src/js/footnote.js,sha256=jZreicIBPAtBjbpoRbLnkSs8fHdCY
77
78
  iXBRLViewerPlugin/viewer/src/js/identifiers.js,sha256=gcGitF1CfiyiUvzWDG6INnFDIBi5jXdBgiqCB8Ip0YE,2260
78
79
  iXBRLViewerPlugin/viewer/src/js/identifiers.test.js,sha256=eu2TkHVpuRItIyNdNAuoITnpGFwwAicqMynf0dFreRk,2112
79
80
  iXBRLViewerPlugin/viewer/src/js/index.js,sha256=SdxunWx8kNw0-vwwnr58-ac1-eQIE1__Ll7ekNNK79E,232
80
- iXBRLViewerPlugin/viewer/src/js/inspector.js,sha256=c7s1kMxGbcRIl2LQEzYwV478efbWrMZBFp7c_As7g-A,50423
81
+ iXBRLViewerPlugin/viewer/src/js/inspector.js,sha256=USIN_ciPzp-6mNKI29c1wOciBKZddgmi0JWfpY0yFRY,50651
81
82
  iXBRLViewerPlugin/viewer/src/js/inspector.test.js,sha256=AQjbwTllw_dZfovCfjfHWtt0kdjzDnoXw-mQ0IrHKWk,10086
82
83
  iXBRLViewerPlugin/viewer/src/js/interval.js,sha256=ZEIbH4uwTIvF1jmulEWnJI5ZD1AamgKtkyplOwlcrv0,1889
83
84
  iXBRLViewerPlugin/viewer/src/js/interval.test.js,sha256=pLbukwlcS38ycDJaNYV_9pAca7wiprunXHqD4TkHEi8,4577
@@ -108,7 +109,7 @@ iXBRLViewerPlugin/viewer/src/js/test-utils.js,sha256=MXhrubSf0PmSRsrDrqHftPgTrK5
108
109
  iXBRLViewerPlugin/viewer/src/js/textblockviewer.js,sha256=lCAZeN_wrSwmYie_rwdeIFCIjiOSblT0K9Vslqwktc8,1874
109
110
  iXBRLViewerPlugin/viewer/src/js/unit.js,sha256=eHaCTE3snK7uuXK48VK1yPPpl0MAQReqPGWKhBvzwPQ,1638
110
111
  iXBRLViewerPlugin/viewer/src/js/unit.test.js,sha256=l4nELK-gK2uJG6jXHEXwnAKzCCCQ7V_oTySaUN_JnhQ,2801
111
- iXBRLViewerPlugin/viewer/src/js/util.js,sha256=oF6wGOTODyMNrQ9N91FqOYamW_bLmLYUdiYaGnviH-c,6793
112
+ iXBRLViewerPlugin/viewer/src/js/util.js,sha256=ESRvK3v3Vaf0NcF4WV3bPKbiuVJjH1xZr0U6F8uX6CQ,6870
112
113
  iXBRLViewerPlugin/viewer/src/js/util.test.js,sha256=9z1y2ImH2t8GKAF5wpkXBADkeQd6X6H7JBejbaSHRwg,6460
113
114
  iXBRLViewerPlugin/viewer/src/js/validationreport.js,sha256=zWA9_8sWavX2Fi8fwEyDPABxWL_XSzvNQ21O1Qu2ayY,644
114
115
  iXBRLViewerPlugin/viewer/src/js/viewer.js,sha256=Zqyj3ROu4v8u0-gcFp84YAPyj3ncljsxXuG9ftoOdBY,35018
@@ -154,12 +155,12 @@ tests/puppeteer/tools/generate.sh,sha256=jZ1Jac6KsuRo2nHuA2B9g9mZqr7tLjPJKJAUf0o
154
155
  tests/unit_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
155
156
  tests/unit_tests/iXBRLViewerPlugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
156
157
  tests/unit_tests/iXBRLViewerPlugin/mock_arelle.py,sha256=fQKJGwceaEVaxvqV9tyuvT6DJB5s1X3-oSMjbFMKlS8,1301
157
- tests/unit_tests/iXBRLViewerPlugin/test_iXBRLViewer.py,sha256=1Q4O_1SzJaDjouRbkgn2PGFsWfJ4_lK-zzsgV9iXXF0,31725
158
+ tests/unit_tests/iXBRLViewerPlugin/test_iXBRLViewer.py,sha256=ZS6YsqkLUDo7mrrakC8NL49kQoXS-TX1PnP1oM1OyH8,31687
158
159
  tests/unit_tests/iXBRLViewerPlugin/test_xhtmlserialize.py,sha256=kdrg4i-YXnYAGl9TLWEACPQF0V69OAMXdXLYJwefsH0,12521
159
- ixbrl_viewer-1.4.28.dist-info/LICENSE,sha256=TZJhu77S_2-WQcPAkuIAlQiuuiNqVcuHBjd7z3Y5S08,16645
160
- ixbrl_viewer-1.4.28.dist-info/METADATA,sha256=R6OQwhHoICv5CpMmyjeBWtHbThTNVTf0Ag4SXMOt-8A,14716
161
- ixbrl_viewer-1.4.28.dist-info/NOTICE,sha256=-SHDY0OY7s4gm4Rdk5AB3nbnUsrdHEHPdJuGFR_vuM4,566
162
- ixbrl_viewer-1.4.28.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
163
- ixbrl_viewer-1.4.28.dist-info/entry_points.txt,sha256=2XUzP20WGwxdvnugdBybUBwAB3xf_zvrOR5W_smFz_4,65
164
- ixbrl_viewer-1.4.28.dist-info/top_level.txt,sha256=h8MkrMhC_t2-KbfS1oxJVnFAbn5NZJH8END_BL40mv8,24
165
- ixbrl_viewer-1.4.28.dist-info/RECORD,,
160
+ ixbrl_viewer-1.4.30.dist-info/LICENSE,sha256=TZJhu77S_2-WQcPAkuIAlQiuuiNqVcuHBjd7z3Y5S08,16645
161
+ ixbrl_viewer-1.4.30.dist-info/METADATA,sha256=NLUIwd1Z5_YQr_sZa5GZxf4XUoWc_G8jhSg54F75qoo,14716
162
+ ixbrl_viewer-1.4.30.dist-info/NOTICE,sha256=-SHDY0OY7s4gm4Rdk5AB3nbnUsrdHEHPdJuGFR_vuM4,566
163
+ ixbrl_viewer-1.4.30.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
164
+ ixbrl_viewer-1.4.30.dist-info/entry_points.txt,sha256=2XUzP20WGwxdvnugdBybUBwAB3xf_zvrOR5W_smFz_4,65
165
+ ixbrl_viewer-1.4.30.dist-info/top_level.txt,sha256=h8MkrMhC_t2-KbfS1oxJVnFAbn5NZJH8END_BL40mv8,24
166
+ ixbrl_viewer-1.4.30.dist-info/RECORD,,
@@ -361,17 +361,6 @@ class TestIXBRLViewer:
361
361
  ixdsTarget=None,
362
362
  )
363
363
 
364
- error1 = logging.LogRecord("arelle", logging.ERROR, "", 0, "Error message", {}, None)
365
- error1.messageCode = "code1"
366
- self.modelManager = Mock(
367
- cntlr = Mock(
368
- logHandler = Mock (
369
- logRecordBuffer = [
370
- error1
371
- ]
372
- )
373
- )
374
- )
375
364
 
376
365
  def urlDocEntry(path, docType, linkQName=None):
377
366
  return path, Mock(
@@ -394,7 +383,6 @@ class TestIXBRLViewer:
394
383
  facts=[fact_1, fact_with_typed_dimension, fact_with_missing_member_on_dimension],
395
384
  info=info_effect,
396
385
  modelDocument=self.modelDocument,
397
- modelManager=self.modelManager,
398
386
  ixdsTarget=None,
399
387
  urlDocs=dict((
400
388
  urlDocEntry('/filesystem/local-inline.htm', Type.INLINEXBRL),
@@ -425,7 +413,6 @@ class TestIXBRLViewer:
425
413
  facts=[fact_2, fact_3],
426
414
  info=info_effect,
427
415
  modelDocument=self.modelDocument,
428
- modelManager=self.modelManager,
429
416
  ixdsTarget=None,
430
417
  urlDocs={}
431
418
  )
@@ -437,7 +424,6 @@ class TestIXBRLViewer:
437
424
  facts=[fact_1, fact_with_typed_dimension, fact_with_missing_member_on_dimension],
438
425
  info=info_effect,
439
426
  modelDocument=self.modelDocumentInlineSet,
440
- modelManager=self.modelManager,
441
427
  ixdsTarget=None,
442
428
  urlDocs={}
443
429
  )
@@ -450,10 +436,15 @@ class TestIXBRLViewer:
450
436
  typed_dimension_domain_concept.modelXbrl = self.modelXbrl_1
451
437
  member_concept.modelXbrl = self.modelXbrl_1
452
438
 
453
- self.builder_1 = IXBRLViewerBuilder([self.modelXbrl_1])
454
- self.builder_2 = IXBRLViewerBuilder([self.modelXbrl_1])
455
- self.builder_3 = IXBRLViewerBuilder([self.modelXbrl_2])
456
- self.builder_doc_set = IXBRLViewerBuilder([self.modelXbrlDocSet])
439
+ self.logRecordBuffer = []
440
+ self.cntlr_mock = Mock(
441
+ logHandler = Mock(
442
+ logRecordBuffer = self.logRecordBuffer
443
+ )
444
+ )
445
+ self.builder_1 = IXBRLViewerBuilder(self.cntlr_mock)
446
+ self.builder_doc_set = IXBRLViewerBuilder(self.cntlr_mock)
447
+
457
448
 
458
449
  @patch('arelle.XbrlConst.conceptLabel', 'http://www.xbrl.org/2003/arcrole/concept-label')
459
450
  @patch('arelle.XbrlConst.conceptReference', 'http://www.xbrl.org/2003/arcrole/concept-reference')
@@ -513,7 +504,13 @@ class TestIXBRLViewer:
513
504
  @patch('arelle.XbrlConst.documentationLabel', 'http://www.xbrl.org/2003/role/documentation')
514
505
  def test_createViewerWithValidation(self):
515
506
  js_uri = 'ixbrlviewer.js'
516
- builder = IXBRLViewerBuilder([self.modelXbrl_1])
507
+
508
+ error1 = logging.LogRecord("arelle", logging.ERROR, "", 0, "Error message", {}, None)
509
+ error1.messageCode = "code1"
510
+ self.logRecordBuffer.append(error1)
511
+
512
+ builder = IXBRLViewerBuilder(self.cntlr_mock)
513
+ builder.processModel(self.modelXbrl_1)
517
514
  result = builder.createViewer(js_uri)
518
515
  assert len(result.files) == 1
519
516
  body = result.files[0].xmlDocument.getroot()[0]
@@ -538,7 +535,8 @@ class TestIXBRLViewer:
538
535
  @patch('arelle.XbrlConst.dimensionDefault', 'http://xbrl.org/int/dim/arcrole/dimension-default')
539
536
  def test_createViewer(self):
540
537
  js_uri = 'ixbrlviewer.js'
541
- builder = IXBRLViewerBuilder([self.modelXbrl_1])
538
+ builder = IXBRLViewerBuilder(self.cntlr_mock)
539
+ builder.processModel(self.modelXbrl_1)
542
540
  result = builder.createViewer(js_uri, showValidations = False)
543
541
  assert len(result.files) == 1
544
542
  body = result.files[0].xmlDocument.getroot()[0]
@@ -583,8 +581,9 @@ class TestIXBRLViewer:
583
581
  @patch('arelle.XbrlConst.dimensionDefault', 'http://xbrl.org/int/dim/arcrole/dimension-default')
584
582
  def test_createStubViewer(self):
585
583
  js_uri = 'ixbrlviewer.js'
586
- builder = IXBRLViewerBuilder([self.modelXbrl_1])
587
- result = builder.createViewer(js_uri, showValidations = False, useStubViewer = True)
584
+ builder = IXBRLViewerBuilder(self.cntlr_mock, useStubViewer = True)
585
+ builder.processModel(self.modelXbrl_1)
586
+ result = builder.createViewer(js_uri, showValidations = False)
588
587
  assert len(result.files) == 2
589
588
  body = result.files[0].xmlDocument.getroot().find('{http://www.w3.org/1999/xhtml}body')
590
589
  assert body[0].text == 'BEGIN IXBRL VIEWER EXTENSIONS'
@@ -628,6 +627,7 @@ class TestIXBRLViewer:
628
627
  @patch('arelle.XbrlConst.dimensionDefault', 'http://xbrl.org/int/dim/arcrole/dimension-default')
629
628
  def test_createViewer_docset(self):
630
629
  js_uri = 'ixbrlviewer.js'
630
+ self.builder_doc_set.processModel(self.modelXbrlDocSet)
631
631
  result = self.builder_doc_set.createViewer(js_uri, showValidations=False)
632
632
  assert len(result.files) == 2
633
633
  body = result.files[0].xmlDocument.getroot()[0]
@@ -656,7 +656,8 @@ class TestIXBRLViewer:
656
656
  @patch('arelle.XbrlConst.documentationLabel', 'http://www.xbrl.org/2003/role/documentation')
657
657
  def test_createViewer_bad_path(self):
658
658
  js_uri = 'ixbrlviewer.js'
659
- builder = IXBRLViewerBuilder([self.modelXbrl_2])
659
+ builder = IXBRLViewerBuilder(self.cntlr_mock)
660
+ builder.processModel(self.modelXbrl_2)
660
661
  result = builder.createViewer(js_uri)
661
662
  assert len(result.files) == 1
662
663
  body = result.files[0].xmlDocument.getroot()[0]