@finema/core 3.11.1 → 3.12.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/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "3.11.1",
3
+ "version": "3.12.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 = "3.11.1";
7
+ const version = "3.12.0";
8
8
 
9
9
  const nuxtAppOptions = {
10
10
  head: {
@@ -7,15 +7,34 @@ type Slot = TableSlots<any> & {
7
7
  type __VLS_Props = {
8
8
  options: ITableOptions<any>;
9
9
  ui?: (typeof tableTheme)['slots'];
10
+ isPinAction?: boolean;
11
+ columnPinning?: {
12
+ left: string[];
13
+ right: string[];
14
+ };
10
15
  };
11
16
  type __VLS_Slots = Slot;
12
17
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
18
  search: (q: string) => any;
14
19
  pageChange: (page: number) => any;
20
+ "update:columnPinning": (value: {
21
+ left: string[];
22
+ right: string[];
23
+ }) => any;
15
24
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
25
  onSearch?: ((q: string) => any) | undefined;
17
26
  onPageChange?: ((page: number) => any) | undefined;
18
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ "onUpdate:columnPinning"?: ((value: {
28
+ left: string[];
29
+ right: string[];
30
+ }) => any) | undefined;
31
+ }>, {
32
+ isPinAction: boolean;
33
+ columnPinning: {
34
+ left: string[];
35
+ right: string[];
36
+ };
37
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
38
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
39
  declare const _default: typeof __VLS_export;
21
40
  export default _default;
@@ -18,6 +18,7 @@
18
18
  v-bind="$attrs"
19
19
  :options="options"
20
20
  :ui="ui"
21
+ :column-pinning="computedColumnPinning"
21
22
  @page-change="onPageChange"
22
23
  @search="emits('search', q)"
23
24
  >
@@ -39,15 +40,37 @@ import { computed } from "vue";
39
40
  import { _debounce, ref, useUiConfig, watch } from "#imports";
40
41
  import { tableTheme } from "#core/theme/table";
41
42
  import Base from "#core/components/Table/Base.vue";
42
- const emits = defineEmits(["pageChange", "search"]);
43
+ const emits = defineEmits(["pageChange", "search", "update:columnPinning"]);
43
44
  const props = defineProps({
44
45
  options: { type: Object, required: true },
45
- ui: { type: null, required: false }
46
+ ui: { type: null, required: false },
47
+ isPinAction: { type: Boolean, required: false, default: false },
48
+ columnPinning: { type: Object, required: false, default: () => ({
49
+ left: [],
50
+ right: []
51
+ }) }
46
52
  });
47
53
  defineSlots();
48
54
  const tableContainer = ref();
49
55
  const q = ref(props.options?.pageOptions.search ?? "");
50
56
  const theme = computed(() => useUiConfig(tableTheme, "table")());
57
+ const computedColumnPinning = computed(() => {
58
+ if (props.isPinAction) {
59
+ const hasActionsColumn = props.options.columns.some(
60
+ (col) => col.accessorKey === "actions"
61
+ );
62
+ if (hasActionsColumn) {
63
+ const rightPinned = props.columnPinning.right.filter(
64
+ (col) => col !== "actions"
65
+ );
66
+ return {
67
+ left: props.columnPinning.left,
68
+ right: [...rightPinned, "actions"]
69
+ };
70
+ }
71
+ }
72
+ return props.columnPinning;
73
+ });
51
74
  watch(
52
75
  q,
53
76
  _debounce((value) => {
@@ -7,15 +7,34 @@ type Slot = TableSlots<any> & {
7
7
  type __VLS_Props = {
8
8
  options: ITableOptions<any>;
9
9
  ui?: (typeof tableTheme)['slots'];
10
+ isPinAction?: boolean;
11
+ columnPinning?: {
12
+ left: string[];
13
+ right: string[];
14
+ };
10
15
  };
11
16
  type __VLS_Slots = Slot;
12
17
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
18
  search: (q: string) => any;
14
19
  pageChange: (page: number) => any;
20
+ "update:columnPinning": (value: {
21
+ left: string[];
22
+ right: string[];
23
+ }) => any;
15
24
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
25
  onSearch?: ((q: string) => any) | undefined;
17
26
  onPageChange?: ((page: number) => any) | undefined;
18
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ "onUpdate:columnPinning"?: ((value: {
28
+ left: string[];
29
+ right: string[];
30
+ }) => any) | undefined;
31
+ }>, {
32
+ isPinAction: boolean;
33
+ columnPinning: {
34
+ left: string[];
35
+ right: string[];
36
+ };
37
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
38
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
39
  declare const _default: typeof __VLS_export;
21
40
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "3.11.1",
3
+ "version": "3.12.0",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",