@bagelink/vue 1.10.1 → 1.10.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/components/Spreadsheet/Index.vue.d.ts +3 -22
- package/dist/components/Spreadsheet/Index.vue.d.ts.map +1 -1
- package/dist/components/Spreadsheet/SpreadsheetCell.vue.d.ts +23 -0
- package/dist/components/Spreadsheet/SpreadsheetCell.vue.d.ts.map +1 -0
- package/dist/components/Spreadsheet/SpreadsheetTable.vue.d.ts +2 -15
- package/dist/components/Spreadsheet/SpreadsheetTable.vue.d.ts.map +1 -1
- package/dist/components/Spreadsheet/composables/useSpreadsheetClipboard.d.ts +7 -0
- package/dist/components/Spreadsheet/composables/useSpreadsheetClipboard.d.ts.map +1 -0
- package/dist/components/Spreadsheet/composables/useSpreadsheetColumns.d.ts +14 -0
- package/dist/components/Spreadsheet/composables/useSpreadsheetColumns.d.ts.map +1 -0
- package/dist/components/Spreadsheet/composables/useSpreadsheetSelection.d.ts +24 -0
- package/dist/components/Spreadsheet/composables/useSpreadsheetSelection.d.ts.map +1 -0
- package/dist/components/Spreadsheet/composables/useSpreadsheetSort.d.ts +8 -0
- package/dist/components/Spreadsheet/composables/useSpreadsheetSort.d.ts.map +1 -0
- package/dist/components/Spreadsheet/composables/useSpreadsheetUndo.d.ts +72 -0
- package/dist/components/Spreadsheet/composables/useSpreadsheetUndo.d.ts.map +1 -0
- package/dist/components/Spreadsheet/types.d.ts +36 -0
- package/dist/components/Spreadsheet/types.d.ts.map +1 -0
- package/dist/components/Spreadsheet/utils.d.ts +6 -0
- package/dist/components/Spreadsheet/utils.d.ts.map +1 -0
- package/dist/index.cjs +90 -90
- package/dist/index.mjs +10165 -10102
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/Spreadsheet/Index.vue +127 -619
- package/src/components/Spreadsheet/SpreadsheetCell.vue +56 -0
- package/src/components/Spreadsheet/SpreadsheetTable.vue +79 -77
- package/src/components/Spreadsheet/composables/useSpreadsheetClipboard.ts +71 -0
- package/src/components/Spreadsheet/composables/useSpreadsheetColumns.ts +110 -0
- package/src/components/Spreadsheet/composables/useSpreadsheetSelection.ts +43 -0
- package/src/components/Spreadsheet/composables/useSpreadsheetSort.ts +42 -0
- package/src/components/Spreadsheet/composables/useSpreadsheetUndo.ts +55 -0
- package/src/components/Spreadsheet/types.ts +35 -0
- package/src/components/Spreadsheet/utils.ts +69 -0
|
@@ -1,26 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
key: string;
|
|
4
|
-
label?: string;
|
|
5
|
-
locked?: boolean;
|
|
6
|
-
format?: ColumnFormat;
|
|
7
|
-
sortable?: boolean;
|
|
8
|
-
width?: string;
|
|
9
|
-
fixed?: boolean;
|
|
10
|
-
hidden?: boolean;
|
|
11
|
-
defaultValue?: any;
|
|
12
|
-
}
|
|
13
|
-
interface Props {
|
|
14
|
-
modelValue: Array<{
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
}>;
|
|
17
|
-
columnConfig?: ColumnConfig[];
|
|
18
|
-
label?: string;
|
|
19
|
-
allowAddRow?: boolean;
|
|
20
|
-
}
|
|
21
|
-
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
1
|
+
import { SpreadsheetProps } from './types';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<SpreadsheetProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
3
|
"update:modelValue": (...args: any[]) => void;
|
|
23
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
4
|
+
}, string, import('vue').PublicProps, Readonly<SpreadsheetProps> & Readonly<{
|
|
24
5
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
25
6
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
26
7
|
searchInputRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../form/inputs/TextInput.vue').TextInputProps> & Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Spreadsheet/Index.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Spreadsheet/Index.vue"],"names":[],"mappings":"AAAA,OA0RO,KAAK,EAAE,gBAAgB,EAAgB,MAAM,SAAS,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAktB7D,wBASG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ColumnConfig } from './types';
|
|
2
|
+
interface Props {
|
|
3
|
+
col: ColumnConfig;
|
|
4
|
+
row: {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
rowIndex: number;
|
|
8
|
+
globalColIndex: number;
|
|
9
|
+
editing: boolean;
|
|
10
|
+
editable: boolean;
|
|
11
|
+
wrapText?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
14
|
+
updateCell: (rowIndex: number, key: string, value: string | boolean) => any;
|
|
15
|
+
stopEditing: (cancelled: boolean) => any;
|
|
16
|
+
setInputRef: (el: any, key: string) => any;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
18
|
+
onUpdateCell?: ((rowIndex: number, key: string, value: string | boolean) => any) | undefined;
|
|
19
|
+
onStopEditing?: ((cancelled: boolean) => any) | undefined;
|
|
20
|
+
onSetInputRef?: ((el: any, key: string) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
export default _default;
|
|
23
|
+
//# sourceMappingURL=SpreadsheetCell.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpreadsheetCell.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Spreadsheet/SpreadsheetCell.vue"],"names":[],"mappings":"AAAA,OA0DO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAI3C,UAAU,KAAK;IACd,GAAG,EAAE,YAAY,CAAA;IACjB,GAAG,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB;;;;;;;;;;AAoHD,wBAOG"}
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
row: number;
|
|
3
|
-
col: number;
|
|
4
|
-
}
|
|
5
|
-
interface ColumnConfig {
|
|
6
|
-
key: string;
|
|
7
|
-
label?: string;
|
|
8
|
-
locked?: boolean;
|
|
9
|
-
format?: 'text' | 'number' | 'currency' | 'date' | 'percentage' | 'image' | 'boolean';
|
|
10
|
-
sortable?: boolean;
|
|
11
|
-
width?: string;
|
|
12
|
-
fixed?: boolean;
|
|
13
|
-
hidden?: boolean;
|
|
14
|
-
defaultValue?: any;
|
|
15
|
-
}
|
|
1
|
+
import { CellPosition, ColumnConfig } from './types';
|
|
16
2
|
interface Props {
|
|
17
3
|
columns: ColumnConfig[];
|
|
18
4
|
rows: Array<{
|
|
@@ -28,6 +14,7 @@ interface Props {
|
|
|
28
14
|
editingCell: CellPosition | null;
|
|
29
15
|
baseColumnIndex: number;
|
|
30
16
|
wrapText?: boolean;
|
|
17
|
+
emptyMessage?: string;
|
|
31
18
|
}
|
|
32
19
|
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
33
20
|
sortColumn: (key: string) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpreadsheetTable.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Spreadsheet/SpreadsheetTable.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SpreadsheetTable.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Spreadsheet/SpreadsheetTable.vue"],"names":[],"mappings":"AAAA,OA0WO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAIzD,UAAU,KAAK;IACd,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,IAAI,EAAE,KAAK,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC,CAAA;IACnC,OAAO,EAAE,OAAO,CAAA;IAChB,cAAc,EAAE,OAAO,CAAA;IACvB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,aAAa,EAAE,KAAK,GAAG,MAAM,CAAA;IAC7B,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAA;IACjC,WAAW,EAAE,YAAY,GAAG,IAAI,CAAA;IAChC,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;CACrB;;;;;;;;;;;;;;;;;;;;;;;;AAyRD,wBAQG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Ref, ComputedRef } from 'vue';
|
|
2
|
+
import { CellPosition, ColumnConfig, Row, SpreadsheetChange } from '../types';
|
|
3
|
+
export declare function useSpreadsheetClipboard(localRows: Ref<Row[]>, columns: ComputedRef<ColumnConfig[]>, selectionStart: Ref<CellPosition | null>, selectionEnd: Ref<CellPosition | null>, saveState: (type: SpreadsheetChange['type']) => void, isCellEditable: (key: string) => boolean, createEmptyRow: () => Row, emitUpdate: () => void): {
|
|
4
|
+
copySelection: () => Promise<void>;
|
|
5
|
+
pasteSelection: () => Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=useSpreadsheetClipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSpreadsheetClipboard.d.ts","sourceRoot":"","sources":["../../../../src/components/Spreadsheet/composables/useSpreadsheetClipboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAGlF,wBAAgB,uBAAuB,CACtC,SAAS,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,EACrB,OAAO,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,EACpC,cAAc,EAAE,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,EACxC,YAAY,EAAE,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,EACtC,SAAS,EAAE,CAAC,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,KAAK,IAAI,EACpD,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,EACxC,cAAc,EAAE,MAAM,GAAG,EACzB,UAAU,EAAE,MAAM,IAAI;;;EA0DtB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { ColumnConfig, Row } from '../types';
|
|
3
|
+
export declare function useSpreadsheetColumns(localRows: Ref<Row[]>, getColumnConfig: () => ColumnConfig[] | undefined): {
|
|
4
|
+
columns: import('vue').ComputedRef<ColumnConfig[]>;
|
|
5
|
+
fixedColumns: import('vue').ComputedRef<ColumnConfig[]>;
|
|
6
|
+
scrollableColumns: import('vue').ComputedRef<ColumnConfig[]>;
|
|
7
|
+
columnOptions: import('vue').ComputedRef<ColumnConfig[]>;
|
|
8
|
+
visibleColumns: Ref<string[], string[]>;
|
|
9
|
+
columnWidths: Ref<Map<string, number> & Omit<Map<string, number>, keyof Map<any, any>>, Map<string, number> | (Map<string, number> & Omit<Map<string, number>, keyof Map<any, any>>)>;
|
|
10
|
+
isCellEditable: (columnKey: string) => boolean;
|
|
11
|
+
createEmptyRow: () => Row;
|
|
12
|
+
handleResizeStart: (e: MouseEvent, columnKey: string) => void;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useSpreadsheetColumns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSpreadsheetColumns.d.ts","sourceRoot":"","sources":["../../../../src/components/Spreadsheet/composables/useSpreadsheetColumns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAGjD,wBAAgB,qBAAqB,CACpC,SAAS,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,EACrB,eAAe,EAAE,MAAM,YAAY,EAAE,GAAG,SAAS;;;;;;;gCAiDd,MAAM,KAAG,OAAO;0BAIxB,GAAG;2BAwBA,UAAU,aAAa,MAAM;EA0B3D"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { CellPosition, ColumnConfig } from '../types';
|
|
3
|
+
export declare function useSpreadsheetSelection(columns: ComputedRef<ColumnConfig[]>): {
|
|
4
|
+
isSelecting: import('vue').Ref<boolean, boolean>;
|
|
5
|
+
selectionStart: import('vue').Ref<{
|
|
6
|
+
row: number;
|
|
7
|
+
col: number;
|
|
8
|
+
} | null, CellPosition | {
|
|
9
|
+
row: number;
|
|
10
|
+
col: number;
|
|
11
|
+
} | null>;
|
|
12
|
+
selectionEnd: import('vue').Ref<{
|
|
13
|
+
row: number;
|
|
14
|
+
col: number;
|
|
15
|
+
} | null, CellPosition | {
|
|
16
|
+
row: number;
|
|
17
|
+
col: number;
|
|
18
|
+
} | null>;
|
|
19
|
+
handleMouseDown: (row: number, col: number) => void;
|
|
20
|
+
handleMouseOver: (row: number, col: number) => void;
|
|
21
|
+
handleMouseUp: () => void;
|
|
22
|
+
selectEntireRow: (rowIndex: number) => void;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=useSpreadsheetSelection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSpreadsheetSelection.d.ts","sourceRoot":"","sources":["../../../../src/components/Spreadsheet/composables/useSpreadsheetSelection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAG1D,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC;;;;;;;;;;;;;;;;2BAK7C,MAAM,OAAO,MAAM;2BAMnB,MAAM,OAAO,MAAM;;gCAUd,MAAM;EAiBzC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Ref, ComputedRef } from 'vue';
|
|
2
|
+
import { ColumnConfig, Row } from '../types';
|
|
3
|
+
export declare function useSpreadsheetSort(localRows: Ref<Row[]>, columns: ComputedRef<ColumnConfig[]>, visibleColumns: Ref<string[]>, emitUpdate: () => void): {
|
|
4
|
+
sortColumn: Ref<string | null, string | null>;
|
|
5
|
+
sortDirection: Ref<"desc" | "asc", "desc" | "asc">;
|
|
6
|
+
sortByColumn: (columnKey: string) => void;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=useSpreadsheetSort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSpreadsheetSort.d.ts","sourceRoot":"","sources":["../../../../src/components/Spreadsheet/composables/useSpreadsheetSort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAGjD,wBAAgB,kBAAkB,CACjC,SAAS,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,EACrB,OAAO,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,EACpC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,EAC7B,UAAU,EAAE,MAAM,IAAI;;;8BAKW,MAAM;EA4BvC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { CellPosition, Row, SpreadsheetChange } from '../types';
|
|
3
|
+
export declare function useSpreadsheetUndo(localRows: Ref<Row[]>, selectionStart: Ref<CellPosition | null>, selectionEnd: Ref<CellPosition | null>, emitUpdate: () => void): {
|
|
4
|
+
undoStack: Ref<{
|
|
5
|
+
type: "cell" | "row" | "paste";
|
|
6
|
+
data: {
|
|
7
|
+
rows: Row[];
|
|
8
|
+
selection?: {
|
|
9
|
+
start: {
|
|
10
|
+
row: number;
|
|
11
|
+
col: number;
|
|
12
|
+
};
|
|
13
|
+
end: {
|
|
14
|
+
row: number;
|
|
15
|
+
col: number;
|
|
16
|
+
};
|
|
17
|
+
} | undefined;
|
|
18
|
+
};
|
|
19
|
+
}[], SpreadsheetChange[] | {
|
|
20
|
+
type: "cell" | "row" | "paste";
|
|
21
|
+
data: {
|
|
22
|
+
rows: Row[];
|
|
23
|
+
selection?: {
|
|
24
|
+
start: {
|
|
25
|
+
row: number;
|
|
26
|
+
col: number;
|
|
27
|
+
};
|
|
28
|
+
end: {
|
|
29
|
+
row: number;
|
|
30
|
+
col: number;
|
|
31
|
+
};
|
|
32
|
+
} | undefined;
|
|
33
|
+
};
|
|
34
|
+
}[]>;
|
|
35
|
+
redoStack: Ref<{
|
|
36
|
+
type: "cell" | "row" | "paste";
|
|
37
|
+
data: {
|
|
38
|
+
rows: Row[];
|
|
39
|
+
selection?: {
|
|
40
|
+
start: {
|
|
41
|
+
row: number;
|
|
42
|
+
col: number;
|
|
43
|
+
};
|
|
44
|
+
end: {
|
|
45
|
+
row: number;
|
|
46
|
+
col: number;
|
|
47
|
+
};
|
|
48
|
+
} | undefined;
|
|
49
|
+
};
|
|
50
|
+
}[], SpreadsheetChange[] | {
|
|
51
|
+
type: "cell" | "row" | "paste";
|
|
52
|
+
data: {
|
|
53
|
+
rows: Row[];
|
|
54
|
+
selection?: {
|
|
55
|
+
start: {
|
|
56
|
+
row: number;
|
|
57
|
+
col: number;
|
|
58
|
+
};
|
|
59
|
+
end: {
|
|
60
|
+
row: number;
|
|
61
|
+
col: number;
|
|
62
|
+
};
|
|
63
|
+
} | undefined;
|
|
64
|
+
};
|
|
65
|
+
}[]>;
|
|
66
|
+
canUndo: import('vue').ComputedRef<boolean>;
|
|
67
|
+
canRedo: import('vue').ComputedRef<boolean>;
|
|
68
|
+
saveState: (type: SpreadsheetChange["type"]) => void;
|
|
69
|
+
undo: () => void;
|
|
70
|
+
redo: () => void;
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=useSpreadsheetUndo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSpreadsheetUndo.d.ts","sourceRoot":"","sources":["../../../../src/components/Spreadsheet/composables/useSpreadsheetUndo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAGpE,wBAAgB,kBAAkB,CACjC,SAAS,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,EACrB,cAAc,EAAE,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,EACxC,YAAY,EAAE,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,EACtC,UAAU,EAAE,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA0BG,iBAAiB,CAAC,MAAM,CAAC;;;EAoBlD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type ColumnFormat = 'text' | 'number' | 'currency' | 'date' | 'percentage' | 'image' | 'boolean';
|
|
2
|
+
export interface Row {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export interface ColumnConfig {
|
|
6
|
+
key: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
locked?: boolean;
|
|
9
|
+
format?: ColumnFormat;
|
|
10
|
+
sortable?: boolean;
|
|
11
|
+
width?: string;
|
|
12
|
+
fixed?: boolean;
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
defaultValue?: any;
|
|
15
|
+
}
|
|
16
|
+
export interface CellPosition {
|
|
17
|
+
row: number;
|
|
18
|
+
col: number;
|
|
19
|
+
}
|
|
20
|
+
export interface SpreadsheetChange {
|
|
21
|
+
type: 'cell' | 'row' | 'paste';
|
|
22
|
+
data: {
|
|
23
|
+
rows: Row[];
|
|
24
|
+
selection?: {
|
|
25
|
+
start: CellPosition;
|
|
26
|
+
end: CellPosition;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface SpreadsheetProps {
|
|
31
|
+
modelValue: Row[];
|
|
32
|
+
columnConfig?: ColumnConfig[];
|
|
33
|
+
label?: string;
|
|
34
|
+
allowAddRow?: boolean;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Spreadsheet/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,GAAG,SAAS,CAAA;AAEvG,MAAM,WAAW,GAAG;IAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE;AAE3C,MAAM,WAAW,YAAY;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,GAAG,CAAA;CAClB;AAED,MAAM,WAAW,YAAY;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACX;AAED,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,CAAA;IAC9B,IAAI,EAAE;QACL,IAAI,EAAE,GAAG,EAAE,CAAA;QACX,SAAS,CAAC,EAAE;YAAE,KAAK,EAAE,YAAY,CAAC;YAAC,GAAG,EAAE,YAAY,CAAA;SAAE,CAAA;KACtD,CAAA;CACD;AAED,MAAM,WAAW,gBAAgB;IAChC,UAAU,EAAE,GAAG,EAAE,CAAA;IACjB,YAAY,CAAC,EAAE,YAAY,EAAE,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;CACrB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ColumnFormat, Row } from './types';
|
|
2
|
+
export declare function flattenObject(obj: Row, prefix?: string): Row;
|
|
3
|
+
export declare function unflattenObject(obj: Row): Row;
|
|
4
|
+
export declare function formatCellValue(value: any, format?: ColumnFormat): string;
|
|
5
|
+
export declare function parseValueForFormat(value: string | boolean, format?: ColumnFormat): any;
|
|
6
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Spreadsheet/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAEhD,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,SAAK,GAAG,GAAG,CAaxD;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAc7C;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAkBzE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,GAAG,CAevF"}
|