@finema/core 3.19.0 → 3.20.1
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.
- package/dist/module.json +1 -1
- package/dist/module.mjs +43 -60
- package/dist/runtime/components/App.d.vue.ts +2 -2
- package/dist/runtime/components/App.vue.d.ts +2 -2
- package/dist/runtime/components/Empty.d.vue.ts +1 -1
- package/dist/runtime/components/Empty.vue.d.ts +1 -1
- package/dist/runtime/components/FlexDeck/index.vue +79 -79
- package/dist/runtime/components/Form/FieldWrapper.d.vue.ts +2 -2
- package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
- package/dist/runtime/components/Form/FieldWrapper.vue.d.ts +2 -2
- package/dist/runtime/components/Form/Fields.vue +13 -13
- package/dist/runtime/components/Form/InputCheckbox/index.vue +18 -18
- package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +21 -21
- package/dist/runtime/components/Form/InputCurrency/index.vue +49 -49
- package/dist/runtime/components/Form/InputDateTime/index.vue +63 -63
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue +56 -56
- package/dist/runtime/components/Form/InputNumber/index.vue +20 -20
- package/dist/runtime/components/Form/InputSelect/index.vue +110 -110
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +118 -118
- package/dist/runtime/components/Form/InputTags/index.d.vue.ts +2 -2
- package/dist/runtime/components/Form/InputTags/index.vue +54 -54
- package/dist/runtime/components/Form/InputTags/index.vue.d.ts +2 -2
- package/dist/runtime/components/Form/InputText/index.vue +86 -86
- package/dist/runtime/components/Form/InputTextarea/index.vue +18 -18
- package/dist/runtime/components/Form/InputTime/index.vue +38 -38
- package/dist/runtime/components/Form/InputToggle/index.vue +17 -17
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +30 -30
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +50 -50
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +50 -50
- package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +50 -50
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.vue +18 -18
- package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.vue +65 -65
- package/dist/runtime/components/Form/InputWYSIWYG/README.md +96 -96
- package/dist/runtime/components/Form/InputWYSIWYG/index.vue +41 -41
- package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
- package/dist/runtime/components/Form/fileState/FailedState.vue +33 -33
- package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
- package/dist/runtime/components/Form/fileState/MultipleFilesState.vue +75 -75
- package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
- package/dist/runtime/components/Form/index.vue +5 -5
- package/dist/runtime/components/Image.vue +28 -28
- package/dist/runtime/components/Log/index.vue +17 -17
- package/dist/runtime/components/Table/Base.d.vue.ts +4 -4
- package/dist/runtime/components/Table/Base.vue +117 -117
- package/dist/runtime/components/Table/Base.vue.d.ts +4 -4
- package/dist/runtime/components/Table/ColumnDate.vue +1 -1
- package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
- package/dist/runtime/components/Table/ColumnImage.vue +4 -4
- package/dist/runtime/components/Table/ColumnText.vue +10 -10
- package/dist/runtime/components/Table/Pagination.vue +62 -62
- package/dist/runtime/components/Table/Simple.vue +19 -19
- package/dist/runtime/components/Table/index.vue +33 -33
- package/dist/runtime/components/TeleportSafe.d.vue.ts +2 -2
- package/dist/runtime/components/TeleportSafe.vue.d.ts +2 -2
- package/dist/runtime/helpers/apiBaseHelper.d.ts +10 -2
- package/dist/runtime/helpers/apiBaseHelper.js +28 -7
- package/dist/runtime/helpers/apiListHelper.js +9 -13
- package/dist/runtime/helpers/apiObjectHelper.js +9 -13
- package/dist/runtime/helpers/apiPageHelper.js +43 -62
- package/dist/runtime/server/tsconfig.json +3 -3
- package/package.json +10 -10
|
@@ -3,23 +3,26 @@ import { _get } from "../utils/lodash.js";
|
|
|
3
3
|
import { bindParamsToUrl } from "./apiBaseHelper.js";
|
|
4
4
|
import {
|
|
5
5
|
checkExpiration,
|
|
6
|
+
createErrorOptions,
|
|
7
|
+
createSuccessOptions,
|
|
6
8
|
handleApiRequest,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
toSerializableRequestOptions,
|
|
9
|
+
prepareLoaderRequestOptions,
|
|
10
|
+
toSerializableLoaderOptions,
|
|
10
11
|
updateLoaderState
|
|
11
12
|
} from "./apiBaseHelper.js";
|
|
12
13
|
import { _findIndex, _shuffle } from "#imports";
|
|
13
14
|
export const apiAddHelper = async (state, onUpdateStatus, onUpdateOptions, onUpdateData, onUpdateItems, data, opts) => {
|
|
14
15
|
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
15
16
|
onUpdateOptions({});
|
|
16
|
-
const
|
|
17
|
+
const {
|
|
18
|
+
requestOptions,
|
|
19
|
+
stateRequestOptions
|
|
20
|
+
} = prepareLoaderRequestOptions(
|
|
17
21
|
opts.getBaseRequestOptions?.() || {},
|
|
18
22
|
opts.add?.getRequestOptions?.(data, opts),
|
|
19
23
|
opts.params,
|
|
20
24
|
opts.signal
|
|
21
25
|
);
|
|
22
|
-
const serializableRequestOptions = toSerializableRequestOptions(requestOptions);
|
|
23
26
|
const url = bindParamsToUrl(opts.add?.getURL ? opts.add.getURL(data, opts) : opts.baseURL, opts.pathBind);
|
|
24
27
|
await handleApiRequest(
|
|
25
28
|
{
|
|
@@ -33,18 +36,11 @@ export const apiAddHelper = async (state, onUpdateStatus, onUpdateOptions, onUpd
|
|
|
33
36
|
onSuccess: (item, status) => {
|
|
34
37
|
onUpdateData(item);
|
|
35
38
|
onUpdateStatus(updateLoaderState.setSuccess(state().status));
|
|
36
|
-
onUpdateOptions(
|
|
37
|
-
_timestamp: Date.now(),
|
|
38
|
-
_status: status,
|
|
39
|
-
request: serializableRequestOptions
|
|
40
|
-
});
|
|
39
|
+
onUpdateOptions(createSuccessOptions(status, stateRequestOptions));
|
|
41
40
|
},
|
|
42
41
|
onError: (error) => {
|
|
43
42
|
onUpdateStatus(updateLoaderState.setError(state().status, error));
|
|
44
|
-
onUpdateOptions(
|
|
45
|
-
_status: error.response?.status,
|
|
46
|
-
request: serializableRequestOptions
|
|
47
|
-
});
|
|
43
|
+
onUpdateOptions(createErrorOptions(error, stateRequestOptions));
|
|
48
44
|
},
|
|
49
45
|
onComplete: () => {
|
|
50
46
|
onUpdateStatus(updateLoaderState.setComplete(state().status));
|
|
@@ -57,13 +53,15 @@ export const apiDeleteHelper = async (state, onUpdateStatus, onUpdateOptions, _o
|
|
|
57
53
|
const getPrimaryKey = (item) => _get(item, primaryKey, "");
|
|
58
54
|
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
59
55
|
onUpdateOptions({});
|
|
60
|
-
const
|
|
56
|
+
const {
|
|
57
|
+
requestOptions,
|
|
58
|
+
stateRequestOptions
|
|
59
|
+
} = prepareLoaderRequestOptions(
|
|
61
60
|
opts.getBaseRequestOptions?.() || {},
|
|
62
61
|
opts.delete?.getRequestOptions?.(id, opts),
|
|
63
62
|
opts.params,
|
|
64
63
|
opts.signal
|
|
65
64
|
);
|
|
66
|
-
const serializableRequestOptions = toSerializableRequestOptions(requestOptions);
|
|
67
65
|
const url = bindParamsToUrl(opts.delete?.getURL ? opts.delete.getURL(id, opts) : `${opts.baseURL}/${id}`, opts.pathBind);
|
|
68
66
|
await handleApiRequest(
|
|
69
67
|
{
|
|
@@ -81,18 +79,11 @@ export const apiDeleteHelper = async (state, onUpdateStatus, onUpdateOptions, _o
|
|
|
81
79
|
);
|
|
82
80
|
}
|
|
83
81
|
onUpdateStatus(updateLoaderState.setSuccess(state().status));
|
|
84
|
-
onUpdateOptions(
|
|
85
|
-
_timestamp: Date.now(),
|
|
86
|
-
_status: status,
|
|
87
|
-
request: serializableRequestOptions
|
|
88
|
-
});
|
|
82
|
+
onUpdateOptions(createSuccessOptions(status, stateRequestOptions));
|
|
89
83
|
},
|
|
90
84
|
onError: (error) => {
|
|
91
85
|
onUpdateStatus(updateLoaderState.setError(state().status, error));
|
|
92
|
-
onUpdateOptions(
|
|
93
|
-
_status: error.response?.status,
|
|
94
|
-
request: serializableRequestOptions
|
|
95
|
-
});
|
|
86
|
+
onUpdateOptions(createErrorOptions(error, stateRequestOptions));
|
|
96
87
|
},
|
|
97
88
|
onComplete: () => {
|
|
98
89
|
onUpdateStatus(updateLoaderState.setComplete(state().status));
|
|
@@ -106,10 +97,11 @@ export const apiFetchHelper = async (state, onUpdateStatus, onUpdateOptions, onU
|
|
|
106
97
|
onUpdateStatus(updateLoaderState.setComplete(state().status));
|
|
107
98
|
return;
|
|
108
99
|
}
|
|
109
|
-
const loaderStateOptions =
|
|
100
|
+
const loaderStateOptions = toSerializableLoaderOptions(opts);
|
|
101
|
+
const currentStateOptions = toSerializableLoaderOptions(state().options);
|
|
110
102
|
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
111
103
|
onUpdateOptions({
|
|
112
|
-
...
|
|
104
|
+
...currentStateOptions,
|
|
113
105
|
...loaderStateOptions,
|
|
114
106
|
currentPage: page,
|
|
115
107
|
search: query,
|
|
@@ -124,7 +116,7 @@ export const apiFetchHelper = async (state, onUpdateStatus, onUpdateOptions, onU
|
|
|
124
116
|
...more
|
|
125
117
|
} = data;
|
|
126
118
|
return {
|
|
127
|
-
...state().options,
|
|
119
|
+
...toSerializableLoaderOptions(state().options),
|
|
128
120
|
...more,
|
|
129
121
|
currentPageCount: state().items?.length || 0,
|
|
130
122
|
currentPage: page2,
|
|
@@ -139,7 +131,10 @@ export const apiFetchHelper = async (state, onUpdateStatus, onUpdateOptions, onU
|
|
|
139
131
|
...opts.fetch?.getRequestOptions?.(page, query, opts) || {}
|
|
140
132
|
};
|
|
141
133
|
const limit = Number(state().options.limit || baseRequestOptions.params?.limit || config.limit_per_page);
|
|
142
|
-
const
|
|
134
|
+
const {
|
|
135
|
+
requestOptions,
|
|
136
|
+
stateRequestOptions
|
|
137
|
+
} = prepareLoaderRequestOptions(
|
|
143
138
|
baseRequestOptions,
|
|
144
139
|
{
|
|
145
140
|
params: {
|
|
@@ -151,7 +146,6 @@ export const apiFetchHelper = async (state, onUpdateStatus, onUpdateOptions, onU
|
|
|
151
146
|
opts.params,
|
|
152
147
|
opts.signal
|
|
153
148
|
);
|
|
154
|
-
const serializableRequestOptions = toSerializableRequestOptions(requestOptions);
|
|
155
149
|
const url = bindParamsToUrl(opts.fetch?.getURL ? opts.fetch.getURL(page, query, opts) : opts.baseURL, opts.pathBind);
|
|
156
150
|
await handleApiRequest(
|
|
157
151
|
{
|
|
@@ -171,21 +165,18 @@ export const apiFetchHelper = async (state, onUpdateStatus, onUpdateOptions, onU
|
|
|
171
165
|
...moreOptions
|
|
172
166
|
} = response;
|
|
173
167
|
onUpdateItems(items);
|
|
174
|
-
onUpdateOptions(
|
|
168
|
+
onUpdateOptions({
|
|
175
169
|
...getOptions(moreOptions),
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
request: serializableRequestOptions
|
|
179
|
-
})));
|
|
170
|
+
...createSuccessOptions(status, stateRequestOptions)
|
|
171
|
+
});
|
|
180
172
|
onUpdateStatus(updateLoaderState.setSuccess(state().status));
|
|
181
173
|
},
|
|
182
174
|
onError: (error) => {
|
|
183
175
|
onUpdateStatus(updateLoaderState.setError(state().status, error));
|
|
184
|
-
onUpdateOptions(
|
|
185
|
-
...state().options,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
})));
|
|
176
|
+
onUpdateOptions({
|
|
177
|
+
...toSerializableLoaderOptions(state().options),
|
|
178
|
+
...createErrorOptions(error, stateRequestOptions)
|
|
179
|
+
});
|
|
189
180
|
},
|
|
190
181
|
onComplete: () => {
|
|
191
182
|
onUpdateStatus(updateLoaderState.setComplete(state().status));
|
|
@@ -200,13 +191,15 @@ export const apiFindHelper = async (state, onUpdateStatus, onUpdateOptions, onUp
|
|
|
200
191
|
}
|
|
201
192
|
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
202
193
|
onUpdateOptions({});
|
|
203
|
-
const
|
|
194
|
+
const {
|
|
195
|
+
requestOptions,
|
|
196
|
+
stateRequestOptions
|
|
197
|
+
} = prepareLoaderRequestOptions(
|
|
204
198
|
opts.getBaseRequestOptions?.() || {},
|
|
205
199
|
opts.find?.getRequestOptions?.(id, opts),
|
|
206
200
|
opts.params,
|
|
207
201
|
opts.signal
|
|
208
202
|
);
|
|
209
|
-
const serializableRequestOptions = toSerializableRequestOptions(requestOptions);
|
|
210
203
|
const url = bindParamsToUrl(opts.find?.getURL ? opts.find.getURL(id, opts) : `${opts.baseURL}/${id}`, opts.pathBind);
|
|
211
204
|
await handleApiRequest(
|
|
212
205
|
{
|
|
@@ -219,18 +212,11 @@ export const apiFindHelper = async (state, onUpdateStatus, onUpdateOptions, onUp
|
|
|
219
212
|
onSuccess: (item, status) => {
|
|
220
213
|
onUpdateData(item);
|
|
221
214
|
onUpdateStatus(updateLoaderState.setSuccess(state().status));
|
|
222
|
-
onUpdateOptions(
|
|
223
|
-
_timestamp: Date.now(),
|
|
224
|
-
_status: status,
|
|
225
|
-
request: serializableRequestOptions
|
|
226
|
-
});
|
|
215
|
+
onUpdateOptions(createSuccessOptions(status, stateRequestOptions));
|
|
227
216
|
},
|
|
228
217
|
onError: (error) => {
|
|
229
218
|
onUpdateStatus(updateLoaderState.setError(state().status, error));
|
|
230
|
-
onUpdateOptions(
|
|
231
|
-
_status: error.response?.status,
|
|
232
|
-
request: serializableRequestOptions
|
|
233
|
-
});
|
|
219
|
+
onUpdateOptions(createErrorOptions(error, stateRequestOptions));
|
|
234
220
|
},
|
|
235
221
|
onComplete: () => {
|
|
236
222
|
onUpdateStatus(updateLoaderState.setComplete(state().status));
|
|
@@ -245,13 +231,15 @@ export const updateHelper = async (state, onUpdateStatus, onUpdateOptions, onUpd
|
|
|
245
231
|
}
|
|
246
232
|
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
247
233
|
onUpdateOptions({});
|
|
248
|
-
const
|
|
234
|
+
const {
|
|
235
|
+
requestOptions,
|
|
236
|
+
stateRequestOptions
|
|
237
|
+
} = prepareLoaderRequestOptions(
|
|
249
238
|
opts.getBaseRequestOptions?.() || {},
|
|
250
239
|
opts.update?.getRequestOptions?.(id, data, opts),
|
|
251
240
|
opts.params,
|
|
252
241
|
opts.signal
|
|
253
242
|
);
|
|
254
|
-
const serializableRequestOptions = toSerializableRequestOptions(requestOptions);
|
|
255
243
|
const url = bindParamsToUrl(opts.update?.getURL ? opts.update.getURL(id, data, opts) : `${opts.baseURL}/${id}`, opts.pathBind);
|
|
256
244
|
await handleApiRequest(
|
|
257
245
|
{
|
|
@@ -278,18 +266,11 @@ export const updateHelper = async (state, onUpdateStatus, onUpdateOptions, onUpd
|
|
|
278
266
|
}
|
|
279
267
|
}
|
|
280
268
|
onUpdateStatus(updateLoaderState.setSuccess(state().status));
|
|
281
|
-
onUpdateOptions(
|
|
282
|
-
_timestamp: Date.now(),
|
|
283
|
-
_status: status,
|
|
284
|
-
request: serializableRequestOptions
|
|
285
|
-
});
|
|
269
|
+
onUpdateOptions(createSuccessOptions(status, stateRequestOptions));
|
|
286
270
|
},
|
|
287
271
|
onError: (error) => {
|
|
288
272
|
onUpdateStatus(updateLoaderState.setError(state().status, error));
|
|
289
|
-
onUpdateOptions(
|
|
290
|
-
_status: error.response?.status,
|
|
291
|
-
request: serializableRequestOptions
|
|
292
|
-
});
|
|
273
|
+
onUpdateOptions(createErrorOptions(error, stateRequestOptions));
|
|
293
274
|
},
|
|
294
275
|
onComplete: () => {
|
|
295
276
|
onUpdateStatus(updateLoaderState.setComplete(state().status));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../.nuxt/tsconfig.server.json",
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../.nuxt/tsconfig.server.json",
|
|
3
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finema/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.1",
|
|
4
4
|
"repository": "https://gitlab.finema.co/finema/ui-kit",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Finema Dev Core Team",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@iconify-json/heroicons": "^1.2.2",
|
|
44
44
|
"@iconify-json/ph": "^1.2.2",
|
|
45
45
|
"@iconify-json/svg-spinners": "^1.2.2",
|
|
46
|
-
"@nuxt/kit": "^4.
|
|
47
|
-
"@nuxt/ui": "^4.
|
|
46
|
+
"@nuxt/kit": "^4.4.8",
|
|
47
|
+
"@nuxt/ui": "^4.8.2",
|
|
48
48
|
"@pinia/nuxt": "^0.11.0",
|
|
49
49
|
"@tailwindcss/typography": "^0.5.0-alpha.3",
|
|
50
50
|
"@tiptap/extension-text-align": "^3.18.0",
|
|
@@ -63,18 +63,18 @@
|
|
|
63
63
|
"url-join": "^5.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@eslint/js": "^
|
|
66
|
+
"@eslint/js": "^10.0.1",
|
|
67
67
|
"@finema/eslint-config": "^2.0.4",
|
|
68
|
-
"@nuxt/devtools": "^2.
|
|
68
|
+
"@nuxt/devtools": "^3.2.4",
|
|
69
69
|
"@nuxt/eslint-config": "^1.4.1",
|
|
70
70
|
"@nuxt/module-builder": "^1.0.2",
|
|
71
|
-
"@nuxt/schema": "^4.
|
|
72
|
-
"@nuxt/test-utils": "^
|
|
71
|
+
"@nuxt/schema": "^4.4.8",
|
|
72
|
+
"@nuxt/test-utils": "^4.0.3",
|
|
73
73
|
"@types/node": "latest",
|
|
74
74
|
"changelogen": "^0.6.1",
|
|
75
75
|
"husky": "^9.1.7",
|
|
76
|
-
"lint-staged": "^
|
|
77
|
-
"nuxt": "^4.
|
|
76
|
+
"lint-staged": "^17.0.7",
|
|
77
|
+
"nuxt": "^4.4.8",
|
|
78
78
|
"typescript": "~5.9.3",
|
|
79
79
|
"typescript-eslint": "^8.18.0",
|
|
80
80
|
"vitest": "^4.0.2",
|
|
@@ -83,4 +83,4 @@
|
|
|
83
83
|
"lint-staged": {
|
|
84
84
|
"*": "eslint"
|
|
85
85
|
}
|
|
86
|
-
}
|
|
86
|
+
}
|