@alitons/ckeditor5 0.0.14 → 0.0.16
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/build/ckeditor.d.ts +0 -2
- package/build/ckeditor.js +2 -2
- package/build/ckeditor.js.map +1 -1
- package/build/plugins/modelo.d.ts +1 -1
- package/package.json +1 -1
- package/sample/script.js +10 -10
- package/src/ckeditor.ts +0 -9
- package/src/components/list/listitemview.d.ts +35 -35
- package/src/components/list/listitemview.js +42 -42
- package/src/components/list/listview.d.ts +65 -65
- package/src/components/list/listview.js +92 -92
- package/src/css/custom.css +0 -9
- package/src/plugins/NumberedDivListSplit.ts +8 -0
- package/src/plugins/listaNumerada.ts +1 -3
- package/src/plugins/modelo.ts +16 -17
package/src/plugins/modelo.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { createDropdown } from '@ckeditor/ckeditor5-ui';
|
|
|
6
6
|
import { HtmlDataProcessor } from '@ckeditor/ckeditor5-engine';
|
|
7
7
|
import $ from "jquery";
|
|
8
8
|
import 'select2/dist/js/select2.full.min'
|
|
9
|
-
import 'select2/dist/css/select2.css'
|
|
9
|
+
import 'select2/dist/css/select2.min.css'
|
|
10
10
|
|
|
11
11
|
window.$ = $;
|
|
12
12
|
window.jQuery = $;
|
|
@@ -22,7 +22,6 @@ export default class DocumentoModelo extends Plugin {
|
|
|
22
22
|
|
|
23
23
|
createPopup() {
|
|
24
24
|
this.editor.ui.componentFactory.add( 'documentoModelo', () => {
|
|
25
|
-
|
|
26
25
|
const dropdown = createDropdown( this.editor.locale );
|
|
27
26
|
|
|
28
27
|
// Configure dropdown's button properties:
|
|
@@ -86,6 +85,7 @@ export default class DocumentoModelo extends Plugin {
|
|
|
86
85
|
})
|
|
87
86
|
|
|
88
87
|
const toolbar = this.editor.config.get('toolbar') as any;
|
|
88
|
+
const self = this;
|
|
89
89
|
|
|
90
90
|
if(!toolbar!.seiOptions || toolbar!.seiOptions === undefined || [null, undefined, ''].includes(toolbar!.seiOptions?.url)) {
|
|
91
91
|
dropdown.isEnabled = false
|
|
@@ -94,16 +94,16 @@ export default class DocumentoModelo extends Plugin {
|
|
|
94
94
|
// CRIAR O ELEMENTO IGUAL AO ELEMENTO DE BUSCA
|
|
95
95
|
const input = document.createElement( 'div' );
|
|
96
96
|
input.classList.add('documento_modelo_container')
|
|
97
|
-
input.innerHTML = `<div class="ck ck-
|
|
97
|
+
input.innerHTML = `<div class="ck ck-dropdown__panel ck-dropdown__panel_se ck-dropdown__panel-visible ck-dropdown__panel_documento_modelo ck-reset_all-excluded" style="left: initial;right: 0;">
|
|
98
98
|
<form class="ck ck-find-and-replace-form">
|
|
99
99
|
<div class="ck ck-form__header">
|
|
100
|
-
<
|
|
100
|
+
<p class="ck ck-form__header__label" style="margin: initial;">Documento Modelo</p>
|
|
101
101
|
</div>
|
|
102
102
|
<fieldset class="ck ck-find-and-replace-form__find" style="margin-bottom: 0px; padding-bottom: 0px;">
|
|
103
103
|
<div class="ck ck-labeled-field-view ck-labeled-field-view_empty">
|
|
104
104
|
<label>Categoria</label>
|
|
105
105
|
<div class="ck ck-labeled-field-view__input-wrapper">
|
|
106
|
-
<select class="ck ck-input ck-input-text_empty ck-input-select categoriamodeloselect" id="search-input-categoria-document-modelo-${this.uid}">
|
|
106
|
+
<select class="ck ck-input ck-input-text_empty ck-input-select categoriamodeloselect-${self.uid}" id="search-input-categoria-document-modelo-${this.uid}">
|
|
107
107
|
</select>
|
|
108
108
|
</div>
|
|
109
109
|
<div class="ck ck-labeled-field-view__status ck-labeled-field-view__status_error" id="search-error-sei-${this.uid}" role="alert"></div>
|
|
@@ -113,7 +113,7 @@ export default class DocumentoModelo extends Plugin {
|
|
|
113
113
|
<div class="ck ck-labeled-field-view ck-labeled-field-view_empty">
|
|
114
114
|
<label>Modelo</label>
|
|
115
115
|
<div class="ck ck-labeled-field-view__input-wrapper">
|
|
116
|
-
<select class="ck ck-input ck-input-text_empty ck-input-select documentomodeloselect" id="search-input-documento-modelo-${this.uid}">
|
|
116
|
+
<select class="ck ck-input ck-input-text_empty ck-input-select documentomodeloselect-${self.uid}" id="search-input-documento-modelo-${this.uid}">
|
|
117
117
|
</select>
|
|
118
118
|
</div>
|
|
119
119
|
<div class="ck ck-labeled-field-view__status ck-labeled-field-view__status_error" id="search-error-sei-${this.uid}" role="alert"></div>
|
|
@@ -124,7 +124,7 @@ export default class DocumentoModelo extends Plugin {
|
|
|
124
124
|
<div class="ck" id="search-result-documento-modelo-${this.uid}"></div>
|
|
125
125
|
</div>
|
|
126
126
|
<button class="ck ck-button ck-button-save ck-off ck-button_with-text" type="button" tabindex="-1" id="search-add-documento-modelo-${this.uid}">
|
|
127
|
-
<svg class="ck ck-icon ck-
|
|
127
|
+
<svg class="ck ck-icon ck-icon_inherit-color ck-button__icon" viewBox="0 0 20 20"><path d="M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z"></path></svg>
|
|
128
128
|
<span class="ck ck-button__label">Importar</span>
|
|
129
129
|
</button>
|
|
130
130
|
</fieldset>
|
|
@@ -132,15 +132,13 @@ export default class DocumentoModelo extends Plugin {
|
|
|
132
132
|
</div>`;
|
|
133
133
|
dropdown.panelView.element.appendChild( input );
|
|
134
134
|
|
|
135
|
-
const self = this;
|
|
136
|
-
|
|
137
135
|
// EXECUTAR APENAS QUANDO O DROPDOWN FOR ABERTO
|
|
138
136
|
dropdown.on( 'change:isOpen', ( evt, name, isOpen ) => {
|
|
139
137
|
if ( isOpen ) {
|
|
140
|
-
$(
|
|
138
|
+
$(`.categoriamodeloselect-${self.uid}`)
|
|
141
139
|
.select2(this.parametrosDocumentoModeloCategoria())
|
|
142
140
|
|
|
143
|
-
$(
|
|
141
|
+
$(`.documentomodeloselect-${self.uid}`)
|
|
144
142
|
.select2(this.parametrosDocumentoModelo())
|
|
145
143
|
.on('select2:select', function (e) {
|
|
146
144
|
console.log('selecionado', $(`#search-actions-documento-modelo-${self.uid}`));
|
|
@@ -178,19 +176,20 @@ export default class DocumentoModelo extends Plugin {
|
|
|
178
176
|
}
|
|
179
177
|
|
|
180
178
|
async openModalDocumentoModelo(){
|
|
179
|
+
const self = this
|
|
181
180
|
const val = await Swal.fire({
|
|
182
181
|
title: 'Modelo de Documento',
|
|
183
182
|
html: `
|
|
184
183
|
<div class="row w-100">
|
|
185
184
|
${(this.options.categoria) ? `<div class="col-12 mb-3" style="text-align: justify;">
|
|
186
185
|
<div class="form-group">
|
|
187
|
-
<select class="form-select categoriamodeloselect">
|
|
186
|
+
<select class="form-select categoriamodeloselect-${self.uid}">
|
|
188
187
|
</select>
|
|
189
188
|
</div>
|
|
190
189
|
</div>` : ''}
|
|
191
190
|
<div class="col-12" style="text-align: justify;">
|
|
192
191
|
<div class="form-group">
|
|
193
|
-
<select class="form-select documentomodeloselect">
|
|
192
|
+
<select class="form-select documentomodeloselect-${self.uid}">
|
|
194
193
|
</select>
|
|
195
194
|
</div>
|
|
196
195
|
</div>
|
|
@@ -201,10 +200,10 @@ export default class DocumentoModelo extends Plugin {
|
|
|
201
200
|
`,
|
|
202
201
|
willOpen: () => {
|
|
203
202
|
|
|
204
|
-
$(
|
|
203
|
+
$(`.categoriamodeloselect-${self.uid}`)
|
|
205
204
|
.select2(this.parametrosDocumentoModeloCategoria())
|
|
206
205
|
|
|
207
|
-
$(
|
|
206
|
+
$(`.documentomodeloselect-${self.uid}`)
|
|
208
207
|
.select2(this.parametrosDocumentoModelo())
|
|
209
208
|
.on('change', function (e) {
|
|
210
209
|
$('.documentomodeloviewer').html(e.target.value)
|
|
@@ -253,7 +252,7 @@ export default class DocumentoModelo extends Plugin {
|
|
|
253
252
|
results: data.data.map(function(item) {
|
|
254
253
|
return {
|
|
255
254
|
id: self.options?.categoria?.ajax?.results?.id ? item[self.options?.categoria?.ajax?.results?.id] : item.id,
|
|
256
|
-
text: self.options?.categoria?.ajax?.results?.
|
|
255
|
+
text: self.options?.categoria?.ajax?.results?.text ? item[self.options?.categoria?.ajax?.results?.text] : item.text
|
|
257
256
|
}
|
|
258
257
|
}),
|
|
259
258
|
pagination: {
|
|
@@ -287,7 +286,7 @@ export default class DocumentoModelo extends Plugin {
|
|
|
287
286
|
let p = {
|
|
288
287
|
search: params.term,
|
|
289
288
|
page: params.page || 1,
|
|
290
|
-
categoria: $(
|
|
289
|
+
categoria: $(`.categoriamodeloselect-${self.uid}`).val() ?? null,
|
|
291
290
|
}
|
|
292
291
|
if(self.options?.ajax?.data) {
|
|
293
292
|
p = {...p, ...self.options?.ajax?.data}
|