@finema/core 2.20.0 â 2.21.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.
- package/README.md +79 -79
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/FlexDeck/index.vue +5 -5
- package/dist/runtime/components/FlexDeck/types.d.ts +1 -1
- package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
- package/dist/runtime/components/Form/InputCheckbox/index.vue +18 -18
- package/dist/runtime/components/Form/InputNumber/index.vue +20 -20
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +43 -43
- package/dist/runtime/components/Form/InputText/index.vue +74 -74
- package/dist/runtime/components/Form/InputTextarea/index.vue +18 -18
- package/dist/runtime/components/Form/InputToggle/index.vue +17 -17
- 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.vue +2 -2
- 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/ColumnNumber.vue +2 -2
- package/dist/runtime/components/Table/ColumnText.vue +1 -1
- package/dist/runtime/components/Table/index.vue +3 -3
- package/dist/runtime/components/Table/types.d.ts +1 -1
- package/dist/runtime/composables/useFlexDeck.js +1 -1
- package/dist/runtime/composables/useTable.js +1 -1
- package/dist/runtime/helpers/componentHelper.js +3 -11
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/runtime/utils/NumberHelper.d.ts +6 -0
- package/dist/runtime/utils/NumberHelper.js +25 -0
- package/dist/runtime/utils/StringHelper.d.ts +0 -2
- package/dist/runtime/utils/StringHelper.js +0 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Get your module up and running quickly.
|
|
3
|
-
|
|
4
|
-
Find and replace all on all files (CMD+SHIFT+F):
|
|
5
|
-
- Name: Finema UI Kit (Note: package.json has name: @finema/core, consider aligning these)
|
|
6
|
-
- Package name: @finema/core
|
|
7
|
-
- Description: A comprehensive UI kit for Finema projects.
|
|
8
|
-
-->
|
|
9
|
-
|
|
10
|
-
# Finema UI Kit
|
|
11
|
-
|
|
12
|
-
[![npm version][npm-version-src]][npm-version-href]
|
|
13
|
-
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
14
|
-
[![License][license-src]][license-href]
|
|
15
|
-
[![Nuxt][nuxt-src]][nuxt-href]
|
|
16
|
-
|
|
17
|
-
A comprehensive UI kit for building consistent and beautiful user interfaces for Finema projects, designed to integrate seamlessly with Nuxt. This package is named `@finema/core` on npm.
|
|
18
|
-
|
|
19
|
-
- [⨠Release Notes](/CHANGELOG.md)
|
|
20
|
-
- [đ Storybook](https://your-storybook-url.com) <!-- Add a link to your Storybook -->
|
|
21
|
-
- [đšī¸ Playground](#playground)
|
|
22
|
-
|
|
23
|
-
## Features
|
|
24
|
-
|
|
25
|
-
<!-- Highlight some of the features your UI kit provides here -->
|
|
26
|
-
- đ¨ Wide range of customizable components, built for Vue and Nuxt
|
|
27
|
-
- đą Responsive design out-of-the-box
|
|
28
|
-
- âŋ Accessibility focused
|
|
29
|
-
- đ ī¸ Easy to integrate and use with Nuxt auto-import capabilities
|
|
30
|
-
|
|
31
|
-
## đ Installation
|
|
32
|
-
|
|
33
|
-
Install the UI kit in your project using npm or yarn:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
npm install @finema/core
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
or
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
yarn add @finema/core
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## đ ī¸ Available Scripts
|
|
46
|
-
|
|
47
|
-
In the project directory, you can run the following scripts:
|
|
48
|
-
|
|
49
|
-
- `npm run dev` or `yarn dev`: Runs the playground app in development mode.
|
|
50
|
-
- `npm run dev:build` or `yarn dev:build`: Builds the playground app.
|
|
51
|
-
- `npm run dev:prepare` or `yarn dev:prepare`: Prepares the development environment.
|
|
52
|
-
- `npm run lint` or `yarn lint`: Lints the codebase.
|
|
53
|
-
- `npm run test` or `yarn test`: Runs tests.
|
|
54
|
-
- `npm run release` or `yarn release`: Creates a new release (lints, tests, builds, publishes).
|
|
55
|
-
|
|
56
|
-
## đšī¸ Playground
|
|
57
|
-
|
|
58
|
-
This project includes a `playground` directory that you can use to test and experiment with the UI components.
|
|
59
|
-
|
|
60
|
-
To run the playground:
|
|
61
|
-
1. Navigate to the `playground` directory.
|
|
62
|
-
2. Install dependencies if you haven't already (`npm install` or `yarn install`).
|
|
63
|
-
3. Run `npm run dev` or `yarn dev`.
|
|
64
|
-
|
|
65
|
-
## đ¤ Contributing
|
|
66
|
-
|
|
67
|
-
Contributions are welcome! Please refer to the `CONTRIBUTING.md` file for guidelines. (You'll need to create this file).
|
|
68
|
-
|
|
69
|
-
<!--
|
|
70
|
-
Badge URLs - Keep these at the bottom of the file for better readability
|
|
71
|
-
-->
|
|
72
|
-
[npm-version-src]: https://img.shields.io/npm/v/@finema/core.svg
|
|
73
|
-
[npm-version-href]: https://npmjs.com/package/@finema/core
|
|
74
|
-
[npm-downloads-src]: https://img.shields.io/npm/dm/@finema/core.svg
|
|
75
|
-
[npm-downloads-href]: https://npmjs.com/package/@finema/core
|
|
76
|
-
[license-src]: https://img.shields.io/npm/l/@finema/core.svg
|
|
77
|
-
[license-href]: https://npmjs.com/package/@finema/core
|
|
78
|
-
[nuxt-src]: https://img.shields.io/badge/Nuxt-00DC82?logo=nuxt.js
|
|
79
|
-
[nuxt-href]: https://nuxt.com
|
|
1
|
+
<!--
|
|
2
|
+
Get your module up and running quickly.
|
|
3
|
+
|
|
4
|
+
Find and replace all on all files (CMD+SHIFT+F):
|
|
5
|
+
- Name: Finema UI Kit (Note: package.json has name: @finema/core, consider aligning these)
|
|
6
|
+
- Package name: @finema/core
|
|
7
|
+
- Description: A comprehensive UI kit for Finema projects.
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
# Finema UI Kit
|
|
11
|
+
|
|
12
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
13
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
14
|
+
[![License][license-src]][license-href]
|
|
15
|
+
[![Nuxt][nuxt-src]][nuxt-href]
|
|
16
|
+
|
|
17
|
+
A comprehensive UI kit for building consistent and beautiful user interfaces for Finema projects, designed to integrate seamlessly with Nuxt. This package is named `@finema/core` on npm.
|
|
18
|
+
|
|
19
|
+
- [⨠Release Notes](/CHANGELOG.md)
|
|
20
|
+
- [đ Storybook](https://your-storybook-url.com) <!-- Add a link to your Storybook -->
|
|
21
|
+
- [đšī¸ Playground](#playground)
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
<!-- Highlight some of the features your UI kit provides here -->
|
|
26
|
+
- đ¨ Wide range of customizable components, built for Vue and Nuxt
|
|
27
|
+
- đą Responsive design out-of-the-box
|
|
28
|
+
- âŋ Accessibility focused
|
|
29
|
+
- đ ī¸ Easy to integrate and use with Nuxt auto-import capabilities
|
|
30
|
+
|
|
31
|
+
## đ Installation
|
|
32
|
+
|
|
33
|
+
Install the UI kit in your project using npm or yarn:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install @finema/core
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
or
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
yarn add @finema/core
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## đ ī¸ Available Scripts
|
|
46
|
+
|
|
47
|
+
In the project directory, you can run the following scripts:
|
|
48
|
+
|
|
49
|
+
- `npm run dev` or `yarn dev`: Runs the playground app in development mode.
|
|
50
|
+
- `npm run dev:build` or `yarn dev:build`: Builds the playground app.
|
|
51
|
+
- `npm run dev:prepare` or `yarn dev:prepare`: Prepares the development environment.
|
|
52
|
+
- `npm run lint` or `yarn lint`: Lints the codebase.
|
|
53
|
+
- `npm run test` or `yarn test`: Runs tests.
|
|
54
|
+
- `npm run release` or `yarn release`: Creates a new release (lints, tests, builds, publishes).
|
|
55
|
+
|
|
56
|
+
## đšī¸ Playground
|
|
57
|
+
|
|
58
|
+
This project includes a `playground` directory that you can use to test and experiment with the UI components.
|
|
59
|
+
|
|
60
|
+
To run the playground:
|
|
61
|
+
1. Navigate to the `playground` directory.
|
|
62
|
+
2. Install dependencies if you haven't already (`npm install` or `yarn install`).
|
|
63
|
+
3. Run `npm run dev` or `yarn dev`.
|
|
64
|
+
|
|
65
|
+
## đ¤ Contributing
|
|
66
|
+
|
|
67
|
+
Contributions are welcome! Please refer to the `CONTRIBUTING.md` file for guidelines. (You'll need to create this file).
|
|
68
|
+
|
|
69
|
+
<!--
|
|
70
|
+
Badge URLs - Keep these at the bottom of the file for better readability
|
|
71
|
+
-->
|
|
72
|
+
[npm-version-src]: https://img.shields.io/npm/v/@finema/core.svg
|
|
73
|
+
[npm-version-href]: https://npmjs.com/package/@finema/core
|
|
74
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/@finema/core.svg
|
|
75
|
+
[npm-downloads-href]: https://npmjs.com/package/@finema/core
|
|
76
|
+
[license-src]: https://img.shields.io/npm/l/@finema/core.svg
|
|
77
|
+
[license-href]: https://npmjs.com/package/@finema/core
|
|
78
|
+
[nuxt-src]: https://img.shields.io/badge/Nuxt-00DC82?logo=nuxt.js
|
|
79
|
+
[nuxt-href]: https://nuxt.com
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
{{ pageBetween }} ⏪⏞ā¸ĸā¸ā¸˛ā¸Ŗ ā¸ā¸˛ā¸ā¸ā¸ąāšā¸ā¸Ģā¸Ąā¸ {{ totalCountWithComma }} ⏪⏞ā¸ĸā¸ā¸˛ā¸Ŗ
|
|
54
54
|
</p>
|
|
55
55
|
<Pagination
|
|
56
|
-
v-if="options.pageOptions.totalPage > 1
|
|
57
|
-
:to="options.
|
|
56
|
+
v-if="options.pageOptions.totalPage > 1"
|
|
57
|
+
:to="options.isRouteChange ? to : void 0"
|
|
58
58
|
:default-page="options.pageOptions?.currentPage || 1"
|
|
59
59
|
:items-per-page="options.pageOptions.limit"
|
|
60
60
|
:total="options.pageOptions.totalCount"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
<script setup>
|
|
68
68
|
import { computed, ref, watch } from "vue";
|
|
69
69
|
import { useElementVisibility } from "@vueuse/core";
|
|
70
|
-
import {
|
|
70
|
+
import { NumberHelper } from "#core/utils/NumberHelper";
|
|
71
71
|
import { _debounce, useRouter, useWatchChange, useWatchTrue } from "#imports";
|
|
72
72
|
import { useCoreConfig } from "#core/composables/useConfig";
|
|
73
73
|
import Empty from "#core/components/Empty.vue";
|
|
@@ -108,7 +108,7 @@ const to = (page2) => {
|
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
110
|
useWatchChange(() => props.options?.pageOptions?.request?.params, () => {
|
|
111
|
-
if (props.options?.
|
|
111
|
+
if (props.options?.isRouteChange) return;
|
|
112
112
|
router.replace({
|
|
113
113
|
query: props.options?.pageOptions?.request?.params || {}
|
|
114
114
|
});
|
|
@@ -123,7 +123,7 @@ const pageBetween = computed(() => {
|
|
|
123
123
|
return `${start} - ${end}`;
|
|
124
124
|
});
|
|
125
125
|
const totalCountWithComma = computed(() => {
|
|
126
|
-
return !props.options.pageOptions.totalCount ? "0" :
|
|
126
|
+
return !props.options.pageOptions.totalCount ? "0" : NumberHelper.withComma(props.options.pageOptions.totalCount);
|
|
127
127
|
});
|
|
128
128
|
const totalInnerRawData = computed(() => {
|
|
129
129
|
return innerRawData.value?.length || 0;
|
|
@@ -6,7 +6,7 @@ export interface IFlexDeckOptions<T = object> {
|
|
|
6
6
|
pageOptions: IPageOptions;
|
|
7
7
|
isEnabledSearch?: boolean;
|
|
8
8
|
searchPlaceholder?: string;
|
|
9
|
-
|
|
9
|
+
isRouteChange: boolean;
|
|
10
10
|
isHidePagination?: boolean;
|
|
11
11
|
isEnableInfiniteScroll?: boolean;
|
|
12
12
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FormField
|
|
3
|
-
:label="label"
|
|
4
|
-
:name="name"
|
|
5
|
-
:description="description"
|
|
6
|
-
:hint="hint"
|
|
7
|
-
:data-testid="name"
|
|
8
|
-
:help="help"
|
|
9
|
-
:error="errorMessage"
|
|
10
|
-
:required="!!required"
|
|
11
|
-
:ui="containerUi"
|
|
12
|
-
>
|
|
13
|
-
<slot />
|
|
14
|
-
</FormField>
|
|
2
|
+
<FormField
|
|
3
|
+
:label="label"
|
|
4
|
+
:name="name"
|
|
5
|
+
:description="description"
|
|
6
|
+
:hint="hint"
|
|
7
|
+
:data-testid="name"
|
|
8
|
+
:help="help"
|
|
9
|
+
:error="errorMessage"
|
|
10
|
+
:required="!!required"
|
|
11
|
+
:ui="containerUi"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</FormField>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script setup>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper
|
|
3
|
-
v-bind="wrapperProps"
|
|
4
|
-
label=""
|
|
5
|
-
description=""
|
|
6
|
-
>
|
|
7
|
-
<Checkbox
|
|
8
|
-
:model-value="value"
|
|
9
|
-
:disabled="wrapperProps.disabled"
|
|
10
|
-
:name="name"
|
|
11
|
-
:label="label"
|
|
12
|
-
:description="description"
|
|
13
|
-
:required="required"
|
|
14
|
-
:variant="variant"
|
|
15
|
-
:indicator="indicator"
|
|
16
|
-
:ui="ui"
|
|
17
|
-
@update:modelValue="onChange"
|
|
18
|
-
/>
|
|
19
|
-
</FieldWrapper>
|
|
2
|
+
<FieldWrapper
|
|
3
|
+
v-bind="wrapperProps"
|
|
4
|
+
label=""
|
|
5
|
+
description=""
|
|
6
|
+
>
|
|
7
|
+
<Checkbox
|
|
8
|
+
:model-value="value"
|
|
9
|
+
:disabled="wrapperProps.disabled"
|
|
10
|
+
:name="name"
|
|
11
|
+
:label="label"
|
|
12
|
+
:description="description"
|
|
13
|
+
:required="required"
|
|
14
|
+
:variant="variant"
|
|
15
|
+
:indicator="indicator"
|
|
16
|
+
:ui="ui"
|
|
17
|
+
@update:modelValue="onChange"
|
|
18
|
+
/>
|
|
19
|
+
</FieldWrapper>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script setup>
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<InputNumber
|
|
4
|
-
:model-value="value"
|
|
5
|
-
:disabled="wrapperProps.disabled"
|
|
6
|
-
:name="name"
|
|
7
|
-
:placeholder="wrapperProps.placeholder"
|
|
8
|
-
:autofocus="!!autoFocus"
|
|
9
|
-
:readonly="readonly"
|
|
10
|
-
:orientation="orientation"
|
|
11
|
-
:increment-disabled="incrementDisabled"
|
|
12
|
-
:decrement-disabled="decrementDisabled"
|
|
13
|
-
:min="min"
|
|
14
|
-
:max="max"
|
|
15
|
-
:step="step"
|
|
16
|
-
:disable-wheel-change="disableWheelChange"
|
|
17
|
-
:format-options="formatOptions"
|
|
18
|
-
:ui="ui"
|
|
19
|
-
@update:model-value="onChange"
|
|
20
|
-
/>
|
|
21
|
-
</FieldWrapper>
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<InputNumber
|
|
4
|
+
:model-value="value"
|
|
5
|
+
:disabled="wrapperProps.disabled"
|
|
6
|
+
:name="name"
|
|
7
|
+
:placeholder="wrapperProps.placeholder"
|
|
8
|
+
:autofocus="!!autoFocus"
|
|
9
|
+
:readonly="readonly"
|
|
10
|
+
:orientation="orientation"
|
|
11
|
+
:increment-disabled="incrementDisabled"
|
|
12
|
+
:decrement-disabled="decrementDisabled"
|
|
13
|
+
:min="min"
|
|
14
|
+
:max="max"
|
|
15
|
+
:step="step"
|
|
16
|
+
:disable-wheel-change="disableWheelChange"
|
|
17
|
+
:format-options="formatOptions"
|
|
18
|
+
:ui="ui"
|
|
19
|
+
@update:model-value="onChange"
|
|
20
|
+
/>
|
|
21
|
+
</FieldWrapper>
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
24
|
<script setup>
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<SelectMenu
|
|
4
|
-
:model-value="value"
|
|
5
|
-
:items="options"
|
|
6
|
-
multiple
|
|
7
|
-
:placeholder="wrapperProps.placeholder"
|
|
8
|
-
:disabled="wrapperProps.disabled"
|
|
9
|
-
:loading="loading"
|
|
10
|
-
:search-input="searchInput"
|
|
11
|
-
:selected-icon="selectedIcon"
|
|
12
|
-
value-key="value"
|
|
13
|
-
label-key="label"
|
|
14
|
-
:icon="icon"
|
|
15
|
-
:ui="ui"
|
|
16
|
-
:ignore-filter="!!$attrs.onSearch"
|
|
17
|
-
@update:model-value="onChange"
|
|
18
|
-
@update:searchTerm="onSearch"
|
|
19
|
-
>
|
|
20
|
-
<template #default="{ modelValue }">
|
|
21
|
-
<div
|
|
22
|
-
v-if="!ArrayHelper.isEmpty(value)"
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<SelectMenu
|
|
4
|
+
:model-value="value"
|
|
5
|
+
:items="options"
|
|
6
|
+
multiple
|
|
7
|
+
:placeholder="wrapperProps.placeholder"
|
|
8
|
+
:disabled="wrapperProps.disabled"
|
|
9
|
+
:loading="loading"
|
|
10
|
+
:search-input="searchInput"
|
|
11
|
+
:selected-icon="selectedIcon"
|
|
12
|
+
value-key="value"
|
|
13
|
+
label-key="label"
|
|
14
|
+
:icon="icon"
|
|
15
|
+
:ui="ui"
|
|
16
|
+
:ignore-filter="!!$attrs.onSearch"
|
|
17
|
+
@update:model-value="onChange"
|
|
18
|
+
@update:searchTerm="onSearch"
|
|
19
|
+
>
|
|
20
|
+
<template #default="{ modelValue }">
|
|
21
|
+
<div
|
|
22
|
+
v-if="!ArrayHelper.isEmpty(value)"
|
|
23
23
|
:class="theme.tagsWrapper({
|
|
24
24
|
class: [ui?.tagsWrapper]
|
|
25
|
-
})"
|
|
26
|
-
>
|
|
27
|
-
<div
|
|
28
|
-
v-for="_value in ArrayHelper.toArray(modelValue)"
|
|
29
|
-
:key="_value"
|
|
25
|
+
})"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
v-for="_value in ArrayHelper.toArray(modelValue)"
|
|
29
|
+
:key="_value"
|
|
30
30
|
:class="theme.tagsItem({
|
|
31
31
|
class: [ui?.tagsItem]
|
|
32
|
-
})"
|
|
33
|
-
>
|
|
34
|
-
<div
|
|
32
|
+
})"
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
35
|
:class="theme.tagsItemText({
|
|
36
36
|
class: [ui?.tagsItemText]
|
|
37
|
-
})"
|
|
38
|
-
>
|
|
39
|
-
{{ options.find((item) => item.value === _value)?.label || _value }}
|
|
40
|
-
<Icon
|
|
37
|
+
})"
|
|
38
|
+
>
|
|
39
|
+
{{ options.find((item) => item.value === _value)?.label || _value }}
|
|
40
|
+
<Icon
|
|
41
41
|
:name="theme.tagsItemDeleteIcon({
|
|
42
42
|
class: [ui?.tagsItemDeleteIcon]
|
|
43
|
-
})"
|
|
43
|
+
})"
|
|
44
44
|
:class="theme.tagsItemDelete({
|
|
45
45
|
class: [ui?.tagsItemDelete]
|
|
46
|
-
})"
|
|
47
|
-
@click.stop="handleDelete(_value)"
|
|
48
|
-
/>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</template>
|
|
53
|
-
</SelectMenu>
|
|
54
|
-
</FieldWrapper>
|
|
46
|
+
})"
|
|
47
|
+
@click.stop="handleDelete(_value)"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
</SelectMenu>
|
|
54
|
+
</FieldWrapper>
|
|
55
55
|
</template>
|
|
56
56
|
|
|
57
57
|
<script setup>
|
|
@@ -1,81 +1,81 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<div class="relative">
|
|
4
|
-
<Input
|
|
5
|
-
v-if="type === 'password'"
|
|
6
|
-
ref="inputRef"
|
|
7
|
-
v-maska="activeMaskOptions"
|
|
8
|
-
:model-value="value"
|
|
9
|
-
:disabled="wrapperProps.disabled"
|
|
10
|
-
:leading-icon="leadingIcon"
|
|
11
|
-
:trailing-icon="trailingIcon"
|
|
12
|
-
:loading="loading"
|
|
13
|
-
:loading-icon="loadingIcon"
|
|
14
|
-
:name="name"
|
|
15
|
-
:placeholder="wrapperProps.placeholder"
|
|
16
|
-
:type="isShowPassword ? 'text' : 'password'"
|
|
17
|
-
:autofocus="!!autoFocus"
|
|
18
|
-
:icon="icon"
|
|
19
|
-
:readonly="readonly"
|
|
20
|
-
:ui="defu(ui, { icon: { trailing: { pointer: '' } } })"
|
|
21
|
-
@update:model-value="onChange"
|
|
22
|
-
@focus="onFocus"
|
|
23
|
-
@blur="onBlur"
|
|
24
|
-
@keydown="onKeydown"
|
|
25
|
-
>
|
|
26
|
-
<template #trailing>
|
|
27
|
-
<Button
|
|
28
|
-
color="neutral"
|
|
29
|
-
variant="link"
|
|
30
|
-
:icon="isShowPassword ? 'i-heroicons-eye-slash' : 'i-heroicons-eye'"
|
|
31
|
-
:padded="false"
|
|
32
|
-
@click="isShowPassword = !isShowPassword"
|
|
33
|
-
/>
|
|
34
|
-
</template>
|
|
35
|
-
</Input>
|
|
36
|
-
<Input
|
|
37
|
-
v-else
|
|
38
|
-
ref="inputRef"
|
|
39
|
-
v-maska="activeMaskOptions"
|
|
40
|
-
:model-value="value"
|
|
41
|
-
:disabled="wrapperProps.disabled"
|
|
42
|
-
:leading-icon="leadingIcon"
|
|
43
|
-
:trailing-icon="trailingIcon"
|
|
44
|
-
:loading="loading"
|
|
45
|
-
:loading-icon="loadingIcon"
|
|
46
|
-
:name="name"
|
|
47
|
-
:placeholder="wrapperProps.placeholder"
|
|
48
|
-
:type="type"
|
|
49
|
-
:autofocus="!!autoFocus"
|
|
50
|
-
:icon="icon"
|
|
51
|
-
:readonly="readonly"
|
|
52
|
-
:ui="ui"
|
|
53
|
-
@update:model-value="onChange"
|
|
54
|
-
@focus="onFocus"
|
|
55
|
-
@blur="onBlur"
|
|
56
|
-
@keydown="onKeydown"
|
|
57
|
-
/>
|
|
58
|
-
<div
|
|
59
|
-
v-if="showSuggestions && filteredSuggestions.length > 0"
|
|
60
|
-
ref="suggestionsContainerRef"
|
|
61
|
-
:class="theme.suggestionsContainer()"
|
|
62
|
-
>
|
|
63
|
-
<div
|
|
64
|
-
v-for="(suggestion, index) in filteredSuggestions"
|
|
65
|
-
:key="suggestion"
|
|
66
|
-
:ref="(el) => setSuggestionItemRef(el, index)"
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<div class="relative">
|
|
4
|
+
<Input
|
|
5
|
+
v-if="type === 'password'"
|
|
6
|
+
ref="inputRef"
|
|
7
|
+
v-maska="activeMaskOptions"
|
|
8
|
+
:model-value="value"
|
|
9
|
+
:disabled="wrapperProps.disabled"
|
|
10
|
+
:leading-icon="leadingIcon"
|
|
11
|
+
:trailing-icon="trailingIcon"
|
|
12
|
+
:loading="loading"
|
|
13
|
+
:loading-icon="loadingIcon"
|
|
14
|
+
:name="name"
|
|
15
|
+
:placeholder="wrapperProps.placeholder"
|
|
16
|
+
:type="isShowPassword ? 'text' : 'password'"
|
|
17
|
+
:autofocus="!!autoFocus"
|
|
18
|
+
:icon="icon"
|
|
19
|
+
:readonly="readonly"
|
|
20
|
+
:ui="defu(ui, { icon: { trailing: { pointer: '' } } })"
|
|
21
|
+
@update:model-value="onChange"
|
|
22
|
+
@focus="onFocus"
|
|
23
|
+
@blur="onBlur"
|
|
24
|
+
@keydown="onKeydown"
|
|
25
|
+
>
|
|
26
|
+
<template #trailing>
|
|
27
|
+
<Button
|
|
28
|
+
color="neutral"
|
|
29
|
+
variant="link"
|
|
30
|
+
:icon="isShowPassword ? 'i-heroicons-eye-slash' : 'i-heroicons-eye'"
|
|
31
|
+
:padded="false"
|
|
32
|
+
@click="isShowPassword = !isShowPassword"
|
|
33
|
+
/>
|
|
34
|
+
</template>
|
|
35
|
+
</Input>
|
|
36
|
+
<Input
|
|
37
|
+
v-else
|
|
38
|
+
ref="inputRef"
|
|
39
|
+
v-maska="activeMaskOptions"
|
|
40
|
+
:model-value="value"
|
|
41
|
+
:disabled="wrapperProps.disabled"
|
|
42
|
+
:leading-icon="leadingIcon"
|
|
43
|
+
:trailing-icon="trailingIcon"
|
|
44
|
+
:loading="loading"
|
|
45
|
+
:loading-icon="loadingIcon"
|
|
46
|
+
:name="name"
|
|
47
|
+
:placeholder="wrapperProps.placeholder"
|
|
48
|
+
:type="type"
|
|
49
|
+
:autofocus="!!autoFocus"
|
|
50
|
+
:icon="icon"
|
|
51
|
+
:readonly="readonly"
|
|
52
|
+
:ui="ui"
|
|
53
|
+
@update:model-value="onChange"
|
|
54
|
+
@focus="onFocus"
|
|
55
|
+
@blur="onBlur"
|
|
56
|
+
@keydown="onKeydown"
|
|
57
|
+
/>
|
|
58
|
+
<div
|
|
59
|
+
v-if="showSuggestions && filteredSuggestions.length > 0"
|
|
60
|
+
ref="suggestionsContainerRef"
|
|
61
|
+
:class="theme.suggestionsContainer()"
|
|
62
|
+
>
|
|
63
|
+
<div
|
|
64
|
+
v-for="(suggestion, index) in filteredSuggestions"
|
|
65
|
+
:key="suggestion"
|
|
66
|
+
:ref="(el) => setSuggestionItemRef(el, index)"
|
|
67
67
|
:class="[
|
|
68
68
|
theme.suggestionItem(),
|
|
69
69
|
{ [theme.suggestionItemActive()]: index === selectedSuggestionIndex }
|
|
70
|
-
]"
|
|
71
|
-
@mousedown.prevent="selectSuggestion(suggestion, index)"
|
|
72
|
-
@mouseenter="selectedSuggestionIndex = index"
|
|
73
|
-
>
|
|
74
|
-
{{ suggestion }}
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
</FieldWrapper>
|
|
70
|
+
]"
|
|
71
|
+
@mousedown.prevent="selectSuggestion(suggestion, index)"
|
|
72
|
+
@mouseenter="selectedSuggestionIndex = index"
|
|
73
|
+
>
|
|
74
|
+
{{ suggestion }}
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</FieldWrapper>
|
|
79
79
|
</template>
|
|
80
80
|
|
|
81
81
|
<script setup>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<Textarea
|
|
4
|
-
:model-value="value"
|
|
5
|
-
:disabled="wrapperProps.disabled"
|
|
6
|
-
:name="name"
|
|
7
|
-
:resize="resize"
|
|
8
|
-
:placeholder="wrapperProps.placeholder"
|
|
9
|
-
:autofocus="!!autoFocus"
|
|
10
|
-
:autoresize="autoresize"
|
|
11
|
-
:rows="rows"
|
|
12
|
-
:maxrows="maxrows"
|
|
13
|
-
:loading="loading"
|
|
14
|
-
:loading-icon="loadingIcon"
|
|
15
|
-
:readonly="readonly"
|
|
16
|
-
:ui="ui"
|
|
17
|
-
@update:model-value="onChange"
|
|
18
|
-
/>
|
|
19
|
-
</FieldWrapper>
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<Textarea
|
|
4
|
+
:model-value="value"
|
|
5
|
+
:disabled="wrapperProps.disabled"
|
|
6
|
+
:name="name"
|
|
7
|
+
:resize="resize"
|
|
8
|
+
:placeholder="wrapperProps.placeholder"
|
|
9
|
+
:autofocus="!!autoFocus"
|
|
10
|
+
:autoresize="autoresize"
|
|
11
|
+
:rows="rows"
|
|
12
|
+
:maxrows="maxrows"
|
|
13
|
+
:loading="loading"
|
|
14
|
+
:loading-icon="loadingIcon"
|
|
15
|
+
:readonly="readonly"
|
|
16
|
+
:ui="ui"
|
|
17
|
+
@update:model-value="onChange"
|
|
18
|
+
/>
|
|
19
|
+
</FieldWrapper>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script setup>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper
|
|
3
|
-
v-bind="wrapperProps"
|
|
4
|
-
label=""
|
|
5
|
-
description=""
|
|
6
|
-
>
|
|
7
|
-
<Switch
|
|
8
|
-
:model-value="value"
|
|
9
|
-
:disabled="wrapperProps.disabled"
|
|
10
|
-
:name="name"
|
|
11
|
-
:ui="ui"
|
|
12
|
-
:label="label"
|
|
13
|
-
:description="description"
|
|
14
|
-
:loading="loading"
|
|
15
|
-
:loading-icon="loadingIcon"
|
|
16
|
-
@update:modelValue="onChange"
|
|
17
|
-
/>
|
|
18
|
-
</FieldWrapper>
|
|
2
|
+
<FieldWrapper
|
|
3
|
+
v-bind="wrapperProps"
|
|
4
|
+
label=""
|
|
5
|
+
description=""
|
|
6
|
+
>
|
|
7
|
+
<Switch
|
|
8
|
+
:model-value="value"
|
|
9
|
+
:disabled="wrapperProps.disabled"
|
|
10
|
+
:name="name"
|
|
11
|
+
:ui="ui"
|
|
12
|
+
:label="label"
|
|
13
|
+
:description="description"
|
|
14
|
+
:loading="loading"
|
|
15
|
+
:loading-icon="loadingIcon"
|
|
16
|
+
@update:modelValue="onChange"
|
|
17
|
+
/>
|
|
18
|
+
</FieldWrapper>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script setup>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<form class="form">
|
|
3
|
-
<slot />
|
|
4
|
-
</form>
|
|
5
|
-
</template>
|
|
1
|
+
<template>
|
|
2
|
+
<form class="form">
|
|
3
|
+
<slot />
|
|
4
|
+
</form>
|
|
5
|
+
</template>
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<UseImage v-bind="$props">
|
|
3
|
-
<template #loading>
|
|
4
|
-
<slot name="loading">
|
|
5
|
-
<div
|
|
6
|
-
class="flex h-full w-full items-center justify-center"
|
|
7
|
-
>
|
|
8
|
-
<Loader
|
|
9
|
-
:loading="true"
|
|
10
|
-
/>
|
|
11
|
-
</div>
|
|
12
|
-
</slot>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<template #error>
|
|
16
|
-
<slot name="error">
|
|
17
|
-
<div
|
|
18
|
-
class="flex h-full w-full items-center justify-center"
|
|
19
|
-
>
|
|
20
|
-
<p class="text-error-400">
|
|
21
|
-
<Icon
|
|
22
|
-
name="i-heroicons:exclamation-circle-solid"
|
|
23
|
-
class="text-error-400 size-8"
|
|
24
|
-
/>
|
|
25
|
-
</p>
|
|
26
|
-
</div>
|
|
27
|
-
</slot>
|
|
28
|
-
</template>
|
|
29
|
-
</UseImage>
|
|
2
|
+
<UseImage v-bind="$props">
|
|
3
|
+
<template #loading>
|
|
4
|
+
<slot name="loading">
|
|
5
|
+
<div
|
|
6
|
+
class="flex h-full w-full items-center justify-center"
|
|
7
|
+
>
|
|
8
|
+
<Loader
|
|
9
|
+
:loading="true"
|
|
10
|
+
/>
|
|
11
|
+
</div>
|
|
12
|
+
</slot>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<template #error>
|
|
16
|
+
<slot name="error">
|
|
17
|
+
<div
|
|
18
|
+
class="flex h-full w-full items-center justify-center"
|
|
19
|
+
>
|
|
20
|
+
<p class="text-error-400">
|
|
21
|
+
<Icon
|
|
22
|
+
name="i-heroicons:exclamation-circle-solid"
|
|
23
|
+
class="text-error-400 size-8"
|
|
24
|
+
/>
|
|
25
|
+
</p>
|
|
26
|
+
</div>
|
|
27
|
+
</slot>
|
|
28
|
+
</template>
|
|
29
|
+
</UseImage>
|
|
30
30
|
</template>
|
|
31
31
|
|
|
32
32
|
<script setup>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<DevOnly>
|
|
3
|
-
<TeleportSafe
|
|
4
|
-
to="#dev-logs"
|
|
5
|
-
>
|
|
6
|
-
<LogItem
|
|
7
|
-
v-if="typeof data !== 'undefined'"
|
|
8
|
-
:data="data"
|
|
9
|
-
:title="title"
|
|
10
|
-
/>
|
|
11
|
-
<LogItem
|
|
12
|
-
v-for="(item, index) in dataItems"
|
|
13
|
-
:key="index"
|
|
14
|
-
:data="item"
|
|
15
|
-
:title="`${title} #${index + 1}`"
|
|
16
|
-
/>
|
|
17
|
-
</TeleportSafe>
|
|
18
|
-
</DevOnly>
|
|
2
|
+
<DevOnly>
|
|
3
|
+
<TeleportSafe
|
|
4
|
+
to="#dev-logs"
|
|
5
|
+
>
|
|
6
|
+
<LogItem
|
|
7
|
+
v-if="typeof data !== 'undefined'"
|
|
8
|
+
:data="data"
|
|
9
|
+
:title="title"
|
|
10
|
+
/>
|
|
11
|
+
<LogItem
|
|
12
|
+
v-for="(item, index) in dataItems"
|
|
13
|
+
:key="index"
|
|
14
|
+
:data="item"
|
|
15
|
+
:title="`${title} #${index + 1}`"
|
|
16
|
+
/>
|
|
17
|
+
</TeleportSafe>
|
|
18
|
+
</DevOnly>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script setup>
|
|
@@ -76,7 +76,7 @@ import { computed } from "vue";
|
|
|
76
76
|
import { COLUMN_TYPES } from "#core/components/Table/types";
|
|
77
77
|
import ColumnNumber from "#core/components/Table/ColumnNumber.vue";
|
|
78
78
|
import ColumnImage from "#core/components/Table/ColumnImage.vue";
|
|
79
|
-
import {
|
|
79
|
+
import { NumberHelper } from "#core/utils/NumberHelper";
|
|
80
80
|
import { ref, watch } from "#imports";
|
|
81
81
|
import ColumnDateTime from "#core/components/Table/ColumnDateTime.vue";
|
|
82
82
|
import Empty from "#core/components/Empty.vue";
|
|
@@ -148,7 +148,7 @@ const transformValue = (column, row) => {
|
|
|
148
148
|
return column.transform ? column.transform(value, row, column) : value;
|
|
149
149
|
};
|
|
150
150
|
const totalCountWithComma = computed(() => {
|
|
151
|
-
return !props.pageOptions?.totalCount ? "0" :
|
|
151
|
+
return !props.pageOptions?.totalCount ? "0" : NumberHelper.withComma(props.pageOptions.totalCount);
|
|
152
152
|
});
|
|
153
153
|
watch(page, () => {
|
|
154
154
|
emits("pageChange", page.value);
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed } from "vue";
|
|
7
|
-
import {
|
|
7
|
+
import { NumberHelper } from "#core/utils/NumberHelper";
|
|
8
8
|
const props = defineProps({
|
|
9
9
|
value: { type: null, required: true },
|
|
10
10
|
row: { type: null, required: true },
|
|
11
11
|
column: { type: null, required: true }
|
|
12
12
|
});
|
|
13
|
-
const getValue = computed(() =>
|
|
13
|
+
const getValue = computed(() => NumberHelper.withComma(props.value));
|
|
14
14
|
</script>
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
:default-page="options.pageOptions?.currentPage || 1"
|
|
91
91
|
:items-per-page="options.pageOptions.limit"
|
|
92
92
|
:total="options.pageOptions.totalCount"
|
|
93
|
-
:to="options.
|
|
93
|
+
:to="options.isRouteChange ? to : void 0"
|
|
94
94
|
@update:page="onPageChange"
|
|
95
95
|
/>
|
|
96
96
|
</div>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
import { computed } from "vue";
|
|
102
102
|
import { COLUMN_TYPES } from "#core/components/Table/types";
|
|
103
103
|
import { _debounce, ref, useUiConfig, watch, useWatchChange, useRouter } from "#imports";
|
|
104
|
-
import {
|
|
104
|
+
import { NumberHelper } from "#core/utils/NumberHelper";
|
|
105
105
|
import ColumnDate from "#core/components/Table/ColumnDate.vue";
|
|
106
106
|
import ColumnDateTime from "#core/components/Table/ColumnDateTime.vue";
|
|
107
107
|
import ColumnImage from "#core/components/Table/ColumnImage.vue";
|
|
@@ -170,7 +170,7 @@ const totalCountWithComma = computed(() => {
|
|
|
170
170
|
if (!total || total <= 0) {
|
|
171
171
|
return "0";
|
|
172
172
|
}
|
|
173
|
-
return
|
|
173
|
+
return NumberHelper.withComma(total);
|
|
174
174
|
});
|
|
175
175
|
const transformValue = (column, row) => {
|
|
176
176
|
return column.cell ? column.cell({
|
|
@@ -28,7 +28,7 @@ export interface ITableOptions<T extends Record<string, any> = Record<string, an
|
|
|
28
28
|
isHideToolbar?: boolean;
|
|
29
29
|
isEnabledSearch?: boolean;
|
|
30
30
|
searchPlaceholder?: string;
|
|
31
|
-
|
|
31
|
+
isRouteChange: boolean;
|
|
32
32
|
}
|
|
33
33
|
export interface ISimpleTableOptions<T extends Record<string, any> = Record<string, any>> extends IBaseTableOptions<T> {
|
|
34
34
|
limit?: number;
|
|
@@ -7,7 +7,7 @@ export const createFlexDeckOptions = (repo, options) => {
|
|
|
7
7
|
pageOptions: get(repo.fetch.options),
|
|
8
8
|
status: get(repo.fetch.status),
|
|
9
9
|
primary: get(repo.fetch.options).primary || config.default_primary_key,
|
|
10
|
-
|
|
10
|
+
isRouteChange: false,
|
|
11
11
|
...options
|
|
12
12
|
};
|
|
13
13
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, ref
|
|
1
|
+
import { computed, ref } from "#imports";
|
|
2
2
|
export const checkMaxSize = (file, acceptFileSize = 0) => {
|
|
3
3
|
if (acceptFileSize) {
|
|
4
4
|
return file.size / 1e3 <= acceptFileSize;
|
|
@@ -90,22 +90,14 @@ export const useFileProgress = () => {
|
|
|
90
90
|
percent.value = 100;
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
percent.value =
|
|
94
|
-
StringHelper.withFixed(
|
|
95
|
-
(Math.floor(progressEvent.loaded * 100 / progressEvent.total) || 0) * 0.8
|
|
96
|
-
)
|
|
97
|
-
);
|
|
93
|
+
percent.value = (Math.floor(progressEvent.loaded * 100 / progressEvent.total) || 0) * 0.8;
|
|
98
94
|
};
|
|
99
95
|
const onDownloadProgress = (progressEvent) => {
|
|
100
96
|
if (!progressEvent.total || progressEvent.total === 0) {
|
|
101
97
|
percent.value = 100;
|
|
102
98
|
return;
|
|
103
99
|
}
|
|
104
|
-
percent.value =
|
|
105
|
-
StringHelper.withFixed(
|
|
106
|
-
Math.floor(progressEvent.loaded * 100 / progressEvent.total) * 0.2 + 80
|
|
107
|
-
)
|
|
108
|
-
);
|
|
100
|
+
percent.value = Math.floor(progressEvent.loaded * 100 / progressEvent.total) * 0.2 + 80;
|
|
109
101
|
};
|
|
110
102
|
return {
|
|
111
103
|
percent,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../.nuxt/tsconfig.server.json",
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../.nuxt/tsconfig.server.json",
|
|
3
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare class NumberHelper {
|
|
2
|
+
static withComma: (value?: number | string) => string;
|
|
3
|
+
static withFixed: (value?: number | string) => string;
|
|
4
|
+
static toCurrency: (value?: number | string, currency?: string) => string;
|
|
5
|
+
static toNumber: (value: any) => number;
|
|
6
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class NumberHelper {
|
|
2
|
+
static withComma = (value = 0) => {
|
|
3
|
+
return (+(value || 0)).toLocaleString();
|
|
4
|
+
};
|
|
5
|
+
static withFixed = (value = 0) => {
|
|
6
|
+
return (+(value || 0)).toLocaleString(void 0, {
|
|
7
|
+
minimumFractionDigits: 0,
|
|
8
|
+
maximumFractionDigits: 2
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
static toCurrency = (value = 0, currency = "") => {
|
|
12
|
+
const options = {
|
|
13
|
+
minimumFractionDigits: 2,
|
|
14
|
+
maximumFractionDigits: 2
|
|
15
|
+
};
|
|
16
|
+
if (currency) {
|
|
17
|
+
options.style = "currency";
|
|
18
|
+
options.currency = currency;
|
|
19
|
+
}
|
|
20
|
+
return (+(value || 0)).toLocaleString(void 0, options);
|
|
21
|
+
};
|
|
22
|
+
static toNumber = (value) => {
|
|
23
|
+
return Number(value) || 0;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export declare class StringHelper {
|
|
2
2
|
static genString: (length?: number) => string;
|
|
3
|
-
static withComma: (value?: number | string) => string;
|
|
4
|
-
static withFixed: (value?: number | string) => string;
|
|
5
3
|
static split: (str: string | null | undefined, separator: string | RegExp) => string[];
|
|
6
4
|
static joinURL: (...parts: string[]) => string;
|
|
7
5
|
static truncate: (str: any, num?: number) => any;
|
|
@@ -9,15 +9,6 @@ export class StringHelper {
|
|
|
9
9
|
}
|
|
10
10
|
return result;
|
|
11
11
|
};
|
|
12
|
-
static withComma = (value = 0) => {
|
|
13
|
-
return (+(value || 0)).toLocaleString();
|
|
14
|
-
};
|
|
15
|
-
static withFixed = (value = 0) => {
|
|
16
|
-
return (+(value || 0)).toLocaleString(void 0, {
|
|
17
|
-
minimumFractionDigits: 0,
|
|
18
|
-
maximumFractionDigits: 2
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
12
|
static split = (str, separator) => {
|
|
22
13
|
return `${str || ""}`.split(separator).filter((item) => item).map((item) => item.trim());
|
|
23
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finema/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.21.0",
|
|
4
4
|
"repository": "https://gitlab.finema.co/finema/ui-kit",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Finema Dev Core Team",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"changelogen": "^0.5.7",
|
|
82
82
|
"eslint": "^9.26.0",
|
|
83
83
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
84
|
-
"eslint-plugin-better-tailwindcss": "^3.
|
|
84
|
+
"eslint-plugin-better-tailwindcss": "^3.3.0",
|
|
85
85
|
"husky": "^9.1.7",
|
|
86
86
|
"lint-staged": "^16.0.0",
|
|
87
87
|
"nuxt": "3.17.3",
|
|
@@ -93,4 +93,4 @@
|
|
|
93
93
|
"lint-staged": {
|
|
94
94
|
"*": "eslint --fix"
|
|
95
95
|
}
|
|
96
|
-
}
|
|
96
|
+
}
|