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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# See COPYRIGHT.md for copyright information
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from arelle.utils.PluginData import PluginData
|
|
6
|
+
|
|
7
|
+
from .iXBRLViewer import IXBRLViewerBuilder
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class IXBRLViewerPluginData(PluginData):
|
|
11
|
+
|
|
12
|
+
builder: IXBRLViewerBuilder | None = None
|
iXBRLViewerPlugin/ui.py
CHANGED
|
@@ -1,34 +1,55 @@
|
|
|
1
1
|
# See COPYRIGHT.md for copyright information
|
|
2
2
|
|
|
3
|
-
from
|
|
4
|
-
try:
|
|
5
|
-
from tkinter.ttk import Frame, Button, Label, Entry, Checkbutton
|
|
6
|
-
except ImportError:
|
|
7
|
-
from ttk import Frame, Button, Label, Entry, Checkbutton
|
|
3
|
+
from __future__ import annotations
|
|
8
4
|
|
|
9
5
|
import os
|
|
10
|
-
|
|
11
|
-
from .
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
from tkinter import EW, NSEW, BooleanVar, E, Event, Misc, StringVar, Toplevel, W
|
|
7
|
+
from tkinter.ttk import Button, Checkbutton, Entry, Frame, Label
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
from arelle.CntlrWinMain import CntlrWinMain
|
|
11
|
+
from arelle.typing import TypeGetText
|
|
12
|
+
|
|
13
|
+
from .constants import (
|
|
14
|
+
CONFIG_COPY_SCRIPT,
|
|
15
|
+
CONFIG_FEATURE_PREFIX,
|
|
16
|
+
CONFIG_FILE_DIRECTORY,
|
|
17
|
+
CONFIG_LAUNCH_ON_LOAD,
|
|
18
|
+
CONFIG_OUTPUT_FILE,
|
|
19
|
+
CONFIG_SCRIPT_URL,
|
|
20
|
+
CONFIG_ZIP_OUTPUT,
|
|
21
|
+
DEFAULT_COPY_SCRIPT,
|
|
22
|
+
DEFAULT_LAUNCH_ON_LOAD,
|
|
23
|
+
GUI_FEATURE_CONFIGS,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
_: TypeGetText
|
|
27
|
+
|
|
28
|
+
UNSET_SCRIPT_URL = ''
|
|
15
29
|
|
|
16
30
|
class BaseViewerDialog(Toplevel):
|
|
17
31
|
"""
|
|
18
32
|
Base class for shared dialog configuration between settings and save dialogs
|
|
19
33
|
"""
|
|
20
|
-
def __init__(self, cntlr):
|
|
21
|
-
super(
|
|
34
|
+
def __init__(self, cntlr: CntlrWinMain) -> None:
|
|
35
|
+
super().__init__(cntlr.parent)
|
|
22
36
|
self.cntlr = cntlr
|
|
23
37
|
self.parent = cntlr.parent
|
|
24
38
|
|
|
25
|
-
self._features = {}
|
|
39
|
+
self._features: dict[str, BooleanVar] = {}
|
|
26
40
|
for featureConfig in GUI_FEATURE_CONFIGS:
|
|
27
41
|
featureVar = BooleanVar()
|
|
28
|
-
featureVar.set(self.
|
|
42
|
+
featureVar.set(self._cntlrConfig.setdefault(f'{CONFIG_FEATURE_PREFIX}{featureConfig.key}', featureConfig.guiDefault))
|
|
29
43
|
self._features[featureConfig.key] = featureVar
|
|
30
44
|
self._scriptUrl = StringVar()
|
|
31
|
-
self._scriptUrl.set(self.
|
|
45
|
+
self._scriptUrl.set(self._cntlrConfig.setdefault(CONFIG_SCRIPT_URL, UNSET_SCRIPT_URL))
|
|
46
|
+
self._copyScript = BooleanVar()
|
|
47
|
+
self._copyScript.set(self._cntlrConfig.setdefault(CONFIG_COPY_SCRIPT, DEFAULT_COPY_SCRIPT))
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def _cntlrConfig(self) -> dict[str, Any]:
|
|
51
|
+
assert self.cntlr.config is not None
|
|
52
|
+
return self.cntlr.config
|
|
32
53
|
|
|
33
54
|
def addButtons(self, frame: Frame, x: int, y: int) -> int:
|
|
34
55
|
"""
|
|
@@ -56,11 +77,17 @@ class BaseViewerDialog(Toplevel):
|
|
|
56
77
|
:return: Row `y` that the last field was added on
|
|
57
78
|
"""
|
|
58
79
|
y += 1
|
|
59
|
-
scriptUrlLabel = Label(frame, text="Script URL")
|
|
80
|
+
scriptUrlLabel = Label(frame, text="Script URL (leave blank for default)")
|
|
60
81
|
scriptUrlEntry = Entry(frame, textvariable=self._scriptUrl, width=80)
|
|
61
82
|
scriptUrlLabel.grid(row=y, column=0, sticky=W, pady=3, padx=3)
|
|
62
83
|
scriptUrlEntry.grid(row=y, column=1, columnspan=2, sticky=EW, pady=3, padx=3)
|
|
63
84
|
|
|
85
|
+
y += 1
|
|
86
|
+
copyScriptCheckbutton = Checkbutton(frame, text="Copy Script", variable=self._copyScript, onvalue=True, offvalue=False)
|
|
87
|
+
copyScriptLabel = Label(frame, text="Copy the iXBRL Viewer script into the output directory.")
|
|
88
|
+
copyScriptCheckbutton.grid(row=y, column=0, pady=3, padx=3, sticky=W)
|
|
89
|
+
copyScriptLabel.grid(row=y, column=1, columnspan=3, pady=3, padx=3, sticky=W)
|
|
90
|
+
|
|
64
91
|
y += 1
|
|
65
92
|
featuresLabel = Label(frame, text="Generate with optional features:")
|
|
66
93
|
featuresLabel.grid(row=y, column=0, columnspan=2, pady=3, padx=3, sticky=W)
|
|
@@ -73,14 +100,14 @@ class BaseViewerDialog(Toplevel):
|
|
|
73
100
|
featureLabel.grid(row=y, column=1, columnspan=2, pady=3, padx=3, sticky=W)
|
|
74
101
|
return y
|
|
75
102
|
|
|
76
|
-
def close(self, event=None):
|
|
103
|
+
def close(self, event: Event[Misc] | None = None) -> None:
|
|
77
104
|
"""
|
|
78
105
|
Closes the dialog.
|
|
79
106
|
"""
|
|
80
107
|
self.parent.focus_set()
|
|
81
108
|
self.destroy()
|
|
82
109
|
|
|
83
|
-
def confirm(self, event=None):
|
|
110
|
+
def confirm(self, event: Event[Misc] | None = None) -> None:
|
|
84
111
|
"""
|
|
85
112
|
Closes the dialog after calling `onConfirm`.
|
|
86
113
|
"""
|
|
@@ -91,16 +118,16 @@ class BaseViewerDialog(Toplevel):
|
|
|
91
118
|
"""
|
|
92
119
|
:return: Title of dialog window
|
|
93
120
|
"""
|
|
94
|
-
|
|
121
|
+
raise NotImplementedError
|
|
95
122
|
|
|
96
|
-
def onConfirm(self):
|
|
123
|
+
def onConfirm(self) -> None:
|
|
97
124
|
"""
|
|
98
125
|
Actions to confirm when "OK" button or "Enter" key are pressed.
|
|
99
126
|
Window is closed immediately after.
|
|
100
127
|
"""
|
|
101
128
|
pass
|
|
102
129
|
|
|
103
|
-
def render(self):
|
|
130
|
+
def render(self) -> None:
|
|
104
131
|
"""
|
|
105
132
|
Performs the arrangement and rendering if dialog fields and buttons.
|
|
106
133
|
Process control is held here via `wait_window` until the dialog is closed.
|
|
@@ -116,7 +143,7 @@ class BaseViewerDialog(Toplevel):
|
|
|
116
143
|
x = 0
|
|
117
144
|
self.addButtons(frame, x, y)
|
|
118
145
|
|
|
119
|
-
frame.grid(row=0, column=0, padx=10, pady=10, sticky=
|
|
146
|
+
frame.grid(row=0, column=0, padx=10, pady=10, sticky=NSEW)
|
|
120
147
|
frame.columnconfigure(1, weight=1)
|
|
121
148
|
|
|
122
149
|
window = self.winfo_toplevel()
|
|
@@ -129,11 +156,14 @@ class BaseViewerDialog(Toplevel):
|
|
|
129
156
|
self.grab_set()
|
|
130
157
|
self.wait_window(self)
|
|
131
158
|
|
|
132
|
-
def
|
|
159
|
+
def copyScript(self) -> bool:
|
|
160
|
+
return self._copyScript.get()
|
|
161
|
+
|
|
162
|
+
def features(self) -> list[str]:
|
|
133
163
|
# Return list of feature keys with corresponding BooleanVar is set to True
|
|
134
164
|
return [feature for feature, value in self._features.items() if value.get()]
|
|
135
165
|
|
|
136
|
-
def scriptUrl(self):
|
|
166
|
+
def scriptUrl(self) -> str:
|
|
137
167
|
return self._scriptUrl.get()
|
|
138
168
|
|
|
139
169
|
|
|
@@ -143,13 +173,13 @@ class SaveViewerDialog(BaseViewerDialog):
|
|
|
143
173
|
Initializes with (but doesn't overwrite) default settings configured in the settings dialog.
|
|
144
174
|
"""
|
|
145
175
|
|
|
146
|
-
def __init__(self, cntlr):
|
|
147
|
-
super(
|
|
176
|
+
def __init__(self, cntlr: CntlrWinMain) -> None:
|
|
177
|
+
super().__init__(cntlr)
|
|
148
178
|
self.accepted = False
|
|
149
179
|
self._filename = StringVar()
|
|
150
|
-
self._filename.set(self.
|
|
180
|
+
self._filename.set(self._cntlrConfig.setdefault(CONFIG_OUTPUT_FILE, ""))
|
|
151
181
|
self._zipViewerOutput = BooleanVar()
|
|
152
|
-
self._zipViewerOutput.set(self.
|
|
182
|
+
self._zipViewerOutput.set(self._cntlrConfig.setdefault(CONFIG_ZIP_OUTPUT, False))
|
|
153
183
|
|
|
154
184
|
def addFields(self, frame: Frame, y: int) -> int:
|
|
155
185
|
"""
|
|
@@ -165,36 +195,35 @@ class SaveViewerDialog(BaseViewerDialog):
|
|
|
165
195
|
y += 1
|
|
166
196
|
zipViewerOutputCheckbutton = Checkbutton(frame, text="Zip Viewer Output", variable=self._zipViewerOutput, onvalue=True, offvalue=False)
|
|
167
197
|
zipViewerOutputCheckbutton.grid(row=y, column=0, pady=3, padx=3)
|
|
168
|
-
return super(
|
|
198
|
+
return super().addFields(frame, y)
|
|
169
199
|
|
|
170
|
-
def browseForFile(self):
|
|
171
|
-
instanceFile = self.cntlr.uiFileDialog(
|
|
200
|
+
def browseForFile(self) -> None:
|
|
201
|
+
instanceFile = self.cntlr.uiFileDialog( # type: ignore[no-untyped-call]
|
|
172
202
|
"save",
|
|
173
203
|
parent=self,
|
|
174
204
|
title=_("arelle - Save iXBRL Viewer Instance"),
|
|
175
|
-
initialdir=self.
|
|
205
|
+
initialdir=self._cntlrConfig.setdefault(CONFIG_FILE_DIRECTORY, "."),
|
|
176
206
|
filetypes=[(_("iXBRL report .html"), "*.html")],
|
|
177
207
|
defaultextension=".html")
|
|
178
208
|
self._filename.set(instanceFile)
|
|
179
|
-
pass
|
|
180
209
|
|
|
181
210
|
def getTitle(self) -> str:
|
|
182
211
|
return "Save iXBRL Viewer"
|
|
183
212
|
|
|
184
|
-
def onConfirm(self):
|
|
213
|
+
def onConfirm(self) -> None:
|
|
185
214
|
"""
|
|
186
215
|
Saves output-specific config values before triggering instance to be saved.
|
|
187
216
|
"""
|
|
188
|
-
self.
|
|
189
|
-
self.
|
|
190
|
-
self.
|
|
217
|
+
self._cntlrConfig[CONFIG_FILE_DIRECTORY] = os.path.dirname(self.filename())
|
|
218
|
+
self._cntlrConfig[CONFIG_OUTPUT_FILE] = self.filename()
|
|
219
|
+
self._cntlrConfig[CONFIG_ZIP_OUTPUT] = self.zipViewerOutput()
|
|
191
220
|
self.cntlr.saveConfig()
|
|
192
221
|
self.accepted = True
|
|
193
222
|
|
|
194
|
-
def filename(self):
|
|
223
|
+
def filename(self) -> str:
|
|
195
224
|
return self._filename.get()
|
|
196
225
|
|
|
197
|
-
def zipViewerOutput(self):
|
|
226
|
+
def zipViewerOutput(self) -> bool:
|
|
198
227
|
return self._zipViewerOutput.get()
|
|
199
228
|
|
|
200
229
|
|
|
@@ -203,10 +232,10 @@ class SettingsDialog(BaseViewerDialog):
|
|
|
203
232
|
Dialog for saving default viewer settings.
|
|
204
233
|
"""
|
|
205
234
|
|
|
206
|
-
def __init__(self, cntlr):
|
|
207
|
-
super(
|
|
235
|
+
def __init__(self, cntlr: CntlrWinMain) -> None:
|
|
236
|
+
super().__init__(cntlr)
|
|
208
237
|
self._launchOnLoad = BooleanVar()
|
|
209
|
-
self._launchOnLoad.set(self.
|
|
238
|
+
self._launchOnLoad.set(self._cntlrConfig.setdefault(CONFIG_LAUNCH_ON_LOAD, DEFAULT_LAUNCH_ON_LOAD))
|
|
210
239
|
|
|
211
240
|
def addButtons(self, frame: Frame, x: int, y: int) -> int:
|
|
212
241
|
"""
|
|
@@ -215,7 +244,7 @@ class SettingsDialog(BaseViewerDialog):
|
|
|
215
244
|
x += 1
|
|
216
245
|
resetButton = Button(frame, text=_("Reset Defaults"), command=self.reset)
|
|
217
246
|
resetButton.grid(row=y, column=x, sticky=E, pady=3, padx=30)
|
|
218
|
-
return super(
|
|
247
|
+
return super().addButtons(frame, x, y)
|
|
219
248
|
|
|
220
249
|
def addFields(self, frame: Frame, y: int) -> int:
|
|
221
250
|
"""
|
|
@@ -226,27 +255,29 @@ class SettingsDialog(BaseViewerDialog):
|
|
|
226
255
|
launchOnLoadLabel = Label(frame, text="Launches an instance of the viewer in Stub Viewer Mode whenever a document is loaded.")
|
|
227
256
|
launchOnLoadCheckbutton.grid(row=y, column=0, pady=3, padx=3, sticky=W)
|
|
228
257
|
launchOnLoadLabel.grid(row=y, column=1, columnspan=3, pady=3, padx=3, sticky=W)
|
|
229
|
-
return super(
|
|
258
|
+
return super().addFields(frame, y)
|
|
230
259
|
|
|
231
260
|
def getTitle(self) -> str:
|
|
232
261
|
return "iXBRL Viewer Settings"
|
|
233
262
|
|
|
234
|
-
def onConfirm(self):
|
|
263
|
+
def onConfirm(self) -> None:
|
|
235
264
|
"""
|
|
236
265
|
Saves configuration values for saving viewers as well as global viewer behavior settings
|
|
237
266
|
"""
|
|
238
|
-
self.
|
|
239
|
-
self.
|
|
267
|
+
self._cntlrConfig[CONFIG_LAUNCH_ON_LOAD] = self._launchOnLoad.get()
|
|
268
|
+
self._cntlrConfig[CONFIG_SCRIPT_URL] = self._scriptUrl.get()
|
|
269
|
+
self._cntlrConfig[CONFIG_COPY_SCRIPT] = self._copyScript.get()
|
|
240
270
|
for key, var in self._features.items():
|
|
241
|
-
self.
|
|
271
|
+
self._cntlrConfig[f'{CONFIG_FEATURE_PREFIX}{key}'] = var.get()
|
|
242
272
|
self.cntlr.saveConfig()
|
|
243
273
|
self.close()
|
|
244
274
|
|
|
245
|
-
def reset(self, event=None):
|
|
275
|
+
def reset(self, event: Event[Misc] | None = None) -> None:
|
|
246
276
|
"""
|
|
247
277
|
Resets dialog variable values to default values
|
|
248
278
|
"""
|
|
249
279
|
self._launchOnLoad.set(DEFAULT_LAUNCH_ON_LOAD)
|
|
250
|
-
self._scriptUrl.set(
|
|
280
|
+
self._scriptUrl.set(UNSET_SCRIPT_URL)
|
|
281
|
+
self._copyScript.set(DEFAULT_COPY_SCRIPT)
|
|
251
282
|
for featureConfig in GUI_FEATURE_CONFIGS:
|
|
252
283
|
self._features[featureConfig.key].set(featureConfig.guiDefault)
|