@finema/core 3.22.0 → 3.24.0

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 (130) hide show
  1. package/README.md +22 -2
  2. package/dist/module.d.mts +2 -0
  3. package/dist/module.json +2 -2
  4. package/dist/module.mjs +18 -15
  5. package/dist/runtime/components/App.vue +1 -1
  6. package/dist/runtime/components/DevToolsWindow/index.vue +24 -26
  7. package/dist/runtime/components/Dialog/index.d.vue.ts +1 -4
  8. package/dist/runtime/components/Dialog/index.vue +17 -17
  9. package/dist/runtime/components/Dialog/index.vue.d.ts +1 -4
  10. package/dist/runtime/components/Empty.d.vue.ts +1 -2
  11. package/dist/runtime/components/Empty.vue +19 -11
  12. package/dist/runtime/components/Empty.vue.d.ts +1 -2
  13. package/dist/runtime/components/FlexDeck/index.vue +21 -23
  14. package/dist/runtime/components/Form/FieldWrapper.vue +1 -1
  15. package/dist/runtime/components/Form/Fields.d.vue.ts +1 -1
  16. package/dist/runtime/components/Form/Fields.vue +26 -20
  17. package/dist/runtime/components/Form/Fields.vue.d.ts +1 -1
  18. package/dist/runtime/components/Form/InputCheckbox/index.vue +3 -6
  19. package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +3 -6
  20. package/dist/runtime/components/Form/InputComponent/index.vue +2 -1
  21. package/dist/runtime/components/Form/InputCurrency/index.vue +11 -11
  22. package/dist/runtime/components/Form/InputDateTime/date_time_field.types.d.ts +3 -1
  23. package/dist/runtime/components/Form/InputDateTime/index.vue +12 -17
  24. package/dist/runtime/components/Form/InputDateTimeRange/date_range_time_field.types.d.ts +1 -1
  25. package/dist/runtime/components/Form/InputDateTimeRange/index.vue +28 -20
  26. package/dist/runtime/components/Form/InputMonth/index.vue +14 -12
  27. package/dist/runtime/components/Form/InputMonth/types.d.ts +1 -1
  28. package/dist/runtime/components/Form/InputNumber/index.vue +3 -6
  29. package/dist/runtime/components/Form/InputRadio/index.vue +3 -6
  30. package/dist/runtime/components/Form/InputRating/index.vue +3 -6
  31. package/dist/runtime/components/Form/InputSearch/index.vue +6 -7
  32. package/dist/runtime/components/Form/InputSelect/index.vue +6 -15
  33. package/dist/runtime/components/Form/InputSelectMultiple/index.vue +7 -18
  34. package/dist/runtime/components/Form/InputTags/index.vue +3 -6
  35. package/dist/runtime/components/Form/InputText/index.vue +41 -51
  36. package/dist/runtime/components/Form/InputTextarea/index.vue +3 -6
  37. package/dist/runtime/components/Form/InputTime/index.vue +32 -27
  38. package/dist/runtime/components/Form/InputTime/types.d.ts +1 -1
  39. package/dist/runtime/components/Form/InputToggle/index.vue +3 -5
  40. package/dist/runtime/components/Form/InputUploadDropzone/index.d.vue.ts +1 -4
  41. package/dist/runtime/components/Form/InputUploadDropzone/index.vue +25 -23
  42. package/dist/runtime/components/Form/InputUploadDropzone/index.vue.d.ts +1 -4
  43. package/dist/runtime/components/Form/InputUploadDropzone/types.d.ts +2 -2
  44. package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.d.vue.ts +0 -5
  45. package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +22 -23
  46. package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue.d.ts +0 -5
  47. package/dist/runtime/components/Form/InputUploadDropzoneAuto/types.d.ts +3 -3
  48. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.d.vue.ts +0 -5
  49. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +26 -24
  50. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue.d.ts +0 -5
  51. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/types.d.ts +3 -3
  52. package/dist/runtime/components/Form/InputUploadImageAuto/index.d.vue.ts +1 -6
  53. package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +22 -23
  54. package/dist/runtime/components/Form/InputUploadImageAuto/index.vue.d.ts +1 -6
  55. package/dist/runtime/components/Form/InputUploadImageAuto/types.d.ts +3 -3
  56. package/dist/runtime/components/Form/InputWYSIWYG/EditorImagePasteExtension.js +7 -6
  57. package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadExtension.js +13 -12
  58. package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.vue +3 -1
  59. package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.vue +20 -22
  60. package/dist/runtime/components/Form/InputWYSIWYG/index.vue +140 -118
  61. package/dist/runtime/components/Form/fileState/EmptyState.vue +1 -1
  62. package/dist/runtime/components/Form/fileState/FailedState.vue +4 -2
  63. package/dist/runtime/components/Form/fileState/MultipleFilesState.d.vue.ts +4 -4
  64. package/dist/runtime/components/Form/fileState/MultipleFilesState.vue +5 -5
  65. package/dist/runtime/components/Form/fileState/MultipleFilesState.vue.d.ts +4 -4
  66. package/dist/runtime/components/Form/fileState/SuccessState.d.vue.ts +2 -2
  67. package/dist/runtime/components/Form/fileState/SuccessState.vue +8 -13
  68. package/dist/runtime/components/Form/fileState/SuccessState.vue.d.ts +2 -2
  69. package/dist/runtime/components/Form/fileState/useFilePicker.d.ts +34 -0
  70. package/dist/runtime/components/Form/fileState/useFilePicker.js +48 -0
  71. package/dist/runtime/components/Form/fileState/useFileState.d.ts +7 -9
  72. package/dist/runtime/components/Form/fileState/useFileState.js +32 -120
  73. package/dist/runtime/components/Form/fileState/useUploadImageState.d.ts +7 -8
  74. package/dist/runtime/components/Form/fileState/useUploadImageState.js +27 -301
  75. package/dist/runtime/components/Form/fileState/useUploadState.d.ts +11 -7
  76. package/dist/runtime/components/Form/fileState/useUploadState.js +52 -136
  77. package/dist/runtime/components/Form/fileState/useUploadStateMultiple.d.ts +12 -18
  78. package/dist/runtime/components/Form/fileState/useUploadStateMultiple.js +88 -226
  79. package/dist/runtime/components/Form/types.d.ts +2 -0
  80. package/dist/runtime/components/Image.vue +4 -10
  81. package/dist/runtime/components/Loader.d.vue.ts +2 -1
  82. package/dist/runtime/components/Loader.vue +10 -7
  83. package/dist/runtime/components/Loader.vue.d.ts +2 -1
  84. package/dist/runtime/components/Log/LogItem.vue +1 -3
  85. package/dist/runtime/components/Log/index.vue +1 -3
  86. package/dist/runtime/components/Table/Base.d.vue.ts +15 -1
  87. package/dist/runtime/components/Table/Base.vue +9 -29
  88. package/dist/runtime/components/Table/Base.vue.d.ts +15 -1
  89. package/dist/runtime/components/Table/ColumnText.d.vue.ts +2 -3
  90. package/dist/runtime/components/Table/ColumnText.vue +1 -1
  91. package/dist/runtime/components/Table/ColumnText.vue.d.ts +2 -3
  92. package/dist/runtime/components/Table/Pagination.vue +19 -22
  93. package/dist/runtime/components/Table/index.d.vue.ts +1 -1
  94. package/dist/runtime/components/Table/index.vue +5 -7
  95. package/dist/runtime/components/Table/index.vue.d.ts +1 -1
  96. package/dist/runtime/composables/loaderList.d.ts +2 -1
  97. package/dist/runtime/composables/loaderList.js +3 -4
  98. package/dist/runtime/composables/loaderObject.d.ts +2 -1
  99. package/dist/runtime/composables/loaderObject.js +2 -1
  100. package/dist/runtime/composables/loaderPage.js +223 -350
  101. package/dist/runtime/composables/useConfig.js +4 -3
  102. package/dist/runtime/composables/useDialog.js +3 -1
  103. package/dist/runtime/composables/useForm.d.ts +2 -2
  104. package/dist/runtime/composables/useForm.js +2 -4
  105. package/dist/runtime/composables/useMessages.d.ts +10 -0
  106. package/dist/runtime/composables/useMessages.js +10 -0
  107. package/dist/runtime/composables/useTable.js +2 -14
  108. package/dist/runtime/helpers/apiBaseHelper.js +6 -24
  109. package/dist/runtime/helpers/apiListHelper.js +2 -5
  110. package/dist/runtime/helpers/apiObjectHelper.js +2 -5
  111. package/dist/runtime/helpers/apiPageHelper.d.ts +0 -1
  112. package/dist/runtime/helpers/apiPageHelper.js +19 -38
  113. package/dist/runtime/helpers/componentHelper.js +2 -6
  114. package/dist/runtime/helpers/uploadCore.d.ts +54 -0
  115. package/dist/runtime/helpers/uploadCore.js +81 -0
  116. package/dist/runtime/i18n/valibot.d.ts +5 -68
  117. package/dist/runtime/i18n/valibot.js +33 -29
  118. package/dist/runtime/locale/en.d.ts +2 -0
  119. package/dist/runtime/locale/en.js +42 -0
  120. package/dist/runtime/locale/index.d.ts +7 -0
  121. package/dist/runtime/locale/index.js +5 -0
  122. package/dist/runtime/locale/th.d.ts +43 -0
  123. package/dist/runtime/locale/th.js +42 -0
  124. package/dist/runtime/server/tsconfig.json +1 -1
  125. package/dist/runtime/styles/main.css +1 -1
  126. package/dist/runtime/utils/ParamHelper.js +1 -1
  127. package/dist/runtime/utils/StringHelper.js +1 -4
  128. package/dist/runtime/utils/TimeHelper.js +2 -2
  129. package/dist/runtime/utils/lodash.js +2 -2
  130. package/package.json +57 -36
@@ -0,0 +1,42 @@
1
+ export const en = {
2
+ common: {
3
+ confirm: "OK",
4
+ cancel: "Cancel",
5
+ select: "Select",
6
+ loading: "Loading...",
7
+ search: "Search...",
8
+ clearSearch: "Clear search",
9
+ empty: "No data found!",
10
+ somethingWentWrong: "Something went wrong"
11
+ },
12
+ pagination: {
13
+ items: "items",
14
+ ofTotal: "of total",
15
+ total: "Total",
16
+ itemsOfTotal: "items of total"
17
+ },
18
+ upload: {
19
+ selectFile: "Click to select a file",
20
+ selectImage: "Click to select an image",
21
+ dropHere: "or drag and drop here",
22
+ uploading: "Uploading...",
23
+ uploadFailed: "Upload failed, please try again",
24
+ retry: "Try again",
25
+ preview: "Preview",
26
+ download: "Download file",
27
+ remove: "Remove file",
28
+ removeConfirm: "Do you want to remove {name}?",
29
+ invalidType: "Invalid file type (only {types} are allowed)",
30
+ maxSize: "File size must not exceed {size}",
31
+ maxFiles: "You can upload up to {max} files",
32
+ error: "An error occurred: {message}",
33
+ imageLoadFailed: "Failed to load image",
34
+ imageWidth: "Image width must be {expected}px (current: {actual}px)",
35
+ imageHeight: "Image height must be {expected}px (current: {actual}px)",
36
+ imageMinWidth: "Image width must be at least {expected}px (current: {actual}px)",
37
+ imageMinHeight: "Image height must be at least {expected}px (current: {actual}px)",
38
+ imageMaxWidth: "Image width must not exceed {expected}px (current: {actual}px)",
39
+ imageMaxHeight: "Image height must not exceed {expected}px (current: {actual}px)",
40
+ imageAspectRatio: "Image aspect ratio is incorrect (expected: {expected}, current: {actual})"
41
+ }
42
+ };
@@ -0,0 +1,7 @@
1
+ import { type ICoreMessages } from './th.js';
2
+ export type { ICoreMessages };
3
+ export type ICoreMessagesOverride = {
4
+ [Group in keyof ICoreMessages]?: Partial<ICoreMessages[Group]>;
5
+ };
6
+ export declare const formatMessage: (template: string, params?: Record<string, string | number>) => string;
7
+ export declare const resolveMessages: (locale: string | undefined, overrides?: ICoreMessagesOverride) => ICoreMessages;
@@ -0,0 +1,5 @@
1
+ import defu from "defu";
2
+ import { th } from "./th.js";
3
+ import { en } from "./en.js";
4
+ export const formatMessage = (template, params = {}) => template.replace(/\{(\w+)\}/g, (placeholder, key) => key in params ? String(params[key]) : placeholder);
5
+ export const resolveMessages = (locale, overrides = {}) => defu(overrides, locale === "th" ? th : en);
@@ -0,0 +1,43 @@
1
+ export declare const th: {
2
+ common: {
3
+ confirm: string;
4
+ cancel: string;
5
+ select: string;
6
+ loading: string;
7
+ search: string;
8
+ clearSearch: string;
9
+ empty: string;
10
+ somethingWentWrong: string;
11
+ };
12
+ pagination: {
13
+ items: string;
14
+ ofTotal: string;
15
+ total: string;
16
+ itemsOfTotal: string;
17
+ };
18
+ upload: {
19
+ selectFile: string;
20
+ selectImage: string;
21
+ dropHere: string;
22
+ uploading: string;
23
+ uploadFailed: string;
24
+ retry: string;
25
+ preview: string;
26
+ download: string;
27
+ remove: string;
28
+ removeConfirm: string;
29
+ invalidType: string;
30
+ maxSize: string;
31
+ maxFiles: string;
32
+ error: string;
33
+ imageLoadFailed: string;
34
+ imageWidth: string;
35
+ imageHeight: string;
36
+ imageMinWidth: string;
37
+ imageMinHeight: string;
38
+ imageMaxWidth: string;
39
+ imageMaxHeight: string;
40
+ imageAspectRatio: string;
41
+ };
42
+ };
43
+ export type ICoreMessages = typeof th;
@@ -0,0 +1,42 @@
1
+ export const th = {
2
+ common: {
3
+ confirm: "\u0E15\u0E01\u0E25\u0E07",
4
+ cancel: "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01",
5
+ select: "\u0E15\u0E01\u0E25\u0E07",
6
+ loading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14...",
7
+ search: "\u0E04\u0E49\u0E19\u0E2B\u0E32...",
8
+ clearSearch: "\u0E25\u0E49\u0E32\u0E07\u0E01\u0E32\u0E23\u0E04\u0E49\u0E19\u0E2B\u0E32",
9
+ empty: "\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25!",
10
+ somethingWentWrong: "\u0E21\u0E35\u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14"
11
+ },
12
+ pagination: {
13
+ items: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",
14
+ ofTotal: "\u0E08\u0E32\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
15
+ total: "\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
16
+ itemsOfTotal: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23 \u0E08\u0E32\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14"
17
+ },
18
+ upload: {
19
+ selectFile: "\u0E04\u0E25\u0E34\u0E01\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C",
20
+ selectImage: "\u0E04\u0E25\u0E34\u0E01\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E",
21
+ dropHere: "\u0E2B\u0E23\u0E37\u0E2D \u0E25\u0E32\u0E01\u0E41\u0E25\u0E30\u0E27\u0E32\u0E07\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48",
22
+ uploading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1E\u0E42\u0E2B\u0E25\u0E14...",
23
+ uploadFailed: "\u0E2D\u0E31\u0E1E\u0E42\u0E2B\u0E25\u0E14\u0E25\u0E49\u0E21\u0E40\u0E2B\u0E25\u0E27, \u0E01\u0E23\u0E38\u0E13\u0E32\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
24
+ retry: "\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
25
+ preview: "\u0E14\u0E39\u0E15\u0E31\u0E27\u0E2D\u0E22\u0E48\u0E32\u0E07",
26
+ download: "\u0E14\u0E32\u0E27\u0E19\u0E4C\u0E42\u0E2B\u0E25\u0E14\u0E44\u0E1F\u0E25\u0E4C",
27
+ remove: "\u0E25\u0E1A\u0E44\u0E1F\u0E25\u0E4C",
28
+ removeConfirm: "\u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E25\u0E1A\u0E44\u0E1F\u0E25\u0E4C {name} \u0E43\u0E0A\u0E48\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48",
29
+ invalidType: "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E44\u0E1F\u0E25\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07 (\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E40\u0E09\u0E1E\u0E32\u0E30 {types})",
30
+ maxSize: "\u0E02\u0E19\u0E32\u0E14\u0E44\u0E1F\u0E25\u0E4C\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 {size}",
31
+ maxFiles: "\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E2D\u0E31\u0E1E\u0E42\u0E2B\u0E25\u0E14\u0E44\u0E14\u0E49\u0E2A\u0E39\u0E07\u0E2A\u0E38\u0E14 {max} \u0E44\u0E1F\u0E25\u0E4C",
32
+ error: "\u0E1E\u0E1A\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14: {message}",
33
+ imageLoadFailed: "\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E42\u0E2B\u0E25\u0E14\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E\u0E44\u0E14\u0E49",
34
+ imageWidth: "\u0E04\u0E27\u0E32\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E02\u0E2D\u0E07\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 {expected}px (\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19: {actual}px)",
35
+ imageHeight: "\u0E04\u0E27\u0E32\u0E21\u0E2A\u0E39\u0E07\u0E02\u0E2D\u0E07\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 {expected}px (\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19: {actual}px)",
36
+ imageMinWidth: "\u0E04\u0E27\u0E32\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E02\u0E2D\u0E07\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 {expected}px (\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19: {actual}px)",
37
+ imageMinHeight: "\u0E04\u0E27\u0E32\u0E21\u0E2A\u0E39\u0E07\u0E02\u0E2D\u0E07\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 {expected}px (\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19: {actual}px)",
38
+ imageMaxWidth: "\u0E04\u0E27\u0E32\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E02\u0E2D\u0E07\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 {expected}px (\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19: {actual}px)",
39
+ imageMaxHeight: "\u0E04\u0E27\u0E32\u0E21\u0E2A\u0E39\u0E07\u0E02\u0E2D\u0E07\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 {expected}px (\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19: {actual}px)",
40
+ imageAspectRatio: "\u0E2D\u0E31\u0E15\u0E23\u0E32\u0E2A\u0E48\u0E27\u0E19\u0E02\u0E2D\u0E07\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07 (\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23: {expected}, \u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19: {actual})"
41
+ }
42
+ };
@@ -1,3 +1,3 @@
1
1
  {
2
- "extends": "../../../.nuxt/tsconfig.server.json",
2
+ "extends": "../../../.nuxt/tsconfig.server.json"
3
3
  }
@@ -1 +1 @@
1
- @import "tailwindcss";@import "@nuxt/ui";@plugin "@tailwindcss/typography";@source inline("prose");@theme{--font-sans:"Noto Sans Thai","Noto Sans Thai Looped","Public Sans",sans-serif;--font-display:"Noto Sans Thai","Noto Sans Thai Looped","Public Sans",sans-serif}:root{--ui-text:var(--ui-color-neutral-800);--color-main:#1570ef;--color-main-50:#eff8ff;--color-main-100:#d1e9ff;--color-main-200:#b2ddff;--color-main-300:#84caff;--color-main-400:#53b1fd;--color-main-500:#1570ef;--color-main-600:#1570ef;--color-main-700:#175cd3;--color-main-800:#1849a9;--color-main-900:#194185;--color-main-950:#102a56;--color-warning:#f79009;--color-warning-50:#fffaeb;--color-warning-100:#fef0c7;--color-warning-200:#fedf89;--color-warning-300:#fec84b;--color-warning-400:#fdb022;--color-warning-500:#f79009;--color-warning-600:#dc6803;--color-warning-700:#b54708;--color-warning-800:#93370d;--color-warning-900:#7a2e0e;--color-warning-950:#4e1d09;--color-success:#17b26a;--color-success-50:#ecfdf3;--color-success-100:#dcfae6;--color-success-200:#abefc6;--color-success-300:#75e0a7;--color-success-400:#47cd89;--color-success-500:#17b26a;--color-success-600:#079455;--color-success-700:#067647;--color-success-800:#085d3a;--color-success-900:#074d31;--color-success-950:#053321;--color-error:#e11d48;--color-error-50:#fef2f2;--color-error-100:#fee2e2;--color-error-200:#f0899f;--color-error-300:#eb6582;--color-error-400:#e64065;--color-error-500:#e11d48;--color-error-600:#af1738;--color-error-700:#7e1028;--color-error-800:#4c0a18;--color-error-900:#1a0308;--color-error-950:#010000;--color-info:#2563eb;--color-info-50:#dde9ff;--color-info-100:#c8dfff;--color-info-200:#a1c4ff;--color-info-300:#7aa9ff;--color-info-400:#538eff;--color-info-500:#2563eb;--color-info-600:#1a4aaf;--color-info-700:#0f318a;--color-info-800:#081f65;--color-info-900:#020b3a;--color-info-950:#000;--color-white:#fff;--color-white-50:#fff;--color-white-100:#fff;--color-white-200:#fff;--color-white-300:#fff;--color-white-400:#fff;--color-white-500:#fff;--color-white-600:#e3e3e3;--color-white-700:#c7c7c7;--color-white-800:#ababab;--color-white-900:#8f8f8f;--color-white-950:#818181}html{@apply text-sm lg:text-base;font-family:Noto Sans Thai,Noto Sans Thai Looped,Public Sans,sans-serif}::-webkit-scrollbar{-webkit-appearance:none;height:10px;width:10px}::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3);border-radius:4px;box-shadow:0 0 1px hsla(0,0%,100%,.5)}:root{--dp-font-family:inherit!important}.dp__theme_light{--dp-primary-color:var(--color-main)!important;--dp-primary-disabled-color:var(--color-main-200)!important}.dp__outer_menu_wrap{@apply ring-1 ring-gray-200}[role=dialog]{pointer-events:auto!important}#__nuxt,body,html{@apply w-full h-full}.dp__main{display:block!important}.dp__menu{border:none!important}.dp__pointer{height:44px!important}.dp__outer_menu_wrap{box-shadow:none!important}.dp--menu-wrapper{@apply ring-1 ring-slate-300}
1
+ @import "tailwindcss";@import "@nuxt/ui";@plugin "@tailwindcss/typography";@source inline("prose");@theme{--font-sans:"Noto Sans Thai","Noto Sans Thai Looped","Public Sans",sans-serif;--font-display:"Noto Sans Thai","Noto Sans Thai Looped","Public Sans",sans-serif}:root{--ui-text:var(--ui-color-neutral-800);--color-main:#1570ef;--color-main-50:#eff8ff;--color-main-100:#d1e9ff;--color-main-200:#b2ddff;--color-main-300:#84caff;--color-main-400:#53b1fd;--color-main-500:#1570ef;--color-main-600:#1570ef;--color-main-700:#175cd3;--color-main-800:#1849a9;--color-main-900:#194185;--color-main-950:#102a56;--color-warning:#f79009;--color-warning-50:#fffaeb;--color-warning-100:#fef0c7;--color-warning-200:#fedf89;--color-warning-300:#fec84b;--color-warning-400:#fdb022;--color-warning-500:#f79009;--color-warning-600:#dc6803;--color-warning-700:#b54708;--color-warning-800:#93370d;--color-warning-900:#7a2e0e;--color-warning-950:#4e1d09;--color-success:#17b26a;--color-success-50:#ecfdf3;--color-success-100:#dcfae6;--color-success-200:#abefc6;--color-success-300:#75e0a7;--color-success-400:#47cd89;--color-success-500:#17b26a;--color-success-600:#079455;--color-success-700:#067647;--color-success-800:#085d3a;--color-success-900:#074d31;--color-success-950:#053321;--color-error:#e11d48;--color-error-50:#fef2f2;--color-error-100:#fee2e2;--color-error-200:#f0899f;--color-error-300:#eb6582;--color-error-400:#e64065;--color-error-500:#e11d48;--color-error-600:#af1738;--color-error-700:#7e1028;--color-error-800:#4c0a18;--color-error-900:#1a0308;--color-error-950:#010000;--color-info:#2563eb;--color-info-50:#dde9ff;--color-info-100:#c8dfff;--color-info-200:#a1c4ff;--color-info-300:#7aa9ff;--color-info-400:#538eff;--color-info-500:#2563eb;--color-info-600:#1a4aaf;--color-info-700:#0f318a;--color-info-800:#081f65;--color-info-900:#020b3a;--color-info-950:#000;--color-white:#fff;--color-white-50:#fff;--color-white-100:#fff;--color-white-200:#fff;--color-white-300:#fff;--color-white-400:#fff;--color-white-500:#fff;--color-white-600:#e3e3e3;--color-white-700:#c7c7c7;--color-white-800:#ababab;--color-white-900:#8f8f8f;--color-white-950:#818181}html{@apply text-sm lg:text-base;font-family:Noto Sans Thai,Noto Sans Thai Looped,Public Sans,sans-serif}::-webkit-scrollbar{-webkit-appearance:none;height:10px;width:10px}::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3);border-radius:4px;box-shadow:0 0 1px hsla(0,0%,100%,.5)}:root{--dp-font-family:inherit!important}.dp__theme_light{--dp-primary-color:var(--color-main)!important;--dp-primary-disabled-color:var(--color-main-200)!important}.dp__outer_menu_wrap{@apply ring-1 ring-gray-200}[role=dialog]{pointer-events:auto!important}#__nuxt,body,html{@apply h-full w-full}.dp__main{display:block!important}.dp__menu{border:none!important}.dp__pointer{height:44px!important}.dp__outer_menu_wrap{box-shadow:none!important}.dp--menu-wrapper{@apply ring-1 ring-slate-300}
@@ -28,7 +28,7 @@ export class ParamHelper {
28
28
  return bool === null ? false : !!bool;
29
29
  };
30
30
  static isNotFoundError = (error) => {
31
- return _get(error, "code", true) === "NOT_FOUND";
31
+ return _get(error, "code", "") === "NOT_FOUND";
32
32
  };
33
33
  static isChangeWithFalse = (value, oldValue) => {
34
34
  return oldValue !== value && !value;
@@ -24,10 +24,7 @@ export class StringHelper {
24
24
  };
25
25
  static getError = (errorData, defaultErrorMessage = "\u0E21\u0E35\u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14") => {
26
26
  let msg = errorData?.message || defaultErrorMessage;
27
- if (!errorData.code || !msg) {
28
- return msg;
29
- }
30
- if (errorData.code !== "INVALID_PARAMS" && !errorData.fields) {
27
+ if (!errorData?.code || !msg || !errorData.fields) {
31
28
  return msg;
32
29
  }
33
30
  for (const [, value] of Object.entries(errorData.fields)) {
@@ -1,5 +1,5 @@
1
1
  import { addYears, format, formatISO, isDate, isValid } from "date-fns";
2
- import * as locales from "date-fns/locale";
2
+ import { th } from "date-fns/locale/th";
3
3
  import { formatInTimeZone } from "date-fns-tz";
4
4
  import { useCoreConfig } from "#core/composables/useConfig";
5
5
  const getTime = (time) => {
@@ -27,7 +27,7 @@ export class TimeHelper {
27
27
  newDateStr = addYears(dateStr, 543);
28
28
  }
29
29
  if (this.getConfig().isThaiMonth || forceThai) {
30
- options.locale = locales.th;
30
+ options.locale = th;
31
31
  }
32
32
  return formatInTimeZone(newDateStr, this.getConfig().timeZone, formatStr, options);
33
33
  };
@@ -16,11 +16,11 @@ export const _get = (object, path, defaultValue) => {
16
16
  }
17
17
  const pathArray = Array.isArray(path) ? path : stringToPath(path);
18
18
  let current = object;
19
- for (let i = 0; i < pathArray.length; i++) {
19
+ for (const key of pathArray) {
20
20
  if (current == null) {
21
21
  return defaultValue;
22
22
  }
23
- current = current[pathArray[i]];
23
+ current = current[key];
24
24
  }
25
25
  return current === void 0 ? defaultValue : current;
26
26
  };
package/package.json CHANGED
@@ -1,20 +1,13 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "3.22.0",
4
- "repository": "https://gitlab.finema.co/finema/ui-kit",
3
+ "version": "3.24.0",
5
4
  "license": "MIT",
6
5
  "author": "Finema Dev Core Team",
7
- "engines": {
8
- "node": ">=22"
9
- },
6
+ "repository": "https://gitlab.finema.co/finema/ui-kit",
7
+ "files": [
8
+ "dist"
9
+ ],
10
10
  "type": "module",
11
- "exports": {
12
- ".": {
13
- "types": "./dist/types.d.mts",
14
- "style": "./dist/runtime/styles/main.css",
15
- "default": "./dist/module.mjs"
16
- }
17
- },
18
11
  "main": "./dist/module.mjs",
19
12
  "typesVersions": {
20
13
  "*": {
@@ -23,30 +16,43 @@
23
16
  ]
24
17
  }
25
18
  },
26
- "files": [
27
- "dist"
28
- ],
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/types.d.mts",
22
+ "style": "./dist/runtime/styles/main.css",
23
+ "default": "./dist/module.mjs"
24
+ }
25
+ },
29
26
  "scripts": {
30
27
  "prepack": "nuxt-module-build build",
31
28
  "dev": "bun run dev:prepare && nuxi dev playground -o",
32
29
  "dev:build": "nuxi build playground",
33
30
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
34
- "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
35
- "lint": "eslint .",
36
- "lint:fix": "eslint --fix .",
31
+ "release": "npm run check && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
32
+ "lint": "oxlint",
33
+ "lint:fix": "oxlint --fix",
37
34
  "test": "vitest run",
35
+ "test:unit": "vitest run --project unit",
36
+ "test:nuxt": "vitest run --project nuxt",
38
37
  "test:watch": "vitest watch",
39
- "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
40
- "prepare": "husky"
38
+ "test:coverage": "vitest run --coverage",
39
+ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit -p .nuxt/tsconfig.app.json",
40
+ "bundle:report": "node scripts/bundle-report.mjs",
41
+ "prepare": "husky",
42
+ "format": "oxfmt",
43
+ "format:check": "oxfmt --check",
44
+ "check": "oxfmt --check && oxlint && nuxt-oxclint check-vue src playground",
45
+ "check:vue": "nuxt-oxclint check-vue src playground",
46
+ "check:vue:fix": "nuxt-oxclint check-vue --fix src playground"
41
47
  },
42
48
  "dependencies": {
43
49
  "@iconify-json/heroicons": "^1.2.2",
44
50
  "@iconify-json/ph": "^1.2.2",
45
51
  "@iconify-json/svg-spinners": "^1.2.2",
46
- "@nuxt/kit": "^4.5.0",
47
- "@nuxt/ui": "^4.10.0",
48
- "@pinia/nuxt": "^0.11.0",
49
- "@tailwindcss/typography": "^0.5.0-alpha.3",
52
+ "@nuxt/kit": "^4.5.2",
53
+ "@nuxt/ui": "^4.11.1",
54
+ "@pinia/nuxt": "^1.0.2",
55
+ "@tailwindcss/typography": "^0.5.20",
50
56
  "@tiptap/extension-text-align": "^3.18.0",
51
57
  "@vee-validate/nuxt": "^4.15.1",
52
58
  "@vee-validate/valibot": "^4.15.1",
@@ -63,24 +69,39 @@
63
69
  "url-join": "^5.0.0"
64
70
  },
65
71
  "devDependencies": {
66
- "@eslint/js": "^10.0.1",
67
- "@finema/eslint-config": "^2.0.4",
68
- "@nuxt/devtools": "^3.2.4",
69
- "@nuxt/eslint-config": "^1.4.1",
70
- "@nuxt/module-builder": "^1.0.2",
71
- "@nuxt/schema": "^4.4.8",
72
- "@nuxt/test-utils": "^4.0.3",
73
- "@types/node": "latest",
72
+ "@finema/nuxt-oxclint": "^1.0.1",
73
+ "@nuxt/devtools": "^3.4.2",
74
+ "@nuxt/module-builder": "^1.0.3",
75
+ "@nuxt/schema": "^4.5.2",
76
+ "@nuxt/test-utils": "^4.3.2",
77
+ "@types/lodash-es": "^4.17.12",
78
+ "@types/node": "^22",
79
+ "@vitest/coverage-v8": "^5.0.1",
80
+ "@vue/test-utils": "^2.5.1",
74
81
  "changelogen": "^0.6.1",
82
+ "happy-dom": "^20.14.5",
75
83
  "husky": "^9.1.7",
76
84
  "lint-staged": "^17.0.7",
77
- "nuxt": "^4.4.8",
85
+ "nuxt": "^4.5.2",
86
+ "oxfmt": "^0.70.0",
87
+ "oxlint": "^1.85.0",
78
88
  "typescript": "~5.9.3",
79
- "typescript-eslint": "^8.18.0",
80
- "vitest": "^4.0.2",
89
+ "vitest": "^5.0.1",
81
90
  "vue-tsc": "^3.0.4"
82
91
  },
83
92
  "lint-staged": {
84
- "*": "eslint"
93
+ "*.{js,mjs,cjs,ts,mts,cts}": [
94
+ "oxfmt",
95
+ "oxlint"
96
+ ],
97
+ "*.vue": [
98
+ "oxfmt",
99
+ "oxlint",
100
+ "nuxt-oxclint check-vue"
101
+ ],
102
+ "*.{json,jsonc,css}": "oxfmt"
103
+ },
104
+ "engines": {
105
+ "node": ">=22"
85
106
  }
86
107
  }