mediacube-ui 0.1.330 → 0.1.331

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/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.331](https://github.com/MediaCubeCo/mcui/compare/v0.1.330...v0.1.331) (2024-11-12)
6
+
5
7
  ### [0.1.330](https://github.com/MediaCubeCo/mcui/compare/v0.1.329...v0.1.330) (2024-11-12)
6
8
 
7
9
  ### [0.1.329](https://github.com/MediaCubeCo/mcui/compare/v0.1.328...v0.1.329) (2024-11-11)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediacube-ui",
3
- "version": "0.1.330",
3
+ "version": "0.1.331",
4
4
  "description": "Design system for Mediacube services",
5
5
  "author": "Mediacube",
6
6
  "private": false,
@@ -22,7 +22,7 @@
22
22
  secondary-color="purple"
23
23
  @mouseup="() => handlePresetMouseUp(preset)"
24
24
  >
25
- {{ preset.name }}
25
+ {{ preset.visibleName }}
26
26
  </mc-button>
27
27
  </div>
28
28
  </div>
@@ -342,7 +342,7 @@ export default {
342
342
  const hasLongName = preset?.name?.length > this.preset_max_size
343
343
  return {
344
344
  ...preset,
345
- name: hasLongName ? `${preset.name.slice(0, this.preset_max_size)}...` : preset.name,
345
+ visibleName: hasLongName ? `${preset.name.slice(0, this.preset_max_size)}...` : preset.name,
346
346
  tooltip: hasLongName ? preset?.name : null,
347
347
  }
348
348
  })
@@ -377,6 +377,9 @@ export default {
377
377
  if (_isEmpty(this.value.filter) && _isEmpty(newVal)) {
378
378
  this.buttonConfirmIsDisable = true
379
379
  }
380
+ if (!_isEqual(this.activePreset?.filter, newVal)) {
381
+ this.activePreset = null
382
+ }
380
383
  },
381
384
  },
382
385
  mounted() {
@@ -392,7 +395,10 @@ export default {
392
395
  },
393
396
  methods: {
394
397
  updatePresets() {
395
- this.presets = JSON.parse(window.localStorage.mcFilterPresets || '{}')
398
+ this.presets = {
399
+ [this.name]: [],
400
+ ...JSON.parse(window.localStorage.mcFilterPresets || '{}'),
401
+ }
396
402
  },
397
403
  handlerSetFastFilter(tag) {
398
404
  const filterValue = tag.relation ? { [tag.relation]: tag.default } : tag.default
@@ -671,22 +677,6 @@ export default {
671
677
  if (_isEmpty(this.currentValues)) {
672
678
  this.buttonConfirmIsDisable = true
673
679
  }
674
- if (this.activePreset) {
675
- const mappedPresets = this.presets[this.name].map(p => {
676
- if (p.name === this.activePreset.name) {
677
- return {
678
- name: p.name,
679
- filter: _cloneDeep(this.currentValues),
680
- filter_name: _cloneDeep(this.currentValuesName),
681
- }
682
- }
683
- return p
684
- })
685
- this.presets[this.name] = [...mappedPresets]
686
- window.localStorage.mcFilterPresets = JSON.stringify({
687
- ...this.presets,
688
- })
689
- }
690
680
  },
691
681
  handleDeletePreset(preset) {
692
682
  const filteredPresets = this.presets[this.name].filter(p => p.name !== preset.name)