@finema/core 1.4.199 → 1.4.201

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.
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.4.199",
3
+ "version": "1.4.201",
4
4
  "configKey": "core",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.7.4"
package/dist/module.mjs CHANGED
@@ -2,7 +2,7 @@ import { defineNuxtModule, createResolver, installModule, addPlugin, addComponen
2
2
  import { defu } from 'defu';
3
3
 
4
4
  const name = "@finema/core";
5
- const version = "1.4.199";
5
+ const version = "1.4.201";
6
6
 
7
7
  const colorModeOptions = {
8
8
  preference: "light"
@@ -1,14 +1,14 @@
1
1
  <template>
2
2
  <div class="flex flex-col items-center justify-center py-6 text-gray-400">
3
- <Icon :name="icon" class="text-[72px]" />
4
- <p class="mt-2" v-html="message" />
3
+ <Icon :name="icon!" class="text-[72px]" />
4
+ <p class="mt-2" v-html="message!" />
5
5
  </div>
6
6
  </template>
7
7
  <script lang="ts" setup>
8
8
  withDefaults(
9
9
  defineProps<{
10
- message: any
11
- icon: string
10
+ message?: any
11
+ icon?: string
12
12
  }>(),
13
13
  {
14
14
  message: 'ไม่พบข้อมูล!',
@@ -23,7 +23,7 @@
23
23
  :trailing-icon="innerValue ? undefined : 'i-heroicons-calendar-days'"
24
24
  type="text"
25
25
  :disabled="wrapperProps.isDisabled"
26
- :value="innerValue"
26
+ :model-value="innerValue"
27
27
  :placeholder="wrapperProps.placeholder"
28
28
  :readonly="true"
29
29
  input-class="cursor-pointer select-none"
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <Datepicker
4
+ :model-value="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
+ @update:model-value="onInput"
20
+ >
21
+ <template #dp-input="{ value: innerValue }">
22
+ <UInput
23
+ :trailing-icon="innerValue ? undefined : 'i-heroicons-calendar-days'"
24
+ type="text"
25
+ :disabled="wrapperProps.isDisabled"
26
+ :value="innerValue"
27
+ :placeholder="wrapperProps.placeholder"
28
+ :readonly="true"
29
+ input-class="cursor-pointer select-none"
30
+ />
31
+ </template>
32
+ </Datepicker>
33
+ </FieldWrapper>
34
+ </template>
35
+ <script lang="ts" setup>
36
+ import Datepicker from '@vuepic/vue-datepicker'
37
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
38
+ import { type IDateTimeFieldProps } from '#core/components/Form/InputDateTime/date_time_field.types'
39
+ import { TimeHelper, useFieldHOC } from '#imports'
40
+ import '@vuepic/vue-datepicker/dist/main.css'
41
+
42
+ const props = withDefaults(defineProps<IDateTimeFieldProps>(), {})
43
+
44
+ const { value, wrapperProps } = useFieldHOC<string>(props)
45
+
46
+ const format = (date: Date) => {
47
+ if (props.disabledTime) {
48
+ return TimeHelper.displayDate(date)
49
+ }
50
+
51
+ return TimeHelper.displayDateTime(date)
52
+ }
53
+
54
+ const onInput = (_value: any) => {
55
+ if (props.disabledTime && !props.isReturnISO) {
56
+ value.value = TimeHelper.getDateFormTime(_value)
57
+ } else {
58
+ value.value = _value
59
+ }
60
+ }
61
+ </script>
@@ -24,7 +24,7 @@
24
24
  <UInput
25
25
  :trailing-icon="innerValue ? undefined : 'i-heroicons-calendar-days'"
26
26
  type="text"
27
- :value="innerValue"
27
+ :model-value="innerValue"
28
28
  :placeholder="wrapperProps.placeholder"
29
29
  :readonly="true"
30
30
  input-class="cursor-pointer select-none"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.4.199",
3
+ "version": "1.4.201",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",