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

Files changed (95) hide show
  1. iXBRLViewerPlugin/__init__.py +25 -22
  2. iXBRLViewerPlugin/_version.py +2 -2
  3. iXBRLViewerPlugin/constants.py +86 -1
  4. iXBRLViewerPlugin/featureConfig.py +4 -1
  5. iXBRLViewerPlugin/iXBRLViewer.py +28 -14
  6. iXBRLViewerPlugin/viewer/dist/ixbrlviewer.js +1 -1
  7. iXBRLViewerPlugin/viewer/i18next-parser.config.js +1 -1
  8. iXBRLViewerPlugin/viewer/src/html/fact-details.html +69 -38
  9. iXBRLViewerPlugin/viewer/src/html/footer-logo.html +4 -0
  10. iXBRLViewerPlugin/viewer/src/html/footnote-details.html +1 -1
  11. iXBRLViewerPlugin/viewer/src/html/inspector.html +318 -211
  12. iXBRLViewerPlugin/viewer/src/i18n/cy/balancetypes.json +1 -0
  13. iXBRLViewerPlugin/viewer/src/i18n/cy/currencies.json +13 -0
  14. iXBRLViewerPlugin/viewer/src/i18n/cy/datatypes.json +9 -0
  15. iXBRLViewerPlugin/viewer/src/i18n/cy/labelroles.json +24 -0
  16. iXBRLViewerPlugin/viewer/src/i18n/cy/referenceparts.json +10 -0
  17. iXBRLViewerPlugin/viewer/src/i18n/cy/scale.json +16 -0
  18. iXBRLViewerPlugin/viewer/src/i18n/cy/tooltips.json +17 -0
  19. iXBRLViewerPlugin/viewer/src/i18n/cy/translation.json +179 -0
  20. iXBRLViewerPlugin/viewer/src/i18n/en/balancetypes.json +4 -0
  21. iXBRLViewerPlugin/viewer/src/i18n/en/datatypes.json +10 -0
  22. iXBRLViewerPlugin/viewer/src/i18n/en/labelroles.json +4 -0
  23. iXBRLViewerPlugin/viewer/src/i18n/en/scale.json +16 -0
  24. iXBRLViewerPlugin/viewer/src/i18n/en/tooltips.json +17 -0
  25. iXBRLViewerPlugin/viewer/src/i18n/en/translation.json +50 -25
  26. iXBRLViewerPlugin/viewer/src/i18n/es/balancetypes.json +4 -0
  27. iXBRLViewerPlugin/viewer/src/i18n/es/datatypes.json +10 -0
  28. iXBRLViewerPlugin/viewer/src/i18n/es/labelroles.json +24 -0
  29. iXBRLViewerPlugin/viewer/src/i18n/es/scale.json +16 -0
  30. iXBRLViewerPlugin/viewer/src/i18n/es/tooltips.json +17 -0
  31. iXBRLViewerPlugin/viewer/src/i18n/es/translation.json +66 -40
  32. iXBRLViewerPlugin/viewer/src/icons/dark-mode.svg +4 -0
  33. iXBRLViewerPlugin/viewer/src/img/arelle-dark.svg +179 -0
  34. iXBRLViewerPlugin/viewer/src/img/inline-viewer-dark.svg +59 -0
  35. iXBRLViewerPlugin/viewer/src/js/accordian.js +2 -1
  36. iXBRLViewerPlugin/viewer/src/js/aspect.js +18 -7
  37. iXBRLViewerPlugin/viewer/src/js/balance.js +14 -0
  38. iXBRLViewerPlugin/viewer/src/js/chart.js +10 -6
  39. iXBRLViewerPlugin/viewer/src/js/concept.js +28 -1
  40. iXBRLViewerPlugin/viewer/src/js/concept.test.js +23 -2
  41. iXBRLViewerPlugin/viewer/src/js/datatype.js +20 -0
  42. iXBRLViewerPlugin/viewer/src/js/datatype.test.js +62 -0
  43. iXBRLViewerPlugin/viewer/src/js/dialog.js +3 -1
  44. iXBRLViewerPlugin/viewer/src/js/fact.js +16 -0
  45. iXBRLViewerPlugin/viewer/src/js/fact.test.js +3 -0
  46. iXBRLViewerPlugin/viewer/src/js/index.js +11 -3
  47. iXBRLViewerPlugin/viewer/src/js/inspector.js +498 -120
  48. iXBRLViewerPlugin/viewer/src/js/inspector.test.js +1 -1
  49. iXBRLViewerPlugin/viewer/src/js/ixbrlviewer.js +128 -30
  50. iXBRLViewerPlugin/viewer/src/js/ixbrlviewer.test.js +133 -20
  51. iXBRLViewerPlugin/viewer/src/js/menu.js +21 -3
  52. iXBRLViewerPlugin/viewer/src/js/outline.js +2 -2
  53. iXBRLViewerPlugin/viewer/src/js/report.js +60 -8
  54. iXBRLViewerPlugin/viewer/src/js/report.test.js +51 -5
  55. iXBRLViewerPlugin/viewer/src/js/reportset.js +20 -0
  56. iXBRLViewerPlugin/viewer/src/js/reportset.test.js +3 -3
  57. iXBRLViewerPlugin/viewer/src/js/search.js +23 -2
  58. iXBRLViewerPlugin/viewer/src/js/search.test.js +2 -2
  59. iXBRLViewerPlugin/viewer/src/js/summary.js +14 -0
  60. iXBRLViewerPlugin/viewer/src/js/tableExport.js +2 -1
  61. iXBRLViewerPlugin/viewer/src/js/taxonomynamer.js +34 -0
  62. iXBRLViewerPlugin/viewer/src/js/taxonomynamer.test.js +32 -0
  63. iXBRLViewerPlugin/viewer/src/js/theme.js +36 -0
  64. iXBRLViewerPlugin/viewer/src/js/unit.js +17 -2
  65. iXBRLViewerPlugin/viewer/src/js/util.js +16 -16
  66. iXBRLViewerPlugin/viewer/src/js/viewer.js +13 -7
  67. iXBRLViewerPlugin/viewer/src/less/accordian.less +8 -4
  68. iXBRLViewerPlugin/viewer/src/less/block-list.less +12 -6
  69. iXBRLViewerPlugin/viewer/src/less/calculation-inspector.less +2 -2
  70. iXBRLViewerPlugin/viewer/src/less/chart.less +8 -5
  71. iXBRLViewerPlugin/viewer/src/less/colours-dark-mode.less +40 -0
  72. iXBRLViewerPlugin/viewer/src/less/colours.less +28 -21
  73. iXBRLViewerPlugin/viewer/src/less/common.less +1 -1
  74. iXBRLViewerPlugin/viewer/src/less/components.less +3 -3
  75. iXBRLViewerPlugin/viewer/src/less/core.less +2 -0
  76. iXBRLViewerPlugin/viewer/src/less/dialog.less +13 -10
  77. iXBRLViewerPlugin/viewer/src/less/form-controls.less +33 -11
  78. iXBRLViewerPlugin/viewer/src/less/inspector.less +538 -299
  79. iXBRLViewerPlugin/viewer/src/less/loader.less +2 -2
  80. iXBRLViewerPlugin/viewer/src/less/menu.less +33 -15
  81. iXBRLViewerPlugin/viewer/src/less/summary.less +16 -6
  82. iXBRLViewerPlugin/viewer/src/less/tabs.less +5 -5
  83. iXBRLViewerPlugin/viewer/src/less/text-mixins.less +2 -1
  84. iXBRLViewerPlugin/viewer/src/less/validation-report.less +1 -1
  85. iXBRLViewerPlugin/viewer/src/less/viewer.less +30 -18
  86. {ixbrl_viewer-1.4.39.dist-info → ixbrl_viewer-1.4.40.dist-info}/METADATA +33 -5
  87. {ixbrl_viewer-1.4.39.dist-info → ixbrl_viewer-1.4.40.dist-info}/RECORD +95 -66
  88. {ixbrl_viewer-1.4.39.dist-info → ixbrl_viewer-1.4.40.dist-info}/WHEEL +1 -1
  89. tests/puppeteer/framework/page_objects/doc_frame.js +1 -1
  90. tests/puppeteer/tests/fact_properties.test.js +4 -4
  91. tests/unit_tests/iXBRLViewerPlugin/test_iXBRLViewer.py +69 -28
  92. {ixbrl_viewer-1.4.39.dist-info → ixbrl_viewer-1.4.40.dist-info}/LICENSE +0 -0
  93. {ixbrl_viewer-1.4.39.dist-info → ixbrl_viewer-1.4.40.dist-info}/NOTICE +0 -0
  94. {ixbrl_viewer-1.4.39.dist-info → ixbrl_viewer-1.4.40.dist-info}/entry_points.txt +0 -0
  95. {ixbrl_viewer-1.4.39.dist-info → ixbrl_viewer-1.4.40.dist-info}/top_level.txt +0 -0
@@ -2,6 +2,12 @@
2
2
 
3
3
  import { ReportSet } from "./reportset.js";
4
4
  import { NAMESPACE_ISO4217 } from "./util";
5
+ import { TestInspector } from "./test-utils.js";
6
+
7
+ const insp = new TestInspector();
8
+ beforeAll(() => {
9
+ insp.i18nInit();
10
+ });
5
11
 
6
12
  const testReportData = {
7
13
  "prefixes": {
@@ -15,14 +21,16 @@ const testReportData = {
15
21
  "std": {
16
22
  "en": "English label"
17
23
  }
18
- }
24
+ },
25
+ "b": "debit"
19
26
  },
20
27
  "eg:Concept2": {
21
28
  "labels": {
22
29
  "std": {
23
30
  "en": "English label for concept two"
24
31
  }
25
- }
32
+ },
33
+ "b": "credit"
26
34
  },
27
35
  "eg:Concept3": {
28
36
  "labels": {
@@ -86,3 +94,16 @@ describe("Concept references", () => {
86
94
  ]);
87
95
  });
88
96
  });
97
+
98
+ describe("Balance types", () => {
99
+ test("Debit/Credit", () => {
100
+ const rs = new ReportSet(testReportData);
101
+ rs._initialize();
102
+ const r = rs.reports[0];
103
+ expect(r.getConcept("eg:Concept1").balance().balance).toBe("debit");
104
+ expect(r.getConcept("eg:Concept1").balance().label()).toBe("Debit");
105
+ expect(r.getConcept("eg:Concept2").balance().balance).toBe("credit");
106
+ expect(r.getConcept("eg:Concept2").balance().label()).toBe("Credit");
107
+ expect(r.getConcept("eg:Concept3").balance()).toBeUndefined();
108
+ });
109
+ });
@@ -0,0 +1,20 @@
1
+ // See COPYRIGHT.md for copyright information
2
+
3
+ import i18next from 'i18next';
4
+ import { NAMESPACE_XBRLI } from "./util.js";
5
+
6
+ export class DataType {
7
+ constructor(report, name) {
8
+ this.name = name;
9
+ this.report = report;
10
+ this.qname = report.qname(name);
11
+ }
12
+
13
+ label() {
14
+ if (this.qname.namespace == NAMESPACE_XBRLI) {
15
+ return i18next.t(`dataTypes:${this.qname.localname}`, {defaultValue: this.qname.qname});
16
+ }
17
+ return this.report.reportSet.taxonomyNamer.convertQName(this.qname);
18
+ }
19
+
20
+ }
@@ -0,0 +1,62 @@
1
+ // See COPYRIGHT.md for copyright information
2
+
3
+ import { ReportSet } from "./reportset.js";
4
+ import { NAMESPACE_ISO4217, NAMESPACE_XBRLI } from "./util";
5
+ import { TestInspector } from "./test-utils.js";
6
+
7
+ const testReportData = {
8
+ "prefixes": {
9
+ "eg": "http://www.example.com",
10
+ "iso4217": NAMESPACE_ISO4217,
11
+ "xbrli": NAMESPACE_XBRLI,
12
+ "e": "http://example.com/entity",
13
+ },
14
+ "concepts": {
15
+ },
16
+ "facts": {
17
+ }
18
+ }
19
+
20
+ function testReport(concept) {
21
+ // Deep copy of standing data
22
+ const data = JSON.parse(JSON.stringify(testReportData));
23
+ data.concepts["eg:concept"] = concept;
24
+ const reportSet = new ReportSet(data);
25
+ reportSet.setIXNodeMap({});
26
+ return reportSet.reports[0];
27
+ }
28
+
29
+ const insp = new TestInspector();
30
+ beforeAll(() => {
31
+ insp.i18nInit();
32
+ });
33
+
34
+ describe("Data types", () => {
35
+ test("Monetary", () => {
36
+ const r1 = testReport({ "dt": "xbrli:monetaryItemType" });
37
+ expect(r1.getConcept("eg:concept").dataType().label()).toBe("Monetary");
38
+ });
39
+
40
+ test("String", () => {
41
+ const r1 = testReport({ "dt": "xbrli:stringItemType" });
42
+ expect(r1.getConcept("eg:concept").dataType().label()).toBe("String");
43
+ });
44
+
45
+ test("Unknown xbrli", () => {
46
+ const r1 = testReport({ "dt": "xbrli:unknown" });
47
+ expect(r1.getConcept("eg:concept").dataType().label()).toBe("xbrli:unknown");
48
+ });
49
+
50
+ test("Custom", () => {
51
+ const r1 = testReport({ "dt": "eg:stringItemType" });
52
+ expect(r1.getConcept("eg:concept").dataType().label()).toBe("eg:stringItemType");
53
+ });
54
+
55
+ test("No datatype", () => {
56
+ const r1 = testReport({});
57
+ expect(r1.getConcept("eg:concept").dataType()).toBeUndefined();
58
+ });
59
+ })
60
+
61
+
62
+
@@ -28,11 +28,13 @@ export class Dialog {
28
28
 
29
29
  close() {
30
30
  $('.dialog-mask').hide();
31
- this.node.remove() ;
31
+ this.node.get(0).close();
32
+ this.node.remove();
32
33
  }
33
34
 
34
35
  show() {
35
36
  $('.dialog-mask').show();
37
+ this.node.get(0).showModal();
36
38
  this.node.show();
37
39
  }
38
40
  }
@@ -23,18 +23,34 @@ export class Fact {
23
23
  return localId(this.vuid);
24
24
  }
25
25
 
26
+ isMandatory() {
27
+ return this.f.a.m
28
+ }
29
+
26
30
  getLabel(rolePrefix, withPrefix) {
27
31
  return this.report.getLabel(this.f.a.c, rolePrefix, withPrefix);
28
32
  }
29
33
 
34
+ getLabelAndLang(rolePrefix, withPrefix) {
35
+ return this.report.getLabelAndLang(this.f.a.c, rolePrefix, withPrefix);
36
+ }
37
+
30
38
  getLabelOrName(rolePrefix, withPrefix) {
31
39
  return this.report.getLabelOrName(this.f.a.c, rolePrefix, withPrefix);
32
40
  }
33
41
 
42
+ getLabelOrNameAndLang(rolePrefix, withPrefix) {
43
+ return this.report.getLabelOrNameAndLang(this.f.a.c, rolePrefix, withPrefix);
44
+ }
45
+
34
46
  conceptName() {
35
47
  return this.f.a.c;
36
48
  }
37
49
 
50
+ conceptDisplayName() {
51
+ return this.report.reportSet.taxonomyNamer.convertQName(this.conceptQName());
52
+ }
53
+
38
54
  concept() {
39
55
  return this.report.getConcept(this.f.a.c);
40
56
  }
@@ -690,10 +690,13 @@ describe("Get Label", () => {
690
690
 
691
691
  test("Get standard label", () => {
692
692
  expect(f.getLabel("std")).toEqual("English label")
693
+ expect(f.getLabelAndLang("std").label).toEqual("English label")
694
+ expect(f.getLabelAndLang("std").lang).toEqual("en")
693
695
  });
694
696
 
695
697
  test("Get non-existent label", () => {
696
698
  expect(f.getLabel("doc")).toBeUndefined();
699
+ expect(f.getLabelAndLang("doc").label).toBeUndefined();
697
700
  });
698
701
 
699
702
  });
@@ -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 iv = new iXBRLViewer({
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
  });