@appscode/design-system 2.6.22-alpha → 2.6.22-alpha-0.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "2.6.22-alpha",
3
+ "version": "2.6.22-alpha-0.0.3",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -1,6 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import { defineAsyncComponent, defineProps } from "vue";
3
- import BuildingIcon from "@/components/vue-components/v3/icons/BuildingIcon.vue";
3
+ import BuildingIcon from "../icons/BuildingIcon.vue";
4
+ import LinkIcon from "../icons/LinkIcon.vue";
5
+ import MapIcon from "../icons/MapIcon.vue";
4
6
 
5
7
  interface TabItem {
6
8
  label: string;
@@ -37,9 +39,6 @@ const Avatar = defineAsyncComponent(() => import("@/components/vue-components/v3
37
39
  // Tabs
38
40
  const Tabs = defineAsyncComponent(() => import("@/components/vue-components/v3/tab/Tabs.vue"));
39
41
  const TabItem = defineAsyncComponent(() => import("@/components/vue-components/v3/tab/TabItem.vue"));
40
-
41
- import LinkIcon from "@/components/vue-components/v3/icons/LinkIcon.vue";
42
- import MapIcon from "@/components/vue-components/v3/icons/MapIcon.vue";
43
42
  </script>
44
43
 
45
44
  <template>
@@ -16,7 +16,6 @@ withDefaults(defineProps<Props>(), {
16
16
  const emit = defineEmits(["handleSearch"]);
17
17
 
18
18
  const searchText = ref("");
19
- console.log(searchText);
20
19
 
21
20
  watch(searchText, (n) => {
22
21
  emit("handleSearch", n.trim());
@@ -1,26 +1,43 @@
1
1
  <script setup>
2
- import { defineAsyncComponent, defineProps } from "vue";
2
+ import { defineAsyncComponent, defineProps, ref, watch } from "vue";
3
3
  const props = defineProps({
4
4
  placeholder: {
5
5
  type: String,
6
6
  default: "Search what you are looking for...",
7
7
  },
8
+ isFilter: {
9
+ type: Boolean,
10
+ default: false,
11
+ },
12
+ filterOptions: {
13
+ type: Array,
14
+ default: () => [
15
+ { value: "all-cluster", text: "All Cluster" },
16
+ { value: "active", text: "Active" },
17
+ { value: "pending", text: "Pending" },
18
+ ],
19
+ },
8
20
  });
9
-
10
- const emit = defineEmits(["handleSearch"]);
21
+ const emit = defineEmits(["handleSearch", "handleFilter"]);
11
22
  function handleSearch(searchText) {
12
23
  emit("handleSearch", searchText);
13
24
  }
14
25
 
26
+ const selectedFilter = ref("all-cluster");
27
+
28
+ watch(selectedFilter, (n) => {
29
+ emit("handleFilter", n);
30
+ });
31
+
15
32
  const Searchbar = defineAsyncComponent(() => import("@/components/vue-components/v3/form-fields/Searchbar.vue"));
16
33
  </script>
17
34
  <template>
18
35
  <div class="filterable-searchbar is-flex">
19
36
  <Searchbar :placeholder="props.placeholder" @handleSearch="handleSearch" />
20
- <select class="select search-filter">
21
- <option value="all-cluster">All Cluster</option>
22
- <option value="active">Active</option>
23
- <option value="pending">Pending</option>
37
+ <select class="select search-filter" v-show="props.isFilter" v-model="selectedFilter">
38
+ <option v-for="option in filterOptions" :key="option.value" :value="option.value">
39
+ {{ option.text }}
40
+ </option>
24
41
  </select>
25
42
  </div>
26
43
  </template>
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import CogIcon from "@/components/vue-components/v3/icons/CogIcon.vue";
2
+ import CogIcon from "../../icons/CogIcon.vue";
3
3
 
4
4
  // Define the props to accept the data structure
5
5
  const props = defineProps({
@@ -22,17 +22,8 @@ const props = defineProps({
22
22
  <label class="label">{{ data.label }}</label>
23
23
 
24
24
  <!-- Iterate through the items inside each section -->
25
- <slot
26
- name="sidebar-item"
27
- v-for="(item, idx) in data.items"
28
- :key="idx"
29
- :item="item"
30
- >
31
- <a
32
- :href="item.link || '#'"
33
- class="sidebar-item"
34
- :class="{ 'is-active': item.isActive }"
35
- >
25
+ <slot name="sidebar-item" v-for="(item, idx) in data.items" :key="idx" :item="item">
26
+ <a :href="item.link || '#'" class="sidebar-item" :class="{ 'is-active': item.isActive }">
36
27
  <span class="icon"><component :is="item.icon || CogIcon" /></span>
37
28
  <span>{{ item.text }}</span>
38
29
  </a>