|
1 | 1 | /**
|
2 | 2 | * Interjs
|
3 |
| - * Version - 2.1.6 |
| 3 | + * Version - 2.1.7 |
4 | 4 | * MIT LICENSED BY - Denis Power
|
5 | 5 | * Repo - https://github.com/interjs/inter
|
6 | 6 | * 2021 - 2023
|
|
214 | 214 | }
|
215 | 215 |
|
216 | 216 | 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 |
218 | 218 | must be a plain Javascript object.`);
|
219 | 219 | }
|
220 | 220 |
|
|
260 | 260 | {
|
261 | 261 | element: ${child.nodeName.toLowerCase()},
|
262 | 262 | _ifNot: ${_ifNot},
|
263 |
| - data: ${Object.keys(data)} |
| 263 | + data: { ${Object.keys(data)} } |
264 | 264 | }
|
265 | 265 |
|
266 | 266 | `);
|
|
301 | 301 | {
|
302 | 302 | element: ${child.nodeName.toLowerCase()},
|
303 | 303 | _if: ${propValue},
|
304 |
| - data: ${Object.keys(data)} |
| 304 | + data: { ${Object.keys(data)} } |
305 | 305 | }
|
306 | 306 |
|
307 | 307 | `);
|
|
1229 | 1229 |
|
1230 | 1230 | const reservedProps = new Set(["setConds", "observe"]);
|
1231 | 1231 | const theContainer = getId(IN);
|
1232 |
| - const conditionalRenderingCache = new Set(); |
| 1232 | + const conditionalRenderingCache = new Array(); |
1233 | 1233 |
|
1234 | 1234 | // eslint-disable-next-line no-inner-declarations
|
1235 | 1235 | function parseAttrs(rootElement) {
|
|
1295 | 1295 | };
|
1296 | 1296 |
|
1297 | 1297 | 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); |
1299 | 1302 | };
|
1300 | 1303 |
|
1301 | 1304 | const rootElementChildNodes = getChildNodes(rootElement);
|
|
1419 | 1422 | }
|
1420 | 1423 | }
|
1421 | 1424 |
|
1422 |
| - function runRenderingSystem(cache /*Set*/, data) { |
1423 |
| - const ArrayOfOptions = Array.from(cache); |
1424 |
| - |
| 1425 | + function runRenderingSystem(ArrayOfOptions, data) { |
1425 | 1426 | function falsefyProps(conditionalProps, changedProp) {
|
1426 | 1427 | if (isFalse(proxyTarget[changedProp]) || conditionalProps.length < 2)
|
1427 | 1428 | return;
|
|
1494 | 1495 | ifNot,
|
1495 | 1496 | rootElement,
|
1496 | 1497 | } = options;
|
1497 |
| - const conditionalProps = Array.from(options.conditionalProps); |
| 1498 | + const conditionalProps = options.conditionalProps; |
| 1499 | + const isInConditionalGroup = new Set(conditionalProps).has(changedProp); |
1498 | 1500 |
|
1499 |
| - if (isDefined(changedProp)) falsefyProps(conditionalProps, changedProp); |
| 1501 | + if (isDefined(changedProp) && isInConditionalGroup) |
| 1502 | + falsefyProps(conditionalProps, changedProp); |
1500 | 1503 |
|
1501 | 1504 | if (ifNot) {
|
1502 | 1505 | if (isFalse(source[ifNot]) && target.parentNode == null) {
|
|
2148 | 2151 | "reverse",
|
2149 | 2152 | ];
|
2150 | 2153 |
|
2151 |
| - array.mutationInfo = void 0; |
2152 |
| - |
2153 | 2154 | for (const method of mutationMethods) {
|
2154 | 2155 | Object.defineProperty(array, method, {
|
2155 | 2156 | value(start, deleteCount, ...items) {
|
|
2192 | 2193 |
|
2193 | 2194 | renderingSystem();
|
2194 | 2195 |
|
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; |
2203 | 2197 |
|
2204 | 2198 | if (method === "push" || method === "unshift") {
|
2205 | 2199 | for (const arg of arguments) {
|
|
3343 | 3337 | window.template = template;
|
3344 | 3338 | window.toAttrs = toAttrs;
|
3345 | 3339 | 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."); |
3347 | 3341 | })();
|
0 commit comments