@structured-field/widget-editor 1.2.0 → 1.2.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@structured-field/widget-editor",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "A lightweight JSON Schema form builder with support for relation fields (ForeignKey, QuerySet) and autocomplete search.",
5
5
  "type": "module",
6
6
  "main": "dist/structured-widget-editor.js",
@@ -24,12 +24,14 @@ export default {
24
24
  initialData: { default: undefined },
25
25
  errors: { type: Object, default: () => ({}) },
26
26
  customEditors: { type: Array, default: () => [] },
27
+ language: { type: String, default: '' },
27
28
  },
28
29
  emits: ['change'],
29
30
  expose: ['getValue'],
30
31
  provide() {
31
32
  return {
32
33
  customEditors: () => this.customEditors,
34
+ language: () => this.language,
33
35
  };
34
36
  },
35
37
  data() {
@@ -46,6 +46,9 @@ import SfIcon from './SfIcon.vue';
46
46
  export default {
47
47
  name: 'RelationEditor',
48
48
  components: { SfIcon },
49
+ inject: {
50
+ language: { from: 'language', default: () => () => '' },
51
+ },
49
52
  props: {
50
53
  schema: { type: Object, required: true },
51
54
  modelValue: { default: null },
@@ -151,6 +154,8 @@ export default {
151
154
  const url = new URL(this.searchUrl, window.location.origin);
152
155
  url.searchParams.set('_q', query || '');
153
156
  url.searchParams.set('page', String(page));
157
+ const lang = typeof this.language === 'function' ? this.language() : this.language;
158
+ if (lang) url.searchParams.set('_lang', lang);
154
159
 
155
160
  const response = await fetch(url, { credentials: 'same-origin' });
156
161
  if (!response.ok) return;
@@ -131,7 +131,8 @@
131
131
  border: 1px solid var(--border-color, #ccc);
132
132
  border-radius: 4px;
133
133
  background: var(--darkened-bg, #f8f8f8);
134
- overflow: hidden;
134
+ overflow: visible;
135
+ position: relative;
135
136
  }
136
137
 
137
138
  .sf-array-item {
@@ -156,6 +157,7 @@
156
157
  padding: 4px 8px;
157
158
  background: var(--darkened-bg, #f0f0f0);
158
159
  border-bottom: 1px solid var(--border-color, #ccc);
160
+ border-radius: 4px 4px 0 0;
159
161
  }
160
162
 
161
163
  .sf-array-item-left {