ch3chi-commons-vue 1.2.0 → 1.8.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/package.json +1 -1
- package/dist/api/ApiService.d.ts +0 -233
- package/dist/auth/AuthorizationService.d.ts +0 -56
- package/dist/auth/PermissionDescriptor.d.ts +0 -37
- package/dist/components/CAlert.vue.d.ts +0 -17
- package/dist/components/CAlertDefine.d.ts +0 -14
- package/dist/components/CBSToast.vue.d.ts +0 -6
- package/dist/components/CGlobalSpinner.vue.d.ts +0 -13
- package/dist/components/CRowCheckBox.vue.d.ts +0 -14
- package/dist/components/CRowTextInput.vue.d.ts +0 -10
- package/dist/components/CTable.vue.d.ts +0 -24
- package/dist/components/CTableDefine.d.ts +0 -201
- package/dist/components/CTableTD.vue.d.ts +0 -7
- package/dist/components/form/CChangePasswordFormField.vue.d.ts +0 -14
- package/dist/components/form/CCheckBoxFormField.vue.d.ts +0 -30
- package/dist/components/form/CDateFormField.vue.d.ts +0 -17
- package/dist/components/form/CDateQueryField.vue.d.ts +0 -16
- package/dist/components/form/CDateRangeFormField.vue.d.ts +0 -17
- package/dist/components/form/CFilePickerFormField.vue.d.ts +0 -28
- package/dist/components/form/CRadioFormField.vue.d.ts +0 -30
- package/dist/components/form/CSelectFormField.vue.d.ts +0 -18
- package/dist/components/form/CTextAreaFormField.vue.d.ts +0 -16
- package/dist/components/form/CTextInputFormField.vue.d.ts +0 -22
- package/dist/directive/CBootstrapDirective.d.ts +0 -17
- package/dist/directive/CDateFormatterDirective.d.ts +0 -10
- package/dist/directive/CFTurnstileDirective.d.ts +0 -15
- package/dist/directive/CFormDirective.d.ts +0 -9
- package/dist/directive/PermissionDirective.d.ts +0 -15
- package/dist/index.cjs.js +0 -19103
- package/dist/index.d.ts +0 -45
- package/dist/index.es.js +0 -19086
- package/dist/model/BSFieldStyleConfig.d.ts +0 -121
- package/dist/model/BaseDictionary.d.ts +0 -34
- package/dist/model/BaseFormDataModel.d.ts +0 -199
- package/dist/model/BaseListViewModel.d.ts +0 -165
- package/dist/model/CBSModalViewModel.d.ts +0 -44
- package/dist/model/CFileDataModel.d.ts +0 -74
- package/dist/model/CImageViewModel.d.ts +0 -8
- package/dist/model/CMenuItem.d.ts +0 -86
- package/dist/model/EmailReceiverDataModel.d.ts +0 -57
- package/dist/model/EmptyDataModel.d.ts +0 -7
- package/dist/model/FormOptions.d.ts +0 -60
- package/dist/model/LoginDataModel.d.ts +0 -12
- package/dist/model/PasswordDataModel.d.ts +0 -15
- package/dist/model/QueryParameter.d.ts +0 -92
- package/dist/model/SessionUser.d.ts +0 -45
- package/dist/model/ShowMessageDataModel.d.ts +0 -44
- package/dist/model/TokenUser.d.ts +0 -50
- package/dist/stores/FormDataStore.d.ts +0 -31
- package/dist/stores/ViewStore.d.ts +0 -349
- package/dist/style.css +0 -223
- package/dist/utils/CToolUtils.d.ts +0 -53
package/package.json
CHANGED
package/dist/api/ApiService.d.ts
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import { AxiosProgressEvent, AxiosRequestConfig, AxiosResponse, RawAxiosResponseHeaders } from 'axios';
|
|
2
|
-
import { AccessToken } from '../model/TokenUser';
|
|
3
|
-
/**
|
|
4
|
-
* ApiEndpoint 定義 API 端點的結構
|
|
5
|
-
*/
|
|
6
|
-
export interface ApiEndpoint {
|
|
7
|
-
path: string;
|
|
8
|
-
method: string;
|
|
9
|
-
isAuthenticated?: boolean;
|
|
10
|
-
security?: string[];
|
|
11
|
-
withCredentials?: boolean;
|
|
12
|
-
isRefreshTokenEndpoint?: boolean;
|
|
13
|
-
errorMessageMap?: Record<number, string>;
|
|
14
|
-
noSpinner?: boolean;
|
|
15
|
-
headers?: Record<string, string>;
|
|
16
|
-
metaData?: Record<string, any>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* CreateEndpointOptions 定義建立 ApiEndpoint 時的選項
|
|
20
|
-
* 通常用於設定預設值
|
|
21
|
-
*/
|
|
22
|
-
export interface CreateEndpointOptions {
|
|
23
|
-
isAuthenticated?: boolean;
|
|
24
|
-
security?: string[];
|
|
25
|
-
headers?: Record<string, string>;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* ApiRequest 定義 API 請求的結構
|
|
29
|
-
*/
|
|
30
|
-
export declare class ApiRequest {
|
|
31
|
-
endpointKey: string;
|
|
32
|
-
headers?: Record<string, string>;
|
|
33
|
-
pathParam?: Record<string, any>;
|
|
34
|
-
queryParam?: Record<string, any>;
|
|
35
|
-
postBody?: Record<string, any> | FormData;
|
|
36
|
-
isDownloadMode?: boolean;
|
|
37
|
-
downloadFileName?: string;
|
|
38
|
-
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
|
|
39
|
-
axiosConfig?: AxiosRequestConfig;
|
|
40
|
-
noSpinner?: boolean;
|
|
41
|
-
constructor(data: ApiRequest);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* ApiResponse 定義 API 回應的結構
|
|
45
|
-
*/
|
|
46
|
-
export declare class ApiResponse {
|
|
47
|
-
httpStatus: number;
|
|
48
|
-
status?: number;
|
|
49
|
-
message?: string;
|
|
50
|
-
data?: any;
|
|
51
|
-
nativeError?: any;
|
|
52
|
-
paging?: Record<string, any>;
|
|
53
|
-
blobData?: Blob;
|
|
54
|
-
headers?: RawAxiosResponseHeaders;
|
|
55
|
-
details?: any;
|
|
56
|
-
axiosResponse?: AxiosResponse;
|
|
57
|
-
constructor(data?: Partial<ApiResponse>);
|
|
58
|
-
isOk(): boolean;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* ApiRejectError 定義 API 呼叫失敗時的自訂錯誤
|
|
62
|
-
* 此物件給 ApiService.call 呼叫後,並且回傳 Promise.reject() 使用
|
|
63
|
-
*/
|
|
64
|
-
export declare class ApiRejectError extends Error {
|
|
65
|
-
response: ApiResponse;
|
|
66
|
-
type?: string;
|
|
67
|
-
constructor(response: ApiResponse);
|
|
68
|
-
notFound(): this;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* ApiService 提供呼叫後端 API 的功能
|
|
72
|
-
*/
|
|
73
|
-
export declare class ApiService {
|
|
74
|
-
private static _options;
|
|
75
|
-
private static _apiEndpoints;
|
|
76
|
-
private static _customHeaders;
|
|
77
|
-
private static _customHeaderProvider?;
|
|
78
|
-
private static _customErrorMessageMap;
|
|
79
|
-
private static _accessToken?;
|
|
80
|
-
private static _accessTokenProvider?;
|
|
81
|
-
private static _refreshTokenPromise?;
|
|
82
|
-
private static _axiosInstance?;
|
|
83
|
-
private static _failedRequestQueue;
|
|
84
|
-
private static _isRefreshing;
|
|
85
|
-
static set accessToken(token: AccessToken);
|
|
86
|
-
static set accessTokenProvider(provider: () => Promise<AccessToken | undefined>);
|
|
87
|
-
static getAccessToken(): Promise<AccessToken | undefined>;
|
|
88
|
-
/**
|
|
89
|
-
* 靜態方法,新增全域自訂標頭
|
|
90
|
-
* @param key
|
|
91
|
-
* @param value
|
|
92
|
-
*/
|
|
93
|
-
static addHeader(key: string, value: string): void;
|
|
94
|
-
/**
|
|
95
|
-
* 靜態方法,移除全域自訂標頭
|
|
96
|
-
* @param key
|
|
97
|
-
*/
|
|
98
|
-
static removeHeader(key: string): void;
|
|
99
|
-
/**
|
|
100
|
-
* 靜態方法,設定自訂標頭提供者
|
|
101
|
-
* @param provider
|
|
102
|
-
*/
|
|
103
|
-
static customHeaderProvider(provider: (endpoint: ApiEndpoint, header: Record<string, any>) => Promise<Record<string, string>>): void;
|
|
104
|
-
constructor();
|
|
105
|
-
/**
|
|
106
|
-
* 靜態方法,配置 ApiService
|
|
107
|
-
* 為方便管理,建議在專案啟動時呼叫此方法註冊所有端點
|
|
108
|
-
* 可以配置
|
|
109
|
-
* - debugMode: 是否啟用除錯模式
|
|
110
|
-
* - baseUrl: API 伺服器的基礎 URL
|
|
111
|
-
* - contextPath: API 的上下文路徑
|
|
112
|
-
* - proxyEnable: 是否啟用代理
|
|
113
|
-
* - proxyBaseUrl: 代理的基礎 URL
|
|
114
|
-
* - showSpinnerFunc: 顯示全域載入動畫的函式
|
|
115
|
-
* - hideSpinnerFunc: 隱藏全域載入動畫的函式
|
|
116
|
-
* - showErrorToastFunc: 顯示全域錯誤提示的函式
|
|
117
|
-
* - endpoints: 預設註冊的 API 端點
|
|
118
|
-
* - customHeaders: 全域自訂標頭
|
|
119
|
-
* - customErrorMessageMap: 全域自訂錯誤訊息對應
|
|
120
|
-
* - createEndpointOptions: 建立端點時的預設選項
|
|
121
|
-
* - refreshTokenFunc: 刷新存取權杖的函式
|
|
122
|
-
* - onAuthenticateFailed: 認證失敗時的回調函式
|
|
123
|
-
* @param config
|
|
124
|
-
*/
|
|
125
|
-
static configure(config: {
|
|
126
|
-
debugMode?: boolean;
|
|
127
|
-
baseUrl?: string;
|
|
128
|
-
contextPath?: string;
|
|
129
|
-
proxyEnable?: boolean;
|
|
130
|
-
proxyBaseUrl?: string;
|
|
131
|
-
showSpinnerFunc?: () => void;
|
|
132
|
-
hideSpinnerFunc?: () => void;
|
|
133
|
-
showErrorToastFunc?: (param: {
|
|
134
|
-
title?: string;
|
|
135
|
-
content?: string;
|
|
136
|
-
}) => void;
|
|
137
|
-
endpoints: Record<string, ApiEndpoint>;
|
|
138
|
-
customHeaders?: Record<string, string>;
|
|
139
|
-
customHeaderProvider?: (endpoint: ApiEndpoint, header: Record<string, any>) => Promise<Record<string, string>>;
|
|
140
|
-
customErrorMessageMap?: Record<number, string>;
|
|
141
|
-
createEndpointOptions?: CreateEndpointOptions;
|
|
142
|
-
refreshTokenFunc?: () => Promise<AccessToken>;
|
|
143
|
-
onAuthenticateFailed?: (param: {
|
|
144
|
-
apiEndpoint: ApiEndpoint;
|
|
145
|
-
apiRequest: ApiRequest;
|
|
146
|
-
}) => void;
|
|
147
|
-
}): void;
|
|
148
|
-
/**
|
|
149
|
-
* 靜態方法,新增單一 API 端點
|
|
150
|
-
* @param key
|
|
151
|
-
* @param endpoint
|
|
152
|
-
*/
|
|
153
|
-
static addEndpoints(key: string, endpoint: ApiEndpoint): void;
|
|
154
|
-
/**
|
|
155
|
-
* 靜態方法,方便直接呼叫 API
|
|
156
|
-
* @param request
|
|
157
|
-
*/
|
|
158
|
-
static call(request: ApiRequest): Promise<ApiResponse>;
|
|
159
|
-
/**
|
|
160
|
-
* 靜態方法,方便直接下載檔案
|
|
161
|
-
* @param request
|
|
162
|
-
*/
|
|
163
|
-
static download(request: ApiRequest): Promise<void>;
|
|
164
|
-
/**
|
|
165
|
-
* 取得指定的 API 端點資訊
|
|
166
|
-
* @param endpointKey
|
|
167
|
-
*/
|
|
168
|
-
getEndpoint(endpointKey: string): ApiEndpoint | undefined;
|
|
169
|
-
/**
|
|
170
|
-
* 取得完整的 API URL
|
|
171
|
-
* @param endpointKey
|
|
172
|
-
*/
|
|
173
|
-
getFullUrl(endpointKey: string): string | undefined;
|
|
174
|
-
/**
|
|
175
|
-
* 組合完整的 API URL
|
|
176
|
-
* @param endpoint
|
|
177
|
-
*/
|
|
178
|
-
makeBaseUrl(endpoint: ApiEndpoint): string | undefined;
|
|
179
|
-
/**
|
|
180
|
-
* 呼叫 API
|
|
181
|
-
* @param request
|
|
182
|
-
*/
|
|
183
|
-
callApi(request: ApiRequest): Promise<ApiResponse>;
|
|
184
|
-
/**
|
|
185
|
-
* 下載檔案
|
|
186
|
-
* @param request
|
|
187
|
-
*/
|
|
188
|
-
downloadFile(request: ApiRequest): Promise<void>;
|
|
189
|
-
/**
|
|
190
|
-
* 決定下載檔案名稱
|
|
191
|
-
* @param request
|
|
192
|
-
* @param response
|
|
193
|
-
*/
|
|
194
|
-
resolveExportFileName(request: ApiRequest, response: ApiResponse): string;
|
|
195
|
-
/**
|
|
196
|
-
* 解碼 RFC 2047 編碼的字串
|
|
197
|
-
* @param str RFC 2047 編碼的字串
|
|
198
|
-
*/
|
|
199
|
-
decodeRfc2047(str: string): string;
|
|
200
|
-
/**
|
|
201
|
-
* 檢查是否啟用 Bearer Token 認證
|
|
202
|
-
*/
|
|
203
|
-
private static hasBearerAuth;
|
|
204
|
-
/**
|
|
205
|
-
* 設定 axios 攔截器
|
|
206
|
-
*/
|
|
207
|
-
private static setupAxiosInterceptors;
|
|
208
|
-
/**
|
|
209
|
-
* 設定認證相關的 interceptors
|
|
210
|
-
*/
|
|
211
|
-
private static setupAuthInterceptorsOnBearerAuth;
|
|
212
|
-
/**
|
|
213
|
-
* 刷新 access token
|
|
214
|
-
*/
|
|
215
|
-
static refreshToken(): Promise<AccessToken>;
|
|
216
|
-
/**
|
|
217
|
-
* 檢查並刷新 token(如果需要)
|
|
218
|
-
*/
|
|
219
|
-
private static refreshTokenIfNeeded;
|
|
220
|
-
/**
|
|
221
|
-
* 處理佇列中的失敗請求
|
|
222
|
-
*/
|
|
223
|
-
private static processFailedRequestQueue;
|
|
224
|
-
/**
|
|
225
|
-
* 處理認證失敗
|
|
226
|
-
*/
|
|
227
|
-
private static handleAuthenticationFailed;
|
|
228
|
-
/**
|
|
229
|
-
* 取得 axios 實例
|
|
230
|
-
*/
|
|
231
|
-
private static getAxiosInstance;
|
|
232
|
-
}
|
|
233
|
-
export declare const __ApiServiceDefine__: ApiEndpoint;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { CMenuItem, MenuItem } from '../model/CMenuItem';
|
|
2
|
-
/**
|
|
3
|
-
* 提供選單項目的參數介面
|
|
4
|
-
*/
|
|
5
|
-
type ProvideMenuByPermissionParams = {
|
|
6
|
-
roleCode: string;
|
|
7
|
-
permissions: string[];
|
|
8
|
-
picker?: (roleCode: string) => MenuItem[];
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* AuthorizationService 類別負責處理權限相關的邏輯
|
|
12
|
-
*/
|
|
13
|
-
export declare class AuthorizationService {
|
|
14
|
-
/**
|
|
15
|
-
* 角色權限映射表
|
|
16
|
-
* 定義角色對應多個權限項目
|
|
17
|
-
* @private
|
|
18
|
-
*/
|
|
19
|
-
private static _rolePermissionMap;
|
|
20
|
-
/**
|
|
21
|
-
* 選單定義映射表
|
|
22
|
-
* 定義不同角色對應的選單結構
|
|
23
|
-
* @private
|
|
24
|
-
*/
|
|
25
|
-
private static _menuDefineMap;
|
|
26
|
-
/**
|
|
27
|
-
* 設定角色權限映射
|
|
28
|
-
* @param map 角色權限映射物件
|
|
29
|
-
*/
|
|
30
|
-
static set rolePermissionMap(map: Record<string, string[]>);
|
|
31
|
-
/**
|
|
32
|
-
* 設定選單定義映射
|
|
33
|
-
* @param map
|
|
34
|
-
*/
|
|
35
|
-
static set menuDefineMap(map: Record<string, MenuItem[]>);
|
|
36
|
-
/**
|
|
37
|
-
* 配置角色與權限關係,以及選單定義映射
|
|
38
|
-
* @param config 配置物件
|
|
39
|
-
*/
|
|
40
|
-
static configure(config: {
|
|
41
|
-
rolePermissionMap?: Record<string, string[]>;
|
|
42
|
-
menuDefineMap: Record<string, MenuItem[]>;
|
|
43
|
-
}): void;
|
|
44
|
-
/**
|
|
45
|
-
* 檢查角色列表是否包含所需的權限
|
|
46
|
-
* @param roleCodes
|
|
47
|
-
* @param requiredPermission
|
|
48
|
-
*/
|
|
49
|
-
static hasPermissionByRole(roleCodes: string[], requiredPermission: string): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* 根據角色列表提供選單項目
|
|
52
|
-
* @param param 配置參數
|
|
53
|
-
*/
|
|
54
|
-
static provideMenuByPermission(param: ProvideMenuByPermissionParams): CMenuItem[];
|
|
55
|
-
}
|
|
56
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 權限:操作字串列舉
|
|
3
|
-
*/
|
|
4
|
-
export declare enum PermissionAction {
|
|
5
|
-
NONE = "NONE",// 無操作
|
|
6
|
-
SIGN_IN = "SIGN_IN",// 登入
|
|
7
|
-
SIGN_OUT = "SIGN_OUT",// 登出
|
|
8
|
-
FORGOT_PASSWORD = "FORGOT_PASSWORD",// 忘記密碼
|
|
9
|
-
RESET_PASSWORD = "RESET_PASSWORD",// 重設個人密碼
|
|
10
|
-
CHANGE_PASSWORD = "CHANGE_PASSWORD",// 更改密碼
|
|
11
|
-
CREATE = "CREATE",// 建立資料
|
|
12
|
-
SEARCH = "SEARCH",// 查詢列表
|
|
13
|
-
READ = "READ",// 讀取資料
|
|
14
|
-
UPDATE = "UPDATE",// 更新資料
|
|
15
|
-
DELETE = "DELETE",// 刪除資料
|
|
16
|
-
EXPORT = "EXPORT"
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* 權限描述類別
|
|
20
|
-
*/
|
|
21
|
-
export declare class PermissionDescriptor {
|
|
22
|
-
module: string;
|
|
23
|
-
action: PermissionAction;
|
|
24
|
-
supportedActions: PermissionAction[];
|
|
25
|
-
constructor(data?: Partial<PermissionDescriptor> | string);
|
|
26
|
-
/**
|
|
27
|
-
* 檢查是否屬於同一個 module
|
|
28
|
-
* @param toCheckPermissions
|
|
29
|
-
*/
|
|
30
|
-
checkModule(toCheckPermissions: string[]): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* 檢查是否具有指定的權限
|
|
33
|
-
* @param toCheckPermissions
|
|
34
|
-
*/
|
|
35
|
-
checkPermission(toCheckPermissions: string[]): boolean;
|
|
36
|
-
}
|
|
37
|
-
export declare const __PermissionStringDefine__: PermissionAction;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CAlertModalData } from './CAlertDefine';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
id?: string;
|
|
4
|
-
};
|
|
5
|
-
declare function show(data?: CAlertModalData): void;
|
|
6
|
-
declare function hide(): void;
|
|
7
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
8
|
-
show: typeof show;
|
|
9
|
-
hide: typeof hide;
|
|
10
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
-
"c.modal.ok": (...args: any[]) => void;
|
|
12
|
-
"c.modal.cancel": (...args: any[]) => void;
|
|
13
|
-
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
-
"onC.modal.ok"?: ((...args: any[]) => any) | undefined;
|
|
15
|
-
"onC.modal.cancel"?: ((...args: any[]) => any) | undefined;
|
|
16
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
|
-
export default _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface CAlertModalData {
|
|
2
|
-
type?: CAlertModalType | string;
|
|
3
|
-
title?: string;
|
|
4
|
-
content?: string;
|
|
5
|
-
onCancel?: () => void;
|
|
6
|
-
onOk?: () => void;
|
|
7
|
-
}
|
|
8
|
-
export declare enum CAlertModalType {
|
|
9
|
-
Error = "error",// 警告類型
|
|
10
|
-
Alert = "alert",// 警告類型
|
|
11
|
-
Confirm = "confirm",// 確認類型
|
|
12
|
-
Info = "info"
|
|
13
|
-
}
|
|
14
|
-
export declare const __CAlertModelDefine__: CAlertModalData & CAlertModalType;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CAlertModalData } from '../components/CAlertDefine';
|
|
2
|
-
declare function addToast(data: CAlertModalData): void;
|
|
3
|
-
declare const _default: import('vue').DefineComponent<{}, {
|
|
4
|
-
addToast: typeof addToast;
|
|
5
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
6
|
-
export default _default;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
show?: boolean;
|
|
3
|
-
color?: string;
|
|
4
|
-
delayMS?: number;
|
|
5
|
-
isDelay?: boolean;
|
|
6
|
-
};
|
|
7
|
-
declare function showSpinner(): void;
|
|
8
|
-
declare function hide(): void;
|
|
9
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
10
|
-
show: typeof showSpinner;
|
|
11
|
-
hide: typeof hide;
|
|
12
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
-
export default _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ComputedRef } from 'vue';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
align?: 'left' | 'center' | 'right';
|
|
4
|
-
rowData: Record<string, any>;
|
|
5
|
-
cancelable?: boolean;
|
|
6
|
-
disableComputed?: ComputedRef<boolean>;
|
|
7
|
-
readMode?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
-
"update:checked": (...args: any[]) => void;
|
|
11
|
-
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
-
"onUpdate:checked"?: ((...args: any[]) => any) | undefined;
|
|
13
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
rowData: Record<string, any>;
|
|
3
|
-
dataName: string;
|
|
4
|
-
};
|
|
5
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
6
|
-
"update:textInput": (...args: any[]) => void;
|
|
7
|
-
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
-
"onUpdate:textInput"?: ((...args: any[]) => any) | undefined;
|
|
9
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLInputElement>;
|
|
10
|
-
export default _default;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Reactive } from 'vue';
|
|
2
|
-
import { BaseFormDataModel } from '../model/BaseFormDataModel';
|
|
3
|
-
import { QueryParameter } from '../model/QueryParameter';
|
|
4
|
-
import { CTableColumn } from './CTableDefine';
|
|
5
|
-
type CTableProps<T extends QueryParameter, V extends BaseFormDataModel> = {
|
|
6
|
-
queryParam?: Reactive<T>;
|
|
7
|
-
columns: CTableColumn[];
|
|
8
|
-
dataList?: V[];
|
|
9
|
-
disablePagination?: boolean;
|
|
10
|
-
multiSort?: boolean;
|
|
11
|
-
pageSizeOptions?: number[];
|
|
12
|
-
styleConfig?: Record<string, any>;
|
|
13
|
-
};
|
|
14
|
-
type __VLS_Props = CTableProps<QueryParameter, BaseFormDataModel>;
|
|
15
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
|
-
"table-action": (...args: any[]) => void;
|
|
17
|
-
"page-change": (...args: any[]) => void;
|
|
18
|
-
"sort-change": (...args: any[]) => void;
|
|
19
|
-
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
|
-
"onTable-action"?: ((...args: any[]) => any) | undefined;
|
|
21
|
-
"onPage-change"?: ((...args: any[]) => any) | undefined;
|
|
22
|
-
"onSort-change"?: ((...args: any[]) => any) | undefined;
|
|
23
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
24
|
-
export default _default;
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { VNode } from 'vue';
|
|
2
|
-
/**
|
|
3
|
-
* CTableColumnType 定義了表格欄位的類型
|
|
4
|
-
* - RowNumber: 行號類型
|
|
5
|
-
* - Text: 文字類型
|
|
6
|
-
* - Date: 日期類型
|
|
7
|
-
* - DateTime: 日期時間類型
|
|
8
|
-
* - Action: 操作類型
|
|
9
|
-
*/
|
|
10
|
-
export declare enum CTableColumnType {
|
|
11
|
-
RowNumber = "rowNumber",// 行號類型
|
|
12
|
-
Text = "text",// 文字類型
|
|
13
|
-
TextInput = "textInput",// 文字輸入類型(可手動切換?)
|
|
14
|
-
Date = "date",// 日期類型
|
|
15
|
-
DateRange = "dateRange",// 日期範圍類型
|
|
16
|
-
DateTime = "datetime",// 日期時間類型
|
|
17
|
-
Action = "action",// 操作類型
|
|
18
|
-
Checkbox = "checkbox"
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* CTableColumnActionType 定義了表格欄位的操作類型
|
|
22
|
-
*/
|
|
23
|
-
export declare enum CTableColumnActionType {
|
|
24
|
-
Edit = "edit",// 編輯操作
|
|
25
|
-
Delete = "delete",// 刪除操作
|
|
26
|
-
Review = "review",// 審核操作
|
|
27
|
-
Vote = "vote",// 投票操作
|
|
28
|
-
Check = "check"
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* CTableColumnActionParam 定義了表格欄位操作的參數
|
|
32
|
-
*/
|
|
33
|
-
export interface CTableColumnActionParam {
|
|
34
|
-
actionType: CTableColumnActionType;
|
|
35
|
-
rowData: Record<string, any>;
|
|
36
|
-
event?: Event;
|
|
37
|
-
}
|
|
38
|
-
export interface CTableColumnActionMeta {
|
|
39
|
-
actionType: CTableColumnActionType;
|
|
40
|
-
text?: string;
|
|
41
|
-
cls?: string;
|
|
42
|
-
icon?: string;
|
|
43
|
-
onClick?: (p: CTableColumnActionParam) => void;
|
|
44
|
-
emit?: (event: string, ...args: any[]) => void;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* CTableColumnDefine 定義了表格欄位的屬性和行為
|
|
48
|
-
*/
|
|
49
|
-
export interface CTableColumnDefine {
|
|
50
|
-
id?: string;
|
|
51
|
-
type: CTableColumnType;
|
|
52
|
-
idName?: string;
|
|
53
|
-
dataName?: string;
|
|
54
|
-
dataNameList?: string[];
|
|
55
|
-
text: string;
|
|
56
|
-
defaultText?: string;
|
|
57
|
-
sortConfig?: {
|
|
58
|
-
sortable?: boolean;
|
|
59
|
-
key?: string | string[];
|
|
60
|
-
direction?: 'asc' | 'desc';
|
|
61
|
-
} | undefined;
|
|
62
|
-
width?: string;
|
|
63
|
-
align?: 'left' | 'center' | 'right';
|
|
64
|
-
dataAlign?: 'left' | 'center' | 'right';
|
|
65
|
-
formatPattern?: string;
|
|
66
|
-
actionList?: CTableColumnActionMeta[];
|
|
67
|
-
customRender?: (rowData: Record<string, any>) => string | HTMLElement | VNode;
|
|
68
|
-
useHtml?: boolean;
|
|
69
|
-
useVNode?: boolean;
|
|
70
|
-
vNodeAttrs?: Record<string, any>;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* CTableColumn 類別定義了表格欄位的屬性和行為
|
|
74
|
-
*/
|
|
75
|
-
export declare class CTableColumn implements CTableColumnDefine {
|
|
76
|
-
id?: string;
|
|
77
|
-
type: CTableColumnType;
|
|
78
|
-
idName?: string;
|
|
79
|
-
dataName?: string;
|
|
80
|
-
dataNameList?: string[];
|
|
81
|
-
text: string;
|
|
82
|
-
defaultText?: string;
|
|
83
|
-
sortConfig?: {
|
|
84
|
-
sortable?: boolean;
|
|
85
|
-
key?: string | string[];
|
|
86
|
-
direction?: 'asc' | 'desc';
|
|
87
|
-
};
|
|
88
|
-
width?: string;
|
|
89
|
-
align?: 'left' | 'center' | 'right';
|
|
90
|
-
dataAlign?: 'left' | 'center' | 'right';
|
|
91
|
-
formatPattern?: string;
|
|
92
|
-
actionList?: CTableColumnActionMeta[];
|
|
93
|
-
defaultRender?: (rowData: Record<string, any>) => string | HTMLElement | VNode;
|
|
94
|
-
customRender?: (rowData: Record<string, any>) => string | HTMLElement | VNode;
|
|
95
|
-
useHtml: boolean;
|
|
96
|
-
useVNode: boolean;
|
|
97
|
-
vNodeAttrs?: Record<string, any>;
|
|
98
|
-
constructor(define: CTableColumnDefine);
|
|
99
|
-
static defaultIconMap: Record<CTableColumnActionType, string>;
|
|
100
|
-
static defaultBtnClassMap: Record<CTableColumnActionType, string>;
|
|
101
|
-
static configure(config: {
|
|
102
|
-
iconMap?: Partial<Record<CTableColumnActionType, string>>;
|
|
103
|
-
btnClassMap?: Partial<Record<CTableColumnActionType, string>>;
|
|
104
|
-
}): void;
|
|
105
|
-
/**
|
|
106
|
-
* 渲染欄位內容
|
|
107
|
-
* @param rowData 當前行的數據
|
|
108
|
-
*/
|
|
109
|
-
render(rowData: Record<string, any>): string | HTMLElement | VNode;
|
|
110
|
-
/**
|
|
111
|
-
* 生成 th 的 class 名稱
|
|
112
|
-
*/
|
|
113
|
-
thClass(): string;
|
|
114
|
-
/**
|
|
115
|
-
* 生成 td 的 class 名稱
|
|
116
|
-
*/
|
|
117
|
-
tdClass(): string;
|
|
118
|
-
/**
|
|
119
|
-
* 處理欄位操作
|
|
120
|
-
* @private
|
|
121
|
-
*/
|
|
122
|
-
private handleAction;
|
|
123
|
-
/**
|
|
124
|
-
* 生成默認渲染函數
|
|
125
|
-
* @private
|
|
126
|
-
*/
|
|
127
|
-
private makeDefaultRender;
|
|
128
|
-
/**
|
|
129
|
-
* 根據操作類型生成按鈕的樣式和文字
|
|
130
|
-
* @param actionType 操作類型
|
|
131
|
-
* @returns {cls: string, text: string} 按鈕的樣式和文字
|
|
132
|
-
* @private
|
|
133
|
-
*/
|
|
134
|
-
private buildActionButtonMeta;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* 分頁樣式配置介面
|
|
138
|
-
*/
|
|
139
|
-
export interface PaginationStyleConfig {
|
|
140
|
-
backgroundColor: string;
|
|
141
|
-
textColor: string;
|
|
142
|
-
borderColor: string;
|
|
143
|
-
hoverBackgroundColor: string;
|
|
144
|
-
hoverTextColor: string;
|
|
145
|
-
hoverBorderColor: string;
|
|
146
|
-
activeBackgroundColor: string;
|
|
147
|
-
activeTextColor: string;
|
|
148
|
-
activeBorderColor: string;
|
|
149
|
-
previousIcon: string;
|
|
150
|
-
nextIcon: string;
|
|
151
|
-
firstIcon: string;
|
|
152
|
-
lastIcon: string;
|
|
153
|
-
ellipsisIcon: string;
|
|
154
|
-
}
|
|
155
|
-
export interface TableStyleConfig {
|
|
156
|
-
sortIconNone?: string;
|
|
157
|
-
sortIconAsc?: string;
|
|
158
|
-
sortIconDesc?: string;
|
|
159
|
-
scrollbarThumbColor?: string;
|
|
160
|
-
scrollbarTrackColor?: string;
|
|
161
|
-
scrollbarThumbHoverColor?: string;
|
|
162
|
-
scrollbarHeight?: string;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* CTableConfig 類別用於配置表格的全域設定 包含以下
|
|
166
|
-
* - 分頁樣式設定
|
|
167
|
-
* - 每頁顯示選項
|
|
168
|
-
*/
|
|
169
|
-
export declare class CTableConfig {
|
|
170
|
-
private static tableStyleConfig;
|
|
171
|
-
static getTableStyleConfig(): TableStyleConfig;
|
|
172
|
-
static setTableStyleConfig(config: Partial<TableStyleConfig>): void;
|
|
173
|
-
private static defaultPaginationStyle;
|
|
174
|
-
private static currentPaginationStyle;
|
|
175
|
-
/**
|
|
176
|
-
* 設定全域分頁樣式
|
|
177
|
-
* @param config 分頁樣式配置
|
|
178
|
-
*/
|
|
179
|
-
static setPaginationStyle(config: Partial<PaginationStyleConfig>): void;
|
|
180
|
-
/**
|
|
181
|
-
* 取得當前分頁樣式
|
|
182
|
-
*/
|
|
183
|
-
static getPaginationStyle(): PaginationStyleConfig;
|
|
184
|
-
/**
|
|
185
|
-
* 重置分頁樣式為預設值
|
|
186
|
-
*/
|
|
187
|
-
static resetPaginationStyle(): void;
|
|
188
|
-
/**
|
|
189
|
-
* 產生分頁樣式的 CSS 變數物件
|
|
190
|
-
*/
|
|
191
|
-
static getPaginationStyleVars(): Record<string, string>;
|
|
192
|
-
/**
|
|
193
|
-
* 產生表格樣式的 CSS 變數物件
|
|
194
|
-
*/
|
|
195
|
-
static getTableStyleVars(): Record<string, string>;
|
|
196
|
-
/**
|
|
197
|
-
* 預設每頁顯示選項
|
|
198
|
-
*/
|
|
199
|
-
static pageSizeOptions: number[];
|
|
200
|
-
}
|
|
201
|
-
export declare const __CTableDefine__: CTableColumnType & CTableColumnActionType & CTableColumnActionParam & CTableColumnActionMeta & CTableColumnDefine & PaginationStyleConfig;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CTableColumn } from '../components/CTableDefine';
|
|
2
|
-
export interface CTableTDProps {
|
|
3
|
-
columnItem: CTableColumn;
|
|
4
|
-
dataItem: Record<string, any>;
|
|
5
|
-
}
|
|
6
|
-
declare const _default: import('vue').DefineComponent<CTableTDProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CTableTDProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
7
|
-
export default _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PasswordDataModel } from '../../model/PasswordDataModel';
|
|
2
|
-
import { ApiResponse } from '../../api/ApiService';
|
|
3
|
-
import { IBSFieldStyleConfig } from '../../model/BSFieldStyleConfig';
|
|
4
|
-
type __VLS_Props = {
|
|
5
|
-
userUid: string;
|
|
6
|
-
requireOldPassword?: boolean;
|
|
7
|
-
dataModelConstructor?: new () => PasswordDataModel;
|
|
8
|
-
callApi: (dataModel: PasswordDataModel) => Promise<ApiResponse>;
|
|
9
|
-
styleConfig?: IBSFieldStyleConfig;
|
|
10
|
-
};
|
|
11
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
|
-
requireOldPassword: boolean;
|
|
13
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
-
export default _default;
|