@fewangsit/wangsvue-fats 1.0.0-alpha.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 (148) hide show
  1. package/components/animation/Animation.vue.d.ts +32 -0
  2. package/components/approverinfo/ApproverInfo.vue.d.ts +51 -0
  3. package/components/assetinfo/AssetInfo.vue.d.ts +44 -0
  4. package/components/badge/Badge.vue.d.ts +73 -0
  5. package/components/badgegroup/BadgeGroup.vue.d.ts +54 -0
  6. package/components/basecomponent/index.d.ts +28 -0
  7. package/components/basetree/BaseTree.vue.d.ts +596 -0
  8. package/components/basetree/TreeNode.vue.d.ts +35 -0
  9. package/components/breadcrumb/Breadcrumb.vue.d.ts +26 -0
  10. package/components/button/Button.vue.d.ts +189 -0
  11. package/components/buttonImportExcel/ButtonImportExcel.vue.d.ts +35 -0
  12. package/components/buttonaddbyscan/ButtonAddByScan.vue.d.ts +40 -0
  13. package/components/buttonbulkaction/ButtonBulkAction.vue.d.ts +105 -0
  14. package/components/buttoncopy/ButtonCopy.vue.d.ts +26 -0
  15. package/components/buttondownload/ButtonDownload.vue.d.ts +80 -0
  16. package/components/buttonfilter/ButtonFilter.vue.d.ts +12 -0
  17. package/components/buttonradio/ButtonRadio.vue.d.ts +258 -0
  18. package/components/buttonscan/ButtonScan.vue.d.ts +202 -0
  19. package/components/buttonsearch/ButtonSearch.vue.d.ts +38 -0
  20. package/components/buttonsearchbyscan/ButtonSearchByScan.vue.d.ts +46 -0
  21. package/components/buttonselecttree/ButtonSelectTree.vue.d.ts +201 -0
  22. package/components/buttonsplit/ButtonSplit.vue.d.ts +352 -0
  23. package/components/buttonsync/ButtonSync.vue.d.ts +22 -0
  24. package/components/buttontoggle/ButtonToggle.vue.d.ts +19 -0
  25. package/components/buttonviewlog/ButtonViewLog.vue.d.ts +17 -0
  26. package/components/calendar/Calendar.vue.d.ts +598 -0
  27. package/components/card/Card.vue.d.ts +140 -0
  28. package/components/carousel/Carousel.vue.d.ts +28 -0
  29. package/components/checkbox/Checkbox.vue.d.ts +330 -0
  30. package/components/customcolumn/CustomColumn.vue.d.ts +37 -0
  31. package/components/datatable/DataTable.vue.d.ts +745 -0
  32. package/components/datepicker/DatePicker.vue.d.ts +52 -0
  33. package/components/daypicker/DayPicker.vue.d.ts +52 -0
  34. package/components/dialog/Dialog.vue.d.ts +465 -0
  35. package/components/dialogassetnamedetail/DialogAssetNameDetail.vue.d.ts +46 -0
  36. package/components/dialogassetnamedetail/options/columns.d.ts +2 -0
  37. package/components/dialogassetnamedetail/options/filter.d.ts +2 -0
  38. package/components/dialogconfirm/DialogConfirm.vue.d.ts +165 -0
  39. package/components/dialogform/DialogForm.vue.d.ts +350 -0
  40. package/components/dialoglinkedasset/DialogLinkedAsset.vue.d.ts +106 -0
  41. package/components/dialogprintqr/DialogPrintQR.vue.d.ts +18 -0
  42. package/components/dialogreportdamage/DialogReportDamage.vue.d.ts +34 -0
  43. package/components/dialogreportmissing/DialogReportMissing.vue.d.ts +33 -0
  44. package/components/dialogreporttag/DialogReportTag.vue.d.ts +31 -0
  45. package/components/dialogselecttree/DialogSelectTree.vue.d.ts +137 -0
  46. package/components/dialogselectuser/DialogSelectUser.vue.d.ts +102 -0
  47. package/components/dialogselectuser/options/columns.d.ts +3 -0
  48. package/components/dialogtransferlog/DialogTransferLog.vue.d.ts +16 -0
  49. package/components/dropdown/Dropdown.vue.d.ts +288 -0
  50. package/components/editor/Editor.vue.d.ts +192 -0
  51. package/components/fieldwrapper/FieldWrapper.vue.d.ts +86 -0
  52. package/components/fileupload/FileUpload.vue.d.ts +170 -0
  53. package/components/filtercontainer/FilterContainer.vue.d.ts +217 -0
  54. package/components/form/Form.vue.d.ts +319 -0
  55. package/components/icon/Icon.vue.d.ts +260 -0
  56. package/components/image/Image.vue.d.ts +411 -0
  57. package/components/imagecompressor/ImageCompressor.vue.d.ts +237 -0
  58. package/components/index.d.ts +83 -0
  59. package/components/inlinemessage/InlineMessage.vue.d.ts +167 -0
  60. package/components/inputbadge/InputBadge.vue.d.ts +122 -0
  61. package/components/inputcurrency/InputCurrency.vue.d.ts +170 -0
  62. package/components/inputcurrency/helpers/currency.helper.d.ts +8 -0
  63. package/components/inputemail/InputEmail.vue.d.ts +26 -0
  64. package/components/inputnumber/InputNumber.vue.d.ts +288 -0
  65. package/components/inputotp/InputOtp.vue.d.ts +3 -0
  66. package/components/inputpassword/InputPassword.vue.d.ts +33 -0
  67. package/components/inputphonenumber/InputPhoneNumber.vue.d.ts +99 -0
  68. package/components/inputrangenumber/InputRangeNumber.vue.d.ts +121 -0
  69. package/components/inputsearch/InputSearch.vue.d.ts +36 -0
  70. package/components/inputtext/InputText.vue.d.ts +353 -0
  71. package/components/inputurl/InputURL.vue.d.ts +41 -0
  72. package/components/invisiblefield/InvisibleField.vue.d.ts +32 -0
  73. package/components/languagedropdown/LanguageDropdown.vue.d.ts +33 -0
  74. package/components/languageswitcher/LanguageSwitcher.vue.d.ts +15 -0
  75. package/components/litedropdown/LiteDropdown.vue.d.ts +98 -0
  76. package/components/loading/Loading.vue.d.ts +47 -0
  77. package/components/loading/store/loading.store.d.ts +8 -0
  78. package/components/menu/Menu.vue.d.ts +391 -0
  79. package/components/menuitem/index.d.ts +106 -0
  80. package/components/multiselect/MultiSelect.vue.d.ts +195 -0
  81. package/components/overlaypanel/OverlayPanel.vue.d.ts +302 -0
  82. package/components/paginator/Paginator.vue.d.ts +285 -0
  83. package/components/passthrough/index.d.ts +16 -0
  84. package/components/steps/Steps.vue.d.ts +20 -0
  85. package/components/tabmenu/TabMenu.vue.d.ts +104 -0
  86. package/components/tagtype/TagType.vue.d.ts +26 -0
  87. package/components/textarea/Textarea.vue.d.ts +171 -0
  88. package/components/timeline/Timeline.vue.d.ts +140 -0
  89. package/components/toast/Toast.vue.d.ts +368 -0
  90. package/components/toggleswitch/ToggleSwitch.vue.d.ts +282 -0
  91. package/components/transactionroles/TransactionRoles.vue.d.ts +58 -0
  92. package/components/tree/Tree.vue.d.ts +151 -0
  93. package/components/tree/helpers/filterNodeKeys.helper.d.ts +22 -0
  94. package/components/tree/helpers/flattenTreeNodeChildren.helper.d.ts +8 -0
  95. package/components/treesearchinput/TreeSearchInput.vue.d.ts +16 -0
  96. package/components/ts-helpers.d.ts +91 -0
  97. package/components/username/UserName.vue.d.ts +123 -0
  98. package/components/userwithicon/UserWithIcon.vue.d.ts +21 -0
  99. package/components/validatormessage/ValidatorMessage.vue.d.ts +12 -0
  100. package/config/defaultProps.d.ts +3 -0
  101. package/config/index.d.ts +3 -0
  102. package/config/locale.d.ts +3 -0
  103. package/directives/focus.d.ts +7 -0
  104. package/directives/index.d.ts +1 -0
  105. package/event-bus/index.d.ts +66 -0
  106. package/event-bus/mitt.d.ts +41 -0
  107. package/loading-page-BrQattYE.js +1 -0
  108. package/loading-page-CgfbWppy.js +1 -0
  109. package/loading-page-CoC9UhfC.js +4 -0
  110. package/loading-page-CoXtqoc9.js +4 -0
  111. package/loading-page-DbLuqCHa.js +1 -0
  112. package/loading-page-f8D03l3G.js +4 -0
  113. package/loading-plane-CgfbWppy.js +1 -0
  114. package/loading-plane-CoXtqoc9.js +4 -0
  115. package/loading-table-Bdr9ZhtP.js +1 -0
  116. package/loading-table-ByUoWqUo.js +4 -0
  117. package/loading-table-BygEMzFM.js +4 -0
  118. package/loading-table-BzrSQlA0.js +1 -0
  119. package/loading-table-D9bw9OcI.js +4 -0
  120. package/loading-table-chOgXi94.js +1 -0
  121. package/main.d.ts +34 -0
  122. package/no-data-CTKux8RI.js +4 -0
  123. package/no-data-Cgze_Rvp.js +1 -0
  124. package/no-data-DLHO1L_u.js +4 -0
  125. package/no-data-Dep79CBh.js +1 -0
  126. package/no-data-g0dJCy2p.js +4 -0
  127. package/no-data-y1X5WtcQ.js +1 -0
  128. package/package.json +27 -0
  129. package/plugins/VueHtmlToPaper.d.ts +11 -0
  130. package/plugins/WangsVue.d.ts +311 -0
  131. package/plugins/formValidation.d.ts +20 -0
  132. package/plugins/i18n-extension.d.ts +4 -0
  133. package/plugins/i18n.d.ts +103 -0
  134. package/stats.html +4949 -0
  135. package/style.css +1 -0
  136. package/utils/date.util.d.ts +79 -0
  137. package/utils/exportToExcel.util.d.ts +27 -0
  138. package/utils/formatTagCode.util.d.ts +1 -0
  139. package/utils/getStatusSeverity.util.d.ts +33 -0
  140. package/utils/index.d.ts +9 -0
  141. package/utils/isBasic.util.d.ts +1 -0
  142. package/utils/listenSidebarChanges.util.d.ts +16 -0
  143. package/utils/object.util.d.ts +27 -0
  144. package/utils/role.util.d.ts +70 -0
  145. package/utils/toast.util.d.ts +120 -0
  146. package/utils/xlsx.util.d.ts +19 -0
  147. package/wangsvue-fats.js +57238 -0
  148. package/wangsvue-fats.system.js +427 -0
@@ -0,0 +1,165 @@
1
+ import { Slot } from 'vue';
2
+
3
+ import { WangsIcons } from '../icon/Icon.vue.d';
4
+ import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
5
+
6
+ type ConfirmDialogSeverity = 'success' | 'danger' | 'primary';
7
+
8
+ export interface DialogConfirmLocaleConfig {
9
+ actionableCloseButtonLabel?: string;
10
+ nonActionableCloseButtonLabel?: string;
11
+ /**
12
+ * @example Are you sure?
13
+ */
14
+ defaultConfirmMessage?: string;
15
+
16
+ /**
17
+ * @example Yakin
18
+ */
19
+ defaultConfirmLabel?: string;
20
+ }
21
+
22
+ /**
23
+ * Props for DialogConfirm component
24
+ */
25
+ export interface DialogConfirmProps {
26
+ /**
27
+ * The header of the dialog.
28
+ */
29
+ header: string;
30
+ /**
31
+ * The severity of the dialog.
32
+ * The severity will determine the dialog icons and color scheme.
33
+ */
34
+ severity: ConfirmDialogSeverity;
35
+ /**
36
+ * The severity of the confirm button.
37
+ * The severity will determine the confirm button color scheme in case button severity is different from header/dialog severity.
38
+ *
39
+ * @default undefined - to fallback to props.severity
40
+ */
41
+ confirmButtonSeverity?: ConfirmDialogSeverity | 'primary';
42
+ /**
43
+ * The boolean modelValue to show dialog.
44
+ */
45
+ visible: boolean;
46
+
47
+ /**
48
+ * Determines if the dialog should close after confirm.
49
+ * @default true
50
+ */
51
+ closeAfterConfirm?: boolean;
52
+ /**
53
+ * The label of the close/cancel button.
54
+ */
55
+ closeLabel?: string;
56
+ /**
57
+ * To hide/show the confirm button.
58
+ *
59
+ * Set to 'false' Make the confirm dialog cannot be confirmed.
60
+ *
61
+ * @default true;
62
+ */
63
+ actionable?: boolean;
64
+ /**
65
+ * The label of the confirm button.
66
+ */
67
+ confirmLabel?: string;
68
+ /**
69
+ * Props to disable confirm button.
70
+ */
71
+ disableConfirmButton?: boolean;
72
+ /**
73
+ * Custom header icon. Default is 'error' icon for danger severity, and 'checkbox-circle' for success severity.
74
+ */
75
+ headerIcon?: WangsIcons;
76
+ /**
77
+ * The lists to be displayed in the dialog.
78
+ */
79
+ list?: (string | object)[] | Set<string | object>;
80
+ /**
81
+ * The label of the list if your list item is an object.
82
+ * Choose a property from the item to be displayed on the list.
83
+ */
84
+ listLabel?: string;
85
+ /**
86
+ * The confirmation message.
87
+ */
88
+ message?: string;
89
+ /**
90
+ * Whether show icon header or not.
91
+ * @default true;
92
+ */
93
+ showIcon?: boolean;
94
+ /**
95
+ * Whether show close button or not (footer button that has label, not close button with icon 'X').
96
+ * @default true;
97
+ */
98
+ showCloseButton?: boolean;
99
+
100
+ /**
101
+ * Set class for content element.
102
+ */
103
+ contentClass?: any;
104
+ }
105
+
106
+ /**
107
+ * Slots for DialogConfirm component
108
+ */
109
+ export interface DialogConfirmSlots {
110
+ /**
111
+ * The body slot for the dialog. Here is where you can put your dialog body.
112
+ */
113
+ body?: Slot | string;
114
+ /**
115
+ * The footer slot for the dialog. Here is where you can put your dialog footer.
116
+ * Use this slot if you need to custom the dialog buttons.
117
+ */
118
+ footer?: Slot | string;
119
+ }
120
+
121
+ /**
122
+ * Emits for DialogConfirm component
123
+ */
124
+ export type DialogConfirmEmits = {
125
+ /**
126
+ * Emits when close button clicked.
127
+ */
128
+ 'close': [];
129
+ /**
130
+ * Emits when Confirm button clicked.
131
+ */
132
+ 'confirm': [];
133
+ /**
134
+ * Emits when dialog closed.
135
+ */
136
+ 'hide': [];
137
+ /**
138
+ * Emits when the dialog is closed. Wether from cancel button, close button, or ESC button pressed.
139
+ */
140
+ 'update:visible': [state: boolean];
141
+ };
142
+
143
+ /**
144
+ * **WangsVue - DialogConfirm**
145
+ *
146
+ * _DialogConfirm is a component for creating confirmation dialogs._
147
+ *
148
+ * --- ---
149
+ * ![WangsVue](https://www.wangs.id/wp-content/uploads/2023/12/cropped-Logo_Wangsid-removebg-preview-192x192.png)
150
+ *
151
+ * @group components
152
+ */
153
+ declare class DialogConfirm extends ClassComponent<
154
+ DialogConfirmProps,
155
+ DialogConfirmSlots,
156
+ DialogConfirmEmits
157
+ > {}
158
+
159
+ declare module '@vue/runtime-core' {
160
+ interface GlobalComponents {
161
+ DialogConfirm: GlobalComponentConstructor<DialogConfirm>;
162
+ }
163
+ }
164
+
165
+ export default DialogConfirm;
@@ -0,0 +1,350 @@
1
+ import { GenericObject } from 'vee-validate';
2
+ import { Slot } from 'vue';
3
+
4
+ import FormInstance, { FormPayload, FormProps } from '../form/Form.vue.d';
5
+ import { WangsIcons } from '../icon/Icon.vue.d';
6
+ import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
7
+
8
+ export type DialogFormValue =
9
+ | string
10
+ | string[]
11
+ | number
12
+ | number[]
13
+ | boolean
14
+ | boolean[]
15
+ | Record<string, unknown>
16
+ | Record<string, unknown>[];
17
+
18
+ /**
19
+ * Generic form payload, able to receive types from outside
20
+ */
21
+ export type DialogFormPayload<
22
+ FormValuesType = Record<string, DialogFormValue>,
23
+ > = {
24
+ stayAfterSubmit: boolean;
25
+ formValues: FormValuesType;
26
+ };
27
+
28
+ export interface DialogFormLocaleConfig {
29
+ /**
30
+ * @example 'Cancel'
31
+ */
32
+ cancelBtnLabel?: string;
33
+
34
+ /**
35
+ * @example 'Clear Field'
36
+ */
37
+ clearBtnLabel?: string;
38
+
39
+ /**
40
+ * @example 'Stay after submit'
41
+ */
42
+ stayCheckboxLabel?: string;
43
+
44
+ /**
45
+ * @example 'Submit'
46
+ */
47
+ submitBtnLabel?: string;
48
+
49
+ /**
50
+ * Set the label for button expand sidebar right when it is expanded.
51
+ *
52
+ * @example 'Tutup <'
53
+ */
54
+ asideRightExpandedButtonLabel?: string;
55
+
56
+ /**
57
+ * Set the label for button expand sidebar right when it is collapsed.
58
+ *
59
+ * @example 'Lihat data yang ada >'
60
+ */
61
+ asideRightCollapsedButtonLabel?: string;
62
+ }
63
+
64
+ /**
65
+ * Props for DialogForm component
66
+ */
67
+ export interface DialogFormProps extends FormProps {
68
+ /**
69
+ * The template for form buttons.
70
+ */
71
+ buttonsTemplate: ('clear' | 'submit' | 'cancel')[];
72
+
73
+ /**
74
+ * The dialog header.
75
+ */
76
+ header: string;
77
+
78
+ /**
79
+ * Value binding to show/hide the dialog.
80
+ */
81
+ visible: boolean;
82
+
83
+ /**
84
+ * With in pixel
85
+ *
86
+ * @default 260
87
+ */
88
+ asideRightWidth?: number;
89
+ class?: string | string[] | object[];
90
+
91
+ /**
92
+ * Custom button cancel label.
93
+ *
94
+ * @default - The default value from locale configuration {@link DialogFormLocaleConfig.cancelBtnLabel}
95
+ *
96
+ */
97
+ cancelBtnLabel?: string;
98
+
99
+ /**
100
+ * Custom button clear label.
101
+ *
102
+ * @default - The default value from locale configuration {@link DialogFormLocaleConfig.clearBtnLabel}
103
+ */
104
+ clearBtnLabel?: string;
105
+
106
+ /**
107
+ * Wether show the Close icon or not.
108
+ */
109
+ closable?: boolean;
110
+
111
+ /**
112
+ * Close dialog after form validated and submitted.
113
+ *
114
+ * @default true
115
+ */
116
+ closeOnSubmit?: boolean;
117
+
118
+ /**
119
+ * @deprecated
120
+ */
121
+ contentClass?: string | string[] | object[];
122
+
123
+ /**
124
+ * Show Date time on header.
125
+ */
126
+ dateHeader?: string;
127
+
128
+ /**
129
+ * Set the header icon left beside of the title.
130
+ */
131
+ headerIcon?: WangsIcons;
132
+
133
+ /**
134
+ * Sets the invalid state.
135
+ *
136
+ * @default false
137
+ */
138
+ invalid?: boolean;
139
+
140
+ /**
141
+ * Prevent form resets after submitted. Default is resetted.
142
+ *
143
+ * @default true
144
+ */
145
+ resetAfterSubmit?: boolean;
146
+
147
+ /**
148
+ * The severity of the dialog.
149
+ * The severity will determine the dialog icons and color scheme.
150
+ */
151
+ severity?: 'success' | 'danger' | 'primary';
152
+
153
+ /**
154
+ * Show or hide the checkbox 'Stay after submit.'
155
+ *
156
+ * @default true - if the action is submit.
157
+ * @default false - if the action is save.
158
+ */
159
+ showStayCheckbox?: boolean;
160
+
161
+ /**
162
+ * Custom label for stay checkbox.
163
+ *
164
+ * @default - The default value from locale configuration {@link DialogFormLocaleConfig.stayCheckboxLabel}
165
+ */
166
+ stayCheckboxLabel?: string;
167
+
168
+ /**
169
+ * Custom button submit label.
170
+ * @default - The default value from locale configuration {@link DialogFormLocaleConfig.submitBtnLabel}
171
+ */
172
+ submitBtnLabel?: string;
173
+
174
+ /**
175
+ * Define the invalid message to be shown on invalid state above the Form submit button.
176
+ *
177
+ * @default undefined
178
+ */
179
+ validatorMessage?: string;
180
+
181
+ /**
182
+ * Additional validation function.
183
+ * Within this this function, you need to set the invalid props value.
184
+ *
185
+ * If after executing this function the props invalid is true, the form will not be submitted.
186
+ * Otherwise, 'submit' event will be emitted.
187
+ *
188
+ * @param values - the Form values
189
+ */
190
+ validationFunction?: (values: GenericObject) => void | Promise<void>;
191
+
192
+ /**
193
+ * Set the dialog size.
194
+ *
195
+ * - small: 400px
196
+ * - medium: 500px
197
+ * - large: 572px
198
+ * - semi-xlarge: 600px
199
+ * - xlarge: 800px
200
+ *
201
+ * @default 'small';
202
+ */
203
+ width?: 'small' | 'medium' | 'large' | 'semi-xlarge' | 'xlarge';
204
+ }
205
+
206
+ export interface ConfirmSlots {
207
+ /**
208
+ * The Visible state.
209
+ */
210
+ visible: boolean;
211
+
212
+ /**
213
+ * Hide the confirm dialog.
214
+ */
215
+ hide: () => void;
216
+
217
+ /**
218
+ * The submit function to be called after confirmation.
219
+ */
220
+ submit: (submitFn: (value: FormPayload) => Promise<void> | void) => void;
221
+ }
222
+
223
+ export interface ActionSlots {
224
+ /**
225
+ * The submit function to be called after confirmation.
226
+ */
227
+ submit: (submitFn: () => Promise<void> | void) => void;
228
+ }
229
+
230
+ /**
231
+ * Slots for DialogForm component
232
+ */
233
+ export interface DialogFormSlots {
234
+ /**
235
+ * Slot for action buttons.
236
+ */
237
+ 'actionButtons': Slot<ActionSlots>;
238
+
239
+ /**
240
+ * Slot for aside right expansion.
241
+ */
242
+ 'aside-right': Slot;
243
+
244
+ /**
245
+ * Slot for dialog confirm.
246
+ */
247
+ 'confirm': Slot<ConfirmSlots>;
248
+
249
+ /**
250
+ * The fields slot for the Dialogform. Here is where you can put your Dialogform fields.
251
+ */
252
+ 'fields': Slot<{ formValues: GenericObject; key?: number }>;
253
+
254
+ /**
255
+ * Slot for dialog header.
256
+ */
257
+ 'header': Slot;
258
+ }
259
+
260
+ /**
261
+ * Emits for DialogForm component
262
+ */
263
+ export type DialogFormEmits = {
264
+ /**
265
+ * Emits when 'Clear Field' button clicked.
266
+ */
267
+ 'clear': [];
268
+
269
+ /**
270
+ * When dialog is closed by close button.
271
+ */
272
+ 'close': [];
273
+
274
+ /**
275
+ * Callback to invoke when dialog is hidden.
276
+ */
277
+ 'hide': [];
278
+
279
+ /**
280
+ * Callback to invoke when dialog is shown.
281
+ */
282
+ 'show': [];
283
+
284
+ /**
285
+ * Emits when the form validation succes and props.invalid is 'false'.
286
+ */
287
+ 'submit': [values: DialogFormPayload];
288
+
289
+ /**
290
+ * When dialog is closed.
291
+ */
292
+ 'update:visible': [state: boolean];
293
+ };
294
+
295
+ /**
296
+ * **WangsVue - DialogForm**
297
+ *
298
+ * _DialogForm is combination of Form and Dialog. Handles validation on submit using vee-validate.
299
+ * You need to install vee-validate while using this component._
300
+ *
301
+ * --- ---
302
+ * ![WangsVue](https://www.wangs.id/wp-content/uploads/2023/12/cropped-Logo_Wangsid-removebg-preview-192x192.png)
303
+ *
304
+ * @group components
305
+ */
306
+ declare class DialogForm extends ClassComponent<
307
+ DialogFormProps,
308
+ DialogFormSlots,
309
+ DialogFormEmits
310
+ > {
311
+ /**
312
+ * Exposed function to clears the form fields.
313
+ */
314
+ clearField: () => void;
315
+
316
+ /**
317
+ * The ref of form element.
318
+ */
319
+ form: FormInstance;
320
+
321
+ /**
322
+ * Set initial values for all fields.
323
+ */
324
+ setValues: (values: GenericObject) => void;
325
+
326
+ /**
327
+ * Set value for specific field.
328
+ */
329
+ setFieldValue: <T extends string>(
330
+ field: T,
331
+ value: GenericObject[T],
332
+ shouldValidate?: boolean,
333
+ ) => void;
334
+
335
+ /**
336
+ * Set errors fields
337
+ * @param fields - {
338
+ * name: 'This name already exists'
339
+ * }
340
+ */
341
+ setErrors(fields: GenericObject): void;
342
+ }
343
+
344
+ declare module '@vue/runtime-core' {
345
+ interface GlobalComponents {
346
+ DialogForm: GlobalComponentConstructor<DialogForm>;
347
+ }
348
+ }
349
+
350
+ export default DialogForm;
@@ -0,0 +1,106 @@
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
+ list?: LinkedAsset[];
52
+ /**
53
+ * The list of selected asset to be transacted.
54
+ *
55
+ * @deprecated - no longer supported, use `list` instead
56
+ */
57
+ lists?: LinkedAsset[];
58
+ /**
59
+ * The label of the dialog button.
60
+ */
61
+ label?: string;
62
+ /**
63
+ * The body text of the dialog.
64
+ */
65
+ confirmBody?: string;
66
+ /**
67
+ * Specify the custom header icon.
68
+ * If not, the default rules by it severity.
69
+ *
70
+ * @default 'success' > hidden;
71
+ * @default 'danger' > 'error';
72
+ */
73
+ headerIcon?: WangsIcons;
74
+ /**
75
+ * @default - 'confirmation'
76
+ */
77
+ type?: 'detail' | 'confirmation';
78
+ }
79
+
80
+ /**
81
+ * Emits for DialogSelectAsset component
82
+ */
83
+ export type DialogLinkedAssetEmit = {
84
+ /**
85
+ * Emits when button confirm clicked.
86
+ */
87
+ 'confirm': [families: LinkedAssetFamily[]];
88
+ /**
89
+ * Emits when the dialog is closed. Wether from cancel button, close button, or ESC button pressed.
90
+ */
91
+ 'update:visible': [state: boolean];
92
+ };
93
+
94
+ /**
95
+ * Wangsvue - DialogLinkedAsset
96
+ *
97
+ * DialogLinkedAsset is a component for creating dialog confirmation of linked assets.
98
+ *
99
+ * @group components
100
+ */
101
+ declare const DialogLinkedAsset: DefineComponent<
102
+ DialogLinkedAssetProps,
103
+ DialogLinkedAssetEmit
104
+ >;
105
+
106
+ export default DialogLinkedAsset;
@@ -0,0 +1,18 @@
1
+ import { ClassComponent } from '../../components/ts-helpers.d';
2
+
3
+ export interface DialogPrintQRProps {
4
+ visible?: boolean;
5
+ }
6
+
7
+ export type DialogPrintQREmits = {
8
+ 'printed': [];
9
+ 'update:visible': [state: boolean];
10
+ };
11
+
12
+ declare class DialogPrintQR extends ClassComponent<
13
+ DialogPrintQRProps,
14
+ unknown,
15
+ DialogPrintQREmits
16
+ > {}
17
+
18
+ export default DialogPrintQR;
@@ -0,0 +1,34 @@
1
+ import { ClassComponent } from '../../components/ts-helpers.d';
2
+
3
+ export type ReportSourceType =
4
+ | 'Available Asset'
5
+ | 'Audit Asset'
6
+ | 'Borrowed Asset'
7
+ | 'Assigned Asset'
8
+ | 'Tracking Asset'
9
+ | 'Maintenance Asset';
10
+
11
+ export interface DialogReportDamageProps {
12
+ id: string;
13
+ reportSource: ReportSourceType;
14
+ visible?: boolean;
15
+ byUser?: boolean;
16
+ successMessage?: string;
17
+ submitFunction?: (body: {
18
+ notes: string;
19
+ image: File;
20
+ }) => Promise<{ status?: number; message?: string } | undefined>;
21
+ }
22
+
23
+ export type DialogReportDamageEmits = {
24
+ 'update:visible': [value: boolean];
25
+ 'reported': [];
26
+ };
27
+
28
+ declare class DialogReportDamage extends ClassComponent<
29
+ DialogReportDamageProps,
30
+ unknown,
31
+ DialogReportDamageEmits
32
+ > {}
33
+
34
+ export default DialogReportDamage;
@@ -0,0 +1,33 @@
1
+ import { ClassComponent } from '../../components/ts-helpers.d';
2
+
3
+ export type ReportSourceType =
4
+ | 'Available Asset'
5
+ | 'Borrowed Asset'
6
+ | 'Assigned Asset'
7
+ | 'Transfer Asset';
8
+
9
+ export interface DialogReportMissingProps {
10
+ id: string; // The Asset id to get asset detail
11
+ reportSource: ReportSourceType;
12
+ trackingId?: string; // The tracking Id to submit permanently missing report
13
+ visible?: boolean;
14
+ permanentlyMissing?: boolean;
15
+ successMessage?: string;
16
+ submitWithoutApi?: boolean;
17
+ submitFunction?: (body: {
18
+ notes: string;
19
+ }) => Promise<{ status?: number; message?: string } | undefined>;
20
+ }
21
+
22
+ export type DialogReportMissingEmits = {
23
+ 'update:visible': [value: boolean];
24
+ 'reported': [payload?: { notes: string }];
25
+ };
26
+
27
+ declare class DialogReportMissing extends ClassComponent<
28
+ DialogReportMissingProps,
29
+ unknown,
30
+ DialogReportMissingEmits
31
+ > {}
32
+
33
+ export default DialogReportMissing;