-
-
+
+
{{ M_value }}
-
{{ description }}
-
-
+
diff --git a/app/src/components/StdDesign/StdDataEntry/index.tsx b/app/src/components/StdDesign/StdDataEntry/index.tsx
new file mode 100644
index 00000000..82741714
--- /dev/null
+++ b/app/src/components/StdDesign/StdDataEntry/index.tsx
@@ -0,0 +1,101 @@
+import { h } from 'vue'
+import { Input, InputNumber, Switch, Textarea } from 'ant-design-vue'
+import _ from 'lodash'
+import StdDataEntry from './StdDataEntry'
+import StdSelector from './components/StdSelector.vue'
+import StdSelect from './components/StdSelect.vue'
+import StdPassword from './components/StdPassword.vue'
+import type { StdDesignEdit } from '@/components/StdDesign/types'
+
+const fn = _.get
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+function readonly(edit: StdDesignEdit, dataSource: any, dataIndex: any) {
+ return h('p', fn(dataSource, dataIndex))
+}
+
+function placeholder_helper(edit: StdDesignEdit) {
+ return typeof edit.config?.placeholder === 'function' ? edit.config?.placeholder() : edit.config?.placeholder
+}
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+function input(edit: StdDesignEdit, dataSource: any, dataIndex: any) {
+ return h(Input, {
+ 'placeholder': placeholder_helper(edit),
+ 'value': dataSource?.[dataIndex],
+ 'onUpdate:value': value => {
+ dataSource[dataIndex] = value
+ },
+ })
+}
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+function inputNumber(edit: StdDesignEdit, dataSource: any, dataIndex: any) {
+ return h(InputNumber, {
+ 'placeholder': placeholder_helper(edit),
+ 'min': edit.config?.min,
+ 'max': edit.config?.max,
+ 'value': dataSource?.[dataIndex],
+ 'onUpdate:value': value => {
+ dataSource[dataIndex] = value
+ },
+ })
+}
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+function textarea(edit: StdDesignEdit, dataSource: any, dataIndex: any) {
+ return h(Textarea, {
+ 'placeholder': placeholder_helper(edit),
+ 'value': dataSource?.[dataIndex],
+ 'onUpdate:value': value => {
+ dataSource[dataIndex] = value
+ },
+ })
+}
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+function password(edit: StdDesignEdit, dataSource: any, dataIndex: any) {
+ return
+}
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+function select(edit: StdDesignEdit, dataSource: any, dataIndex: any) {
+ return
+}
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+function selector(edit: StdDesignEdit, dataSource: any, dataIndex: any) {
+ return
+}
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+function switcher(edit: StdDesignEdit, dataSource: any, dataIndex: any) {
+ return h(Switch, {
+ 'checked': dataSource?.[dataIndex],
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ 'onUpdate:checked': (value: any) => {
+ dataSource[dataIndex] = value
+ },
+ })
+}
+
+export {
+ readonly,
+ input,
+ textarea,
+ select,
+ selector,
+ password,
+ inputNumber,
+ switcher,
+}
+
+export default StdDataEntry
diff --git a/app/src/components/StdDataEntry/style.less b/app/src/components/StdDesign/StdDataEntry/style.less
similarity index 100%
rename from app/src/components/StdDataEntry/style.less
rename to app/src/components/StdDesign/StdDataEntry/style.less
diff --git a/app/src/components/StdDesign/types.d.ts b/app/src/components/StdDesign/types.d.ts
new file mode 100644
index 00000000..316b073d
--- /dev/null
+++ b/app/src/components/StdDesign/types.d.ts
@@ -0,0 +1,49 @@
+import Curd from '@/api/curd'
+import {IKeyEvt} from '@/components/StdDesign/StdDataDisplay/types'
+import {Ref} from 'vue'
+
+export interface StdDesignEdit {
+ type?: function // component type
+
+ mask?: {
+ [key: string]: () => string
+ } // use for select-option
+
+ rules?: [] // validator rules
+
+ selector?: {
+ get_params?: {}
+ recordValueIndex: any // relative to api return
+ selectionType: any
+ api: Curd,
+ valueApi?: Curd,
+ columns: any
+ disable_search?: boolean
+ description?: string
+ bind?: any
+ itemKey?: any // default is id
+ dataSourceValueIndex?: any // relative to dataSource
+ } // StdSelector Config
+
+ config?: {
+ label?: string | (() => string) // label for form item
+ size?: string // class size of Std image upload
+ placeholder?: string | (() => string) // placeholder for input
+ generate?: boolean // generate btn for StdPassword
+ min?: number // min value for input number
+ max?: number // max value for input number
+ error_messages?: Ref
+ hint?: string | (() => string) // hint form item
+ }
+
+ flex?: Flex
+}
+
+
+export interface Flex {
+ sm?: string | number | boolean
+ md?: string | number | boolean
+ lg?: string | number | boolean
+ xl?: string | number | boolean
+ xxl?: string | number | boolean
+}
diff --git a/app/src/components/SwitchAppearance/SwitchAppearance.vue b/app/src/components/SwitchAppearance/SwitchAppearance.vue
index ef623595..3dc59864 100644
--- a/app/src/components/SwitchAppearance/SwitchAppearance.vue
+++ b/app/src/components/SwitchAppearance/SwitchAppearance.vue
@@ -1,12 +1,13 @@
@@ -38,8 +37,8 @@ async function toggleAppearance() {
:aria-checked="isDark"
@click="toggleAppearance"
>
-
-
+
+
diff --git a/app/src/components/SwitchAppearance/icons/VPIconMoon.vue b/app/src/components/SwitchAppearance/icons/VPIconMoon.vue
index a6bc34cd..1907e541 100644
--- a/app/src/components/SwitchAppearance/icons/VPIconMoon.vue
+++ b/app/src/components/SwitchAppearance/icons/VPIconMoon.vue
@@ -1,6 +1,10 @@
-
diff --git a/app/src/components/SwitchAppearance/icons/VPIconSun.vue b/app/src/components/SwitchAppearance/icons/VPIconSun.vue
index 622df216..64abf464 100644
--- a/app/src/components/SwitchAppearance/icons/VPIconSun.vue
+++ b/app/src/components/SwitchAppearance/icons/VPIconSun.vue
@@ -1,18 +1,18 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/components/VPSwitch/VPSwitch.vue b/app/src/components/VPSwitch/VPSwitch.vue
index 27df45d1..6f1677f8 100644
--- a/app/src/components/VPSwitch/VPSwitch.vue
+++ b/app/src/components/VPSwitch/VPSwitch.vue
@@ -1,8 +1,15 @@
-