@ramathibodi/nuxt-commons 0.1.59 → 0.1.60

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
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.1.59",
7
+ "version": "0.1.60",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -102,7 +102,8 @@ const assignNestedValue = (obj: any, keys: string[], value: any) => {
102
102
  const parseIfJson = (value: any) => {
103
103
  if (typeof value === 'string') {
104
104
  try {
105
- return JSON.parse(value)
105
+ let parsedValue = JSON.parse(value)
106
+ return (parsedValue==value) ? value : parsedValue
106
107
  } catch {
107
108
  // If parsing fails, return the original value
108
109
  return value
@@ -3,9 +3,10 @@ import { ref, watch, watchEffect, nextTick, defineExpose, computed} from 'vue'
3
3
  import { VTextField } from 'vuetify/components/VTextField'
4
4
  import Datepicker from '@vuepic/vue-datepicker'
5
5
  import '@vuepic/vue-datepicker/dist/main.css'
6
- import {isArray, isString} from "lodash-es";
6
+ import { isArray, isString } from "lodash-es";
7
7
  import { type dateFormat, Datetime } from '../../utils/datetime'
8
8
  import { useRules } from "../../composables/utils/validation";
9
+ import { th } from 'date-fns/locale';
9
10
 
10
11
  interface Props extends /* @vue-ignore */ InstanceType<typeof VTextField['$props']> {
11
12
  locale?: 'TH' | 'EN'
@@ -244,7 +245,15 @@ defineExpose({
244
245
  auto-apply
245
246
  inline
246
247
  :locale="locale"
248
+ :format-locale="(locale=='TH') ? th : undefined"
247
249
  @update:model-value="updateDatePicker"
248
- />
250
+ >
251
+ <template #year="{value}" v-if="locale=='TH'">
252
+ {{value+543}}
253
+ </template>
254
+ <template #year-overlay-value="{value}" v-if="locale=='TH'">
255
+ {{value+543}}
256
+ </template>
257
+ </Datepicker>
249
258
  </v-menu>
250
259
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramathibodi/nuxt-commons",
3
- "version": "0.1.59",
3
+ "version": "0.1.60",
4
4
  "description": "Ramathibodi Nuxt modules for common components",
5
5
  "repository": {
6
6
  "type": "git",