@finema/core 3.23.2 → 3.25.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 (88) hide show
  1. package/README.md +22 -2
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +3 -14
  4. package/dist/runtime/components/DevToolsWindow/index.vue +24 -26
  5. package/dist/runtime/components/Dialog/index.vue +11 -10
  6. package/dist/runtime/components/Empty.d.vue.ts +1 -1
  7. package/dist/runtime/components/Empty.vue +16 -12
  8. package/dist/runtime/components/Empty.vue.d.ts +1 -1
  9. package/dist/runtime/components/FlexDeck/index.vue +85 -92
  10. package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
  11. package/dist/runtime/components/Form/Fields.d.vue.ts +1 -1
  12. package/dist/runtime/components/Form/Fields.vue +17 -11
  13. package/dist/runtime/components/Form/Fields.vue.d.ts +1 -1
  14. package/dist/runtime/components/Form/InputCheckbox/index.vue +19 -23
  15. package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +1 -5
  16. package/dist/runtime/components/Form/InputCurrency/index.vue +56 -57
  17. package/dist/runtime/components/Form/InputDateTime/date_time_field.types.d.ts +2 -0
  18. package/dist/runtime/components/Form/InputDateTime/index.vue +70 -80
  19. package/dist/runtime/components/Form/InputDateTimeRange/index.vue +78 -75
  20. package/dist/runtime/components/Form/InputMonth/index.vue +7 -10
  21. package/dist/runtime/components/Form/InputNumber/index.vue +21 -25
  22. package/dist/runtime/components/Form/InputRadio/index.d.vue.ts +1 -1
  23. package/dist/runtime/components/Form/InputRadio/index.vue +1 -5
  24. package/dist/runtime/components/Form/InputRadio/index.vue.d.ts +1 -1
  25. package/dist/runtime/components/Form/InputRating/index.vue +1 -5
  26. package/dist/runtime/components/Form/InputSearch/index.vue +2 -8
  27. package/dist/runtime/components/Form/InputSelect/index.vue +112 -122
  28. package/dist/runtime/components/Form/InputSelectMultiple/index.vue +121 -133
  29. package/dist/runtime/components/Form/InputTags/index.vue +55 -59
  30. package/dist/runtime/components/Form/InputText/index.vue +122 -133
  31. package/dist/runtime/components/Form/InputTextarea/index.vue +19 -23
  32. package/dist/runtime/components/Form/InputTime/index.d.vue.ts +1 -0
  33. package/dist/runtime/components/Form/InputTime/index.vue +66 -63
  34. package/dist/runtime/components/Form/InputTime/index.vue.d.ts +1 -0
  35. package/dist/runtime/components/Form/InputTime/types.d.ts +2 -0
  36. package/dist/runtime/components/Form/InputToggle/index.vue +18 -21
  37. package/dist/runtime/components/Form/InputUploadDropzone/index.vue +46 -49
  38. package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +57 -63
  39. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +57 -64
  40. package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +57 -63
  41. package/dist/runtime/components/Form/InputWYSIWYG/EditorImagePasteExtension.js +7 -6
  42. package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadExtension.js +13 -12
  43. package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.vue +21 -19
  44. package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.vue +85 -87
  45. package/dist/runtime/components/Form/InputWYSIWYG/README.md +96 -96
  46. package/dist/runtime/components/Form/InputWYSIWYG/index.vue +178 -157
  47. package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
  48. package/dist/runtime/components/Form/fileState/FailedState.vue +34 -36
  49. package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
  50. package/dist/runtime/components/Form/fileState/MultipleFilesState.vue +74 -78
  51. package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
  52. package/dist/runtime/components/Form/fileState/SuccessState.vue +3 -12
  53. package/dist/runtime/components/Form/fileState/useFileState.js +2 -10
  54. package/dist/runtime/components/Form/fileState/useUploadImageState.js +1 -3
  55. package/dist/runtime/components/Form/fileState/useUploadState.js +8 -19
  56. package/dist/runtime/components/Form/fileState/useUploadStateMultiple.js +25 -30
  57. package/dist/runtime/components/Form/index.vue +5 -5
  58. package/dist/runtime/components/Image.vue +22 -28
  59. package/dist/runtime/components/Loader.d.vue.ts +1 -1
  60. package/dist/runtime/components/Loader.vue +10 -7
  61. package/dist/runtime/components/Loader.vue.d.ts +1 -1
  62. package/dist/runtime/components/Log/LogItem.vue +1 -3
  63. package/dist/runtime/components/Log/index.vue +1 -3
  64. package/dist/runtime/components/Table/Base.vue +117 -137
  65. package/dist/runtime/components/Table/ColumnDate.vue +1 -1
  66. package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
  67. package/dist/runtime/components/Table/ColumnImage.vue +4 -4
  68. package/dist/runtime/components/Table/ColumnText.vue +10 -10
  69. package/dist/runtime/components/Table/Pagination.vue +71 -77
  70. package/dist/runtime/components/Table/Simple.vue +19 -19
  71. package/dist/runtime/components/Table/index.vue +36 -42
  72. package/dist/runtime/composables/loaderList.js +1 -3
  73. package/dist/runtime/composables/loaderPage.js +156 -133
  74. package/dist/runtime/composables/useConfig.js +1 -1
  75. package/dist/runtime/composables/useDialog.js +1 -3
  76. package/dist/runtime/composables/useForm.d.ts +1 -1
  77. package/dist/runtime/composables/useForm.js +1 -3
  78. package/dist/runtime/composables/useTable.js +2 -14
  79. package/dist/runtime/helpers/apiBaseHelper.js +6 -24
  80. package/dist/runtime/helpers/apiListHelper.js +2 -5
  81. package/dist/runtime/helpers/apiObjectHelper.js +2 -5
  82. package/dist/runtime/helpers/apiPageHelper.js +19 -38
  83. package/dist/runtime/helpers/componentHelper.js +2 -6
  84. package/dist/runtime/helpers/uploadCore.js +1 -4
  85. package/dist/runtime/locale/index.js +1 -4
  86. package/dist/runtime/server/tsconfig.json +3 -3
  87. package/dist/runtime/styles/main.css +1 -1
  88. package/package.json +39 -26
@@ -1,56 +1,58 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <div :class="ui.container()">
4
- <Editor
5
- v-slot="{ editor }"
6
- v-model="value"
7
- content-type="html"
8
- :editable="editable"
9
- :placeholder="placeholder"
10
- :autofocus="autoFocus"
11
- class="min-h-[200px]"
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <div :class="ui.container()">
4
+ <Editor
5
+ v-slot="{ editor }"
6
+ v-model="value"
7
+ content-type="html"
8
+ :editable="editable"
9
+ :placeholder="placeholder"
10
+ :autofocus="autoFocus"
11
+ class="min-h-[200px]"
12
12
  :extensions="[
13
13
  TextAlign.configure({
14
14
  types: ['heading', 'paragraph'],
15
15
  alignments: ['left', 'center', 'right', 'justify']
16
16
  }),
17
17
  ...image.requestOptions ? [ImageUpload.configure(image), ImagePaste.configure(image)] : []
18
- ]"
18
+ ]"
19
19
  :ui="{
20
20
  content: '',
21
- base: ['min-h-[200px] w-full sm:px-3 py-1']
22
- }"
23
- :handlers="customHandlers"
24
- >
25
- <EditorToolbar
26
- :editor="editor"
27
- :items="toolbarItems"
28
- :class="ui.toolbar()"
29
- >
30
- <template #link>
31
- <EditorLinkPopover
32
- :editor="editor"
33
- auto-open
34
- />
35
- </template>
36
- </EditorToolbar>
37
- <EditorToolbar
38
- :editor="editor"
39
- :items="imageToolbarItems(editor)"
40
- layout="bubble"
41
- :should-show="({ editor: editor2, view }) => {
42
- return editor2.isActive('image') && view.hasFocus();
43
- }"
44
- />
45
-
46
- <EditorSuggestionMenu
47
- :editor="editor"
48
- :items="suggestionItems"
49
- :append-to="appendToBody"
50
- />
51
- </Editor>
52
- </div>
53
- </FieldWrapper>
21
+ base: ['min-h-[200px] w-full py-1 sm:px-3']
22
+ }"
23
+ :handlers="customHandlers"
24
+ >
25
+ <EditorToolbar
26
+ :editor="editor"
27
+ :items="toolbarItems"
28
+ :class="ui.toolbar()"
29
+ >
30
+ <template #link>
31
+ <EditorLinkPopover
32
+ :editor="editor"
33
+ auto-open
34
+ />
35
+ </template>
36
+ </EditorToolbar>
37
+ <EditorToolbar
38
+ :editor="editor"
39
+ :items="imageToolbarItems(editor)"
40
+ layout="bubble"
41
+ :should-show="
42
+ ({ editor: editor2, view }) => {
43
+ return editor2.isActive('image') && view.hasFocus();
44
+ }
45
+ "
46
+ />
47
+
48
+ <EditorSuggestionMenu
49
+ :editor="editor"
50
+ :items="suggestionItems"
51
+ :append-to="appendToBody"
52
+ />
53
+ </Editor>
54
+ </div>
55
+ </FieldWrapper>
54
56
  </template>
55
57
 
56
58
  <script setup>
@@ -90,10 +92,7 @@ const props = defineProps({
90
92
  ui: { type: null, required: false },
91
93
  containerUi: { type: null, required: false }
92
94
  });
93
- const {
94
- value,
95
- wrapperProps
96
- } = useFieldHOC(props);
95
+ const { value, wrapperProps } = useFieldHOC(props);
97
96
  const ui = computed(() => useUiConfig(wysiwygTheme, "wysiwyg")({}));
98
97
  const appendToBody = false ? () => document.body : void 0;
99
98
  const customHandlers = {
@@ -110,35 +109,38 @@ const customHandlers = {
110
109
  };
111
110
  const imageToolbarItems = (editor) => {
112
111
  const node = editor.state.doc.nodeAt(editor.state.selection.from);
113
- return [[{
114
- icon: "i-lucide-download",
115
- to: node?.attrs?.src,
116
- download: true,
117
- tooltip: {
118
- text: "Download"
119
- }
120
- }], [{
121
- icon: "i-lucide-trash",
122
- tooltip: {
123
- text: "Delete"
124
- },
125
- onClick: () => {
126
- const {
127
- state
128
- } = editor;
129
- const {
130
- selection
131
- } = 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();
112
+ return [
113
+ [
114
+ {
115
+ icon: "i-lucide-download",
116
+ to: node?.attrs?.src,
117
+ download: true,
118
+ tooltip: {
119
+ text: "Download"
120
+ }
139
121
  }
140
- }
141
- }]];
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
+ ];
142
144
  };
143
145
  const toolbarItems = [
144
146
  // Block types
@@ -151,27 +153,32 @@ const toolbarItems = [
151
153
  content: {
152
154
  align: "start"
153
155
  },
154
- items: [{
155
- kind: "heading",
156
- level: 1,
157
- icon: "i-lucide-heading-1",
158
- label: "Heading 1"
159
- }, {
160
- kind: "heading",
161
- level: 2,
162
- icon: "i-lucide-heading-2",
163
- label: "Heading 2"
164
- }, {
165
- kind: "heading",
166
- level: 3,
167
- icon: "i-lucide-heading-3",
168
- label: "Heading 3"
169
- }, {
170
- kind: "heading",
171
- level: 4,
172
- icon: "i-lucide-heading-4",
173
- label: "Heading 4"
174
- }]
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
+ ]
175
182
  },
176
183
  // Text alignment
177
184
  {
@@ -217,15 +224,18 @@ const toolbarItems = [
217
224
  content: {
218
225
  align: "start"
219
226
  },
220
- items: [{
221
- kind: "bulletList",
222
- icon: "i-lucide-list",
223
- label: "Bullet List"
224
- }, {
225
- kind: "orderedList",
226
- icon: "i-lucide-list-ordered",
227
- label: "Ordered List"
228
- }]
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
+ ]
229
239
  },
230
240
  {
231
241
  kind: "blockquote",
@@ -250,66 +260,77 @@ const toolbarItems = [
250
260
  }
251
261
  ],
252
262
  // Text formatting
253
- [{
254
- kind: "mark",
255
- mark: "bold",
256
- icon: "i-lucide-bold",
257
- tooltip: {
258
- text: "Bold"
259
- }
260
- }, {
261
- kind: "mark",
262
- mark: "italic",
263
- icon: "i-lucide-italic",
264
- tooltip: {
265
- text: "Italic"
266
- }
267
- }, {
268
- kind: "mark",
269
- mark: "underline",
270
- icon: "i-lucide-underline",
271
- tooltip: {
272
- text: "Underline"
273
- }
274
- }, {
275
- kind: "mark",
276
- mark: "strike",
277
- icon: "i-lucide-strikethrough",
278
- tooltip: {
279
- text: "Strikethrough"
280
- }
281
- }, {
282
- kind: "mark",
283
- mark: "code",
284
- icon: "i-lucide-code",
285
- tooltip: {
286
- 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
+ }
287
303
  }
288
- }],
304
+ ],
289
305
  // Link & image
290
306
  [
291
307
  {
292
308
  slot: "link"
293
309
  },
294
- ...props.image?.requestOptions ? [{
295
- kind: "imageUpload",
296
- icon: "i-lucide-image"
297
- }] : []
310
+ ...props.image?.requestOptions ? [
311
+ {
312
+ kind: "imageUpload",
313
+ icon: "i-lucide-image"
314
+ }
315
+ ] : []
298
316
  ],
299
317
  // History controls
300
- [{
301
- kind: "undo",
302
- icon: "i-lucide-undo",
303
- tooltip: {
304
- text: "Undo"
305
- }
306
- }, {
307
- kind: "redo",
308
- icon: "i-lucide-redo",
309
- tooltip: {
310
- 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
+ }
311
332
  }
312
- }]
333
+ ]
313
334
  ];
314
335
  const suggestionItems = [
315
336
  [
@@ -1,25 +1,25 @@
1
1
  <template>
2
- <div :class="theme.placeholderWrapper()">
3
- <Icon
4
- :name="icons.uploadIcon"
5
- :class="theme.labelIcon()"
6
- />
7
- <div :class="theme.labelWrapper()">
8
- <p
9
- class="text-primary cursor-pointer font-bold"
10
- @click="$emit('openFile')"
11
- >
12
- {{ selectFileLabel }}
13
- </p>
14
- <p>{{ selectFileSubLabel }}</p>
15
- </div>
16
- <p
17
- v-if="placeholder"
18
- :class="theme.placeholder()"
19
- >
20
- {{ placeholder }}
21
- </p>
22
- </div>
2
+ <div :class="theme.placeholderWrapper()">
3
+ <Icon
4
+ :name="icons.uploadIcon"
5
+ :class="theme.labelIcon()"
6
+ />
7
+ <div :class="theme.labelWrapper()">
8
+ <p
9
+ class="cursor-pointer font-bold text-primary"
10
+ @click="$emit('openFile')"
11
+ >
12
+ {{ selectFileLabel }}
13
+ </p>
14
+ <p>{{ selectFileSubLabel }}</p>
15
+ </div>
16
+ <p
17
+ v-if="placeholder"
18
+ :class="theme.placeholder()"
19
+ >
20
+ {{ placeholder }}
21
+ </p>
22
+ </div>
23
23
  </template>
24
24
 
25
25
  <script setup>
@@ -1,37 +1,37 @@
1
1
  <template>
2
- <div :class="theme.onFailedWrapper()">
3
- <div :class="theme.onFailedFailedImgWrapper()">
4
- <Icon
5
- :name="getFileIcon(selectedFile)"
6
- :class="theme.onFailedFailedIconClass()"
7
- />
8
- </div>
9
- <div :class="theme.onFailedTextWrapper()">
10
- <div class="truncate">
11
- <h1 class="truncate font-bold">
12
- {{ selectedFile.name }}
13
- </h1>
14
- <p class="text-error truncate font-light">
15
- {{ uploadFailedLabel }}
16
- </p>
17
- <Button
18
- variant="link"
19
- :icon="icons.actionRetryIcon"
20
- :class="theme.actionRetryBtnClass()"
21
- color="primary"
22
- @click="$emit('retry')"
23
- >
24
- {{ retryLabel }}
25
- </Button>
26
- </div>
27
- <Icon
28
- :name="icons.actionDeleteIcon"
29
- :class="theme.actionDeleteIconClass()"
30
- :title="messages.upload.remove"
31
- @click="$emit('delete')"
32
- />
33
- </div>
34
- </div>
2
+ <div :class="theme.onFailedWrapper()">
3
+ <div :class="theme.onFailedFailedImgWrapper()">
4
+ <Icon
5
+ :name="getFileIcon(selectedFile)"
6
+ :class="theme.onFailedFailedIconClass()"
7
+ />
8
+ </div>
9
+ <div :class="theme.onFailedTextWrapper()">
10
+ <div class="truncate">
11
+ <h1 class="truncate font-bold">
12
+ {{ selectedFile.name }}
13
+ </h1>
14
+ <p class="truncate font-light text-error">
15
+ {{ uploadFailedLabel }}
16
+ </p>
17
+ <Button
18
+ variant="link"
19
+ :icon="icons.actionRetryIcon"
20
+ :class="theme.actionRetryBtnClass()"
21
+ color="primary"
22
+ @click="$emit('retry')"
23
+ >
24
+ {{ retryLabel }}
25
+ </Button>
26
+ </div>
27
+ <Icon
28
+ :name="icons.actionDeleteIcon"
29
+ :class="theme.actionDeleteIconClass()"
30
+ :title="messages.upload.remove"
31
+ @click="$emit('delete')"
32
+ />
33
+ </div>
34
+ </div>
35
35
  </template>
36
36
 
37
37
  <script setup>
@@ -52,7 +52,5 @@ const getFileIcon = (file) => {
52
52
  }
53
53
  return icons.filePreviewIcon;
54
54
  };
55
- const {
56
- messages
57
- } = useCoreMessages();
55
+ const { messages } = useCoreMessages();
58
56
  </script>
@@ -1,28 +1,28 @@
1
1
  <template>
2
- <div :class="theme.onLoadingWrapper()">
3
- <div :class="theme.onLoadingPlaceholderWrapper()">
4
- <Icon
5
- :name="getFileIcon(selectedFile)"
6
- :class="theme.onLoadingPlaceholderIconClass()"
7
- />
8
- </div>
9
- <div :class="theme.onLoadingTextWrapper()">
10
- <div class="truncate">
11
- <h1 class="truncate font-bold">
12
- {{ selectedFile.name }}
13
- </h1>
14
- <p class="truncate font-light text-gray-400">
15
- {{ getFileSize(selectedFile) }} - {{ percent }}% {{ uploadingLabel }}
16
- </p>
17
- </div>
18
- <div>
19
- <Icon
20
- :name="icons.loadingIcon"
21
- :class="theme.onLoadingLoadingIconClass()"
22
- />
23
- </div>
24
- </div>
25
- </div>
2
+ <div :class="theme.onLoadingWrapper()">
3
+ <div :class="theme.onLoadingPlaceholderWrapper()">
4
+ <Icon
5
+ :name="getFileIcon(selectedFile)"
6
+ :class="theme.onLoadingPlaceholderIconClass()"
7
+ />
8
+ </div>
9
+ <div :class="theme.onLoadingTextWrapper()">
10
+ <div class="truncate">
11
+ <h1 class="truncate font-bold">
12
+ {{ selectedFile.name }}
13
+ </h1>
14
+ <p class="truncate font-light text-gray-400">
15
+ {{ getFileSize(selectedFile) }} - {{ percent }}% {{ uploadingLabel }}
16
+ </p>
17
+ </div>
18
+ <div>
19
+ <Icon
20
+ :name="icons.loadingIcon"
21
+ :class="theme.onLoadingLoadingIconClass()"
22
+ />
23
+ </div>
24
+ </div>
25
+ </div>
26
26
  </template>
27
27
 
28
28
  <script setup>