sgerp-frontend-lib 0.1.0 → 0.1.2
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 +1 -1
- package/dist/connection-manager.d.ts +48 -0
- package/dist/connection-manager.d.ts.map +1 -0
- package/dist/connection-manager.js +156 -0
- package/dist/index.js +20 -2
- package/dist/locales/locale-server.d.ts +10 -0
- package/dist/locales/locale-server.d.ts.map +1 -0
- package/dist/locales/locale-server.js +49 -0
- package/dist/locales/locale.d.ts +23 -0
- package/dist/locales/locale.d.ts.map +1 -0
- package/dist/locales/locale.js +145 -0
- package/dist/locales/locale_en.d.ts.map +1 -1
- package/dist/locales/locale_en.js +93 -9
- package/dist/locales/locale_ja.d.ts.map +1 -1
- package/dist/locales/locale_ja.js +93 -9
- package/dist/locales/locale_ms.d.ts.map +1 -1
- package/dist/locales/locale_ms.js +84 -9
- package/dist/locales/useLocalization.d.ts +11 -0
- package/dist/locales/useLocalization.d.ts.map +1 -0
- package/dist/locales/useLocalization.js +64 -0
- package/dist/locales.d.ts +228 -0
- package/dist/locales.d.ts.map +1 -0
- package/dist/locales.js +229 -0
- package/dist/sgerp/api/client.d.ts +45 -0
- package/dist/sgerp/api/client.d.ts.map +1 -0
- package/dist/sgerp/api/client.js +141 -0
- package/dist/sgerp/client.js +341 -0
- package/dist/sgerp/collection.d.ts +391 -0
- package/dist/sgerp/collection.d.ts.map +1 -0
- package/dist/sgerp/collection.js +756 -0
- package/dist/sgerp/collections/account/user.d.ts +8 -0
- package/dist/sgerp/collections/account/user.d.ts.map +1 -0
- package/dist/sgerp/collections/account/user.js +10 -0
- package/dist/sgerp/collections/masstransit/building.d.ts +26 -0
- package/dist/sgerp/collections/masstransit/building.d.ts.map +1 -0
- package/dist/sgerp/collections/masstransit/building.js +53 -0
- package/dist/sgerp/collections/masstransit/transitstop.d.ts +15 -0
- package/dist/sgerp/collections/masstransit/transitstop.d.ts.map +1 -0
- package/dist/sgerp/collections/masstransit/transitstop.js +54 -0
- package/dist/sgerp/collections/masstransit/transitstopset.d.ts +10 -0
- package/dist/sgerp/collections/masstransit/transitstopset.d.ts.map +1 -0
- package/dist/sgerp/collections/masstransit/transitstopset.js +10 -0
- package/dist/sgerp/collections/sharing/organization-project.d.ts +11 -0
- package/dist/sgerp/collections/sharing/organization-project.d.ts.map +1 -0
- package/dist/sgerp/collections/sharing/organization-project.js +13 -0
- package/dist/sgerp/collections/sharing/organization.d.ts +11 -0
- package/dist/sgerp/collections/sharing/organization.d.ts.map +1 -0
- package/dist/sgerp/collections/sharing/organization.js +13 -0
- package/dist/sgerp/collections/sharing/pricing.d.ts +18 -0
- package/dist/sgerp/collections/sharing/pricing.d.ts.map +1 -0
- package/dist/sgerp/collections/sharing/pricing.js +23 -0
- package/dist/sgerp/collections/sharing/project-member.d.ts +8 -0
- package/dist/sgerp/collections/sharing/project-member.d.ts.map +1 -0
- package/dist/sgerp/collections/sharing/project-member.js +10 -0
- package/dist/sgerp/collections/sharing/project.d.ts +8 -0
- package/dist/sgerp/collections/sharing/project.d.ts.map +1 -0
- package/dist/sgerp/collections/sharing/project.js +10 -0
- package/dist/sgerp/collections/simulation/booking.d.ts +11 -0
- package/dist/sgerp/collections/simulation/booking.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/booking.js +13 -0
- package/dist/sgerp/collections/simulation/dataset.d.ts +14 -0
- package/dist/sgerp/collections/simulation/dataset.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/dataset.js +17 -0
- package/dist/sgerp/collections/simulation/driver.d.ts +12 -0
- package/dist/sgerp/collections/simulation/driver.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/driver.js +40 -0
- package/dist/sgerp/collections/simulation/geofence.d.ts +24 -0
- package/dist/sgerp/collections/simulation/geofence.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/geofence.js +66 -0
- package/dist/sgerp/collections/simulation/mapboxtoken.d.ts +18 -0
- package/dist/sgerp/collections/simulation/mapboxtoken.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/mapboxtoken.js +24 -0
- package/dist/sgerp/collections/simulation/node.js +13 -0
- package/dist/sgerp/collections/simulation/operationslocation.d.ts +28 -0
- package/dist/sgerp/collections/simulation/operationslocation.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/operationslocation.js +64 -0
- package/dist/sgerp/collections/simulation/operationslocationgroup.d.ts +12 -0
- package/dist/sgerp/collections/simulation/operationslocationgroup.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/operationslocationgroup.js +24 -0
- package/dist/sgerp/collections/simulation/routingprofile.d.ts +10 -0
- package/dist/sgerp/collections/simulation/routingprofile.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/routingprofile.js +10 -0
- package/dist/sgerp/collections/simulation/simulation.d.ts +12 -0
- package/dist/sgerp/collections/simulation/simulation.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/simulation.js +35 -0
- package/dist/sgerp/collections/simulation/simulationprocessor.d.ts +19 -0
- package/dist/sgerp/collections/simulation/simulationprocessor.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/simulationprocessor.js +27 -0
- package/dist/sgerp/collections/simulation/vehicle.js +13 -0
- package/dist/sgerp/collections/simulation/vehicletype.d.ts +11 -0
- package/dist/sgerp/collections/simulation/vehicletype.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/vehicletype.js +13 -0
- package/dist/sgerp/collections/sms_notify/smsscheduled.d.ts +11 -0
- package/dist/sgerp/collections/sms_notify/smsscheduled.d.ts.map +1 -0
- package/dist/sgerp/collections/sms_notify/smsscheduled.js +13 -0
- package/dist/sgerp/collections/transportation/passenger.d.ts +8 -0
- package/dist/sgerp/collections/transportation/passenger.d.ts.map +1 -0
- package/dist/sgerp/collections/transportation/passenger.js +10 -0
- package/dist/sgerp/collections/transportation/ticket.d.ts +11 -0
- package/dist/sgerp/collections/transportation/ticket.d.ts.map +1 -0
- package/dist/sgerp/collections/transportation/ticket.js +13 -0
- package/dist/sgerp/collections/transportation/transaction.d.ts +11 -0
- package/dist/sgerp/collections/transportation/transaction.d.ts.map +1 -0
- package/dist/sgerp/collections/transportation/transaction.js +13 -0
- package/dist/sgerp/constants/bulkoperations-enums.d.ts +71 -0
- package/dist/sgerp/constants/bulkoperations-enums.d.ts.map +1 -0
- package/dist/sgerp/constants/bulkoperations-enums.js +99 -0
- package/dist/sgerp/constants/messages-enums.d.ts +47 -0
- package/dist/sgerp/constants/messages-enums.d.ts.map +1 -0
- package/dist/sgerp/constants/messages-enums.js +67 -0
- package/dist/sgerp/constants/scheduling-enums.d.ts +42 -0
- package/dist/sgerp/constants/scheduling-enums.d.ts.map +1 -0
- package/dist/sgerp/constants/scheduling-enums.js +61 -0
- package/dist/sgerp/constants/simulation-enums.d.ts +93 -0
- package/dist/sgerp/constants/simulation-enums.d.ts.map +1 -0
- package/dist/sgerp/constants/simulation-enums.js +147 -0
- package/dist/sgerp/constants/solver-strategies.d.ts +75 -0
- package/dist/sgerp/constants/solver-strategies.d.ts.map +1 -0
- package/dist/sgerp/constants/solver-strategies.js +26 -0
- package/dist/sgerp/context/sgerp-context.js +134 -0
- package/dist/sgerp/domains.d.ts +47 -0
- package/dist/sgerp/domains.d.ts.map +1 -0
- package/dist/sgerp/domains.js +45 -0
- package/dist/sgerp/hooks/use-collection.js +122 -0
- package/dist/sgerp/hooks/use-live-updates.js +16 -13
- package/dist/sgerp/index.js +153 -0
- package/dist/sgerp/map-states/operations-location-state.d.ts +12 -0
- package/dist/sgerp/map-states/operations-location-state.d.ts.map +1 -0
- package/dist/sgerp/map-states/operations-location-state.js +86 -0
- package/dist/sgerp/routing/index.d.ts +51 -0
- package/dist/sgerp/routing/index.d.ts.map +1 -0
- package/dist/sgerp/routing/index.js +373 -0
- package/dist/sgerp/simulation-logic/fetchUtils.js +226 -0
- package/dist/sgerp/simulation-logic/index.js +27 -7
- package/dist/sgerp/simulation-logic/manualEditUtils.js +69 -0
- package/dist/sgerp/simulation-logic/mapUtils.js +58 -0
- package/dist/sgerp/simulation-logic/optimisticUpdateUtils.js +8 -5
- package/dist/sgerp/simulation-logic/referenceUtils.js +110 -0
- package/dist/sgerp/simulation-logic/routeCalculationUtils.js +43 -0
- package/dist/sgerp/simulation-logic/timeShiftUtils.js +63 -0
- package/dist/sgerp/types/account/user.d.ts +38 -0
- package/dist/sgerp/types/account/user.d.ts.map +1 -0
- package/dist/sgerp/types/account/user.js +2 -0
- package/dist/sgerp/types/bulkoperations/index.d.ts +37 -0
- package/dist/sgerp/types/bulkoperations/index.d.ts.map +1 -0
- package/dist/sgerp/types/bulkoperations/index.js +35 -0
- package/dist/sgerp/types/bulkoperations/vehicle-upload.d.ts +335 -0
- package/dist/sgerp/types/bulkoperations/vehicle-upload.d.ts.map +1 -0
- package/dist/sgerp/types/bulkoperations/vehicle-upload.js +49 -0
- package/dist/sgerp/types/config.d.ts +25 -0
- package/dist/sgerp/types/config.d.ts.map +1 -0
- package/dist/sgerp/types/config.js +2 -0
- package/dist/sgerp/types/geojson.d.ts +45 -0
- package/dist/sgerp/types/geojson.d.ts.map +1 -0
- package/dist/sgerp/types/geojson.js +6 -0
- package/dist/sgerp/types/map.d.ts +24 -0
- package/dist/sgerp/types/map.d.ts.map +1 -0
- package/dist/sgerp/types/map.js +2 -0
- package/dist/sgerp/types/masstransit/building.d.ts +24 -0
- package/dist/sgerp/types/masstransit/building.d.ts.map +1 -0
- package/dist/sgerp/types/masstransit/building.js +2 -0
- package/dist/sgerp/types/masstransit/transitstop.d.ts +35 -0
- package/dist/sgerp/types/masstransit/transitstop.d.ts.map +1 -0
- package/dist/sgerp/types/masstransit/transitstop.js +2 -0
- package/dist/sgerp/types/masstransit/transitstopset.d.ts +14 -0
- package/dist/sgerp/types/masstransit/transitstopset.d.ts.map +1 -0
- package/dist/sgerp/types/masstransit/transitstopset.js +2 -0
- package/dist/sgerp/types/sharing/organization-project.d.ts +14 -0
- package/dist/sgerp/types/sharing/organization-project.d.ts.map +1 -0
- package/dist/sgerp/types/sharing/organization-project.js +2 -0
- package/dist/sgerp/types/sharing/organization.d.ts +14 -0
- package/dist/sgerp/types/sharing/organization.d.ts.map +1 -0
- package/dist/sgerp/types/sharing/organization.js +2 -0
- package/dist/sgerp/types/sharing/pricing.d.ts +98 -0
- package/dist/sgerp/types/sharing/pricing.d.ts.map +1 -0
- package/dist/sgerp/types/sharing/pricing.js +2 -0
- package/dist/sgerp/types/sharing/project-member.d.ts +15 -0
- package/dist/sgerp/types/sharing/project-member.d.ts.map +1 -0
- package/dist/sgerp/types/sharing/project-member.js +2 -0
- package/dist/sgerp/types/sharing/project.d.ts +16 -0
- package/dist/sgerp/types/sharing/project.d.ts.map +1 -0
- package/dist/sgerp/types/sharing/project.js +2 -0
- package/dist/sgerp/types/simulation/booking.d.ts +128 -0
- package/dist/sgerp/types/simulation/booking.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/booking.js +24 -0
- package/dist/sgerp/types/simulation/calculation-params.d.ts +20 -0
- package/dist/sgerp/types/simulation/calculation-params.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/calculation-params.js +2 -0
- package/dist/sgerp/types/simulation/dataset.d.ts +16 -0
- package/dist/sgerp/types/simulation/dataset.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/dataset.js +2 -0
- package/dist/sgerp/types/simulation/driver.d.ts +19 -0
- package/dist/sgerp/types/simulation/driver.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/driver.js +2 -0
- package/dist/sgerp/types/simulation/geofence.d.ts +19 -0
- package/dist/sgerp/types/simulation/geofence.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/geofence.js +2 -0
- package/dist/sgerp/types/simulation/logistics-api-settings.d.ts +98 -0
- package/dist/sgerp/types/simulation/logistics-api-settings.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/logistics-api-settings.js +104 -0
- package/dist/sgerp/types/simulation/mapboxtoken.d.ts +13 -0
- package/dist/sgerp/types/simulation/mapboxtoken.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/mapboxtoken.js +2 -0
- package/dist/sgerp/types/simulation/node.js +5 -2
- package/dist/sgerp/types/simulation/operationslocation.d.ts +40 -0
- package/dist/sgerp/types/simulation/operationslocation.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/operationslocation.js +2 -0
- package/dist/sgerp/types/simulation/operationslocationgroup.d.ts +11 -0
- package/dist/sgerp/types/simulation/operationslocationgroup.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/operationslocationgroup.js +2 -0
- package/dist/sgerp/types/simulation/pricing.d.ts +171 -0
- package/dist/sgerp/types/simulation/pricing.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/pricing.js +2 -0
- package/dist/sgerp/types/simulation/route-cost-modification.d.ts +35 -0
- package/dist/sgerp/types/simulation/route-cost-modification.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/route-cost-modification.js +5 -0
- package/dist/sgerp/types/simulation/routing-engine-settings.d.ts +42 -0
- package/dist/sgerp/types/simulation/routing-engine-settings.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/routing-engine-settings.js +35 -0
- package/dist/sgerp/types/simulation/routingprofile.d.ts +32 -0
- package/dist/sgerp/types/simulation/routingprofile.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/routingprofile.js +37 -0
- package/dist/sgerp/types/simulation/simulation.d.ts +120 -0
- package/dist/sgerp/types/simulation/simulation.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/simulation.js +2 -0
- package/dist/sgerp/types/simulation/simulationprocessor.d.ts +31 -0
- package/dist/sgerp/types/simulation/simulationprocessor.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/simulationprocessor.js +2 -0
- package/dist/sgerp/types/simulation/vehicle.js +2 -1
- package/dist/sgerp/types/simulation/vehicletype.d.ts +33 -0
- package/dist/sgerp/types/simulation/vehicletype.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/vehicletype.js +2 -0
- package/dist/sgerp/types/sms_notify/smsscheduled.d.ts +36 -0
- package/dist/sgerp/types/sms_notify/smsscheduled.d.ts.map +1 -0
- package/dist/sgerp/types/sms_notify/smsscheduled.js +6 -0
- package/dist/sgerp/types/transportation/passenger.d.ts +49 -0
- package/dist/sgerp/types/transportation/passenger.d.ts.map +1 -0
- package/dist/sgerp/types/transportation/passenger.js +13 -0
- package/dist/sgerp/types/transportation/ticket.d.ts +31 -0
- package/dist/sgerp/types/transportation/ticket.d.ts.map +1 -0
- package/dist/sgerp/types/transportation/ticket.js +2 -0
- package/dist/sgerp/types/transportation/transaction.d.ts +71 -0
- package/dist/sgerp/types/transportation/transaction.d.ts.map +1 -0
- package/dist/sgerp/types/transportation/transaction.js +54 -0
- package/dist/sgerp/utils/bookingPayload.d.ts +80 -0
- package/dist/sgerp/utils/bookingPayload.d.ts.map +1 -0
- package/dist/sgerp/utils/bookingPayload.js +44 -0
- package/dist/sgerp/utils/color.d.ts +30 -0
- package/dist/sgerp/utils/color.d.ts.map +1 -0
- package/dist/sgerp/utils/color.js +117 -0
- package/dist/sgerp/utils/enum-helpers.d.ts +41 -0
- package/dist/sgerp/utils/enum-helpers.d.ts.map +1 -0
- package/dist/sgerp/utils/enum-helpers.js +54 -0
- package/dist/sgerp/utils/routeUtils.js +171 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ npm install sgerp-frontend-lib
|
|
|
15
15
|
Install the complete library directly into your project:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npx shadcn@latest add https://
|
|
18
|
+
npx shadcn@latest add https://sgerp-frontend-lib.vercel.app/registry/lib/sgerp-lib
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
This copies all `sgerplib/sgerp` files into your project. You own the code and can modify it as needed.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Connection } from './sgerp/types/config';
|
|
2
|
+
export interface StoredConnection extends Connection {
|
|
3
|
+
lastUsed?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class ConnectionManager {
|
|
6
|
+
/**
|
|
7
|
+
* Get all stored connections from localStorage
|
|
8
|
+
*/
|
|
9
|
+
static getConnections(): StoredConnection[];
|
|
10
|
+
/**
|
|
11
|
+
* Get a specific connection by ID
|
|
12
|
+
*/
|
|
13
|
+
static getConnection(id: string): StoredConnection | null;
|
|
14
|
+
/**
|
|
15
|
+
* Save a connection to localStorage
|
|
16
|
+
*/
|
|
17
|
+
static saveConnection(connection: Connection): void;
|
|
18
|
+
/**
|
|
19
|
+
* Delete a connection from localStorage
|
|
20
|
+
*/
|
|
21
|
+
static deleteConnection(id: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Get the active connection ID
|
|
24
|
+
*/
|
|
25
|
+
static getActiveConnectionId(): string | null;
|
|
26
|
+
/**
|
|
27
|
+
* Get the active connection
|
|
28
|
+
*/
|
|
29
|
+
static getActiveConnection(): StoredConnection | null;
|
|
30
|
+
/**
|
|
31
|
+
* Set the active connection ID
|
|
32
|
+
*/
|
|
33
|
+
static setActiveConnection(id: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* Update the lastUsed timestamp for a connection
|
|
36
|
+
*/
|
|
37
|
+
static touchConnection(id: string): void;
|
|
38
|
+
/**
|
|
39
|
+
* Clear all connections
|
|
40
|
+
*/
|
|
41
|
+
static clearAll(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Subscribe to connection changes
|
|
44
|
+
* @returns Unsubscribe function
|
|
45
|
+
*/
|
|
46
|
+
static onChange(callback: () => void): () => void;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=connection-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-manager.d.ts","sourceRoot":"","sources":["../sgerplib/connection-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAMvD,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAWD,qBAAa,iBAAiB;IAC5B;;OAEG;IACH,MAAM,CAAC,cAAc,IAAI,gBAAgB,EAAE;IAY3C;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAKzD;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IA+BnD;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAoBzC;;OAEG;IACH,MAAM,CAAC,qBAAqB,IAAI,MAAM,GAAG,IAAI;IAW7C;;OAEG;IACH,MAAM,CAAC,mBAAmB,IAAI,gBAAgB,GAAG,IAAI;IAKrD;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAW5C;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAOxC;;OAEG;IACH,MAAM,CAAC,QAAQ,IAAI,IAAI;IAYvB;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;CAOlD"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectionManager = void 0;
|
|
4
|
+
const STORAGE_KEY = 'sgerp_connections';
|
|
5
|
+
const ACTIVE_CONNECTION_KEY = 'sgerp_active_connection';
|
|
6
|
+
const CONNECTION_CHANGE_EVENT = 'sgerp_connection_change';
|
|
7
|
+
/**
|
|
8
|
+
* Dispatch a custom event to notify components of connection changes
|
|
9
|
+
*/
|
|
10
|
+
function notifyConnectionChange() {
|
|
11
|
+
if (typeof window !== 'undefined') {
|
|
12
|
+
window.dispatchEvent(new CustomEvent(CONNECTION_CHANGE_EVENT));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
class ConnectionManager {
|
|
16
|
+
/**
|
|
17
|
+
* Get all stored connections from localStorage
|
|
18
|
+
*/
|
|
19
|
+
static getConnections() {
|
|
20
|
+
if (typeof window === 'undefined')
|
|
21
|
+
return [];
|
|
22
|
+
try {
|
|
23
|
+
const stored = localStorage.getItem(STORAGE_KEY);
|
|
24
|
+
return stored ? JSON.parse(stored) : [];
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error('Failed to load connections:', error);
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get a specific connection by ID
|
|
33
|
+
*/
|
|
34
|
+
static getConnection(id) {
|
|
35
|
+
const connections = this.getConnections();
|
|
36
|
+
return connections.find(conn => conn.id === id) || null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Save a connection to localStorage
|
|
40
|
+
*/
|
|
41
|
+
static saveConnection(connection) {
|
|
42
|
+
if (typeof window === 'undefined')
|
|
43
|
+
return;
|
|
44
|
+
try {
|
|
45
|
+
const connections = this.getConnections();
|
|
46
|
+
const existingIndex = connections.findIndex(conn => conn.id === connection.id);
|
|
47
|
+
const storedConnection = Object.assign(Object.assign({}, connection), { lastUsed: new Date().toISOString() });
|
|
48
|
+
if (existingIndex >= 0) {
|
|
49
|
+
connections[existingIndex] = storedConnection;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
connections.push(storedConnection);
|
|
53
|
+
}
|
|
54
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(connections));
|
|
55
|
+
// Set as active connection if it's the first one
|
|
56
|
+
if (connections.length === 1) {
|
|
57
|
+
this.setActiveConnection(connection.id);
|
|
58
|
+
}
|
|
59
|
+
notifyConnectionChange();
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
console.error('Failed to save connection:', error);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Delete a connection from localStorage
|
|
67
|
+
*/
|
|
68
|
+
static deleteConnection(id) {
|
|
69
|
+
if (typeof window === 'undefined')
|
|
70
|
+
return;
|
|
71
|
+
try {
|
|
72
|
+
const connections = this.getConnections();
|
|
73
|
+
const filtered = connections.filter(conn => conn.id !== id);
|
|
74
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(filtered));
|
|
75
|
+
// If we deleted the active connection, clear it
|
|
76
|
+
if (this.getActiveConnectionId() === id) {
|
|
77
|
+
localStorage.removeItem(ACTIVE_CONNECTION_KEY);
|
|
78
|
+
}
|
|
79
|
+
notifyConnectionChange();
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
console.error('Failed to delete connection:', error);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get the active connection ID
|
|
87
|
+
*/
|
|
88
|
+
static getActiveConnectionId() {
|
|
89
|
+
if (typeof window === 'undefined')
|
|
90
|
+
return null;
|
|
91
|
+
try {
|
|
92
|
+
return localStorage.getItem(ACTIVE_CONNECTION_KEY);
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.error('Failed to get active connection:', error);
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Get the active connection
|
|
101
|
+
*/
|
|
102
|
+
static getActiveConnection() {
|
|
103
|
+
const id = this.getActiveConnectionId();
|
|
104
|
+
return id ? this.getConnection(id) : null;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Set the active connection ID
|
|
108
|
+
*/
|
|
109
|
+
static setActiveConnection(id) {
|
|
110
|
+
if (typeof window === 'undefined')
|
|
111
|
+
return;
|
|
112
|
+
try {
|
|
113
|
+
localStorage.setItem(ACTIVE_CONNECTION_KEY, id);
|
|
114
|
+
notifyConnectionChange();
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
console.error('Failed to set active connection:', error);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Update the lastUsed timestamp for a connection
|
|
122
|
+
*/
|
|
123
|
+
static touchConnection(id) {
|
|
124
|
+
const connection = this.getConnection(id);
|
|
125
|
+
if (connection) {
|
|
126
|
+
this.saveConnection(connection);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Clear all connections
|
|
131
|
+
*/
|
|
132
|
+
static clearAll() {
|
|
133
|
+
if (typeof window === 'undefined')
|
|
134
|
+
return;
|
|
135
|
+
try {
|
|
136
|
+
localStorage.removeItem(STORAGE_KEY);
|
|
137
|
+
localStorage.removeItem(ACTIVE_CONNECTION_KEY);
|
|
138
|
+
notifyConnectionChange();
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
console.error('Failed to clear connections:', error);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Subscribe to connection changes
|
|
146
|
+
* @returns Unsubscribe function
|
|
147
|
+
*/
|
|
148
|
+
static onChange(callback) {
|
|
149
|
+
if (typeof window === 'undefined')
|
|
150
|
+
return () => { };
|
|
151
|
+
const handler = () => callback();
|
|
152
|
+
window.addEventListener(CONNECTION_CHANGE_EVENT, handler);
|
|
153
|
+
return () => window.removeEventListener(CONNECTION_CHANGE_EVENT, handler);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.ConnectionManager = ConnectionManager;
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* SGERP Frontend Library
|
|
3
4
|
* Main entry point for npm package
|
|
4
5
|
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.ConnectionManager = void 0;
|
|
5
22
|
// Re-export everything from sgerp module
|
|
6
|
-
|
|
23
|
+
__exportStar(require("./sgerp"), exports);
|
|
7
24
|
// Re-export connection manager
|
|
8
|
-
|
|
25
|
+
var connection_manager_1 = require("./connection-manager");
|
|
26
|
+
Object.defineProperty(exports, "ConnectionManager", { enumerable: true, get: function () { return connection_manager_1.ConnectionManager; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type Language = "en" | "ja" | "ms";
|
|
2
|
+
/**
|
|
3
|
+
* Server-side localization function (no localStorage, no client features)
|
|
4
|
+
* @param key - The translation key
|
|
5
|
+
* @param params - Parameters to replace in the translation
|
|
6
|
+
* @param locale - The locale to use
|
|
7
|
+
* @returns The localized string
|
|
8
|
+
*/
|
|
9
|
+
export declare const localizeServer: (key: string, params?: Record<string, unknown>, locale?: Language) => string;
|
|
10
|
+
//# sourceMappingURL=locale-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale-server.d.ts","sourceRoot":"","sources":["../../sgerplib/locales/locale-server.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAU1C;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GACzB,KAAK,MAAM,EACX,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACpC,SAAQ,QAAyB,KAChC,MAmCF,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.localizeServer = void 0;
|
|
4
|
+
const locale_en_1 = require("./locale_en");
|
|
5
|
+
const locale_ja_1 = require("./locale_ja");
|
|
6
|
+
const locale_ms_1 = require("./locale_ms");
|
|
7
|
+
const locales = {
|
|
8
|
+
en: locale_en_1.translations,
|
|
9
|
+
ja: locale_ja_1.translations,
|
|
10
|
+
ms: locale_ms_1.translations,
|
|
11
|
+
};
|
|
12
|
+
const DEFAULT_LOCALE = "en";
|
|
13
|
+
/**
|
|
14
|
+
* Server-side localization function (no localStorage, no client features)
|
|
15
|
+
* @param key - The translation key
|
|
16
|
+
* @param params - Parameters to replace in the translation
|
|
17
|
+
* @param locale - The locale to use
|
|
18
|
+
* @returns The localized string
|
|
19
|
+
*/
|
|
20
|
+
const localizeServer = (key, params = {}, locale = DEFAULT_LOCALE) => {
|
|
21
|
+
const translation = locale in locales ? locales[locale] : locales[DEFAULT_LOCALE];
|
|
22
|
+
// Try to find the key in the selected locale
|
|
23
|
+
let value = translation[key];
|
|
24
|
+
// If not found, try removing '_id' from the key and search again
|
|
25
|
+
if (value === undefined) {
|
|
26
|
+
const keyWithoutId = key.replace(/_id/g, "");
|
|
27
|
+
value = translation[keyWithoutId];
|
|
28
|
+
}
|
|
29
|
+
// If still not found, fallback to English translation
|
|
30
|
+
if (value === undefined) {
|
|
31
|
+
value = locales["en"][key];
|
|
32
|
+
// Try removing '_id' from the key in English fallback
|
|
33
|
+
if (value === undefined) {
|
|
34
|
+
const keyWithoutId = key.replace(/_id/g, "");
|
|
35
|
+
value = locales["en"][keyWithoutId];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// If still not found, use the key itself
|
|
39
|
+
if (value === undefined) {
|
|
40
|
+
value = key;
|
|
41
|
+
}
|
|
42
|
+
// Replace placeholders with provided values
|
|
43
|
+
Object.keys(params).forEach((param) => {
|
|
44
|
+
const regex = new RegExp(`\\{${param}\\}`, "g");
|
|
45
|
+
value = value.replace(regex, String(params[param] || ""));
|
|
46
|
+
});
|
|
47
|
+
return value;
|
|
48
|
+
};
|
|
49
|
+
exports.localizeServer = localizeServer;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type Language = "en" | "ja" | "ms";
|
|
2
|
+
type LocaleChangeListener = (locale: Language) => void;
|
|
3
|
+
export declare const subscribeToLocaleChanges: (listener: LocaleChangeListener) => () => void;
|
|
4
|
+
/**
|
|
5
|
+
* Get the current locale
|
|
6
|
+
* @returns The current locale
|
|
7
|
+
*/
|
|
8
|
+
export declare const getLocale: () => Language;
|
|
9
|
+
/**
|
|
10
|
+
* Set the locale
|
|
11
|
+
* @param locale - The locale to set
|
|
12
|
+
*/
|
|
13
|
+
export declare const setLocale: (locale: Language) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Localize a key with optional parameters
|
|
16
|
+
* @param key - The translation key
|
|
17
|
+
* @param params - Parameters to replace in the translation
|
|
18
|
+
* @param locale - Optional locale override
|
|
19
|
+
* @returns The localized string
|
|
20
|
+
*/
|
|
21
|
+
export declare const localize: (key: string, params?: Record<string, unknown>, locale?: Language) => string;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=locale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../sgerplib/locales/locale.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAc1C,KAAK,oBAAoB,GAAG,CAAC,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC;AAGvD,eAAO,MAAM,wBAAwB,GAAI,UAAU,oBAAoB,eAKtE,CAAC;AA6BF;;;GAGG;AACH,eAAO,MAAM,SAAS,QAAO,QAe5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,QAAQ,QAAQ,KAAG,IAU5C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GACnB,KAAK,MAAM,EACX,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACpC,SAAQ,QAAsB,KAC7B,MAmCF,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.localize = exports.setLocale = exports.getLocale = exports.subscribeToLocaleChanges = void 0;
|
|
5
|
+
const locale_en_1 = require("./locale_en");
|
|
6
|
+
const locale_ja_1 = require("./locale_ja");
|
|
7
|
+
const locale_ms_1 = require("./locale_ms");
|
|
8
|
+
const locales = {
|
|
9
|
+
en: locale_en_1.translations,
|
|
10
|
+
ja: locale_ja_1.translations,
|
|
11
|
+
ms: locale_ms_1.translations,
|
|
12
|
+
};
|
|
13
|
+
const DEFAULT_LOCALE = "en";
|
|
14
|
+
const STORAGE_KEY = "sgerp-language";
|
|
15
|
+
let currentLocale = DEFAULT_LOCALE;
|
|
16
|
+
const listeners = new Set();
|
|
17
|
+
const subscribeToLocaleChanges = (listener) => {
|
|
18
|
+
listeners.add(listener);
|
|
19
|
+
return () => {
|
|
20
|
+
listeners.delete(listener);
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
exports.subscribeToLocaleChanges = subscribeToLocaleChanges;
|
|
24
|
+
const notifyListeners = () => {
|
|
25
|
+
listeners.forEach(listener => listener(currentLocale));
|
|
26
|
+
};
|
|
27
|
+
// Function to safely access localStorage
|
|
28
|
+
const safeLocalStorage = {
|
|
29
|
+
getItem: (key) => {
|
|
30
|
+
try {
|
|
31
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
32
|
+
return localStorage.getItem(key);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
catch (_a) {
|
|
36
|
+
// Ignore localStorage errors
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
},
|
|
40
|
+
setItem: (key, value) => {
|
|
41
|
+
try {
|
|
42
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
43
|
+
localStorage.setItem(key, value);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (_a) {
|
|
47
|
+
// Ignore localStorage errors
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Get the current locale
|
|
53
|
+
* @returns The current locale
|
|
54
|
+
*/
|
|
55
|
+
const getLocale = () => {
|
|
56
|
+
if (typeof self !== "undefined" && typeof self.postMessage === "function") {
|
|
57
|
+
// Web Worker environment
|
|
58
|
+
return currentLocale;
|
|
59
|
+
}
|
|
60
|
+
else if (typeof window !== "undefined") {
|
|
61
|
+
// Browser environment
|
|
62
|
+
const stored = safeLocalStorage.getItem(STORAGE_KEY);
|
|
63
|
+
if (stored === "en" || stored === "ja" || stored === "ms") {
|
|
64
|
+
return stored;
|
|
65
|
+
}
|
|
66
|
+
return DEFAULT_LOCALE;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
// Server environment
|
|
70
|
+
return DEFAULT_LOCALE;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
exports.getLocale = getLocale;
|
|
74
|
+
/**
|
|
75
|
+
* Set the locale
|
|
76
|
+
* @param locale - The locale to set
|
|
77
|
+
*/
|
|
78
|
+
const setLocale = (locale) => {
|
|
79
|
+
if (locale in locales) {
|
|
80
|
+
// Only notify if locale actually changed
|
|
81
|
+
const changed = currentLocale !== locale;
|
|
82
|
+
currentLocale = locale;
|
|
83
|
+
safeLocalStorage.setItem(STORAGE_KEY, locale);
|
|
84
|
+
if (changed) {
|
|
85
|
+
notifyListeners();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
exports.setLocale = setLocale;
|
|
90
|
+
/**
|
|
91
|
+
* Localize a key with optional parameters
|
|
92
|
+
* @param key - The translation key
|
|
93
|
+
* @param params - Parameters to replace in the translation
|
|
94
|
+
* @param locale - Optional locale override
|
|
95
|
+
* @returns The localized string
|
|
96
|
+
*/
|
|
97
|
+
const localize = (key, params = {}, locale = (0, exports.getLocale)()) => {
|
|
98
|
+
const translation = locale in locales ? locales[locale] : locales[DEFAULT_LOCALE];
|
|
99
|
+
// Try to find the key in the selected locale
|
|
100
|
+
let value = translation[key];
|
|
101
|
+
// If not found, try removing '_id' from the key and search again
|
|
102
|
+
if (value === undefined) {
|
|
103
|
+
const keyWithoutId = key.replace(/_id/g, "");
|
|
104
|
+
value = translation[keyWithoutId];
|
|
105
|
+
}
|
|
106
|
+
// If still not found, fallback to English translation
|
|
107
|
+
if (value === undefined) {
|
|
108
|
+
value = locales["en"][key];
|
|
109
|
+
// Try removing '_id' from the key in English fallback
|
|
110
|
+
if (value === undefined) {
|
|
111
|
+
const keyWithoutId = key.replace(/_id/g, "");
|
|
112
|
+
value = locales["en"][keyWithoutId];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// If still not found, use the key itself
|
|
116
|
+
if (value === undefined) {
|
|
117
|
+
value = key;
|
|
118
|
+
}
|
|
119
|
+
// Replace placeholders with provided values
|
|
120
|
+
Object.keys(params).forEach((param) => {
|
|
121
|
+
const regex = new RegExp(`\\{${param}\\}`, "g");
|
|
122
|
+
value = value.replace(regex, String(params[param] || ""));
|
|
123
|
+
});
|
|
124
|
+
return value;
|
|
125
|
+
};
|
|
126
|
+
exports.localize = localize;
|
|
127
|
+
// Setup for Web Worker environment
|
|
128
|
+
if (typeof self !== "undefined" && self.postMessage) {
|
|
129
|
+
self.onmessage = (event) => {
|
|
130
|
+
if (event.data.type === "setLocale") {
|
|
131
|
+
(0, exports.setLocale)(event.data.locale);
|
|
132
|
+
}
|
|
133
|
+
else if (event.data.type === "getLocale") {
|
|
134
|
+
self.postMessage({ type: "currentLocale", locale: (0, exports.getLocale)() });
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
// Setup for Browser environment
|
|
139
|
+
if (typeof window !== "undefined") {
|
|
140
|
+
// Initialize locale from localStorage
|
|
141
|
+
const storedLocale = safeLocalStorage.getItem(STORAGE_KEY);
|
|
142
|
+
if (storedLocale === "en" || storedLocale === "ja" || storedLocale === "ms") {
|
|
143
|
+
(0, exports.setLocale)(storedLocale);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale_en.d.ts","sourceRoot":"","sources":["../../sgerplib/locales/locale_en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"locale_en.d.ts","sourceRoot":"","sources":["../../sgerplib/locales/locale_en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAomE/C,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.translations = void 0;
|
|
4
|
+
exports.translations = {
|
|
2
5
|
// SGERP Login
|
|
3
6
|
"sgerp_login.username": "Username",
|
|
4
7
|
"sgerp_login.password": "Password",
|
|
@@ -137,17 +140,82 @@ export const translations = {
|
|
|
137
140
|
"interactive_demo.loading": "Loading...",
|
|
138
141
|
"interactive_demo.code_equivalent": "Code Equivalent",
|
|
139
142
|
// Homepage
|
|
140
|
-
"homepage.
|
|
141
|
-
"homepage.
|
|
143
|
+
"homepage.badge": "Frontend Components for Logistics & TMS",
|
|
144
|
+
"homepage.title": "Build Mobility and Logistics Apps Fast",
|
|
145
|
+
"homepage.subtitle": "Production-ready React components backed by swatmobility.com services",
|
|
146
|
+
"homepage.description": "Shadcn-style reusable components for mobility and logistics platforms. Fully customizable, drop into any React app, and adapt to your design system. Perfect for people transport and logistics applications.",
|
|
142
147
|
"homepage.try_it_out": "Try It Out",
|
|
143
148
|
"homepage.get_started": "Get Started",
|
|
144
149
|
"homepage.documentation": "Documentation",
|
|
145
|
-
|
|
146
|
-
"homepage.
|
|
147
|
-
"homepage.
|
|
148
|
-
"homepage.
|
|
149
|
-
"homepage.
|
|
150
|
-
|
|
150
|
+
// Stats
|
|
151
|
+
"homepage.stat_components": "Components",
|
|
152
|
+
"homepage.stat_tables": "Data Tables",
|
|
153
|
+
"homepage.stat_pages": "Full Pages",
|
|
154
|
+
"homepage.stat_typescript": "TypeScript",
|
|
155
|
+
// Features Section
|
|
156
|
+
"homepage.features_title": "Everything You Need for Mobility & Logistics Apps",
|
|
157
|
+
"homepage.features_subtitle": "Frontend components backed by swatmobility.com infrastructure for mobility and delivery management",
|
|
158
|
+
"homepage.feature_transport_title": "People Transport",
|
|
159
|
+
"homepage.feature_transport_desc": "Complete passenger transport solutions with booking management, ridesharing support, driver assignment, and real-time tracking for efficient people movement.",
|
|
160
|
+
"homepage.feature_logistics_title": "Logistics",
|
|
161
|
+
"homepage.feature_logistics_desc": "18 pre-built table components, 10+ complete pages, and specialized editors for delivery management and supply chain operations. Install with shadcn CLI and customize.",
|
|
162
|
+
"homepage.feature_backend_title": "Backend-Powered",
|
|
163
|
+
"homepage.feature_backend_desc": "All components connect to production-grade logistics APIs. Fetch live data with automatic authentication and type safety.",
|
|
164
|
+
"homepage.feature_maps_title": "Interactive Maps",
|
|
165
|
+
"homepage.feature_maps_desc": "Route visualization with Mapbox GL. Display vehicle routes, waypoints, and live tracking on interactive maps.",
|
|
166
|
+
"homepage.feature_routing_title": "Route Planning",
|
|
167
|
+
"homepage.feature_routing_desc": "Solve vehicle routing problems with automated planning algorithms or manual editing. Create optimal routes with autoplan, then fine-tune manually for real-world constraints.",
|
|
168
|
+
"homepage.feature_customizable_title": "Shadcn-Style Components",
|
|
169
|
+
"homepage.feature_customizable_desc": "Fully customizable components that drop into any React app. Built with Radix UI primitives and Tailwind CSS. Copy, paste, and adapt to your design system.",
|
|
170
|
+
// Use Cases Section
|
|
171
|
+
"homepage.usecases_title": "Built for Real-World Logistics",
|
|
172
|
+
"homepage.usecases_subtitle": "Trusted by transportation companies for fleet operations, delivery management, and route optimization",
|
|
173
|
+
"homepage.usecase_fleet_title": "Fleet Management",
|
|
174
|
+
"homepage.usecase_fleet_desc": "Track vehicles, assign drivers, monitor service schedules, and optimize fleet utilization across multiple projects.",
|
|
175
|
+
"homepage.usecase_rideshare_title": "Ride-Sharing & Carpooling",
|
|
176
|
+
"homepage.usecase_rideshare_desc": "Manage passenger bookings, match riders, calculate routes, and handle JIT shift-based transportation services.",
|
|
177
|
+
"homepage.usecase_delivery_title": "Last-Mile Delivery",
|
|
178
|
+
"homepage.usecase_delivery_desc": "Optimize delivery routes, track packages, manage nodes, and coordinate drivers for efficient last-mile logistics.",
|
|
179
|
+
"homepage.usecase_routing_title": "Route Optimization",
|
|
180
|
+
"homepage.usecase_routing_desc": "Calculate optimal routes using swatmobility route optimization APIs, visualize waypoints, estimate travel times, and reduce operational costs.",
|
|
181
|
+
// Showcase Section
|
|
182
|
+
"homepage.showcase_title": "See It In Action",
|
|
183
|
+
"homepage.showcase_subtitle": "Production-ready components for every aspect of mobility and logistics management",
|
|
184
|
+
"homepage.hero_feature_title": "Complete Route Planning Interface — Zero Development Required",
|
|
185
|
+
"homepage.hero_feature_desc": "Drop in a full-featured route planning interface with interactive maps, vehicle management, and timeline views. Connected to backend by swatmobility developers — just install and use or customize.",
|
|
186
|
+
"homepage.showcase_services": "Services Management",
|
|
187
|
+
"homepage.showcase_services_desc": "Complete page for managing transportation services with filtering and scheduling",
|
|
188
|
+
"homepage.showcase_drivers": "Driver Management",
|
|
189
|
+
"homepage.showcase_drivers_desc": "Track driver availability, assignments, and performance metrics",
|
|
190
|
+
"homepage.showcase_passengers": "Passenger Bookings",
|
|
191
|
+
"homepage.showcase_passengers_desc": "Manage passenger information, bookings, and transaction history",
|
|
192
|
+
"homepage.showcase_timeline": "Timeline View",
|
|
193
|
+
"homepage.showcase_timeline_desc": "Gantt-style timeline for visualizing vehicle schedules and routes",
|
|
194
|
+
"homepage.showcase_notifications": "Notifications",
|
|
195
|
+
"homepage.showcase_notifications_desc": "Schedule SMS and push notifications for passengers and drivers",
|
|
196
|
+
"homepage.showcase_trackplayer": "Route Playback",
|
|
197
|
+
"homepage.showcase_trackplayer_desc": "Replay historical routes with speed control and waypoint tracking",
|
|
198
|
+
// CTA Section
|
|
199
|
+
"homepage.cta_title": "Start Building Today",
|
|
200
|
+
"homepage.cta_subtitle": "Install components via shadcn CLI and connect to your SGERP backend. Full TypeScript support included.",
|
|
201
|
+
// Footer
|
|
202
|
+
"footer.about": "About",
|
|
203
|
+
"footer.about_desc": "Production-ready React components for mobility and logistics platforms, backed by SWAT Mobility.",
|
|
204
|
+
"footer.documentation": "Documentation",
|
|
205
|
+
"footer.getting_started": "Getting Started",
|
|
206
|
+
"footer.api_reference": "API Reference",
|
|
207
|
+
"footer.components": "Components",
|
|
208
|
+
"footer.pages": "Pages",
|
|
209
|
+
"footer.resources": "Resources",
|
|
210
|
+
"footer.try_demo": "Try Demo",
|
|
211
|
+
"footer.github": "GitHub",
|
|
212
|
+
"footer.npm_package": "NPM Package",
|
|
213
|
+
"footer.connect": "Connect",
|
|
214
|
+
"footer.swat_website": "SWAT Mobility",
|
|
215
|
+
"footer.contact": "Contact Us",
|
|
216
|
+
"footer.about_us": "About Us",
|
|
217
|
+
"footer.copyright": "SWAT Mobility. All rights reserved.",
|
|
218
|
+
"footer.terms": "Terms & Conditions",
|
|
151
219
|
// PT App
|
|
152
220
|
"ptapp.title": "PT Management",
|
|
153
221
|
"ptapp.login_required": "Please log in to access PT Management",
|
|
@@ -1471,6 +1539,15 @@ export const translations = {
|
|
|
1471
1539
|
"calendar.select_date_first": "Select date first",
|
|
1472
1540
|
"calendar.found": "found",
|
|
1473
1541
|
"calendar.project_label": "Project",
|
|
1542
|
+
// Simulation Filters
|
|
1543
|
+
"simulation_filters.basic_filters": "Basic Filters (3 components)",
|
|
1544
|
+
"simulation_filters.basic_filters_desc": "Project, Template, and Calendar selectors",
|
|
1545
|
+
"simulation_filters.full_filters": "Full Filters (4 components)",
|
|
1546
|
+
"simulation_filters.full_filters_desc": "Project, Template, Calendar, and Simulation selectors",
|
|
1547
|
+
"simulation_filters.multiselect_templates": "Multiselect Templates",
|
|
1548
|
+
"simulation_filters.multiselect_templates_desc": "Project and multi-template selectors",
|
|
1549
|
+
"simulation_filters.multiselect_all": "Multiselect Templates and Simulations",
|
|
1550
|
+
"simulation_filters.multiselect_all_desc": "All components with multi-select for templates and simulations",
|
|
1474
1551
|
// Booking
|
|
1475
1552
|
"booking.create_booking": "Create Booking",
|
|
1476
1553
|
"booking.new_booking": "New Booking",
|
|
@@ -1930,4 +2007,11 @@ export const translations = {
|
|
|
1930
2007
|
"example.map.feature_style": "Change map style using the dropdown (top-left)",
|
|
1931
2008
|
"example.map.feature_zoom": "Zoom and pan using mouse or touch",
|
|
1932
2009
|
"example.map.feature_updates": "Data automatically updates when collection changes",
|
|
2010
|
+
// Table Examples
|
|
2011
|
+
"examples.live_example": "Live Example",
|
|
2012
|
+
"examples.integrated_editor_recommended": "Integrated Editor (Recommended)",
|
|
2013
|
+
"examples.integrated_editor_desc": "Enable editing with just enableEditor={true}. The table handles the drawer and editor automatically.",
|
|
2014
|
+
"examples.custom_onedit_handler": "Custom onEdit Handler",
|
|
2015
|
+
"examples.custom_onedit_desc": "For advanced use cases, provide your own onEdit handler for full control.",
|
|
2016
|
+
"examples.see_code_above": "See code example above for custom implementation",
|
|
1933
2017
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale_ja.d.ts","sourceRoot":"","sources":["../../sgerplib/locales/locale_ja.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"locale_ja.d.ts","sourceRoot":"","sources":["../../sgerplib/locales/locale_ja.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAimE/C,CAAC"}
|