@finema/core 2.55.0 → 2.55.2

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": "2.55.0",
3
+ "version": "2.55.2",
4
4
  "configKey": "core",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
package/dist/module.mjs CHANGED
@@ -4,7 +4,7 @@ import * as lodash from 'lodash-es';
4
4
  import * as theme from '../dist/runtime/theme/index.js';
5
5
 
6
6
  const name = "@finema/core";
7
- const version = "2.55.0";
7
+ const version = "2.55.2";
8
8
 
9
9
  const nuxtAppOptions = {
10
10
  head: {
@@ -1,61 +1,61 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <Datepicker
4
- :model-value="innerValue"
5
- :disabled="wrapperProps.disabled"
6
- :cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
7
- :select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
8
- :locale="appConfig.core?.locale"
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
- :teleport="teleport"
18
- :required="required"
19
- :flow="['calendar', 'time']"
20
- @update:model-value="onInput"
21
- >
22
- <template
23
- v-if="appConfig.core?.is_thai_year"
24
- #year="{ value }"
25
- >
26
- {{ value + 543 }}
27
- </template>
28
- <template
29
- v-if="appConfig.core?.is_thai_year"
30
- #year-overlay-value="{ value }"
31
- >
32
- {{ value + 543 }}
33
- </template>
34
- <template #dp-input="{ value: innerValue }">
35
- <Input
36
- :trailing-icon="innerValue ? void 0 : 'i-heroicons-calendar-days'"
37
- type="text"
38
- :disabled="wrapperProps.disabled"
39
- :model-value="innerValue"
40
- :placeholder="wrapperProps.placeholder"
41
- :readonly="true"
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <Datepicker
4
+ :model-value="innerValue"
5
+ :disabled="wrapperProps.disabled"
6
+ :cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
7
+ :select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
8
+ :locale="appConfig.core?.locale"
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
+ :teleport="teleport"
18
+ :required="required"
19
+ :flow="['calendar', 'time']"
20
+ @update:model-value="onInput"
21
+ >
22
+ <template
23
+ v-if="appConfig.core?.is_thai_year"
24
+ #year="{ value }"
25
+ >
26
+ {{ value + 543 }}
27
+ </template>
28
+ <template
29
+ v-if="appConfig.core?.is_thai_year"
30
+ #year-overlay-value="{ value }"
31
+ >
32
+ {{ value + 543 }}
33
+ </template>
34
+ <template #dp-input="{ value: innerValue }">
35
+ <Input
36
+ :trailing-icon="innerValue ? void 0 : 'i-heroicons-calendar-days'"
37
+ type="text"
38
+ :disabled="wrapperProps.disabled"
39
+ :model-value="innerValue"
40
+ :placeholder="wrapperProps.placeholder"
41
+ :readonly="true"
42
42
  :ui="{
43
43
  base: 'cursor-pointer select-none',
44
44
  trailingIcon: 'cursor-pointer'
45
- }"
46
- />
47
- </template>
48
- <template #clear-icon="{ clear }">
49
- <Icon
50
- :name="clearIcon"
45
+ }"
46
+ />
47
+ </template>
48
+ <template #clear-icon="{ clear }">
49
+ <Icon
50
+ :name="clearIcon"
51
51
  :class="theme.clearIcon({
52
52
  class: [ui?.clearIcon]
53
- })"
54
- @click.stop="clear"
55
- />
56
- </template>
57
- </Datepicker>
58
- </FieldWrapper>
53
+ })"
54
+ @click.stop="clear"
55
+ />
56
+ </template>
57
+ </Datepicker>
58
+ </FieldWrapper>
59
59
  </template>
60
60
 
61
61
  <script setup>
@@ -1,64 +1,64 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <Datepicker
4
- ref="datepicker"
5
- v-model="innerValueRef"
6
- :teleport="teleport"
7
- :disabled="wrapperProps.disabled"
8
- :cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
9
- :select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
10
- :locale="appConfig.core?.locale"
11
- :format="format"
12
- :enable-time-picker="!disabledTime"
13
- :placeholder="wrapperProps.placeholder"
14
- :min-date="minDate"
15
- :max-date="maxDate"
16
- :min-time="minTime"
17
- :max-time="maxTime"
18
- :start-time="startTime"
19
- :multi-calendars="!isDisabledMultiCalendar"
20
- :required="required"
21
- time-picker-inline
22
- range
23
- :flow="['calendar', 'time']"
24
- @update:model-value="onInput"
25
- >
26
- <template
27
- v-if="appConfig.core?.is_thai_year"
28
- #year="{ value }"
29
- >
30
- {{ value + 543 }}
31
- </template>
32
- <template
33
- v-if="appConfig.core?.is_thai_year"
34
- #year-overlay-value="{ value }"
35
- >
36
- {{ value + 543 }}
37
- </template>
38
- <template #dp-input="{ value: innerValue }">
39
- <Input
40
- :trailing-icon="innerValue ? void 0 : 'i-heroicons-calendar-days'"
41
- type="text"
42
- :model-value="innerValue"
43
- :placeholder="wrapperProps.placeholder"
44
- :readonly="true"
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <Datepicker
4
+ ref="datepicker"
5
+ v-model="innerValueRef"
6
+ :teleport="teleport"
7
+ :disabled="wrapperProps.disabled"
8
+ :cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
9
+ :select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
10
+ :locale="appConfig.core?.locale"
11
+ :format="format"
12
+ :enable-time-picker="!disabledTime"
13
+ :placeholder="wrapperProps.placeholder"
14
+ :min-date="minDate"
15
+ :max-date="maxDate"
16
+ :min-time="minTime"
17
+ :max-time="maxTime"
18
+ :start-time="startTime"
19
+ :multi-calendars="!isDisabledMultiCalendar"
20
+ :required="required"
21
+ time-picker-inline
22
+ range
23
+ :flow="['calendar', 'time']"
24
+ @update:model-value="onInput"
25
+ >
26
+ <template
27
+ v-if="appConfig.core?.is_thai_year"
28
+ #year="{ value }"
29
+ >
30
+ {{ value + 543 }}
31
+ </template>
32
+ <template
33
+ v-if="appConfig.core?.is_thai_year"
34
+ #year-overlay-value="{ value }"
35
+ >
36
+ {{ value + 543 }}
37
+ </template>
38
+ <template #dp-input="{ value: innerValue }">
39
+ <Input
40
+ :trailing-icon="innerValue ? void 0 : 'i-heroicons-calendar-days'"
41
+ type="text"
42
+ :model-value="innerValue"
43
+ :placeholder="wrapperProps.placeholder"
44
+ :readonly="true"
45
45
  :ui="{
46
46
  base: 'cursor-pointer select-none',
47
47
  trailingIcon: 'cursor-pointer'
48
- }"
49
- />
50
- </template>
51
- <template #clear-icon="{ clear }">
52
- <Icon
53
- :name="clearIcon"
48
+ }"
49
+ />
50
+ </template>
51
+ <template #clear-icon="{ clear }">
52
+ <Icon
53
+ :name="clearIcon"
54
54
  :class="theme.clearIcon({
55
55
  class: [ui?.clearIcon]
56
- })"
57
- @click.stop="clear"
58
- />
59
- </template>
60
- </Datepicker>
61
- </FieldWrapper>
56
+ })"
57
+ @click.stop="clear"
58
+ />
59
+ </template>
60
+ </Datepicker>
61
+ </FieldWrapper>
62
62
  </template>
63
63
 
64
64
  <script setup>
@@ -1,48 +1,48 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <SelectMenu
4
- :model-value="value"
5
- :items="options"
6
- :placeholder="wrapperProps.placeholder"
7
- :disabled="wrapperProps.disabled"
8
- :loading="loading"
9
- :search-input="searchInput"
10
- :selected-icon="selectedIcon"
11
- value-key="value"
12
- label-key="label"
13
- :icon="icon"
14
- :ui="ui"
15
- :leading-icon="options.find((item) => item.value === value)?.icon"
16
- :avatar="options.find((item) => item.value === value)?.avatar"
17
- @update:modelValue="onChange"
18
- @update:searchTerm="onSearch"
19
- >
20
- <template #default="{ modelValue }">
21
- <div
22
- v-if="value"
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <SelectMenu
4
+ :model-value="value"
5
+ :items="options"
6
+ :placeholder="wrapperProps.placeholder"
7
+ :disabled="wrapperProps.disabled"
8
+ :loading="loading"
9
+ :search-input="searchInput"
10
+ :selected-icon="selectedIcon"
11
+ value-key="value"
12
+ label-key="label"
13
+ :icon="icon"
14
+ :ui="ui"
15
+ :leading-icon="options.find((item) => item.value === value)?.icon"
16
+ :avatar="options.find((item) => item.value === value)?.avatar"
17
+ @update:modelValue="onChange"
18
+ @update:searchTerm="onSearch"
19
+ >
20
+ <template #default="{ modelValue }">
21
+ <div
22
+ v-if="value"
23
23
  :class="theme.selectedWrapper({
24
24
  class: [ui?.selectedWrapper]
25
- })"
26
- >
27
- <span
25
+ })"
26
+ >
27
+ <span
28
28
  :class="theme.selectedLabel({
29
29
  class: [ui?.selectedLabel]
30
- })"
31
- >
32
- {{ options.find((item) => item.value === modelValue)?.label || modelValue }}
33
- </span>
34
- <Icon
35
- v-if="clearable"
36
- :name="clearIcon"
30
+ })"
31
+ >
32
+ {{ options.find((item) => item.value === modelValue)?.label || modelValue }}
33
+ </span>
34
+ <Icon
35
+ v-if="clearable"
36
+ :name="clearIcon"
37
37
  :class="theme.clearIcon({
38
38
  class: [ui?.clearIcon]
39
- })"
40
- @click.stop="onChange(void 0)"
41
- />
42
- </div>
43
- </template>
44
- </SelectMenu>
45
- </FieldWrapper>
39
+ })"
40
+ @click.stop="onChange(void 0)"
41
+ />
42
+ </div>
43
+ </template>
44
+ </SelectMenu>
45
+ </FieldWrapper>
46
46
  </template>
47
47
 
48
48
  <script setup>
@@ -1,47 +1,47 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <Datepicker
4
- v-model="innerValue"
5
- :teleport="teleport"
6
- :disabled="wrapperProps.disabled"
7
- :cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
8
- :select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
9
- :locale="appConfig.core?.locale"
10
- time-picker
11
- :placeholder="wrapperProps.placeholder"
12
- :format="format"
13
- :min-time="minTime"
14
- :max-time="maxTime"
15
- :start-time="startTime"
16
- :required="required"
17
- :enable-seconds="enableSeconds"
18
- @update:model-value="onChange"
19
- >
20
- <template #dp-input="{ value: innerValue }">
21
- <Input
22
- :trailing-icon="innerValue ? void 0 : 'i-heroicons-clock'"
23
- type="text"
24
- :disabled="wrapperProps.disabled"
25
- :model-value="innerValue"
26
- :placeholder="wrapperProps.placeholder"
27
- :readonly="true"
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <Datepicker
4
+ v-model="innerValue"
5
+ :teleport="teleport"
6
+ :disabled="wrapperProps.disabled"
7
+ :cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
8
+ :select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
9
+ :locale="appConfig.core?.locale"
10
+ time-picker
11
+ :placeholder="wrapperProps.placeholder"
12
+ :format="format"
13
+ :min-time="minTime"
14
+ :max-time="maxTime"
15
+ :start-time="startTime"
16
+ :required="required"
17
+ :enable-seconds="enableSeconds"
18
+ @update:model-value="onChange"
19
+ >
20
+ <template #dp-input="{ value: innerValue }">
21
+ <Input
22
+ :trailing-icon="innerValue ? void 0 : 'i-heroicons-clock'"
23
+ type="text"
24
+ :disabled="wrapperProps.disabled"
25
+ :model-value="innerValue"
26
+ :placeholder="wrapperProps.placeholder"
27
+ :readonly="true"
28
28
  :ui="{
29
29
  base: 'cursor-pointer select-none',
30
30
  trailingIcon: 'cursor-pointer'
31
- }"
32
- />
33
- </template>
34
- <template #clear-icon="{ clear }">
35
- <Icon
36
- :name="clearIcon"
31
+ }"
32
+ />
33
+ </template>
34
+ <template #clear-icon="{ clear }">
35
+ <Icon
36
+ :name="clearIcon"
37
37
  :class="theme.clearIcon({
38
38
  class: [ui?.clearIcon]
39
- })"
40
- @click.stop="clear"
41
- />
42
- </template>
43
- </Datepicker>
44
- </FieldWrapper>
39
+ })"
40
+ @click.stop="clear"
41
+ />
42
+ </template>
43
+ </Datepicker>
44
+ </FieldWrapper>
45
45
  </template>
46
46
 
47
47
  <script setup>
@@ -1,6 +1,6 @@
1
1
  export const tableTheme = {
2
2
  slots: {
3
- root: "",
3
+ root: "rounded-t-lg rounded-b-lg",
4
4
  rootWrapper: "rounded-t-lg rounded-b-lg border-1 border-[#EAECF0] bg-white",
5
5
  searchContainer: "mb-4 flex justify-end",
6
6
  captionContainer: "hidden mb-4 text-gray-500",
@@ -25,7 +25,7 @@ export const tableTheme = {
25
25
  },
26
26
  sticky: {
27
27
  true: {
28
- thead: "sticky bg-transparent top-0 inset-x-0 z-[1] backdrop-blur-none",
28
+ thead: "sticky bg-white top-0 inset-x-0 z-[1] backdrop-blur-none",
29
29
  tfoot: "sticky bottom-0 inset-x-0 bg-white z-[1] backdrop-blur-none"
30
30
  },
31
31
  header: {
@@ -10,6 +10,7 @@ const timeFormat = useCoreConfig().time_format;
10
10
  const isThaiYear = useCoreConfig().is_thai_year;
11
11
  const isThaiMonth = useCoreConfig().is_thai_month;
12
12
  const timeZone = useCoreConfig().time_zone;
13
+ const locale = useCoreConfig().locale;
13
14
  const getTime = (time) => {
14
15
  return isDate(time) ? time : new Date(time);
15
16
  };
@@ -30,7 +31,7 @@ export class TimeHelper {
30
31
  return null;
31
32
  }
32
33
  const parsedTime = getTime(time);
33
- const newTime = TimeHelper.thaiFormat(parsedTime, dateFormatDisplay);
34
+ const newTime = locale === "th" ? TimeHelper.thaiFormat(parsedTime, dateFormatDisplay) : format(parsedTime, dateFormatDisplay);
34
35
  return isValid(parsedTime) ? newTime : time;
35
36
  };
36
37
  static displayDateTime = (time) => {
@@ -38,7 +39,7 @@ export class TimeHelper {
38
39
  return null;
39
40
  }
40
41
  const parsedTime = getTime(time);
41
- const newTime = TimeHelper.thaiFormat(parsedTime, dateTimeFormatDisplay);
42
+ const newTime = locale === "th" ? TimeHelper.thaiFormat(parsedTime, dateTimeFormatDisplay) : format(parsedTime, dateTimeFormatDisplay);
42
43
  return isValid(parsedTime) ? newTime : time;
43
44
  };
44
45
  static displayDateThai = (time) => {
@@ -46,7 +47,7 @@ export class TimeHelper {
46
47
  return null;
47
48
  }
48
49
  const parsedTime = getTime(time);
49
- const newTime = TimeHelper.thaiFormat(parsedTime, dateFormat, true);
50
+ const newTime = TimeHelper.thaiFormat(parsedTime, dateFormatDisplay, true);
50
51
  return isValid(parsedTime) ? newTime : time;
51
52
  };
52
53
  static displayDateTimeThai = (time) => {
@@ -54,7 +55,7 @@ export class TimeHelper {
54
55
  return null;
55
56
  }
56
57
  const parsedTime = getTime(time);
57
- const newTime = TimeHelper.thaiFormat(parsedTime, dateTimeFormat, true);
58
+ const newTime = TimeHelper.thaiFormat(parsedTime, dateTimeFormatDisplay, true);
58
59
  return isValid(parsedTime) ? newTime : time;
59
60
  };
60
61
  static displayDateRange = (startDate, endDate) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.55.0",
3
+ "version": "2.55.2",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",