diff --git a/apps/web/src/common/modules/user/UserSelectDropdown.vue b/apps/web/src/common/modules/user/UserSelectDropdown.vue index 75d508a833..352691532d 100644 --- a/apps/web/src/common/modules/user/UserSelectDropdown.vue +++ b/apps/web/src/common/modules/user/UserSelectDropdown.vue @@ -37,13 +37,16 @@ const props = withDefaults(defineProps<{ selectedId?: string; selectedIds?: string[]; selectionType?: 'single'|'multiple'; + appearanceType?: 'badge'|'stack'; + styleType?: string; + block?: boolean; useFixedMenuStyle?: boolean; + selectionLabel?: string; invalid?: boolean; disabled?: boolean; readonly?: boolean; userPool?: string[]; userGroupPool?: string[]; - appearanceType?: 'badge'|'stack'; showUserList?: boolean; showUserGroupList?: boolean; showCategoryTitle?: boolean; @@ -53,12 +56,16 @@ const props = withDefaults(defineProps<{ selectedId: undefined, selectedIds: undefined, selectionType: 'single', + appearanceType: 'stack', + styleType: undefined, + block: undefined, useFixedMenuStyle: false, + selectionLabel: undefined, invalid: false, disabled: false, + readonly: false, userPool: undefined, userGroupPool: undefined, - appearanceType: 'badge', showUserList: true, showUserGroupList: true, showCategoryTitle: true, @@ -134,7 +141,7 @@ const state = reactive({ const checkUserGroup = (id: string): boolean => state.allUserGroupItems.some((i) => i.name === id); const menuItemsHandler = (): AutocompleteHandler => async (keyword: string, pageStart = 1, pageLimit = 10, filters, resultIndex) => { - const _totalCount = pageStart - 1 + pageLimit; + const _totalCount = Number((pageStart - 1 || 0) + pageLimit); const filterItems = (items: SelectDropdownMenuItem[]) => items.filter((item) => getTextHighlightRegex(keyword).test(item.name)).slice(pageStart - 1, _totalCount); if (resultIndex === undefined) { @@ -149,7 +156,7 @@ const menuItemsHandler = (): AutocompleteHandler => async (keyword: string, page } return { results: _slicedItems, - more: _totalCount < items.length, + more: pageLimit <= _slicedItems.length - 1 && _totalCount < items.length, }; }); } @@ -160,7 +167,7 @@ const menuItemsHandler = (): AutocompleteHandler => async (keyword: string, page if (i !== resultIndex) return { results: [], title: c.title }; return { results: _slicedItems, - more: _totalCount < items.length, + more: pageLimit <= _slicedItems.length - 1 && _totalCount < items.length, }; }); }; @@ -248,20 +255,23 @@ watch([() => props.selectedId, () => props.selectedIds], ([newUserId, newUserIds