Skip to content

Commit f1c1479

Browse files
committed
Update to v2.1.7
1 parent b5bd0b6 commit f1c1479

File tree

4 files changed

+20
-26
lines changed

4 files changed

+20
-26
lines changed

inter.js

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Interjs
3-
* Version - 2.1.6
3+
* Version - 2.1.7
44
* MIT LICENSED BY - Denis Power
55
* Repo - https://github.com/interjs/inter
66
* 2021 - 2023
@@ -214,7 +214,7 @@
214214
}
215215

216216
function runInvalidRenderIfDataOptionError() {
217-
syErr(`The value of the "data" property on the renderIf function
217+
syErr(`The value of the "data" property in the renderIf function
218218
must be a plain Javascript object.`);
219219
}
220220

@@ -260,7 +260,7 @@
260260
{
261261
element: ${child.nodeName.toLowerCase()},
262262
_ifNot: ${_ifNot},
263-
data: ${Object.keys(data)}
263+
data: { ${Object.keys(data)} }
264264
}
265265
266266
`);
@@ -301,7 +301,7 @@
301301
{
302302
element: ${child.nodeName.toLowerCase()},
303303
_if: ${propValue},
304-
data: ${Object.keys(data)}
304+
data: { ${Object.keys(data)} }
305305
}
306306
307307
`);
@@ -1229,7 +1229,7 @@
12291229

12301230
const reservedProps = new Set(["setConds", "observe"]);
12311231
const theContainer = getId(IN);
1232-
const conditionalRenderingCache = new Set();
1232+
const conditionalRenderingCache = new Array();
12331233

12341234
// eslint-disable-next-line no-inner-declarations
12351235
function parseAttrs(rootElement) {
@@ -1295,7 +1295,10 @@
12951295
};
12961296

12971297
const cacheParserOptions = () => {
1298-
conditionalRenderingCache.add(parserOptions.getOptions());
1298+
const conditionalGroup = parserOptions.elseIfs.size;
1299+
const options = parserOptions.getOptions();
1300+
if (conditionalGroup) conditionalRenderingCache.unshift(options);
1301+
else conditionalRenderingCache.push(options);
12991302
};
13001303

13011304
const rootElementChildNodes = getChildNodes(rootElement);
@@ -1419,9 +1422,7 @@
14191422
}
14201423
}
14211424

1422-
function runRenderingSystem(cache /*Set*/, data) {
1423-
const ArrayOfOptions = Array.from(cache);
1424-
1425+
function runRenderingSystem(ArrayOfOptions, data) {
14251426
function falsefyProps(conditionalProps, changedProp) {
14261427
if (isFalse(proxyTarget[changedProp]) || conditionalProps.length < 2)
14271428
return;
@@ -1494,9 +1495,11 @@
14941495
ifNot,
14951496
rootElement,
14961497
} = options;
1497-
const conditionalProps = Array.from(options.conditionalProps);
1498+
const conditionalProps = options.conditionalProps;
1499+
const isInConditionalGroup = new Set(conditionalProps).has(changedProp);
14981500

1499-
if (isDefined(changedProp)) falsefyProps(conditionalProps, changedProp);
1501+
if (isDefined(changedProp) && isInConditionalGroup)
1502+
falsefyProps(conditionalProps, changedProp);
15001503

15011504
if (ifNot) {
15021505
if (isFalse(source[ifNot]) && target.parentNode == null) {
@@ -2148,8 +2151,6 @@
21482151
"reverse",
21492152
];
21502153

2151-
array.mutationInfo = void 0;
2152-
21532154
for (const method of mutationMethods) {
21542155
Object.defineProperty(array, method, {
21552156
value(start, deleteCount, ...items) {
@@ -2192,14 +2193,7 @@
21922193

21932194
renderingSystem();
21942195

2195-
this.mutationInfo = {
2196-
method: void 0,
2197-
removeInfo: [],
2198-
do: void 0,
2199-
newData: [],
2200-
from: void 0,
2201-
to: void 0,
2202-
};
2196+
this.mutationInfo = void 0;
22032197

22042198
if (method === "push" || method === "unshift") {
22052199
for (const arg of arguments) {
@@ -3343,5 +3337,5 @@
33433337
window.template = template;
33443338
window.toAttrs = toAttrs;
33453339
window.Backend = Backend;
3346-
console.log("The global version 2.1.6 of Inter was loaded successfully.");
3340+
console.log("The global version 2.1.7 of Inter was loaded successfully.");
33473341
})();

inter.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)