sprintify-ui 0.8.68 → 0.8.69
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/sprintify-ui.es.js +2972 -2966
- package/dist/types/components/BaseAutocomplete.vue.d.ts +2 -129
- package/dist/types/components/BaseAutocompleteFetch.vue.d.ts +1 -106
- package/dist/types/components/BaseBelongsTo.vue.d.ts +1 -106
- package/dist/types/components/BaseBelongsToFetch.vue.d.ts +1 -92
- package/dist/types/components/BaseCalendar.vue.d.ts +1 -3
- package/dist/types/components/BaseDataIterator.vue.d.ts +23 -11
- package/dist/types/components/BaseDataTable.vue.d.ts +34 -171
- package/dist/types/components/BaseDataTableTemplate.vue.d.ts +1 -11
- package/dist/types/components/BaseDialog.vue.d.ts +2 -115
- package/dist/types/components/BaseFilePickerCrop.vue.d.ts +1 -7
- package/dist/types/components/BaseGantt.vue.d.ts +396 -3
- package/dist/types/components/BaseHasMany.vue.d.ts +1 -51
- package/dist/types/components/BaseTagAutocomplete.vue.d.ts +1 -33
- package/dist/types/components/BaseTagAutocompleteFetch.vue.d.ts +1 -84
- package/package.json +1 -1
- package/src/components/BaseDataIterator.stories.js +0 -7
- package/src/components/BaseDataIterator.vue +22 -15
- package/src/components/BaseDraggable.vue +20 -12
|
@@ -453,6 +453,7 @@ function updateFilterQueryValue(key: string, value: any) {
|
|
|
453
453
|
let newQuery = cloneDeep(query.value);
|
|
454
454
|
newQuery = set(newQuery, key, value);
|
|
455
455
|
newQuery = set(newQuery, 'page', 1);
|
|
456
|
+
|
|
456
457
|
updateQuery(newQuery);
|
|
457
458
|
}
|
|
458
459
|
|
|
@@ -635,6 +636,22 @@ function onRouteChange() {
|
|
|
635
636
|
|--------------------------------------------------------------------------
|
|
636
637
|
*/
|
|
637
638
|
|
|
639
|
+
const fullQuery = computed(() => {
|
|
640
|
+
|
|
641
|
+
const urlSplit = (url.value + '').split(/[?#]/);
|
|
642
|
+
const urlQueryString = urlSplit[1] ?? null;
|
|
643
|
+
const urlQuery = config.parseQueryString(urlQueryString);
|
|
644
|
+
|
|
645
|
+
// Ordered by priority
|
|
646
|
+
const allParams = merge(
|
|
647
|
+
cloneDeep(query.value),
|
|
648
|
+
cloneDeep(props.urlQuery),
|
|
649
|
+
cloneDeep(urlQuery)
|
|
650
|
+
);
|
|
651
|
+
|
|
652
|
+
return allParams;
|
|
653
|
+
});
|
|
654
|
+
|
|
638
655
|
function fetchWithLoading(force = false) {
|
|
639
656
|
fetch(force, true);
|
|
640
657
|
}
|
|
@@ -653,22 +670,12 @@ function fetch(force = false, showLoading = true) {
|
|
|
653
670
|
return;
|
|
654
671
|
}
|
|
655
672
|
|
|
656
|
-
const
|
|
673
|
+
const fullQueryInternal = fullQuery.value;
|
|
674
|
+
const fullQueryString = config.formatQueryString(fullQueryInternal);
|
|
657
675
|
|
|
676
|
+
const urlSplit = url.value.split(/[?#]/);
|
|
658
677
|
const baseUrl = urlSplit[0];
|
|
659
|
-
const
|
|
660
|
-
const urlQuery = config.parseQueryString(urlQueryString);
|
|
661
|
-
|
|
662
|
-
// Ordered by priority
|
|
663
|
-
const allParams = merge(
|
|
664
|
-
cloneDeep(query.value),
|
|
665
|
-
cloneDeep(props.urlQuery),
|
|
666
|
-
cloneDeep(urlQuery)
|
|
667
|
-
);
|
|
668
|
-
|
|
669
|
-
const queryString = config.formatQueryString(allParams);
|
|
670
|
-
|
|
671
|
-
const fullUrl = baseUrl + '?' + queryString;
|
|
678
|
+
const fullUrl = baseUrl + '?' + fullQueryString;
|
|
672
679
|
|
|
673
680
|
if (lastUrl == fullUrl && !force) {
|
|
674
681
|
return;
|
|
@@ -956,7 +963,7 @@ defineExpose({
|
|
|
956
963
|
fetchWithLoading: () => fetchWithLoading(true),
|
|
957
964
|
fetchWithoutLoading: () => fetchWithoutLoading(true),
|
|
958
965
|
scrollIntoView: scrollIntoViewAction,
|
|
959
|
-
query,
|
|
966
|
+
query: computed(() => fullQuery.value),
|
|
960
967
|
data: computed(() => dataInternal.value),
|
|
961
968
|
});
|
|
962
969
|
</script>
|
|
@@ -40,26 +40,34 @@ onMounted(() => {
|
|
|
40
40
|
handle: props.handle,
|
|
41
41
|
disabled: props.disabled,
|
|
42
42
|
onEnd: (event) => {
|
|
43
|
-
if (event.oldIndex !== undefined && event.newIndex !== undefined) {
|
|
44
|
-
const modelValue = cloneDeep(props.modelValue);
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
if (event.oldIndex === undefined || event.newIndex === undefined) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const modelValue = props.modelValue;
|
|
49
|
+
|
|
50
|
+
const modelValueUpdated = arrayMove(
|
|
51
|
+
modelValue,
|
|
52
|
+
event.oldIndex,
|
|
53
|
+
event.newIndex
|
|
54
|
+
);
|
|
51
55
|
|
|
56
|
+
nextTick(() => {
|
|
52
57
|
emit('update:modelValue', modelValueUpdated);
|
|
53
|
-
}
|
|
58
|
+
});
|
|
54
59
|
},
|
|
55
60
|
});
|
|
56
61
|
});
|
|
57
62
|
|
|
58
63
|
function arrayMove(array: any[], fromIndex: number, toIndex: number): any[] {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
// without mutating the original array
|
|
65
|
+
|
|
66
|
+
const newArray = [...array];
|
|
67
|
+
const item = newArray.splice(fromIndex, 1)[0];
|
|
68
|
+
newArray.splice(toIndex, 0, item);
|
|
69
|
+
|
|
70
|
+
return newArray;
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
onBeforeUnmount(() => {
|