@fewangsit/wangsvue-gsts 1.0.0-alpha.1

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 (173) hide show
  1. package/assets/json/currencies.json.d.ts +1068 -0
  2. package/assets/json/languages.json.d.ts +180 -0
  3. package/assets/lottie/admin/loading-page.lottie +0 -0
  4. package/assets/lottie/admin/loading-table.lottie +0 -0
  5. package/assets/lottie/admin/no-data.lottie +0 -0
  6. package/assets/lottie/supplyasset/loading-page.lottie +0 -0
  7. package/assets/lottie/supplyasset/loading-table.lottie +0 -0
  8. package/assets/lottie/supplyasset/no-data.lottie +0 -0
  9. package/assets/lottie/workspace/loading-page.lottie +0 -0
  10. package/assets/lottie/workspace/loading-plane.lottie +0 -0
  11. package/assets/lottie/workspace/loading-table.lottie +0 -0
  12. package/assets/lottie/workspace/no-data.lottie +0 -0
  13. package/build-entry.d.ts +14 -0
  14. package/components/animation/Animation.vue.d.ts +24 -0
  15. package/components/approverinfo/ApproverInfo.vue.d.ts +51 -0
  16. package/components/badge/Badge.vue.d.ts +66 -0
  17. package/components/badgegroup/BadgeGroup.vue.d.ts +40 -0
  18. package/components/badgegrouptree/BadgeGroupTree.vue.d.ts +34 -0
  19. package/components/basecomponent/index.d.ts +28 -0
  20. package/components/basetree/BaseTree.vue.d.ts +567 -0
  21. package/components/basetree/TreeNode.vue.d.ts +35 -0
  22. package/components/breadcrumb/Breadcrumb.vue.d.ts +26 -0
  23. package/components/button/Button.vue.d.ts +185 -0
  24. package/components/buttonImportExcel/ButtonImportExcel.vue.d.ts +26 -0
  25. package/components/buttonbulkaction/ButtonBulkAction.vue.d.ts +97 -0
  26. package/components/buttondownload/ButtonDownload.vue.d.ts +49 -0
  27. package/components/buttonfilter/ButtonFilter.vue.d.ts +12 -0
  28. package/components/buttonradio/ButtonRadio.vue.d.ts +257 -0
  29. package/components/buttonsearch/ButtonSearch.vue.d.ts +38 -0
  30. package/components/buttonselecttree/ButtonSelectTree.vue.d.ts +193 -0
  31. package/components/buttonsplit/ButtonSplit.d.ts +350 -0
  32. package/components/buttonsplit/ButtonSplit.vue.d.ts +34 -0
  33. package/components/buttontoggle/ButtonToggle.vue.d.ts +18 -0
  34. package/components/calendar/BaseCalendar.vue.d.ts +83 -0
  35. package/components/calendar/Calendar.vue.d.ts +561 -0
  36. package/components/card/Card.vue.d.ts +139 -0
  37. package/components/changelog/Changelog.vue.d.ts +158 -0
  38. package/components/changelogpage/ChangelogFilter.vue.d.ts +16 -0
  39. package/components/changelogpage/ChangelogPage.vue.d.ts +124 -0
  40. package/components/checkbox/Checkbox.vue.d.ts +329 -0
  41. package/components/codesnippet/CodeSnippet.vue.d.ts +14 -0
  42. package/components/customcolumn/CustomColumn.vue.d.ts +35 -0
  43. package/components/datatable/DataTable.vue.d.ts +704 -0
  44. package/components/datatable/MultiRow.vue.d.ts +16 -0
  45. package/components/datatable/helpers/adjustMenuPosition.helper.d.ts +1 -0
  46. package/components/datatable/helpers/filter.helper.d.ts +28 -0
  47. package/components/datatable/helpers/index.d.ts +3 -0
  48. package/components/datatable/helpers/readConfig.helper.d.ts +2 -0
  49. package/components/datatable/store/dataTable.store.d.ts +22 -0
  50. package/components/dialog/Dialog.vue.d.ts +464 -0
  51. package/components/dialogconfirm/DialogConfirm.vue.d.ts +153 -0
  52. package/components/dialogform/DialogForm.vue.d.ts +349 -0
  53. package/components/dialogselecttree/DialogSelectTree.vue.d.ts +111 -0
  54. package/components/dropdown/Dropdown.vue.d.ts +257 -0
  55. package/components/editor/CodeSnippetAdapter.vue.d.ts +92 -0
  56. package/components/editor/Editor.vue.d.ts +191 -0
  57. package/components/editor/EditorButton.vue.d.ts +15 -0
  58. package/components/editor/MentionList.vue.d.ts +35 -0
  59. package/components/editor/MentionSection.vue.d.ts +92 -0
  60. package/components/editor/codeSnippetExtension.d.ts +3 -0
  61. package/components/editor/mentionSectionExtension.d.ts +3 -0
  62. package/components/editor/suggestion.d.ts +2 -0
  63. package/components/fieldwrapper/FieldWrapper.vue.d.ts +69 -0
  64. package/components/fileupload/FileUpload.vue.d.ts +153 -0
  65. package/components/filtercontainer/FilterContainer.vue.d.ts +141 -0
  66. package/components/filtercontainer/helpers/applyFilter.helper.d.ts +3 -0
  67. package/components/filtercontainer/helpers/formatDateTimeRange.helper.d.ts +7 -0
  68. package/components/filtercontainer/helpers/getOption.helper.d.ts +3 -0
  69. package/components/form/Form.vue.d.ts +306 -0
  70. package/components/gallerypreview/GalleryPreview.vue.d.ts +31 -0
  71. package/components/helpers/convertToArrayClass.helper.d.ts +2 -0
  72. package/components/helpers/index.d.ts +2 -0
  73. package/components/helpers/label.d.ts +15 -0
  74. package/components/icon/Icon.vue.d.ts +245 -0
  75. package/components/image/Image.vue.d.ts +403 -0
  76. package/components/imagecompressor/BackgroundImageCropper.vue.d.ts +36 -0
  77. package/components/imagecompressor/ImageCompressor.vue.d.ts +191 -0
  78. package/components/imagecompressor/ImageInputInfo.vue.d.ts +30 -0
  79. package/components/index.d.ts +66 -0
  80. package/components/inlinemessage/InlineMessage.vue.d.ts +167 -0
  81. package/components/inputbadge/InputBadge.vue.d.ts +122 -0
  82. package/components/inputcurrency/InputCurrency.vue.d.ts +170 -0
  83. package/components/inputcurrency/helpers/currency.helper.d.ts +4 -0
  84. package/components/inputemail/InputEmail.vue.d.ts +25 -0
  85. package/components/inputgroup/InputGroup.vue.d.ts +141 -0
  86. package/components/inputnumber/InputNumber.vue.d.ts +282 -0
  87. package/components/inputpassword/InputPassword.vue.d.ts +32 -0
  88. package/components/inputphonenumber/InputPhoneNumber.vue.d.ts +99 -0
  89. package/components/inputphonenumber/helpers/getUserLocation.helper.d.ts +8 -0
  90. package/components/inputrangenumber/InputRangeNumber.vue.d.ts +120 -0
  91. package/components/inputtext/InputText.vue.d.ts +352 -0
  92. package/components/inputurl/InputURL.vue.d.ts +39 -0
  93. package/components/invisiblefield/InvisibleField.vue.d.ts +36 -0
  94. package/components/languagedropdown/LanguageDropdown.vue.d.ts +58 -0
  95. package/components/languagedropdown/LanguageDropdownOption.vue.d.ts +18 -0
  96. package/components/litedropdown/LiteDropdown.vue.d.ts +96 -0
  97. package/components/loading/Loading.vue.d.ts +47 -0
  98. package/components/loading/store/loading.store.d.ts +8 -0
  99. package/components/menu/Menu.vue.d.ts +390 -0
  100. package/components/menu/helpers/filterMenu.helper.d.ts +12 -0
  101. package/components/menu/helpers/index.d.ts +1 -0
  102. package/components/menuitem/MenuItem.vue.d.ts +19 -0
  103. package/components/menuitem/index.d.ts +104 -0
  104. package/components/multiselect/MultiSelect.vue.d.ts +192 -0
  105. package/components/overlaypanel/OverlayPanel.vue.d.ts +301 -0
  106. package/components/passthrough/index.d.ts +16 -0
  107. package/components/progressbar/ProgressBar.vue.d.ts +72 -0
  108. package/components/quickfilter/QuickFilter.vue.d.ts +25 -0
  109. package/components/tabmenu/TabMenu.vue.d.ts +288 -0
  110. package/components/tagtype/TagType.vue.d.ts +22 -0
  111. package/components/textarea/Textarea.vue.d.ts +170 -0
  112. package/components/timeline/Timeline.vue.d.ts +115 -0
  113. package/components/timeline/TimelineContentByType.vue.d.ts +16 -0
  114. package/components/toast/Toast.vue.d.ts +367 -0
  115. package/components/toggleswitch/ToggleSwitch.vue.d.ts +281 -0
  116. package/components/tooltipspan/TooltipSpan.vue.d.ts +20 -0
  117. package/components/tree/Tree.vue.d.ts +146 -0
  118. package/components/tree/helpers/filterNodeKeys.helper.d.ts +16 -0
  119. package/components/tree/helpers/flattenTreeNodeChildren.helper.d.ts +6 -0
  120. package/components/tree/helpers/index.d.ts +3 -0
  121. package/components/treesearchinput/TreeSearchInput.vue.d.ts +16 -0
  122. package/components/ts-helpers.d.ts +63 -0
  123. package/components/usergroup/UserGroup.vue.d.ts +57 -0
  124. package/components/username/UserName.vue.d.ts +61 -0
  125. package/components/validatormessage/ValidatorMessage.vue.d.ts +12 -0
  126. package/config/defaultProps.d.ts +3 -0
  127. package/config/index.d.ts +3 -0
  128. package/config/locale.d.ts +3 -0
  129. package/directives/focus.d.ts +7 -0
  130. package/directives/index.d.ts +1 -0
  131. package/event-bus/index.d.ts +55 -0
  132. package/event-bus/mitt.d.ts +26 -0
  133. package/loading-page-BrQattYE.js +1 -0
  134. package/loading-page-CgfbWppy.js +1 -0
  135. package/loading-page-CoC9UhfC.js +4 -0
  136. package/loading-page-CoXtqoc9.js +4 -0
  137. package/loading-page-DbLuqCHa.js +1 -0
  138. package/loading-page-f8D03l3G.js +4 -0
  139. package/loading-plane-CgfbWppy.js +1 -0
  140. package/loading-plane-CoXtqoc9.js +4 -0
  141. package/loading-table-Bb2MtjdD.js +4 -0
  142. package/loading-table-Br25QIny.js +1 -0
  143. package/loading-table-ByUoWqUo.js +4 -0
  144. package/loading-table-BygEMzFM.js +4 -0
  145. package/loading-table-BzrSQlA0.js +1 -0
  146. package/loading-table-chOgXi94.js +1 -0
  147. package/main.d.ts +2 -0
  148. package/no-data-CTKux8RI.js +4 -0
  149. package/no-data-Cgze_Rvp.js +1 -0
  150. package/no-data-DLHO1L_u.js +4 -0
  151. package/no-data-Dep79CBh.js +1 -0
  152. package/no-data-g0dJCy2p.js +4 -0
  153. package/no-data-y1X5WtcQ.js +1 -0
  154. package/package.json +16 -0
  155. package/plugins/WangsVue.d.ts +121 -0
  156. package/plugins/formValidation.d.ts +10 -0
  157. package/plugins/translation.d.ts +37 -0
  158. package/style.css +1 -0
  159. package/types/options.type.d.ts +16 -0
  160. package/utils/date.util.d.ts +37 -0
  161. package/utils/exportToExcel.util.d.ts +20 -0
  162. package/utils/filterOptions.util.d.ts +3 -0
  163. package/utils/genPlaceholder.util.d.ts +8 -0
  164. package/utils/getAttachmentIcon.util.d.ts +8 -0
  165. package/utils/getStatusSeverity.util.d.ts +3 -0
  166. package/utils/index.d.ts +18 -0
  167. package/utils/mergePropsWithDefaults.util.d.ts +20 -0
  168. package/utils/object.util.d.ts +9 -0
  169. package/utils/role.util.d.ts +2 -0
  170. package/utils/textFormatter.util.d.ts +17 -0
  171. package/utils/toast.util.d.ts +114 -0
  172. package/wangsvue-gsts.es.js +133347 -0
  173. package/wangsvue-gsts.system.js +454 -0
@@ -0,0 +1,18 @@
1
+ import { LanguageOption } from './LanguageDropdown.vue.d';
2
+ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<{
3
+ option: LanguageOption;
4
+ iconOnly?: boolean;
5
+ }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<{
6
+ option: LanguageOption;
7
+ iconOnly?: boolean;
8
+ }>>>, {}, {}>;
9
+ export default _default;
10
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
11
+ type __VLS_TypePropsToOption<T> = {
12
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
13
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
14
+ } : {
15
+ type: import('vue').PropType<T[K]>;
16
+ required: true;
17
+ };
18
+ };
@@ -0,0 +1,96 @@
1
+ import { DropdownOption, OptionValue } from 'lib/types/options.type';
2
+ import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
3
+ import { DropdownChangeEvent } from 'primevue/dropdown';
4
+
5
+ /**
6
+ * Lite dropdown component props
7
+ */
8
+ export interface LiteDropdownProps {
9
+ modelValue: OptionValue | undefined;
10
+ options: DropdownOption[] | undefined;
11
+ /**
12
+ * Specify the property name of option to be used as label.
13
+ *
14
+ * @default undefined - the label will be sets to the option itself.
15
+ */
16
+ optionLabel: string;
17
+ /**
18
+ * Specify the property name of option to be used as value.
19
+ *
20
+ * @default undefined - the value will be sets to the option itself.
21
+ */
22
+ optionValue: string;
23
+ /**
24
+ * Determines if the field is mandatory
25
+ */
26
+ mandatory?: boolean;
27
+ /**
28
+ * Default text to display when no option is selected.
29
+ *
30
+ * @default `Pilih data`
31
+ */
32
+ placeholder?: string;
33
+ /**
34
+ * Whether the dropdown is in loading state.
35
+ * @defaultValue false
36
+ */
37
+ loading?: boolean;
38
+ /**
39
+ * Set disabled state for input dropdown.
40
+ */
41
+ disabled?: boolean;
42
+ /**
43
+ * Wether show the Dropdown option search or not.
44
+ *
45
+ * @default true,
46
+ */
47
+ filter?: boolean;
48
+ /**
49
+ * The filter input Placeholder
50
+ *
51
+ * @default 'Cari'
52
+ */
53
+ filterPlaceholder?: string;
54
+ }
55
+
56
+ /**
57
+ * Lite dropdown component emits
58
+ */
59
+ export type LiteDropdownEmits = {
60
+ /**
61
+ * Emits when an option selected.
62
+ */
63
+ 'update:modelValue': [value: OptionValue | undefined];
64
+ /**
65
+ * Emits when overlay shown.
66
+ */
67
+ 'show': [];
68
+ /**
69
+ * Emits when there is a change on the dropdown value.
70
+ */
71
+ 'change': [value: DropdownChangeEvent];
72
+ };
73
+
74
+ /**
75
+ * **WangsVue - LiteDropwdown**
76
+ *
77
+ * _LiteDropdown, a lite version of the Dropdown component._
78
+ *
79
+ * --- ---
80
+ * ![WangsVue](https://www.wangs.id/wp-content/uploads/2023/12/cropped-Logo_Wangsid-removebg-preview-192x192.png)
81
+ *
82
+ * @group Component
83
+ */
84
+ declare class LiteDropdown extends ClassComponent<
85
+ LiteDropdownProps,
86
+ unknown,
87
+ LiteDropdownEmits
88
+ > {}
89
+
90
+ declare module '@vue/runtime-core' {
91
+ interface GlobalComponents {
92
+ Dropdown: GlobalComponentConstructor<LiteDropdown>;
93
+ }
94
+ }
95
+
96
+ export default LiteDropdown;
@@ -0,0 +1,47 @@
1
+ import { DefineComponent } from 'vue';
2
+
3
+ /**
4
+ * Attributes for Loading pass-through customization.
5
+ */
6
+ export interface LoadingPresetAttributes {
7
+ class?: any;
8
+ style?: any;
9
+ [key: string]: any;
10
+ }
11
+
12
+ export interface LoadingPresetOptions {
13
+ root: LoadingPresetAttributes;
14
+ animation: LoadingPresetAttributes;
15
+ }
16
+
17
+ /**
18
+ * **TSVue - Loading**
19
+ *
20
+ * _Tag Samurai Loading Overlay Animation._
21
+ *
22
+ * #### Example
23
+ *
24
+ * Script:
25
+ * ```ts
26
+ * import { Loading, useLoadingStore } from 'wangsvue';
27
+ *
28
+ * const { setLoading } = useLoadingStore();
29
+ *
30
+ * onMounted(() => {
31
+ * setLoading(true);
32
+ * });
33
+ * ```
34
+ * ---
35
+ * Template:
36
+ * ```html
37
+ * <Loading />
38
+ * ```
39
+ *
40
+ * --- ---
41
+ * ![TSVue](https://www.wangs.id/wp-content/uploads/2023/12/cropped-Logo_Wangsid-removebg-preview-192x192.png)
42
+ *
43
+ * @group form
44
+ */
45
+ declare const Loading: DefineComponent;
46
+
47
+ export default Loading;
@@ -0,0 +1,8 @@
1
+ import { Ref } from 'vue';
2
+ export interface LoadingStore {
3
+ loading: Ref<boolean>;
4
+ message: Ref<string | undefined>;
5
+ setLoading: (state: boolean, message?: string) => void;
6
+ }
7
+ declare const useLoadingStore: () => LoadingStore;
8
+ export default useLoadingStore;
@@ -0,0 +1,390 @@
1
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ /**
4
+ *
5
+ * Menu is a navigation / command component that supports dynamic and static positioning.
6
+ *
7
+ * [Live Demo](https://www.WangsVue.org/menu/)
8
+ *
9
+ * @module menu
10
+ *
11
+ */
12
+ import { TransitionProps, VNode } from 'vue';
13
+ import { ComponentHooks } from '../basecomponent';
14
+ import { PassThroughOptions } from '../passthrough';
15
+ import { MenuItem } from '../menuitem';
16
+ import {
17
+ ClassComponent,
18
+ GlobalComponentConstructor,
19
+ PassThrough,
20
+ } from '../ts-helpers';
21
+
22
+ export declare type MenuPassThroughOptionType =
23
+ | MenuPassThroughAttributes
24
+ | ((
25
+ options: MenuPassThroughMethodOptions,
26
+ ) => MenuPassThroughAttributes | string)
27
+ | string
28
+ | null
29
+ | undefined;
30
+
31
+ export declare type MenuPassThroughTransitionType =
32
+ | TransitionProps
33
+ | ((options: MenuPassThroughMethodOptions) => TransitionProps)
34
+ | undefined;
35
+
36
+ export interface MenuLocaleConfig {
37
+ /**
38
+ * The label of menu when no selectable menu available.
39
+ */
40
+ noOptionLabel?: string;
41
+ }
42
+
43
+ /**
44
+ * Custom passthrough(pt) option method.
45
+ */
46
+ export interface MenuPassThroughMethodOptions {
47
+ /**
48
+ * Defines instance.
49
+ */
50
+ instance: any;
51
+ /**
52
+ * Defines valid properties.
53
+ */
54
+ props: MenuProps;
55
+ /**
56
+ * Defines current inline state.
57
+ */
58
+ state: MenuState;
59
+ /**
60
+ * Defines current options.
61
+ */
62
+ context: MenuContext;
63
+ /**
64
+ * Defines valid attributes.
65
+ */
66
+ attrs: any;
67
+ /**
68
+ * Defines parent options.
69
+ */
70
+ parent: any;
71
+ /**
72
+ * Defines passthrough(pt) options in global config.
73
+ */
74
+ global: object | undefined;
75
+ }
76
+
77
+ /**
78
+ * Custom passthrough(pt) options.
79
+ * @see {@link MenuProps.pt}
80
+ */
81
+ export interface MenuPassThroughOptions {
82
+ /**
83
+ * Used to pass attributes to the root's DOM element.
84
+ */
85
+ root?: MenuPassThroughOptionType;
86
+ /**
87
+ * Used to pass attributes to the list's DOM element.
88
+ */
89
+ menu?: MenuPassThroughOptionType;
90
+ /**
91
+ * Used to pass attributes to the submenu header's DOM element.
92
+ */
93
+ submenuHeader?: MenuPassThroughOptionType;
94
+ /**
95
+ * Used to pass attributes to the list item's DOM element.
96
+ */
97
+ menuitem?: MenuPassThroughOptionType;
98
+ /**
99
+ * Used to pass attributes to the content's DOM element.
100
+ */
101
+ content?: MenuPassThroughOptionType;
102
+ /**
103
+ * Used to pass attributes to the action's DOM element.
104
+ */
105
+ action?: MenuPassThroughOptionType;
106
+ /**
107
+ * Used to pass attributes to the icon's DOM element.
108
+ */
109
+ icon?: MenuPassThroughOptionType;
110
+ /**
111
+ * Used to pass attributes to the label's DOM element.
112
+ */
113
+ label?: MenuPassThroughOptionType;
114
+ /**
115
+ * Used to pass attributes to the separator's DOM element.
116
+ */
117
+ separator?: MenuPassThroughOptionType;
118
+ /**
119
+ * Used to pass attributes to the start of the component.
120
+ */
121
+ start?: MenuPassThroughOptionType;
122
+ /**
123
+ * Used to pass attributes to the end of the component.
124
+ */
125
+ end?: MenuPassThroughOptionType;
126
+ /**
127
+ * Used to manage all lifecycle hooks.
128
+ * @see {@link basecomponent.ComponentHooks}
129
+ */
130
+ hooks?: ComponentHooks;
131
+ /**
132
+ * Used to control Vue Transition API.
133
+ */
134
+ transition?: MenuPassThroughTransitionType;
135
+ }
136
+
137
+ /**
138
+ * Custom passthrough attributes for each DOM elements
139
+ */
140
+ export interface MenuPassThroughAttributes {
141
+ [key: string]: any;
142
+ }
143
+
144
+ /**
145
+ * Defines current inline state in Menu component.
146
+ */
147
+ export interface MenuState {
148
+ /**
149
+ * Current id state as a string.
150
+ */
151
+ id: string;
152
+ /**
153
+ * Current visible state as a boolean.
154
+ * @defaultValue false
155
+ */
156
+ overlayVisible: boolean;
157
+ /**
158
+ * Current focus state as a boolean.
159
+ * @defaultValue false
160
+ */
161
+ focused: boolean;
162
+ /**
163
+ * Focused option index.
164
+ */
165
+ focusedOptionIndex: number;
166
+ /**
167
+ * Selected option index.
168
+ */
169
+ selectedOptionIndex: number;
170
+ }
171
+
172
+ /**
173
+ * Defines current options in Menu component.
174
+ */
175
+ export interface MenuContext {
176
+ /**
177
+ * Current menuitem
178
+ */
179
+ item: any;
180
+ /**
181
+ * Current index of the menuitem.
182
+ */
183
+ index: number;
184
+ /**
185
+ * Current focused state of menuitem as a boolean.
186
+ * @defaultValue false
187
+ */
188
+ focused: boolean;
189
+ /**
190
+ * Current disabled state of menuitem as a boolean.
191
+ * @defaultValue false
192
+ */
193
+ disabled: boolean;
194
+ }
195
+
196
+ /**
197
+ * Defines valid router binding props in Menu component.
198
+ */
199
+ export interface MenuRouterBindProps {
200
+ /**
201
+ * Action element binding
202
+ */
203
+ action: object;
204
+ /**
205
+ * Icon element binding
206
+ */
207
+ icon: object;
208
+ /**
209
+ * Label element binding
210
+ */
211
+ label: object;
212
+ }
213
+
214
+ /**
215
+ * Defines valid properties in Menu component.
216
+ */
217
+ export interface MenuProps {
218
+ /**
219
+ * An array of menuitems.
220
+ */
221
+ model?: MenuItem[] | undefined;
222
+ /**
223
+ * Defines if menu would displayed as a popup.
224
+ * @defaultValue true
225
+ */
226
+ popup?: boolean | undefined;
227
+ /**
228
+ * A valid query selector or an HTMLElement to specify where the overlay gets attached.
229
+ * @defaultValue body
230
+ */
231
+ appendTo?: 'body' | 'self' | string | undefined | HTMLElement;
232
+ /**
233
+ * Whether to automatically manage layering.
234
+ * @defaultValue true
235
+ */
236
+ autoZIndex?: boolean | undefined;
237
+ /**
238
+ * Base zIndex value to use in layering.
239
+ * @defaultValue 0
240
+ */
241
+ baseZIndex?: number | undefined;
242
+ /**
243
+ * Whether to apply 'router-link-active-exact' class if route exactly matches the item path.
244
+ * @deprecated since v3.40.0.
245
+ * @defaultValue true
246
+ */
247
+ exact?: boolean | undefined;
248
+ /**
249
+ * Index of the element in tabbing order.
250
+ */
251
+ tabindex?: number | string | undefined;
252
+ /**
253
+ * Defines a string value that labels an interactive element.
254
+ */
255
+ ariaLabel?: string | undefined;
256
+ /**
257
+ * Identifier of the underlying input element.
258
+ */
259
+ ariaLabelledby?: string | undefined;
260
+ /**
261
+ * Used to pass attributes to DOM elements inside the component.
262
+ * @type {MenuPassThroughOptions}
263
+ */
264
+ pt?: PassThrough<MenuPassThroughOptions>;
265
+ /**
266
+ * Used to configure passthrough(pt) options of the component.
267
+ * @type {PassThroughOptions}
268
+ */
269
+ ptOptions?: PassThroughOptions;
270
+ /**
271
+ * When enabled, it removes component related styles in the core.
272
+ * @defaultValue false
273
+ */
274
+ unstyled?: boolean;
275
+ }
276
+
277
+ /**
278
+ * Defines valid slots in Menu component.
279
+ */
280
+ export interface MenuSlots {
281
+ /**
282
+ * Custom start template.
283
+ */
284
+ start(): VNode[];
285
+ /**
286
+ * Custom end template.
287
+ */
288
+ end(): VNode[];
289
+ /**
290
+ * Custom item template.
291
+ * @param {Object} scope - item slot's params.
292
+ */
293
+ item(scope: {
294
+ /**
295
+ * Menuitem instance
296
+ */
297
+ item: MenuItem;
298
+ /**
299
+ * Label property of the menuitem
300
+ */
301
+ label: string | ((...args: any) => string) | undefined;
302
+ /**
303
+ * Binding properties of the menuitem
304
+ */
305
+ props: MenuRouterBindProps;
306
+ }): VNode[];
307
+ /**
308
+ * Custom item icon template.
309
+ * @param {Object} scope - item icon slot's params.
310
+ */
311
+ itemicon(scope: {
312
+ /**
313
+ * Menuitem instance
314
+ */
315
+ item: MenuItem;
316
+ /**
317
+ * Style class of the item icon element.
318
+ */
319
+ class: any;
320
+ }): VNode[];
321
+ /**
322
+ * Custom item template.
323
+ * @param {Object} scope - submenuheader slot's params.
324
+ */
325
+ submenuheader(scope: {
326
+ /**
327
+ * Menuitem instance
328
+ */
329
+ item: MenuItem;
330
+ }): VNode[];
331
+ }
332
+
333
+ /**
334
+ * Defines valid emits in Menu component.
335
+ */
336
+ export type MenuEmits = {
337
+ /**
338
+ * Callback to invoke when the component receives focus.
339
+ * @param {Event} event - Browser event.
340
+ */
341
+ focus: [event: Event];
342
+ /**
343
+ * Callback to invoke when the component loses focus.
344
+ * @param {Event} event - Browser event.
345
+ */
346
+ blur: [event: Event];
347
+ };
348
+
349
+ /**
350
+ * **WangsVue - Menu**
351
+ *
352
+ * _Menu is a navigation / command component that supports dynamic and static positioning._
353
+ *
354
+ * --- ---
355
+ * ![WangsVue](https://www.wangs.id/wp-content/uploads/2023/12/cropped-Logo_Wangsid-removebg-preview-192x192.png)
356
+ *
357
+ * @group Component
358
+ *
359
+ */
360
+ declare class Menu extends ClassComponent<MenuProps, MenuSlots, MenuEmits> {
361
+ /**
362
+ * Toggles the visibility of the overlay.
363
+ * @param {Event} event - Browser event.
364
+ *
365
+ * @memberof Menu
366
+ */
367
+ toggle(event: Event): void;
368
+ /**
369
+ * Shows the overlay.
370
+ * @param {Event} event - Browser event.
371
+ * @param {*} [target] - Target element
372
+ *
373
+ * @memberof Menu
374
+ */
375
+ show(event: Event, target?: any): void;
376
+ /**
377
+ * Hides the overlay.
378
+ *
379
+ * @memberof Menu
380
+ */
381
+ hide(): void;
382
+ }
383
+
384
+ declare module '@vue/runtime-core' {
385
+ interface GlobalComponents {
386
+ Menu: GlobalComponentConstructor<Menu>;
387
+ }
388
+ }
389
+
390
+ export default Menu;
@@ -0,0 +1,12 @@
1
+ import { MenuItem } from '../../menuitem';
2
+ /**
3
+ * Filters the menu items to return only the visible ones.
4
+ * If no visible menu items are found, it returns a menu with a label 'No Option Available'.
5
+ *
6
+ * @param menuItems - The array of menu items to filter.
7
+ * @param noOptionLabel - The label of menu to be shown when no available option. The value is from locale configuration each project.
8
+ *
9
+ * @returns - The array of visible menu items or an array with a single menu item with label 'No Option Available'.
10
+ */
11
+ declare const filterVisibleMenu: (menuItems: MenuItem[], noOptionLabel?: string) => MenuItem[];
12
+ export default filterVisibleMenu;
@@ -0,0 +1 @@
1
+ export { default as filterVisibleMenu } from './filterMenu.helper';
@@ -0,0 +1,19 @@
1
+ import { MenuRouterBindProps } from '../menu/Menu.vue.d';
2
+ import { MenuItem } from '.';
3
+ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<{
4
+ item: MenuItem;
5
+ routerProps: MenuRouterBindProps;
6
+ }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<{
7
+ item: MenuItem;
8
+ routerProps: MenuRouterBindProps;
9
+ }>>>, {}, {}>;
10
+ export default _default;
11
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
+ type __VLS_TypePropsToOption<T> = {
13
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
14
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
15
+ } : {
16
+ type: import('vue').PropType<T[K]>;
17
+ required: true;
18
+ };
19
+ };
@@ -0,0 +1,104 @@
1
+ /**
2
+ *
3
+ * WangsVue menu components share a common api to specify the menuitems and submenus.
4
+ *
5
+ * @module menuitem
6
+ *
7
+ */
8
+
9
+ /**
10
+ * Custom command event.
11
+ * @todo next release should be able to change see menuItem.command
12
+ */
13
+ export interface MenuItemCommandEvent {
14
+ /**
15
+ * Browser event.
16
+ */
17
+ originalEvent: Event;
18
+ /**
19
+ * Menuitem instance.
20
+ */
21
+ item: MenuItem;
22
+ /**
23
+ * Optional
24
+ */
25
+ [key: string]: any;
26
+ }
27
+
28
+ /**
29
+ * Defines model of MenuItem API.
30
+ */
31
+ export interface MenuItem {
32
+ /**
33
+ * Property name or getter function to use as the label of an item.
34
+ */
35
+ label?: string | ((...args: any) => string) | undefined;
36
+ /**
37
+ * Icon of the item.
38
+ */
39
+ icon?: string | undefined;
40
+ /**
41
+ * Callback to execute when item is clicked.
42
+ * @param {MenuItemCommandEvent} event - Custom command event.
43
+ * @todo next release should be able to change
44
+ */
45
+ command?: (event: MenuItemCommandEvent) => void;
46
+ /**
47
+ * External link to navigate when item is clicked.
48
+ */
49
+ url?: string | undefined;
50
+ /**
51
+ * Specifies where to open the linked document.
52
+ */
53
+ target?: string | undefined;
54
+ /**
55
+ * Internal/ vue router link to navigate when item is clicked.
56
+ */
57
+ route?: string | undefined;
58
+ /**
59
+ * An array of children menuitems.
60
+ */
61
+ items?: MenuItem[] | undefined;
62
+ /**
63
+ * A boolean or a function to return a boolean to specify if the item is disabled.
64
+ * @defaultValue false
65
+ */
66
+ disabled?: boolean | ((...args: any) => boolean) | undefined;
67
+ /**
68
+ * A boolean or a function to return a boolean to specify if the item is visible.
69
+ * @defaultValue true
70
+ */
71
+ visible?: boolean | ((...args: any) => boolean) | undefined;
72
+ /**
73
+ * A boolean or to specify if the item has danger severity.
74
+ * @defaultValue false
75
+ */
76
+ danger?: boolean | undefined;
77
+ /**
78
+ * Defines the item as a separator.
79
+ * @defaultValue false
80
+ */
81
+ separator?: boolean | undefined;
82
+ /**
83
+ * Inline style of the menuitem.
84
+ */
85
+ style?: any;
86
+ /**
87
+ * Style class of the menuitem.
88
+ */
89
+ class?: any;
90
+ /**
91
+ * Unique identifier of an item.
92
+ */
93
+ key?: string | undefined;
94
+ /**
95
+ * Specify if the there is additional slot for the selected menuitem.
96
+ * Only work on BulkAction when BulkActionProps.selectMenuType is "dropdown".
97
+ *
98
+ */
99
+ useAdditionSlot?: boolean;
100
+ /**
101
+ * Optional
102
+ */
103
+ [key: string]: any;
104
+ }