@mantou/gem 2.3.0 → 2.3.2
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/AGENTS.md +150 -0
- package/dist/gem.js +6 -6
- package/dist/gem.mjs +6 -6
- package/elements/base/dialog.d.ts.map +1 -1
- package/elements/base/gesture.d.ts.map +1 -1
- package/elements/base/gesture.js +20 -1
- package/elements/base/gesture.js.map +1 -1
- package/elements/base/link.d.ts.map +1 -1
- package/elements/base/link.js +1 -1
- package/elements/base/link.js.map +1 -1
- package/elements/base/modal-factory.d.ts +20 -511
- package/elements/base/modal-factory.d.ts.map +1 -1
- package/elements/base/modal-factory.js +3 -2
- package/elements/base/modal-factory.js.map +1 -1
- package/elements/base/reflect.d.ts +7 -4
- package/elements/base/reflect.d.ts.map +1 -1
- package/elements/base/reflect.js +30 -4
- package/elements/base/reflect.js.map +1 -1
- package/elements/base/route.d.ts +3 -6
- package/elements/base/route.d.ts.map +1 -1
- package/elements/base/route.js +1 -1
- package/elements/base/route.js.map +1 -1
- package/elements/base/title.d.ts.map +1 -1
- package/elements/base/title.js +1 -1
- package/elements/base/title.js.map +1 -1
- package/helper/hmr.js.map +1 -1
- package/helper/i18n.d.ts +21 -17
- package/helper/i18n.d.ts.map +1 -1
- package/helper/i18n.js +172 -116
- package/helper/i18n.js.map +1 -1
- package/helper/logger.d.ts.map +1 -1
- package/helper/mediaquery.d.ts.map +1 -1
- package/helper/request.d.ts +7 -1
- package/helper/request.d.ts.map +1 -1
- package/helper/request.js.map +1 -1
- package/helper/theme.d.ts.map +1 -1
- package/helper/theme.js.map +1 -1
- package/lib/decorators.d.ts +3 -2
- package/lib/decorators.d.ts.map +1 -1
- package/lib/decorators.js +2 -1
- package/lib/decorators.js.map +1 -1
- package/lib/directive.d.ts.map +1 -1
- package/lib/element.d.ts +5 -1
- package/lib/element.d.ts.map +1 -1
- package/lib/element.js.map +1 -1
- package/lib/history.d.ts +46 -42
- package/lib/history.d.ts.map +1 -1
- package/lib/lit-html.d.ts.map +1 -1
- package/lib/lit-html.js.map +1 -1
- package/lib/reactive.d.ts +1 -4
- package/lib/reactive.d.ts.map +1 -1
- package/lib/reactive.js +1 -3
- package/lib/reactive.js.map +1 -1
- package/lib/repeat.d.ts +1 -1
- package/lib/repeat.d.ts.map +1 -1
- package/lib/repeat.js.map +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +6 -5
- package/src/elements/base/gesture.ts +20 -1
- package/src/elements/base/modal-factory.ts +22 -6
- package/src/elements/base/reflect.ts +30 -4
- package/src/elements/base/route.ts +2 -7
- package/src/helper/i18n.ts +184 -127
- package/src/lib/decorators.ts +2 -1
- package/src/lib/element.ts +5 -4
- package/src/lib/reactive.ts +1 -6
- package/src/lib/version.ts +1 -1
- package/src/test/elements/link.test.ts +12 -2
- package/src/test/elements/reflect.test.ts +20 -1
- package/src/test/elements/unsafe.test.ts +22 -0
- package/src/test/gem-element/advance.test.ts +87 -0
- package/src/test/utils.test.ts +4 -0
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import { GemElement } from '../../lib/reactive';
|
|
2
|
+
import type { Store } from '../../lib/store';
|
|
2
3
|
declare const open: unique symbol;
|
|
4
|
+
declare const final: unique symbol;
|
|
5
|
+
type ModalElement = GemElement & {
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
export interface ModalClass<T> extends Omit<typeof GemElement, 'prototype'> {
|
|
9
|
+
new (): ModalElement;
|
|
10
|
+
prototype: ModalElement;
|
|
11
|
+
inertStore: HTMLElement[];
|
|
12
|
+
instance: GemElement | null;
|
|
13
|
+
store: Store<{
|
|
14
|
+
[open]: boolean;
|
|
15
|
+
} & T>;
|
|
16
|
+
readonly isOpen: boolean;
|
|
17
|
+
open(opts: T): typeof final;
|
|
18
|
+
close(): typeof final;
|
|
19
|
+
closeHandle(): typeof final;
|
|
20
|
+
shouldClose(): boolean;
|
|
21
|
+
}
|
|
3
22
|
/**
|
|
4
23
|
* 需要使用范型,所以导出一个函数,用来*创建*类似 Confirm 元素的基类;
|
|
5
24
|
* 需要使用 Confirm 的静态方式所以使用 Store 来管理组件状态;
|
|
@@ -8,516 +27,6 @@ declare const open: unique symbol;
|
|
|
8
27
|
* 使用 `mounted`/`unmounted` 定义 `open`/`close` 回调;
|
|
9
28
|
* 模拟 top layer:https://github.com/whatwg/html/issues/4633.
|
|
10
29
|
*/
|
|
11
|
-
export declare function createModalClass<T extends Record<string, unknown>>(options: T):
|
|
12
|
-
new (): {
|
|
13
|
-
[x: symbol]: () => void;
|
|
14
|
-
label: string;
|
|
15
|
-
"__#private@#connectHistory": () => () => boolean | undefined;
|
|
16
|
-
"__#private@#connectStore": () => () => boolean | undefined;
|
|
17
|
-
readonly attributes: NamedNodeMap & {
|
|
18
|
-
label?: Attr | undefined;
|
|
19
|
-
};
|
|
20
|
-
"__#private@#renderRoot": HTMLElement | ShadowRoot;
|
|
21
|
-
"__#private@#internals": ElementInternals & {
|
|
22
|
-
sheets: {
|
|
23
|
-
"__#private@#ele"?: HTMLStyleElement;
|
|
24
|
-
cssText: string;
|
|
25
|
-
get element(): HTMLStyleElement;
|
|
26
|
-
replaceSync(text: string): void;
|
|
27
|
-
readonly cssRules: CSSRuleList;
|
|
28
|
-
readonly ownerRule: CSSRule | null;
|
|
29
|
-
readonly rules: CSSRuleList;
|
|
30
|
-
addRule(selector?: string, style?: string, index?: number): number;
|
|
31
|
-
deleteRule(index: number): void;
|
|
32
|
-
insertRule(rule: string, index?: number): number;
|
|
33
|
-
removeRule(index?: number): void;
|
|
34
|
-
replace(text: string): Promise<CSSStyleSheet>;
|
|
35
|
-
disabled: boolean;
|
|
36
|
-
readonly href: string | null;
|
|
37
|
-
get media(): MediaList;
|
|
38
|
-
set media(mediaText: string);
|
|
39
|
-
readonly ownerNode: Element | ProcessingInstruction | null;
|
|
40
|
-
readonly parentStyleSheet: CSSStyleSheet | null;
|
|
41
|
-
readonly title: string | null;
|
|
42
|
-
readonly type: string;
|
|
43
|
-
}[];
|
|
44
|
-
stateList: import("../..").Updater<any>[];
|
|
45
|
-
};
|
|
46
|
-
"__#private@#effectList": {
|
|
47
|
-
callback: (depValues: any, oldDepValues?: any) => any;
|
|
48
|
-
initialized?: boolean;
|
|
49
|
-
fixed?: boolean;
|
|
50
|
-
values?: any;
|
|
51
|
-
getDep?: (() => any) | undefined;
|
|
52
|
-
preCallback?: any;
|
|
53
|
-
}[];
|
|
54
|
-
"__#private@#memoList": {
|
|
55
|
-
callback: (depValues: any, oldDepValues?: any) => any;
|
|
56
|
-
initialized?: boolean;
|
|
57
|
-
fixed?: boolean;
|
|
58
|
-
values?: any;
|
|
59
|
-
getDep?: (() => any) | undefined;
|
|
60
|
-
preCallback?: any;
|
|
61
|
-
}[];
|
|
62
|
-
"__#private@#renderList": {
|
|
63
|
-
render: () => import("../..").TemplateResult | null | undefined;
|
|
64
|
-
condition?: () => boolean;
|
|
65
|
-
}[];
|
|
66
|
-
"__#private@#isAppendReason"?: boolean;
|
|
67
|
-
"__#private@#isMounted"?: boolean;
|
|
68
|
-
"__#private@#notInCons"?: boolean;
|
|
69
|
-
"__#private@#rendering"?: boolean;
|
|
70
|
-
"__#private@#clearStyle"?: (() => void) | undefined;
|
|
71
|
-
get "__#private@#metadata"(): import("../../lib/reactive").Metadata;
|
|
72
|
-
get "__#private@#renderItem"(): {
|
|
73
|
-
render: () => import("../..").TemplateResult | null | undefined;
|
|
74
|
-
condition?: () => boolean;
|
|
75
|
-
} | undefined;
|
|
76
|
-
get internals(): ElementInternals & {
|
|
77
|
-
sheets: {
|
|
78
|
-
"__#private@#ele"?: HTMLStyleElement;
|
|
79
|
-
cssText: string;
|
|
80
|
-
get element(): HTMLStyleElement;
|
|
81
|
-
replaceSync(text: string): void;
|
|
82
|
-
readonly cssRules: CSSRuleList;
|
|
83
|
-
readonly ownerRule: CSSRule | null;
|
|
84
|
-
readonly rules: CSSRuleList;
|
|
85
|
-
addRule(selector?: string, style?: string, index?: number): number;
|
|
86
|
-
deleteRule(index: number): void;
|
|
87
|
-
insertRule(rule: string, index?: number): number;
|
|
88
|
-
removeRule(index?: number): void;
|
|
89
|
-
replace(text: string): Promise<CSSStyleSheet>;
|
|
90
|
-
disabled: boolean;
|
|
91
|
-
readonly href: string | null;
|
|
92
|
-
get media(): MediaList;
|
|
93
|
-
set media(mediaText: string);
|
|
94
|
-
readonly ownerNode: Element | ProcessingInstruction | null;
|
|
95
|
-
readonly parentStyleSheet: CSSStyleSheet | null;
|
|
96
|
-
readonly title: string | null;
|
|
97
|
-
readonly type: string;
|
|
98
|
-
}[];
|
|
99
|
-
stateList: import("../..").Updater<any>[];
|
|
100
|
-
};
|
|
101
|
-
"__#private@#execEffect": () => void;
|
|
102
|
-
"__#private@#render": (item?: {
|
|
103
|
-
render: () => import("../..").TemplateResult | null | undefined;
|
|
104
|
-
condition?: () => boolean;
|
|
105
|
-
}) => void;
|
|
106
|
-
"__#private@#updateCallback": () => void;
|
|
107
|
-
"__#private@#schedule": (task: () => void) => void;
|
|
108
|
-
"__#private@#update": () => void;
|
|
109
|
-
"__#private@#scheduleUpdate": () => void;
|
|
110
|
-
"__#private@#prepareStyle": () => (() => void) | undefined;
|
|
111
|
-
"__#private@#initEffect": () => void;
|
|
112
|
-
willMount?(): void | Promise<void>;
|
|
113
|
-
mounted?(): void | (() => void) | Promise<void>;
|
|
114
|
-
updated?(): void | Promise<void>;
|
|
115
|
-
unmounted?(): void | Promise<void>;
|
|
116
|
-
shouldUpdate?(): boolean;
|
|
117
|
-
render?(): import("../..").TemplateResult | null | undefined;
|
|
118
|
-
"__#private@#compat": () => void;
|
|
119
|
-
"__#private@#disconnectStore"?: (() => void)[];
|
|
120
|
-
"__#private@#connectedCallback": () => void;
|
|
121
|
-
connectedCallback(): typeof import("../../lib/reactive").UpdateToken;
|
|
122
|
-
disconnectedCallback(): typeof import("../../lib/reactive").UpdateToken;
|
|
123
|
-
effect: <K = any[] | undefined>(callback: (depValues: K, oldDepValues?: K | undefined) => any, getDep?: K extends any[] ? () => K : undefined) => void;
|
|
124
|
-
memo: <K = any[] | undefined>(callback: (depValues: K, oldDepValues?: K | undefined) => any, getDep?: K extends any[] ? () => K : undefined) => void;
|
|
125
|
-
update: () => void;
|
|
126
|
-
accessKey: string;
|
|
127
|
-
readonly accessKeyLabel: string;
|
|
128
|
-
autocapitalize: string;
|
|
129
|
-
autocorrect: boolean;
|
|
130
|
-
dir: string;
|
|
131
|
-
draggable: boolean;
|
|
132
|
-
hidden: boolean;
|
|
133
|
-
inert: boolean;
|
|
134
|
-
innerText: string;
|
|
135
|
-
lang: string;
|
|
136
|
-
readonly offsetHeight: number;
|
|
137
|
-
readonly offsetLeft: number;
|
|
138
|
-
readonly offsetParent: Element | null;
|
|
139
|
-
readonly offsetTop: number;
|
|
140
|
-
readonly offsetWidth: number;
|
|
141
|
-
outerText: string;
|
|
142
|
-
popover: string | null;
|
|
143
|
-
spellcheck: boolean;
|
|
144
|
-
title: string;
|
|
145
|
-
translate: boolean;
|
|
146
|
-
writingSuggestions: string;
|
|
147
|
-
attachInternals(): ElementInternals;
|
|
148
|
-
click(): void;
|
|
149
|
-
hidePopover(): void;
|
|
150
|
-
showPopover(): void;
|
|
151
|
-
togglePopover(options?: boolean): boolean;
|
|
152
|
-
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
153
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
154
|
-
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
155
|
-
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
156
|
-
get classList(): DOMTokenList;
|
|
157
|
-
set classList(value: string);
|
|
158
|
-
className: string;
|
|
159
|
-
readonly clientHeight: number;
|
|
160
|
-
readonly clientLeft: number;
|
|
161
|
-
readonly clientTop: number;
|
|
162
|
-
readonly clientWidth: number;
|
|
163
|
-
readonly currentCSSZoom: number;
|
|
164
|
-
id: string;
|
|
165
|
-
innerHTML: string;
|
|
166
|
-
readonly localName: string;
|
|
167
|
-
readonly namespaceURI: string | null;
|
|
168
|
-
onfullscreenchange: ((this: Element, ev: Event) => any) | null;
|
|
169
|
-
onfullscreenerror: ((this: Element, ev: Event) => any) | null;
|
|
170
|
-
outerHTML: string;
|
|
171
|
-
readonly ownerDocument: Document;
|
|
172
|
-
get part(): DOMTokenList;
|
|
173
|
-
set part(value: string);
|
|
174
|
-
readonly prefix: string | null;
|
|
175
|
-
readonly scrollHeight: number;
|
|
176
|
-
scrollLeft: number;
|
|
177
|
-
scrollTop: number;
|
|
178
|
-
readonly scrollWidth: number;
|
|
179
|
-
readonly shadowRoot: ShadowRoot | null;
|
|
180
|
-
slot: string;
|
|
181
|
-
readonly tagName: string;
|
|
182
|
-
attachShadow(init: ShadowRootInit): ShadowRoot;
|
|
183
|
-
checkVisibility(options?: CheckVisibilityOptions): boolean;
|
|
184
|
-
closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
|
|
185
|
-
closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;
|
|
186
|
-
closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K] | null;
|
|
187
|
-
closest<E extends Element = Element>(selectors: string): E | null;
|
|
188
|
-
computedStyleMap(): StylePropertyMapReadOnly;
|
|
189
|
-
getAttribute(qualifiedName: string): string | null;
|
|
190
|
-
getAttributeNS(namespace: string | null, localName: string): string | null;
|
|
191
|
-
getAttributeNames(): string[];
|
|
192
|
-
getAttributeNode(qualifiedName: string): Attr | null;
|
|
193
|
-
getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
|
|
194
|
-
getBoundingClientRect(): DOMRect;
|
|
195
|
-
getClientRects(): DOMRectList;
|
|
196
|
-
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
|
|
197
|
-
getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
|
|
198
|
-
getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
|
|
199
|
-
getElementsByTagName<K extends keyof MathMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
|
|
200
|
-
getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
|
|
201
|
-
getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
|
|
202
|
-
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
|
|
203
|
-
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
|
|
204
|
-
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>;
|
|
205
|
-
getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
|
|
206
|
-
getHTML(options?: GetHTMLOptions): string;
|
|
207
|
-
hasAttribute(qualifiedName: string): boolean;
|
|
208
|
-
hasAttributeNS(namespace: string | null, localName: string): boolean;
|
|
209
|
-
hasAttributes(): boolean;
|
|
210
|
-
hasPointerCapture(pointerId: number): boolean;
|
|
211
|
-
insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
|
|
212
|
-
insertAdjacentHTML(position: InsertPosition, string: string): void;
|
|
213
|
-
insertAdjacentText(where: InsertPosition, data: string): void;
|
|
214
|
-
matches(selectors: string): boolean;
|
|
215
|
-
releasePointerCapture(pointerId: number): void;
|
|
216
|
-
removeAttribute(qualifiedName: string): void;
|
|
217
|
-
removeAttributeNS(namespace: string | null, localName: string): void;
|
|
218
|
-
removeAttributeNode(attr: Attr): Attr;
|
|
219
|
-
requestFullscreen(options?: FullscreenOptions): Promise<void>;
|
|
220
|
-
requestPointerLock(options?: PointerLockOptions): Promise<void>;
|
|
221
|
-
scroll(options?: ScrollToOptions): void;
|
|
222
|
-
scroll(x: number, y: number): void;
|
|
223
|
-
scrollBy(options?: ScrollToOptions): void;
|
|
224
|
-
scrollBy(x: number, y: number): void;
|
|
225
|
-
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
|
|
226
|
-
scrollTo(options?: ScrollToOptions): void;
|
|
227
|
-
scrollTo(x: number, y: number): void;
|
|
228
|
-
setAttribute(qualifiedName: string, value: string): void;
|
|
229
|
-
setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
|
|
230
|
-
setAttributeNode(attr: Attr): Attr | null;
|
|
231
|
-
setAttributeNodeNS(attr: Attr): Attr | null;
|
|
232
|
-
setHTMLUnsafe(html: string): void;
|
|
233
|
-
setPointerCapture(pointerId: number): void;
|
|
234
|
-
toggleAttribute(qualifiedName: string, force?: boolean): boolean;
|
|
235
|
-
webkitMatchesSelector(selectors: string): boolean;
|
|
236
|
-
get textContent(): string;
|
|
237
|
-
set textContent(value: string | null);
|
|
238
|
-
readonly baseURI: string;
|
|
239
|
-
readonly childNodes: NodeListOf<ChildNode>;
|
|
240
|
-
readonly firstChild: ChildNode | null;
|
|
241
|
-
readonly isConnected: boolean;
|
|
242
|
-
readonly lastChild: ChildNode | null;
|
|
243
|
-
readonly nextSibling: ChildNode | null;
|
|
244
|
-
readonly nodeName: string;
|
|
245
|
-
readonly nodeType: number;
|
|
246
|
-
nodeValue: string | null;
|
|
247
|
-
readonly parentElement: HTMLElement | null;
|
|
248
|
-
readonly parentNode: ParentNode | null;
|
|
249
|
-
readonly previousSibling: ChildNode | null;
|
|
250
|
-
appendChild<T_1 extends Node>(node: T_1): T_1;
|
|
251
|
-
cloneNode(subtree?: boolean): Node;
|
|
252
|
-
compareDocumentPosition(other: Node): number;
|
|
253
|
-
contains(other: Node | null): boolean;
|
|
254
|
-
getRootNode(options?: GetRootNodeOptions): Node;
|
|
255
|
-
hasChildNodes(): boolean;
|
|
256
|
-
insertBefore<T_1 extends Node>(node: T_1, child: Node | null): T_1;
|
|
257
|
-
isDefaultNamespace(namespace: string | null): boolean;
|
|
258
|
-
isEqualNode(otherNode: Node | null): boolean;
|
|
259
|
-
isSameNode(otherNode: Node | null): boolean;
|
|
260
|
-
lookupNamespaceURI(prefix: string | null): string | null;
|
|
261
|
-
lookupPrefix(namespace: string | null): string | null;
|
|
262
|
-
normalize(): void;
|
|
263
|
-
removeChild<T_1 extends Node>(child: T_1): T_1;
|
|
264
|
-
replaceChild<T_1 extends Node>(node: Node, child: T_1): T_1;
|
|
265
|
-
readonly ELEMENT_NODE: 1;
|
|
266
|
-
readonly ATTRIBUTE_NODE: 2;
|
|
267
|
-
readonly TEXT_NODE: 3;
|
|
268
|
-
readonly CDATA_SECTION_NODE: 4;
|
|
269
|
-
readonly ENTITY_REFERENCE_NODE: 5;
|
|
270
|
-
readonly ENTITY_NODE: 6;
|
|
271
|
-
readonly PROCESSING_INSTRUCTION_NODE: 7;
|
|
272
|
-
readonly COMMENT_NODE: 8;
|
|
273
|
-
readonly DOCUMENT_NODE: 9;
|
|
274
|
-
readonly DOCUMENT_TYPE_NODE: 10;
|
|
275
|
-
readonly DOCUMENT_FRAGMENT_NODE: 11;
|
|
276
|
-
readonly NOTATION_NODE: 12;
|
|
277
|
-
readonly DOCUMENT_POSITION_DISCONNECTED: 1;
|
|
278
|
-
readonly DOCUMENT_POSITION_PRECEDING: 2;
|
|
279
|
-
readonly DOCUMENT_POSITION_FOLLOWING: 4;
|
|
280
|
-
readonly DOCUMENT_POSITION_CONTAINS: 8;
|
|
281
|
-
readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
|
|
282
|
-
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
|
|
283
|
-
dispatchEvent(event: Event): boolean;
|
|
284
|
-
ariaActiveDescendantElement: Element | null;
|
|
285
|
-
ariaAtomic: string | null;
|
|
286
|
-
ariaAutoComplete: string | null;
|
|
287
|
-
ariaBrailleLabel: string | null;
|
|
288
|
-
ariaBrailleRoleDescription: string | null;
|
|
289
|
-
ariaBusy: string | null;
|
|
290
|
-
ariaChecked: string | null;
|
|
291
|
-
ariaColCount: string | null;
|
|
292
|
-
ariaColIndex: string | null;
|
|
293
|
-
ariaColIndexText: string | null;
|
|
294
|
-
ariaColSpan: string | null;
|
|
295
|
-
ariaControlsElements: ReadonlyArray<Element> | null;
|
|
296
|
-
ariaCurrent: string | null;
|
|
297
|
-
ariaDescribedByElements: ReadonlyArray<Element> | null;
|
|
298
|
-
ariaDescription: string | null;
|
|
299
|
-
ariaDetailsElements: ReadonlyArray<Element> | null;
|
|
300
|
-
ariaDisabled: string | null;
|
|
301
|
-
ariaErrorMessageElements: ReadonlyArray<Element> | null;
|
|
302
|
-
ariaExpanded: string | null;
|
|
303
|
-
ariaFlowToElements: ReadonlyArray<Element> | null;
|
|
304
|
-
ariaHasPopup: string | null;
|
|
305
|
-
ariaHidden: string | null;
|
|
306
|
-
ariaInvalid: string | null;
|
|
307
|
-
ariaKeyShortcuts: string | null;
|
|
308
|
-
ariaLabel: string | null;
|
|
309
|
-
ariaLabelledByElements: ReadonlyArray<Element> | null;
|
|
310
|
-
ariaLevel: string | null;
|
|
311
|
-
ariaLive: string | null;
|
|
312
|
-
ariaModal: string | null;
|
|
313
|
-
ariaMultiLine: string | null;
|
|
314
|
-
ariaMultiSelectable: string | null;
|
|
315
|
-
ariaOrientation: string | null;
|
|
316
|
-
ariaOwnsElements: ReadonlyArray<Element> | null;
|
|
317
|
-
ariaPlaceholder: string | null;
|
|
318
|
-
ariaPosInSet: string | null;
|
|
319
|
-
ariaPressed: string | null;
|
|
320
|
-
ariaReadOnly: string | null;
|
|
321
|
-
ariaRelevant: string | null;
|
|
322
|
-
ariaRequired: string | null;
|
|
323
|
-
ariaRoleDescription: string | null;
|
|
324
|
-
ariaRowCount: string | null;
|
|
325
|
-
ariaRowIndex: string | null;
|
|
326
|
-
ariaRowIndexText: string | null;
|
|
327
|
-
ariaRowSpan: string | null;
|
|
328
|
-
ariaSelected: string | null;
|
|
329
|
-
ariaSetSize: string | null;
|
|
330
|
-
ariaSort: string | null;
|
|
331
|
-
ariaValueMax: string | null;
|
|
332
|
-
ariaValueMin: string | null;
|
|
333
|
-
ariaValueNow: string | null;
|
|
334
|
-
ariaValueText: string | null;
|
|
335
|
-
role: string | null;
|
|
336
|
-
animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;
|
|
337
|
-
getAnimations(options?: GetAnimationsOptions): Animation[];
|
|
338
|
-
after(...nodes: (Node | string)[]): void;
|
|
339
|
-
before(...nodes: (Node | string)[]): void;
|
|
340
|
-
remove(): void;
|
|
341
|
-
replaceWith(...nodes: (Node | string)[]): void;
|
|
342
|
-
readonly nextElementSibling: Element | null;
|
|
343
|
-
readonly previousElementSibling: Element | null;
|
|
344
|
-
readonly childElementCount: number;
|
|
345
|
-
readonly children: HTMLCollection;
|
|
346
|
-
readonly firstElementChild: Element | null;
|
|
347
|
-
readonly lastElementChild: Element | null;
|
|
348
|
-
append(...nodes: (Node | string)[]): void;
|
|
349
|
-
prepend(...nodes: (Node | string)[]): void;
|
|
350
|
-
querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
|
|
351
|
-
querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
|
|
352
|
-
querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
|
|
353
|
-
querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null;
|
|
354
|
-
querySelector<E extends Element = Element>(selectors: string): E | null;
|
|
355
|
-
querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
|
|
356
|
-
querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
|
|
357
|
-
querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
|
|
358
|
-
querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
|
|
359
|
-
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
|
|
360
|
-
replaceChildren(...nodes: (Node | string)[]): void;
|
|
361
|
-
readonly assignedSlot: HTMLSlotElement | null;
|
|
362
|
-
readonly attributeStyleMap: StylePropertyMap;
|
|
363
|
-
get style(): CSSStyleDeclaration;
|
|
364
|
-
set style(cssText: string);
|
|
365
|
-
contentEditable: string;
|
|
366
|
-
enterKeyHint: string;
|
|
367
|
-
inputMode: string;
|
|
368
|
-
readonly isContentEditable: boolean;
|
|
369
|
-
onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
|
|
370
|
-
onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
371
|
-
onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
372
|
-
onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
373
|
-
onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
374
|
-
onauxclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
375
|
-
onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
|
|
376
|
-
onbeforematch: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
377
|
-
onbeforetoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
|
|
378
|
-
onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
|
|
379
|
-
oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
380
|
-
oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
381
|
-
oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
382
|
-
onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
383
|
-
onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
384
|
-
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
385
|
-
oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
386
|
-
oncontextmenu: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
387
|
-
oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
388
|
-
oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
389
|
-
oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
390
|
-
oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
391
|
-
ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
392
|
-
ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
393
|
-
ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
394
|
-
ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
395
|
-
ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
396
|
-
ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
397
|
-
ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
398
|
-
ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
399
|
-
ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
400
|
-
onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
401
|
-
onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
402
|
-
onerror: OnErrorEventHandler;
|
|
403
|
-
onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
|
|
404
|
-
onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
|
|
405
|
-
ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
406
|
-
oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
407
|
-
oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
408
|
-
onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
409
|
-
onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
410
|
-
onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
411
|
-
onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
412
|
-
onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
413
|
-
onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
414
|
-
onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
415
|
-
onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
416
|
-
onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
417
|
-
onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
418
|
-
onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
419
|
-
onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
420
|
-
onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
421
|
-
onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
422
|
-
onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
423
|
-
onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
424
|
-
onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
425
|
-
onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
426
|
-
onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
427
|
-
onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
428
|
-
onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
429
|
-
onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
430
|
-
onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
431
|
-
onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
432
|
-
onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
433
|
-
onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
434
|
-
onpointerrawupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
435
|
-
onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
436
|
-
onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
|
|
437
|
-
onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
438
|
-
onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
439
|
-
onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
|
|
440
|
-
onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
441
|
-
onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
442
|
-
onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
|
|
443
|
-
onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
444
|
-
onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
445
|
-
onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
446
|
-
onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
447
|
-
onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
448
|
-
onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
449
|
-
onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
450
|
-
onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
|
|
451
|
-
onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
452
|
-
ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
453
|
-
ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
|
|
454
|
-
ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
455
|
-
ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
456
|
-
ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
457
|
-
ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
458
|
-
ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
459
|
-
ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
460
|
-
ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
461
|
-
ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
462
|
-
onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
463
|
-
onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
464
|
-
onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
465
|
-
onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
466
|
-
onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
467
|
-
onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
468
|
-
onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
|
|
469
|
-
autofocus: boolean;
|
|
470
|
-
readonly dataset: DOMStringMap;
|
|
471
|
-
nonce?: string;
|
|
472
|
-
tabIndex: number;
|
|
473
|
-
blur(): void;
|
|
474
|
-
focus(options?: FocusOptions): void;
|
|
475
|
-
};
|
|
476
|
-
inertStore: HTMLElement[];
|
|
477
|
-
instance: GemElement | null;
|
|
478
|
-
/**
|
|
479
|
-
* @final
|
|
480
|
-
* modal 状态,包括内容,是否已经确认关闭等属性
|
|
481
|
-
*/
|
|
482
|
-
store: ((value?: Partial<{
|
|
483
|
-
[open]: boolean;
|
|
484
|
-
} & T> | undefined) => void) & Omit<{
|
|
485
|
-
name: never;
|
|
486
|
-
apply: never;
|
|
487
|
-
call: never;
|
|
488
|
-
bind: never;
|
|
489
|
-
toString: never;
|
|
490
|
-
prototype: never;
|
|
491
|
-
length: never;
|
|
492
|
-
arguments: never;
|
|
493
|
-
caller: never;
|
|
494
|
-
[Symbol.hasInstance]: never;
|
|
495
|
-
[Symbol.metadata]: never;
|
|
496
|
-
}, typeof open | keyof T> & {
|
|
497
|
-
[open]: boolean;
|
|
498
|
-
} & T;
|
|
499
|
-
/**@final */
|
|
500
|
-
get isOpen(): boolean;
|
|
501
|
-
/**
|
|
502
|
-
* @final
|
|
503
|
-
* 自带 100ms 延迟,以允许在其他 Dialog 的 `shouldClose` 中调用此方法;
|
|
504
|
-
* 浏览器 history 为异步 API,需要设置较长延迟;
|
|
505
|
-
*/
|
|
506
|
-
open(opts: T): symbol;
|
|
507
|
-
/**
|
|
508
|
-
* @final
|
|
509
|
-
* UI 中执行关闭
|
|
510
|
-
*/
|
|
511
|
-
close(): symbol;
|
|
512
|
-
/**
|
|
513
|
-
* @final
|
|
514
|
-
* history 中自动调用
|
|
515
|
-
*/
|
|
516
|
-
closeHandle(): symbol;
|
|
517
|
-
/**
|
|
518
|
-
* 由于要操作浏览器历史记录,所以没有设计为 Promise;
|
|
519
|
-
*/
|
|
520
|
-
shouldClose(): boolean;
|
|
521
|
-
};
|
|
30
|
+
export declare function createModalClass<T extends Record<string, unknown>>(options: T): ModalClass<T>;
|
|
522
31
|
export {};
|
|
523
32
|
//# sourceMappingURL=modal-factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-factory.d.ts","sourceRoot":"","sources":["../../src/elements/base/modal-factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"modal-factory.d.ts","sourceRoot":"","sources":["../../src/elements/base/modal-factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAG7C,QAAA,MAAM,IAAI,eAAsB,CAAC;AAEjC,QAAA,MAAM,KAAK,eAAW,CAAC;AAEvB,KAAK,YAAY,GAAG,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnD,MAAM,WAAW,UAAU,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC;IACzE,QAAQ,YAAY,CAAC;IACrB,SAAS,EAAE,YAAY,CAAC;IACxB,UAAU,EAAE,WAAW,EAAE,CAAC;IAC1B,QAAQ,EAAE,UAAU,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,KAAK,CAAC;QAAE,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,CAAC,CAAC,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO,KAAK,CAAC;IAC5B,KAAK,IAAI,OAAO,KAAK,CAAC;IACtB,WAAW,IAAI,OAAO,KAAK,CAAC;IAC5B,WAAW,IAAI,OAAO,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAiF7F"}
|
|
@@ -37,6 +37,8 @@ import { history } from '../../lib/history';
|
|
|
37
37
|
import { GemElement } from '../../lib/reactive';
|
|
38
38
|
import { connect, createStore } from '../../lib/store';
|
|
39
39
|
const open = Symbol('open mark');
|
|
40
|
+
// 静态方法返回不可伪造的值,防止子类覆盖
|
|
41
|
+
const final = Symbol();
|
|
40
42
|
/**
|
|
41
43
|
* 需要使用范型,所以导出一个函数,用来*创建*类似 Confirm 元素的基类;
|
|
42
44
|
* 需要使用 Confirm 的静态方式所以使用 Store 来管理组件状态;
|
|
@@ -46,7 +48,6 @@ const open = Symbol('open mark');
|
|
|
46
48
|
* 模拟 top layer:https://github.com/whatwg/html/issues/4633.
|
|
47
49
|
*/
|
|
48
50
|
export function createModalClass(options) {
|
|
49
|
-
const final = Symbol();
|
|
50
51
|
let ModalElement = (() => {
|
|
51
52
|
var _a;
|
|
52
53
|
let _classDecorators = [shadow(), aria({ role: 'alertdialog', ariaModal: 'true' })];
|
|
@@ -60,7 +61,7 @@ export function createModalClass(options) {
|
|
|
60
61
|
let _private_connectStore_decorators;
|
|
61
62
|
let _private_connectStore_initializers = [];
|
|
62
63
|
let _private_connectStore_extraInitializers = [];
|
|
63
|
-
var ModalElement = class extends _classSuper {
|
|
64
|
+
var ModalElement = _a = class extends _classSuper {
|
|
64
65
|
static { _classThis = this; }
|
|
65
66
|
static {
|
|
66
67
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-factory.js","sourceRoot":"","sources":["../../src/elements/base/modal-factory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"modal-factory.js","sourceRoot":"","sources":["../../src/elements/base/modal-factory.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* 把子节点移动到 `target`(默认 `document.head`)中,用开始和结束注释标记这些节点,
|
|
3
|
+
* 修改 `target` 或者卸载时一起移动或移除
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* 比如 duoyun-ui 文档站加载示例元素时把 GemReflectElement 渲染的元素清除
|
|
5
|
+
* 服务端渲染时不执行 effect,客户端水合后才移动,使用 `getLogicalParent` 从被移动的节点找到 reflect 元素
|
|
7
6
|
*/
|
|
8
7
|
import { GemElement } from '../../lib/reactive';
|
|
8
|
+
/**
|
|
9
|
+
* 节点的逻辑父元素:被 reflect 移动的节点是 reflect 元素,ShadowRoot 中顶层的节点是宿主,其他是父元素
|
|
10
|
+
*/
|
|
11
|
+
export declare function getLogicalParent(node: Node): Element | null;
|
|
9
12
|
export declare class GemReflectElement extends GemElement {
|
|
10
13
|
#private;
|
|
11
14
|
method: 'prepend' | 'append';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflect.d.ts","sourceRoot":"","sources":["../../src/elements/base/reflect.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"reflect.d.ts","sourceRoot":"","sources":["../../src/elements/base/reflect.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AA+BhD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,GAAG,IAAI,CAO3D;AAED,qBAAa,iBAAkB,SAAQ,UAAU;;IACpC,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE9B,MAAM,EAAE,WAAW,CAAiB;CAgC/C"}
|