godown 1.1.4 → 1.1.6
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 +35 -35
- package/conf.d.ts +18 -18
- package/conf.js +22 -22
- package/deps.d.ts +7 -7
- package/deps.js +7 -7
- package/effect/index.d.ts +3 -3
- package/effect/index.js +3 -3
- package/effect/ov-effect.d.ts +23 -23
- package/effect/ov-effect.d.ts.map +1 -1
- package/effect/ov-effect.js +299 -275
- package/effect/ro-effect.d.ts +19 -19
- package/effect/ro-effect.d.ts.map +1 -1
- package/effect/ro-effect.js +125 -120
- package/effect/std.d.ts +3 -3
- package/effect/std.d.ts.map +1 -1
- package/effect/std.js +3 -3
- package/effect/tw-effect.d.ts +21 -21
- package/effect/tw-effect.d.ts.map +1 -1
- package/effect/tw-effect.js +108 -107
- package/glob.d.ts +8 -8
- package/glob.d.ts.map +1 -1
- package/glob.js +25 -24
- package/group/avatar-group.d.ts +20 -20
- package/group/avatar-group.d.ts.map +1 -1
- package/group/avatar-group.js +112 -88
- package/group/button-group.d.ts +12 -12
- package/group/button-group.d.ts.map +1 -1
- package/group/button-group.js +79 -74
- package/group/details-group.d.ts +16 -16
- package/group/details-group.d.ts.map +1 -1
- package/group/details-group.js +55 -53
- package/group/index.d.ts +3 -3
- package/group/index.js +3 -3
- package/group/std.d.ts +3 -3
- package/group/std.d.ts.map +1 -1
- package/group/std.js +3 -3
- package/index.d.ts +7 -7
- package/index.js +7 -7
- package/input-form/base-input.d.ts +32 -32
- package/input-form/base-input.d.ts.map +1 -1
- package/input-form/base-input.js +229 -226
- package/input-form/exp-input.d.ts +22 -22
- package/input-form/exp-input.d.ts.map +1 -1
- package/input-form/exp-input.js +218 -205
- package/input-form/index.d.ts +8 -8
- package/input-form/index.js +8 -8
- package/input-form/label-input.d.ts +21 -21
- package/input-form/label-input.d.ts.map +1 -1
- package/input-form/label-input.js +150 -137
- package/input-form/search-input.d.ts +36 -36
- package/input-form/search-input.d.ts.map +1 -1
- package/input-form/search-input.js +311 -297
- package/input-form/select-input.d.ts +31 -31
- package/input-form/select-input.d.ts.map +1 -1
- package/input-form/select-input.js +354 -330
- package/input-form/sign-form.d.ts +25 -23
- package/input-form/sign-form.d.ts.map +1 -1
- package/input-form/sign-form.js +165 -160
- package/input-form/split-input.d.ts +26 -26
- package/input-form/split-input.d.ts.map +1 -1
- package/input-form/split-input.js +181 -173
- package/input-form/std.d.ts +19 -19
- package/input-form/std.d.ts.map +1 -1
- package/input-form/std.js +72 -68
- package/input-form/switch-input.d.ts +22 -22
- package/input-form/switch-input.d.ts.map +1 -1
- package/input-form/switch-input.js +181 -175
- package/items/alert-item.d.ts +16 -16
- package/items/alert-item.d.ts.map +1 -1
- package/items/alert-item.js +143 -142
- package/items/avatar-anchor.d.ts +19 -19
- package/items/avatar-anchor.d.ts.map +1 -1
- package/items/avatar-anchor.js +150 -148
- package/items/base-button.d.ts +16 -16
- package/items/base-button.d.ts.map +1 -1
- package/items/base-button.js +170 -167
- package/items/dialog-item.d.ts +24 -24
- package/items/dialog-item.d.ts.map +1 -1
- package/items/dialog-item.js +157 -156
- package/items/index.d.ts +7 -7
- package/items/index.js +7 -7
- package/items/link-a.d.ts +19 -19
- package/items/link-a.d.ts.map +1 -1
- package/items/link-a.js +98 -97
- package/items/load-track.d.ts +20 -20
- package/items/load-track.d.ts.map +1 -1
- package/items/load-track.js +115 -109
- package/items/std.d.ts +3 -3
- package/items/std.d.ts.map +1 -1
- package/items/std.js +3 -3
- package/items/super-a.d.ts +15 -15
- package/items/super-a.d.ts.map +1 -1
- package/items/super-a.js +99 -88
- package/layout/div-line.d.ts +15 -15
- package/layout/div-line.d.ts.map +1 -1
- package/layout/div-line.js +71 -65
- package/layout/drag-box.d.ts +25 -25
- package/layout/drag-box.d.ts.map +1 -1
- package/layout/drag-box.js +95 -94
- package/layout/flex-flow.d.ts +13 -13
- package/layout/flex-flow.d.ts.map +1 -1
- package/layout/flex-flow.js +39 -34
- package/layout/index.d.ts +5 -5
- package/layout/index.js +5 -5
- package/layout/nav-aside.d.ts +13 -13
- package/layout/nav-aside.d.ts.map +1 -1
- package/layout/nav-aside.js +61 -54
- package/layout/nav-layout.d.ts +16 -16
- package/layout/nav-layout.d.ts.map +1 -1
- package/layout/nav-layout.js +167 -146
- package/layout/std.d.ts +4 -4
- package/layout/std.d.ts.map +1 -1
- package/layout/std.js +10 -8
- package/package.json +48 -40
- package/react/effect.d.ts +9 -9
- package/react/effect.d.ts.map +1 -1
- package/react/effect.js +33 -33
- package/react/group.d.ts +4 -4
- package/react/group.d.ts.map +1 -1
- package/react/group.js +19 -19
- package/react/index.d.ts +7 -7
- package/react/index.d.ts.map +1 -1
- package/react/index.js +7 -7
- package/react/input-form.d.ts +32 -32
- package/react/input-form.d.ts.map +1 -1
- package/react/input-form.js +65 -65
- package/react/items.d.ts +8 -8
- package/react/items.d.ts.map +1 -1
- package/react/items.js +39 -39
- package/react/layout.d.ts +6 -6
- package/react/layout.d.ts.map +1 -1
- package/react/layout.js +29 -29
- package/react/view.d.ts +6 -6
- package/react/view.d.ts.map +1 -1
- package/react/view.js +29 -29
- package/view/details-expand.d.ts +18 -18
- package/view/details-expand.d.ts.map +1 -1
- package/view/details-expand.js +85 -80
- package/view/down-drop.d.ts +18 -18
- package/view/down-drop.d.ts.map +1 -1
- package/view/down-drop.js +98 -94
- package/view/index.d.ts +5 -5
- package/view/index.js +5 -5
- package/view/menu-list.d.ts +16 -16
- package/view/menu-list.d.ts.map +1 -1
- package/view/menu-list.js +77 -72
- package/view/route-view.d.ts +57 -57
- package/view/route-view.d.ts.map +1 -1
- package/view/route-view.js +261 -258
- package/view/scroll-x.d.ts +14 -14
- package/view/scroll-x.d.ts.map +1 -1
- package/view/scroll-x.js +77 -72
- package/view/std.d.ts +4 -4
- package/view/std.d.ts.map +1 -1
- package/view/std.js +37 -37
- package/with.d.ts +27 -27
- package/with.d.ts.map +1 -1
- package/with.js +77 -78
- package/view/react/effect.d.ts +0 -10
- package/view/react/effect.d.ts.map +0 -1
- package/view/react/effect.js +0 -32
- package/view/react/group.d.ts +0 -5
- package/view/react/group.d.ts.map +0 -1
- package/view/react/group.js +0 -18
- package/view/react/index.d.ts +0 -7
- package/view/react/index.d.ts.map +0 -1
- package/view/react/index.js +0 -6
- package/view/react/input-form.d.ts +0 -33
- package/view/react/input-form.d.ts.map +0 -1
- package/view/react/input-form.js +0 -64
- package/view/react/items.d.ts +0 -9
- package/view/react/items.d.ts.map +0 -1
- package/view/react/items.js +0 -38
- package/view/react/layout.d.ts +0 -7
- package/view/react/layout.d.ts.map +0 -1
- package/view/react/layout.js +0 -28
- package/view/react/view.d.ts +0 -7
- package/view/react/view.d.ts.map +0 -1
- package/view/react/view.js +0 -28
package/view/scroll-x.js
CHANGED
@@ -1,72 +1,77 @@
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
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
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
-
};
|
7
|
-
import { css, define, html } from "../deps.js";
|
8
|
-
import STD from "./std.js";
|
9
|
-
let ScrollX = class ScrollX extends STD {
|
10
|
-
get _section() {
|
11
|
-
return this.shadowRoot.querySelector("section");
|
12
|
-
}
|
13
|
-
render() {
|
14
|
-
return html `<section
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
this.
|
23
|
-
});
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
this.style.height =
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
+
};
|
7
|
+
import { css, define, html } from "../deps.js";
|
8
|
+
import STD from "./std.js";
|
9
|
+
let ScrollX = class ScrollX extends STD {
|
10
|
+
get _section() {
|
11
|
+
return this.shadowRoot.querySelector("section");
|
12
|
+
}
|
13
|
+
render() {
|
14
|
+
return html `<section>
|
15
|
+
<main>
|
16
|
+
<span><slot></slot></span>
|
17
|
+
</main>
|
18
|
+
</section>`;
|
19
|
+
}
|
20
|
+
firstUpdated() {
|
21
|
+
this._section.addEventListener("scroll", (e) => {
|
22
|
+
this.dispatchEvent(new CustomEvent("scroll", { detail: e.target.scrollTop }));
|
23
|
+
});
|
24
|
+
this.resize();
|
25
|
+
window.addEventListener("resize", () => {
|
26
|
+
this.resize();
|
27
|
+
});
|
28
|
+
}
|
29
|
+
resize() {
|
30
|
+
const child = this.firstElementChild;
|
31
|
+
if (!child)
|
32
|
+
return;
|
33
|
+
const ClientHeight = child.clientHeight || 0;
|
34
|
+
if (ClientHeight) {
|
35
|
+
this._section.style.width = ClientHeight + "px";
|
36
|
+
this._section.style.height = getComputedStyle(this).width;
|
37
|
+
}
|
38
|
+
else {
|
39
|
+
const ComputedHeight = getComputedStyle(child).height;
|
40
|
+
this.style.height = ComputedHeight;
|
41
|
+
this._section.style.width = ComputedHeight;
|
42
|
+
this._section.style.height = getComputedStyle(this).width;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
};
|
46
|
+
ScrollX.styles = css `
|
47
|
+
:host {
|
48
|
+
display: block;
|
49
|
+
width: 100%;
|
50
|
+
height: fit-content;
|
51
|
+
}
|
52
|
+
section {
|
53
|
+
overflow: auto;
|
54
|
+
position: relative;
|
55
|
+
transform-origin: 0 0;
|
56
|
+
transform: rotate(-90deg) translateX(-100%);
|
57
|
+
}
|
58
|
+
section::-webkit-scrollbar {
|
59
|
+
display: none;
|
60
|
+
}
|
61
|
+
span {
|
62
|
+
height: 500px;
|
63
|
+
display: flex;
|
64
|
+
}
|
65
|
+
main {
|
66
|
+
width: auto;
|
67
|
+
position: absolute;
|
68
|
+
left: 100%;
|
69
|
+
transform-origin: 0 0;
|
70
|
+
transform: rotate(90deg);
|
71
|
+
}
|
72
|
+
`;
|
73
|
+
ScrollX = __decorate([
|
74
|
+
define("scroll-x")
|
75
|
+
], ScrollX);
|
76
|
+
export { ScrollX };
|
77
|
+
export default ScrollX;
|
package/view/std.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { GLOBSTD } from "../deps.js";
|
2
|
-
export default class ViewSTD extends GLOBSTD {
|
3
|
-
}
|
4
|
-
export declare const DLsharecss: import("lit").CSSResult;
|
1
|
+
import { GLOBSTD } from "../deps.js";
|
2
|
+
export default class ViewSTD extends GLOBSTD {
|
3
|
+
}
|
4
|
+
export declare const DLsharecss: import("lit").CSSResult;
|
5
5
|
//# sourceMappingURL=std.d.ts.map
|
package/view/std.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"std.d.ts","sourceRoot":"","sources":["../../src/view/std.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAO,MAAM,YAAY,CAAC;AAC1C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;
|
1
|
+
{"version":3,"file":"std.d.ts","sourceRoot":"","sources":["../../src/view/std.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAO,MAAM,YAAY,CAAC;AAC1C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;CAAG;AAC/C,eAAO,MAAM,UAAU,yBAiCtB,CAAC"}
|
package/view/std.js
CHANGED
@@ -1,37 +1,37 @@
|
|
1
|
-
import { GLOBSTD, css } from "../deps.js";
|
2
|
-
export default class ViewSTD extends GLOBSTD {
|
3
|
-
}
|
4
|
-
export const DLsharecss = css `
|
5
|
-
:host{
|
6
|
-
|
7
|
-
|
8
|
-
}
|
9
|
-
span{
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
}
|
15
|
-
dt{
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
}
|
22
|
-
*{
|
23
|
-
|
24
|
-
}
|
25
|
-
dd{
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
}
|
30
|
-
section{
|
31
|
-
|
32
|
-
|
33
|
-
}
|
34
|
-
dd[open]{
|
35
|
-
|
36
|
-
}
|
37
|
-
`;
|
1
|
+
import { GLOBSTD, css } from "../deps.js";
|
2
|
+
export default class ViewSTD extends GLOBSTD {
|
3
|
+
}
|
4
|
+
export const DLsharecss = css `
|
5
|
+
:host {
|
6
|
+
display: block;
|
7
|
+
transition: all 0.3s ease-in-out;
|
8
|
+
}
|
9
|
+
span {
|
10
|
+
display: inline-flex;
|
11
|
+
align-items: center;
|
12
|
+
flex: 1;
|
13
|
+
white-space: nowrap;
|
14
|
+
}
|
15
|
+
dt {
|
16
|
+
display: flex;
|
17
|
+
flex-wrap: nowrap;
|
18
|
+
justify-content: space-between;
|
19
|
+
background: inherit;
|
20
|
+
align-items: center;
|
21
|
+
}
|
22
|
+
* {
|
23
|
+
transition: inherit;
|
24
|
+
}
|
25
|
+
dd {
|
26
|
+
overflow: hidden;
|
27
|
+
display: grid;
|
28
|
+
grid-template-rows: 0fr;
|
29
|
+
}
|
30
|
+
section {
|
31
|
+
min-height: 0;
|
32
|
+
overflow: hidden;
|
33
|
+
}
|
34
|
+
dd[open] {
|
35
|
+
grid-template-rows: 1fr;
|
36
|
+
}
|
37
|
+
`;
|
package/with.d.ts
CHANGED
@@ -1,28 +1,28 @@
|
|
1
|
-
export declare const define: (name: string, options?: ElementDefinitionOptions) => (constructor: CustomElementConstructor) => void;
|
2
|
-
/**
|
3
|
-
* Create element with args append to target
|
4
|
-
* @param target Appended target element or use document.querySelector(target) or document.body
|
5
|
-
* @param args tag:tag name, props:attribute, children:appended chindren, html:innerHTML
|
6
|
-
*/
|
7
|
-
export declare const append: (target?: string | object, args?: string | {
|
8
|
-
tag: any;
|
9
|
-
props?: any;
|
10
|
-
children?: any;
|
11
|
-
html?: any;
|
12
|
-
}) => void;
|
13
|
-
/**
|
14
|
-
* Create element from args
|
15
|
-
* @param args tag:tag name, props:attribute, children:appended chindren, html:innerHTML
|
16
|
-
*/
|
17
|
-
export declare const create: (args?: string | {
|
18
|
-
tag: any;
|
19
|
-
props?: any;
|
20
|
-
children?: any;
|
21
|
-
html?: any;
|
22
|
-
}) => any;
|
23
|
-
/**
|
24
|
-
* Create element with args append to target
|
25
|
-
* @param map Map of key:selector, value:args
|
26
|
-
*/
|
27
|
-
export declare const retag: (map: any) => void;
|
1
|
+
export declare const define: (name: string, options?: ElementDefinitionOptions) => (constructor: CustomElementConstructor) => void;
|
2
|
+
/**
|
3
|
+
* Create element with args append to target
|
4
|
+
* @param target Appended target element or use document.querySelector(target) or document.body
|
5
|
+
* @param args tag:tag name, props:attribute, children:appended chindren, html:innerHTML
|
6
|
+
*/
|
7
|
+
export declare const append: (target?: string | object, args?: string | {
|
8
|
+
tag: any;
|
9
|
+
props?: any;
|
10
|
+
children?: any;
|
11
|
+
html?: any;
|
12
|
+
}) => void;
|
13
|
+
/**
|
14
|
+
* Create element from args
|
15
|
+
* @param args tag:tag name, props:attribute, children:appended chindren, html:innerHTML
|
16
|
+
*/
|
17
|
+
export declare const create: (args?: string | {
|
18
|
+
tag: any;
|
19
|
+
props?: any;
|
20
|
+
children?: any;
|
21
|
+
html?: any;
|
22
|
+
}) => any;
|
23
|
+
/**
|
24
|
+
* Create element with args append to target
|
25
|
+
* @param map Map of key:selector, value:args
|
26
|
+
*/
|
27
|
+
export declare const retag: (map: any) => void;
|
28
28
|
//# sourceMappingURL=with.d.ts.map
|
package/with.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"with.d.ts","sourceRoot":"","sources":["../src/with.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,MAAM,SAAU,MAAM,YAAY,wBAAwB,mBAAmB,wBAAwB,SAOjH,CAAC;AACF;;;;
|
1
|
+
{"version":3,"file":"with.d.ts","sourceRoot":"","sources":["../src/with.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,MAAM,SAAU,MAAM,YAAY,wBAAwB,mBAAmB,wBAAwB,SAOjH,CAAC;AACF;;;;GAIG;AACH,eAAO,MAAM,MAAM,YAAY,MAAM,GAAG,MAAM,SAAiB,MAAM,GAAG;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAA;CAAE,SAK5H,CAAC;AACF;;;GAGG;AACH,eAAO,MAAM,MAAM,UAAU,MAAM,GAAG;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAA;CAAE,QAqB1F,CAAC;AACF;;;GAGG;AACH,eAAO,MAAM,KAAK,oBAqBjB,CAAC"}
|
package/with.js
CHANGED
@@ -1,78 +1,77 @@
|
|
1
|
-
import { conf } from "./conf.js";
|
2
|
-
export const define = (name, options) => (constructor) => {
|
3
|
-
var _a, _b;
|
4
|
-
const tagname = conf === null || conf === void 0 ? void 0 : conf.tag(name);
|
5
|
-
if (customElements.get(tagname) === undefined) {
|
6
|
-
customElements.define(tagname, constructor, options);
|
7
|
-
(_a = conf === null || conf === void 0 ? void 0 : conf.enabled) === null || _a === void 0 ? void 0 : _a.push(name);
|
8
|
-
(_b = conf === null || conf === void 0 ? void 0 : conf.namemap) === null || _b === void 0 ? void 0 : _b.set(name, tagname);
|
9
|
-
}
|
10
|
-
};
|
11
|
-
/**
|
12
|
-
* Create element with args append to target
|
13
|
-
* @param target Appended target element or use document.querySelector(target) or document.body
|
14
|
-
* @param args tag:tag name, props:attribute, children:appended chindren, html:innerHTML
|
15
|
-
*/
|
16
|
-
export const append = (target = "body", args = "div") => {
|
17
|
-
if (!args)
|
18
|
-
return;
|
19
|
-
target = (typeof target === "string" ? document.querySelector(target) : target) || document.body;
|
20
|
-
const element = create(args);
|
21
|
-
target.appendChild(element);
|
22
|
-
};
|
23
|
-
/**
|
24
|
-
* Create element from args
|
25
|
-
* @param args tag:tag name, props:attribute, children:appended chindren, html:innerHTML
|
26
|
-
*/
|
27
|
-
export const create = (args = "div") => {
|
28
|
-
const tag = (typeof args === "string" ? args : args === null || args === void 0 ? void 0 : args.tag) || "div";
|
29
|
-
const { props, children, html } = args || {};
|
30
|
-
const element = document.createElement(tag);
|
31
|
-
if (props) {
|
32
|
-
Object.keys(props).forEach((prop) => {
|
33
|
-
// element[prop] = props[prop];
|
34
|
-
element.setAttribute(prop, props[prop] === true ? "" : props[prop]);
|
35
|
-
});
|
36
|
-
}
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
*
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
const
|
62
|
-
const
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
acc
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
};
|
1
|
+
import { conf } from "./conf.js";
|
2
|
+
export const define = (name, options) => (constructor) => {
|
3
|
+
var _a, _b;
|
4
|
+
const tagname = conf === null || conf === void 0 ? void 0 : conf.tag(name);
|
5
|
+
if (customElements.get(tagname) === undefined) {
|
6
|
+
customElements.define(tagname, constructor, options);
|
7
|
+
(_a = conf === null || conf === void 0 ? void 0 : conf.enabled) === null || _a === void 0 ? void 0 : _a.push(name);
|
8
|
+
(_b = conf === null || conf === void 0 ? void 0 : conf.namemap) === null || _b === void 0 ? void 0 : _b.set(name, tagname);
|
9
|
+
}
|
10
|
+
};
|
11
|
+
/**
|
12
|
+
* Create element with args append to target
|
13
|
+
* @param target Appended target element or use document.querySelector(target) or document.body
|
14
|
+
* @param args tag:tag name, props:attribute, children:appended chindren, html:innerHTML
|
15
|
+
*/
|
16
|
+
export const append = (target = "body", args = "div") => {
|
17
|
+
if (!args)
|
18
|
+
return;
|
19
|
+
target = (typeof target === "string" ? document.querySelector(target) : target) || document.body;
|
20
|
+
const element = create(args);
|
21
|
+
target.appendChild(element);
|
22
|
+
};
|
23
|
+
/**
|
24
|
+
* Create element from args
|
25
|
+
* @param args tag:tag name, props:attribute, children:appended chindren, html:innerHTML
|
26
|
+
*/
|
27
|
+
export const create = (args = "div") => {
|
28
|
+
const tag = (typeof args === "string" ? args : args === null || args === void 0 ? void 0 : args.tag) || "div";
|
29
|
+
const { props, children, html } = args || {};
|
30
|
+
const element = document.createElement(tag);
|
31
|
+
if (props) {
|
32
|
+
Object.keys(props).forEach((prop) => {
|
33
|
+
// element[prop] = props[prop];
|
34
|
+
element.setAttribute(prop, props[prop] === true ? "" : props[prop]);
|
35
|
+
});
|
36
|
+
}
|
37
|
+
if (html)
|
38
|
+
element.innerHTML += html;
|
39
|
+
if (children) {
|
40
|
+
if (children.length) {
|
41
|
+
/* Iterators exist */ [...children].forEach((child) => {
|
42
|
+
typeof child === "string" ? element.appendChild(document.createTextNode(child)) : element.appendChild(child);
|
43
|
+
});
|
44
|
+
}
|
45
|
+
else {
|
46
|
+
typeof children === "string" ? element.appendChild(document.createTextNode(children)) : element.appendChild(children);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
return element;
|
50
|
+
};
|
51
|
+
/**
|
52
|
+
* Create element with args append to target
|
53
|
+
* @param map Map of key:selector, value:args
|
54
|
+
*/
|
55
|
+
export const retag = (map) => {
|
56
|
+
if (!map)
|
57
|
+
return;
|
58
|
+
for (const [key, args] of map) {
|
59
|
+
for (let i = document.querySelectorAll(key).length - 1; i >= 0; i--) {
|
60
|
+
const element = document.querySelectorAll(key)[i];
|
61
|
+
const tag = (typeof args === "string" ? args : args === null || args === void 0 ? void 0 : args.tag) || "div";
|
62
|
+
const props = args.props || {};
|
63
|
+
const { children, html = "" } = args;
|
64
|
+
[...element.attributes].reduce((acc, attr) => {
|
65
|
+
acc[attr.name] = attr.args;
|
66
|
+
return acc;
|
67
|
+
}, props);
|
68
|
+
const newElement = create({
|
69
|
+
tag,
|
70
|
+
html: html + element.innerHTML,
|
71
|
+
props,
|
72
|
+
children,
|
73
|
+
});
|
74
|
+
element.parentNode.replaceChild(newElement, element);
|
75
|
+
}
|
76
|
+
}
|
77
|
+
};
|
package/view/react/effect.d.ts
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
import * as X from "../../effect/index.js";
|
2
|
-
export declare const OVText: import("@lit-labs/react").ReactWebComponent<X.OVText, {}>;
|
3
|
-
export declare const OVPort: import("@lit-labs/react").ReactWebComponent<X.OVPort, {}>;
|
4
|
-
export declare const OVButton: import("@lit-labs/react").ReactWebComponent<X.OVButton, {}>;
|
5
|
-
export declare const ROPort: import("@lit-labs/react").ReactWebComponent<X.ROPort, {}>;
|
6
|
-
export declare const TWText: import("@lit-labs/react").ReactWebComponent<X.TWText, {
|
7
|
-
onChange: string;
|
8
|
-
onDone: string;
|
9
|
-
}>;
|
10
|
-
//# sourceMappingURL=effect.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"effect.d.ts","sourceRoot":"","sources":["../../../src/view/react/effect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,uBAAuB,CAAC;AAE3C,eAAO,MAAM,MAAM,2DAIjB,CAAC;AACH,eAAO,MAAM,MAAM,2DAIjB,CAAC;AACH,eAAO,MAAM,QAAQ,6DAInB,CAAC;AACH,eAAO,MAAM,MAAM,2DAIjB,CAAC;AACH,eAAO,MAAM,MAAM;;;EAQjB,CAAC"}
|
package/view/react/effect.js
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
import * as React from "react";
|
2
|
-
import * as X from "../../effect/index.js";
|
3
|
-
import { createComponent } from "@lit-labs/react";
|
4
|
-
export const OVText = createComponent({
|
5
|
-
tagName: "ov-text",
|
6
|
-
elementClass: X.OVText,
|
7
|
-
react: React
|
8
|
-
});
|
9
|
-
export const OVPort = createComponent({
|
10
|
-
tagName: "ov-port",
|
11
|
-
elementClass: X.OVPort,
|
12
|
-
react: React
|
13
|
-
});
|
14
|
-
export const OVButton = createComponent({
|
15
|
-
tagName: "ov-button",
|
16
|
-
elementClass: X.OVButton,
|
17
|
-
react: React
|
18
|
-
});
|
19
|
-
export const ROPort = createComponent({
|
20
|
-
tagName: "ro-port",
|
21
|
-
elementClass: X.ROPort,
|
22
|
-
react: React
|
23
|
-
});
|
24
|
-
export const TWText = createComponent({
|
25
|
-
tagName: "tw-text",
|
26
|
-
elementClass: X.TWText,
|
27
|
-
react: React,
|
28
|
-
events: {
|
29
|
-
onChange: "change",
|
30
|
-
onDone: "done"
|
31
|
-
}
|
32
|
-
});
|
package/view/react/group.d.ts
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
import * as X from "../../group/index.js";
|
2
|
-
export declare const AvatarGroup: import("@lit-labs/react").ReactWebComponent<X.AvatarGroup, {}>;
|
3
|
-
export declare const ButtonGroup: import("@lit-labs/react").ReactWebComponent<X.ButtonGroup, {}>;
|
4
|
-
export declare const DetailsGroup: import("@lit-labs/react").ReactWebComponent<X.DetailsGroup, {}>;
|
5
|
-
//# sourceMappingURL=group.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../../src/view/react/group.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,sBAAsB,CAAC;AAE1C,eAAO,MAAM,WAAW,gEAItB,CAAC;AACH,eAAO,MAAM,WAAW,gEAItB,CAAC;AACH,eAAO,MAAM,YAAY,iEAIvB,CAAC"}
|
package/view/react/group.js
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
import * as React from "react";
|
2
|
-
import * as X from "../../group/index.js";
|
3
|
-
import { createComponent } from "@lit-labs/react";
|
4
|
-
export const AvatarGroup = createComponent({
|
5
|
-
tagName: "avatar-group",
|
6
|
-
elementClass: X.AvatarGroup,
|
7
|
-
react: React
|
8
|
-
});
|
9
|
-
export const ButtonGroup = createComponent({
|
10
|
-
tagName: "button-group",
|
11
|
-
elementClass: X.ButtonGroup,
|
12
|
-
react: React
|
13
|
-
});
|
14
|
-
export const DetailsGroup = createComponent({
|
15
|
-
tagName: "details-group",
|
16
|
-
elementClass: X.DetailsGroup,
|
17
|
-
react: React
|
18
|
-
});
|
package/view/react/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/view/react/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
package/view/react/index.js
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
import * as X from "../../input-form/index.js";
|
2
|
-
export declare const BaseForm: import("@lit-labs/react").ReactWebComponent<X.BaseForm, {}>;
|
3
|
-
export declare const BaseInput: import("@lit-labs/react").ReactWebComponent<X.BaseInput, {
|
4
|
-
onInput: string;
|
5
|
-
onChange: string;
|
6
|
-
}>;
|
7
|
-
export declare const ExpInput: import("@lit-labs/react").ReactWebComponent<X.ExpInput, {
|
8
|
-
onInput: string;
|
9
|
-
onChange: string;
|
10
|
-
}>;
|
11
|
-
export declare const LabelInput: import("@lit-labs/react").ReactWebComponent<X.LabelInput, {
|
12
|
-
onInput: string;
|
13
|
-
onChange: string;
|
14
|
-
}>;
|
15
|
-
export declare const SearchInput: import("@lit-labs/react").ReactWebComponent<X.SearchInput, {
|
16
|
-
onInput: string;
|
17
|
-
onChange: string;
|
18
|
-
}>;
|
19
|
-
export declare const SearchW: import("@lit-labs/react").ReactWebComponent<X.SearchW, {}>;
|
20
|
-
export declare const SelectInput: import("@lit-labs/react").ReactWebComponent<X.SelectInput, {
|
21
|
-
onInput: string;
|
22
|
-
onChange: string;
|
23
|
-
}>;
|
24
|
-
export declare const SignForm: import("@lit-labs/react").ReactWebComponent<X.SignForm, {}>;
|
25
|
-
export declare const SplitInput: import("@lit-labs/react").ReactWebComponent<X.SplitInput, {
|
26
|
-
onInput: string;
|
27
|
-
onChange: string;
|
28
|
-
}>;
|
29
|
-
export declare const SwitchInput: import("@lit-labs/react").ReactWebComponent<X.SwitchInput, {
|
30
|
-
onInput: string;
|
31
|
-
onChange: string;
|
32
|
-
}>;
|
33
|
-
//# sourceMappingURL=input-form.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"input-form.d.ts","sourceRoot":"","sources":["../../../src/view/react/input-form.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,2BAA2B,CAAC;AAM/C,eAAO,MAAM,QAAQ,6DAInB,CAAC;AACH,eAAO,MAAM,SAAS;;;EAKpB,CAAC;AACH,eAAO,MAAM,QAAQ;;;EAKnB,CAAC;AACH,eAAO,MAAM,UAAU;;;EAKrB,CAAC;AACH,eAAO,MAAM,WAAW;;;EAKtB,CAAC;AACH,eAAO,MAAM,OAAO,4DAIlB,CAAC;AACH,eAAO,MAAM,WAAW;;;EAKtB,CAAC;AACH,eAAO,MAAM,QAAQ,6DAInB,CAAC;AACH,eAAO,MAAM,UAAU;;;EAKrB,CAAC;AACH,eAAO,MAAM,WAAW;;;EAKtB,CAAC"}
|