@finema/core 1.4.92 → 1.4.94

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 (28) hide show
  1. package/README.md +2 -5
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +4 -1
  4. package/dist/runtime/components/Badge.vue +3 -45
  5. package/dist/runtime/components/Form/Fields.vue +9 -0
  6. package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +7 -1
  7. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/Item.vue +283 -282
  8. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +13 -4
  9. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/index.vue +134 -0
  10. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/item.vue +198 -0
  11. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/types.d.ts +20 -0
  12. package/dist/runtime/components/Form/InputUploadDropzoneImageAutoMultiple/types.mjs +0 -0
  13. package/dist/runtime/components/Form/InputUploadFileClassic/index.vue +5 -3
  14. package/dist/runtime/components/Form/InputUploadFileClassicAuto/index.vue +9 -5
  15. package/dist/runtime/components/Form/types.d.ts +4 -2
  16. package/dist/runtime/components/Form/types.mjs +1 -0
  17. package/dist/runtime/composables/useNotification.d.ts +7 -0
  18. package/dist/runtime/composables/useNotification.mjs +39 -0
  19. package/dist/runtime/types/config.d.ts +1 -1
  20. package/dist/runtime/ui.config/badge.d.ts +3 -1
  21. package/dist/runtime/ui.config/badge.mjs +1 -9
  22. package/dist/runtime/ui.config/index.d.ts +1 -0
  23. package/dist/runtime/ui.config/index.mjs +1 -0
  24. package/dist/runtime/ui.config/uploadDropzoneImage.d.ts +83 -0
  25. package/dist/runtime/ui.config/uploadDropzoneImage.mjs +26 -0
  26. package/dist/runtime/ui.config/uploadFileDropzone.d.ts +4 -0
  27. package/dist/runtime/ui.config/uploadFileDropzone.mjs +5 -1
  28. package/package.json +2 -1
package/README.md CHANGED
@@ -2,11 +2,8 @@
2
2
 
3
3
  [✨  Release Notes](/CHANGELOG.md)
4
4
 
5
- ## Features
6
-
7
- - UI components
8
- - Useful composables
9
- - Security
5
+ ## Starter template
6
+ https://gitlab.finema.co/finema/nuxt3-template-with-uikit
10
7
 
11
8
  ## Remark
12
9
  - Temporary use resolutions for vue 3.3.13 instead of ^3.4.0 due to [this issue](https://github.com/nuxt/ui/issues/1171) and planned to be fixed in the next vue 3.5 version.
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.4.92",
3
+ "version": "1.4.94",
4
4
  "configKey": "core",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.7.4"
package/dist/module.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineNuxtModule, createResolver, installModule, addPlugin, addComponentsDir, addImportsDir } from '@nuxt/kit';
2
2
 
3
3
  const name = "@finema/core";
4
- const version = "1.4.92";
4
+ const version = "1.4.94";
5
5
 
6
6
  const colors = {
7
7
  black: "#20243E",
@@ -222,6 +222,8 @@ const toggle = {
222
222
  }
223
223
  };
224
224
 
225
+ const badge = {};
226
+
225
227
  const colorModeOptions = {
226
228
  preference: "light"
227
229
  };
@@ -371,6 +373,7 @@ const module = defineNuxtModule({
371
373
  selectMenu,
372
374
  textarea,
373
375
  toggle,
376
+ badge,
374
377
  icons: {
375
378
  dynamic: true
376
379
  }
@@ -1,53 +1,11 @@
1
1
  <template>
2
- <UBadge
3
- v-bind="attrs"
4
- :class="$props.class"
5
- :label="label"
6
- :size="size"
7
- :color="color"
8
- :variant="variant"
9
- :ui="ui"
10
- >
2
+ <UBadge v-bind="$attrs">
11
3
  <slot />
12
4
  </UBadge>
13
5
  </template>
14
6
 
15
7
  <script setup lang="ts">
16
- import { useUiConfig, type PropType, useUI, toRef } from '#imports'
17
- import { badge } from '#core/ui.config'
18
- import type { BadgeColor, BadgeSize, BadgeVariant, Strategy } from '#ui/types'
8
+ import type { Badge } from '#ui/types/badge'
19
9
 
20
- const config = useUiConfig<typeof badge>(badge, 'badge')
21
-
22
- const props = defineProps({
23
- size: {
24
- type: String as PropType<BadgeSize>,
25
- default: () => badge.default.size,
26
- validator(value: string) {
27
- return Object.keys(badge.size).includes(value)
28
- },
29
- },
30
- color: {
31
- type: String as PropType<BadgeColor>,
32
- default: () => badge.default.color,
33
- },
34
- variant: {
35
- type: String as PropType<BadgeVariant>,
36
- default: () => badge.default.variant,
37
- },
38
- label: {
39
- type: [String, Number],
40
- default: null,
41
- },
42
- class: {
43
- type: [String, Object, Array] as PropType<any>,
44
- default: () => '',
45
- },
46
- ui: {
47
- type: Object as PropType<Partial<typeof config> & { strategy?: Strategy }>,
48
- default: () => ({}),
49
- },
50
- })
51
-
52
- const { ui, attrs } = useUI('badge', toRef(props, 'ui'), config, toRef(props, 'class'))
10
+ defineProps<Badge>()
53
11
  </script>
@@ -104,6 +104,7 @@
104
104
  v-else-if="option.type === INPUT_TYPES.UPLOAD_FILE_CLASSIC_AUTO"
105
105
  :class="option.class"
106
106
  :form="form"
107
+ :request-options="option.props.requestOptions"
107
108
  v-bind="getFieldBinding(option)"
108
109
  v-on="option.on ?? {}"
109
110
  />
@@ -130,6 +131,14 @@
130
131
  v-bind="getFieldBinding(option)"
131
132
  v-on="option.on ?? {}"
132
133
  />
134
+ <FormInputUploadDropzoneImageAutoMultiple
135
+ v-else-if="option.type === INPUT_TYPES.UPLOAD_DROPZONE_IMAGE_AUTO_MULTIPLE"
136
+ :class="option.class"
137
+ :form="form"
138
+ :request-options="option.props.requestOptions"
139
+ v-bind="getFieldBinding(option)"
140
+ v-on="option.on ?? {}"
141
+ />
133
142
  </template>
134
143
  </div>
135
144
  </template>
@@ -192,7 +192,13 @@ import i18next from 'i18next'
192
192
 
193
193
  const config = useUiConfig<typeof uploadFileDropzone>(uploadFileDropzone, 'uploadFileDropzone')
194
194
 
195
- const props = withDefaults(defineProps<IUploadDropzoneAutoProps>(), {})
195
+ const props = withDefaults(defineProps<IUploadDropzoneAutoProps>(), {
196
+ bodyKey: 'file',
197
+ responseKey: 'url',
198
+ selectFileLabel: 'คลิกเพื่อเลือกไฟล์',
199
+ selectFileSubLabel: 'หรือ ลากและวางที่นี่',
200
+ })
201
+
196
202
  const emits = defineEmits(['change', 'success', 'delete'])
197
203
 
198
204
  const { wrapperProps, handleChange: onChange, setErrors, value } = useFieldHOC<File>(props)