@fewangsit/wangsvue-fats 1.0.0-alpha.9 → 1.0.0-alpha.90

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 (156) hide show
  1. package/components/animation/Animation.vue.d.ts +9 -1
  2. package/components/assetinfo/AssetInfo.vue.d.ts +39 -0
  3. package/components/badgegroup/BadgeGroup.vue.d.ts +3 -1
  4. package/components/basetree/BaseTree.vue.d.ts +6 -1
  5. package/components/button/Button.vue.d.ts +7 -3
  6. package/components/buttonaddbyscan/ButtonAddByScan.vue.d.ts +40 -0
  7. package/components/buttonbulkaction/ButtonBulkAction.vue.d.ts +1 -0
  8. package/components/buttonradio/ButtonRadio.vue.d.ts +1 -0
  9. package/components/buttonscan/ButtonScan.vue.d.ts +202 -0
  10. package/components/buttonsearchbyscan/ButtonSearchByScan.vue.d.ts +46 -0
  11. package/components/buttonselecttree/ButtonSelectTree.vue.d.ts +2 -1
  12. package/components/buttonsplit/ButtonSplit.vue.d.ts +352 -34
  13. package/components/buttonsync/ButtonSync.vue.d.ts +22 -0
  14. package/components/buttontoggle/ButtonToggle.vue.d.ts +1 -0
  15. package/components/buttonviewlog/ButtonViewLog.vue.d.ts +17 -0
  16. package/components/calendar/Calendar.vue.d.ts +32 -4
  17. package/components/card/Card.vue.d.ts +1 -0
  18. package/components/checkbox/Checkbox.vue.d.ts +1 -0
  19. package/components/datatable/DataTable.vue.d.ts +12 -4
  20. package/components/dialog/Dialog.vue.d.ts +4 -3
  21. package/components/dialogassetnamedetail/DialogAssetNameDetail.vue.d.ts +46 -0
  22. package/components/dialogassetnamedetail/options/columns.d.ts +2 -0
  23. package/components/dialogassetnamedetail/options/filter.d.ts +2 -0
  24. package/components/dialogconfirm/DialogConfirm.vue.d.ts +1 -0
  25. package/components/dialogform/DialogForm.vue.d.ts +3 -2
  26. package/components/dialogprintqr/DialogPrintQR.vue.d.ts +18 -0
  27. package/components/dialogreportdamage/DialogReportDamage.vue.d.ts +34 -0
  28. package/components/dialogreportmissing/DialogReportMissing.vue.d.ts +33 -0
  29. package/components/dialogreporttag/DialogReportTag.vue.d.ts +31 -0
  30. package/components/dialogselecttree/DialogSelectTree.vue.d.ts +3 -2
  31. package/components/dialogselectuser/DialogSelectUser.vue.d.ts +102 -0
  32. package/components/dialogselectuser/options/columns.d.ts +3 -0
  33. package/components/dropdown/Dropdown.vue.d.ts +23 -4
  34. package/components/editor/Editor.vue.d.ts +1 -0
  35. package/components/fieldwrapper/FieldWrapper.vue.d.ts +12 -2
  36. package/components/fileupload/FileUpload.vue.d.ts +1 -0
  37. package/components/filtercontainer/FilterContainer.vue.d.ts +12 -8
  38. package/components/form/Form.vue.d.ts +2 -1
  39. package/components/icon/Icon.vue.d.ts +3 -0
  40. package/components/image/Image.vue.d.ts +8 -0
  41. package/components/imagecompressor/ImageCompressor.vue.d.ts +6 -0
  42. package/components/index.d.ts +27 -18
  43. package/components/inputcurrency/helpers/currency.helper.d.ts +5 -1
  44. package/components/inputemail/InputEmail.vue.d.ts +1 -0
  45. package/components/inputnumber/InputNumber.vue.d.ts +6 -0
  46. package/components/inputpassword/InputPassword.vue.d.ts +1 -0
  47. package/components/inputrangenumber/InputRangeNumber.vue.d.ts +1 -0
  48. package/components/inputsearch/InputSearch.vue.d.ts +36 -0
  49. package/components/inputtext/InputText.vue.d.ts +2 -1
  50. package/components/inputurl/InputURL.vue.d.ts +4 -2
  51. package/components/invisiblefield/InvisibleField.vue.d.ts +32 -36
  52. package/components/languagedropdown/LanguageDropdown.vue.d.ts +5 -19
  53. package/components/litedropdown/LiteDropdown.vue.d.ts +5 -3
  54. package/components/loading/store/loading.store.d.ts +3 -3
  55. package/components/menu/Menu.vue.d.ts +2 -1
  56. package/components/multiselect/MultiSelect.vue.d.ts +7 -4
  57. package/components/overlaypanel/OverlayPanel.vue.d.ts +1 -0
  58. package/components/paginator/Paginator.vue.d.ts +285 -0
  59. package/components/tabmenu/TabMenu.vue.d.ts +6 -190
  60. package/components/tagtype/TagType.vue.d.ts +26 -0
  61. package/components/textarea/Textarea.vue.d.ts +2 -1
  62. package/components/timeline/Timeline.vue.d.ts +21 -2
  63. package/components/toast/Toast.vue.d.ts +2 -1
  64. package/components/toggleswitch/ToggleSwitch.vue.d.ts +1 -0
  65. package/components/transactionroles/TransactionRoles.vue.d.ts +58 -0
  66. package/components/tree/Tree.vue.d.ts +6 -3
  67. package/components/tree/helpers/filterNodeKeys.helper.d.ts +8 -2
  68. package/components/tree/helpers/flattenTreeNodeChildren.helper.d.ts +3 -1
  69. package/components/username/UserName.vue.d.ts +6 -1
  70. package/components/userwithicon/UserWithIcon.vue.d.ts +21 -0
  71. package/config/defaultProps.d.ts +1 -1
  72. package/config/index.d.ts +1 -1
  73. package/config/locale.d.ts +1 -1
  74. package/directives/focus.d.ts +1 -1
  75. package/event-bus/index.d.ts +55 -50
  76. package/event-bus/mitt.d.ts +29 -14
  77. package/main.d.ts +34 -2
  78. package/package.json +10 -6
  79. package/plugins/VueHtmlToPaper.d.ts +11 -0
  80. package/plugins/WangsVue.d.ts +266 -98
  81. package/plugins/formValidation.d.ts +15 -6
  82. package/plugins/i18n-extension.d.ts +4 -0
  83. package/plugins/i18n.d.ts +89 -113
  84. package/stats.html +4949 -0
  85. package/style.css +1 -1
  86. package/utils/date.util.d.ts +64 -31
  87. package/utils/formatTagCode.util.d.ts +1 -0
  88. package/utils/getSeverityByAssetStatus.util.d.ts +3 -0
  89. package/utils/index.d.ts +6 -20
  90. package/utils/listenSidebarChanges.util.d.ts +16 -0
  91. package/utils/object.util.d.ts +14 -3
  92. package/utils/role.util.d.ts +67 -1
  93. package/utils/toast.util.d.ts +78 -78
  94. package/wangsvue-fats.js +56016 -0
  95. package/wangsvue-fats.system.js +204 -267
  96. package/assets/json/currencies.json.d.ts +0 -1068
  97. package/assets/lottie/admin/loading-page.lottie +0 -0
  98. package/assets/lottie/admin/loading-table.lottie +0 -0
  99. package/assets/lottie/admin/no-data.lottie +0 -0
  100. package/assets/lottie/supplyasset/loading-page.lottie +0 -0
  101. package/assets/lottie/supplyasset/loading-table.lottie +0 -0
  102. package/assets/lottie/supplyasset/no-data.lottie +0 -0
  103. package/assets/lottie/workspace/loading-page.lottie +0 -0
  104. package/assets/lottie/workspace/loading-plane.lottie +0 -0
  105. package/assets/lottie/workspace/loading-table.lottie +0 -0
  106. package/assets/lottie/workspace/no-data.lottie +0 -0
  107. package/build-entry.d.ts +0 -14
  108. package/components/buttonsplit/ButtonSplit.d.ts +0 -350
  109. package/components/calendar/BaseCalendar.vue.d.ts +0 -86
  110. package/components/codesnippet/CodeSnippet.vue.d.ts +0 -14
  111. package/components/customcolumn/ColumnList.vue.d.ts +0 -27
  112. package/components/customcolumn/helpers/setVisibilityColumn.helper.d.ts +0 -12
  113. package/components/datatable/MultiRow.vue.d.ts +0 -16
  114. package/components/datatable/helpers/adjustMenuPosition.helper.d.ts +0 -1
  115. package/components/datatable/helpers/filter.helper.d.ts +0 -28
  116. package/components/datatable/helpers/index.d.ts +0 -3
  117. package/components/datatable/helpers/readConfig.helper.d.ts +0 -2
  118. package/components/datatable/store/dataTable.store.d.ts +0 -22
  119. package/components/editor/CodeSnippetAdapter.vue.d.ts +0 -92
  120. package/components/editor/EditorButton.vue.d.ts +0 -15
  121. package/components/editor/MentionList.vue.d.ts +0 -35
  122. package/components/editor/MentionSection.vue.d.ts +0 -92
  123. package/components/editor/codeSnippetExtension.d.ts +0 -3
  124. package/components/editor/mentionSectionExtension.d.ts +0 -3
  125. package/components/editor/suggestion.d.ts +0 -2
  126. package/components/filtercontainer/helpers/applyFilter.helper.d.ts +0 -5
  127. package/components/filtercontainer/helpers/formatDateTimeRange.helper.d.ts +0 -7
  128. package/components/filtercontainer/helpers/getOption.helper.d.ts +0 -3
  129. package/components/gallerypreview/GalleryPreview.vue.d.ts +0 -31
  130. package/components/helpers/convertToArrayClass.helper.d.ts +0 -2
  131. package/components/helpers/index.d.ts +0 -2
  132. package/components/helpers/label.d.ts +0 -15
  133. package/components/imagecompressor/BackgroundImageCropper.vue.d.ts +0 -36
  134. package/components/imagecompressor/ImageInputInfo.vue.d.ts +0 -30
  135. package/components/inputgroup/InputGroup.vue.d.ts +0 -141
  136. package/components/inputphonenumber/helpers/getUserLocation.helper.d.ts +0 -8
  137. package/components/languagedropdown/LanguageDropdownOption.vue.d.ts +0 -18
  138. package/components/menu/helpers/filterMenu.helper.d.ts +0 -12
  139. package/components/menu/helpers/index.d.ts +0 -1
  140. package/components/menuitem/MenuItem.vue.d.ts +0 -19
  141. package/components/progressbar/ProgressBar.vue.d.ts +0 -72
  142. package/components/quickfilter/QuickFilter.vue.d.ts +0 -25
  143. package/components/timeline/TimelineContentByType.vue.d.ts +0 -16
  144. package/components/tooltipspan/TooltipSpan.vue.d.ts +0 -20
  145. package/components/tree/helpers/index.d.ts +0 -3
  146. package/components/usergroup/UserGroup.vue.d.ts +0 -57
  147. package/components/validatormessage/ValidatorMessage.vue.d.ts +0 -12
  148. package/types/options.type.d.ts +0 -16
  149. package/utils/addAttachment.util.d.ts +0 -43
  150. package/utils/exportToExcel.util.d.ts +0 -20
  151. package/utils/filterOptions.util.d.ts +0 -3
  152. package/utils/genPlaceholder.util.d.ts +0 -8
  153. package/utils/getAttachmentIcon.util.d.ts +0 -8
  154. package/utils/mergePropsWithDefaults.util.d.ts +0 -20
  155. package/utils/textFormatter.util.d.ts +0 -17
  156. package/wangsvue-fats.es.js +0 -132347
@@ -0,0 +1,26 @@
1
+ import { ClassComponent } from 'primevue/ts-helpers';
2
+
3
+ export type AssetTagType =
4
+ | 'QR'
5
+ | 'RFID'
6
+ | 'NFC'
7
+ | 'RFID & NFC'
8
+ | 'RFID & QR'
9
+ | 'NFC & QR'
10
+ | 'RFID & NFC & QR'
11
+ | 'Non TAG';
12
+
13
+ export interface TagTypeProps {
14
+ type: AssetTagType;
15
+
16
+ /**
17
+ * @default true
18
+ */
19
+ useNfc?: boolean;
20
+ }
21
+
22
+ export default class TagType extends ClassComponent<
23
+ TagTypeProps,
24
+ unknown,
25
+ unknown
26
+ > {}
@@ -1,11 +1,12 @@
1
1
  import { TextareaHTMLAttributes } from 'vue';
2
+
3
+ import { CustomValidation } from '../form/Form.vue.d';
2
4
  import {
3
5
  ClassComponent,
4
6
  GlobalComponentConstructor,
5
7
  Nullable,
6
8
  Numberish,
7
9
  } from '../ts-helpers.d';
8
- import { CustomValidation } from '../form/Form.vue.d';
9
10
 
10
11
  export interface TextareaLocaleConfig {
11
12
  /**
@@ -1,5 +1,7 @@
1
- import { JSONContent } from '../editor/Editor.vue.d';
1
+ import { VNode } from 'vue';
2
+
2
3
  import { BadgeProps } from '../badge/Badge.vue.d';
4
+ import { JSONContent } from '../editor/Editor.vue.d';
3
5
  import { ClassComponent } from '../ts-helpers';
4
6
 
5
7
  export interface AttachmentFile {
@@ -70,12 +72,17 @@ export type DetailType =
70
72
  | DetailJSONContent
71
73
  | DetailBadge;
72
74
 
75
+ export type DetailAnyRecord = Record<string, any>;
76
+
77
+ export type SlotDetailType = string | DetailAnyRecord;
78
+
73
79
  export type KeyValue = Record<string, string | DetailType>;
74
80
 
75
81
  export type TimelineItem = {
76
82
  _id: string;
77
83
  action: string;
78
84
  createdAt: string;
85
+ username?: string;
79
86
  user?: {
80
87
  _id: string;
81
88
  nickName: string;
@@ -102,6 +109,18 @@ export type TimelineProps = {
102
109
  noFormatDate?: boolean;
103
110
  };
104
111
 
112
+ export type TimelineSlots = {
113
+ /**
114
+ * Custom detail template.
115
+ *
116
+ * Use this slot if you want to configure your own detail value in each timeline
117
+ */
118
+ detail(slotProps: {
119
+ key: string;
120
+ value: SlotDetailType; // Type DetailAnyRecord only used when using slot since you can use your own object structure
121
+ }): VNode[];
122
+ };
123
+
105
124
  /**
106
125
  * **WangsVue - Timeline**
107
126
  *
@@ -114,7 +133,7 @@ export type TimelineProps = {
114
133
  */
115
134
  declare class Timeline extends ClassComponent<
116
135
  TimelineProps,
117
- unknown,
136
+ TimelineSlots,
118
137
  unknown
119
138
  > {}
120
139
 
@@ -9,14 +9,15 @@
9
9
  *
10
10
  */
11
11
  import { TransitionProps, VNode } from 'vue';
12
+
12
13
  import { ComponentHooks } from '../basecomponent';
14
+ import { WangsIcons } from '../icon/Icon.vue.d';
13
15
  import { PassThroughOptions } from '../passthrough';
14
16
  import {
15
17
  ClassComponent,
16
18
  GlobalComponentConstructor,
17
19
  PassThrough,
18
20
  } from '../ts-helpers';
19
- import { WangsIcons } from '../icon/Icon.vue.d';
20
21
 
21
22
  export declare type ToastPassThroughOptionType =
22
23
  | ToastPassThroughAttributes
@@ -6,6 +6,7 @@
6
6
  *
7
7
  */
8
8
  import { StyleValue } from 'vue';
9
+
9
10
  import { ComponentHooks } from '../basecomponent';
10
11
  import { PassThroughOptions } from '../passthrough';
11
12
  import {
@@ -0,0 +1,58 @@
1
+ import { DefineComponent } from 'vue';
2
+
3
+ export type TransactionRoles = Addon & {
4
+ borrowing: boolean;
5
+ assignment: boolean;
6
+ transfer: boolean;
7
+ disposal: boolean;
8
+ };
9
+
10
+ export type Addon = {
11
+ repairTicketing: boolean;
12
+ maintenance: boolean;
13
+ tracking: boolean;
14
+ audit: boolean;
15
+ assetControl: boolean;
16
+ };
17
+
18
+ type LicenseStatus = 'Managed' | 'Unmanaged' | null;
19
+
20
+ export type LicenseStatuses = {
21
+ fixedAsset: LicenseStatus;
22
+ repairTicketing: LicenseStatus;
23
+ maintenance: LicenseStatus;
24
+ tracking: LicenseStatus;
25
+ audit: LicenseStatus;
26
+ assetControl: LicenseStatus;
27
+ };
28
+
29
+ export type RoleData = {
30
+ [key: string]: unknown;
31
+ transactionRoles?: TransactionRoles;
32
+ addOn?: Addon;
33
+ transactions?: TransactionRoles; // For Policy Assets
34
+ licenseStatuses?: LicenseStatuses;
35
+ };
36
+
37
+ export interface TransactionRolesProps {
38
+ asset?: RoleData;
39
+ user?: Omit<RoleData, 'addon'>;
40
+ /**
41
+ * @default transaction
42
+ */
43
+ type?: 'transaction' | 'addon' | 'transaction-policy';
44
+ }
45
+
46
+ /**
47
+ * **TSVue V2 - TransactionRoles**
48
+ *
49
+ * _TransactionRoles is a component to show list of transaction role._
50
+ *
51
+ * --- ---
52
+ * ![TSVue](https://ik.imagekit.io/kurniadev/TS-HEAD-BLACK.png)
53
+ *
54
+ * @group buttons
55
+ */
56
+ declare const TransactionRoles: DefineComponent<TransactionRolesProps>;
57
+
58
+ export default TransactionRoles;
@@ -1,9 +1,12 @@
1
1
  import { Slot } from 'vue';
2
- import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
3
- import { TreeSelectionKeys } from 'primevue/tree';
4
- import { MenuItem } from 'lib/components/menuitem';
2
+
3
+ import { MenuItem } from '../../components/menuitem';
4
+
5
5
  import { BaseTreeProps, TreeNode } from '../basetree/BaseTree.vue.d';
6
6
  import { QueryParams, ShortFetchResponse } from '../datatable/DataTable.vue.d';
7
+ import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
8
+
9
+ import { TreeSelectionKeys } from 'primevue/tree';
7
10
 
8
11
  export interface TreeProps extends BaseTreeProps {
9
12
  /**
@@ -5,7 +5,10 @@ import { TreeSelectionKeys } from 'primevue/tree';
5
5
  * @param nodeKeys - A collection of selected node keys.
6
6
  * @param includeNodeAllKey - Whether to include the "-1" key (representing "All").
7
7
  */
8
- export declare const parseNodeKeys: (nodeKeys: TreeSelectionKeys, includeNodeAllKey?: boolean) => number[];
8
+ export declare const parseNodeKeys: (
9
+ nodeKeys: TreeSelectionKeys,
10
+ includeNodeAllKey?: boolean,
11
+ ) => number[];
9
12
  /**
10
13
  * Filters a collection of selected node keys based on specific criteria.
11
14
  *
@@ -13,4 +16,7 @@ export declare const parseNodeKeys: (nodeKeys: TreeSelectionKeys, includeNodeAll
13
16
  * @param includeNodeAllKey - Whether to include the "-1" key (representing "All").
14
17
  * @returns A new collection of filtered node keys.
15
18
  */
16
- export declare const filterNodeKeys: (nodeKeys: TreeSelectionKeys, includeNodeAllKey?: boolean) => TreeSelectionKeys;
19
+ export declare const filterNodeKeys: (
20
+ nodeKeys: TreeSelectionKeys,
21
+ includeNodeAllKey?: boolean,
22
+ ) => TreeSelectionKeys;
@@ -2,5 +2,7 @@ import { TreeNode } from '../../basetree/BaseTree.vue.d';
2
2
  /**
3
3
  * Covert deeply nested tree node into one level array.
4
4
  */
5
- declare const flattenTreeNodeChildren: (nodes: TreeNode[] | undefined) => TreeNode[];
5
+ declare const flattenTreeNodeChildren: (
6
+ nodes: TreeNode[] | undefined,
7
+ ) => TreeNode[];
6
8
  export default flattenTreeNodeChildren;
@@ -37,6 +37,11 @@ export interface UserNameComponentConfigs {
37
37
  */
38
38
  type?: 'icon' | 'picture';
39
39
 
40
+ /**
41
+ * Whether to show the user's name. If false, only the user's icon will be shown.
42
+ * @default true
43
+ */
44
+ showUserName?: boolean;
40
45
  /**
41
46
  * Specify the field of user to be used as display name
42
47
  *
@@ -80,7 +85,7 @@ export interface UserNameProps extends Partial<UserNameComponentConfigs> {
80
85
  /**
81
86
  * The full user Object
82
87
  */
83
- user?: GeneralUser;
88
+ user?: Partial<GeneralUser>;
84
89
 
85
90
  /**
86
91
  * When it sets to false, the props.user will be used
@@ -0,0 +1,21 @@
1
+ import { UserDetail } from '@tagsamurai/fats-api-services/src/types/user.type';
2
+
3
+ import { ClassComponent } from '../../components/ts-helpers';
4
+
5
+ export interface UserWithIconProps {
6
+ user: Partial<UserDetail> & { fullName: string };
7
+ }
8
+
9
+ declare class UserWithIcon extends ClassComponent<
10
+ UserWithIconProps,
11
+ unknown,
12
+ unknown
13
+ > {}
14
+
15
+ declare module 'vue' {
16
+ interface GlobalComponents {
17
+ UserWithIcon: typeof UserWithIcon;
18
+ }
19
+ }
20
+
21
+ export default UserWithIcon;
@@ -1,3 +1,3 @@
1
- import { ComponentDefaultPropsConfig } from '.././plugins/WangsVue';
1
+ import { ComponentDefaultPropsConfig } from '../plugins/WangsVue';
2
2
  declare const defaultProps: ComponentDefaultPropsConfig;
3
3
  export default defaultProps;
package/config/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { WangsVueOptions } from '.././plugins/WangsVue';
1
+ import { WangsVueOptions } from '../plugins/WangsVue';
2
2
  declare const _default: import('vue').Plugin<Partial<WangsVueOptions>>;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import { LocaleConfig } from '.././plugins/WangsVue';
1
+ import { LocaleConfig } from '../plugins/WangsVue';
2
2
  declare const locale: LocaleConfig;
3
3
  export default locale;
@@ -2,6 +2,6 @@
2
2
  * This directive is used to focus the html input on a component.
3
3
  */
4
4
  declare const Focus: {
5
- mounted: (el: HTMLElement) => Promise<void>;
5
+ mounted: (el: HTMLElement) => Promise<void>;
6
6
  };
7
7
  export default Focus;
@@ -1,57 +1,62 @@
1
- import { Data, QueryParams } from '../components/datatable/DataTable.vue.d';
2
- import { ToastParams } from '../utils';
3
1
  import { Emitter } from './mitt';
2
+ import { Data, QueryParams } from '../components/datatable/DataTable.vue.d';
3
+ import { ToastParams } from '../utils/toast.util';
4
4
  export type TableEvent = {
5
- tableName?: string;
5
+ tableName?: string;
6
6
  };
7
7
  export type Events<CustomEvents = Record<string, any>> = CustomEvents & {
8
- 'data-table:apply-filter': TableEvent & {
9
- filter: QueryParams;
10
- };
11
- 'search-table': TableEvent & {
12
- search: string | undefined;
13
- };
14
- 'show-filter': TableEvent & {
15
- show: boolean;
16
- };
17
- 'multi-select:hide-overlay': unknown;
18
- 'button-download:multi-tables': {
19
- table: {
20
- headers: string[];
21
- data: Record<string, unknown>[];
22
- tableName: string;
23
- tableTitle?: string;
24
- };
25
- };
26
- 'data-table:update': TableEvent;
27
- 'data-table:updated': TableEvent & {
28
- data: Data[];
29
- };
30
- 'data-table:download': TableEvent & {
31
- fileName: string;
32
- multiTableNames?: string[];
33
- additionalTexts?: (string | string[])[];
34
- };
35
- 'data-table:select-all-record': TableEvent;
36
- 'data-table:update-total-record': TableEvent & {
37
- total: number;
38
- };
39
- 'data-table:update-selected-data': TableEvent & {
40
- data?: Data[];
41
- };
42
- 'data-table:clear-selected-data': TableEvent;
43
- 'data-table:import-excel-to-json': TableEvent & {
44
- data: Data[];
45
- };
46
- 'work-calendar:reset-month': unknown;
47
- 'work-calendar:reset-year': unknown;
48
- 'toast:add': ToastParams;
49
- 'tree:update-tree-nodes': unknown;
50
- 'tree:tree-updated': unknown;
51
- 'tree:selection-changed': unknown;
52
- 'overlay:show': {
53
- overlayId: number;
54
- };
8
+ 'data-table:apply-filter': TableEvent & {
9
+ filter: QueryParams;
10
+ };
11
+ 'search-table': TableEvent & {
12
+ search: string | undefined;
13
+ };
14
+ 'search-by-scan-table': TableEvent & {
15
+ tag?: string;
16
+ };
17
+ 'show-filter': TableEvent & {
18
+ show: boolean;
19
+ };
20
+ 'multi-select:hide-overlay': unknown;
21
+ 'button-download:multi-tables': {
22
+ table: {
23
+ headers: string[];
24
+ data: Record<string, unknown>[];
25
+ tableName: string;
26
+ tableTitle?: string;
27
+ };
28
+ };
29
+ 'data-table:update': TableEvent;
30
+ 'data-table:updated': TableEvent & {
31
+ data: Data[];
32
+ };
33
+ 'data-table:download': TableEvent & {
34
+ fileName: string;
35
+ multiTableNames?: string[];
36
+ additionalTexts?: (string | string[])[];
37
+ };
38
+ 'data-table:select-all-record': TableEvent;
39
+ 'data-table:update-total-record': TableEvent & {
40
+ total: number;
41
+ };
42
+ 'data-table:update-selected-data': TableEvent & {
43
+ data?: Data[];
44
+ };
45
+ 'data-table:clear-selected-data': TableEvent;
46
+ 'data-table:import-excel-to-json': TableEvent & {
47
+ data: Data[];
48
+ };
49
+ 'work-calendar:reset-month': unknown;
50
+ 'work-calendar:reset-year': unknown;
51
+ 'toast:add': ToastParams;
52
+ 'tree:update-tree-nodes': unknown;
53
+ 'tree:tree-updated': unknown;
54
+ 'tree:selection-changed': {
55
+ keys: string;
56
+ };
57
+ 'overlay:show': {
58
+ overlayId: number;
59
+ };
55
60
  };
56
61
  declare const eventBus: Emitter<Events<Record<string, any>>>;
57
62
  export declare const extendEventBus: <T>() => Emitter<Events<T>>;
@@ -1,26 +1,41 @@
1
1
  export type EventType = string | symbol;
2
2
  export type Handler<T = unknown> = (event: T) => void;
3
- export type WildcardHandler<T = Record<string, unknown>> = (type: keyof T, event: T[keyof T]) => void;
3
+ export type WildcardHandler<T = Record<string, unknown>> = (
4
+ type: keyof T,
5
+ event: T[keyof T],
6
+ ) => void;
4
7
  export type EventHandlerList<T = unknown> = Array<Handler<T>>;
5
- export type WildCardEventHandlerList<T = Record<string, unknown>> = Array<WildcardHandler<T>>;
6
- export type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<keyof Events | '*', EventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>>;
8
+ export type WildCardEventHandlerList<T = Record<string, unknown>> = Array<
9
+ WildcardHandler<T>
10
+ >;
11
+ export type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<
12
+ keyof Events | '*',
13
+ EventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>
14
+ >;
7
15
  export interface Emitter<Events extends Record<EventType, unknown>> {
8
- all: EventHandlerMap<Events>;
9
- on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;
10
- on(type: '*', handler: WildcardHandler<Events>): void;
11
- off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>): void;
12
- off(type: '*', handler: WildcardHandler<Events>): void;
13
- emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
14
- emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void;
16
+ all: EventHandlerMap<Events>;
17
+ on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;
18
+ on(type: '*', handler: WildcardHandler<Events>): void;
19
+ off<Key extends keyof Events>(
20
+ type: Key,
21
+ handler?: Handler<Events[Key]>,
22
+ ): void;
23
+ off(type: '*', handler: WildcardHandler<Events>): void;
24
+ emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
25
+ emit<Key extends keyof Events>(
26
+ type: undefined extends Events[Key] ? Key : never,
27
+ ): void;
15
28
  }
16
29
  /**
17
30
  * Mitt: Tiny (~200b) functional event emitter / pubsub.
18
31
  * @name mitt
19
32
  * @returns {Mitt}
20
33
  */
21
- export default function mitt<Events extends Record<EventType, unknown>>(all?: EventHandlerMap<Events>): Emitter<Events>;
34
+ export default function mitt<Events extends Record<EventType, unknown>>(
35
+ all?: EventHandlerMap<Events>,
36
+ ): Emitter<Events>;
22
37
  declare global {
23
- interface Window {
24
- eventBus: Emitter<any>;
25
- }
38
+ interface Window {
39
+ eventBus: Emitter<any>;
40
+ }
26
41
  }
package/main.d.ts CHANGED
@@ -1,2 +1,34 @@
1
- export * from './build-entry'
2
- export {}
1
+ export { default as mitt } from './event-bus/mitt';
2
+ export { default as eventBus, extendEventBus } from './event-bus';
3
+
4
+ // PrimeVue
5
+ export { default as ToastService } from 'primevue/toastservice';
6
+
7
+ // Utils
8
+ export * from './utils';
9
+
10
+ // Helpers
11
+ export { formatCurrency } from './components/inputcurrency/helpers/currency.helper';
12
+
13
+ // Component store
14
+ export { default as useLoadingStore } from './components/loading/store/loading.store';
15
+
16
+ // Directives
17
+ export { default as Tooltip } from 'primevue/tooltip';
18
+ export { Focus } from './directives';
19
+
20
+ // Plugins
21
+ export { useForm, useField } from './plugins/formValidation';
22
+ export type { FormContext } from './plugins/formValidation';
23
+
24
+ // Translation
25
+ export * from './plugins/i18n';
26
+ export { default as i18n } from './plugins/i18n-extension';
27
+
28
+ // Used for dialog print qr
29
+ export { default as VueHtmlToPaper } from './plugins/VueHtmlToPaper';
30
+
31
+ export * from './components';
32
+
33
+ // Config
34
+ export { default as WangsVue } from './config';
package/package.json CHANGED
@@ -1,15 +1,19 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.0-alpha.9",
4
- "author": "fewangsit",
5
- "description": "Admin Console Tagsamurai VueJS Component Library",
3
+ "version": "1.0.0-alpha.90",
4
+ "author": "Wangsit FE Developer",
5
+ "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",
7
- "module": "./wangsvue-fats.es.js",
7
+ "module": "./wangsvue-fats.js",
8
8
  "types": "./main.d.ts",
9
+ "repository": "https://github.com/fewangsit/wangsvue",
9
10
  "exports": {
10
- ".": "./wangsvue-fats.es.js",
11
+ ".": "./wangsvue-fats.js",
11
12
  "./style.css": "./style.css",
12
- "./types": "./types",
13
+ "./config": "./config",
14
+ "./plugins": "./plugins",
15
+ "./directives": "./directives",
16
+ "./components": "./components",
13
17
  "./event-bus": "./event-bus",
14
18
  "./utils": "./utils"
15
19
  }
@@ -0,0 +1,11 @@
1
+ import { App } from 'vue';
2
+ type PrintOptions = {
3
+ name?: string;
4
+ specs?: string[];
5
+ replace?: boolean;
6
+ styles?: string[];
7
+ };
8
+ declare const VueHtmlToPaper: {
9
+ install(app: App, globalOptions?: PrintOptions): void;
10
+ };
11
+ export default VueHtmlToPaper;