orbcafe-ui 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -1
- package/dist/index.d.mts +252 -4
- package/dist/index.d.ts +252 -4
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,51 @@
|
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
+
## 重点组件:CMessageBox(请优先使用)
|
|
14
|
+
|
|
15
|
+
`CMessageBox` 是标准体系里用于统一提示/确认交互的基础分子组件,适用于:
|
|
16
|
+
|
|
17
|
+
- 删除确认
|
|
18
|
+
- 保存成功提示
|
|
19
|
+
- 警告/错误弹窗
|
|
20
|
+
- 通用信息提醒
|
|
21
|
+
|
|
22
|
+
> 建议在项目中统一使用 `CMessageBox`,避免各页面自行拼装不一致的 Dialog 样式。
|
|
23
|
+
|
|
24
|
+
### Import
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import { CMessageBox } from 'orbcafe-ui';
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 最小示例
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
const [open, setOpen] = useState(false);
|
|
34
|
+
|
|
35
|
+
<CMessageBox
|
|
36
|
+
open={open}
|
|
37
|
+
type="warning"
|
|
38
|
+
title="Delete Item"
|
|
39
|
+
message="Are you sure you want to delete this record?"
|
|
40
|
+
confirmText="Delete"
|
|
41
|
+
cancelText="Cancel"
|
|
42
|
+
onClose={() => setOpen(false)}
|
|
43
|
+
onConfirm={() => {
|
|
44
|
+
// do delete
|
|
45
|
+
setOpen(false);
|
|
46
|
+
}}
|
|
47
|
+
/>;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 标准约定
|
|
51
|
+
|
|
52
|
+
- `type`: `success | warning | error | info | default`
|
|
53
|
+
- 默认支持确认与取消按钮,可通过 `showCancel` 控制
|
|
54
|
+
- 建议所有业务确认弹窗统一走该组件,保证品牌与交互一致
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
13
58
|
## Installation
|
|
14
59
|
|
|
15
60
|
```bash
|
|
@@ -33,6 +78,53 @@ module.exports = {
|
|
|
33
78
|
|
|
34
79
|
---
|
|
35
80
|
|
|
81
|
+
## Internationalization (i18n)
|
|
82
|
+
|
|
83
|
+
ORBCAFE UI 标准组件已内置 6 种语言:
|
|
84
|
+
|
|
85
|
+
- `en` (English)
|
|
86
|
+
- `zh` (中文)
|
|
87
|
+
- `fr` (Français)
|
|
88
|
+
- `de` (Deutsch)
|
|
89
|
+
- `ja` (日本語)
|
|
90
|
+
- `ko` (한국어)
|
|
91
|
+
|
|
92
|
+
可通过 `OrbcafeI18nProvider` 或 `CAppPageLayout.locale` 统一控制语言。
|
|
93
|
+
|
|
94
|
+
### 方式 1:在应用根部包裹 Provider
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
import { OrbcafeI18nProvider } from 'orbcafe-ui';
|
|
98
|
+
|
|
99
|
+
<OrbcafeI18nProvider locale="de">
|
|
100
|
+
<YourApp />
|
|
101
|
+
</OrbcafeI18nProvider>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 方式 2:使用 PageLayout 时直接传 `locale`
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
<CAppPageLayout
|
|
108
|
+
appTitle="ORBCAFE"
|
|
109
|
+
locale="ja"
|
|
110
|
+
menuData={menuData}
|
|
111
|
+
>
|
|
112
|
+
{children}
|
|
113
|
+
</CAppPageLayout>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
组件内部统一使用同一套翻译 key,避免出现中英混搭。
|
|
117
|
+
|
|
118
|
+
### 国际化维护规范(必须)
|
|
119
|
+
|
|
120
|
+
- 所有标准组件可见文案必须通过 `useOrbcafeI18n().t()` 读取,不允许新增硬编码文案。
|
|
121
|
+
- 统一词条源:`src/i18n/messages.ts`。
|
|
122
|
+
- 新增文案时必须同时补齐 6 个语言分支:`en/zh/fr/de/ja/ko`。
|
|
123
|
+
- 业务字段值(如状态、类别)建议采用“稳定 value + 本地化 label”模式,避免筛选逻辑与展示文案耦合。
|
|
124
|
+
- 示例工程(`examples/app/std-report/page.tsx`)已按该模式实现,作为接入参考。
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
36
128
|
## ORBCAFE UI 标准化规范(Template Spec)
|
|
37
129
|
|
|
38
130
|
以下规范适用于“成形组件(Standard Component)”,例如:
|
|
@@ -169,4 +261,3 @@ const { navigationIslandProps } = useNavigationIsland({
|
|
|
169
261
|
## License
|
|
170
262
|
|
|
171
263
|
MIT
|
|
172
|
-
|
package/dist/index.d.mts
CHANGED
|
@@ -88,6 +88,53 @@ interface UseNavigationIslandResult {
|
|
|
88
88
|
*/
|
|
89
89
|
declare const useNavigationIsland: (options?: UseNavigationIslandOptions) => UseNavigationIslandResult;
|
|
90
90
|
|
|
91
|
+
/**
|
|
92
|
+
* @file 10_Frontend/components/sap/ui/Common/Molecules/CMessageBox.tsx
|
|
93
|
+
*
|
|
94
|
+
* @summary Core frontend CMessageBox module for the ORBAI Core project
|
|
95
|
+
* @author ORBAICODER
|
|
96
|
+
* @version 1.0.0
|
|
97
|
+
* @date 2025-01-19
|
|
98
|
+
*
|
|
99
|
+
* @description
|
|
100
|
+
* This file is responsible for:
|
|
101
|
+
* - Implementing CMessageBox functionality within frontend workflows
|
|
102
|
+
* - Integrating with shared ORBAI Core application processes under frontend
|
|
103
|
+
*
|
|
104
|
+
* @logic
|
|
105
|
+
* 1. Import required dependencies and configuration
|
|
106
|
+
* 2. Execute the primary logic for CMessageBox
|
|
107
|
+
* 3. Export the resulting APIs, hooks, or components for reuse
|
|
108
|
+
*
|
|
109
|
+
* @changelog
|
|
110
|
+
* V1.0.0 - 2025-01-19 - Initial creation
|
|
111
|
+
*/
|
|
112
|
+
/**
|
|
113
|
+
* File Overview
|
|
114
|
+
*
|
|
115
|
+
* START CODING
|
|
116
|
+
*
|
|
117
|
+
* --------------------------
|
|
118
|
+
* SECTION 1: CMessageBox Core Logic
|
|
119
|
+
* Section overview and description.
|
|
120
|
+
* --------------------------
|
|
121
|
+
*/
|
|
122
|
+
|
|
123
|
+
type CMessageBoxType = 'success' | 'warning' | 'error' | 'info' | 'default';
|
|
124
|
+
interface CMessageBoxProps {
|
|
125
|
+
open: boolean;
|
|
126
|
+
title?: string;
|
|
127
|
+
message?: string | React__default.ReactNode;
|
|
128
|
+
onClose: () => void;
|
|
129
|
+
onConfirm?: () => void;
|
|
130
|
+
confirmText?: string;
|
|
131
|
+
cancelText?: string;
|
|
132
|
+
showCancel?: boolean;
|
|
133
|
+
maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
134
|
+
type?: CMessageBoxType;
|
|
135
|
+
}
|
|
136
|
+
declare const CMessageBox: React__default.FC<CMessageBoxProps>;
|
|
137
|
+
|
|
91
138
|
interface GraphReportFieldMapping {
|
|
92
139
|
primaryDimension: string;
|
|
93
140
|
secondaryDimension: string;
|
|
@@ -106,6 +153,39 @@ interface GraphReportConfig {
|
|
|
106
153
|
statusFlagValues?: string[];
|
|
107
154
|
}
|
|
108
155
|
|
|
156
|
+
interface CTableQuickCreateConfig {
|
|
157
|
+
enabled?: boolean;
|
|
158
|
+
title?: string;
|
|
159
|
+
description?: string;
|
|
160
|
+
submitLabel?: string;
|
|
161
|
+
cancelLabel?: string;
|
|
162
|
+
fields?: string[];
|
|
163
|
+
excludeFields?: string[];
|
|
164
|
+
initialValues?: Record<string, any>;
|
|
165
|
+
onSubmit?: (payload: Record<string, any>) => void | Promise<void>;
|
|
166
|
+
}
|
|
167
|
+
interface CTableQuickEditConfig {
|
|
168
|
+
enabled?: boolean;
|
|
169
|
+
title?: string;
|
|
170
|
+
description?: string;
|
|
171
|
+
submitLabel?: string;
|
|
172
|
+
cancelLabel?: string;
|
|
173
|
+
fields?: string[];
|
|
174
|
+
excludeFields?: string[];
|
|
175
|
+
editableFields?: string[];
|
|
176
|
+
nonEditableFields?: string[];
|
|
177
|
+
primaryKeys?: string[];
|
|
178
|
+
getInitialValues?: (row: Record<string, any>) => Record<string, any>;
|
|
179
|
+
onSubmit?: (payload: Record<string, any>, row: Record<string, any>) => void | Promise<void>;
|
|
180
|
+
}
|
|
181
|
+
interface CTableQuickDeleteConfig {
|
|
182
|
+
enabled?: boolean;
|
|
183
|
+
title?: string;
|
|
184
|
+
message?: string;
|
|
185
|
+
confirmText?: string;
|
|
186
|
+
cancelText?: string;
|
|
187
|
+
onConfirm?: (rows: Record<string, any>[]) => void | Promise<void>;
|
|
188
|
+
}
|
|
109
189
|
interface CTableProps {
|
|
110
190
|
appId?: string;
|
|
111
191
|
title?: string;
|
|
@@ -137,6 +217,9 @@ interface CTableProps {
|
|
|
137
217
|
orderBy?: string;
|
|
138
218
|
onSortChange?: (property: string, direction: 'asc' | 'desc') => void;
|
|
139
219
|
graphReport?: GraphReportConfig;
|
|
220
|
+
quickCreate?: CTableQuickCreateConfig;
|
|
221
|
+
quickEdit?: CTableQuickEditConfig;
|
|
222
|
+
quickDelete?: CTableQuickDeleteConfig;
|
|
140
223
|
}
|
|
141
224
|
interface CTableHeadProps {
|
|
142
225
|
columns: any[];
|
|
@@ -165,6 +248,7 @@ interface CTableBodyProps {
|
|
|
165
248
|
loading?: boolean;
|
|
166
249
|
expandedGroups?: Set<string>;
|
|
167
250
|
toggleGroupExpand?: (groupId: string) => void;
|
|
251
|
+
isGroupFullyExpanded?: (groupId: string) => boolean;
|
|
168
252
|
handleExpandGroupRecursively?: (groupId: string) => void;
|
|
169
253
|
handleCollapseGroupRecursively?: (groupId: string) => void;
|
|
170
254
|
handleClick?: (event: React.MouseEvent, row: any) => void;
|
|
@@ -512,8 +596,10 @@ interface ReportMetadata {
|
|
|
512
596
|
interface UseStandardReportOptions {
|
|
513
597
|
metadata: ReportMetadata;
|
|
514
598
|
fetchData?: (params: any) => Promise<any>;
|
|
599
|
+
initialRowsPerPage?: number;
|
|
600
|
+
rowsPerPageOptions?: number[];
|
|
515
601
|
}
|
|
516
|
-
declare const useStandardReport: ({ metadata, fetchData }: UseStandardReportOptions) => {
|
|
602
|
+
declare const useStandardReport: ({ metadata, fetchData, initialRowsPerPage, rowsPerPageOptions, }: UseStandardReportOptions) => {
|
|
517
603
|
pageProps: CStandardPageProps;
|
|
518
604
|
filters: Record<string, any>;
|
|
519
605
|
rows: any[];
|
|
@@ -521,6 +607,162 @@ declare const useStandardReport: ({ metadata, fetchData }: UseStandardReportOpti
|
|
|
521
607
|
refresh: () => void;
|
|
522
608
|
};
|
|
523
609
|
|
|
610
|
+
type OrbcafeLocale = 'en' | 'zh' | 'fr' | 'de' | 'ja' | 'ko';
|
|
611
|
+
declare const en: {
|
|
612
|
+
readonly 'common.cancel': "Cancel";
|
|
613
|
+
readonly 'common.save': "Save";
|
|
614
|
+
readonly 'common.ok': "OK";
|
|
615
|
+
readonly 'common.done': "Done";
|
|
616
|
+
readonly 'common.search': "Search";
|
|
617
|
+
readonly 'common.none': "None";
|
|
618
|
+
readonly 'common.all': "All";
|
|
619
|
+
readonly 'common.noData': "No data";
|
|
620
|
+
readonly 'common.copy': "Copy";
|
|
621
|
+
readonly 'common.delete': "Delete";
|
|
622
|
+
readonly 'common.loading': "Loading...";
|
|
623
|
+
readonly 'header.searchPlaceholder': "Ask me...";
|
|
624
|
+
readonly 'header.theme.system': "Theme: System";
|
|
625
|
+
readonly 'header.theme.dark': "Theme: Dark";
|
|
626
|
+
readonly 'header.theme.light': "Theme: Light";
|
|
627
|
+
readonly 'header.menu.setting': "Setting";
|
|
628
|
+
readonly 'header.menu.logout': "Logout";
|
|
629
|
+
readonly 'navigation.expand': "Expand navigation";
|
|
630
|
+
readonly 'navigation.collapse': "Collapse navigation";
|
|
631
|
+
readonly 'navigation.searchPlaceholder': "Search menu...";
|
|
632
|
+
readonly 'navigation.noMatch': "No matching menu items";
|
|
633
|
+
readonly 'navigation.noAccessibleApp': "No accessible applications";
|
|
634
|
+
readonly 'navigation.noItems': "No items to display";
|
|
635
|
+
readonly 'navigation.expandView': "Expand {title}";
|
|
636
|
+
readonly 'table.toolbar.searchPlaceholder': "Search...";
|
|
637
|
+
readonly 'table.title.default': "Data Table";
|
|
638
|
+
readonly 'table.toolbar.groupBy': "Group By";
|
|
639
|
+
readonly 'table.toolbar.summary': "Summary";
|
|
640
|
+
readonly 'table.toolbar.columns': "Columns";
|
|
641
|
+
readonly 'table.toolbar.export': "Export";
|
|
642
|
+
readonly 'table.toolbar.itemsPerPage': "Items per page:";
|
|
643
|
+
readonly 'table.toolbar.pageOf': "Page {current} of {total}";
|
|
644
|
+
readonly 'table.toolbar.newItem': "New Item";
|
|
645
|
+
readonly 'table.toolbar.editItem': "Edit Item";
|
|
646
|
+
readonly 'table.toolbar.deleteItem': "Delete Item";
|
|
647
|
+
readonly 'table.toolbar.graphicReport': "Graphic Report";
|
|
648
|
+
readonly 'table.toolbar.saveLayout': "Save Layout";
|
|
649
|
+
readonly 'table.menu.groupBy': "Group By";
|
|
650
|
+
readonly 'table.menu.clearAll': "Clear All";
|
|
651
|
+
readonly 'table.menu.visibleColumns': "Visible Columns";
|
|
652
|
+
readonly 'table.menu.showSummaryRow': "Show Summary Row";
|
|
653
|
+
readonly 'table.menu.noNumericColumns': "No numeric columns";
|
|
654
|
+
readonly 'table.group.expandAll': "Expand All Groups";
|
|
655
|
+
readonly 'table.group.collapseAll': "Collapse All Groups";
|
|
656
|
+
readonly 'table.mobile.notImplemented': "Mobile View Not Implemented";
|
|
657
|
+
readonly 'smartFilter.adaptFilters': "Adapt Filters";
|
|
658
|
+
readonly 'smartFilter.addFilters': "Add Filters";
|
|
659
|
+
readonly 'smartFilter.go': "Go";
|
|
660
|
+
readonly 'smartFilter.visibleFilters': "Visible Filters";
|
|
661
|
+
readonly 'smartFilter.searchPlaceholder': "Search...";
|
|
662
|
+
readonly 'smartFilter.noOptionsFound': "No options found";
|
|
663
|
+
readonly 'smartFilter.min': "Min";
|
|
664
|
+
readonly 'smartFilter.max': "Max";
|
|
665
|
+
readonly 'smartFilter.minMaxPlaceholder': "Min - Max";
|
|
666
|
+
readonly 'smartFilter.operator.equals': "Equals";
|
|
667
|
+
readonly 'smartFilter.operator.contains': "Contains";
|
|
668
|
+
readonly 'smartFilter.operator.notContains': "Does Not Contain";
|
|
669
|
+
readonly 'smartFilter.operator.wildcard': "Wildcard Search";
|
|
670
|
+
readonly 'smartFilter.operator.notEquals': "Not Equals";
|
|
671
|
+
readonly 'smartFilter.operator.greaterThan': "Greater Than";
|
|
672
|
+
readonly 'smartFilter.operator.lessThan': "Less Than";
|
|
673
|
+
readonly 'smartFilter.operator.greaterOrEqual': "Greater Than or Equal";
|
|
674
|
+
readonly 'smartFilter.operator.lessOrEqual': "Less Than or Equal";
|
|
675
|
+
readonly 'smartFilter.operator.between': "Between";
|
|
676
|
+
readonly 'variant.noOptions': "No options";
|
|
677
|
+
readonly 'variant.defaultSuffix': "Default";
|
|
678
|
+
readonly 'variant.selectVariant': "Select Variant";
|
|
679
|
+
readonly 'variant.saveView': "Save View";
|
|
680
|
+
readonly 'variant.newVariant': "New Variant";
|
|
681
|
+
readonly 'variant.viewName': "View Name";
|
|
682
|
+
readonly 'variant.setDefault': "Set as Default";
|
|
683
|
+
readonly 'variant.publicAllUsers': "Public (All Users)";
|
|
684
|
+
readonly 'variant.toast.fetchFailed': "Failed to load variants";
|
|
685
|
+
readonly 'variant.toast.saveFailed': "Failed to save variant";
|
|
686
|
+
readonly 'variant.toast.saveSuccess': "Variant saved successfully";
|
|
687
|
+
readonly 'variant.toast.deleteFailed': "Failed to delete variant";
|
|
688
|
+
readonly 'variant.toast.deleteSuccess': "Variant deleted successfully";
|
|
689
|
+
readonly 'variant.toast.defaultFailed': "Failed to update default variant";
|
|
690
|
+
readonly 'variant.toast.defaultSuccess': "Default variant updated";
|
|
691
|
+
readonly 'layout.saveLayout': "Save Layout";
|
|
692
|
+
readonly 'layout.layoutOptions': "Layout Options";
|
|
693
|
+
readonly 'layout.selectLayout': "Select Layout";
|
|
694
|
+
readonly 'layout.saveCurrentLayout': "Save Current Layout...";
|
|
695
|
+
readonly 'layout.noSavedLayouts': "No saved layouts";
|
|
696
|
+
readonly 'layout.removeDefault': "Remove Default";
|
|
697
|
+
readonly 'layout.setAsDefault': "Set as Default";
|
|
698
|
+
readonly 'layout.layoutName': "Layout Name";
|
|
699
|
+
readonly 'layout.layoutDescription': "Description";
|
|
700
|
+
readonly 'layout.layoutNameHelper': "e.g., 'Compact View'";
|
|
701
|
+
readonly 'layout.warningOverwrite': "Warning: Existing layout will be overwritten";
|
|
702
|
+
readonly 'layout.useAsDefault': "Use as Default Layout";
|
|
703
|
+
readonly 'layout.publicAllUsers': "Public (Visible to all users)";
|
|
704
|
+
readonly 'layout.toast.loadFallback': "Failed to load layouts from backend, fallback to local storage";
|
|
705
|
+
readonly 'layout.toast.saveSuccess': "Layout saved successfully";
|
|
706
|
+
readonly 'layout.toast.saveLocalSuccess': "Layout saved to local storage";
|
|
707
|
+
readonly 'layout.toast.backendUnavailableSavedLocal': "Backend unavailable, saved to local storage";
|
|
708
|
+
readonly 'layout.toast.deleteSuccess': "Layout deleted successfully";
|
|
709
|
+
readonly 'layout.toast.deleteLocalSuccess': "Layout deleted from local storage";
|
|
710
|
+
readonly 'layout.toast.backendUnavailableDeletedLocal': "Backend unavailable, deleted from local storage";
|
|
711
|
+
readonly 'layout.toast.defaultSuccess': "Default layout set";
|
|
712
|
+
readonly 'layout.toast.defaultLocalSuccess': "Default layout set in local storage";
|
|
713
|
+
readonly 'layout.toast.backendUnavailableDefaultLocal': "Backend unavailable, default saved to local storage";
|
|
714
|
+
readonly 'dateRange.label': "Date Range";
|
|
715
|
+
readonly 'dateRange.startDate': "Start Date";
|
|
716
|
+
readonly 'dateRange.endDate': "End Date";
|
|
717
|
+
readonly 'dateRange.select': "Select...";
|
|
718
|
+
readonly 'dateRange.today': "Today";
|
|
719
|
+
readonly 'dateRange.thisWeek': "This Week";
|
|
720
|
+
readonly 'dateRange.thisMonth': "This Month";
|
|
721
|
+
readonly 'graph.records': "{count} records";
|
|
722
|
+
readonly 'graph.kpi.totalRecords': "Total Records";
|
|
723
|
+
readonly 'graph.kpi.totalReport': "Total Report";
|
|
724
|
+
readonly 'graph.kpi.totalBillable': "Total Billable";
|
|
725
|
+
readonly 'graph.kpi.efficiency': "Efficiency";
|
|
726
|
+
readonly 'graph.kpi.amount': "Amount";
|
|
727
|
+
readonly 'graph.kpi.flagged': "Flagged";
|
|
728
|
+
readonly 'graph.chart.billable.title': "Billable by Dimension";
|
|
729
|
+
readonly 'graph.chart.billable.subtitle': "Top values by billable hours";
|
|
730
|
+
readonly 'graph.chart.efficiency.title': "Efficiency by Person";
|
|
731
|
+
readonly 'graph.chart.efficiency.subtitle': "Lowest efficiency first";
|
|
732
|
+
readonly 'graph.chart.status.title': "Status Distribution";
|
|
733
|
+
readonly 'graph.chart.status.subtitle': "Record ratio by status";
|
|
734
|
+
readonly 'graph.dataBody': "Data Body";
|
|
735
|
+
readonly 'graph.reportTitle': "Graphic Report";
|
|
736
|
+
readonly 'graph.unassigned': "Unassigned";
|
|
737
|
+
readonly 'graph.column.reportHours': "Report Hours";
|
|
738
|
+
readonly 'graph.column.billableHours': "Billable Hours";
|
|
739
|
+
readonly 'quickCreate.newItem': "New Item";
|
|
740
|
+
readonly 'quickCreate.createWithTitle': "Create {title}";
|
|
741
|
+
readonly 'quickEdit.editWithTitle': "Edit {title}";
|
|
742
|
+
readonly 'quickDelete.confirmTitle': "Confirm Delete";
|
|
743
|
+
readonly 'quickDelete.confirmMessageSingle': "Are you sure you want to delete the selected record?";
|
|
744
|
+
readonly 'quickDelete.confirmMessageMultiple': "Are you sure you want to delete {count} selected records?";
|
|
745
|
+
readonly 'messageBox.confirm': "OK";
|
|
746
|
+
readonly 'messageBox.cancel': "Cancel";
|
|
747
|
+
};
|
|
748
|
+
type OrbcafeMessages = Record<keyof typeof en, string>;
|
|
749
|
+
type OrbcafeMessageKey = keyof OrbcafeMessages;
|
|
750
|
+
type OrbcafeMessageParams = Record<string, string | number>;
|
|
751
|
+
type OrbcafeLocaleMessages = Record<OrbcafeMessageKey, string>;
|
|
752
|
+
declare const ORBCAFE_I18N_MESSAGES: Record<OrbcafeLocale, OrbcafeLocaleMessages>;
|
|
753
|
+
|
|
754
|
+
interface OrbcafeI18nContextValue {
|
|
755
|
+
locale: OrbcafeLocale;
|
|
756
|
+
t: (key: OrbcafeMessageKey, params?: OrbcafeMessageParams) => string;
|
|
757
|
+
}
|
|
758
|
+
interface OrbcafeI18nProviderProps {
|
|
759
|
+
locale?: OrbcafeLocale;
|
|
760
|
+
messages?: Partial<Record<OrbcafeLocale, Partial<OrbcafeLocaleMessages>>>;
|
|
761
|
+
children: React__default.ReactNode;
|
|
762
|
+
}
|
|
763
|
+
declare const OrbcafeI18nProvider: ({ locale, messages, children, }: OrbcafeI18nProviderProps) => react_jsx_runtime.JSX.Element;
|
|
764
|
+
declare const useOrbcafeI18n: () => OrbcafeI18nContextValue;
|
|
765
|
+
|
|
524
766
|
interface CAppHeaderUser {
|
|
525
767
|
name: string;
|
|
526
768
|
subtitle?: string;
|
|
@@ -532,7 +774,10 @@ interface CAppHeaderProps {
|
|
|
532
774
|
logo?: ReactNode;
|
|
533
775
|
mode?: 'light' | 'dark' | 'system';
|
|
534
776
|
onToggleMode?: () => void;
|
|
777
|
+
locale?: OrbcafeLocale;
|
|
535
778
|
localeLabel?: string;
|
|
779
|
+
localeOptions?: OrbcafeLocale[];
|
|
780
|
+
onLocaleChange?: (locale: OrbcafeLocale) => void;
|
|
536
781
|
searchPlaceholder?: string;
|
|
537
782
|
onSearch?: (query: string) => void;
|
|
538
783
|
user?: CAppHeaderUser;
|
|
@@ -544,7 +789,10 @@ interface CAppPageLayoutProps {
|
|
|
544
789
|
menuData?: TreeMenuItem[];
|
|
545
790
|
children: ReactNode;
|
|
546
791
|
showNavigation?: boolean;
|
|
792
|
+
locale?: OrbcafeLocale;
|
|
547
793
|
localeLabel?: string;
|
|
794
|
+
localeOptions?: OrbcafeLocale[];
|
|
795
|
+
onLocaleChange?: (locale: OrbcafeLocale) => void;
|
|
548
796
|
user?: CAppHeaderUser;
|
|
549
797
|
logo?: ReactNode;
|
|
550
798
|
onSearch?: (query: string) => void;
|
|
@@ -553,9 +801,9 @@ interface CAppPageLayoutProps {
|
|
|
553
801
|
contentSx?: SxProps<Theme>;
|
|
554
802
|
}
|
|
555
803
|
|
|
556
|
-
declare const CAppPageLayout: ({ appTitle, menuData, children, showNavigation, localeLabel, user, logo, onSearch, rightHeaderSlot, leftHeaderSlot, contentSx, }: CAppPageLayoutProps) => react_jsx_runtime.JSX.Element;
|
|
804
|
+
declare const CAppPageLayout: ({ appTitle, menuData, children, showNavigation, locale, localeLabel, localeOptions, onLocaleChange, user, logo, onSearch, rightHeaderSlot, leftHeaderSlot, contentSx, }: CAppPageLayoutProps) => react_jsx_runtime.JSX.Element;
|
|
557
805
|
|
|
558
|
-
declare const CAppHeader: ({ appTitle, logo, mode, onToggleMode, localeLabel, searchPlaceholder, onSearch, user, leftSlot, rightSlot, }: CAppHeaderProps) => react_jsx_runtime.JSX.Element;
|
|
806
|
+
declare const CAppHeader: ({ appTitle, logo, mode, onToggleMode, locale: localeProp, localeLabel, localeOptions, onLocaleChange, searchPlaceholder, onSearch, user, leftSlot, rightSlot, }: CAppHeaderProps) => react_jsx_runtime.JSX.Element;
|
|
559
807
|
|
|
560
808
|
interface UsePageLayoutOptions {
|
|
561
809
|
menuData?: TreeMenuItem[];
|
|
@@ -566,4 +814,4 @@ declare const usePageLayout: ({ menuData, initialNavigationCollapsed, }?: UsePag
|
|
|
566
814
|
navigationMaxHeight: number;
|
|
567
815
|
};
|
|
568
816
|
|
|
569
|
-
export { Button, type ButtonProps, CAppHeader, type CAppHeaderProps, type CAppHeaderUser, CAppPageLayout, type CAppPageLayoutProps, CLayoutManagement, type CLayoutManagementProps, CLayoutManager, type CLayoutManagerProps, CPageLayout, type CPageLayoutProps, CSmartFilter, type CSmartFilterProps, CSmartTable, CStandardPage, type CStandardPageProps, CTable, CTableBody, type CTableBodyProps, CTableCell, type CTableCellProps, CTableContainer, type CTableContainerProps, CTableHead, type CTableHeadProps, type CTableProps, CTableRow, type CTableRowProps, CVariantManagement, type CVariantManagementProps, CVariantManager, type DateOperator, type FilterField, type FilterOperator, type FilterType, type FilterValue, type IVariantService, type LayoutMetadata, NavigationIsland, type NavigationIslandProps, type NumberOperator, type ReportColumn, type ReportFilter, type ReportMetadata, type SelectOperator, type TextOperator, TreeMenu, type TreeMenuItem, type UseNavigationIslandOptions, type UseNavigationIslandResult, type UsePageLayoutOptions, type UseStandardReportOptions, type VariantMetadata, buttonVariants, useNavigationIsland, usePageLayout, useStandardReport };
|
|
817
|
+
export { Button, type ButtonProps, CAppHeader, type CAppHeaderProps, type CAppHeaderUser, CAppPageLayout, type CAppPageLayoutProps, CLayoutManagement, type CLayoutManagementProps, CLayoutManager, type CLayoutManagerProps, CMessageBox, type CMessageBoxProps, type CMessageBoxType, CPageLayout, type CPageLayoutProps, CSmartFilter, type CSmartFilterProps, CSmartTable, CStandardPage, type CStandardPageProps, CTable, CTableBody, type CTableBodyProps, CTableCell, type CTableCellProps, CTableContainer, type CTableContainerProps, CTableHead, type CTableHeadProps, type CTableProps, type CTableQuickCreateConfig, type CTableQuickDeleteConfig, type CTableQuickEditConfig, CTableRow, type CTableRowProps, CVariantManagement, type CVariantManagementProps, CVariantManager, type DateOperator, type FilterField, type FilterOperator, type FilterType, type FilterValue, type IVariantService, type LayoutMetadata, NavigationIsland, type NavigationIslandProps, type NumberOperator, ORBCAFE_I18N_MESSAGES, type OrbcafeI18nContextValue, OrbcafeI18nProvider, type OrbcafeI18nProviderProps, type OrbcafeLocale, type OrbcafeLocaleMessages, type OrbcafeMessageKey, type OrbcafeMessageParams, type ReportColumn, type ReportFilter, type ReportMetadata, type SelectOperator, type TextOperator, TreeMenu, type TreeMenuItem, type UseNavigationIslandOptions, type UseNavigationIslandResult, type UsePageLayoutOptions, type UseStandardReportOptions, type VariantMetadata, buttonVariants, useNavigationIsland, useOrbcafeI18n, usePageLayout, useStandardReport };
|