sgerp-frontend-lib 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/locales/locale_en.d.ts +2 -0
- package/dist/locales/locale_en.d.ts.map +1 -0
- package/dist/locales/locale_en.js +1933 -0
- package/dist/locales/locale_ja.d.ts +2 -0
- package/dist/locales/locale_ja.d.ts.map +1 -0
- package/dist/locales/locale_ja.js +1926 -0
- package/dist/locales/locale_ms.d.ts +2 -0
- package/dist/locales/locale_ms.d.ts.map +1 -0
- package/dist/locales/locale_ms.js +1916 -0
- package/dist/sgerp/client.d.ts +236 -0
- package/dist/sgerp/client.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/node.d.ts +11 -0
- package/dist/sgerp/collections/simulation/node.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/vehicle.d.ts +11 -0
- package/dist/sgerp/collections/simulation/vehicle.d.ts.map +1 -0
- package/dist/sgerp/context/sgerp-context.d.ts +54 -0
- package/dist/sgerp/context/sgerp-context.d.ts.map +1 -0
- package/dist/sgerp/hooks/use-collection.d.ts +83 -0
- package/dist/sgerp/hooks/use-collection.d.ts.map +1 -0
- package/dist/sgerp/hooks/use-live-updates.d.ts +35 -0
- package/dist/sgerp/hooks/use-live-updates.d.ts.map +1 -0
- package/dist/sgerp/hooks/use-live-updates.js +95 -0
- package/dist/sgerp/index.d.ts +90 -0
- package/dist/sgerp/index.d.ts.map +1 -0
- package/dist/sgerp/simulation-logic/fetchUtils.d.ts +69 -0
- package/dist/sgerp/simulation-logic/fetchUtils.d.ts.map +1 -0
- package/dist/sgerp/simulation-logic/index.d.ts +14 -0
- package/dist/sgerp/simulation-logic/index.d.ts.map +1 -0
- package/dist/sgerp/simulation-logic/index.js +11 -0
- package/dist/sgerp/simulation-logic/manualEditUtils.d.ts +70 -0
- package/dist/sgerp/simulation-logic/manualEditUtils.d.ts.map +1 -0
- package/dist/sgerp/simulation-logic/mapUtils.d.ts +11 -0
- package/dist/sgerp/simulation-logic/mapUtils.d.ts.map +1 -0
- package/dist/sgerp/simulation-logic/optimisticUpdateUtils.d.ts +28 -0
- package/dist/sgerp/simulation-logic/optimisticUpdateUtils.d.ts.map +1 -0
- package/dist/sgerp/simulation-logic/optimisticUpdateUtils.js +37 -0
- package/dist/sgerp/simulation-logic/referenceUtils.d.ts +28 -0
- package/dist/sgerp/simulation-logic/referenceUtils.d.ts.map +1 -0
- package/dist/sgerp/simulation-logic/routeCalculationUtils.d.ts +12 -0
- package/dist/sgerp/simulation-logic/routeCalculationUtils.d.ts.map +1 -0
- package/dist/sgerp/simulation-logic/timeShiftUtils.d.ts +27 -0
- package/dist/sgerp/simulation-logic/timeShiftUtils.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/node.d.ts +102 -0
- package/dist/sgerp/types/simulation/node.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/node.js +11 -0
- package/dist/sgerp/types/simulation/vehicle.d.ts +88 -0
- package/dist/sgerp/types/simulation/vehicle.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/vehicle.js +1 -0
- package/dist/sgerp/utils/routeUtils.d.ts +47 -0
- package/dist/sgerp/utils/routeUtils.d.ts.map +1 -0
- package/package.json +126 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 [Your Name/Organization]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# SGERP Frontend Library
|
|
2
|
+
|
|
3
|
+
TypeScript/React library for interacting with the SGERP API. Provides a client SDK, Backbone.js-style Collections with reactive hooks, and pre-built React components.
|
|
4
|
+
|
|
5
|
+
## Installation Methods
|
|
6
|
+
|
|
7
|
+
### Method 1: NPM Package (Traditional)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install sgerp-frontend-lib
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Method 2: shadcn CLI (Copy & Own the Code)
|
|
14
|
+
|
|
15
|
+
Install the complete library directly into your project:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx shadcn@latest add https://your-docs-url.com/registry/lib/sgerp-lib
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This copies all `sgerplib/sgerp` files into your project. You own the code and can modify it as needed.
|
|
22
|
+
|
|
23
|
+
**Dependencies installed:**
|
|
24
|
+
- `underscore`
|
|
25
|
+
- `react`
|
|
26
|
+
- `date-fns`
|
|
27
|
+
- `@types/underscore` (dev)
|
|
28
|
+
|
|
29
|
+
**What gets installed:**
|
|
30
|
+
- Complete SGERP API client (`sgerplib/sgerp/`)
|
|
31
|
+
- All collections (User, Project, Vehicle, etc.)
|
|
32
|
+
- React hooks (`useSGERP`, `useCollection`)
|
|
33
|
+
- TypeScript types
|
|
34
|
+
- Localization system (English, Japanese, Malay)
|
|
35
|
+
- Connection manager
|
|
36
|
+
|
|
37
|
+
## Getting Started
|
|
38
|
+
|
|
39
|
+
First, run the development server:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm run dev
|
|
43
|
+
# or
|
|
44
|
+
yarn dev
|
|
45
|
+
# or
|
|
46
|
+
pnpm dev
|
|
47
|
+
# or
|
|
48
|
+
bun dev
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
52
|
+
|
|
53
|
+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
|
54
|
+
|
|
55
|
+
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
|
|
56
|
+
|
|
57
|
+
## Learn More
|
|
58
|
+
|
|
59
|
+
To learn more about Next.js, take a look at the following resources:
|
|
60
|
+
|
|
61
|
+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
|
62
|
+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
|
63
|
+
|
|
64
|
+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
|
65
|
+
|
|
66
|
+
## Deploy on Vercel
|
|
67
|
+
|
|
68
|
+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
|
69
|
+
|
|
70
|
+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../sgerplib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +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,CAigE/C,CAAC"}
|