@bimdata/design-system 2.1.0-rc.1 → 2.1.0-rc.2

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": "@bimdata/design-system",
3
- "version": "2.1.0-rc.1",
3
+ "version": "2.1.0-rc.2",
4
4
  "main": "./src/BIMDataComponents/index.js",
5
5
  "module": "./src/BIMDataComponents/index.js",
6
6
  "files": [
@@ -26,24 +26,40 @@
26
26
  <slot name="contentAfterBtn" :isOpen="displayed"></slot>
27
27
  </div>
28
28
  <transition :name="`slide-fade-${transitionName}`">
29
- <BIMDataPaginatedList
30
- :class="`submenu submenu--${directionClass}`"
31
- v-show="displayed"
32
- :list="list"
33
- :perPage="perPage"
34
- :elementKey="elementKey"
35
- @element-click="onElementClick"
36
- :loading="loading"
37
- >
38
- <template #element="{ element }">
39
- <slot
40
- name="element"
41
- :element="element"
42
- :close="away"
43
- :isOpen="displayed"
44
- ></slot>
45
- </template>
46
- </BIMDataPaginatedList>
29
+ <div>
30
+ <BIMDataPaginatedList
31
+ :class="`submenu submenu--${directionClass}`"
32
+ v-show="displayed"
33
+ :list="filteredList"
34
+ :perPage="perPage"
35
+ :elementKey="elementKey"
36
+ @element-click="onElementClick"
37
+ :loading="loading"
38
+ >
39
+ <template #header>
40
+ <BIMDataSearch
41
+ v-if="search"
42
+ width="calc(100% - 12px)"
43
+ color="primary"
44
+ radius
45
+ :placeholder="searchPlaceholder"
46
+ v-model="searchText"
47
+ class="m-6"
48
+ />
49
+ <div v-if="filteredList.length === 0" class="p-x-6 p-b-6">
50
+ <slot name="empty"></slot>
51
+ </div>
52
+ </template>
53
+ <template #element="{ element }">
54
+ <slot
55
+ name="element"
56
+ :element="element"
57
+ :close="away"
58
+ :isOpen="displayed"
59
+ ></slot>
60
+ </template>
61
+ </BIMDataPaginatedList>
62
+ </div>
47
63
  </transition>
48
64
  </div>
49
65
  </template>
@@ -105,11 +121,20 @@ export default {
105
121
  type: String,
106
122
  default: "36px",
107
123
  },
124
+ search: {
125
+ type: Boolean,
126
+ default: false,
127
+ },
128
+ searchPlaceholder: {
129
+ type: String,
130
+ default: "Search",
131
+ },
108
132
  },
109
133
  emits: ["element-click"],
110
134
  data() {
111
135
  return {
112
136
  displayed: false,
137
+ searchText: "",
113
138
  };
114
139
  },
115
140
  computed: {
@@ -122,6 +147,16 @@ export default {
122
147
  iconRotation() {
123
148
  return this.displayed ? (this.directionClass === "up" ? -90 : 90) : 0;
124
149
  },
150
+ filteredList() {
151
+ if (this.searchText === "") {
152
+ return this.list;
153
+ } else {
154
+ const lowerCaseSearchText = this.searchText.toLowerCase();
155
+ return this.list.filter(element =>
156
+ element.toLowerCase().includes(lowerCaseSearchText),
157
+ );
158
+ }
159
+ },
125
160
  },
126
161
  methods: {
127
162
  onHeaderClick() {