From b618340cecbae3a64dc0b1e7b0bf841159613660 Mon Sep 17 00:00:00 2001
From: 18alantom <2.alan.tom@gmail.com>
Date: Fri, 31 Mar 2023 14:00:37 +0530
Subject: [PATCH] refactor: cleanup provide-injects - type a bunch of form
element .vue files
---
fyo/model/types.ts | 2 +-
src/components/Controls/AutoComplete.vue | 3 -
src/components/Controls/Base.vue | 141 +++++++++++--------
src/components/Controls/Check.vue | 33 +++--
src/components/Controls/Currency.vue | 33 ++---
src/components/Controls/LanguageSelector.vue | 18 +--
src/components/Controls/Select.vue | 36 ++---
src/components/Controls/Table.vue | 3 -
src/components/Controls/TableRow.vue | 6 +-
src/components/Dropdown.vue | 10 +-
src/components/DropdownWithActions.vue | 39 +++--
src/components/TwoColumnForm.vue | 7 -
src/pages/CommonForm/CommonForm.vue | 2 -
src/pages/InvoiceForm.vue | 2 -
src/pages/QuickEditForm.vue | 2 -
src/pages/SetupWizard/SetupWizard.vue | 2 -
src/utils/index.ts | 11 +-
src/utils/types.ts | 9 ++
utils/index.ts | 27 ++++
19 files changed, 226 insertions(+), 160 deletions(-)
diff --git a/fyo/model/types.ts b/fyo/model/types.ts
index 36135212..6f2d9f88 100644
--- a/fyo/model/types.ts
+++ b/fyo/model/types.ts
@@ -68,7 +68,7 @@ export interface Action {
group?: string;
type?: 'primary' | 'secondary';
component?: {
- template?: string;
+ template: string;
};
}
diff --git a/src/components/Controls/AutoComplete.vue b/src/components/Controls/AutoComplete.vue
index e52028d9..6e43ca6c 100644
--- a/src/components/Controls/AutoComplete.vue
+++ b/src/components/Controls/AutoComplete.vue
@@ -96,9 +96,6 @@ export default {
},
},
},
- inject: {
- doc: { default: null },
- },
mounted() {
const value = this.linkValue || this.value;
this.setLinkValue(this.getLinkValue(value));
diff --git a/src/components/Controls/Base.vue b/src/components/Controls/Base.vue
index 03bda284..efc9af6e 100644
--- a/src/components/Controls/Base.vue
+++ b/src/components/Controls/Base.vue
@@ -14,10 +14,10 @@
:placeholder="inputPlaceholder"
:readonly="isReadOnly"
:step="step"
- :max="df.maxvalue"
- :min="df.minvalue"
+ :max="isNumeric(df) ? df.maxvalue : undefined"
+ :min="isNumeric(df) ? df.minvalue : undefined"
:style="containerStyles"
- @blur="(e) => !isReadOnly && triggerChange(e.target.value)"
+ @blur="onBlur"
@focus="(e) => !isReadOnly && $emit('focus', e)"
@input="(e) => !isReadOnly && $emit('input', e)"
:tabindex="isReadOnly ? '-1' : '0'"
@@ -25,61 +25,71 @@
-
-
diff --git a/src/components/Controls/Check.vue b/src/components/Controls/Check.vue
index c137025d..2ae72b95 100644
--- a/src/components/Controls/Check.vue
+++ b/src/components/Controls/Check.vue
@@ -12,7 +12,7 @@
:class="isReadOnly ? 'cursor-default' : 'cursor-pointer'"
>