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.
Files changed (179) hide show
  1. package/README.md +35 -35
  2. package/conf.d.ts +18 -18
  3. package/conf.js +22 -22
  4. package/deps.d.ts +7 -7
  5. package/deps.js +7 -7
  6. package/effect/index.d.ts +3 -3
  7. package/effect/index.js +3 -3
  8. package/effect/ov-effect.d.ts +23 -23
  9. package/effect/ov-effect.d.ts.map +1 -1
  10. package/effect/ov-effect.js +299 -275
  11. package/effect/ro-effect.d.ts +19 -19
  12. package/effect/ro-effect.d.ts.map +1 -1
  13. package/effect/ro-effect.js +125 -120
  14. package/effect/std.d.ts +3 -3
  15. package/effect/std.d.ts.map +1 -1
  16. package/effect/std.js +3 -3
  17. package/effect/tw-effect.d.ts +21 -21
  18. package/effect/tw-effect.d.ts.map +1 -1
  19. package/effect/tw-effect.js +108 -107
  20. package/glob.d.ts +8 -8
  21. package/glob.d.ts.map +1 -1
  22. package/glob.js +25 -24
  23. package/group/avatar-group.d.ts +20 -20
  24. package/group/avatar-group.d.ts.map +1 -1
  25. package/group/avatar-group.js +112 -88
  26. package/group/button-group.d.ts +12 -12
  27. package/group/button-group.d.ts.map +1 -1
  28. package/group/button-group.js +79 -74
  29. package/group/details-group.d.ts +16 -16
  30. package/group/details-group.d.ts.map +1 -1
  31. package/group/details-group.js +55 -53
  32. package/group/index.d.ts +3 -3
  33. package/group/index.js +3 -3
  34. package/group/std.d.ts +3 -3
  35. package/group/std.d.ts.map +1 -1
  36. package/group/std.js +3 -3
  37. package/index.d.ts +7 -7
  38. package/index.js +7 -7
  39. package/input-form/base-input.d.ts +32 -32
  40. package/input-form/base-input.d.ts.map +1 -1
  41. package/input-form/base-input.js +229 -226
  42. package/input-form/exp-input.d.ts +22 -22
  43. package/input-form/exp-input.d.ts.map +1 -1
  44. package/input-form/exp-input.js +218 -205
  45. package/input-form/index.d.ts +8 -8
  46. package/input-form/index.js +8 -8
  47. package/input-form/label-input.d.ts +21 -21
  48. package/input-form/label-input.d.ts.map +1 -1
  49. package/input-form/label-input.js +150 -137
  50. package/input-form/search-input.d.ts +36 -36
  51. package/input-form/search-input.d.ts.map +1 -1
  52. package/input-form/search-input.js +311 -297
  53. package/input-form/select-input.d.ts +31 -31
  54. package/input-form/select-input.d.ts.map +1 -1
  55. package/input-form/select-input.js +354 -330
  56. package/input-form/sign-form.d.ts +25 -23
  57. package/input-form/sign-form.d.ts.map +1 -1
  58. package/input-form/sign-form.js +165 -160
  59. package/input-form/split-input.d.ts +26 -26
  60. package/input-form/split-input.d.ts.map +1 -1
  61. package/input-form/split-input.js +181 -173
  62. package/input-form/std.d.ts +19 -19
  63. package/input-form/std.d.ts.map +1 -1
  64. package/input-form/std.js +72 -68
  65. package/input-form/switch-input.d.ts +22 -22
  66. package/input-form/switch-input.d.ts.map +1 -1
  67. package/input-form/switch-input.js +181 -175
  68. package/items/alert-item.d.ts +16 -16
  69. package/items/alert-item.d.ts.map +1 -1
  70. package/items/alert-item.js +143 -142
  71. package/items/avatar-anchor.d.ts +19 -19
  72. package/items/avatar-anchor.d.ts.map +1 -1
  73. package/items/avatar-anchor.js +150 -148
  74. package/items/base-button.d.ts +16 -16
  75. package/items/base-button.d.ts.map +1 -1
  76. package/items/base-button.js +170 -167
  77. package/items/dialog-item.d.ts +24 -24
  78. package/items/dialog-item.d.ts.map +1 -1
  79. package/items/dialog-item.js +157 -156
  80. package/items/index.d.ts +7 -7
  81. package/items/index.js +7 -7
  82. package/items/link-a.d.ts +19 -19
  83. package/items/link-a.d.ts.map +1 -1
  84. package/items/link-a.js +98 -97
  85. package/items/load-track.d.ts +20 -20
  86. package/items/load-track.d.ts.map +1 -1
  87. package/items/load-track.js +115 -109
  88. package/items/std.d.ts +3 -3
  89. package/items/std.d.ts.map +1 -1
  90. package/items/std.js +3 -3
  91. package/items/super-a.d.ts +15 -15
  92. package/items/super-a.d.ts.map +1 -1
  93. package/items/super-a.js +99 -88
  94. package/layout/div-line.d.ts +15 -15
  95. package/layout/div-line.d.ts.map +1 -1
  96. package/layout/div-line.js +71 -65
  97. package/layout/drag-box.d.ts +25 -25
  98. package/layout/drag-box.d.ts.map +1 -1
  99. package/layout/drag-box.js +95 -94
  100. package/layout/flex-flow.d.ts +13 -13
  101. package/layout/flex-flow.d.ts.map +1 -1
  102. package/layout/flex-flow.js +39 -34
  103. package/layout/index.d.ts +5 -5
  104. package/layout/index.js +5 -5
  105. package/layout/nav-aside.d.ts +13 -13
  106. package/layout/nav-aside.d.ts.map +1 -1
  107. package/layout/nav-aside.js +61 -54
  108. package/layout/nav-layout.d.ts +16 -16
  109. package/layout/nav-layout.d.ts.map +1 -1
  110. package/layout/nav-layout.js +167 -146
  111. package/layout/std.d.ts +4 -4
  112. package/layout/std.d.ts.map +1 -1
  113. package/layout/std.js +10 -8
  114. package/package.json +48 -40
  115. package/react/effect.d.ts +9 -9
  116. package/react/effect.d.ts.map +1 -1
  117. package/react/effect.js +33 -33
  118. package/react/group.d.ts +4 -4
  119. package/react/group.d.ts.map +1 -1
  120. package/react/group.js +19 -19
  121. package/react/index.d.ts +7 -7
  122. package/react/index.d.ts.map +1 -1
  123. package/react/index.js +7 -7
  124. package/react/input-form.d.ts +32 -32
  125. package/react/input-form.d.ts.map +1 -1
  126. package/react/input-form.js +65 -65
  127. package/react/items.d.ts +8 -8
  128. package/react/items.d.ts.map +1 -1
  129. package/react/items.js +39 -39
  130. package/react/layout.d.ts +6 -6
  131. package/react/layout.d.ts.map +1 -1
  132. package/react/layout.js +29 -29
  133. package/react/view.d.ts +6 -6
  134. package/react/view.d.ts.map +1 -1
  135. package/react/view.js +29 -29
  136. package/view/details-expand.d.ts +18 -18
  137. package/view/details-expand.d.ts.map +1 -1
  138. package/view/details-expand.js +85 -80
  139. package/view/down-drop.d.ts +18 -18
  140. package/view/down-drop.d.ts.map +1 -1
  141. package/view/down-drop.js +98 -94
  142. package/view/index.d.ts +5 -5
  143. package/view/index.js +5 -5
  144. package/view/menu-list.d.ts +16 -16
  145. package/view/menu-list.d.ts.map +1 -1
  146. package/view/menu-list.js +77 -72
  147. package/view/route-view.d.ts +57 -57
  148. package/view/route-view.d.ts.map +1 -1
  149. package/view/route-view.js +261 -258
  150. package/view/scroll-x.d.ts +14 -14
  151. package/view/scroll-x.d.ts.map +1 -1
  152. package/view/scroll-x.js +77 -72
  153. package/view/std.d.ts +4 -4
  154. package/view/std.d.ts.map +1 -1
  155. package/view/std.js +37 -37
  156. package/with.d.ts +27 -27
  157. package/with.d.ts.map +1 -1
  158. package/with.js +77 -78
  159. package/view/react/effect.d.ts +0 -10
  160. package/view/react/effect.d.ts.map +0 -1
  161. package/view/react/effect.js +0 -32
  162. package/view/react/group.d.ts +0 -5
  163. package/view/react/group.d.ts.map +0 -1
  164. package/view/react/group.js +0 -18
  165. package/view/react/index.d.ts +0 -7
  166. package/view/react/index.d.ts.map +0 -1
  167. package/view/react/index.js +0 -6
  168. package/view/react/input-form.d.ts +0 -33
  169. package/view/react/input-form.d.ts.map +0 -1
  170. package/view/react/input-form.js +0 -64
  171. package/view/react/items.d.ts +0 -9
  172. package/view/react/items.d.ts.map +0 -1
  173. package/view/react/items.js +0 -38
  174. package/view/react/layout.d.ts +0 -7
  175. package/view/react/layout.d.ts.map +0 -1
  176. package/view/react/layout.js +0 -28
  177. package/view/react/view.d.ts +0 -7
  178. package/view/react/view.d.ts.map +0 -1
  179. 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><main><span><slot></slot></span></main></section>`;
15
- }
16
- firstUpdated() {
17
- this._section.addEventListener("scroll", (e) => {
18
- this.dispatchEvent(new CustomEvent("scroll", { detail: e.target.scrollTop }));
19
- });
20
- this.resize();
21
- window.addEventListener("resize", () => {
22
- this.resize();
23
- });
24
- }
25
- resize() {
26
- const child = this.firstElementChild;
27
- if (!child)
28
- return;
29
- const ClientHeight = child.clientHeight || 0;
30
- if (ClientHeight) {
31
- this._section.style.width = ClientHeight + "px";
32
- this._section.style.height = getComputedStyle(this).width;
33
- }
34
- else {
35
- const ComputedHeight = getComputedStyle(child).height;
36
- this.style.height = ComputedHeight;
37
- this._section.style.width = ComputedHeight;
38
- this._section.style.height = getComputedStyle(this).width;
39
- }
40
- }
41
- };
42
- ScrollX.styles = css `
43
- :host{
44
- display: block;
45
- width: 100%;
46
- height: fit-content;
47
- }
48
- section {
49
- overflow: auto;
50
- position: relative;
51
- transform-origin: 0 0;
52
- transform: rotate(-90deg) translateX(-100%);
53
- }
54
- section::-webkit-scrollbar {
55
- display: none;
56
- }
57
- span {
58
- height: 500px;
59
- display: flex;
60
- }
61
- main {
62
- width: auto;
63
- position: absolute;
64
- left: 100%;
65
- transform-origin: 0 0;
66
- transform: rotate(90deg);
67
- }`;
68
- ScrollX = __decorate([
69
- define("scroll-x")
70
- ], ScrollX);
71
- export { ScrollX };
72
- export default ScrollX;
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;CAAI;AAChD,eAAO,MAAM,UAAU,yBAiCtB,CAAC"}
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
- display: block;
7
- transition: all .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
- `;
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;;;;EAIE;AACF,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,CAAC;CAAE,SAK7H,CAAC;AACF;;;EAGE;AACF,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,CAAC;CAAE,QAqB3F,CAAC;AACF;;;EAGE;AACF,eAAO,MAAM,KAAK,oBAuBjB,CAAC"}
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
- if (html)
39
- element.innerHTML += html;
40
- if (children) {
41
- if (children.length) /* Iterators exist */ {
42
- [...children].forEach((child) => {
43
- typeof child === "string" ? element.appendChild(document.createTextNode(child)) : element.appendChild(child);
44
- });
45
- }
46
- else {
47
- typeof children === "string" ? element.appendChild(document.createTextNode(children)) : element.appendChild(children);
48
- }
49
- }
50
- return element;
51
- };
52
- /**
53
- * Create element with args append to target
54
- * @param map Map of key:selector, value:args
55
- */
56
- export const retag = (map) => {
57
- if (!map)
58
- return;
59
- for (let [key, args] of map) {
60
- for (let i = document.querySelectorAll(key).length - 1; i >= 0; i--) {
61
- const element = document.querySelectorAll(key)[i];
62
- const tag = (typeof args === "string" ? args : args === null || args === void 0 ? void 0 : args.tag) || "div";
63
- let props = args.props || {};
64
- const { children, html = "" } = args;
65
- [...element.attributes].reduce((acc, attr) => {
66
- acc[attr.name] = attr.args;
67
- return acc;
68
- }, props);
69
- const newElement = create({
70
- tag,
71
- html: html + element.innerHTML,
72
- props,
73
- children,
74
- });
75
- element.parentNode.replaceChild(newElement, element);
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
+ };
@@ -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"}
@@ -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
- });
@@ -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"}
@@ -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
- });
@@ -1,7 +0,0 @@
1
- export * from "./effect.js";
2
- export * from "./group.js";
3
- export * from "./input-form.js";
4
- export * from "./items.js";
5
- export * from "./layout.js";
6
- export * from "./view.js";
7
- //# sourceMappingURL=index.d.ts.map
@@ -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"}
@@ -1,6 +0,0 @@
1
- export * from "./effect.js";
2
- export * from "./group.js";
3
- export * from "./input-form.js";
4
- export * from "./items.js";
5
- export * from "./layout.js";
6
- export * from "./view.js";
@@ -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"}