@finema/core 1.4.2 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "configKey": "core",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.7.4"
package/dist/module.mjs CHANGED
@@ -2,7 +2,7 @@ import { defineNuxtModule, createResolver, installModule, addPlugin, addComponen
2
2
  import 'lodash-es';
3
3
 
4
4
  const name = "@finema/core";
5
- const version = "1.4.2";
5
+ const version = "1.4.3";
6
6
 
7
7
  const colors = {
8
8
  black: "#20243E",
@@ -181,6 +181,44 @@ const button = {
181
181
 
182
182
  const buttonGroup = {};
183
183
 
184
+ const formGroup = {
185
+ default: {
186
+ size: "lg"
187
+ }
188
+ };
189
+
190
+ const checkbox = {};
191
+
192
+ const input = {
193
+ default: {
194
+ size: "lg"
195
+ }
196
+ };
197
+
198
+ const select = {
199
+ default: {
200
+ size: "lg"
201
+ }
202
+ };
203
+
204
+ const selectMenu = {
205
+ default: {
206
+ size: "lg"
207
+ }
208
+ };
209
+
210
+ const textarea = {
211
+ default: {
212
+ size: "lg"
213
+ }
214
+ };
215
+
216
+ const toggle = {
217
+ default: {
218
+ size: "lg"
219
+ }
220
+ };
221
+
184
222
  const colorModeOptions = {
185
223
  preference: "light"
186
224
  };
@@ -317,7 +355,14 @@ const module = defineNuxtModule({
317
355
  pagination,
318
356
  alert,
319
357
  button,
320
- buttonGroup
358
+ buttonGroup,
359
+ formGroup,
360
+ checkbox,
361
+ input,
362
+ select,
363
+ selectMenu,
364
+ textarea,
365
+ toggle
321
366
  },
322
367
  nuxt.options.appConfig.ui
323
368
  );
@@ -1,4 +1,11 @@
1
1
  <template>
2
+ <NuxtLoadingIndicator :color="color" />
2
3
  <Dialog />
3
4
  </template>
4
- <script lang="ts" setup></script>
5
+ <script lang="ts" setup>
6
+ defineProps({
7
+ color: {
8
+ type: String,
9
+ },
10
+ })
11
+ </script>
@@ -7,12 +7,23 @@
7
7
  select-text="เลือก"
8
8
  locale="th"
9
9
  :enable-time-picker="!disabledTime"
10
- :placeholder="placeholder || 'เลือกวันที่'"
10
+ :placeholder="wrapperProps.placeholder"
11
11
  :format="format"
12
12
  :min-date="minDate"
13
13
  :max-date="maxDate"
14
14
  :required="isRequired"
15
- />
15
+ >
16
+ <template #dp-input="{ value }">
17
+ <UInput
18
+ icon="i-heroicons-calendar-days"
19
+ type="text"
20
+ :value="value"
21
+ :placeholder="wrapperProps.placeholder"
22
+ :readonly="true"
23
+ input-class="cursor-pointer select-none"
24
+ />
25
+ </template>
26
+ </Datepicker>
16
27
  </FieldWrapper>
17
28
  </template>
18
29
  <script lang="ts" setup>
@@ -4,10 +4,11 @@
4
4
  v-model="value"
5
5
  :disabled="wrapperProps.isDisabled"
6
6
  :name="name"
7
- :placeholder="placeholder ?? props.label"
7
+ :placeholder="wrapperProps.placeholder"
8
8
  :type="isShowPassword ? 'text' : props.type || 'text'"
9
9
  :autofocus="!!autoFocus"
10
10
  :icon="icon"
11
+ :readonly="isReadonly"
11
12
  :ui="ui"
12
13
  />
13
14
  </FieldWrapper>
@@ -5,10 +5,11 @@
5
5
  :disabled="wrapperProps.isDisabled"
6
6
  :name="name"
7
7
  :resize="resize"
8
- :placeholder="placeholder ?? props.label"
8
+ :placeholder="wrapperProps.placeholder"
9
9
  :autofocus="!!autoFocus"
10
10
  :autoresize="autoresize"
11
11
  :rows="rows"
12
+ :readonly="isReadonly"
12
13
  :ui="ui"
13
14
  />
14
15
  </FieldWrapper>
@@ -35,6 +35,7 @@ export interface IFieldProps {
35
35
  classInner?: any;
36
36
  placeholder?: string;
37
37
  isDisabled?: boolean;
38
+ isReadonly?: boolean;
38
39
  isRequired?: boolean;
39
40
  help?: string;
40
41
  ui?: object | any;
@@ -10,6 +10,7 @@ export const useFieldHOC = (newFormProps, opts) => {
10
10
  ...field,
11
11
  wrapperProps: computed(() => ({
12
12
  ...newFormProps,
13
+ placeholder: newFormProps.placeholder || newFormProps.label,
13
14
  errorMessage: field.errorMessage.value
14
15
  }))
15
16
  };
@@ -1 +1 @@
1
- export type UIComponentList = 'modal' | 'slideover' | 'dropdown' | 'icon' | 'button' | 'buttonGroup' | 'tabs' | 'card' | 'breadcrumb' | 'badge';
1
+ export type UIComponentList = 'modal' | 'slideover' | 'dropdown' | 'icon' | 'button' | 'buttonGroup' | 'tabs' | 'card' | 'breadcrumb' | 'badge' | 'input';
@@ -0,0 +1,3 @@
1
+ import type { DeepPartial } from '#ui/types';
2
+ import type * as config from '#ui/ui.config';
3
+ export declare const checkbox: DeepPartial<(typeof config)['checkbox']>;
@@ -0,0 +1 @@
1
+ export const checkbox = {};
@@ -0,0 +1,3 @@
1
+ import type { DeepPartial } from '#ui/types';
2
+ import type * as config from '#ui/ui.config';
3
+ export declare const formGroup: DeepPartial<(typeof config)['formGroup']>;
@@ -0,0 +1,5 @@
1
+ export const formGroup = {
2
+ default: {
3
+ size: "lg"
4
+ }
5
+ };
@@ -0,0 +1,3 @@
1
+ import type { DeepPartial } from '#ui/types';
2
+ import type * as config from '#ui/ui.config';
3
+ export declare const input: DeepPartial<(typeof config)['input']>;
@@ -0,0 +1,5 @@
1
+ export const input = {
2
+ default: {
3
+ size: "lg"
4
+ }
5
+ };
@@ -0,0 +1,3 @@
1
+ import type { DeepPartial } from '#ui/types';
2
+ import type * as config from '#ui/ui.config';
3
+ export declare const select: DeepPartial<(typeof config)['select']>;
@@ -0,0 +1,5 @@
1
+ export const select = {
2
+ default: {
3
+ size: "lg"
4
+ }
5
+ };
@@ -0,0 +1,3 @@
1
+ import type { DeepPartial } from '#ui/types';
2
+ import type * as config from '#ui/ui.config';
3
+ export declare const selectMenu: DeepPartial<(typeof config)['selectMenu']>;
@@ -0,0 +1,5 @@
1
+ export const selectMenu = {
2
+ default: {
3
+ size: "lg"
4
+ }
5
+ };
@@ -0,0 +1,3 @@
1
+ import type { DeepPartial } from '#ui/types';
2
+ import type * as config from '#ui/ui.config';
3
+ export declare const textarea: DeepPartial<(typeof config)['textarea']>;
@@ -0,0 +1,5 @@
1
+ export const textarea = {
2
+ default: {
3
+ size: "lg"
4
+ }
5
+ };
@@ -0,0 +1,3 @@
1
+ import type { DeepPartial } from '#ui/types';
2
+ import type * as config from '#ui/ui.config';
3
+ export declare const toggle: DeepPartial<(typeof config)['toggle']>;
@@ -0,0 +1,5 @@
1
+ export const toggle = {
2
+ default: {
3
+ size: "lg"
4
+ }
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",