classcard-ui 0.2.855 → 0.2.857

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": "classcard-ui",
3
- "version": "0.2.855",
3
+ "version": "0.2.857",
4
4
  "main": "dist/classcard-ui.umd.min.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -13,7 +13,7 @@
13
13
  <div class="relative">
14
14
  <input
15
15
  type="text"
16
- class="relative w-full cursor-default rounded-md border border-gray-300 bg-white py-2 pl-3 pr-10 text-left shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 disabled:pointer-events-none disabled:opacity-50 sm:text-sm"
16
+ class="focus:outline-none relative w-full cursor-default rounded-md border border-gray-300 bg-white py-2 pl-3 pr-10 text-left shadow-sm focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 disabled:pointer-events-none disabled:opacity-50 sm:text-sm"
17
17
  aria-haspopup="listbox"
18
18
  aria-expanded="true"
19
19
  aria-labelledby="listbox-label"
@@ -75,7 +75,7 @@
75
75
  To: "opacity-0"
76
76
  -->
77
77
  <ul
78
- class="absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm"
78
+ class="ring-black focus:outline-none absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-opacity-5 sm:text-sm"
79
79
  tabindex="-1"
80
80
  role="listbox"
81
81
  aria-labelledby="listbox-label"
@@ -93,9 +93,7 @@
93
93
  class="relative cursor-default select-none bg-gray-100 py-2 pl-3 pr-9 text-left text-xs font-semibold text-gray-900"
94
94
  role="option"
95
95
  >
96
- <span class="block truncate">
97
- {{ option.label }}
98
- </span>
96
+ <span class="block truncate"> {{ option.label }} </span>
99
97
  </li>
100
98
  <li
101
99
  class="group relative cursor-default select-none py-2 pl-3 pr-9 text-left text-gray-900 hover:bg-indigo-600 hover:text-white"
@@ -106,6 +104,7 @@
106
104
  >
107
105
  <!-- Selected: "font-semibold", Not Selected: "font-normal" -->
108
106
  <span
107
+ class="flex"
109
108
  :class="[
110
109
  subOption[keyField] === value[keyField]
111
110
  ? 'font-semibold'
@@ -114,6 +113,19 @@
114
113
  ]"
115
114
  >
116
115
  {{ subOption.label }}
116
+ <div
117
+ v-if="
118
+ subOption.stock_level ||
119
+ (subOption.stock_level <= 0 && subOption.stock_level !== null)
120
+ "
121
+ >
122
+ <p
123
+ class="ml-2 text-sm"
124
+ :class="[quantityLabelColor(subOption)]"
125
+ >
126
+ {{ subOption.stock_level }} units
127
+ </p>
128
+ </div>
117
129
  </span>
118
130
 
119
131
  <!--
@@ -197,12 +209,22 @@ export default {
197
209
  closeDropDown(hasData) {
198
210
  this.inputValue = this.value.label;
199
211
  this.showDropDown = false;
200
- this.$emit('blur', {hasData: hasData});
212
+ this.$emit("blur", { hasData: hasData });
201
213
  },
202
214
  openDropDown() {
203
215
  this.showDropDown = true;
204
216
  this.emitSearch("");
205
217
  },
218
+ quantityLabelColor(data) {
219
+ console.log("test");
220
+ if (data.stock_level <= 0) {
221
+ return "text-red-300";
222
+ } else if (data.stock_level < data.alert_level) {
223
+ return "text-orange-300";
224
+ } else {
225
+ return "text-gray-300";
226
+ }
227
+ },
206
228
  },
207
229
  watch: {
208
230
  value(newValue) {
@@ -32,7 +32,7 @@
32
32
  <span class="sr-only">Use setting</span>
33
33
  <span
34
34
  aria-hidden="true"
35
- class="pointer-events-none absolute h-full w-full rounded-md bg-white"
35
+ class="pointer-events-none absolute h-full w-full rounded-md"
36
36
  ></span>
37
37
  <span
38
38
  aria-hidden="true"