@finema/core 1.4.124 → 1.4.126

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 (64) hide show
  1. package/README.md +60 -60
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +1 -1
  4. package/dist/runtime/components/Alert.vue +48 -48
  5. package/dist/runtime/components/Avatar.vue +27 -27
  6. package/dist/runtime/components/Badge.vue +11 -11
  7. package/dist/runtime/components/Breadcrumb.vue +44 -44
  8. package/dist/runtime/components/Button/Group.vue +37 -37
  9. package/dist/runtime/components/Button/index.vue +75 -75
  10. package/dist/runtime/components/Card.vue +38 -38
  11. package/dist/runtime/components/Core.vue +37 -37
  12. package/dist/runtime/components/Dialog/index.vue +108 -108
  13. package/dist/runtime/components/Dropdown/index.vue +70 -70
  14. package/dist/runtime/components/FlexDeck/Base.vue +143 -143
  15. package/dist/runtime/components/FlexDeck/index.vue +68 -68
  16. package/dist/runtime/components/Form/FieldWrapper.vue +23 -23
  17. package/dist/runtime/components/Form/Fields.vue +230 -230
  18. package/dist/runtime/components/Form/InputCheckbox/index.vue +28 -21
  19. package/dist/runtime/components/Form/InputCheckbox/types.d.ts +3 -1
  20. package/dist/runtime/components/Form/InputDateTime/index.vue +60 -60
  21. package/dist/runtime/components/Form/InputDateTimeRange/index.vue +83 -83
  22. package/dist/runtime/components/Form/InputNumber/index.vue +27 -27
  23. package/dist/runtime/components/Form/InputRadio/index.vue +27 -27
  24. package/dist/runtime/components/Form/InputSelect/index.vue +43 -36
  25. package/dist/runtime/components/Form/InputSelectMultiple/index.vue +52 -52
  26. package/dist/runtime/components/Form/InputStatic/index.vue +16 -16
  27. package/dist/runtime/components/Form/InputTags/index.vue +145 -145
  28. package/dist/runtime/components/Form/InputText/index.vue +67 -67
  29. package/dist/runtime/components/Form/InputTextarea/index.vue +25 -25
  30. package/dist/runtime/components/Form/InputToggle/index.vue +14 -14
  31. package/dist/runtime/components/Form/InputUploadDropzone/index.vue +206 -206
  32. package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +341 -341
  33. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/ItemUpload.vue +241 -241
  34. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/ItemView.vue +89 -89
  35. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +164 -164
  36. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/ItemUpload.vue +161 -161
  37. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/ItemView.vue +64 -64
  38. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/index.vue +172 -172
  39. package/dist/runtime/components/Form/InputUploadFileClassic/index.vue +95 -95
  40. package/dist/runtime/components/Form/InputUploadFileClassicAuto/index.vue +151 -151
  41. package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +219 -219
  42. package/dist/runtime/components/Form/InputWYSIWYG/index.vue +53 -53
  43. package/dist/runtime/components/Form/index.vue +6 -6
  44. package/dist/runtime/components/Form/types.d.ts +1 -0
  45. package/dist/runtime/components/Icon.vue +23 -23
  46. package/dist/runtime/components/Image.vue +36 -36
  47. package/dist/runtime/components/Loader.vue +27 -27
  48. package/dist/runtime/components/Log.vue +6 -30
  49. package/dist/runtime/components/LogItem.vue +43 -0
  50. package/dist/runtime/components/Modal/index.vue +146 -146
  51. package/dist/runtime/components/QRCode.vue +22 -22
  52. package/dist/runtime/components/SimplePagination.vue +96 -96
  53. package/dist/runtime/components/Slideover/index.vue +110 -110
  54. package/dist/runtime/components/Table/Base.vue +139 -139
  55. package/dist/runtime/components/Table/ColumnDate.vue +16 -16
  56. package/dist/runtime/components/Table/ColumnDateTime.vue +18 -18
  57. package/dist/runtime/components/Table/ColumnImage.vue +15 -15
  58. package/dist/runtime/components/Table/ColumnNumber.vue +14 -14
  59. package/dist/runtime/components/Table/ColumnText.vue +25 -25
  60. package/dist/runtime/components/Table/Simple.vue +69 -69
  61. package/dist/runtime/components/Table/index.vue +65 -65
  62. package/dist/runtime/components/Tabs/index.vue +64 -64
  63. package/dist/runtime/components/TeleportSafe.vue +40 -40
  64. package/package.json +95 -95
@@ -1,65 +1,65 @@
1
- <template>
2
- <div>
3
- <div v-if="options.isEnabledSearch" class="mb-4 flex justify-end">
4
- <UInput
5
- v-model="q"
6
- icon="i-heroicons-magnifying-glass"
7
- :placeholder="options.searchPlaceholder || 'ค้นหา...'"
8
- />
9
- </div>
10
- <Base
11
- v-bind="$attrs"
12
- :columns="options.columns"
13
- :raw-data="options.rawData"
14
- :status="options.status"
15
- :page-options="options.pageOptions"
16
- :is-simple-pagination="isShowSimplePagination"
17
- :is-hide-bottom-pagination="options.isHideBottomPagination"
18
- @page-change="onPageChange"
19
- >
20
- <template v-for="(_, slot) of $slots" #[slot]="slotProps">
21
- <slot :name="slot" v-bind="slotProps || {}" />
22
- </template>
23
- </Base>
24
- </div>
25
- </template>
26
- <script lang="ts" setup>
27
- import { type PropType } from 'vue'
28
- import { type ITableOptions } from '#core/components/Table/types'
29
- import { _debounce, computed, ref, watch } from '#imports'
30
- import { useCoreConfig } from '#core/composables/useConfig'
31
- import Base from '#core/components/Table/Base.vue'
32
-
33
- defineSlots<{
34
- 'empty-state': () => any
35
- 'loading-state': () => any
36
- }>()
37
-
38
- const emits = defineEmits<{
39
- (event: 'pageChange', page: number): void
40
- (event: 'search', q: string): void
41
- }>()
42
-
43
- const props = defineProps({
44
- options: { type: Object as PropType<ITableOptions>, required: true },
45
- })
46
-
47
- const coreConfig = useCoreConfig()
48
-
49
- const q = ref(props.options?.pageOptions.search ?? '')
50
-
51
- const isShowSimplePagination = computed(
52
- (): boolean => props.options.isSimplePagination ?? coreConfig.is_simple_pagination
53
- )
54
-
55
- watch(
56
- q,
57
- _debounce((value) => {
58
- emits('search', value)
59
- }, 500)
60
- )
61
-
62
- const onPageChange = (page: number) => {
63
- emits('pageChange', page)
64
- }
65
- </script>
1
+ <template>
2
+ <div>
3
+ <div v-if="options.isEnabledSearch" class="mb-4 flex justify-end">
4
+ <UInput
5
+ v-model="q"
6
+ icon="i-heroicons-magnifying-glass"
7
+ :placeholder="options.searchPlaceholder || 'ค้นหา...'"
8
+ />
9
+ </div>
10
+ <Base
11
+ v-bind="$attrs"
12
+ :columns="options.columns"
13
+ :raw-data="options.rawData"
14
+ :status="options.status"
15
+ :page-options="options.pageOptions"
16
+ :is-simple-pagination="isShowSimplePagination"
17
+ :is-hide-bottom-pagination="options.isHideBottomPagination"
18
+ @page-change="onPageChange"
19
+ >
20
+ <template v-for="(_, slot) of $slots" #[slot]="slotProps">
21
+ <slot :name="slot" v-bind="slotProps || {}" />
22
+ </template>
23
+ </Base>
24
+ </div>
25
+ </template>
26
+ <script lang="ts" setup>
27
+ import { type PropType } from 'vue'
28
+ import { type ITableOptions } from '#core/components/Table/types'
29
+ import { _debounce, computed, ref, watch } from '#imports'
30
+ import { useCoreConfig } from '#core/composables/useConfig'
31
+ import Base from '#core/components/Table/Base.vue'
32
+
33
+ defineSlots<{
34
+ 'empty-state': () => any
35
+ 'loading-state': () => any
36
+ }>()
37
+
38
+ const emits = defineEmits<{
39
+ (event: 'pageChange', page: number): void
40
+ (event: 'search', q: string): void
41
+ }>()
42
+
43
+ const props = defineProps({
44
+ options: { type: Object as PropType<ITableOptions>, required: true },
45
+ })
46
+
47
+ const coreConfig = useCoreConfig()
48
+
49
+ const q = ref(props.options?.pageOptions.search ?? '')
50
+
51
+ const isShowSimplePagination = computed(
52
+ (): boolean => props.options.isSimplePagination ?? coreConfig.is_simple_pagination
53
+ )
54
+
55
+ watch(
56
+ q,
57
+ _debounce((value) => {
58
+ emits('search', value)
59
+ }, 500)
60
+ )
61
+
62
+ const onPageChange = (page: number) => {
63
+ emits('pageChange', page)
64
+ }
65
+ </script>
@@ -1,64 +1,64 @@
1
- <template>
2
- <UTabs
3
- v-bind="attrs"
4
- :model-value="modelValue"
5
- :class="$props.class"
6
- :items="items"
7
- :orientation="orientation"
8
- :default-index="defaultIndex"
9
- :ui="ui"
10
- @change="change"
11
- >
12
- <template #default="{ item, index, selected }">
13
- <slot name="default" :item="item" :index="index" :selected="selected" />
14
- </template>
15
-
16
- <template #item="{ item, index, selected }">
17
- <slot name="item" :item="item" :index="index" :selected="selected" />
18
- </template>
19
- </UTabs>
20
- </template>
21
-
22
- <script setup lang="ts">
23
- import { useUiConfig, type PropType, useUI, toRef } from '#imports'
24
- import { tabs } from '#core/ui.config'
25
- import type { Strategy, TabItem } from '#ui/types'
26
-
27
- const config = useUiConfig<typeof tabs>(tabs, 'tabs')
28
-
29
- const props = defineProps({
30
- modelValue: {
31
- type: Number,
32
- default: undefined,
33
- },
34
- items: {
35
- type: Array as PropType<TabItem[]>,
36
- default: () => [],
37
- },
38
- orientation: {
39
- type: String as PropType<'horizontal' | 'vertical'>,
40
- default: 'horizontal',
41
- validator: (value: string) => ['horizontal', 'vertical'].includes(value),
42
- },
43
- defaultIndex: {
44
- type: Number,
45
- default: 0,
46
- },
47
- class: {
48
- type: [String, Object, Array] as PropType<any>,
49
- default: () => '',
50
- },
51
- ui: {
52
- type: Object as PropType<Partial<typeof config> & { strategy?: Strategy }>,
53
- default: () => ({}),
54
- },
55
- })
56
-
57
- const emits = defineEmits(['update:modelValue', 'change'])
58
-
59
- const change = (index: number) => {
60
- emits('change', index)
61
- }
62
-
63
- const { ui, attrs } = useUI('tabs', toRef(props, 'ui'), config, toRef(props, 'class'))
64
- </script>
1
+ <template>
2
+ <UTabs
3
+ v-bind="attrs"
4
+ :model-value="modelValue"
5
+ :class="$props.class"
6
+ :items="items"
7
+ :orientation="orientation"
8
+ :default-index="defaultIndex"
9
+ :ui="ui"
10
+ @change="change"
11
+ >
12
+ <template #default="{ item, index, selected }">
13
+ <slot name="default" :item="item" :index="index" :selected="selected" />
14
+ </template>
15
+
16
+ <template #item="{ item, index, selected }">
17
+ <slot name="item" :item="item" :index="index" :selected="selected" />
18
+ </template>
19
+ </UTabs>
20
+ </template>
21
+
22
+ <script setup lang="ts">
23
+ import { useUiConfig, type PropType, useUI, toRef } from '#imports'
24
+ import { tabs } from '#core/ui.config'
25
+ import type { Strategy, TabItem } from '#ui/types'
26
+
27
+ const config = useUiConfig<typeof tabs>(tabs, 'tabs')
28
+
29
+ const props = defineProps({
30
+ modelValue: {
31
+ type: Number,
32
+ default: undefined,
33
+ },
34
+ items: {
35
+ type: Array as PropType<TabItem[]>,
36
+ default: () => [],
37
+ },
38
+ orientation: {
39
+ type: String as PropType<'horizontal' | 'vertical'>,
40
+ default: 'horizontal',
41
+ validator: (value: string) => ['horizontal', 'vertical'].includes(value),
42
+ },
43
+ defaultIndex: {
44
+ type: Number,
45
+ default: 0,
46
+ },
47
+ class: {
48
+ type: [String, Object, Array] as PropType<any>,
49
+ default: () => '',
50
+ },
51
+ ui: {
52
+ type: Object as PropType<Partial<typeof config> & { strategy?: Strategy }>,
53
+ default: () => ({}),
54
+ },
55
+ })
56
+
57
+ const emits = defineEmits(['update:modelValue', 'change'])
58
+
59
+ const change = (index: number) => {
60
+ emits('change', index)
61
+ }
62
+
63
+ const { ui, attrs } = useUI('tabs', toRef(props, 'ui'), config, toRef(props, 'class'))
64
+ </script>
@@ -1,40 +1,40 @@
1
- <template>
2
- <Teleport v-if="isShow" :to="target" :disabled="!target || disabled">
3
- <slot />
4
- </Teleport>
5
- </template>
6
-
7
- <script setup lang="ts">
8
- import { onBeforeUnmount, onMounted, ref } from 'vue'
9
-
10
- const props = defineProps<{ to: string; disabled?: boolean }>()
11
-
12
- const target = ref<Element | null>(null)
13
- const isShow = ref(false)
14
-
15
- onBeforeUnmount(() => {
16
- isShow.value = false
17
- })
18
-
19
- onMounted(() => {
20
- isShow.value = true
21
-
22
- const observer = new MutationObserver((mutationList, observer) => {
23
- for (const mutation of mutationList) {
24
- if (mutation.type !== 'childList') continue
25
- const el = document.querySelector(props.to)
26
- if (!el) continue
27
- target.value = el
28
- observer.disconnect()
29
-
30
- break
31
- }
32
- })
33
-
34
- observer.observe(document, { childList: true, subtree: true })
35
-
36
- return () => {
37
- observer.disconnect()
38
- }
39
- })
40
- </script>
1
+ <template>
2
+ <Teleport v-if="isShow" :to="target" :disabled="!target || disabled">
3
+ <slot />
4
+ </Teleport>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { onBeforeUnmount, onMounted, ref } from 'vue'
9
+
10
+ const props = defineProps<{ to: string; disabled?: boolean }>()
11
+
12
+ const target = ref<Element | null>(null)
13
+ const isShow = ref(false)
14
+
15
+ onBeforeUnmount(() => {
16
+ isShow.value = false
17
+ })
18
+
19
+ onMounted(() => {
20
+ isShow.value = true
21
+
22
+ const observer = new MutationObserver((mutationList, observer) => {
23
+ for (const mutation of mutationList) {
24
+ if (mutation.type !== 'childList') continue
25
+ const el = document.querySelector(props.to)
26
+ if (!el) continue
27
+ target.value = el
28
+ observer.disconnect()
29
+
30
+ break
31
+ }
32
+ })
33
+
34
+ observer.observe(document, { childList: true, subtree: true })
35
+
36
+ return () => {
37
+ observer.disconnect()
38
+ }
39
+ })
40
+ </script>
package/package.json CHANGED
@@ -1,95 +1,95 @@
1
- {
2
- "name": "@finema/core",
3
- "version": "1.4.124",
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",
26
- "docs": "nuxi dev docs",
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.11.1",
39
- "@nuxt/ui": "^2.15.1",
40
- "@pinia/nuxt": "^0.5.1",
41
- "@vee-validate/nuxt": "^4.12.6",
42
- "@vee-validate/zod": "^4.12.6",
43
- "@vuepic/vue-datepicker": "^8.2.0",
44
- "@vueup/vue-quill": "^1.2.0",
45
- "@wdns/vue-code-block": "^2.3.2",
46
- "axios": "^1.6.8",
47
- "date-fns": "^3.3.1",
48
- "i18next": "^23.10.1",
49
- "maska": "^2.1.11",
50
- "nuxt-lodash": "^2.5.3",
51
- "nuxt-security": "^1.2.2",
52
- "pinia": "^2.1.7",
53
- "prismjs": "^1.29.0",
54
- "qrcode.vue": "^3.4.1",
55
- "url-join": "^5.0.0",
56
- "zod": "^3.22.4",
57
- "zod-i18n-map": "^2.27.0"
58
- },
59
- "devDependencies": {
60
- "@finema/eslint-config": "^1.2.0",
61
- "@nuxt/devtools": "^1.1.4",
62
- "@nuxt/eslint-config": "^0.2.0",
63
- "@nuxt/module-builder": "^0.5.5",
64
- "@nuxt/schema": "^3.11.1",
65
- "@nuxt/test-utils": "^3.12.0",
66
- "@release-it/conventional-changelog": "^8.0.1",
67
- "@types/node": "^20.10.17",
68
- "@types/prismjs": "^1",
69
- "@types/quill": "^2",
70
- "@vue/test-utils": "^2.4.3",
71
- "changelogen": "^0.5.5",
72
- "eslint": "^8.56.0",
73
- "happy-dom": "^13.0.0",
74
- "husky": "^9.0.11",
75
- "lint-staged": "^15.2.0",
76
- "nuxt": "^3.11.1",
77
- "playwright-core": "^1.42.1",
78
- "prettier": "^3.1.1",
79
- "release-it": "^17.0.1",
80
- "sass": "^1.69.5",
81
- "stylelint": "^16.1.0",
82
- "stylelint-config-prettier-scss": "^1.0.0",
83
- "stylelint-config-standard-scss": "^13.0.0",
84
- "vitest": "^1.3.1",
85
- "vue": "^3.4.21"
86
- },
87
- "lint-staged": {
88
- "*.{ts,vue,tsx,js}": "eslint --fix --cache",
89
- "*.{html,json}": "prettier --write"
90
- },
91
- "workspaces": [
92
- "./*"
93
- ],
94
- "packageManager": "yarn@4.2.2"
95
- }
1
+ {
2
+ "name": "@finema/core",
3
+ "version": "1.4.126",
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",
26
+ "docs": "nuxi dev docs",
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.11.1",
39
+ "@nuxt/ui": "^2.15.1",
40
+ "@pinia/nuxt": "^0.5.1",
41
+ "@vee-validate/nuxt": "^4.12.6",
42
+ "@vee-validate/zod": "^4.12.6",
43
+ "@vuepic/vue-datepicker": "^8.2.0",
44
+ "@vueup/vue-quill": "^1.2.0",
45
+ "@wdns/vue-code-block": "^2.3.2",
46
+ "axios": "^1.6.8",
47
+ "date-fns": "^3.3.1",
48
+ "i18next": "^23.10.1",
49
+ "maska": "^2.1.11",
50
+ "nuxt-lodash": "^2.5.3",
51
+ "nuxt-security": "^1.2.2",
52
+ "pinia": "^2.1.7",
53
+ "prismjs": "^1.29.0",
54
+ "qrcode.vue": "^3.4.1",
55
+ "url-join": "^5.0.0",
56
+ "zod": "^3.22.4",
57
+ "zod-i18n-map": "^2.27.0"
58
+ },
59
+ "devDependencies": {
60
+ "@finema/eslint-config": "^1.2.0",
61
+ "@nuxt/devtools": "^1.1.4",
62
+ "@nuxt/eslint-config": "^0.2.0",
63
+ "@nuxt/module-builder": "^0.5.5",
64
+ "@nuxt/schema": "^3.11.1",
65
+ "@nuxt/test-utils": "^3.12.0",
66
+ "@release-it/conventional-changelog": "^8.0.1",
67
+ "@types/node": "^20.10.17",
68
+ "@types/prismjs": "^1",
69
+ "@types/quill": "^2",
70
+ "@vue/test-utils": "^2.4.3",
71
+ "changelogen": "^0.5.5",
72
+ "eslint": "^8.56.0",
73
+ "happy-dom": "^13.0.0",
74
+ "husky": "^9.0.11",
75
+ "lint-staged": "^15.2.0",
76
+ "nuxt": "^3.11.1",
77
+ "playwright-core": "^1.42.1",
78
+ "prettier": "^3.1.1",
79
+ "release-it": "^17.0.1",
80
+ "sass": "^1.69.5",
81
+ "stylelint": "^16.1.0",
82
+ "stylelint-config-prettier-scss": "^1.0.0",
83
+ "stylelint-config-standard-scss": "^13.0.0",
84
+ "vitest": "^1.3.1",
85
+ "vue": "^3.4.21"
86
+ },
87
+ "lint-staged": {
88
+ "*.{ts,vue,tsx,js}": "eslint --fix --cache",
89
+ "*.{html,json}": "prettier --write"
90
+ },
91
+ "workspaces": [
92
+ "./*"
93
+ ],
94
+ "packageManager": "yarn@4.2.2"
95
+ }