Skip to content

Commit

Permalink
detaklhes
Browse files Browse the repository at this point in the history
  • Loading branch information
skaduhs5232 committed May 22, 2024
1 parent f563517 commit 6021f87
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/extensions/extension-table-cell/src/table-cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const TableCell = Node.create<TableCellOptions>({
return {
...this.parent?.(),
setCellAttribute:
(attributes: { [key: string]: any }) =>
(attributes: { [key: string]: boolean }) =>
({ state, dispatch, tr }) => {
const { nodeAfter, pos } = selectionCell(state)

Expand Down
22 changes: 18 additions & 4 deletions src/extensions/table/itensModalCell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ function itensModalCell(editor: ExitusEditor) {

const inputBackgroundColor1 = createInput('color', 'Cor de Fundo')
inputBackgroundColor1.className = 'colorInput'
inputBackgroundColor1.disabled = true

const larguraBloco1 = createInput('text', 'Largura')
larguraBloco1.className = 'largura1'
larguraBloco1.disabled = true

const bloco1 = document.createElement('div')
bloco1.className = 'bloco1'
Expand All @@ -105,9 +107,19 @@ function itensModalCell(editor: ExitusEditor) {
bordaLabel.textContent = 'Borda'

bloco1.append(bordaLabel, selectInput, inputBackgroundColor1, larguraBloco1)

dropdownContent.appendChild(bloco1)

selectInput.addEventListener('change', () => {
if (selectInput.value) {
inputBackgroundColor1.disabled = false
}
})

inputBackgroundColor1.addEventListener('change', () => {
if (inputBackgroundColor1.value) {
larguraBloco1.disabled = false
}
})
function aplicarEstiloBorda() {
const selectedValue = selectInput.value
const cor = inputBackgroundColor1.value
Expand All @@ -120,6 +132,8 @@ function itensModalCell(editor: ExitusEditor) {
}
}
larguraBloco1.addEventListener('change', aplicarEstiloBorda)
selectInput.addEventListener('change', aplicarEstiloBorda)
inputBackgroundColor1.addEventListener('change', aplicarEstiloBorda)
larguraBloco1.value = ''

//bloco2
Expand Down Expand Up @@ -193,7 +207,7 @@ function itensModalCell(editor: ExitusEditor) {
}
}
inputLargura.addEventListener('change', aplicarDimencoesTabela)

inputAltura.addEventListener('change', aplicarDimencoesTabela)
//bloco 4
const alinhamentoLabel = document.createElement('strong')
alinhamentoLabel.textContent = 'Alinhamento'
Expand Down Expand Up @@ -250,15 +264,15 @@ function itensModalCell(editor: ExitusEditor) {

const botaoCancela = createButton(editor, 'Cancelar', () => {
;(editor.commands as any).setCellAttribute({
Direita: 'auto',
Esquerda: 'auto'
'vertical-align': 'top'
})
;(editor.commands as any).setCellAttribute({
height: ``,
width: ``,
background: ``,
border: ``
})
fecharDropdownsAbertos()
})
botaoCancela.className = 'botaoCancela'
const iconeCancela = document.createElement('span')
Expand Down
6 changes: 3 additions & 3 deletions src/extensions/table/tableToolbarItens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function dropDownColunas(editor: ExitusEditor, dropdown: Dropdown) {
const dropdownContent = document.createElement('div')
dropdownContent.className = '.ex-dropdownList-content'

const colunaHead = colunaHeader(editor, dropdown, 'Adicionar cabeçalho à coluna')
const colunaHead = colunaHeader(editor, dropdown, 'Adicionar/remover cabeçalho à coluna')
const colunaE = colunaEsquerda(editor, dropdown, 'Adicionar coluna à Esquerda')
const colunaD = colunaDireita(editor, dropdown, 'Adicionar coluna à Direita')
const colunaDel = colunaDelete(editor, dropdown, 'Deletar coluna')
Expand Down Expand Up @@ -193,7 +193,7 @@ function dropDownLinhas(editor: ExitusEditor, dropdown: Dropdown) {
const dropdownContent = document.createElement('div')
dropdownContent.className = '.ex-dropdownList-content'

const linhaHead = linhaHeader(editor, dropdown, 'Adicionar cabeçalho à linha')
const linhaHead = linhaHeader(editor, dropdown, 'Adicionar/remover cabeçalho à linha')
const linhaE = linhaEsquerda(editor, dropdown, 'Adicionar linha em cima')
const linhaD = linhaDireita(editor, dropdown, 'Adicionar linha em baixo')
const linhaDel = linhaDelete(editor, dropdown, 'Deletar linha')
Expand Down Expand Up @@ -277,7 +277,7 @@ function dropDownCell(editor: ExitusEditor, dropdown: Dropdown) {
const dropdownContent = document.createElement('div')
dropdownContent.className = '.ex-dropdownList-content'

const cellHead = cellHeader(editor, dropdown, 'Adicionar cabeçalho à célula')
const cellHead = cellHeader(editor, dropdown, 'Adicionar/remover cabeçalho à célula')
const cellMerge = mergeCell(editor, dropdown, 'Mesclar células')
const cellSplit = splitCell(editor, dropdown, 'Dividir células')

Expand Down

0 comments on commit 6021f87

Please sign in to comment.