@finema/core 2.26.7 → 2.27.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 (31) hide show
  1. package/README.md +79 -79
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +1 -1
  4. package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
  5. package/dist/runtime/components/Form/Fields.vue +13 -13
  6. package/dist/runtime/components/Form/InputCheckbox/index.vue +18 -18
  7. package/dist/runtime/components/Form/InputDateTime/index.vue +51 -51
  8. package/dist/runtime/components/Form/InputNumber/index.vue +20 -20
  9. package/dist/runtime/components/Form/InputSelectMultiple/index.vue +43 -43
  10. package/dist/runtime/components/Form/InputText/index.vue +2 -1
  11. package/dist/runtime/components/Form/InputText/index.vue.d.ts +2 -0
  12. package/dist/runtime/components/Form/InputText/types.d.ts +1 -0
  13. package/dist/runtime/components/Form/InputTextarea/index.vue +18 -18
  14. package/dist/runtime/components/Form/InputToggle/index.vue +17 -17
  15. package/dist/runtime/components/Form/InputUploadDropzone/index.vue +30 -30
  16. package/dist/runtime/components/Form/InputWYSIWYG/index.vue +1 -1
  17. package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
  18. package/dist/runtime/components/Form/fileState/FailedState.vue +33 -33
  19. package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
  20. package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
  21. package/dist/runtime/components/Form/index.vue +5 -5
  22. package/dist/runtime/components/Image.vue +28 -28
  23. package/dist/runtime/components/Log/index.vue +17 -17
  24. package/dist/runtime/components/Table/ColumnDate.vue +1 -1
  25. package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
  26. package/dist/runtime/components/Table/ColumnImage.vue +4 -4
  27. package/dist/runtime/components/Table/ColumnText.vue +1 -1
  28. package/dist/runtime/components/Table/types.d.ts +1 -2
  29. package/dist/runtime/helpers/apiBaseHelper.js +3 -7
  30. package/dist/runtime/server/tsconfig.json +3 -3
  31. package/package.json +11 -11
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
- - [✨ &nbsp;Release Notes](/CHANGELOG.md)
20
- - [📖 &nbsp;Storybook](https://your-storybook-url.com) <!-- Add a link to your Storybook -->
21
- - [đŸ•šī¸ &nbsp;Playground](#playground)
22
-
23
- ## Features
24
-
25
- <!-- Highlight some of the features your UI kit provides here -->
26
- - 🎨 &nbsp;Wide range of customizable components, built for Vue and Nuxt
27
- - 📱 &nbsp;Responsive design out-of-the-box
28
- - â™ŋ &nbsp;Accessibility focused
29
- - đŸ› ī¸ &nbsp;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
+ - [✨ &nbsp;Release Notes](/CHANGELOG.md)
20
+ - [📖 &nbsp;Storybook](https://your-storybook-url.com) <!-- Add a link to your Storybook -->
21
+ - [đŸ•šī¸ &nbsp;Playground](#playground)
22
+
23
+ ## Features
24
+
25
+ <!-- Highlight some of the features your UI kit provides here -->
26
+ - 🎨 &nbsp;Wide range of customizable components, built for Vue and Nuxt
27
+ - 📱 &nbsp;Responsive design out-of-the-box
28
+ - â™ŋ &nbsp;Accessibility focused
29
+ - đŸ› ī¸ &nbsp;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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.26.7",
3
+ "version": "2.27.0",
4
4
  "configKey": "core",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
package/dist/module.mjs CHANGED
@@ -4,7 +4,7 @@ import * as lodash from 'lodash-es';
4
4
  import * as theme from '../dist/runtime/theme/index.js';
5
5
 
6
6
  const name = "@finema/core";
7
- const version = "2.26.7";
7
+ const version = "2.27.0";
8
8
 
9
9
  const nuxtAppOptions = {
10
10
  head: {
@@ -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
- <div
2
+ <div
3
3
  :class="[theme.base({
4
4
  class: [$props.class, ui?.base]
5
- })]"
6
- >
7
- <component
8
- :is="componentMap[option.type]?.component"
9
- v-for="option in options.filter((item) => !item.isHide)"
10
- :key="option.props.name"
11
- :class="option.class"
12
- :form="form"
5
+ })]"
6
+ >
7
+ <component
8
+ :is="componentMap[option.type]?.component"
9
+ v-for="option in options.filter((item) => !item.isHide)"
10
+ :key="option.props.name"
11
+ :class="option.class"
12
+ :form="form"
13
13
  v-bind="{
14
14
  ...getFieldBinding(option),
15
15
  ...componentMap[option.type]?.props
16
- }"
17
- v-on="option.on ?? {}"
18
- />
19
- </div>
16
+ }"
17
+ v-on="option.on ?? {}"
18
+ />
19
+ </div>
20
20
  </template>
21
21
 
22
22
  <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,60 +1,60 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <Datepicker
4
- :model-value="innerValue"
5
- :disabled="wrapperProps.disabled"
6
- cancel-text="ā¸ĸā¸āš€ā¸Ĩ⏴⏁"
7
- select-text="āš€ā¸Ĩ⏎⏭⏁"
8
- locale="th"
9
- :enable-time-picker="!disabledTime"
10
- :placeholder="wrapperProps.placeholder"
11
- :format="format"
12
- :min-date="minDate"
13
- :max-date="maxDate"
14
- :min-time="minTime"
15
- :max-time="maxTime"
16
- :start-time="startTime"
17
- :required="required"
18
- :flow="['calendar', 'time']"
19
- @update:model-value="onInput"
20
- >
21
- <template
22
- v-if="appConfig.core?.is_thai_year"
23
- #year="{ value }"
24
- >
25
- {{ value + 543 }}
26
- </template>
27
- <template
28
- v-if="appConfig.core?.is_thai_year"
29
- #year-overlay-value="{ value }"
30
- >
31
- {{ value + 543 }}
32
- </template>
33
- <template #dp-input="{ value: innerValue }">
34
- <Input
35
- :trailing-icon="innerValue ? void 0 : 'i-heroicons-calendar-days'"
36
- type="text"
37
- :disabled="wrapperProps.disabled"
38
- :model-value="innerValue"
39
- :placeholder="wrapperProps.placeholder"
40
- :readonly="true"
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <Datepicker
4
+ :model-value="innerValue"
5
+ :disabled="wrapperProps.disabled"
6
+ cancel-text="ā¸ĸā¸āš€ā¸Ĩ⏴⏁"
7
+ select-text="āš€ā¸Ĩ⏎⏭⏁"
8
+ locale="th"
9
+ :enable-time-picker="!disabledTime"
10
+ :placeholder="wrapperProps.placeholder"
11
+ :format="format"
12
+ :min-date="minDate"
13
+ :max-date="maxDate"
14
+ :min-time="minTime"
15
+ :max-time="maxTime"
16
+ :start-time="startTime"
17
+ :required="required"
18
+ :flow="['calendar', 'time']"
19
+ @update:model-value="onInput"
20
+ >
21
+ <template
22
+ v-if="appConfig.core?.is_thai_year"
23
+ #year="{ value }"
24
+ >
25
+ {{ value + 543 }}
26
+ </template>
27
+ <template
28
+ v-if="appConfig.core?.is_thai_year"
29
+ #year-overlay-value="{ value }"
30
+ >
31
+ {{ value + 543 }}
32
+ </template>
33
+ <template #dp-input="{ value: innerValue }">
34
+ <Input
35
+ :trailing-icon="innerValue ? void 0 : 'i-heroicons-calendar-days'"
36
+ type="text"
37
+ :disabled="wrapperProps.disabled"
38
+ :model-value="innerValue"
39
+ :placeholder="wrapperProps.placeholder"
40
+ :readonly="true"
41
41
  :ui="{
42
42
  base: 'cursor-pointer select-none',
43
43
  trailingIcon: 'cursor-pointer'
44
- }"
45
- />
46
- </template>
47
- <template #clear-icon="{ clear }">
48
- <Icon
49
- :name="clearIcon"
44
+ }"
45
+ />
46
+ </template>
47
+ <template #clear-icon="{ clear }">
48
+ <Icon
49
+ :name="clearIcon"
50
50
  :class="theme.clearIcon({
51
51
  class: [ui?.clearIcon]
52
- })"
53
- @click.stop="clear"
54
- />
55
- </template>
56
- </Datepicker>
57
- </FieldWrapper>
52
+ })"
53
+ @click.stop="clear"
54
+ />
55
+ </template>
56
+ </Datepicker>
57
+ </FieldWrapper>
58
58
  </template>
59
59
 
60
60
  <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>
@@ -85,7 +85,7 @@ import { ref, computed, nextTick, useUiConfig } from "#imports";
85
85
  import { useFieldHOC } from "#core/composables/useForm";
86
86
  import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
87
87
  import { inputTheme } from "#core/theme/input";
88
- const emits = defineEmits(["change"]);
88
+ const emits = defineEmits(["change", "selected"]);
89
89
  const props = defineProps({
90
90
  type: { type: String, required: false, default: "text" },
91
91
  leadingIcon: { type: null, required: false },
@@ -180,6 +180,7 @@ const onKeydown = (event) => {
180
180
  event.preventDefault();
181
181
  if (selectedSuggestionIndex.value >= 0) {
182
182
  selectSuggestion(filteredSuggestions.value[selectedSuggestionIndex.value], selectedSuggestionIndex.value);
183
+ emits("selected", filteredSuggestions.value[selectedSuggestionIndex.value]);
183
184
  }
184
185
  break;
185
186
  case "Escape":
@@ -1,8 +1,10 @@
1
1
  import type { ITextFieldProps } from '#core/components/Form/InputText/types';
2
2
  declare const _default: import("vue").DefineComponent<ITextFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
3
  change: (...args: any[]) => void;
4
+ selected: (...args: any[]) => void;
4
5
  }, string, import("vue").PublicProps, Readonly<ITextFieldProps> & Readonly<{
5
6
  onChange?: ((...args: any[]) => any) | undefined;
7
+ onSelected?: ((...args: any[]) => any) | undefined;
6
8
  }>, {
7
9
  type: "text" | "password" | "email";
8
10
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -17,4 +17,5 @@ export interface ITextFieldProps extends IFieldProps {
17
17
  }
18
18
  export type ITextField = IFormFieldBase<INPUT_TYPES.TEXT | INPUT_TYPES.PASSWORD | INPUT_TYPES.EMAIL, ITextFieldProps, {
19
19
  change?: (value: string) => void;
20
+ selected?: (value: string) => void;
20
21
  }>;
@@ -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,34 +1,34 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <div
4
- ref="dropzoneRef"
5
- :class="theme.base()"
6
- >
7
- <div :class="theme.wrapper()">
8
- <!-- Empty State -->
9
- <EmptyState
10
- v-if="uploadState.isEmpty.value"
11
- :theme="theme"
12
- :select-file-label="selectFileLabel"
13
- :select-file-sub-label="selectFileSubLabel"
14
- :placeholder="placeholder"
15
- @open-file="uploadState.handleOpenFile"
16
- />
17
-
18
- <!-- Success State -->
19
- <SuccessState
20
- v-if="uploadState.isSuccess.value"
21
- :theme="theme"
22
- :value="value"
23
- :disabled="wrapperProps.disabled"
24
- :readonly="wrapperProps.readonly"
25
- @preview="uploadState.handlePreview"
26
- @download="handleDownloadFile"
27
- @delete="uploadState.handleDeleteFile"
28
- />
29
- </div>
30
- </div>
31
- </FieldWrapper>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <div
4
+ ref="dropzoneRef"
5
+ :class="theme.base()"
6
+ >
7
+ <div :class="theme.wrapper()">
8
+ <!-- Empty State -->
9
+ <EmptyState
10
+ v-if="uploadState.isEmpty.value"
11
+ :theme="theme"
12
+ :select-file-label="selectFileLabel"
13
+ :select-file-sub-label="selectFileSubLabel"
14
+ :placeholder="placeholder"
15
+ @open-file="uploadState.handleOpenFile"
16
+ />
17
+
18
+ <!-- Success State -->
19
+ <SuccessState
20
+ v-if="uploadState.isSuccess.value"
21
+ :theme="theme"
22
+ :value="value"
23
+ :disabled="wrapperProps.disabled"
24
+ :readonly="wrapperProps.readonly"
25
+ @preview="uploadState.handlePreview"
26
+ @download="handleDownloadFile"
27
+ @delete="uploadState.handleDeleteFile"
28
+ />
29
+ </div>
30
+ </div>
31
+ </FieldWrapper>
32
32
  </template>
33
33
 
34
34
  <script setup>
@@ -32,7 +32,7 @@
32
32
  />
33
33
  <template #fallback>
34
34
  <div
35
- class="min-h-[200px]"
35
+ class="prose min-h-[200px] px-4 py-2"
36
36
  v-html="value"
37
37
  />
38
38
  </template>
@@ -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="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>
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="ā¸Ĩā¸šāš„ā¸Ÿā¸ĨāšŒ"
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="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="ā¸Ĩā¸šāš„ā¸Ÿā¸ĨāšŒ"
31
+ @click="$emit('delete')"
32
+ />
33
+ </div>
34
+ </div>
35
35
  </template>
36
36
 
37
37
  <script setup>
@@ -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>
@@ -1,29 +1,29 @@
1
1
  <template>
2
- <Modal
3
- :close="{ onClick: () => emits('close', false) }"
4
- :dismissible="false"
5
- :title="value?.name"
2
+ <Modal
3
+ :close="{ onClick: () => emits('close', false) }"
4
+ :dismissible="false"
5
+ :title="value?.name"
6
6
  :ui="{
7
7
  content: 'max-w-3xl'
8
- }"
9
- >
10
- <template #body>
11
- <div class="flex justify-center">
12
- <img
13
- v-if="value && isImageFromPath(value.path)"
14
- :src="value.url"
15
- alt="img-preview"
16
- class="max-h-96 max-w-full rounded-lg"
17
- />
18
- <video
19
- v-else-if="value && isVideoFromPath(value.path)"
20
- :src="value.url"
21
- controls
22
- class="max-h-96 max-w-full"
23
- />
24
- </div>
25
- </template>
26
- </Modal>
8
+ }"
9
+ >
10
+ <template #body>
11
+ <div class="flex justify-center">
12
+ <img
13
+ v-if="value && isImageFromPath(value.path)"
14
+ :src="value.url"
15
+ alt="img-preview"
16
+ class="max-h-96 max-w-full rounded-lg"
17
+ />
18
+ <video
19
+ v-else-if="value && isVideoFromPath(value.path)"
20
+ :src="value.url"
21
+ controls
22
+ class="max-h-96 max-w-full"
23
+ />
24
+ </div>
25
+ </template>
26
+ </Modal>
27
27
  </template>
28
28
 
29
29
  <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>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- {{ getValue || "-" }}
2
+ {{ getValue || "-" }}
3
3
  </template>
4
4
 
5
5
  <script setup>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- {{ getValue || "-" }}
2
+ {{ getValue || "-" }}
3
3
  </template>
4
4
 
5
5
  <script setup>
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <Image
3
- class="h-12 rounded"
4
- :src="getValue"
5
- />
2
+ <Image
3
+ class="h-12 rounded"
4
+ :src="getValue"
5
+ />
6
6
  </template>
7
7
 
8
8
  <script setup>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- {{ getValue }}
2
+ {{ getValue }}
3
3
  </template>
4
4
 
5
5
  <script setup>
@@ -1,7 +1,7 @@
1
1
  import type { Component } from 'vue';
2
2
  import type { TableColumn as NuxtUiTableColumn } from '@nuxt/ui';
3
3
  import type { IPageOptions, IStatus } from '#core/types/lib';
4
- export declare const enum COLUMN_TYPES {
4
+ export declare enum COLUMN_TYPES {
5
5
  COMPONENT = "COMPONENT",
6
6
  DATE = "DATE",
7
7
  DATE_TIME = "DATE_TIME",
@@ -21,7 +21,6 @@ export interface IBaseTableOptions<T extends Record<string, any> = Record<string
21
21
  columns: TableColumn<T>[];
22
22
  isHidePagination?: boolean;
23
23
  isHideCaption?: boolean;
24
- isSimplePagination?: boolean;
25
24
  }
26
25
  export interface ITableOptions<T extends Record<string, any> = Record<string, any>> extends IBaseTableOptions<T> {
27
26
  pageOptions: IPageOptions;
@@ -1,6 +1,6 @@
1
1
  import { ObjectHelper } from "../utils/ObjectHelper.js";
2
- import { ParamHelper } from "../utils/ParamHelper.js";
3
2
  import { NewRequester } from "../lib/Requester.js";
3
+ import { _merge } from "#imports";
4
4
  export const checkExpiration = (timestamp, expire) => {
5
5
  if (!expire || !timestamp) return false;
6
6
  return timestamp + expire > Date.now();
@@ -13,13 +13,9 @@ export const bindParamsToUrl = (urlTemplate, urlParams = {}) => {
13
13
  return resultUrl;
14
14
  };
15
15
  export const prepareRequestOptions = (baseOptions, requestOptions, params) => {
16
- const options = {
17
- ...baseOptions || {},
18
- ...requestOptions || {}
19
- };
20
- options.params = ParamHelper.getParams({
16
+ const options = _merge({}, baseOptions, requestOptions, {
21
17
  params
22
- }, options);
18
+ });
23
19
  return options;
24
20
  };
25
21
  export const handleApiRequest = async (requestContext, mockData, callbacks) => {
@@ -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": "2.26.7",
3
+ "version": "2.27.0",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",
@@ -47,15 +47,15 @@
47
47
  "@nuxt/ui": "^3.3.0",
48
48
  "@pinia/nuxt": "^0.11.0",
49
49
  "@tailwindcss/typography": "^0.5.0-alpha.3",
50
- "@tiptap/extension-image": "^2.23.0",
51
- "@tiptap/extension-link": "^2.23.0",
52
- "@tiptap/extension-text-align": "^2.23.0",
53
- "@tiptap/extension-text-style": "^2.23.0",
54
- "@tiptap/extension-underline": "^2.23.0",
55
- "@tiptap/extension-youtube": "^2.23.0",
56
- "@tiptap/pm": "^2.23.0",
57
- "@tiptap/starter-kit": "^2.23.0",
58
- "@tiptap/vue-3": "^2.23.0",
50
+ "@tiptap/extension-image": "^3.0.7",
51
+ "@tiptap/extension-link": "^3.0.7",
52
+ "@tiptap/extension-text-align": "^3.0.7",
53
+ "@tiptap/extension-text-style": "^3.0.7",
54
+ "@tiptap/extension-underline": "^3.0.7",
55
+ "@tiptap/extension-youtube": "^3.0.7",
56
+ "@tiptap/pm": "^3.0.7",
57
+ "@tiptap/starter-kit": "^3.0.7",
58
+ "@tiptap/vue-3": "^3.0.7",
59
59
  "@vee-validate/nuxt": "^4.15.1",
60
60
  "@vee-validate/valibot": "^4.15.1",
61
61
  "@vuepic/vue-datepicker": "^11.0.2",
@@ -74,7 +74,7 @@
74
74
  "@eslint/js": "^9.26.0",
75
75
  "@nuxt/devtools": "^2.6.0",
76
76
  "@nuxt/eslint-config": "^1.4.1",
77
- "@nuxt/module-builder": "^1.0.1",
77
+ "@nuxt/module-builder": "^1.0.2",
78
78
  "@nuxt/schema": "^4.0.2",
79
79
  "@nuxt/test-utils": "^3.19.0",
80
80
  "@types/node": "latest",