@vuetify/nightly 3.7.15-dev.2025-03-06 → 3.7.15-dev.2025-03-07

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/dist/vuetify.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vuetify v3.7.15-dev.2025-03-06
2
+ * Vuetify v3.7.15-dev.2025-03-07
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
@@ -13161,17 +13161,31 @@
13161
13161
  // Types
13162
13162
 
13163
13163
  /**
13164
- * - match without highlight
13165
- * - single match (index), length already known
13166
- * - single match (start, end)
13167
- * - multiple matches (start, end), probably shouldn't overlap
13164
+ * - boolean: match without highlight
13165
+ * - number: single match (index), length already known
13166
+ * - []: single match (start, end)
13167
+ * - [][]: multiple matches (start, end), shouldn't overlap
13168
13168
  */
13169
13169
 
13170
13170
  // Composables
13171
13171
  const defaultFilter = (value, query, item) => {
13172
13172
  if (value == null || query == null) return -1;
13173
- return value.toString().toLocaleLowerCase().indexOf(query.toString().toLocaleLowerCase());
13173
+ value = value.toString().toLocaleLowerCase();
13174
+ query = query.toString().toLocaleLowerCase();
13175
+ const result = [];
13176
+ let idx = value.indexOf(query);
13177
+ while (~idx) {
13178
+ result.push([idx, idx + query.length]);
13179
+ idx = value.indexOf(query, idx + query.length);
13180
+ }
13181
+ return result.length ? result : -1;
13174
13182
  };
13183
+ function normaliseMatch(match, query) {
13184
+ if (match == null || typeof match === 'boolean' || match === -1) return;
13185
+ if (typeof match === 'number') return [[match, query.length]];
13186
+ if (Array.isArray(match[0])) return match;
13187
+ return [match];
13188
+ }
13175
13189
  const makeFilterProps = propsFactory({
13176
13190
  customFilter: Function,
13177
13191
  customKeyFilter: Object,
@@ -13202,7 +13216,7 @@
13202
13216
  const keyFilter = options?.customKeyFilter?.[key];
13203
13217
  match = keyFilter ? keyFilter(value, query, item) : filter(value, query, item);
13204
13218
  if (match !== -1 && match !== false) {
13205
- if (keyFilter) customMatches[key] = match;else defaultMatches[key] = match;
13219
+ if (keyFilter) customMatches[key] = normaliseMatch(match, query);else defaultMatches[key] = normaliseMatch(match, query);
13206
13220
  } else if (options?.filterMode === 'every') {
13207
13221
  continue loop;
13208
13222
  }
@@ -13210,7 +13224,7 @@
13210
13224
  } else {
13211
13225
  match = filter(item, query, item);
13212
13226
  if (match !== -1 && match !== false) {
13213
- defaultMatches.title = match;
13227
+ defaultMatches.title = normaliseMatch(match, query);
13214
13228
  }
13215
13229
  }
13216
13230
  const defaultMatchesLength = Object.keys(defaultMatches).length;
@@ -13270,20 +13284,26 @@
13270
13284
  getMatches
13271
13285
  };
13272
13286
  }
13287
+ function highlightResult(name, text, matches) {
13288
+ if (matches == null || !matches.length) return text;
13289
+ return matches.map((match, i) => {
13290
+ const start = i === 0 ? 0 : matches[i - 1][1];
13291
+ const result = [vue.createVNode("span", {
13292
+ "class": `${name}__unmask`
13293
+ }, [text.slice(start, match[0])]), vue.createVNode("span", {
13294
+ "class": `${name}__mask`
13295
+ }, [text.slice(match[0], match[1])])];
13296
+ if (i === matches.length - 1) {
13297
+ result.push(vue.createVNode("span", {
13298
+ "class": `${name}__unmask`
13299
+ }, [text.slice(match[1])]));
13300
+ }
13301
+ return vue.createVNode(vue.Fragment, null, [result]);
13302
+ });
13303
+ }
13273
13304
 
13274
13305
  // Types
13275
13306
 
13276
- function highlightResult$1(text, matches, length) {
13277
- if (matches == null) return text;
13278
- if (Array.isArray(matches)) throw new Error('Multiple matches is not implemented');
13279
- return typeof matches === 'number' && ~matches ? vue.createVNode(vue.Fragment, null, [vue.createVNode("span", {
13280
- "class": "v-autocomplete__unmask"
13281
- }, [text.substr(0, matches)]), vue.createVNode("span", {
13282
- "class": "v-autocomplete__mask"
13283
- }, [text.substr(matches, length)]), vue.createVNode("span", {
13284
- "class": "v-autocomplete__unmask"
13285
- }, [text.substr(matches + length)])]) : text;
13286
- }
13287
13307
  const makeVAutocompleteProps = propsFactory({
13288
13308
  autoSelectFirst: {
13289
13309
  type: [Boolean, String]
@@ -13655,7 +13675,7 @@
13655
13675
  }, null)]);
13656
13676
  },
13657
13677
  title: () => {
13658
- return isPristine.value ? item.title : highlightResult$1(item.title, getMatches(item)?.title, search.value?.length ?? 0);
13678
+ return isPristine.value ? item.title : highlightResult('v-autocomplete', item.title, getMatches(item)?.title);
13659
13679
  }
13660
13680
  });
13661
13681
  }
@@ -17148,17 +17168,6 @@
17148
17168
 
17149
17169
  // Types
17150
17170
 
17151
- function highlightResult(text, matches, length) {
17152
- if (matches == null) return text;
17153
- if (Array.isArray(matches)) throw new Error('Multiple matches is not implemented');
17154
- return typeof matches === 'number' && ~matches ? vue.createVNode(vue.Fragment, null, [vue.createVNode("span", {
17155
- "class": "v-combobox__unmask"
17156
- }, [text.substr(0, matches)]), vue.createVNode("span", {
17157
- "class": "v-combobox__mask"
17158
- }, [text.substr(matches, length)]), vue.createVNode("span", {
17159
- "class": "v-combobox__unmask"
17160
- }, [text.substr(matches + length)])]) : text;
17161
- }
17162
17171
  const makeVComboboxProps = propsFactory({
17163
17172
  autoSelectFirst: {
17164
17173
  type: [Boolean, String]
@@ -17572,7 +17581,7 @@
17572
17581
  }, null)]);
17573
17582
  },
17574
17583
  title: () => {
17575
- return isPristine.value ? item.title : highlightResult(item.title, getMatches(item)?.title, search.value?.length ?? 0);
17584
+ return isPristine.value ? item.title : highlightResult('v-combobox', item.title, getMatches(item)?.title);
17576
17585
  }
17577
17586
  });
17578
17587
  }
@@ -28521,7 +28530,7 @@
28521
28530
  };
28522
28531
  });
28523
28532
  }
28524
- const version$1 = "3.7.15-dev.2025-03-06";
28533
+ const version$1 = "3.7.15-dev.2025-03-07";
28525
28534
  createVuetify$1.version = version$1;
28526
28535
 
28527
28536
  // Vue's inject() can only be used in setup
@@ -28546,7 +28555,7 @@
28546
28555
  ...options
28547
28556
  });
28548
28557
  };
28549
- const version = "3.7.15-dev.2025-03-06";
28558
+ const version = "3.7.15-dev.2025-03-07";
28550
28559
  createVuetify.version = version;
28551
28560
 
28552
28561
  exports.blueprints = index;