@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.
- package/components/animation/Animation.vue.d.ts +32 -0
- package/components/approverinfo/ApproverInfo.vue.d.ts +51 -0
- package/components/assetinfo/AssetInfo.vue.d.ts +44 -0
- package/components/badge/Badge.vue.d.ts +73 -0
- package/components/badgegroup/BadgeGroup.vue.d.ts +54 -0
- package/components/basecomponent/index.d.ts +28 -0
- package/components/basetree/BaseTree.vue.d.ts +596 -0
- package/components/basetree/TreeNode.vue.d.ts +35 -0
- package/components/breadcrumb/Breadcrumb.vue.d.ts +26 -0
- package/components/button/Button.vue.d.ts +189 -0
- package/components/buttonImportExcel/ButtonImportExcel.vue.d.ts +35 -0
- package/components/buttonaddbyscan/ButtonAddByScan.vue.d.ts +40 -0
- package/components/buttonbulkaction/ButtonBulkAction.vue.d.ts +105 -0
- package/components/buttoncopy/ButtonCopy.vue.d.ts +26 -0
- package/components/buttondownload/ButtonDownload.vue.d.ts +80 -0
- package/components/buttonfilter/ButtonFilter.vue.d.ts +12 -0
- package/components/buttonradio/ButtonRadio.vue.d.ts +258 -0
- package/components/buttonscan/ButtonScan.vue.d.ts +202 -0
- package/components/buttonsearch/ButtonSearch.vue.d.ts +38 -0
- package/components/buttonsearchbyscan/ButtonSearchByScan.vue.d.ts +46 -0
- package/components/buttonselecttree/ButtonSelectTree.vue.d.ts +201 -0
- package/components/buttonsplit/ButtonSplit.vue.d.ts +352 -0
- package/components/buttonsync/ButtonSync.vue.d.ts +22 -0
- package/components/buttontoggle/ButtonToggle.vue.d.ts +19 -0
- package/components/buttonviewlog/ButtonViewLog.vue.d.ts +17 -0
- package/components/calendar/Calendar.vue.d.ts +598 -0
- package/components/card/Card.vue.d.ts +140 -0
- package/components/carousel/Carousel.vue.d.ts +28 -0
- package/components/checkbox/Checkbox.vue.d.ts +330 -0
- package/components/customcolumn/CustomColumn.vue.d.ts +37 -0
- package/components/datatable/DataTable.vue.d.ts +745 -0
- package/components/datepicker/DatePicker.vue.d.ts +52 -0
- package/components/daypicker/DayPicker.vue.d.ts +52 -0
- package/components/dialog/Dialog.vue.d.ts +465 -0
- package/components/dialogassetnamedetail/DialogAssetNameDetail.vue.d.ts +46 -0
- package/components/dialogassetnamedetail/options/columns.d.ts +2 -0
- package/components/dialogassetnamedetail/options/filter.d.ts +2 -0
- package/components/dialogconfirm/DialogConfirm.vue.d.ts +165 -0
- package/components/dialogform/DialogForm.vue.d.ts +350 -0
- package/components/dialoglinkedasset/DialogLinkedAsset.vue.d.ts +106 -0
- package/components/dialogprintqr/DialogPrintQR.vue.d.ts +18 -0
- package/components/dialogreportdamage/DialogReportDamage.vue.d.ts +34 -0
- package/components/dialogreportmissing/DialogReportMissing.vue.d.ts +33 -0
- package/components/dialogreporttag/DialogReportTag.vue.d.ts +31 -0
- package/components/dialogselecttree/DialogSelectTree.vue.d.ts +137 -0
- package/components/dialogselectuser/DialogSelectUser.vue.d.ts +102 -0
- package/components/dialogselectuser/options/columns.d.ts +3 -0
- package/components/dialogtransferlog/DialogTransferLog.vue.d.ts +16 -0
- package/components/dropdown/Dropdown.vue.d.ts +288 -0
- package/components/editor/Editor.vue.d.ts +192 -0
- package/components/fieldwrapper/FieldWrapper.vue.d.ts +86 -0
- package/components/fileupload/FileUpload.vue.d.ts +170 -0
- package/components/filtercontainer/FilterContainer.vue.d.ts +217 -0
- package/components/form/Form.vue.d.ts +319 -0
- package/components/icon/Icon.vue.d.ts +260 -0
- package/components/image/Image.vue.d.ts +411 -0
- package/components/imagecompressor/ImageCompressor.vue.d.ts +237 -0
- package/components/index.d.ts +83 -0
- package/components/inlinemessage/InlineMessage.vue.d.ts +167 -0
- package/components/inputbadge/InputBadge.vue.d.ts +122 -0
- package/components/inputcurrency/InputCurrency.vue.d.ts +170 -0
- package/components/inputcurrency/helpers/currency.helper.d.ts +8 -0
- package/components/inputemail/InputEmail.vue.d.ts +26 -0
- package/components/inputnumber/InputNumber.vue.d.ts +288 -0
- package/components/inputotp/InputOtp.vue.d.ts +3 -0
- package/components/inputpassword/InputPassword.vue.d.ts +33 -0
- package/components/inputphonenumber/InputPhoneNumber.vue.d.ts +99 -0
- package/components/inputrangenumber/InputRangeNumber.vue.d.ts +121 -0
- package/components/inputsearch/InputSearch.vue.d.ts +36 -0
- package/components/inputtext/InputText.vue.d.ts +353 -0
- package/components/inputurl/InputURL.vue.d.ts +41 -0
- package/components/invisiblefield/InvisibleField.vue.d.ts +32 -0
- package/components/languagedropdown/LanguageDropdown.vue.d.ts +33 -0
- package/components/languageswitcher/LanguageSwitcher.vue.d.ts +15 -0
- package/components/litedropdown/LiteDropdown.vue.d.ts +98 -0
- package/components/loading/Loading.vue.d.ts +47 -0
- package/components/loading/store/loading.store.d.ts +8 -0
- package/components/menu/Menu.vue.d.ts +391 -0
- package/components/menuitem/index.d.ts +106 -0
- package/components/multiselect/MultiSelect.vue.d.ts +195 -0
- package/components/overlaypanel/OverlayPanel.vue.d.ts +302 -0
- package/components/paginator/Paginator.vue.d.ts +285 -0
- package/components/passthrough/index.d.ts +16 -0
- package/components/steps/Steps.vue.d.ts +20 -0
- package/components/tabmenu/TabMenu.vue.d.ts +104 -0
- package/components/tagtype/TagType.vue.d.ts +26 -0
- package/components/textarea/Textarea.vue.d.ts +171 -0
- package/components/timeline/Timeline.vue.d.ts +140 -0
- package/components/toast/Toast.vue.d.ts +368 -0
- package/components/toggleswitch/ToggleSwitch.vue.d.ts +282 -0
- package/components/transactionroles/TransactionRoles.vue.d.ts +58 -0
- package/components/tree/Tree.vue.d.ts +151 -0
- package/components/tree/helpers/filterNodeKeys.helper.d.ts +22 -0
- package/components/tree/helpers/flattenTreeNodeChildren.helper.d.ts +8 -0
- package/components/treesearchinput/TreeSearchInput.vue.d.ts +16 -0
- package/components/ts-helpers.d.ts +91 -0
- package/components/username/UserName.vue.d.ts +123 -0
- package/components/userwithicon/UserWithIcon.vue.d.ts +21 -0
- package/components/validatormessage/ValidatorMessage.vue.d.ts +12 -0
- package/config/defaultProps.d.ts +3 -0
- package/config/index.d.ts +3 -0
- package/config/locale.d.ts +3 -0
- package/directives/focus.d.ts +7 -0
- package/directives/index.d.ts +1 -0
- package/event-bus/index.d.ts +66 -0
- package/event-bus/mitt.d.ts +41 -0
- package/loading-page-BrQattYE.js +1 -0
- package/loading-page-CgfbWppy.js +1 -0
- package/loading-page-CoC9UhfC.js +4 -0
- package/loading-page-CoXtqoc9.js +4 -0
- package/loading-page-DbLuqCHa.js +1 -0
- package/loading-page-f8D03l3G.js +4 -0
- package/loading-plane-CgfbWppy.js +1 -0
- package/loading-plane-CoXtqoc9.js +4 -0
- package/loading-table-Bdr9ZhtP.js +1 -0
- package/loading-table-ByUoWqUo.js +4 -0
- package/loading-table-BygEMzFM.js +4 -0
- package/loading-table-BzrSQlA0.js +1 -0
- package/loading-table-D9bw9OcI.js +4 -0
- package/loading-table-chOgXi94.js +1 -0
- package/main.d.ts +34 -0
- package/no-data-CTKux8RI.js +4 -0
- package/no-data-Cgze_Rvp.js +1 -0
- package/no-data-DLHO1L_u.js +4 -0
- package/no-data-Dep79CBh.js +1 -0
- package/no-data-g0dJCy2p.js +4 -0
- package/no-data-y1X5WtcQ.js +1 -0
- package/package.json +27 -0
- package/plugins/VueHtmlToPaper.d.ts +11 -0
- package/plugins/WangsVue.d.ts +311 -0
- package/plugins/formValidation.d.ts +20 -0
- package/plugins/i18n-extension.d.ts +4 -0
- package/plugins/i18n.d.ts +103 -0
- package/stats.html +4949 -0
- package/style.css +1 -0
- package/utils/date.util.d.ts +79 -0
- package/utils/exportToExcel.util.d.ts +27 -0
- package/utils/formatTagCode.util.d.ts +1 -0
- package/utils/getStatusSeverity.util.d.ts +33 -0
- package/utils/index.d.ts +9 -0
- package/utils/isBasic.util.d.ts +1 -0
- package/utils/listenSidebarChanges.util.d.ts +16 -0
- package/utils/object.util.d.ts +27 -0
- package/utils/role.util.d.ts +70 -0
- package/utils/toast.util.d.ts +120 -0
- package/utils/xlsx.util.d.ts +19 -0
- package/wangsvue-fats.js +57238 -0
- package/wangsvue-fats.system.js +427 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ClassComponent } from '../../components/ts-helpers.d';
|
|
2
|
+
|
|
3
|
+
export interface DialogReportTagProps {
|
|
4
|
+
id: string;
|
|
5
|
+
tagReported?: ReportTagBody;
|
|
6
|
+
visible?: boolean;
|
|
7
|
+
successMessage?: string;
|
|
8
|
+
submitLabel?: string;
|
|
9
|
+
submitWithoutApi?: boolean;
|
|
10
|
+
submitFunction?: (
|
|
11
|
+
body: ReportTagBody,
|
|
12
|
+
) => Promise<{ status?: number; message?: string } | undefined>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type DialogReportTagEmits = {
|
|
16
|
+
'update:visible': [value: boolean];
|
|
17
|
+
'reported': [payload?: ReportTagBody];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type ReportTagBody = {
|
|
21
|
+
qr: boolean;
|
|
22
|
+
rfid: boolean;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
declare class DialogReportTag extends ClassComponent<
|
|
26
|
+
DialogReportTagProps,
|
|
27
|
+
unknown,
|
|
28
|
+
DialogReportTagEmits
|
|
29
|
+
> {}
|
|
30
|
+
|
|
31
|
+
export default DialogReportTag;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { TreeSelectionKeys } from 'primevue/tree';
|
|
2
|
+
import { Slot } from 'vue';
|
|
3
|
+
|
|
4
|
+
import { TreeNode } from '../basetree/BaseTree.vue.d';
|
|
5
|
+
import { QueryParams, ShortFetchResponse } from '../datatable/DataTable.vue.d';
|
|
6
|
+
import TreeInstance, { TreeProps } from '../tree/Tree.vue.d';
|
|
7
|
+
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
8
|
+
|
|
9
|
+
export interface DialogSelectTreeProps
|
|
10
|
+
extends Omit<TreeProps, 'type' | 'filter'> {
|
|
11
|
+
fetchTree?: (
|
|
12
|
+
type: 'group' | 'category',
|
|
13
|
+
params?: QueryParams,
|
|
14
|
+
) => Promise<ShortFetchResponse<TreeNode> | undefined>;
|
|
15
|
+
params?: QueryParams;
|
|
16
|
+
visible?: boolean;
|
|
17
|
+
type?: 'group' | 'category';
|
|
18
|
+
/**
|
|
19
|
+
* Specify wether the all tree node should be auto checked once it rendered.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
autoSelectAll?: boolean;
|
|
23
|
+
header?: string;
|
|
24
|
+
subHeader?: string;
|
|
25
|
+
selectionMode?: 'single' | 'checkbox';
|
|
26
|
+
/**
|
|
27
|
+
* Current behavior is preventing select if there is no node selected.
|
|
28
|
+
*
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
allowEmptySelection?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The previously selected tree key to be displayed again.
|
|
34
|
+
*/
|
|
35
|
+
keys?: number[];
|
|
36
|
+
/**
|
|
37
|
+
* The lists to be displayed in the dialog.
|
|
38
|
+
*/
|
|
39
|
+
lists?: (string | object)[];
|
|
40
|
+
/**
|
|
41
|
+
* The label of the list if your list item is an object.
|
|
42
|
+
* Choose a property from the item to be displayed on the list.
|
|
43
|
+
*/
|
|
44
|
+
listLabel?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Disable node 'All' selection
|
|
47
|
+
*/
|
|
48
|
+
disableNodeAll?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated
|
|
51
|
+
*/
|
|
52
|
+
exactDisableKey?: number;
|
|
53
|
+
/**
|
|
54
|
+
* A list of node keys that should be disabled along with their children.
|
|
55
|
+
*/
|
|
56
|
+
disableKeys?: number[];
|
|
57
|
+
/**
|
|
58
|
+
* A list of node keys that should be disabled, affecting only the specified nodes and not their children.
|
|
59
|
+
*/
|
|
60
|
+
exactDisableKeys?: number[];
|
|
61
|
+
/**
|
|
62
|
+
* Defines the tree is readonly and disabled.
|
|
63
|
+
*/
|
|
64
|
+
readonly?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Defines the group tree to showing disposable groups.
|
|
67
|
+
*/
|
|
68
|
+
showDisposableGroups?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Defines the tree to be flattened and shows disposable only
|
|
71
|
+
*/
|
|
72
|
+
flattenDisposableNode?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Defines the group tree to disable excluded keys
|
|
75
|
+
*/
|
|
76
|
+
excludedKeys?: number[];
|
|
77
|
+
/**
|
|
78
|
+
* Render hidden dialog to trigger fetch tree
|
|
79
|
+
*/
|
|
80
|
+
hidden?: boolean;
|
|
81
|
+
|
|
82
|
+
propagateSelection?: boolean;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type TreeSelectPayload = {
|
|
86
|
+
keys: TreeSelectionKeys | undefined;
|
|
87
|
+
selectedNodes: TreeNode[] | undefined;
|
|
88
|
+
singleNode: TreeNode | undefined;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export type DialogSelectTreeEmits = {
|
|
92
|
+
select: [keys?: TreeSelectPayload];
|
|
93
|
+
hide: [];
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export interface DialogSelectTreeSlots {
|
|
97
|
+
header: Slot<{
|
|
98
|
+
dialogHeader: string;
|
|
99
|
+
subHeader?: string;
|
|
100
|
+
lists?: (string | object)[];
|
|
101
|
+
listLabel?: string;
|
|
102
|
+
isLoading: boolean;
|
|
103
|
+
filter: string;
|
|
104
|
+
updateFilter: (newFilter?: string) => void; // Hooks to update internal state filter
|
|
105
|
+
}>;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Slot to customize tree node item
|
|
109
|
+
*/
|
|
110
|
+
treenode: Slot<{ node: TreeNode; checked: boolean; disabled: boolean }>;
|
|
111
|
+
|
|
112
|
+
footer: Slot;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* **TSVue v2 - DialogSelectTree**
|
|
117
|
+
*
|
|
118
|
+
* --- ---
|
|
119
|
+
* 
|
|
120
|
+
*
|
|
121
|
+
* @group components
|
|
122
|
+
*/
|
|
123
|
+
declare class DialogSelectTree extends ClassComponent<
|
|
124
|
+
DialogSelectTreeProps,
|
|
125
|
+
DialogSelectTreeSlots,
|
|
126
|
+
DialogSelectTreeEmits
|
|
127
|
+
> {
|
|
128
|
+
treeComponent: TreeInstance;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
declare module '@vue/runtime-core' {
|
|
132
|
+
interface GlobalComponents {
|
|
133
|
+
DialogSelectTree: GlobalComponentConstructor<DialogSelectTree>;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export default DialogSelectTree;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { FetchListResponse } from '@fewangsit/workspace-api-services/src/types/fetchResponse.type';
|
|
2
|
+
import { FetchUserRoleOptionResponse } from '@tagsamurai/fats-api-services/src/dto/role.dto';
|
|
3
|
+
import { User } from '@tagsamurai/fats-api-services/src/types/user.type';
|
|
4
|
+
|
|
5
|
+
import { QueryParams } from '../../components/datatable/DataTable.vue.d';
|
|
6
|
+
import { ClassComponent } from '../../components/ts-helpers';
|
|
7
|
+
|
|
8
|
+
export type EmitSelectionValue = {
|
|
9
|
+
checkbox: User[];
|
|
10
|
+
single: User;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type SelectionType = 'single' | 'checkbox';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Props for DialogSelectUser component
|
|
17
|
+
*/
|
|
18
|
+
export interface DialogSelectUserProps {
|
|
19
|
+
/**
|
|
20
|
+
* The header of the dialog.
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue "Select User"
|
|
23
|
+
*/
|
|
24
|
+
header?: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The description of the table.
|
|
28
|
+
*
|
|
29
|
+
* @defaultValue "Select user"
|
|
30
|
+
*/
|
|
31
|
+
description?: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Table's selection type
|
|
35
|
+
*/
|
|
36
|
+
selectionType: SelectionType;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Specifies the visibility of the dialog.
|
|
40
|
+
* @defaultValue false
|
|
41
|
+
*/
|
|
42
|
+
visible?: boolean | undefined;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* List that will be show above the table
|
|
46
|
+
* @defaultValue undefined
|
|
47
|
+
*/
|
|
48
|
+
list?: string[];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Set custom button select label
|
|
52
|
+
*/
|
|
53
|
+
selectButtonLabel?: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The function to fetch data on DataTable mounted and on queryParams dependencies updated.
|
|
57
|
+
*
|
|
58
|
+
* @param params this is required
|
|
59
|
+
*/
|
|
60
|
+
fetchFunction?: (
|
|
61
|
+
params: QueryParams,
|
|
62
|
+
) => Promise<FetchListResponse | undefined>;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The function to fetch options on DialogSelectUserFilter.
|
|
66
|
+
*
|
|
67
|
+
*/
|
|
68
|
+
fetchOptionFunction?: () => Promise<
|
|
69
|
+
FetchUserRoleOptionResponse['data'] | undefined
|
|
70
|
+
>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Emits for DialogSelectUser component
|
|
75
|
+
*/
|
|
76
|
+
export type DialogSelectUserEmits<T = User> = {
|
|
77
|
+
/**
|
|
78
|
+
* Emits when the dialog is closed. Wether from cancel button, close button, or ESC button pressed.
|
|
79
|
+
*/
|
|
80
|
+
'update:visible': [state: boolean];
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Emits when you done selected user.
|
|
84
|
+
*/
|
|
85
|
+
'selected': [user: T];
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* **TSVue - DialogSelectUser**
|
|
90
|
+
*
|
|
91
|
+
* --- ---
|
|
92
|
+
* 
|
|
93
|
+
*
|
|
94
|
+
* @group components
|
|
95
|
+
*/
|
|
96
|
+
declare const DialogSelectUser: ClassComponent<
|
|
97
|
+
DialogSelectUserProps,
|
|
98
|
+
unknown,
|
|
99
|
+
DialogSelectUserEmits
|
|
100
|
+
>;
|
|
101
|
+
|
|
102
|
+
export default DialogSelectUser;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ClassComponent } from '../../components/ts-helpers.d';
|
|
2
|
+
|
|
3
|
+
// You need to provide requestIds with Ref<string[]> to enable prev and next buttons
|
|
4
|
+
|
|
5
|
+
export interface DialogTransferLogProps {
|
|
6
|
+
id: string;
|
|
7
|
+
visible?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare class DialogTransferLog extends ClassComponent<
|
|
11
|
+
DialogTransferLogProps,
|
|
12
|
+
unknown,
|
|
13
|
+
unknown
|
|
14
|
+
> {}
|
|
15
|
+
|
|
16
|
+
export default DialogTransferLog;
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { Slot } from 'vue';
|
|
2
|
+
|
|
3
|
+
import { BadgeProps } from '../../components/badge/Badge.vue.d';
|
|
4
|
+
import { WangsIcons } from '../../components/icon/Icon.vue.d';
|
|
5
|
+
|
|
6
|
+
import { CustomValidation } from '../form/Form.vue.d';
|
|
7
|
+
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
8
|
+
|
|
9
|
+
export type OptionValue = string | number | boolean | Record<string, any>;
|
|
10
|
+
|
|
11
|
+
export type Option = {
|
|
12
|
+
label?: string;
|
|
13
|
+
value?: OptionValue;
|
|
14
|
+
visible?: boolean;
|
|
15
|
+
icon?: WangsIcons;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Configuration interface for localizing dropdown component placeholders and error messages.
|
|
21
|
+
*/
|
|
22
|
+
export interface DropdownLocaleConfig {
|
|
23
|
+
/**
|
|
24
|
+
* Placeholder text for the filter input field.
|
|
25
|
+
*
|
|
26
|
+
* @default undefined
|
|
27
|
+
*/
|
|
28
|
+
filterPlaceholder?: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Placeholder text displayed while the dropdown is loading.
|
|
32
|
+
*
|
|
33
|
+
* @example 'Loading...'
|
|
34
|
+
* @default undefined
|
|
35
|
+
*/
|
|
36
|
+
loadingPlaceholder?: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Placeholder text for the input field when no selection has been made.
|
|
40
|
+
*
|
|
41
|
+
* This text can include a placeholder `{label}` which will be replaced with the value of `props.label`.
|
|
42
|
+
*
|
|
43
|
+
* @example 'Select {label}' - If `props.label` is 'Option', the placeholder will be 'Select Option'.
|
|
44
|
+
* @example 'Select {lowercaseLabel}' - If `props.label` is 'Option', the placeholder will be 'Select option'.
|
|
45
|
+
* @default undefined
|
|
46
|
+
*/
|
|
47
|
+
inputPlaceholder?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Error message displayed when no selection has been made.
|
|
51
|
+
*
|
|
52
|
+
* This message can include placeholders:
|
|
53
|
+
* - `{label}`: Replaced with the value of `props.label`.
|
|
54
|
+
* - `{formattedLabel}`: Replaced with the value of `props.label` formatted with an appropriate article (a/an).
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* // If `props.label` is 'Label', the error message will be:
|
|
58
|
+
* '{label} must be picked' - 'Label must be picked'
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* // If `props.label` is 'user', the error message will be:
|
|
62
|
+
* 'You must pick {formattedLabel}' - 'You must pick a user'
|
|
63
|
+
*
|
|
64
|
+
* @default undefined
|
|
65
|
+
*/
|
|
66
|
+
emptySelectionErrorMessage?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Dropdown component props
|
|
71
|
+
*/
|
|
72
|
+
export interface DropdownProps {
|
|
73
|
+
/**
|
|
74
|
+
* Don't use modelValue with useValidator at the same time.
|
|
75
|
+
* It may lead unexpected behavior.
|
|
76
|
+
*/
|
|
77
|
+
modelValue?: OptionValue;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* If you deals with form validation on edit form action, you can set the initial value of the field.
|
|
81
|
+
*/
|
|
82
|
+
initialValue?: OptionValue;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The input label. Tell the user what input is this.
|
|
86
|
+
*/
|
|
87
|
+
label?: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* List of options to display.
|
|
91
|
+
*/
|
|
92
|
+
options?: Option[] | string[] | Record<string, any>;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Allows `null` to be treated as a valid selectable option in the dropdown.
|
|
96
|
+
*
|
|
97
|
+
* When enabled, `null` can be included in the options list and selected by the user.
|
|
98
|
+
*/
|
|
99
|
+
allowNullOption?: boolean;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Specify the property name of option to be used as label.
|
|
103
|
+
*
|
|
104
|
+
* @default undefined - the label will be sets to the option itself.
|
|
105
|
+
*/
|
|
106
|
+
optionLabel?: string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Specify the property name of option to be used as value.
|
|
110
|
+
*
|
|
111
|
+
* @default undefined - the value will be sets to the option itself.
|
|
112
|
+
*/
|
|
113
|
+
optionValue?: string;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Define the value style, whether badge or plain text
|
|
117
|
+
*
|
|
118
|
+
* @default 'plain'
|
|
119
|
+
*/
|
|
120
|
+
valueType?: 'badge' | 'plain';
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Bind the badge property to the dropdown value
|
|
124
|
+
*/
|
|
125
|
+
badgeValueProps?: Omit<BadgeProps, 'label'>;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Set the input border style
|
|
129
|
+
*
|
|
130
|
+
* @default 'default'
|
|
131
|
+
*/
|
|
132
|
+
inputBorder?: 'none' | 'default';
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* A property to uniquely identify an option.
|
|
136
|
+
*/
|
|
137
|
+
dataKey?: string | undefined;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Determines if the field uses a validator
|
|
141
|
+
*/
|
|
142
|
+
useValidator?: boolean;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Determines if the field is mandatory
|
|
146
|
+
*/
|
|
147
|
+
mandatory?: boolean;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Show the text (opsional)
|
|
151
|
+
*
|
|
152
|
+
* @default true if mandatory true
|
|
153
|
+
*/
|
|
154
|
+
showOptionalText?: boolean;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Set custom validator message.
|
|
158
|
+
* It is rarely use, this component has handled the validator message.
|
|
159
|
+
*
|
|
160
|
+
*
|
|
161
|
+
* @example: 'This field is required'
|
|
162
|
+
* @example: { empty: 'This field is required' }
|
|
163
|
+
*/
|
|
164
|
+
validatorMessage?: string | CustomValidation<'empty'>;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Wether to format the message
|
|
168
|
+
*
|
|
169
|
+
* @default true
|
|
170
|
+
*/
|
|
171
|
+
formatValidatorMessage?: boolean;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Set custom invalid state.
|
|
175
|
+
*/
|
|
176
|
+
invalid?: boolean;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* This prop is required if you use this component in a form input.
|
|
180
|
+
* Specify the unique field name, match with your needs for API request.
|
|
181
|
+
*
|
|
182
|
+
* @default 'dropdown'
|
|
183
|
+
*/
|
|
184
|
+
fieldName?: string;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Default text to display when no option is selected.
|
|
188
|
+
*
|
|
189
|
+
* @default `Select ${label}`
|
|
190
|
+
*/
|
|
191
|
+
placeholder?: string;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Whether the dropdown is in loading state.
|
|
195
|
+
* @defaultValue false
|
|
196
|
+
*/
|
|
197
|
+
loading?: boolean;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Show icon 'info' on the right side of label.
|
|
201
|
+
* Show information to user about the field on icon hover.
|
|
202
|
+
*/
|
|
203
|
+
fieldInfo?: string;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Set disabled state for input dropdown.
|
|
207
|
+
*/
|
|
208
|
+
disabled?: boolean;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Whether show the Dropdown option search or not.
|
|
212
|
+
*
|
|
213
|
+
* @default true,
|
|
214
|
+
*/
|
|
215
|
+
filter?: boolean;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* The filter input Placeholder
|
|
219
|
+
*
|
|
220
|
+
* @default 'Search'
|
|
221
|
+
*/
|
|
222
|
+
filterPlaceholder?: string;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* To determine whether dropdown panel width should fit its max content or not
|
|
226
|
+
*
|
|
227
|
+
* @default false
|
|
228
|
+
*/
|
|
229
|
+
panelMaxContent?: boolean;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export interface DropdownSlots {
|
|
233
|
+
'value': Slot<{ value: string; originalValue: any }>;
|
|
234
|
+
'option': Slot<{ option: Option }>;
|
|
235
|
+
'addon-left': Slot;
|
|
236
|
+
'addon-right': Slot;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Dropdown component emits
|
|
241
|
+
*/
|
|
242
|
+
export type DropdownEmits = {
|
|
243
|
+
/**
|
|
244
|
+
* Emits when an option selected.
|
|
245
|
+
*/
|
|
246
|
+
'update:modelValue': [value: OptionValue | undefined];
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Emits when overlay shown.
|
|
250
|
+
*/
|
|
251
|
+
'show': [];
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Emits when the Field Info icon is clicked.
|
|
255
|
+
*/
|
|
256
|
+
'fieldInfoClick': [];
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* **WangsVue - Dropdown**
|
|
261
|
+
*
|
|
262
|
+
* _Dropdown also known as Select, is used to choose an item from a collection of options._
|
|
263
|
+
*
|
|
264
|
+
* --- ---
|
|
265
|
+
* 
|
|
266
|
+
*
|
|
267
|
+
* @group Component
|
|
268
|
+
*/
|
|
269
|
+
declare class Dropdown extends ClassComponent<
|
|
270
|
+
DropdownProps,
|
|
271
|
+
DropdownSlots,
|
|
272
|
+
DropdownEmits
|
|
273
|
+
> {
|
|
274
|
+
/**
|
|
275
|
+
* Shows the overlay.
|
|
276
|
+
*
|
|
277
|
+
* @memberof MultiSelect
|
|
278
|
+
*/
|
|
279
|
+
showOverlay(): void;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
declare module '@vue/runtime-core' {
|
|
283
|
+
interface GlobalComponents {
|
|
284
|
+
Dropdown: GlobalComponentConstructor<Dropdown>;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export default Dropdown;
|