@finema/core 2.15.0 → 2.15.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 (28) 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/DevToolsWindow/index.vue +95 -95
  5. package/dist/runtime/components/FlexDeck/index.vue +119 -37
  6. package/dist/runtime/components/FlexDeck/index.vue.d.ts +2 -1
  7. package/dist/runtime/components/FlexDeck/types.d.ts +1 -4
  8. package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
  9. package/dist/runtime/components/Form/InputCheckbox/index.vue +18 -18
  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/InputText/index.vue +48 -48
  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/index.vue +5 -5
  16. package/dist/runtime/components/Image.vue +28 -28
  17. package/dist/runtime/components/Log/index.vue +17 -17
  18. package/dist/runtime/components/Table/Base.vue.d.ts +2 -2
  19. package/dist/runtime/components/Table/ColumnDate.vue +1 -1
  20. package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
  21. package/dist/runtime/components/Table/ColumnImage.vue +4 -4
  22. package/dist/runtime/components/Table/ColumnNumber.vue +1 -1
  23. package/dist/runtime/components/Table/ColumnText.vue +1 -1
  24. package/dist/runtime/components/Table/index.vue +1 -21
  25. package/dist/runtime/server/tsconfig.json +3 -3
  26. package/package.json +1 -1
  27. package/dist/runtime/components/FlexDeck/Base.vue +0 -156
  28. package/dist/runtime/components/FlexDeck/Base.vue.d.ts +0 -103
@@ -1,156 +0,0 @@
1
- <template>
2
- <div
3
- v-if="!isHideCaption || !isHideBottomPagination"
4
- class="mb-4 text-gray-500"
5
- >
6
- <span class="font-bold">ผลลัพธ์ทั้งหมด:</span>
7
- จำนวน
8
- <span class="font-bold">{{ pageOptions?.totalCount || 0 }}</span>
9
- รายการ
10
- </div>
11
- <slot
12
- v-if="!status.isLoading && rawData.length === 0"
13
- name="empty-state"
14
- >
15
- <Empty />
16
- </slot>
17
-
18
- <div
19
- v-if="pageOptions && isEnableInfiniteScroll && !isHideTopPagination"
20
- class="mb-4 flex items-center justify-end"
21
- >
22
- <p class="text-xs text-gray-500">
23
- ผลลัพธ์ {{ totalInnerRawData }} ของ {{ totalCountWithComma }} รายการ
24
- </p>
25
- </div>
26
-
27
- <div :class="containerClass">
28
- <slot
29
- v-for="(row, index) in innerRawData"
30
- :key="index"
31
- :row="row"
32
- />
33
- <div ref="bottomEdgeElement" />
34
- </div>
35
-
36
- <slot
37
- v-if="status.isLoading"
38
- name="loading-state"
39
- >
40
- <div class="flex h-60 items-center justify-center">
41
- <Icon
42
- name="i-svg-spinners:180-ring-with-bg"
43
- class="size-8 text-primary"
44
- />
45
- </div>
46
- </slot>
47
-
48
- <div
49
- v-if="pageOptions && !isEnableInfiniteScroll"
50
- class="mt-4 flex justify-between px-3"
51
- >
52
- <p class="text-xs text-gray-500">
53
- ผลลัพธ์ {{ pageBetween }} ของ {{ totalCountWithComma }} รายการ
54
- </p>
55
- <Pagination
56
- v-if="pageOptions.totalPage > 1 && !isSimplePagination && !isHideBottomPagination"
57
- :default-page="pageOptions?.currentPage || 1"
58
- :items-per-page="pageOptions.limit"
59
- :total="pageOptions.totalCount"
60
- @update:page="emits('pageChange', $event)"
61
- />
62
- <SimplePagination
63
- v-if="pageOptions.totalPage > 1 && isSimplePagination"
64
- v-model="page"
65
- :page-count="pageOptions.limit"
66
- :total="pageOptions.totalCount"
67
- />
68
- </div>
69
- </template>
70
-
71
- <script setup>
72
- import { computed } from "vue";
73
- import { useElementVisibility } from "@vueuse/core";
74
- import { StringHelper } from "#core/utils/StringHelper";
75
- import { ref, useWatchChange, useWatchTrue, watch } from "#imports";
76
- import Empty from "#core/components/Empty.vue";
77
- const emits = defineEmits(["pageChange"]);
78
- const props = defineProps({
79
- status: {
80
- type: Object,
81
- required: true
82
- },
83
- pageOptions: {
84
- type: Object,
85
- required: false
86
- },
87
- rawData: {
88
- type: Array,
89
- required: true
90
- },
91
- isSimplePagination: {
92
- type: Boolean,
93
- default: false
94
- },
95
- isHideTopPagination: {
96
- type: Boolean,
97
- default: false
98
- },
99
- isHideBottomPagination: {
100
- type: Boolean,
101
- default: false
102
- },
103
- isEnableInfiniteScroll: {
104
- type: Boolean,
105
- default: false
106
- },
107
- isHideCaption: {
108
- type: Boolean,
109
- default: false
110
- },
111
- containerClass: {
112
- type: [String, Array, Object]
113
- }
114
- });
115
- const bottomEdgeElement = ref(null);
116
- const page = ref(props.pageOptions?.currentPage || 1);
117
- const innerRawData = ref([]);
118
- const targetElement = useElementVisibility(bottomEdgeElement);
119
- const pageBetween = computed(() => {
120
- const length = props.rawData?.length;
121
- if (length === 0) {
122
- return "0";
123
- }
124
- const start = (props.pageOptions.currentPage - 1) * props.pageOptions.limit + 1;
125
- const end = start + length - 1;
126
- return `${start} - ${end}`;
127
- });
128
- const totalCountWithComma = computed(() => {
129
- return !props.pageOptions.totalCount ? "0" : StringHelper.withComma(props.pageOptions.totalCount);
130
- });
131
- const totalInnerRawData = computed(() => {
132
- return innerRawData.value?.length || 0;
133
- });
134
- useWatchChange(
135
- () => props.pageOptions?.currentPage,
136
- (value) => {
137
- page.value = value;
138
- }
139
- );
140
- useWatchTrue(
141
- () => props.status.isSuccess,
142
- () => {
143
- if (props.isEnableInfiniteScroll) {
144
- innerRawData.value = [...innerRawData.value || [], ...props.rawData];
145
- return;
146
- }
147
- innerRawData.value = props.rawData;
148
- }
149
- );
150
- watch(targetElement, (value) => {
151
- if (props.status.isLoading || !props.isEnableInfiniteScroll) return;
152
- if (page.value < props.pageOptions.totalPage && value) {
153
- page.value++;
154
- }
155
- });
156
- </script>
@@ -1,103 +0,0 @@
1
- import { type PropType } from 'vue';
2
- import type { IFlexDeckOptions } from '#core/components/FlexDeck/types';
3
- declare var __VLS_1: {}, __VLS_6: {
4
- key: number;
5
- row: object;
6
- }, __VLS_8: {};
7
- type __VLS_Slots = {} & {
8
- 'empty-state'?: (props: typeof __VLS_1) => any;
9
- } & {
10
- default?: (props: typeof __VLS_6) => any;
11
- } & {
12
- 'loading-state'?: (props: typeof __VLS_8) => any;
13
- };
14
- declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
15
- status: {
16
- type: PropType<IFlexDeckOptions["status"]>;
17
- required: true;
18
- };
19
- pageOptions: {
20
- type: PropType<IFlexDeckOptions["pageOptions"]>;
21
- required: false;
22
- };
23
- rawData: {
24
- type: PropType<IFlexDeckOptions["rawData"]>;
25
- required: true;
26
- };
27
- isSimplePagination: {
28
- type: PropType<IFlexDeckOptions["isSimplePagination"]>;
29
- default: boolean;
30
- };
31
- isHideTopPagination: {
32
- type: PropType<IFlexDeckOptions["isHideTopPagination"]>;
33
- default: boolean;
34
- };
35
- isHideBottomPagination: {
36
- type: PropType<IFlexDeckOptions["isHideBottomPagination"]>;
37
- default: boolean;
38
- };
39
- isEnableInfiniteScroll: {
40
- type: PropType<IFlexDeckOptions["isEnableInfiniteScroll"]>;
41
- default: boolean;
42
- };
43
- isHideCaption: {
44
- type: PropType<IFlexDeckOptions["isHideCaption"]>;
45
- default: boolean;
46
- };
47
- containerClass: {
48
- type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
49
- };
50
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
51
- pageChange: (...args: any[]) => void;
52
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
53
- status: {
54
- type: PropType<IFlexDeckOptions["status"]>;
55
- required: true;
56
- };
57
- pageOptions: {
58
- type: PropType<IFlexDeckOptions["pageOptions"]>;
59
- required: false;
60
- };
61
- rawData: {
62
- type: PropType<IFlexDeckOptions["rawData"]>;
63
- required: true;
64
- };
65
- isSimplePagination: {
66
- type: PropType<IFlexDeckOptions["isSimplePagination"]>;
67
- default: boolean;
68
- };
69
- isHideTopPagination: {
70
- type: PropType<IFlexDeckOptions["isHideTopPagination"]>;
71
- default: boolean;
72
- };
73
- isHideBottomPagination: {
74
- type: PropType<IFlexDeckOptions["isHideBottomPagination"]>;
75
- default: boolean;
76
- };
77
- isEnableInfiniteScroll: {
78
- type: PropType<IFlexDeckOptions["isEnableInfiniteScroll"]>;
79
- default: boolean;
80
- };
81
- isHideCaption: {
82
- type: PropType<IFlexDeckOptions["isHideCaption"]>;
83
- default: boolean;
84
- };
85
- containerClass: {
86
- type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
87
- };
88
- }>> & Readonly<{
89
- onPageChange?: ((...args: any[]) => any) | undefined;
90
- }>, {
91
- isHideCaption: boolean | undefined;
92
- isHideBottomPagination: boolean | undefined;
93
- isHideTopPagination: boolean | undefined;
94
- isSimplePagination: boolean | undefined;
95
- isEnableInfiniteScroll: boolean | undefined;
96
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
97
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
98
- export default _default;
99
- type __VLS_WithSlots<T, S> = T & {
100
- new (): {
101
- $slots: S;
102
- };
103
- };