godown 3.12.0 → 3.13.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 (146) hide show
  1. package/build/godown+lit.iife.js +12 -13
  2. package/build/godown+lit.iife.js.map +1 -1
  3. package/build/godown+lit.js +11 -12
  4. package/build/godown+lit.js.map +1 -1
  5. package/build/godown+lit.umd.js +12 -13
  6. package/build/godown+lit.umd.js.map +1 -1
  7. package/build/godown.iife.js +5 -5
  8. package/build/godown.iife.js.map +1 -1
  9. package/build/godown.js +5 -5
  10. package/build/godown.js.map +1 -1
  11. package/build/godown.umd.js +5 -5
  12. package/build/godown.umd.js.map +1 -1
  13. package/custom-elements.json +1 -1
  14. package/index.d.ts +1 -0
  15. package/index.d.ts.map +1 -1
  16. package/index.js +1 -1
  17. package/internal/global-style.d.ts.map +1 -1
  18. package/internal/global-style.js +1 -1
  19. package/internal/global-style.js.map +1 -1
  20. package/internal/popover.d.ts +3 -0
  21. package/internal/popover.d.ts.map +1 -0
  22. package/internal/popover.js +2 -0
  23. package/internal/popover.js.map +1 -0
  24. package/internal/reset-style.d.ts +3 -0
  25. package/internal/reset-style.d.ts.map +1 -0
  26. package/internal/reset-style.js +2 -0
  27. package/internal/reset-style.js.map +1 -0
  28. package/internal/ring.d.ts +1 -0
  29. package/internal/ring.d.ts.map +1 -1
  30. package/internal/ring.js +1 -1
  31. package/internal/ring.js.map +1 -1
  32. package/internal/super-input.d.ts +1 -1
  33. package/internal/super-input.d.ts.map +1 -1
  34. package/internal/super-input.js +1 -1
  35. package/internal/super-input.js.map +1 -1
  36. package/internal/utils.d.ts +2 -0
  37. package/internal/utils.d.ts.map +1 -0
  38. package/internal/utils.js +2 -0
  39. package/internal/utils.js.map +1 -0
  40. package/package.json +2 -3
  41. package/popover.d.ts +2 -0
  42. package/popover.d.ts.map +1 -0
  43. package/popover.js +2 -0
  44. package/popover.js.map +1 -0
  45. package/src/index.ts +1 -0
  46. package/src/internal/global-style.ts +7 -35
  47. package/src/internal/popover.ts +64 -0
  48. package/src/internal/reset-style.ts +63 -0
  49. package/src/internal/ring.ts +3 -2
  50. package/src/internal/super-input.ts +2 -2
  51. package/src/internal/utils.ts +10 -0
  52. package/src/popover.ts +1 -0
  53. package/src/web-components/alert/component.ts +8 -15
  54. package/src/web-components/avatar/component.ts +1 -0
  55. package/src/web-components/button/component.ts +6 -10
  56. package/src/web-components/card/component.ts +4 -4
  57. package/src/web-components/chip/component.ts +1 -3
  58. package/src/web-components/details/component.ts +27 -16
  59. package/src/web-components/dialog/component.ts +50 -67
  60. package/src/web-components/heading/component.ts +0 -1
  61. package/src/web-components/input/component.ts +5 -7
  62. package/src/web-components/link/component.ts +0 -2
  63. package/src/web-components/popover/component.ts +172 -0
  64. package/src/web-components/popover/definition.ts +11 -0
  65. package/src/web-components/range/component.ts +2 -1
  66. package/src/web-components/rotate/component.ts +0 -1
  67. package/src/web-components/select/component.ts +110 -173
  68. package/src/web-components/split/component.ts +2 -2
  69. package/src/web-components/switch/component.ts +2 -1
  70. package/src/web-components/tabs/component.ts +100 -101
  71. package/src/web-components/tooltip/component.ts +44 -112
  72. package/vscode.css-custom-data.json +1 -1
  73. package/vscode.html-custom-data.json +1 -1
  74. package/web-components/alert/component.d.ts.map +1 -1
  75. package/web-components/alert/component.js +1 -1
  76. package/web-components/alert/component.js.map +1 -1
  77. package/web-components/avatar/component.d.ts.map +1 -1
  78. package/web-components/avatar/component.js +1 -1
  79. package/web-components/avatar/component.js.map +1 -1
  80. package/web-components/button/component.d.ts.map +1 -1
  81. package/web-components/button/component.js +1 -1
  82. package/web-components/button/component.js.map +1 -1
  83. package/web-components/card/component.d.ts.map +1 -1
  84. package/web-components/card/component.js +1 -1
  85. package/web-components/card/component.js.map +1 -1
  86. package/web-components/chip/component.d.ts +1 -3
  87. package/web-components/chip/component.d.ts.map +1 -1
  88. package/web-components/chip/component.js.map +1 -1
  89. package/web-components/details/component.d.ts +9 -13
  90. package/web-components/details/component.d.ts.map +1 -1
  91. package/web-components/details/component.js +1 -1
  92. package/web-components/details/component.js.map +1 -1
  93. package/web-components/dialog/component.d.ts +12 -14
  94. package/web-components/dialog/component.d.ts.map +1 -1
  95. package/web-components/dialog/component.js +1 -1
  96. package/web-components/dialog/component.js.map +1 -1
  97. package/web-components/heading/component.d.ts.map +1 -1
  98. package/web-components/heading/component.js +1 -1
  99. package/web-components/heading/component.js.map +1 -1
  100. package/web-components/input/component.d.ts.map +1 -1
  101. package/web-components/input/component.js +1 -1
  102. package/web-components/input/component.js.map +1 -1
  103. package/web-components/link/component.d.ts.map +1 -1
  104. package/web-components/link/component.js +1 -1
  105. package/web-components/link/component.js.map +1 -1
  106. package/web-components/popover/component.d.ts +35 -0
  107. package/web-components/popover/component.d.ts.map +1 -0
  108. package/web-components/popover/component.js +2 -0
  109. package/web-components/popover/component.js.map +1 -0
  110. package/web-components/popover/definition.d.ts +8 -0
  111. package/web-components/popover/definition.d.ts.map +1 -0
  112. package/web-components/popover/definition.js +2 -0
  113. package/web-components/popover/definition.js.map +1 -0
  114. package/web-components/range/component.d.ts.map +1 -1
  115. package/web-components/range/component.js +1 -1
  116. package/web-components/range/component.js.map +1 -1
  117. package/web-components/rotate/component.d.ts.map +1 -1
  118. package/web-components/rotate/component.js.map +1 -1
  119. package/web-components/select/component.d.ts +11 -27
  120. package/web-components/select/component.d.ts.map +1 -1
  121. package/web-components/select/component.js +1 -1
  122. package/web-components/select/component.js.map +1 -1
  123. package/web-components/split/component.js +1 -1
  124. package/web-components/split/component.js.map +1 -1
  125. package/web-components/switch/component.d.ts.map +1 -1
  126. package/web-components/switch/component.js +1 -1
  127. package/web-components/switch/component.js.map +1 -1
  128. package/web-components/tabs/component.d.ts +18 -25
  129. package/web-components/tabs/component.d.ts.map +1 -1
  130. package/web-components/tabs/component.js +1 -1
  131. package/web-components/tabs/component.js.map +1 -1
  132. package/web-components/tooltip/component.d.ts +15 -39
  133. package/web-components/tooltip/component.d.ts.map +1 -1
  134. package/web-components/tooltip/component.js +1 -1
  135. package/web-components/tooltip/component.js.map +1 -1
  136. package/web-types.json +1 -1
  137. package/internal/direction.d.ts +0 -27
  138. package/internal/direction.d.ts.map +0 -1
  139. package/internal/direction.js +0 -2
  140. package/internal/direction.js.map +0 -1
  141. package/internal/super-openable.d.ts +0 -15
  142. package/internal/super-openable.d.ts.map +0 -1
  143. package/internal/super-openable.js +0 -2
  144. package/internal/super-openable.js.map +0 -1
  145. package/src/internal/direction.ts +0 -65
  146. package/src/internal/super-openable.ts +0 -34
@@ -2,52 +2,32 @@ import { attr, godown, htmlSlot, StyleController, styles, tokenList } from "@god
2
2
  import { cssGlobalVars, GlobalStyle, scopePrefix } from "../../internal/global-style.js";
3
3
  import { css, html, type TemplateResult } from "lit";
4
4
  import { property, queryAll } from "lit/decorators.js";
5
- import { RingBuilder, type RingType } from "../../internal/ring.js";
5
+ import { RingBuilder, ringTypeAttribute, type RingType } from "../../internal/ring.js";
6
6
 
7
7
  const protoName = "tabs";
8
8
  const cssScope = scopePrefix(protoName);
9
9
 
10
- const mouseEnterAddedToken = "hover";
10
+ const hoverToken = "hover";
11
11
 
12
12
  /**
13
13
  * {@linkcode Tabs} used to render a set of tabs.
14
14
  *
15
- * It accepts "tabs" to present the sub-content.
16
- *
17
- * When "useSlot" is enabled, each item in "tabs" becomes a named slot with the same name as itself,
18
- * while for non-slot tabs, the content is rendered as a horizontally padded string.
19
- *
20
- * When "mouseenter" and "mouseleave" are triggered on an individual tab, the indicator will move.
21
- *
22
- * The moving indicator will start from the position of the item that was last entered.
23
- *
24
- * If the pointer moves out of the root element or the element is connected to the document,
25
- * the starting position of the indicator will be regarded as the current selection.
26
- *
27
- * Apply "flex-direction: column" to the tabs to arrange them vertically.
28
- *
29
- * @csspart root - The root element.
30
- * @csspart item - The tab items.
31
- * @csspart indicator - The indicator.
32
- * @csspart selected - The selected tab item.
33
- * @csspart hover - The hovered tab item.
34
- * @fires select - Fires when the tab is selected.
15
+ * @fires select - Fires when the tab index is changed.
35
16
  * @category display
36
17
  */
37
18
  @godown(protoName)
38
19
  @styles(css`
39
20
  :host {
40
21
  ${cssScope}--indicator-background: var(${cssGlobalVars.passive});
41
- ${cssScope}--space: 0.25em;
42
- border-radius: var(${cssGlobalVars.radius});
43
- transition: 0.3s ease-in-out;
44
- width: fit-content;
22
+ ${cssScope}--selected-background: var(${cssGlobalVars.passive});
23
+ transition: 0.2s ease-in-out;
45
24
  display: flex;
46
25
  cursor: default;
47
26
  }
48
27
 
49
28
  [part="root"] {
50
- padding: 0.2em;
29
+ gap: 0.25em;
30
+ padding: 0.25em;
51
31
  position: relative;
52
32
  z-index: 1;
53
33
  display: flex;
@@ -56,17 +36,13 @@ const mouseEnterAddedToken = "hover";
56
36
  border-radius: inherit;
57
37
  transition: inherit;
58
38
  transition-property: width, transform, opacity;
59
- gap: var(${cssScope}--space);
60
- }
61
-
62
- [useslot] [part~="item"] {
63
- padding: 0;
64
39
  }
65
40
 
66
41
  [part~="item"] {
42
+ position: relative;
67
43
  width: 100%;
68
44
  display: block;
69
- padding: 0 0.25em;
45
+ text-align: center;
70
46
  position: relative;
71
47
  white-space: nowrap;
72
48
  transition: inherit;
@@ -74,12 +50,11 @@ const mouseEnterAddedToken = "hover";
74
50
  transition-property: inherit;
75
51
  }
76
52
 
77
- [part="indicator"] {
53
+ [part="indicator"],
54
+ [part~="item"]::after {
78
55
  width: 100%;
79
56
  height: 100%;
80
57
  inset: 0;
81
- opacity: 0;
82
- z-index: -1;
83
58
  position: absolute;
84
59
  transition: inherit;
85
60
  border-radius: inherit;
@@ -87,27 +62,58 @@ const mouseEnterAddedToken = "hover";
87
62
  background: var(${cssScope}--indicator-background);
88
63
  }
89
64
 
90
- [part~="selected"] {
91
- background: var(${cssScope}--indicator-background);
65
+ [part="indicator"] {
66
+ opacity: 0;
67
+ z-index: -1;
68
+ }
69
+
70
+ [part~="item"]::after {
71
+ z-index: -2;
72
+ }
73
+
74
+ [indicator="underline"] [part="indicator"],
75
+ [indicator="underline"] [part~="item"]::after {
76
+ top: 100%;
77
+ height: 0.15em;
78
+ border-radius: 0.075em;
79
+ margin-top: 0.15em;
80
+ }
81
+
82
+ [part~="selected"]::after {
83
+ content: "";
84
+ background: var(${cssScope}--selected-background);
92
85
  }
93
86
 
94
- [part~="selected"] [part="indicator"],
95
87
  [part~="hover"] [part="indicator"] {
96
88
  opacity: 1;
97
89
  }
98
90
  `)
99
91
  class Tabs extends GlobalStyle {
100
- @property({ attribute: "ring-type" })
92
+ @property({ attribute: ringTypeAttribute })
101
93
  ringType: RingType = "border";
102
94
 
103
95
  /**
104
- * Determines whether the tabs should use a slot for their content instead of a string.
96
+ * If it is "select", the indicator moves from the selected content to the hover position.
97
+ *
98
+ * If it is "previous", the indicator moves from the last moved position to the hover position.
99
+ *
100
+ * If "none", the indicator will not move.
101
+ */
102
+ @property()
103
+ beginning: "selected" | "previous" | "none" = "selected";
104
+
105
+ /**
106
+ * The behavior of the indicator:
107
+ *
108
+ * If "background", its size will be consistent with that of a single tab.
109
+ *
110
+ * If "underline", an underline will be displayed at the bottom of the tab.
105
111
  */
106
- @property({ type: Boolean })
107
- useSlot = false;
112
+ @property()
113
+ indicator: "background" | "underline" = "background";
108
114
 
109
115
  /**
110
- * An array of strings or slot content representing the tabs.
116
+ * Tab list or slot list.
111
117
  */
112
118
  @property({ type: Array })
113
119
  tabs: string[];
@@ -118,7 +124,7 @@ class Tabs extends GlobalStyle {
118
124
  @property({ type: Number })
119
125
  index = 0;
120
126
 
121
- protected _lastIndex: number;
127
+ protected previousIndex: number;
122
128
 
123
129
  @queryAll("[part~=item]")
124
130
  protected _items: HTMLCollectionOf<HTMLLIElement>;
@@ -138,24 +144,20 @@ class Tabs extends GlobalStyle {
138
144
  ${attr(this.observedRecord)}
139
145
  @mouseleave="${this._handleMouseLeave}"
140
146
  >
141
- ${this.tabs?.map((tab, index) =>
142
- tab || this.useSlot
143
- ? html`
144
- <li
145
- part="${tokenList("item", {
146
- selected: this.index === index,
147
- })}"
148
- @mouseenter=${() => {
149
- this.move(this._lastIndex, index);
150
- this._lastIndex = index;
151
- }}
152
- @click=${() => this.select(index)}
153
- >
154
- ${this.useSlot ? htmlSlot(tab) : tab}
155
- <div part="indicator"></div>
156
- </li>
157
- `
158
- : "",
147
+ ${this.tabs?.map(
148
+ (tab, index) => html`
149
+ <li
150
+ part="${tokenList("item", this.index === index && "selected")}"
151
+ @mouseenter=${() => {
152
+ this.move(this.previousIndex, index);
153
+ this.previousIndex = index;
154
+ }}
155
+ @click=${() => this.select(index)}
156
+ >
157
+ ${htmlSlot(tab, tab)}
158
+ <div part="indicator"></div>
159
+ </li>
160
+ `,
159
161
  )}
160
162
  </ul>
161
163
  `;
@@ -163,65 +165,62 @@ class Tabs extends GlobalStyle {
163
165
 
164
166
  connectedCallback(): void {
165
167
  super.connectedCallback();
166
- this._lastIndex = this.index;
168
+ this.previousIndex = this.beginning === "selected" ? this.index : -1;
167
169
  }
168
170
 
169
171
  protected _handleMouseLeave(): void {
170
- const lastItem = this._items[this._lastIndex];
172
+ const lastItem = this._items[this.previousIndex];
171
173
  if (lastItem) {
172
- lastItem.part.remove(mouseEnterAddedToken);
174
+ lastItem.part.remove(hoverToken);
173
175
  }
174
- this._lastIndex = this.index;
176
+ this.previousIndex = this.beginning === "selected" ? this.index : -1;
175
177
  }
176
178
 
177
- move(from: number, to: number): void {
178
- if (from === to) {
179
+ move(sourceIndex: number, targetIndex: number): void {
180
+ if (sourceIndex === targetIndex) {
179
181
  return;
180
182
  }
181
183
  const { _items, _indicators } = this;
182
- const toItem = _items[to];
183
- if (!toItem) {
184
+ const targetElement = _items[targetIndex];
185
+ if (!targetElement) {
184
186
  return;
185
187
  }
186
- toItem.part.add(mouseEnterAddedToken);
187
- const fromItem = _items[from];
188
+ targetElement.part.add(hoverToken);
189
+ const fromItem = _items[sourceIndex];
188
190
  if (!fromItem) {
189
191
  return;
190
192
  }
191
- fromItem.part.remove(mouseEnterAddedToken);
192
- const toIndicator = _indicators[to];
193
- const fromIndicator = _indicators[from];
194
- if (!toIndicator || !fromIndicator) {
193
+ fromItem.part.remove(hoverToken);
194
+ if (this.beginning === "none") {
195
195
  return;
196
196
  }
197
- const fromIndicatorRect = fromIndicator.getBoundingClientRect();
198
- const toItemRect = toItem.getBoundingClientRect();
199
- const transformX = fromIndicatorRect.x - toItemRect.x;
200
- const transformY = fromIndicatorRect.y - toItemRect.y;
201
- const fromWidth = fromIndicatorRect.width;
202
-
203
- const { style } = toIndicator;
204
- const cssNone = "none";
205
-
206
- style.transform = `translate3d(${transformX}px,${transformY}px,0)`;
207
- style.width = fromWidth + "px";
208
- style.transition = fromIndicator.style.transition = cssNone;
209
-
210
- toIndicator.getBoundingClientRect();
211
-
212
- style.width = style.transform = style.transition = fromIndicator.style.transition = "";
197
+ const targetIndicator = _indicators[targetIndex];
198
+ const sourceIndicator = _indicators[sourceIndex];
199
+ if (!targetIndicator || !sourceIndicator) {
200
+ return;
201
+ }
202
+ const { x: sourceX, y: sourceY, width: sourceWidth } = sourceIndicator.getBoundingClientRect();
203
+ const { x, y } = targetIndicator.getBoundingClientRect();
204
+ const transformX = sourceX - x;
205
+ const transformY = sourceY - y;
206
+
207
+ const { style: targetStyle } = targetIndicator;
208
+ const { style: sourceStyle } = sourceIndicator;
209
+
210
+ targetStyle.transform = `translate3d(${transformX}px,${transformY}px,0)`;
211
+ targetStyle.width = `${sourceWidth}px`;
212
+ targetStyle.transition = sourceStyle.transition = "none";
213
+ targetIndicator.getBoundingClientRect();
214
+ targetStyle.width = targetStyle.transform = targetStyle.transition = sourceStyle.transition = "";
213
215
  }
214
216
 
215
217
  select(selected: number): void {
216
- const { index, tabs, _lastIndex, useSlot } = this;
217
- if (!tabs || index === selected || !(selected in tabs)) {
218
- return;
219
- }
220
- this.dispatchCustomEvent("select", selected);
221
- this.move(_lastIndex, selected);
222
- this._lastIndex = selected;
223
- if (index in tabs && (tabs[index] || useSlot)) {
218
+ const { index, previousIndex } = this;
219
+ this.move(previousIndex, selected);
220
+ if (selected !== index) {
221
+ this.previousIndex = selected;
224
222
  this.index = selected;
223
+ this.dispatchCustomEvent("select", selected);
225
224
  }
226
225
  }
227
226
  }
@@ -1,139 +1,71 @@
1
- import { attr, godown, htmlSlot, styles } from "@godown/element";
2
- import { type TemplateResult, css, html } from "lit";
1
+ import { godown, htmlSlot } from "@godown/element";
2
+ import { type TemplateResult, html } from "lit";
3
3
  import { property } from "lit/decorators.js";
4
4
 
5
- import { scopePrefix } from "../../internal/global-style.js";
6
- import { SuperOpenable } from "../../internal/super-openable.js";
7
- import { type DirectionCardinal, type DirectionCorner, directionOutsetPlace } from "../../internal/direction.js";
5
+ import Popover from "../popover/component.js";
8
6
 
9
7
  const protoName = "tooltip";
10
- const cssScope = scopePrefix(protoName);
11
8
 
12
9
  /**
13
- * {@linkcode Tooltip} provide tooltip for slot elements.
10
+ * {@linkcode Tooltip} is similar to {@linkcode Popover}.
14
11
  *
15
- * If it has the tip property, ignore the slot tip.
12
+ * It listens for the mouseenter event and displays the tip or popover after a specified delay.
16
13
  *
17
- * @slot tip - Tip element if no `tip` provided.
18
- * @slot - Content.
14
+ * When it is clicked or the mouseleave event occurs followed by another delay, closes the tip.
15
+ *
16
+ * @fires toggle - Fired when the popover is toggled.
17
+ * @slot tip - Tip content.
18
+ * @slot - Tip trigger.
19
19
  * @category feedback
20
20
  */
21
21
  @godown(protoName)
22
- @styles(
23
- directionOutsetPlace,
24
- css`
25
- :host {
26
- ${cssScope}--tip-background: inherit;
27
- width: fit-content;
28
- }
29
-
30
- :host,
31
- [part="root"] {
32
- display: inline-flex;
33
- }
34
-
35
- [part="root"] {
36
- position: relative;
37
- transition: inherit;
38
- border-radius: inherit;
39
- }
40
-
41
- [part="tip"] {
42
- width: fit-content;
43
- height: fit-content;
44
- position: absolute;
45
- visibility: hidden;
46
- transition: inherit;
47
- user-select: none;
48
- }
49
-
50
- :host([open]) [part="tip"] {
51
- visibility: visible;
52
- }
22
+ class Tooltip extends Popover {
23
+ action: "hide";
24
+ span: "span" | "isolated";
53
25
 
54
- .passive {
55
- background: var(${cssScope}--tip-background);
56
- }
57
-
58
- [propagation] [part="tip"] {
59
- pointer-events: none;
60
- }
61
- `,
62
- )
63
- class Tooltip extends SuperOpenable {
64
- /**
65
- * Tip text, if there is a value, the slot will be ignored.
66
- */
67
26
  @property()
68
27
  tip: string;
69
28
 
70
- /**
71
- * Direction of opening the tip.
72
- */
73
- @property()
74
- direction: DirectionCardinal | DirectionCorner = "top";
75
-
76
- /**
77
- * Content alignment.
78
- */
79
- @property()
80
- align: "center" | "flex-start" | "flex-end" | "start" | "end" = "center";
81
-
82
- /**
83
- * If true, allow penetration of the tip.
84
- */
85
- @property({ type: Boolean })
86
- propagation = false;
87
-
88
- /**
89
- * How can tips be triggered.
90
- *
91
- * If `focus`, element will be focusable, open tip when focused.
92
- *
93
- * If `hover`, element will open tip when hovered.
94
- *
95
- * @default "hover"
96
- */
97
- @property()
98
- type: "hover" | "focus" = "hover";
99
-
100
- static aligns = {
101
- start: "flex-start",
102
- end: "flex-end",
103
- center: "center",
104
- "flex-start": "flex-start",
105
- "flex-end": "flex-end",
106
- };
29
+ @property({ type: Number })
30
+ delay = 300;
107
31
 
108
32
  protected render(): TemplateResult<1> {
109
- const align = Tooltip.aligns[this.align] || "inherit";
110
- const isFocusable = this.type === "focus";
111
33
  return html`
112
- <div
113
- part="root"
114
- ${attr(this.observedRecord)}
115
- tabindex="${isFocusable ? 0 : -1}"
116
- @focus="${isFocusable ? () => (this.open = true) : null}"
117
- @blur="${isFocusable ? () => (this.open = false) : null}"
118
- @mouseenter="${isFocusable ? null : () => (this.open = true)}"
119
- @mouseleave="${isFocusable ? null : () => (this.open = false)}"
120
- style="justify-content:${align};align-items:${align}"
121
- >
122
- ${htmlSlot()}
34
+ <div part="root">
123
35
  <div
124
- part="tip"
125
- direction-outset-place
36
+ part="trigger"
37
+ @click=${this.hide}
126
38
  >
127
- ${htmlSlot(
128
- "tip",
129
- html`
130
- <span class="passive">${this.tip}</span>
131
- `,
132
- )}
39
+ ${htmlSlot()}
40
+ </div>
41
+ <div
42
+ part="popover"
43
+ popover="manual"
44
+ >
45
+ ${htmlSlot("tip", this.tip)}
133
46
  </div>
134
47
  </div>
135
48
  `;
136
49
  }
50
+
51
+ _hoverTimeout: number;
52
+ _leaveTimeout: number;
53
+
54
+ connectedCallback(): void {
55
+ super.connectedCallback();
56
+ this.events.add(this, "mouseenter", () => {
57
+ clearTimeout(this._leaveTimeout);
58
+ this._hoverTimeout = setTimeout(() => {
59
+ this.show();
60
+ }, this.delay);
61
+ });
62
+ this.events.add(this, "mouseleave", () => {
63
+ clearTimeout(this._hoverTimeout);
64
+ this._leaveTimeout = setTimeout(() => {
65
+ this.hide();
66
+ }, this.delay);
67
+ });
68
+ }
137
69
  }
138
70
 
139
71
  export default Tooltip;
@@ -1 +1 @@
1
- {"version":1.1,"properties":[],"pseudoElements":[{"name":"::part(root)","description":"The root element."},{"name":"::part(item)","description":"The tab items."},{"name":"::part(indicator)","description":"The indicator."},{"name":"::part(selected)","description":"The selected tab item."},{"name":"::part(hover)","description":"The hovered tab item."}]}
1
+ {"version":1.1,"properties":[],"pseudoElements":[]}
@@ -1 +1 @@
1
- {"version":1.1,"tags":[{"name":"godown-typewriter","description":"Typewriter renders a typewriter effect to text.\n---\n","attributes":[{"name":"content","description":"Raw text.","values":[]},{"name":"ended","description":"If true, hide the cursor","values":[]},{"name":"max","description":"Maximum random time.","values":[]},{"name":"min","description":"Minimum random time.","values":[]},{"name":"delay","description":"Fixed time.","values":[]},{"name":"index","description":"The index at the beginning.","values":[]}],"references":[]},{"name":"godown-tooltip","description":"Tooltip provide tooltip for slot elements.\nIf it has the tip property, ignore the slot tip.\n---\n### **Slots:**\n - **tip** - Tip element if no `tip` provided.\n- _default_ - Content.","attributes":[{"name":"tip","description":"Tip text, if there is a value, the slot will be ignored.","values":[]},{"name":"direction","description":"Direction of opening the tip.","values":[{"name":"DirectionCardinal"},{"name":"DirectionCorner"}]},{"name":"align","description":"Content alignment.","values":[{"name":"center"},{"name":"flex-start"},{"name":"flex-end"},{"name":"start"},{"name":"end"}]},{"name":"propagation","description":"If true, allow penetration of the tip.","values":[]},{"name":"type","description":"How can tips be triggered.\nIf `focus`, element will be focusable, open tip when focused.\nIf `hover`, element will open tip when hovered.","values":[{"name":"hover"},{"name":"focus"}]},{"name":"open","description":"Open the content.","values":[]}],"references":[]},{"name":"godown-time","description":"Time renders a formatting time.\n---\n### **Events:**\n - **time** - Fires when the time changes.","attributes":[{"name":"escape","description":"Escape symbol.","values":[]},{"name":"format","description":"Format strings.","values":[]},{"name":"time","description":"Time.","values":[{"name":"Date"}]},{"name":"timeout","description":"If there is a value, update every gap or timeout.","values":[]},{"name":"gap","description":"The number of milliseconds that change with each update.","values":[]},{"name":"underline","values":[{"name":"none"},{"name":"hover"},{"name":"active"},{"name":"always"}]},{"name":"nowrap","values":[]},{"name":"italic","values":[]},{"name":"truncate","values":[]},{"name":"clip","values":[]}],"references":[]},{"name":"godown-text","description":"Text renders text.\n---\n","attributes":[{"name":"underline","values":[{"name":"none"},{"name":"hover"},{"name":"active"},{"name":"always"}]},{"name":"nowrap","values":[]},{"name":"italic","values":[]},{"name":"truncate","values":[]},{"name":"clip","values":[]}],"references":[]},{"name":"godown-tabs","description":"Tabs used to render a set of tabs.\nIt accepts \"tabs\" to present the sub-content.\nWhen \"useSlot\" is enabled, each item in \"tabs\" becomes a named slot with the same name as itself,\nwhile for non-slot tabs, the content is rendered as a horizontally padded string.\nWhen \"mouseenter\" and \"mouseleave\" are triggered on an individual tab, the indicator will move.\nThe moving indicator will start from the position of the item that was last entered.\nIf the pointer moves out of the root element or the element is connected to the document,\nthe starting position of the indicator will be regarded as the current selection.\nApply \"flex-direction: column\" to the tabs to arrange them vertically.\n---\n### **Events:**\n - **select** - Fires when the tab is selected.\n### **CSS Parts:**\n - **root** - The root element.\n- **item** - The tab items.\n- **indicator** - The indicator.\n- **selected** - The selected tab item.\n- **hover** - The hovered tab item.","attributes":[{"name":"ring-type","values":[{"name":"RingType"}]},{"name":"useSlot","description":"Determines whether the tabs should use a slot for their content instead of a string.","values":[]},{"name":"tabs","description":"An array of strings or slot content representing the tabs.","values":[{"name":"string[]"}]},{"name":"index","description":"The index of the currently selected tab.","values":[]}],"references":[]},{"name":"godown-switch","description":"Switch renders a switch.\n---\n### **Events:**\n - **change** - Fires when the switch is switched.","attributes":[{"name":"default","description":"Default checked state.","values":[]},{"name":"checked","description":"The current value of the switch component. Reflects the \"checked\" attribute.","values":[]},{"name":"autocomplete","values":[]},{"name":"ring-type","values":[{"name":"RingType"}]},{"name":"disabled","values":[]},{"name":"placeholder","values":[]},{"name":"name","values":[]},{"name":"value","values":[{"name":"V"}]}],"references":[]},{"name":"godown-split","description":"Split renders multiple input boxes.\nInput: will move the focus box backward until the complete input from start to end.\nDelete: will move the focus box forward until the first and no inputs for each.\n---\n### **Events:**\n - **input** - Fires when the input value changes.\n- **change** - Fires when the input value changes.\n- **focus** - Fires when the input is focused.\n- **blur** - Fires when the input is blurred.\n### **Methods:**\n ","attributes":[{"name":"len","description":"The number of input boxes.","values":[]},{"name":"index","description":"Focus index.","values":[]},{"name":"autocomplete","values":[]},{"name":"ring-type","values":[{"name":"RingType"}]},{"name":"disabled","values":[]},{"name":"placeholder","values":[]},{"name":"name","values":[]},{"name":"value","values":[{"name":"V"}]},{"name":"default","description":"default property records the default or initial value and is used to reset the input.","values":[]}],"references":[]},{"name":"godown-skeleton","description":"Skeleton renders a skeleton screen.\n---\n### **Slots:**\n - **loading** - The content if loading is true.\n- _default_ - The content if loading is false.","attributes":[],"references":[]},{"name":"godown-select","description":"Select is similar to `<select>`.\nElements with the value attribute/property can be used as options.\nThe checked attribute will be added to the selected element.\nMulti-selected state looks the same as single-selected.\nInput will filter the options.\n---\n### **Events:**\n - **input** - Fires when the input value changes.\n- **change** - Fires when the input value changes.\n- **select** - Fires when select an option.\n### **Slots:**\n - _default_ - Options.","attributes":[{"name":"text","description":"Selected texts.","values":[]},{"name":"direction","values":[{"name":"DirectionCardinalY"}]},{"name":"multiple","values":[]},{"name":"visible","values":[]},{"name":"type","values":[{"name":"InputType"}]},{"name":"variant","description":"If outline, the outline is always present.","values":[{"name":"default"},{"name":"outline"}]},{"name":"autocomplete","values":[]},{"name":"ring-type","values":[{"name":"RingType"}]},{"name":"disabled","values":[]},{"name":"placeholder","values":[]},{"name":"name","values":[]},{"name":"value","values":[{"name":"V"}]},{"name":"default","description":"default property records the default or initial value and is used to reset the input.","values":[]}],"references":[]},{"name":"godown-router","description":"Router has basic routing control.\nTo switch routes, use `router-link component`.\nIt has two methods to collect routes.\n1. From field `routes`, an array, each elements require \"path\".\n2. From child elements, which have the slot attribute for matching routes.\nIf only the method 1 is used, set `type` to `\"field\"`.\nIf only the method 2 is used, set `type` to `\"slotted\"`.\n`type` defaults to `\"united\"`, which will try method 1, then method 2.\nIf no routes are matched, the default value (no named slot) will be rendered.\n---\n### **Methods:**\n - **fieldComponent(query: _string_): _unknown_** - Get component from routes by query.\n- **slottedComponent(query: _string_): _TemplateResult<1>_** - Get component from slotted elements by query.\n- **collectSlottedRoutes(): _void_** - Reset the route tree, clear cache, collect routes from child elements.\n- **collectFieldRoutes(value: _typeof this.routes_): _void_** - Reset the route tree, clear cache, collect routes from value.\n### **Slots:**\n - _default_ - Display slot when there is no match.\n- ***** - Matching slot will be displayed.","attributes":[{"name":"pathname","description":"Current pathname (equals to location.pathname).","values":[]},{"name":"type","description":"The type of routing sources.\nIf field, it won't collect the slot attribute of the child elements.\nThis property should not be changed after the rendering is complete.","values":[{"name":"RouterType"}]},{"name":"cache","description":"Cache accessed records.\nEmptied at each re-collection.","values":[]}],"references":[]},{"name":"godown-rotate","description":"Rotate Make child elements rotate.\n---\n### **Methods:**\n ","attributes":[],"references":[]},{"name":"godown-range","description":"Range is similar to `<input type=\"range\">`.\nValue accepts number, or array.\nNumber has 1 handle, the array has the number of its elements.\n---\n### **Events:**\n - **range** - Fires when the value changes.\n### **Methods:**\n - **padValue(len: _number_, value): _number[]_** - Pad the value to the specified length.\n- **focusHandle(index: _number_): _void_** - Focuses the handle at the given index, updates the focus stack.\n- **blurHandle(): _void_** - Removes the focus from the currently focused handle.\n","attributes":[{"name":"min","description":"Minimum value.","values":[]},{"name":"max","description":"Maximum value.","values":[]},{"name":"step","description":"Sliding step length.","values":[]},{"name":"vertical","description":"Whether to display the range vertically.","values":[]},{"name":"value","description":"Value, or each of values, will render a handle.\nAccepts number or array of numbers.","values":[{"name":"V"}]},{"name":"default","description":"The default of `this.value`.","values":[]},{"name":"autocomplete","values":[]},{"name":"ring-type","values":[{"name":"RingType"}]},{"name":"disabled","values":[]},{"name":"placeholder","values":[]},{"name":"name","values":[]}],"references":[]},{"name":"godown-progress","description":"Progress similar to `<progress>`.\n---\n","attributes":[{"name":"max","values":[]},{"name":"min","values":[]},{"name":"value","values":[]}],"references":[]},{"name":"godown-link","description":"Link is used for link jumping, works standalone or in Router.\nSet `type` to `\"normal\"`,\nbehave like a normal anchor.\nSet `type` to `\"push\" `or `\"replace\"`,\nupdate history state by `history.pushState` or `history.replaceState`,\nupdate all routers whether current pathname is registered or not.\nSet `type` to `\"auto\"`,\nonly update the routers if the current pathname is registered,\nif not registered, behave like `\"normal\"`.\n`replace` property will enforce `history.replaceState`.\n---\n### **Events:**\n - **navigate** - Fires when the link is clicked.","attributes":[{"name":"type","description":"If `\"normal\"`, behave like a normal anchor.\nIf `\"auto\"` or `\"push\"`, call `history.pushState` if `replace` is false,\nIf `\"replace\"`, call `history.replaceState`.","values":[{"name":"LinkType"}]},{"name":"suppress","description":"If `true`, the Router will not be updated.","values":[]},{"name":"replace","description":"Use `replaceState` instead of `pushState`.","values":[]},{"name":"href","description":"A element href.","values":[]},{"name":"target","description":"A element target.","values":[{"name":"_blank"},{"name":"_self"},{"name":"_parent"},{"name":"_top"}]}],"references":[]},{"name":"godown-layout","description":"Layout renders main content, top header, bottom footer.\nIf `sticky` is set to `true`, the header will be sticky.\nMain content will take up the remaining space.\nElement display should be `(inline-)flex` or `(inline-)grid`.\n---\n### **Slots:**\n - _default_ - The main content of the layout.\n- **header** - The header of the layout.\n- **footer** - The footer of the layout.","attributes":[{"name":"sticky","description":"If `true`, header will sticky.","values":[]}],"references":[]},{"name":"godown-input","description":"Input renders a input.\n---\n### **Events:**\n - **input** - Fires when the input value changes.\n- **change** - Fires when the input value changes.","attributes":[{"name":"type","values":[{"name":"InputType"}]},{"name":"variant","description":"If outline, the outline is always present.","values":[{"name":"default"},{"name":"outline"}]},{"name":"autocomplete","values":[]},{"name":"ring-type","values":[{"name":"RingType"}]},{"name":"disabled","values":[]},{"name":"placeholder","values":[]},{"name":"name","values":[]},{"name":"value","values":[{"name":"V"}]},{"name":"default","description":"default property records the default or initial value and is used to reset the input.","values":[]}],"references":[]},{"name":"godown-heading","description":"Heading renders a heading.\nIf the id is provided, the anchor will be displayed.\n---\n### **Events:**\n - **navigate** - Fires when the link is clicked.\n### **Slots:**\n - _default_ - Heading content.","attributes":[{"name":"as","description":"The heading level.","values":[{"name":"h1"},{"name":"h2"},{"name":"h3"},{"name":"h4"},{"name":"h5"},{"name":"h6"}]},{"name":"anchor","description":"The anchor prefix.\nElement must have an id to be displayed.","values":[]},{"name":"side","description":"The anchor side.","values":[{"name":"left"},{"name":"right"}]},{"name":"type","description":"If `\"normal\"`, behave like a normal anchor.\nIf `\"auto\"` or `\"push\"`, call `history.pushState` if `replace` is false,\nIf `\"replace\"`, call `history.replaceState`.","values":[{"name":"LinkType"}]},{"name":"suppress","description":"If `true`, the Router will not be updated.","values":[]},{"name":"replace","description":"Use `replaceState` instead of `pushState`.","values":[]},{"name":"href","description":"A element href.","values":[]},{"name":"target","description":"A element target.","values":[{"name":"_blank"},{"name":"_self"},{"name":"_parent"},{"name":"_top"}]}],"references":[]},{"name":"godown-grid","description":"Grid provides gird layout.\n---\n### **Slots:**\n - _default_ - Grid items.","attributes":[{"name":"gap","description":"CSS property `gap`.","values":[]},{"name":"columns","description":"CSS property `grid-template-columns`.\nIf columns is numerical, divide columns equally.","values":[]},{"name":"rows","description":"CSS property `grid-template-rows`.\nIf rows is numerical, divide rows equally.","values":[]},{"name":"content","description":"CSS property `place-content` (`align-content justify-content`).","values":[]},{"name":"items","description":"CSS property `place-items` (`align-items justify-items`).","values":[]}],"references":[]},{"name":"godown-form","description":"Form Gets child element key-value object,\nwhich will be nested if the child element is the same as this element.\n---\n","attributes":[{"name":"name","values":[]}],"references":[]},{"name":"godown-flex","description":"Flex provides flex layout.\n---\n### **Slots:**\n - _default_ - Flex items.","attributes":[{"name":"flex-flow","description":"CSS property `flex-flow` (`flex-direction flex-wrap`).","values":[]},{"name":"gap","description":"CSS property `gap`.","values":[]},{"name":"content","description":"CSS property `justify-content`.","values":[]},{"name":"items","description":"CSS property `align-items`.","values":[]},{"name":"vertical","description":"If true, set flex-direction to \"column\".","values":[]}],"references":[]},{"name":"godown-dragbox","description":"Dragbox moves with the mouse and does not exceed the boundary of offsetParent.\n---\n### **Slots:**\n - _default_ - Dragbox content.","attributes":[{"name":"x","description":"Position x.","values":[]},{"name":"y","description":"Position y.","values":[]}],"references":[]},{"name":"godown-divider","description":"Divider similar to `<hr>`.\n---\n","attributes":[{"name":"vertical","description":"Whether to display the divider vertically.","values":[]}],"references":[]},{"name":"godown-dialog","description":"Dialog similar to `<dialog>`.\nLike dialog, it listens for submit events and closes itself when the target method is \"dialog\".\nIt listens for the keydown event and also closes itself when the key contained in the key is pressed.\n---\n### **Events:**\n - **change** - Fires when the open changes.","attributes":[{"name":"modal","description":"Indicates whether the dialog should be displayed as a modal.","values":[]},{"name":"key","description":"The keys will close the dialog when pressed.","values":[]},{"name":"open","description":"Open the content.","values":[]}],"references":[]},{"name":"godown-details","description":"Details similar to `<details>`.\n---\n### **Events:**\n - **change** - Fires when the open changes.\n### **Slots:**\n - **summary** - Details summary if no `summary` is provided.\n- _default_ - Details content.","attributes":[{"name":"float","description":"Determines whether the details component should float.","values":[]},{"name":"fill","description":"Determines whether the details component should fill the available space.","values":[]},{"name":"summary","description":"The summary text to display in the details component.","values":[]},{"name":"open","description":"Open the content.","values":[]}],"references":[]},{"name":"godown-chip","description":"Chip renders a chip.\n---\n### **Slots:**\n - _default_ - Chip content.","attributes":[{"name":"position","description":"The position of the chip relative to its parent element.\nPossible values are `\"top-left\"`, `\"top-right\"`, `\"bottom-left\"`, and `\"bottom-right\"`.","values":[{"name":"DirectionCorner"}]},{"name":"value","values":[]},{"name":"dot","description":"If `true`, render a dot chip.","values":[]},{"name":"max","description":"The maximum value that can be displayed in the chip\nValues greater than this will be displayed as `max+` by default.","values":[]}],"references":[]},{"name":"godown-carousel","description":"Carousel make the content display as a carousel.\nWhen this component is `firstUpdated`,\nclone the first and last element and make the matching element visible when switching index.\n---\n### **Events:**\n - **change** - Fires when the index changes.\n### **Slots:**\n - _default_ - Carousel items, should maintain the same size.","attributes":[{"name":"index","description":"The index of the current item.","values":[]},{"name":"autoChange","description":"The duration of the transition.","values":[]}],"references":[]},{"name":"godown-card","description":"Card renders a card.\nThis may be similar to Layout,\nbut it needs to be specified to enable header and footer.\n---\n### **Slots:**\n - _default_ - The main content of the card.\n- **header** - The header of the card.\n- **footer** - The footer of the card.","attributes":[{"name":"ring-type","values":[{"name":"RingType"}]},{"name":"footer","description":"Whether to display the header.","values":[]},{"name":"header","description":"Whether to display the footer.","values":[]}],"references":[]},{"name":"godown-button","description":"Button renders a button.\nCreate modal animation upon clicking.\n---\n### **Slots:**\n - _default_ - The content of the button.","attributes":[{"name":"plain","description":"If true, remove gradient, modal animation, focus scale.","values":[]},{"name":"disabled","description":"Whether this element is disabled or not.","values":[]},{"name":"active","description":"Whether this element is active or not.","values":[]},{"name":"round","description":"Display rounded.","values":[]},{"name":"content","description":"Content text.","values":[]}],"references":[]},{"name":"godown-breath","description":"Breath render the text with a breathing effect.\nDynamically generate a breathing effect based on the length of the split text.\nIf there is not enough CSS variable, overrun elements will use the.\ngodown was a css library in its earliest days,\nand this is the component version of its first effect.\nInspired by Vercel home page (2023).\n---\n### **Slots:**\n - _default_ - Breathing parts.","attributes":[{"name":"content","description":"Strings or array of strings,\nif array, divided each element into chunks,\notherwise split strings by whitespace.","values":[{"name":"string[]"}]},{"name":"duration","description":"Effect duration.","values":[]}],"references":[]},{"name":"godown-badge","description":"Badge renders a badge.\n---\n### **Slots:**\n - _default_ - Badge content.","attributes":[{"name":"plain","description":"If true, remove gradient, modal animation, focus scale.","values":[]},{"name":"disabled","description":"Whether this element is disabled or not.","values":[]},{"name":"active","description":"Whether this element is active or not.","values":[]},{"name":"round","description":"Display rounded.","values":[]},{"name":"content","description":"Content text.","values":[]}],"references":[]},{"name":"godown-avatar","description":"Avatar renders a avatar.\nRenders as an image if it has a src property,\notherwise falls back to name or nameless slot.\n---\n### **Slots:**\n - _default_ - Display content if no `src` or `name` provided.","attributes":[{"name":"src","description":"The `src` property specifies the URL of the avatar image.\nIf `src` is not provided, the component will display the `name` property instead.","values":[]},{"name":"name","description":"Specifies the name or initials to display if no `src` is provided","values":[]},{"name":"round","description":"If `true`, will make the avatar display as a circle.","values":[]}],"references":[]},{"name":"godown-alert","description":"Alert renders a alert.\n---\n### **Slots:**\n - _default_ - Alert content.\n- **title** - Alert title.\n- **prefix** - Alert prefix.\n- **suffix** - Alert suffix.","attributes":[{"name":"ring-type","values":[{"name":"RingType"}]},{"name":"title","description":"The title is bold and the icon height is the same as it.","values":[]},{"name":"content","description":"Content, if zero value, will be rendered as an unnamed slot.","values":[]}],"references":[]}]}
1
+ {"version":1.1,"tags":[{"name":"godown-typewriter","description":"Typewriter renders a typewriter effect to text.\n---\n","attributes":[{"name":"content","description":"Raw text.","values":[]},{"name":"ended","description":"If true, hide the cursor","values":[]},{"name":"max","description":"Maximum random time.","values":[]},{"name":"min","description":"Minimum random time.","values":[]},{"name":"delay","description":"Fixed time.","values":[]},{"name":"index","description":"The index at the beginning.","values":[]}],"references":[]},{"name":"godown-tooltip","description":"Tooltip is similar to Popover.\nIt listens for the mouseenter event and displays the tip or popover after a specified delay.\nWhen it is clicked or the mouseleave event occurs followed by another delay, closes the tip.\n---\n### **Events:**\n - **toggle** - Fired when the popover is toggled.\n### **Slots:**\n - **tip** - Tip content.\n- _default_ - Tip trigger.\n- **popover** - Popover content.","attributes":[{"name":"tip","values":[]},{"name":"delay","values":[]},{"name":"open","values":[]},{"name":"action","values":[{"name":"hide"},{"name":"show"},{"name":"toggle"},{"name":"none"}]},{"name":"span","values":[{"name":"span"},{"name":"spread"},{"name":"isolated"}]},{"name":"position","description":"The position refers to the spatial location of the popover in relation to the trigger,\nrather than the alignment property between them.","values":[{"name":""},{"name":"center"},{"name":"left"},{"name":"left-top"},{"name":"left-bottom"},{"name":"right"},{"name":"right-top"},{"name":"right-bottom"},{"name":"top"},{"name":"top-left"},{"name":"top-right"},{"name":"bottom"},{"name":"bottom-left"},{"name":"bottom-right"},{"name":"start"},{"name":"start-start"},{"name":"start-end"},{"name":"end"},{"name":"end-start"},{"name":"end-end"}]}],"references":[]},{"name":"godown-time","description":"Time renders a formatting time.\n---\n### **Events:**\n - **time** - Fires when the time changes.","attributes":[{"name":"escape","description":"Escape symbol.","values":[]},{"name":"format","description":"Format strings.","values":[]},{"name":"time","description":"Time.","values":[{"name":"Date"}]},{"name":"timeout","description":"If there is a value, update every gap or timeout.","values":[]},{"name":"gap","description":"The number of milliseconds that change with each update.","values":[]},{"name":"underline","values":[{"name":"none"},{"name":"hover"},{"name":"active"},{"name":"always"}]},{"name":"nowrap","values":[]},{"name":"italic","values":[]},{"name":"truncate","values":[]},{"name":"clip","values":[]}],"references":[]},{"name":"godown-text","description":"Text renders text.\n---\n","attributes":[{"name":"underline","values":[{"name":"none"},{"name":"hover"},{"name":"active"},{"name":"always"}]},{"name":"nowrap","values":[]},{"name":"italic","values":[]},{"name":"truncate","values":[]},{"name":"clip","values":[]}],"references":[]},{"name":"godown-tabs","description":"Tabs used to render a set of tabs.\n---\n### **Events:**\n - **select** - Fires when the tab index is changed.","attributes":[{"name":"ringType","values":[{"name":"RingType"}]},{"name":"beginning","description":"If it is \"select\", the indicator moves from the selected content to the hover position.\nIf it is \"previous\", the indicator moves from the last moved position to the hover position.\nIf \"none\", the indicator will not move.","values":[{"name":"selected"},{"name":"previous"},{"name":"none"}]},{"name":"indicator","description":"The behavior of the indicator:\nIf \"background\", its size will be consistent with that of a single tab.\nIf \"underline\", an underline will be displayed at the bottom of the tab.","values":[{"name":"background"},{"name":"underline"}]},{"name":"tabs","description":"Tab list or slot list.","values":[{"name":"string[]"}]},{"name":"index","description":"The index of the currently selected tab.","values":[]}],"references":[]},{"name":"godown-switch","description":"Switch renders a switch.\n---\n### **Events:**\n - **change** - Fires when the switch is switched.","attributes":[{"name":"default","description":"Default checked state.","values":[]},{"name":"checked","description":"The current value of the switch component. Reflects the \"checked\" attribute.","values":[]},{"name":"autocomplete","values":[]},{"name":"ringType","values":[{"name":"RingType"}]},{"name":"disabled","values":[]},{"name":"placeholder","values":[]},{"name":"name","values":[]},{"name":"value","values":[{"name":"V"}]}],"references":[]},{"name":"godown-split","description":"Split renders multiple input boxes.\nInput: will move the focus box backward until the complete input from start to end.\nDelete: will move the focus box forward until the first and no inputs for each.\n---\n### **Events:**\n - **input** - Fires when the input value changes.\n- **change** - Fires when the input value changes.\n- **focus** - Fires when the input is focused.\n- **blur** - Fires when the input is blurred.\n### **Methods:**\n ","attributes":[{"name":"len","description":"The number of input boxes.","values":[]},{"name":"index","description":"Focus index.","values":[]},{"name":"autocomplete","values":[]},{"name":"ringType","values":[{"name":"RingType"}]},{"name":"disabled","values":[]},{"name":"placeholder","values":[]},{"name":"name","values":[]},{"name":"value","values":[{"name":"V"}]},{"name":"default","description":"default property records the default or initial value and is used to reset the input.","values":[]}],"references":[]},{"name":"godown-skeleton","description":"Skeleton renders a skeleton screen.\n---\n### **Slots:**\n - **loading** - The content if loading is true.\n- _default_ - The content if loading is false.","attributes":[],"references":[]},{"name":"godown-select","description":"Select is similar to `<select>`.\n---\n### **Events:**\n - **input** - Fires when the input value changes.\n- **change** - Fires when the input value changes.\n- **select** - Fires when select an option.\n### **Slots:**\n - _default_ - Options.","attributes":[{"name":"text","values":[]},{"name":"multiple","values":[]},{"name":"noEdit","values":[]},{"name":"values","values":[{"name":"{\n value: string;\n label?: string;\n }[]"}]},{"name":"type","values":[{"name":"InputType"}]},{"name":"variant","description":"If outline, the outline is always present.","values":[{"name":"default"},{"name":"outline"}]},{"name":"autocomplete","values":[]},{"name":"ringType","values":[{"name":"RingType"}]},{"name":"disabled","values":[]},{"name":"placeholder","values":[]},{"name":"name","values":[]},{"name":"value","values":[{"name":"V"}]},{"name":"default","description":"default property records the default or initial value and is used to reset the input.","values":[]}],"references":[]},{"name":"godown-router","description":"Router has basic routing control.\nTo switch routes, use `router-link component`.\nIt has two methods to collect routes.\n1. From field `routes`, an array, each elements require \"path\".\n2. From child elements, which have the slot attribute for matching routes.\nIf only the method 1 is used, set `type` to `\"field\"`.\nIf only the method 2 is used, set `type` to `\"slotted\"`.\n`type` defaults to `\"united\"`, which will try method 1, then method 2.\nIf no routes are matched, the default value (no named slot) will be rendered.\n---\n### **Methods:**\n - **fieldComponent(query: _string_): _unknown_** - Get component from routes by query.\n- **slottedComponent(query: _string_): _TemplateResult<1>_** - Get component from slotted elements by query.\n- **collectSlottedRoutes(): _void_** - Reset the route tree, clear cache, collect routes from child elements.\n- **collectFieldRoutes(value: _typeof this.routes_): _void_** - Reset the route tree, clear cache, collect routes from value.\n### **Slots:**\n - _default_ - Display slot when there is no match.\n- ***** - Matching slot will be displayed.","attributes":[{"name":"pathname","description":"Current pathname (equals to location.pathname).","values":[]},{"name":"type","description":"The type of routing sources.\nIf field, it won't collect the slot attribute of the child elements.\nThis property should not be changed after the rendering is complete.","values":[{"name":"RouterType"}]},{"name":"cache","description":"Cache accessed records.\nEmptied at each re-collection.","values":[]}],"references":[]},{"name":"godown-rotate","description":"Rotate Make child elements rotate.\n---\n### **Methods:**\n ","attributes":[],"references":[]},{"name":"godown-range","description":"Range is similar to `<input type=\"range\">`.\nValue accepts number, or array.\nNumber has 1 handle, the array has the number of its elements.\n---\n### **Events:**\n - **range** - Fires when the value changes.\n### **Methods:**\n - **padValue(len: _number_, value): _number[]_** - Pad the value to the specified length.\n- **focusHandle(index: _number_): _void_** - Focuses the handle at the given index, updates the focus stack.\n- **blurHandle(): _void_** - Removes the focus from the currently focused handle.\n","attributes":[{"name":"min","description":"Minimum value.","values":[]},{"name":"max","description":"Maximum value.","values":[]},{"name":"step","description":"Sliding step length.","values":[]},{"name":"vertical","description":"Whether to display the range vertically.","values":[]},{"name":"value","description":"Value, or each of values, will render a handle.\nAccepts number or array of numbers.","values":[{"name":"V"}]},{"name":"default","description":"The default of `this.value`.","values":[]},{"name":"autocomplete","values":[]},{"name":"ringType","values":[{"name":"RingType"}]},{"name":"disabled","values":[]},{"name":"placeholder","values":[]},{"name":"name","values":[]}],"references":[]},{"name":"godown-progress","description":"Progress similar to `<progress>`.\n---\n","attributes":[{"name":"max","values":[]},{"name":"min","values":[]},{"name":"value","values":[]}],"references":[]},{"name":"godown-popover","description":"Popover renders a popover.\nThis requires the support of the popover API and CSS position-area.\n---\n### **Events:**\n - **toggle** - Fired when the popover is toggled.\n### **Slots:**\n - **popover** - Popover content.\n- _default_ - Popover trigger.","attributes":[{"name":"open","values":[]},{"name":"action","values":[{"name":"hide"},{"name":"show"},{"name":"toggle"},{"name":"none"}]},{"name":"span","values":[{"name":"span"},{"name":"spread"},{"name":"isolated"}]},{"name":"position","description":"The position refers to the spatial location of the popover in relation to the trigger,\nrather than the alignment property between them.","values":[{"name":""},{"name":"center"},{"name":"left"},{"name":"left-top"},{"name":"left-bottom"},{"name":"right"},{"name":"right-top"},{"name":"right-bottom"},{"name":"top"},{"name":"top-left"},{"name":"top-right"},{"name":"bottom"},{"name":"bottom-left"},{"name":"bottom-right"},{"name":"start"},{"name":"start-start"},{"name":"start-end"},{"name":"end"},{"name":"end-start"},{"name":"end-end"}]}],"references":[]},{"name":"godown-link","description":"Link is used for link jumping, works standalone or in Router.\nSet `type` to `\"normal\"`,\nbehave like a normal anchor.\nSet `type` to `\"push\" `or `\"replace\"`,\nupdate history state by `history.pushState` or `history.replaceState`,\nupdate all routers whether current pathname is registered or not.\nSet `type` to `\"auto\"`,\nonly update the routers if the current pathname is registered,\nif not registered, behave like `\"normal\"`.\n`replace` property will enforce `history.replaceState`.\n---\n### **Events:**\n - **navigate** - Fires when the link is clicked.","attributes":[{"name":"type","description":"If `\"normal\"`, behave like a normal anchor.\nIf `\"auto\"` or `\"push\"`, call `history.pushState` if `replace` is false,\nIf `\"replace\"`, call `history.replaceState`.","values":[{"name":"LinkType"}]},{"name":"suppress","description":"If `true`, the Router will not be updated.","values":[]},{"name":"replace","description":"Use `replaceState` instead of `pushState`.","values":[]},{"name":"href","description":"A element href.","values":[]},{"name":"target","description":"A element target.","values":[{"name":"_blank"},{"name":"_self"},{"name":"_parent"},{"name":"_top"}]}],"references":[]},{"name":"godown-layout","description":"Layout renders main content, top header, bottom footer.\nIf `sticky` is set to `true`, the header will be sticky.\nMain content will take up the remaining space.\nElement display should be `(inline-)flex` or `(inline-)grid`.\n---\n### **Slots:**\n - _default_ - The main content of the layout.\n- **header** - The header of the layout.\n- **footer** - The footer of the layout.","attributes":[{"name":"sticky","description":"If `true`, header will sticky.","values":[]}],"references":[]},{"name":"godown-input","description":"Input renders a input.\n---\n### **Events:**\n - **input** - Fires when the input value changes.\n- **change** - Fires when the input value changes.","attributes":[{"name":"type","values":[{"name":"InputType"}]},{"name":"variant","description":"If outline, the outline is always present.","values":[{"name":"default"},{"name":"outline"}]},{"name":"autocomplete","values":[]},{"name":"ringType","values":[{"name":"RingType"}]},{"name":"disabled","values":[]},{"name":"placeholder","values":[]},{"name":"name","values":[]},{"name":"value","values":[{"name":"V"}]},{"name":"default","description":"default property records the default or initial value and is used to reset the input.","values":[]}],"references":[]},{"name":"godown-heading","description":"Heading renders a heading.\nIf the id is provided, the anchor will be displayed.\n---\n### **Events:**\n - **navigate** - Fires when the link is clicked.\n### **Slots:**\n - _default_ - Heading content.","attributes":[{"name":"as","description":"The heading level.","values":[{"name":"h1"},{"name":"h2"},{"name":"h3"},{"name":"h4"},{"name":"h5"},{"name":"h6"}]},{"name":"anchor","description":"The anchor prefix.\nElement must have an id to be displayed.","values":[]},{"name":"side","description":"The anchor side.","values":[{"name":"left"},{"name":"right"}]},{"name":"type","description":"If `\"normal\"`, behave like a normal anchor.\nIf `\"auto\"` or `\"push\"`, call `history.pushState` if `replace` is false,\nIf `\"replace\"`, call `history.replaceState`.","values":[{"name":"LinkType"}]},{"name":"suppress","description":"If `true`, the Router will not be updated.","values":[]},{"name":"replace","description":"Use `replaceState` instead of `pushState`.","values":[]},{"name":"href","description":"A element href.","values":[]},{"name":"target","description":"A element target.","values":[{"name":"_blank"},{"name":"_self"},{"name":"_parent"},{"name":"_top"}]}],"references":[]},{"name":"godown-grid","description":"Grid provides gird layout.\n---\n### **Slots:**\n - _default_ - Grid items.","attributes":[{"name":"gap","description":"CSS property `gap`.","values":[]},{"name":"columns","description":"CSS property `grid-template-columns`.\nIf columns is numerical, divide columns equally.","values":[]},{"name":"rows","description":"CSS property `grid-template-rows`.\nIf rows is numerical, divide rows equally.","values":[]},{"name":"content","description":"CSS property `place-content` (`align-content justify-content`).","values":[]},{"name":"items","description":"CSS property `place-items` (`align-items justify-items`).","values":[]}],"references":[]},{"name":"godown-form","description":"Form Gets child element key-value object,\nwhich will be nested if the child element is the same as this element.\n---\n","attributes":[{"name":"name","values":[]}],"references":[]},{"name":"godown-flex","description":"Flex provides flex layout.\n---\n### **Slots:**\n - _default_ - Flex items.","attributes":[{"name":"flex-flow","description":"CSS property `flex-flow` (`flex-direction flex-wrap`).","values":[]},{"name":"gap","description":"CSS property `gap`.","values":[]},{"name":"content","description":"CSS property `justify-content`.","values":[]},{"name":"items","description":"CSS property `align-items`.","values":[]},{"name":"vertical","description":"If true, set flex-direction to \"column\".","values":[]}],"references":[]},{"name":"godown-dragbox","description":"Dragbox moves with the mouse and does not exceed the boundary of offsetParent.\n---\n### **Slots:**\n - _default_ - Dragbox content.","attributes":[{"name":"x","description":"Position x.","values":[]},{"name":"y","description":"Position y.","values":[]}],"references":[]},{"name":"godown-divider","description":"Divider similar to `<hr>`.\n---\n","attributes":[{"name":"vertical","description":"Whether to display the divider vertically.","values":[]}],"references":[]},{"name":"godown-dialog","description":"Dialog similar to `<dialog>`.\nLike dialog, it listens for submit events and closes itself when the target method is \"dialog\".\nPrevious versions of Dialog did not contain triggers.\nTherefore, unlike Tooltip which uses the default slot as the trigger.\nDialog needs to use slot=\"trigger\" as the trigger instead of an element without a slot name.\n---\n### **Events:**\n - **change** - Fires when the open changes.\n### **Slots:**\n - **trigger** - The trigger element.\n- _default_ - The dialog content.","attributes":[{"name":"open","values":[]},{"name":"modal","values":[]}],"references":[]},{"name":"godown-details","description":"Details similar to `<details>`.\n---\n### **Events:**\n - **change** - Fires when the open changes.\n### **Slots:**\n - **summary** - Details summary (trigger).\n- _default_ - Details content.","attributes":[{"name":"open","values":[]},{"name":"float","values":[]},{"name":"fill","values":[]},{"name":"summary","values":[]}],"references":[]},{"name":"godown-chip","description":"Chip renders a chip.\n---\n### **Slots:**\n - _default_ - Chip content.","attributes":[{"name":"position","description":"The position of the chip relative to its parent element.","values":[{"name":"top-left"},{"name":"top-right"},{"name":"bottom-left"},{"name":"bottom-right"}]},{"name":"value","values":[]},{"name":"dot","description":"If `true`, render a dot chip.","values":[]},{"name":"max","description":"The maximum value that can be displayed in the chip\nValues greater than this will be displayed as `max+` by default.","values":[]}],"references":[]},{"name":"godown-carousel","description":"Carousel make the content display as a carousel.\nWhen this component is `firstUpdated`,\nclone the first and last element and make the matching element visible when switching index.\n---\n### **Events:**\n - **change** - Fires when the index changes.\n### **Slots:**\n - _default_ - Carousel items, should maintain the same size.","attributes":[{"name":"index","description":"The index of the current item.","values":[]},{"name":"autoChange","description":"The duration of the transition.","values":[]}],"references":[]},{"name":"godown-card","description":"Card renders a card.\nThis may be similar to Layout,\nbut it needs to be specified to enable header and footer.\n---\n### **Slots:**\n - _default_ - The main content of the card.\n- **header** - The header of the card.\n- **footer** - The footer of the card.","attributes":[{"name":"ringType","values":[{"name":"RingType"}]},{"name":"footer","description":"Whether to display the header.","values":[]},{"name":"header","description":"Whether to display the footer.","values":[]}],"references":[]},{"name":"godown-button","description":"Button renders a button.\nCreate modal animation upon clicking.\n---\n### **Slots:**\n - _default_ - The content of the button.","attributes":[{"name":"plain","description":"If true, remove gradient, modal animation, focus scale.","values":[]},{"name":"disabled","description":"Whether this element is disabled or not.","values":[]},{"name":"active","description":"Whether this element is active or not.","values":[]},{"name":"round","description":"Display rounded.","values":[]},{"name":"content","description":"Content text.","values":[]}],"references":[]},{"name":"godown-breath","description":"Breath render the text with a breathing effect.\nDynamically generate a breathing effect based on the length of the split text.\nIf there is not enough CSS variable, overrun elements will use the.\ngodown was a css library in its earliest days,\nand this is the component version of its first effect.\nInspired by Vercel home page (2023).\n---\n### **Slots:**\n - _default_ - Breathing parts.","attributes":[{"name":"content","description":"Strings or array of strings,\nif array, divided each element into chunks,\notherwise split strings by whitespace.","values":[{"name":"string[]"}]},{"name":"duration","description":"Effect duration.","values":[]}],"references":[]},{"name":"godown-badge","description":"Badge renders a badge.\n---\n### **Slots:**\n - _default_ - Badge content.","attributes":[{"name":"plain","description":"If true, remove gradient, modal animation, focus scale.","values":[]},{"name":"disabled","description":"Whether this element is disabled or not.","values":[]},{"name":"active","description":"Whether this element is active or not.","values":[]},{"name":"round","description":"Display rounded.","values":[]},{"name":"content","description":"Content text.","values":[]}],"references":[]},{"name":"godown-avatar","description":"Avatar renders a avatar.\nRenders as an image if it has a src property,\notherwise falls back to name or nameless slot.\n---\n### **Slots:**\n - _default_ - Display content if no `src` or `name` provided.","attributes":[{"name":"src","description":"The `src` property specifies the URL of the avatar image.\nIf `src` is not provided, the component will display the `name` property instead.","values":[]},{"name":"name","description":"Specifies the name or initials to display if no `src` is provided","values":[]},{"name":"round","description":"If `true`, will make the avatar display as a circle.","values":[]}],"references":[]},{"name":"godown-alert","description":"Alert renders a alert.\n---\n### **Slots:**\n - _default_ - Alert content.\n- **title** - Alert title.\n- **prefix** - Alert prefix.\n- **suffix** - Alert suffix.","attributes":[{"name":"ringType","values":[{"name":"RingType"}]},{"name":"title","description":"The title is bold and the icon height is the same as it.","values":[]},{"name":"content","description":"Content, if zero value, will be rendered as an unnamed slot.","values":[]}],"references":[]}]}
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/alert/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAiB,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIpE;;;;;;;;GAQG;AACH,cAuBM,KAAM,SAAQ,WAAW;;IAO7B,QAAQ,EAAE,QAAQ,CAAY;IAE9B;;OAEG;IAEH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IAEH,OAAO,EAAE,MAAM,CAAC;IAEhB,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAgBrC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK;CAM/D;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/alert/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAiB,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIvF;;;;;;;;GAQG;AACH,cAmBM,KAAM,SAAQ,WAAW;;IAO7B,QAAQ,EAAE,QAAQ,CAAY;IAE9B;;OAEG;IAEH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IAEH,OAAO,EAAE,MAAM,CAAC;IAEhB,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAarC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK;CAM/D;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}