pawajs 1.3.0 → 1.3.2
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/package.json +1 -1
- package/pawaElement.js +18 -7
package/package.json
CHANGED
package/pawaElement.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {components,escapePawaAttribute,getPawaAttributes,getDependentAttribute
|
|
1
|
+
import {components,escapePawaAttribute,getPawaAttributes,getDependentAttribute} from './index.js';
|
|
2
2
|
import {splitAndAdd,replaceTemplateOperators,setPawaDevError,getEvalValues,safeEval} from './utils.js';
|
|
3
3
|
import PawaComponent from './pawaComponent.js';
|
|
4
|
-
import { getPrimaryDirective } from './index.js';
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
export class PawaElement {
|
|
@@ -107,6 +106,19 @@ export class PawaElement {
|
|
|
107
106
|
call()
|
|
108
107
|
})
|
|
109
108
|
}
|
|
109
|
+
setPawaAttr(){
|
|
110
|
+
const isResume=this._el.hasAttribute('p:c')
|
|
111
|
+
if(isResume){
|
|
112
|
+
const pawaAttr=this._el.getAttribute('p:c')
|
|
113
|
+
const array=pawaAttr.split(';')
|
|
114
|
+
array.forEach(value =>{
|
|
115
|
+
if(!this._el.hasAttribute(value)) return
|
|
116
|
+
this._attributes.push({name:value,value:this._el.getAttribute(value)})
|
|
117
|
+
})
|
|
118
|
+
}else{
|
|
119
|
+
this._attributes=Array.from(this._el.attributes)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
110
122
|
findPawaAttribute(){
|
|
111
123
|
Array.from(this._el.attributes).forEach((attr) => {
|
|
112
124
|
const pawaAttribute=getPawaAttributes()
|
|
@@ -199,8 +211,7 @@ export class PawaElement {
|
|
|
199
211
|
this._out=true
|
|
200
212
|
this._el.remove()
|
|
201
213
|
if (callback) {
|
|
202
|
-
|
|
203
|
-
callback?.()
|
|
214
|
+
callback()
|
|
204
215
|
}
|
|
205
216
|
return true
|
|
206
217
|
}
|
|
@@ -353,7 +364,7 @@ export class PawaComment {
|
|
|
353
364
|
this._endComment=null
|
|
354
365
|
this._keyRemover=this.keyRemoveElement
|
|
355
366
|
this._resetForKeyElement=this.forKeyResetElement
|
|
356
|
-
this.
|
|
367
|
+
this._deletKey=this.deleteKey
|
|
357
368
|
}
|
|
358
369
|
static Element(element){
|
|
359
370
|
const pawa=new PawaComment(element)
|
|
@@ -379,15 +390,15 @@ export class PawaComment {
|
|
|
379
390
|
return
|
|
380
391
|
} else {
|
|
381
392
|
if (comment?.nextSibling?.nodeType === 8) {
|
|
393
|
+
// console.log(comment)
|
|
382
394
|
if(comment.nextSibling?._controlComponent){
|
|
383
395
|
comment.nextSibling._remove()
|
|
384
|
-
|
|
396
|
+
}else{
|
|
385
397
|
comment.nextSibling.remove()
|
|
386
398
|
}
|
|
387
399
|
|
|
388
400
|
} else if (comment.nextSibling.nodeType === 1) {
|
|
389
401
|
if (firstElement) {
|
|
390
|
-
console.log(callback)
|
|
391
402
|
await comment.nextSibling._remove(callback)
|
|
392
403
|
} else{
|
|
393
404
|
await comment.nextSibling._remove()
|