quill-table-up 2.1.9 → 2.2.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/README.md +41 -34
- package/dist/index.css +1 -1
- package/dist/index.d.ts +53 -17
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +16 -16
- package/src/__tests__/e2e/editor-page.ts +6 -0
- package/src/__tests__/e2e/table-blots.test.ts +52 -0
- package/src/__tests__/e2e/table-caption.test.ts +93 -0
- package/src/__tests__/e2e/table-hack.test.ts +43 -0
- package/src/__tests__/e2e/table-resize.test.ts +136 -5
- package/src/__tests__/e2e/table-selection.test.ts +7 -10
- package/src/__tests__/e2e/utils.ts +2 -2
- package/src/__tests__/unit/table-blots.test.ts +223 -0
- package/src/__tests__/unit/table-caption.test.ts +237 -0
- package/src/__tests__/unit/table-clipboard.test.ts +6 -6
- package/src/__tests__/unit/table-hack.test.ts +137 -63
- package/src/__tests__/unit/table-insert.test.ts +4 -4
- package/src/__tests__/unit/table-redo-undo.test.ts +252 -3
- package/src/__tests__/unit/utils.test.ts +2 -2
- package/src/__tests__/unit/utils.ts +44 -25
- package/src/__tests__/unit/vitest.d.ts +0 -1
- package/src/formats/index.ts +1 -0
- package/src/formats/overrides/scroll.ts +6 -0
- package/src/formats/table-caption-format.ts +115 -0
- package/src/formats/table-cell-format.ts +63 -33
- package/src/formats/table-cell-inner-format.ts +3 -3
- package/src/formats/table-col-format.ts +16 -12
- package/src/formats/table-colgroup-format.ts +2 -2
- package/src/formats/table-main-format.ts +0 -9
- package/src/formats/table-wrapper-format.ts +2 -2
- package/src/modules/table-clipboard.ts +21 -3
- package/src/modules/table-menu/constants.ts +18 -2
- package/src/modules/table-menu/table-menu-common.ts +0 -5
- package/src/modules/table-resize/table-resize-box.ts +74 -31
- package/src/modules/table-resize/table-resize-common.ts +8 -7
- package/src/modules/table-resize/table-resize-scale.ts +12 -5
- package/src/modules/table-scrollbar.ts +12 -7
- package/src/modules/table-selection.ts +16 -19
- package/src/style/color-picker.less +4 -2
- package/src/style/index.less +19 -0
- package/src/style/table-resize.less +16 -1
- package/src/svg/arrow-up-down.svg +11 -0
- package/src/svg/auto-full.svg +11 -1
- package/src/svg/background.svg +10 -1
- package/src/svg/border.svg +10 -1
- package/src/svg/color.svg +10 -1
- package/src/svg/copy.svg +8 -1
- package/src/svg/cut.svg +7 -1
- package/src/svg/insert-bottom.svg +6 -1
- package/src/svg/insert-left.svg +6 -1
- package/src/svg/insert-right.svg +6 -1
- package/src/svg/insert-top.svg +6 -1
- package/src/svg/merge-cell.svg +6 -1
- package/src/svg/remove-column.svg +6 -1
- package/src/svg/remove-row.svg +6 -1
- package/src/svg/remove-table.svg +6 -1
- package/src/svg/split-cell.svg +6 -1
- package/src/svg/table-head.svg +4 -0
- package/src/table-up.ts +149 -112
- package/src/utils/bem.ts +2 -2
- package/src/utils/blot-helper.ts +12 -0
- package/src/utils/color.ts +12 -12
- package/src/utils/components/button.ts +2 -2
- package/src/utils/components/color-picker.ts +2 -2
- package/src/utils/components/dialog.ts +2 -2
- package/src/utils/components/input.ts +2 -2
- package/src/utils/components/table/creator.ts +2 -2
- package/src/utils/components/table/select-box.ts +2 -2
- package/src/utils/components/tooltip.ts +2 -2
- package/src/utils/constants.ts +5 -3
- package/src/utils/position.ts +2 -2
- package/src/utils/resize-observer-helper.ts +2 -2
- package/src/utils/transformer.ts +5 -0
- package/src/utils/transition-event-helper.ts +2 -2
- package/src/utils/types.ts +5 -1
- package/src/utils/utils.ts +2 -2
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ Enhancement of quill table module
|
|
|
14
14
|
- [x] line break in cells
|
|
15
15
|
- [x] redo and undo
|
|
16
16
|
- [x] support whole table align left/center/right
|
|
17
|
+
- [x] `<caption>` support
|
|
17
18
|
|
|
18
19
|
## Usage
|
|
19
20
|
|
|
@@ -64,26 +65,30 @@ const quill = new Quill('#editor', {
|
|
|
64
65
|
|
|
65
66
|
### TableUp Options
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
86
|
-
|
|
68
|
+
**Full options usage see [demo](https://github.com/zzxming/quill-table-up/blob/master/docs/index.js#L38)**
|
|
69
|
+
|
|
70
|
+
| attribute | description | type | default |
|
|
71
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------- |
|
|
72
|
+
| full | if set `true`. width max will be 100% | `boolean` | `false` |
|
|
73
|
+
| fullSwitch | enable to choose insert a full width table | `boolean` | `true` |
|
|
74
|
+
| texts | the text used to create the table | `TableTextOptions` | `defaultTexts` |
|
|
75
|
+
| 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` | - |
|
|
76
|
+
| customBtn | display a custom button to custom row and column number add a table. it only when use `defaultCustomSelect` will effect | `boolean` | `false` |
|
|
77
|
+
| selection | table selection handler. module provides `TableSelection` | `Constructor` | - |
|
|
78
|
+
| selectionOptions | table selection options | `TableSelectionOptions` | - |
|
|
79
|
+
| icon | picker svg icon string. it will set with `innerHTML` | `string` | `origin table icon` |
|
|
80
|
+
| resize | table cell resize handler. module provides `TableResizeLine` and `TableResizeBox` | `Constructor` | - |
|
|
81
|
+
| resizeScale | equal scale table cell handler. module provides `TableResizeScale` | `Constructor` | - |
|
|
82
|
+
| scrollbar | table virtual scrollbar handler(don't have any other functional, just like origin scrollbar). module provides `TableVirtualScrollbar` | `Constructor` | - |
|
|
83
|
+
| align | table alignment handler. module provides `TableAlign` | `Constructor` | - |
|
|
84
|
+
| resizeOptions | table cell resize handler options | `any` | - |
|
|
85
|
+
| resizeScaleOptions | equal scale table cell handler options | `TableResizeScaleOptions` | - |
|
|
86
|
+
| alignOptions | table alignment handler options | `any` | - |
|
|
87
|
+
| scrollbarOptions | table virtual scrollbar handler options | `any` | - |
|
|
88
|
+
|
|
89
|
+
> 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://zzxming.github.io/quill-table-up/)
|
|
90
|
+
|
|
91
|
+
> If you doesn't use `TableVirtualScrollbar`, you may need to set css `.ql-editor .ql-table-wrapper { scrollbar-width: auto; }` to display the browser origin scrollbar.
|
|
87
92
|
|
|
88
93
|
<details>
|
|
89
94
|
<summary> default value </summary>
|
|
@@ -113,7 +118,8 @@ const defaultTexts = {
|
|
|
113
118
|
DeleteTable: 'Delete table',
|
|
114
119
|
BackgroundColor: 'Set background color',
|
|
115
120
|
BorderColor: 'Set border color',
|
|
116
|
-
SwitchWidth: 'Switch table width'
|
|
121
|
+
SwitchWidth: 'Switch table width',
|
|
122
|
+
InsertCaption: 'Insert table caption',
|
|
117
123
|
};
|
|
118
124
|
```
|
|
119
125
|
|
|
@@ -150,8 +156,8 @@ interface ToolOption {
|
|
|
150
156
|
name: string;
|
|
151
157
|
icon: string | ((tableModule: TableUp) => HTMLElement);
|
|
152
158
|
tip?: string;
|
|
153
|
-
|
|
154
|
-
|
|
159
|
+
isColorChoose?: boolean; // trigger a color picker first. need set `key`
|
|
160
|
+
key?: string; // the style name to set on td.
|
|
155
161
|
handle: (tableModule: TableUp, selectedTds: TableCellInnerFormat[], e: Event | string) => void;
|
|
156
162
|
}
|
|
157
163
|
interface ToolOptionBreak {
|
|
@@ -163,12 +169,6 @@ const tableMenuTools: Record<string, Tool> = {
|
|
|
163
169
|
Break: {
|
|
164
170
|
name: 'break',
|
|
165
171
|
},
|
|
166
|
-
SwitchWidth: {
|
|
167
|
-
name: 'SwitchWidth',
|
|
168
|
-
icon: AutoFull,
|
|
169
|
-
tip: 'Switch table width',
|
|
170
|
-
handle: (tableModule) => {},
|
|
171
|
-
},
|
|
172
172
|
CopyCell: {
|
|
173
173
|
name: 'CopyCell',
|
|
174
174
|
tip: 'Copy cell',
|
|
@@ -251,6 +251,18 @@ const tableMenuTools: Record<string, Tool> = {
|
|
|
251
251
|
key: 'border-color',
|
|
252
252
|
handle: (tableModule, selectedTds, color) => {},
|
|
253
253
|
},
|
|
254
|
+
SwitchWidth: {
|
|
255
|
+
name: 'SwitchWidth',
|
|
256
|
+
icon: AutoFull,
|
|
257
|
+
tip: 'Switch table width',
|
|
258
|
+
handle: (tableModule) => {},
|
|
259
|
+
},
|
|
260
|
+
InsertCaption: {
|
|
261
|
+
name: 'InsertCaption',
|
|
262
|
+
icon: TableHead,
|
|
263
|
+
tip: 'Insert table caption',
|
|
264
|
+
handle: (tableModule) => {},
|
|
265
|
+
},
|
|
254
266
|
};
|
|
255
267
|
const defaultTools = [
|
|
256
268
|
tableMenuTools.InsertTop,
|
|
@@ -267,11 +279,6 @@ const defaultTools = [
|
|
|
267
279
|
tableMenuTools.Break,
|
|
268
280
|
tableMenuTools.BackgroundColor,
|
|
269
281
|
tableMenuTools.BorderColor,
|
|
270
|
-
tableMenuTools.Break,
|
|
271
|
-
tableMenuTools.CopyCell,
|
|
272
|
-
tableMenuTools.CutCell,
|
|
273
|
-
tableMenuTools.Break,
|
|
274
|
-
tableMenuTools.SwitchWidth,
|
|
275
282
|
];
|
|
276
283
|
```
|
|
277
284
|
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ql-toolbar .ql-picker:not(.ql-color-picker):not(.ql-icon-picker).ql-table-up{width:28px}.ql-toolbar .ql-picker:not(.ql-color-picker):not(.ql-icon-picker).ql-table-up .ql-picker-label{padding:2px 4px}.ql-toolbar .ql-picker:not(.ql-color-picker):not(.ql-icon-picker).ql-table-up .ql-picker-label svg{position:static;margin-top:0}.ql-toolbar .ql-picker.ql-expanded .ql-picker-options{z-index:1}.ql-editor .ql-table{display:table;border-collapse:collapse;table-layout:fixed;width:auto}.ql-editor .ql-table[data-full]{width:100%}.ql-editor .ql-table-wrapper{width:100%;overflow:auto;scrollbar-width:none}.ql-editor .ql-table-cell{padding:8px 12px;border-color:transparent;font-size:14px;outline:0;overflow:auto}.ql-editor .ql-table-cell-inner{display:inline-block;min-width:100%;word-break:break-word;outline:0}.ql-editor .ql-table col{border-collapse:separate;text-indent:initial;display:table-column;table-layout:fixed}.ql-editor .ql-table tr+tr td{border-top:none}.ql-editor .ql-table td{border:1px solid #a1a1aa}.ql-editor .ql-table td+td{border-left:none}.table-up-toolbox{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.table-up-toolbox *{pointer-events:all}.table-up-tooltip{position:absolute;z-index:20;padding:.25rem .75rem;border-radius:.25rem;font-size:.75rem;color:#fff;white-space:nowrap;background-color:#303133;transition:opacity .15s linear}.table-up-tooltip.transparent{opacity:0}.table-up-tooltip.hidden{display:none}.table-up-button{--table-btn-color:#606266;--table-btn-bg-hover:#f3f4f6;--table-btn-color-border:#dcdfe6;--table-btn-border:0.0625rem solid var(--table-btn-color-border);--table-btn-confirm-color-border:#409eff;--table-btn-confirm-bg:#409eff;--table-btn-confirm-hover:#79bbff;--table-btn-confirm-outline-focus-visible:0.125rem solid #a0cfff;box-sizing:border-box;display:inline-flex;height:2rem;line-height:1;margin:0;padding:.5rem 1rem;border-radius:.25rem;border:var(--table-btn-border);color:var(--table-btn-color);background-color:transparent;font-size:.875rem;cursor:pointer}.table-up-button+.table-up-button{margin-left:.375rem}.table-up-button:hover{background-color:var(--table-btn-bg-hover)}.table-up-button.confirm{border-color:var(--table-btn-confirm-color-border);background-color:var(--table-btn-confirm-bg);color:#fff}.table-up-button.confirm:hover{border-color:var(--table-btn-confirm-hover);background-color:var(--table-btn-confirm-hover)}.table-up-button.confirm:focus-visible{outline:var(--table-btn-confirm-outline-focus-visible);outline-offset:.0625rem}.table-up-dialog{--dialog-bg:rgba(0, 0, 0, 0.5);--dialog-color-border:#ebeef5;--dialog-color-boxshadow:rgba(0, 0, 0, 0.12);--dialog-border:0.0625rem solid var(--dialog-color-border);--dialog-boxshadow:0 0 0.75rem var(--dialog-color-boxshadow);position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;height:100%;background-color:var(--dialog-bg);overflow:auto}.table-up-dialog__overlay{position:fixed;top:0;right:0;bottom:0;left:0;padding:1rem;overflow:auto;text-align:center}.table-up-dialog__overlay::after{content:'';display:inline-block;height:100%;width:0;vertical-align:middle}.table-up-dialog__content{display:inline-block;max-width:50vw;width:100%;vertical-align:middle;background-color:#fff;border-radius:.25rem;border:var(--dialog-border);font-size:1.125rem;box-shadow:var(--dialog-boxshadow);text-align:left;overflow:hidden;box-sizing:border-box}.table-up-color-picker{--color-picker-bg-color:#ffffff;box-sizing:border-box;display:inline-flex;flex-direction:column;width:16.75rem;padding:.5rem;border-radius:.375rem;background:var(--color-picker-bg-color);box-shadow:0 0 .375rem #b2b5b8}.table-up-color-picker__content{box-sizing:border-box;width:100%;height:11.75rem;padding-top:.5rem}.table-up-color-picker__selector{width:14.375rem;height:9.375rem;position:absolute}.table-up-color-picker__background{width:100%;height:100%;background:linear-gradient(to top,#000 0,rgba(0,0,0,0) 100%),linear-gradient(to right,#fff 0,rgba(255,255,255,0) 100%)}.table-up-color-picker__background-handle{box-sizing:border-box;position:absolute;border:.0625rem solid #fff;cursor:pointer;top:0;left:14.375rem;border-radius:100%;width:.625rem;height:.625rem;transform:translate(-.3125rem,-.3125rem)}.table-up-color-picker__hue{width:.75rem;height:9.375rem;margin-left:15rem;position:absolute;background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.table-up-color-picker__hue-handle{box-sizing:border-box;position:absolute;border:.0625rem solid #fff;cursor:pointer;background-color:#fff;box-shadow:0 0 .125rem #0009;left:0;width:1rem;height:.625rem;transform:translate(-.125rem,-.3125rem)}.table-up-color-picker__alpha{width:14.375rem;height:.75rem;position:absolute;margin-top:10rem;background:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(135deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(135deg,transparent 75%,#ccc 75%);background-size:.75rem .75rem;background-position:0 0,.375rem 0,.375rem -.375rem,0 .375rem}.table-up-color-picker__alpha-bg{position:relative;height:100%;background:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 100%)}.table-up-color-picker__alpha-handle{box-sizing:border-box;position:absolute;border:.0625rem solid #fff;cursor:pointer;background-color:#fff;box-shadow:0 0 .125rem #0009;top:0;width:.625rem;height:1rem;transform:translate(-.3125rem,-.125rem)}.table-up-color-picker__action{box-sizing:border-box;display:flex;align-items:center;gap:.375rem;width:100%;padding-top:.5rem;border-top:.0625rem solid #e9ecef}.table-up-color-picker__action-item{flex:1;display:inline-flex;align-items:center;font-size:.75rem}.table-up-color-picker__input{box-sizing:border-box;width:100%;height:1.375rem;margin-left:.125rem;padding:.125rem 0 .125rem .25rem;background-color:#fff;border:.0625rem solid #ced4da;border-radius:.25rem;outline:0;color:#405057}.table-up-tooltip .table-up-color-picker{--color-picker-bg-color:transparent;box-shadow:none;width:15.75rem;padding:.5rem 0}.ql-container .table-up-selection{--select-color:#0589f340;display:none;position:absolute;overflow:hidden;pointer-events:none}.ql-container .table-up-selection__line{position:absolute;background-color:var(--select-color);pointer-events:none}.table-up-resize-line__col,.table-up-resize-line__row{position:absolute;z-index:0}.table-up-resize-line__col.is-hidden,.table-up-resize-line__row.is-hidden{display:none}.table-up-resize-line__col::after,.table-up-resize-line__col::before,.table-up-resize-line__row::after,.table-up-resize-line__row::before{content:'';display:block;position:absolute;top:0;z-index:1}.table-up-resize-line__row{height:.0625rem;cursor:ns-resize}.table-up-resize-line__row::after,.table-up-resize-line__row::before{width:100%;height:.5rem}.table-up-resize-line__row::before{transform:translateY(-.5rem)}.table-up-resize-line__col{width:.0625rem;cursor:ew-resize}.table-up-resize-line__col::after,.table-up-resize-line__col::before{height:100%;width:.5rem}.table-up-resize-line__col::before{transform:translateX(-.5rem)}.table-up-resize-box{position:absolute;z-index:0}.table-up-resize-box.is-hidden{display:none}.table-up-resize-box.is-align-right .table-up-resize-box__col-separator{left:-.125rem}.table-up-resize-box.is-align-right .table-up-resize-box__corner{border-left-width:.0625rem;border-right-width:.0625rem;border-top-left-radius:0;border-top-right-radius:50%}.table-up-resize-box__col,.table-up-resize-box__row{position:absolute;top:0;left:0;overflow:hidden}.table-up-resize-box__col-wrapper,.table-up-resize-box__row-wrapper{display:flex}.table-up-resize-box__col-header,.table-up-resize-box__row-header{position:relative;flex-shrink:0;background-color:#f3f4f5;border:.0625rem solid #ccc}.table-up-resize-box__col-wrapper{height:100%}.table-up-resize-box__col-header{height:100%;cursor:pointer;border-right-color:transparent}.table-up-resize-box__col-header:last-child{border-right-color:#ccc}.table-up-resize-box__col-separator{position:absolute;top:0;bottom:0;right:-.125rem;width:.125rem;cursor:ew-resize;z-index:0}.table-up-resize-box__col-separator::after{right:-.375rem}.table-up-resize-box__col-separator::before{left:-.375rem}.table-up-resize-box__col-separator::after,.table-up-resize-box__col-separator::before{content:'';position:absolute;top:0;display:block;width:.5rem;height:100%;z-index:1}.table-up-resize-box__row-wrapper{flex-direction:column;width:100%}.table-up-resize-box__row-header{width:100%;cursor:pointer;border-bottom-color:transparent}.table-up-resize-box__row-header:last-child{border-bottom-color:#ccc}.table-up-resize-box__row-separator{position:absolute;left:0;right:0;bottom:-.125rem;height:.125rem;cursor:ns-resize;z-index:0}.table-up-resize-box__row-separator::after{bottom:-.375rem}.table-up-resize-box__row-separator::before{top:-.375rem}.table-up-resize-box__row-separator::after,.table-up-resize-box__row-separator::before{content:'';position:absolute;left:0;display:block;width:100%;height:.5rem;z-index:1}.table-up-resize-box__corner{position:absolute;top:0;left:0;background-color:#f3f4f5;border:.0625rem solid #ccc;border-right-width:0;border-bottom-width:0;border-top-left-radius:50%;cursor:pointer}.table-up-drag-line{position:fixed;z-index:0;background-color:#409eff}.table-up-drag-line.is-col{width:.125rem;cursor:ew-resize}.table-up-drag-line.is-row{height:.125rem;cursor:ns-resize}.table-up-scale{position:absolute;top:0;left:0;overflow:hidden;pointer-events:none}.table-up-scale__block{position:absolute;top:0;left:0;transform:translate(-100%,-100%);width:.75rem;height:.75rem;background-color:#f1f5f9;border:.0625rem solid grey;cursor:nwse-resize;pointer-events:all}.table-up-scale.is-align-right .table-up-scale__block{cursor:nesw-resize}.table-up-scale.is-hidden{display:none}.table-up-scrollbar{position:absolute;z-index:1;transition:opacity .15s linear}.table-up-scrollbar__container{position:relative}.table-up-scrollbar.is-transparent{opacity:0}.table-up-scrollbar.is-vertical{top:.125rem;bottom:.125rem;left:-.5rem;width:.375rem}.table-up-scrollbar.is-vertical .table-up-scrollbar__thumb{width:100%}.table-up-scrollbar.is-horizontal{bottom:.125rem;left:.125rem;right:.125rem;height:.375rem}.table-up-scrollbar.is-horizontal .table-up-scrollbar__thumb{height:100%}.table-up-scrollbar__thumb{border-radius:.3125rem;background-color:#d2d2d2;cursor:pointer}.table-up-scrollbar__thumb:hover{background-color:#a1a1aa}.table-up-scrollbar--origin.ql-container .ql-table-wrapper{scrollbar-width:inherit}.table-up-align,.table-up-menu{position:absolute;z-index:1;display:none;align-items:center;padding:.25rem;border-radius:.375rem;box-shadow:0 0 .5rem rgba(0,0,0,.5);background-color:#fff;font-size:.875rem}.table-up-align__item,.table-up-menu__item{position:relative;display:inline-flex;align-items:center;justify-content:center;padding:.25rem;border-radius:.25rem;cursor:pointer}.table-up-align__item:hover,.table-up-menu__item:hover{background-color:#eee}.table-up-align__item.is-break,.table-up-menu__item.is-break{align-self:stretch;width:.0625rem;padding:0;margin:.125rem .25rem;background-color:#a3a3a3;cursor:default}.table-up-align .icon,.table-up-menu .icon{display:flex;flex-shrink:0;font-size:1.25rem}.table-up-align span,.table-up-menu span{text-wrap:nowrap}.table-up-menu.is-contextmenu{flex-direction:column;padding:.25rem .5rem;max-height:21.875rem;overflow-y:auto;overflow-x:hidden}.table-up-menu.is-contextmenu .table-up-menu__item{display:flex;justify-content:flex-start;width:100%;gap:.25rem;cursor:pointer}.table-up-menu.is-contextmenu .is-break{width:100%;height:.0625rem;flex-shrink:0;margin:.25rem 0;background-color:#a3a3a3}.table-up-align--active{display:flex}.table-up-align .icon{width:1.25rem;height:1.25rem}.table-up-color-map{display:flex;flex-direction:column}.table-up-color-map--used{display:flex;align-items:center;justify-content:center;flex-direction:row-reverse;margin-top:.25rem;padding-top:.25rem;border-top:.0625rem solid #ccc}.table-up-color-map__content{display:flex;flex-direction:column}.table-up-color-map__content-row{display:flex;align-items:center;justify-content:center;gap:.25rem}.table-up-color-map__item{width:.875rem;height:.875rem;margin:.125rem;border:.0625rem solid #a3a3a3;cursor:pointer}.table-up-color-map__btn{display:flex;align-items:center;justify-content:center;flex:1;height:1.25rem;padding:0 .375rem;color:#303133;background-color:#fff;cursor:pointer}.table-up-color-map__btn:hover{background-color:#edeeef}
|
|
1
|
+
.ql-toolbar .ql-picker:not(.ql-color-picker):not(.ql-icon-picker).ql-table-up{width:28px}.ql-toolbar .ql-picker:not(.ql-color-picker):not(.ql-icon-picker).ql-table-up .ql-picker-label{padding:2px 4px}.ql-toolbar .ql-picker:not(.ql-color-picker):not(.ql-icon-picker).ql-table-up .ql-picker-label svg{position:static;margin-top:0}.ql-toolbar .ql-picker.ql-expanded .ql-picker-options{z-index:1}.ql-editor .ql-table{display:table;border-collapse:collapse;table-layout:fixed;width:auto}.ql-editor .ql-table[data-full]{width:100%}.ql-editor .ql-table-wrapper{width:100%;overflow:auto;scrollbar-width:none}.ql-editor .ql-table-caption{position:relative;word-break:break-word;outline:0}.ql-editor .ql-table-caption .ql-table-caption--switch{display:flex;align-items:center;justify-content:center;padding:2px;border-radius:4px;border:1px solid #0003;font-size:12px;cursor:pointer;background-color:#fff}.ql-editor .ql-table-caption .ql-table-caption--switch:hover{background-color:#eee}.ql-editor .ql-table-cell{padding:8px 12px;border-color:transparent;font-size:14px;outline:0;overflow:auto}.ql-editor .ql-table-cell-inner{display:inline-block;min-width:100%;word-break:break-word;outline:0}.ql-editor .ql-table col{border-collapse:separate;text-indent:initial;display:table-column;table-layout:fixed}.ql-editor .ql-table tr+tr td{border-top:none}.ql-editor .ql-table td{border:1px solid #a1a1aa}.ql-editor .ql-table td+td{border-left:none}.table-up-toolbox{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.table-up-toolbox *{pointer-events:all}.table-up-tooltip{position:absolute;z-index:20;padding:.25rem .75rem;border-radius:.25rem;font-size:.75rem;color:#fff;white-space:nowrap;background-color:#303133;transition:opacity .15s linear}.table-up-tooltip.transparent{opacity:0}.table-up-tooltip.hidden{display:none}.table-up-button{--table-btn-color:#606266;--table-btn-bg-hover:#f3f4f6;--table-btn-color-border:#dcdfe6;--table-btn-border:0.0625rem solid var(--table-btn-color-border);--table-btn-confirm-color-border:#409eff;--table-btn-confirm-bg:#409eff;--table-btn-confirm-hover:#79bbff;--table-btn-confirm-outline-focus-visible:0.125rem solid #a0cfff;box-sizing:border-box;display:inline-flex;height:2rem;line-height:1;margin:0;padding:.5rem 1rem;border-radius:.25rem;border:var(--table-btn-border);color:var(--table-btn-color);background-color:transparent;font-size:.875rem;cursor:pointer}.table-up-button+.table-up-button{margin-left:.375rem}.table-up-button:hover{background-color:var(--table-btn-bg-hover)}.table-up-button.confirm{border-color:var(--table-btn-confirm-color-border);background-color:var(--table-btn-confirm-bg);color:#fff}.table-up-button.confirm:hover{border-color:var(--table-btn-confirm-hover);background-color:var(--table-btn-confirm-hover)}.table-up-button.confirm:focus-visible{outline:var(--table-btn-confirm-outline-focus-visible);outline-offset:.0625rem}.table-up-dialog{--dialog-bg:rgba(0, 0, 0, 0.5);--dialog-color-border:#ebeef5;--dialog-color-boxshadow:rgba(0, 0, 0, 0.12);--dialog-border:0.0625rem solid var(--dialog-color-border);--dialog-boxshadow:0 0 0.75rem var(--dialog-color-boxshadow);position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;height:100%;background-color:var(--dialog-bg);overflow:auto}.table-up-dialog__overlay{position:fixed;top:0;right:0;bottom:0;left:0;padding:1rem;overflow:auto;text-align:center}.table-up-dialog__overlay::after{content:'';display:inline-block;height:100%;width:0;vertical-align:middle}.table-up-dialog__content{display:inline-block;max-width:50vw;width:100%;vertical-align:middle;background-color:#fff;border-radius:.25rem;border:var(--dialog-border);font-size:1.125rem;box-shadow:var(--dialog-boxshadow);text-align:left;overflow:hidden;box-sizing:border-box}.table-up-color-picker{--color-picker-bg-color:#ffffff;box-sizing:border-box;display:inline-flex;flex-direction:column;width:16.75rem;padding:.5rem;border-radius:.375rem;background:var(--color-picker-bg-color);box-shadow:0 0 .375rem #b2b5b8}.table-up-color-picker__content{box-sizing:border-box;width:100%;height:11.75rem;padding-top:.5rem}.table-up-color-picker__selector{width:14.375rem;height:9.375rem;position:absolute}.table-up-color-picker__background{width:100%;height:100%;background:linear-gradient(to top,#000 0,rgba(0,0,0,0) 100%),linear-gradient(to right,#fff 0,rgba(255,255,255,0) 100%)}.table-up-color-picker__background-handle{box-sizing:border-box;position:absolute;border:.0625rem solid #fff;cursor:pointer;top:0;left:14.375rem;border-radius:100%;width:.625rem;height:.625rem;transform:translate(-.3125rem,-.3125rem)}.table-up-color-picker__hue{width:.75rem;height:9.375rem;margin-left:15rem;position:absolute;background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.table-up-color-picker__hue-handle{box-sizing:border-box;position:absolute;border:.0625rem solid #fff;cursor:pointer;background-color:#fff;box-shadow:0 0 .125rem #0009;left:0;width:1rem;height:.625rem;transform:translate(-.125rem,-.3125rem)}.table-up-color-picker__alpha{width:14.375rem;height:.75rem;position:absolute;margin-top:10rem;background:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(135deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(135deg,transparent 75%,#ccc 75%);background-size:.75rem .75rem;background-position:0 0,.375rem 0,.375rem -.375rem,0 .375rem}.table-up-color-picker__alpha-bg{position:relative;height:100%;background:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 100%)}.table-up-color-picker__alpha-handle{box-sizing:border-box;position:absolute;border:.0625rem solid #fff;cursor:pointer;background-color:#fff;box-shadow:0 0 .125rem #0009;top:0;width:.625rem;height:1rem;transform:translate(-.3125rem,-.125rem)}.table-up-color-picker__action{box-sizing:border-box;display:flex;align-items:center;gap:.375rem;width:100%;padding-top:.5rem;border-top:.0625rem solid #e9ecef}.table-up-color-picker__action-item{flex:1;display:inline-flex;align-items:center;font-size:.75rem}.table-up-color-picker__input{box-sizing:border-box;width:100%;height:1.375rem;margin-left:.125rem;padding:.125rem 0 .125rem .25rem;background-color:#fff;border:.0625rem solid #ced4da;border-radius:.25rem;outline:0;color:#405057}.table-up-tooltip .table-up-color-picker{--color-picker-bg-color:transparent;box-shadow:none;width:15.75rem;padding:.5rem 0}.ql-container .table-up-selection{--select-color:#0589f340;display:none;position:absolute;overflow:hidden;pointer-events:none}.ql-container .table-up-selection__line{position:absolute;background-color:var(--select-color);pointer-events:none}.table-up-resize-line__col,.table-up-resize-line__row{position:absolute;z-index:0}.table-up-resize-line__col.is-hidden,.table-up-resize-line__row.is-hidden{display:none}.table-up-resize-line__col::after,.table-up-resize-line__col::before,.table-up-resize-line__row::after,.table-up-resize-line__row::before{content:'';display:block;position:absolute;top:0;z-index:1}.table-up-resize-line__row{height:.0625rem;cursor:ns-resize}.table-up-resize-line__row::after,.table-up-resize-line__row::before{width:100%;height:.5rem}.table-up-resize-line__row::before{transform:translateY(-.5rem)}.table-up-resize-line__col{width:.0625rem;cursor:ew-resize}.table-up-resize-line__col::after,.table-up-resize-line__col::before{height:100%;width:.5rem}.table-up-resize-line__col::before{transform:translateX(-.5rem)}.table-up-resize-box{position:absolute;z-index:0}.table-up-resize-box.is-hidden{display:none}.table-up-resize-box.is-caption-bottom .table-up-resize-box__corner{border-top-width:0;border-bottom-width:.0625rem;border-top-left-radius:0;border-bottom-left-radius:50%}.table-up-resize-box.is-align-right .table-up-resize-box__col-separator{left:-.125rem}.table-up-resize-box.is-align-right .table-up-resize-box__corner{border-left-width:0;border-right-width:.0625rem;border-top-left-radius:0;border-top-right-radius:50%}.table-up-resize-box.is-align-right.is-caption-bottom .table-up-resize-box__corner{border-top-right-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:50%}.table-up-resize-box__col,.table-up-resize-box__row{position:absolute;top:0;left:0;overflow:hidden}.table-up-resize-box__col-wrapper,.table-up-resize-box__row-wrapper{display:flex}.table-up-resize-box__col-header,.table-up-resize-box__row-header{position:relative;flex-shrink:0;background-color:#f3f4f5;border:.0625rem solid #ccc}.table-up-resize-box__col-wrapper{height:100%}.table-up-resize-box__col-header{height:100%;cursor:pointer;border-right-color:transparent}.table-up-resize-box__col-header:last-child{border-right-color:#ccc}.table-up-resize-box__col-separator{position:absolute;top:0;bottom:0;right:-.125rem;width:.125rem;cursor:ew-resize;z-index:0}.table-up-resize-box__col-separator::after{right:-.375rem}.table-up-resize-box__col-separator::before{left:-.375rem}.table-up-resize-box__col-separator::after,.table-up-resize-box__col-separator::before{content:'';position:absolute;top:0;display:block;width:.5rem;height:100%;z-index:1}.table-up-resize-box__row-wrapper{flex-direction:column;width:100%}.table-up-resize-box__row-header{width:100%;cursor:pointer;border-bottom-color:transparent}.table-up-resize-box__row-header:last-child{border-bottom-color:#ccc}.table-up-resize-box__row-separator{position:absolute;left:0;right:0;bottom:-.125rem;height:.125rem;cursor:ns-resize;z-index:0}.table-up-resize-box__row-separator::after{bottom:-.375rem}.table-up-resize-box__row-separator::before{top:-.375rem}.table-up-resize-box__row-separator::after,.table-up-resize-box__row-separator::before{content:'';position:absolute;left:0;display:block;width:100%;height:.5rem;z-index:1}.table-up-resize-box__corner{position:absolute;top:0;left:0;background-color:#f3f4f5;border:.0625rem solid #ccc;border-right-width:0;border-bottom-width:0;border-top-left-radius:50%;cursor:pointer}.table-up-drag-line{position:fixed;z-index:0;background-color:#409eff}.table-up-drag-line.is-col{width:.125rem;cursor:ew-resize}.table-up-drag-line.is-row{height:.125rem;cursor:ns-resize}.table-up-scale{position:absolute;top:0;left:0;overflow:hidden;pointer-events:none}.table-up-scale__block{position:absolute;top:0;left:0;transform:translate(-100%,-100%);width:.75rem;height:.75rem;background-color:#f1f5f9;border:.0625rem solid grey;cursor:nwse-resize;pointer-events:all}.table-up-scale.is-align-right .table-up-scale__block{cursor:nesw-resize}.table-up-scale.is-hidden{display:none}.table-up-scrollbar{position:absolute;z-index:1;transition:opacity .15s linear}.table-up-scrollbar__container{position:relative}.table-up-scrollbar.is-transparent{opacity:0}.table-up-scrollbar.is-vertical{top:.125rem;bottom:.125rem;left:-.5rem;width:.375rem}.table-up-scrollbar.is-vertical .table-up-scrollbar__thumb{width:100%}.table-up-scrollbar.is-horizontal{bottom:.125rem;left:.125rem;right:.125rem;height:.375rem}.table-up-scrollbar.is-horizontal .table-up-scrollbar__thumb{height:100%}.table-up-scrollbar__thumb{border-radius:.3125rem;background-color:#d2d2d2;cursor:pointer}.table-up-scrollbar__thumb:hover{background-color:#a1a1aa}.table-up-scrollbar--origin.ql-container .ql-table-wrapper{scrollbar-width:inherit}.table-up-align,.table-up-menu{position:absolute;z-index:1;display:none;align-items:center;padding:.25rem;border-radius:.375rem;box-shadow:0 0 .5rem rgba(0,0,0,.5);background-color:#fff;font-size:.875rem}.table-up-align__item,.table-up-menu__item{position:relative;display:inline-flex;align-items:center;justify-content:center;padding:.25rem;border-radius:.25rem;cursor:pointer}.table-up-align__item:hover,.table-up-menu__item:hover{background-color:#eee}.table-up-align__item.is-break,.table-up-menu__item.is-break{align-self:stretch;width:.0625rem;padding:0;margin:.125rem .25rem;background-color:#a3a3a3;cursor:default}.table-up-align .icon,.table-up-menu .icon{display:flex;flex-shrink:0;font-size:1.25rem}.table-up-align span,.table-up-menu span{text-wrap:nowrap}.table-up-menu.is-contextmenu{flex-direction:column;padding:.25rem .5rem;max-height:21.875rem;overflow-y:auto;overflow-x:hidden}.table-up-menu.is-contextmenu .table-up-menu__item{display:flex;justify-content:flex-start;width:100%;gap:.25rem;cursor:pointer}.table-up-menu.is-contextmenu .is-break{width:100%;height:.0625rem;flex-shrink:0;margin:.25rem 0;background-color:#a3a3a3}.table-up-align--active{display:flex}.table-up-align .icon{width:1.25rem;height:1.25rem}.table-up-color-map{display:flex;flex-direction:column}.table-up-color-map--used{display:flex;align-items:center;justify-content:center;flex-direction:row-reverse;margin-top:.25rem;padding-top:.25rem;border-top:.0625rem solid #ccc}.table-up-color-map__content{display:flex;flex-direction:column}.table-up-color-map__content-row{display:flex;align-items:center;justify-content:center;gap:.25rem}.table-up-color-map__item{width:.875rem;height:.875rem;margin:.125rem;border:.0625rem solid #a3a3a3;cursor:pointer}.table-up-color-map__btn{display:flex;align-items:center;justify-content:center;flex:1;height:1.25rem;padding:0 .375rem;color:#303133;background-color:#fff;cursor:pointer}.table-up-color-map__btn:hover{background-color:#edeeef}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import TypeScroll from 'quill/blots/scroll';
|
|
|
4
4
|
import BaseTheme from 'quill/themes/base';
|
|
5
5
|
import Picker from 'quill/ui/picker';
|
|
6
6
|
import TypeBlock, { BlockEmbed as BlockEmbed$1 } from 'quill/blots/block';
|
|
7
|
+
import TypeInline from 'quill/blots/inline';
|
|
8
|
+
import TypeText from 'quill/blots/text';
|
|
7
9
|
import { Delta } from 'quill/core';
|
|
8
10
|
import TypeClipboard from 'quill/modules/clipboard';
|
|
9
11
|
|
|
@@ -39,6 +41,7 @@ declare class TableCellFormat extends ContainerFormat {
|
|
|
39
41
|
static formats(domNode: HTMLElement): Record<string, any>;
|
|
40
42
|
setFormatValue(name: string, value?: any): void;
|
|
41
43
|
setStyleBoder(name: string, value?: any): void;
|
|
44
|
+
getNearByCell(direction: 'left' | 'top'): TableCellFormat[];
|
|
42
45
|
get tableId(): string;
|
|
43
46
|
get rowId(): string;
|
|
44
47
|
get colId(): string;
|
|
@@ -97,16 +100,32 @@ declare class TableBodyFormat extends ContainerFormat {
|
|
|
97
100
|
optimize(context: Record<string, any>): void;
|
|
98
101
|
}
|
|
99
102
|
|
|
103
|
+
declare class TableCaptionFormat extends BlockOverride {
|
|
104
|
+
static blotName: "table-up-caption";
|
|
105
|
+
static tagName: string;
|
|
106
|
+
static className: string;
|
|
107
|
+
static allowedChildren: (typeof TypeInline | typeof TypeText)[];
|
|
108
|
+
static create(value: TableCaptionValue): HTMLElement;
|
|
109
|
+
static formats(domNode: HTMLElement): TableCaptionValue;
|
|
110
|
+
scroll: TypeScroll;
|
|
111
|
+
uiNode: HTMLElement;
|
|
112
|
+
constructor(scroll: TypeScroll, domNode: HTMLElement, _value: TableCaptionValue);
|
|
113
|
+
createUI(): HTMLElement;
|
|
114
|
+
get tableId(): string;
|
|
115
|
+
set side(value: TableCaptionValue['side']);
|
|
116
|
+
get side(): TableCaptionValue["side"];
|
|
117
|
+
format(name: string, value: any): void;
|
|
118
|
+
checkMerge(): boolean;
|
|
119
|
+
optimize(context: Record<string, any>): void;
|
|
120
|
+
}
|
|
121
|
+
|
|
100
122
|
declare const BlockEmbed: typeof BlockEmbed$1;
|
|
101
123
|
declare class TableColFormat extends BlockEmbed {
|
|
102
|
-
scroll: Parchment.Root;
|
|
103
|
-
domNode: HTMLElement;
|
|
104
124
|
static blotName: "table-up-col";
|
|
105
125
|
static tagName: string;
|
|
106
126
|
static validWidth(width: string | number, full: boolean): string;
|
|
107
127
|
static create(value: TableColValue): HTMLElement;
|
|
108
128
|
static value(domNode: HTMLElement): Record<string, any>;
|
|
109
|
-
constructor(scroll: Parchment.Root, domNode: HTMLElement);
|
|
110
129
|
get width(): number;
|
|
111
130
|
set width(value: string | number);
|
|
112
131
|
get tableId(): string;
|
|
@@ -197,6 +216,7 @@ declare class TableWrapperFormat extends ContainerFormat {
|
|
|
197
216
|
|
|
198
217
|
declare const blotName: {
|
|
199
218
|
readonly container: "table-up-container";
|
|
219
|
+
readonly tableCaption: "table-up-caption";
|
|
200
220
|
readonly tableWrapper: "table-up";
|
|
201
221
|
readonly tableMain: "table-up-main";
|
|
202
222
|
readonly tableColgroup: "table-up-colgroup";
|
|
@@ -276,6 +296,7 @@ declare class TableClipboard extends Clipboard {
|
|
|
276
296
|
html?: string;
|
|
277
297
|
text?: string;
|
|
278
298
|
}, formats?: Record<string, unknown>): Delta;
|
|
299
|
+
matchCaption(node: Node, delta: Delta): Delta;
|
|
279
300
|
}
|
|
280
301
|
|
|
281
302
|
declare const tableMenuTools: Record<string, Tool>;
|
|
@@ -422,10 +443,6 @@ declare class TableResizeCommon {
|
|
|
422
443
|
destroy(): void;
|
|
423
444
|
}
|
|
424
445
|
|
|
425
|
-
interface Point {
|
|
426
|
-
x: number;
|
|
427
|
-
y: number;
|
|
428
|
-
}
|
|
429
446
|
declare class TableResizeBox extends TableResizeCommon {
|
|
430
447
|
tableModule: TableUp;
|
|
431
448
|
table: HTMLElement;
|
|
@@ -439,7 +456,10 @@ declare class TableResizeBox extends TableResizeCommon {
|
|
|
439
456
|
colHeadWrapper: HTMLElement | null;
|
|
440
457
|
corner: HTMLElement | null;
|
|
441
458
|
scrollHandler: [HTMLElement, (e: Event) => void][];
|
|
442
|
-
lastHeaderSelect:
|
|
459
|
+
lastHeaderSelect: {
|
|
460
|
+
isX: boolean;
|
|
461
|
+
index: number;
|
|
462
|
+
} | null;
|
|
443
463
|
size: number;
|
|
444
464
|
bem: {
|
|
445
465
|
b: () => string;
|
|
@@ -453,7 +473,7 @@ declare class TableResizeBox extends TableResizeCommon {
|
|
|
453
473
|
};
|
|
454
474
|
constructor(tableModule: TableUp, table: HTMLElement, quill: Quill);
|
|
455
475
|
updateWhenTextChange: () => void;
|
|
456
|
-
handleResizerHeader(isX: boolean, e: MouseEvent): void;
|
|
476
|
+
handleResizerHeader(isX: boolean, index: number, e: MouseEvent): void;
|
|
457
477
|
findCurrentColIndex(e: MouseEvent): number;
|
|
458
478
|
colWidthChange(i: number, w: sizeChangeValue, isFull: boolean): void;
|
|
459
479
|
handleColMouseDownFunc: (e: MouseEvent) => {
|
|
@@ -531,6 +551,7 @@ declare class TableResizeScale {
|
|
|
531
551
|
};
|
|
532
552
|
startX: number;
|
|
533
553
|
startY: number;
|
|
554
|
+
offset: number;
|
|
534
555
|
options: TableResizeScaleOptions;
|
|
535
556
|
root?: HTMLElement;
|
|
536
557
|
block?: HTMLElement;
|
|
@@ -542,7 +563,7 @@ declare class TableResizeScale {
|
|
|
542
563
|
} & Partial<TableResizeScaleOptions>;
|
|
543
564
|
buildResizer(): void;
|
|
544
565
|
isTableOutofEditor(): boolean;
|
|
545
|
-
update():
|
|
566
|
+
update(): void;
|
|
546
567
|
show(): void;
|
|
547
568
|
hide(): void;
|
|
548
569
|
destroy(): void;
|
|
@@ -601,6 +622,7 @@ declare class Scrollbar {
|
|
|
601
622
|
cv: (v?: string) => string;
|
|
602
623
|
is: (n: string) => string;
|
|
603
624
|
};
|
|
625
|
+
tableMainBlot: TableMainFormat;
|
|
604
626
|
constructor(quill: Quill, isVertical: boolean, table: HTMLElement, scrollbarContainer: HTMLElement);
|
|
605
627
|
update(): void;
|
|
606
628
|
setScrollbarPosition(): void;
|
|
@@ -790,7 +812,7 @@ interface TableUpOptions {
|
|
|
790
812
|
interface TableColValue {
|
|
791
813
|
tableId: string;
|
|
792
814
|
colId: string;
|
|
793
|
-
width:
|
|
815
|
+
width: number;
|
|
794
816
|
full?: boolean;
|
|
795
817
|
align?: string;
|
|
796
818
|
}
|
|
@@ -806,6 +828,10 @@ interface TableRowValue {
|
|
|
806
828
|
tableId: string;
|
|
807
829
|
rowId: string;
|
|
808
830
|
}
|
|
831
|
+
interface TableCaptionValue {
|
|
832
|
+
tableId: string;
|
|
833
|
+
side: 'top' | 'bottom';
|
|
834
|
+
}
|
|
809
835
|
interface TableValue {
|
|
810
836
|
tableId: string;
|
|
811
837
|
full?: boolean;
|
|
@@ -881,7 +907,7 @@ interface ColorPickerOptions {
|
|
|
881
907
|
color: string;
|
|
882
908
|
onChange: (color: string) => void;
|
|
883
909
|
}
|
|
884
|
-
declare
|
|
910
|
+
declare function createColorPicker(options?: Partial<ColorPickerOptions>): HTMLDivElement;
|
|
885
911
|
|
|
886
912
|
interface TableSelectOptions {
|
|
887
913
|
row: number;
|
|
@@ -890,7 +916,7 @@ interface TableSelectOptions {
|
|
|
890
916
|
customBtn: boolean;
|
|
891
917
|
texts: Partial<TableCreatorTextOptions>;
|
|
892
918
|
}
|
|
893
|
-
declare
|
|
919
|
+
declare function createSelectBox(options?: Partial<TableSelectOptions>): HTMLDivElement;
|
|
894
920
|
|
|
895
921
|
interface ToolTipOptions {
|
|
896
922
|
direction?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end';
|
|
@@ -909,7 +935,7 @@ interface TooltipInstance {
|
|
|
909
935
|
show: (force?: boolean) => void;
|
|
910
936
|
hide: (force?: boolean) => void;
|
|
911
937
|
}
|
|
912
|
-
declare
|
|
938
|
+
declare function createTooltip(target: HTMLElement, options?: ToolTipOptions): TooltipInstance | null;
|
|
913
939
|
|
|
914
940
|
declare const randomId: () => string;
|
|
915
941
|
|
|
@@ -937,23 +963,32 @@ declare class TableUp {
|
|
|
937
963
|
}, range: Range, context: Context): boolean;
|
|
938
964
|
};
|
|
939
965
|
'table up': {
|
|
966
|
+
bindInHead: boolean;
|
|
940
967
|
key: string;
|
|
941
968
|
collapsed: boolean;
|
|
942
969
|
format: "table-up-cell-inner"[];
|
|
943
|
-
bindInHead: boolean;
|
|
944
970
|
handler(this: {
|
|
945
971
|
quill: Quill;
|
|
946
972
|
}, range: Range, context: Context): boolean;
|
|
947
973
|
};
|
|
948
974
|
'table down': {
|
|
975
|
+
bindInHead: boolean;
|
|
949
976
|
key: string;
|
|
950
977
|
collapsed: boolean;
|
|
951
978
|
format: "table-up-cell-inner"[];
|
|
952
|
-
bindInHead: boolean;
|
|
953
979
|
handler(this: {
|
|
954
980
|
quill: Quill;
|
|
955
981
|
}, range: Range, context: Context): boolean;
|
|
956
982
|
};
|
|
983
|
+
'table caption break': {
|
|
984
|
+
bindInHead: boolean;
|
|
985
|
+
key: string;
|
|
986
|
+
shiftKey: null;
|
|
987
|
+
format: "table-up-caption"[];
|
|
988
|
+
handler(this: {
|
|
989
|
+
quill: Quill;
|
|
990
|
+
}, _range: Range, _context: Context): boolean;
|
|
991
|
+
};
|
|
957
992
|
};
|
|
958
993
|
static register(): void;
|
|
959
994
|
quill: Quill;
|
|
@@ -1022,4 +1057,5 @@ declare class TableUp {
|
|
|
1022
1057
|
splitCell(selectedTds: TableCellInnerFormat[]): void;
|
|
1023
1058
|
}
|
|
1024
1059
|
|
|
1025
|
-
export { BlockOverride,
|
|
1060
|
+
export { BlockOverride, ContainerFormat, ScrollOverride, Scrollbar, TableAlign, TableBodyFormat, TableCaptionFormat, TableCellFormat, TableCellInnerFormat, TableClipboard, TableColFormat, TableColgroupFormat, TableMainFormat, TableMenuCommon, TableMenuContextmenu, TableMenuSelect, TableResizeBox, TableResizeCommon, TableResizeLine, TableResizeScale, TableRowFormat, TableSelection, TableUp, TableVirtualScrollbar, TableWrapperFormat, blotName, createColorPicker, createSelectBox, createTooltip, TableUp as default, defaultCustomSelect, findParentBlot, findParentBlots, isTableAlignRight, randomId, tableMenuTools, tableUpEvent, tableUpInternal, tableUpSize, updateTableConstants };
|
|
1061
|
+
export type { ClipboardOptions, Constructor, InternalModule, InternalTableMenuModule, InternalTableSelectionModule, Matcher, MenuTooltipInstance, QuillTheme, QuillThemePicker, RelactiveRect, SelectionData, Selector, SkipRowCount, TableCaptionValue, TableCellValue, TableColValue, TableConstantsData, TableCreatorTextOptions, TableMenuOptions, TableMenuOptionsInput$1 as TableMenuOptionsInput, TableMenuTexts, TableResizeScaleOptions, TableRowValue, TableSelectionOptions, TableTextOptions, TableUpOptions, TableValue, Tool, ToolOption, ToolOptionBreak, Writable, sizeChangeValue };
|