vue3-django 0.1.13 → 0.1.14

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.
@@ -8622,12 +8622,13 @@ const fp = { class: "json-editor" }, cp = ["aria-label"], dp = {
8622
8622
  modelValue: d.value,
8623
8623
  "onUpdate:modelValue": C[16] || (C[16] = (b) => d.value = b),
8624
8624
  type: ["textarea", "password"].includes(a.field.widget) ? a.field.widget : "text",
8625
+ autosize: a.field.widget === "textarea" ? a.field.autosize ?? { minRows: 8, maxRows: 24 } : !1,
8625
8626
  maxlength: a.field.max_length,
8626
8627
  autocomplete: a.field.autocomplete,
8627
8628
  placeholder: a.field.placeholder ?? [a.field.label, a.field.help_text].filter(Boolean).join(`
8628
8629
  `),
8629
8630
  "aria-label": a.field.label || a.field.name
8630
- }, null, 8, ["modelValue", "type", "maxlength", "autocomplete", "placeholder", "aria-label"]));
8631
+ }, null, 8, ["modelValue", "type", "autosize", "maxlength", "autocomplete", "placeholder", "aria-label"]));
8631
8632
  }
8632
8633
  };
8633
8634
  function bp(a) {
package/docs/migration.md CHANGED
@@ -201,6 +201,10 @@ const actions = [
201
201
  `#actions` 插槽可替换操作区域。布局转发 `action-done(result, action)` 和 `error`。
202
202
  其他位置也可直接使用 `<Actions>`;抽屉操作需要位于 Layout 子树中。
203
203
 
204
+ 表单 `widget: 'textarea'` 沿用原版默认自适应高度:最少 8 行、最多 24 行。
205
+ 通过字段配置 `autosize: { minRows: 4, maxRows: 12 }` 自定义行数范围,
206
+ 也可设为 `true` 随内容自动增高,或 `false` 关闭自适应高度。
207
+
204
208
  JSON 表单组件已迁移到 Vue 3,可从包入口导入 `JsonInput`、`JsonEditor`。
205
209
  字段配置支持 `widget: 'JsonInput'` / `widget: 'JsonEditor'`(也支持 `json-input`、
206
210
  `json-editor`),或直接传入组件。使用 `v-model` / `update:modelValue` 替代旧版
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue3-django",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "DRF metadata-driven Vue 3 framework",
5
5
  "repository": {
6
6
  "type": "git",
@@ -173,6 +173,9 @@ function mobileInput(v) {
173
173
  v-else
174
174
  v-model="value"
175
175
  :type="['textarea', 'password'].includes(field.widget) ? field.widget : 'text'"
176
+ :autosize="
177
+ field.widget === 'textarea' ? (field.autosize ?? { minRows: 8, maxRows: 24 }) : false
178
+ "
176
179
  :maxlength="field.max_length"
177
180
  :autocomplete="field.autocomplete"
178
181
  :placeholder="field.placeholder ?? [field.label, field.help_text].filter(Boolean).join('\n')"