diff --git a/package.json b/package.json index 673e90b..004a702 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "type": "interface", "path": "dist/index.js", "source": "src/index.ts", - "host": "^9.25.1" + "host": "^10.1.0" }, "files": [ "dist" @@ -36,6 +36,7 @@ "release": "semantic-release" }, "devDependencies": { + "@directus/extensions-sdk": "^10.2.0", "@directus/format-title": "^10.0.0", "@directus/types": "^9.25.3", "@directus/utils": "^9.25.3", @@ -51,12 +52,12 @@ "lodash-es": "^4.17.21", "prettier": "^2.8.7", "rollup-plugin-copy": "^3.4.0", - "sass": "^1.62.0", + "sass": "^1.69.5", + "sass-loader": "^13.3.2", "semantic-release": "^21.0.2", "typescript": "^5.0.4" }, "peerDependencies": { - "@directus/extensions-sdk": "^9.25.3", "vue": "^3.2.47", "vue-i18n": "^9.2.2" }, diff --git a/src/composables/use-group-section.ts b/src/composables/use-group-section.ts index b4a386f..b0c3e1d 100644 --- a/src/composables/use-group-section.ts +++ b/src/composables/use-group-section.ts @@ -1,6 +1,5 @@ -import { Field, ValidationError } from '@directus/types'; -import { isNil, merge } from 'lodash-es'; -import { computed, Ref, unref } from 'vue'; +import type { Field, ValidationError } from '@directus/types'; +import { Ref, computed, unref } from 'vue'; import { useI18n } from 'vue-i18n'; interface UseGroupSectionOptions { @@ -14,7 +13,7 @@ export function useGroupSection({ field, fields: groupFields, values, validation const { t } = useI18n(); const fieldsInSection = computed(() => { - const fields: Field[] = [merge({}, unref(field), { hideLabel: true })]; + const fields: Field[] = [Object.assign({}, unref(field), { hideLabel: true })]; if (unref(field).meta?.special?.includes('group')) { fields.push(...getFieldsForGroup(unref(field).meta?.field, [], unref(groupFields))); @@ -49,7 +48,7 @@ export function useGroupSection({ field, fields: groupFields, values, validation function getFieldsForGroup(group: undefined | string, passed: string[] = [], groupFields: Field[]): Field[] { const fieldsInGroup: Field[] = groupFields.filter((field) => { - return field.meta?.group === group || (group === null && isNil(field.meta)); + return field.meta?.group === group || (group === null && !field.meta); }); for (const field of fieldsInGroup) { diff --git a/src/group-tabs.vue b/src/group-tabs.vue index a894f3b..42778a8 100644 --- a/src/group-tabs.vue +++ b/src/group-tabs.vue @@ -1,42 +1,9 @@ - - + + + diff --git a/src/index.ts b/src/index.ts index 8b6e584..76b7ff9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,6 @@ -import { defineInterface } from '@directus/utils'; import InterfaceGroupTabs from './group-tabs.vue'; -export default defineInterface({ +export default { id: 'group-tabs', name: 'Tab Group', description: 'Display fields in a tab group', @@ -14,4 +13,4 @@ export default defineInterface({ localTypes: ['group'], group: 'group', options: [], -}); +}; diff --git a/src/tab-button.vue b/src/tab-button.vue index 989c1ba..f03e959 100644 --- a/src/tab-button.vue +++ b/src/tab-button.vue @@ -1,19 +1,3 @@ - - + + + diff --git a/src/tab-group.vue b/src/tab-group.vue index 2b97e50..27831f8 100644 --- a/src/tab-group.vue +++ b/src/tab-group.vue @@ -1,24 +1,6 @@ - + + + diff --git a/tsconfig.json b/tsconfig.json index b6b35aa..68a35bb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { - "target": "ES2020", - "lib": ["ES2019", "DOM"], - "module": "esnext", + "target": "ES2022", + "lib": ["ES2022", "DOM"], + "module": "ES2022", "moduleResolution": "node", "strict": true, "noFallthroughCasesInSwitch": true,