From 2477c50170e0837a4d8998de886e03c37f2e11a5 Mon Sep 17 00:00:00 2001 From: AI Engineer Date: Thu, 11 Jun 2026 20:16:19 +0800 Subject: [PATCH] chore: release v1.0.8 with component-based refactor, purified state management, and optimized rendering By: AICoder --- dist/datatable.js | 21 ++++++++++++++------- dist/datatable.min.js | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/DataTable.js | 21 ++++++++++++++------- test/lib/datatable.js | 21 ++++++++++++++------- test/lib/datatable.min.js | 2 +- 7 files changed, 47 insertions(+), 26 deletions(-) diff --git a/dist/datatable.js b/dist/datatable.js index e0bd832..3f64b94 100644 --- a/dist/datatable.js +++ b/dist/datatable.js @@ -623,12 +623,15 @@ form.data = row; form.state.schema = [{ ...field, type: formType, options: ((_b = field.settings) == null ? void 0 : _b.options) || field.options, name: field.id, label: "" }]; } + const isComplex = ["textarea", "TagsInput", "checkbox", "radio"].includes(formType); + const minWidth = isComplex ? 300 : 200; Object.assign(overlay.style, { display: "flex", left: rect.left - rootRect.left + "px", top: rect.top - rootRect.top + "px", - width: (formType === "textarea" || formType === "TagsInput" ? Math.max(rect.width, 300) : rect.width) + "px", - height: formType === "textarea" || formType === "TagsInput" ? "auto" : rect.height + "px" + width: Math.max(rect.width, minWidth) + "px", + height: "auto", + minHeight: rect.height + "px" }); setTimeout(() => { var _a2; @@ -761,7 +764,7 @@ container.addField = async () => { container.hideColumnMenu(); const data = globalThis.NewState({ id: "c" + Date.now().toString().slice(-4), name: "New Field", user_type: "text", decimals: 0, isIndex: false, memo: "", options_str: "" }); - const d = container.querySelector(`Dialog[id="${container.id}_field_dialog"]`); + const d = container.querySelector(`Modal[id="${container.id}_field_modal"]`); if (!d) return; Object.assign(d.state, { title: "Add Field", buttons: ["Cancel", "Save"] }); const form = d.querySelector("AutoForm"); @@ -788,7 +791,7 @@ const f = state.activeField; const s = f.settings || {}; const data = globalThis.NewState({ id: f.id, name: f.name, memo: f.memo || "", isIndex: !!f.isIndex, user_type: s.formType || "text", decimals: s.decimals || 0, prefix: s.prefix || "", suffix: s.suffix || "", thousandSep: !!s.thousandSep, labelOn: s.labelOn || "", labelOff: s.labelOff || "", format: s.format || "", placeholder: s.placeholder || "", options_str: formatOptionsStr(s.options) }); - const d = container.querySelector(`Dialog[id="${container.id}_field_dialog"]`); + const d = container.querySelector(`Modal[id="${container.id}_field_modal"]`); if (!d) return; Object.assign(d.state, { title: "Edit Field", buttons: ["Cancel", "Save"] }); const form = d.querySelector("AutoForm"); @@ -915,9 +918,13 @@ - - - + +
+
+ + +
+