@web-atoms/web-controls 2.6.5 → 2.6.7
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/html-editor/InlineHtmlEditor.d.ts +1 -1
- package/dist/html-editor/InlineHtmlEditor.d.ts.map +1 -1
- package/dist/html-editor/InlineHtmlEditor.js +2 -2
- package/dist/html-editor/InlineHtmlEditor.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist-esm/ArrayLike.js +14 -12
- package/dist-esm/DataAttributes.js +18 -19
- package/dist-esm/Focusable.js +10 -11
- package/dist-esm/ModuleFiles.js +43 -42
- package/dist-esm/NumberFormats.js +60 -56
- package/dist-esm/PageNavigator.js +28 -30
- package/dist-esm/animations/Animations.js +36 -33
- package/dist-esm/basic/AtomChips.js +312 -305
- package/dist-esm/basic/AtomRepeater.js +1070 -1035
- package/dist-esm/basic/AtomSuggestions.js +97 -107
- package/dist-esm/basic/AttachedPopup.js +0 -1
- package/dist-esm/basic/Button.js +45 -19
- package/dist-esm/basic/ButtonBar.js +84 -64
- package/dist-esm/basic/Calendar.js +211 -203
- package/dist-esm/basic/CheckBoxList.js +90 -70
- package/dist-esm/basic/Checkbox.js +16 -8
- package/dist-esm/basic/Chip.js +36 -12
- package/dist-esm/basic/ComboBox.js +47 -51
- package/dist-esm/basic/DataGrid.js +258 -252
- package/dist-esm/basic/DateField.js +149 -127
- package/dist-esm/basic/DropDown.js +91 -103
- package/dist-esm/basic/DropDownInput.js +78 -106
- package/dist-esm/basic/Editable.js +82 -77
- package/dist-esm/basic/Expander.js +104 -86
- package/dist-esm/basic/FilesDragDrop.js +84 -80
- package/dist-esm/basic/Form.js +80 -52
- package/dist-esm/basic/FormField.js +164 -106
- package/dist-esm/basic/IElement.js +1 -2
- package/dist-esm/basic/InlinePopup.js +263 -234
- package/dist-esm/basic/InlinePopupButton.js +99 -88
- package/dist-esm/basic/InlinePopupControl.js +24 -23
- package/dist-esm/basic/ItemPath.js +59 -60
- package/dist-esm/basic/LimitedText.js +49 -38
- package/dist-esm/basic/ListRepeater.js +13 -14
- package/dist-esm/basic/MaskedInput.js +37 -29
- package/dist-esm/basic/MaskedInputDiv.js +55 -48
- package/dist-esm/basic/MergeNode.js +64 -35
- package/dist-esm/basic/PasswordBox.js +32 -17
- package/dist-esm/basic/PinchZoomView.js +221 -199
- package/dist-esm/basic/PopupButton.js +39 -16
- package/dist-esm/basic/PopupMenu.js +3 -4
- package/dist-esm/basic/RadioButtonList.js +35 -25
- package/dist-esm/basic/RefreshLock.js +41 -42
- package/dist-esm/basic/Resizable.js +43 -33
- package/dist-esm/basic/Select.js +72 -65
- package/dist-esm/basic/SortByButton.js +41 -31
- package/dist-esm/basic/Swipe.js +91 -84
- package/dist-esm/basic/Switch.js +22 -8
- package/dist-esm/basic/TableRepeater.js +29 -33
- package/dist-esm/basic/TimeEditor.js +97 -52
- package/dist-esm/basic/TitleEditor.js +115 -95
- package/dist-esm/basic/ToggleButtonBar.js +21 -22
- package/dist-esm/basic/Tooltip.js +49 -47
- package/dist-esm/basic/TypeWriter.js +45 -42
- package/dist-esm/basic/UploadEvent.js +211 -178
- package/dist-esm/basic/ZoomView.js +229 -198
- package/dist-esm/basic/combineClasses.js +2 -3
- package/dist-esm/basic/elements/AtomPopover.js +270 -253
- package/dist-esm/basic/elements/getContainingBlock.js +34 -35
- package/dist-esm/basic/elements/relativeRect.js +40 -21
- package/dist-esm/desktop-app/DesktopApp.js +65 -80
- package/dist-esm/desktop-app/MobileDesktopApp.js +20 -23
- package/dist-esm/html-editor/AtomHtmlEditor.js +243 -268
- package/dist-esm/html-editor/HtmlEditorCommands.js +6 -4
- package/dist-esm/html-editor/InlineHtmlEditor.d.ts +1 -1
- package/dist-esm/html-editor/InlineHtmlEditor.d.ts.map +1 -1
- package/dist-esm/html-editor/InlineHtmlEditor.js +175 -167
- package/dist-esm/html-editor/InlineHtmlEditor.js.map +1 -1
- package/dist-esm/html-editor/RangeEditor.js +49 -51
- package/dist-esm/html-editor/commands/AddImage.js +40 -35
- package/dist-esm/html-editor/commands/AddLink.js +56 -54
- package/dist-esm/html-editor/commands/Align.js +24 -7
- package/dist-esm/html-editor/commands/AttachFile.js +23 -13
- package/dist-esm/html-editor/commands/AttachImage.js +35 -25
- package/dist-esm/html-editor/commands/Bold.js +10 -11
- package/dist-esm/html-editor/commands/ChangeColor.js +31 -107
- package/dist-esm/html-editor/commands/ChangeFont.js +42 -42
- package/dist-esm/html-editor/commands/ChangeFontSize.js +15 -5
- package/dist-esm/html-editor/commands/Command.js +34 -16
- package/dist-esm/html-editor/commands/CommandButton.js +51 -32
- package/dist-esm/html-editor/commands/Headings.js +25 -9
- package/dist-esm/html-editor/commands/HorizontalRule.js +9 -10
- package/dist-esm/html-editor/commands/HtmlCommands.js +160 -65
- package/dist-esm/html-editor/commands/IndentLess.js +10 -11
- package/dist-esm/html-editor/commands/IndentMore.js +10 -11
- package/dist-esm/html-editor/commands/Italic.js +10 -11
- package/dist-esm/html-editor/commands/NumberedList.js +10 -11
- package/dist-esm/html-editor/commands/Quote.js +10 -11
- package/dist-esm/html-editor/commands/RemoveFormat.js +10 -11
- package/dist-esm/html-editor/commands/Separator.js +5 -4
- package/dist-esm/html-editor/commands/Source.js +29 -25
- package/dist-esm/html-editor/commands/StrikeThrough.js +10 -11
- package/dist-esm/html-editor/commands/Toolbar.js +6 -4
- package/dist-esm/html-editor/commands/Underline.js +10 -11
- package/dist-esm/html-editor/commands/Unlink.js +10 -9
- package/dist-esm/html-editor/commands/UnorderedList.js +10 -11
- package/dist-esm/mobile-app/BottomPopup.js +137 -148
- package/dist-esm/mobile-app/MasterDetailPage.js +153 -152
- package/dist-esm/mobile-app/MobileApp.js +577 -569
- package/dist-esm/player/AtomVideoPlayer.js +316 -270
- package/dist-esm/player/TrackProgress.js +11 -7
- package/dist-esm/player/input-range-style.js +97 -98
- package/dist-esm/tests/app-test/AppTestApp.js +12 -15
- package/dist-esm/tests/app-test/AppTestApp.pack.js +54 -0
- package/dist-esm/tests/app-test/commands/AppCommands.js +14 -11
- package/dist-esm/tests/app-test/drawer/AppDrawer.js +4 -6
- package/dist-esm/tests/app-test/model/model.js +1 -2
- package/dist-esm/tests/app-test/pages/detail/DetailPage.js +21 -15
- package/dist-esm/tests/app-test/pages/home/HomePage.js +7 -8
- package/dist-esm/tests/app-test/pages/list/ListPage.js +79 -62
- package/dist-esm/tests/basic/PopupTest.js +9 -7
- package/dist-esm/tests/basic/TimeEditorTest.js +5 -9
- package/dist-esm/tests/basic/TimeEditorTest.pack.js +39 -0
- package/dist-esm/tests/basic/TimerTest.js +27 -37
- package/dist-esm/tests/basic/TimerTest.pack.js +40 -0
- package/dist-esm/tests/basic/basic-form/BasicForm.js +47 -27
- package/dist-esm/tests/basic/basic-form/BasicForm.pack.js +44 -0
- package/dist-esm/tests/basic/calendar/BasicCalendarTest.js +5 -9
- package/dist-esm/tests/basic/calendar/BasicCalendarTest.pack.js +53 -0
- package/dist-esm/tests/basic/chips/ChipsTest.js +25 -15
- package/dist-esm/tests/basic/chips/ChipsTest.pack.js +56 -0
- package/dist-esm/tests/basic/data-grid/DataGridTest.js +55 -60
- package/dist-esm/tests/basic/data-grid/DataGridTest.pack.js +58 -0
- package/dist-esm/tests/basic/date/DateFieldTest.js +21 -96
- package/dist-esm/tests/basic/date/DateFieldTest.pack.js +57 -0
- package/dist-esm/tests/basic/drop-down/DropDownTest.js +25 -19
- package/dist-esm/tests/basic/drop-down/DropDownTest.pack.js +52 -0
- package/dist-esm/tests/basic/drop-down-input/DropDownTest.js +32 -32
- package/dist-esm/tests/basic/drop-down-input/DropDownTest.pack.js +54 -0
- package/dist-esm/tests/basic/expander/ExpanderMenuTest.js +20 -14
- package/dist-esm/tests/basic/expander/ExpanderMenuTest.pack.js +38 -0
- package/dist-esm/tests/basic/expander/ExpanderTest.js +11 -12
- package/dist-esm/tests/basic/expander/ExpanderTest.pack.js +38 -0
- package/dist-esm/tests/basic/form2/Form2Test.js +26 -24
- package/dist-esm/tests/basic/form2/Form2Test.pack.js +46 -0
- package/dist-esm/tests/basic/limited-text/LimitedTextTest.js +14 -11
- package/dist-esm/tests/basic/limited-text/LimitedTextTest.pack.js +38 -0
- package/dist-esm/tests/basic/pinch-zoom/PinchZoomViewTest.js +14 -14
- package/dist-esm/tests/basic/pinch-zoom/PinchZoomViewTest.pack.js +38 -0
- package/dist-esm/tests/basic/repeater/DragDropRepater.js +30 -12
- package/dist-esm/tests/basic/repeater/DragDropRepater.pack.js +51 -0
- package/dist-esm/tests/basic/repeater/RepeaterTest.js +45 -35
- package/dist-esm/tests/basic/repeater/RepeaterTest.pack.js +52 -0
- package/dist-esm/tests/basic/swipe/SwipeTest.js +13 -13
- package/dist-esm/tests/basic/swipe/SwipeTest.pack.js +52 -0
- package/dist-esm/tests/basic/switch-test/SwitchTest.js +8 -10
- package/dist-esm/tests/basic/switch-test/SwitchTest.pack.js +38 -0
- package/dist-esm/tests/basic/title-editor/TitleEditorTest.js +8 -9
- package/dist-esm/tests/basic/title-editor/TitleEditorTest.pack.js +38 -0
- package/dist-esm/tests/basic/tooltip/TooltipTest.js +30 -24
- package/dist-esm/tests/basic/tooltip/TooltipTest.pack.js +52 -0
- package/dist-esm/tests/basic/typewriter/TypeWriter.js +10 -9
- package/dist-esm/tests/basic/typewriter/TypeWriter.pack.js +39 -0
- package/dist-esm/tests/basic/video/AtomVideoTest.js +13 -10
- package/dist-esm/tests/basic/video/AtomVideoTest.pack.js +38 -0
- package/dist-esm/tests/basic/zoom/ZoomViewTest.js +13 -13
- package/dist-esm/tests/basic/zoom/ZoomViewTest.pack.js +38 -0
- package/dist-esm/tests/check-box-list/CheckBoxListSample.js +13 -12
- package/dist-esm/tests/check-box-list/CheckBoxListSample.pack.js +52 -0
- package/dist-esm/tests/data-grid/GridTestViewModel.js +203 -227
- package/dist-esm/tests/form/CustomHelp.js +6 -9
- package/dist-esm/tests/form/FormViewModel.js +21 -28
- package/dist-esm/tests/html-editor/HtmlEditorTest.js +7 -37
- package/dist-esm/tests/html-editor/HtmlEditorTest.pack.js +83 -0
- package/dist-esm/tests/html-editor/InlineHtmlEdiorTest.js +9 -38
- package/dist-esm/tests/html-editor/InlineHtmlEdiorTest.pack.js +85 -0
- package/dist-esm/tests/mask/MaskedInputTest.js +11 -12
- package/dist-esm/tests/mask/MaskedInputTest.pack.js +38 -0
- package/dist-esm/tests/mobile-app/DesktopAppTest.js +8 -9
- package/dist-esm/tests/mobile-app/DesktopAppTest.pack.js +60 -0
- package/dist-esm/tests/mobile-app/MobileAppTest.js +64 -53
- package/dist-esm/tests/mobile-app/MobileAppTest.pack.js +55 -0
- package/dist-esm/tests/pop-over/PopOverTest.js +37 -77
- package/dist-esm/tests/switch/SwitchTest.js +9 -8
- package/dist-esm/tests/toggle-view/ToggleViewTest.js +15 -22
- package/dist-esm/tests/toggle-view/ToggleViewTest.pack.js +45 -0
- package/dist-esm/toggle-view/AtomToggleView.js +77 -73
- package/dist-esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/html-editor/InlineHtmlEditor.tsx +1 -1
|
@@ -2,163 +2,164 @@ import PageNavigator from "../PageNavigator.js";
|
|
|
2
2
|
import { ContentPage, isMobileView } from "./MobileApp.js";
|
|
3
3
|
import { descendentElementIterator } from "@web-atoms/core/dist/web/core/AtomUI.js";
|
|
4
4
|
import AtomRepeater from "../basic/AtomRepeater.js";
|
|
5
|
-
import
|
|
5
|
+
ESMPack.installStyleSheet(import.meta.resolve("./MasterDetailPage.global.css"));
|
|
6
6
|
const findItem = (content, item) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
const element = repeater.element?.querySelector(`[data-item-index="${index}"]`);
|
|
17
|
-
if (element) {
|
|
18
|
-
return element;
|
|
19
|
-
}
|
|
7
|
+
for (const iterator of descendentElementIterator(content)) {
|
|
8
|
+
const repeater = iterator?.atomControl;
|
|
9
|
+
if (!(repeater instanceof AtomRepeater)) {
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
const index = repeater.items?.indexOf(item) ?? -1;
|
|
13
|
+
if (index === -1) {
|
|
14
|
+
continue;
|
|
20
15
|
}
|
|
16
|
+
const element = repeater.element?.querySelector(`[data-item-index="${index}"]`);
|
|
17
|
+
if (element) {
|
|
18
|
+
return element;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
21
|
};
|
|
22
22
|
export default class MasterDetailPage extends ContentPage {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
if (typeof value === "string") {
|
|
39
|
-
const tokens = value.split("=");
|
|
40
|
-
let key = tokens[0];
|
|
41
|
-
let v = tokens[1] ?? "true";
|
|
42
|
-
if (v.endsWith("]")) {
|
|
43
|
-
v = v.substring(0, v.length - 1);
|
|
44
|
-
}
|
|
45
|
-
if (key.startsWith("[")) {
|
|
46
|
-
key = key.substring(1);
|
|
47
|
-
}
|
|
48
|
-
value = [key, v];
|
|
49
|
-
}
|
|
50
|
-
this.highlightAttributeValue = value;
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.showClose = true;
|
|
26
|
+
this.scrollEveryNewTarget = false;
|
|
27
|
+
this.lookupItemForHighlight = true;
|
|
28
|
+
this.highlightAttributeValue = ["data-filter", "drop-shadow-accent"];
|
|
29
|
+
}
|
|
30
|
+
get highlightAttribute() {
|
|
31
|
+
return this.highlightAttributeValue;
|
|
32
|
+
}
|
|
33
|
+
set highlightAttribute(value) {
|
|
34
|
+
if (!value) {
|
|
35
|
+
this.highlightAttributeValue = ["data-filter", "drop-shadow-accent"];
|
|
36
|
+
return;
|
|
51
37
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
if (!highlightElement && this.lookupItemForHighlight) {
|
|
65
|
-
highlightElement = findItem(content, highlightElementOrItem);
|
|
66
|
-
}
|
|
67
|
-
const lastTargetElement = this.lastTargetElement;
|
|
68
|
-
if (lastTargetElement) {
|
|
69
|
-
const [key] = this.highlightAttributeValue;
|
|
70
|
-
lastTargetElement.removeAttribute(key);
|
|
71
|
-
}
|
|
72
|
-
this.lastTargetElement = highlightElement;
|
|
73
|
-
if (!this.closeButton && this.showClose) {
|
|
74
|
-
const closeButton = document.createElement("i");
|
|
75
|
-
closeButton.setAttribute("data-element", "close");
|
|
76
|
-
closeButton.className = "fas fa-times-circle";
|
|
77
|
-
this.closeButton = closeButton;
|
|
78
|
-
this.element.appendChild(closeButton);
|
|
79
|
-
closeButton.addEventListener("click", () => this.closeDetail());
|
|
80
|
-
}
|
|
81
|
-
let lastDetail = this.lastDetail;
|
|
82
|
-
if (lastDetail) {
|
|
83
|
-
const { element } = lastDetail;
|
|
84
|
-
lastDetail.dispose();
|
|
85
|
-
this.lastDetail = null;
|
|
86
|
-
element.remove();
|
|
87
|
-
if (this.scrollEveryNewTarget) {
|
|
88
|
-
this.scrollTargetIntoView();
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
this.scrollTargetIntoView();
|
|
93
|
-
}
|
|
94
|
-
this.updateTargetSelector(highlightElement);
|
|
95
|
-
const P = page;
|
|
96
|
-
lastDetail = new P(this.app);
|
|
97
|
-
this.element.appendChild(lastDetail.element);
|
|
98
|
-
lastDetail.element.setAttribute("data-element", "detail");
|
|
99
|
-
this.lastDetail = lastDetail;
|
|
100
|
-
lastDetail.parameters = parameters;
|
|
101
|
-
const close = () => this.closeDetail();
|
|
102
|
-
lastDetail.cancel = close;
|
|
103
|
-
lastDetail.close = close;
|
|
104
|
-
this.app.runAsync(() => this.lastDetail?.init?.());
|
|
105
|
-
}
|
|
106
|
-
scrollTargetIntoView(dispose = false) {
|
|
107
|
-
const lastTargetElement = this.lastTargetElement;
|
|
108
|
-
if (lastTargetElement) {
|
|
109
|
-
setTimeout(() => {
|
|
110
|
-
if (lastTargetElement.isConnected) {
|
|
111
|
-
lastTargetElement.scrollIntoView();
|
|
112
|
-
}
|
|
113
|
-
if (dispose) {
|
|
114
|
-
this.lastTargetElement = void 0;
|
|
115
|
-
this.updateTargetSelector(lastTargetElement, true, dispose);
|
|
116
|
-
}
|
|
117
|
-
}, 100);
|
|
118
|
-
}
|
|
38
|
+
if (typeof value === "string") {
|
|
39
|
+
const tokens = value.split("=");
|
|
40
|
+
let key = tokens[0];
|
|
41
|
+
let v = tokens[1] ?? "true";
|
|
42
|
+
if (v.endsWith("]")) {
|
|
43
|
+
v = v.substring(0, v.length - 1);
|
|
44
|
+
}
|
|
45
|
+
if (key.startsWith("[")) {
|
|
46
|
+
key = key.substring(1);
|
|
47
|
+
}
|
|
48
|
+
value = [key, v];
|
|
119
49
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (delay) {
|
|
127
|
-
setTimeout(() => {
|
|
128
|
-
lastTargetElement.removeAttribute(key);
|
|
129
|
-
}, 1000);
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
lastTargetElement.removeAttribute(key);
|
|
133
|
-
}
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
lastTargetElement.setAttribute(key, value);
|
|
50
|
+
this.highlightAttributeValue = value;
|
|
51
|
+
}
|
|
52
|
+
openDetail(page, parameters, highlightElementOrItem) {
|
|
53
|
+
if (isMobileView) {
|
|
54
|
+
PageNavigator.pushPage(page, parameters);
|
|
55
|
+
return;
|
|
137
56
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
57
|
+
const content = this.element.querySelector(`[data-page-element="content"]`);
|
|
58
|
+
content.setAttribute("data-mode", "desktop");
|
|
59
|
+
this.element.setAttribute("data-is-open", "true");
|
|
60
|
+
let highlightElement;
|
|
61
|
+
if (highlightElementOrItem instanceof HTMLElement) {
|
|
62
|
+
highlightElement = highlightElementOrItem;
|
|
63
|
+
}
|
|
64
|
+
if (!highlightElement && this.lookupItemForHighlight) {
|
|
65
|
+
highlightElement = findItem(content, highlightElementOrItem);
|
|
66
|
+
}
|
|
67
|
+
const lastTargetElement = this.lastTargetElement;
|
|
68
|
+
if (lastTargetElement) {
|
|
69
|
+
const [key] = this.highlightAttributeValue;
|
|
70
|
+
lastTargetElement.removeAttribute(key);
|
|
71
|
+
}
|
|
72
|
+
this.lastTargetElement = highlightElement;
|
|
73
|
+
if (!this.closeButton && this.showClose) {
|
|
74
|
+
const closeButton = document.createElement("i");
|
|
75
|
+
closeButton.setAttribute("data-element", "close");
|
|
76
|
+
closeButton.className = "fas fa-times-circle";
|
|
77
|
+
this.closeButton = closeButton;
|
|
78
|
+
this.element.appendChild(closeButton);
|
|
79
|
+
closeButton.addEventListener("click", () => this.closeDetail());
|
|
80
|
+
}
|
|
81
|
+
let lastDetail = this.lastDetail;
|
|
82
|
+
if (lastDetail) {
|
|
83
|
+
const {
|
|
84
|
+
element
|
|
85
|
+
} = lastDetail;
|
|
86
|
+
lastDetail.dispose();
|
|
87
|
+
this.lastDetail = null;
|
|
88
|
+
element.remove();
|
|
89
|
+
if (this.scrollEveryNewTarget) {
|
|
90
|
+
this.scrollTargetIntoView();
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
this.scrollTargetIntoView();
|
|
94
|
+
}
|
|
95
|
+
this.updateTargetSelector(highlightElement);
|
|
96
|
+
const P = page;
|
|
97
|
+
lastDetail = new P(this.app);
|
|
98
|
+
this.element.appendChild(lastDetail.element);
|
|
99
|
+
lastDetail.element.setAttribute("data-element", "detail");
|
|
100
|
+
this.lastDetail = lastDetail;
|
|
101
|
+
lastDetail.parameters = parameters;
|
|
102
|
+
const close = () => this.closeDetail();
|
|
103
|
+
lastDetail.cancel = close;
|
|
104
|
+
lastDetail.close = close;
|
|
105
|
+
this.app.runAsync(() => this.lastDetail?.init?.());
|
|
106
|
+
}
|
|
107
|
+
scrollTargetIntoView(dispose = false) {
|
|
108
|
+
const lastTargetElement = this.lastTargetElement;
|
|
109
|
+
if (lastTargetElement) {
|
|
110
|
+
setTimeout(() => {
|
|
111
|
+
if (lastTargetElement.isConnected) {
|
|
112
|
+
lastTargetElement.scrollIntoView();
|
|
113
|
+
}
|
|
114
|
+
if (dispose) {
|
|
115
|
+
this.lastTargetElement = void 0;
|
|
116
|
+
this.updateTargetSelector(lastTargetElement, true, dispose);
|
|
117
|
+
}
|
|
118
|
+
}, 100);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
updateTargetSelector(lastTargetElement, remove = false, delay = false) {
|
|
122
|
+
if (!lastTargetElement) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const [key, value] = this.highlightAttributeValue;
|
|
126
|
+
if (remove) {
|
|
127
|
+
if (delay) {
|
|
128
|
+
setTimeout(() => {
|
|
129
|
+
lastTargetElement.removeAttribute(key);
|
|
130
|
+
}, 1000);
|
|
131
|
+
} else {
|
|
132
|
+
lastTargetElement.removeAttribute(key);
|
|
133
|
+
}
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
lastTargetElement.setAttribute(key, value);
|
|
137
|
+
}
|
|
138
|
+
preCreate() {
|
|
139
|
+
super.preCreate();
|
|
140
|
+
if (!isMobileView) {
|
|
141
|
+
this.element.setAttribute("data-mode", "desktop");
|
|
142
|
+
}
|
|
143
|
+
this.element.setAttribute("data-page-type", "master-detail");
|
|
144
|
+
}
|
|
145
|
+
closeDetail() {
|
|
146
|
+
const lastDetail = this.lastDetail;
|
|
147
|
+
if (lastDetail) {
|
|
148
|
+
const {
|
|
149
|
+
element
|
|
150
|
+
} = lastDetail;
|
|
151
|
+
lastDetail.dispose();
|
|
152
|
+
element.remove();
|
|
153
|
+
this.lastDetail = void 0;
|
|
154
|
+
}
|
|
155
|
+
const closeButton = this.closeButton;
|
|
156
|
+
if (closeButton) {
|
|
157
|
+
closeButton.remove();
|
|
158
|
+
this.closeButton = void 0;
|
|
162
159
|
}
|
|
163
|
-
|
|
164
|
-
|
|
160
|
+
const content = this.element.querySelector(`[data-page-element="content"]`);
|
|
161
|
+
content.removeAttribute("data-mode");
|
|
162
|
+
this.element.removeAttribute("data-is-open");
|
|
163
|
+
this.scrollTargetIntoView(true);
|
|
164
|
+
}
|
|
165
|
+
}
|