@g1cloud/open-bluesea-core 1.0.0-alpha.4 → 1.0.0-alpha.6
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/dist/BSAlertModal-ZEIUM0ut.js +4 -0
- package/dist/BSYesNoModal-Cs6mgXcP.js +4 -0
- package/dist/index.d.ts +1521 -42
- package/dist/open-bluesea-core.css +106 -2
- package/dist/open-bluesea-core.es.js +1122 -314
- package/dist/open-bluesea-core.umd.js +1128 -312
- package/package.json +2 -1
- package/dist/blueseaPlugin.d.ts +0 -43
- package/dist/component/basic/PageNavigation.model.d.ts +0 -5
- package/dist/component/input/DateInputLib.d.ts +0 -26
- package/dist/contextmenu/contextMenuPlugin.d.ts +0 -36
- package/dist/directive/vClickOutside.d.ts +0 -20
- package/dist/directive/vFocusOnLoad.d.ts +0 -3
- package/dist/directive/vTooltip.d.ts +0 -7
- package/dist/model/CommonTypes.d.ts +0 -29
- package/dist/model/DefaultImpl.d.ts +0 -7
- package/dist/model/FieldContext.d.ts +0 -14
- package/dist/notification/notificationPlugin.d.ts +0 -31
- package/dist/savepoint/SavePoint.d.ts +0 -46
- package/dist/util/componentUtil.d.ts +0 -11
- package/dist/util/debounceUtil.d.ts +0 -16
- package/dist/util/formatUtil.d.ts +0 -69
- package/dist/util/typeUtil.d.ts +0 -18
- package/dist/util/waitUtil.d.ts +0 -19
- package/dist/validator/FieldValidator.d.ts +0 -43
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Vue UI Library for Management Console.",
|
|
4
4
|
"license": "Proprietary",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "1.0.0-alpha.
|
|
6
|
+
"version": "1.0.0-alpha.6",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"engines": {
|
|
9
9
|
"node": ">= 24.3.0"
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"tailwindcss": "^4.1.16",
|
|
35
35
|
"typescript": "~5.9.3",
|
|
36
36
|
"vite": "^7.1.12",
|
|
37
|
+
"vite-plugin-dts": "^4.5.4",
|
|
37
38
|
"vue-tsc": "^3.1.3"
|
|
38
39
|
},
|
|
39
40
|
"dependencies": {
|
package/dist/blueseaPlugin.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { type InjectionKey, type Plugin } from "vue";
|
|
2
|
-
import type { DisplayDateResolution } from "./model/CommonTypes";
|
|
3
|
-
export type PopupComponentConfig = {
|
|
4
|
-
container?: string | HTMLElement;
|
|
5
|
-
hideOnScroll?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export type CalendarComponentConfig = {
|
|
8
|
-
startYear?: string;
|
|
9
|
-
endYear?: string;
|
|
10
|
-
};
|
|
11
|
-
export type ComponentConfig = {
|
|
12
|
-
popup?: PopupComponentConfig;
|
|
13
|
-
calendar?: CalendarComponentConfig;
|
|
14
|
-
};
|
|
15
|
-
export declare class BlueseaConfig {
|
|
16
|
-
dateFormat: string;
|
|
17
|
-
dateFormatDay: string;
|
|
18
|
-
dateFormatMinute: string;
|
|
19
|
-
dateFormatSecond: string;
|
|
20
|
-
minDateValue: string;
|
|
21
|
-
maxDateValue: string;
|
|
22
|
-
timeZone: string;
|
|
23
|
-
componentConfig: ComponentConfig;
|
|
24
|
-
constructor(config?: BlueseaConfigRaw);
|
|
25
|
-
resolveDisplayDateFormat(format?: string | DisplayDateResolution): string;
|
|
26
|
-
}
|
|
27
|
-
export type BlueseaConfigRaw = {
|
|
28
|
-
dateFormat?: string;
|
|
29
|
-
dateFormatDay?: string;
|
|
30
|
-
dateFormatMinute?: string;
|
|
31
|
-
dateFormatSecond?: string;
|
|
32
|
-
minDateValue?: string;
|
|
33
|
-
maxDateValue?: string;
|
|
34
|
-
timeZone?: string;
|
|
35
|
-
componentConfig?: ComponentConfig;
|
|
36
|
-
};
|
|
37
|
-
export declare const BlueseaConfigKey: InjectionKey<BlueseaConfig>;
|
|
38
|
-
/**
|
|
39
|
-
* App 에 provide 된 BlueseaConfig 를 리턴한다.
|
|
40
|
-
* @returns BlueseaConfig
|
|
41
|
-
*/
|
|
42
|
-
export declare const useBlueseaConfig: () => BlueseaConfig;
|
|
43
|
-
export declare const BlueseaPlugin: Plugin;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { DateResolution, TimeZone } from "@/model/CommonTypes";
|
|
2
|
-
/**
|
|
3
|
-
* Resolution 에 해당하는 날짜 입력 포맷.
|
|
4
|
-
* 예를 들어 'YYYYMMDD', 'YYYYMMDDHH', 'YYYYMMDDHHmm'
|
|
5
|
-
* @param resolution
|
|
6
|
-
*/
|
|
7
|
-
export declare const dateInputFormatByResolution: (resolution: DateResolution) => string;
|
|
8
|
-
/**
|
|
9
|
-
* 입력받은 YYYYMMDDHHmm 형식의 input string 을 ISO8601 형식의 string 으로 변환한다.
|
|
10
|
-
*
|
|
11
|
-
* 입력값(str) 은 blueseaConfig.minDateValue 와 blueseaConfig.maxDateValue 사이 값이어야 한다.
|
|
12
|
-
* 그렇지 않으면 이 사이 값으로 변경되어 처리된다.
|
|
13
|
-
*
|
|
14
|
-
* @param str 변환할 입력 값. (ex: YYYYMMDDHHmm 형식)
|
|
15
|
-
* @param inputFormat
|
|
16
|
-
* @param endTime
|
|
17
|
-
* @param resolution
|
|
18
|
-
* @param inputTimeZone
|
|
19
|
-
* @param minDateValue 최소시각. 없으면 blueseaConfig.minDateValue 사용.
|
|
20
|
-
* @param maxDateValue 최대시각. 없으면 blueseaConfig.maxDateValue 사용.
|
|
21
|
-
* @return ISO8601 형식의 값. (ex: 2024-04-01T12:30:00.000+09:00)
|
|
22
|
-
*/
|
|
23
|
-
export declare const convertInputToDateString: (str: string | undefined, inputFormat: string, endTime: boolean, resolution: DateResolution, inputTimeZone: TimeZone, minDateValue: string, maxDateValue: string) => string;
|
|
24
|
-
export declare const convertDateToInputString: (date: string, inputFormat: string, inputTimeZone: string) => string;
|
|
25
|
-
export declare const checkDateMinMaxValue: (value: string | undefined, inputFormat: string, endTime: boolean, resolution: DateResolution, inputTimeZone: TimeZone, minDateValue: string, maxDateValue: string) => string | undefined;
|
|
26
|
-
export declare const normalizeDateInput: (value: string) => string;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { type Component } from "vue";
|
|
2
|
-
export declare const ContextMenuPluginKey: unique symbol;
|
|
3
|
-
export type MenuItem = {
|
|
4
|
-
type?: 'menu' | 'link' | 'route' | 'separator' | 'custom';
|
|
5
|
-
menuId?: string;
|
|
6
|
-
caption?: string;
|
|
7
|
-
component?: Component;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
handler?: () => void;
|
|
10
|
-
href?: string;
|
|
11
|
-
target?: string;
|
|
12
|
-
children?: MenuItem[];
|
|
13
|
-
};
|
|
14
|
-
export type MenuPosition = {
|
|
15
|
-
x: number;
|
|
16
|
-
y: number;
|
|
17
|
-
};
|
|
18
|
-
export type ContextMenuOptions = {
|
|
19
|
-
zIndex?: number;
|
|
20
|
-
onHideContextMenu?: () => void;
|
|
21
|
-
};
|
|
22
|
-
export type MousePosition = {
|
|
23
|
-
clientX: number;
|
|
24
|
-
clientY: number;
|
|
25
|
-
};
|
|
26
|
-
export declare class BSContextMenuPlugin {
|
|
27
|
-
contextMenuItems: import("vue").Ref<MenuItem[] | undefined, MenuItem[] | undefined>;
|
|
28
|
-
position: import("vue").Ref<MenuPosition | undefined, MenuPosition | undefined>;
|
|
29
|
-
options: import("vue").Ref<ContextMenuOptions | undefined, ContextMenuOptions | undefined>;
|
|
30
|
-
showContextMenu(event: MousePosition, menus: MenuItem[], options?: ContextMenuOptions): void;
|
|
31
|
-
hideContextMenu(): void;
|
|
32
|
-
private markComponentRaw;
|
|
33
|
-
}
|
|
34
|
-
export declare const useContextMenu: () => BSContextMenuPlugin;
|
|
35
|
-
export declare const useContextMenuOptional: () => BSContextMenuPlugin | undefined;
|
|
36
|
-
export declare const createContextMenuPlugin: () => BSContextMenuPlugin;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ObjectDirective } from "vue";
|
|
2
|
-
type ClickOutsideContext = {
|
|
3
|
-
enabled: boolean;
|
|
4
|
-
handler: () => void;
|
|
5
|
-
insideElements?: (HTMLElement | string | undefined)[];
|
|
6
|
-
};
|
|
7
|
-
declare global {
|
|
8
|
-
interface HTMLElement {
|
|
9
|
-
vClickOutsideListener?: (event: MouseEvent) => void;
|
|
10
|
-
vClickOutsideContext?: ClickOutsideContext;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* ```
|
|
15
|
-
* v-click-outside="() => someFunction()"
|
|
16
|
-
* v-click-outside="{enabled: true, handler: () => someFunction()}"
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
declare const vClickOutside: ObjectDirective;
|
|
20
|
-
export default vClickOutside;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export type LabelProvider<T> = (item: T) => string | undefined;
|
|
2
|
-
export type KeyProvider<T> = (item: T) => string | undefined;
|
|
3
|
-
export type EnabledItemProvider<T> = (item: T) => boolean;
|
|
4
|
-
export type IconProvider<T> = (item: T) => string | undefined;
|
|
5
|
-
export type TooltipProvider<T> = (item: T) => string | undefined;
|
|
6
|
-
export type LocaleName = string;
|
|
7
|
-
export type TimeZone = string;
|
|
8
|
-
export type DateResolution = 'DAY' | 'HOUR' | 'MINUTE_30' | 'MINUTE_10' | 'MINUTE' | 'SECOND';
|
|
9
|
-
export type DisplayDateResolution = 'DAY' | 'MINUTE' | 'SECOND';
|
|
10
|
-
/**
|
|
11
|
-
* BSTextInput 등의 prefix, suffix 타입
|
|
12
|
-
*/
|
|
13
|
-
export type PrefixSuffix = {
|
|
14
|
-
type: 'text' | 'font-icon' | 'image-url';
|
|
15
|
-
value: string;
|
|
16
|
-
};
|
|
17
|
-
export type StoredFile = {
|
|
18
|
-
fileUrl?: string;
|
|
19
|
-
mediaType?: 'Image' | 'Video' | 'Youtube' | 'Unknown';
|
|
20
|
-
thumbnailUrl?: string;
|
|
21
|
-
altText?: string;
|
|
22
|
-
width?: number;
|
|
23
|
-
height?: number;
|
|
24
|
-
imageNo?: number;
|
|
25
|
-
file?: File;
|
|
26
|
-
thumbnailFile?: File;
|
|
27
|
-
};
|
|
28
|
-
export declare class IllegalAccessError {
|
|
29
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { KeyProvider, LabelProvider } from "@/model/CommonTypes";
|
|
2
|
-
export declare const defaultLabelProvider: <T>(item: T) => string;
|
|
3
|
-
export declare const emptyLabelProvider: <T>(_item: T) => undefined;
|
|
4
|
-
export declare const executeLabelProviderOrDefault: <T>(item: T, labelProvider: LabelProvider<T> | undefined, defaultLabel: (item: T) => string) => string;
|
|
5
|
-
export declare const defaultKeyProvider: <T>(item: T) => string;
|
|
6
|
-
export declare const emptyKeyProvider: <T>(_item: T) => undefined;
|
|
7
|
-
export declare const executeKeyProviderOrDefault: <T>(item: T, keyProvider: KeyProvider<T> | undefined, defaultKey: (item: T) => string) => string;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { LocaleName } from "@/model/CommonTypes";
|
|
2
|
-
export type IterationContext<T> = {
|
|
3
|
-
componentName: string;
|
|
4
|
-
record: T;
|
|
5
|
-
recordKey?: string;
|
|
6
|
-
recordIndex?: number;
|
|
7
|
-
data: T[];
|
|
8
|
-
};
|
|
9
|
-
export type FieldContext<T> = {
|
|
10
|
-
iteration?: IterationContext<T>;
|
|
11
|
-
locale?: LocaleName;
|
|
12
|
-
};
|
|
13
|
-
export declare const provideFieldContext: <T>(fieldContext: FieldContext<T>) => void;
|
|
14
|
-
export declare const useFieldContext: () => FieldContext<any> | undefined;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Component, Raw } from "vue";
|
|
2
|
-
export type NotificationStyle = 'error' | 'info';
|
|
3
|
-
export type NotificationEntry = {
|
|
4
|
-
entryId: number;
|
|
5
|
-
message: string;
|
|
6
|
-
style: NotificationStyle;
|
|
7
|
-
duration: number;
|
|
8
|
-
};
|
|
9
|
-
export declare const notificationEntries: import("vue").Reactive<NotificationEntry[]>;
|
|
10
|
-
export declare const showNotification: (message: string, style?: NotificationStyle, durationInMilliSeconds?: number) => void;
|
|
11
|
-
export type AlarmEntry = {
|
|
12
|
-
entryId: number;
|
|
13
|
-
component: Raw<Component>;
|
|
14
|
-
duration: number;
|
|
15
|
-
};
|
|
16
|
-
export declare const alarmEntries: import("vue").Reactive<AlarmEntry[]>;
|
|
17
|
-
export declare const showAlarm: (component: Component, durationInMilliSeconds?: number) => void;
|
|
18
|
-
export declare const closeAlarm: (entryId: number | AlarmEntry) => void;
|
|
19
|
-
export type TooltipEntry = {
|
|
20
|
-
content: string;
|
|
21
|
-
target: HTMLElement;
|
|
22
|
-
cursorInTooltip: boolean;
|
|
23
|
-
};
|
|
24
|
-
export declare const tooltipEntry: import("vue").Ref<TooltipEntry | undefined, TooltipEntry | undefined>;
|
|
25
|
-
export declare const showTooltip: (content: string, target: HTMLElement) => void;
|
|
26
|
-
export declare const hideTooltip: () => void;
|
|
27
|
-
export declare const isTooltipDisplayed: () => boolean;
|
|
28
|
-
export declare const showLoadingIcon: import("vue").Ref<boolean, boolean>;
|
|
29
|
-
export declare const showLoading: () => void;
|
|
30
|
-
export declare const hideLoading: () => void;
|
|
31
|
-
export declare const withLoading: <T>(func: () => Promise<T>) => Promise<T>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { Ref } from "vue";
|
|
2
|
-
export type SavePointValueProvider<T> = {
|
|
3
|
-
getCurrentValue: () => T;
|
|
4
|
-
setCurrentValue: (value: T) => void;
|
|
5
|
-
compare?: (savedValue: T, currentValue: T) => boolean;
|
|
6
|
-
};
|
|
7
|
-
export type SavePointHandlerRegisterOption<T> = {
|
|
8
|
-
field: Ref<HTMLElement | undefined>;
|
|
9
|
-
} & SavePointValueProvider<T>;
|
|
10
|
-
export interface ChildSavePoint {
|
|
11
|
-
set(): void;
|
|
12
|
-
rollback(): void;
|
|
13
|
-
isModified(): boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface SavePoint {
|
|
16
|
-
registerField<T>(option: SavePointHandlerRegisterOption<T>): SavePointHandler<T>;
|
|
17
|
-
unregisterField(field: Ref<HTMLElement | undefined>): void;
|
|
18
|
-
addChild(child: ChildSavePoint): void;
|
|
19
|
-
removeChild(child: ChildSavePoint): void;
|
|
20
|
-
set(): void;
|
|
21
|
-
setNextTick(): Promise<void>;
|
|
22
|
-
rollback(): void;
|
|
23
|
-
isModified(): boolean;
|
|
24
|
-
}
|
|
25
|
-
export declare class SavePointImpl implements SavePoint {
|
|
26
|
-
private fields;
|
|
27
|
-
private children?;
|
|
28
|
-
registerField<T>(option: SavePointHandlerRegisterOption<T>): SavePointHandler<T>;
|
|
29
|
-
unregisterField(field: Ref<HTMLElement | undefined>): void;
|
|
30
|
-
addChild(child: ChildSavePoint): void;
|
|
31
|
-
removeChild(child: ChildSavePoint): void;
|
|
32
|
-
set(): void;
|
|
33
|
-
setNextTick(): Promise<void>;
|
|
34
|
-
rollback(): void;
|
|
35
|
-
isModified(): boolean;
|
|
36
|
-
}
|
|
37
|
-
export declare const provideSavePoint: () => SavePoint;
|
|
38
|
-
export declare const useSavePoint: () => SavePoint | undefined;
|
|
39
|
-
export declare const cancelProvidedSavePoint: () => void;
|
|
40
|
-
export interface SavePointHandler<T> {
|
|
41
|
-
saveValue(): void;
|
|
42
|
-
getSavedValue(): T | undefined;
|
|
43
|
-
rollbackValue(): void;
|
|
44
|
-
isModified(currentValue: T): boolean;
|
|
45
|
-
isFieldModified(): boolean;
|
|
46
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { PrefixSuffix } from "@/model/CommonTypes";
|
|
2
|
-
declare const componentUtil: {
|
|
3
|
-
handleExternalErrorMessage(showErrorMessage: boolean, errorMessage?: string, elementId?: string): void;
|
|
4
|
-
generateNextId(prefix: string): string;
|
|
5
|
-
generateNextName(prefix: string): string;
|
|
6
|
-
isRelativeSize(size?: string): boolean;
|
|
7
|
-
delayed<T>(func: () => T, millis?: number): void;
|
|
8
|
-
trimStringValue(value?: string, trim?: boolean): string | undefined;
|
|
9
|
-
getPrefixSuffixList(param: string | string[] | PrefixSuffix | PrefixSuffix[] | undefined): PrefixSuffix[];
|
|
10
|
-
};
|
|
11
|
-
export default componentUtil;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* debounce 함수를 생성한다.
|
|
3
|
-
*
|
|
4
|
-
* ```ts
|
|
5
|
-
* // 함수를 만들 때 debounce 로 감싼다.
|
|
6
|
-
* const debouncedFunc = debounce(() => {
|
|
7
|
-
* ...
|
|
8
|
-
* }, 500)()
|
|
9
|
-
*
|
|
10
|
-
* // 여러 번 호출하더라도, 마지막 호출만 실행된다.
|
|
11
|
-
* debouncedFunc()
|
|
12
|
-
* ```
|
|
13
|
-
* @param func
|
|
14
|
-
* @param wait
|
|
15
|
-
*/
|
|
16
|
-
export declare const debounce: <T>(func: (...args: any[]) => T, wait: number) => ((...args: any[]) => Promise<T>);
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { DisplayDateResolution, TimeZone } from "@/model/CommonTypes";
|
|
2
|
-
export declare const formatUtil: {
|
|
3
|
-
/**
|
|
4
|
-
* 개행 문자('\r', '\n')를 '<br/>' 태그로 변경한다.
|
|
5
|
-
* @param str 변경할 String
|
|
6
|
-
* @return 개행문자가 '<br/>'로 변경된 String
|
|
7
|
-
*/
|
|
8
|
-
escapeNewLine(str?: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* `str` 안의 `&<>"'` 문자를 escape 처리한다.
|
|
11
|
-
* @param str 변경할 String
|
|
12
|
-
*/
|
|
13
|
-
escapeHtml(str?: string): string;
|
|
14
|
-
/**
|
|
15
|
-
* String 을 개행 문자('\r', '\n') 기준으로 나눈다.
|
|
16
|
-
* @param str
|
|
17
|
-
* @return 개행문자로 나누어진 string 의 array
|
|
18
|
-
*/
|
|
19
|
-
splitNewLine(str?: string): Array<string>;
|
|
20
|
-
/**
|
|
21
|
-
* ISO8601 형식의 string 을 주어진 format 으로 변환한다.
|
|
22
|
-
* @param utcDate
|
|
23
|
-
* @param format
|
|
24
|
-
* @param displayTimeZone
|
|
25
|
-
*/
|
|
26
|
-
formatDateString(utcDate?: string, format?: string | DisplayDateResolution, displayTimeZone?: TimeZone): string;
|
|
27
|
-
/**
|
|
28
|
-
* 숫자에 구분점을 넣는다. 소수점 이하가 있는 경우도 처리한다.
|
|
29
|
-
* * 12345 -> '12,345'
|
|
30
|
-
* * 12345.12345 -> '12,345.12345'
|
|
31
|
-
* * 0 -> '0'
|
|
32
|
-
* * undefined -> null
|
|
33
|
-
* * null -> null
|
|
34
|
-
*
|
|
35
|
-
* @param value
|
|
36
|
-
* @return
|
|
37
|
-
*/
|
|
38
|
-
formatNumber(value?: number | string | null): string | null;
|
|
39
|
-
formatNumberByCode(value?: number | string | null, locale?: string | "ko-KR"): string | null;
|
|
40
|
-
/**
|
|
41
|
-
* 통화단위와 표시위치를 받아 출력한다
|
|
42
|
-
* @param value 값
|
|
43
|
-
* @param currencyUnit 통화단위
|
|
44
|
-
* @param prefix true 이면 withUnit을 앞에 붙이고, false 이면 뒤에 붙인다.
|
|
45
|
-
*/
|
|
46
|
-
formatPrice(value?: number | string | null, currencyUnit?: string | "", prefix?: boolean): string | null;
|
|
47
|
-
/**
|
|
48
|
-
* rate 를 받아 percent 를 출력한다.
|
|
49
|
-
* * 0.1 -> 10%
|
|
50
|
-
* * 0.55 -> 55%
|
|
51
|
-
* * 0.551 -> 55.1%
|
|
52
|
-
* @param value 비율 값
|
|
53
|
-
* @param withUnit true 이면 % 를 붙이고, false 이면 붙이지 않는다.
|
|
54
|
-
* @param decimalPlace 소숫점 n번째에서 반올림한다.
|
|
55
|
-
*/
|
|
56
|
-
formatPercent(value?: number | string | null, withUnit?: boolean, decimalPlace?: number): string | null;
|
|
57
|
-
/**
|
|
58
|
-
* 신용카드번호를 4자리 단위로 나누어 구분자를 넣는다.
|
|
59
|
-
* @param value
|
|
60
|
-
* @param separator 구분자
|
|
61
|
-
*/
|
|
62
|
-
formatCreditCardNo(value: string, separator?: string): string | undefined;
|
|
63
|
-
/**
|
|
64
|
-
* `HTML`태그가 포함된 문자열에서 text 만 남긴다.
|
|
65
|
-
* @param textIncludedHTMLElement HTML 태그를 포함하는 문자열
|
|
66
|
-
* @return HTML 태그가 제거된 문자열
|
|
67
|
-
*/
|
|
68
|
-
toPlainText(textIncludedHTMLElement?: string): string;
|
|
69
|
-
};
|
package/dist/util/typeUtil.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type FunctionPropertyNames<T> = {
|
|
2
|
-
[K in keyof T]: T[K] extends Function ? K : never;
|
|
3
|
-
}[keyof T];
|
|
4
|
-
export type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>>;
|
|
5
|
-
export type NonFunctionPropertyNames<T> = {
|
|
6
|
-
[K in keyof T]: T[K] extends Function ? never : K;
|
|
7
|
-
}[keyof T];
|
|
8
|
-
export type NonFunctionProperties<T> = Pick<T, NonFunctionPropertyNames<T>>;
|
|
9
|
-
export type PartialNonFunctionProperties<T> = Partial<NonFunctionProperties<T>>;
|
|
10
|
-
export type RawData<T> = PartialNonFunctionProperties<T>;
|
|
11
|
-
/**
|
|
12
|
-
* Array 의 filter 로 null/undefined 가 아닌 것을 걸러낼 때 사용한다.
|
|
13
|
-
* ```ts
|
|
14
|
-
* const array: (string | null)[] = ['test', null, 'sample', undefined]
|
|
15
|
-
* const filtered: string[] = array.filter(notNull)
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare function notNull<T>(value: T | null | undefined): value is T;
|
package/dist/util/waitUtil.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 특정 조건이 완료될 때까지 여러 번 계속 시도한다.
|
|
3
|
-
* @param condition 조건
|
|
4
|
-
* @param intervalMilliseconds 시도 간격
|
|
5
|
-
* @param maxTrial 최대 시도 수
|
|
6
|
-
*/
|
|
7
|
-
export declare const waitUntil: (condition: () => boolean, intervalMilliseconds?: number, maxTrial?: number) => Promise<void>;
|
|
8
|
-
/**
|
|
9
|
-
* 일정 시간동안 기다린다.
|
|
10
|
-
* @param milliSec 기다리는 시간
|
|
11
|
-
*/
|
|
12
|
-
export declare const waitDuring: (milliSec?: number) => Promise<void>;
|
|
13
|
-
export declare const tryUntil: (until: () => boolean | undefined, tryCall: () => void, intervalMilliseconds?: number, maxTrial?: number) => void;
|
|
14
|
-
declare const _default: {
|
|
15
|
-
waitUntil: (condition: () => boolean, intervalMilliseconds?: number, maxTrial?: number) => Promise<void>;
|
|
16
|
-
waitDuring: (milliSec?: number) => Promise<void>;
|
|
17
|
-
tryUntil: (until: () => boolean | undefined, tryCall: () => void, intervalMilliseconds?: number, maxTrial?: number) => void;
|
|
18
|
-
};
|
|
19
|
-
export default _default;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { ComputedRef, Ref, UnwrapRef } from "vue";
|
|
2
|
-
import type { FieldContext } from "@/model/FieldContext";
|
|
3
|
-
export type ValidationError = {
|
|
4
|
-
code: string;
|
|
5
|
-
message: string | undefined;
|
|
6
|
-
};
|
|
7
|
-
export type ValidationPhase = 'input' | 'change' | 'blur' | 'form';
|
|
8
|
-
export type FieldValidationRule<T> = (value: T, phase: ValidationPhase, fieldContext?: FieldContext<any>) => Promise<ValidationError[] | undefined> | ValidationError[] | undefined;
|
|
9
|
-
export type FieldValidatorOption<T> = {
|
|
10
|
-
field?: Ref<HTMLElement | undefined>;
|
|
11
|
-
disabled: Ref<boolean> | ComputedRef<boolean>;
|
|
12
|
-
initialValue?: T;
|
|
13
|
-
isValid?: (value: UnwrapRef<T> | undefined, phase: ValidationPhase) => undefined | ValidationError[] | Promise<ValidationError[]>;
|
|
14
|
-
convertToValue?: (value: string | undefined) => UnwrapRef<T>;
|
|
15
|
-
convertFromValue?: (value: UnwrapRef<T | undefined>) => string;
|
|
16
|
-
};
|
|
17
|
-
export type FieldValidator<T> = {
|
|
18
|
-
stringValue: Ref<string | undefined>;
|
|
19
|
-
value: Ref<UnwrapRef<T> | undefined>;
|
|
20
|
-
valid: Ref<boolean>;
|
|
21
|
-
errors: Ref<ValidationError[]>;
|
|
22
|
-
touched: Ref<boolean>;
|
|
23
|
-
handleInput: (event: Event) => Promise<void>;
|
|
24
|
-
handleChange: (event: Event) => Promise<void>;
|
|
25
|
-
handleFocus: (event: Event) => void;
|
|
26
|
-
handleBlur: (event: Event) => void;
|
|
27
|
-
validateValue: (value: UnwrapRef<T>, phase: ValidationPhase) => Promise<void>;
|
|
28
|
-
validate: (phase?: ValidationPhase) => Promise<void>;
|
|
29
|
-
clearErrors: () => void;
|
|
30
|
-
getName: () => string;
|
|
31
|
-
};
|
|
32
|
-
export declare const storeFieldValidator: <T>(field: HTMLElement, validator: FieldValidator<T>) => void;
|
|
33
|
-
export declare const loadFieldValidator: <T>(field: HTMLElement) => FieldValidator<T> | undefined;
|
|
34
|
-
export declare const findFieldValidatorElements: (element?: HTMLElement) => NodeListOf<HTMLElement> | undefined;
|
|
35
|
-
export declare const validateField: (field: HTMLElement | string, phase?: ValidationPhase) => Promise<void>;
|
|
36
|
-
export declare const validateFields: (fields: (HTMLElement | string)[], phase?: ValidationPhase) => Promise<void>;
|
|
37
|
-
export declare const fieldValidator: <T>(option: FieldValidatorOption<T>) => FieldValidator<T>;
|
|
38
|
-
export declare const executeFieldValidationRule: <T>(value: T, rules: FieldValidationRule<T>[] | undefined, errors: ValidationError[], phase: ValidationPhase, fieldContext?: FieldContext<any>) => Promise<boolean>;
|
|
39
|
-
export declare const executeRequiredValidation: (value: string | number | undefined, checkRequired: boolean, requiredMessage: string | undefined, errors: ValidationError[]) => boolean;
|
|
40
|
-
export declare const executeRegExpValidation: (value: string, regexp: string | undefined, message: string | undefined, errors: ValidationError[]) => boolean;
|
|
41
|
-
export declare const executeBetweenLengthValidation: (text: string, minLength: number | undefined, minLengthMessage: string | undefined, maxLength: number | undefined, maxLengthMessage: string | undefined, betweenLengthMessage: string | undefined, errors: ValidationError[]) => boolean;
|
|
42
|
-
export declare const executeBetweenValueValidation: (value: number, minValue: number | undefined, minValueMessage: string | undefined, maxValue: number | undefined, maxValueMessage: string | undefined, betweenValueMessage: string | undefined, errors: ValidationError[]) => boolean;
|
|
43
|
-
export declare const executeDateRangeValidation: (fromValue: string | undefined, toValue: string | undefined, validationMessage: string | undefined, erros: ValidationError[]) => boolean;
|