@adminforth/clone-row 1.2.15 → 1.2.17
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/build.log +2 -2
- package/custom/CloneRowThreeDots.vue +12 -8
- package/dist/custom/CloneRowThreeDots.vue +12 -8
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
- package/types.ts +5 -0
package/build.log
CHANGED
|
@@ -8,5 +8,5 @@ custom/CloneRowButton.vue
|
|
|
8
8
|
custom/CloneRowThreeDots.vue
|
|
9
9
|
custom/tsconfig.json
|
|
10
10
|
|
|
11
|
-
sent 3,
|
|
12
|
-
total size is 3,
|
|
11
|
+
sent 3,753 bytes received 77 bytes 7,660.00 bytes/sec
|
|
12
|
+
total size is 3,467 speedup is 0.91
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
:to="{
|
|
5
5
|
name: `resource-create`,
|
|
6
6
|
params: { resourceId: props.meta.resourceId },
|
|
7
|
-
query:
|
|
8
|
-
values: save_btoa(JSON.stringify(redirectToCreatePage())),
|
|
9
|
-
}
|
|
7
|
+
query: cloneQuery
|
|
10
8
|
}">
|
|
11
9
|
<IconFileCloneSolid class="w-5 h-5 me-2 text-lightPrimary dark:text-darkPrimary"/>
|
|
12
10
|
{{ $t('Clone record') }}
|
|
@@ -15,7 +13,9 @@
|
|
|
15
13
|
|
|
16
14
|
<script lang="ts" setup>
|
|
17
15
|
import { Tooltip } from '@/afcl';
|
|
16
|
+
import { computed } from 'vue';
|
|
18
17
|
import { AdminUser, type AdminForthResourceCommon } from '@/types';
|
|
18
|
+
import { btoa_function } from '@/utils';
|
|
19
19
|
import { IconFileCloneSolid } from '@iconify-prerendered/vue-flowbite';
|
|
20
20
|
import { useI18n } from 'vue-i18n';
|
|
21
21
|
|
|
@@ -40,10 +40,14 @@ function redirectToCreatePage() {
|
|
|
40
40
|
dataToFill[field.name] = props.record[field.name];
|
|
41
41
|
}
|
|
42
42
|
return dataToFill;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function save_btoa(str) {
|
|
46
|
-
const cleaned = str.replace(/\uFEFF/g, '');
|
|
47
|
-
return btoa(cleaned);
|
|
48
43
|
}
|
|
44
|
+
|
|
45
|
+
const cloneQuery = computed(() => {
|
|
46
|
+
try {
|
|
47
|
+
return { values: btoa_function(JSON.stringify(redirectToCreatePage())) };
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.error('Failed to build clone query', error);
|
|
50
|
+
return {};
|
|
51
|
+
}
|
|
52
|
+
});
|
|
49
53
|
</script>
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
:to="{
|
|
5
5
|
name: `resource-create`,
|
|
6
6
|
params: { resourceId: props.meta.resourceId },
|
|
7
|
-
query:
|
|
8
|
-
values: save_btoa(JSON.stringify(redirectToCreatePage())),
|
|
9
|
-
}
|
|
7
|
+
query: cloneQuery
|
|
10
8
|
}">
|
|
11
9
|
<IconFileCloneSolid class="w-5 h-5 me-2 text-lightPrimary dark:text-darkPrimary"/>
|
|
12
10
|
{{ $t('Clone record') }}
|
|
@@ -15,7 +13,9 @@
|
|
|
15
13
|
|
|
16
14
|
<script lang="ts" setup>
|
|
17
15
|
import { Tooltip } from '@/afcl';
|
|
16
|
+
import { computed } from 'vue';
|
|
18
17
|
import { AdminUser, type AdminForthResourceCommon } from '@/types';
|
|
18
|
+
import { btoa_function } from '@/utils';
|
|
19
19
|
import { IconFileCloneSolid } from '@iconify-prerendered/vue-flowbite';
|
|
20
20
|
import { useI18n } from 'vue-i18n';
|
|
21
21
|
|
|
@@ -40,10 +40,14 @@ function redirectToCreatePage() {
|
|
|
40
40
|
dataToFill[field.name] = props.record[field.name];
|
|
41
41
|
}
|
|
42
42
|
return dataToFill;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function save_btoa(str) {
|
|
46
|
-
const cleaned = str.replace(/\uFEFF/g, '');
|
|
47
|
-
return btoa(cleaned);
|
|
48
43
|
}
|
|
44
|
+
|
|
45
|
+
const cloneQuery = computed(() => {
|
|
46
|
+
try {
|
|
47
|
+
return { values: btoa_function(JSON.stringify(redirectToCreatePage())) };
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.error('Failed to build clone query', error);
|
|
50
|
+
return {};
|
|
51
|
+
}
|
|
52
|
+
});
|
|
49
53
|
</script>
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { type PluginsCommonOptions } from "adminforth";
|
|
2
2
|
export interface PluginOptions extends PluginsCommonOptions {
|
|
3
|
+
/**
|
|
4
|
+
* When `true`, the Clone button is displayed as a standalone quick-action icon
|
|
5
|
+
* directly in the row actions area (next to buttons like Approve).
|
|
6
|
+
* When `false` (default), the Clone option appears inside the three-dots dropdown menu.
|
|
7
|
+
*/
|
|
3
8
|
makeCloneButtonAsQuickAction?: boolean;
|
|
4
9
|
}
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import {type PluginsCommonOptions } from "adminforth";
|
|
2
2
|
|
|
3
3
|
export interface PluginOptions extends PluginsCommonOptions {
|
|
4
|
+
/**
|
|
5
|
+
* When `true`, the Clone button is displayed as a standalone quick-action icon
|
|
6
|
+
* directly in the row actions area (next to buttons like Approve).
|
|
7
|
+
* When `false` (default), the Clone option appears inside the three-dots dropdown menu.
|
|
8
|
+
*/
|
|
4
9
|
makeCloneButtonAsQuickAction?: boolean;
|
|
5
10
|
}
|