@svadmin/lite 0.17.0 → 0.22.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 (226) hide show
  1. package/README.md +71 -2
  2. package/dist/components/LiteActivityFeed.svelte +24 -2
  3. package/dist/components/LiteActivityFeed.svelte.d.ts +6 -0
  4. package/dist/components/LiteAffix.svelte +29 -0
  5. package/dist/components/LiteAffix.svelte.d.ts +13 -0
  6. package/dist/components/LiteAnchor.svelte +38 -0
  7. package/dist/components/LiteAnchor.svelte.d.ts +14 -0
  8. package/dist/components/LiteApprovalActionCard.svelte +4 -1
  9. package/dist/components/LiteApprovalActionCard.svelte.d.ts +2 -0
  10. package/dist/components/LiteAutoComplete.svelte +41 -0
  11. package/dist/components/LiteAutoComplete.svelte.d.ts +13 -0
  12. package/dist/components/LiteBackTop.svelte +16 -0
  13. package/dist/components/LiteBackTop.svelte.d.ts +8 -0
  14. package/dist/components/LiteBreadcrumbs.svelte +4 -1
  15. package/dist/components/LiteBreadcrumbs.svelte.d.ts +2 -0
  16. package/dist/components/LiteCalendar.svelte +124 -0
  17. package/dist/components/LiteCalendar.svelte.d.ts +20 -0
  18. package/dist/components/LiteCarousel.svelte +72 -0
  19. package/dist/components/LiteCarousel.svelte.d.ts +14 -0
  20. package/dist/components/LiteCollapse.svelte +49 -0
  21. package/dist/components/LiteCollapse.svelte.d.ts +15 -0
  22. package/dist/components/LiteColumnHeaderFilter.svelte +4 -1
  23. package/dist/components/LiteColumnHeaderFilter.svelte.d.ts +2 -0
  24. package/dist/components/LiteColumnSettings.svelte +4 -1
  25. package/dist/components/LiteColumnSettings.svelte.d.ts +2 -0
  26. package/dist/components/LiteCommentThread.svelte +113 -0
  27. package/dist/components/LiteCommentThread.svelte.d.ts +26 -0
  28. package/dist/components/LiteCountdown.svelte +49 -0
  29. package/dist/components/LiteCountdown.svelte.d.ts +10 -0
  30. package/dist/components/LiteDetailDrawer.svelte +45 -0
  31. package/dist/components/LiteDetailDrawer.svelte.d.ts +14 -0
  32. package/dist/components/LiteDraggableRowTable.svelte +4 -1
  33. package/dist/components/LiteDraggableRowTable.svelte.d.ts +2 -0
  34. package/dist/components/LiteDrawerForm.svelte +4 -1
  35. package/dist/components/LiteDrawerForm.svelte.d.ts +2 -0
  36. package/dist/components/LiteEditableTable.svelte +4 -1
  37. package/dist/components/LiteEditableTable.svelte.d.ts +2 -0
  38. package/dist/components/LiteEmptyState.svelte +8 -1
  39. package/dist/components/LiteEmptyState.svelte.d.ts +3 -0
  40. package/dist/components/LiteFilterBuilder.svelte +4 -1
  41. package/dist/components/LiteFilterBuilder.svelte.d.ts +2 -0
  42. package/dist/components/LiteFloatButton.svelte +54 -0
  43. package/dist/components/LiteFloatButton.svelte.d.ts +15 -0
  44. package/dist/components/LiteGrid.svelte +34 -0
  45. package/dist/components/LiteGrid.svelte.d.ts +11 -0
  46. package/dist/components/LiteImage.svelte +54 -0
  47. package/dist/components/LiteImage.svelte.d.ts +14 -0
  48. package/dist/components/LiteImageCropper.svelte +4 -1
  49. package/dist/components/LiteImageCropper.svelte.d.ts +2 -0
  50. package/dist/components/LiteImagePreview.svelte +36 -0
  51. package/dist/components/LiteImagePreview.svelte.d.ts +13 -0
  52. package/dist/components/LiteItemList.svelte +50 -0
  53. package/dist/components/LiteItemList.svelte.d.ts +15 -0
  54. package/dist/components/LiteJsonSchemaForm.svelte +4 -1
  55. package/dist/components/LiteJsonSchemaForm.svelte.d.ts +2 -0
  56. package/dist/components/LiteLayout.svelte +16 -4
  57. package/dist/components/LiteLayout.svelte.d.ts +8 -0
  58. package/dist/components/LiteLink.svelte +32 -0
  59. package/dist/components/LiteLink.svelte.d.ts +11 -0
  60. package/dist/components/LiteLogin.svelte +9 -2
  61. package/dist/components/LiteLogin.svelte.d.ts +2 -0
  62. package/dist/components/LiteMasterDetailView.svelte +4 -1
  63. package/dist/components/LiteMasterDetailView.svelte.d.ts +2 -0
  64. package/dist/components/LiteMediaLibraryModal.svelte +4 -1
  65. package/dist/components/LiteMediaLibraryModal.svelte.d.ts +2 -0
  66. package/dist/components/LiteMenu.svelte +22 -0
  67. package/dist/components/LiteMenu.svelte.d.ts +12 -0
  68. package/dist/components/LiteMenuList.svelte +55 -0
  69. package/dist/components/LiteMenuList.svelte.d.ts +17 -0
  70. package/dist/components/LiteModalForm.svelte +4 -1
  71. package/dist/components/LiteModalForm.svelte.d.ts +2 -0
  72. package/dist/components/LiteNotificationCenter.svelte +85 -0
  73. package/dist/components/LiteNotificationCenter.svelte.d.ts +22 -0
  74. package/dist/components/LiteOtpInput.svelte +50 -0
  75. package/dist/components/LiteOtpInput.svelte.d.ts +15 -0
  76. package/dist/components/LitePageHeader.svelte +34 -0
  77. package/dist/components/LitePageHeader.svelte.d.ts +13 -0
  78. package/dist/components/LitePagination.svelte +10 -2
  79. package/dist/components/LitePagination.svelte.d.ts +2 -0
  80. package/dist/components/LitePopconfirm.svelte +49 -0
  81. package/dist/components/LitePopconfirm.svelte.d.ts +14 -0
  82. package/dist/components/LitePresenceAvatarGroup.svelte +4 -1
  83. package/dist/components/LitePresenceAvatarGroup.svelte.d.ts +2 -0
  84. package/dist/components/LitePrintableBill.svelte +4 -1
  85. package/dist/components/LitePrintableBill.svelte.d.ts +2 -0
  86. package/dist/components/LiteProgress.svelte +46 -0
  87. package/dist/components/LiteProgress.svelte.d.ts +12 -0
  88. package/dist/components/LiteQRCode.svelte +62 -0
  89. package/dist/components/LiteQRCode.svelte.d.ts +14 -0
  90. package/dist/components/LiteResizeBox.svelte +34 -0
  91. package/dist/components/LiteResizeBox.svelte.d.ts +12 -0
  92. package/dist/components/LiteResult.svelte +52 -0
  93. package/dist/components/LiteResult.svelte.d.ts +14 -0
  94. package/dist/components/LiteRowActions.svelte +36 -0
  95. package/dist/components/LiteRowActions.svelte.d.ts +17 -0
  96. package/dist/components/LiteSensitiveDataMask.svelte +4 -1
  97. package/dist/components/LiteSensitiveDataMask.svelte.d.ts +2 -0
  98. package/dist/components/LiteSkeleton.svelte +100 -0
  99. package/dist/components/LiteSkeleton.svelte.d.ts +19 -0
  100. package/dist/components/LiteSpace.svelte +31 -0
  101. package/dist/components/LiteSpace.svelte.d.ts +12 -0
  102. package/dist/components/LiteSpin.svelte +27 -0
  103. package/dist/components/LiteSpin.svelte.d.ts +10 -0
  104. package/dist/components/LiteSplitPaneLayout.svelte +16 -4
  105. package/dist/components/LiteSplitPaneLayout.svelte.d.ts +8 -0
  106. package/dist/components/LiteStatistic.svelte +63 -0
  107. package/dist/components/LiteStatistic.svelte.d.ts +15 -0
  108. package/dist/components/LiteStatsCard.svelte +5 -2
  109. package/dist/components/LiteStatsCard.svelte.d.ts +2 -0
  110. package/dist/components/LiteStatusBadge.svelte +33 -0
  111. package/dist/components/LiteStatusBadge.svelte.d.ts +12 -0
  112. package/dist/components/LiteStatusTabs.svelte +35 -0
  113. package/dist/components/LiteStatusTabs.svelte.d.ts +14 -0
  114. package/dist/components/LiteStepForm.svelte +4 -1
  115. package/dist/components/LiteStepForm.svelte.d.ts +2 -0
  116. package/dist/components/LiteSteps.svelte +64 -0
  117. package/dist/components/LiteSteps.svelte.d.ts +18 -0
  118. package/dist/components/LiteTable.svelte +4 -1
  119. package/dist/components/LiteTable.svelte.d.ts +2 -0
  120. package/dist/components/LiteTableSummary.svelte +4 -1
  121. package/dist/components/LiteTableSummary.svelte.d.ts +2 -0
  122. package/dist/components/LiteTabs.svelte +28 -18
  123. package/dist/components/LiteTabs.svelte.d.ts +11 -2
  124. package/dist/components/LiteTag.svelte +31 -0
  125. package/dist/components/LiteTag.svelte.d.ts +13 -0
  126. package/dist/components/LiteTimeline.svelte +48 -0
  127. package/dist/components/LiteTimeline.svelte.d.ts +17 -0
  128. package/dist/components/LiteTour.svelte +54 -0
  129. package/dist/components/LiteTour.svelte.d.ts +15 -0
  130. package/dist/components/LiteTransfer.svelte +4 -1
  131. package/dist/components/LiteTransfer.svelte.d.ts +2 -0
  132. package/dist/components/LiteTree.svelte +48 -0
  133. package/dist/components/LiteTree.svelte.d.ts +17 -0
  134. package/dist/components/LiteTwoFactorStepper.svelte +53 -0
  135. package/dist/components/LiteTwoFactorStepper.svelte.d.ts +16 -0
  136. package/dist/components/LiteVersionDiffViewer.svelte +4 -1
  137. package/dist/components/LiteVersionDiffViewer.svelte.d.ts +2 -0
  138. package/dist/components/LiteVideoPlayer.svelte +67 -0
  139. package/dist/components/LiteVideoPlayer.svelte.d.ts +22 -0
  140. package/dist/components/advanced/LiteAutoSaveIndicator.svelte +42 -13
  141. package/dist/components/advanced/LiteAutoSaveIndicator.svelte.d.ts +10 -4
  142. package/dist/components/advanced/LiteDrawerForm.svelte +4 -1
  143. package/dist/components/advanced/LiteDrawerForm.svelte.d.ts +2 -0
  144. package/dist/components/advanced/LiteModalForm.svelte +4 -1
  145. package/dist/components/advanced/LiteModalForm.svelte.d.ts +2 -0
  146. package/dist/components/compatibility/LiteRealtimeStatus.svelte +41 -2
  147. package/dist/components/compatibility/LiteRealtimeStatus.svelte.d.ts +15 -0
  148. package/dist/components/fields/LiteBooleanField.svelte +4 -2
  149. package/dist/components/fields/LiteBooleanField.svelte.d.ts +2 -0
  150. package/dist/components/fields/LiteCascader.svelte +5 -2
  151. package/dist/components/fields/LiteCascader.svelte.d.ts +2 -0
  152. package/dist/components/fields/LiteDateField.svelte +39 -9
  153. package/dist/components/fields/LiteDateField.svelte.d.ts +2 -0
  154. package/dist/components/fields/LiteImageField.svelte +6 -2
  155. package/dist/components/fields/LiteImageField.svelte.d.ts +2 -0
  156. package/dist/components/fields/LiteMarkdownField.svelte +49 -3
  157. package/dist/components/fields/LiteMarkdownField.svelte.d.ts +5 -0
  158. package/dist/components/fields/LiteNumberField.svelte +5 -3
  159. package/dist/components/fields/LiteNumberField.svelte.d.ts +2 -0
  160. package/dist/components/fields/LiteRichTextField.svelte +45 -8
  161. package/dist/components/fields/LiteRichTextField.svelte.d.ts +3 -0
  162. package/dist/components/fields/LiteSelectField.svelte +5 -3
  163. package/dist/components/fields/LiteSelectField.svelte.d.ts +2 -0
  164. package/dist/components/fields/LiteTagField.svelte +38 -15
  165. package/dist/components/fields/LiteTagField.svelte.d.ts +2 -0
  166. package/dist/components/fields/LiteTextField.svelte +26 -5
  167. package/dist/components/fields/LiteTextField.svelte.d.ts +2 -0
  168. package/dist/components/fields/LiteTreeSelect.svelte +5 -2
  169. package/dist/components/fields/LiteTreeSelect.svelte.d.ts +2 -0
  170. package/dist/components/fields/LiteUrlField.svelte +5 -3
  171. package/dist/components/fields/LiteUrlField.svelte.d.ts +2 -0
  172. package/dist/components/layout/LiteSidebar.svelte +4 -1
  173. package/dist/components/layout/LiteSidebar.svelte.d.ts +2 -0
  174. package/dist/components/pages/LiteCreatePage.svelte +4 -1
  175. package/dist/components/pages/LiteCreatePage.svelte.d.ts +2 -0
  176. package/dist/components/pages/LiteEditPage.svelte +4 -1
  177. package/dist/components/pages/LiteEditPage.svelte.d.ts +2 -0
  178. package/dist/components/pages/LiteListPage.svelte +4 -1
  179. package/dist/components/pages/LiteListPage.svelte.d.ts +2 -0
  180. package/dist/components/pages/LiteShowPage.svelte +4 -1
  181. package/dist/components/pages/LiteShowPage.svelte.d.ts +2 -0
  182. package/dist/components/widgets/LiteAnomalyBadge.svelte +5 -2
  183. package/dist/components/widgets/LiteAnomalyBadge.svelte.d.ts +2 -0
  184. package/dist/components/widgets/LiteAreaChart.svelte +20 -0
  185. package/dist/components/widgets/LiteAreaChart.svelte.d.ts +10 -0
  186. package/dist/components/widgets/LiteChartSvg.svelte +102 -0
  187. package/dist/components/widgets/LiteChartSvg.svelte.d.ts +10 -0
  188. package/dist/components/widgets/LiteChartTable.svelte +44 -0
  189. package/dist/components/widgets/LiteChartTable.svelte.d.ts +10 -0
  190. package/dist/components/widgets/LiteDonutChart.svelte +20 -0
  191. package/dist/components/widgets/LiteDonutChart.svelte.d.ts +10 -0
  192. package/dist/components/widgets/LiteFunnelChart.svelte +20 -0
  193. package/dist/components/widgets/LiteFunnelChart.svelte.d.ts +10 -0
  194. package/dist/components/widgets/LiteGaugeChart.svelte +20 -0
  195. package/dist/components/widgets/LiteGaugeChart.svelte.d.ts +10 -0
  196. package/dist/components/widgets/LiteHeatmapChart.svelte +20 -0
  197. package/dist/components/widgets/LiteHeatmapChart.svelte.d.ts +10 -0
  198. package/dist/components/widgets/LiteInsightCard.svelte +34 -12
  199. package/dist/components/widgets/LiteInsightCard.svelte.d.ts +7 -4
  200. package/dist/components/widgets/LiteLineChart.svelte +6 -3
  201. package/dist/components/widgets/LiteLineChart.svelte.d.ts +0 -5
  202. package/dist/components/widgets/LitePieChart.svelte +5 -3
  203. package/dist/components/widgets/LitePieChart.svelte.d.ts +0 -5
  204. package/dist/components/widgets/LiteRadarChart.svelte +20 -0
  205. package/dist/components/widgets/LiteRadarChart.svelte.d.ts +10 -0
  206. package/dist/components/widgets/LiteRoseChart.svelte +20 -0
  207. package/dist/components/widgets/LiteRoseChart.svelte.d.ts +10 -0
  208. package/dist/components/widgets/LiteScatterChart.svelte +20 -0
  209. package/dist/components/widgets/LiteScatterChart.svelte.d.ts +10 -0
  210. package/dist/components/widgets/LiteWaterfallChart.svelte +20 -0
  211. package/dist/components/widgets/LiteWaterfallChart.svelte.d.ts +10 -0
  212. package/dist/components/widgets/chart-geometry.d.ts +65 -0
  213. package/dist/components/widgets/chart-geometry.js +229 -0
  214. package/dist/components/widgets/index.d.ts +10 -0
  215. package/dist/components/widgets/index.js +10 -0
  216. package/dist/index.d.ts +40 -0
  217. package/dist/index.js +47 -0
  218. package/dist/lite-code-theme.css +139 -0
  219. package/dist/lite.css +108 -1
  220. package/dist/rich-content.d.ts +47 -0
  221. package/dist/rich-content.js +498 -0
  222. package/dist/schema-generator.js +3 -1
  223. package/dist/server-adapter.js +6 -11
  224. package/dist/value-normalization.d.ts +4 -0
  225. package/dist/value-normalization.js +13 -0
  226. package/package.json +18 -4
@@ -0,0 +1,49 @@
1
+ <script lang="ts">
2
+ interface CollapseItem {
3
+ id: string;
4
+ title: string;
5
+ description?: string;
6
+ content: string;
7
+ open?: boolean;
8
+ disabled?: boolean;
9
+ }
10
+
11
+ interface Props {
12
+ items: CollapseItem[];
13
+ label?: string;
14
+ }
15
+
16
+ let { items, label = 'Collapsible sections' }: Props = $props();
17
+ </script>
18
+
19
+ <div class="lite-collapse" role="group" aria-label={label}>
20
+ {#each items as item (item.id)}
21
+ <section class="lite-collapse__item" data-open={item.open || undefined} data-disabled={item.disabled || undefined}>
22
+ {#if item.disabled}
23
+ <!-- Disabled sections must not navigate: a dead anchor still moves focus and
24
+ changes the URL, so render plain text instead of a link. -->
25
+ <span class="lite-collapse__trigger" aria-disabled="true">
26
+ <span>{item.title}</span>
27
+ {#if item.description}<small>{item.description}</small>{/if}
28
+ </span>
29
+ {:else}
30
+ <a class="lite-collapse__trigger" href={`#${item.id}`}>
31
+ <span>{item.title}</span>
32
+ {#if item.description}<small>{item.description}</small>{/if}
33
+ </a>
34
+ {/if}
35
+ <div class="lite-collapse__body" id={item.id}>{item.content}</div>
36
+ </section>
37
+ {/each}
38
+ </div>
39
+
40
+ <style>
41
+ .lite-collapse { border: 1px solid #E5E6EB; border-radius: 8px; background: #fff; overflow: hidden; }
42
+ .lite-collapse__item + .lite-collapse__item { border-top: 1px solid #E5E6EB; }
43
+ .lite-collapse__trigger { display: block; padding: 12px 16px; color: #1D2129; font-size: 14px; font-weight: 500; text-decoration: none; }
44
+ .lite-collapse__trigger:hover { background: #F7F8FA; text-decoration: none; }
45
+ .lite-collapse__trigger small { margin-left: 8px; color: #86909C; font-size: 12px; font-weight: 400; }
46
+ .lite-collapse__item[data-disabled] .lite-collapse__trigger { color: #C9CDD4; cursor: not-allowed; }
47
+ .lite-collapse__body { display: none; padding: 12px 16px; border-top: 1px solid #F2F3F5; color: #4E5969; font-size: 13px; line-height: 1.6; }
48
+ .lite-collapse__item[data-open] .lite-collapse__body, .lite-collapse__body:target { display: block; }
49
+ </style>
@@ -0,0 +1,15 @@
1
+ interface CollapseItem {
2
+ id: string;
3
+ title: string;
4
+ description?: string;
5
+ content: string;
6
+ open?: boolean;
7
+ disabled?: boolean;
8
+ }
9
+ interface Props {
10
+ items: CollapseItem[];
11
+ label?: string;
12
+ }
13
+ declare const LiteCollapse: import("svelte").Component<Props, {}, "">;
14
+ type LiteCollapse = ReturnType<typeof LiteCollapse>;
15
+ export default LiteCollapse;
@@ -4,15 +4,18 @@
4
4
  interface Props {
5
5
  field: FieldDefinition;
6
6
  action?: string;
7
+ /** Caller class merged with the built-in class list. */
8
+ class?: string;
7
9
  }
8
10
 
9
11
  let {
10
12
  field,
11
13
  action = '',
14
+ class: className = '',
12
15
  }: Props = $props();
13
16
  </script>
14
17
 
15
- <span class="lite-column-header-filter">
18
+ <span class="lite-column-header-filter {className}">
16
19
  <a
17
20
  href="{action}?filter_field={field.key}"
18
21
  class="lite-filter-icon"
@@ -2,6 +2,8 @@ import type { FieldDefinition } from '@svadmin/core';
2
2
  interface Props {
3
3
  field: FieldDefinition;
4
4
  action?: string;
5
+ /** Caller class merged with the built-in class list. */
6
+ class?: string;
5
7
  }
6
8
  declare const LiteColumnHeaderFilter: import("svelte").Component<Props, {}, "">;
7
9
  type LiteColumnHeaderFilter = ReturnType<typeof LiteColumnHeaderFilter>;
@@ -11,6 +11,8 @@
11
11
  method?: 'GET' | 'POST' | 'get' | 'post';
12
12
  title?: string;
13
13
  submitText?: string;
14
+ /** Caller class merged with the built-in class list. */
15
+ class?: string;
14
16
  }
15
17
 
16
18
  let {
@@ -19,10 +21,11 @@
19
21
  method = 'GET',
20
22
  title = 'Column Visibility',
21
23
  submitText = 'Apply',
24
+ class: className = '',
22
25
  }: Props = $props();
23
26
  </script>
24
27
 
25
- <div class="lite-column-settings lite-form-group">
28
+ <div class="lite-column-settings lite-form-group {className}">
26
29
  <div class="lite-column-settings-title">
27
30
  <strong>⚙ {title}</strong>
28
31
  </div>
@@ -9,6 +9,8 @@ interface Props {
9
9
  method?: 'GET' | 'POST' | 'get' | 'post';
10
10
  title?: string;
11
11
  submitText?: string;
12
+ /** Caller class merged with the built-in class list. */
13
+ class?: string;
12
14
  }
13
15
  declare const LiteColumnSettings: import("svelte").Component<Props, {}, "">;
14
16
  type LiteColumnSettings = ReturnType<typeof LiteColumnSettings>;
@@ -0,0 +1,113 @@
1
+ <script lang="ts">
2
+ import { renderRichContent, type MarkdownRenderOptions } from '../rich-content.js';
3
+
4
+ interface CommentItem {
5
+ id: string;
6
+ author: string;
7
+ content: string;
8
+ time?: string;
9
+ avatar?: string;
10
+ replies?: CommentItem[];
11
+ }
12
+
13
+ interface Props {
14
+ comments: CommentItem[];
15
+ emptyText?: string;
16
+ label?: string;
17
+ action?: string;
18
+ submitLabel?: string;
19
+ name?: string;
20
+ /**
21
+ * Render comment bodies as Markdown/allowlisted HTML. Defaults to `false` so
22
+ * the default output stays text-only, matching the reference component.
23
+ */
24
+ richContent?: boolean;
25
+ richContentOptions?: MarkdownRenderOptions;
26
+ }
27
+
28
+ let {
29
+ comments,
30
+ emptyText = 'No comments yet',
31
+ label = 'Comments',
32
+ action,
33
+ submitLabel = 'Comment',
34
+ name = 'comment',
35
+ richContent = false,
36
+ richContentOptions,
37
+ }: Props = $props();
38
+
39
+ function body(value: string): string {
40
+ return renderRichContent(value, richContentOptions);
41
+ }
42
+ </script>
43
+
44
+ <section class="lite-comments" aria-label={label}>
45
+ {#if comments.length === 0}
46
+ <p class="lite-muted">{emptyText}</p>
47
+ {:else}
48
+ <ol class="lite-comments__list">
49
+ {#each comments as comment (comment.id)}
50
+ <li class="lite-comments__item">
51
+ {#if comment.avatar}<img src={comment.avatar} alt="" loading="lazy" />{:else}<span class="lite-comments__avatar" aria-hidden="true">{comment.author.slice(0, 1)}</span>{/if}
52
+ <div class="lite-comments__body">
53
+ <p class="lite-comments__meta"><strong>{comment.author}</strong>{#if comment.time}<time>{comment.time}</time>{/if}</p>
54
+ {#if richContent}
55
+ <!-- eslint-disable-next-line svelte/no-at-html-tags -- 内容由 renderRichContent 转义或白名单过滤,高亮回调仅允许可信服务端实现。 -->
56
+ <div class="lite-comments__rich">{@html body(comment.content)}</div>
57
+ {:else}
58
+ <p>{comment.content}</p>
59
+ {/if}
60
+ {#if comment.replies?.length}
61
+ <ol class="lite-comments__replies">
62
+ {#each comment.replies as reply (reply.id)}
63
+ <li>
64
+ <strong>{reply.author}</strong>
65
+ {#if richContent}
66
+ <!-- eslint-disable-next-line svelte/no-at-html-tags -- 内容由 renderRichContent 转义或白名单过滤,高亮回调仅允许可信服务端实现。 -->
67
+ <span class="lite-comments__rich">{@html body(reply.content)}</span>
68
+ {:else}
69
+ {reply.content}
70
+ {/if}
71
+ </li>
72
+ {/each}
73
+ </ol>
74
+ {/if}
75
+ </div>
76
+ </li>
77
+ {/each}
78
+ </ol>
79
+ {/if}
80
+ {#if action}
81
+ <form class="lite-comments__form" method="POST" {action}>
82
+ <label class="lite-form-group">
83
+ <span>Add a comment</span>
84
+ <textarea class="lite-input" name={name} rows="3" required></textarea>
85
+ </label>
86
+ <button class="lite-btn lite-btn-primary lite-btn-sm" type="submit">{submitLabel}</button>
87
+ </form>
88
+ {/if}
89
+ </section>
90
+
91
+ <style>
92
+ .lite-comments { display: block; }
93
+ .lite-comments__list, .lite-comments__replies { display: block; margin: 0; padding: 0; list-style: none; }
94
+ .lite-comments__item { display: flex; align-items: flex-start; padding-bottom: 12px; border-bottom: 1px solid #F2F3F5; }
95
+ .lite-comments__avatar, .lite-comments__item > img { display: inline-grid; flex: 0 0 32px; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: #E8F3FF; color: #165DFF; font-size: 13px; font-weight: 600; object-fit: cover; }
96
+ .lite-comments__body { min-width: 0; flex: 1; }
97
+ .lite-comments__body > p { margin: 4px 0 0; color: #4E5969; font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
98
+ .lite-comments__meta { display: flex; flex-wrap: wrap; align-items: baseline; margin: 0; color: #1D2129; font-size: 13px; }
99
+ .lite-comments__meta time { color: #86909C; font-size: 12px; }
100
+ .lite-comments__replies { margin-top: 8px; padding-left: 12px; border-left: 2px solid #F2F3F5; color: #4E5969; font-size: 12px; }
101
+ .lite-comments__form { display: block; justify-items: start; }
102
+
103
+ .lite-comments__item > img, .lite-comments__avatar { margin-right: 10px; }
104
+ .lite-comments__meta > * + * { margin-left: 8px; }
105
+ .lite-comments__form textarea { margin-bottom: 8px; }
106
+ .lite-comments__rich :global(p) { margin: 0 0 6px; }
107
+ .lite-comments__rich :global(p:last-child) { margin-bottom: 0; }
108
+ .lite-comments__rich :global(code) { padding: 1px 4px; border-radius: 3px; background: #F2F3F5; font-family: monospace; font-size: 12px; }
109
+ .lite-comments__rich :global(pre) { margin: 0 0 6px; padding: 8px; overflow-x: auto; border-radius: 4px; background: #F2F3F5; }
110
+ .lite-comments__rich :global(a) { color: #165DFF; }
111
+ .lite-comments__rich :global(ul),
112
+ .lite-comments__rich :global(ol) { margin: 0 0 6px; padding-left: 18px; }
113
+ </style>
@@ -0,0 +1,26 @@
1
+ import { type MarkdownRenderOptions } from '../rich-content.js';
2
+ interface CommentItem {
3
+ id: string;
4
+ author: string;
5
+ content: string;
6
+ time?: string;
7
+ avatar?: string;
8
+ replies?: CommentItem[];
9
+ }
10
+ interface Props {
11
+ comments: CommentItem[];
12
+ emptyText?: string;
13
+ label?: string;
14
+ action?: string;
15
+ submitLabel?: string;
16
+ name?: string;
17
+ /**
18
+ * Render comment bodies as Markdown/allowlisted HTML. Defaults to `false` so
19
+ * the default output stays text-only, matching the reference component.
20
+ */
21
+ richContent?: boolean;
22
+ richContentOptions?: MarkdownRenderOptions;
23
+ }
24
+ declare const LiteCommentThread: import("svelte").Component<Props, {}, "">;
25
+ type LiteCommentThread = ReturnType<typeof LiteCommentThread>;
26
+ export default LiteCommentThread;
@@ -0,0 +1,49 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ target?: Date | string | number;
4
+ duration?: number;
5
+ title?: string;
6
+ format?: 'full' | 'clock';
7
+ refreshHref?: string;
8
+ }
9
+
10
+ let { target, duration, title, format = 'full', refreshHref }: Props = $props();
11
+
12
+ function resolveRemaining(): number {
13
+ if (duration !== undefined) return Math.max(0, duration * 1000);
14
+ if (!target) return 0;
15
+ const end = target instanceof Date ? target.getTime() : new Date(target).getTime();
16
+ return Number.isNaN(end) ? 0 : Math.max(0, end - Date.now());
17
+ }
18
+
19
+ function formatTime(value: number): string {
20
+ const total = Math.max(0, Math.floor(value / 1000));
21
+ const days = Math.floor(total / 86400);
22
+ const hours = Math.floor((total % 86400) / 3600);
23
+ const minutes = Math.floor((total % 3600) / 60);
24
+ const seconds = total % 60;
25
+ const clock = [hours, minutes, seconds].map((part) => String(part).padStart(2, '0')).join(':');
26
+ return format === 'clock' ? clock : days > 0 ? `${days}d ${clock}` : clock;
27
+ }
28
+
29
+ const remaining = $derived(resolveRemaining());
30
+ const deadline = $derived(target ? (target instanceof Date ? target.toISOString() : new Date(target).toISOString()) : undefined);
31
+ </script>
32
+
33
+ <div class="lite-countdown" data-finished={remaining <= 0 || undefined}>
34
+ {#if title}<p class="lite-countdown__title">{title}</p>{/if}
35
+ <time class="lite-countdown__value" datetime={deadline}>{formatTime(remaining)}</time>
36
+ {#if deadline}<small>Deadline: {deadline}</small>{/if}
37
+ {#if refreshHref}<a href={refreshHref}>Refresh</a>{/if}
38
+ </div>
39
+
40
+ <style>
41
+ .lite-countdown { display: block; }
42
+ .lite-countdown__title { margin: 0; color: #86909C; font-size: 13px; }
43
+ .lite-countdown__value { color: #1D2129; font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
44
+ .lite-countdown[data-finished] .lite-countdown__value { color: #86909C; }
45
+ .lite-countdown small { color: #86909C; font-size: 12px; }
46
+ .lite-countdown a { color: #165DFF; font-size: 12px; }
47
+
48
+ .lite-countdown > * + * { margin-top: 4px; }
49
+ </style>
@@ -0,0 +1,10 @@
1
+ interface Props {
2
+ target?: Date | string | number;
3
+ duration?: number;
4
+ title?: string;
5
+ format?: 'full' | 'clock';
6
+ refreshHref?: string;
7
+ }
8
+ declare const LiteCountdown: import("svelte").Component<Props, {}, "">;
9
+ type LiteCountdown = ReturnType<typeof LiteCountdown>;
10
+ export default LiteCountdown;
@@ -0,0 +1,45 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ interface Props {
5
+ id: string;
6
+ title: string;
7
+ description?: string;
8
+ open?: boolean;
9
+ closeHref?: string;
10
+ children: Snippet;
11
+ /** Caller class merged with the built-in class list. */
12
+ class?: string;
13
+ }
14
+
15
+ let {
16
+ id,
17
+ title,
18
+ description,
19
+ open = false,
20
+ closeHref = '#',
21
+ children,
22
+ class: className = '',
23
+ }: Props = $props();
24
+ </script>
25
+
26
+ <div class="lite-detail-drawer {className}" data-open={open || undefined}>
27
+ <a class="lite-btn lite-btn-sm" href={`#${id}`}>Details</a>
28
+ <aside class="lite-detail-drawer__panel" id={id} aria-label={title}>
29
+ <header>
30
+ <h2>{title}</h2>
31
+ <a href={closeHref} aria-label="Close details">×</a>
32
+ </header>
33
+ {#if description}<p class="lite-muted">{description}</p>{/if}
34
+ {@render children()}
35
+ </aside>
36
+ </div>
37
+
38
+ <style>
39
+ .lite-detail-drawer { display: inline-block; }
40
+ .lite-detail-drawer__panel { display: none; position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: 28rem; max-width: 100vw; overflow: auto; padding: 20px; border-left: 1px solid #E5E6EB; background: #fff; box-shadow: -12px 0 32px rgba(29, 33, 41, 0.14); }
41
+ .lite-detail-drawer__panel:target, .lite-detail-drawer[data-open] .lite-detail-drawer__panel { display: block; }
42
+ .lite-detail-drawer__panel header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
43
+ .lite-detail-drawer__panel h2 { margin: 0; color: #1D2129; font-size: 18px; }
44
+ .lite-detail-drawer__panel header a { margin-left: 12px; color: #4E5969; font-size: 24px; line-height: 1; text-decoration: none; }
45
+ </style>
@@ -0,0 +1,14 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ id: string;
4
+ title: string;
5
+ description?: string;
6
+ open?: boolean;
7
+ closeHref?: string;
8
+ children: Snippet;
9
+ /** Caller class merged with the built-in class list. */
10
+ class?: string;
11
+ }
12
+ declare const LiteDetailDrawer: import("svelte").Component<Props, {}, "">;
13
+ type LiteDetailDrawer = ReturnType<typeof LiteDetailDrawer>;
14
+ export default LiteDetailDrawer;
@@ -10,6 +10,8 @@
10
10
  action?: string;
11
11
  method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
12
12
  rowKey?: string;
13
+ /** Caller class merged with the built-in class list. */
14
+ class?: string;
13
15
  }
14
16
 
15
17
  let {
@@ -18,10 +20,11 @@
18
20
  action = '',
19
21
  method = 'POST',
20
22
  rowKey = 'id',
23
+ class: className = '',
21
24
  }: Props = $props();
22
25
  </script>
23
26
 
24
- <div class="lite-sortable-table-card">
27
+ <div class="lite-sortable-table-card {className}">
25
28
  <form {action} {method}>
26
29
  <table class="lite-table">
27
30
  <thead>
@@ -8,6 +8,8 @@ interface Props {
8
8
  action?: string;
9
9
  method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
10
10
  rowKey?: string;
11
+ /** Caller class merged with the built-in class list. */
12
+ class?: string;
11
13
  }
12
14
  declare const LiteDraggableRowTable: import("svelte").Component<Props, {}, "">;
13
15
  type LiteDraggableRowTable = ReturnType<typeof LiteDraggableRowTable>;
@@ -9,6 +9,8 @@
9
9
  submitText?: string;
10
10
  cancelText?: string;
11
11
  children?: Snippet;
12
+ /** Caller class merged with the built-in class list. */
13
+ class?: string;
12
14
  }
13
15
 
14
16
  let {
@@ -19,10 +21,11 @@
19
21
  submitText = 'Save',
20
22
  cancelText = 'Cancel',
21
23
  children,
24
+ class: className = '',
22
25
  }: Props = $props();
23
26
  </script>
24
27
 
25
- <div class="lite-drawer-card">
28
+ <div class="lite-drawer-card {className}">
26
29
  <div class="lite-drawer-header">
27
30
  <h3 class="lite-drawer-title">{title}</h3>
28
31
  {#if description}
@@ -7,6 +7,8 @@ interface Props {
7
7
  submitText?: string;
8
8
  cancelText?: string;
9
9
  children?: Snippet;
10
+ /** Caller class merged with the built-in class list. */
11
+ class?: string;
10
12
  }
11
13
  declare const LiteDrawerForm: import("svelte").Component<Props, {}, "">;
12
14
  type LiteDrawerForm = ReturnType<typeof LiteDrawerForm>;
@@ -12,6 +12,8 @@
12
12
  action?: string;
13
13
  method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
14
14
  rowKey?: string;
15
+ /** Caller class merged with the built-in class list. */
16
+ class?: string;
15
17
  }
16
18
 
17
19
  let {
@@ -20,10 +22,11 @@
20
22
  action = '',
21
23
  method = 'POST',
22
24
  rowKey = 'id',
25
+ class: className = '',
23
26
  }: Props = $props();
24
27
  </script>
25
28
 
26
- <div class="lite-editable-table-card">
29
+ <div class="lite-editable-table-card {className}">
27
30
  <form {action} {method}>
28
31
  <table class="lite-table">
29
32
  <thead>
@@ -13,6 +13,8 @@ interface Props {
13
13
  action?: string;
14
14
  method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
15
15
  rowKey?: string;
16
+ /** Caller class merged with the built-in class list. */
17
+ class?: string;
16
18
  }
17
19
  declare const LiteEditableTable: import("svelte").Component<Props, {}, "">;
18
20
  type LiteEditableTable = ReturnType<typeof LiteEditableTable>;
@@ -10,6 +10,9 @@
10
10
  description?: string;
11
11
  /** Optional HTML entity or text icon */
12
12
  icon?: string;
13
+ /** Optional illustration URL; mirrors the full EmptyState image API. */
14
+ imageUrl?: string;
15
+ imageAlt?: string;
13
16
  actionLabel?: string;
14
17
  actionUrl?: string;
15
18
  }
@@ -18,13 +21,17 @@
18
21
  title,
19
22
  description,
20
23
  icon,
24
+ imageUrl,
25
+ imageAlt,
21
26
  actionLabel,
22
27
  actionUrl,
23
28
  }: Props = $props();
24
29
  </script>
25
30
 
26
31
  <div class="lite-empty-state lite-card" style="text-align:center;padding:48px 24px;">
27
- {#if icon}
32
+ {#if imageUrl}
33
+ <img src={imageUrl} alt={imageAlt ?? ''} loading="lazy" style="display:block;width:96px;height:96px;object-fit:contain;margin:0 auto 16px auto;" />
34
+ {:else if icon}
28
35
  <div style="font-size:32px;color:#86909C;margin-bottom:16px;">{icon}</div>
29
36
  {/if}
30
37
  <h3 style="font-size:16px;font-weight:600;color:#1D2129;margin:0 0 8px 0;">{title}</h3>
@@ -8,6 +8,9 @@ interface Props {
8
8
  description?: string;
9
9
  /** Optional HTML entity or text icon */
10
10
  icon?: string;
11
+ /** Optional illustration URL; mirrors the full EmptyState image API. */
12
+ imageUrl?: string;
13
+ imageAlt?: string;
11
14
  actionLabel?: string;
12
15
  actionUrl?: string;
13
16
  }
@@ -23,6 +23,8 @@
23
23
  method?: 'GET' | 'POST';
24
24
  disabled?: boolean;
25
25
  onApply?: (filters: Filter[]) => void;
26
+ /** Caller class merged with the built-in class list. */
27
+ class?: string;
26
28
  }
27
29
 
28
30
  let {
@@ -32,6 +34,7 @@
32
34
  method = 'GET',
33
35
  disabled = false,
34
36
  onApply,
37
+ class: className = '',
35
38
  }: Props = $props();
36
39
  let validationError = $state<string | undefined>();
37
40
 
@@ -105,7 +108,7 @@
105
108
 
106
109
  </script>
107
110
 
108
- <div class="lite-filter-builder lite-form-group">
111
+ <div class="lite-filter-builder lite-form-group {className}">
109
112
  <div class="lite-filter-header">
110
113
  <strong>{t('common.filters') || '高级多条件筛选'}</strong>
111
114
  <button type="submit" form={formId} class="lite-btn lite-btn-primary lite-btn-sm" disabled={disabled}>
@@ -12,6 +12,8 @@ interface Props {
12
12
  method?: 'GET' | 'POST';
13
13
  disabled?: boolean;
14
14
  onApply?: (filters: Filter[]) => void;
15
+ /** Caller class merged with the built-in class list. */
16
+ class?: string;
15
17
  }
16
18
  declare const LiteFilterBuilder: import("svelte").Component<Props, {}, "">;
17
19
  type LiteFilterBuilder = ReturnType<typeof LiteFilterBuilder>;
@@ -0,0 +1,54 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ href?: string;
4
+ label?: string;
5
+ description?: string;
6
+ icon?: string;
7
+ badge?: string | number;
8
+ position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
9
+ target?: string;
10
+ ariaLabel?: string;
11
+ /** Caller class merged with the built-in class list. */
12
+ class?: string;
13
+ }
14
+
15
+ let {
16
+ href,
17
+ label,
18
+ description,
19
+ icon = '+',
20
+ badge,
21
+ position = 'bottom-right',
22
+ target,
23
+ ariaLabel,
24
+ class: className = '',
25
+ }: Props = $props();
26
+ </script>
27
+
28
+ <div class="lite-float-button {className}" data-position={position}>
29
+ {#if href}
30
+ <a class="lite-float-button__control" href={href} {target} aria-label={ariaLabel ?? label ?? description ?? 'Float button'}>
31
+ <span aria-hidden="true">{icon}</span>
32
+ {#if label || description}<span><strong>{label}</strong>{#if description}<small>{description}</small>{/if}</span>{/if}
33
+ {#if badge !== undefined}<span class="lite-badge lite-badge-danger">{badge}</span>{/if}
34
+ </a>
35
+ {:else}
36
+ <span class="lite-float-button__control" role="note" aria-label={ariaLabel ?? label ?? 'Float button'}>
37
+ <span aria-hidden="true">{icon}</span>
38
+ {#if label}<span><strong>{label}</strong>{#if description}<small>{description}</small>{/if}</span>{/if}
39
+ </span>
40
+ {/if}
41
+ </div>
42
+
43
+ <style>
44
+ .lite-float-button { position: fixed; z-index: 60; }
45
+ .lite-float-button[data-position='bottom-right'] { right: 24px; bottom: 24px; }
46
+ .lite-float-button[data-position='bottom-left'] { left: 24px; bottom: 24px; }
47
+ .lite-float-button[data-position='top-right'] { top: 24px; right: 24px; }
48
+ .lite-float-button[data-position='top-left'] { top: 24px; left: 24px; }
49
+ .lite-float-button__control { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid #E5E6EB; border-radius: 999px; background: #fff; color: #1D2129; box-shadow: 0 6px 20px rgba(29, 33, 41, 0.16); text-decoration: none; }
50
+ .lite-float-button__control:hover { color: #165DFF; text-decoration: none; }
51
+ .lite-float-button__control small { display: block; color: #86909C; font-size: 11px; }
52
+
53
+ .lite-float-button__control > * + * { margin-left: 8px; }
54
+ </style>
@@ -0,0 +1,15 @@
1
+ interface Props {
2
+ href?: string;
3
+ label?: string;
4
+ description?: string;
5
+ icon?: string;
6
+ badge?: string | number;
7
+ position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
8
+ target?: string;
9
+ ariaLabel?: string;
10
+ /** Caller class merged with the built-in class list. */
11
+ class?: string;
12
+ }
13
+ declare const LiteFloatButton: import("svelte").Component<Props, {}, "">;
14
+ type LiteFloatButton = ReturnType<typeof LiteFloatButton>;
15
+ export default LiteFloatButton;