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.
Files changed (52) hide show
  1. package/package.json +1 -1
  2. package/dist/api/ApiService.d.ts +0 -233
  3. package/dist/auth/AuthorizationService.d.ts +0 -56
  4. package/dist/auth/PermissionDescriptor.d.ts +0 -37
  5. package/dist/components/CAlert.vue.d.ts +0 -17
  6. package/dist/components/CAlertDefine.d.ts +0 -14
  7. package/dist/components/CBSToast.vue.d.ts +0 -6
  8. package/dist/components/CGlobalSpinner.vue.d.ts +0 -13
  9. package/dist/components/CRowCheckBox.vue.d.ts +0 -14
  10. package/dist/components/CRowTextInput.vue.d.ts +0 -10
  11. package/dist/components/CTable.vue.d.ts +0 -24
  12. package/dist/components/CTableDefine.d.ts +0 -201
  13. package/dist/components/CTableTD.vue.d.ts +0 -7
  14. package/dist/components/form/CChangePasswordFormField.vue.d.ts +0 -14
  15. package/dist/components/form/CCheckBoxFormField.vue.d.ts +0 -30
  16. package/dist/components/form/CDateFormField.vue.d.ts +0 -17
  17. package/dist/components/form/CDateQueryField.vue.d.ts +0 -16
  18. package/dist/components/form/CDateRangeFormField.vue.d.ts +0 -17
  19. package/dist/components/form/CFilePickerFormField.vue.d.ts +0 -28
  20. package/dist/components/form/CRadioFormField.vue.d.ts +0 -30
  21. package/dist/components/form/CSelectFormField.vue.d.ts +0 -18
  22. package/dist/components/form/CTextAreaFormField.vue.d.ts +0 -16
  23. package/dist/components/form/CTextInputFormField.vue.d.ts +0 -22
  24. package/dist/directive/CBootstrapDirective.d.ts +0 -17
  25. package/dist/directive/CDateFormatterDirective.d.ts +0 -10
  26. package/dist/directive/CFTurnstileDirective.d.ts +0 -15
  27. package/dist/directive/CFormDirective.d.ts +0 -9
  28. package/dist/directive/PermissionDirective.d.ts +0 -15
  29. package/dist/index.cjs.js +0 -19103
  30. package/dist/index.d.ts +0 -45
  31. package/dist/index.es.js +0 -19086
  32. package/dist/model/BSFieldStyleConfig.d.ts +0 -121
  33. package/dist/model/BaseDictionary.d.ts +0 -34
  34. package/dist/model/BaseFormDataModel.d.ts +0 -199
  35. package/dist/model/BaseListViewModel.d.ts +0 -165
  36. package/dist/model/CBSModalViewModel.d.ts +0 -44
  37. package/dist/model/CFileDataModel.d.ts +0 -74
  38. package/dist/model/CImageViewModel.d.ts +0 -8
  39. package/dist/model/CMenuItem.d.ts +0 -86
  40. package/dist/model/EmailReceiverDataModel.d.ts +0 -57
  41. package/dist/model/EmptyDataModel.d.ts +0 -7
  42. package/dist/model/FormOptions.d.ts +0 -60
  43. package/dist/model/LoginDataModel.d.ts +0 -12
  44. package/dist/model/PasswordDataModel.d.ts +0 -15
  45. package/dist/model/QueryParameter.d.ts +0 -92
  46. package/dist/model/SessionUser.d.ts +0 -45
  47. package/dist/model/ShowMessageDataModel.d.ts +0 -44
  48. package/dist/model/TokenUser.d.ts +0 -50
  49. package/dist/stores/FormDataStore.d.ts +0 -31
  50. package/dist/stores/ViewStore.d.ts +0 -349
  51. package/dist/style.css +0 -223
  52. package/dist/utils/CToolUtils.d.ts +0 -53
@@ -1,121 +0,0 @@
1
- /**
2
- * BSFieldStyleConfig 配置物件
3
- * 用於以配置方式自訂欄位外觀和行為
4
- */
5
- export interface IBSFieldStyleConfig {
6
- containerClass?: string;
7
- labelClass?: string;
8
- labelPrefix?: string;
9
- labelSuffix?: string;
10
- hideLabel?: boolean;
11
- requiredLabelClass?: string;
12
- requiredLabelText?: string;
13
- plainTextClass?: string;
14
- inputClass?: string;
15
- inputPrefix?: {
16
- text?: string;
17
- class?: string;
18
- };
19
- inputSuffix?: {
20
- text?: string;
21
- class?: string;
22
- };
23
- wrapperClass?: string;
24
- selectClass?: string;
25
- selectSize?: 'sm' | 'lg';
26
- selectMultiple?: boolean;
27
- selectPlaceholder?: string;
28
- textareaClass?: string;
29
- textareaRows?: number;
30
- textareaResize?: 'none' | 'both' | 'horizontal' | 'vertical';
31
- textareaAutoGrow?: boolean;
32
- checkboxClass?: string;
33
- checkboxLabelClass?: string;
34
- checkboxWrapperClass?: string;
35
- radioClass?: string;
36
- radioLabelClass?: string;
37
- radioWrapperClass?: string;
38
- radioInline?: boolean;
39
- fileClass?: string;
40
- fileAccept?: string;
41
- fileMultiple?: boolean;
42
- fileDragDrop?: boolean;
43
- calendarIconClass?: string;
44
- calendarClearIconClass?: string;
45
- changePasswordButtonClass?: string;
46
- changePasswordButtonIcon?: string;
47
- errorClass?: string;
48
- errorPrefix?: string;
49
- }
50
- /**
51
- * BSFieldStyleConfig 類別
52
- */
53
- export declare class BSFieldStyleConfig {
54
- config: IBSFieldStyleConfig;
55
- /**
56
- * 單一實例
57
- */
58
- static instance: BSFieldStyleConfig;
59
- /**
60
- * 合併配置
61
- * @param config 要合併到全域實例的配置
62
- */
63
- static merge(config: IBSFieldStyleConfig): void;
64
- /**
65
- * 混合多個樣式配置,建立新的 BSFieldStyleConfig 實例
66
- * 優先順序:propStyle > defaultStyle > instance(全域設定)
67
- *
68
- * @param defaultStyle 預設樣式配置(例如組件內建的預設值)
69
- * @param propStyle 組件 prop 傳入的樣式配置
70
- * @returns 合併後的 BSFieldStyleConfig 實例
71
- *
72
- * @example
73
- * ```typescript
74
- * // 在組件中使用
75
- * const bStyleConfig = BSFieldStyleConfig.mix(
76
- * { plainTextClass: 'form-control-plaintext bg-light' }, // 組件預設值
77
- * props.styleConfig // 從 prop 傳入的值
78
- * );
79
- * ```
80
- */
81
- static mix(defaultStyle: IBSFieldStyleConfig, propStyle?: IBSFieldStyleConfig): BSFieldStyleConfig;
82
- constructor(config?: IBSFieldStyleConfig);
83
- get containerClass(): string;
84
- get labelClass(): string;
85
- get inputClass(): string;
86
- get wrapperClass(): string;
87
- get errorClass(): string;
88
- get hideLabel(): boolean;
89
- get requiredLabelClass(): string;
90
- get requiredLabelText(): string;
91
- get plainTextClass(): string;
92
- get hasInputPrefix(): boolean;
93
- get hasInputSuffix(): boolean;
94
- get inputPrefixText(): string;
95
- get inputSuffixText(): string;
96
- get inputPrefixClass(): string;
97
- get inputSuffixClass(): string;
98
- get selectClass(): string;
99
- get selectMultiple(): boolean;
100
- get selectPlaceholder(): string;
101
- get textareaClass(): string;
102
- get textareaRows(): number;
103
- get textareaResizeStyle(): string;
104
- get textareaAutoGrow(): boolean;
105
- get checkboxClass(): string;
106
- get checkboxLabelClass(): string;
107
- get checkboxWrapperClass(): string;
108
- get radioClass(): string;
109
- get radioLabelClass(): string;
110
- get radioWrapperClass(): string;
111
- get radioInline(): boolean;
112
- get fileClass(): string;
113
- get fileAccept(): string;
114
- get fileMultiple(): boolean;
115
- get fileDragDrop(): boolean;
116
- get calendarIconClass(): string;
117
- get calendarClearIconClass(): string;
118
- get changePasswordButtonClass(): string;
119
- get changePasswordButtonIcon(): string;
120
- }
121
- export declare const __BSFieldStyleConfigDefine__: IBSFieldStyleConfig;
@@ -1,34 +0,0 @@
1
- /**
2
- * BaseDictionary class
3
- * 用於 distionary store 的基底類別
4
- */
5
- export declare abstract class BaseDictionary {
6
- protected data: Record<string, any>;
7
- dataProvider: (key: string) => Promise<any> | any;
8
- lastUpdatedAt: number;
9
- protected constructor(data?: Partial<BaseDictionary>);
10
- /**
11
- * 初始化方法,讓子類別可以覆寫以進行自訂初始化
12
- * @protected
13
- */
14
- abstract init(): void;
15
- val(key: string): any;
16
- setVal(key: string, value: any): void;
17
- hasVal(key: string): boolean;
18
- /**
19
- * 載入所有字典資料
20
- * 使用 Promise.allSettled 確保即使某個載入失敗,其他的也能繼續執行
21
- */
22
- loadAll(): Promise<void>;
23
- /**
24
- * load dictionary data
25
- * 支援 Promise 或是直接回傳資料物件
26
- * @param key
27
- */
28
- loadDictionary(key: string): Promise<Record<string, any>>;
29
- loadFromStore(storeData: Record<string, any>): this;
30
- }
31
- export declare class CBaseDictionary extends BaseDictionary {
32
- constructor(data?: Partial<CBaseDictionary>);
33
- init(): void;
34
- }
@@ -1,199 +0,0 @@
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
- _debug?: boolean;
11
- uid?: string;
12
- rowId?: string;
13
- _formMode?: string;
14
- __rowNumber?: number;
15
- __isLastAndLastPage?: boolean;
16
- /**
17
- * 表單驗證的 schema,使用 Yup 進行定義。
18
- */
19
- formSchema: yup.ObjectSchema<any> | null;
20
- /**
21
- * 從 formSchema 中展平的欄位名稱列表。
22
- * formSchema.fields 的 key 值,同時支援 nest object 的欄位名稱。
23
- * 例如 address.city, address.zipCode
24
- * 這個屬性會在 initForm 時被初始化。
25
- */
26
- formSchemaFieldList: string[] | null;
27
- /**
28
- * 表單欄位映射,用於 VeeValidate 的表單驗證。
29
- */
30
- formFieldMap: Record<string, FieldContext>;
31
- /**
32
- * 表單上下文,包含驗證和狀態管理。
33
- */
34
- formContext: FormContext<Record<string, any>> | null;
35
- /**
36
- * BaseFormDataModel 的建構函數。
37
- * @param data 可選的初始數據,用於初始化模型屬性。
38
- */
39
- protected constructor(data?: Record<string, any>);
40
- /**
41
- * 初始化表單驗證的 schema。
42
- */
43
- abstract initFormSchema(): yup.ObjectSchema<any>;
44
- /**
45
- * 取得需要套用 form field 欄位名稱的列表。
46
- * @returns {string[]} 欄位名稱列表
47
- */
48
- abstract dataFieldNameList(): string[];
49
- /**
50
- * 在呼叫 loadData 之後的會執行的方法,供子類別可以接續處理。
51
- * @param data
52
- */
53
- afterLoadFormData(data: Record<string, any>): void;
54
- /**
55
- * 載入數據到模型中。
56
- * 不會檢查欄位名稱是否在 dataFieldNameList 中定義。
57
- * @param data
58
- */
59
- loadData(data: Record<string, any>): this;
60
- /**
61
- * 載入數據到表單模型中。
62
- * 是從有定義的表單欄位名稱列表中進行載入,同時 properties 也必須要有定義會忽略optional且未賦值的情況。
63
- *
64
- * @param data data
65
- */
66
- loadFormData(data: Record<string, any>): this;
67
- /**
68
- * 將表單數據轉換為 JSON 格式。
69
- */
70
- formToJsonData(): Record<string, any>;
71
- /**
72
- * 將表單數據轉換為 API 請求的 payload 格式。
73
- * 供子類別可以覆寫此方法來調整 payload 結構。
74
- * @param key 動作名稱,例如 "create"、"update" 等。
75
- */
76
- toPayload(key?: string): Record<string, any>;
77
- /**
78
- * 將表單數據轉換為包含 payload 的映射結構。
79
- * 供子類別可以覆寫此方法來調整 payload 結構。
80
- * key 動作名稱,例如 "create"、"update" 等。
81
- */
82
- toPayloadMap(): Record<string, Record<string, any>>;
83
- /**
84
- * 初始化表單相關的屬性和方法。
85
- */
86
- initForm(): void;
87
- /**
88
- * 驗證表單數據。
89
- */
90
- validateForm(): Promise<FormValidationResult<Record<string, any>>>;
91
- /**
92
- * 顯示指定欄位的錯誤訊息。
93
- * @param fieldName
94
- */
95
- validateField(fieldName: string): Promise<ValidationResult>;
96
- /**
97
- * 清除表單錯誤訊息。
98
- */
99
- clearFormErrors(): void;
100
- /**
101
- * 把本身的 properties 套用到 form field 上。
102
- */
103
- applyPropertiesToFormField(): void;
104
- /**
105
- * 重置表單數據。
106
- */
107
- resetFormData(): void;
108
- /**
109
- * 檢查指定的欄位是否為必填欄位。
110
- * @param fieldName
111
- */
112
- fieldIsRequired(fieldName: string): boolean;
113
- /**
114
- * 取得指定欄位的最大長度限制。
115
- * @param fieldName
116
- */
117
- fieldMaxLength(fieldName: string): number | null;
118
- /**
119
- * 將欄位名稱轉換為 Yup schema 中的 key。
120
- * @param fieldName 欄位名稱
121
- */
122
- parseToYupFieldKey(fieldName: string): string;
123
- /**
124
- * 設定指定欄位的值。
125
- * @param fieldName
126
- * @param toValue
127
- */
128
- setFieldValue(fieldName: string, toValue: any): void;
129
- /**
130
- * 取得指定欄位的值。
131
- * @param fieldName
132
- */
133
- fieldValue(fieldName: string): any;
134
- /**
135
- * 根據欄位名稱查找對應的 FieldContext。
136
- * @param fieldName 欄位名稱
137
- * @returns FieldContext 或 null
138
- */
139
- findFieldContext(fieldName: string): FieldContext | null;
140
- /**
141
- * 根據欄位名稱查找對應的 Ref。
142
- * @param fieldName 欄位名稱
143
- * @returns Ref<any> 或 null
144
- */
145
- findFieldToBind(fieldName: string): Ref<any> | null;
146
- /**
147
- * 根據欄位名稱列表查找對應的 Ref 映射。
148
- * @param fieldNames 欄位名稱列表
149
- */
150
- findFieldRefToBind(fieldNames: string[]): Record<string, Ref<any>>;
151
- /**
152
- * 將指定的屬性列表中的字串轉換為 Date 物件。
153
- * @param data 數據物件
154
- * @param propertyName 屬性名稱列表
155
- */
156
- parseStringToDate(data: Record<string, any>, propertyName: string[]): void;
157
- set formMode(type: string);
158
- get formMode(): string | undefined;
159
- /**
160
- * 將指定的屬性列表轉換為 JSON 格式的數據。
161
- * @param propertyList
162
- * @param dataModel
163
- */
164
- static makeJsonData(propertyList: string[], dataModel: BaseFormDataModel): Record<string, any>;
165
- }
166
- /**
167
- * CheckableListViewModel 定義了可檢查的列表視圖模型。
168
- */
169
- export interface CheckableModel {
170
- checked?: boolean;
171
- toggleChecked(): void;
172
- }
173
- /**
174
- * CheckableDataModel 是一個抽象類別,實現了 CheckableModel 接口。
175
- */
176
- export declare abstract class CheckableDataModel extends BaseFormDataModel implements CheckableModel {
177
- checked: boolean;
178
- protected constructor(data?: Record<string, any>);
179
- /**
180
- * 切換選中狀態。
181
- */
182
- toggleChecked(): void;
183
- }
184
- /**
185
- * FormDataModelMapper 用於將一個資料物件映射到一個 BaseFormDataModel 的子類別實例中,
186
- * 並且初始化該實例的表單相關功能。
187
- * 同時會監控表單值的變化,並將變化回寫到原始資料物件中。
188
- * 目的:網頁控制項的雙向或是單向綁定到 dataInstance 上,而不是直接綁定到 data 上。
189
- */
190
- export declare class FormDataModelMapper<T extends BaseFormDataModel> {
191
- dataModelClass: new (data?: Partial<T>) => T;
192
- dataInstance: T;
193
- constructor(dataModelClass: new (data?: Partial<T>) => T, data: Partial<T>);
194
- /**
195
- * 驗證指定欄位。
196
- * @param fieldPath
197
- */
198
- validateField(fieldPath: string): Promise<ValidationResult<unknown>>;
199
- }
@@ -1,165 +0,0 @@
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 { GlobalViewActions } from '../stores/ViewStore';
6
- import { ApiResponse } from '../api/ApiService';
7
- export interface ListApiEndpointMeta {
8
- key: string;
9
- pathParam?: Record<string, any>;
10
- dataListFinder?: (response: ApiResponse) => any[];
11
- dataParser: (dataItem: any) => any;
12
- }
13
- /**
14
- * BaseListViewModel 是一個抽象類別,用於定義列表視圖模型的基本結構和行為。
15
- */
16
- export declare abstract class BaseListViewModel<Q extends QueryParameter, V extends BaseFormDataModel> {
17
- queryParam: Q;
18
- dataList: V[];
19
- tableColumnArray: CTableColumn[];
20
- router?: Router;
21
- storeAction?: GlobalViewActions;
22
- enableQueryParamDefault?: boolean;
23
- queryParamDefaultValues?: Record<string, any>;
24
- saveOnQueryFormDataStore?: boolean;
25
- autoSearchOnClear?: boolean;
26
- protected constructor(data?: Partial<BaseListViewModel<Q, V>>);
27
- /**
28
- * 初始化方法
29
- * @param options
30
- */
31
- init(options: {
32
- router: Router;
33
- storeAction?: GlobalViewActions;
34
- }): this;
35
- /**
36
- * 查詢列表的 API 端點元資料
37
- */
38
- queryListApiEndpointMeta(): ListApiEndpointMeta;
39
- /**
40
- * 生成新增的 URL
41
- * @returns {string} 新增頁面的 URL
42
- */
43
- abstract toCreateUrl(): string;
44
- /**
45
- * 生成編輯的 URL
46
- * @param rowData 資料模型
47
- * @returns {string} 編輯頁面的 URL
48
- */
49
- abstract toEditUrl(rowData: V): string;
50
- /**
51
- * 使用表格欄位定義
52
- */
53
- abstract useTableColumnArray(): CTableColumn[];
54
- /**
55
- * 在組件掛載時調用的函式
56
- */
57
- callOnMounted(): Promise<void>;
58
- /**
59
- * 儲存目前 query param 的屬性值為預設值
60
- */
61
- storeQueryDefaultValues(defValues: Record<string, any>): void;
62
- /**
63
- * 重設查詢參數為預設值
64
- */
65
- resetToDefaultValues(): void;
66
- /**
67
- * 載入 API 回應資料
68
- * @param response API 回應物件
69
- * @param options 載入選項
70
- */
71
- loadApiResponse(response: ApiResponse, options: {
72
- dataListFinder?: (response: ApiResponse) => any[];
73
- parser?: (data: any) => V;
74
- }): void;
75
- /**
76
- * 設定列號 根據當下的分頁資訊計算
77
- * @param dataItem 當前資料項目
78
- * @param dataIndex 當前資料的索引
79
- */
80
- setupRowNumber(dataItem: V, dataIndex: number): void;
81
- /**
82
- * 添加單筆資料到列表中
83
- * @param dataToAdd
84
- */
85
- addData(dataToAdd: V): void;
86
- /**
87
- * 添加多筆資料到列表中
88
- * @param dataListToAdd
89
- */
90
- addDataList(dataListToAdd: V[]): void;
91
- /**
92
- * 清除資料列表
93
- */
94
- cleanDataList(): void;
95
- /**
96
- * 顯示錯誤訊息對話框
97
- * @param content 錯誤訊息內容
98
- * @param onOk 確認按鈕點擊事件
99
- * @param onCancel 取消按鈕點擊事件
100
- */
101
- showConfirm(params: {
102
- content: string;
103
- onOk: () => void;
104
- onCancel?: () => void;
105
- }): void;
106
- makeQueryParamStoreKey(): string;
107
- /**
108
- * 將查詢參數保存到查詢表單數據存儲中
109
- */
110
- saveQueryParamToStore(): void;
111
- /**
112
- * 從查詢表單數據存儲中讀取查詢參數
113
- */
114
- readQueryParamFromStore(): void;
115
- /**
116
- * 前往新增頁面
117
- */
118
- goToCreatePage(): void;
119
- /**
120
- * 執行搜尋操作
121
- * 查詢時會將查詢參數保存到 store 中,並呼叫 API 獲取資料
122
- */
123
- doSearch(event?: Event): Promise<void>;
124
- /**
125
- * 處理清除事件
126
- * 清除查詢參數,並根據設定決定是否重新執行搜尋
127
- */
128
- doClear(): Promise<void>;
129
- /**
130
- * 處理排序變更事件
131
- */
132
- onSortChange(): Promise<void>;
133
- /**
134
- * 處理分頁變更事件
135
- * @param params
136
- */
137
- onPageChange(params: QueryPage): Promise<void>;
138
- /**
139
- * 處理 row action編輯事件
140
- * @param rowMeta
141
- */
142
- onColumnActionEdit(rowMeta: {
143
- actionType: CTableColumnActionType;
144
- rowData: V;
145
- }): Promise<void>;
146
- /**
147
- * 刪除列後的處理
148
- * @param rowData
149
- */
150
- callOnAfterDeleteRow(rowData: V): Promise<void>;
151
- }
152
- /**
153
- * CheckableListViewModel 是一個抽象類別,擴展自 BaseListViewModel,提供了查找被選中資料的功能。
154
- */
155
- export declare abstract class CheckableListViewModel<Q extends QueryParameter, V extends BaseFormDataModel> extends BaseListViewModel<Q, V> {
156
- /**
157
- * 查找所有被選中的資料
158
- */
159
- findCheckedData(): V[];
160
- /**
161
- * 重置所有資料的選中狀態
162
- */
163
- resetCheckedData(): void;
164
- }
165
- export declare const __BaseListViewModelDefine__: ListApiEndpointMeta;
@@ -1,44 +0,0 @@
1
- import { Modal } from 'bootstrap';
2
- export declare enum ICBSModalViewType {
3
- Info = "infoModal",
4
- Form = "formModal",
5
- Table = "tableModal"
6
- }
7
- export interface ICBSModalViewModel {
8
- type: ICBSModalViewType;
9
- title?: string;
10
- config?: Record<string, any>;
11
- onOpen?: () => void;
12
- onClose?: () => void;
13
- }
14
- export declare class CBSModalViewModel {
15
- modalInstance: import('vue').Ref<{
16
- toggle: (relatedTarget?: HTMLElement) => void;
17
- show: (relatedTarget?: HTMLElement) => void;
18
- hide: () => void;
19
- handleUpdate: () => void;
20
- dispose: () => void;
21
- } | null, Modal | {
22
- toggle: (relatedTarget?: HTMLElement) => void;
23
- show: (relatedTarget?: HTMLElement) => void;
24
- hide: () => void;
25
- handleUpdate: () => void;
26
- dispose: () => void;
27
- } | null>;
28
- elt: HTMLElement | null;
29
- type: ICBSModalViewType;
30
- modalId: string;
31
- labelId: string;
32
- title?: string;
33
- config?: Record<string, any>;
34
- onOpen?: () => void;
35
- onClose?: () => void;
36
- constructor(data?: Partial<ICBSModalViewModel>);
37
- defaultTitle(): string;
38
- show(): void;
39
- hide(): void;
40
- init({ elt }: {
41
- elt: HTMLElement;
42
- }): void;
43
- unmount(): void;
44
- }
@@ -1,74 +0,0 @@
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
- }
@@ -1,8 +0,0 @@
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
- }