Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Stepanov committed May 10, 2024
1 parent d12f8df commit e34b7dc
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 35 deletions.
2 changes: 1 addition & 1 deletion pages/uikit/FloatLabel.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { ref, onMounted } from 'vue';
import CountryService from '@/service/CountryService';
import {CountryService} from '@/service/CountryService';
const countries = ref([]);
const cities = ref([
Expand Down
4 changes: 2 additions & 2 deletions pages/uikit/Input.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup>
import { ref, onMounted } from 'vue';
import CountryService from '@/service/CountryService';
import NodeService from '@/service/NodeService';
import {CountryService} from '@/service/CountryService';
import {NodeService} from '@/service/NodeService';
const floatValue = ref(null);
const autoValue = ref(null);
Expand Down
2 changes: 1 addition & 1 deletion pages/uikit/InvalidState.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { ref, onMounted } from 'vue';
import CountryService from '@/service/CountryService';
import {CountryService} from '@/service/CountryService';
const countries = ref(null);
const filteredCountries = ref(null);
Expand Down
2 changes: 1 addition & 1 deletion pages/uikit/List.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { ref, onMounted } from 'vue';
import ProductService from '@/service/ProductService';
import {ProductService} from '@/service/ProductService';
const picklistValue = ref([
[
Expand Down
2 changes: 1 addition & 1 deletion pages/uikit/Overlay.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import ProductService from '@/service/ProductService';
import {ProductService} from '@/service/ProductService';
import { ref, onMounted } from 'vue';
import { useToast } from 'primevue/usetoast';
import { useConfirm } from 'primevue/useconfirm';
Expand Down
14 changes: 8 additions & 6 deletions pages/uikit/Table.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup>
import { FilterMatchMode, FilterOperator } from 'primevue/api';
import CustomerService from '@/service/CustomerService';
import ProductService from '@/service/ProductService';
import { ref, onBeforeMount } from 'vue';
import {CustomerService} from '@/service/CustomerService';
import {ProductService} from '@/service/ProductService';
import { ref, onBeforeMount, reactive } from 'vue';
const customer1 = ref(null);
const customer2 = ref(null);
Expand All @@ -13,8 +13,8 @@ const loading2 = ref(null);
const idFrozen = ref(false);
const products = ref(null);
const expandedRows = ref([]);
const statuses = ref(['unqualified', 'qualified', 'new', 'negotiation', 'renewal', 'proposal']);
const representatives = ref([
const statuses = reactive(['unqualified', 'qualified', 'new', 'negotiation', 'renewal', 'proposal']);
const representatives = reactive([
{ name: 'Amy Elsner', image: 'amyelsner.png' },
{ name: 'Anna Fali', image: 'annafali.png' },
{ name: 'Asiya Javayant', image: 'asiyajavayant.png' },
Expand Down Expand Up @@ -146,7 +146,9 @@ const calculateCustomerTotal = (name) => {
<Button type="button" icon="pi pi-filter-slash" label="Clear" outlined @click="clearFilter1()" />
<IconField iconPosition="left">
<InputIcon class="pi pi-search" />
<InputText v-model="filters1['global'].value" placeholder="Keyword Search" style="width: 100%" />
<ClientOnly>
<InputText v-model="filters1['global'].value" placeholder="Keyword Search" style="width: 100%" />
</ClientOnly>
</IconField>
</div>
</template>
Expand Down
4 changes: 2 additions & 2 deletions service/CountryService.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const CountryService = {
export class CountryService {
getData() {
return [
{ name: 'Afghanistan', code: 'AF' },
Expand Down Expand Up @@ -244,7 +244,7 @@ export const CountryService = {
{ name: 'Zambia', code: 'ZM' },
{ name: 'Zimbabwe', code: 'ZW' }
];
},
}

getCountries() {
return Promise.resolve(this.getData());
Expand Down
12 changes: 6 additions & 6 deletions service/CustomerService.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const CustomerService = {
export class CustomerService {
getData() {
return [
{
Expand Down Expand Up @@ -9002,23 +9002,23 @@ export const CustomerService = {
balance: 88090
}
];
},
}

getCustomersSmall() {
return Promise.resolve(this.getData().slice(0, 10));
},
}

getCustomersMedium() {
return Promise.resolve(this.getData().slice(0, 50));
},
}

getCustomersLarge() {
return Promise.resolve(this.getData().slice(0, 200));
},
}

getCustomersXLarge() {
return Promise.resolve(this.getData());
},
}

getCustomers(params) {
const queryParams = params
Expand Down
4 changes: 2 additions & 2 deletions service/IconService.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
let icons = [];
let selectedIcon = null;

export const IconService = {
export class IconService {
getIcons() {
return fetch('/demo/data/icons.json', { headers: { 'Cache-Control': 'no-cache' } })
.then((res) => res.json())
.then((d) => d.icons);
},
}

getIcon(id) {
if (icons) {
Expand Down
8 changes: 4 additions & 4 deletions service/NodeService.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const NodeService = {
export class NodeService {
getTreeNodesData() {
return [
{
Expand Down Expand Up @@ -66,7 +66,7 @@ export const NodeService = {
]
}
];
},
}

getTreeTableNodesData() {
return [
Expand Down Expand Up @@ -419,11 +419,11 @@ export const NodeService = {
]
}
];
},
}

getTreeTableNodes() {
return Promise.resolve(this.getTreeTableNodesData());
},
}

getTreeNodes() {
return Promise.resolve(this.getTreeNodesData());
Expand Down
4 changes: 2 additions & 2 deletions service/PhotoService.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const PhotoService = {
export class PhotoService {
getData() {
return [
{
Expand Down Expand Up @@ -92,7 +92,7 @@ export const PhotoService = {
title: 'Title 15'
}
];
},
}

getImages() {
return Promise.resolve(this.getData());
Expand Down
14 changes: 7 additions & 7 deletions service/ProductService.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const ProductService = {
export class ProductService {
getProductsData() {
return [
{
Expand Down Expand Up @@ -362,7 +362,7 @@ export const ProductService = {
rating: 8
}
];
},
}

getProductsWithOrdersData() {
return [
Expand Down Expand Up @@ -1196,23 +1196,23 @@ export const ProductService = {
]
}
];
},
}

getProductsMini() {
return Promise.resolve(this.getProductsData().slice(0, 5));
},
}

getProductsSmall() {
return Promise.resolve(this.getProductsData().slice(0, 10));
},
}

getProducts() {
return Promise.resolve(this.getProductsData());
},
}

getProductsWithOrdersSmall() {
return Promise.resolve(this.getProductsWithOrdersData().slice(0, 10));
},
}

getProductsWithOrders() {
return Promise.resolve(this.getProductsWithOrdersData());
Expand Down

0 comments on commit e34b7dc

Please sign in to comment.