@svadmin/lite 0.7.0 → 0.8.0

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 (71) hide show
  1. package/dist/components/LiteActivityFeed.svelte +98 -0
  2. package/dist/components/LiteActivityFeed.svelte.d.ts +19 -0
  3. package/dist/components/LiteApprovalActionCard.svelte +75 -0
  4. package/dist/components/LiteApprovalActionCard.svelte.d.ts +10 -0
  5. package/dist/components/LiteCanvasAnnotation.svelte +136 -0
  6. package/dist/components/LiteCanvasAnnotation.svelte.d.ts +16 -0
  7. package/dist/components/LiteColumnHeaderFilter.svelte +38 -0
  8. package/dist/components/LiteColumnHeaderFilter.svelte.d.ts +8 -0
  9. package/dist/components/LiteColumnSettings.svelte +82 -0
  10. package/dist/components/LiteColumnSettings.svelte.d.ts +15 -0
  11. package/dist/components/LiteDecisionTable.svelte +178 -0
  12. package/dist/components/LiteDecisionTable.svelte.d.ts +21 -0
  13. package/dist/components/LiteDraggableRowTable.svelte +70 -0
  14. package/dist/components/LiteDraggableRowTable.svelte.d.ts +14 -0
  15. package/dist/components/LiteDrawerForm.svelte +85 -0
  16. package/dist/components/LiteDrawerForm.svelte.d.ts +13 -0
  17. package/dist/components/LiteEditableTable.svelte +84 -0
  18. package/dist/components/LiteEditableTable.svelte.d.ts +19 -0
  19. package/dist/components/LiteGanttChart.svelte +144 -0
  20. package/dist/components/LiteGanttChart.svelte.d.ts +17 -0
  21. package/dist/components/LiteImageCropper.svelte +81 -0
  22. package/dist/components/LiteImageCropper.svelte.d.ts +9 -0
  23. package/dist/components/LiteImportWizard.svelte +99 -0
  24. package/dist/components/LiteImportWizard.svelte.d.ts +11 -0
  25. package/dist/components/LiteJsonSchemaForm.svelte +102 -0
  26. package/dist/components/LiteJsonSchemaForm.svelte.d.ts +10 -0
  27. package/dist/components/LiteKanbanBoard.svelte +169 -0
  28. package/dist/components/LiteKanbanBoard.svelte.d.ts +21 -0
  29. package/dist/components/LiteMasterDetailView.svelte +113 -0
  30. package/dist/components/LiteMasterDetailView.svelte.d.ts +11 -0
  31. package/dist/components/LiteMediaLibraryModal.svelte +110 -0
  32. package/dist/components/LiteMediaLibraryModal.svelte.d.ts +17 -0
  33. package/dist/components/LiteMentionsInput.svelte +98 -0
  34. package/dist/components/LiteMentionsInput.svelte.d.ts +19 -0
  35. package/dist/components/LiteModalForm.svelte +84 -0
  36. package/dist/components/LiteModalForm.svelte.d.ts +13 -0
  37. package/dist/components/LiteMultiTabKeepAlive.svelte +79 -0
  38. package/dist/components/LiteMultiTabKeepAlive.svelte.d.ts +15 -0
  39. package/dist/components/LiteOfflineSyncBanner.svelte +75 -0
  40. package/dist/components/LiteOfflineSyncBanner.svelte.d.ts +15 -0
  41. package/dist/components/LitePdfDocumentViewer.svelte +138 -0
  42. package/dist/components/LitePdfDocumentViewer.svelte.d.ts +17 -0
  43. package/dist/components/LitePivotTable.svelte +163 -0
  44. package/dist/components/LitePivotTable.svelte.d.ts +15 -0
  45. package/dist/components/LitePresenceAvatarGroup.svelte +52 -0
  46. package/dist/components/LitePresenceAvatarGroup.svelte.d.ts +12 -0
  47. package/dist/components/LitePrintableBill.svelte +119 -0
  48. package/dist/components/LitePrintableBill.svelte.d.ts +19 -0
  49. package/dist/components/LiteSensitiveDataMask.svelte +35 -0
  50. package/dist/components/LiteSensitiveDataMask.svelte.d.ts +7 -0
  51. package/dist/components/LiteSignaturePad.svelte +99 -0
  52. package/dist/components/LiteSignaturePad.svelte.d.ts +11 -0
  53. package/dist/components/LiteSplitPaneLayout.svelte +66 -0
  54. package/dist/components/LiteSplitPaneLayout.svelte.d.ts +9 -0
  55. package/dist/components/LiteSpreadsheetView.svelte +148 -0
  56. package/dist/components/LiteSpreadsheetView.svelte.d.ts +16 -0
  57. package/dist/components/LiteStepForm.svelte +144 -0
  58. package/dist/components/LiteStepForm.svelte.d.ts +18 -0
  59. package/dist/components/LiteTableSummary.svelte +93 -0
  60. package/dist/components/LiteTableSummary.svelte.d.ts +17 -0
  61. package/dist/components/LiteTreeTable.svelte +85 -0
  62. package/dist/components/LiteTreeTable.svelte.d.ts +13 -0
  63. package/dist/components/LiteVersionDiffViewer.svelte +129 -0
  64. package/dist/components/LiteVersionDiffViewer.svelte.d.ts +10 -0
  65. package/dist/components/LiteVirtualTable.svelte +52 -0
  66. package/dist/components/LiteVirtualTable.svelte.d.ts +14 -0
  67. package/dist/components/LiteWatermark.svelte +35 -0
  68. package/dist/components/LiteWatermark.svelte.d.ts +11 -0
  69. package/dist/index.d.ts +35 -0
  70. package/dist/index.js +34 -0
  71. package/package.json +2 -2
@@ -0,0 +1,98 @@
1
+ <script lang="ts">
2
+ interface LiteActivityItem {
3
+ id: string;
4
+ user?: { name: string };
5
+ action: string;
6
+ target?: string;
7
+ timestamp: string;
8
+ comment?: string;
9
+ status?: 'info' | 'success' | 'warning' | 'destructive';
10
+ }
11
+
12
+ interface Props {
13
+ activities?: LiteActivityItem[];
14
+ action?: string;
15
+ method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
16
+ }
17
+
18
+ let {
19
+ activities = [],
20
+ action = '',
21
+ method = 'POST',
22
+ }: Props = $props();
23
+ </script>
24
+
25
+ <div class="lite-activity-card">
26
+ <div class="lite-activity-header">
27
+ <strong>Activity & Timeline Stream</strong>
28
+ </div>
29
+
30
+ <ul class="lite-activity-list">
31
+ {#each activities as act (act.id)}
32
+ <li class="lite-activity-item">
33
+ <div class="lite-activity-title">
34
+ <strong>{act.user?.name ?? 'System'}</strong> {act.action}
35
+ {#if act.target}<strong>{act.target}</strong>{/if}
36
+ <span class="lite-activity-time">{act.timestamp}</span>
37
+ </div>
38
+ {#if act.comment}
39
+ <div class="lite-activity-comment">
40
+ {act.comment}
41
+ </div>
42
+ {/if}
43
+ </li>
44
+ {/each}
45
+ </ul>
46
+
47
+ <!-- Comment Form -->
48
+ <form {action} {method} class="lite-activity-form">
49
+ <div style="margin-bottom: 8px;">
50
+ <label for="lite_act_comment" class="lite-label">Add Note / Comment:</label>
51
+ <textarea id="lite_act_comment" name="comment" class="lite-textarea" style="height: 50px;" placeholder="Write a comment..."></textarea>
52
+ </div>
53
+ <div style="text-align: right;">
54
+ <button type="submit" class="lite-btn lite-btn-primary lite-btn-sm">
55
+ Post Comment
56
+ </button>
57
+ </div>
58
+ </form>
59
+ </div>
60
+
61
+ <style>
62
+ .lite-activity-card {
63
+ background: #ffffff;
64
+ border: 1px solid #cbd5e1;
65
+ border-radius: 6px;
66
+ padding: 16px;
67
+ margin-bottom: 16px;
68
+ }
69
+ .lite-activity-header {
70
+ padding-bottom: 8px;
71
+ border-bottom: 1px solid #e2e8f0;
72
+ margin-bottom: 12px;
73
+ font-size: 13px;
74
+ }
75
+ .lite-activity-list {
76
+ list-style: none;
77
+ padding: 0;
78
+ margin: 0 0 16px 0;
79
+ }
80
+ .lite-activity-item {
81
+ padding: 8px 0;
82
+ border-bottom: 1px solid #f1f5f9;
83
+ font-size: 12px;
84
+ }
85
+ .lite-activity-time {
86
+ color: #94a3b8;
87
+ margin-left: 8px;
88
+ font-size: 11px;
89
+ }
90
+ .lite-activity-comment {
91
+ background: #f8fafc;
92
+ border: 1px solid #e2e8f0;
93
+ padding: 6px 10px;
94
+ border-radius: 4px;
95
+ margin-top: 4px;
96
+ color: #475569;
97
+ }
98
+ </style>
@@ -0,0 +1,19 @@
1
+ interface LiteActivityItem {
2
+ id: string;
3
+ user?: {
4
+ name: string;
5
+ };
6
+ action: string;
7
+ target?: string;
8
+ timestamp: string;
9
+ comment?: string;
10
+ status?: 'info' | 'success' | 'warning' | 'destructive';
11
+ }
12
+ interface Props {
13
+ activities?: LiteActivityItem[];
14
+ action?: string;
15
+ method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
16
+ }
17
+ declare const LiteActivityFeed: import("svelte").Component<Props, {}, "">;
18
+ type LiteActivityFeed = ReturnType<typeof LiteActivityFeed>;
19
+ export default LiteActivityFeed;
@@ -0,0 +1,75 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ interface Props {
5
+ title?: string;
6
+ status?: 'pending' | 'approved' | 'rejected' | 'recalled';
7
+ action?: string;
8
+ children?: Snippet;
9
+ }
10
+
11
+ let {
12
+ title = 'Approval Request',
13
+ status = 'pending',
14
+ action = '',
15
+ children,
16
+ }: Props = $props();
17
+ </script>
18
+
19
+ <div class="lite-approval-card lite-form-group">
20
+ <div class="lite-approval-header">
21
+ <strong>{title}</strong>
22
+ <span class="lite-badge lite-badge-{status}">{status.toUpperCase()}</span>
23
+ </div>
24
+
25
+ {#if children}
26
+ <div class="lite-approval-body">
27
+ {@render children()}
28
+ </div>
29
+ {/if}
30
+
31
+ {#if status === 'pending'}
32
+ <form {action} method="POST" class="lite-approval-form">
33
+ <div class="lite-approval-field">
34
+ <label for="approval_comment" class="lite-label">Approval / Rejection Comment:</label>
35
+ <textarea id="approval_comment" name="comment" class="lite-textarea" style="height: 60px;" placeholder="Optional comment or rejection reason..."></textarea>
36
+ </div>
37
+ <div class="lite-approval-actions">
38
+ <button type="submit" name="_action" value="approve" class="lite-btn lite-btn-sm lite-btn-success">
39
+ ✔ Approve
40
+ </button>
41
+ <button type="submit" name="_action" value="reject" class="lite-btn lite-btn-sm lite-btn-danger" style="margin-left: 8px;">
42
+ ✕ Reject
43
+ </button>
44
+ </div>
45
+ </form>
46
+ {/if}
47
+ </div>
48
+
49
+ <style>
50
+ .lite-approval-card {
51
+ padding: 12px;
52
+ background: #f8fafc;
53
+ border: 1px solid #cbd5e1;
54
+ border-radius: 6px;
55
+ margin-bottom: 16px;
56
+ }
57
+ .lite-approval-header {
58
+ display: flex;
59
+ justify-content: space-between;
60
+ align-items: center;
61
+ margin-bottom: 8px;
62
+ font-size: 13px;
63
+ }
64
+ .lite-approval-body {
65
+ font-size: 12px;
66
+ color: #475569;
67
+ margin-bottom: 12px;
68
+ }
69
+ .lite-approval-field {
70
+ margin-bottom: 8px;
71
+ }
72
+ .lite-approval-actions {
73
+ display: flex;
74
+ }
75
+ </style>
@@ -0,0 +1,10 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ title?: string;
4
+ status?: 'pending' | 'approved' | 'rejected' | 'recalled';
5
+ action?: string;
6
+ children?: Snippet;
7
+ }
8
+ declare const LiteApprovalActionCard: import("svelte").Component<Props, {}, "">;
9
+ type LiteApprovalActionCard = ReturnType<typeof LiteApprovalActionCard>;
10
+ export default LiteApprovalActionCard;
@@ -0,0 +1,136 @@
1
+ <script lang="ts">
2
+ export interface AnnotationItem {
3
+ id: string;
4
+ type: string;
5
+ text?: string;
6
+ color?: string;
7
+ }
8
+
9
+ interface Props {
10
+ imageUrl?: string;
11
+ annotations?: AnnotationItem[];
12
+ title?: string;
13
+ formAction?: string;
14
+ class?: string;
15
+ }
16
+
17
+ let {
18
+ imageUrl = '',
19
+ annotations = [],
20
+ title = 'Image Annotation & Markings',
21
+ formAction = '',
22
+ class: className = '',
23
+ }: Props = $props();
24
+ </script>
25
+
26
+ <div class="sv-lite-annotation-box {className}">
27
+ <div class="sv-lite-anno-header">
28
+ <strong>{title}</strong>
29
+ <span class="sv-lite-anno-count">({annotations.length} markers)</span>
30
+ </div>
31
+
32
+ {#if imageUrl}
33
+ <div class="sv-lite-anno-preview">
34
+ <img src={imageUrl} alt="Annotation Target" class="sv-lite-anno-img" />
35
+ </div>
36
+ {/if}
37
+
38
+ {#if annotations.length > 0}
39
+ <div class="sv-lite-anno-list">
40
+ <div class="sv-lite-list-title">Annotations:</div>
41
+ {#each annotations as anno (anno.id)}
42
+ <div class="sv-lite-anno-item">
43
+ <span class="sv-lite-anno-badge">{anno.type}</span>
44
+ <span class="sv-lite-anno-text">{anno.text ?? 'Defect / Mark'}</span>
45
+ </div>
46
+ {/each}
47
+ </div>
48
+ {/if}
49
+
50
+ {#if formAction}
51
+ <div class="sv-lite-anno-upload">
52
+ <form method="POST" action={formAction} enctype="multipart/form-data">
53
+ <input type="file" name="annotatedImage" accept="image/*" class="sv-lite-file-input" />
54
+ <button type="submit" class="sv-lite-upload-btn">Upload Markup</button>
55
+ </form>
56
+ </div>
57
+ {/if}
58
+ </div>
59
+
60
+ <style>
61
+ .sv-lite-annotation-box {
62
+ display: block;
63
+ border: 1px solid #e2e8f0;
64
+ border-radius: 6px;
65
+ padding: 12px;
66
+ background-color: #ffffff;
67
+ font-size: 12px;
68
+ }
69
+ .sv-lite-anno-header {
70
+ margin-bottom: 10px;
71
+ font-size: 13px;
72
+ color: #0f172a;
73
+ }
74
+ .sv-lite-anno-count {
75
+ color: #64748b;
76
+ font-size: 11px;
77
+ margin-left: 6px;
78
+ }
79
+ .sv-lite-anno-preview {
80
+ text-align: center;
81
+ background-color: #f8fafc;
82
+ border: 1px solid #cbd5e1;
83
+ border-radius: 4px;
84
+ padding: 8px;
85
+ margin-bottom: 10px;
86
+ }
87
+ .sv-lite-anno-img {
88
+ max-width: 100%;
89
+ max-height: 240px;
90
+ vertical-align: middle;
91
+ }
92
+ .sv-lite-anno-list {
93
+ margin-bottom: 10px;
94
+ padding: 8px;
95
+ background-color: #f8fafc;
96
+ border-radius: 4px;
97
+ }
98
+ .sv-lite-list-title {
99
+ font-weight: 600;
100
+ color: #475569;
101
+ margin-bottom: 6px;
102
+ }
103
+ .sv-lite-anno-item {
104
+ margin-bottom: 4px;
105
+ }
106
+ .sv-lite-anno-badge {
107
+ display: inline-block;
108
+ padding: 1px 5px;
109
+ background-color: #fee2e2;
110
+ color: #991b1b;
111
+ border-radius: 3px;
112
+ font-size: 10px;
113
+ text-transform: uppercase;
114
+ margin-right: 6px;
115
+ }
116
+ .sv-lite-anno-text {
117
+ color: #334155;
118
+ }
119
+ .sv-lite-anno-upload {
120
+ padding-top: 8px;
121
+ border-top: 1px solid #e2e8f0;
122
+ }
123
+ .sv-lite-file-input {
124
+ font-size: 11px;
125
+ margin-right: 8px;
126
+ }
127
+ .sv-lite-upload-btn {
128
+ padding: 4px 10px;
129
+ font-size: 11px;
130
+ background-color: #4f46e5;
131
+ color: #ffffff;
132
+ border: none;
133
+ border-radius: 3px;
134
+ cursor: pointer;
135
+ }
136
+ </style>
@@ -0,0 +1,16 @@
1
+ export interface AnnotationItem {
2
+ id: string;
3
+ type: string;
4
+ text?: string;
5
+ color?: string;
6
+ }
7
+ interface Props {
8
+ imageUrl?: string;
9
+ annotations?: AnnotationItem[];
10
+ title?: string;
11
+ formAction?: string;
12
+ class?: string;
13
+ }
14
+ declare const LiteCanvasAnnotation: import("svelte").Component<Props, {}, "">;
15
+ type LiteCanvasAnnotation = ReturnType<typeof LiteCanvasAnnotation>;
16
+ export default LiteCanvasAnnotation;
@@ -0,0 +1,38 @@
1
+ <script lang="ts">
2
+ import type { FieldDefinition } from '@svadmin/core';
3
+
4
+ interface Props {
5
+ field: FieldDefinition;
6
+ action?: string;
7
+ }
8
+
9
+ let {
10
+ field,
11
+ action = '',
12
+ }: Props = $props();
13
+ </script>
14
+
15
+ <span class="lite-column-header-filter">
16
+ <a
17
+ href="{action}?filter_field={field.key}"
18
+ class="lite-filter-icon"
19
+ title="Filter by {field.label}"
20
+ >
21
+ 🔍
22
+ </a>
23
+ </span>
24
+
25
+ <style>
26
+ .lite-column-header-filter {
27
+ display: inline-block;
28
+ margin-left: 4px;
29
+ }
30
+ .lite-filter-icon {
31
+ font-size: 11px;
32
+ text-decoration: none;
33
+ opacity: 0.6;
34
+ }
35
+ .lite-filter-icon:hover {
36
+ opacity: 1;
37
+ }
38
+ </style>
@@ -0,0 +1,8 @@
1
+ import type { FieldDefinition } from '@svadmin/core';
2
+ interface Props {
3
+ field: FieldDefinition;
4
+ action?: string;
5
+ }
6
+ declare const LiteColumnHeaderFilter: import("svelte").Component<Props, {}, "">;
7
+ type LiteColumnHeaderFilter = ReturnType<typeof LiteColumnHeaderFilter>;
8
+ export default LiteColumnHeaderFilter;
@@ -0,0 +1,82 @@
1
+ <script lang="ts">
2
+ export interface LiteColumnOption {
3
+ key: string;
4
+ label: string;
5
+ visible: boolean;
6
+ }
7
+
8
+ interface Props {
9
+ columns: LiteColumnOption[];
10
+ action?: string;
11
+ method?: 'GET' | 'POST' | 'get' | 'post';
12
+ title?: string;
13
+ submitText?: string;
14
+ }
15
+
16
+ let {
17
+ columns = [],
18
+ action = '',
19
+ method = 'GET',
20
+ title = 'Column Visibility',
21
+ submitText = 'Apply',
22
+ }: Props = $props();
23
+ </script>
24
+
25
+ <div class="lite-column-settings lite-form-group">
26
+ <div class="lite-column-settings-title">
27
+ <strong>⚙ {title}</strong>
28
+ </div>
29
+ <form {action} {method} class="lite-column-settings-form">
30
+ <div class="lite-column-options">
31
+ {#each columns as col (col.key)}
32
+ <label class="lite-column-option">
33
+ <input
34
+ type="checkbox"
35
+ name="columns"
36
+ value={col.key}
37
+ checked={col.visible}
38
+ />
39
+ <span>{col.label}</span>
40
+ </label>
41
+ {/each}
42
+ </div>
43
+ <div class="lite-column-actions">
44
+ <button type="submit" class="lite-btn lite-btn-sm lite-btn-primary">
45
+ {submitText}
46
+ </button>
47
+ </div>
48
+ </form>
49
+ </div>
50
+
51
+ <style>
52
+ .lite-column-settings {
53
+ margin-bottom: 12px;
54
+ padding: 8px 12px;
55
+ background: #f8fafc;
56
+ border: 1px solid #cbd5e1;
57
+ border-radius: 4px;
58
+ }
59
+ .lite-column-settings-title {
60
+ font-size: 12px;
61
+ color: #475569;
62
+ margin-bottom: 6px;
63
+ }
64
+ .lite-column-options {
65
+ display: flex;
66
+ flex-wrap: wrap;
67
+ }
68
+ .lite-column-option {
69
+ display: inline-flex;
70
+ align-items: center;
71
+ margin-right: 12px;
72
+ margin-bottom: 4px;
73
+ font-size: 12px;
74
+ cursor: pointer;
75
+ }
76
+ .lite-column-option input {
77
+ margin-right: 4px;
78
+ }
79
+ .lite-column-actions {
80
+ margin-top: 6px;
81
+ }
82
+ </style>
@@ -0,0 +1,15 @@
1
+ export interface LiteColumnOption {
2
+ key: string;
3
+ label: string;
4
+ visible: boolean;
5
+ }
6
+ interface Props {
7
+ columns: LiteColumnOption[];
8
+ action?: string;
9
+ method?: 'GET' | 'POST' | 'get' | 'post';
10
+ title?: string;
11
+ submitText?: string;
12
+ }
13
+ declare const LiteColumnSettings: import("svelte").Component<Props, {}, "">;
14
+ type LiteColumnSettings = ReturnType<typeof LiteColumnSettings>;
15
+ export default LiteColumnSettings;
@@ -0,0 +1,178 @@
1
+ <script lang="ts">
2
+ export interface DecisionColumn {
3
+ key: string;
4
+ label: string;
5
+ type: 'condition' | 'action';
6
+ }
7
+
8
+ export interface DecisionRule {
9
+ id: string;
10
+ description?: string;
11
+ values: Record<string, string>;
12
+ }
13
+
14
+ interface Props {
15
+ title?: string;
16
+ columns?: DecisionColumn[];
17
+ rules?: DecisionRule[];
18
+ hitPolicy?: string;
19
+ formAction?: string;
20
+ class?: string;
21
+ }
22
+
23
+ let {
24
+ title = 'Decision Table Matrix',
25
+ columns = [
26
+ { key: 'tier', label: 'Tier', type: 'condition' },
27
+ { key: 'discount', label: 'Discount', type: 'action' },
28
+ ],
29
+ rules = [
30
+ { id: 'r1', description: 'VIP', values: { tier: 'VIP', discount: '20%' } },
31
+ { id: 'r2', description: 'Standard', values: { tier: 'Standard', discount: '10%' } },
32
+ ],
33
+ hitPolicy = 'FIRST',
34
+ formAction = '',
35
+ class: className = '',
36
+ }: Props = $props();
37
+
38
+ const conditionCols = $derived(columns.filter((c) => c.type === 'condition'));
39
+ const actionCols = $derived(columns.filter((c) => c.type === 'action'));
40
+ </script>
41
+
42
+ <div class="sv-lite-decision-container {className}">
43
+ <div class="sv-lite-decision-header">
44
+ <strong>{title}</strong>
45
+ <span class="sv-lite-hit-policy">[Policy: {hitPolicy}]</span>
46
+ </div>
47
+
48
+ <form method="POST" action={formAction}>
49
+ <table class="sv-lite-decision-table">
50
+ <thead>
51
+ <tr>
52
+ <th rowspan="2" class="sv-lite-th-idx">#</th>
53
+ <th colspan={conditionCols.length} class="sv-lite-th-cond">Conditions (IF)</th>
54
+ <th colspan={actionCols.length} class="sv-lite-th-act">Actions (THEN)</th>
55
+ </tr>
56
+ <tr>
57
+ {#each conditionCols as col (col.key)}
58
+ <th class="sv-lite-th-sub">{col.label}</th>
59
+ {/each}
60
+ {#each actionCols as col (col.key)}
61
+ <th class="sv-lite-th-sub">{col.label}</th>
62
+ {/each}
63
+ </tr>
64
+ </thead>
65
+ <tbody>
66
+ {#each rules as rule, idx (rule.id)}
67
+ <tr>
68
+ <td class="sv-lite-td-idx">{idx + 1}</td>
69
+ {#each conditionCols as col (col.key)}
70
+ <td>
71
+ <input
72
+ type="text"
73
+ name={`rule_${rule.id}_${col.key}`}
74
+ value={rule.values[col.key] ?? ''}
75
+ class="sv-lite-rule-input"
76
+ />
77
+ </td>
78
+ {/each}
79
+ {#each actionCols as col (col.key)}
80
+ <td>
81
+ <input
82
+ type="text"
83
+ name={`rule_${rule.id}_${col.key}`}
84
+ value={rule.values[col.key] ?? ''}
85
+ class="sv-lite-rule-input sv-lite-act-input"
86
+ />
87
+ </td>
88
+ {/each}
89
+ </tr>
90
+ {/each}
91
+ </tbody>
92
+ </table>
93
+
94
+ {#if formAction}
95
+ <div class="sv-lite-decision-actions">
96
+ <button type="submit" class="sv-lite-save-btn">Save Rules</button>
97
+ </div>
98
+ {/if}
99
+ </form>
100
+ </div>
101
+
102
+ <style>
103
+ .sv-lite-decision-container {
104
+ display: block;
105
+ border: 1px solid #e2e8f0;
106
+ border-radius: 6px;
107
+ padding: 12px;
108
+ background-color: #ffffff;
109
+ font-size: 12px;
110
+ overflow-x: auto;
111
+ }
112
+ .sv-lite-decision-header {
113
+ margin-bottom: 10px;
114
+ font-size: 13px;
115
+ color: #0f172a;
116
+ }
117
+ .sv-lite-hit-policy {
118
+ font-size: 10px;
119
+ color: #64748b;
120
+ margin-left: 6px;
121
+ }
122
+ .sv-lite-decision-table {
123
+ width: 100%;
124
+ border-collapse: collapse;
125
+ font-family: monospace;
126
+ }
127
+ .sv-lite-decision-table th, .sv-lite-decision-table td {
128
+ border: 1px solid #cbd5e1;
129
+ padding: 4px 6px;
130
+ }
131
+ .sv-lite-th-idx, .sv-lite-td-idx {
132
+ background-color: #f1f5f9;
133
+ text-align: center;
134
+ width: 28px;
135
+ font-size: 10px;
136
+ }
137
+ .sv-lite-th-cond {
138
+ background-color: #e0e7ff;
139
+ color: #3730a3;
140
+ text-align: center;
141
+ font-weight: bold;
142
+ }
143
+ .sv-lite-th-act {
144
+ background-color: #dcfce7;
145
+ color: #166534;
146
+ text-align: center;
147
+ font-weight: bold;
148
+ }
149
+ .sv-lite-th-sub {
150
+ background-color: #f8fafc;
151
+ color: #475569;
152
+ font-weight: 600;
153
+ }
154
+ .sv-lite-rule-input {
155
+ width: 100%;
156
+ border: 1px solid #cbd5e1;
157
+ padding: 3px;
158
+ font-size: 11px;
159
+ box-sizing: border-box;
160
+ }
161
+ .sv-lite-act-input {
162
+ font-weight: bold;
163
+ color: #4338ca;
164
+ }
165
+ .sv-lite-decision-actions {
166
+ margin-top: 10px;
167
+ text-align: right;
168
+ }
169
+ .sv-lite-save-btn {
170
+ padding: 5px 12px;
171
+ background-color: #4f46e5;
172
+ color: #ffffff;
173
+ border: none;
174
+ border-radius: 3px;
175
+ font-size: 11px;
176
+ cursor: pointer;
177
+ }
178
+ </style>
@@ -0,0 +1,21 @@
1
+ export interface DecisionColumn {
2
+ key: string;
3
+ label: string;
4
+ type: 'condition' | 'action';
5
+ }
6
+ export interface DecisionRule {
7
+ id: string;
8
+ description?: string;
9
+ values: Record<string, string>;
10
+ }
11
+ interface Props {
12
+ title?: string;
13
+ columns?: DecisionColumn[];
14
+ rules?: DecisionRule[];
15
+ hitPolicy?: string;
16
+ formAction?: string;
17
+ class?: string;
18
+ }
19
+ declare const LiteDecisionTable: import("svelte").Component<Props, {}, "">;
20
+ type LiteDecisionTable = ReturnType<typeof LiteDecisionTable>;
21
+ export default LiteDecisionTable;