@iyulab/enterprise 0.14.0 → 0.16.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 +64 -0
- package/README.md +40 -0
- package/dist/index.d.ts +660 -11
- package/dist/index.js +45 -42
- package/dist/styles/preset.css +21 -4
- package/package.json +3 -2
- package/dist/ApiConfig.d.ts +0 -71
- package/dist/FormRow.d.ts +0 -33
- package/dist/FormSection.d.ts +0 -26
- package/dist/auth/AuthClient.d.ts +0 -46
- package/dist/auth/permissions.d.ts +0 -43
- package/dist/data/ODataService.d.ts +0 -136
- package/dist/helpers/CurrencyHelper.d.ts +0 -33
- package/dist/helpers/DateHelper.d.ts +0 -61
- package/dist/helpers/ProgressHelper.d.ts +0 -48
- package/dist/helpers/UrgencyHelper.d.ts +0 -62
- package/dist/helpers/constants.d.ts +0 -6
- package/dist/helpers/index.d.ts +0 -10
- package/dist/helpers/messages.d.ts +0 -26
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Date manipulation and formatting utility class
|
|
3
|
-
*/
|
|
4
|
-
export declare class DateHelper {
|
|
5
|
-
/**
|
|
6
|
-
* Format date to YYYY-MM-DD string
|
|
7
|
-
* @param date - Date to format (Date object or ISO string)
|
|
8
|
-
*/
|
|
9
|
-
static formatDate(date: Date | string | null | undefined): string;
|
|
10
|
-
/**
|
|
11
|
-
* Format date to localized string
|
|
12
|
-
* @param date - Date to format
|
|
13
|
-
* @param locale - Locale for formatting (default: 'ko-KR')
|
|
14
|
-
* @param options - Intl.DateTimeFormat options
|
|
15
|
-
*/
|
|
16
|
-
static formatLocalDate(date: Date | string | null | undefined, locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
|
17
|
-
/**
|
|
18
|
-
* Format datetime to YYYY-MM-DD HH:mm string
|
|
19
|
-
* @param date - Date to format
|
|
20
|
-
*/
|
|
21
|
-
static formatDateTime(date: Date | string | null | undefined): string;
|
|
22
|
-
/**
|
|
23
|
-
* Calculate days difference between two dates
|
|
24
|
-
* @param startDate - Start date
|
|
25
|
-
* @param endDate - End date
|
|
26
|
-
* @returns Number of days (positive if endDate > startDate)
|
|
27
|
-
*/
|
|
28
|
-
static getDaysDifference(startDate: Date | string, endDate: Date | string): number;
|
|
29
|
-
/**
|
|
30
|
-
* Calculate days from now to target date
|
|
31
|
-
* @param targetDate - Target date
|
|
32
|
-
* @returns Days remaining (negative if overdue)
|
|
33
|
-
*/
|
|
34
|
-
static getDaysFromNow(targetDate: Date | string): number;
|
|
35
|
-
/**
|
|
36
|
-
* Check if date is today
|
|
37
|
-
*/
|
|
38
|
-
static isToday(date: Date | string): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Check if date is in the past
|
|
41
|
-
*/
|
|
42
|
-
static isPast(date: Date | string): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Check if date is in the future
|
|
45
|
-
*/
|
|
46
|
-
static isFuture(date: Date | string): boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Add days to date
|
|
49
|
-
* @param date - Base date
|
|
50
|
-
* @param days - Number of days to add (can be negative)
|
|
51
|
-
*/
|
|
52
|
-
static addDays(date: Date | string, days: number): Date;
|
|
53
|
-
/**
|
|
54
|
-
* Get start of day (00:00:00)
|
|
55
|
-
*/
|
|
56
|
-
static startOfDay(date: Date | string): Date;
|
|
57
|
-
/**
|
|
58
|
-
* Get end of day (23:59:59.999)
|
|
59
|
-
*/
|
|
60
|
-
static endOfDay(date: Date | string): Date;
|
|
61
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Progress bar and percentage utility class
|
|
3
|
-
*/
|
|
4
|
-
export declare class ProgressHelper {
|
|
5
|
-
/**
|
|
6
|
-
* Get color based on progress percentage
|
|
7
|
-
* @param progress - Progress value (0-100)
|
|
8
|
-
* @param thresholds - Custom thresholds { high, medium }
|
|
9
|
-
*/
|
|
10
|
-
static getProgressColor(progress: number, thresholds?: {
|
|
11
|
-
high?: number;
|
|
12
|
-
medium?: number;
|
|
13
|
-
}): string;
|
|
14
|
-
/**
|
|
15
|
-
* Validate and clamp progress to 0-100 range.
|
|
16
|
-
*
|
|
17
|
-
* Returns `null` for a missing/unparsable input rather than `0` — "no progress value yet"
|
|
18
|
-
* and "0% progress" are different facts and must not render identically.
|
|
19
|
-
* @param progress - Raw progress value
|
|
20
|
-
* @param round - Whether to round to integer (default: true)
|
|
21
|
-
*/
|
|
22
|
-
static validateProgress(progress: number, round?: boolean): number;
|
|
23
|
-
static validateProgress(progress: number | null | undefined, round?: boolean): number | null;
|
|
24
|
-
/**
|
|
25
|
-
* Convert decimal ratio to percentage.
|
|
26
|
-
*
|
|
27
|
-
* Returns `null` for a missing/unparsable input — see {@link validateProgress}.
|
|
28
|
-
* @param ratio - Decimal ratio (0-1)
|
|
29
|
-
* @param round - Whether to round to integer
|
|
30
|
-
*/
|
|
31
|
-
static ratioToPercent(ratio: number | null | undefined, round?: boolean): number | null;
|
|
32
|
-
/**
|
|
33
|
-
* Get progress label text
|
|
34
|
-
* @param progress - Progress value (0-100)
|
|
35
|
-
*/
|
|
36
|
-
static getProgressLabel(progress: number): string;
|
|
37
|
-
/**
|
|
38
|
-
* Calculate progress from current and total values
|
|
39
|
-
* @param current - Current value
|
|
40
|
-
* @param total - Total value
|
|
41
|
-
*/
|
|
42
|
-
static calculateProgress(current: number, total: number): number;
|
|
43
|
-
/**
|
|
44
|
-
* Get CSS gradient for progress bar
|
|
45
|
-
* @param progress - Progress value (0-100)
|
|
46
|
-
*/
|
|
47
|
-
static getProgressGradient(progress: number): string;
|
|
48
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Urgency level types
|
|
3
|
-
*/
|
|
4
|
-
export type UrgencyLevel = 'overdue' | 'critical' | 'urgent' | 'soon' | 'normal';
|
|
5
|
-
/**
|
|
6
|
-
* Urgency configuration
|
|
7
|
-
*/
|
|
8
|
-
export interface UrgencyConfig {
|
|
9
|
-
/** Days threshold for critical urgency (default: 1) */
|
|
10
|
-
critical?: number;
|
|
11
|
-
/** Days threshold for urgent level (default: 3) */
|
|
12
|
-
urgent?: number;
|
|
13
|
-
/** Days threshold for soon level (default: 7) */
|
|
14
|
-
soon?: number;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Urgency calculation and display utility class
|
|
18
|
-
*/
|
|
19
|
-
export declare class UrgencyHelper {
|
|
20
|
-
private static defaultConfig;
|
|
21
|
-
/**
|
|
22
|
-
* Get urgency color based on days remaining
|
|
23
|
-
* @param daysRemaining - Days until deadline (negative if overdue)
|
|
24
|
-
* @param config - Custom urgency thresholds
|
|
25
|
-
*/
|
|
26
|
-
static getUrgencyColor(daysRemaining: number | null | undefined, config?: UrgencyConfig): string;
|
|
27
|
-
/**
|
|
28
|
-
* Get urgency level based on days remaining
|
|
29
|
-
* @param daysRemaining - Days until deadline
|
|
30
|
-
* @param config - Custom urgency thresholds
|
|
31
|
-
*/
|
|
32
|
-
static getUrgencyLevel(daysRemaining: number | null | undefined, config?: UrgencyConfig): UrgencyLevel;
|
|
33
|
-
/**
|
|
34
|
-
* Get urgency text label
|
|
35
|
-
* @param daysRemaining - Days until deadline
|
|
36
|
-
* @param config - Custom urgency thresholds
|
|
37
|
-
* @param labels - Custom label text
|
|
38
|
-
*/
|
|
39
|
-
static getUrgencyText(daysRemaining: number | null | undefined, config?: UrgencyConfig, labels?: Partial<Record<UrgencyLevel, string>>): string;
|
|
40
|
-
/**
|
|
41
|
-
* Get background and text color for urgency badge
|
|
42
|
-
* @param daysRemaining - Days until deadline
|
|
43
|
-
* @param config - Custom urgency thresholds
|
|
44
|
-
*/
|
|
45
|
-
static getUrgencyBadgeColors(daysRemaining: number | null | undefined, config?: UrgencyConfig): {
|
|
46
|
-
bg: string;
|
|
47
|
-
text: string;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Format days remaining as display text
|
|
51
|
-
* @param daysRemaining - Days until deadline
|
|
52
|
-
*/
|
|
53
|
-
static formatDaysRemaining(daysRemaining: number | null | undefined): string;
|
|
54
|
-
/**
|
|
55
|
-
* Check if deadline is overdue
|
|
56
|
-
*/
|
|
57
|
-
static isOverdue(daysRemaining: number | null | undefined): boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Check if deadline requires attention
|
|
60
|
-
*/
|
|
61
|
-
static needsAttention(daysRemaining: number | null | undefined, config?: UrgencyConfig): boolean;
|
|
62
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Display string for an absent value (`null`/`undefined`/unparsable), shared by every
|
|
3
|
-
* formatting helper in this package so "no value" renders identically everywhere and
|
|
4
|
-
* never collides with a real `0`.
|
|
5
|
-
*/
|
|
6
|
-
export declare const EMPTY_VALUE_DISPLAY = "\u2014";
|
package/dist/helpers/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @iyulab/enterprise Helpers
|
|
3
|
-
* Reusable utility classes for enterprise applications
|
|
4
|
-
*/
|
|
5
|
-
export * from './messages';
|
|
6
|
-
export * from './constants';
|
|
7
|
-
export * from './CurrencyHelper';
|
|
8
|
-
export * from './DateHelper';
|
|
9
|
-
export * from './ProgressHelper';
|
|
10
|
-
export * from './UrgencyHelper';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { LocaleNamespace } from '@iyulab/components/dist/utilities/Locale.js';
|
|
2
|
-
/**
|
|
3
|
-
* `@iyulab/enterprise` 의 화면 문자열 — **영어 기본 + 로케일 레지스트리**.
|
|
4
|
-
*
|
|
5
|
-
* ## 왜 이 파일이 생겼나
|
|
6
|
-
*
|
|
7
|
-
* 헬퍼들이 라벨을 **한국어 리터럴로** 들고 있었다(실측 14건). 이 리포는 이미 로케일 표준을
|
|
8
|
-
* 채택했지만(영어 기본 + 레지스트리) **강제하는 장치가 없어서** 채택 이후에 들어온 코드가
|
|
9
|
-
* 한국어 기본값을 갖고 있었다.
|
|
10
|
-
*
|
|
11
|
-
* ⚠**「의견 있음」이 정당화하는 것은 스타일 값의 의견이지 언어가 아니다**(2026-08-04 결정).
|
|
12
|
-
*
|
|
13
|
-
* ## 왜 자체 레지스트리를 만들지 않았나
|
|
14
|
-
*
|
|
15
|
-
* `@iyulab/components` 의 `Locale.namespace()`(1.23.0~)를 쓴다. 자체 구현은 이 조직의
|
|
16
|
-
* **네 번째 레지스트리**가 됐을 것이고, 그러면 소비자가 앱 하나에서 로케일을 **두 번**
|
|
17
|
-
* 전환해야 한다. `Locale.set()` 한 번으로 검증 메시지·이 라벨이 함께 따라온다.
|
|
18
|
-
*
|
|
19
|
-
* ## 동작 변화
|
|
20
|
-
*
|
|
21
|
-
* ⚠기본 로케일은 브라우저 언어에서 감지된다 — **한국어 브라우저는 종전과 같은 문구**를 본다
|
|
22
|
-
* (`ko-KR` → `ko`). 그 밖의 환경은 한국어 대신 **영어**를 본다. 그것이 이 이주의 목적이다.
|
|
23
|
-
*/
|
|
24
|
-
export type EnterpriseMessageKey = 'progressNotStarted' | 'progressEarly' | 'progressInProgress' | 'progressPastMid' | 'progressAlmost' | 'progressDone' | 'urgencyOverdue' | 'urgencyCritical' | 'urgencyUrgent' | 'urgencySoon' | 'urgencyNormal' | 'daysOverdue' | 'daysToday' | 'daysRemaining';
|
|
25
|
-
/** 이 패키지의 문자열 묶음. 소비자는 `messages.register(locale, table)` 로 덮거나 언어를 더한다. */
|
|
26
|
-
export declare const messages: LocaleNamespace<EnterpriseMessageKey>;
|