@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
@@ -21,7 +21,7 @@ export interface IUploadDropzoneAutoMultipleProps extends IFieldProps {
21
21
  retryLabel?: string;
22
22
  }
23
23
  export type IUploadDropzoneAutoMultipleField = IFormFieldBase<INPUT_TYPES.UPLOAD_DROPZONE_AUTO_MULTIPLE, IUploadDropzoneAutoMultipleProps, {
24
- change: (value: File[] | undefined) => void;
25
- success: (res: any) => void;
26
- delete: (index: number, value: IFileValue) => void;
24
+ change?: (value: File[] | undefined) => void;
25
+ success?: (res: any) => void;
26
+ delete?: (index: number, value: IFileValue) => void;
27
27
  }>;
@@ -9,18 +9,13 @@ declare const __VLS_export: import("vue").DefineComponent<IUploadImageAutoProps,
9
9
  onDelete?: (() => any) | undefined;
10
10
  onChange?: ((value: File | undefined) => any) | undefined;
11
11
  }>, {
12
- selectFileLabel: string;
13
- selectFileSubLabel: string;
14
- uploadingLabel: string;
15
- uploadFailedLabel: string;
16
- retryLabel: string;
12
+ accept: string[] | string;
17
13
  bodyKey: string;
18
14
  responseURL: string;
19
15
  responsePath: string;
20
16
  responseName: string;
21
17
  responseSize: string;
22
18
  responseID: string;
23
- accept: string[] | string;
24
19
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
20
  declare const _default: typeof __VLS_export;
26
21
  export default _default;
@@ -9,8 +9,8 @@
9
9
  <EmptyState
10
10
  v-if="uploadState.isEmpty.value"
11
11
  :theme="theme"
12
- :select-file-label="selectFileLabel"
13
- :select-file-sub-label="selectFileSubLabel"
12
+ :select-file-label="selectFileLabel ?? messages.upload.selectImage"
13
+ :select-file-sub-label="selectFileSubLabel ?? messages.upload.dropHere"
14
14
  :placeholder="placeholder"
15
15
  @open-file="uploadState.handleOpenFile"
16
16
  />
@@ -21,7 +21,7 @@
21
21
  :theme="theme"
22
22
  :selected-file="uploadState.selectedFile.value"
23
23
  :percent="uploadState.percent.value"
24
- :uploading-label="uploadingLabel"
24
+ :uploading-label="uploadingLabel ?? messages.upload.uploading"
25
25
  />
26
26
 
27
27
  <!-- Success State -->
@@ -41,8 +41,8 @@
41
41
  v-if="uploadState.isError.value"
42
42
  :theme="theme"
43
43
  :selected-file="uploadState.selectedFile.value"
44
- :upload-failed-label="uploadFailedLabel"
45
- :retry-label="retryLabel"
44
+ :upload-failed-label="uploadFailedLabel ?? messages.upload.uploadFailed"
45
+ :retry-label="retryLabel ?? messages.upload.retry"
46
46
  @retry="uploadState.handleRetryUpload"
47
47
  @delete="uploadState.handleDeleteFile"
48
48
  />
@@ -62,6 +62,7 @@ import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
62
62
  import { useFieldHOC } from "#core/composables/useForm";
63
63
  import { uploadFileDropzoneTheme } from "#core/theme/uploadFileDropzone";
64
64
  import { useUiConfig } from "#core/composables/useConfig";
65
+ import { useCoreMessages } from "#core/composables/useMessages";
65
66
  import { downloadFileFromURL } from "#core/helpers/componentHelper";
66
67
  const emits = defineEmits(["change", "success", "delete"]);
67
68
  const props = defineProps({
@@ -76,11 +77,11 @@ const props = defineProps({
76
77
  accept: { type: [Array, String], required: false, default: () => ["image/*"] },
77
78
  maxSize: { type: Number, required: false },
78
79
  dimensions: { type: Object, required: false },
79
- selectFileLabel: { type: String, required: false, default: "\u0E04\u0E25\u0E34\u0E01\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E" },
80
- selectFileSubLabel: { type: String, required: false, default: "\u0E2B\u0E23\u0E37\u0E2D \u0E25\u0E32\u0E01\u0E41\u0E25\u0E30\u0E27\u0E32\u0E07\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48" },
81
- uploadingLabel: { type: String, required: false, default: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1E\u0E42\u0E2B\u0E25\u0E14..." },
82
- uploadFailedLabel: { type: String, required: false, default: "\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" },
83
- retryLabel: { type: String, required: false, default: "\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07" },
80
+ selectFileLabel: { type: String, required: false },
81
+ selectFileSubLabel: { type: String, required: false },
82
+ uploadingLabel: { type: String, required: false },
83
+ uploadFailedLabel: { type: String, required: false },
84
+ retryLabel: { type: String, required: false },
84
85
  form: { type: Object, required: false },
85
86
  name: { type: String, required: true },
86
87
  errorMessage: { type: String, required: false },
@@ -94,19 +95,14 @@ const props = defineProps({
94
95
  readonly: { type: Boolean, required: false },
95
96
  required: { type: Boolean, required: false },
96
97
  help: { type: String, required: false },
97
- ui: { type: null, required: false }
98
+ ui: { type: null, required: false },
99
+ containerUi: { type: null, required: false }
98
100
  });
99
- const {
100
- wrapperProps,
101
- handleChange: onChange,
102
- setErrors,
103
- value
104
- } = useFieldHOC(props);
105
- const acceptedFileTypes = computed(
106
- () => typeof props.accept === "string" ? props.accept : props.accept?.join(",")
107
- );
101
+ const { messages } = useCoreMessages();
102
+ const { wrapperProps, handleChange: onChange, setErrors, value } = useFieldHOC(props);
103
+ const acceptedFileTypes = computed(() => typeof props.accept === "string" ? props.accept : props.accept?.join(","));
108
104
  const dropzoneRef = useTemplateRef("dropzoneRef");
109
- const uploadState = useUploadImageState(
105
+ const uploadState = useUploadImageState({
110
106
  props,
111
107
  emits,
112
108
  onChange,
@@ -115,9 +111,12 @@ const uploadState = useUploadImageState(
115
111
  acceptedFileTypes,
116
112
  wrapperProps,
117
113
  dropzoneRef
118
- );
114
+ });
119
115
  const theme = computed(
120
- () => useUiConfig(uploadFileDropzoneTheme, "uploadFileDropzone")({
116
+ () => useUiConfig(
117
+ uploadFileDropzoneTheme,
118
+ "uploadFileDropzone"
119
+ )({
121
120
  dragover: uploadState.dropzone.isOverDropZone.value && uploadState.isEmpty.value,
122
121
  disabled: wrapperProps.value.disabled,
123
122
  failed: uploadState.upload.status.value.isError
@@ -9,18 +9,13 @@ declare const __VLS_export: import("vue").DefineComponent<IUploadImageAutoProps,
9
9
  onDelete?: (() => any) | undefined;
10
10
  onChange?: ((value: File | undefined) => any) | undefined;
11
11
  }>, {
12
- selectFileLabel: string;
13
- selectFileSubLabel: string;
14
- uploadingLabel: string;
15
- uploadFailedLabel: string;
16
- retryLabel: string;
12
+ accept: string[] | string;
17
13
  bodyKey: string;
18
14
  responseURL: string;
19
15
  responsePath: string;
20
16
  responseName: string;
21
17
  responseSize: string;
22
18
  responseID: string;
23
- accept: string[] | string;
24
19
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
20
  declare const _default: typeof __VLS_export;
26
21
  export default _default;
@@ -31,7 +31,7 @@ export interface IUploadImageAutoProps extends IFieldProps {
31
31
  retryLabel?: string;
32
32
  }
33
33
  export type IUploadImageAutoField = IFormFieldBase<INPUT_TYPES.UPLOAD_IMAGE_AUTO, IUploadImageAutoProps, {
34
- change: (value: File | undefined) => void;
35
- success: (res: any) => void;
36
- delete: () => void;
34
+ change?: (value: File | undefined) => void;
35
+ success?: (res: any) => void;
36
+ delete?: () => void;
37
37
  }>;
@@ -39,14 +39,15 @@ export const ImagePaste = Extension.create({
39
39
  console.warn("ImagePaste: requestOptions is not configured");
40
40
  continue;
41
41
  }
42
- const {
43
- schema
44
- } = view.state;
42
+ const { schema } = view.state;
45
43
  const pos = view.state.selection.from;
46
44
  if (schema.nodes.imageUpload) {
47
- const transaction = view.state.tr.insert(pos, schema.nodes.imageUpload.create({
48
- loading: true
49
- }));
45
+ const transaction = view.state.tr.insert(
46
+ pos,
47
+ schema.nodes.imageUpload.create({
48
+ loading: true
49
+ })
50
+ );
50
51
  view.dispatch(transaction);
51
52
  }
52
53
  const request = {
@@ -10,25 +10,26 @@ export const ImageUpload = Node.create({
10
10
  return {};
11
11
  },
12
12
  parseHTML() {
13
- return [{
14
- tag: 'div[data-type="image-upload"]'
15
- }];
13
+ return [
14
+ {
15
+ tag: 'div[data-type="image-upload"]'
16
+ }
17
+ ];
16
18
  },
17
- renderHTML({
18
- HTMLAttributes
19
- }) {
20
- return ["div", mergeAttributes(HTMLAttributes, {
21
- "data-type": "image-upload"
22
- })];
19
+ renderHTML({ HTMLAttributes }) {
20
+ return [
21
+ "div",
22
+ mergeAttributes(HTMLAttributes, {
23
+ "data-type": "image-upload"
24
+ })
25
+ ];
23
26
  },
24
27
  addNodeView() {
25
28
  return VueNodeViewRenderer(ImageUploadNodeComponent);
26
29
  },
27
30
  addCommands() {
28
31
  return {
29
- insertImageUpload: () => ({
30
- commands
31
- }) => {
32
+ insertImageUpload: () => ({ commands }) => {
32
33
  return commands.insertContent({
33
34
  type: this.name
34
35
  });
@@ -38,7 +38,9 @@ const props = defineProps({
38
38
  extension: { type: Object, required: true },
39
39
  HTMLAttributes: { type: Object, required: true }
40
40
  });
41
- const options = computed(() => props.extension.options);
41
+ const options = computed(
42
+ () => props.extension.options
43
+ );
42
44
  const file = ref(null);
43
45
  const loading = ref(false);
44
46
  watch(file, async (newFile) => {
@@ -9,27 +9,27 @@ const url = ref("");
9
9
  const active = computed(() => props.editor.isActive("link"));
10
10
  const disabled = computed(() => {
11
11
  if (!props.editor.isEditable) return true;
12
- const {
13
- selection
14
- } = props.editor.state;
12
+ const { selection } = props.editor.state;
15
13
  return selection.empty && !props.editor.isActive("link");
16
14
  });
17
- watch(() => props.editor, (editor, _, onCleanup) => {
18
- if (!editor) return;
19
- const updateUrl = () => {
20
- const {
21
- href
22
- } = editor.getAttributes("link");
23
- url.value = href || "";
24
- };
25
- updateUrl();
26
- editor.on("selectionUpdate", updateUrl);
27
- onCleanup(() => {
28
- editor.off("selectionUpdate", updateUrl);
29
- });
30
- }, {
31
- immediate: true
32
- });
15
+ watch(
16
+ () => props.editor,
17
+ (editor, _, onCleanup) => {
18
+ if (!editor) return;
19
+ const updateUrl = () => {
20
+ const { href } = editor.getAttributes("link");
21
+ url.value = href || "";
22
+ };
23
+ updateUrl();
24
+ editor.on("selectionUpdate", updateUrl);
25
+ onCleanup(() => {
26
+ editor.off("selectionUpdate", updateUrl);
27
+ });
28
+ },
29
+ {
30
+ immediate: true
31
+ }
32
+ );
33
33
  watch(active, (isActive) => {
34
34
  if (isActive && props.autoOpen) {
35
35
  open.value = true;
@@ -37,9 +37,7 @@ watch(active, (isActive) => {
37
37
  });
38
38
  const setLink = () => {
39
39
  if (!url.value) return;
40
- const {
41
- selection
42
- } = props.editor.state;
40
+ const { selection } = props.editor.state;
43
41
  const isEmpty = selection.empty;
44
42
  const hasCode = props.editor.isActive("code");
45
43
  let chain = props.editor.chain().focus();
@@ -18,7 +18,7 @@
18
18
  ]"
19
19
  :ui="{
20
20
  content: '',
21
- base: ['min-h-[200px] w-full sm:px-3 py-1']
21
+ base: ['min-h-[200px] w-full py-1 sm:px-3']
22
22
  }"
23
23
  :handlers="customHandlers"
24
24
  >
@@ -38,9 +38,11 @@
38
38
  :editor="editor"
39
39
  :items="imageToolbarItems(editor)"
40
40
  layout="bubble"
41
- :should-show="({ editor: editor2, view }) => {
42
- return editor2.isActive('image') && view.hasFocus();
43
- }"
41
+ :should-show="
42
+ ({ editor: editor2, view }) => {
43
+ return editor2.isActive('image') && view.hasFocus();
44
+ }
45
+ "
44
46
  />
45
47
 
46
48
  <EditorSuggestionMenu
@@ -87,12 +89,10 @@ const props = defineProps({
87
89
  readonly: { type: Boolean, required: false },
88
90
  required: { type: Boolean, required: false },
89
91
  help: { type: String, required: false },
90
- ui: { type: null, required: false }
92
+ ui: { type: null, required: false },
93
+ containerUi: { type: null, required: false }
91
94
  });
92
- const {
93
- value,
94
- wrapperProps
95
- } = useFieldHOC(props);
95
+ const { value, wrapperProps } = useFieldHOC(props);
96
96
  const ui = computed(() => useUiConfig(wysiwygTheme, "wysiwyg")({}));
97
97
  const appendToBody = false ? () => document.body : void 0;
98
98
  const customHandlers = {
@@ -109,35 +109,38 @@ const customHandlers = {
109
109
  };
110
110
  const imageToolbarItems = (editor) => {
111
111
  const node = editor.state.doc.nodeAt(editor.state.selection.from);
112
- return [[{
113
- icon: "i-lucide-download",
114
- to: node?.attrs?.src,
115
- download: true,
116
- tooltip: {
117
- text: "Download"
118
- }
119
- }], [{
120
- icon: "i-lucide-trash",
121
- tooltip: {
122
- text: "Delete"
123
- },
124
- onClick: () => {
125
- const {
126
- state
127
- } = editor;
128
- const {
129
- selection
130
- } = state;
131
- const pos = selection.from;
132
- const node2 = state.doc.nodeAt(pos);
133
- if (node2 && node2.type.name === "image") {
134
- editor.chain().focus().deleteRange({
135
- from: pos,
136
- to: pos + node2.nodeSize
137
- }).run();
112
+ return [
113
+ [
114
+ {
115
+ icon: "i-lucide-download",
116
+ to: node?.attrs?.src,
117
+ download: true,
118
+ tooltip: {
119
+ text: "Download"
120
+ }
138
121
  }
139
- }
140
- }]];
122
+ ],
123
+ [
124
+ {
125
+ icon: "i-lucide-trash",
126
+ tooltip: {
127
+ text: "Delete"
128
+ },
129
+ onClick: () => {
130
+ const { state } = editor;
131
+ const { selection } = state;
132
+ const pos = selection.from;
133
+ const node2 = state.doc.nodeAt(pos);
134
+ if (node2 && node2.type.name === "image") {
135
+ editor.chain().focus().deleteRange({
136
+ from: pos,
137
+ to: pos + node2.nodeSize
138
+ }).run();
139
+ }
140
+ }
141
+ }
142
+ ]
143
+ ];
141
144
  };
142
145
  const toolbarItems = [
143
146
  // Block types
@@ -150,27 +153,32 @@ const toolbarItems = [
150
153
  content: {
151
154
  align: "start"
152
155
  },
153
- items: [{
154
- kind: "heading",
155
- level: 1,
156
- icon: "i-lucide-heading-1",
157
- label: "Heading 1"
158
- }, {
159
- kind: "heading",
160
- level: 2,
161
- icon: "i-lucide-heading-2",
162
- label: "Heading 2"
163
- }, {
164
- kind: "heading",
165
- level: 3,
166
- icon: "i-lucide-heading-3",
167
- label: "Heading 3"
168
- }, {
169
- kind: "heading",
170
- level: 4,
171
- icon: "i-lucide-heading-4",
172
- label: "Heading 4"
173
- }]
156
+ items: [
157
+ {
158
+ kind: "heading",
159
+ level: 1,
160
+ icon: "i-lucide-heading-1",
161
+ label: "Heading 1"
162
+ },
163
+ {
164
+ kind: "heading",
165
+ level: 2,
166
+ icon: "i-lucide-heading-2",
167
+ label: "Heading 2"
168
+ },
169
+ {
170
+ kind: "heading",
171
+ level: 3,
172
+ icon: "i-lucide-heading-3",
173
+ label: "Heading 3"
174
+ },
175
+ {
176
+ kind: "heading",
177
+ level: 4,
178
+ icon: "i-lucide-heading-4",
179
+ label: "Heading 4"
180
+ }
181
+ ]
174
182
  },
175
183
  // Text alignment
176
184
  {
@@ -216,15 +224,18 @@ const toolbarItems = [
216
224
  content: {
217
225
  align: "start"
218
226
  },
219
- items: [{
220
- kind: "bulletList",
221
- icon: "i-lucide-list",
222
- label: "Bullet List"
223
- }, {
224
- kind: "orderedList",
225
- icon: "i-lucide-list-ordered",
226
- label: "Ordered List"
227
- }]
227
+ items: [
228
+ {
229
+ kind: "bulletList",
230
+ icon: "i-lucide-list",
231
+ label: "Bullet List"
232
+ },
233
+ {
234
+ kind: "orderedList",
235
+ icon: "i-lucide-list-ordered",
236
+ label: "Ordered List"
237
+ }
238
+ ]
228
239
  },
229
240
  {
230
241
  kind: "blockquote",
@@ -249,66 +260,77 @@ const toolbarItems = [
249
260
  }
250
261
  ],
251
262
  // Text formatting
252
- [{
253
- kind: "mark",
254
- mark: "bold",
255
- icon: "i-lucide-bold",
256
- tooltip: {
257
- text: "Bold"
258
- }
259
- }, {
260
- kind: "mark",
261
- mark: "italic",
262
- icon: "i-lucide-italic",
263
- tooltip: {
264
- text: "Italic"
265
- }
266
- }, {
267
- kind: "mark",
268
- mark: "underline",
269
- icon: "i-lucide-underline",
270
- tooltip: {
271
- text: "Underline"
272
- }
273
- }, {
274
- kind: "mark",
275
- mark: "strike",
276
- icon: "i-lucide-strikethrough",
277
- tooltip: {
278
- text: "Strikethrough"
279
- }
280
- }, {
281
- kind: "mark",
282
- mark: "code",
283
- icon: "i-lucide-code",
284
- tooltip: {
285
- text: "Code"
263
+ [
264
+ {
265
+ kind: "mark",
266
+ mark: "bold",
267
+ icon: "i-lucide-bold",
268
+ tooltip: {
269
+ text: "Bold"
270
+ }
271
+ },
272
+ {
273
+ kind: "mark",
274
+ mark: "italic",
275
+ icon: "i-lucide-italic",
276
+ tooltip: {
277
+ text: "Italic"
278
+ }
279
+ },
280
+ {
281
+ kind: "mark",
282
+ mark: "underline",
283
+ icon: "i-lucide-underline",
284
+ tooltip: {
285
+ text: "Underline"
286
+ }
287
+ },
288
+ {
289
+ kind: "mark",
290
+ mark: "strike",
291
+ icon: "i-lucide-strikethrough",
292
+ tooltip: {
293
+ text: "Strikethrough"
294
+ }
295
+ },
296
+ {
297
+ kind: "mark",
298
+ mark: "code",
299
+ icon: "i-lucide-code",
300
+ tooltip: {
301
+ text: "Code"
302
+ }
286
303
  }
287
- }],
304
+ ],
288
305
  // Link & image
289
306
  [
290
307
  {
291
308
  slot: "link"
292
309
  },
293
- ...props.image?.requestOptions ? [{
294
- kind: "imageUpload",
295
- icon: "i-lucide-image"
296
- }] : []
310
+ ...props.image?.requestOptions ? [
311
+ {
312
+ kind: "imageUpload",
313
+ icon: "i-lucide-image"
314
+ }
315
+ ] : []
297
316
  ],
298
317
  // History controls
299
- [{
300
- kind: "undo",
301
- icon: "i-lucide-undo",
302
- tooltip: {
303
- text: "Undo"
304
- }
305
- }, {
306
- kind: "redo",
307
- icon: "i-lucide-redo",
308
- tooltip: {
309
- text: "Redo"
318
+ [
319
+ {
320
+ kind: "undo",
321
+ icon: "i-lucide-undo",
322
+ tooltip: {
323
+ text: "Undo"
324
+ }
325
+ },
326
+ {
327
+ kind: "redo",
328
+ icon: "i-lucide-redo",
329
+ tooltip: {
330
+ text: "Redo"
331
+ }
310
332
  }
311
- }]
333
+ ]
312
334
  ];
313
335
  const suggestionItems = [
314
336
  [
@@ -6,7 +6,7 @@
6
6
  />
7
7
  <div :class="theme.labelWrapper()">
8
8
  <p
9
- class="text-primary cursor-pointer font-bold"
9
+ class="cursor-pointer font-bold text-primary"
10
10
  @click="$emit('openFile')"
11
11
  >
12
12
  {{ selectFileLabel }}
@@ -11,7 +11,7 @@
11
11
  <h1 class="truncate font-bold">
12
12
  {{ selectedFile.name }}
13
13
  </h1>
14
- <p class="text-error truncate font-light">
14
+ <p class="truncate font-light text-error">
15
15
  {{ uploadFailedLabel }}
16
16
  </p>
17
17
  <Button
@@ -27,7 +27,7 @@
27
27
  <Icon
28
28
  :name="icons.actionDeleteIcon"
29
29
  :class="theme.actionDeleteIconClass()"
30
- title="ลบไฟล์"
30
+ :title="messages.upload.remove"
31
31
  @click="$emit('delete')"
32
32
  />
33
33
  </div>
@@ -35,6 +35,7 @@
35
35
  </template>
36
36
 
37
37
  <script setup>
38
+ import { useCoreMessages } from "#core/composables/useMessages";
38
39
  import { isImage } from "#core/helpers/componentHelper";
39
40
  import { useUiIconConfig } from "#core/composables/useConfig";
40
41
  defineEmits(["retry", "delete"]);
@@ -51,4 +52,5 @@ const getFileIcon = (file) => {
51
52
  }
52
53
  return icons.filePreviewIcon;
53
54
  };
55
+ const { messages } = useCoreMessages();
54
56
  </script>
@@ -17,14 +17,14 @@ interface Props {
17
17
  }
18
18
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
19
19
  delete: (index: number) => any;
20
- download: (value: IFileValue) => any;
21
- preview: (value: IFileValue) => any;
22
20
  retry: (index: number) => any;
21
+ preview: (value: IFileValue) => any;
22
+ download: (value: IFileValue) => any;
23
23
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
24
24
  onDelete?: ((index: number) => any) | undefined;
25
- onDownload?: ((value: IFileValue) => any) | undefined;
26
- onPreview?: ((value: IFileValue) => any) | undefined;
27
25
  onRetry?: ((index: number) => any) | undefined;
26
+ onPreview?: ((value: IFileValue) => any) | undefined;
27
+ onDownload?: ((value: IFileValue) => any) | undefined;
28
28
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
29
  declare const _default: typeof __VLS_export;
30
30
  export default _default;