diff --git a/custom/ListCell.vue b/custom/ListCell.vue
new file mode 100644
index 0000000..99edf13
--- /dev/null
+++ b/custom/ListCell.vue
@@ -0,0 +1,25 @@
+
+
+ {{ limitedText }}
+
+
+
+
\ No newline at end of file
diff --git a/custom/SingleMultiInput.vue b/custom/SingleMultiInput.vue
new file mode 100644
index 0000000..30854af
--- /dev/null
+++ b/custom/SingleMultiInput.vue
@@ -0,0 +1,76 @@
+
+ emit('update:value', $event)" />
+
+
+
+
diff --git a/custom/tsconfig.json b/custom/tsconfig.json
index d313f46..ec802aa 100644
--- a/custom/tsconfig.json
+++ b/custom/tsconfig.json
@@ -4,11 +4,11 @@
"paths": {
"@/*": [
// "node_modules/adminforth/dist/spa/src/*"
- "../../../spa/src/*"
+ "../../../adminforth/spa/src/*"
],
"*": [
// "node_modules/adminforth/dist/spa/node_modules/*"
- "../../../spa/node_modules/*"
+ "../../../adminforth/spa/node_modules/*"
],
"@@/*": [
// "node_modules/adminforth/dist/spa/src/*"
diff --git a/index.ts b/index.ts
index 5a5cb99..6993a53 100644
--- a/index.ts
+++ b/index.ts
@@ -165,6 +165,21 @@ export default class I18nPlugin extends AdminForthPlugin {
throw new Error(`Field ${this.trFieldNames[lang]} not found for storing translation for language ${lang}
in resource ${resourceConfig.resourceId}, consider adding it to columns or change trFieldNames option to remap it to existing column`);
}
+
+ column.components = column.components || {};
+
+ // set edit and create custom component - SingleMultiInput.vue
+ column.components.edit = {
+ file: this.componentPath('SingleMultiInput.vue'),
+ };
+ column.components.create = {
+ file: this.componentPath('SingleMultiInput.vue'),
+ };
+
+ // set ListCell for list
+ column.components.list = {
+ file: this.componentPath('ListCell.vue'),
+ };
}
this.enFieldName = this.trFieldNames['en'] || 'en_string';
@@ -186,6 +201,16 @@ export default class I18nPlugin extends AdminForthPlugin {
throw new Error(`Field ${this.enFieldName} not found column to store english original string in resource ${resourceConfig.resourceId}`);
}
+ enColumn.components = enColumn.components || {};
+ enColumn.components.edit = {
+ file: this.componentPath('SingleMultiInput.vue'),
+ };
+ enColumn.components.create = {
+ file: this.componentPath('SingleMultiInput.vue'),
+ };
+ enColumn.components.list = {
+ file: this.componentPath('ListCell.vue'),
+ };
enColumn.editReadonly = true;
// if sourceFieldName defined, check it exists