@finema/core 1.4.201 → 1.4.203

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 (72) hide show
  1. package/README.md +60 -60
  2. package/dist/module.d.mts +1 -0
  3. package/dist/module.d.ts +1 -0
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +2 -1
  6. package/dist/runtime/components/Alert.vue +48 -48
  7. package/dist/runtime/components/Avatar.vue +27 -27
  8. package/dist/runtime/components/Badge.vue +11 -11
  9. package/dist/runtime/components/Breadcrumb.vue +44 -44
  10. package/dist/runtime/components/Button/Group.vue +37 -37
  11. package/dist/runtime/components/Button/index.vue +75 -75
  12. package/dist/runtime/components/Card.vue +38 -38
  13. package/dist/runtime/components/Core.vue +45 -45
  14. package/dist/runtime/components/Dialog/index.vue +108 -108
  15. package/dist/runtime/components/Dropdown/index.vue +70 -70
  16. package/dist/runtime/components/FlexDeck/Base.vue +152 -152
  17. package/dist/runtime/components/FlexDeck/index.vue +68 -68
  18. package/dist/runtime/components/Form/FieldWrapper.vue +23 -23
  19. package/dist/runtime/components/Form/Fields.vue +230 -230
  20. package/dist/runtime/components/Form/InputCheckbox/index.vue +28 -28
  21. package/dist/runtime/components/Form/InputDateTime/index.vue +61 -61
  22. package/dist/runtime/components/Form/InputDateTimeRange/index.vue +83 -83
  23. package/dist/runtime/components/Form/InputNumber/index.vue +27 -27
  24. package/dist/runtime/components/Form/InputRadio/index.vue +27 -27
  25. package/dist/runtime/components/Form/InputSelect/index.vue +45 -45
  26. package/dist/runtime/components/Form/InputSelectMultiple/index.vue +54 -54
  27. package/dist/runtime/components/Form/InputStatic/index.vue +16 -16
  28. package/dist/runtime/components/Form/InputTags/index.vue +141 -141
  29. package/dist/runtime/components/Form/InputText/index.vue +68 -68
  30. package/dist/runtime/components/Form/InputTextarea/index.vue +25 -25
  31. package/dist/runtime/components/Form/InputToggle/index.vue +27 -27
  32. package/dist/runtime/components/Form/InputUploadDropzone/index.vue +206 -206
  33. package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +342 -342
  34. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/ItemUpload.vue +241 -241
  35. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/ItemView.vue +89 -89
  36. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +170 -170
  37. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/ItemUpload.vue +161 -161
  38. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/ItemView.vue +64 -64
  39. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/index.vue +178 -178
  40. package/dist/runtime/components/Form/InputUploadFileClassic/index.vue +95 -95
  41. package/dist/runtime/components/Form/InputUploadFileClassicAuto/index.vue +151 -151
  42. package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +219 -219
  43. package/dist/runtime/components/Form/InputWYSIWYG/UploadImageForm.vue +55 -55
  44. package/dist/runtime/components/Form/InputWYSIWYG/index.vue +228 -228
  45. package/dist/runtime/components/Form/index.vue +6 -6
  46. package/dist/runtime/components/Icon.vue +23 -23
  47. package/dist/runtime/components/Image.vue +36 -36
  48. package/dist/runtime/components/Loader.vue +27 -27
  49. package/dist/runtime/components/Modal/index.vue +146 -146
  50. package/dist/runtime/components/QRCode.vue +22 -22
  51. package/dist/runtime/components/SimplePagination.vue +96 -96
  52. package/dist/runtime/components/Slideover/index.vue +110 -110
  53. package/dist/runtime/components/Table/Base.vue +153 -153
  54. package/dist/runtime/components/Table/ColumnDate.vue +16 -16
  55. package/dist/runtime/components/Table/ColumnDateTime.vue +18 -18
  56. package/dist/runtime/components/Table/ColumnImage.vue +15 -15
  57. package/dist/runtime/components/Table/ColumnNumber.vue +14 -14
  58. package/dist/runtime/components/Table/ColumnText.vue +29 -29
  59. package/dist/runtime/components/Table/Simple.vue +69 -69
  60. package/dist/runtime/components/Table/index.vue +65 -65
  61. package/dist/runtime/components/Tabs/index.vue +64 -64
  62. package/dist/runtime/components/TeleportSafe.vue +40 -40
  63. package/dist/runtime/core.config.d.ts +1 -0
  64. package/dist/runtime/core.config.mjs +2 -1
  65. package/dist/runtime/ui.config/notifications.d.ts +3 -0
  66. package/dist/runtime/ui.config/notifications.mjs +3 -0
  67. package/dist/runtime/utils/TimeHelper.mjs +15 -10
  68. package/dist/runtime/utils/TimeHelper.spec.mjs +11 -4
  69. package/dist/runtime/utils/TimeHelper.thai.spec.mjs +2 -1
  70. package/package.json +102 -101
  71. package/dist/runtime/components/Form/InputDateTime/index.vue~ +0 -61
  72. package/dist/runtime/ui.config/table.ts~ +0 -48
@@ -7,7 +7,8 @@ vi.mock("#core/composables/useConfig", () => ({
7
7
  date_format_system: "yyyy-MM-dd",
8
8
  date_time_format_system: "yyyy-MM-dd HH:mm",
9
9
  time_format: "HH:mm",
10
- is_thai_year: false
10
+ is_thai_year: false,
11
+ time_zone: "Asia/Bangkok"
11
12
  })
12
13
  }));
13
14
  describe("TimeHelper", async () => {
@@ -17,15 +18,21 @@ describe("TimeHelper", async () => {
17
18
  const result = TimeHelper.toUTC(inputTime);
18
19
  assert.equal(result, expectedOutput);
19
20
  });
21
+ it("toUTC should convert time to UTC format 2", () => {
22
+ const inputTime = "2023-01-16T22:01:00Z";
23
+ const expectedOutput = "2023-01-16 22:01";
24
+ const result = TimeHelper.toUTC(inputTime);
25
+ assert.equal(result, expectedOutput);
26
+ });
20
27
  it("toLocal should convert time to local format", () => {
21
- const inputTime = "2023-12-19 12:00";
22
- const expectedOutput = "2023-12-19 19:00";
28
+ const inputTime = "2023-01-16T22:00:00Z";
29
+ const expectedOutput = "2023-01-17 05:00";
23
30
  const result = TimeHelper.toLocal(inputTime);
24
31
  assert.equal(result, expectedOutput);
25
32
  });
26
33
  it("[thai year ]toLocal should convert time to local format", () => {
27
34
  const inputTime = "2023-12-19 12:00";
28
- const expectedOutput = "2023-12-19 19:00";
35
+ const expectedOutput = "2023-12-19 12:00";
29
36
  const result = TimeHelper.toLocal(inputTime);
30
37
  assert.equal(result, expectedOutput);
31
38
  });
@@ -5,7 +5,8 @@ vi.mock("#core/composables/useConfig", () => ({
5
5
  date_format: "yyyy-MM-dd",
6
6
  date_time_format: "yyyy-MM-dd HH:mm",
7
7
  time_format: "HH:mm",
8
- is_thai_year: true
8
+ is_thai_year: true,
9
+ time_zone: "Asia/Bangkok"
9
10
  })
10
11
  }));
11
12
  describe("TimeHelper", async () => {
package/package.json CHANGED
@@ -1,101 +1,102 @@
1
- {
2
- "name": "@finema/core",
3
- "version": "1.4.201",
4
- "repository": "https://gitlab.finema.co/finema/ui-kit",
5
- "license": "MIT",
6
- "author": "Finema Dev Core Team",
7
- "type": "module",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/types.d.ts",
11
- "import": "./dist/module.mjs",
12
- "require": "./dist/module.cjs"
13
- }
14
- },
15
- "main": "./dist/module.cjs",
16
- "types": "./dist/types.d.ts",
17
- "files": [
18
- "dist"
19
- ],
20
- "engines": {
21
- "node": ">=18.0.0"
22
- },
23
- "scripts": {
24
- "prepack": "nuxt-module-build build",
25
- "dev": "nuxi dev playground -o",
26
- "docs": "nuxi dev docs -o",
27
- "dev:build": "nuxi build playground",
28
- "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground && nuxi prepare docs",
29
- "docs:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare docs",
30
- "lint": "eslint . --cache",
31
- "lint:fix": "eslint . --fix --cache",
32
- "test": "vitest run",
33
- "test:watch": "vitest watch",
34
- "release": "release-it --ci",
35
- "prepare": "husky install"
36
- },
37
- "dependencies": {
38
- "@nuxt/kit": "^3.13.1",
39
- "@nuxt/ui": "2.18.5",
40
- "@pinia/nuxt": "^0.5.4",
41
- "@tiptap/extension-image": "^2.6.6",
42
- "@tiptap/extension-link": "^2.6.6",
43
- "@tiptap/extension-text-align": "^2.6.6",
44
- "@tiptap/extension-underline": "^2.6.6",
45
- "@tiptap/extension-youtube": "^2.6.6",
46
- "@tiptap/pm": "^2.6.6",
47
- "@tiptap/starter-kit": "^2.6.6",
48
- "@tiptap/vue-3": "^2.6.6",
49
- "@vee-validate/nuxt": "^4.13.2",
50
- "@vee-validate/zod": "^4.13.2",
51
- "@vuepic/vue-datepicker": "^8.2.0",
52
- "@vueup/vue-quill": "^1.2.0",
53
- "@wdns/vue-code-block": "^2.3.3",
54
- "axios": "^1.7.2",
55
- "cheerio": "1.0.0-rc.12",
56
- "date-fns": "^3.3.1",
57
- "defu": "^6.1.4",
58
- "i18next": "^23.12.2",
59
- "maska": "^2.1.11",
60
- "nuxt-lodash": "^2.5.3",
61
- "nuxt-security": "^1.2.2",
62
- "pinia": "^2.1.7",
63
- "qrcode.vue": "^3.4.1",
64
- "url-join": "^5.0.0",
65
- "zod": "^3.23.8",
66
- "zod-i18n-map": "^2.27.0"
67
- },
68
- "devDependencies": {
69
- "@finema/eslint-config": "^1.2.0",
70
- "@nuxt/devtools": "^1.4.2",
71
- "@nuxt/eslint-config": "^0.5.0",
72
- "@nuxt/module-builder": "^0.5.5",
73
- "@nuxt/schema": "^3.13.1",
74
- "@nuxt/test-utils": "^3.13.1",
75
- "@release-it/conventional-changelog": "^8.0.1",
76
- "@types/node": "^20.10.17",
77
- "@types/quill": "^2",
78
- "@vue/test-utils": "^2.4.6",
79
- "changelogen": "^0.5.5",
80
- "eslint": "^8.56.0",
81
- "happy-dom": "^13.0.0",
82
- "husky": "^9.0.11",
83
- "lint-staged": "^15.2.0",
84
- "nuxt": "^3.13.1",
85
- "playwright-core": "^1.42.1",
86
- "prettier": "^3.1.1",
87
- "release-it": "^17.0.1",
88
- "sass": "^1.69.5",
89
- "stylelint": "^16.1.0",
90
- "stylelint-config-prettier-scss": "^1.0.0",
91
- "stylelint-config-standard-scss": "^13.0.0",
92
- "vitest": "^2.0.4"
93
- },
94
- "lint-staged": {
95
- "*.{ts,vue,tsx,js}": "eslint --fix --cache"
96
- },
97
- "workspaces": [
98
- "./*"
99
- ],
100
- "packageManager": "yarn@4.4.1"
101
- }
1
+ {
2
+ "name": "@finema/core",
3
+ "version": "1.4.203",
4
+ "repository": "https://gitlab.finema.co/finema/ui-kit",
5
+ "license": "MIT",
6
+ "author": "Finema Dev Core Team",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/types.d.ts",
11
+ "import": "./dist/module.mjs",
12
+ "require": "./dist/module.cjs"
13
+ }
14
+ },
15
+ "main": "./dist/module.cjs",
16
+ "types": "./dist/types.d.ts",
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "engines": {
21
+ "node": ">=18.0.0"
22
+ },
23
+ "scripts": {
24
+ "prepack": "nuxt-module-build build",
25
+ "dev": "nuxi dev playground -o",
26
+ "docs": "nuxi dev docs -o",
27
+ "dev:build": "nuxi build playground",
28
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground && nuxi prepare docs",
29
+ "docs:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare docs",
30
+ "lint": "eslint . --cache",
31
+ "lint:fix": "eslint . --fix --cache",
32
+ "test": "vitest run",
33
+ "test:watch": "vitest watch",
34
+ "release": "release-it --ci",
35
+ "prepare": "husky install"
36
+ },
37
+ "dependencies": {
38
+ "@nuxt/kit": "^3.13.1",
39
+ "@nuxt/ui": "2.18.5",
40
+ "@pinia/nuxt": "^0.5.4",
41
+ "@tiptap/extension-image": "^2.6.6",
42
+ "@tiptap/extension-link": "^2.6.6",
43
+ "@tiptap/extension-text-align": "^2.6.6",
44
+ "@tiptap/extension-underline": "^2.6.6",
45
+ "@tiptap/extension-youtube": "^2.6.6",
46
+ "@tiptap/pm": "^2.6.6",
47
+ "@tiptap/starter-kit": "^2.6.6",
48
+ "@tiptap/vue-3": "^2.6.6",
49
+ "@vee-validate/nuxt": "^4.13.2",
50
+ "@vee-validate/zod": "^4.13.2",
51
+ "@vuepic/vue-datepicker": "^8.2.0",
52
+ "@vueup/vue-quill": "^1.2.0",
53
+ "@wdns/vue-code-block": "^2.3.3",
54
+ "axios": "^1.7.2",
55
+ "cheerio": "1.0.0-rc.12",
56
+ "date-fns": "^3.3.1",
57
+ "date-fns-tz": "^3.1.3",
58
+ "defu": "^6.1.4",
59
+ "i18next": "^23.12.2",
60
+ "maska": "^2.1.11",
61
+ "nuxt-lodash": "^2.5.3",
62
+ "nuxt-security": "^1.2.2",
63
+ "pinia": "^2.1.7",
64
+ "qrcode.vue": "^3.4.1",
65
+ "url-join": "^5.0.0",
66
+ "zod": "^3.23.8",
67
+ "zod-i18n-map": "^2.27.0"
68
+ },
69
+ "devDependencies": {
70
+ "@finema/eslint-config": "^1.2.0",
71
+ "@nuxt/devtools": "^1.4.2",
72
+ "@nuxt/eslint-config": "^0.5.0",
73
+ "@nuxt/module-builder": "^0.5.5",
74
+ "@nuxt/schema": "^3.13.1",
75
+ "@nuxt/test-utils": "^3.13.1",
76
+ "@release-it/conventional-changelog": "^8.0.1",
77
+ "@types/node": "^20.10.17",
78
+ "@types/quill": "^2",
79
+ "@vue/test-utils": "^2.4.6",
80
+ "changelogen": "^0.5.5",
81
+ "eslint": "^8.56.0",
82
+ "happy-dom": "^13.0.0",
83
+ "husky": "^9.0.11",
84
+ "lint-staged": "^15.2.0",
85
+ "nuxt": "^3.13.1",
86
+ "playwright-core": "^1.42.1",
87
+ "prettier": "^3.1.1",
88
+ "release-it": "^17.0.1",
89
+ "sass": "^1.69.5",
90
+ "stylelint": "^16.1.0",
91
+ "stylelint-config-prettier-scss": "^1.0.0",
92
+ "stylelint-config-standard-scss": "^13.0.0",
93
+ "vitest": "^2.0.4"
94
+ },
95
+ "lint-staged": {
96
+ "*.{ts,vue,tsx,js}": "eslint --fix --cache"
97
+ },
98
+ "workspaces": [
99
+ "./*"
100
+ ],
101
+ "packageManager": "yarn@4.4.1"
102
+ }
@@ -1,61 +0,0 @@
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>
@@ -1,48 +0,0 @@
1
- import type { DeepPartial } from '#ui/types'
2
- import type * as config from '#ui/ui.config'
3
-
4
- export const table: DeepPartial<(typeof config)['table']> = {
5
- wrapper: 'relative overflow-x-auto bg-white rounded-lg',
6
- base: 'min-w-full table-fixed',
7
- divide: 'divide-y divide-y-2 divide-gray-300 dark:divide-gray-700',
8
- thead: '',
9
- tbody: 'divide-y divide-gray-200 dark:divide-gray-800',
10
- tr: {
11
- base: 'even:bg-gray-50',
12
- selected: 'bg-gray-50 dark:bg-gray-800/50',
13
- active: 'hover:bg-gray-50 dark:hover:bg-gray-800/50 cursor-pointer',
14
- },
15
- th: {
16
- base: 'text-left rtl:text-right',
17
- padding: 'px-3 py-3.5',
18
- color: 'text-gray-700 dark:text-white',
19
- font: 'font-normal',
20
- size: 'text-sm',
21
- },
22
- td: {
23
- base: 'whitespace-nowrap',
24
- padding: 'px-3 py-4',
25
- color: 'text-gray-500 dark:text-gray-400',
26
- font: '',
27
- size: 'text-base',
28
- },
29
- progress: {
30
- wrapper: 'absolute inset-x-0 p-0',
31
- },
32
- default: {
33
- sortButton: {
34
- icon: 'i-heroicons-arrows-up-down-20-solid',
35
- trailing: true,
36
- square: true,
37
- color: 'gray',
38
- variant: 'ghost',
39
- class: '-m-1.5 text-gray-700 font-normal',
40
- },
41
- loadingState: {
42
- label: 'กำลังโหลด...',
43
- },
44
- emptyState: {
45
- label: 'ไม่พบข้อมูล',
46
- },
47
- },
48
- }