@finema/core 1.4.34 → 1.4.36

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.
Files changed (60) hide show
  1. package/README.md +63 -63
  2. package/dist/module.d.mts +4 -4
  3. package/dist/module.d.ts +4 -4
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +7 -4
  6. package/dist/runtime/components/Alert.vue +49 -49
  7. package/dist/runtime/components/Avatar.vue +27 -27
  8. package/dist/runtime/components/Badge.vue +54 -54
  9. package/dist/runtime/components/Breadcrumb.vue +45 -45
  10. package/dist/runtime/components/Button/Group.vue +37 -37
  11. package/dist/runtime/components/Button/index.vue +77 -77
  12. package/dist/runtime/components/Card.vue +38 -38
  13. package/dist/runtime/components/Core.vue +13 -13
  14. package/dist/runtime/components/Dialog/index.vue +108 -108
  15. package/dist/runtime/components/Dropdown/index.vue +71 -71
  16. package/dist/runtime/components/Form/FieldWrapper.vue +23 -23
  17. package/dist/runtime/components/Form/Fields.vue +147 -136
  18. package/dist/runtime/components/Form/InputCheckbox/index.vue +21 -21
  19. package/dist/runtime/components/Form/InputDateTime/index.vue +51 -51
  20. package/dist/runtime/components/Form/InputRadio/index.vue +27 -27
  21. package/dist/runtime/components/Form/InputSelect/index.vue +37 -37
  22. package/dist/runtime/components/Form/InputStatic/index.vue +16 -16
  23. package/dist/runtime/components/Form/InputText/index.vue +27 -27
  24. package/dist/runtime/components/Form/InputTextarea/index.vue +25 -25
  25. package/dist/runtime/components/Form/InputToggle/index.vue +14 -14
  26. package/dist/runtime/components/Form/InputUploadDropzone/index.vue +170 -0
  27. package/dist/runtime/components/Form/InputUploadDropzone/types.d.ts +11 -0
  28. package/dist/runtime/components/Form/InputUploadDropzone/types.mjs +0 -0
  29. package/dist/runtime/components/Form/InputUploadFileClassic/index.vue +36 -36
  30. package/dist/runtime/components/Form/InputUploadFileClassicAuto/index.vue +160 -152
  31. package/dist/runtime/components/Form/index.vue +6 -6
  32. package/dist/runtime/components/Form/types.d.ts +4 -2
  33. package/dist/runtime/components/Form/types.mjs +1 -0
  34. package/dist/runtime/components/Icon.vue +23 -23
  35. package/dist/runtime/components/Image.vue +36 -36
  36. package/dist/runtime/components/Loader.vue +14 -14
  37. package/dist/runtime/components/Modal/index.vue +146 -146
  38. package/dist/runtime/components/SimplePagination.vue +96 -96
  39. package/dist/runtime/components/Slideover/index.vue +110 -110
  40. package/dist/runtime/components/Table/Base.vue +132 -132
  41. package/dist/runtime/components/Table/ColumnDate.vue +16 -16
  42. package/dist/runtime/components/Table/ColumnDateTime.vue +30 -30
  43. package/dist/runtime/components/Table/ColumnImage.vue +13 -13
  44. package/dist/runtime/components/Table/ColumnNumber.vue +14 -14
  45. package/dist/runtime/components/Table/Simple.vue +57 -57
  46. package/dist/runtime/components/Table/index.vue +52 -52
  47. package/dist/runtime/components/Tabs/index.vue +65 -65
  48. package/dist/runtime/lib/Requester.d.ts +2 -0
  49. package/dist/runtime/lib/Requester.mjs +3 -0
  50. package/dist/runtime/plugin.mjs +4 -2
  51. package/dist/runtime/types/config.d.ts +1 -1
  52. package/dist/runtime/types/utils.d.ts +29 -29
  53. package/dist/runtime/ui.config/breadcrumb.mjs +1 -1
  54. package/dist/runtime/ui.config/button.mjs +1 -1
  55. package/dist/runtime/ui.config/index.d.ts +1 -0
  56. package/dist/runtime/ui.config/index.mjs +1 -0
  57. package/dist/runtime/ui.config/uploadFileDropzone.d.ts +31 -0
  58. package/dist/runtime/ui.config/uploadFileDropzone.mjs +31 -0
  59. package/dist/runtime/ui.css +32 -32
  60. package/package.json +86 -86
@@ -1,136 +1,147 @@
1
- <template>
2
- <div :class="['fields', $props.class]">
3
- <template
4
- v-for="(option, index) in options.filter((item) => !item.isHide)"
5
- :key="option.props.name + index + option.type"
6
- >
7
- <FormInputStatic
8
- v-if="option.type === INPUT_TYPES.STATIC"
9
- :class="option.class"
10
- :form="form"
11
- v-bind="getFieldBinding(option)"
12
- v-on="option.on ?? {}"
13
- />
14
- <FormInputText
15
- v-else-if="option.type === INPUT_TYPES.TEXT"
16
- :class="option.class"
17
- :form="form"
18
- v-bind="getFieldBinding(option)"
19
- v-on="option.on ?? {}"
20
- />
21
- <FormInputText
22
- v-else-if="option.type === INPUT_TYPES.PASSWORD"
23
- :class="option.class"
24
- type="password"
25
- :form="form"
26
- v-bind="getFieldBinding(option)"
27
- v-on="option.on ?? {}"
28
- />
29
- <FormInputText
30
- v-else-if="option.type === INPUT_TYPES.EMAIL"
31
- :class="option.class"
32
- type="email"
33
- :form="form"
34
- v-bind="getFieldBinding(option)"
35
- v-on="option.on ?? {}"
36
- />
37
- <FormInputTextarea
38
- v-else-if="option.type === INPUT_TYPES.TEXTAREA"
39
- :class="option.class"
40
- :form="form"
41
- v-bind="getFieldBinding(option)"
42
- v-on="option.on ?? {}"
43
- />
44
- <FormInputToggle
45
- v-else-if="option.type === INPUT_TYPES.TOGGLE"
46
- :class="option.class"
47
- :form="form"
48
- v-bind="getFieldBinding(option)"
49
- v-on="option.on ?? {}"
50
- />
51
- <FormInputSelect
52
- v-else-if="option.type === INPUT_TYPES.SELECT"
53
- :class="option.class"
54
- :form="form"
55
- v-bind="getFieldBinding(option)"
56
- v-on="option.on ?? {}"
57
- />
58
- <FormInputRadio
59
- v-else-if="option.type === INPUT_TYPES.RADIO"
60
- :class="option.class"
61
- :form="form"
62
- v-bind="getFieldBinding(option)"
63
- v-on="option.on ?? {}"
64
- />
65
- <FormInputCheckbox
66
- v-else-if="option.type === INPUT_TYPES.CHECKBOX"
67
- :class="option.class"
68
- :form="form"
69
- v-bind="getFieldBinding(option)"
70
- v-on="option.on ?? {}"
71
- />
72
- <FormInputDateTime
73
- v-else-if="option.type === INPUT_TYPES.DATE_TIME"
74
- :class="option.class"
75
- :form="form"
76
- v-bind="getFieldBinding(option)"
77
- v-on="option.on ?? {}"
78
- />
79
- <FormInputDateTime
80
- v-else-if="option.type === INPUT_TYPES.DATE"
81
- :class="option.class"
82
- :form="form"
83
- v-bind="getFieldBinding(option)"
84
- :disabled-time="true"
85
- v-on="option.on ?? {}"
86
- />
87
- <FormInputUploadFileClassic
88
- v-else-if="option.type === INPUT_TYPES.UPLOAD_FILE_CLASSIC"
89
- :class="option.class"
90
- :form="form"
91
- v-bind="getFieldBinding(option)"
92
- v-on="option.on ?? {}"
93
- />
94
- <FormInputUploadFileClassicAuto
95
- v-else-if="option.type === INPUT_TYPES.UPLOAD_FILE_CLASSIC_AUTO"
96
- :class="option.class"
97
- :form="form"
98
- v-bind="getFieldBinding(option)"
99
- v-on="option.on ?? {}"
100
- />
101
- </template>
102
- </div>
103
- </template>
104
- <script lang="ts" setup>
105
- import { type FormContext } from 'vee-validate'
106
- import { type IFormField, INPUT_TYPES } from '#core/components/Form/types'
107
-
108
- const props = withDefaults(
109
- defineProps<{
110
- form?: FormContext
111
- options: IFormField[]
112
- orientation?: 'horizontal' | 'vertical'
113
- class?: any
114
- }>(),
115
- {
116
- class: 'space-y-4',
117
- orientation: 'vertical',
118
- }
119
- )
120
-
121
- const getFieldBinding = (field: IFormField) => {
122
- if (props.orientation === 'horizontal') {
123
- return {
124
- ...field.props,
125
- containerUi: {
126
- ...field.props.containerUi,
127
- wrapper:
128
- 'lg:grid lg:grid-cols-3 lg:gap-4 lg:items-start ' + field.props.containerUi?.wrapper,
129
- container: 'lg:col-span-2 ' + field.props.containerUi?.container,
130
- },
131
- }
132
- }
133
-
134
- return field.props
135
- }
136
- </script>
1
+ <template>
2
+ <div :class="['fields', $props.class]">
3
+ <template
4
+ v-for="(option, index) in options.filter((item) => !item.isHide)"
5
+ :key="option.props.name + index + option.type"
6
+ >
7
+ <FormInputStatic
8
+ v-if="option.type === INPUT_TYPES.STATIC"
9
+ :class="option.class"
10
+ :form="form"
11
+ v-bind="getFieldBinding(option)"
12
+ v-on="option.on ?? {}"
13
+ />
14
+ <FormInputText
15
+ v-else-if="option.type === INPUT_TYPES.TEXT"
16
+ :class="option.class"
17
+ :form="form"
18
+ v-bind="getFieldBinding(option)"
19
+ v-on="option.on ?? {}"
20
+ />
21
+ <FormInputText
22
+ v-else-if="option.type === INPUT_TYPES.PASSWORD"
23
+ :class="option.class"
24
+ type="password"
25
+ :form="form"
26
+ v-bind="getFieldBinding(option)"
27
+ v-on="option.on ?? {}"
28
+ />
29
+ <FormInputText
30
+ v-else-if="option.type === INPUT_TYPES.EMAIL"
31
+ :class="option.class"
32
+ type="email"
33
+ :form="form"
34
+ v-bind="getFieldBinding(option)"
35
+ v-on="option.on ?? {}"
36
+ />
37
+ <FormInputTextarea
38
+ v-else-if="option.type === INPUT_TYPES.TEXTAREA"
39
+ :class="option.class"
40
+ :form="form"
41
+ v-bind="getFieldBinding(option)"
42
+ v-on="option.on ?? {}"
43
+ />
44
+ <FormInputToggle
45
+ v-else-if="option.type === INPUT_TYPES.TOGGLE"
46
+ :class="option.class"
47
+ :form="form"
48
+ v-bind="getFieldBinding(option)"
49
+ v-on="option.on ?? {}"
50
+ />
51
+ <FormInputSelect
52
+ v-else-if="option.type === INPUT_TYPES.SELECT"
53
+ :class="option.class"
54
+ :form="form"
55
+ :options="option.props.options"
56
+ v-bind="getFieldBinding(option)"
57
+ v-on="option.on ?? {}"
58
+ />
59
+ <FormInputRadio
60
+ v-else-if="option.type === INPUT_TYPES.RADIO"
61
+ :class="option.class"
62
+ :form="form"
63
+ :options="option.props.options"
64
+ v-bind="getFieldBinding(option)"
65
+ v-on="option.on ?? {}"
66
+ />
67
+ <FormInputCheckbox
68
+ v-else-if="option.type === INPUT_TYPES.CHECKBOX"
69
+ :class="option.class"
70
+ :form="form"
71
+ v-bind="getFieldBinding(option)"
72
+ v-on="option.on ?? {}"
73
+ />
74
+ <FormInputDateTime
75
+ v-else-if="option.type === INPUT_TYPES.DATE_TIME"
76
+ :class="option.class"
77
+ :form="form"
78
+ v-bind="getFieldBinding(option)"
79
+ v-on="option.on ?? {}"
80
+ />
81
+ <FormInputDateTime
82
+ v-else-if="option.type === INPUT_TYPES.DATE"
83
+ :class="option.class"
84
+ :form="form"
85
+ v-bind="getFieldBinding(option)"
86
+ :disabled-time="true"
87
+ v-on="option.on ?? {}"
88
+ />
89
+ <FormInputUploadFileClassic
90
+ v-else-if="option.type === INPUT_TYPES.UPLOAD_FILE_CLASSIC"
91
+ :class="option.class"
92
+ :form="form"
93
+ v-bind="getFieldBinding(option)"
94
+ v-on="option.on ?? {}"
95
+ />
96
+ <FormInputUploadFileClassicAuto
97
+ v-else-if="option.type === INPUT_TYPES.UPLOAD_FILE_CLASSIC_AUTO"
98
+ :class="option.class"
99
+ :form="form"
100
+ :request-options="option.props.requestOptions"
101
+ v-bind="getFieldBinding(option)"
102
+ v-on="option.on ?? {}"
103
+ />
104
+ <FormInputUploadDropzone
105
+ v-else-if="option.type === INPUT_TYPES.UPLOAD_DROPZONE"
106
+ :class="option.class"
107
+ :form="form"
108
+ :request-options="option.props.requestOptions"
109
+ v-bind="getFieldBinding(option)"
110
+ v-on="option.on ?? {}"
111
+ />
112
+ </template>
113
+ </div>
114
+ </template>
115
+ <script lang="ts" setup>
116
+ import { type FormContext } from 'vee-validate'
117
+ import { type IFormField, INPUT_TYPES } from '#core/components/Form/types'
118
+
119
+ const props = withDefaults(
120
+ defineProps<{
121
+ form?: FormContext
122
+ options: IFormField[]
123
+ orientation?: 'horizontal' | 'vertical'
124
+ class?: any
125
+ }>(),
126
+ {
127
+ class: 'space-y-4',
128
+ orientation: 'vertical',
129
+ }
130
+ )
131
+
132
+ const getFieldBinding = (field: IFormField) => {
133
+ if (props.orientation === 'horizontal') {
134
+ return {
135
+ ...field.props,
136
+ containerUi: {
137
+ ...field.props.containerUi,
138
+ wrapper:
139
+ 'lg:grid lg:grid-cols-3 lg:gap-4 lg:items-start ' + field.props.containerUi?.wrapper,
140
+ container: 'lg:col-span-2 ' + field.props.containerUi?.container,
141
+ },
142
+ }
143
+ }
144
+
145
+ return field.props
146
+ }
147
+ </script>
@@ -1,21 +1,21 @@
1
- <template>
2
- <FieldWrapper v-bind="wrapperProps" label="">
3
- <UCheckbox
4
- v-model="value"
5
- :disabled="wrapperProps.isDisabled"
6
- :name="name"
7
- :label="props.label"
8
- :required="isRequired"
9
- :ui="ui"
10
- />
11
- </FieldWrapper>
12
- </template>
13
- <script lang="ts" setup>
14
- import { useFieldHOC } from '#core/composables/useForm'
15
- import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
16
- import { type ICheckboxFieldProps } from '#core/components/Form/InputCheckbox/types'
17
-
18
- const props = withDefaults(defineProps<ICheckboxFieldProps>(), {})
19
-
20
- const { value, wrapperProps } = useFieldHOC<boolean>(props)
21
- </script>
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps" label="">
3
+ <UCheckbox
4
+ v-model="value"
5
+ :disabled="wrapperProps.isDisabled"
6
+ :name="name"
7
+ :label="props.label"
8
+ :required="isRequired"
9
+ :ui="ui"
10
+ />
11
+ </FieldWrapper>
12
+ </template>
13
+ <script lang="ts" setup>
14
+ import { useFieldHOC } from '#core/composables/useForm'
15
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
16
+ import { type ICheckboxFieldProps } from '#core/components/Form/InputCheckbox/types'
17
+
18
+ const props = withDefaults(defineProps<ICheckboxFieldProps>(), {})
19
+
20
+ const { value, wrapperProps } = useFieldHOC<boolean>(props)
21
+ </script>
@@ -1,51 +1,51 @@
1
- <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <Datepicker
4
- v-model="value"
5
- :disabled="wrapperProps.isDisabled"
6
- cancel-text="ยกเลิก"
7
- select-text="เลือก"
8
- locale="th"
9
- :enable-time-picker="!disabledTime"
10
- :placeholder="wrapperProps.placeholder"
11
- :format="format"
12
- :min-date="minDate"
13
- :max-date="maxDate"
14
- :min-time="minTime"
15
- :max-time="maxTime"
16
- :start-time="startTime"
17
- :required="isRequired"
18
- time-picker-inline
19
- >
20
- <template #dp-input="{ value: innerValue }">
21
- <UInput
22
- :trailing-icon="innerValue ? undefined : 'i-heroicons-calendar-days'"
23
- type="text"
24
- :value="innerValue"
25
- :placeholder="wrapperProps.placeholder"
26
- :readonly="true"
27
- input-class="cursor-pointer select-none"
28
- />
29
- </template>
30
- </Datepicker>
31
- </FieldWrapper>
32
- </template>
33
- <script lang="ts" setup>
34
- import Datepicker from '@vuepic/vue-datepicker'
35
- import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
36
- import { type IDateTimeFieldProps } from '#core/components/Form/InputDateTime/date_time_field.types'
37
- import { TimeHelper, useFieldHOC } from '#imports'
38
- import '@vuepic/vue-datepicker/dist/main.css'
39
-
40
- const props = withDefaults(defineProps<IDateTimeFieldProps>(), {})
41
-
42
- const { value, wrapperProps } = useFieldHOC<string>(props)
43
-
44
- const format = (date: Date) => {
45
- if (props.disabledTime) {
46
- return TimeHelper.getDateFormTime(date)
47
- }
48
-
49
- return TimeHelper.getDateTimeFormTime(date)
50
- }
51
- </script>
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <Datepicker
4
+ v-model="value"
5
+ :disabled="wrapperProps.isDisabled"
6
+ cancel-text="ยกเลิก"
7
+ select-text="เลือก"
8
+ locale="th"
9
+ :enable-time-picker="!disabledTime"
10
+ :placeholder="wrapperProps.placeholder"
11
+ :format="format"
12
+ :min-date="minDate"
13
+ :max-date="maxDate"
14
+ :min-time="minTime"
15
+ :max-time="maxTime"
16
+ :start-time="startTime"
17
+ :required="isRequired"
18
+ time-picker-inline
19
+ >
20
+ <template #dp-input="{ value: innerValue }">
21
+ <UInput
22
+ :trailing-icon="innerValue ? undefined : 'i-heroicons-calendar-days'"
23
+ type="text"
24
+ :value="innerValue"
25
+ :placeholder="wrapperProps.placeholder"
26
+ :readonly="true"
27
+ input-class="cursor-pointer select-none"
28
+ />
29
+ </template>
30
+ </Datepicker>
31
+ </FieldWrapper>
32
+ </template>
33
+ <script lang="ts" setup>
34
+ import Datepicker from '@vuepic/vue-datepicker'
35
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
36
+ import { type IDateTimeFieldProps } from '#core/components/Form/InputDateTime/date_time_field.types'
37
+ import { TimeHelper, useFieldHOC } from '#imports'
38
+ import '@vuepic/vue-datepicker/dist/main.css'
39
+
40
+ const props = withDefaults(defineProps<IDateTimeFieldProps>(), {})
41
+
42
+ const { value, wrapperProps } = useFieldHOC<string>(props)
43
+
44
+ const format = (date: Date) => {
45
+ if (props.disabledTime) {
46
+ return TimeHelper.getDateFormTime(date)
47
+ }
48
+
49
+ return TimeHelper.getDateTimeFormTime(date)
50
+ }
51
+ </script>
@@ -1,27 +1,27 @@
1
- <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <URadioGroup
4
- v-model="value"
5
- :options="options"
6
- :disabled="wrapperProps.isDisabled"
7
- :required="isRequired"
8
- value-attribute="value"
9
- option-attribute="label"
10
- :icon="icon"
11
- :color="color"
12
- :size="size"
13
- :ui="ui"
14
- :ui-menu="uiMenu"
15
- />
16
- </FieldWrapper>
17
- </template>
18
-
19
- <script lang="ts" setup>
20
- import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
21
- import { useFieldHOC } from '#core/composables/useForm'
22
- import { type ISelectFieldProps } from '#core/components/Form/InputSelect/types'
23
-
24
- const props = withDefaults(defineProps<ISelectFieldProps>(), {})
25
-
26
- const { value, wrapperProps } = useFieldHOC<any>(props)
27
- </script>
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <URadioGroup
4
+ v-model="value"
5
+ :options="options"
6
+ :disabled="wrapperProps.isDisabled"
7
+ :required="isRequired"
8
+ value-attribute="value"
9
+ option-attribute="label"
10
+ :icon="icon"
11
+ :color="color"
12
+ :size="size"
13
+ :ui="ui"
14
+ :ui-menu="uiMenu"
15
+ />
16
+ </FieldWrapper>
17
+ </template>
18
+
19
+ <script lang="ts" setup>
20
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
21
+ import { useFieldHOC } from '#core/composables/useForm'
22
+ import { type ISelectFieldProps } from '#core/components/Form/InputSelect/types'
23
+
24
+ const props = withDefaults(defineProps<ISelectFieldProps>(), {})
25
+
26
+ const { value, wrapperProps } = useFieldHOC<any>(props)
27
+ </script>
@@ -1,37 +1,37 @@
1
- <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <USelectMenu
4
- v-model="value"
5
- searchable
6
- :options="options"
7
- :placeholder="placeholder || label"
8
- :disabled="wrapperProps.isDisabled"
9
- :loading="loading"
10
- :searchable-placeholder="searchablePlaceholder"
11
- value-attribute="value"
12
- option-attribute="label"
13
- :required="isRequired"
14
- :icon="icon"
15
- :color="color"
16
- :size="size"
17
- :ui="ui"
18
- :ui-menu="uiMenu"
19
- >
20
- <template #label>
21
- <span v-if="value" class="truncate">
22
- {{ options.find((item) => item.value === value)?.label || value }}
23
- </span>
24
- </template>
25
- </USelectMenu>
26
- </FieldWrapper>
27
- </template>
28
-
29
- <script lang="ts" setup>
30
- import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
31
- import { useFieldHOC } from '#core/composables/useForm'
32
- import { type ISelectFieldProps } from '#core/components/Form/InputSelect/types'
33
-
34
- const props = withDefaults(defineProps<ISelectFieldProps>(), {})
35
-
36
- const { value, wrapperProps } = useFieldHOC<any>(props)
37
- </script>
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <USelectMenu
4
+ v-model="value"
5
+ searchable
6
+ :options="options"
7
+ :placeholder="placeholder || label"
8
+ :disabled="wrapperProps.isDisabled"
9
+ :loading="loading"
10
+ :searchable-placeholder="searchablePlaceholder"
11
+ value-attribute="value"
12
+ option-attribute="label"
13
+ :required="isRequired"
14
+ :icon="icon"
15
+ :color="color"
16
+ :size="size"
17
+ :ui="ui"
18
+ :ui-menu="uiMenu"
19
+ >
20
+ <template #label>
21
+ <span v-if="value" class="truncate">
22
+ {{ options.find((item) => item.value === value)?.label || value }}
23
+ </span>
24
+ </template>
25
+ </USelectMenu>
26
+ </FieldWrapper>
27
+ </template>
28
+
29
+ <script lang="ts" setup>
30
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
31
+ import { useFieldHOC } from '#core/composables/useForm'
32
+ import { type ISelectFieldProps } from '#core/components/Form/InputSelect/types'
33
+
34
+ const props = withDefaults(defineProps<ISelectFieldProps>(), {})
35
+
36
+ const { value, wrapperProps } = useFieldHOC<any>(props)
37
+ </script>
@@ -1,16 +1,16 @@
1
- <template>
2
- <FieldWrapper v-bind="wrapperProps" :is-required="false">
3
- <p class="form-control-static">
4
- {{ !value || value.length === 0 ? '-' : value }}
5
- </p>
6
- </FieldWrapper>
7
- </template>
8
- <script lang="ts" setup>
9
- import { type IStaticFieldProps } from '#core/components/Form/InputStatic/types'
10
- import { useFieldHOC } from '#core/composables/useForm'
11
- import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
12
-
13
- const props = withDefaults(defineProps<IStaticFieldProps>(), {})
14
-
15
- const { value, wrapperProps } = useFieldHOC<string>(props)
16
- </script>
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps" :is-required="false">
3
+ <p class="form-control-static">
4
+ {{ !value || value.length === 0 ? '-' : value }}
5
+ </p>
6
+ </FieldWrapper>
7
+ </template>
8
+ <script lang="ts" setup>
9
+ import { type IStaticFieldProps } from '#core/components/Form/InputStatic/types'
10
+ import { useFieldHOC } from '#core/composables/useForm'
11
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
12
+
13
+ const props = withDefaults(defineProps<IStaticFieldProps>(), {})
14
+
15
+ const { value, wrapperProps } = useFieldHOC<string>(props)
16
+ </script>
@@ -1,27 +1,27 @@
1
- <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <UInput
4
- v-model="value"
5
- :disabled="wrapperProps.isDisabled"
6
- :name="name"
7
- :placeholder="wrapperProps.placeholder"
8
- :type="isShowPassword ? 'text' : props.type || 'text'"
9
- :autofocus="!!autoFocus"
10
- :icon="icon"
11
- :readonly="isReadonly"
12
- :ui="ui"
13
- />
14
- </FieldWrapper>
15
- </template>
16
- <script lang="ts" setup>
17
- import { ref } from '#imports'
18
- import { type ITextFieldProps } from '#core/components/Form/InputText/types'
19
- import { useFieldHOC } from '#core/composables/useForm'
20
- import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
21
-
22
- const props = withDefaults(defineProps<ITextFieldProps>(), {})
23
-
24
- const { value, wrapperProps } = useFieldHOC<string>(props)
25
-
26
- const isShowPassword = ref(false)
27
- </script>
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <UInput
4
+ v-model="value"
5
+ :disabled="wrapperProps.isDisabled"
6
+ :name="name"
7
+ :placeholder="wrapperProps.placeholder"
8
+ :type="isShowPassword ? 'text' : props.type || 'text'"
9
+ :autofocus="!!autoFocus"
10
+ :icon="icon"
11
+ :readonly="isReadonly"
12
+ :ui="ui"
13
+ />
14
+ </FieldWrapper>
15
+ </template>
16
+ <script lang="ts" setup>
17
+ import { ref } from '#imports'
18
+ import { type ITextFieldProps } from '#core/components/Form/InputText/types'
19
+ import { useFieldHOC } from '#core/composables/useForm'
20
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
21
+
22
+ const props = withDefaults(defineProps<ITextFieldProps>(), {})
23
+
24
+ const { value, wrapperProps } = useFieldHOC<string>(props)
25
+
26
+ const isShowPassword = ref(false)
27
+ </script>