godown 2.6.0 → 2.6.1

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 (109) hide show
  1. package/lib/event-collection.d.ts +1 -1
  2. package/package.json +4 -4
  3. package/react/index.d.ts +0 -1
  4. package/react/index.d.ts.map +1 -1
  5. package/react/index.js +0 -3
  6. package/react/index.js.map +1 -1
  7. package/web-components/a/avatar-a.js +40 -40
  8. package/web-components/a/avatar-a.js.map +1 -1
  9. package/web-components/a/super-a.js +22 -22
  10. package/web-components/a/super-a.js.map +1 -1
  11. package/web-components/button/base-button.js +86 -86
  12. package/web-components/button/base-button.js.map +1 -1
  13. package/web-components/carousel/carousel-slider.d.ts +1 -1
  14. package/web-components/carousel/carousel-slider.d.ts.map +1 -1
  15. package/web-components/carousel/carousel-slider.js +70 -70
  16. package/web-components/carousel/carousel-slider.js.map +1 -1
  17. package/web-components/form/base-form.js +15 -15
  18. package/web-components/form/base-form.js.map +1 -1
  19. package/web-components/group/avatar-group.js +13 -13
  20. package/web-components/group/avatar-group.js.map +1 -1
  21. package/web-components/group/details-group.js +7 -7
  22. package/web-components/group/details-group.js.map +1 -1
  23. package/web-components/group/tab-group.js +45 -45
  24. package/web-components/group/tab-group.js.map +1 -1
  25. package/web-components/index.d.ts +0 -1
  26. package/web-components/index.d.ts.map +1 -1
  27. package/web-components/index.js +0 -1
  28. package/web-components/index.js.map +1 -1
  29. package/web-components/input/base-input.js +73 -73
  30. package/web-components/input/base-input.js.map +1 -1
  31. package/web-components/input/input.js +15 -15
  32. package/web-components/input/input.js.map +1 -1
  33. package/web-components/input/label-input.js +49 -49
  34. package/web-components/input/label-input.js.map +1 -1
  35. package/web-components/input/search-input.js +53 -53
  36. package/web-components/input/search-input.js.map +1 -1
  37. package/web-components/input/select-input.js +88 -88
  38. package/web-components/input/select-input.js.map +1 -1
  39. package/web-components/input/split-input.js +51 -51
  40. package/web-components/input/split-input.js.map +1 -1
  41. package/web-components/input/switch-input.js +36 -36
  42. package/web-components/input/switch-input.js.map +1 -1
  43. package/web-components/items/alert-item.js +32 -33
  44. package/web-components/items/alert-item.js.map +1 -1
  45. package/web-components/items/card-item.js +54 -54
  46. package/web-components/items/card-item.js.map +1 -1
  47. package/web-components/items/drag-box.js +8 -8
  48. package/web-components/items/drag-box.js.map +1 -1
  49. package/web-components/items/time-bar.js +8 -9
  50. package/web-components/items/time-bar.js.map +1 -1
  51. package/web-components/layout/divider-line.js +11 -11
  52. package/web-components/layout/divider-line.js.map +1 -1
  53. package/web-components/layout/flex-flow.js +7 -7
  54. package/web-components/layout/flex-flow.js.map +1 -1
  55. package/web-components/layout/nav-aside.js +14 -14
  56. package/web-components/layout/nav-aside.js.map +1 -1
  57. package/web-components/layout/nav-layout.js +26 -26
  58. package/web-components/layout/nav-layout.js.map +1 -1
  59. package/web-components/loading/loading-progress.d.ts +1 -1
  60. package/web-components/loading/loading-progress.d.ts.map +1 -1
  61. package/web-components/loading/loading-progress.js +28 -28
  62. package/web-components/loading/loading-progress.js.map +1 -1
  63. package/web-components/loading/skeleton-screen.js +19 -19
  64. package/web-components/loading/skeleton-screen.js.map +1 -1
  65. package/web-components/open/open-details.d.ts.map +1 -1
  66. package/web-components/open/open-details.js +73 -22
  67. package/web-components/open/open-details.js.map +1 -1
  68. package/web-components/open/open-dialog.d.ts +5 -16
  69. package/web-components/open/open-dialog.d.ts.map +1 -1
  70. package/web-components/open/open-dialog.js +92 -102
  71. package/web-components/open/open-dialog.js.map +1 -1
  72. package/web-components/open/open-offset.d.ts +0 -1
  73. package/web-components/open/open-offset.d.ts.map +1 -1
  74. package/web-components/open/open-offset.js +50 -53
  75. package/web-components/open/open-offset.js.map +1 -1
  76. package/web-components/open/open-tooltip.d.ts +2 -2
  77. package/web-components/open/open-tooltip.d.ts.map +1 -1
  78. package/web-components/open/open-tooltip.js +14 -15
  79. package/web-components/open/open-tooltip.js.map +1 -1
  80. package/web-components/open/open.d.ts +3 -2
  81. package/web-components/open/open.d.ts.map +1 -1
  82. package/web-components/open/open.js +13 -59
  83. package/web-components/open/open.js.map +1 -1
  84. package/web-components/text/clip-text.js +8 -8
  85. package/web-components/text/clip-text.js.map +1 -1
  86. package/web-components/text/overbreath-text.js +17 -17
  87. package/web-components/text/overbreath-text.js.map +1 -1
  88. package/web-components/text/typewriter-text.js +32 -32
  89. package/web-components/text/typewriter-text.js.map +1 -1
  90. package/web-components/view/route-view.d.ts +2 -2
  91. package/web-components/view/route-view.js +7 -7
  92. package/web-components/view/route-view.js.map +1 -1
  93. package/web-components/view/scroll-x.js +29 -29
  94. package/web-components/view/scroll-x.js.map +1 -1
  95. package/web-components/view/wrap-view.d.ts +1 -1
  96. package/web-components/view/wrap-view.js +15 -15
  97. package/web-components/view/wrap-view.js.map +1 -1
  98. package/open-list.d.ts +0 -2
  99. package/open-list.d.ts.map +0 -1
  100. package/open-list.js +0 -2
  101. package/open-list.js.map +0 -1
  102. package/web-components/layout/index.d.ts +0 -5
  103. package/web-components/layout/index.d.ts.map +0 -1
  104. package/web-components/layout/index.js +0 -6
  105. package/web-components/layout/index.js.map +0 -1
  106. package/web-components/open/open-list.d.ts +0 -20
  107. package/web-components/open/open-list.d.ts.map +0 -1
  108. package/web-components/open/open-list.js +0 -71
  109. package/web-components/open/open-list.js.map +0 -1
@@ -50,38 +50,6 @@ let TypewriterText = class TypewriterText extends GodownElement {
50
50
  get len() {
51
51
  return this.text.length;
52
52
  }
53
- static { this.styles = [
54
- css `
55
- :host {
56
- ${cssvarScope}--cursor-width: .05em;
57
- font-family: monospace;
58
- white-space: nowrap;
59
- }
60
-
61
- i {
62
- border-right: var(${cssvarScope}--cursor-width) solid;
63
- margin-left: 0.02em;
64
- animation: s 1.5s steps(1) infinite;
65
- }
66
-
67
- @keyframes s {
68
- 0% {
69
- border-color: currentColor;
70
- }
71
- 50% {
72
- border-color: transparent;
73
- }
74
- }
75
-
76
- slot {
77
- display: none;
78
- }
79
-
80
- .hidden {
81
- visibility: hidden;
82
- }
83
- `,
84
- ]; }
85
53
  render() {
86
54
  return html `${htmlSlot()}${this.content}<i class="${(this.ended && "hidden") || ""}"></i>`;
87
55
  }
@@ -116,6 +84,38 @@ let TypewriterText = class TypewriterText extends GodownElement {
116
84
  this.ended = true;
117
85
  }
118
86
  };
87
+ TypewriterText.styles = [
88
+ css `
89
+ :host {
90
+ ${cssvarScope}--cursor-width: .05em;
91
+ font-family: monospace;
92
+ white-space: nowrap;
93
+ }
94
+
95
+ i {
96
+ border-right: var(${cssvarScope}--cursor-width) solid;
97
+ margin-left: 0.02em;
98
+ animation: s 1.5s steps(1) infinite;
99
+ }
100
+
101
+ @keyframes s {
102
+ 0% {
103
+ border-color: currentColor;
104
+ }
105
+ 50% {
106
+ border-color: transparent;
107
+ }
108
+ }
109
+
110
+ slot {
111
+ display: none;
112
+ }
113
+
114
+ .hidden {
115
+ visibility: hidden;
116
+ }
117
+ `,
118
+ ];
119
119
  __decorate([
120
120
  property()
121
121
  ], TypewriterText.prototype, "text", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"typewriter-text.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/text/typewriter-text.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAyB,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnE,MAAM,UAAU,GAAG,iBAAiB,CAAC;AACrC,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C;;GAEG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,aAAa;IAA1C;;QACL;;WAEG;QACS,SAAI,GAAG,EAAE,CAAC;QACtB;;WAE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AAC;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","sourcesContent":["import { css, html, property, type PropertyValueMap, query, state } from \"../../deps.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { random } from \"../../lib/utils.js\";\nimport { createScope, define, GodownElement } from \"../../root.js\";\n\nconst defineName = \"typewriter-text\";\nconst cssvarScope = createScope(defineName);\n\n/**\n * TypewriterText renders a typewriter effect to text.\n */\n@define(defineName)\nexport class TypewriterText extends GodownElement {\n /**\n * Raw text.\n */\n @property() text = \"\";\n /**\n * Start immediately after {@linkcode TypewriterText.firstUpdated}.\n */\n @property({ type: Boolean }) stopped = false;\n /**\n * If true, hide the cursor\n */\n @property({ type: Boolean }) ended = false;\n /**\n * Maximum random time.\n */\n @property({ type: Number }) max = 100;\n /**\n * Minimum random time.\n */\n @property({ type: Number }) min = 50;\n /**\n * Fixed time.\n */\n @property({ type: Number }) delay = 0;\n /**\n * The index at the beginning.\n */\n @property({ type: Number }) index = 0;\n /**\n * Internal text.\n */\n @state() content = \"\";\n\n timeoutID: number;\n @query(\"i\") _i: HTMLElement;\n\n /**\n * {@linkcode TypewriterText.text} length.\n */\n get len() {\n return this.text.length;\n }\n\n static styles = [\n css`\n :host {\n ${cssvarScope}--cursor-width: .05em;\n font-family: monospace;\n white-space: nowrap;\n }\n\n i {\n border-right: var(${cssvarScope}--cursor-width) solid;\n margin-left: 0.02em;\n animation: s 1.5s steps(1) infinite;\n }\n\n @keyframes s {\n 0% {\n border-color: currentColor;\n }\n 50% {\n border-color: transparent;\n }\n }\n\n slot {\n display: none;\n }\n\n .hidden {\n visibility: hidden;\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n return html`${htmlSlot()}${this.content}<i class=\"${(this.ended && \"hidden\") || \"\"}\"></i>`;\n }\n\n protected firstUpdated() {\n if (!this.text) {\n this.text = this.assignedNodes[0]?.textContent.trim() || \"\";\n }\n if (!this.stopped && this.len) {\n this.write();\n }\n }\n\n protected updated(changedProperties: PropertyValueMap<this>) {\n if (changedProperties.has(\"index\")) {\n this.dispatchEvent(new CustomEvent(this.index === this.len ? \"done\" : \"write\", { detail: this.content }));\n }\n }\n\n write(at = this.index) {\n this.content = this.text.slice(0, at + 1);\n const timeout = this.delay || random(this.max, this.min);\n this.timeoutID = setTimeout(() => {\n const nx = at + 1;\n if (nx <= this.len) {\n this.index = nx;\n this.write();\n }\n }, timeout);\n }\n\n stop() {\n clearTimeout(this.timeoutID);\n }\n\n end() {\n this.ended = true;\n }\n}\n\nexport default TypewriterText;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"typewriter-text\": TypewriterText;\n }\n}\n"]}
1
+ {"version":3,"file":"typewriter-text.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/text/typewriter-text.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAyB,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnE,MAAM,UAAU,GAAG,iBAAiB,CAAC;AACrC,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C;;GAEG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,aAAa;IAA1C;;QACL;;WAEG;QACS,SAAI,GAAG,EAAE,CAAC;QACtB;;WAEG;QAC0B,YAAO,GAAG,KAAK,CAAC;QAC7C;;WAEG;QAC0B,UAAK,GAAG,KAAK,CAAC;QAC3C;;WAEG;QAC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jB,cAAc;IAD1B,MAAM,CAAC,UAAU,CAAC;GACN,cAAc,CAmH1B;;AAED,eAAe,cAAc,CAAC","sourcesContent":["import { css, html, property, type PropertyValueMap, query, state } from \"../../deps.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { random } from \"../../lib/utils.js\";\nimport { createScope, define, GodownElement } from \"../../root.js\";\n\nconst defineName = \"typewriter-text\";\nconst cssvarScope = createScope(defineName);\n\n/**\n * TypewriterText renders a typewriter effect to text.\n */\n@define(defineName)\nexport class TypewriterText extends GodownElement {\n /**\n * Raw text.\n */\n @property() text = \"\";\n /**\n * Start immediately after {@linkcode TypewriterText.firstUpdated}.\n */\n @property({ type: Boolean }) stopped = false;\n /**\n * If true, hide the cursor\n */\n @property({ type: Boolean }) ended = false;\n /**\n * Maximum random time.\n */\n @property({ type: Number }) max = 100;\n /**\n * Minimum random time.\n */\n @property({ type: Number }) min = 50;\n /**\n * Fixed time.\n */\n @property({ type: Number }) delay = 0;\n /**\n * The index at the beginning.\n */\n @property({ type: Number }) index = 0;\n /**\n * Internal text.\n */\n @state() content = \"\";\n\n timeoutID: number;\n @query(\"i\") _i: HTMLElement;\n\n /**\n * {@linkcode TypewriterText.text} length.\n */\n get len() {\n return this.text.length;\n }\n\n static styles = [\n css`\n :host {\n ${cssvarScope}--cursor-width: .05em;\n font-family: monospace;\n white-space: nowrap;\n }\n\n i {\n border-right: var(${cssvarScope}--cursor-width) solid;\n margin-left: 0.02em;\n animation: s 1.5s steps(1) infinite;\n }\n\n @keyframes s {\n 0% {\n border-color: currentColor;\n }\n 50% {\n border-color: transparent;\n }\n }\n\n slot {\n display: none;\n }\n\n .hidden {\n visibility: hidden;\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n return html`${htmlSlot()}${this.content}<i class=\"${(this.ended && \"hidden\") || \"\"}\"></i>`;\n }\n\n protected firstUpdated() {\n if (!this.text) {\n this.text = this.assignedNodes[0]?.textContent.trim() || \"\";\n }\n if (!this.stopped && this.len) {\n this.write();\n }\n }\n\n protected updated(changedProperties: PropertyValueMap<this>) {\n if (changedProperties.has(\"index\")) {\n this.dispatchEvent(new CustomEvent(this.index === this.len ? \"done\" : \"write\", { detail: this.content }));\n }\n }\n\n write(at = this.index) {\n this.content = this.text.slice(0, at + 1);\n const timeout = this.delay || random(this.max, this.min);\n this.timeoutID = setTimeout(() => {\n const nx = at + 1;\n if (nx <= this.len) {\n this.index = nx;\n this.write();\n }\n }, timeout);\n }\n\n stop() {\n clearTimeout(this.timeoutID);\n }\n\n end() {\n this.ended = true;\n }\n}\n\nexport default TypewriterText;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"typewriter-text\": TypewriterText;\n }\n}\n"]}
@@ -51,7 +51,7 @@ export declare class RouteView<T = unknown> extends GodownElement {
51
51
  pathname: string;
52
52
  params: Record<string, string>;
53
53
  path: string;
54
- component: T | import("lit").TemplateResult<1>;
54
+ component: import("lit").TemplateResult<1> | T;
55
55
  }>;
56
56
  set routes(v: (Record<string, any> & Record<"path", string> & {
57
57
  component?: T;
@@ -66,7 +66,7 @@ export declare class RouteView<T = unknown> extends GodownElement {
66
66
  pathname: string;
67
67
  params: Record<string, string>;
68
68
  path: string;
69
- component: T | import("lit").TemplateResult<1>;
69
+ component: import("lit").TemplateResult<1> | T;
70
70
  };
71
71
  connectedCallback(): void;
72
72
  /**
@@ -76,13 +76,6 @@ let RouteView = class RouteView extends GodownElement {
76
76
  get routes() {
77
77
  return this._routes;
78
78
  }
79
- static { this.styles = [
80
- css `
81
- :host {
82
- display: contents;
83
- }
84
- `,
85
- ]; }
86
79
  reset() {
87
80
  this._routeTree = new RouteTree();
88
81
  this.record.clear();
@@ -213,6 +206,13 @@ let RouteView = class RouteView extends GodownElement {
213
206
  });
214
207
  }
215
208
  };
209
+ RouteView.styles = [
210
+ css `
211
+ :host {
212
+ display: contents;
213
+ }
214
+ `,
215
+ ];
216
216
  __decorate([
217
217
  state()
218
218
  ], RouteView.prototype, "component", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"route-view.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/view/route-view.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAyB,KAAK,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI9C,MAAM,UAAU,GAAG,YAAY,CAAC;AAEhC;;GAEG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAuB,SAAQ,aAAa;IAAlD;;QACG,YAAO,GAA+C,EAAE,CAAC;QACzD,eAAU,GAAc,IAAI,SAAS,EAAE,CAAC;QAEhD;;WAEG;QACM,cAAS,GAAqB,IAAI,CAAC;QAC5C;;WAEG;QACM,WAAM,GAA2B,EAAE,CAAC;QAC7C;;WAEG;QACM,SAAI,GAAW,IAAI,CAAC;QAC7B;;WAEG;QACS,aAAQ,GAAG,EAAE,CAAC;QAC1B;;WAEG;QACS,YAAO,GAAG,EAAE,CAAC;QACzB;;WAEG;QACM,QAAG,GAAG,QAAQ,EAAE,CAAC;QAC1B;;WAEG;QACS,SAAI,GAA6C,QAAQ,CAAC;QACtE;;WAEG;QACM,aAAQ,GAAG,IAAI,CAAC;QACzB;;WAEG;QAC0B,UAAK,GAAG,KAAK,CAAC;QAE3C;;WAEG;QACH,WAAM,GAAG,IAAI,GAAG,EAA6C,CAAC;QAsF9D;;;;WAIG;QACH,wBAAmB,GAAoE,IAAI,CAAC;IAgF9F,CAAC;IAzKC,IAAI,MAAM,CAAC,CAAC;QACV,IAAI,MAAM,CA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property, type PropertyValueMap, state } from \"../../deps.js\";\nimport RouteTree from \"../../lib/route-tree.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { deepQuerySelectorAll } from \"../../lib/utils.js\";\nimport { define } from \"../../root.js\";\nimport { GodownElement } from \"../../root.js\";\n\ntype WithRecord<T extends string> = Record<string, any> & Record<T, string>;\n\nconst defineName = \"route-view\";\n\n/**\n * RouteView has basic routing control.\n */\n@define(defineName)\nexport class RouteView<T = unknown> extends GodownElement {\n private _routes: (WithRecord<\"path\"> & { component?: T })[] = [];\n private _routeTree: RouteTree = new RouteTree();\n\n /**\n * Component will render.\n */\n @state() component: T | HTMLTemplate = null;\n /**\n * Dynamic parameters record.\n */\n @state() params: Record<string, string> = {};\n /**\n * Value of matched path in routes, or null.\n */\n @state() path: string = null;\n /**\n * Current pathname (location.pathname).\n */\n @property() pathname = \"\";\n /**\n * Path prefix.\n */\n @property() baseURL = \"\";\n /**\n * Rendered content when there is no match.\n */\n @state() def = htmlSlot();\n /**\n * The type of routing query.\n */\n @property() type: \"united\" | \"child\" | \"slotted\" | \"field\" = \"united\";\n /**\n * Rewrite history.\n */\n @state() override = true;\n /**\n * Cache accessed.\n */\n @property({ type: Boolean }) cache = false;\n\n /**\n * Cache record.\n */\n record = new Map<string, ReturnType<typeof this.useRouter>>();\n\n set routes(v) {\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\n return;\n }\n this._routes = v;\n this.reset();\n for (const route of v) {\n this._routeTree.insert(route.path);\n }\n this.requestUpdate();\n }\n\n get routes() {\n return this._routes;\n }\n\n static styles = [\n css`\n :host {\n display: contents;\n }\n `,\n ];\n\n reset() {\n this._routeTree = new RouteTree();\n this.record.clear();\n }\n\n protected render(): T | HTMLTemplate {\n if (this.cache) {\n const cached = this.record.get(this.pathname);\n if (cached) {\n Object.assign(this, cached);\n return this.component;\n }\n }\n this.params = {};\n switch (this.type) {\n case \"field\":\n this.component = this.fieldComponent();\n break;\n case \"child\":\n case \"slotted\":\n this.component = this.slottedComponent();\n break;\n case \"united\":\n this.component = this.fieldComponent() ?? this.slottedComponent();\n break;\n }\n return this.component ?? this.def;\n }\n\n useRouter() {\n return {\n pathname: this.pathname,\n params: this.params,\n path: this.path,\n component: this.component,\n };\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.pathname = window.location.pathname;\n if (!this.override) {\n return;\n }\n this.addEvent(window, \"popstate\", () => {\n this.pathname = window.location.pathname;\n });\n const self = this;\n const pushHistory = history.pushState;\n history.pushState = function () {\n pushHistory.apply(this, arguments);\n self.pathname = window.location.pathname;\n };\n const replaceHistory = history.replaceState;\n history.replaceState = function () {\n replaceHistory.apply(this, arguments);\n self.pathname = window.location.pathname;\n };\n }\n\n /**\n *\n * @param ur value of useRouter()\n * @param first whether this path is loaded for the first time\n */\n routeChangeCallback: (ur: ReturnType<typeof this.useRouter>, first: boolean) => void = null;\n\n protected updated(changedProperties: PropertyValueMap<this>) {\n const shouldDispatch = changedProperties.has(\"pathname\") || changedProperties.has(\"path\");\n if (shouldDispatch) {\n const ur = this.useRouter();\n const noRecord = !this.record.has(this.pathname);\n if (noRecord) {\n this.record.set(this.pathname, ur);\n }\n this.routeChangeCallback?.(ur, noRecord);\n this.dispatchEvent(new CustomEvent(\"change\", { detail: ur }));\n }\n }\n\n fieldComponent(usedRouteTemplate?: string): null | T {\n if (!usedRouteTemplate) {\n usedRouteTemplate = this.useWhichRoute(this.pathname);\n }\n this.path = usedRouteTemplate;\n if (!usedRouteTemplate) {\n return null;\n }\n this.params = this.parseRouterParams(this.path, this.pathname);\n const route = this.routes.find((r) => r.path === usedRouteTemplate);\n if (!route) {\n return null;\n }\n return route.component;\n }\n\n slottedComponent(usedRouteTemplate?: string): null | HTMLTemplate {\n const childNodes = this.querySelectorAll(\":scope > *[slot]\");\n if (!childNodes.length) {\n return null;\n }\n const slottedPaths = Array.from(childNodes).map((node) => {\n const slotname = node.getAttribute(\"slot\");\n return {\n path: slotname,\n };\n });\n const tempRouteTree = new RouteTree();\n for (const withPath of slottedPaths) {\n tempRouteTree.insert(withPath.path);\n }\n if (!usedRouteTemplate) {\n usedRouteTemplate = this.useWhichRoute(this.pathname, undefined, tempRouteTree);\n if (!usedRouteTemplate) {\n return null;\n }\n }\n const slotElement = slottedPaths.find((s) => s.path === usedRouteTemplate);\n if (!slotElement) {\n return null;\n }\n this.params = this.parseRouterParams(usedRouteTemplate, this.pathname);\n return htmlSlot(slotElement.path);\n }\n\n useWhichRoute(path: string, baseURL = this.baseURL, appl: RouteTree = this._routeTree): string | null {\n return appl.useWhich(baseURL + path);\n }\n\n parseRouterParams(routeTemplate: string, originpath: string, appl: RouteTree = this._routeTree): Record<string, string> {\n return appl.parseParams(originpath, routeTemplate);\n }\n\n static updateAll() {\n const routeViewTagName = conf.nameMap.get(\"route-view\");\n if (!routeViewTagName) {\n return;\n }\n const routeViewArray = deepQuerySelectorAll<RouteView>(routeViewTagName, document.body);\n routeViewArray.forEach((ArrayItem) => {\n if (!ArrayItem.override) {\n ArrayItem.pathname = window.location.pathname;\n }\n });\n }\n}\n\nexport default RouteView;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"route-view\": RouteView;\n }\n}\n"]}
1
+ {"version":3,"file":"route-view.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/view/route-view.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAyB,KAAK,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI9C,MAAM,UAAU,GAAG,YAAY,C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AC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YACnC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;gBACxB,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAChD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AAxJM,gBAAM,GAAG;IACd,GAAG,CAAA;;;;KAIF;CACF,AANY,CAMX;AA7DO;IAAR,KAAK,EAAE;4CAAoC;AAInC;IAAR,KAAK,EAAE;yCAAqC;AAIpC;IAAR,KAAK,EAAE;uCAAqB;AAIjB;IAAX,QAAQ,EAAE;2CAAe;AAId;IAAX,QAAQ,EAAE;0CAAc;AAIhB;IAAR,KAAK,EAAE;sCAAkB;AAId;IAAX,QAAQ,EAAE;uCAA2D;AAI7D;IAAR,KAAK,EAAE;2CAAiB;AAII;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCAAe;AAvChC,SAAS;IADrB,MAAM,CAAC,UAAU,CAAC;GACN,SAAS,CAuNrB;;AAED,eAAe,SAAS,CAAC","sourcesContent":["import { conf } from \"../../conf.js\";\nimport { css, property, type PropertyValueMap, state } from \"../../deps.js\";\nimport RouteTree from \"../../lib/route-tree.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { deepQuerySelectorAll } from \"../../lib/utils.js\";\nimport { define } from \"../../root.js\";\nimport { GodownElement } from \"../../root.js\";\n\ntype WithRecord<T extends string> = Record<string, any> & Record<T, string>;\n\nconst defineName = \"route-view\";\n\n/**\n * RouteView has basic routing control.\n */\n@define(defineName)\nexport class RouteView<T = unknown> extends GodownElement {\n private _routes: (WithRecord<\"path\"> & { component?: T })[] = [];\n private _routeTree: RouteTree = new RouteTree();\n\n /**\n * Component will render.\n */\n @state() component: T | HTMLTemplate = null;\n /**\n * Dynamic parameters record.\n */\n @state() params: Record<string, string> = {};\n /**\n * Value of matched path in routes, or null.\n */\n @state() path: string = null;\n /**\n * Current pathname (location.pathname).\n */\n @property() pathname = \"\";\n /**\n * Path prefix.\n */\n @property() baseURL = \"\";\n /**\n * Rendered content when there is no match.\n */\n @state() def = htmlSlot();\n /**\n * The type of routing query.\n */\n @property() type: \"united\" | \"child\" | \"slotted\" | \"field\" = \"united\";\n /**\n * Rewrite history.\n */\n @state() override = true;\n /**\n * Cache accessed.\n */\n @property({ type: Boolean }) cache = false;\n\n /**\n * Cache record.\n */\n record = new Map<string, ReturnType<typeof this.useRouter>>();\n\n set routes(v) {\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\n return;\n }\n this._routes = v;\n this.reset();\n for (const route of v) {\n this._routeTree.insert(route.path);\n }\n this.requestUpdate();\n }\n\n get routes() {\n return this._routes;\n }\n\n static styles = [\n css`\n :host {\n display: contents;\n }\n `,\n ];\n\n reset() {\n this._routeTree = new RouteTree();\n this.record.clear();\n }\n\n protected render(): T | HTMLTemplate {\n if (this.cache) {\n const cached = this.record.get(this.pathname);\n if (cached) {\n Object.assign(this, cached);\n return this.component;\n }\n }\n this.params = {};\n switch (this.type) {\n case \"field\":\n this.component = this.fieldComponent();\n break;\n case \"child\":\n case \"slotted\":\n this.component = this.slottedComponent();\n break;\n case \"united\":\n this.component = this.fieldComponent() ?? this.slottedComponent();\n break;\n }\n return this.component ?? this.def;\n }\n\n useRouter() {\n return {\n pathname: this.pathname,\n params: this.params,\n path: this.path,\n component: this.component,\n };\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.pathname = window.location.pathname;\n if (!this.override) {\n return;\n }\n this.addEvent(window, \"popstate\", () => {\n this.pathname = window.location.pathname;\n });\n const self = this;\n const pushHistory = history.pushState;\n history.pushState = function () {\n pushHistory.apply(this, arguments);\n self.pathname = window.location.pathname;\n };\n const replaceHistory = history.replaceState;\n history.replaceState = function () {\n replaceHistory.apply(this, arguments);\n self.pathname = window.location.pathname;\n };\n }\n\n /**\n *\n * @param ur value of useRouter()\n * @param first whether this path is loaded for the first time\n */\n routeChangeCallback: (ur: ReturnType<typeof this.useRouter>, first: boolean) => void = null;\n\n protected updated(changedProperties: PropertyValueMap<this>) {\n const shouldDispatch = changedProperties.has(\"pathname\") || changedProperties.has(\"path\");\n if (shouldDispatch) {\n const ur = this.useRouter();\n const noRecord = !this.record.has(this.pathname);\n if (noRecord) {\n this.record.set(this.pathname, ur);\n }\n this.routeChangeCallback?.(ur, noRecord);\n this.dispatchEvent(new CustomEvent(\"change\", { detail: ur }));\n }\n }\n\n fieldComponent(usedRouteTemplate?: string): null | T {\n if (!usedRouteTemplate) {\n usedRouteTemplate = this.useWhichRoute(this.pathname);\n }\n this.path = usedRouteTemplate;\n if (!usedRouteTemplate) {\n return null;\n }\n this.params = this.parseRouterParams(this.path, this.pathname);\n const route = this.routes.find((r) => r.path === usedRouteTemplate);\n if (!route) {\n return null;\n }\n return route.component;\n }\n\n slottedComponent(usedRouteTemplate?: string): null | HTMLTemplate {\n const childNodes = this.querySelectorAll(\":scope > *[slot]\");\n if (!childNodes.length) {\n return null;\n }\n const slottedPaths = Array.from(childNodes).map((node) => {\n const slotname = node.getAttribute(\"slot\");\n return {\n path: slotname,\n };\n });\n const tempRouteTree = new RouteTree();\n for (const withPath of slottedPaths) {\n tempRouteTree.insert(withPath.path);\n }\n if (!usedRouteTemplate) {\n usedRouteTemplate = this.useWhichRoute(this.pathname, undefined, tempRouteTree);\n if (!usedRouteTemplate) {\n return null;\n }\n }\n const slotElement = slottedPaths.find((s) => s.path === usedRouteTemplate);\n if (!slotElement) {\n return null;\n }\n this.params = this.parseRouterParams(usedRouteTemplate, this.pathname);\n return htmlSlot(slotElement.path);\n }\n\n useWhichRoute(path: string, baseURL = this.baseURL, appl: RouteTree = this._routeTree): string | null {\n return appl.useWhich(baseURL + path);\n }\n\n parseRouterParams(routeTemplate: string, originpath: string, appl: RouteTree = this._routeTree): Record<string, string> {\n return appl.parseParams(originpath, routeTemplate);\n }\n\n static updateAll() {\n const routeViewTagName = conf.nameMap.get(\"route-view\");\n if (!routeViewTagName) {\n return;\n }\n const routeViewArray = deepQuerySelectorAll<RouteView>(routeViewTagName, document.body);\n routeViewArray.forEach((ArrayItem) => {\n if (!ArrayItem.override) {\n ArrayItem.pathname = window.location.pathname;\n }\n });\n }\n}\n\nexport default RouteView;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"route-view\": RouteView;\n }\n}\n"]}
@@ -16,35 +16,6 @@ let ScrollX = class ScrollX extends GodownElement {
16
16
  */
17
17
  this.height = "";
18
18
  }
19
- static { this.styles = css `
20
- :host {
21
- display: block;
22
- width: 100%;
23
- }
24
-
25
- section {
26
- overflow: auto;
27
- position: relative;
28
- transform-origin: 0 0;
29
- transform: rotate(-90deg) translateX(-100%);
30
- }
31
-
32
- section::-webkit-scrollbar {
33
- display: none;
34
- }
35
-
36
- span {
37
- display: flex;
38
- }
39
-
40
- main {
41
- width: auto;
42
- position: absolute;
43
- left: 100%;
44
- transform-origin: 0 0;
45
- transform: rotate(90deg);
46
- }
47
- `; }
48
19
  render() {
49
20
  const style = this.height && `:host{height:${this.height}}`;
50
21
  return html `<section @scroll="${this._handelScroll}">
@@ -83,6 +54,35 @@ let ScrollX = class ScrollX extends GodownElement {
83
54
  this.height = this._section.style.width;
84
55
  }
85
56
  };
57
+ ScrollX.styles = css `
58
+ :host {
59
+ display: block;
60
+ width: 100%;
61
+ }
62
+
63
+ section {
64
+ overflow: auto;
65
+ position: relative;
66
+ transform-origin: 0 0;
67
+ transform: rotate(-90deg) translateX(-100%);
68
+ }
69
+
70
+ section::-webkit-scrollbar {
71
+ display: none;
72
+ }
73
+
74
+ span {
75
+ display: flex;
76
+ }
77
+
78
+ main {
79
+ width: auto;
80
+ position: absolute;
81
+ left: 100%;
82
+ transform-origin: 0 0;
83
+ transform: rotate(90deg);
84
+ }
85
+ `;
86
86
  __decorate([
87
87
  property()
88
88
  ], ScrollX.prototype, "height", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-x.js","sourceRoot":"https://github.com/startracex/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AC,MAAM,EAAE,CAAC;IAChB,CAAC;IAED,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC;QACrC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO;QACT,CAAC;QACD,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,IAAI,CAAC,CAAC;QACvC,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC;YAC1C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;QAC5D,CAAC;aAAM,CAAC;YACN,MAAM,cAAc,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;YACtD,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,cAAc,CAAC;YACnC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,GAAG,cAAc,CAAC;YAC3C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;QAC5D,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;IAC1C,CAAC;;AAzEW;IAAX,QAAQ,EAAE;uCAAa;AAEN;IAAjB,KAAK,CAAC,SAAS,CAAC;yCAAuB;AAN7B,OAAO;IADnB,MAAM,CAAC,UAAU,CAAC;GACN,OAAO,CA8EnB;;AAED,eAAe,OAAO,CAAC","sourcesContent":["import { css, html, property, query } from \"../../deps.js\";\nimport { htmlSlot, htmlStyle, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { debounce } from \"../../lib/utils.js\";\nimport { define } from \"../../root.js\";\nimport { GodownElement } from \"../../root.js\";\n\nconst defineName = \"scroll-x\";\n\n/**\n * ScrollX changes the scroll direction to horizontal.\n */\n@define(defineName)\nexport class ScrollX extends GodownElement {\n /**\n * Element height.\n */\n @property() height = \"\";\n\n @query(\"section\") _section: HTMLElement;\n\n static styles = css`\n :host {\n display: block;\n width: 100%;\n }\n\n section {\n overflow: auto;\n position: relative;\n transform-origin: 0 0;\n transform: rotate(-90deg) translateX(-100%);\n }\n\n section::-webkit-scrollbar {\n display: none;\n }\n\n span {\n display: flex;\n }\n\n main {\n width: auto;\n position: absolute;\n left: 100%;\n transform-origin: 0 0;\n transform: rotate(90deg);\n }\n `;\n\n protected render(): HTMLTemplate {\n const style = this.height && `:host{height:${this.height}}`;\n return html`<section @scroll=\"${this._handelScroll}\">\n <main>\n <span>${htmlSlot()}</span>\n </main>\n ${htmlStyle(style)}\n </section>`;\n }\n\n protected _handelScroll(e: any) {\n this.dispatchEvent(new CustomEvent(\"scroll\", { detail: e.target.scrollTop }));\n }\n\n protected firstUpdated() {\n this.resize();\n this.addEvent(window, \"resize\", debounce(this._handelResize.bind(this), 500));\n }\n\n protected _handelResize() {\n this.resize();\n }\n\n resize() {\n const child = this.firstElementChild;\n if (!child) {\n return;\n }\n const height = child.clientHeight || 0;\n if (height) {\n this._section.style.width = height + \"px\";\n this._section.style.height = getComputedStyle(this).width;\n } else {\n const ComputedHeight = getComputedStyle(child).height;\n this.style.height = ComputedHeight;\n this._section.style.width = ComputedHeight;\n this._section.style.height = getComputedStyle(this).width;\n }\n this.height = this._section.style.width;\n }\n}\n\nexport default ScrollX;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"scroll-x\": ScrollX;\n }\n}\n"]}
1
+ {"version":3,"file":"scroll-x.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/view/scroll-x.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAqB,MAAM,wBAAwB,CAAC;AAChF,OAAO,E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AAG,IAAI,CAAC;YAC1C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;QAC5D,CAAC;aAAM,CAAC;YACN,MAAM,cAAc,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;YACtD,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,cAAc,CAAC;YACnC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,GAAG,cAAc,CAAC;YAC3C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;QAC5D,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;IAC1C,CAAC;;AArEM,cAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BlB,AA5BY,CA4BX;AAhCU;IAAX,QAAQ,EAAE;uCAAa;AAEN;IAAjB,KAAK,CAAC,SAAS,CAAC;yCAAuB;AAN7B,OAAO;IADnB,MAAM,CAAC,UAAU,CAAC;GACN,OAAO,CA8EnB;;AAED,eAAe,OAAO,CAAC","sourcesContent":["import { css, html, property, query } from \"../../deps.js\";\nimport { htmlSlot, htmlStyle, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { debounce } from \"../../lib/utils.js\";\nimport { define } from \"../../root.js\";\nimport { GodownElement } from \"../../root.js\";\n\nconst defineName = \"scroll-x\";\n\n/**\n * ScrollX changes the scroll direction to horizontal.\n */\n@define(defineName)\nexport class ScrollX extends GodownElement {\n /**\n * Element height.\n */\n @property() height = \"\";\n\n @query(\"section\") _section: HTMLElement;\n\n static styles = css`\n :host {\n display: block;\n width: 100%;\n }\n\n section {\n overflow: auto;\n position: relative;\n transform-origin: 0 0;\n transform: rotate(-90deg) translateX(-100%);\n }\n\n section::-webkit-scrollbar {\n display: none;\n }\n\n span {\n display: flex;\n }\n\n main {\n width: auto;\n position: absolute;\n left: 100%;\n transform-origin: 0 0;\n transform: rotate(90deg);\n }\n `;\n\n protected render(): HTMLTemplate {\n const style = this.height && `:host{height:${this.height}}`;\n return html`<section @scroll=\"${this._handelScroll}\">\n <main>\n <span>${htmlSlot()}</span>\n </main>\n ${htmlStyle(style)}\n </section>`;\n }\n\n protected _handelScroll(e: any) {\n this.dispatchEvent(new CustomEvent(\"scroll\", { detail: e.target.scrollTop }));\n }\n\n protected firstUpdated() {\n this.resize();\n this.addEvent(window, \"resize\", debounce(this._handelResize.bind(this), 500));\n }\n\n protected _handelResize() {\n this.resize();\n }\n\n resize() {\n const child = this.firstElementChild;\n if (!child) {\n return;\n }\n const height = child.clientHeight || 0;\n if (height) {\n this._section.style.width = height + \"px\";\n this._section.style.height = getComputedStyle(this).width;\n } else {\n const ComputedHeight = getComputedStyle(child).height;\n this.style.height = ComputedHeight;\n this._section.style.width = ComputedHeight;\n this._section.style.height = getComputedStyle(this).width;\n }\n this.height = this._section.style.width;\n }\n}\n\nexport default ScrollX;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"scroll-x\": ScrollX;\n }\n}\n"]}
@@ -19,7 +19,7 @@ export declare class WrapView extends GodownElement {
19
19
  export default WrapView;
20
20
  declare global {
21
21
  interface HTMLElementTagNameMap {
22
- "with-wrap": WrapView;
22
+ "wrap-view": WrapView;
23
23
  }
24
24
  }
25
25
  //# sourceMappingURL=wrap-view.d.ts.map
@@ -19,15 +19,26 @@ let WrapView = class WrapView extends GodownElement {
19
19
  */
20
20
  this.wrap = "";
21
21
  }
22
- static { this.styles = [
23
- css `
22
+ render() {
23
+ switch (this.with) {
24
+ case "expand":
25
+ return html `<i class="${this.wrap || "close"}"></i>`;
26
+ case "icon":
27
+ return icons[this.wrap]?.();
28
+ default:
29
+ return htmlSlot(this.with || this.wrap);
30
+ }
31
+ }
32
+ };
33
+ WrapView.styles = [
34
+ css `
24
35
  :host {
25
36
  display: flex;
26
37
  width: 1em;
27
38
  height: 1em;
28
39
  }
29
40
  `,
30
- css `
41
+ css `
31
42
  i {
32
43
  width: 100%;
33
44
  height: 100%;
@@ -68,18 +79,7 @@ let WrapView = class WrapView extends GodownElement {
68
79
  --e: 0.15em;
69
80
  }
70
81
  `,
71
- ]; }
72
- render() {
73
- switch (this.with) {
74
- case "expand":
75
- return html `<i class="${this.wrap || "close"}"></i>`;
76
- case "icon":
77
- return icons[this.wrap]?.();
78
- default:
79
- return htmlSlot(this.with || this.wrap);
80
- }
81
- }
82
- };
82
+ ];
83
83
  __decorate([
84
84
  property()
85
85
  ], WrapView.prototype, "with", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"wrap-view.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/view/wrap-view.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,UAAU,GAAG,WAAW,CAAC;AAE/B;;GAEG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,aAAa;IAApC;;QACL;;WAEG;QACS,SAAI,GAAoD,EAAE,CAAC;QACvE;;WAEG;QACS,SAAI,GAAgC,EAAE,CAAC;IA+DrD,CAAC;aA7DQ,WAAM,GAAG;QACd,GAAG,CAAA;;;;;;KAMF;QACD,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwCF;KACF,AAjDY,CAiDX;IAEQ,MAAM;QACd,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,KAAK,QAAQ;gBACX,OAAO,IAAI,CAAA,aAAa,IAAI,CAAC,IAAI,IAAI,OAAO,QAAQ,CAAC;YACvD,KAAK,MAAM;gBACT,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;YAC9B;gBACE,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;;AAlEW;IAAX,QAAQ,EAAE;sCAA4D;AAI3D;IAAX,QAAQ,EAAE;sCAAwC;AARxC,QAAQ;IADpB,MAAM,CAAC,UAAU,CAAC;GACN,QAAQ,CAuEpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { css, html, property } from \"../../deps.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { icons } from \"../../lib/templates.js\";\nimport { define, GodownElement } from \"../../root.js\";\n\nconst defineName = \"wrap-view\";\n\n/**\n * WithWrap is used for wrap content.\n */\n@define(defineName)\nexport class WrapView extends GodownElement {\n /**\n * Behavioral basis.\n */\n @property() with: string | keyof typeof icons | \"expand\" | \"icon\" = \"\";\n /**\n * Rendered content or slot name.\n */\n @property() wrap: string | keyof typeof icons = \"\";\n\n static styles = [\n css`\n :host {\n display: flex;\n width: 1em;\n height: 1em;\n }\n `,\n css`\n i {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n --e: 0.05em;\n }\n\n i::before,\n i::after {\n content: \"\";\n display: block;\n width: 100%;\n height: 0.05em;\n background: currentColor;\n transition: 0.3s;\n }\n\n i::after {\n transform: translate(0, calc(var(--e) / -2)) rotate(-45deg);\n }\n\n i::before {\n transform: translate(0, calc(var(--e) / 2)) rotate(45deg);\n }\n\n .close::after {\n transform: translate(0, var(--e));\n }\n\n .close::before {\n transform: translate(0, calc(var(--e) * -1));\n }\n\n .close {\n --e: 0.15em;\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n switch (this.with) {\n case \"expand\":\n return html`<i class=\"${this.wrap || \"close\"}\"></i>`;\n case \"icon\":\n return icons[this.wrap]?.();\n default:\n return htmlSlot(this.with || this.wrap);\n }\n }\n}\n\nexport default WrapView;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"with-wrap\": WrapView;\n }\n}\n"]}
1
+ {"version":3,"file":"wrap-view.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/view/wrap-view.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,UAAU,GAAG,WAAW,CAAC;AAE/B;;GAEG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,aAAa;IAApC;;QACL;;WAEG;QACS,SAAI,GAAoD,EAAE,CAAC;QACvE;;WAEG;QACS,SAAI,GAAgC,EAAE,CAAC;IA+DrD,CAAC;IAVW,MAAM;QACd,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,KAAK,QAAQ;gBACX,OAAO,IAAI,CAAA,aAAa,IAAI,CAAC,IAAI,IAAI,OAAO,QAAQ,CAAC;YACvD,KAAK,MAAM;gBACT,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;YAC9B;gBACE,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;;AA5DM,eAAM,GAAG;IACd,GAAG,CAAA;;;;;;KAMF;IACD,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwCF;CACF,AAjDY,CAiDX;AAvDU;IAAX,QAAQ,EAAE;sCAA4D;AAI3D;IAAX,QAAQ,EAAE;sCAAwC;AARxC,QAAQ;IADpB,MAAM,CAAC,UAAU,CAAC;GACN,QAAQ,CAuEpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { css, html, property } from \"../../deps.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { icons } from \"../../lib/templates.js\";\nimport { define, GodownElement } from \"../../root.js\";\n\nconst defineName = \"wrap-view\";\n\n/**\n * WithWrap is used for wrap content.\n */\n@define(defineName)\nexport class WrapView extends GodownElement {\n /**\n * Behavioral basis.\n */\n @property() with: string | keyof typeof icons | \"expand\" | \"icon\" = \"\";\n /**\n * Rendered content or slot name.\n */\n @property() wrap: string | keyof typeof icons = \"\";\n\n static styles = [\n css`\n :host {\n display: flex;\n width: 1em;\n height: 1em;\n }\n `,\n css`\n i {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n --e: 0.05em;\n }\n\n i::before,\n i::after {\n content: \"\";\n display: block;\n width: 100%;\n height: 0.05em;\n background: currentColor;\n transition: 0.3s;\n }\n\n i::after {\n transform: translate(0, calc(var(--e) / -2)) rotate(-45deg);\n }\n\n i::before {\n transform: translate(0, calc(var(--e) / 2)) rotate(45deg);\n }\n\n .close::after {\n transform: translate(0, var(--e));\n }\n\n .close::before {\n transform: translate(0, calc(var(--e) * -1));\n }\n\n .close {\n --e: 0.15em;\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n switch (this.with) {\n case \"expand\":\n return html`<i class=\"${this.wrap || \"close\"}\"></i>`;\n case \"icon\":\n return icons[this.wrap]?.();\n default:\n return htmlSlot(this.with || this.wrap);\n }\n }\n}\n\nexport default WrapView;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"wrap-view\": WrapView;\n }\n}\n"]}
package/open-list.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { default } from "./web-components/open/open-list.js";
2
- //# sourceMappingURL=open-list.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"open-list.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["open-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC"}
package/open-list.js DELETED
@@ -1,2 +0,0 @@
1
- export { default } from "./web-components/open/open-list.js";
2
- //# sourceMappingURL=open-list.js.map
package/open-list.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"open-list.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["open-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["export { default } from \"./web-components/open/open-list.js\";"]}
@@ -1,5 +0,0 @@
1
- export * from "./divider-line.js";
2
- export * from "./flex-flow.js";
3
- export * from "./nav-aside.js";
4
- export * from "./nav-layout.js";
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
@@ -1,6 +0,0 @@
1
- /// script generated
2
- export * from "./divider-line.js";
3
- export * from "./flex-flow.js";
4
- export * from "./nav-aside.js";
5
- export * from "./nav-layout.js";
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/index.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC","sourcesContent":["/// script generated\nexport * from \"./divider-line.js\";\nexport * from \"./flex-flow.js\";\nexport * from \"./nav-aside.js\";\nexport * from \"./nav-layout.js\";\n"]}
@@ -1,20 +0,0 @@
1
- import { type CSSResultGroup } from "../../deps.js";
2
- import { type HTMLTemplate } from "../../lib/templates.js";
3
- import { OpenableElement } from "./open.js";
4
- /**
5
- * OpenList renders the menu when it has a summary, otherwise a list.
6
- *
7
- * Inspired by Docusaurus (v1,v2).
8
- */
9
- export declare class OpenList extends OpenableElement {
10
- _section: HTMLElement;
11
- static styles: CSSResultGroup;
12
- protected render(): HTMLTemplate;
13
- }
14
- export default OpenList;
15
- declare global {
16
- interface HTMLElementTagNameMap {
17
- "open-list": OpenList;
18
- }
19
- }
20
- //# sourceMappingURL=open-list.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"open-list.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/open/open-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAe,MAAM,eAAe,CAAC;AAEtE,OAAO,EAAY,KAAK,YAAY,EAAY,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAI5C;;;;GAIG;AACH,qBACa,QAAS,SAAQ,eAAe;IACzB,QAAQ,EAAE,WAAW,CAAC;IACxC,MAAM,CAAC,MAAM,iBAgCO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;CAejC;AAED,eAAe,QAAQ,CAAC;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
@@ -1,71 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { css, html, query } from "../../deps.js";
3
- import { ifValue } from "../../lib/directives.js";
4
- import { htmlSlot, svgArrow } from "../../lib/templates.js";
5
- import { cssvarValues, define } from "../../root.js";
6
- import { OpenableElement } from "./open.js";
7
- const defineName = "open-list";
8
- /**
9
- * OpenList renders the menu when it has a summary, otherwise a list.
10
- *
11
- * Inspired by Docusaurus (v1,v2).
12
- */
13
- let OpenList = class OpenList extends OpenableElement {
14
- static { this.styles = [
15
- OpenableElement.styles,
16
- css `
17
- i {
18
- width: 1.2em;
19
- height: 1.2em;
20
- display: inline-flex;
21
- align-items: center;
22
- border-radius: 20%;
23
- transition: inherit;
24
- }
25
-
26
- dt i {
27
- background: rgb(var(${cssvarValues.mainRGB}) / 0.055);
28
- }
29
-
30
- dt i:hover {
31
- background: rgb(var(${cssvarValues.mainRGB}) / 0.075);
32
- }
33
-
34
- dd {
35
- padding: 0.2em;
36
- }
37
-
38
- :host([open]) svg {
39
- transform: rotate(90deg);
40
- }
41
-
42
- .noTitle {
43
- display: none;
44
- }
45
- `,
46
- ]; }
47
- render() {
48
- const noTitle = !this.summary && ifValue(!this.querySelector("[slot=summary]"), "noTitle");
49
- if (noTitle) {
50
- this.open = true;
51
- }
52
- return html `<dl>
53
- <dt class="${noTitle}">
54
- <span>${this.summary || htmlSlot("summary")}</span>
55
- <i @click="${this._handelClick}"> ${htmlSlot("icon", svgArrow(), this)} </i>
56
- </dt>
57
- <dd>
58
- <section>${htmlSlot()}</section>
59
- </dd>
60
- </dl>`;
61
- }
62
- };
63
- __decorate([
64
- query("section")
65
- ], OpenList.prototype, "_section", void 0);
66
- OpenList = __decorate([
67
- define(defineName)
68
- ], OpenList);
69
- export { OpenList };
70
- export default OpenList;
71
- //# sourceMappingURL=open-list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"open-list.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/open/open-list.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAqB,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,UAAU,GAAG,WAAW,CAAC;AAE/B;;;;GAIG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,eAAe;aAEpC,WAAM,GAAG;QACd,eAAe,CAAC,MAAM;QACtB,GAAG,CAAA;;;;;;;;;;;8BAWuB,YAAY,CAAC,OAAO;;;;8BAIpB,YAAY,CAAC,OAAO;;;;;;;;;;;;;;KAc7C;KACgB,AAhCN,CAgCO;IAEV,MAAM;QACd,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,EAAE,SAAS,CAAC,CAAC;QAC3F,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACnB,CAAC;QACD,OAAO,IAAI,CAAA;mBACI,OAAO;gBACV,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,SAAS,CAAC;qBAC9B,IAAI,CAAC,YAAY,MAAM,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC;;;mBAG3D,QAAQ,EAAE;;UAEnB,CAAC;IACT,CAAC;;AAjDiB;IAAjB,KAAK,CAAC,SAAS,CAAC;0CAAuB;AAD7B,QAAQ;IADpB,MAAM,CAAC,UAAU,CAAC;GACN,QAAQ,CAmDpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, query } from \"../../deps.js\";\nimport { ifValue } from \"../../lib/directives.js\";\nimport { htmlSlot, type HTMLTemplate, svgArrow } from \"../../lib/templates.js\";\nimport { cssvarValues, define } from \"../../root.js\";\nimport { OpenableElement } from \"./open.js\";\n\nconst defineName = \"open-list\";\n\n/**\n * OpenList renders the menu when it has a summary, otherwise a list.\n *\n * Inspired by Docusaurus (v1,v2).\n */\n@define(defineName)\nexport class OpenList extends OpenableElement {\n @query(\"section\") _section: HTMLElement;\n static styles = [\n OpenableElement.styles,\n css`\n i {\n width: 1.2em;\n height: 1.2em;\n display: inline-flex;\n align-items: center;\n border-radius: 20%;\n transition: inherit;\n }\n\n dt i {\n background: rgb(var(${cssvarValues.mainRGB}) / 0.055);\n }\n\n dt i:hover {\n background: rgb(var(${cssvarValues.mainRGB}) / 0.075);\n }\n\n dd {\n padding: 0.2em;\n }\n\n :host([open]) svg {\n transform: rotate(90deg);\n }\n\n .noTitle {\n display: none;\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n const noTitle = !this.summary && ifValue(!this.querySelector(\"[slot=summary]\"), \"noTitle\");\n if (noTitle) {\n this.open = true;\n }\n return html`<dl>\n <dt class=\"${noTitle}\">\n <span>${this.summary || htmlSlot(\"summary\")}</span>\n <i @click=\"${this._handelClick}\"> ${htmlSlot(\"icon\", svgArrow(), this)} </i>\n </dt>\n <dd>\n <section>${htmlSlot()}</section>\n </dd>\n </dl>`;\n }\n}\n\nexport default OpenList;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"open-list\": OpenList;\n }\n}\n"]}