@iyulab/enterprise 0.8.1 → 0.9.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/CHANGELOG.md +31 -0
- package/dist/helpers/CurrencyHelper.d.ts +14 -18
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +19 -0
- package/dist/index.js +17 -23
- package/package.json +15 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **New opt-in subpath `@iyulab/enterprise/icons`.** Bundles 10 hand-drawn nav-style SVG
|
|
8
|
+
icons and registers them under the icon-library name `'house'` via `@iyulab/components`'
|
|
9
|
+
`IconRegistry`. Importing the main `@iyulab/enterprise` entry does not pull this in —
|
|
10
|
+
only importing `@iyulab/enterprise/icons` registers the library, matching how
|
|
11
|
+
`./styles/preset.css` is already opt-in.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- **`sideEffects` narrowed from `false` to an explicit array.** Protects the new
|
|
16
|
+
`icons.ts` module (and, since this package builds as a single bundle with no
|
|
17
|
+
per-file output, the whole `index.ts`/`index.js` — which also covers a pre-existing
|
|
18
|
+
side effect in `helpers/messages.ts`) from being tree-shaken away by consumers'
|
|
19
|
+
production bundlers.
|
|
20
|
+
|
|
21
|
+
## 0.8.2
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- **`CurrencyHelper` now delegates to `@iyulab/components`' `formatCurrency`** instead of
|
|
26
|
+
duplicating `Intl.NumberFormat` logic. Output is unchanged for all existing methods
|
|
27
|
+
(`formatCurrency`/`formatKRW`/`formatUSD`/`formatEUR`/`formatJPY`/`formatCNY`/
|
|
28
|
+
`parseCurrency`) — this is a behavior-preserving internal change. The class is now marked
|
|
29
|
+
`@deprecated`; new code should call `formatCurrency`/`formatNumber`/`formatDate` from
|
|
30
|
+
`@iyulab/components` directly.
|
|
31
|
+
- **`@iyulab/components` peer floor raised to `>=1.27.0`** (the delegation above needs
|
|
32
|
+
`formatCurrency`, added in that release).
|
|
33
|
+
|
|
3
34
|
## 0.8.1
|
|
4
35
|
|
|
5
36
|
### Fixed
|
|
@@ -1,36 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Currency formatting utility class
|
|
2
|
+
* Currency formatting utility class.
|
|
3
|
+
*
|
|
4
|
+
* @deprecated The formatting logic now lives in `@iyulab/components`' `formatCurrency`
|
|
5
|
+
* (framework-neutral, lower in the dependency stack so `@iyulab/modern-app` can consume it
|
|
6
|
+
* too). This class is kept as a thin, behavior-preserving wrapper for existing callers —
|
|
7
|
+
* new code should import `formatCurrency`/`formatNumber`/`formatDate` from
|
|
8
|
+
* `@iyulab/components` directly.
|
|
3
9
|
*/
|
|
4
10
|
export declare class CurrencyHelper {
|
|
5
11
|
/**
|
|
6
|
-
* Format amount as currency string
|
|
12
|
+
* Format amount as currency string.
|
|
7
13
|
* @param amount - Amount to format
|
|
8
14
|
* @param currency - Currency code (default: 'KRW')
|
|
9
15
|
* @param locale - Locale for formatting (default: 'ko-KR')
|
|
10
16
|
*/
|
|
11
17
|
static formatCurrency(amount: number | null | undefined, currency?: string, locale?: string): string;
|
|
12
|
-
/**
|
|
13
|
-
* Format amount as Korean Won (KRW)
|
|
14
|
-
*/
|
|
18
|
+
/** Format amount as Korean Won (KRW) */
|
|
15
19
|
static formatKRW(amount: number | null | undefined): string;
|
|
16
|
-
/**
|
|
17
|
-
* Format amount as US Dollar (USD)
|
|
18
|
-
*/
|
|
20
|
+
/** Format amount as US Dollar (USD) */
|
|
19
21
|
static formatUSD(amount: number | null | undefined): string;
|
|
20
|
-
/**
|
|
21
|
-
* Format amount as Euro (EUR)
|
|
22
|
-
*/
|
|
22
|
+
/** Format amount as Euro (EUR) */
|
|
23
23
|
static formatEUR(amount: number | null | undefined): string;
|
|
24
|
-
/**
|
|
25
|
-
* Format amount as Japanese Yen (JPY)
|
|
26
|
-
*/
|
|
24
|
+
/** Format amount as Japanese Yen (JPY) */
|
|
27
25
|
static formatJPY(amount: number | null | undefined): string;
|
|
28
|
-
/**
|
|
29
|
-
* Format amount as Chinese Yuan (CNY)
|
|
30
|
-
*/
|
|
26
|
+
/** Format amount as Chinese Yuan (CNY) */
|
|
31
27
|
static formatCNY(amount: number | null | undefined): string;
|
|
32
28
|
/**
|
|
33
|
-
* Parse currency string to number
|
|
29
|
+
* Parse currency string to number.
|
|
34
30
|
* @param value - Currency string to parse
|
|
35
31
|
*/
|
|
36
32
|
static parseCurrency(value: string): number;
|
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/icons.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IconRegistry } from "@iyulab/components";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region src/icons.ts
|
|
4
|
+
var bundle = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
5
|
+
"./assets/icons/code.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <path d=\"M8 6l-5 6l5 6\" />\n <path d=\"M16 6l5 6l-5 6\" />\n</svg>\n",
|
|
6
|
+
"./assets/icons/contrast.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 3v2M12 19v2M5.6 5.6l1.4 1.4M17 17l1.4 1.4M3 12h2M19 12h2M5.6 18.4l1.4 -1.4M17 7l1.4 -1.4\" />\n</svg>\n",
|
|
7
|
+
"./assets/icons/flow.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <circle cx=\"4\" cy=\"12\" r=\"2\" />\n <circle cx=\"12\" cy=\"12\" r=\"2\" />\n <circle cx=\"20\" cy=\"12\" r=\"2\" />\n <line x1=\"6\" y1=\"12\" x2=\"10\" y2=\"12\" />\n <line x1=\"14\" y1=\"12\" x2=\"18\" y2=\"12\" />\n</svg>\n",
|
|
8
|
+
"./assets/icons/home.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <path d=\"M5 12l7 -7l7 7\" />\n <path d=\"M6 10.5v8.5a1 1 0 0 0 1 1h10a1 1 0 0 0 1 -1v-8.5\" />\n</svg>\n",
|
|
9
|
+
"./assets/icons/identity.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <circle cx=\"12\" cy=\"12\" r=\"8\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n</svg>\n",
|
|
10
|
+
"./assets/icons/layers.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <rect x=\"5\" y=\"4\" width=\"14\" height=\"4\" rx=\"1\" />\n <rect x=\"5\" y=\"10\" width=\"14\" height=\"4\" rx=\"1\" />\n <rect x=\"5\" y=\"16\" width=\"14\" height=\"4\" rx=\"1\" />\n</svg>\n",
|
|
11
|
+
"./assets/icons/layout.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <rect x=\"4\" y=\"4\" width=\"7\" height=\"7\" rx=\"1\" />\n <rect x=\"13\" y=\"4\" width=\"7\" height=\"7\" rx=\"1\" />\n <rect x=\"4\" y=\"13\" width=\"7\" height=\"7\" rx=\"1\" />\n <rect x=\"13\" y=\"13\" width=\"7\" height=\"7\" rx=\"1\" />\n</svg>\n",
|
|
12
|
+
"./assets/icons/message.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"11\" rx=\"2\" />\n <path d=\"M8 15v4l4 -4\" />\n</svg>\n",
|
|
13
|
+
"./assets/icons/pulse.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <path d=\"M3 12h4l2 -7l4 14l2 -7h6\" />\n</svg>\n",
|
|
14
|
+
"./assets/icons/table.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"1\" />\n <line x1=\"3\" y1=\"10\" x2=\"21\" y2=\"10\" />\n <line x1=\"9\" y1=\"4\" x2=\"9\" y2=\"20\" />\n</svg>\n"
|
|
15
|
+
})).map(([path, module]) => {
|
|
16
|
+
return [path.split("/").pop()?.replace(".svg", "") || "", module];
|
|
17
|
+
}).filter(([name]) => name !== ""));
|
|
18
|
+
IconRegistry.register("house", (name) => bundle.get(name));
|
|
19
|
+
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Locale } from "@iyulab/components";
|
|
2
|
+
import { Locale, formatCurrency } from "@iyulab/components";
|
|
3
3
|
import { HttpClient } from "@iyulab/http-client";
|
|
4
4
|
import buildQuery from "odata-query";
|
|
5
5
|
//#region src/FormSection.tsx
|
|
@@ -118,56 +118,50 @@ messages.register("ko", {
|
|
|
118
118
|
//#endregion
|
|
119
119
|
//#region src/helpers/CurrencyHelper.ts
|
|
120
120
|
/**
|
|
121
|
-
* Currency formatting utility class
|
|
121
|
+
* Currency formatting utility class.
|
|
122
|
+
*
|
|
123
|
+
* @deprecated The formatting logic now lives in `@iyulab/components`' `formatCurrency`
|
|
124
|
+
* (framework-neutral, lower in the dependency stack so `@iyulab/modern-app` can consume it
|
|
125
|
+
* too). This class is kept as a thin, behavior-preserving wrapper for existing callers —
|
|
126
|
+
* new code should import `formatCurrency`/`formatNumber`/`formatDate` from
|
|
127
|
+
* `@iyulab/components` directly.
|
|
122
128
|
*/
|
|
123
129
|
var CurrencyHelper = class {
|
|
124
130
|
/**
|
|
125
|
-
* Format amount as currency string
|
|
131
|
+
* Format amount as currency string.
|
|
126
132
|
* @param amount - Amount to format
|
|
127
133
|
* @param currency - Currency code (default: 'KRW')
|
|
128
134
|
* @param locale - Locale for formatting (default: 'ko-KR')
|
|
129
135
|
*/
|
|
130
136
|
static formatCurrency(amount, currency = "KRW", locale = "ko-KR") {
|
|
131
137
|
if (amount === null || amount === void 0) return "-";
|
|
132
|
-
return
|
|
133
|
-
style: "currency",
|
|
134
|
-
currency,
|
|
138
|
+
return formatCurrency(amount, currency, {
|
|
135
139
|
minimumFractionDigits: 0,
|
|
136
140
|
maximumFractionDigits: currency === "KRW" ? 0 : 2
|
|
137
|
-
})
|
|
141
|
+
}, locale);
|
|
138
142
|
}
|
|
139
|
-
/**
|
|
140
|
-
* Format amount as Korean Won (KRW)
|
|
141
|
-
*/
|
|
143
|
+
/** Format amount as Korean Won (KRW) */
|
|
142
144
|
static formatKRW(amount) {
|
|
143
145
|
return this.formatCurrency(amount, "KRW", "ko-KR");
|
|
144
146
|
}
|
|
145
|
-
/**
|
|
146
|
-
* Format amount as US Dollar (USD)
|
|
147
|
-
*/
|
|
147
|
+
/** Format amount as US Dollar (USD) */
|
|
148
148
|
static formatUSD(amount) {
|
|
149
149
|
return this.formatCurrency(amount, "USD", "en-US");
|
|
150
150
|
}
|
|
151
|
-
/**
|
|
152
|
-
* Format amount as Euro (EUR)
|
|
153
|
-
*/
|
|
151
|
+
/** Format amount as Euro (EUR) */
|
|
154
152
|
static formatEUR(amount) {
|
|
155
153
|
return this.formatCurrency(amount, "EUR", "de-DE");
|
|
156
154
|
}
|
|
157
|
-
/**
|
|
158
|
-
* Format amount as Japanese Yen (JPY)
|
|
159
|
-
*/
|
|
155
|
+
/** Format amount as Japanese Yen (JPY) */
|
|
160
156
|
static formatJPY(amount) {
|
|
161
157
|
return this.formatCurrency(amount, "JPY", "ja-JP");
|
|
162
158
|
}
|
|
163
|
-
/**
|
|
164
|
-
* Format amount as Chinese Yuan (CNY)
|
|
165
|
-
*/
|
|
159
|
+
/** Format amount as Chinese Yuan (CNY) */
|
|
166
160
|
static formatCNY(amount) {
|
|
167
161
|
return this.formatCurrency(amount, "CNY", "zh-CN");
|
|
168
162
|
}
|
|
169
163
|
/**
|
|
170
|
-
* Parse currency string to number
|
|
164
|
+
* Parse currency string to number.
|
|
171
165
|
* @param value - Currency string to parse
|
|
172
166
|
*/
|
|
173
167
|
static parseCurrency(value) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iyulab/enterprise",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Enterprise utilities and components for iyulab framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"enterprise",
|
|
@@ -25,12 +25,23 @@
|
|
|
25
25
|
"engines": {
|
|
26
26
|
"node": ">=20"
|
|
27
27
|
},
|
|
28
|
-
"sideEffects":
|
|
28
|
+
"sideEffects": [
|
|
29
|
+
"./src/index.ts",
|
|
30
|
+
"./dist/index.js",
|
|
31
|
+
"./src/icons.ts",
|
|
32
|
+
"./dist/icons.js",
|
|
33
|
+
"./src/styles/preset.css",
|
|
34
|
+
"./dist/styles/preset.css"
|
|
35
|
+
],
|
|
29
36
|
"exports": {
|
|
30
37
|
".": {
|
|
31
38
|
"types": "./dist/index.d.ts",
|
|
32
39
|
"import": "./dist/index.js"
|
|
33
40
|
},
|
|
41
|
+
"./icons": {
|
|
42
|
+
"types": "./dist/icons.d.ts",
|
|
43
|
+
"import": "./dist/icons.js"
|
|
44
|
+
},
|
|
34
45
|
"./styles/preset.css": "./dist/styles/preset.css"
|
|
35
46
|
},
|
|
36
47
|
"scripts": {
|
|
@@ -43,7 +54,7 @@
|
|
|
43
54
|
"odata-query": "^8.1.0"
|
|
44
55
|
},
|
|
45
56
|
"devDependencies": {
|
|
46
|
-
"@iyulab/components": "^1.
|
|
57
|
+
"@iyulab/components": "^1.27.0",
|
|
47
58
|
"@types/node": "^26.1.1",
|
|
48
59
|
"@types/react": "^19.2.14",
|
|
49
60
|
"typescript": "^5.9.3",
|
|
@@ -53,7 +64,7 @@
|
|
|
53
64
|
},
|
|
54
65
|
"peerDependencies": {
|
|
55
66
|
"react": ">=18",
|
|
56
|
-
"@iyulab/components": ">=1.
|
|
67
|
+
"@iyulab/components": ">=1.27.0"
|
|
57
68
|
},
|
|
58
69
|
"peerDependenciesMeta": {
|
|
59
70
|
"@iyulab/components": {
|