@appscode/design-system 1.0.3-alpha.7 → 1.0.43-alpha.12
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/base/utilities/_default.scss +24 -4
- package/base/utilities/_derived-variables.scss +2 -2
- package/base/utilities/_initial-variables.scss +35 -22
- package/base/utilities/_mixin.scss +96 -9
- package/components/_ac-alert-box.scss +30 -2
- package/components/_ac-input.scss +70 -3
- package/components/_ac-multi-select.scss +25 -5
- package/components/_ac-table.scss +52 -17
- package/components/_ac-tags.scss +1 -1
- package/components/_breadcumb.scss +2 -2
- package/components/_buttons.scss +26 -6
- package/components/_left-sidebar-menu.scss +8 -2
- package/components/_navbar.scss +1 -1
- package/components/_pagination.scss +36 -6
- package/components/_preloader.scss +1 -1
- package/components/_wizard.scss +1 -1
- package/components/ac-toaster/_ac-toasted.scss +36 -4
- package/components/bbum/_information-center.scss +2 -2
- package/components/bbum/_user-profile.scss +1 -1
- package/components/ui-builder/_ui-builder.scss +2 -2
- package/layouts/_404.scss +158 -0
- package/layouts/_code-preview.scss +1 -0
- package/package.json +1 -1
- package/plugins/vue-toaster.js +7 -6
- package/vue-components/v2/card/CardContent.vue +5 -0
- package/vue-components/v2/card/CardHeader.vue +12 -0
- package/vue-components/v2/card/OverviewCard.vue +10 -0
- package/vue-components/v2/card/OverviewCards.vue +5 -0
- package/vue-components/v2/card/PaymentCards.vue +6 -9
- package/vue-components/v2/content/ContentHeader.vue +1 -1
- package/vue-components/v2/header/Header.vue +0 -1
- package/vue-components/v2/modal/Modal.vue +2 -3
- package/vue-components/v2/modals/JsonShowModal.vue +0 -1
- package/vue-components/v2/navbar/Appdrawer.vue +8 -6
- package/vue-components/v2/pagination/Pagination.vue +8 -1
- package/vue-components/v2/sidebar/SidebarItem.vue +1 -1
- package/vue-components/v2/table/InfoTable.vue +13 -3
- package/vue-components/v2/table/Table.vue +75 -5
- package/vue-components/v3/button/Button.vue +73 -0
- package/vue-components/v3/content/ContentHeader.vue +54 -0
- package/vue-components/v3/content/ContentTable.vue +65 -0
- package/vue-components/v3/dropdown/DropdownDivider.vue +3 -0
- package/vue-components/v3/dropdown/DropdownItem.vue +5 -0
- package/vue-components/v3/dropdown/DropdownMenu.vue +111 -0
- package/vue-components/v3/editor/Editor.vue +137 -0
- package/vue-components/v3/form-fields/Input.vue +21 -0
- package/vue-components/v3/header/Header.vue +45 -0
- package/vue-components/v3/modal/Modal.vue +126 -0
- package/vue-components/v3/modals/JsonShowModal.vue +87 -0
- package/vue-components/v3/navbar/Appdrawer.vue +58 -0
- package/vue-components/v3/navbar/User.vue +64 -0
- package/vue-components/v3/pagination/Pagination.vue +159 -0
- package/vue-components/v3/searchbars/SearchBar.vue +47 -0
- package/vue-components/v3/tab/TabItem.vue +17 -0
- package/vue-components/v3/table/FakeTableCell.vue +39 -0
- package/vue-components/v3/table/InfoTable.vue +105 -0
- package/vue-components/v3/table/Table.vue +238 -0
- package/vue-components/v3/table/TableCell.vue +28 -0
- package/vue-components/v3/table/TableRow.vue +60 -0
- package/vue-components/v3/table/table-cell/ArrayCell.vue +111 -0
- package/vue-components/v3/table/table-cell/CellValue.vue +108 -0
- package/vue-components/v3/table/table-cell/ObjectCell.vue +105 -0
- package/vue-components/v3/table/table-cell/ValueWithModal.vue +43 -0
- package/vue-components/v3/tabs/EditorTabs.vue +36 -0
- package/vue-components/v3/tag/Tag.vue +17 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="inner-header">
|
|
3
|
+
<div
|
|
4
|
+
class="is-flex is-justify-content-space-between"
|
|
5
|
+
:class="{ container: isContainer }"
|
|
6
|
+
>
|
|
7
|
+
<header-items>
|
|
8
|
+
<header-item>
|
|
9
|
+
<transition name="fade" mode="out-in" appear>
|
|
10
|
+
<h5 :key="title">{{ title }}</h5>
|
|
11
|
+
</transition>
|
|
12
|
+
</header-item>
|
|
13
|
+
<slot name="header-left-controls" />
|
|
14
|
+
</header-items>
|
|
15
|
+
<header-items>
|
|
16
|
+
<slot />
|
|
17
|
+
</header-items>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
24
|
+
|
|
25
|
+
export default defineComponent({
|
|
26
|
+
props: {
|
|
27
|
+
title: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "No Title",
|
|
30
|
+
},
|
|
31
|
+
isContainer: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
components: {
|
|
37
|
+
HeaderItems: defineAsyncComponent(() =>
|
|
38
|
+
import("../../v2/header/HeaderItems.vue").then((module) => module.default)
|
|
39
|
+
),
|
|
40
|
+
HeaderItem: defineAsyncComponent(() =>
|
|
41
|
+
import("../../v2/header/HeaderItem.vue").then((module) => module.default)
|
|
42
|
+
),
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
</script>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<teleport to="#modals">
|
|
3
|
+
<!-- for transition https://github.com/adamwathan/vue-tailwind-examples/blob/master/src/components/Modal.vue -->
|
|
4
|
+
<!-- modal start -->
|
|
5
|
+
<div
|
|
6
|
+
v-if="showModal"
|
|
7
|
+
class="ac-modal is-middle-alignment"
|
|
8
|
+
:class="modifierClasses"
|
|
9
|
+
@click.self="destroyModal"
|
|
10
|
+
>
|
|
11
|
+
<div class="ac-modal-inner">
|
|
12
|
+
<!-- modal header start -->
|
|
13
|
+
<div class="ac-modal-header">
|
|
14
|
+
<h6>{{ title }}</h6>
|
|
15
|
+
<header-items>
|
|
16
|
+
<slot name="modal-header-controls" />
|
|
17
|
+
<header-item>
|
|
18
|
+
<ac-button
|
|
19
|
+
modifier-classes="is-square is-transparent"
|
|
20
|
+
:icon-image="crossIcon"
|
|
21
|
+
@click.stop="destroyModal"
|
|
22
|
+
/>
|
|
23
|
+
</header-item>
|
|
24
|
+
</header-items>
|
|
25
|
+
</div>
|
|
26
|
+
<!-- modal header end -->
|
|
27
|
+
|
|
28
|
+
<!-- modal body start -->
|
|
29
|
+
<div class="ac-modal-body">
|
|
30
|
+
<div class="ac-modal-content">
|
|
31
|
+
<!-- freedom content start -->
|
|
32
|
+
<slot />
|
|
33
|
+
<!-- freedom content end -->
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<!-- modal body end -->
|
|
37
|
+
|
|
38
|
+
<!-- modal footer start -->
|
|
39
|
+
<div class="ac-modal-footer action-footer">
|
|
40
|
+
<buttons class="has-text-right is-block">
|
|
41
|
+
<slot name="modal-footer-controls" />
|
|
42
|
+
</buttons>
|
|
43
|
+
<!-- modal footer end -->
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</teleport>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script>
|
|
51
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
52
|
+
|
|
53
|
+
export default defineComponent({
|
|
54
|
+
props: {
|
|
55
|
+
open: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false,
|
|
58
|
+
},
|
|
59
|
+
title: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: "Modal",
|
|
62
|
+
},
|
|
63
|
+
modifierClasses: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "",
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
emits: ["closemodal"],
|
|
69
|
+
|
|
70
|
+
components: {
|
|
71
|
+
HeaderItems: defineAsyncComponent(() =>
|
|
72
|
+
import("../../v2/header/HeaderItems.vue").then((module) => module.default)
|
|
73
|
+
),
|
|
74
|
+
HeaderItem: defineAsyncComponent(() =>
|
|
75
|
+
import("../../v2/header/HeaderItem.vue").then((module) => module.default)
|
|
76
|
+
),
|
|
77
|
+
Buttons: defineAsyncComponent(() =>
|
|
78
|
+
import("../../v2/button/Buttons.vue").then((module) => module.default)
|
|
79
|
+
),
|
|
80
|
+
AcButton: defineAsyncComponent(() =>
|
|
81
|
+
import("../button/Button.vue").then((module) => module.default)
|
|
82
|
+
),
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
data() {
|
|
86
|
+
return {
|
|
87
|
+
showModal: false,
|
|
88
|
+
crossIcon: import.meta.globEager(
|
|
89
|
+
"/src/assets/icons/modal/close-icon.svg"
|
|
90
|
+
)["/src/assets/icons/modal/close-icon.svg"].default,
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
watch: {
|
|
95
|
+
open: {
|
|
96
|
+
immediate: true,
|
|
97
|
+
handler(n) {
|
|
98
|
+
if (n) {
|
|
99
|
+
this.initializeModal();
|
|
100
|
+
} else {
|
|
101
|
+
this.destroyModal();
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
methods: {
|
|
108
|
+
onKeyDown(e) {
|
|
109
|
+
if (this.open && e.keyCode === 27) {
|
|
110
|
+
// escape key
|
|
111
|
+
this.destroyModal();
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
initializeModal() {
|
|
115
|
+
this.showModal = true;
|
|
116
|
+
document.addEventListener("keydown", this.onKeyDown);
|
|
117
|
+
},
|
|
118
|
+
destroyModal() {
|
|
119
|
+
this.showModal = false;
|
|
120
|
+
document.removeEventListener("keydown", this.onKeyDown);
|
|
121
|
+
|
|
122
|
+
this.$emit("closemodal", true);
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
</script>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<modal
|
|
3
|
+
:title="editorTitle"
|
|
4
|
+
:open="open"
|
|
5
|
+
@closemodal="closeModal"
|
|
6
|
+
modifier-classes="is-medium"
|
|
7
|
+
>
|
|
8
|
+
<template #modal-header-controls>
|
|
9
|
+
<header-item>
|
|
10
|
+
<ac-button
|
|
11
|
+
modifier-classes="is-square is-primary"
|
|
12
|
+
icon-class="copy"
|
|
13
|
+
v-clipboard:copy="`${editorTitle}: "${editorContent}"`"
|
|
14
|
+
v-clipboard:success="onCopy"
|
|
15
|
+
v-clipboard:error="onError"
|
|
16
|
+
/>
|
|
17
|
+
</header-item>
|
|
18
|
+
</template>
|
|
19
|
+
<editor
|
|
20
|
+
:value="JSON.stringify(parsedContent, null, 4)"
|
|
21
|
+
:read-only="true"
|
|
22
|
+
language="json"
|
|
23
|
+
:show-minimap="false"
|
|
24
|
+
/>
|
|
25
|
+
</modal>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
30
|
+
import { useToast } from "vue-toastification";
|
|
31
|
+
|
|
32
|
+
export default defineComponent({
|
|
33
|
+
props: {
|
|
34
|
+
open: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false,
|
|
37
|
+
},
|
|
38
|
+
editorTitle: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "",
|
|
41
|
+
},
|
|
42
|
+
editorContent: {
|
|
43
|
+
type: null,
|
|
44
|
+
default: () => ({}),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
emits: ["closemodal"],
|
|
48
|
+
components: {
|
|
49
|
+
Modal: defineAsyncComponent(() =>
|
|
50
|
+
import("../modal/Modal.vue").then((module) => module.default)
|
|
51
|
+
),
|
|
52
|
+
Editor: defineAsyncComponent(() =>
|
|
53
|
+
import("../editor/Editor.vue").then((module) => module.default)
|
|
54
|
+
),
|
|
55
|
+
AcButton: defineAsyncComponent(() =>
|
|
56
|
+
import("../button/Button.vue").then((module) => module.default)
|
|
57
|
+
),
|
|
58
|
+
HeaderItem: defineAsyncComponent(() =>
|
|
59
|
+
import("../../v2/header/HeaderItem.vue").then((module) => module.default)
|
|
60
|
+
),
|
|
61
|
+
},
|
|
62
|
+
computed: {
|
|
63
|
+
parsedContent() {
|
|
64
|
+
try {
|
|
65
|
+
return JSON.parse(this.editorContent);
|
|
66
|
+
} catch (e) {
|
|
67
|
+
return this.editorContent;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
setup() {
|
|
72
|
+
const toast = useToast();
|
|
73
|
+
return { toast };
|
|
74
|
+
},
|
|
75
|
+
methods: {
|
|
76
|
+
onCopy() {
|
|
77
|
+
this.toast.success("Value copied successfully", { timeout: 1000 });
|
|
78
|
+
},
|
|
79
|
+
onError() {
|
|
80
|
+
this.toast.error("Copying failed", { timeout: 1000 });
|
|
81
|
+
},
|
|
82
|
+
closeModal() {
|
|
83
|
+
this.$emit("closemodal", true);
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
</script>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-drawer-wrapper">
|
|
3
|
+
<div class="drawer-icon">
|
|
4
|
+
<svg
|
|
5
|
+
class="gb_We"
|
|
6
|
+
focusable="false"
|
|
7
|
+
viewBox="0 0 24 24"
|
|
8
|
+
:style="{ fill: 'white' }"
|
|
9
|
+
>
|
|
10
|
+
<path
|
|
11
|
+
d="M6,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,20c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM6,20c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM6,14c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,14c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM16,6c0,1.1 0.9,2 2,2s2,-0.9 2,-2 -0.9,-2 -2,-2 -2,0.9 -2,2zM12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,14c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,20c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2z"
|
|
12
|
+
></path>
|
|
13
|
+
</svg>
|
|
14
|
+
</div>
|
|
15
|
+
<!-- dropdown start -->
|
|
16
|
+
<div class="ac-menu-content app-drawer-dropdown is-active">
|
|
17
|
+
<ul>
|
|
18
|
+
<li v-for="app in apps" :key="app.url">
|
|
19
|
+
<a :href="app.url">
|
|
20
|
+
<article class="media">
|
|
21
|
+
<figure class="media-left">
|
|
22
|
+
<p class="image">
|
|
23
|
+
<img :src="app.icon_url" />
|
|
24
|
+
</p>
|
|
25
|
+
</figure>
|
|
26
|
+
<div class="media-content">
|
|
27
|
+
<div class="content">
|
|
28
|
+
<p>
|
|
29
|
+
<strong>{{ app.title }}</strong>
|
|
30
|
+
<span>{{ app.sub_title }}</span>
|
|
31
|
+
</p>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</article>
|
|
35
|
+
</a>
|
|
36
|
+
</li>
|
|
37
|
+
</ul>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script>
|
|
43
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
44
|
+
|
|
45
|
+
export default defineComponent({
|
|
46
|
+
props: {
|
|
47
|
+
apps: {
|
|
48
|
+
type: Array,
|
|
49
|
+
default: () => [],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
components: {
|
|
53
|
+
NavbarItemContent: defineAsyncComponent(() =>
|
|
54
|
+
import("../../v2/navbar/NavbarItemContent.vue").then((module) => module.default)
|
|
55
|
+
),
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
</script>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<navbar-item>
|
|
3
|
+
<button class="button ac-nav-button ac-profile-button">
|
|
4
|
+
{{ user.full_name || user.username }}
|
|
5
|
+
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
|
6
|
+
<div class="ac-user-profile">
|
|
7
|
+
<img :src="user.avatar_url" alt="User Photo" />
|
|
8
|
+
</div>
|
|
9
|
+
</button>
|
|
10
|
+
<navbar-item-content>
|
|
11
|
+
<div v-if="user.username" class="user-profile-wrapper">
|
|
12
|
+
<div class="profile-area">
|
|
13
|
+
<div class="profile-photo">
|
|
14
|
+
<img :src="user.avatar_url" alt="User Photo" />
|
|
15
|
+
<button class="camera-icon"></button>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="profile-info">
|
|
18
|
+
<p>{{ user.username.toUpperCase() }}</p>
|
|
19
|
+
<a :href="`mailto:${user.email}`"> {{ user.email }}</a>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<ul>
|
|
23
|
+
<li>
|
|
24
|
+
<a :href="`${serverDomain}/user/settings/`">Settings</a>
|
|
25
|
+
</li>
|
|
26
|
+
<template v-if="user.is_admin">
|
|
27
|
+
<li>
|
|
28
|
+
<a :href="`${serverDomain}/admin`"> Site Administration </a>
|
|
29
|
+
</li>
|
|
30
|
+
</template>
|
|
31
|
+
<li>
|
|
32
|
+
<a :href="`${serverDomain}/user/logout`"> Sign out </a>
|
|
33
|
+
</li>
|
|
34
|
+
</ul>
|
|
35
|
+
</div>
|
|
36
|
+
</navbar-item-content>
|
|
37
|
+
</navbar-item>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
42
|
+
|
|
43
|
+
export default defineComponent({
|
|
44
|
+
props: {
|
|
45
|
+
user: {
|
|
46
|
+
type: Object,
|
|
47
|
+
default: () => ({}),
|
|
48
|
+
},
|
|
49
|
+
serverDomain: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
components: {
|
|
56
|
+
NavbarItem: defineAsyncComponent(() =>
|
|
57
|
+
import("../../v2/navbar/NavbarItem.vue").then((module) => module.default)
|
|
58
|
+
),
|
|
59
|
+
NavbarItemContent: defineAsyncComponent(() =>
|
|
60
|
+
import("../../v2/navbar/NavbarItemContent.vue").then((module) => module.default)
|
|
61
|
+
),
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
</script>
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="level inner-table-pagination" v-show="showPagination">
|
|
3
|
+
<div class="pagination-filter level-left">
|
|
4
|
+
<div
|
|
5
|
+
class="level-item"
|
|
6
|
+
v-show="
|
|
7
|
+
!hideRowsPerPageSelection &&
|
|
8
|
+
totalNoOfItems > preSelectedItemsCountPerPage
|
|
9
|
+
"
|
|
10
|
+
>
|
|
11
|
+
<label>Rows per page</label>
|
|
12
|
+
<select v-model="selectedItemCountPerPage" name="page">
|
|
13
|
+
<option :value="5">5</option>
|
|
14
|
+
<option :value="10" v-show="totalNoOfItems > 5">10</option>
|
|
15
|
+
<option :value="15" v-show="totalNoOfItems > 10">15</option>
|
|
16
|
+
<option :value="20" v-show="totalNoOfItems > 15">20</option>
|
|
17
|
+
<option :value="25" v-show="totalNoOfItems > 20">25</option>
|
|
18
|
+
<option :value="50" v-show="totalNoOfItems > 25">50</option>
|
|
19
|
+
</select>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<nav class="pagination-item level-right">
|
|
24
|
+
<p class="counting-page">
|
|
25
|
+
Showing
|
|
26
|
+
<span>{{ itemsRange.start + 1 }}</span
|
|
27
|
+
>to <span>{{ itemsRange.end }}</span
|
|
28
|
+
>of <span>{{ totalNoOfItems }}</span
|
|
29
|
+
>{{ totalNoOfItems > 1 ? "Items" : "Item" }}
|
|
30
|
+
</p>
|
|
31
|
+
|
|
32
|
+
<ul v-if="totalNoOfItems > selectedItemCountPerPage">
|
|
33
|
+
<li>
|
|
34
|
+
<a class="previous" @click.prevent="prevPage()">
|
|
35
|
+
<i class="fa fa-angle-left" aria-hidden="true"></i>
|
|
36
|
+
</a>
|
|
37
|
+
</li>
|
|
38
|
+
<li v-for="page in pages" :key="`page-${page}`">
|
|
39
|
+
<a
|
|
40
|
+
@click.prevent="changePage(page)"
|
|
41
|
+
:class="{ 'is-current': activePageNo === page }"
|
|
42
|
+
>{{ page }}</a
|
|
43
|
+
>
|
|
44
|
+
</li>
|
|
45
|
+
<li>
|
|
46
|
+
<a class="next" @click.prevent="nextPage()">
|
|
47
|
+
<i class="fa fa-angle-right" aria-hidden="true"></i>
|
|
48
|
+
</a>
|
|
49
|
+
</li>
|
|
50
|
+
</ul>
|
|
51
|
+
</nav>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script>
|
|
56
|
+
import { defineComponent } from "vue";
|
|
57
|
+
|
|
58
|
+
export default defineComponent({
|
|
59
|
+
props: {
|
|
60
|
+
hideRowsPerPageSelection: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
totalNoOfItems: {
|
|
65
|
+
type: Number,
|
|
66
|
+
default: 0,
|
|
67
|
+
},
|
|
68
|
+
preSelectedItemsCountPerPage: {
|
|
69
|
+
type: Number,
|
|
70
|
+
default: 5,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
emits: ["pagination:pagechange"],
|
|
74
|
+
|
|
75
|
+
data() {
|
|
76
|
+
return {
|
|
77
|
+
activePageNo: 1,
|
|
78
|
+
selectedItemCountPerPage: 5,
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
computed: {
|
|
83
|
+
noOfPages() {
|
|
84
|
+
return Math.ceil(this.totalNoOfItems / this.selectedItemCountPerPage);
|
|
85
|
+
},
|
|
86
|
+
noOfPageNos() {
|
|
87
|
+
return Math.min(this.noOfPages, 5);
|
|
88
|
+
},
|
|
89
|
+
pageRange() {
|
|
90
|
+
let o = { start: 1, end: 0 };
|
|
91
|
+
if (this.noOfPageNos < 5) {
|
|
92
|
+
o.start = 1;
|
|
93
|
+
o.end = this.noOfPageNos;
|
|
94
|
+
} else {
|
|
95
|
+
if (this.activePageNo < 3) {
|
|
96
|
+
o.start = 1;
|
|
97
|
+
o.end = 5;
|
|
98
|
+
} else if (this.activePageNo > this.noOfPages - 2) {
|
|
99
|
+
o.start = this.noOfPages - 4;
|
|
100
|
+
o.end = this.noOfPages;
|
|
101
|
+
} else {
|
|
102
|
+
o.start = this.activePageNo - 2;
|
|
103
|
+
o.end = this.activePageNo + 2;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return o;
|
|
107
|
+
},
|
|
108
|
+
pages() {
|
|
109
|
+
let ar = [];
|
|
110
|
+
let start = this.pageRange.start;
|
|
111
|
+
let end = this.pageRange.end;
|
|
112
|
+
for (let i = start; i <= end; i++) {
|
|
113
|
+
ar.push(i);
|
|
114
|
+
}
|
|
115
|
+
return ar;
|
|
116
|
+
},
|
|
117
|
+
itemsRange() {
|
|
118
|
+
let start = (this.activePageNo - 1) * this.selectedItemCountPerPage;
|
|
119
|
+
let end = Math.min(
|
|
120
|
+
this.activePageNo * this.selectedItemCountPerPage,
|
|
121
|
+
this.totalNoOfItems
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
return { start, end };
|
|
125
|
+
},
|
|
126
|
+
showPagination() {
|
|
127
|
+
return this.itemsRange.end > this.itemsRange.start;
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
created() {
|
|
132
|
+
this.selectedItemCountPerPage = this.preSelectedItemsCountPerPage;
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
methods: {
|
|
136
|
+
prevPage() {
|
|
137
|
+
this.activePageNo = Math.max(this.activePageNo - 1, 1);
|
|
138
|
+
},
|
|
139
|
+
changePage(page) {
|
|
140
|
+
this.activePageNo = page;
|
|
141
|
+
},
|
|
142
|
+
nextPage() {
|
|
143
|
+
this.activePageNo = Math.min(this.activePageNo + 1, this.noOfPages);
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
watch: {
|
|
148
|
+
itemsRange: {
|
|
149
|
+
deep: true,
|
|
150
|
+
handler(n) {
|
|
151
|
+
this.$emit("pagination:pagechange", n);
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
selectedItemCountPerPage() {
|
|
155
|
+
this.activePageNo = 1;
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
</script>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ac-single-input modifier-classes="is-extra-small width-200">
|
|
3
|
+
<template #button>
|
|
4
|
+
<button class="ac-search-button">
|
|
5
|
+
<i class="fa fa-search" aria-hidden="true"></i>
|
|
6
|
+
</button>
|
|
7
|
+
</template>
|
|
8
|
+
<ac-input
|
|
9
|
+
name="search"
|
|
10
|
+
placeholder="Search"
|
|
11
|
+
type="search"
|
|
12
|
+
class="ac-search"
|
|
13
|
+
v-model="searchText"
|
|
14
|
+
/>
|
|
15
|
+
</ac-single-input>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
20
|
+
|
|
21
|
+
export default defineComponent({
|
|
22
|
+
components: {
|
|
23
|
+
AcSingleInput: defineAsyncComponent(() =>
|
|
24
|
+
import("../../v2/form-fields/AcSingleInput.vue").then(
|
|
25
|
+
(module) => module.default
|
|
26
|
+
)
|
|
27
|
+
),
|
|
28
|
+
AcInput: defineAsyncComponent(() =>
|
|
29
|
+
import("../form-fields/Input.vue").then((module) => module.default)
|
|
30
|
+
),
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
emits: ["search"],
|
|
34
|
+
|
|
35
|
+
data() {
|
|
36
|
+
return {
|
|
37
|
+
searchText: "",
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
watch: {
|
|
42
|
+
searchText(n) {
|
|
43
|
+
this.$emit("search", n);
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<li :class="{ 'is-active': isActive }">
|
|
3
|
+
<slot />
|
|
4
|
+
</li>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { defineComponent } from "vue";
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
props: {
|
|
11
|
+
isActive: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: false,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<th v-if="isHeaderCell" class="increase-width">
|
|
3
|
+
<div class="increase-innner" :style="dynamicColumnStyle" />
|
|
4
|
+
</th>
|
|
5
|
+
<table-cell v-else class="increase-width">
|
|
6
|
+
<div class="increase-innner" :style="dynamicColumnStyle" />
|
|
7
|
+
</table-cell>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
12
|
+
|
|
13
|
+
export default defineComponent({
|
|
14
|
+
props: {
|
|
15
|
+
isHeaderCell: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false,
|
|
18
|
+
},
|
|
19
|
+
fakeCellWidth: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
components: {
|
|
26
|
+
TableCell: defineAsyncComponent(() =>
|
|
27
|
+
import("./TableCell.vue").then((module) => module.default)
|
|
28
|
+
),
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
computed: {
|
|
32
|
+
dynamicColumnStyle() {
|
|
33
|
+
return {
|
|
34
|
+
right: `-${this.fakeCellWidth}px`,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
</script>
|