@fewangsit/wangsvue-fats 1.0.0-alpha.91 → 1.0.0-alpha.92

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,103 @@
1
+ import { DefineComponent } from 'vue';
2
+ import { AssetName } from '@tagsamurai/fats-api-services/src/types/oldAssetService.type';
3
+
4
+ import { DialogConfirmProps } from '../../../../library/components/dialogconfirm/DialogConfirm.vue.d';
5
+ import { WangsIcons } from '../../../../library/components/icon/Icon.vue.d';
6
+
7
+ /**
8
+ * Type of the asset data, it refers to data response from Asset API, but since this component only using asset's name and _id then only those field are required for type.
9
+ */
10
+ export type LinkedAsset = {
11
+ _id: string;
12
+ name: AssetName;
13
+ };
14
+
15
+ /**
16
+ * Type of linked asset, it contains parent and its child(s).
17
+ */
18
+ export type LinkedAssetFamily = {
19
+ parent: LinkedAsset;
20
+ children: LinkedAsset[];
21
+ };
22
+
23
+ export type ChildAsset = {
24
+ parent: LinkedAsset;
25
+ children: LinkedAsset[]; // Empty children
26
+ family: LinkedAsset[];
27
+ };
28
+
29
+ export type ParentAsset = {
30
+ parent: undefined; // If the asset is parent, the parent will undefined
31
+ children: LinkedAsset[];
32
+ family: LinkedAsset[]; // Family is combination of parent, children and asset itself.
33
+ // If it only contains one asset in family, it means the asset has not linked yet.
34
+ };
35
+
36
+ export type FamilyData = (ParentAsset | ChildAsset) & {
37
+ _id: string;
38
+ };
39
+
40
+ /**
41
+ * Props for DialogSelectAsset component
42
+ */
43
+ export interface DialogLinkedAssetProps extends DialogConfirmProps {
44
+ /**
45
+ * The header of the dialog.
46
+ */
47
+ header: string;
48
+ /**
49
+ * The list of selected asset to be transacted.
50
+ */
51
+ lists?: LinkedAsset[];
52
+ /**
53
+ * The label of the dialog button.
54
+ */
55
+ label?: string;
56
+ /**
57
+ * The body text of the dialog.
58
+ */
59
+ confirmBody?: string;
60
+ /**
61
+ * Specify the custom header icon.
62
+ * If not, the default rules by it severity.
63
+ *
64
+ * @default 'success' > hidden;
65
+ * @default 'danger' > 'error';
66
+ */
67
+ headerIcon?: WangsIcons;
68
+ /**
69
+ * @default - 'confirmation'
70
+ */
71
+ type?: 'detail' | 'confirmation';
72
+ }
73
+
74
+ /**
75
+ * Emits for DialogSelectAsset component
76
+ */
77
+ export type DialogLinkedAssetEmit = {
78
+ /**
79
+ * Emits when button confirm clicked.
80
+ */
81
+ 'confirm': [families: LinkedAssetFamily[]];
82
+ /**
83
+ * Emits when the dialog is closed. Wether from cancel button, close button, or ESC button pressed.
84
+ */
85
+ 'update:visible': [state: boolean];
86
+ };
87
+
88
+ /**
89
+ * TSVue - DialogLinkedAsset
90
+ *
91
+ * DialogLinkedAsset is a component for creating dialog confirmation of linked assets.
92
+ *
93
+ * --- ---
94
+ * ![TSVue](https://ik.imagekit.io/kurniadev/TS-HEAD-BLACK.png)
95
+ *
96
+ * @group components
97
+ */
98
+ declare const DialogLinkedAsset: DefineComponent<
99
+ DialogLinkedAssetProps,
100
+ DialogLinkedAssetEmit
101
+ >;
102
+
103
+ export default DialogLinkedAsset;
@@ -60,6 +60,7 @@ export { default as AssetInfo } from './assetinfo/AssetInfo.vue';
60
60
  export { default as ButtonAddByScan } from './buttonaddbyscan/ButtonAddByScan.vue';
61
61
  export { default as ButtonSelectUser } from './buttonselectuser/ButtonSelectUser.vue';
62
62
  export { default as ButtonViewLog } from './buttonviewlog/ButtonViewLog.vue';
63
+ export { default as DialogLinkedAsset } from './dialoglinkedasset/DialogLinkedAsset.vue';
63
64
  export { default as DialogSelectUser } from './dialogselectuser/DialogSelectUser.vue';
64
65
  export { default as UserWithIcon } from './userwithicon/UserWithIcon.vue';
65
66
  export { default as FilterContainer } from './filtercontainer/FilterContainer.vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.0-alpha.91",
3
+ "version": "1.0.0-alpha.92",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",