diff --git a/app/javascript/dashboard/components-next/Contacts/ContactHeader/ContactActions.vue b/app/javascript/dashboard/components-next/Contacts/ContactHeader/ContactActions.vue
new file mode 100644
index 000000000..b79f4783e
--- /dev/null
+++ b/app/javascript/dashboard/components-next/Contacts/ContactHeader/ContactActions.vue
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/dashboard/components-next/Contacts/ContactHeader/ContactSortMenu.vue b/app/javascript/dashboard/components-next/Contacts/ContactHeader/ContactSortMenu.vue
new file mode 100644
index 000000000..45d1bee0b
--- /dev/null
+++ b/app/javascript/dashboard/components-next/Contacts/ContactHeader/ContactSortMenu.vue
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+ {{ t('CONTACTS_LAYOUT.HEADER.ACTIONS.SORT_BY.LABEL') }}
+
+
+
+
+
+ {{ t('CONTACTS_LAYOUT.HEADER.ACTIONS.ORDER.LABEL') }}
+
+
+
+
+
+
diff --git a/app/javascript/dashboard/components-next/Contacts/ContactsLayout.vue b/app/javascript/dashboard/components-next/Contacts/ContactsLayout.vue
index 2c4eca902..568eab6d7 100644
--- a/app/javascript/dashboard/components-next/Contacts/ContactsLayout.vue
+++ b/app/javascript/dashboard/components-next/Contacts/ContactsLayout.vue
@@ -2,11 +2,11 @@
import { computed, useSlots } from 'vue';
import { useI18n } from 'vue-i18n';
-import Button from 'dashboard/components-next/button/Button.vue';
import Input from 'dashboard/components-next/input/Input.vue';
import Icon from 'dashboard/components-next/icon/Icon.vue';
import PaginationFooter from 'dashboard/components-next/pagination/PaginationFooter.vue';
import Breadcrumb from 'dashboard/components-next/breadcrumb/Breadcrumb.vue';
+import ContactActions from 'dashboard/components-next/Contacts/ContactHeader/ContactActions.vue';
const props = defineProps({
headerTitle: {
@@ -41,6 +41,14 @@ const props = defineProps({
type: Object,
default: () => ({}),
},
+ activeSort: {
+ type: String,
+ default: '',
+ },
+ activeOrdering: {
+ type: String,
+ default: '',
+ },
});
const emit = defineEmits([
@@ -50,6 +58,7 @@ const emit = defineEmits([
'update:currentPage',
'goToContactsList',
'search',
+ 'sort',
]);
const { t } = useI18n();
@@ -116,7 +125,9 @@ const updateCurrentPage = page => {
@@ -127,21 +138,16 @@ const updateCurrentPage = page => {
-
-
-
diff --git a/app/javascript/dashboard/components-next/input/Input.vue b/app/javascript/dashboard/components-next/input/Input.vue
index 00402443b..458d2b6f2 100644
--- a/app/javascript/dashboard/components-next/input/Input.vue
+++ b/app/javascript/dashboard/components-next/input/Input.vue
@@ -1,5 +1,5 @@
@@ -89,7 +101,10 @@ const handleInput = event => {
:class="[
customInputClass,
inputBorderClass,
- { error: messageType === 'error' },
+ {
+ error: messageType === 'error',
+ focus: isFocused,
+ },
]"
:type="type"
:placeholder="placeholder"
@@ -97,7 +112,8 @@ const handleInput = event => {
:min="['date', 'datetime-local', 'time'].includes(type) ? min : undefined"
class="block w-full reset-base text-sm h-10 !px-3 !py-2.5 !mb-0 border rounded-lg bg-n-alpha-black2 file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-n-slate-10 dark:placeholder:text-n-slate-10 disabled:cursor-not-allowed disabled:opacity-50 text-n-slate-12 transition-all duration-500 ease-in-out"
@input="handleInput"
- @blur="emit('blur')"
+ @focus="handleFocus"
+ @blur="handleBlur"
/>
+import { ref } from 'vue';
+import SelectMenu from './SelectMenu.vue';
+
+const sampleOptions = [
+ { label: 'Option 1', value: 'option1' },
+ { label: 'Option 2', value: 'option2' },
+ { label: 'Option 3', value: 'option3' },
+ { label: 'Option 4', value: 'option4' },
+];
+
+const selectedValue = ref('option1');
+
+
+
+
+
+
+
+
Selected value: {{ selectedValue }}
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/dashboard/components-next/selectmenu/SelectMenu.vue b/app/javascript/dashboard/components-next/selectmenu/SelectMenu.vue
new file mode 100644
index 000000000..38104243c
--- /dev/null
+++ b/app/javascript/dashboard/components-next/selectmenu/SelectMenu.vue
@@ -0,0 +1,69 @@
+
+
+
+
+
diff --git a/app/javascript/dashboard/i18n/locale/en/contact.json b/app/javascript/dashboard/i18n/locale/en/contact.json
index 3cdd9e575..a0610396d 100644
--- a/app/javascript/dashboard/i18n/locale/en/contact.json
+++ b/app/javascript/dashboard/i18n/locale/en/contact.json
@@ -394,6 +394,28 @@
"MESSAGE_BUTTON": "Message",
"BREADCRUMB": {
"CONTACTS": "Contacts"
+ },
+ "ACTIONS": {
+ "SORT_BY": {
+ "LABEL": "Sort by",
+ "OPTIONS": {
+ "NAME": "Name",
+ "EMAIL": "Email",
+ "PHONE_NUMBER": "Phone number",
+ "COMPANY": "Company",
+ "COUNTRY": "Country",
+ "CITY": "City",
+ "LAST_ACTIVITY": "Last activity",
+ "CREATED_AT": "Created at"
+ }
+ },
+ "ORDER": {
+ "LABEL": "Ordering",
+ "OPTIONS": {
+ "ASCENDING": "Ascending",
+ "DESCENDING": "Descending"
+ }
+ }
}
},
"CARD": {
diff --git a/app/javascript/dashboard/routes/dashboard/contact/pages/ContactsPageRouteView.vue b/app/javascript/dashboard/routes/dashboard/contact/pages/ContactsPageRouteView.vue
index 05b4e87c0..854590495 100644
--- a/app/javascript/dashboard/routes/dashboard/contact/pages/ContactsPageRouteView.vue
+++ b/app/javascript/dashboard/routes/dashboard/contact/pages/ContactsPageRouteView.vue
@@ -1,13 +1,18 @@
@@ -67,8 +114,11 @@ const updateCurrentPage = page => {
:current-page="currentPage"
:total-items="totalItems"
:show-pagination-footer="!isFetchingList && searchValue === ''"
+ :active-sort="activeSort"
+ :active-ordering="activeOrdering"
@update:current-page="updateCurrentPage"
@search="searchContacts"
+ @sort="handleSort"
>
{
app.use(store);
app.use(i18n);
app.directive('resize', vResizeObserver);
+ app.directive('onClickaway', onClickaway);
});