@ebl-vue/editor-full 1.0.8
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/.postcssrc.yml +33 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +2565 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +55 -0
- package/postcss.config.js +15 -0
- package/src/components/Editor/Editor.vue +209 -0
- package/src/components/index.ts +27 -0
- package/src/constants/index.ts +1 -0
- package/src/i18n/zh-cn.ts +151 -0
- package/src/icons/index.ts +78 -0
- package/src/index.ts +11 -0
- package/src/installer.ts +22 -0
- package/src/plugins/alert/index.css +150 -0
- package/src/plugins/alert/index.ts +463 -0
- package/src/plugins/block-alignment/index.css +9 -0
- package/src/plugins/block-alignment/index.ts +116 -0
- package/src/plugins/block-alignment/readme.md +1 -0
- package/src/plugins/code/LICENSE +21 -0
- package/src/plugins/code/index.css +120 -0
- package/src/plugins/code/index.ts +530 -0
- package/src/plugins/code/utils/string.ts +34 -0
- package/src/plugins/color-picker/index.ts +138 -0
- package/src/plugins/color-picker/styles.css +27 -0
- package/src/plugins/delimiter/index.css +14 -0
- package/src/plugins/delimiter/index.ts +122 -0
- package/src/plugins/drag-drop/index.css +19 -0
- package/src/plugins/drag-drop/index.ts +151 -0
- package/src/plugins/drag-drop/readme.md +1 -0
- package/src/plugins/header/H1.ts +405 -0
- package/src/plugins/header/H2.ts +403 -0
- package/src/plugins/header/H3.ts +404 -0
- package/src/plugins/header/H4.ts +405 -0
- package/src/plugins/header/H5.ts +405 -0
- package/src/plugins/header/H6.ts +406 -0
- package/src/plugins/header/index.css +20 -0
- package/src/plugins/header/index.ts +15 -0
- package/src/plugins/header/types.d.ts +46 -0
- package/src/plugins/indent/index.css +86 -0
- package/src/plugins/indent/index.ts +697 -0
- package/src/plugins/inline-code/index.css +11 -0
- package/src/plugins/inline-code/index.ts +205 -0
- package/src/plugins/list/ListRenderer/ChecklistRenderer.ts +211 -0
- package/src/plugins/list/ListRenderer/ListRenderer.ts +73 -0
- package/src/plugins/list/ListRenderer/OrderedListRenderer.ts +123 -0
- package/src/plugins/list/ListRenderer/UnorderedListRenderer.ts +123 -0
- package/src/plugins/list/ListRenderer/index.ts +6 -0
- package/src/plugins/list/ListTabulator/index.ts +1179 -0
- package/src/plugins/list/index.ts +502 -0
- package/src/plugins/list/styles/CssPrefix.ts +4 -0
- package/src/plugins/list/styles/icons/index.ts +10 -0
- package/src/plugins/list/styles/input.css +36 -0
- package/src/plugins/list/styles/list.css +165 -0
- package/src/plugins/list/types/Elements.ts +14 -0
- package/src/plugins/list/types/ItemMeta.ts +40 -0
- package/src/plugins/list/types/ListParams.ts +102 -0
- package/src/plugins/list/types/ListRenderer.ts +6 -0
- package/src/plugins/list/types/OlCounterType.ts +63 -0
- package/src/plugins/list/types/index.ts +14 -0
- package/src/plugins/list/utils/focusItem.ts +18 -0
- package/src/plugins/list/utils/getChildItems.ts +40 -0
- package/src/plugins/list/utils/getItemChildWrapper.ts +10 -0
- package/src/plugins/list/utils/getItemContentElement.ts +10 -0
- package/src/plugins/list/utils/getSiblings.ts +52 -0
- package/src/plugins/list/utils/isLastItem.ts +9 -0
- package/src/plugins/list/utils/itemHasSublist.ts +10 -0
- package/src/plugins/list/utils/normalizeData.ts +84 -0
- package/src/plugins/list/utils/removeChildWrapperIfEmpty.ts +31 -0
- package/src/plugins/list/utils/renderToolboxInput.ts +105 -0
- package/src/plugins/list/utils/stripNumbers.ts +7 -0
- package/src/plugins/list/utils/type-guards.ts +8 -0
- package/src/plugins/list.md +15 -0
- package/src/plugins/marker/index.css +4 -0
- package/src/plugins/marker/index.ts +187 -0
- package/src/plugins/paragraph/index.css +23 -0
- package/src/plugins/paragraph/index.ts +380 -0
- package/src/plugins/paragraph/types/icons.d.ts +4 -0
- package/src/plugins/paragraph/utils/makeFragment.ts +17 -0
- package/src/plugins/quote/index.css +26 -0
- package/src/plugins/quote/index.ts +206 -0
- package/src/plugins/table/index.ts +4 -0
- package/src/plugins/table/plugin.ts +254 -0
- package/src/plugins/table/style.css +388 -0
- package/src/plugins/table/table.ts +1192 -0
- package/src/plugins/table/toolbox.ts +165 -0
- package/src/plugins/table/utils/dom.ts +128 -0
- package/src/plugins/table/utils/popover.ts +172 -0
- package/src/plugins/table/utils/throttled.ts +22 -0
- package/src/plugins/underline/index.css +3 -0
- package/src/plugins/underline/index.ts +216 -0
- package/src/plugins/undo/index.ts +509 -0
- package/src/plugins/undo/observer.ts +101 -0
- package/src/style.css +89 -0
- package/src/utils/index.ts +15 -0
- package/src/utils/install.ts +19 -0
- package/tsconfig.json +37 -0
- package/types/index.d.ts +13 -0
- package/types/plugins/index.d.ts +0 -0
- package/vite.config.ts +79 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import Table from './table';
|
|
2
|
+
import * as $ from './utils/dom';
|
|
3
|
+
|
|
4
|
+
import { IconTable, IconTableWithHeadings, IconTableWithoutHeadings, IconStretch, IconCollapse } from '../../icons';
|
|
5
|
+
import type { BlockTool, BlockToolConstructorOptions,PasteEvent } from '@ebl-vue/editorjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {object} TableData - configuration that the user can set for the table
|
|
9
|
+
* @property {number} rows - number of rows in the table
|
|
10
|
+
* @property {number} cols - number of columns in the table
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {object} Tune - setting for the table
|
|
14
|
+
* @property {string} name - tune name
|
|
15
|
+
* @property {HTMLElement} icon - icon for the tune
|
|
16
|
+
* @property {boolean} isActive - default state of the tune
|
|
17
|
+
* @property {void} setTune - set tune state to the table data
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {object} TableConfig - object with the data transferred to form a table
|
|
21
|
+
* @property {boolean} withHeading - setting to use cells of the first row as headings
|
|
22
|
+
* @property {string[][]} content - two-dimensional array which contains table content
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* @typedef {object} TableConstructor
|
|
26
|
+
* @property {TableConfig} data — previously saved data
|
|
27
|
+
* @property {TableConfig} config - user config for Tool
|
|
28
|
+
* @property {object} api - Editor.js API
|
|
29
|
+
* @property {boolean} readOnly - read-only mode flag
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* @typedef {import('@editorjs/editorjs').PasteEvent} PasteEvent
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Table block for Editor.js
|
|
38
|
+
*/
|
|
39
|
+
export default class TableBlock implements BlockTool {
|
|
40
|
+
private api: any;
|
|
41
|
+
private data: any;
|
|
42
|
+
private config: any;
|
|
43
|
+
private container: any;
|
|
44
|
+
//private block: any;
|
|
45
|
+
private readOnly: any;
|
|
46
|
+
private table: any;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Notify core that read-only mode is supported
|
|
50
|
+
*
|
|
51
|
+
* @returns {boolean}
|
|
52
|
+
*/
|
|
53
|
+
static get isReadOnlySupported() {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Allow to press Enter inside the CodeTool textarea
|
|
59
|
+
*
|
|
60
|
+
* @returns {boolean}
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
static get enableLineBreaks() {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Render plugin`s main Element and fill it with saved data
|
|
69
|
+
*
|
|
70
|
+
* @param {TableConstructor} init
|
|
71
|
+
*/
|
|
72
|
+
constructor({ data, config, api, readOnly, block }: BlockToolConstructorOptions) {
|
|
73
|
+
this.api = api;
|
|
74
|
+
this.readOnly = readOnly;
|
|
75
|
+
this.config = config;
|
|
76
|
+
this.data = {
|
|
77
|
+
withHeadings: this.getConfig('withHeadings', undefined, data),
|
|
78
|
+
stretched: this.getConfig('stretched', undefined, data),
|
|
79
|
+
content: data && data.content ? data.content : [],
|
|
80
|
+
colWidth: data && data.colWidth ? data.colWidth : []
|
|
81
|
+
};
|
|
82
|
+
this.table = null;
|
|
83
|
+
//this.block = block;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Get Tool toolbox settings
|
|
88
|
+
* icon - Tool icon's SVG
|
|
89
|
+
* title - title to show in toolbox
|
|
90
|
+
*
|
|
91
|
+
* @returns {{icon: string, title: string}}
|
|
92
|
+
*/
|
|
93
|
+
static get toolbox() {
|
|
94
|
+
return {
|
|
95
|
+
icon: IconTable,
|
|
96
|
+
title: 'Table'
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Return Tool's view
|
|
102
|
+
*
|
|
103
|
+
* @returns {HTMLDivElement}
|
|
104
|
+
*/
|
|
105
|
+
render() {
|
|
106
|
+
/** creating table */
|
|
107
|
+
this.table = new Table(this.readOnly, this.api, this.data, this.config);
|
|
108
|
+
|
|
109
|
+
/** creating container around table */
|
|
110
|
+
this.container = $.make('div', this.api.styles.block);
|
|
111
|
+
|
|
112
|
+
this.container.appendChild(this.table.getWrapper());
|
|
113
|
+
|
|
114
|
+
this.table.setHeadingsSetting(this.data.withHeadings);
|
|
115
|
+
|
|
116
|
+
return this.container;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Returns plugin settings
|
|
121
|
+
*
|
|
122
|
+
* @returns {Array}
|
|
123
|
+
*/
|
|
124
|
+
renderSettings() {
|
|
125
|
+
return [
|
|
126
|
+
{
|
|
127
|
+
label: this.api.i18n.t('With headings'),
|
|
128
|
+
icon: IconTableWithHeadings,
|
|
129
|
+
isActive: this.data.withHeadings,
|
|
130
|
+
closeOnActivate: true,
|
|
131
|
+
toggle: true,
|
|
132
|
+
hint: {
|
|
133
|
+
title: this.api.i18n.t('With headings')
|
|
134
|
+
},
|
|
135
|
+
onActivate: () => {
|
|
136
|
+
this.data.withHeadings = true;
|
|
137
|
+
this.table.setHeadingsSetting(this.data.withHeadings);
|
|
138
|
+
}
|
|
139
|
+
}, {
|
|
140
|
+
label: this.api.i18n.t('Without headings'),
|
|
141
|
+
icon: IconTableWithoutHeadings,
|
|
142
|
+
isActive: !this.data.withHeadings,
|
|
143
|
+
closeOnActivate: true,
|
|
144
|
+
toggle: true,
|
|
145
|
+
hint: {
|
|
146
|
+
title: this.api.i18n.t('Without headings')
|
|
147
|
+
},
|
|
148
|
+
onActivate: () => {
|
|
149
|
+
this.data.withHeadings = false;
|
|
150
|
+
this.table.setHeadingsSetting(this.data.withHeadings);
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
// {
|
|
154
|
+
// label: this.data.stretched ? this.api.i18n.t('Collapse') : this.api.i18n.t('Stretch'),
|
|
155
|
+
// icon: this.data.stretched ? IconCollapse : IconStretch,
|
|
156
|
+
// closeOnActivate: true,
|
|
157
|
+
// toggle: true,
|
|
158
|
+
// onActivate: () => {
|
|
159
|
+
// this.data.stretched = !this.data.stretched;
|
|
160
|
+
// this.block.stretched = this.data.stretched;
|
|
161
|
+
// }
|
|
162
|
+
// }
|
|
163
|
+
];
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Extract table data from the view
|
|
167
|
+
*
|
|
168
|
+
* @returns {TableData} - saved data
|
|
169
|
+
*/
|
|
170
|
+
save() {
|
|
171
|
+
const tableContent = this.table.getData();
|
|
172
|
+
|
|
173
|
+
const result = {
|
|
174
|
+
withHeadings: this.data.withHeadings,
|
|
175
|
+
stretched: this.data.stretched,
|
|
176
|
+
content: tableContent
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
return result;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Plugin destroyer
|
|
184
|
+
*
|
|
185
|
+
* @returns {void}
|
|
186
|
+
*/
|
|
187
|
+
destroy() {
|
|
188
|
+
this.table.destroy();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* A helper to get config value.
|
|
193
|
+
*
|
|
194
|
+
* @param {string} configName - the key to get from the config.
|
|
195
|
+
* @param {any} defaultValue - default value if config doesn't have passed key
|
|
196
|
+
* @param {object} savedData - previously saved data. If passed, the key will be got from there, otherwise from the config
|
|
197
|
+
* @returns {any} - config value.
|
|
198
|
+
*/
|
|
199
|
+
getConfig(configName: string, defaultValue = undefined, savedData = undefined) {
|
|
200
|
+
const data = this.data || savedData;
|
|
201
|
+
|
|
202
|
+
if (data) {
|
|
203
|
+
return data[configName] ? data[configName] : defaultValue;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return this.config && this.config[configName] ? this.config[configName] : defaultValue;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Table onPaste configuration
|
|
211
|
+
*
|
|
212
|
+
* @public
|
|
213
|
+
*/
|
|
214
|
+
static get pasteConfig() {
|
|
215
|
+
return { tags: ['TABLE', 'TR', 'TH', 'TD'] };
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* On paste callback that is fired from Editor
|
|
220
|
+
*
|
|
221
|
+
* @param {PasteEvent} event - event with pasted data
|
|
222
|
+
*/
|
|
223
|
+
onPaste(event: PasteEvent) {
|
|
224
|
+
if ('data' in event.detail) {
|
|
225
|
+
const table = event.detail.data as HTMLElement;
|
|
226
|
+
|
|
227
|
+
/** Check if the first row is a header */
|
|
228
|
+
const firstRowHeading = table.querySelector(':scope > thead, tr:first-of-type th');
|
|
229
|
+
|
|
230
|
+
/** Get all rows from the table */
|
|
231
|
+
const rows = Array.from(table.querySelectorAll('tr'));
|
|
232
|
+
|
|
233
|
+
/** Generate a content matrix */
|
|
234
|
+
const content = rows.map((row) => {
|
|
235
|
+
/** Get cells from row */
|
|
236
|
+
const cells = Array.from(row.querySelectorAll('th, td'))
|
|
237
|
+
|
|
238
|
+
/** Return cells content */
|
|
239
|
+
return cells.map((cell) => cell.innerHTML);
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
/** Update Tool's data */
|
|
243
|
+
this.data = {
|
|
244
|
+
withHeadings: firstRowHeading !== null,
|
|
245
|
+
content
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/** Update table block */
|
|
249
|
+
if (this.table.wrapper) {
|
|
250
|
+
this.table.wrapper.replaceWith(this.render());
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
.tc-wrap {
|
|
2
|
+
--color-background: #f9f9fb;
|
|
3
|
+
--color-text-secondary: #7b7e89;
|
|
4
|
+
--color-border: #e8e8eb;
|
|
5
|
+
--cell-size: 34px;
|
|
6
|
+
--toolbox-icon-size: 18px;
|
|
7
|
+
--toolbox-padding: 6px;
|
|
8
|
+
--toolbox-aiming-field-size: calc(var(--toolbox-icon-size) + var(--toolbox-padding)*2);
|
|
9
|
+
--col-width: 100px 100px 100px;
|
|
10
|
+
position: relative;
|
|
11
|
+
height: 100%;
|
|
12
|
+
/* width: 100%; */
|
|
13
|
+
margin-top: var(--toolbox-icon-size);
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
display: inline-grid;
|
|
16
|
+
|
|
17
|
+
z-index: 0
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.tc-wrap--readonly {
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.tc-wrap svg {
|
|
25
|
+
vertical-align: top
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@media print {
|
|
29
|
+
.tc-wrap {
|
|
30
|
+
border-left-color: var(--color-border);
|
|
31
|
+
border-left-style: solid;
|
|
32
|
+
border-left-width: 1px;
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@media print {
|
|
38
|
+
.tc-wrap .tc-row:after {
|
|
39
|
+
display: none
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.tc-table {
|
|
44
|
+
position: relative;
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
display: grid;
|
|
48
|
+
font-size: 14px;
|
|
49
|
+
border-top: 1px solid var(--color-border);
|
|
50
|
+
border-left: 1px solid var(--color-border);
|
|
51
|
+
line-height: 1.4;
|
|
52
|
+
overflow-x: auto;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.tc-table:after {
|
|
56
|
+
width: calc(var(--cell-size));
|
|
57
|
+
height: 100%;
|
|
58
|
+
left: calc(var(--cell-size)*-1);
|
|
59
|
+
top: 0
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.tc-table:after,
|
|
63
|
+
.tc-table:before {
|
|
64
|
+
position: absolute;
|
|
65
|
+
content: ""
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.tc-table:before {
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: var(--toolbox-aiming-field-size);
|
|
71
|
+
top: calc(var(--toolbox-aiming-field-size)*-1);
|
|
72
|
+
left: 0
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.tc-table--heading .tc-row:first-child {
|
|
76
|
+
font-weight: 600;
|
|
77
|
+
border-bottom: 2px solid var(--color-border);
|
|
78
|
+
position: sticky;
|
|
79
|
+
top: 0;
|
|
80
|
+
z-index: 2;
|
|
81
|
+
background: var(--color-background)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.tc-table--heading .tc-row:first-child [contenteditable]:empty:before {
|
|
85
|
+
content: attr(heading);
|
|
86
|
+
color: var(--color-text-secondary)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.tc-table--heading .tc-row:first-child:after {
|
|
90
|
+
bottom: -2px;
|
|
91
|
+
border-bottom: 2px solid var(--color-border)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.tc-add-column,
|
|
95
|
+
.tc-add-row {
|
|
96
|
+
display: flex;
|
|
97
|
+
color: var(--color-text-secondary)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@media print {
|
|
101
|
+
.tc-add {
|
|
102
|
+
display: none
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.tc-add-column {
|
|
107
|
+
display: grid;
|
|
108
|
+
border-top: 1px solid var(--color-border);
|
|
109
|
+
|
|
110
|
+
grid-auto-rows: var(--cell-size);
|
|
111
|
+
place-items: center
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.tc-add-column svg {
|
|
115
|
+
padding: 5px;
|
|
116
|
+
position: sticky;
|
|
117
|
+
top: 0;
|
|
118
|
+
background-color: var(--color-background)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.tc-add-column--disabled {
|
|
122
|
+
visibility: hidden
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@media print {
|
|
126
|
+
.tc-add-column {
|
|
127
|
+
display: none
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.tc-add-row {
|
|
132
|
+
height: var(--cell-size);
|
|
133
|
+
align-items: center;
|
|
134
|
+
padding-left: 4px;
|
|
135
|
+
position: relative
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.tc-add-row--disabled {
|
|
139
|
+
display: none
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.tc-add-row:before {
|
|
143
|
+
content: "";
|
|
144
|
+
position: absolute;
|
|
145
|
+
right: calc(var(--cell-size)*-1);
|
|
146
|
+
width: var(--cell-size);
|
|
147
|
+
height: 100%
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@media print {
|
|
151
|
+
.tc-add-row {
|
|
152
|
+
display: none
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.tc-add-column,
|
|
157
|
+
.tc-add-row {
|
|
158
|
+
transition: 0s;
|
|
159
|
+
cursor: pointer;
|
|
160
|
+
will-change: background-color
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.tc-add-column:hover,
|
|
164
|
+
.tc-add-row:hover {
|
|
165
|
+
transition: background-color .1s ease;
|
|
166
|
+
background-color: var(--color-background)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.tc-add-row {
|
|
170
|
+
margin-top: 1px
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.tc-add-row:hover:before {
|
|
174
|
+
transition: .1s;
|
|
175
|
+
background-color: var(--color-background)
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.tc-row {
|
|
179
|
+
display: grid;
|
|
180
|
+
/* grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)); */
|
|
181
|
+
/* grid-template-columns: 100px 100px 100px; */
|
|
182
|
+
grid-template-columns:var(--col-width);
|
|
183
|
+
position: relative;
|
|
184
|
+
border-bottom: 1px solid var(--color-border)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* .tc-row:after {
|
|
188
|
+
content: "";
|
|
189
|
+
pointer-events: none;
|
|
190
|
+
position: absolute;
|
|
191
|
+
width: var(--cell-size);
|
|
192
|
+
height: 100%;
|
|
193
|
+
bottom: -1px;
|
|
194
|
+
right: calc(var(--cell-size)*-1);
|
|
195
|
+
border-bottom: 1px solid var(--color-border)
|
|
196
|
+
} */
|
|
197
|
+
|
|
198
|
+
.tc-row--selected {
|
|
199
|
+
background: var(--color-background)
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.tc-row--selected:after {
|
|
203
|
+
background: var(--color-background)
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.tc-cell {
|
|
207
|
+
border-right: 1px solid var(--color-border);
|
|
208
|
+
padding: 6px 12px;
|
|
209
|
+
overflow: hidden;
|
|
210
|
+
outline: none;
|
|
211
|
+
line-break: normal
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.tc-cell--selected {
|
|
215
|
+
background: var(--color-background)
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.tc-wrap--readonly .tc-row:after {
|
|
219
|
+
display: none
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.tc-toolbox {
|
|
223
|
+
--toolbox-padding: 6px;
|
|
224
|
+
--popover-margin: 30px;
|
|
225
|
+
--toggler-click-zone-size: 30px;
|
|
226
|
+
--toggler-dots-color: #7b7e89;
|
|
227
|
+
--toggler-dots-color-hovered: #1d202b;
|
|
228
|
+
position: absolute;
|
|
229
|
+
cursor: pointer;
|
|
230
|
+
z-index: 1;
|
|
231
|
+
opacity: 0;
|
|
232
|
+
transition: opacity .1s;
|
|
233
|
+
will-change: left, opacity
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.tc-toolbox--column {
|
|
237
|
+
top: calc(var(--toggler-click-zone-size)*-1);
|
|
238
|
+
transform: translate(calc(var(--toggler-click-zone-size)*-1/2));
|
|
239
|
+
will-change: left, opacity
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.tc-toolbox--row {
|
|
243
|
+
left: calc(var(--popover-margin)*-1);
|
|
244
|
+
transform: translateY(calc(var(--toggler-click-zone-size)*-1/2));
|
|
245
|
+
margin-top: -1px;
|
|
246
|
+
will-change: top, opacity
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.tc-toolbox--showed {
|
|
250
|
+
opacity: 1
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.tc-toolbox .tc-popover {
|
|
254
|
+
position: absolute;
|
|
255
|
+
top: 0;
|
|
256
|
+
left: var(--popover-margin)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.tc-toolbox__toggler {
|
|
260
|
+
display: flex;
|
|
261
|
+
align-items: center;
|
|
262
|
+
justify-content: center;
|
|
263
|
+
width: var(--toggler-click-zone-size);
|
|
264
|
+
height: var(--toggler-click-zone-size);
|
|
265
|
+
color: var(--toggler-dots-color);
|
|
266
|
+
opacity: 0;
|
|
267
|
+
transition: opacity .15s ease;
|
|
268
|
+
will-change: opacity
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.tc-toolbox__toggler:hover {
|
|
272
|
+
color: var(--toggler-dots-color-hovered)
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.tc-toolbox__toggler svg {
|
|
276
|
+
fill: currentColor
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.tc-wrap:hover .tc-toolbox__toggler {
|
|
280
|
+
opacity: 1
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.tc-settings .cdx-settings-button {
|
|
284
|
+
width: 50%;
|
|
285
|
+
margin: 0
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.tc-popover {
|
|
289
|
+
--color-border: #eaeaea;
|
|
290
|
+
--color-background: #fff;
|
|
291
|
+
--color-background-hover: rgba(232, 232, 235, .49);
|
|
292
|
+
--color-background-confirm: #e24a4a;
|
|
293
|
+
--color-background-confirm-hover: #d54040;
|
|
294
|
+
--color-text-confirm: #fff;
|
|
295
|
+
background: var(--color-background);
|
|
296
|
+
border: 1px solid var(--color-border);
|
|
297
|
+
box-shadow: 0 3px 15px -3px #0d142121;
|
|
298
|
+
border-radius: 6px;
|
|
299
|
+
padding: 6px;
|
|
300
|
+
display: none;
|
|
301
|
+
will-change: opacity, transform
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.tc-popover--opened {
|
|
305
|
+
display: block;
|
|
306
|
+
animation: menuShowing .1s cubic-bezier(.215, .61, .355, 1) forwards
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.tc-popover__item {
|
|
310
|
+
display: flex;
|
|
311
|
+
align-items: center;
|
|
312
|
+
padding: 2px 14px 2px 2px;
|
|
313
|
+
border-radius: 5px;
|
|
314
|
+
cursor: pointer;
|
|
315
|
+
white-space: nowrap;
|
|
316
|
+
-webkit-user-select: none;
|
|
317
|
+
-moz-user-select: none;
|
|
318
|
+
user-select: none
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.tc-popover__item:hover {
|
|
322
|
+
background: var(--color-background-hover)
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.tc-popover__item:not(:last-of-type) {
|
|
326
|
+
margin-bottom: 2px
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.tc-popover__item-icon {
|
|
330
|
+
display: inline-flex;
|
|
331
|
+
width: 26px;
|
|
332
|
+
height: 26px;
|
|
333
|
+
align-items: center;
|
|
334
|
+
justify-content: center;
|
|
335
|
+
background: var(--color-background);
|
|
336
|
+
border-radius: 5px;
|
|
337
|
+
border: 1px solid var(--color-border);
|
|
338
|
+
margin-right: 8px
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.tc-popover__item-label {
|
|
342
|
+
line-height: 22px;
|
|
343
|
+
font-size: 14px;
|
|
344
|
+
font-weight: 500
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.tc-popover__item--confirm {
|
|
348
|
+
background: var(--color-background-confirm);
|
|
349
|
+
color: var(--color-text-confirm)
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.tc-popover__item--confirm:hover {
|
|
353
|
+
background-color: var(--color-background-confirm-hover)
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.tc-popover__item--confirm .tc-popover__item-icon {
|
|
357
|
+
background: var(--color-background-confirm);
|
|
358
|
+
border-color: #0000001a
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.tc-popover__item--confirm .tc-popover__item-icon svg {
|
|
362
|
+
transition: transform .2s ease-in;
|
|
363
|
+
transform: rotate(90deg) scale(1.2)
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.tc-popover__item--hidden {
|
|
367
|
+
display: none
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
@keyframes menuShowing {
|
|
371
|
+
0% {
|
|
372
|
+
opacity: 0;
|
|
373
|
+
transform: translateY(-8px) scale(.9)
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
70% {
|
|
377
|
+
opacity: 1;
|
|
378
|
+
transform: translateY(2px)
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
to {
|
|
382
|
+
transform: translateY(0)
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.cell-resizable {
|
|
387
|
+
cursor: col-resize;
|
|
388
|
+
}
|