ch3chi-commons-vue 0.1.11 → 0.1.12

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.
@@ -0,0 +1,195 @@
1
+ import { Ref } from 'vue';
2
+ import { FieldContext, FormContext, FormValidationResult, ValidationResult } from 'vee-validate';
3
+ import * as yup from "yup";
4
+ /**
5
+ * BaseFormDataModel 是一個抽象類別,用於定義表單數據模型的基礎結構。
6
+ * 它包含了表單驗證的 schema、欄位映射和表單上下文等屬性。
7
+ * 子類別需要實現 initFormSchema 方法來定義具體的表單驗證邏輯。
8
+ */
9
+ export declare abstract class BaseFormDataModel {
10
+ uid?: string;
11
+ rowId?: string;
12
+ __rowNumber?: number;
13
+ __isLastAndLastPage?: boolean;
14
+ /**
15
+ * 表單驗證的 schema,使用 Yup 進行定義。
16
+ */
17
+ formSchema: yup.ObjectSchema<any> | null;
18
+ /**
19
+ * 從 formSchema 中展平的欄位名稱列表。
20
+ * formSchema.fields 的 key 值,同時支援 nest object 的欄位名稱。
21
+ * 例如 address.city, address.zipCode
22
+ * 這個屬性會在 initForm 時被初始化。
23
+ */
24
+ formSchemaFieldList: string[] | null;
25
+ /**
26
+ * 表單欄位映射,用於 VeeValidate 的表單驗證。
27
+ */
28
+ formFieldMap: Record<string, FieldContext>;
29
+ /**
30
+ * 表單上下文,包含驗證和狀態管理。
31
+ */
32
+ formContext: FormContext<Record<string, any>> | null;
33
+ /**
34
+ * BaseFormDataModel 的建構函數。
35
+ * @param data 可選的初始數據,用於初始化模型屬性。
36
+ */
37
+ protected constructor(data?: Record<string, any>);
38
+ /**
39
+ * 初始化表單驗證的 schema。
40
+ */
41
+ abstract initFormSchema(): yup.ObjectSchema<any>;
42
+ /**
43
+ * 取得需要套用 form field 欄位名稱的列表。
44
+ * @returns {string[]} 欄位名稱列表
45
+ */
46
+ abstract dataFieldNameList(): string[];
47
+ /**
48
+ * 在呼叫 loadData 之後的會執行的方法,供子類別可以接續處理。
49
+ * @param data
50
+ */
51
+ afterLoadFormData(data: Record<string, any>): void;
52
+ /**
53
+ * 載入數據到模型中。
54
+ * 不會檢查欄位名稱是否在 dataFieldNameList 中定義。
55
+ * @param data
56
+ */
57
+ loadData(data: Record<string, any>): this;
58
+ /**
59
+ * 載入數據到表單模型中。
60
+ * 是從有定義的表單欄位名稱列表中進行載入,同時 properties 也必須要有定義會忽略optional且未賦值的情況。
61
+ *
62
+ * @param data data
63
+ */
64
+ loadFormData(data: Record<string, any>): this;
65
+ /**
66
+ * 將表單數據轉換為 JSON 格式。
67
+ */
68
+ formToJsonData(): Record<string, any>;
69
+ /**
70
+ * 將表單數據轉換為 API 請求的 payload 格式。
71
+ * 供子類別可以覆寫此方法來調整 payload 結構。
72
+ * @param key 動作名稱,例如 "create"、"update" 等。
73
+ */
74
+ toPayload(key?: string): Record<string, any>;
75
+ /**
76
+ * 將表單數據轉換為包含 payload 的映射結構。
77
+ * 供子類別可以覆寫此方法來調整 payload 結構。
78
+ * key 動作名稱,例如 "create"、"update" 等。
79
+ */
80
+ toPayloadMap(): Record<string, Record<string, any>>;
81
+ /**
82
+ * 初始化表單相關的屬性和方法。
83
+ */
84
+ initForm(): void;
85
+ /**
86
+ * 驗證表單數據。
87
+ */
88
+ validateForm(): Promise<FormValidationResult<Record<string, any>>>;
89
+ /**
90
+ * 顯示指定欄位的錯誤訊息。
91
+ * @param fieldName
92
+ */
93
+ validateField(fieldName: string): Promise<ValidationResult>;
94
+ /**
95
+ * 清除表單錯誤訊息。
96
+ */
97
+ clearFormErrors(): void;
98
+ /**
99
+ * 把本身的 properties 套用到 form field 上。
100
+ */
101
+ applyPropertiesToFormField(): void;
102
+ /**
103
+ * 重置表單數據。
104
+ */
105
+ resetFormData(): void;
106
+ /**
107
+ * 檢查指定的欄位是否為必填欄位。
108
+ * @param fieldName
109
+ */
110
+ fieldIsRequired(fieldName: string): boolean;
111
+ /**
112
+ * 取得指定欄位的最大長度限制。
113
+ * @param fieldName
114
+ */
115
+ fieldMaxLength(fieldName: string): number | null;
116
+ /**
117
+ * 將欄位名稱轉換為 Yup schema 中的 key。
118
+ * @param fieldName 欄位名稱
119
+ */
120
+ parseToYupFieldKey(fieldName: string): string;
121
+ /**
122
+ * 設定指定欄位的值。
123
+ * @param fieldName
124
+ * @param toValue
125
+ */
126
+ setFieldValue(fieldName: string, toValue: any): void;
127
+ /**
128
+ * 取得指定欄位的值。
129
+ * @param fieldName
130
+ */
131
+ fieldValue(fieldName: string): any;
132
+ /**
133
+ * 根據欄位名稱查找對應的 FieldContext。
134
+ * @param fieldName 欄位名稱
135
+ * @returns FieldContext 或 null
136
+ */
137
+ findFieldContext(fieldName: string): FieldContext | null;
138
+ /**
139
+ * 根據欄位名稱查找對應的 Ref。
140
+ * @param fieldName 欄位名稱
141
+ * @returns Ref<any> 或 null
142
+ */
143
+ findFieldToBind(fieldName: string): Ref<any> | null;
144
+ /**
145
+ * 根據欄位名稱列表查找對應的 Ref 映射。
146
+ * @param fieldNames 欄位名稱列表
147
+ */
148
+ findFieldRefToBind(fieldNames: string[]): Record<string, Ref<any>>;
149
+ /**
150
+ * 將指定的屬性列表中的字串轉換為 Date 物件。
151
+ * @param data 數據物件
152
+ * @param propertyName 屬性名稱列表
153
+ */
154
+ parseStringToDate(data: Record<string, any>, propertyName: string[]): void;
155
+ /**
156
+ * 將指定的屬性列表轉換為 JSON 格式的數據。
157
+ * @param propertyList
158
+ * @param dataModel
159
+ */
160
+ static makeJsonData(propertyList: string[], dataModel: BaseFormDataModel): Record<string, any>;
161
+ }
162
+ /**
163
+ * CheckableListViewModel 定義了可檢查的列表視圖模型。
164
+ */
165
+ export interface CheckableModel {
166
+ checked?: boolean;
167
+ toggleChecked(): void;
168
+ }
169
+ /**
170
+ * CheckableDataModel 是一個抽象類別,實現了 CheckableModel 接口。
171
+ */
172
+ export declare abstract class CheckableDataModel extends BaseFormDataModel implements CheckableModel {
173
+ checked: boolean;
174
+ protected constructor(data?: Record<string, any>);
175
+ /**
176
+ * 切換選中狀態。
177
+ */
178
+ toggleChecked(): void;
179
+ }
180
+ /**
181
+ * FormDataModelMapper 用於將一個資料物件映射到一個 BaseFormDataModel 的子類別實例中,
182
+ * 並且初始化該實例的表單相關功能。
183
+ * 同時會監控表單值的變化,並將變化回寫到原始資料物件中。
184
+ * 目的:網頁控制項的雙向或是單向綁定到 dataInstance 上,而不是直接綁定到 data 上。
185
+ */
186
+ export declare class FormDataModelMapper<T extends BaseFormDataModel> {
187
+ dataModelClass: new (data?: Partial<T>) => T;
188
+ dataInstance: T;
189
+ constructor(dataModelClass: new (data?: Partial<T>) => T, data: Partial<T>);
190
+ /**
191
+ * 驗證指定欄位。
192
+ * @param fieldPath
193
+ */
194
+ validateField(fieldPath: string): Promise<ValidationResult<unknown>>;
195
+ }
@@ -0,0 +1,144 @@
1
+ import { QueryPage, QueryParameter } from './QueryParameter';
2
+ import { BaseFormDataModel } from './BaseFormDataModel';
3
+ import { CTableColumn, CTableColumnActionType } from '../components/CTableDefine';
4
+ import { Router } from 'vue-router';
5
+ import { ApiResponse } from '../api/ApiService';
6
+ export interface ListApiEndpointMeta {
7
+ key: string;
8
+ pathParam?: Record<string, any>;
9
+ dataParser: (dataItem: any) => any;
10
+ }
11
+ /**
12
+ * BaseListViewModel 是一個抽象類別,用於定義列表視圖模型的基本結構和行為。
13
+ */
14
+ export declare abstract class BaseListViewModel<Q extends QueryParameter, V extends BaseFormDataModel> {
15
+ queryParam: Q;
16
+ dataList: V[];
17
+ tableColumnArray: CTableColumn[];
18
+ router?: Router;
19
+ enableQueryParamDefault?: boolean;
20
+ queryParamDefaultValues?: Record<string, any>;
21
+ saveOnQueryFormDataStore?: boolean;
22
+ autoSearchOnClear?: boolean;
23
+ protected constructor(data?: Partial<BaseListViewModel<Q, V>>);
24
+ /**
25
+ * 查詢列表的 API 端點元資料
26
+ */
27
+ queryListApiEndpointMeta(): ListApiEndpointMeta;
28
+ /**
29
+ * 生成新增的 URL
30
+ * @returns {string} 新增頁面的 URL
31
+ */
32
+ abstract toCreateUrl(): string;
33
+ /**
34
+ * 生成編輯的 URL
35
+ * @param rowData 資料模型
36
+ * @returns {string} 編輯頁面的 URL
37
+ */
38
+ abstract toEditUrl(rowData: V): string;
39
+ /**
40
+ * 使用表格欄位定義
41
+ */
42
+ abstract useTableColumnArray(): CTableColumn[];
43
+ /**
44
+ * 在組件掛載時調用的函式
45
+ */
46
+ callOnMounted(): Promise<void>;
47
+ /**
48
+ * 儲存目前 query param 的屬性值為預設值
49
+ */
50
+ storeQueryDefaultValues(defValues: Record<string, any>): void;
51
+ /**
52
+ * 重設查詢參數為預設值
53
+ */
54
+ resetToDefaultValues(): void;
55
+ /**
56
+ * 載入 API 回應資料
57
+ * @param response API 回應物件
58
+ * @param options 載入選項
59
+ */
60
+ loadApiResponse(response: ApiResponse, options: {
61
+ parser?: (data: any) => V;
62
+ }): void;
63
+ /**
64
+ * 設定列號 根據當下的分頁資訊計算
65
+ * @param dataItem 當前資料項目
66
+ * @param dataIndex 當前資料的索引
67
+ */
68
+ setupRowNumber(dataItem: V, dataIndex: number): void;
69
+ /**
70
+ * 添加單筆資料到列表中
71
+ * @param dataToAdd
72
+ */
73
+ addData(dataToAdd: V): void;
74
+ /**
75
+ * 添加多筆資料到列表中
76
+ * @param dataListToAdd
77
+ */
78
+ addDataList(dataListToAdd: V[]): void;
79
+ /**
80
+ * 清除資料列表
81
+ */
82
+ cleanDataList(): void;
83
+ /**
84
+ * 顯示錯誤訊息對話框
85
+ * @param content 錯誤訊息內容
86
+ * @param onOk 確認按鈕點擊事件
87
+ * @param onCancel 取消按鈕點擊事件
88
+ */
89
+ showConfirm(params: {
90
+ content: string;
91
+ onOk: () => void;
92
+ onCancel?: () => void;
93
+ }): void;
94
+ makeQueryParamStoreKey(): string;
95
+ /**
96
+ * 將查詢參數保存到查詢表單數據存儲中
97
+ */
98
+ saveQueryParamToStore(): void;
99
+ /**
100
+ * 從查詢表單數據存儲中讀取查詢參數
101
+ */
102
+ readQueryParamFromStore(): void;
103
+ /**
104
+ * 執行搜尋操作
105
+ * 查詢時會將查詢參數保存到 store 中,並呼叫 API 獲取資料
106
+ */
107
+ doSearch(event?: Event): Promise<void>;
108
+ /**
109
+ * 處理清除事件
110
+ * 清除查詢參數,並根據設定決定是否重新執行搜尋
111
+ */
112
+ doClear(): Promise<void>;
113
+ /**
114
+ * 處理分頁變更事件
115
+ * @param params
116
+ */
117
+ onPageChange(params: QueryPage): Promise<void>;
118
+ /**
119
+ * 處理 row action編輯事件
120
+ * @param rowMeta
121
+ */
122
+ onColumnActionEdit(rowMeta: {
123
+ actionType: CTableColumnActionType;
124
+ rowData: V;
125
+ }): Promise<void>;
126
+ /**
127
+ * 刪除列後的處理
128
+ * @param rowData
129
+ */
130
+ callOnAfterDeleteRow(rowData: V): Promise<void>;
131
+ }
132
+ /**
133
+ * CheckableListViewModel 是一個抽象類別,擴展自 BaseListViewModel,提供了查找被選中資料的功能。
134
+ */
135
+ export declare abstract class CheckableListViewModel<Q extends QueryParameter, V extends BaseFormDataModel> extends BaseListViewModel<Q, V> {
136
+ /**
137
+ * 查找所有被選中的資料
138
+ */
139
+ findCheckedData(): V[];
140
+ /**
141
+ * 重置所有資料的選中狀態
142
+ */
143
+ resetCheckedData(): void;
144
+ }
@@ -0,0 +1,74 @@
1
+ /**
2
+ * CFileDataModel.ts
3
+ * 用來定義檔案資料模型的介面和實作類別
4
+ */
5
+ /**
6
+ * CFileDataModel 介面
7
+ */
8
+ export interface CFileDataModel {
9
+ uid?: string;
10
+ originalFilename?: string;
11
+ name?: string;
12
+ mimeType?: string;
13
+ ext?: string;
14
+ size?: number;
15
+ url?: string;
16
+ createdAt?: Date;
17
+ fileObj?: File;
18
+ icon?: string;
19
+ fontIcon?: string;
20
+ badgeClass?: string;
21
+ isAssociated?: boolean;
22
+ description?: string;
23
+ }
24
+ /**
25
+ * 用來標示檔案資料模型的實作類別
26
+ */
27
+ export declare class CFileDataModel implements CFileDataModel {
28
+ uid?: string;
29
+ originalFilename?: string;
30
+ name?: string;
31
+ mimeType?: string;
32
+ ext?: string;
33
+ size?: number;
34
+ url?: string;
35
+ createdAt?: Date;
36
+ fileObj?: File;
37
+ icon?: string;
38
+ fontIcon?: string;
39
+ badgeClass?: string;
40
+ isAssociated?: boolean;
41
+ description?: string;
42
+ constructor(data?: Partial<CFileDataModel>);
43
+ init(): this;
44
+ }
45
+ /**
46
+ * CPhotoDataModel 介面
47
+ */
48
+ export declare class CPhotoDataModel extends CFileDataModel {
49
+ width?: number;
50
+ height?: number;
51
+ loaded?: boolean;
52
+ constructor(data?: Partial<CPhotoDataModel>);
53
+ }
54
+ export interface FileUploadProgress {
55
+ uid?: string;
56
+ name?: string;
57
+ progress?: number;
58
+ status?: 'ready' | 'uploading' | 'completed' | 'failed';
59
+ error?: string;
60
+ }
61
+ export declare class FileUploadProgress implements FileUploadProgress {
62
+ uid?: string;
63
+ name?: string;
64
+ progress?: number;
65
+ status?: 'ready' | 'uploading' | 'completed' | 'failed';
66
+ error?: string;
67
+ constructor(data?: Partial<FileUploadProgress>);
68
+ readyToUpload(): boolean;
69
+ isShowProgress(): boolean;
70
+ isDone(): boolean;
71
+ start(): void;
72
+ complete(): void;
73
+ fail(errorMessage: string): void;
74
+ }
@@ -0,0 +1,8 @@
1
+ export declare class CImageViewModel {
2
+ onLoad?: (event: Event) => void;
3
+ onError?: (event: Event | string) => void;
4
+ placeholderImage: string;
5
+ constructor(data?: Partial<CImageViewModel>);
6
+ onLoadHandler(event: Event): void;
7
+ onErrorHandler(event: Event | string): void;
8
+ }
@@ -0,0 +1,84 @@
1
+ import { Ref } from 'vue';
2
+ /**
3
+ * MenuItem 介面用於描述左側選單項目結構
4
+ * name: 顯示名稱
5
+ * icon: 圖示 class 或路徑(可選)
6
+ * path: 路由路徑
7
+ * children: 子選單項目(可選,型別為 CMenuItem 陣列)
8
+ */
9
+ export interface MenuItem {
10
+ id: string;
11
+ name: string;
12
+ icon?: string;
13
+ fontIcon?: string;
14
+ path?: string;
15
+ children?: MenuItem[];
16
+ needRoles?: string[];
17
+ permission?: string | string[];
18
+ activePaths?: string[];
19
+ hasChildren?: () => boolean;
20
+ }
21
+ /**
22
+ * CMenuItem 類別實現 MenuItem 介面
23
+ */
24
+ export declare class CMenuItem implements MenuItem {
25
+ id: string;
26
+ name: string;
27
+ icon?: string;
28
+ fontIcon?: string;
29
+ path?: string;
30
+ needRoles?: string[];
31
+ permission?: string | string[];
32
+ activePaths?: string[];
33
+ children?: CMenuItem[];
34
+ isOpen?: Ref<boolean>;
35
+ isActive?: Ref<boolean>;
36
+ constructor(params: MenuItem);
37
+ /**
38
+ * 判斷是否有子選單項目
39
+ * @returns {boolean} 如果有子選單項目則返回 true,否則返回 false
40
+ */
41
+ hasChildren(): boolean;
42
+ /**
43
+ * 使用 collapse 屬性來控制子選單的展開或收起狀態
44
+ * 這個方法可以在 Vue 模板中使用 v-bind 指令來
45
+ * 綁定到 collapse 屬性上,以實現子選單的折
46
+ */
47
+ useCollapseAttribute(): Record<string, any>;
48
+ /**
49
+ * 使用 collapseId 方法來生成唯一的折疊 ID
50
+ */
51
+ useCollapseId(): string;
52
+ /**
53
+ * 使用 useClassName 方法來生成 CSS 類名
54
+ */
55
+ useClassNameForNavLink(): string;
56
+ /**
57
+ * 使用 useClassName 方法來生成 CSS 類名
58
+ */
59
+ useClassNameForLi(): string;
60
+ /**
61
+ * 計算箭頭圖示的 CSS 類名
62
+ */
63
+ computeArrowClass(): string;
64
+ /**
65
+ * 計算折疊顯示的 CSS 類名
66
+ */
67
+ computeCollapseShowClass(): string;
68
+ /**
69
+ * 計算折疊的 CSS 類名
70
+ * @returns {string} 返回折疊的 CSS 類名
71
+ */
72
+ collapseClassName(): string;
73
+ /**
74
+ * 檢查當前路徑是否與此選單項目的路徑匹配
75
+ * @param currentPath
76
+ */
77
+ checkCurrentPath(currentPath: string): boolean;
78
+ /**
79
+ * 靜態方法用於從 MenuItem 物件解析出 CMenuItem 實例
80
+ * @param item {MenuItem} 要解析的 MenuItem 物件
81
+ * @return {CMenuItem} 返回解析後的 CMenuItem 實例
82
+ */
83
+ static parse(item: MenuItem): CMenuItem;
84
+ }
@@ -0,0 +1,57 @@
1
+ import { BaseFormDataModel } from './BaseFormDataModel';
2
+ import { ComputedRef } from 'vue';
3
+ import * as yup from "yup";
4
+ /**
5
+ * Email 收件人資料
6
+ */
7
+ export declare class EmailRecipientData extends BaseFormDataModel {
8
+ email: string;
9
+ type: 'receiver' | 'cc' | 'bcc';
10
+ constructor(data?: Partial<EmailRecipientData>);
11
+ dataFieldNameList(): string[];
12
+ initFormSchema(): yup.ObjectSchema<{
13
+ email: string;
14
+ type: NonNullable<"receiver" | "cc" | "bcc" | undefined>;
15
+ }, yup.AnyObject, {
16
+ email: undefined;
17
+ type: undefined;
18
+ }, "">;
19
+ }
20
+ /**
21
+ * Email 收件人資料模型
22
+ *
23
+ */
24
+ export declare class EmailReceiverDataModel extends BaseFormDataModel {
25
+ recipientList: Array<EmailRecipientData>;
26
+ constructor(data?: Partial<EmailReceiverDataModel>);
27
+ dataFieldNameList(): string[];
28
+ initFormSchema(): yup.ObjectSchema<{
29
+ recipientList: {
30
+ type: NonNullable<"receiver" | "cc" | "bcc" | undefined>;
31
+ email: string;
32
+ }[] | undefined;
33
+ }, yup.AnyObject, {
34
+ recipientList: "";
35
+ }, "">;
36
+ toPayload(key?: string): Record<string, any>;
37
+ /**
38
+ * 收件人列表
39
+ * @return {ComputedRef<Array<EmailRecipientData>>}
40
+ */
41
+ dataList(): ComputedRef<Array<EmailRecipientData>>;
42
+ /**
43
+ * 新增收件人
44
+ * @param data
45
+ */
46
+ add(data?: Partial<EmailRecipientData>): void;
47
+ /**
48
+ * 刪除收件人
49
+ * @param index
50
+ */
51
+ remove(index: number): void;
52
+ /**
53
+ * 清空表單
54
+ */
55
+ clean(): void;
56
+ get recipientListField(): import('vee-validate').FieldContext;
57
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseFormDataModel } from './BaseFormDataModel';
2
+ import * as yup from 'yup';
3
+ export declare class EmptyDataModel extends BaseFormDataModel {
4
+ constructor(data?: Partial<EmptyDataModel>);
5
+ initFormSchema(): yup.ObjectSchema<{}, yup.AnyObject, {}, "">;
6
+ dataFieldNameList(): string[];
7
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * 表單選項相關的 TypeScript 接口定義
3
+ */
4
+ /**
5
+ * COptionItem 接口定義
6
+ */
7
+ export interface COptionItem {
8
+ id: string;
9
+ text: string;
10
+ value: string | number | boolean;
11
+ disabled?: boolean;
12
+ selected?: boolean;
13
+ children?: CCOptionItem[];
14
+ }
15
+ /**
16
+ * COptionItem 類別實現
17
+ */
18
+ export declare class CCOptionItem implements COptionItem {
19
+ id: string;
20
+ text: string;
21
+ value: string | number | boolean;
22
+ disabled?: boolean;
23
+ selected?: boolean;
24
+ children?: CCOptionItem[];
25
+ constructor(data?: Partial<COptionItem>);
26
+ }
27
+ /**
28
+ * DataCategory 資料類別
29
+ */
30
+ export declare class DataCategory {
31
+ slug?: string;
32
+ name?: string;
33
+ constructor(data?: Partial<DataCategory>);
34
+ }
35
+ /**
36
+ * 基本狀態選項
37
+ */
38
+ export declare const ToggleStatusOptions: COptionItem[];
39
+ /**
40
+ * 通用選項,適用
41
+ * 1. 帳號狀態選項
42
+ * 2. 最新消息狀態選項
43
+ */
44
+ export declare const CommonStatusOptions: COptionItem[];
45
+ /**
46
+ * 是/否 選項
47
+ */
48
+ export declare const YesNoStatusOptions: COptionItem[];
49
+ export declare const OptionUtils: {
50
+ /**
51
+ * 根據 CommonStatusOptions 產生對應的 狀態標籤 HTML
52
+ * @param value 狀態值
53
+ */
54
+ makeCommonStatusLabelText: (value: string | boolean) => string;
55
+ };
@@ -0,0 +1,11 @@
1
+ import { BaseFormDataModel } from './BaseFormDataModel';
2
+ import { ObjectSchema } from 'yup';
3
+ export declare class LoginDataModel extends BaseFormDataModel {
4
+ account?: string;
5
+ password?: string;
6
+ turnstileToken?: string;
7
+ constructor(data?: Partial<LoginDataModel>);
8
+ dataFieldNameList(): string[];
9
+ initFormSchema(): ObjectSchema<any>;
10
+ formToJsonData(): Record<string, any>;
11
+ }
@@ -0,0 +1,15 @@
1
+ import { BaseFormDataModel } from './BaseFormDataModel';
2
+ import { ObjectSchema } from 'yup';
3
+ /**
4
+ * 密碼數據模型
5
+ */
6
+ export declare class PasswordDataModel extends BaseFormDataModel {
7
+ oldPassword: string | null;
8
+ newPassword: string | null;
9
+ confirmNewPassword: string | null;
10
+ requiredOldPassword: boolean;
11
+ constructor(data?: Partial<PasswordDataModel>);
12
+ dataFieldNameList(): string[];
13
+ initFormSchema(): ObjectSchema<any>;
14
+ toPayload(): Record<string, any>;
15
+ }