@lgsm/modules 1.6.20-beta.2 → 1.6.20-beta.21
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 +201 -78
- package/dist/fonts/Noto_Sans/OFL-NotoSans.txt +93 -0
- package/dist/fonts/Noto_Sans/noto-sans-latin.woff2 +0 -0
- package/dist/fonts.css +9 -0
- package/dist/main.d.ts +5 -14
- package/dist/main.js +8 -7347
- package/dist/setupBaseURL.d.ts +2 -0
- package/dist/theme.css +45 -0
- package/package.json +96 -86
- package/dist/assets/main.css +0 -1
- package/dist/shared-function/jwtDecodeFunc.d.ts +0 -1
- package/dist/shared-function/loginRedirect.d.ts +0 -1
- package/dist/shared-service/apiService.d.ts +0 -8
- package/dist/shared-service/axiosInstance.d.ts +0 -5
- package/dist/shared-ui/Button/index.d.ts +0 -9
- package/dist/shared-ui/Dropdown/index.d.ts +0 -16
- package/dist/shared-ui/Modal/index.d.ts +0 -12
- package/dist/shared-ui/MyCounter/index.d.ts +0 -8
- package/dist/shared-ui/MyTitle/index.d.ts +0 -6
- package/dist/shared-ui/Notification/NotificationContainer.d.ts +0 -1
- package/dist/shared-ui/Notification/index.d.ts +0 -9
- package/dist/shared-ui/Sonner/index.d.ts +0 -1
- package/dist/shared-ui/ThreeDotsLoader/index.d.ts +0 -1
- package/dist/shared-ui/sonnerHelper.d.ts +0 -3
- package/dist/shared-ui/ui/alert.d.ts +0 -8
- package/dist/shared-ui/ui/button.d.ts +0 -11
- package/dist/shared-ui/ui/sonner.d.ts +0 -4
- package/dist/usage-example/example-apiService.d.ts +0 -1
- package/dist/usage-example/example-components.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,78 +1,201 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
1
|
+
# LGSM shared packages
|
|
2
|
+
|
|
3
|
+
One repository maintains four focused packages and the full-library entry point.
|
|
4
|
+
All packages currently use version 1.6.20-beta.10.
|
|
5
|
+
|
|
6
|
+
| Package | Owns | LGSM dependencies |
|
|
7
|
+
| --- | --- | --- |
|
|
8
|
+
| @lgsm/core | API client, authentication redirects and token decoding | None |
|
|
9
|
+
| @lgsm/ui | Basic controls, dropdowns, dialogs/side drawers, loaders, notifications and error views | None |
|
|
10
|
+
| @lgsm/account | ProfileMenu, SystemSwitcher shell and profile URL helpers | ui |
|
|
11
|
+
| @lgsm/data-table | Tables, editing/filtering/pagination, date/command controls and Excel export | ui |
|
|
12
|
+
| @lgsm/modules | Re-exports all four packages and preserves existing imports | All four |
|
|
13
|
+
|
|
14
|
+
The feature packages never import @lgsm/modules. Account and UI do not depend on
|
|
15
|
+
TanStack Table, Excel/file-export libraries, date pickers or command controls.
|
|
16
|
+
React and React DOM remain peer dependencies. Source code has one home under
|
|
17
|
+
packages/; the umbrella contains exports and the legacy API notification adapter.
|
|
18
|
+
|
|
19
|
+
## Install everything
|
|
20
|
+
|
|
21
|
+
After this release is published:
|
|
22
|
+
|
|
23
|
+
~~~sh
|
|
24
|
+
bun add @lgsm/modules
|
|
25
|
+
~~~
|
|
26
|
+
|
|
27
|
+
Existing imports continue to work:
|
|
28
|
+
|
|
29
|
+
~~~tsx
|
|
30
|
+
import { DataTable, ProfileMenu, SystemSwitcher, Sheet, MainErrorFallback } from '@lgsm/modules'
|
|
31
|
+
~~~
|
|
32
|
+
|
|
33
|
+
The umbrella depends on the feature packages, so one command installs all of them.
|
|
34
|
+
A teammate cloning an app only runs bun install, using its package.json and lockfile.
|
|
35
|
+
|
|
36
|
+
## Install selected features
|
|
37
|
+
|
|
38
|
+
~~~sh
|
|
39
|
+
bun add @lgsm/account
|
|
40
|
+
# Or choose several packages in one command:
|
|
41
|
+
bun add @lgsm/core @lgsm/ui @lgsm/data-table
|
|
42
|
+
~~~
|
|
43
|
+
|
|
44
|
+
~~~tsx
|
|
45
|
+
import { ProfileMenu, SystemSwitcher } from '@lgsm/account'
|
|
46
|
+
import { DataTable, type ColumnConfig } from '@lgsm/data-table'
|
|
47
|
+
import { Sheet, SheetContent, SheetTitle, SheetTrigger, NotFound } from '@lgsm/ui'
|
|
48
|
+
~~~
|
|
49
|
+
|
|
50
|
+
Only required dependencies are installed automatically. Installing account does
|
|
51
|
+
not install core, data-table or the umbrella. The package entry points import their
|
|
52
|
+
compiled, scoped CSS; no source files need to be copied into the app. The shared
|
|
53
|
+
UI package supplies fonts and base styles. Apps intentionally suppressing library
|
|
54
|
+
CSS must register the installed @lgsm packages with Tailwind @source, as LMS does.
|
|
55
|
+
CSS is also exported at each UI package's /styles.css subpath.
|
|
56
|
+
|
|
57
|
+
## Develop this repository
|
|
58
|
+
|
|
59
|
+
~~~sh
|
|
60
|
+
bun install
|
|
61
|
+
bun run build
|
|
62
|
+
bun run test --run
|
|
63
|
+
bun run check:packages
|
|
64
|
+
bun run check:install
|
|
65
|
+
~~~
|
|
66
|
+
|
|
67
|
+
Run bun install once at the repository root. Workspaces link the local packages.
|
|
68
|
+
The build command type-checks and builds core, UI, account, data-table and finally
|
|
69
|
+
the umbrella in dependency order. Existing Storybook stories now live beside their
|
|
70
|
+
components in packages/*/src; start them with bun run storybook.
|
|
71
|
+
|
|
72
|
+
Commit scripts/ alongside the package sources: build and publish checks depend
|
|
73
|
+
on those files. Generated dist/ folders remain Git-ignored.
|
|
74
|
+
|
|
75
|
+
check:packages verifies package boundaries, declared imports, build outputs and
|
|
76
|
+
account-only dependency isolation. check:install packs the actual release files
|
|
77
|
+
and performs clean account-only and full-library installs in temporary directories.
|
|
78
|
+
It asserts that heavy table dependencies are absent from the account-only install.
|
|
79
|
+
It does not publish anything. Open scripts/check-style-isolation.html through the
|
|
80
|
+
local Vite server after building to verify shared CSS isolation in a browser.
|
|
81
|
+
|
|
82
|
+
## Local consumer repositories
|
|
83
|
+
|
|
84
|
+
HRIS, Jakarta and LMS currently keep @lgsm/modules as file:../lampung-fe.
|
|
85
|
+
Their package.json overrides resolve the four unpublished packages from sibling
|
|
86
|
+
folders in packages/. Run bun install in each app after building Lampung. After
|
|
87
|
+
subsequent library-only edits, rebuild Lampung and refresh the app's copied local
|
|
88
|
+
packages with bun install --force. App feature edits do not need a library build.
|
|
89
|
+
|
|
90
|
+
Keep `resolve.dedupe: ['react', 'react-dom']` in each consuming app's Vite config
|
|
91
|
+
so linked library dependencies use the app's React instance. After changing this
|
|
92
|
+
setting, restart the dev server with `bun run dev --force` to refresh Vite's cache.
|
|
93
|
+
|
|
94
|
+
Another local app can use a selective file dependency, for example
|
|
95
|
+
file:../lampung-fe/packages/account, with a local override for its UI dependency.
|
|
96
|
+
Keep overrides in the consuming app, not in published packages.
|
|
97
|
+
When using the published release, replace the file dependency with the package
|
|
98
|
+
version and remove the local LGSM overrides.
|
|
99
|
+
|
|
100
|
+
## Shared account controls
|
|
101
|
+
|
|
102
|
+
~~~tsx
|
|
103
|
+
import { DropdownMenuItem, ProfileMenu, SystemSwitcher } from '@lgsm/modules'
|
|
104
|
+
|
|
105
|
+
<div className="flex items-center gap-4">
|
|
106
|
+
<SystemSwitcher label="Open navigation menus" contentClassName="w-100">
|
|
107
|
+
<div className="grid grid-cols-4 gap-2">
|
|
108
|
+
{menus.map((menu) => (
|
|
109
|
+
<DropdownMenuItem key={menu.path} onSelect={() => navigate(menu.path)}>
|
|
110
|
+
{menu.name}
|
|
111
|
+
</DropdownMenuItem>
|
|
112
|
+
))}
|
|
113
|
+
</div>
|
|
114
|
+
</SystemSwitcher>
|
|
115
|
+
<ProfileMenu
|
|
116
|
+
avatarUrl={user?.userDetails.avtrPath}
|
|
117
|
+
jakartaUrl={import.meta.env.VITE_APP_URL_JAKARTA}
|
|
118
|
+
onChangePassword={changePassword}
|
|
119
|
+
onLogout={logout}
|
|
120
|
+
/>
|
|
121
|
+
</div>
|
|
122
|
+
~~~
|
|
123
|
+
|
|
124
|
+
ProfileMenu owns the bundled fallback avatar and account-menu behavior. My Profile
|
|
125
|
+
opens /profile and My Groups opens /my-groups on the configured Jakarta base URL.
|
|
126
|
+
Jakarta passes window.location.origin. Authentication actions remain app callbacks.
|
|
127
|
+
|
|
128
|
+
SystemSwitcher owns only the shared 32px button, dropdown container, focus and
|
|
129
|
+
open/close behavior. Pass the content as children, use label to name the button,
|
|
130
|
+
and optionally change container sizing through contentClassName. Use
|
|
131
|
+
DropdownMenuItem for selectable children so keyboard navigation and dismissal work.
|
|
132
|
+
Selective consumers import SystemSwitcher from @lgsm/account and declare @lgsm/ui
|
|
133
|
+
when importing DropdownMenuItem directly.
|
|
134
|
+
|
|
135
|
+
Each app owns its API calls, filtering, grid layout and navigation. HRIS's local
|
|
136
|
+
MenuSwitcher uses the existing access-menu context and internal router links in a
|
|
137
|
+
four-column grid. Jakarta supplies its already-loaded application list through a
|
|
138
|
+
local ApplicationSwitcher. LMS's ApplicationSwitcher calls its own SystemService
|
|
139
|
+
and handles loading, retry, inactive systems and HTTP(S)-only external links.
|
|
140
|
+
There are no API calls or application data types in @lgsm/account. The previous
|
|
141
|
+
userId and systems props are replaced by children in this unpublished release.
|
|
142
|
+
|
|
143
|
+
## API initialization
|
|
144
|
+
|
|
145
|
+
The full @lgsm/modules setupBaseURL export keeps existing toast notifications.
|
|
146
|
+
It delegates to the shared core client. Existing five-argument initialization
|
|
147
|
+
calls remain compatible.
|
|
148
|
+
|
|
149
|
+
Selective consumers importing the client directly should declare @lgsm/core as
|
|
150
|
+
an app dependency and provide their notification callback when needed:
|
|
151
|
+
|
|
152
|
+
~~~ts
|
|
153
|
+
import { setupBaseURL } from '@lgsm/core'
|
|
154
|
+
|
|
155
|
+
setupBaseURL(apiUrl, getAccessToken, loginUrl, environment, setAccessToken, showApiError)
|
|
156
|
+
~~~
|
|
157
|
+
|
|
158
|
+
The last callback receives (message, description). Core defaults to console.error
|
|
159
|
+
and has no UI dependency. Apps wanting the shared notifications can pass notifyError
|
|
160
|
+
from @lgsm/ui and render Sonner from that same package. Keep API configuration and
|
|
161
|
+
token state in the host app; feature packages share the configured core client.
|
|
162
|
+
|
|
163
|
+
## Tables, drawers and errors
|
|
164
|
+
|
|
165
|
+
DataTable and ServerTable retain their existing props and permission behavior.
|
|
166
|
+
The app supplies data, columns, validation, save callbacks and access flags.
|
|
167
|
+
Missing permissions keep built-in editing actions read-only. Table-specific
|
|
168
|
+
calendar/command controls and Excel code live only in @lgsm/data-table.
|
|
169
|
+
|
|
170
|
+
Sheet, SheetContent, SheetTrigger, SheetTitle and the other Sheet primitives provide
|
|
171
|
+
the side drawer. MainErrorFallback and NotFound provide the shared error views.
|
|
172
|
+
The host app still owns its router, error-boundary wiring, navigation and permissions.
|
|
173
|
+
All shared roots and portal content retain data-lgsm-ui for style isolation.
|
|
174
|
+
|
|
175
|
+
## Publish
|
|
176
|
+
|
|
177
|
+
Build, test and run both package checks first. Publish to your existing registry
|
|
178
|
+
with the intended package visibility, in this order:
|
|
179
|
+
|
|
180
|
+
1. packages/core and packages/ui
|
|
181
|
+
2. packages/account and packages/data-table
|
|
182
|
+
3. repository root (@lgsm/modules)
|
|
183
|
+
|
|
184
|
+
From this repository root, after npm login:
|
|
185
|
+
|
|
186
|
+
~~~sh
|
|
187
|
+
npm publish -w @lgsm/core --tag beta --access public
|
|
188
|
+
npm publish -w @lgsm/ui --tag beta --access public
|
|
189
|
+
npm publish -w @lgsm/account --tag beta --access public
|
|
190
|
+
npm publish -w @lgsm/data-table --tag beta --access public
|
|
191
|
+
npm publish --tag beta --access public
|
|
192
|
+
~~~
|
|
193
|
+
|
|
194
|
+
The root command publishes only @lgsm/modules, not the workspace packages.
|
|
195
|
+
Published versions cannot be overwritten: use a new beta number for each release.
|
|
196
|
+
|
|
197
|
+
Each folder is independently publishable; only dist, package metadata and README
|
|
198
|
+
are shipped. Runtime package dependencies use registry versions, not local file or
|
|
199
|
+
workspace paths. Use the same release version across the five package manifests
|
|
200
|
+
for now and update internal versions together. No release-management service or
|
|
201
|
+
additional build framework is required.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2022 The Noto Project Authors (https://github.com/notofonts/latin-greek-cyrillic)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
https://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
package/dist/fonts.css
ADDED
package/dist/main.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export {
|
|
6
|
-
export { NotificationContainer } from './shared-ui/Notification/NotificationContainer';
|
|
7
|
-
export { Sonner } from './shared-ui/Sonner';
|
|
8
|
-
export { Modal } from './shared-ui/Modal';
|
|
9
|
-
export { Dropdown } from './shared-ui/Dropdown';
|
|
10
|
-
export { notifyError, notifySuccess, notifyWarning } from './shared-ui/sonnerHelper';
|
|
11
|
-
export { default as apiService } from './shared-service/apiService';
|
|
12
|
-
export { setupBaseURL } from './shared-service/axiosInstance';
|
|
13
|
-
export { loginRedirect } from './shared-function/loginRedirect';
|
|
14
|
-
export { decodeToken } from './shared-function/jwtDecodeFunc';
|
|
1
|
+
export * from '@lgsm/core';
|
|
2
|
+
export * from '@lgsm/ui';
|
|
3
|
+
export * from '@lgsm/account';
|
|
4
|
+
export * from '@lgsm/data-table';
|
|
5
|
+
export { setupBaseURL } from './setupBaseURL';
|