godown 2.4.1 → 2.5.0
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/README.md +1 -1
- package/conf.d.ts +2 -2
- package/conf.d.ts.map +1 -1
- package/conf.js +15 -1
- package/conf.js.map +1 -1
- package/deps.d.ts +4 -9
- package/deps.d.ts.map +1 -1
- package/deps.js +4 -7
- package/deps.js.map +1 -1
- package/effect/clip-text.d.ts +7 -1
- package/effect/clip-text.d.ts.map +1 -1
- package/effect/clip-text.js +9 -2
- package/effect/clip-text.js.map +1 -1
- package/effect/overbreath-text.d.ts +11 -2
- package/effect/overbreath-text.d.ts.map +1 -1
- package/effect/overbreath-text.js +12 -1
- package/effect/overbreath-text.js.map +1 -1
- package/effect/std.d.ts +1 -1
- package/effect/std.js +1 -1
- package/effect/typewriter-text.d.ts +33 -1
- package/effect/typewriter-text.d.ts.map +1 -1
- package/effect/typewriter-text.js +39 -5
- package/effect/typewriter-text.js.map +1 -1
- package/{glob.d.ts → godown-element.d.ts} +20 -30
- package/godown-element.d.ts.map +1 -0
- package/godown-element.js +140 -0
- package/godown-element.js.map +1 -0
- package/group/avatar-group.d.ts +10 -2
- package/group/avatar-group.d.ts.map +1 -1
- package/group/avatar-group.js +16 -11
- package/group/avatar-group.js.map +1 -1
- package/group/details-group.d.ts +12 -2
- package/group/details-group.d.ts.map +1 -1
- package/group/details-group.js +23 -15
- package/group/details-group.js.map +1 -1
- package/group/std.d.ts +1 -1
- package/group/std.js +1 -1
- package/group/tab-group.d.ts +24 -4
- package/group/tab-group.d.ts.map +1 -1
- package/group/tab-group.js +26 -6
- package/group/tab-group.js.map +1 -1
- package/input-form/base-input.d.ts +25 -7
- package/input-form/base-input.d.ts.map +1 -1
- package/input-form/base-input.js +36 -21
- package/input-form/base-input.js.map +1 -1
- package/input-form/label-input.d.ts +14 -6
- package/input-form/label-input.d.ts.map +1 -1
- package/input-form/label-input.js +64 -39
- package/input-form/label-input.js.map +1 -1
- package/input-form/search-input.d.ts +28 -9
- package/input-form/search-input.d.ts.map +1 -1
- package/input-form/search-input.js +61 -72
- package/input-form/search-input.js.map +1 -1
- package/input-form/select-input.d.ts +22 -5
- package/input-form/select-input.d.ts.map +1 -1
- package/input-form/select-input.js +39 -20
- package/input-form/select-input.js.map +1 -1
- package/input-form/sign-form.d.ts +19 -4
- package/input-form/sign-form.d.ts.map +1 -1
- package/input-form/sign-form.js +16 -8
- package/input-form/sign-form.js.map +1 -1
- package/input-form/split-input.d.ts +13 -4
- package/input-form/split-input.d.ts.map +1 -1
- package/input-form/split-input.js +20 -15
- package/input-form/split-input.js.map +1 -1
- package/input-form/std.d.ts +6 -6
- package/input-form/std.d.ts.map +1 -1
- package/input-form/std.js +18 -9
- package/input-form/std.js.map +1 -1
- package/input-form/switch-input.d.ts +26 -3
- package/input-form/switch-input.d.ts.map +1 -1
- package/input-form/switch-input.js +30 -6
- package/input-form/switch-input.js.map +1 -1
- package/items/alert-item.d.ts +20 -2
- package/items/alert-item.d.ts.map +1 -1
- package/items/alert-item.js +39 -26
- package/items/alert-item.js.map +1 -1
- package/items/avatar-a.d.ts +22 -2
- package/items/avatar-a.d.ts.map +1 -1
- package/items/avatar-a.js +34 -7
- package/items/avatar-a.js.map +1 -1
- package/items/base-button.d.ts +50 -6
- package/items/base-button.d.ts.map +1 -1
- package/items/base-button.js +179 -80
- package/items/base-button.js.map +1 -1
- package/items/card-item.d.ts +11 -5
- package/items/card-item.d.ts.map +1 -1
- package/items/card-item.js +52 -13
- package/items/card-item.js.map +1 -1
- package/items/dialog-item.d.ts +27 -5
- package/items/dialog-item.d.ts.map +1 -1
- package/items/dialog-item.js +26 -4
- package/items/dialog-item.js.map +1 -1
- package/items/index.d.ts +1 -1
- package/items/index.d.ts.map +1 -1
- package/items/index.js +1 -1
- package/items/index.js.map +1 -1
- package/items/link-a.d.ts +14 -1
- package/items/link-a.d.ts.map +1 -1
- package/items/link-a.js +21 -7
- package/items/link-a.js.map +1 -1
- package/items/load-progress.d.ts +36 -0
- package/items/load-progress.d.ts.map +1 -0
- package/items/{load-track.js → load-progress.js} +40 -49
- package/items/load-progress.js.map +1 -0
- package/items/std.d.ts +1 -1
- package/items/std.d.ts.map +1 -1
- package/items/std.js +1 -1
- package/items/std.js.map +1 -1
- package/items/super-a.d.ts +15 -1
- package/items/super-a.d.ts.map +1 -1
- package/items/super-a.js +20 -6
- package/items/super-a.js.map +1 -1
- package/items/time-bar.d.ts +33 -2
- package/items/time-bar.d.ts.map +1 -1
- package/items/time-bar.js +35 -4
- package/items/time-bar.js.map +1 -1
- package/layout/div-line.d.ts +8 -2
- package/layout/div-line.d.ts.map +1 -1
- package/layout/div-line.js +16 -9
- package/layout/div-line.js.map +1 -1
- package/layout/drag-box.d.ts +10 -1
- package/layout/drag-box.d.ts.map +1 -1
- package/layout/drag-box.js +14 -4
- package/layout/drag-box.js.map +1 -1
- package/layout/flex-flow.d.ts +11 -2
- package/layout/flex-flow.d.ts.map +1 -1
- package/layout/flex-flow.js +15 -5
- package/layout/flex-flow.js.map +1 -1
- package/layout/index.d.ts +0 -1
- package/layout/index.d.ts.map +1 -1
- package/layout/index.js +0 -1
- package/layout/index.js.map +1 -1
- package/layout/nav-aside.d.ts +12 -3
- package/layout/nav-aside.d.ts.map +1 -1
- package/layout/nav-aside.js +15 -5
- package/layout/nav-aside.js.map +1 -1
- package/layout/nav-layout.d.ts +14 -2
- package/layout/nav-layout.d.ts.map +1 -1
- package/layout/nav-layout.js +12 -6
- package/layout/nav-layout.js.map +1 -1
- package/layout/skeleton-screen.d.ts +15 -1
- package/layout/skeleton-screen.d.ts.map +1 -1
- package/layout/skeleton-screen.js +17 -2
- package/layout/skeleton-screen.js.map +1 -1
- package/layout/std.d.ts +1 -1
- package/layout/std.js +1 -1
- package/lib/directives.d.ts +31 -0
- package/lib/directives.d.ts.map +1 -0
- package/lib/directives.js +38 -0
- package/lib/directives.js.map +1 -0
- package/lib/event-collection.d.ts +9 -5
- package/lib/event-collection.d.ts.map +1 -1
- package/lib/event-collection.js +29 -29
- package/lib/event-collection.js.map +1 -1
- package/lib/templates.d.ts +39 -0
- package/lib/templates.d.ts.map +1 -0
- package/{tmpl.js → lib/templates.js} +27 -5
- package/lib/templates.js.map +1 -0
- package/lib/utils.d.ts +45 -2
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +121 -13
- package/lib/utils.js.map +1 -1
- package/package.json +2 -2
- package/react/create.d.ts +1 -1
- package/react/create.d.ts.map +1 -1
- package/react/create.js +1 -2
- package/react/create.js.map +1 -1
- package/react/effect.d.ts.map +1 -1
- package/react/effect.js +0 -3
- package/react/effect.js.map +1 -1
- package/react/group.d.ts.map +1 -1
- package/react/group.js +0 -3
- package/react/group.js.map +1 -1
- package/react/input-form.d.ts.map +1 -1
- package/react/input-form.js +0 -8
- package/react/input-form.js.map +1 -1
- package/react/items.d.ts +1 -1
- package/react/items.d.ts.map +1 -1
- package/react/items.js +1 -10
- package/react/items.js.map +1 -1
- package/react/layout.d.ts +0 -1
- package/react/layout.d.ts.map +1 -1
- package/react/layout.js +0 -10
- package/react/layout.js.map +1 -1
- package/react/view.d.ts +3 -2
- package/react/view.d.ts.map +1 -1
- package/react/view.js +9 -13
- package/react/view.js.map +1 -1
- package/root.d.ts +23 -0
- package/root.d.ts.map +1 -0
- package/root.js +82 -0
- package/root.js.map +1 -0
- package/view/details-expand.d.ts +10 -2
- package/view/details-expand.d.ts.map +1 -1
- package/view/details-expand.js +15 -12
- package/view/details-expand.js.map +1 -1
- package/view/index.d.ts +3 -2
- package/view/index.d.ts.map +1 -1
- package/view/index.js +3 -2
- package/view/index.js.map +1 -1
- package/view/menu-list.d.ts +6 -4
- package/view/menu-list.d.ts.map +1 -1
- package/view/menu-list.js +18 -23
- package/view/menu-list.js.map +1 -1
- package/view/offset-expand.d.ts +27 -0
- package/view/offset-expand.d.ts.map +1 -0
- package/view/offset-expand.js +138 -0
- package/view/offset-expand.js.map +1 -0
- package/view/rotation-pool.d.ts +14 -2
- package/view/rotation-pool.d.ts.map +1 -1
- package/view/rotation-pool.js +16 -2
- package/view/rotation-pool.js.map +1 -1
- package/view/route-view.d.ts +25 -3
- package/view/route-view.d.ts.map +1 -1
- package/view/route-view.js +27 -3
- package/view/route-view.js.map +1 -1
- package/view/scroll-x.d.ts +9 -3
- package/view/scroll-x.d.ts.map +1 -1
- package/view/scroll-x.js +13 -5
- package/view/scroll-x.js.map +1 -1
- package/view/std.d.ts +27 -7
- package/view/std.d.ts.map +1 -1
- package/view/std.js +32 -6
- package/view/std.js.map +1 -1
- package/view/tool-tip.d.ts +24 -0
- package/view/tool-tip.d.ts.map +1 -0
- package/view/{float-tips.js → tool-tip.js} +41 -41
- package/view/tool-tip.js.map +1 -0
- package/view/with-wrap.d.ts +25 -0
- package/view/with-wrap.d.ts.map +1 -0
- package/view/with-wrap.js +99 -0
- package/view/with-wrap.js.map +1 -0
- package/glob.d.ts.map +0 -1
- package/glob.js +0 -213
- package/glob.js.map +0 -1
- package/items/load-track.d.ts +0 -23
- package/items/load-track.d.ts.map +0 -1
- package/items/load-track.js.map +0 -1
- package/layout/with-wrap.d.ts +0 -14
- package/layout/with-wrap.d.ts.map +0 -1
- package/layout/with-wrap.js +0 -33
- package/layout/with-wrap.js.map +0 -1
- package/tmpl.d.ts +0 -23
- package/tmpl.d.ts.map +0 -1
- package/tmpl.js.map +0 -1
- package/view/down-drop.d.ts +0 -25
- package/view/down-drop.d.ts.map +0 -1
- package/view/down-drop.js +0 -119
- package/view/down-drop.js.map +0 -1
- package/view/float-tips.d.ts +0 -19
- package/view/float-tips.d.ts.map +0 -1
- package/view/float-tips.js.map +0 -1
- package/with.d.ts +0 -43
- package/with.d.ts.map +0 -1
- package/with.js +0 -89
- package/with.js.map +0 -1
package/README.md
CHANGED
package/conf.d.ts
CHANGED
@@ -7,15 +7,15 @@ declare global {
|
|
7
7
|
GodownWebComponentsCONF: ConfType;
|
8
8
|
}
|
9
9
|
}
|
10
|
-
interface ConfType {
|
10
|
+
export interface ConfType {
|
11
11
|
assign: null | Record<string, any>;
|
12
12
|
cssvar: string;
|
13
|
-
enabled: Set<string>;
|
14
13
|
namemap: Map<string, string>;
|
15
14
|
classmap: Map<string, CustomElementConstructor>;
|
16
15
|
prefix: string;
|
17
16
|
reflect: boolean;
|
18
17
|
suffix: string;
|
19
18
|
tag: (origin: string) => string;
|
19
|
+
define: (name: string | void, constructor: CustomElementConstructor, options?: ElementDefinitionOptions) => void;
|
20
20
|
}
|
21
21
|
//# sourceMappingURL=conf.d.ts.map
|
package/conf.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conf.d.ts","sourceRoot":"","sources":["../src/conf.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"conf.d.ts","sourceRoot":"","sources":["../src/conf.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,IAAI,EAAE,QAAkE,CAAC;AACtF,eAAe,IAAI,CAAC;AAEpB,wBAAgB,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAE,QAAe,GAAG,QAAQ,CASrF;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAEpE;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,UAAU;QAClB,uBAAuB,EAAE,QAAQ,CAAC;KACnC;CACF;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAChC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,WAAW,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,wBAAwB,KAAK,IAAI,CAAC;CAClH"}
|
package/conf.js
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
const defaultConfig = {
|
2
2
|
assign: null,
|
3
3
|
cssvar: "godown",
|
4
|
-
enabled: new Set(),
|
5
4
|
namemap: new Map(),
|
6
5
|
classmap: new Map(),
|
7
6
|
prefix: "",
|
@@ -10,6 +9,21 @@ const defaultConfig = {
|
|
10
9
|
tag(origin) {
|
11
10
|
return this.prefix + origin + this.suffix;
|
12
11
|
},
|
12
|
+
define(name, constructor, options) {
|
13
|
+
if (!name) {
|
14
|
+
name = constructor.name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
15
|
+
}
|
16
|
+
const tagName = this.tag(name);
|
17
|
+
if (!tagName) {
|
18
|
+
return;
|
19
|
+
}
|
20
|
+
if (!customElements.get(tagName)) {
|
21
|
+
customElements.define(tagName, constructor, options);
|
22
|
+
constructor.elementTagName = tagName;
|
23
|
+
this.namemap.set(name, tagName);
|
24
|
+
this.classmap.set(name, constructor);
|
25
|
+
}
|
26
|
+
},
|
13
27
|
};
|
14
28
|
export const conf = init(globalThis.GodownWebComponentsCONF, defaultConfig);
|
15
29
|
export default conf;
|
package/conf.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conf.js","sourceRoot":"","sources":["../src/conf.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"conf.js","sourceRoot":"","sources":["../src/conf.ts"],"names":[],"mappings":"AACA,MAAM,aAAa,GAAa;IAC9B,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,IAAI,GAAG,EAAE;IAClB,QAAQ,EAAE,IAAI,GAAG,EAAE;IACnB,MAAM,EAAE,EAAE;IAC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MAAM,UAAU,YAAY,CAAC,UAA6B;IACxD,OAAO,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AAChC,CAAC"}
|
package/deps.d.ts
CHANGED
@@ -1,10 +1,5 @@
|
|
1
|
-
export {
|
2
|
-
export
|
3
|
-
export
|
4
|
-
export
|
5
|
-
export { query, queryAll, property, state, customElement } from "lit/decorators.js";
|
6
|
-
export { ifDefined } from "lit/directives/if-defined.js";
|
7
|
-
export { classMap } from "lit/directives/class-map.js";
|
8
|
-
export type { HTMLTemplate } from "./tmpl";
|
9
|
-
export type { CSSResultGroup } from "lit";
|
1
|
+
export { html, css, unsafeCSS, type CSSResultGroup, nothing, type PropertyValueMap } from "lit";
|
2
|
+
export * from "lit/decorators.js";
|
3
|
+
export * from "lit/directives/if-defined.js";
|
4
|
+
export * from "lit/directives/class-map.js";
|
10
5
|
//# sourceMappingURL=deps.d.ts.map
|
package/deps.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,
|
1
|
+
{"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAChG,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC"}
|
package/deps.js
CHANGED
@@ -1,8 +1,5 @@
|
|
1
|
-
export {
|
2
|
-
export
|
3
|
-
export
|
4
|
-
export
|
5
|
-
export { query, queryAll, property, state, customElement } from "lit/decorators.js";
|
6
|
-
export { ifDefined } from "lit/directives/if-defined.js";
|
7
|
-
export { classMap } from "lit/directives/class-map.js";
|
1
|
+
export { html, css, unsafeCSS, nothing } from "lit";
|
2
|
+
export * from "lit/decorators.js";
|
3
|
+
export * from "lit/directives/if-defined.js";
|
4
|
+
export * from "lit/directives/class-map.js";
|
8
5
|
//# sourceMappingURL=deps.js.map
|
package/deps.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deps.js","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,
|
1
|
+
{"version":3,"file":"deps.js","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAuB,OAAO,EAAyB,MAAM,KAAK,CAAC;AAChG,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC"}
|
package/effect/clip-text.d.ts
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
import { type CSSResultGroup } from "../deps.js";
|
2
|
-
import { type HTMLTemplate } from "../
|
2
|
+
import { type HTMLTemplate } from "../lib/templates.js";
|
3
3
|
import EffectSTD from "./std.js";
|
4
|
+
/**
|
5
|
+
* ClipText renders a gradient text.
|
6
|
+
*/
|
4
7
|
export declare class ClipText extends EffectSTD {
|
8
|
+
/**
|
9
|
+
* The text to be clipped.
|
10
|
+
*/
|
5
11
|
text: string;
|
6
12
|
static styles: CSSResultGroup;
|
7
13
|
protected render(): HTMLTemplate | string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"clip-text.d.ts","sourceRoot":"","sources":["../../src/effect/clip-text.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"clip-text.d.ts","sourceRoot":"","sources":["../../src/effect/clip-text.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,cAAc,EAAY,MAAM,YAAY,CAAC;AAChE,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,SAAS,MAAM,UAAU,CAAC;AAKjC;;GAEG;AACH,qBACa,QAAS,SAAQ,SAAS;IACrC;;OAEG;IACS,IAAI,SAAM;IAEtB,MAAM,CAAC,MAAM,iBAaO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY,GAAG,MAAM;CAG1C;AAED,eAAe,QAAQ,CAAC;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
package/effect/clip-text.js
CHANGED
@@ -4,14 +4,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
6
|
};
|
7
|
-
import { createScope,
|
8
|
-
import {
|
7
|
+
import { createScope, cssvar, define } from "../root.js";
|
8
|
+
import { css, property } from "../deps.js";
|
9
|
+
import { htmlSlot } from "../lib/templates.js";
|
9
10
|
import EffectSTD from "./std.js";
|
10
11
|
const defineName = "clip-text";
|
11
12
|
const cssvarScope = createScope(defineName);
|
13
|
+
/**
|
14
|
+
* ClipText renders a gradient text.
|
15
|
+
*/
|
12
16
|
let ClipText = class ClipText extends EffectSTD {
|
13
17
|
constructor() {
|
14
18
|
super(...arguments);
|
19
|
+
/**
|
20
|
+
* The text to be clipped.
|
21
|
+
*/
|
15
22
|
this.text = "";
|
16
23
|
}
|
17
24
|
render() {
|
package/effect/clip-text.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"clip-text.js","sourceRoot":"","sources":["../../src/effect/clip-text.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,
|
1
|
+
{"version":3,"file":"clip-text.js","sourceRoot":"","sources":["../../src/effect/clip-text.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,GAAG,EAAuB,QAAQ,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAqB,MAAM,qBAAqB,CAAC;AAClE,OAAO,SAAS,MAAM,UAAU,CAAC;AAEjC,MAAM,UAAU,GAAG,WAAW,CAAC;AAC/B,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C;;GAEG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,SAAS;IAAhC;;QACL;;WAEG;QACS,SAAI,GAAG,EAAE,CAAC;IAoBxB,CAAC;IAHW,MAAM;QACd,OAAO,IAAI,CAAC,IAAI,IAAI,QAAQ,EAAE,CAAC;IACjC,CAAC;;AAjBM,eAAM,GAAG;IACd,SAAS,CAAC,MAAM;IAChB,GAAG,CAAA;;UAEG,WAAW,0BAA0B,MAAM;0BAC3B,WAAW;;;;;;;KAOhC;CACgB,AAbN,CAaO;AAfR;IAAX,QAAQ,EAAE;sCAAW;AAJX,QAAQ;IADpB,MAAM,CAAC,UAAU,CAAC;GACN,QAAQ,CAwBpB;;AAED,eAAe,QAAQ,CAAC"}
|
@@ -1,10 +1,19 @@
|
|
1
|
-
import { type CSSResultGroup
|
1
|
+
import { type CSSResultGroup } from "../deps.js";
|
2
2
|
import EffectSTD from "./std.js";
|
3
|
+
import { type HTMLTemplate } from "../lib/templates.js";
|
4
|
+
/**
|
5
|
+
* OverbreathText renders three animated pieces of text.
|
6
|
+
*
|
7
|
+
* Inspired by Vercel homepage (2022? - 2023).
|
8
|
+
*/
|
3
9
|
export declare class OverbreathText extends EffectSTD {
|
4
|
-
|
10
|
+
/**
|
11
|
+
* One of the texts.
|
12
|
+
*/
|
5
13
|
t1: string;
|
6
14
|
t2: string;
|
7
15
|
t3: string;
|
16
|
+
static styles: CSSResultGroup;
|
8
17
|
protected render(): HTMLTemplate[];
|
9
18
|
protected renderText(text: string): HTMLTemplate;
|
10
19
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"overbreath-text.d.ts","sourceRoot":"","sources":["../../src/effect/overbreath-text.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"overbreath-text.d.ts","sourceRoot":"","sources":["../../src/effect/overbreath-text.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,cAAc,EAAkB,MAAM,YAAY,CAAC;AACtE,OAAO,SAAS,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAKxD;;;;GAIG;AACH,qBACa,cAAe,SAAQ,SAAS;IAC3C;;OAEG;IACS,EAAE,SAAM;IAER,EAAE,SAAM;IAER,EAAE,SAAM;IAEpB,MAAM,CAAC,MAAM,iBAiLO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY,EAAE;IAIlC,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;CAMjD;AAED,eAAe,cAAc,CAAC;AAE9B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,cAAc,CAAC;KACnC;CACF"}
|
@@ -4,15 +4,26 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
6
|
};
|
7
|
-
import { createScope,
|
7
|
+
import { createScope, cssvar, define } from "../root.js";
|
8
|
+
import { css, html, property } from "../deps.js";
|
8
9
|
import EffectSTD from "./std.js";
|
9
10
|
const defineName = "overbreath-text";
|
10
11
|
const cssvarScope = createScope(defineName);
|
12
|
+
/**
|
13
|
+
* OverbreathText renders three animated pieces of text.
|
14
|
+
*
|
15
|
+
* Inspired by Vercel homepage (2022? - 2023).
|
16
|
+
*/
|
11
17
|
let OverbreathText = class OverbreathText extends EffectSTD {
|
12
18
|
constructor() {
|
13
19
|
super(...arguments);
|
20
|
+
/**
|
21
|
+
* One of the texts.
|
22
|
+
*/
|
14
23
|
this.t1 = "";
|
24
|
+
// As t1.
|
15
25
|
this.t2 = "";
|
26
|
+
// As t2.
|
16
27
|
this.t3 = "";
|
17
28
|
}
|
18
29
|
render() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"overbreath-text.js","sourceRoot":"","sources":["../../src/effect/overbreath-text.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,
|
1
|
+
{"version":3,"file":"overbreath-text.js","sourceRoot":"","sources":["../../src/effect/overbreath-text.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,SAAS,MAAM,UAAU,CAAC;AAGjC,MAAM,UAAU,GAAG,iBAAiB,CAAC;AACrC,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C;;;;GAIG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,SAAS;IAAtC;;QACL;;WAEG;QACS,OAAE,GAAG,EAAE,CAAC;QACpB,SAAS;QACG,OAAE,GAAG,EAAE,CAAC;QACpB,SAAS;QACG,OAAE,GAAG,EAAE,CAAC;IA+LtB,CAAC;IAVW,MAAM;QACd,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC1D,CAAC;IAES,UAAU,CAAC,IAAY;QAC/B,OAAO,IAAI,CAAA;yBACU,IAAI;yBACJ,IAAI;YACjB,CAAC;IACX,CAAC;;AA5LM,qBAAM,GAAG;IACd,SAAS,CAAC,MAAM;IAChB,GAAG,CAAA;;UAEG,WAAW;UACX,WAAW;UACX,WAAW;UACX,WAAW;UACX,WAAW;UACX,WAAW;UACX,WAAW;UACX,WAAW,4BAA4B,WAAW,eAAe,WAAW,eAAe,WAAW;UACtG,WAAW,4BAA4B,WAAW,eAAe,WAAW,eAAe,WAAW;UACtG,WAAW,4BAA4B,WAAW,eAAe,WAAW,eAAe,WAAW;;KAE3G;IACD,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA2CyB,WAAW;;;;;gCAKX,WAAW;;;;;gCAKX,WAAW;;;;;;;;;;;;;;KActC;IACD,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+EF;IACD,GAAG,CAAA;;UAEG,WAAW,0BAA0B,MAAM;0BAC3B,WAAW;;;;;;;;;KAShC;CACgB,AAjLN,CAiLO;AAvLR;IAAX,QAAQ,EAAE;0CAAS;AAER;IAAX,QAAQ,EAAE;0CAAS;AAER;IAAX,QAAQ,EAAE;0CAAS;AART,cAAc;IAD1B,MAAM,CAAC,UAAU,CAAC;GACN,cAAc,CAuM1B;;AAED,eAAe,cAAc,CAAC"}
|
package/effect/std.d.ts
CHANGED
package/effect/std.js
CHANGED
@@ -1,20 +1,52 @@
|
|
1
|
-
import { type
|
1
|
+
import { type PropertyValueMap } from "../deps.js";
|
2
|
+
import { type HTMLTemplate } from "../lib/templates.js";
|
2
3
|
import EffectSTD from "./std.js";
|
4
|
+
/**
|
5
|
+
* TypewriterText renders a typewriter effect to text.
|
6
|
+
*/
|
3
7
|
export declare class TypewriterText extends EffectSTD {
|
8
|
+
/**
|
9
|
+
* Raw text.
|
10
|
+
*/
|
4
11
|
text: string;
|
12
|
+
/**
|
13
|
+
* Start immediately after {@linkcode TypewriterText.firstUpdated}.
|
14
|
+
*/
|
5
15
|
stopped: boolean;
|
16
|
+
/**
|
17
|
+
* If true, hide the cursor
|
18
|
+
*/
|
6
19
|
ended: boolean;
|
20
|
+
/**
|
21
|
+
* Maximum random time.
|
22
|
+
*/
|
7
23
|
max: number;
|
24
|
+
/**
|
25
|
+
* Minimum random time.
|
26
|
+
*/
|
8
27
|
min: number;
|
28
|
+
/**
|
29
|
+
* Fixed time.
|
30
|
+
*/
|
9
31
|
delay: number;
|
32
|
+
/**
|
33
|
+
* The index at the beginning.
|
34
|
+
*/
|
10
35
|
index: number;
|
36
|
+
/**
|
37
|
+
* Internal text.
|
38
|
+
*/
|
11
39
|
content: string;
|
12
40
|
timeoutID: number;
|
13
41
|
_i: HTMLElement;
|
42
|
+
/**
|
43
|
+
* {@linkcode TypewriterText.text} length.
|
44
|
+
*/
|
14
45
|
get len(): number;
|
15
46
|
static styles: import("lit").CSSResult[];
|
16
47
|
protected render(): HTMLTemplate;
|
17
48
|
protected firstUpdated(): void;
|
49
|
+
protected updated(changedProperties: PropertyValueMap<this>): void;
|
18
50
|
write(at?: number): void;
|
19
51
|
stop(): void;
|
20
52
|
end(): void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"typewriter-text.d.ts","sourceRoot":"","sources":["../../src/effect/typewriter-text.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"typewriter-text.d.ts","sourceRoot":"","sources":["../../src/effect/typewriter-text.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,gBAAgB,EAAgB,MAAM,YAAY,CAAC;AACtF,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,SAAS,MAAM,UAAU,CAAC;AAMjC;;GAEG;AACH,qBACa,cAAe,SAAQ,SAAS;IAC3C;;OAEG;IACS,IAAI,SAAM;IACtB;;OAEG;IAC0B,OAAO,UAAS;IAC7C;;OAEG;IAC0B,KAAK,UAAS;IAC3C;;OAEG;IACyB,GAAG,SAAO;IACtC;;OAEG;IACyB,GAAG,SAAM;IACrC;;OAEG;IACyB,KAAK,SAAK;IACtC;;OAEG;IACyB,KAAK,SAAK;IACtC;;OAEG;IACM,OAAO,SAAM;IAEtB,SAAS,EAAE,MAAM,CAAC;IACN,EAAE,EAAE,WAAW,CAAC;IAE5B;;OAEG;IACH,IAAI,GAAG,WAEN;IAED,MAAM,CAAC,MAAM,4BA+BX;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;IAIhC,SAAS,CAAC,YAAY;IAStB,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAM3D,KAAK,CAAC,EAAE,SAAa;IAYrB,IAAI;IAIJ,GAAG;CAGJ;AAED,eAAe,cAAc,CAAC;AAE9B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,cAAc,CAAC;KACnC;CACF"}
|
@@ -4,23 +4,55 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
6
|
};
|
7
|
-
import { createScope,
|
8
|
-
import {
|
7
|
+
import { createScope, define } from "../root.js";
|
8
|
+
import { css, html, property, query, state } from "../deps.js";
|
9
|
+
import { htmlSlot } from "../lib/templates.js";
|
9
10
|
import EffectSTD from "./std.js";
|
11
|
+
import { random } from "../lib/utils.js";
|
10
12
|
const defineName = "typewriter-text";
|
11
13
|
const cssvarScope = createScope(defineName);
|
14
|
+
/**
|
15
|
+
* TypewriterText renders a typewriter effect to text.
|
16
|
+
*/
|
12
17
|
let TypewriterText = class TypewriterText extends EffectSTD {
|
13
18
|
constructor() {
|
14
19
|
super(...arguments);
|
20
|
+
/**
|
21
|
+
* Raw text.
|
22
|
+
*/
|
15
23
|
this.text = "";
|
24
|
+
/**
|
25
|
+
* Start immediately after {@linkcode TypewriterText.firstUpdated}.
|
26
|
+
*/
|
16
27
|
this.stopped = false;
|
28
|
+
/**
|
29
|
+
* If true, hide the cursor
|
30
|
+
*/
|
17
31
|
this.ended = false;
|
32
|
+
/**
|
33
|
+
* Maximum random time.
|
34
|
+
*/
|
18
35
|
this.max = 100;
|
36
|
+
/**
|
37
|
+
* Minimum random time.
|
38
|
+
*/
|
19
39
|
this.min = 50;
|
40
|
+
/**
|
41
|
+
* Fixed time.
|
42
|
+
*/
|
20
43
|
this.delay = 0;
|
44
|
+
/**
|
45
|
+
* The index at the beginning.
|
46
|
+
*/
|
21
47
|
this.index = 0;
|
48
|
+
/**
|
49
|
+
* Internal text.
|
50
|
+
*/
|
22
51
|
this.content = "";
|
23
52
|
}
|
53
|
+
/**
|
54
|
+
* {@linkcode TypewriterText.text} length.
|
55
|
+
*/
|
24
56
|
get len() {
|
25
57
|
return this.text.length;
|
26
58
|
}
|
@@ -35,6 +67,11 @@ let TypewriterText = class TypewriterText extends EffectSTD {
|
|
35
67
|
this.write();
|
36
68
|
}
|
37
69
|
}
|
70
|
+
updated(changedProperties) {
|
71
|
+
if (changedProperties.has("index")) {
|
72
|
+
this.dispatchEvent(new CustomEvent(this.index === this.len ? "done" : "write", { detail: this.content }));
|
73
|
+
}
|
74
|
+
}
|
38
75
|
write(at = this.index) {
|
39
76
|
this.content = this.text.slice(0, at + 1);
|
40
77
|
const timeout = this.delay || random(this.max, this.min);
|
@@ -116,8 +153,5 @@ TypewriterText = __decorate([
|
|
116
153
|
define(defineName)
|
117
154
|
], TypewriterText);
|
118
155
|
export { TypewriterText };
|
119
|
-
function random(m = 0, n = 1) {
|
120
|
-
return Math.random() * (n - m) + m;
|
121
|
-
}
|
122
156
|
export default TypewriterText;
|
123
157
|
//# sourceMappingURL=typewriter-text.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"typewriter-text.js","sourceRoot":"","sources":["../../src/effect/typewriter-text.ts"],"names":[],"mappings":";;;;;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G,IAAI,CAAC;IACpB,CAAC;;AAtEM,qBAAM,GAAG;IACd,GAAG,CAAA;;UAEG,WAAW;;;;;;4BAMO,WAAW;;;;;;;;;;;;;;;;;;;;;KAqBlC;CACF,AA/BY,CA+BX;AAvEU;IAAX,QAAQ,EAAE;4CAAW;AAIO;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CAAiB;AAIhB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAe;AAIf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAW;AAIV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAU;AAIT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAW;AAIV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAW;AAI7B;IAAR,KAAK,EAAE;+CAAc;AAGV;IAAX,KAAK,CAAC,GAAG,CAAC;0CAAiB;AAnCjB,cAAc;IAD1B,MAAM,CAAC,UAAU,CAAC;GACN,cAAc,CAmH1B;;AAED,eAAe,cAAc,CAAC"}
|
@@ -1,31 +1,13 @@
|
|
1
|
-
import { type
|
2
|
-
import { deepQuerySelector, deepQuerySelectorAll } from "./lib/utils.js";
|
3
|
-
import {
|
4
|
-
import
|
5
|
-
/**
|
6
|
-
* Define a custom element.
|
7
|
-
* @param name Name for the new custom element. Must be a valid custom element name.
|
8
|
-
* @param options Object that controls how the element is defined.
|
9
|
-
*/
|
10
|
-
export declare const define: (name: string, options?: ElementDefinitionOptions) => (constructor: CustomElementConstructor) => void;
|
11
|
-
/**
|
12
|
-
* Custom CSS variable prefix, join with "--".
|
13
|
-
*/
|
14
|
-
export declare const cssvar: CSSResult;
|
15
|
-
export declare function createScope(scope: LikeString): CSSResult;
|
16
|
-
export declare const cssvarValues: {
|
17
|
-
cssvar: CSSResult;
|
18
|
-
input: CSSResult;
|
19
|
-
main: CSSResult;
|
20
|
-
text: CSSResult;
|
21
|
-
mainRGB: CSSResult;
|
22
|
-
textRGB: CSSResult;
|
23
|
-
};
|
1
|
+
import { type AddOptions, type EventsNames, type ListenerFunc } from "./lib/event-collection.js";
|
2
|
+
import { deepQuerySelector, deepQuerySelectorAll, type LikeString } from "./lib/utils.js";
|
3
|
+
import type { ConfType } from "./conf";
|
4
|
+
import { LitElement } from "lit";
|
24
5
|
/**
|
25
6
|
* Global element.
|
26
7
|
*/
|
27
|
-
|
28
|
-
static
|
8
|
+
declare class GodownElement extends LitElement {
|
9
|
+
static conf?: ConfType;
|
10
|
+
static elementTagName?: string;
|
29
11
|
/**
|
30
12
|
* No named slot element's assignedElements, as HTMLElement[].
|
31
13
|
*/
|
@@ -50,6 +32,13 @@ export declare class GodownElement extends LitElement {
|
|
50
32
|
* Named slot elements' slot attribute.
|
51
33
|
*/
|
52
34
|
get slottedNames(): string[];
|
35
|
+
/**
|
36
|
+
* Query for a element with slot names
|
37
|
+
*
|
38
|
+
* @param slotName Slot name.
|
39
|
+
* @returns Slot element.
|
40
|
+
*/
|
41
|
+
querySlot(slotName: string): HTMLSlotElement | null;
|
53
42
|
/**
|
54
43
|
* Width of (`this.offsetParent` or `document.body`).
|
55
44
|
*/
|
@@ -66,7 +55,7 @@ export declare class GodownElement extends LitElement {
|
|
66
55
|
* this.addEvent(src, "type", listener)
|
67
56
|
* ```
|
68
57
|
*/
|
69
|
-
addEvent(src: any, type:
|
58
|
+
addEvent(src: any, type: EventsNames, listener: ListenerFunc, options?: AddOptions, alias?: PropertyKey): void;
|
70
59
|
/**
|
71
60
|
* ```
|
72
61
|
* src.removeEventListener("type", listener)
|
@@ -74,7 +63,7 @@ export declare class GodownElement extends LitElement {
|
|
74
63
|
* this.removeEvent(src, "type", listener)
|
75
64
|
* ```
|
76
65
|
*/
|
77
|
-
removeEvent(src: any, type:
|
66
|
+
removeEvent(src: any, type: EventsNames, alias: PropertyKey | ListenerFunc): void;
|
78
67
|
removeAllEvents(): void;
|
79
68
|
private __assign;
|
80
69
|
constructor(assign?: typeof GodownElement.prototype.__assign);
|
@@ -83,8 +72,8 @@ export declare class GodownElement extends LitElement {
|
|
83
72
|
mount(arg?: any): void;
|
84
73
|
unmount(): void;
|
85
74
|
remount(arg?: any): void;
|
86
|
-
deepQuerySelector<E extends Element = HTMLElement>(selectors: Parameters<typeof deepQuerySelector>[0],
|
87
|
-
deepQuerySelectorAll<E extends Element = HTMLElement>(selectors: Parameters<typeof deepQuerySelectorAll>[0],
|
75
|
+
deepQuerySelector<E extends Element = HTMLElement>(selectors: Parameters<typeof deepQuerySelector>[0], root?: Parameters<typeof deepQuerySelector>[1]): E;
|
76
|
+
deepQuerySelectorAll<E extends Element = HTMLElement>(selectors: Parameters<typeof deepQuerySelectorAll>[0], root?: Parameters<typeof deepQuerySelectorAll>[1]): E[];
|
88
77
|
/**
|
89
78
|
* Add styles to shadowRoot.
|
90
79
|
*
|
@@ -100,4 +89,5 @@ export declare class GodownElement extends LitElement {
|
|
100
89
|
*/
|
101
90
|
adoptStyles(...styles: LikeString[]): void;
|
102
91
|
}
|
103
|
-
|
92
|
+
export default GodownElement;
|
93
|
+
//# sourceMappingURL=godown-element.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"godown-element.d.ts","sourceRoot":"","sources":["../src/godown-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAoB,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACnH,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAY,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjC;;GAEG;AACH,cAAM,aAAc,SAAQ,UAAU;IACpC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,CAAC,CAAC,CAAC,EAAE,IAAI,GAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAQ,GAAG,CAAC;IAI/J,oBAAoB,CAAC,CAAC,SAAS,OAAO,GAAG,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,GAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAQ,GAAG,CAAC,EAAE;IAI1K;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE;CAKpC;AAED,eAAe,aAAa,CAAC"}
|
@@ -0,0 +1,140 @@
|
|
1
|
+
import { EventsCollection } from "./lib/event-collection.js";
|
2
|
+
import { deepQuerySelector, deepQuerySelectorAll, doAssign } from "./lib/utils.js";
|
3
|
+
import { LitElement } from "lit";
|
4
|
+
/**
|
5
|
+
* Global element.
|
6
|
+
*/
|
7
|
+
class GodownElement extends LitElement {
|
8
|
+
/**
|
9
|
+
* No named slot element's assignedElements, as HTMLElement[].
|
10
|
+
*/
|
11
|
+
get assigned() {
|
12
|
+
return this._slot?.assignedElements();
|
13
|
+
}
|
14
|
+
/**
|
15
|
+
* No named slot element's assignedElements, as Node[].
|
16
|
+
*/
|
17
|
+
get assignedNodes() {
|
18
|
+
return this._slot?.assignedNodes();
|
19
|
+
}
|
20
|
+
/**
|
21
|
+
* No named slot element.
|
22
|
+
*/
|
23
|
+
get _slot() {
|
24
|
+
return this.shadowRoot.querySelector("slot:not([name])");
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* Slot elements.
|
28
|
+
*/
|
29
|
+
get _slots() {
|
30
|
+
return [...this.shadowRoot.querySelectorAll("slot")];
|
31
|
+
}
|
32
|
+
/**
|
33
|
+
* Named slot elements.
|
34
|
+
*/
|
35
|
+
get slottedChildren() {
|
36
|
+
return [...this.querySelectorAll("[slot]")];
|
37
|
+
}
|
38
|
+
/**
|
39
|
+
* Named slot elements' slot attribute.
|
40
|
+
*/
|
41
|
+
get slottedNames() {
|
42
|
+
return this.slottedChildren.map((c) => c.getAttribute("slot")).filter((v) => v);
|
43
|
+
}
|
44
|
+
/**
|
45
|
+
* Query for a element with slot names
|
46
|
+
*
|
47
|
+
* @param slotName Slot name.
|
48
|
+
* @returns Slot element.
|
49
|
+
*/
|
50
|
+
querySlot(slotName) {
|
51
|
+
return this.querySelector(`[slot=${slotName}]`);
|
52
|
+
}
|
53
|
+
/**
|
54
|
+
* Width of (`this.offsetParent` or `document.body`).
|
55
|
+
*/
|
56
|
+
get offsetsWidth() {
|
57
|
+
return this.offsetParent?.clientWidth ?? document.body.offsetWidth;
|
58
|
+
}
|
59
|
+
/**
|
60
|
+
* Height of (`this.offsetParent` or `document.body`).
|
61
|
+
*/
|
62
|
+
get offsetsHeight() {
|
63
|
+
return this.offsetParent?.clientHeight ?? document.body.offsetHeight;
|
64
|
+
}
|
65
|
+
/**
|
66
|
+
* ```
|
67
|
+
* src.addEventListener("type", listener)
|
68
|
+
* //as
|
69
|
+
* this.addEvent(src, "type", listener)
|
70
|
+
* ```
|
71
|
+
*/
|
72
|
+
addEvent(src, type, listener, options, alias) {
|
73
|
+
this.__events.addEvent(src, type, listener, options, alias);
|
74
|
+
}
|
75
|
+
/**
|
76
|
+
* ```
|
77
|
+
* src.removeEventListener("type", listener)
|
78
|
+
* //as
|
79
|
+
* this.removeEvent(src, "type", listener)
|
80
|
+
* ```
|
81
|
+
*/
|
82
|
+
removeEvent(src, type, alias) {
|
83
|
+
this.__events.removeEvent(src, type, alias);
|
84
|
+
}
|
85
|
+
removeAllEvents() {
|
86
|
+
this.__events.removeAllEvents();
|
87
|
+
}
|
88
|
+
constructor(assign = GodownElement.conf?.assign) {
|
89
|
+
super();
|
90
|
+
this.__events = new EventsCollection();
|
91
|
+
this.__assign = assign;
|
92
|
+
}
|
93
|
+
connectedCallback() {
|
94
|
+
super.connectedCallback();
|
95
|
+
if (this.__assign) {
|
96
|
+
this.__assign.__assign = null;
|
97
|
+
doAssign(this.__assign, this);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
disconnectedCallback() {
|
101
|
+
this.removeAllEvents();
|
102
|
+
}
|
103
|
+
mount(arg) {
|
104
|
+
this.firstUpdated(arg);
|
105
|
+
}
|
106
|
+
unmount() {
|
107
|
+
this.disconnectedCallback();
|
108
|
+
}
|
109
|
+
remount(arg) {
|
110
|
+
this.unmount();
|
111
|
+
this.connectedCallback();
|
112
|
+
this.mount(arg);
|
113
|
+
}
|
114
|
+
deepQuerySelector(selectors, root = this) {
|
115
|
+
return deepQuerySelector(selectors, root);
|
116
|
+
}
|
117
|
+
deepQuerySelectorAll(selectors, root = this) {
|
118
|
+
return deepQuerySelectorAll(selectors, root);
|
119
|
+
}
|
120
|
+
/**
|
121
|
+
* Add styles to shadowRoot.
|
122
|
+
*
|
123
|
+
* @param styles css strings
|
124
|
+
*
|
125
|
+
* @example
|
126
|
+
* ```
|
127
|
+
* this.applyStyles(
|
128
|
+
* "...",
|
129
|
+
* css`...`,
|
130
|
+
* )
|
131
|
+
* ```
|
132
|
+
*/
|
133
|
+
adoptStyles(...styles) {
|
134
|
+
const sheet = new CSSStyleSheet();
|
135
|
+
styles.forEach((style) => sheet.insertRule(style.toString()));
|
136
|
+
this.shadowRoot.adoptedStyleSheets.push(sheet);
|
137
|
+
}
|
138
|
+
}
|
139
|
+
export default GodownElement;
|
140
|
+
//# sourceMappingURL=godown-element.js.map
|