@finema/core 2.32.1 → 2.32.2

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 (30) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/components/FlexDeck/index.vue +31 -16
  4. package/dist/runtime/components/FlexDeck/index.vue.d.ts +1 -0
  5. package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
  6. package/dist/runtime/components/Form/Fields.vue +13 -13
  7. package/dist/runtime/components/Form/InputCheckbox/index.vue +18 -18
  8. package/dist/runtime/components/Form/InputComponent/index.vue +1 -1
  9. package/dist/runtime/components/Form/InputDateTime/index.vue +51 -51
  10. package/dist/runtime/components/Form/InputNumber/index.vue +20 -20
  11. package/dist/runtime/components/Form/InputSelectMultiple/index.vue +43 -43
  12. package/dist/runtime/components/Form/InputTextarea/index.vue +18 -18
  13. package/dist/runtime/components/Form/InputTime/index.vue +37 -37
  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/fileState/EmptyState.vue +21 -21
  17. package/dist/runtime/components/Form/fileState/FailedState.vue +33 -33
  18. package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
  19. package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
  20. package/dist/runtime/components/Form/index.vue +5 -5
  21. package/dist/runtime/components/Image.vue +28 -28
  22. package/dist/runtime/components/Log/index.vue +17 -17
  23. package/dist/runtime/components/Table/Base.vue +67 -67
  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/Simple.vue +20 -20
  29. package/dist/runtime/server/tsconfig.json +3 -3
  30. package/package.json +2 -2
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.32.1",
3
+ "version": "2.32.2",
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.32.1";
7
+ const version = "2.32.2";
8
8
 
9
9
  const nuxtAppOptions = {
10
10
  head: {
@@ -11,13 +11,6 @@
11
11
  />
12
12
  </div>
13
13
 
14
- <slot
15
- v-if="options.status.isSuccess && options.rawData.length === 0"
16
- name="empty-state"
17
- >
18
- <Empty />
19
- </slot>
20
-
21
14
  <div
22
15
  v-if="options.pageOptions && options.isEnableInfiniteScroll"
23
16
  class="mb-4 flex items-center justify-end"
@@ -27,23 +20,45 @@
27
20
  </p>
28
21
  </div>
29
22
 
30
- <div :class="containerClass">
31
- <slot
32
- v-for="(row, index) in displayData"
33
- :key="index"
34
- :row="row"
35
- />
36
- <div ref="bottomEdgeElement" />
37
- </div>
23
+ <slot
24
+ v-if="options.status.isSuccess && options.rawData.length === 0"
25
+ name="empty-state"
26
+ >
27
+ <Empty />
28
+ </slot>
38
29
 
39
30
  <slot
40
- v-if="options.status.isLoading"
31
+ v-else-if="options.status.isLoading"
41
32
  name="loading-state"
42
33
  >
43
34
  <Loader
44
35
  :loading="true"
45
36
  />
46
37
  </slot>
38
+ <slot
39
+ v-else-if="options.status.isError"
40
+ name="error-state"
41
+ >
42
+ <div
43
+ class="
44
+ text-error-400 flex h-[200px] items-center justify-center text-2xl
45
+ "
46
+ >
47
+ {{ StringHelper.getError(options.status.errorData) }}
48
+ </div>
49
+ </slot>
50
+
51
+ <div
52
+ v-else
53
+ :class="containerClass"
54
+ >
55
+ <slot
56
+ v-for="(row, index) in displayData"
57
+ :key="index"
58
+ :row="row"
59
+ />
60
+ <div ref="bottomEdgeElement" />
61
+ </div>
47
62
 
48
63
  <div
49
64
  v-if="options.pageOptions && !options.isEnableInfiniteScroll && !options.isHidePagination"
@@ -7,6 +7,7 @@ type __VLS_Slots = {
7
7
  }) => any;
8
8
  'empty-state': () => any;
9
9
  'loading-state': () => any;
10
+ 'error-state': () => any;
10
11
  };
11
12
  declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
12
13
  options: {
@@ -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,5 +1,5 @@
1
1
  <template>
2
- <component :is="props.component" :value="value" v-bind="props"/>
2
+ <component :is="props.component" :value="value" v-bind="props"/>
3
3
  </template>
4
4
 
5
5
  <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>
@@ -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,46 +1,46 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <Datepicker
4
- v-model="innerValue"
5
- :disabled="wrapperProps.disabled"
6
- cancel-text="ยกเลิก"
7
- select-text="เลือก"
8
- locale="th"
9
- time-picker
10
- :placeholder="wrapperProps.placeholder"
11
- :format="format"
12
- :min-time="minTime"
13
- :max-time="maxTime"
14
- :start-time="startTime"
15
- :required="required"
16
- :enable-seconds="enableSeconds"
17
- @update:model-value="onChange"
18
- >
19
- <template #dp-input="{ value: innerValue }">
20
- <Input
21
- :trailing-icon="innerValue ? void 0 : 'i-heroicons-clock'"
22
- type="text"
23
- :disabled="wrapperProps.disabled"
24
- :model-value="innerValue"
25
- :placeholder="wrapperProps.placeholder"
26
- :readonly="true"
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <Datepicker
4
+ v-model="innerValue"
5
+ :disabled="wrapperProps.disabled"
6
+ cancel-text="ยกเลิก"
7
+ select-text="เลือก"
8
+ locale="th"
9
+ time-picker
10
+ :placeholder="wrapperProps.placeholder"
11
+ :format="format"
12
+ :min-time="minTime"
13
+ :max-time="maxTime"
14
+ :start-time="startTime"
15
+ :required="required"
16
+ :enable-seconds="enableSeconds"
17
+ @update:model-value="onChange"
18
+ >
19
+ <template #dp-input="{ value: innerValue }">
20
+ <Input
21
+ :trailing-icon="innerValue ? void 0 : 'i-heroicons-clock'"
22
+ type="text"
23
+ :disabled="wrapperProps.disabled"
24
+ :model-value="innerValue"
25
+ :placeholder="wrapperProps.placeholder"
26
+ :readonly="true"
27
27
  :ui="{
28
28
  base: 'cursor-pointer select-none',
29
29
  trailingIcon: 'cursor-pointer'
30
- }"
31
- />
32
- </template>
33
- <template #clear-icon="{ clear }">
34
- <Icon
35
- :name="clearIcon"
30
+ }"
31
+ />
32
+ </template>
33
+ <template #clear-icon="{ clear }">
34
+ <Icon
35
+ :name="clearIcon"
36
36
  :class="theme.clearIcon({
37
37
  class: [ui?.clearIcon]
38
- })"
39
- @click.stop="clear"
40
- />
41
- </template>
42
- </Datepicker>
43
- </FieldWrapper>
38
+ })"
39
+ @click.stop="clear"
40
+ />
41
+ </template>
42
+ </Datepicker>
43
+ </FieldWrapper>
44
44
  </template>
45
45
 
46
46
  <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>