quill-table-up 3.4.0 → 3.5.1
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/README.md +12 -10
- package/dist/index.d.ts +6 -1
- package/dist/index.js +29 -29
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +27 -27
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/unit/table-clipboard.test.ts +674 -108
- package/src/__tests__/unit/table-hack.test.ts +402 -1
- package/src/modules/table-clipboard/table-clipboard.ts +142 -34
- package/src/modules/table-selection.ts +22 -2
- package/src/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/src/table-up.ts +44 -10
- package/src/utils/index.ts +1 -1
- package/src/utils/{style-helper.ts → style/helper.ts} +1 -1
- package/src/utils/style/index.ts +2 -0
- package/src/utils/style/inline-core.ts +80 -0
- package/src/utils/types.ts +2 -0
package/README.md
CHANGED
|
@@ -65,16 +65,18 @@ const quill = new Quill('#editor', {
|
|
|
65
65
|
|
|
66
66
|
**Full options usage see [demo](https://github.com/quill-modules/quill-table-up/blob/master/docs/index.js#L38)**
|
|
67
67
|
|
|
68
|
-
| Attribute
|
|
69
|
-
|
|
|
70
|
-
| full
|
|
71
|
-
| fullSwitch
|
|
72
|
-
| texts
|
|
73
|
-
| customSelect
|
|
74
|
-
| customBtn
|
|
75
|
-
| icon
|
|
76
|
-
| autoMergeCell
|
|
77
|
-
|
|
|
68
|
+
| Attribute | Description | Type | Default |
|
|
69
|
+
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------ |
|
|
70
|
+
| full | if set `true`. width max will be 100% | `boolean` | `false` |
|
|
71
|
+
| fullSwitch | enable to choose insert a full width table | `boolean` | `true` |
|
|
72
|
+
| texts | the text used to create the table | `TableTextOptions \| ((key: string) => string)` | `defaultTexts` |
|
|
73
|
+
| customSelect | display a custom select to custom row and column number add a table. module provides default selector `defaultCustomSelect` | `(tableModule: TableUp, picker: Picker) => Promise<HTMLElement> \| HTMLElement` | - |
|
|
74
|
+
| customBtn | display a custom button to custom row and column number add a table. it only when use `defaultCustomSelect` will effect | `boolean` | `false` |
|
|
75
|
+
| icon | picker svg icon string. it will set with `innerHTML` | `string` | `origin table icon` |
|
|
76
|
+
| autoMergeCell | empty row or column will auto merge to one | `boolean` | `true` |
|
|
77
|
+
| pasteStyleSheet | resolve `<style>` stylesheet rules to inline styles on table cells when pasting. note: when enabled, it processes **all** pasted HTML (not just tables), which may affect non-table paste content and add extra overhead for large pastes | `boolean` | `false` |
|
|
78
|
+
| pasteDefaultTagStyle | when `pasteStyleSheet` is enabled, also apply rules with tag-only selectors (e.g. `td`, `table td`). otherwise only class/id/attribute selectors are applied | `boolean` | `false` |
|
|
79
|
+
| modules | the module plugin to help user control about table operate. see [`Export Internal Module`](#export-internal-module) | `[]` | `{ module: Contstructor, options: any }[]` |
|
|
78
80
|
|
|
79
81
|
> I'm not suggest to use `TableVirtualScrollbar` and `TableResizeLine` at same time, because it have a little conflict when user hover on it. Just like the first editor in [demo](https://quill-modules.github.io/quill-table-up/)
|
|
80
82
|
|
package/dist/index.d.ts
CHANGED
|
@@ -442,7 +442,9 @@ declare class TableClipboard extends Clipboard {
|
|
|
442
442
|
cellCount: number;
|
|
443
443
|
colCount: number;
|
|
444
444
|
constructor(quill: Quill, options: Partial<ClipboardOptions>);
|
|
445
|
+
normalizeHTML(doc: Document): void;
|
|
445
446
|
getStyleBackgroundColor(node: Node, delta: Delta$1): void;
|
|
447
|
+
getTargetFull(): boolean;
|
|
446
448
|
matchTable(node: Node, delta: Delta$1): Delta$1;
|
|
447
449
|
matchTbody(node: Node, delta: Delta$1): Delta$1;
|
|
448
450
|
matchThead(node: Node, delta: Delta$1): Delta$1;
|
|
@@ -909,6 +911,7 @@ declare class TableSelection extends TableDomSelector {
|
|
|
909
911
|
setSelectionData(selection: Selection, selectionData: SelectionData): void;
|
|
910
912
|
selectionDirectionUp(selection: SelectionData): boolean;
|
|
911
913
|
resolveOptions(options: Partial<TableSelectionOptions>): TableSelectionOptions;
|
|
914
|
+
getSelectedTdsFormat(): Record<string, any>;
|
|
912
915
|
selectionChangeHandler: () => void;
|
|
913
916
|
helpLinesInitial(): HTMLDivElement;
|
|
914
917
|
computeSelectedTds(startPoint: Position, endPoint: Position): TableCellInnerFormat[];
|
|
@@ -919,8 +922,8 @@ declare class TableSelection extends TableDomSelector {
|
|
|
919
922
|
updateWithSelectedTds(): void;
|
|
920
923
|
update(): void;
|
|
921
924
|
getTableViewScroll(): {
|
|
922
|
-
x: number;
|
|
923
925
|
y: number;
|
|
926
|
+
x: number;
|
|
924
927
|
};
|
|
925
928
|
setSelectionTable(table: HTMLTableElement | undefined): void;
|
|
926
929
|
showDisplay(): void;
|
|
@@ -999,6 +1002,8 @@ interface TableUpOptions {
|
|
|
999
1002
|
texts: TableTextOptions;
|
|
1000
1003
|
icon: string;
|
|
1001
1004
|
autoMergeCell: boolean;
|
|
1005
|
+
pasteStyleSheet: boolean;
|
|
1006
|
+
pasteDefaultTagStyle: boolean;
|
|
1002
1007
|
modules: TableUpModule[];
|
|
1003
1008
|
}
|
|
1004
1009
|
interface TableUpOptionsInput extends Partial<Omit<TableUpOptions, 'texts'>> {
|