@omnifyjp/shell 0.1.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.
- package/README.md +476 -0
- package/dist/chunk-6JYWZJEY.js +123 -0
- package/dist/chunk-6JYWZJEY.js.map +1 -0
- package/dist/chunk-ACCHC3AM.js +57 -0
- package/dist/chunk-ACCHC3AM.js.map +1 -0
- package/dist/chunk-EJEVW4RO.js +49 -0
- package/dist/chunk-EJEVW4RO.js.map +1 -0
- package/dist/chunk-OHORC3F5.js +72 -0
- package/dist/chunk-OHORC3F5.js.map +1 -0
- package/dist/chunk-OMIE3Z5N.js +661 -0
- package/dist/chunk-OMIE3Z5N.js.map +1 -0
- package/dist/chunk-OYE3TXTK.js +37 -0
- package/dist/chunk-OYE3TXTK.js.map +1 -0
- package/dist/chunk-Q3QWQG6P.js +91 -0
- package/dist/chunk-Q3QWQG6P.js.map +1 -0
- package/dist/chunk-QNCYBLHC.js +189 -0
- package/dist/chunk-QNCYBLHC.js.map +1 -0
- package/dist/chunk-SHHZRZMM.js +83 -0
- package/dist/chunk-SHHZRZMM.js.map +1 -0
- package/dist/chunk-WCRLQ5M5.js +235 -0
- package/dist/chunk-WCRLQ5M5.js.map +1 -0
- package/dist/chunk-YVUVYTVZ.js +224 -0
- package/dist/chunk-YVUVYTVZ.js.map +1 -0
- package/dist/components/AppShell.d.ts +27 -0
- package/dist/components/AppShell.js +11 -0
- package/dist/components/AppShell.js.map +1 -0
- package/dist/components/Header.d.ts +11 -0
- package/dist/components/Header.js +6 -0
- package/dist/components/Header.js.map +1 -0
- package/dist/components/OrganizationSelector.d.ts +8 -0
- package/dist/components/OrganizationSelector.js +4 -0
- package/dist/components/OrganizationSelector.js.map +1 -0
- package/dist/components/OrganizationSetupModal.d.ts +5 -0
- package/dist/components/OrganizationSetupModal.js +4 -0
- package/dist/components/OrganizationSetupModal.js.map +1 -0
- package/dist/components/PageContainer.d.ts +105 -0
- package/dist/components/PageContainer.js +3 -0
- package/dist/components/PageContainer.js.map +1 -0
- package/dist/components/ServiceMenu.d.ts +11 -0
- package/dist/components/ServiceMenu.js +3 -0
- package/dist/components/ServiceMenu.js.map +1 -0
- package/dist/components/Sidebar.d.ts +11 -0
- package/dist/components/Sidebar.js +5 -0
- package/dist/components/Sidebar.js.map +1 -0
- package/dist/contexts/OrganizationContext.d.ts +26 -0
- package/dist/contexts/OrganizationContext.js +3 -0
- package/dist/contexts/OrganizationContext.js.map +1 -0
- package/dist/contexts/ThemeContext.d.ts +14 -0
- package/dist/contexts/ThemeContext.js +3 -0
- package/dist/contexts/ThemeContext.js.map +1 -0
- package/dist/hooks/useDateFormat.d.ts +28 -0
- package/dist/hooks/useDateFormat.js +4 -0
- package/dist/hooks/useDateFormat.js.map +1 -0
- package/dist/i18n.d.ts +38 -0
- package/dist/i18n.js +3 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +89 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/locales/en.json","../src/locales/vi.json","../src/locales/ja.json","../src/i18n.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,UAAA,GAAA;AAAA,EACE,MAAA,EAAU;AAAA,IACR,IAAA,EAAQ,cAAA;AAAA,IACR,MAAA,EAAU,QAAA;AAAA,IACV,MAAA,EAAU,QAAA;AAAA,IACV,IAAA,EAAQ,MAAA;AAAA,IACR,IAAA,EAAQ,MAAA;AAAA,IACR,MAAA,EAAU,QAAA;AAAA,IACV,MAAA,EAAU,QAAA;AAAA,IACV,KAAA,EAAS,OAAA;AAAA,IACT,IAAA,EAAQ,MAAA;AAAA,IACR,IAAA,EAAQ,MAAA;AAAA,IACR,QAAA,EAAY,UAAA;AAAA,IACZ,MAAA,EAAU,QAAA;AAAA,IACV,IAAA,EAAQ,MA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ACjC;AAGA,IAAO,YAAA,GAAQ","file":"chunk-OMIE3Z5N.js","sourcesContent":["{\n \"common\": {\n \"save\": \"Save changes\",\n \"cancel\": \"Cancel\",\n \"delete\": \"Delete\",\n \"edit\": \"Edit\",\n \"copy\": \"Copy\",\n \"search\": \"Search\",\n \"filter\": \"Filter\",\n \"close\": \"Close\",\n \"back\": \"Back\",\n \"next\": \"Next\",\n \"complete\": \"Complete\",\n \"create\": \"Create\",\n \"send\": \"Send\",\n \"today\": \"Today\",\n \"yesterday\": \"Yesterday\",\n \"viewAll\": \"View all\",\n \"notFound\": \"Not found\",\n \"noData\": \"No data\",\n \"loading\": \"Loading...\",\n \"progress\": \"Progress\",\n \"members\": \"members\",\n \"tasks\": \"tasks\",\n \"completed\": \"completed\",\n \"days\": \"days\",\n \"download\": \"Download\",\n \"details\": \"Details\",\n \"preview\": \"Preview\",\n \"assignToMe\": \"Assign to me\"\n },\n \"sidebar\": {\n \"projects\": \"Projects\",\n \"documents\": \"Documents\",\n \"settings\": \"Settings\",\n \"recentProjects\": \"Recent Projects\",\n \"allProjects\": \"All Projects\",\n \"searchProject\": \"Search project...\",\n \"backToList\": \"Back to list\",\n \"collapse\": \"Collapse\",\n \"expandSidebar\": \"Expand sidebar\",\n \"collapseSidebar\": \"Collapse sidebar\"\n },\n \"header\": {\n \"searchPlaceholder\": \"Search tasks, projects...\",\n \"services\": \"Services\",\n \"notifications\": \"Notifications\",\n \"viewAllNotifications\": \"View all notifications\",\n \"myAccount\": \"My Account\",\n \"profile\": \"Profile\",\n \"logout\": \"Log out\",\n \"searchServices\": \"Search services...\",\n \"noServiceFound\": \"No service found\"\n },\n \"myTasks\": {\n \"title\": \"My Tasks\",\n \"count\": \"{{count}} tasks\",\n \"noTasks\": \"No tasks assigned\"\n },\n \"status\": {\n \"backlog\": \"Backlog\",\n \"todo\": \"To Do\",\n \"inProgress\": \"In Progress\",\n \"review\": \"Review\",\n \"done\": \"Done\"\n },\n \"priority\": {\n \"low\": \"Low\",\n \"medium\": \"Medium\",\n \"high\": \"High\",\n \"urgent\": \"Urgent\"\n },\n \"service\": {\n \"hr\": \"Human Resources (HR)\",\n \"employeeManagement\": \"Employee Management\",\n \"attendance\": \"Attendance\",\n \"training\": \"Training\",\n \"recruitment\": \"Recruitment\",\n \"accounting\": \"Accounting & Finance\",\n \"accountingLabel\": \"Accounting\",\n \"invoice\": \"Invoices\",\n \"cashFund\": \"Cash Fund\",\n \"financialReport\": \"Financial Reports\",\n \"sales\": \"Sales & Commerce\",\n \"pos\": \"Point of Sale (POS)\",\n \"payment\": \"Payments\",\n \"crm\": \"CRM\",\n \"marketing\": \"Marketing\",\n \"operations\": \"Operations\",\n \"warehouse\": \"Warehouse & Inventory\",\n \"shipping\": \"Shipping\",\n \"facilityManagement\": \"Facility Management\",\n \"maintenance\": \"Maintenance\",\n \"support\": \"Support & Others\",\n \"helpdesk\": \"Helpdesk\",\n \"reportBI\": \"Reports & BI\",\n \"systemSettings\": \"System Settings\"\n },\n \"notification\": {\n \"assignedTask\": \"assigned a task to you\",\n \"commentedTask\": \"commented on a task\",\n \"completedTask\": \"completed a task\",\n \"minutesAgo\": \"{{count}} minutes ago\",\n \"hoursAgo\": \"{{count}} hours ago\",\n \"daysAgo\": \"{{count}} days ago\"\n },\n \"org\": {\n \"noOrgSelected\": \"No organization selected\",\n \"noBranchSelected\": \"No branch selected\",\n \"selectOrg\": \"Select Organization\",\n \"selectBranch\": \"Select Branch\",\n \"selectOrgDesc\": \"Please select the organization you want to work with.\",\n \"selectBranchDesc\": \"Select a branch to continue.\",\n \"orgStep\": \"Organization\",\n \"branchStep\": \"Branch\",\n \"branchCount\": \"{{count}} branches\",\n \"selectedOrg\": \"Selected organization\",\n \"searchBranch\": \"Search branches...\",\n \"noBranchFound\": \"No branches found\"\n },\n \"settings\": {\n \"title\": \"Settings\",\n \"subtitle\": \"Manage your account and system preferences\",\n \"profileTab\": \"Profile\",\n \"notificationsTab\": \"Notifications\",\n \"securityTab\": \"Security\",\n \"preferencesTab\": \"Preferences\",\n \"personalInfo\": \"Personal Information\",\n \"personalInfoDesc\": \"Update your profile and avatar\",\n \"changePhoto\": \"Change photo\",\n \"photoHint\": \"JPG, PNG or GIF. Max 2MB\",\n \"firstName\": \"First name\",\n \"lastName\": \"Last name\",\n \"email\": \"Email\",\n \"phone\": \"Phone number\",\n \"bio\": \"Bio\",\n \"bioPlaceholder\": \"Write a few lines about yourself...\",\n \"saveSuccess\": \"Settings saved successfully!\",\n \"emailNotifications\": \"Email Notifications\",\n \"emailNotificationsDesc\": \"Manage email notifications\",\n \"receiveEmailNotif\": \"Receive email notifications\",\n \"receiveEmailNotifDesc\": \"Get emails about important activities\",\n \"taskUpdates\": \"Task updates\",\n \"taskUpdatesDesc\": \"Notify when tasks are assigned or updated\",\n \"newComments\": \"New comments\",\n \"newCommentsDesc\": \"Notify when someone comments on your tasks\",\n \"pushNotifications\": \"Push Notifications\",\n \"pushNotificationsDesc\": \"Manage browser notifications\",\n \"enablePush\": \"Enable push notifications\",\n \"enablePushDesc\": \"Show desktop notifications\",\n \"changePassword\": \"Change Password\",\n \"changePasswordDesc\": \"Update your password to secure your account\",\n \"currentPassword\": \"Current password\",\n \"newPassword\": \"New password\",\n \"confirmPassword\": \"Confirm new password\",\n \"updatePassword\": \"Update password\",\n \"passwordUpdated\": \"Password updated successfully!\",\n \"twoFactor\": \"Two-Factor Authentication\",\n \"twoFactorDesc\": \"Enhance account security with two-factor authentication\",\n \"enable2FA\": \"Enable 2FA\",\n \"enable2FADesc\": \"Require verification code on login\",\n \"appearance\": \"Appearance\",\n \"appearanceDesc\": \"Customize the interface to your preference\",\n \"theme\": \"Theme\",\n \"themeLight\": \"Light\",\n \"themeDark\": \"Dark\",\n \"themeSystem\": \"System\",\n \"language\": \"Language\",\n \"timezone\": \"Timezone\"\n },\n \"login\": {\n \"subtitle\": \"Efficient project management\",\n \"title\": \"Sign in\",\n \"emailLabel\": \"Email\",\n \"passwordLabel\": \"Password\",\n \"forgotPassword\": \"Forgot password?\",\n \"forgotPasswordMsg\": \"Password reset feature coming soon\",\n \"passwordPlaceholder\": \"Enter password\",\n \"rememberMe\": \"Remember me\",\n \"loggingIn\": \"Signing in...\",\n \"loginButton\": \"Sign in\",\n \"emptyFieldsError\": \"Please enter both email and password\",\n \"success\": \"Signed in successfully!\",\n \"demoPassword\": \"Password: anything\"\n },\n \"notFound\": {\n \"title\": \"Page not found\",\n \"description\": \"Sorry, the page you are looking for does not exist or has been moved.\",\n \"goBack\": \"Go back\",\n \"goHome\": \"Go home\"\n },\n \"datePicker\": {\n \"selectDate\": \"Select date\",\n \"selectDateRange\": \"Select date range\"\n }\n}\n","{\n \"common\": {\n \"save\": \"Lưu thay đổi\",\n \"cancel\": \"Hủy\",\n \"delete\": \"Xóa\",\n \"edit\": \"Chỉnh sửa\",\n \"copy\": \"Sao chép\",\n \"search\": \"Tìm kiếm\",\n \"filter\": \"Bộ lọc\",\n \"close\": \"Đóng\",\n \"back\": \"Quay lại\",\n \"next\": \"Tiếp theo\",\n \"complete\": \"Hoàn thành\",\n \"create\": \"Tạo\",\n \"send\": \"Gửi\",\n \"today\": \"Hôm nay\",\n \"yesterday\": \"Hôm qua\",\n \"viewAll\": \"Xem tất cả\",\n \"notFound\": \"Không tìm thấy\",\n \"noData\": \"Không có dữ liệu\",\n \"loading\": \"Đang tải...\",\n \"progress\": \"Tiến độ\",\n \"members\": \"thành viên\",\n \"tasks\": \"tasks\",\n \"completed\": \"hoàn thành\",\n \"days\": \"ngày\",\n \"download\": \"Tải xuống\",\n \"details\": \"Chi tiết\",\n \"preview\": \"Xem trước\",\n \"assignToMe\": \"Gán cho tôi\"\n },\n \"sidebar\": {\n \"projects\": \"Dự án\",\n \"documents\": \"Tài liệu\",\n \"settings\": \"Cài đặt\",\n \"recentProjects\": \"Dự án gần đây\",\n \"allProjects\": \"Tất cả dự án\",\n \"searchProject\": \"Tìm dự án...\",\n \"backToList\": \"Quay lại danh sách\",\n \"collapse\": \"Thu gọn\",\n \"expandSidebar\": \"Mở rộng sidebar\",\n \"collapseSidebar\": \"Thu gọn sidebar\"\n },\n \"header\": {\n \"searchPlaceholder\": \"Tìm kiếm task, dự án...\",\n \"services\": \"Dịch vụ\",\n \"notifications\": \"Thông báo\",\n \"viewAllNotifications\": \"Xem tất cả thông báo\",\n \"myAccount\": \"Tài khoản của tôi\",\n \"profile\": \"Hồ sơ\",\n \"logout\": \"Đăng xuất\",\n \"searchServices\": \"Tìm dịch vụ...\",\n \"noServiceFound\": \"Không tìm thấy dịch vụ\"\n },\n \"myTasks\": {\n \"title\": \"Task của tôi\",\n \"count\": \"{{count}} task\",\n \"noTasks\": \"Không có task nào được giao\"\n },\n \"status\": {\n \"backlog\": \"Backlog\",\n \"todo\": \"Cần làm\",\n \"inProgress\": \"Đang làm\",\n \"review\": \"Review\",\n \"done\": \"Hoàn thành\"\n },\n \"priority\": {\n \"low\": \"Low\",\n \"medium\": \"Medium\",\n \"high\": \"High\",\n \"urgent\": \"Urgent\"\n },\n \"service\": {\n \"hr\": \"Nhân sự (HR)\",\n \"employeeManagement\": \"Quản lý nhân viên\",\n \"attendance\": \"Chấm công\",\n \"training\": \"Đào tạo\",\n \"recruitment\": \"Tuyển dụng\",\n \"accounting\": \"Kế toán & Tài chính\",\n \"accountingLabel\": \"Kế toán\",\n \"invoice\": \"Hóa đơn\",\n \"cashFund\": \"Quỹ tiền mặt\",\n \"financialReport\": \"Báo cáo tài chính\",\n \"sales\": \"Kinh doanh & Bán hàng\",\n \"pos\": \"Bán hàng (POS)\",\n \"payment\": \"Thanh toán\",\n \"crm\": \"CRM\",\n \"marketing\": \"Marketing\",\n \"operations\": \"Vận hành\",\n \"warehouse\": \"Kho & Tồn kho\",\n \"shipping\": \"Vận chuyển\",\n \"facilityManagement\": \"Quản lý cơ sở\",\n \"maintenance\": \"Bảo trì\",\n \"support\": \"Hỗ trợ & Khác\",\n \"helpdesk\": \"Helpdesk\",\n \"reportBI\": \"Báo cáo & BI\",\n \"systemSettings\": \"Cài đặt hệ thống\"\n },\n \"notification\": {\n \"assignedTask\": \"đã giao task cho bạn\",\n \"commentedTask\": \"đã comment trong task\",\n \"completedTask\": \"đã hoàn thành task\",\n \"minutesAgo\": \"{{count}} phút trước\",\n \"hoursAgo\": \"{{count}} giờ trước\",\n \"daysAgo\": \"{{count}} ngày trước\"\n },\n \"org\": {\n \"noOrgSelected\": \"Chưa chọn tổ chức\",\n \"noBranchSelected\": \"Chưa chọn chi nhánh\",\n \"selectOrg\": \"Chọn Tổ chức\",\n \"selectBranch\": \"Chọn Chi nhánh\",\n \"selectOrgDesc\": \"Vui lòng chọn tổ chức bạn muốn làm việc.\",\n \"selectBranchDesc\": \"Chọn chi nhánh của tổ chức để tiếp tục.\",\n \"orgStep\": \"Tổ chức\",\n \"branchStep\": \"Chi nhánh\",\n \"branchCount\": \"{{count}} chi nhánh\",\n \"selectedOrg\": \"Tổ chức đã chọn\",\n \"searchBranch\": \"Tìm chi nhánh...\",\n \"noBranchFound\": \"Không tìm thấy chi nhánh\"\n },\n \"settings\": {\n \"title\": \"Cài đặt\",\n \"subtitle\": \"Quản lý thông tin tài khoản và tùy chỉnh hệ thống\",\n \"profileTab\": \"Hồ sơ\",\n \"notificationsTab\": \"Thông báo\",\n \"securityTab\": \"Bảo mật\",\n \"preferencesTab\": \"Tùy chỉnh\",\n \"personalInfo\": \"Thông tin cá nhân\",\n \"personalInfoDesc\": \"Cập nhật thông tin hồ sơ và ảnh đại diện của bạn\",\n \"changePhoto\": \"Thay đổi ảnh\",\n \"photoHint\": \"JPG, PNG hoặc GIF. Tối đa 2MB\",\n \"firstName\": \"Họ\",\n \"lastName\": \"Tên\",\n \"email\": \"Email\",\n \"phone\": \"Số điện thoại\",\n \"bio\": \"Giới thiệu\",\n \"bioPlaceholder\": \"Viết vài dòng về bản thân...\",\n \"saveSuccess\": \"Cài đặt đã được lưu thành công!\",\n \"emailNotifications\": \"Thông báo Email\",\n \"emailNotificationsDesc\": \"Quản lý thông báo gửi đến email của bạn\",\n \"receiveEmailNotif\": \"Nhận thông báo email\",\n \"receiveEmailNotifDesc\": \"Nhận email về các hoạt động quan trọng\",\n \"taskUpdates\": \"Cập nhật task\",\n \"taskUpdatesDesc\": \"Thông báo khi có task mới được giao hoặc cập nhật\",\n \"newComments\": \"Bình luận mới\",\n \"newCommentsDesc\": \"Thông báo khi có người bình luận trong task của bạn\",\n \"pushNotifications\": \"Thông báo Push\",\n \"pushNotificationsDesc\": \"Quản lý thông báo hiển thị trên trình duyệt\",\n \"enablePush\": \"Bật thông báo push\",\n \"enablePushDesc\": \"Hiển thị thông báo trên desktop\",\n \"changePassword\": \"Đổi mật khẩu\",\n \"changePasswordDesc\": \"Cập nhật mật khẩu để bảo vệ tài khoản của bạn\",\n \"currentPassword\": \"Mật khẩu hiện tại\",\n \"newPassword\": \"Mật khẩu mới\",\n \"confirmPassword\": \"Xác nhận mật khẩu mới\",\n \"updatePassword\": \"Cập nhật mật khẩu\",\n \"passwordUpdated\": \"Mật khẩu đã được cập nhật!\",\n \"twoFactor\": \"Xác thực hai yếu tố\",\n \"twoFactorDesc\": \"Tăng cường bảo mật tài khoản với xác thực hai yếu tố\",\n \"enable2FA\": \"Bật xác thực 2FA\",\n \"enable2FADesc\": \"Yêu cầu mã xác thực khi đăng nhập\",\n \"appearance\": \"Giao diện\",\n \"appearanceDesc\": \"Tùy chỉnh giao diện theo sở thích của bạn\",\n \"theme\": \"Chủ đề\",\n \"themeLight\": \"Sáng\",\n \"themeDark\": \"Tối\",\n \"themeSystem\": \"Theo hệ thống\",\n \"language\": \"Ngôn ngữ\",\n \"timezone\": \"Múi giờ\"\n },\n \"login\": {\n \"subtitle\": \"Quản lý dự án hiệu quả\",\n \"title\": \"Đăng nhập\",\n \"emailLabel\": \"Email\",\n \"passwordLabel\": \"Mật khẩu\",\n \"forgotPassword\": \"Quên mật khẩu?\",\n \"forgotPasswordMsg\": \"Tính năng đặt lại mật khẩu sẽ được triển khai sau\",\n \"passwordPlaceholder\": \"Nhập mật khẩu\",\n \"rememberMe\": \"Ghi nhớ đăng nhập\",\n \"loggingIn\": \"Đang đăng nhập...\",\n \"loginButton\": \"Đăng nhập\",\n \"emptyFieldsError\": \"Vui lòng nhập đầy đủ email và mật khẩu\",\n \"success\": \"Đăng nhập thành công!\",\n \"demoPassword\": \"Password: bất kỳ\"\n },\n \"notFound\": {\n \"title\": \"Không tìm thấy trang\",\n \"description\": \"Xin lỗi, trang bạn đang tìm kiếm không tồn tại hoặc đã được di chuyển.\",\n \"goBack\": \"Quay lại\",\n \"goHome\": \"Về trang chủ\"\n },\n \"datePicker\": {\n \"selectDate\": \"Chọn ngày\",\n \"selectDateRange\": \"Chọn khoảng ngày\"\n }\n}\n","{\n \"common\": {\n \"save\": \"変更を保存\",\n \"cancel\": \"キャンセル\",\n \"delete\": \"削除\",\n \"edit\": \"編集\",\n \"copy\": \"コピー\",\n \"search\": \"検索\",\n \"filter\": \"フィルター\",\n \"close\": \"閉じる\",\n \"back\": \"戻る\",\n \"next\": \"次へ\",\n \"complete\": \"完了\",\n \"create\": \"作成\",\n \"send\": \"送信\",\n \"today\": \"今日\",\n \"yesterday\": \"昨日\",\n \"viewAll\": \"すべて表示\",\n \"notFound\": \"見つかりません\",\n \"noData\": \"データなし\",\n \"loading\": \"読み込み中...\",\n \"progress\": \"進捗\",\n \"members\": \"メンバー\",\n \"tasks\": \"タスク\",\n \"completed\": \"完了\",\n \"days\": \"日\",\n \"download\": \"ダウンロード\",\n \"details\": \"詳細\",\n \"preview\": \"プレビュー\",\n \"assignToMe\": \"自分に割り当て\"\n },\n \"sidebar\": {\n \"projects\": \"プロジェクト\",\n \"documents\": \"ドキュメント\",\n \"settings\": \"設定\",\n \"recentProjects\": \"最近のプロジェクト\",\n \"allProjects\": \"すべてのプロジェクト\",\n \"searchProject\": \"プロジェクトを検索...\",\n \"backToList\": \"リストに戻る\",\n \"collapse\": \"折りたたむ\",\n \"expandSidebar\": \"サイドバーを展開\",\n \"collapseSidebar\": \"サイドバーを折りたたむ\"\n },\n \"header\": {\n \"searchPlaceholder\": \"タスク、プロジェクトを検索...\",\n \"services\": \"サービス\",\n \"notifications\": \"通知\",\n \"viewAllNotifications\": \"すべての通知を表示\",\n \"myAccount\": \"マイアカウント\",\n \"profile\": \"プロフィール\",\n \"logout\": \"ログアウト\",\n \"searchServices\": \"サービスを検索...\",\n \"noServiceFound\": \"サービスが見つかりません\"\n },\n \"myTasks\": {\n \"title\": \"マイタスク\",\n \"count\": \"{{count}} タスク\",\n \"noTasks\": \"割り当てられたタスクはありません\"\n },\n \"status\": {\n \"backlog\": \"バックログ\",\n \"todo\": \"未着手\",\n \"inProgress\": \"進行中\",\n \"review\": \"レビュー\",\n \"done\": \"完了\"\n },\n \"priority\": {\n \"low\": \"低\",\n \"medium\": \"中\",\n \"high\": \"高\",\n \"urgent\": \"緊急\"\n },\n \"service\": {\n \"hr\": \"人事 (HR)\",\n \"employeeManagement\": \"従業員管理\",\n \"attendance\": \"勤怠管理\",\n \"training\": \"研修\",\n \"recruitment\": \"採用\",\n \"accounting\": \"会計・財務\",\n \"accountingLabel\": \"会計\",\n \"invoice\": \"請求書\",\n \"cashFund\": \"現金管理\",\n \"financialReport\": \"財務レポート\",\n \"sales\": \"営業・販売\",\n \"pos\": \"POS販売\",\n \"payment\": \"決済\",\n \"crm\": \"CRM\",\n \"marketing\": \"マーケティング\",\n \"operations\": \"オペレーション\",\n \"warehouse\": \"倉庫・在庫\",\n \"shipping\": \"配送\",\n \"facilityManagement\": \"施設管理\",\n \"maintenance\": \"メンテナンス\",\n \"support\": \"サポート・その他\",\n \"helpdesk\": \"ヘルプデスク\",\n \"reportBI\": \"レポート & BI\",\n \"systemSettings\": \"システム設定\"\n },\n \"notification\": {\n \"assignedTask\": \"タスクを割り当てました\",\n \"commentedTask\": \"タスクにコメントしました\",\n \"completedTask\": \"タスクを完了しました\",\n \"minutesAgo\": \"{{count}}分前\",\n \"hoursAgo\": \"{{count}}時間前\",\n \"daysAgo\": \"{{count}}日前\"\n },\n \"org\": {\n \"noOrgSelected\": \"組織が未選択\",\n \"noBranchSelected\": \"支店が未選択\",\n \"selectOrg\": \"組織を選択\",\n \"selectBranch\": \"支店を選択\",\n \"selectOrgDesc\": \"作業する組織を選択してください。\",\n \"selectBranchDesc\": \"続行する支店を選択してください。\",\n \"orgStep\": \"組織\",\n \"branchStep\": \"支店\",\n \"branchCount\": \"{{count}} 支店\",\n \"selectedOrg\": \"選択された組織\",\n \"searchBranch\": \"支店を検索...\",\n \"noBranchFound\": \"支店が見つかりません\"\n },\n \"settings\": {\n \"title\": \"設定\",\n \"subtitle\": \"アカウントとシステム設定の管理\",\n \"profileTab\": \"プロフィール\",\n \"notificationsTab\": \"通知\",\n \"securityTab\": \"セキュリティ\",\n \"preferencesTab\": \"カスタマイズ\",\n \"personalInfo\": \"個人情報\",\n \"personalInfoDesc\": \"プロフィールとアバターを更新\",\n \"changePhoto\": \"写真を変更\",\n \"photoHint\": \"JPG、PNG、GIF。最大2MB\",\n \"firstName\": \"姓\",\n \"lastName\": \"名\",\n \"email\": \"メール\",\n \"phone\": \"電話番号\",\n \"bio\": \"自己紹介\",\n \"bioPlaceholder\": \"自己紹介を書いてください...\",\n \"saveSuccess\": \"設定が保存されました!\",\n \"emailNotifications\": \"メール通知\",\n \"emailNotificationsDesc\": \"メール通知の管理\",\n \"receiveEmailNotif\": \"メール通知を受信\",\n \"receiveEmailNotifDesc\": \"重要なアクティビティのメールを受信\",\n \"taskUpdates\": \"タスク更新\",\n \"taskUpdatesDesc\": \"タスクの割り当てや更新時に通知\",\n \"newComments\": \"新しいコメント\",\n \"newCommentsDesc\": \"タスクにコメントがあった時に通知\",\n \"pushNotifications\": \"プッシュ通知\",\n \"pushNotificationsDesc\": \"ブラウザ通知の管理\",\n \"enablePush\": \"プッシュ通知を有効化\",\n \"enablePushDesc\": \"デスクトップ通知を表示\",\n \"changePassword\": \"パスワード変更\",\n \"changePasswordDesc\": \"アカウントを保護するためにパスワードを更新\",\n \"currentPassword\": \"現在のパスワード\",\n \"newPassword\": \"新しいパスワード\",\n \"confirmPassword\": \"新しいパスワードの確認\",\n \"updatePassword\": \"パスワードを更新\",\n \"passwordUpdated\": \"パスワードが更新されました!\",\n \"twoFactor\": \"二要素認証\",\n \"twoFactorDesc\": \"二要素認証でアカウントセキュリティを強化\",\n \"enable2FA\": \"2FAを有効化\",\n \"enable2FADesc\": \"ログイン時に認証コードを要求\",\n \"appearance\": \"外観\",\n \"appearanceDesc\": \"お好みに合わせてインターフェースをカスタマイズ\",\n \"theme\": \"テーマ\",\n \"themeLight\": \"ライト\",\n \"themeDark\": \"ダーク\",\n \"themeSystem\": \"システム\",\n \"language\": \"言語\",\n \"timezone\": \"タイムゾーン\"\n },\n \"login\": {\n \"subtitle\": \"効率的なプロジェクト管理\",\n \"title\": \"ログイン\",\n \"emailLabel\": \"メール\",\n \"passwordLabel\": \"パスワード\",\n \"forgotPassword\": \"パスワードを忘れた?\",\n \"forgotPasswordMsg\": \"パスワードリセット機能は近日公開予定\",\n \"passwordPlaceholder\": \"パスワードを入力\",\n \"rememberMe\": \"ログインを記憶\",\n \"loggingIn\": \"ログイン中...\",\n \"loginButton\": \"ログイン\",\n \"emptyFieldsError\": \"メールとパスワードを入力してください\",\n \"success\": \"ログインに成功しました!\",\n \"demoPassword\": \"Password: 任意\"\n },\n \"notFound\": {\n \"title\": \"ページが見つかりません\",\n \"description\": \"申し訳ありませんが、お探しのページは存在しないか、移動されました。\",\n \"goBack\": \"戻る\",\n \"goHome\": \"ホームへ\"\n },\n \"datePicker\": {\n \"selectDate\": \"日付を選択\",\n \"selectDateRange\": \"期間を選択\"\n }\n}\n","import i18n from 'i18next';\nimport { initReactI18next } from 'react-i18next';\nimport shellEn from './locales/en.json';\nimport shellVi from './locales/vi.json';\nimport shellJa from './locales/ja.json';\n\nexport type SupportedLanguage = 'vi' | 'en' | 'ja';\n\nexport const languageNames: Record<SupportedLanguage, string> = {\n vi: 'Tiếng Việt',\n en: 'English',\n ja: '日本語',\n};\n\nfunction loadSavedLanguage(): SupportedLanguage {\n if (typeof window === 'undefined') return 'vi';\n const saved = localStorage.getItem('omnify_language');\n if (saved === 'vi' || saved === 'en' || saved === 'ja') return saved;\n return 'vi';\n}\n\n// Initialize i18next with shell namespace built-in\ni18n.use(initReactI18next).init({\n resources: {\n en: { shell: shellEn },\n vi: { shell: shellVi },\n ja: { shell: shellJa },\n },\n lng: loadSavedLanguage(),\n fallbackLng: 'vi',\n defaultNS: 'shell',\n fallbackNS: 'shell',\n ns: ['shell'],\n interpolation: {\n escapeValue: false, // React already escapes\n },\n});\n\nexport interface InitOmnifyI18nOptions {\n /** Add service-specific namespace translations */\n namespaces?: Record<string, Record<string, Record<string, unknown>>>;\n /** Override shell translation keys */\n overrides?: Record<string, Record<string, string>>;\n}\n\n/**\n * Initialize Omnify i18n for a service.\n * Call this once in your service's entry point.\n *\n * @example\n * ```ts\n * import { initOmnifyI18n } from '@omnifyjp/shell';\n * import pmVi from './locales/vi.json';\n * import pmEn from './locales/en.json';\n *\n * initOmnifyI18n({\n * namespaces: { pm: { vi: pmVi, en: pmEn } },\n * overrides: {\n * vi: { 'common.save': 'Lưu hồ sơ' },\n * }\n * });\n * ```\n */\nexport function initOmnifyI18n(options: InitOmnifyI18nOptions = {}) {\n const { namespaces, overrides } = options;\n\n // Add service namespaces\n if (namespaces) {\n for (const [ns, langs] of Object.entries(namespaces)) {\n for (const [lang, resources] of Object.entries(langs)) {\n i18n.addResourceBundle(lang, ns, resources, true, true);\n }\n }\n }\n\n // Apply overrides to shell namespace\n if (overrides) {\n for (const [lang, keys] of Object.entries(overrides)) {\n // Convert flat keys like 'common.save' to nested { common: { save: '...' } }\n const nested: Record<string, Record<string, string>> = {};\n for (const [flatKey, value] of Object.entries(keys)) {\n const parts = flatKey.split('.');\n if (parts.length === 2) {\n const [section, key] = parts;\n if (!nested[section]) nested[section] = {};\n nested[section][key] = value;\n }\n }\n i18n.addResourceBundle(lang, 'shell', nested, true, true);\n }\n }\n}\n\n/**\n * Change the current language.\n * Persists to localStorage and updates i18next.\n */\nexport function changeLanguage(lang: SupportedLanguage) {\n localStorage.setItem('omnify_language', lang);\n return i18n.changeLanguage(lang);\n}\n\nexport { i18n };\nexport default i18n;\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ThemeProvider } from './chunk-EJEVW4RO.js';
|
|
2
|
+
import { i18n } from './chunk-OMIE3Z5N.js';
|
|
3
|
+
import { Sidebar } from './chunk-YVUVYTVZ.js';
|
|
4
|
+
import { Header } from './chunk-Q3QWQG6P.js';
|
|
5
|
+
import { OrganizationSetupModal } from './chunk-QNCYBLHC.js';
|
|
6
|
+
import { OrganizationProvider } from './chunk-SHHZRZMM.js';
|
|
7
|
+
import { Outlet } from 'react-router';
|
|
8
|
+
import { I18nextProvider } from 'react-i18next';
|
|
9
|
+
import { Toaster } from '@omnifyjp/ui/components/sonner';
|
|
10
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
function AppShell({ config, extra }) {
|
|
13
|
+
const { organization } = config;
|
|
14
|
+
return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(I18nextProvider, { i18n, children: /* @__PURE__ */ jsx(
|
|
15
|
+
OrganizationProvider,
|
|
16
|
+
{
|
|
17
|
+
organizations: organization?.organizations,
|
|
18
|
+
branches: organization?.branches,
|
|
19
|
+
onOrganizationChange: organization?.onOrganizationChange,
|
|
20
|
+
onBranchChange: organization?.onBranchChange,
|
|
21
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex h-screen bg-background text-foreground", children: [
|
|
22
|
+
/* @__PURE__ */ jsx(Sidebar, { config }),
|
|
23
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col overflow-hidden", children: [
|
|
24
|
+
/* @__PURE__ */ jsx(Header, { config }),
|
|
25
|
+
/* @__PURE__ */ jsx("main", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsx(Outlet, {}) })
|
|
26
|
+
] }),
|
|
27
|
+
/* @__PURE__ */ jsx(Toaster, { richColors: true, position: "bottom-right" }),
|
|
28
|
+
extra,
|
|
29
|
+
/* @__PURE__ */ jsx(OrganizationSetupModal, {})
|
|
30
|
+
] })
|
|
31
|
+
}
|
|
32
|
+
) }) });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { AppShell };
|
|
36
|
+
//# sourceMappingURL=chunk-OYE3TXTK.js.map
|
|
37
|
+
//# sourceMappingURL=chunk-OYE3TXTK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AppShell.tsx"],"names":[],"mappings":";;;;;;;;;;;AAgCO,SAAS,QAAA,CAAS,EAAE,MAAA,EAAQ,KAAA,EAAM,EAAkB;AACzD,EAAA,MAAM,EAAE,cAAa,GAAI,MAAA;AAEzB,EAAA,uBACE,GAAA,CAAC,aAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,eAAA,EAAA,EAAgB,IAAA,EACf,QAAA,kBAAA,GAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACC,eAAe,YAAA,EAAc,aAAA;AAAA,MAC7B,UAAU,YAAA,EAAc,QAAA;AAAA,MACxB,sBAAsB,YAAA,EAAc,oBAAA;AAAA,MACpC,gBAAgB,YAAA,EAAc,cAAA;AAAA,MAE9B,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,6CAAA,EACb,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,WAAQ,MAAA,EAAgB,CAAA;AAAA,wBACzB,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,sCAAA,EACb,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,UAAO,MAAA,EAAgB,CAAA;AAAA,8BACvB,MAAA,EAAA,EAAK,SAAA,EAAU,sBAAA,EACd,QAAA,kBAAA,GAAA,CAAC,UAAO,CAAA,EACV;AAAA,SAAA,EACF,CAAA;AAAA,wBACA,GAAA,CAAC,OAAA,EAAA,EAAQ,UAAA,EAAU,IAAA,EAAC,UAAS,cAAA,EAAe,CAAA;AAAA,QAC3C,KAAA;AAAA,4BACA,sBAAA,EAAA,EAAuB;AAAA,OAAA,EAC1B;AAAA;AAAA,KAEJ,CAAA,EACF,CAAA;AAEJ","file":"chunk-OYE3TXTK.js","sourcesContent":["import { ReactNode } from 'react';\nimport { Outlet } from 'react-router';\nimport { I18nextProvider } from 'react-i18next';\nimport { Toaster } from '@omnifyjp/ui/components/sonner';\nimport { ThemeProvider } from '../contexts/ThemeContext';\nimport { OrganizationProvider } from '../contexts/OrganizationContext';\nimport { Sidebar } from './Sidebar';\nimport { Header } from './Header';\nimport { OrganizationSetupModal } from './OrganizationSetupModal';\nimport { i18n } from '../i18n';\nimport type { ShellConfig } from '../types';\n\ninterface AppShellProps {\n config: ShellConfig;\n /** Extra content to render alongside the main content (e.g., ChatWidget) */\n extra?: ReactNode;\n}\n\n/**\n * The main application shell.\n * Use as a route layout element in React Router:\n *\n * ```tsx\n * const router = createBrowserRouter([{\n * path: '/',\n * element: <AppShell config={config} />,\n * children: [\n * { index: true, element: <Dashboard /> },\n * ],\n * }]);\n * ```\n */\nexport function AppShell({ config, extra }: AppShellProps) {\n const { organization } = config;\n\n return (\n <ThemeProvider>\n <I18nextProvider i18n={i18n}>\n <OrganizationProvider\n organizations={organization?.organizations}\n branches={organization?.branches}\n onOrganizationChange={organization?.onOrganizationChange}\n onBranchChange={organization?.onBranchChange}\n >\n <div className=\"flex h-screen bg-background text-foreground\">\n <Sidebar config={config} />\n <div className=\"flex-1 flex flex-col overflow-hidden\">\n <Header config={config} />\n <main className=\"flex-1 overflow-auto\">\n <Outlet />\n </main>\n </div>\n <Toaster richColors position=\"bottom-right\" />\n {extra}\n <OrganizationSetupModal />\n </div>\n </OrganizationProvider>\n </I18nextProvider>\n </ThemeProvider>\n );\n}\n"]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ServiceMenu } from './chunk-ACCHC3AM.js';
|
|
2
|
+
import { OrganizationSelector } from './chunk-WCRLQ5M5.js';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { useNavigate } from 'react-router';
|
|
5
|
+
import { Button } from '@omnifyjp/ui/components/button';
|
|
6
|
+
import { Input } from '@omnifyjp/ui/components/input';
|
|
7
|
+
import { Avatar, AvatarImage, AvatarFallback } from '@omnifyjp/ui/components/avatar';
|
|
8
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem } from '@omnifyjp/ui/components/dropdown-menu';
|
|
9
|
+
import { Badge } from '@omnifyjp/ui/components/badge';
|
|
10
|
+
import { Search, Bell, User, Settings, LogOut } from 'lucide-react';
|
|
11
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
function Header({ config }) {
|
|
14
|
+
const navigate = useNavigate();
|
|
15
|
+
const { t } = useTranslation("shell");
|
|
16
|
+
const { services, header } = config;
|
|
17
|
+
const showSearch = header?.showSearch !== false;
|
|
18
|
+
return /* @__PURE__ */ jsxs("header", { className: "h-header bg-background border-b border-border px-page flex items-center justify-between", children: [
|
|
19
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 flex-1", children: [
|
|
20
|
+
/* @__PURE__ */ jsx(OrganizationSelector, {}),
|
|
21
|
+
services && services.length > 0 && /* @__PURE__ */ jsx(ServiceMenu, { categories: services }),
|
|
22
|
+
showSearch && /* @__PURE__ */ jsxs("div", { className: "relative max-w-md flex-1", children: [
|
|
23
|
+
/* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
|
|
24
|
+
/* @__PURE__ */ jsx(
|
|
25
|
+
Input,
|
|
26
|
+
{
|
|
27
|
+
type: "text",
|
|
28
|
+
placeholder: header?.searchPlaceholder || t("header.searchPlaceholder"),
|
|
29
|
+
className: "pl-10"
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
] })
|
|
33
|
+
] }),
|
|
34
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
35
|
+
header?.notifications && /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
36
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "icon", className: "relative", children: [
|
|
37
|
+
/* @__PURE__ */ jsx(Bell, { className: "w-5 h-5" }),
|
|
38
|
+
header.notifications.count > 0 && /* @__PURE__ */ jsx(
|
|
39
|
+
Badge,
|
|
40
|
+
{
|
|
41
|
+
variant: "destructive",
|
|
42
|
+
className: "absolute -top-1 -right-1 w-5 h-5 flex items-center justify-center p-0 text-xs",
|
|
43
|
+
children: header.notifications.count
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] }) }),
|
|
47
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-80", children: [
|
|
48
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: t("header.notifications") }),
|
|
49
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
50
|
+
header.notifications.content,
|
|
51
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
52
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { className: "text-center justify-center text-blue-600", children: t("header.viewAllNotifications") })
|
|
53
|
+
] })
|
|
54
|
+
] }),
|
|
55
|
+
header?.actions,
|
|
56
|
+
header?.user && /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
57
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsxs(Avatar, { className: "w-8 h-8", children: [
|
|
58
|
+
header.user.avatar && /* @__PURE__ */ jsx(AvatarImage, { src: header.user.avatar }),
|
|
59
|
+
/* @__PURE__ */ jsx(AvatarFallback, { children: header.user.name.split(" ").map((n) => n[0]).join("").slice(0, 2).toUpperCase() })
|
|
60
|
+
] }) }) }),
|
|
61
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", children: [
|
|
62
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: t("header.myAccount") }),
|
|
63
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
64
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { children: [
|
|
65
|
+
/* @__PURE__ */ jsx(User, { className: "w-4 h-4" }),
|
|
66
|
+
t("header.profile")
|
|
67
|
+
] }),
|
|
68
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx(Settings, { className: "w-4 h-4" }),
|
|
70
|
+
t("settings.title")
|
|
71
|
+
] }),
|
|
72
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
73
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: () => {
|
|
74
|
+
if (header.user?.onLogout) {
|
|
75
|
+
header.user.onLogout();
|
|
76
|
+
} else {
|
|
77
|
+
navigate("/login");
|
|
78
|
+
}
|
|
79
|
+
}, children: [
|
|
80
|
+
/* @__PURE__ */ jsx(LogOut, { className: "w-4 h-4" }),
|
|
81
|
+
t("header.logout")
|
|
82
|
+
] })
|
|
83
|
+
] })
|
|
84
|
+
] })
|
|
85
|
+
] })
|
|
86
|
+
] });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { Header };
|
|
90
|
+
//# sourceMappingURL=chunk-Q3QWQG6P.js.map
|
|
91
|
+
//# sourceMappingURL=chunk-Q3QWQG6P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Header.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAuBO,SAAS,MAAA,CAAO,EAAE,MAAA,EAAO,EAAgB;AAC9C,EAAA,MAAM,WAAW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AA,WAAA,EACpB;AAAA,SAAA,EACF;AAAA,OAAA,EACF;AAAA,KAAA,EAEJ;AAAA,GAAA,EACF,CAAA;AAEJ","file":"chunk-Q3QWQG6P.js","sourcesContent":["import { useTranslation } from 'react-i18next';\nimport { useNavigate } from 'react-router';\nimport { Button } from '@omnifyjp/ui/components/button';\nimport { Input } from '@omnifyjp/ui/components/input';\nimport { Avatar, AvatarImage, AvatarFallback } from '@omnifyjp/ui/components/avatar';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@omnifyjp/ui/components/dropdown-menu';\nimport { Badge } from '@omnifyjp/ui/components/badge';\nimport { Search, Bell, User, Settings, LogOut } from 'lucide-react';\nimport { OrganizationSelector } from './OrganizationSelector';\nimport { ServiceMenu } from './ServiceMenu';\nimport type { ShellConfig } from '../types';\n\ninterface HeaderProps {\n config: ShellConfig;\n}\n\nexport function Header({ config }: HeaderProps) {\n const navigate = useNavigate();\n const { t } = useTranslation('shell');\n const { services, header } = config;\n const showSearch = header?.showSearch !== false;\n\n return (\n <header className=\"h-header bg-background border-b border-border px-page flex items-center justify-between\">\n <div className=\"flex items-center gap-3 flex-1\">\n <OrganizationSelector />\n {services && services.length > 0 && (\n <ServiceMenu categories={services} />\n )}\n {showSearch && (\n <div className=\"relative max-w-md flex-1\">\n <Search className=\"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4\" />\n <Input\n type=\"text\"\n placeholder={header?.searchPlaceholder || t('header.searchPlaceholder')}\n className=\"pl-10\"\n />\n </div>\n )}\n </div>\n\n <div className=\"flex items-center gap-3\">\n {/* Notifications */}\n {header?.notifications && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"icon\" className=\"relative\">\n <Bell className=\"w-5 h-5\" />\n {header.notifications.count > 0 && (\n <Badge\n variant=\"destructive\"\n className=\"absolute -top-1 -right-1 w-5 h-5 flex items-center justify-center p-0 text-xs\"\n >\n {header.notifications.count}\n </Badge>\n )}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-80\">\n <DropdownMenuLabel>{t('header.notifications')}</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {header.notifications.content}\n <DropdownMenuSeparator />\n <DropdownMenuItem className=\"text-center justify-center text-blue-600\">\n {t('header.viewAllNotifications')}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n\n {/* Custom header actions (e.g., MyTasksDropdown) */}\n {header?.actions}\n\n {/* User Menu */}\n {header?.user && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"icon\">\n <Avatar className=\"w-8 h-8\">\n {header.user.avatar && (\n <AvatarImage src={header.user.avatar} />\n )}\n <AvatarFallback>\n {header.user.name.split(' ').map(n => n[0]).join('').slice(0, 2).toUpperCase()}\n </AvatarFallback>\n </Avatar>\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuLabel>{t('header.myAccount')}</DropdownMenuLabel>\n <DropdownMenuSeparator />\n <DropdownMenuItem>\n <User className=\"w-4 h-4\" />\n {t('header.profile')}\n </DropdownMenuItem>\n <DropdownMenuItem>\n <Settings className=\"w-4 h-4\" />\n {t('settings.title')}\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem onClick={() => {\n if (header.user?.onLogout) {\n header.user.onLogout();\n } else {\n navigate('/login');\n }\n }}>\n <LogOut className=\"w-4 h-4\" />\n {t('header.logout')}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </header>\n );\n}\n"]}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { useOrganization } from './chunk-SHHZRZMM.js';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { Button } from '@omnifyjp/ui/components/button';
|
|
5
|
+
import { Input } from '@omnifyjp/ui/components/input';
|
|
6
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '@omnifyjp/ui/components/dialog';
|
|
7
|
+
import { Building2, ArrowRight, MapPin, Check, Search } from 'lucide-react';
|
|
8
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
function OrganizationSetupModal() {
|
|
11
|
+
const {
|
|
12
|
+
organizations,
|
|
13
|
+
selectedOrganization,
|
|
14
|
+
selectedBranch,
|
|
15
|
+
setSelectedOrganization,
|
|
16
|
+
setSelectedBranch,
|
|
17
|
+
getBranchesByOrg,
|
|
18
|
+
isSetupComplete
|
|
19
|
+
} = useOrganization();
|
|
20
|
+
const { t } = useTranslation("shell");
|
|
21
|
+
const [step, setStep] = useState("organization");
|
|
22
|
+
const [tempOrgId, setTempOrgId] = useState("");
|
|
23
|
+
const [tempBranchId, setTempBranchId] = useState("");
|
|
24
|
+
const [branchSearch, setBranchSearch] = useState("");
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!isSetupComplete) {
|
|
27
|
+
if (!selectedOrganization) {
|
|
28
|
+
setStep("organization");
|
|
29
|
+
setTempOrgId("");
|
|
30
|
+
} else if (!selectedBranch) {
|
|
31
|
+
setStep("branch");
|
|
32
|
+
setTempBranchId("");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, [isSetupComplete, selectedOrganization, selectedBranch]);
|
|
36
|
+
const handleOrganizationNext = () => {
|
|
37
|
+
const org = organizations.find((o) => o.id === tempOrgId);
|
|
38
|
+
if (org) {
|
|
39
|
+
setSelectedOrganization(org);
|
|
40
|
+
setStep("branch");
|
|
41
|
+
setTempBranchId("");
|
|
42
|
+
setBranchSearch("");
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const handleBranchComplete = () => {
|
|
46
|
+
const branch = getBranchesByOrg(selectedOrganization.id).find((b) => b.id === tempBranchId);
|
|
47
|
+
if (branch) {
|
|
48
|
+
setSelectedBranch(branch);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const availableBranches = selectedOrganization ? getBranchesByOrg(selectedOrganization.id) : [];
|
|
52
|
+
const filteredBranches = availableBranches.filter(
|
|
53
|
+
(b) => b.name.toLowerCase().includes(branchSearch.toLowerCase()) || b.location?.toLowerCase().includes(branchSearch.toLowerCase())
|
|
54
|
+
);
|
|
55
|
+
return /* @__PURE__ */ jsx(Dialog, { open: !isSetupComplete, onOpenChange: () => {
|
|
56
|
+
}, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-[520px]", onInteractOutside: (e) => e.preventDefault(), children: [
|
|
57
|
+
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
58
|
+
/* @__PURE__ */ jsx(DialogTitle, { className: "text-xl font-semibold", children: step === "organization" ? t("org.selectOrg") : t("org.selectBranch") }),
|
|
59
|
+
/* @__PURE__ */ jsx(DialogDescription, { className: "text-sm", children: step === "organization" ? t("org.selectOrgDesc") : t("org.selectBranchDesc") })
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
|
|
62
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-6", children: [
|
|
63
|
+
/* @__PURE__ */ jsxs("div", { className: `flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium ${step === "organization" ? "bg-blue-50 text-blue-700 dark:bg-blue-500/15 dark:text-blue-400" : "bg-muted text-muted-foreground"}`, children: [
|
|
64
|
+
/* @__PURE__ */ jsx(Building2, { className: "w-4 h-4" }),
|
|
65
|
+
t("org.orgStep")
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ jsx(ArrowRight, { className: "w-4 h-4 text-muted-foreground" }),
|
|
68
|
+
/* @__PURE__ */ jsxs("div", { className: `flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium ${step === "branch" ? "bg-blue-50 text-blue-700 dark:bg-blue-500/15 dark:text-blue-400" : "bg-muted text-muted-foreground"}`, children: [
|
|
69
|
+
/* @__PURE__ */ jsx(MapPin, { className: "w-4 h-4" }),
|
|
70
|
+
t("org.branchStep")
|
|
71
|
+
] })
|
|
72
|
+
] }),
|
|
73
|
+
step === "organization" && /* @__PURE__ */ jsxs("div", { children: [
|
|
74
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-2", children: organizations.map((org) => /* @__PURE__ */ jsxs(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: `relative flex items-center gap-3 rounded-lg border-2 p-4 cursor-pointer transition-all ${tempOrgId === org.id ? "border-blue-500 bg-blue-50/50 dark:bg-blue-500/10" : "border-border hover:border-muted-foreground/30 hover:bg-accent"}`,
|
|
78
|
+
onClick: () => setTempOrgId(org.id),
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
className: "w-10 h-10 rounded-lg flex items-center justify-center text-white font-bold text-sm flex-shrink-0",
|
|
84
|
+
style: { backgroundColor: org.color },
|
|
85
|
+
children: org.shortName
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
89
|
+
/* @__PURE__ */ jsx("div", { className: "font-semibold text-base", children: org.name }),
|
|
90
|
+
org.description && /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: org.description }),
|
|
91
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground mt-1", children: t("org.branchCount", { count: getBranchesByOrg(org.id).length }) })
|
|
92
|
+
] }),
|
|
93
|
+
tempOrgId === org.id && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-6 h-6 rounded-full bg-blue-500 flex items-center justify-center", children: /* @__PURE__ */ jsx(Check, { className: "w-4 h-4 text-white" }) })
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
org.id
|
|
97
|
+
)) }),
|
|
98
|
+
/* @__PURE__ */ jsx("div", { className: "mt-6 flex justify-end", children: /* @__PURE__ */ jsxs(
|
|
99
|
+
Button,
|
|
100
|
+
{
|
|
101
|
+
onClick: handleOrganizationNext,
|
|
102
|
+
disabled: !tempOrgId,
|
|
103
|
+
size: "lg",
|
|
104
|
+
className: "gap-2",
|
|
105
|
+
children: [
|
|
106
|
+
t("common.next"),
|
|
107
|
+
/* @__PURE__ */ jsx(ArrowRight, { className: "w-4 h-4" })
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
) })
|
|
111
|
+
] }),
|
|
112
|
+
step === "branch" && selectedOrganization && /* @__PURE__ */ jsxs("div", { children: [
|
|
113
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-4 p-3 bg-muted rounded-lg border border-border", children: [
|
|
114
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground mb-1.5", children: t("org.selectedOrg") }),
|
|
115
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
116
|
+
/* @__PURE__ */ jsx(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
className: "w-8 h-8 rounded-lg flex items-center justify-center text-white font-bold text-xs",
|
|
120
|
+
style: { backgroundColor: selectedOrganization.color },
|
|
121
|
+
children: selectedOrganization.shortName
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: selectedOrganization.name })
|
|
125
|
+
] })
|
|
126
|
+
] }),
|
|
127
|
+
/* @__PURE__ */ jsxs("div", { className: "relative mb-3", children: [
|
|
128
|
+
/* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground" }),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
Input,
|
|
131
|
+
{
|
|
132
|
+
placeholder: t("org.searchBranch"),
|
|
133
|
+
value: branchSearch,
|
|
134
|
+
onChange: (e) => setBranchSearch(e.target.value),
|
|
135
|
+
className: "pl-9"
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
] }),
|
|
139
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-2 max-h-[280px] overflow-y-auto", children: filteredBranches.length === 0 ? /* @__PURE__ */ jsx("div", { className: "py-6 text-center text-sm text-muted-foreground", children: t("org.noBranchFound") }) : filteredBranches.map((branch) => /* @__PURE__ */ jsxs(
|
|
140
|
+
"div",
|
|
141
|
+
{
|
|
142
|
+
className: `relative flex items-center gap-3 rounded-lg border-2 p-4 cursor-pointer transition-all ${tempBranchId === branch.id ? "border-blue-500 bg-blue-50/50 dark:bg-blue-500/10" : "border-border hover:border-muted-foreground/30 hover:bg-accent"}`,
|
|
143
|
+
onClick: () => setTempBranchId(branch.id),
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded-lg bg-muted flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx(MapPin, { className: "w-5 h-5 text-muted-foreground" }) }),
|
|
146
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
147
|
+
/* @__PURE__ */ jsx("div", { className: "font-semibold text-base", children: branch.name }),
|
|
148
|
+
branch.location && /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: branch.location })
|
|
149
|
+
] }),
|
|
150
|
+
tempBranchId === branch.id && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-6 h-6 rounded-full bg-blue-500 flex items-center justify-center", children: /* @__PURE__ */ jsx(Check, { className: "w-4 h-4 text-white" }) })
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
branch.id
|
|
154
|
+
)) }),
|
|
155
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-6 flex justify-between", children: [
|
|
156
|
+
/* @__PURE__ */ jsx(
|
|
157
|
+
Button,
|
|
158
|
+
{
|
|
159
|
+
variant: "outline",
|
|
160
|
+
onClick: () => {
|
|
161
|
+
setStep("organization");
|
|
162
|
+
setSelectedOrganization(null);
|
|
163
|
+
setTempOrgId("");
|
|
164
|
+
},
|
|
165
|
+
children: t("common.back")
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
/* @__PURE__ */ jsxs(
|
|
169
|
+
Button,
|
|
170
|
+
{
|
|
171
|
+
onClick: handleBranchComplete,
|
|
172
|
+
disabled: !tempBranchId,
|
|
173
|
+
size: "lg",
|
|
174
|
+
className: "gap-2",
|
|
175
|
+
children: [
|
|
176
|
+
t("common.complete"),
|
|
177
|
+
/* @__PURE__ */ jsx(ArrowRight, { className: "w-4 h-4" })
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
] })
|
|
182
|
+
] })
|
|
183
|
+
] })
|
|
184
|
+
] }) });
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export { OrganizationSetupModal };
|
|
188
|
+
//# sourceMappingURL=chunk-QNCYBLHC.js.map
|
|
189
|
+
//# sourceMappingURL=chunk-QNCYBLHC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/OrganizationSetupModal.tsx"],"names":[],"mappings":";;;;;;;;;AAQO,SAAS,sBAAA,GAAyB;AACvC,EAAA,MAAM;AAAA,IACJ,aAAA;AAAA,IACA,oBAAA;AAAA,IACA,cAAA;AAAA,IACA,uBAAA;AAAA,IACA,iBAAA;AAAA,IACA,gBAAA;AAAA,IACA;AAAA,MACE,eAAA,EAAgB;AAEpB,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,cAAA,CAAe,OAAO,CAAA;AAEpC,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAoC,cAAc,CAAA;AAC1E,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAiB,EAAE,CAAA;AACrD,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAI,SAAiB,EAAE,CAAA;AAC3D,EAAA,MAAM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A;AAAA,gCACpB,GAAA,CAAC,UAAA,EAAA,EAAW,SAAA,EAAU,SAAA,EAAU;AAAA;AAAA;AAAA;AAClC,SAAA,EACF;AAAA,OAAA,EACF;AAAA,KAAA,EAEJ;AAAA,GAAA,EACF,CAAA,EACF,CAAA;AAEJ","file":"chunk-QNCYBLHC.js","sourcesContent":["import { useState, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useOrganization } from '../contexts/OrganizationContext';\nimport { Button } from '@omnifyjp/ui/components/button';\nimport { Input } from '@omnifyjp/ui/components/input';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@omnifyjp/ui/components/dialog';\nimport { Building2, MapPin, ArrowRight, Check, Search } from 'lucide-react';\n\nexport function OrganizationSetupModal() {\n const {\n organizations,\n selectedOrganization,\n selectedBranch,\n setSelectedOrganization,\n setSelectedBranch,\n getBranchesByOrg,\n isSetupComplete,\n } = useOrganization();\n\n const { t } = useTranslation('shell');\n\n const [step, setStep] = useState<'organization' | 'branch'>('organization');\n const [tempOrgId, setTempOrgId] = useState<string>('');\n const [tempBranchId, setTempBranchId] = useState<string>('');\n const [branchSearch, setBranchSearch] = useState('');\n\n useEffect(() => {\n if (!isSetupComplete) {\n if (!selectedOrganization) {\n setStep('organization');\n setTempOrgId('');\n } else if (!selectedBranch) {\n setStep('branch');\n setTempBranchId('');\n }\n }\n }, [isSetupComplete, selectedOrganization, selectedBranch]);\n\n const handleOrganizationNext = () => {\n const org = organizations.find(o => o.id === tempOrgId);\n if (org) {\n setSelectedOrganization(org);\n setStep('branch');\n setTempBranchId('');\n setBranchSearch('');\n }\n };\n\n const handleBranchComplete = () => {\n const branch = getBranchesByOrg(selectedOrganization!.id).find(b => b.id === tempBranchId);\n if (branch) {\n setSelectedBranch(branch);\n }\n };\n\n const availableBranches = selectedOrganization ? getBranchesByOrg(selectedOrganization.id) : [];\n const filteredBranches = availableBranches.filter((b) =>\n b.name.toLowerCase().includes(branchSearch.toLowerCase()) ||\n b.location?.toLowerCase().includes(branchSearch.toLowerCase())\n );\n\n return (\n <Dialog open={!isSetupComplete} onOpenChange={() => {}}>\n <DialogContent className=\"sm:max-w-[520px]\" onInteractOutside={(e) => e.preventDefault()}>\n <DialogHeader>\n <DialogTitle className=\"text-xl font-semibold\">\n {step === 'organization' ? t('org.selectOrg') : t('org.selectBranch')}\n </DialogTitle>\n <DialogDescription className=\"text-sm\">\n {step === 'organization'\n ? t('org.selectOrgDesc')\n : t('org.selectBranchDesc')}\n </DialogDescription>\n </DialogHeader>\n\n <div className=\"mt-4\">\n <div className=\"flex items-center gap-2 mb-6\">\n <div className={`flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium ${\n step === 'organization' ? 'bg-blue-50 text-blue-700 dark:bg-blue-500/15 dark:text-blue-400' : 'bg-muted text-muted-foreground'\n }`}>\n <Building2 className=\"w-4 h-4\" />\n {t('org.orgStep')}\n </div>\n <ArrowRight className=\"w-4 h-4 text-muted-foreground\" />\n <div className={`flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium ${\n step === 'branch' ? 'bg-blue-50 text-blue-700 dark:bg-blue-500/15 dark:text-blue-400' : 'bg-muted text-muted-foreground'\n }`}>\n <MapPin className=\"w-4 h-4\" />\n {t('org.branchStep')}\n </div>\n </div>\n\n {step === 'organization' && (\n <div>\n <div className=\"space-y-2\">\n {organizations.map((org) => (\n <div\n key={org.id}\n className={`relative flex items-center gap-3 rounded-lg border-2 p-4 cursor-pointer transition-all ${\n tempOrgId === org.id\n ? 'border-blue-500 bg-blue-50/50 dark:bg-blue-500/10'\n : 'border-border hover:border-muted-foreground/30 hover:bg-accent'\n }`}\n onClick={() => setTempOrgId(org.id)}\n >\n <div\n className=\"w-10 h-10 rounded-lg flex items-center justify-center text-white font-bold text-sm flex-shrink-0\"\n style={{ backgroundColor: org.color }}\n >\n {org.shortName}\n </div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"font-semibold text-base\">{org.name}</div>\n {org.description && (\n <div className=\"text-sm text-muted-foreground\">{org.description}</div>\n )}\n <div className=\"text-xs text-muted-foreground mt-1\">\n {t('org.branchCount', { count: getBranchesByOrg(org.id).length })}\n </div>\n </div>\n {tempOrgId === org.id && (\n <div className=\"flex-shrink-0 w-6 h-6 rounded-full bg-blue-500 flex items-center justify-center\">\n <Check className=\"w-4 h-4 text-white\" />\n </div>\n )}\n </div>\n ))}\n </div>\n\n <div className=\"mt-6 flex justify-end\">\n <Button\n onClick={handleOrganizationNext}\n disabled={!tempOrgId}\n size=\"lg\"\n className=\"gap-2\"\n >\n {t('common.next')}\n <ArrowRight className=\"w-4 h-4\" />\n </Button>\n </div>\n </div>\n )}\n\n {step === 'branch' && selectedOrganization && (\n <div>\n <div className=\"mb-4 p-3 bg-muted rounded-lg border border-border\">\n <div className=\"text-xs text-muted-foreground mb-1.5\">{t('org.selectedOrg')}</div>\n <div className=\"flex items-center gap-2\">\n <div\n className=\"w-8 h-8 rounded-lg flex items-center justify-center text-white font-bold text-xs\"\n style={{ backgroundColor: selectedOrganization.color }}\n >\n {selectedOrganization.shortName}\n </div>\n <span className=\"font-semibold\">{selectedOrganization.name}</span>\n </div>\n </div>\n\n <div className=\"relative mb-3\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground\" />\n <Input\n placeholder={t('org.searchBranch')}\n value={branchSearch}\n onChange={(e) => setBranchSearch(e.target.value)}\n className=\"pl-9\"\n />\n </div>\n\n <div className=\"space-y-2 max-h-[280px] overflow-y-auto\">\n {filteredBranches.length === 0 ? (\n <div className=\"py-6 text-center text-sm text-muted-foreground\">\n {t('org.noBranchFound')}\n </div>\n ) : (\n filteredBranches.map((branch) => (\n <div\n key={branch.id}\n className={`relative flex items-center gap-3 rounded-lg border-2 p-4 cursor-pointer transition-all ${\n tempBranchId === branch.id\n ? 'border-blue-500 bg-blue-50/50 dark:bg-blue-500/10'\n : 'border-border hover:border-muted-foreground/30 hover:bg-accent'\n }`}\n onClick={() => setTempBranchId(branch.id)}\n >\n <div className=\"w-10 h-10 rounded-lg bg-muted flex items-center justify-center flex-shrink-0\">\n <MapPin className=\"w-5 h-5 text-muted-foreground\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"font-semibold text-base\">{branch.name}</div>\n {branch.location && (\n <div className=\"text-sm text-muted-foreground\">{branch.location}</div>\n )}\n </div>\n {tempBranchId === branch.id && (\n <div className=\"flex-shrink-0 w-6 h-6 rounded-full bg-blue-500 flex items-center justify-center\">\n <Check className=\"w-4 h-4 text-white\" />\n </div>\n )}\n </div>\n ))\n )}\n </div>\n\n <div className=\"mt-6 flex justify-between\">\n <Button\n variant=\"outline\"\n onClick={() => {\n setStep('organization');\n setSelectedOrganization(null);\n setTempOrgId('');\n }}\n >\n {t('common.back')}\n </Button>\n <Button\n onClick={handleBranchComplete}\n disabled={!tempBranchId}\n size=\"lg\"\n className=\"gap-2\"\n >\n {t('common.complete')}\n <ArrowRight className=\"w-4 h-4\" />\n </Button>\n </div>\n </div>\n )}\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { createContext, useState, useEffect, useContext } from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/contexts/OrganizationContext.tsx
|
|
5
|
+
var OrganizationContext = createContext(void 0);
|
|
6
|
+
function loadSavedOrganization(organizations) {
|
|
7
|
+
if (typeof window === "undefined") return null;
|
|
8
|
+
const savedOrgId = localStorage.getItem("selectedOrganizationId");
|
|
9
|
+
if (savedOrgId) {
|
|
10
|
+
return organizations.find((o) => o.id === savedOrgId) ?? null;
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
function loadSavedBranch(branches) {
|
|
15
|
+
if (typeof window === "undefined") return null;
|
|
16
|
+
const savedBranchId = localStorage.getItem("selectedBranchId");
|
|
17
|
+
if (savedBranchId) {
|
|
18
|
+
return branches.find((b) => b.id === savedBranchId) ?? null;
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
function OrganizationProvider({
|
|
23
|
+
children,
|
|
24
|
+
organizations = [],
|
|
25
|
+
branches = [],
|
|
26
|
+
onOrganizationChange,
|
|
27
|
+
onBranchChange
|
|
28
|
+
}) {
|
|
29
|
+
const [selectedOrganization, setSelectedOrganizationState] = useState(
|
|
30
|
+
() => loadSavedOrganization(organizations)
|
|
31
|
+
);
|
|
32
|
+
const [selectedBranch, setSelectedBranchState] = useState(
|
|
33
|
+
() => loadSavedBranch(branches)
|
|
34
|
+
);
|
|
35
|
+
const setSelectedOrganization = (org) => {
|
|
36
|
+
setSelectedOrganizationState(org);
|
|
37
|
+
if (org) onOrganizationChange?.(org);
|
|
38
|
+
};
|
|
39
|
+
const setSelectedBranch = (branch) => {
|
|
40
|
+
setSelectedBranchState(branch);
|
|
41
|
+
if (branch) onBranchChange?.(branch);
|
|
42
|
+
};
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (selectedOrganization) {
|
|
45
|
+
localStorage.setItem("selectedOrganizationId", selectedOrganization.id);
|
|
46
|
+
} else {
|
|
47
|
+
localStorage.removeItem("selectedOrganizationId");
|
|
48
|
+
}
|
|
49
|
+
}, [selectedOrganization]);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (selectedBranch) {
|
|
52
|
+
localStorage.setItem("selectedBranchId", selectedBranch.id);
|
|
53
|
+
} else {
|
|
54
|
+
localStorage.removeItem("selectedBranchId");
|
|
55
|
+
}
|
|
56
|
+
}, [selectedBranch]);
|
|
57
|
+
const getBranchesByOrg = (orgId) => {
|
|
58
|
+
return branches.filter((b) => b.organizationId === orgId);
|
|
59
|
+
};
|
|
60
|
+
const isSetupComplete = selectedOrganization !== null && selectedBranch !== null;
|
|
61
|
+
const value = {
|
|
62
|
+
organizations,
|
|
63
|
+
branches,
|
|
64
|
+
selectedOrganization,
|
|
65
|
+
selectedBranch,
|
|
66
|
+
setSelectedOrganization,
|
|
67
|
+
setSelectedBranch,
|
|
68
|
+
getBranchesByOrg,
|
|
69
|
+
isSetupComplete
|
|
70
|
+
};
|
|
71
|
+
return /* @__PURE__ */ jsx(OrganizationContext.Provider, { value, children });
|
|
72
|
+
}
|
|
73
|
+
function useOrganization() {
|
|
74
|
+
const context = useContext(OrganizationContext);
|
|
75
|
+
if (context === void 0) {
|
|
76
|
+
throw new Error("useOrganization must be used within an OrganizationProvider");
|
|
77
|
+
}
|
|
78
|
+
return context;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { OrganizationProvider, useOrganization };
|
|
82
|
+
//# sourceMappingURL=chunk-SHHZRZMM.js.map
|
|
83
|
+
//# sourceMappingURL=chunk-SHHZRZMM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/contexts/OrganizationContext.tsx"],"names":[],"mappings":";;;;AAcA,IAAM,mBAAA,GAAsB,cAAmD,MAAS,CAAA;AAUxF,SAAS,sBAAsB,aAAA,EAAoD;AACjF,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,EAAa,OAAO,IAAA;AAC1C,EAAA,MAAM,UAAA,GAAa,YAAA,CAAa,OAAA,CAAQ,wBAAwB,CAAA;AAChE,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,OAAO,cAAc,IAAA,CAAK,CAAA,CAAA,KAAK,CAAA,CAAE,EAAA,KAAO,UAAU,CAAA,IAAK,IAAA;AAAA,EACzD;AACA,EAAA,OAAO,IAAA;AACT;AAEA,SAAS,gBAAgB,QAAA,EAAmC;AAC1D,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,EAAa,OAAO,IAAA;AAC1C,EAAA,MAAM,aAAA,GAAgB,YAAA,CAAa,OAAA,CAAQ,kBAAkB,CAAA;AAC7D,EAAA,IAAI,aAAA,EAAe;AACjB,IAAA,OAAO,SAAS,IAAA,CAAK,CAAA,CAAA,KAAK,CAAA,CAAE,EAAA,KAAO,aAAa,CAAA,I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,CAAC,cAAc,CAAC,CAAA;AAEnB,EAAA,MAAM,gBAAA,GAAmB,CAAC,KAAA,KAAkB;AAC1C,IAAA,OAAO,QAAA,CAAS,MAAA,CAAO,CAAA,CAAA,KAAK,CAAA,CAAE,mBAAmB,KAAK,CAAA;AAAA,EACxD,CAAA;AAEA,EAAA,MAAM,eAAA,GAAkB,oBAAA,KAAyB,IAAA,IAAQ,cAAA,KAAmB,IAAA;AAE5E,EAAA,MAAM,KAAA,GAAiC;AAAA,IACrC,aAAA;AAAA,IACA,QAAA;AAAA,IACA,oBAAA;AAAA,IACA,cAAA;AAAA,IACA,uBAAA;AAAA,IACA,iBAAA;AAAA,IACA,gBAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,uBACE,GAAA,CAAC,mBAAA,CAAoB,QAAA,EAApB,EAA6B,OAC3B,QAAA,EACH,CAAA;AAEJ;AAEO,SAAS,eAAA,GAAkB;AAChC,EAAA,MAAM,OAAA,GAAU,WAAW,mBAAmB,CAAA;AAC9C,EAAA,IAAI,YAAY,MAAA,EAAW;AACzB,IAAA,MAAM,IAAI,MAAM,6DAA6D,CAAA;AAAA,EAC/E;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-SHHZRZMM.js","sourcesContent":["import { createContext, useContext, useState, useEffect, ReactNode } from 'react';\nimport type { Organization, Branch } from '../types';\n\ninterface OrganizationContextType {\n organizations: Organization[];\n branches: Branch[];\n selectedOrganization: Organization | null;\n selectedBranch: Branch | null;\n setSelectedOrganization: (org: Organization | null) => void;\n setSelectedBranch: (branch: Branch | null) => void;\n getBranchesByOrg: (orgId: string) => Branch[];\n isSetupComplete: boolean;\n}\n\nconst OrganizationContext = createContext<OrganizationContextType | undefined>(undefined);\n\ninterface OrganizationProviderProps {\n children: ReactNode;\n organizations?: Organization[];\n branches?: Branch[];\n onOrganizationChange?: (org: Organization) => void;\n onBranchChange?: (branch: Branch) => void;\n}\n\nfunction loadSavedOrganization(organizations: Organization[]): Organization | null {\n if (typeof window === 'undefined') return null;\n const savedOrgId = localStorage.getItem('selectedOrganizationId');\n if (savedOrgId) {\n return organizations.find(o => o.id === savedOrgId) ?? null;\n }\n return null;\n}\n\nfunction loadSavedBranch(branches: Branch[]): Branch | null {\n if (typeof window === 'undefined') return null;\n const savedBranchId = localStorage.getItem('selectedBranchId');\n if (savedBranchId) {\n return branches.find(b => b.id === savedBranchId) ?? null;\n }\n return null;\n}\n\nexport function OrganizationProvider({\n children,\n organizations = [],\n branches = [],\n onOrganizationChange,\n onBranchChange,\n}: OrganizationProviderProps) {\n const [selectedOrganization, setSelectedOrganizationState] = useState<Organization | null>(\n () => loadSavedOrganization(organizations)\n );\n const [selectedBranch, setSelectedBranchState] = useState<Branch | null>(\n () => loadSavedBranch(branches)\n );\n\n const setSelectedOrganization = (org: Organization | null) => {\n setSelectedOrganizationState(org);\n if (org) onOrganizationChange?.(org);\n };\n\n const setSelectedBranch = (branch: Branch | null) => {\n setSelectedBranchState(branch);\n if (branch) onBranchChange?.(branch);\n };\n\n useEffect(() => {\n if (selectedOrganization) {\n localStorage.setItem('selectedOrganizationId', selectedOrganization.id);\n } else {\n localStorage.removeItem('selectedOrganizationId');\n }\n }, [selectedOrganization]);\n\n useEffect(() => {\n if (selectedBranch) {\n localStorage.setItem('selectedBranchId', selectedBranch.id);\n } else {\n localStorage.removeItem('selectedBranchId');\n }\n }, [selectedBranch]);\n\n const getBranchesByOrg = (orgId: string) => {\n return branches.filter(b => b.organizationId === orgId);\n };\n\n const isSetupComplete = selectedOrganization !== null && selectedBranch !== null;\n\n const value: OrganizationContextType = {\n organizations,\n branches,\n selectedOrganization,\n selectedBranch,\n setSelectedOrganization,\n setSelectedBranch,\n getBranchesByOrg,\n isSetupComplete,\n };\n\n return (\n <OrganizationContext.Provider value={value}>\n {children}\n </OrganizationContext.Provider>\n );\n}\n\nexport function useOrganization() {\n const context = useContext(OrganizationContext);\n if (context === undefined) {\n throw new Error('useOrganization must be used within an OrganizationProvider');\n }\n return context;\n}\n"]}
|