aloha-vue 1.2.68 → 1.2.69
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/docs/src/components/TheMenu/TheMenu.js +7 -0
- package/docs/src/mainTranslation.js +9 -0
- package/docs/src/router/index.js +5 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSize.js +35 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSize.pug +24 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSize.vue +2 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeArguments/PageFilterFileSizeArguments.js +19 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeArguments/PageFilterFileSizeArguments.pug +5 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeArguments/PageFilterFileSizeArguments.vue +2 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeArguments/compositionAPI/JsAPI.js +25 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeDigits/PageFilterFileSizeDigits.js +19 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeDigits/PageFilterFileSizeDigits.pug +5 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeDigits/PageFilterFileSizeDigits.vue +2 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeDigits/compositionAPI/JsAPI.js +19 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeExample/PageFilterFileSizeExample.js +19 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeExample/PageFilterFileSizeExample.pug +5 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeExample/PageFilterFileSizeExample.vue +2 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeExample/compositionAPI/JsAPI.js +19 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeImportCompositionApi/PageFilterFileSizeImportCompositionApi.js +19 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeImportCompositionApi/PageFilterFileSizeImportCompositionApi.pug +5 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeImportCompositionApi/PageFilterFileSizeImportCompositionApi.vue +2 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeImportCompositionApi/compositionAPI/JsAPI.js +15 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeImportFunction/PageFilterFileSizeImportFunction.js +19 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeImportFunction/PageFilterFileSizeImportFunction.pug +5 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeImportFunction/PageFilterFileSizeImportFunction.vue +2 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeImportFunction/compositionAPI/JsAPI.js +7 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeSourceUnits/PageFilterFileSizeSourceUnits.js +19 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeSourceUnits/PageFilterFileSizeSourceUnits.pug +5 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeSourceUnits/PageFilterFileSizeSourceUnits.vue +2 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeSourceUnits/compositionAPI/JsAPI.js +28 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeUnits/PageFilterFileSizeUnits.js +19 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeUnits/PageFilterFileSizeUnits.pug +5 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeUnits/PageFilterFileSizeUnits.vue +2 -0
- package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeUnits/compositionAPI/JsAPI.js +28 -0
- package/docs/src/views/Functions/PageFilterFileSize/compositionAPI/PageTitleAPI.js +7 -0
- package/docs/src/views/Functions/PageFilterFileSize/i18n/PageFilterFileSizeI18n.js +19 -0
- package/docs/src/views/Functions/PageFilterFileSize/i18n/ar.json +4 -0
- package/docs/src/views/Functions/PageFilterFileSize/i18n/de.json +4 -0
- package/docs/src/views/Functions/PageFilterFileSize/i18n/en.json +4 -0
- package/docs/src/views/Functions/PageFilterFileSize/i18n/es.json +4 -0
- package/docs/src/views/Functions/PageFilterFileSize/i18n/fr.json +4 -0
- package/docs/src/views/Functions/PageFilterFileSize/i18n/hr.json +4 -0
- package/docs/src/views/Functions/PageFilterFileSize/i18n/it.json +4 -0
- package/docs/src/views/Functions/PageFilterFileSize/i18n/ru.json +4 -0
- package/package.json +1 -1
- package/src/AGet/AGet.js +1 -1
- package/src/compositionAPI/AFiltersAPI.js +2 -2
- package/src/filters/filterFileSize.js +36 -9
- package/src/filters/i18n/Filters18n.js +19 -0
- package/src/filters/i18n/ar.json +7 -0
- package/src/filters/i18n/de.json +7 -0
- package/src/filters/i18n/en.json +7 -0
- package/src/filters/i18n/es.json +7 -0
- package/src/filters/i18n/fr.json +7 -0
- package/src/filters/i18n/hr.json +7 -0
- package/src/filters/i18n/it.json +7 -0
- package/src/filters/i18n/ru.json +7 -0
- package/src/i18n/allLanguages.js +9 -0
|
@@ -53,6 +53,7 @@ import PageFilterSearchHighlightI18n from "./views/Functions/PageFilterSearchHig
|
|
|
53
53
|
import PageFilterLinkI18n from "./views/Functions/PageFilterLink/i18n/PageFilterLinkI18n";
|
|
54
54
|
import PageFilterJsonI18n from "./views/Functions/PageFilterJson/i18n/PageFilterJsonI18n";
|
|
55
55
|
import PageFilterKeyValueI18n from "./views/Functions/PageFilterKeyValue/i18n/PageFilterKeyValueI18n";
|
|
56
|
+
import PageFilterFileSizeI18n from "./views/Functions/PageFilterFileSize/i18n/PageFilterFileSizeI18n";
|
|
56
57
|
|
|
57
58
|
export const mainTranslation = {
|
|
58
59
|
ar: {
|
|
@@ -102,6 +103,7 @@ export const mainTranslation = {
|
|
|
102
103
|
...PageFilterLinkI18n.ar,
|
|
103
104
|
...PageFilterJsonI18n.ar,
|
|
104
105
|
...PageFilterKeyValueI18n.ar,
|
|
106
|
+
...PageFilterFileSizeI18n.ar,
|
|
105
107
|
},
|
|
106
108
|
de: {
|
|
107
109
|
...allLanguages.de,
|
|
@@ -150,6 +152,7 @@ export const mainTranslation = {
|
|
|
150
152
|
...PageFilterLinkI18n.de,
|
|
151
153
|
...PageFilterJsonI18n.de,
|
|
152
154
|
...PageFilterKeyValueI18n.de,
|
|
155
|
+
...PageFilterFileSizeI18n.de,
|
|
153
156
|
},
|
|
154
157
|
en: {
|
|
155
158
|
...allLanguages.en,
|
|
@@ -198,6 +201,7 @@ export const mainTranslation = {
|
|
|
198
201
|
...PageFilterLinkI18n.en,
|
|
199
202
|
...PageFilterJsonI18n.en,
|
|
200
203
|
...PageFilterKeyValueI18n.en,
|
|
204
|
+
...PageFilterFileSizeI18n.en,
|
|
201
205
|
},
|
|
202
206
|
es: {
|
|
203
207
|
...allLanguages.es,
|
|
@@ -246,6 +250,7 @@ export const mainTranslation = {
|
|
|
246
250
|
...PageFilterLinkI18n.es,
|
|
247
251
|
...PageFilterJsonI18n.es,
|
|
248
252
|
...PageFilterKeyValueI18n.es,
|
|
253
|
+
...PageFilterFileSizeI18n.es,
|
|
249
254
|
},
|
|
250
255
|
fr: {
|
|
251
256
|
...allLanguages.fr,
|
|
@@ -294,6 +299,7 @@ export const mainTranslation = {
|
|
|
294
299
|
...PageFilterLinkI18n.fr,
|
|
295
300
|
...PageFilterJsonI18n.fr,
|
|
296
301
|
...PageFilterKeyValueI18n.fr,
|
|
302
|
+
...PageFilterFileSizeI18n.fr,
|
|
297
303
|
},
|
|
298
304
|
hr: {
|
|
299
305
|
...allLanguages.hr,
|
|
@@ -342,6 +348,7 @@ export const mainTranslation = {
|
|
|
342
348
|
...PageFilterLinkI18n.hr,
|
|
343
349
|
...PageFilterJsonI18n.hr,
|
|
344
350
|
...PageFilterKeyValueI18n.hr,
|
|
351
|
+
...PageFilterFileSizeI18n.hr,
|
|
345
352
|
},
|
|
346
353
|
it: {
|
|
347
354
|
...allLanguages.it,
|
|
@@ -390,6 +397,7 @@ export const mainTranslation = {
|
|
|
390
397
|
...PageFilterLinkI18n.it,
|
|
391
398
|
...PageFilterJsonI18n.it,
|
|
392
399
|
...PageFilterKeyValueI18n.it,
|
|
400
|
+
...PageFilterFileSizeI18n.it,
|
|
393
401
|
},
|
|
394
402
|
ru: {
|
|
395
403
|
...allLanguages.ru,
|
|
@@ -438,5 +446,6 @@ export const mainTranslation = {
|
|
|
438
446
|
...PageFilterLinkI18n.ru,
|
|
439
447
|
...PageFilterJsonI18n.ru,
|
|
440
448
|
...PageFilterKeyValueI18n.ru,
|
|
449
|
+
...PageFilterFileSizeI18n.ru,
|
|
441
450
|
},
|
|
442
451
|
};
|
package/docs/src/router/index.js
CHANGED
|
@@ -324,6 +324,11 @@ const ROUTES = [
|
|
|
324
324
|
name: "PageFilterKeyValue",
|
|
325
325
|
component: () => import(/* webpackChunkName: "PageFilterKeyValue" */ "../views/Functions/PageFilterKeyValue/PageFilterKeyValue.vue"),
|
|
326
326
|
},
|
|
327
|
+
{
|
|
328
|
+
path: "/filter-file-size",
|
|
329
|
+
name: "PageFilterFileSize",
|
|
330
|
+
component: () => import(/* webpackChunkName: "PageFilterFileSize" */ "../views/Functions/PageFilterFileSize/PageFilterFileSize.vue"),
|
|
331
|
+
},
|
|
327
332
|
{
|
|
328
333
|
// If the routing configuration '*' reports an error, replace it with '/: catchAll(. *)'
|
|
329
334
|
// caught Error: Catch all routes ("*") must now be defined using a param with a custom regexp
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import AlohaPage from "../../../global/components/AlohaPage/AlohaPage.vue";
|
|
2
|
+
import ATranslation from "../../../../../src/ATranslation/ATranslation";
|
|
3
|
+
import PageFilterFileSizeArguments from "./PageFilterFileSizeArguments/PageFilterFileSizeArguments.vue";
|
|
4
|
+
import PageFilterFileSizeDigits from "./PageFilterFileSizeDigits/PageFilterFileSizeDigits.vue";
|
|
5
|
+
import PageFilterFileSizeExample from "./PageFilterFileSizeExample/PageFilterFileSizeExample.vue";
|
|
6
|
+
import PageFilterFileSizeImportCompositionApi from "./PageFilterFileSizeImportCompositionApi/PageFilterFileSizeImportCompositionApi.vue";
|
|
7
|
+
import PageFilterFileSizeImportFunction from "./PageFilterFileSizeImportFunction/PageFilterFileSizeImportFunction.vue";
|
|
8
|
+
import PageFilterFileSizeSourceUnits from "./PageFilterFileSizeSourceUnits/PageFilterFileSizeSourceUnits.vue";
|
|
9
|
+
import PageFilterFileSizeUnits from "./PageFilterFileSizeUnits/PageFilterFileSizeUnits.vue";
|
|
10
|
+
|
|
11
|
+
import PageTitleAPI from "./compositionAPI/PageTitleAPI";
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: "PageFilterFileSize",
|
|
15
|
+
components: {
|
|
16
|
+
AlohaPage,
|
|
17
|
+
ATranslation,
|
|
18
|
+
PageFilterFileSizeArguments,
|
|
19
|
+
PageFilterFileSizeDigits,
|
|
20
|
+
PageFilterFileSizeExample,
|
|
21
|
+
PageFilterFileSizeImportCompositionApi,
|
|
22
|
+
PageFilterFileSizeImportFunction,
|
|
23
|
+
PageFilterFileSizeSourceUnits,
|
|
24
|
+
PageFilterFileSizeUnits,
|
|
25
|
+
},
|
|
26
|
+
setup() {
|
|
27
|
+
const {
|
|
28
|
+
pageTitle,
|
|
29
|
+
} = PageTitleAPI();
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
pageTitle,
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
aloha-page(
|
|
2
|
+
:page-title="pageTitle"
|
|
3
|
+
)
|
|
4
|
+
template(
|
|
5
|
+
v-slot:body
|
|
6
|
+
)
|
|
7
|
+
a-translation(
|
|
8
|
+
tag="p"
|
|
9
|
+
html="_PAGE_FILTER_FILE_SIZE_DESCRIPTION_"
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
page-filter-file-size-import-function
|
|
13
|
+
|
|
14
|
+
page-filter-file-size-import-composition-api
|
|
15
|
+
|
|
16
|
+
page-filter-file-size-arguments
|
|
17
|
+
|
|
18
|
+
page-filter-file-size-example
|
|
19
|
+
|
|
20
|
+
page-filter-file-size-units
|
|
21
|
+
|
|
22
|
+
page-filter-file-size-source-units
|
|
23
|
+
|
|
24
|
+
page-filter-file-size-digits
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AlohaExample from "../../../../global/components/AlohaExample/AlohaExample.vue";
|
|
2
|
+
|
|
3
|
+
import JsAPI from "./compositionAPI/JsAPI";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: "PageFilterFileSizeArguments",
|
|
7
|
+
components: {
|
|
8
|
+
AlohaExample,
|
|
9
|
+
},
|
|
10
|
+
setup() {
|
|
11
|
+
const {
|
|
12
|
+
codeJs,
|
|
13
|
+
} = JsAPI();
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
codeJs,
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
} from "vue";
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
getTranslatedText,
|
|
7
|
+
} from "../../../../../../../src/ATranslation/compositionAPI/UtilsAPI";
|
|
8
|
+
|
|
9
|
+
export default function JsAPI() {
|
|
10
|
+
const argumentsTranslated = computed(() => {
|
|
11
|
+
return getTranslatedText({
|
|
12
|
+
placeholder: "_PAGE_FILTER_FILE_SIZE_ARGUMENTS_",
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const codeJs = computed(() => {
|
|
17
|
+
return `filterFileSize(value, { [units="kb"], [sourceUnits="b"], [digits=2] });
|
|
18
|
+
|
|
19
|
+
${ argumentsTranslated.value }`;
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
codeJs,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AlohaExample from "../../../../global/components/AlohaExample/AlohaExample.vue";
|
|
2
|
+
|
|
3
|
+
import JsAPI from "./compositionAPI/JsAPI";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: "PageFilterFileSizeDigits",
|
|
7
|
+
components: {
|
|
8
|
+
AlohaExample,
|
|
9
|
+
},
|
|
10
|
+
setup() {
|
|
11
|
+
const {
|
|
12
|
+
codeJs,
|
|
13
|
+
} = JsAPI();
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
codeJs,
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
};
|
package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeDigits/compositionAPI/JsAPI.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
} from "vue";
|
|
4
|
+
|
|
5
|
+
import filterFileSize from "../../../../../../../src/filters/filterFileSize";
|
|
6
|
+
|
|
7
|
+
export default function JsAPI() {
|
|
8
|
+
const codeJs = computed(() => {
|
|
9
|
+
return `filterFileSize(1024, { digits: 0 });
|
|
10
|
+
// ${ filterFileSize(1024, { digits: 0 }) }
|
|
11
|
+
|
|
12
|
+
filterFileSize(10241, { digits: 2 });
|
|
13
|
+
// ${ filterFileSize(10241, { digits: 2 }) }`;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
codeJs,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AlohaExample from "../../../../global/components/AlohaExample/AlohaExample.vue";
|
|
2
|
+
|
|
3
|
+
import JsAPI from "./compositionAPI/JsAPI";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: "PageFilterFileSizeExample",
|
|
7
|
+
components: {
|
|
8
|
+
AlohaExample,
|
|
9
|
+
},
|
|
10
|
+
setup() {
|
|
11
|
+
const {
|
|
12
|
+
codeJs,
|
|
13
|
+
} = JsAPI();
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
codeJs,
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
} from "vue";
|
|
4
|
+
|
|
5
|
+
import filterFileSize from "../../../../../../../src/filters/filterFileSize";
|
|
6
|
+
|
|
7
|
+
export default function JsAPI() {
|
|
8
|
+
const codeJs = computed(() => {
|
|
9
|
+
return `filterFileSize(2000);
|
|
10
|
+
// ${ filterFileSize(2000) }
|
|
11
|
+
|
|
12
|
+
filterFileSize(1024);
|
|
13
|
+
// ${ filterFileSize(1024) }`;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
codeJs,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AlohaExample from "../../../../global/components/AlohaExample/AlohaExample.vue";
|
|
2
|
+
|
|
3
|
+
import JsAPI from "./compositionAPI/JsAPI";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: "PageFilterFileSizeImportCompositionApi",
|
|
7
|
+
components: {
|
|
8
|
+
AlohaExample,
|
|
9
|
+
},
|
|
10
|
+
setup() {
|
|
11
|
+
const {
|
|
12
|
+
codeJs,
|
|
13
|
+
} = JsAPI();
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
codeJs,
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function JsAPI() {
|
|
2
|
+
const codeJs = `import AFiltersAPI from "aloha-vue/src/compositionAPI/AFiltersAPI";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
setup() {
|
|
6
|
+
const {
|
|
7
|
+
filterFileSize,
|
|
8
|
+
} = AFiltersAPI();
|
|
9
|
+
},
|
|
10
|
+
};`;
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
codeJs,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AlohaExample from "../../../../global/components/AlohaExample/AlohaExample.vue";
|
|
2
|
+
|
|
3
|
+
import JsAPI from "./compositionAPI/JsAPI";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: "PageFilterFileSizeImportFunction",
|
|
7
|
+
components: {
|
|
8
|
+
AlohaExample,
|
|
9
|
+
},
|
|
10
|
+
setup() {
|
|
11
|
+
const {
|
|
12
|
+
codeJs,
|
|
13
|
+
} = JsAPI();
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
codeJs,
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AlohaExample from "../../../../global/components/AlohaExample/AlohaExample.vue";
|
|
2
|
+
|
|
3
|
+
import JsAPI from "./compositionAPI/JsAPI";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: "PageFilterFileSizeSourceUnits",
|
|
7
|
+
components: {
|
|
8
|
+
AlohaExample,
|
|
9
|
+
},
|
|
10
|
+
setup() {
|
|
11
|
+
const {
|
|
12
|
+
codeJs,
|
|
13
|
+
} = JsAPI();
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
codeJs,
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
} from "vue";
|
|
4
|
+
|
|
5
|
+
import filterFileSize from "../../../../../../../src/filters/filterFileSize";
|
|
6
|
+
|
|
7
|
+
export default function JsAPI() {
|
|
8
|
+
const codeJs = computed(() => {
|
|
9
|
+
return `filterFileSize(1024, { sourceUnits: "b" });
|
|
10
|
+
// ${ filterFileSize(1024, { sourceUnits: "b" }) }
|
|
11
|
+
|
|
12
|
+
filterFileSize(2, { sourceUnits: "kb" });
|
|
13
|
+
// ${ filterFileSize(2, { sourceUnits: "kb" }) }
|
|
14
|
+
|
|
15
|
+
filterFileSize(1, { sourceUnits: "mb" });
|
|
16
|
+
// ${ filterFileSize(1, { sourceUnits: "mb" }) }
|
|
17
|
+
|
|
18
|
+
filterFileSize(0.1, { sourceUnits: "gb" });
|
|
19
|
+
// ${ filterFileSize(0.1, { sourceUnits: "gb" }) }
|
|
20
|
+
|
|
21
|
+
filterFileSize(0.0001, { sourceUnits: "tb" });
|
|
22
|
+
// ${ filterFileSize(0.0001, { sourceUnits: "tb" }) }`;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
codeJs,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AlohaExample from "../../../../global/components/AlohaExample/AlohaExample.vue";
|
|
2
|
+
|
|
3
|
+
import JsAPI from "./compositionAPI/JsAPI";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: "PageFilterFileSizeUnits",
|
|
7
|
+
components: {
|
|
8
|
+
AlohaExample,
|
|
9
|
+
},
|
|
10
|
+
setup() {
|
|
11
|
+
const {
|
|
12
|
+
codeJs,
|
|
13
|
+
} = JsAPI();
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
codeJs,
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
};
|
package/docs/src/views/Functions/PageFilterFileSize/PageFilterFileSizeUnits/compositionAPI/JsAPI.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
} from "vue";
|
|
4
|
+
|
|
5
|
+
import filterFileSize from "../../../../../../../src/filters/filterFileSize";
|
|
6
|
+
|
|
7
|
+
export default function JsAPI() {
|
|
8
|
+
const codeJs = computed(() => {
|
|
9
|
+
return `filterFileSize(1024, { units: "b" });
|
|
10
|
+
// ${ filterFileSize(1024, { units: "b" }) }
|
|
11
|
+
|
|
12
|
+
filterFileSize(1024, { units: "kb" });
|
|
13
|
+
// ${ filterFileSize(1024, { units: "kb" }) }
|
|
14
|
+
|
|
15
|
+
filterFileSize(1048576, { units: "mb" });
|
|
16
|
+
// ${ filterFileSize(1048576, { units: "mb" }) }
|
|
17
|
+
|
|
18
|
+
filterFileSize(1073741824, { units: "gb" });
|
|
19
|
+
// ${ filterFileSize(1073741824, { units: "gb" }) }
|
|
20
|
+
|
|
21
|
+
filterFileSize(1073741824 * 1024, { units: "tb" });
|
|
22
|
+
// ${ filterFileSize(1073741824 * 1024, { units: "tb" }) }`;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
codeJs,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ar from "./ar.json";
|
|
2
|
+
import de from "./de.json";
|
|
3
|
+
import en from "./en.json";
|
|
4
|
+
import es from "./es.json";
|
|
5
|
+
import fr from "./fr.json";
|
|
6
|
+
import hr from "./hr.json";
|
|
7
|
+
import it from "./it.json";
|
|
8
|
+
import ru from "./ru.json";
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
ar,
|
|
12
|
+
de,
|
|
13
|
+
en,
|
|
14
|
+
es,
|
|
15
|
+
fr,
|
|
16
|
+
hr,
|
|
17
|
+
it,
|
|
18
|
+
ru,
|
|
19
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_PAGE_FILTER_FILE_SIZE_ARGUMENTS_": "# Argumente: \nvalue (Number): Die Größe, die konvertiert werden soll.\n[units=\"kb\"] (String): Die gewünschte Einheit für die Größenangabe. Mögliche Einheiten sind \"b\" (Bytes), \"kb\" (Kilobytes), \"mb\" (Megabytes), \"gb\" (Gigabytes), \"tb\" (Terabytes).\n[sourceUnits=\"b\"] (String): Die Einheit der ursprünglichen Größe. Mögliche Einheiten sind dieselben wie für units.\n[digits=2] (Number): Die Anzahl der Dezimalstellen in der formatierten Zeichenkette",
|
|
3
|
+
"_PAGE_FILTER_FILE_SIZE_DESCRIPTION_": "Die Funktion <strong>filterFileSize</strong> konvertiert eine Größe von einer Quelleinheit (zum Beispiel Bytes) in eine Zielgröße mit einer bestimmten Einheit (zum Beispiel Kilobytes, Megabytes) und gibt das Ergebnis als formatierte Zeichenkette zurück."
|
|
4
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_PAGE_FILTER_FILE_SIZE_ARGUMENTS_": "# Аргументы: \nvalue (Number): Размер, который требуется сконвертировать.\n[units=\"kb\"] (String): Желаемая единица измерения размера. Допустимые единицы измерения: \"b\" (байты), \"kb\" (килобайты), \"mb\" (мегабайты), \"gb\" (гигабайты), \"tb\" (терабайты).\n[sourceUnits=\"b\"] (String): Единица измерения исходного размера. Допустимые единицы измерения те же, что и для units.\n[digits=2] (Number): Количество десятичных знаков в отформатированной строке.",
|
|
3
|
+
"_PAGE_FILTER_FILE_SIZE_DESCRIPTION_": "Функция <strong>filterFileSize</strong> конвертирует размер из исходной единицы измерения (например, байты) в желаемую единицу измерения (например, килобайты, мегабайты) и возвращает результат в виде отформатированной строки."
|
|
4
|
+
}
|
package/package.json
CHANGED
package/src/AGet/AGet.js
CHANGED
|
@@ -50,8 +50,8 @@ export default function AFiltersAPI() {
|
|
|
50
50
|
return _filterEmail(value, { linkClass });
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
-
const filterFileSize = (value, { units = "
|
|
54
|
-
return _filterFileSize(value, { units });
|
|
53
|
+
const filterFileSize = (value, { units = "kb", sourceUnits = "b", digits = 2 } = {}) => {
|
|
54
|
+
return _filterFileSize(value, { units, sourceUnits, digits });
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
const filterJson = (value, { replacer, space = 2 } = {}) => {
|
|
@@ -1,17 +1,44 @@
|
|
|
1
1
|
import filterCurrency from "./filterCurrency";
|
|
2
|
+
import {
|
|
3
|
+
getTranslatedText,
|
|
4
|
+
} from "../ATranslation/compositionAPI/UtilsAPI";
|
|
2
5
|
import {
|
|
3
6
|
isNumber,
|
|
7
|
+
toUpper,
|
|
4
8
|
} from "lodash-es";
|
|
5
9
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
const KB = 1024;
|
|
11
|
+
const UNITS_ORDER = [
|
|
12
|
+
"b",
|
|
13
|
+
"kb",
|
|
14
|
+
"mb",
|
|
15
|
+
"gb",
|
|
16
|
+
"tb",
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export default function(value, { units = "kb", sourceUnits = "b", digits = 2 } = {}) {
|
|
20
|
+
const INDEX_SOURCE_UNITS = UNITS_ORDER.indexOf(sourceUnits);
|
|
21
|
+
const INDEX_UNITS = UNITS_ORDER.indexOf(units);
|
|
22
|
+
if (INDEX_SOURCE_UNITS === -1 ||
|
|
23
|
+
INDEX_UNITS === -1) {
|
|
24
|
+
return "";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const UNITS_TRANSLATED = getTranslatedText({ placeholder: `_A_FILE_SIZE_${ toUpper(units) }_` });
|
|
10
28
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (!isNumber(value)) {
|
|
14
|
-
valueLocal = 0;
|
|
29
|
+
if (!isNumber(value) || value === 0) {
|
|
30
|
+
return filterCurrency(0, { suffix: UNITS_TRANSLATED, digits });
|
|
15
31
|
}
|
|
16
|
-
|
|
32
|
+
if (INDEX_SOURCE_UNITS === INDEX_UNITS) {
|
|
33
|
+
return filterCurrency(value, { suffix: UNITS_TRANSLATED, digits });
|
|
34
|
+
}
|
|
35
|
+
const DIFF_UNITS = INDEX_SOURCE_UNITS - INDEX_UNITS;
|
|
36
|
+
let size = 0;
|
|
37
|
+
if (DIFF_UNITS < 0) {
|
|
38
|
+
size = value / Math.pow(KB, Math.abs(DIFF_UNITS));
|
|
39
|
+
} else {
|
|
40
|
+
size = value * Math.pow(KB, DIFF_UNITS);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return filterCurrency(size, { suffix: UNITS_TRANSLATED, digits });
|
|
17
44
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ar from "./ar.json";
|
|
2
|
+
import de from "./de.json";
|
|
3
|
+
import en from "./en.json";
|
|
4
|
+
import es from "./es.json";
|
|
5
|
+
import fr from "./fr.json";
|
|
6
|
+
import hr from "./hr.json";
|
|
7
|
+
import it from "./it.json";
|
|
8
|
+
import ru from "./ru.json";
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
ar,
|
|
12
|
+
de,
|
|
13
|
+
en,
|
|
14
|
+
es,
|
|
15
|
+
fr,
|
|
16
|
+
hr,
|
|
17
|
+
it,
|
|
18
|
+
ru,
|
|
19
|
+
};
|
package/src/i18n/allLanguages.js
CHANGED
|
@@ -22,6 +22,7 @@ import ATableI18n from "../ATable/i18n/ATableI18n";
|
|
|
22
22
|
import AWizardI18n from "../AWizard/i18n/AWizardI18n";
|
|
23
23
|
import AMenu2I18n from "../AMenu2/i18n/AMenu2I18n";
|
|
24
24
|
import AVerticalScrollI18n from "../AVerticalScroll/i18n/AVerticalScrollI18n";
|
|
25
|
+
import Filters18n from "../filters/i18n/Filters18n";
|
|
25
26
|
|
|
26
27
|
export const ar = {
|
|
27
28
|
...arJson,
|
|
@@ -40,6 +41,7 @@ export const ar = {
|
|
|
40
41
|
...ADatepickerRangeI18n.ar,
|
|
41
42
|
...AMenu2I18n.ar,
|
|
42
43
|
...AVerticalScrollI18n.ar,
|
|
44
|
+
...Filters18n.ar,
|
|
43
45
|
};
|
|
44
46
|
export const de = {
|
|
45
47
|
...deJson,
|
|
@@ -58,6 +60,7 @@ export const de = {
|
|
|
58
60
|
...ADatepickerRangeI18n.de,
|
|
59
61
|
...AMenu2I18n.de,
|
|
60
62
|
...AVerticalScrollI18n.de,
|
|
63
|
+
...Filters18n.de,
|
|
61
64
|
};
|
|
62
65
|
export const en = {
|
|
63
66
|
...enJson,
|
|
@@ -76,6 +79,7 @@ export const en = {
|
|
|
76
79
|
...ADatepickerRangeI18n.en,
|
|
77
80
|
...AMenu2I18n.en,
|
|
78
81
|
...AVerticalScrollI18n.en,
|
|
82
|
+
...Filters18n.en,
|
|
79
83
|
};
|
|
80
84
|
export const es = {
|
|
81
85
|
...esJson,
|
|
@@ -94,6 +98,7 @@ export const es = {
|
|
|
94
98
|
...ADatepickerRangeI18n.es,
|
|
95
99
|
...AMenu2I18n.es,
|
|
96
100
|
...AVerticalScrollI18n.es,
|
|
101
|
+
...Filters18n.es,
|
|
97
102
|
};
|
|
98
103
|
export const fr = {
|
|
99
104
|
...frJson,
|
|
@@ -112,6 +117,7 @@ export const fr = {
|
|
|
112
117
|
...ADatepickerRangeI18n.fr,
|
|
113
118
|
...AMenu2I18n.fr,
|
|
114
119
|
...AVerticalScrollI18n.fr,
|
|
120
|
+
...Filters18n.fr,
|
|
115
121
|
};
|
|
116
122
|
export const hr = {
|
|
117
123
|
...hrJson,
|
|
@@ -130,6 +136,7 @@ export const hr = {
|
|
|
130
136
|
...ADatepickerRangeI18n.hr,
|
|
131
137
|
...AMenu2I18n.hr,
|
|
132
138
|
...AVerticalScrollI18n.hr,
|
|
139
|
+
...Filters18n.hr,
|
|
133
140
|
};
|
|
134
141
|
export const it = {
|
|
135
142
|
...itJson,
|
|
@@ -148,6 +155,7 @@ export const it = {
|
|
|
148
155
|
...ADatepickerRangeI18n.it,
|
|
149
156
|
...AMenu2I18n.it,
|
|
150
157
|
...AVerticalScrollI18n.it,
|
|
158
|
+
...Filters18n.it,
|
|
151
159
|
};
|
|
152
160
|
export const ru = {
|
|
153
161
|
...ruJson,
|
|
@@ -166,6 +174,7 @@ export const ru = {
|
|
|
166
174
|
...ADatepickerRangeI18n.ru,
|
|
167
175
|
...AMenu2I18n.ru,
|
|
168
176
|
...AVerticalScrollI18n.ru,
|
|
177
|
+
...Filters18n.ru,
|
|
169
178
|
};
|
|
170
179
|
|
|
171
180
|
export default {
|