goodteditor-ui 1.0.35 → 1.0.37

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": "goodteditor-ui",
3
- "version": "1.0.35",
3
+ "version": "1.0.37",
4
4
  "main": "index.js",
5
5
  "homepage": "https://goodt-ui.netlify.app/",
6
6
  "scripts": {
@@ -177,19 +177,16 @@ export default {
177
177
  value: {
178
178
  handler(v) {
179
179
  const a = String(v).match(withUnitRegExp);
180
+ const [_, n, u] = a ?? [];
180
181
  const { units } = this;
181
182
  let unit = units.length ? units[0] : '';
182
- let value = '';
183
+ let value = Number.isNaN(Number(v)) ? '' : v;
183
184
 
184
- if (!a) {
185
- value = v;
186
- } else {
187
- const [_, n, u] = a;
188
- if (units.includes(u)) {
189
- value = n;
190
- unit = u;
191
- }
185
+ if (units.includes(u)) {
186
+ value = n;
187
+ unit = u;
192
188
  }
189
+
193
190
  this.dataListCursorIndex = units.indexOf(unit);
194
191
  this.model = { value, unit };
195
192
  },
@@ -100,7 +100,7 @@
100
100
  class="w-100 pull-left"
101
101
  @click.native.stop
102
102
  @select-option="onDatalistSelectOption"
103
- v-bind="{ size, options }"
103
+ v-bind="{ size, options, class: datalistCssClass }"
104
104
  :cursorIndex.sync="dataListCursorIndex"
105
105
  ref="datalist"
106
106
  >
@@ -155,18 +155,18 @@
155
155
  <div class="col col-vmid text-truncate">
156
156
  <div
157
157
  class="text-truncate"
158
- style="min-height: calc(var(--line-height)*1em)"
158
+ style="min-height: calc(var(--line-height) * 1em)"
159
159
  >
160
160
  {{ getOptionLabel(option) }}
161
161
  </div>
162
162
  </div>
163
163
  <div class="col col-auto col-vmid" v-if="isOptionSelected(option)">
164
- <i class="mdi mdi-check" style="line-height:1"></i>
164
+ <i class="mdi mdi-check" style="line-height: 1"></i>
165
165
  </div>
166
166
  </div>
167
167
  <div
168
168
  class="text-truncate"
169
- style="min-height: calc(var(--line-height)*1rem)"
169
+ style="min-height: calc(var(--line-height) * 1rem)"
170
170
  v-else
171
171
  >
172
172
  {{ getOptionLabel(option) }}
@@ -238,6 +238,13 @@ export default {
238
238
  return [];
239
239
  },
240
240
  },
241
+ /**
242
+ * Datalist css classes (optional)
243
+ */
244
+ datalistCssClass: {
245
+ type: [String, Array],
246
+ default: '',
247
+ },
241
248
  /**
242
249
  * Allow multiple selection
243
250
  */