ch3chi-commons-vue 0.1.4 → 0.1.7
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/directive/CBootstrapDirective.d.ts +17 -0
- package/dist/directive/CDateFormatterDirective.d.ts +6 -0
- package/dist/directive/CFTurnstileDirective.d.ts +2 -0
- package/dist/directive/CFormDirective.d.ts +9 -0
- package/dist/index.d.ts +7 -0
- package/dist/model/CBSModalViewModel.d.ts +44 -0
- package/package.json +9 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Directive } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* v-tooltip 指令
|
|
4
|
+
* 初始化 Bootstrap 的 Tooltip
|
|
5
|
+
* 使用方式:<button v-tooltip>Hover me</button>
|
|
6
|
+
*/
|
|
7
|
+
export declare const vdTooltip: Directive;
|
|
8
|
+
/**
|
|
9
|
+
* v-cbs-modal 指令
|
|
10
|
+
* binding.value 必須是 CBSModalViewModel 的實例
|
|
11
|
+
*/
|
|
12
|
+
export declare const vdCBSModal: Directive;
|
|
13
|
+
/**
|
|
14
|
+
* v-cbs-dropdown 指令
|
|
15
|
+
* 初始化 Bootstrap 的 Dropdown
|
|
16
|
+
*/
|
|
17
|
+
export declare const vdCBSDropdown: Directive;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Directive } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 此指令用於當 FormField 有錯誤時,顯示錯誤樣式 'is-invalid'。
|
|
4
|
+
*/
|
|
5
|
+
export declare const CFormFieldErrorStyleDirective: Directive;
|
|
6
|
+
/**
|
|
7
|
+
* 此指令用於當 Yup Schema 驗證失敗時,顯示錯誤樣式 'is-invalid'。
|
|
8
|
+
*/
|
|
9
|
+
export declare const CFormFieldErrorOnYupDirective: Directive;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { vdTooltip } from './directive/CBootstrapDirective';
|
|
2
|
+
export { vdDateFormatter } from './directive/CDateFormatterDirective';
|
|
3
|
+
export { vdCBSDropdown } from './directive/CBootstrapDirective';
|
|
4
|
+
export { vdCBSModal } from './directive/CBootstrapDirective';
|
|
5
|
+
export { CFTurnstileDirective } from './directive/CFTurnstileDirective';
|
|
6
|
+
export { CFormFieldErrorOnYupDirective, CFormFieldErrorStyleDirective } from './directive/CFormDirective';
|
|
7
|
+
export { CBSModalViewModel, ICBSModalViewType } from './model/CBSModalViewModel';
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ch3chi-commons-vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
5
|
+
"main": "dist/index.es.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.es.js",
|
|
10
|
+
"require": "./dist/index.cjs.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
7
13
|
"files": [
|
|
8
14
|
"dist",
|
|
9
15
|
"package.json",
|
|
@@ -34,6 +40,7 @@
|
|
|
34
40
|
"uuid": "^11.1.0",
|
|
35
41
|
"vee-validate": "^4.15.1",
|
|
36
42
|
"vite": "^7.2.1",
|
|
43
|
+
"vite-plugin-dts": "^4.5.4",
|
|
37
44
|
"vue": "^3.5.23",
|
|
38
45
|
"yup": "^1.7.1"
|
|
39
46
|
},
|