@tko/build.knockout 4.0.0 → 4.1.0
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/dist/browser.js +699 -544
- package/dist/browser.js.map +4 -4
- package/dist/browser.min.js +11 -11
- package/dist/browser.min.js.map +4 -4
- package/dist/index.cjs +41 -8514
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +6 -15
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +6 -15
- package/dist/index.mjs.map +2 -2
- package/package.json +34 -32
- package/dist/common.js +0 -3
- package/dist/common.js.map +0 -7
- package/helpers/jasmine.extensions.js +0 -209
package/dist/browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @tko/build.knockout 🥊 4.
|
|
1
|
+
// @tko/build.knockout 🥊 4.1.0 IIFE
|
|
2
2
|
"use strict";
|
|
3
3
|
var ko = (() => {
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -10,6 +10,7 @@ var ko = (() => {
|
|
|
10
10
|
throw TypeError(msg);
|
|
11
11
|
};
|
|
12
12
|
var __pow = Math.pow;
|
|
13
|
+
var __defNormalProp = (obj, key, value2) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key] = value2;
|
|
13
14
|
var __export = (target, all) => {
|
|
14
15
|
for (var name in all)
|
|
15
16
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -23,6 +24,7 @@ var ko = (() => {
|
|
|
23
24
|
return to;
|
|
24
25
|
};
|
|
25
26
|
var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2);
|
|
27
|
+
var __publicField = (obj, key, value2) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value2);
|
|
26
28
|
var __accessCheck = (obj, member2, msg) => member2.has(obj) || __typeError("Cannot " + msg);
|
|
27
29
|
var __privateGet = (obj, member2, getter) => (__accessCheck(obj, member2, "read from private field"), getter ? getter.call(obj) : member2.get(obj));
|
|
28
30
|
var __privateAdd = (obj, member2, value2) => member2.has(obj) ? __typeError("Cannot add the same private member more than once") : member2 instanceof WeakSet ? member2.add(obj) : member2.set(obj, value2);
|
|
@@ -86,7 +88,7 @@ var ko = (() => {
|
|
|
86
88
|
default: () => index_default
|
|
87
89
|
});
|
|
88
90
|
|
|
89
|
-
// ../../packages/utils/
|
|
91
|
+
// ../../packages/utils/src/array.ts
|
|
90
92
|
var { isArray } = Array;
|
|
91
93
|
function arrayForEach(array, action, actionOwner) {
|
|
92
94
|
if (arguments.length > 2) {
|
|
@@ -182,17 +184,17 @@ var ko = (() => {
|
|
|
182
184
|
}
|
|
183
185
|
var statusNotInOld = "added";
|
|
184
186
|
var statusNotInNew = "deleted";
|
|
185
|
-
function compareArrays(oldArray, newArray,
|
|
186
|
-
|
|
187
|
+
function compareArrays(oldArray, newArray, options4) {
|
|
188
|
+
options4 = typeof options4 === "boolean" ? { dontLimitMoves: options4 } : options4 || {};
|
|
187
189
|
oldArray = oldArray || [];
|
|
188
190
|
newArray = newArray || [];
|
|
189
191
|
if (oldArray.length < newArray.length) {
|
|
190
|
-
return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew,
|
|
192
|
+
return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options4);
|
|
191
193
|
} else {
|
|
192
|
-
return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld,
|
|
194
|
+
return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options4);
|
|
193
195
|
}
|
|
194
196
|
}
|
|
195
|
-
function compareSmallArrayToBigArray(smlArray, bigArray, statusNotInSml, statusNotInBig,
|
|
197
|
+
function compareSmallArrayToBigArray(smlArray, bigArray, statusNotInSml, statusNotInBig, options4) {
|
|
196
198
|
let myMin = Math.min, myMax = Math.max, editDistanceMatrix = new Array(), smlIndex, smlIndexMax = smlArray.length, bigIndex, bigIndexMax = bigArray.length, compareRange = bigIndexMax - smlIndexMax || 1, maxDistance = smlIndexMax + bigIndexMax + 1, thisRow, lastRow, bigIndexMaxForRow, bigIndexMinForRow;
|
|
197
199
|
for (smlIndex = 0; smlIndex <= smlIndexMax; smlIndex++) {
|
|
198
200
|
lastRow = thisRow;
|
|
@@ -237,56 +239,82 @@ var ko = (() => {
|
|
|
237
239
|
} else {
|
|
238
240
|
--bigIndex;
|
|
239
241
|
--smlIndex;
|
|
240
|
-
if (!(
|
|
242
|
+
if (!(options4 == null ? void 0 : options4.sparse)) {
|
|
241
243
|
editScript.push({ status: "retained", value: bigArray[bigIndex] });
|
|
242
244
|
}
|
|
243
245
|
}
|
|
244
246
|
}
|
|
245
|
-
findMovesInArrayComparison(notInBig, notInSml, !
|
|
247
|
+
findMovesInArrayComparison(notInBig, notInSml, !options4.dontLimitMoves && smlIndexMax * 10);
|
|
246
248
|
return editScript.reverse();
|
|
247
249
|
}
|
|
248
250
|
|
|
249
|
-
// ../../packages/utils/
|
|
251
|
+
// ../../packages/utils/src/options.ts
|
|
250
252
|
var Options = class {
|
|
251
253
|
constructor() {
|
|
252
|
-
|
|
253
|
-
this
|
|
254
|
-
|
|
255
|
-
this
|
|
256
|
-
this
|
|
257
|
-
this
|
|
258
|
-
this
|
|
259
|
-
|
|
260
|
-
this
|
|
261
|
-
this
|
|
262
|
-
|
|
263
|
-
this
|
|
264
|
-
|
|
265
|
-
this
|
|
266
|
-
|
|
267
|
-
this
|
|
268
|
-
|
|
269
|
-
this
|
|
270
|
-
|
|
271
|
-
this
|
|
272
|
-
|
|
273
|
-
|
|
254
|
+
// The following options can be set on ko.options to make a function rewriting or something similar.
|
|
255
|
+
__publicField(this, "bindingStringPreparsers", []);
|
|
256
|
+
// Reference to the own knockout instance
|
|
257
|
+
__publicField(this, "knockoutInstance", null);
|
|
258
|
+
__publicField(this, "deferUpdates", false);
|
|
259
|
+
// Don't set this false, with jquery 3.7+
|
|
260
|
+
__publicField(this, "useOnlyNativeEvents", true);
|
|
261
|
+
// Use HTML5 <template> tags if is supported
|
|
262
|
+
__publicField(this, "useTemplateTag", true);
|
|
263
|
+
__publicField(this, "protoProperty", "__ko_proto__");
|
|
264
|
+
// Modify the default attribute from `data-bind`.
|
|
265
|
+
__publicField(this, "defaultBindingAttribute", "data-bind");
|
|
266
|
+
// Enable/disable <!-- ko binding: ... -> style bindings
|
|
267
|
+
__publicField(this, "allowVirtualElements", true);
|
|
268
|
+
// Global variables that can be accessed from bindings.
|
|
269
|
+
__publicField(this, "bindingGlobals", /* @__PURE__ */ Object.create(null));
|
|
270
|
+
// An instance of the binding provider.
|
|
271
|
+
__publicField(this, "bindingProviderInstance");
|
|
272
|
+
// Whether the `with` binding creates a child context when used with `as`.
|
|
273
|
+
__publicField(this, "createChildContextWithAs", false);
|
|
274
|
+
// jQuery will be automatically set to globalThis.jQuery in applyBindings
|
|
275
|
+
// if it is (strictly equal to) undefined. Set it to true to
|
|
276
|
+
// disable automatically setting jQuery.
|
|
277
|
+
__publicField(this, "disableJQueryUsage", false);
|
|
278
|
+
__publicField(this, "_jQuery");
|
|
279
|
+
__publicField(this, "Promise", globalThis.Promise);
|
|
280
|
+
__publicField(this, "taskScheduler", null);
|
|
281
|
+
__publicField(this, "debug", false);
|
|
282
|
+
/**
|
|
283
|
+
* The maximum size of template to parse.
|
|
284
|
+
* Set to 0 to disable the limit.
|
|
285
|
+
*/
|
|
286
|
+
__publicField(this, "templateSizeLimit", 4096);
|
|
287
|
+
/**
|
|
288
|
+
* Whether or not to allow script tags in templates.
|
|
289
|
+
* If false, an error will be thrown if a script tag is detected in the template.
|
|
290
|
+
* It is not recommended to set this to true.
|
|
291
|
+
*/
|
|
292
|
+
__publicField(this, "allowScriptTagsInTemplates", false);
|
|
293
|
+
__publicField(this, "_sanitizeWarningLogged", false);
|
|
294
|
+
__publicField(this, "global", globalThis);
|
|
295
|
+
__publicField(this, "document", globalThis.document);
|
|
296
|
+
// Filters for bindings
|
|
297
|
+
// data-bind="expression | filter_1 | filter_2"
|
|
298
|
+
__publicField(this, "filters", {});
|
|
299
|
+
// Used by the template binding.
|
|
300
|
+
__publicField(this, "includeDestroyed", false);
|
|
301
|
+
__publicField(this, "foreachHidesDestroyed", false);
|
|
274
302
|
}
|
|
275
303
|
get jQuery() {
|
|
276
|
-
var
|
|
277
|
-
if (this.disableJQueryUsage) return;
|
|
278
|
-
return (
|
|
304
|
+
var _a2;
|
|
305
|
+
if (this.disableJQueryUsage) return void 0;
|
|
306
|
+
return (_a2 = this._jQuery) != null ? _a2 : globalThis.jQuery;
|
|
279
307
|
}
|
|
280
308
|
/**
|
|
281
309
|
* Set jQuery manuall to be used by TKO.
|
|
282
310
|
* @param jQuery If jQuery set to undefined, TKO will not use jQuery and this.disableJQueryUsage to true.
|
|
283
311
|
*/
|
|
284
|
-
set jQuery(
|
|
285
|
-
if (!
|
|
312
|
+
set jQuery(jQuery) {
|
|
313
|
+
if (!jQuery) {
|
|
286
314
|
this.disableJQueryUsage = true;
|
|
287
315
|
this._jQuery = void 0;
|
|
288
316
|
} else {
|
|
289
|
-
this._jQuery =
|
|
317
|
+
this._jQuery = jQuery;
|
|
290
318
|
this.disableJQueryUsage = false;
|
|
291
319
|
}
|
|
292
320
|
}
|
|
@@ -320,9 +348,26 @@ var ko = (() => {
|
|
|
320
348
|
}
|
|
321
349
|
};
|
|
322
350
|
var options = new Options();
|
|
351
|
+
function defineOption(name, config) {
|
|
352
|
+
var _a2;
|
|
353
|
+
let _value = config.default;
|
|
354
|
+
Object.defineProperty(options, name, {
|
|
355
|
+
get() {
|
|
356
|
+
return _value;
|
|
357
|
+
},
|
|
358
|
+
set(value2) {
|
|
359
|
+
var _a3;
|
|
360
|
+
_value = value2;
|
|
361
|
+
(_a3 = config.set) == null ? void 0 : _a3.call(config, value2);
|
|
362
|
+
},
|
|
363
|
+
enumerable: true,
|
|
364
|
+
configurable: true
|
|
365
|
+
});
|
|
366
|
+
(_a2 = config.set) == null ? void 0 : _a2.call(config, _value);
|
|
367
|
+
}
|
|
323
368
|
var options_default = options;
|
|
324
369
|
|
|
325
|
-
// ../../packages/utils/
|
|
370
|
+
// ../../packages/utils/src/error.ts
|
|
326
371
|
function catchFunctionErrors(delegate) {
|
|
327
372
|
if (!options_default.onError) {
|
|
328
373
|
return delegate;
|
|
@@ -344,7 +389,7 @@ var ko = (() => {
|
|
|
344
389
|
return setTimeout(catchFunctionErrors(handler), timeout);
|
|
345
390
|
}
|
|
346
391
|
|
|
347
|
-
// ../../packages/utils/
|
|
392
|
+
// ../../packages/utils/src/async.ts
|
|
348
393
|
function throttle(callback, timeout) {
|
|
349
394
|
let timeoutInstance;
|
|
350
395
|
return function(...args) {
|
|
@@ -364,7 +409,12 @@ var ko = (() => {
|
|
|
364
409
|
};
|
|
365
410
|
}
|
|
366
411
|
|
|
367
|
-
// ../../packages/utils/
|
|
412
|
+
// ../../packages/utils/src/compat.ts
|
|
413
|
+
function createSymbolOrString(identifier) {
|
|
414
|
+
return Symbol(identifier);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// ../../packages/utils/src/object.ts
|
|
368
418
|
function hasOwnProperty(obj, propName) {
|
|
369
419
|
return Object.prototype.hasOwnProperty.call(obj, propName);
|
|
370
420
|
}
|
|
@@ -442,77 +492,34 @@ var ko = (() => {
|
|
|
442
492
|
return isObjectLike(object) && typeof object.then === "function";
|
|
443
493
|
}
|
|
444
494
|
|
|
445
|
-
// ../../packages/utils/
|
|
446
|
-
function testOverwrite() {
|
|
447
|
-
try {
|
|
448
|
-
Object.defineProperty(function x() {
|
|
449
|
-
}, "length", {});
|
|
450
|
-
return true;
|
|
451
|
-
} catch (e) {
|
|
452
|
-
return false;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
var functionSupportsLengthOverwrite = testOverwrite();
|
|
456
|
-
function overwriteLengthPropertyIfSupported(fn, descriptor) {
|
|
457
|
-
if (functionSupportsLengthOverwrite) {
|
|
458
|
-
Object.defineProperty(fn, "length", descriptor);
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
// ../../packages/utils/dist/string.js
|
|
463
|
-
function stringTrim(string) {
|
|
464
|
-
return string === null || string === void 0 ? "" : string.trim ? string.trim() : string.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, "");
|
|
465
|
-
}
|
|
466
|
-
function stringStartsWith(string, startsWith) {
|
|
467
|
-
string = string || "";
|
|
468
|
-
if (startsWith.length > string.length) {
|
|
469
|
-
return false;
|
|
470
|
-
}
|
|
471
|
-
return string.substring(0, startsWith.length) === startsWith;
|
|
472
|
-
}
|
|
495
|
+
// ../../packages/utils/src/string.ts
|
|
473
496
|
function parseJson(jsonString) {
|
|
474
497
|
if (typeof jsonString === "string") {
|
|
475
|
-
|
|
476
|
-
if (
|
|
477
|
-
return JSON.parse(
|
|
498
|
+
const trimmed = jsonString.trim();
|
|
499
|
+
if (trimmed) {
|
|
500
|
+
return JSON.parse(trimmed);
|
|
478
501
|
}
|
|
479
502
|
}
|
|
480
503
|
return null;
|
|
481
504
|
}
|
|
482
505
|
|
|
483
|
-
// ../../packages/utils/
|
|
484
|
-
var useSymbols = typeof Symbol === "function";
|
|
485
|
-
function createSymbolOrString(identifier) {
|
|
486
|
-
return useSymbols ? Symbol(identifier) : identifier;
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
// ../../packages/utils/dist/css.js
|
|
506
|
+
// ../../packages/utils/src/css.ts
|
|
490
507
|
var cssClassNameRegex = /\S+/g;
|
|
491
508
|
function toggleDomNodeCssClass(node, classNames, shouldHaveClass) {
|
|
492
|
-
let addOrRemoveFn;
|
|
493
509
|
if (!classNames) {
|
|
494
510
|
return;
|
|
495
511
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
} else {
|
|
504
|
-
toggleObjectClassPropertyString(node, "className", classNames, shouldHaveClass);
|
|
512
|
+
const tokens = classNames.match(cssClassNameRegex);
|
|
513
|
+
if (!tokens) {
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
const method = shouldHaveClass ? "add" : "remove";
|
|
517
|
+
for (const token of tokens) {
|
|
518
|
+
node.classList[method](token);
|
|
505
519
|
}
|
|
506
|
-
}
|
|
507
|
-
function toggleObjectClassPropertyString(obj, prop, classNames, shouldHaveClass) {
|
|
508
|
-
const currentClassNames = obj[prop].match(cssClassNameRegex) || [];
|
|
509
|
-
arrayForEach(classNames.match(cssClassNameRegex), function(className) {
|
|
510
|
-
addOrRemoveItem(currentClassNames, className, shouldHaveClass);
|
|
511
|
-
});
|
|
512
|
-
obj[prop] = currentClassNames.join(" ");
|
|
513
520
|
}
|
|
514
521
|
|
|
515
|
-
// ../../packages/utils/
|
|
522
|
+
// ../../packages/utils/src/dom/info.ts
|
|
516
523
|
function domNodeIsContainedBy(node, containedByNode) {
|
|
517
524
|
if (node === containedByNode) {
|
|
518
525
|
return true;
|
|
@@ -556,7 +563,7 @@ var ko = (() => {
|
|
|
556
563
|
}
|
|
557
564
|
}
|
|
558
565
|
|
|
559
|
-
// ../../packages/utils/
|
|
566
|
+
// ../../packages/utils/src/dom/event.ts
|
|
560
567
|
var knownEvents = {};
|
|
561
568
|
var knownEventTypesByEventName = {};
|
|
562
569
|
knownEvents["UIEvents"] = ["keyup", "keydown", "keypress"];
|
|
@@ -587,9 +594,9 @@ var ko = (() => {
|
|
|
587
594
|
function registerEventHandler(element, eventType, handler, eventOptions = false) {
|
|
588
595
|
const wrappedHandler = catchFunctionErrors(handler);
|
|
589
596
|
const mustUseNative = Boolean(eventOptions);
|
|
590
|
-
const
|
|
591
|
-
if (!options_default.useOnlyNativeEvents && !mustUseNative &&
|
|
592
|
-
|
|
597
|
+
const jQuery = options_default.jQuery;
|
|
598
|
+
if (!options_default.useOnlyNativeEvents && !mustUseNative && jQuery) {
|
|
599
|
+
jQuery(element).on(eventType, wrappedHandler);
|
|
593
600
|
} else if (typeof element.addEventListener === "function") {
|
|
594
601
|
element.addEventListener(eventType, wrappedHandler, eventOptions);
|
|
595
602
|
} else {
|
|
@@ -606,39 +613,29 @@ var ko = (() => {
|
|
|
606
613
|
const useClickWorkaround = isClickOnCheckableElement(element, eventType);
|
|
607
614
|
if (!options_default.useOnlyNativeEvents && options_default.jQuery && !useClickWorkaround) {
|
|
608
615
|
options_default.jQuery(element).trigger(eventType);
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
true,
|
|
616
|
-
true,
|
|
617
|
-
options_default.global,
|
|
618
|
-
0,
|
|
619
|
-
0,
|
|
620
|
-
0,
|
|
621
|
-
0,
|
|
622
|
-
0,
|
|
623
|
-
false,
|
|
624
|
-
false,
|
|
625
|
-
false,
|
|
626
|
-
false,
|
|
627
|
-
0,
|
|
628
|
-
element
|
|
629
|
-
);
|
|
630
|
-
element.dispatchEvent(event);
|
|
631
|
-
} else {
|
|
632
|
-
throw new Error("The supplied element doesn't support dispatchEvent");
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
if (typeof element.dispatchEvent !== "function") {
|
|
619
|
+
if (useClickWorkaround && hasClick(element)) {
|
|
620
|
+
element.click();
|
|
621
|
+
return;
|
|
633
622
|
}
|
|
634
|
-
|
|
635
|
-
|
|
623
|
+
throw new Error("The supplied element doesn't support dispatchEvent");
|
|
624
|
+
}
|
|
625
|
+
const eventCategory = knownEventTypesByEventName[eventType] || "HTMLEvents";
|
|
626
|
+
const view = options_default.global;
|
|
627
|
+
let event;
|
|
628
|
+
if (eventCategory === "MouseEvents" && typeof MouseEvent === "function") {
|
|
629
|
+
event = new MouseEvent(eventType, { bubbles: true, cancelable: true, view, relatedTarget: element });
|
|
630
|
+
} else if (eventCategory === "UIEvents" && typeof KeyboardEvent === "function") {
|
|
631
|
+
event = new KeyboardEvent(eventType, { bubbles: true, cancelable: true, view });
|
|
636
632
|
} else {
|
|
637
|
-
|
|
633
|
+
event = new Event(eventType, { bubbles: true, cancelable: true });
|
|
638
634
|
}
|
|
635
|
+
element.dispatchEvent(event);
|
|
639
636
|
}
|
|
640
637
|
|
|
641
|
-
// ../../packages/utils/
|
|
638
|
+
// ../../packages/utils/src/dom/data.ts
|
|
642
639
|
var data_exports = {};
|
|
643
640
|
__export(data_exports, {
|
|
644
641
|
clear: () => clear,
|
|
@@ -697,7 +694,7 @@ var ko = (() => {
|
|
|
697
694
|
return dataForNode[key] || (dataForNode[key] = value2);
|
|
698
695
|
}
|
|
699
696
|
|
|
700
|
-
// ../../packages/utils/
|
|
697
|
+
// ../../packages/utils/src/dom/disposal.ts
|
|
701
698
|
var domDataKey = nextKey();
|
|
702
699
|
var cleanableNodeTypes = { 1: true, 8: true, 9: true };
|
|
703
700
|
var cleanableNodeTypesWithDescendants = { 1: true, 9: true };
|
|
@@ -799,7 +796,7 @@ var ko = (() => {
|
|
|
799
796
|
}
|
|
800
797
|
otherNodeCleanerFunctions.push(cleanjQueryData);
|
|
801
798
|
|
|
802
|
-
// ../../packages/utils/
|
|
799
|
+
// ../../packages/utils/src/dom/manipulation.ts
|
|
803
800
|
function moveCleanedNodesToContainerElement(nodes) {
|
|
804
801
|
const nodesArray = makeArray(nodes);
|
|
805
802
|
const templateDocument = nodesArray[0] && nodesArray[0].ownerDocument || document;
|
|
@@ -844,7 +841,7 @@ var ko = (() => {
|
|
|
844
841
|
}
|
|
845
842
|
}
|
|
846
843
|
|
|
847
|
-
// ../../packages/utils/
|
|
844
|
+
// ../../packages/utils/src/dom/fixes.ts
|
|
848
845
|
function fixUpContinuousNodeArray(continuousNodeArray, parentNode) {
|
|
849
846
|
if (continuousNodeArray.length) {
|
|
850
847
|
parentNode = parentNode.nodeType === Node.COMMENT_NODE && parentNode.parentNode || parentNode;
|
|
@@ -870,7 +867,7 @@ var ko = (() => {
|
|
|
870
867
|
optionNode.selected = isSelected;
|
|
871
868
|
}
|
|
872
869
|
|
|
873
|
-
// ../../packages/utils/
|
|
870
|
+
// ../../packages/utils/src/dom/virtualElements.ts
|
|
874
871
|
var virtualElements_exports = {};
|
|
875
872
|
__export(virtualElements_exports, {
|
|
876
873
|
allowedBindings: () => allowedBindings,
|
|
@@ -992,7 +989,7 @@ var ko = (() => {
|
|
|
992
989
|
}
|
|
993
990
|
}
|
|
994
991
|
function prepend(containerNode, nodeToPrepend) {
|
|
995
|
-
var
|
|
992
|
+
var _a2;
|
|
996
993
|
if (!isStartComment(containerNode)) {
|
|
997
994
|
if (containerNode.firstChild) {
|
|
998
995
|
containerNode.insertBefore(nodeToPrepend, containerNode.firstChild);
|
|
@@ -1000,11 +997,11 @@ var ko = (() => {
|
|
|
1000
997
|
containerNode.appendChild(nodeToPrepend);
|
|
1001
998
|
}
|
|
1002
999
|
} else {
|
|
1003
|
-
(
|
|
1000
|
+
(_a2 = containerNode.parentNode) == null ? void 0 : _a2.insertBefore(nodeToPrepend, containerNode.nextSibling);
|
|
1004
1001
|
}
|
|
1005
1002
|
}
|
|
1006
1003
|
function insertAfter(containerNode, nodeToInsert, insertAfterNode) {
|
|
1007
|
-
var
|
|
1004
|
+
var _a2;
|
|
1008
1005
|
if (!insertAfterNode) {
|
|
1009
1006
|
prepend(containerNode, nodeToInsert);
|
|
1010
1007
|
} else if (!isStartComment(containerNode)) {
|
|
@@ -1014,7 +1011,7 @@ var ko = (() => {
|
|
|
1014
1011
|
containerNode.appendChild(nodeToInsert);
|
|
1015
1012
|
}
|
|
1016
1013
|
} else {
|
|
1017
|
-
(
|
|
1014
|
+
(_a2 = containerNode.parentNode) == null ? void 0 : _a2.insertBefore(nodeToInsert, insertAfterNode.nextSibling);
|
|
1018
1015
|
}
|
|
1019
1016
|
}
|
|
1020
1017
|
function firstChild(node) {
|
|
@@ -1099,7 +1096,7 @@ var ko = (() => {
|
|
|
1099
1096
|
}
|
|
1100
1097
|
}
|
|
1101
1098
|
|
|
1102
|
-
// ../../packages/utils/
|
|
1099
|
+
// ../../packages/utils/src/dom/html.ts
|
|
1103
1100
|
var supportsTemplateTag = options_default.useTemplateTag && options_default.document && "content" in options_default.document.createElement("template");
|
|
1104
1101
|
function simpleHtmlParse(html2, documentContext) {
|
|
1105
1102
|
if (!documentContext) {
|
|
@@ -1118,9 +1115,9 @@ var ko = (() => {
|
|
|
1118
1115
|
return makeArray(template.content.childNodes);
|
|
1119
1116
|
}
|
|
1120
1117
|
function jQueryHtmlParse(html2, documentContext) {
|
|
1121
|
-
const
|
|
1122
|
-
if (
|
|
1123
|
-
return
|
|
1118
|
+
const jQuery = options_default.jQuery;
|
|
1119
|
+
if (jQuery) {
|
|
1120
|
+
return jQuery.parseHTML(html2, documentContext) || [];
|
|
1124
1121
|
}
|
|
1125
1122
|
return [];
|
|
1126
1123
|
}
|
|
@@ -1156,10 +1153,10 @@ var ko = (() => {
|
|
|
1156
1153
|
if (typeof html2 !== "string") {
|
|
1157
1154
|
html2 = html2.toString();
|
|
1158
1155
|
}
|
|
1159
|
-
const
|
|
1160
|
-
if (
|
|
1156
|
+
const jQuery = options_default.jQuery;
|
|
1157
|
+
if (jQuery && !supportsTemplateTag) {
|
|
1161
1158
|
const saferHtml = validateHTMLInput(html2);
|
|
1162
|
-
|
|
1159
|
+
jQuery(node).html(saferHtml);
|
|
1163
1160
|
} else {
|
|
1164
1161
|
let parsedNodes;
|
|
1165
1162
|
if (node.ownerDocument) {
|
|
@@ -1195,7 +1192,7 @@ var ko = (() => {
|
|
|
1195
1192
|
}
|
|
1196
1193
|
}
|
|
1197
1194
|
|
|
1198
|
-
// ../../packages/utils/
|
|
1195
|
+
// ../../packages/utils/src/dom/selectExtensions.ts
|
|
1199
1196
|
var hasDomDataExpandoProperty = /* @__PURE__ */ Symbol("Knockout selectExtensions hasDomDataProperty");
|
|
1200
1197
|
var selectExtensions = {
|
|
1201
1198
|
optionValueDomDataKey: nextKey(),
|
|
@@ -1241,10 +1238,10 @@ var ko = (() => {
|
|
|
1241
1238
|
const selectElement = element;
|
|
1242
1239
|
for (let i = 0, n = selectElement.options.length, optionValue; i < n; ++i) {
|
|
1243
1240
|
optionValue = selectExtensions.readValue(selectElement.options[i]);
|
|
1244
|
-
const
|
|
1241
|
+
const strictEqual2 = optionValue === value2;
|
|
1245
1242
|
const blankEqual = optionValue === "" && value2 === void 0;
|
|
1246
1243
|
const numericEqual = typeof value2 === "number" && Number(optionValue) === value2;
|
|
1247
|
-
if (
|
|
1244
|
+
if (strictEqual2 || blankEqual || numericEqual) {
|
|
1248
1245
|
selection = i;
|
|
1249
1246
|
break;
|
|
1250
1247
|
}
|
|
@@ -1265,7 +1262,7 @@ var ko = (() => {
|
|
|
1265
1262
|
}
|
|
1266
1263
|
};
|
|
1267
1264
|
|
|
1268
|
-
// ../../packages/utils/
|
|
1265
|
+
// ../../packages/utils/src/memoization.ts
|
|
1269
1266
|
var memoization_exports = {};
|
|
1270
1267
|
__export(memoization_exports, {
|
|
1271
1268
|
memoize: () => memoize,
|
|
@@ -1340,7 +1337,7 @@ var ko = (() => {
|
|
|
1340
1337
|
return match ? match[1] : null;
|
|
1341
1338
|
}
|
|
1342
1339
|
|
|
1343
|
-
// ../../packages/utils/
|
|
1340
|
+
// ../../packages/utils/src/tasks.ts
|
|
1344
1341
|
var tasks_exports = {};
|
|
1345
1342
|
__export(tasks_exports, {
|
|
1346
1343
|
cancel: () => cancel,
|
|
@@ -1352,19 +1349,28 @@ var ko = (() => {
|
|
|
1352
1349
|
var taskQueueLength = 0;
|
|
1353
1350
|
var nextHandle = 1;
|
|
1354
1351
|
var nextIndexToProcess = 0;
|
|
1355
|
-
var
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1352
|
+
var schedulerGlobal = options_default.global;
|
|
1353
|
+
var _a;
|
|
1354
|
+
if (schedulerGlobal && typeof schedulerGlobal.queueMicrotask === "function") {
|
|
1355
|
+
options_default.taskScheduler = (callback) => schedulerGlobal.queueMicrotask(callback);
|
|
1356
|
+
} else if ((schedulerGlobal == null ? void 0 : schedulerGlobal.MutationObserver) && schedulerGlobal.document && !((_a = schedulerGlobal.navigator) == null ? void 0 : _a.standalone)) {
|
|
1357
|
+
options_default.taskScheduler = (function() {
|
|
1358
|
+
let scheduledCallback = null;
|
|
1359
|
+
let toggle = false;
|
|
1360
|
+
const div2 = schedulerGlobal.document.createElement("div");
|
|
1361
|
+
new schedulerGlobal.MutationObserver(function() {
|
|
1362
|
+
const callback = scheduledCallback;
|
|
1363
|
+
scheduledCallback = null;
|
|
1364
|
+
callback == null ? void 0 : callback();
|
|
1365
|
+
}).observe(div2, { attributes: true });
|
|
1366
|
+
return function(callback) {
|
|
1367
|
+
scheduledCallback = callback;
|
|
1368
|
+
toggle = !toggle;
|
|
1369
|
+
div2.setAttribute("data-task-scheduler", toggle ? "1" : "0");
|
|
1362
1370
|
};
|
|
1363
|
-
})(
|
|
1371
|
+
})();
|
|
1364
1372
|
} else {
|
|
1365
|
-
options_default.taskScheduler =
|
|
1366
|
-
setTimeout(callback, 0);
|
|
1367
|
-
};
|
|
1373
|
+
options_default.taskScheduler = (callback) => setTimeout(callback, 0);
|
|
1368
1374
|
}
|
|
1369
1375
|
function processTasks() {
|
|
1370
1376
|
if (taskQueueLength) {
|
|
@@ -1414,7 +1420,7 @@ var ko = (() => {
|
|
|
1414
1420
|
return length;
|
|
1415
1421
|
}
|
|
1416
1422
|
|
|
1417
|
-
// ../../packages/observable/
|
|
1423
|
+
// ../../packages/observable/src/dependencyDetection.ts
|
|
1418
1424
|
var dependencyDetection_exports = {};
|
|
1419
1425
|
__export(dependencyDetection_exports, {
|
|
1420
1426
|
begin: () => begin,
|
|
@@ -1427,22 +1433,22 @@ var ko = (() => {
|
|
|
1427
1433
|
registerDependency: () => registerDependency
|
|
1428
1434
|
});
|
|
1429
1435
|
|
|
1430
|
-
// ../../packages/observable/
|
|
1436
|
+
// ../../packages/observable/src/subscribableSymbol.ts
|
|
1431
1437
|
var SUBSCRIBABLE_SYM = /* @__PURE__ */ Symbol("Knockout Subscribable");
|
|
1432
1438
|
function isSubscribable(instance) {
|
|
1433
1439
|
return instance && instance[SUBSCRIBABLE_SYM] || false;
|
|
1434
1440
|
}
|
|
1435
1441
|
|
|
1436
|
-
// ../../packages/observable/
|
|
1442
|
+
// ../../packages/observable/src/dependencyDetection.ts
|
|
1437
1443
|
var outerFrames = new Array();
|
|
1438
1444
|
var currentFrame;
|
|
1439
1445
|
var lastId = 0;
|
|
1440
1446
|
function getId() {
|
|
1441
1447
|
return ++lastId;
|
|
1442
1448
|
}
|
|
1443
|
-
function begin(
|
|
1449
|
+
function begin(options4) {
|
|
1444
1450
|
outerFrames.push(currentFrame);
|
|
1445
|
-
currentFrame =
|
|
1451
|
+
currentFrame = options4;
|
|
1446
1452
|
}
|
|
1447
1453
|
function end() {
|
|
1448
1454
|
currentFrame = outerFrames.pop();
|
|
@@ -1486,7 +1492,7 @@ var ko = (() => {
|
|
|
1486
1492
|
return void 0;
|
|
1487
1493
|
}
|
|
1488
1494
|
|
|
1489
|
-
// ../../packages/observable/
|
|
1495
|
+
// ../../packages/observable/src/defer.ts
|
|
1490
1496
|
function deferUpdates(target) {
|
|
1491
1497
|
if (target._deferUpdates) {
|
|
1492
1498
|
return;
|
|
@@ -1510,9 +1516,15 @@ var ko = (() => {
|
|
|
1510
1516
|
});
|
|
1511
1517
|
}
|
|
1512
1518
|
|
|
1513
|
-
// ../../packages/observable/
|
|
1519
|
+
// ../../packages/observable/src/Subscription.ts
|
|
1514
1520
|
var Subscription = class {
|
|
1515
1521
|
constructor(target, observer, disposeCallback) {
|
|
1522
|
+
__publicField(this, "_disposeCallback");
|
|
1523
|
+
__publicField(this, "_target");
|
|
1524
|
+
__publicField(this, "_callback");
|
|
1525
|
+
__publicField(this, "_isDisposed");
|
|
1526
|
+
__publicField(this, "_domNodeDisposalCallback");
|
|
1527
|
+
__publicField(this, "_node");
|
|
1516
1528
|
this._target = target;
|
|
1517
1529
|
this._callback = observer.next;
|
|
1518
1530
|
this._disposeCallback = disposeCallback;
|
|
@@ -1539,7 +1551,7 @@ var ko = (() => {
|
|
|
1539
1551
|
}
|
|
1540
1552
|
};
|
|
1541
1553
|
|
|
1542
|
-
// ../../packages/observable/
|
|
1554
|
+
// ../../packages/observable/src/extenders.ts
|
|
1543
1555
|
var primitiveTypes = { undefined: 1, boolean: 1, number: 1, string: 1 };
|
|
1544
1556
|
function valuesArePrimitiveAndEqual(a, b) {
|
|
1545
1557
|
const oldValueIsPrimitive = a === null || typeof a in primitiveTypes;
|
|
@@ -1570,13 +1582,13 @@ var ko = (() => {
|
|
|
1570
1582
|
}
|
|
1571
1583
|
deferUpdates(target);
|
|
1572
1584
|
}
|
|
1573
|
-
function rateLimit(target,
|
|
1585
|
+
function rateLimit(target, options4) {
|
|
1574
1586
|
let timeout, method, limitFunction;
|
|
1575
|
-
if (typeof
|
|
1576
|
-
timeout =
|
|
1587
|
+
if (typeof options4 === "number") {
|
|
1588
|
+
timeout = options4;
|
|
1577
1589
|
} else {
|
|
1578
|
-
timeout =
|
|
1579
|
-
method =
|
|
1590
|
+
timeout = options4.timeout;
|
|
1591
|
+
method = options4.method;
|
|
1580
1592
|
}
|
|
1581
1593
|
target._deferUpdates = false;
|
|
1582
1594
|
limitFunction = method === "notifyWhenChangesStop" ? debounce : throttle;
|
|
@@ -1586,7 +1598,7 @@ var ko = (() => {
|
|
|
1586
1598
|
}
|
|
1587
1599
|
var extenders = { notify, deferred, rateLimit };
|
|
1588
1600
|
|
|
1589
|
-
// ../../packages/observable/
|
|
1601
|
+
// ../../packages/observable/src/subscribable.ts
|
|
1590
1602
|
var LATEST_VALUE = /* @__PURE__ */ Symbol("Knockout latest value");
|
|
1591
1603
|
if (!Symbol.observable) {
|
|
1592
1604
|
Symbol.observable = /* @__PURE__ */ Symbol.for("@tko/Symbol.observable");
|
|
@@ -1712,7 +1724,7 @@ var ko = (() => {
|
|
|
1712
1724
|
Object.setPrototypeOf(ko_subscribable_fn, Function.prototype);
|
|
1713
1725
|
subscribable.fn = ko_subscribable_fn;
|
|
1714
1726
|
|
|
1715
|
-
// ../../packages/observable/
|
|
1727
|
+
// ../../packages/observable/src/observable.ts
|
|
1716
1728
|
function observable(initialValue) {
|
|
1717
1729
|
function Observable() {
|
|
1718
1730
|
if (arguments.length > 0) {
|
|
@@ -1728,7 +1740,7 @@ var ko = (() => {
|
|
|
1728
1740
|
return Observable[LATEST_VALUE];
|
|
1729
1741
|
}
|
|
1730
1742
|
}
|
|
1731
|
-
|
|
1743
|
+
Object.defineProperty(Observable, "length", { value: void 0 });
|
|
1732
1744
|
Observable[LATEST_VALUE] = initialValue;
|
|
1733
1745
|
subscribable.fn.init(Observable);
|
|
1734
1746
|
Object.setPrototypeOf(Observable, observable.fn);
|
|
@@ -1771,8 +1783,8 @@ var ko = (() => {
|
|
|
1771
1783
|
* @param peek Whether to use the current value without creating a dependency.
|
|
1772
1784
|
* @returns The modified observable.
|
|
1773
1785
|
*/
|
|
1774
|
-
modify(fn,
|
|
1775
|
-
this(fn(
|
|
1786
|
+
modify(fn, peek3 = true) {
|
|
1787
|
+
this(fn(peek3 ? this.peek() : this()));
|
|
1776
1788
|
},
|
|
1777
1789
|
// Some observables may not always be writeable, notably computeds.
|
|
1778
1790
|
isWriteable: true
|
|
@@ -1856,12 +1868,12 @@ var ko = (() => {
|
|
|
1856
1868
|
return isObservable(instance) && instance.isWriteable;
|
|
1857
1869
|
}
|
|
1858
1870
|
|
|
1859
|
-
// ../../packages/observable/
|
|
1871
|
+
// ../../packages/observable/src/observableArray.changeTracking.ts
|
|
1860
1872
|
var arrayChangeEventName = "arrayChange";
|
|
1861
|
-
function trackArrayChanges(target,
|
|
1873
|
+
function trackArrayChanges(target, options4) {
|
|
1862
1874
|
target.compareArrayOptions = {};
|
|
1863
|
-
if (
|
|
1864
|
-
extend(target.compareArrayOptions,
|
|
1875
|
+
if (options4 && typeof options4 === "object") {
|
|
1876
|
+
extend(target.compareArrayOptions, options4);
|
|
1865
1877
|
}
|
|
1866
1878
|
target.compareArrayOptions.sparse = true;
|
|
1867
1879
|
if (target.cacheDiffForKnownOperation) {
|
|
@@ -1941,6 +1953,7 @@ var ko = (() => {
|
|
|
1941
1953
|
return diff[diff.length] = { status, value: value2, index };
|
|
1942
1954
|
}
|
|
1943
1955
|
switch (operationName) {
|
|
1956
|
+
// biome-ignore lint/suspicious/noFallthroughSwitchClause: push sets offset then falls through to unshift
|
|
1944
1957
|
case "push":
|
|
1945
1958
|
offset = arrayLength;
|
|
1946
1959
|
case "unshift":
|
|
@@ -1948,6 +1961,7 @@ var ko = (() => {
|
|
|
1948
1961
|
pushDiff("added", args[index], offset + index);
|
|
1949
1962
|
}
|
|
1950
1963
|
break;
|
|
1964
|
+
// biome-ignore lint/suspicious/noFallthroughSwitchClause: pop sets offset then falls through to shift
|
|
1951
1965
|
case "pop":
|
|
1952
1966
|
offset = arrayLength - 1;
|
|
1953
1967
|
case "shift":
|
|
@@ -1978,7 +1992,7 @@ var ko = (() => {
|
|
|
1978
1992
|
trackArrayChanges.compareArrays = compareArrays;
|
|
1979
1993
|
extenders.trackArrayChanges = trackArrayChanges;
|
|
1980
1994
|
|
|
1981
|
-
// ../../packages/observable/
|
|
1995
|
+
// ../../packages/observable/src/observableArray.ts
|
|
1982
1996
|
function observableArray(initialValues) {
|
|
1983
1997
|
initialValues = initialValues || [];
|
|
1984
1998
|
if (typeof initialValues !== "object" || !("length" in initialValues)) {
|
|
@@ -1988,9 +2002,9 @@ var ko = (() => {
|
|
|
1988
2002
|
}
|
|
1989
2003
|
const result = Object.setPrototypeOf(observable(initialValues), observableArray.fn);
|
|
1990
2004
|
trackArrayChanges(result);
|
|
1991
|
-
|
|
1992
|
-
var
|
|
1993
|
-
return (
|
|
2005
|
+
Object.defineProperty(result, "length", { get: () => {
|
|
2006
|
+
var _a2;
|
|
2007
|
+
return (_a2 = result()) == null ? void 0 : _a2.length;
|
|
1994
2008
|
} });
|
|
1995
2009
|
return result;
|
|
1996
2010
|
}
|
|
@@ -2106,7 +2120,7 @@ var ko = (() => {
|
|
|
2106
2120
|
});
|
|
2107
2121
|
observableArray.trackArrayChanges = trackArrayChanges;
|
|
2108
2122
|
|
|
2109
|
-
// ../../packages/observable/
|
|
2123
|
+
// ../../packages/observable/src/mappingHelpers.ts
|
|
2110
2124
|
var maxNestedObservableDepth = 10;
|
|
2111
2125
|
function toJS(rootObject) {
|
|
2112
2126
|
if (arguments.length == 0) {
|
|
@@ -2166,7 +2180,7 @@ var ko = (() => {
|
|
|
2166
2180
|
}
|
|
2167
2181
|
}
|
|
2168
2182
|
|
|
2169
|
-
// ../../packages/utils.parser/
|
|
2183
|
+
// ../../packages/utils.parser/src/operators.ts
|
|
2170
2184
|
function LAMBDA() {
|
|
2171
2185
|
}
|
|
2172
2186
|
function unwrapOrCall(a, b) {
|
|
@@ -2175,6 +2189,22 @@ var ko = (() => {
|
|
|
2175
2189
|
}
|
|
2176
2190
|
return b;
|
|
2177
2191
|
}
|
|
2192
|
+
function looseEqual(a, b) {
|
|
2193
|
+
return a == b;
|
|
2194
|
+
}
|
|
2195
|
+
looseEqual.precedence = 8;
|
|
2196
|
+
function looseNotEqual(a, b) {
|
|
2197
|
+
return a != b;
|
|
2198
|
+
}
|
|
2199
|
+
looseNotEqual.precedence = 8;
|
|
2200
|
+
function strictEqual(a, b) {
|
|
2201
|
+
return a === b;
|
|
2202
|
+
}
|
|
2203
|
+
strictEqual.precedence = 8;
|
|
2204
|
+
function strictNotEqual(a, b) {
|
|
2205
|
+
return a !== b;
|
|
2206
|
+
}
|
|
2207
|
+
strictNotEqual.precedence = 8;
|
|
2178
2208
|
var operators = {
|
|
2179
2209
|
// unary
|
|
2180
2210
|
"@": unwrapOrCall,
|
|
@@ -2234,19 +2264,11 @@ var ko = (() => {
|
|
|
2234
2264
|
// TODO: 'in': function (a, b) { return a in b; },
|
|
2235
2265
|
// TODO: 'instanceof': function (a, b) { return a instanceof b; },
|
|
2236
2266
|
// TODO: 'typeof': function (a, b) { return typeof b; },
|
|
2237
|
-
// equality
|
|
2238
|
-
"==":
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
"
|
|
2242
|
-
return a != b;
|
|
2243
|
-
},
|
|
2244
|
-
"===": function sequal(a, b) {
|
|
2245
|
-
return a === b;
|
|
2246
|
-
},
|
|
2247
|
-
"!==": function sne(a, b) {
|
|
2248
|
-
return a !== b;
|
|
2249
|
-
},
|
|
2267
|
+
// equality — default loose; set options.strictEquality = true for === behavior
|
|
2268
|
+
"==": looseEqual,
|
|
2269
|
+
"!=": looseNotEqual,
|
|
2270
|
+
"===": strictEqual,
|
|
2271
|
+
"!==": strictNotEqual,
|
|
2250
2272
|
// bitwise
|
|
2251
2273
|
"&": function bitAnd(a, b) {
|
|
2252
2274
|
return a & b;
|
|
@@ -2289,45 +2311,55 @@ var ko = (() => {
|
|
|
2289
2311
|
};
|
|
2290
2312
|
operators["@"].precedence = 21;
|
|
2291
2313
|
operators["#"].precedence = 21;
|
|
2292
|
-
operators["."].precedence =
|
|
2293
|
-
operators["["].precedence =
|
|
2294
|
-
operators["?."].precedence =
|
|
2295
|
-
operators["!"].precedence =
|
|
2296
|
-
operators["!!"].precedence =
|
|
2297
|
-
operators["++"].precedence =
|
|
2298
|
-
operators["--"].precedence =
|
|
2299
|
-
operators["&-"].precedence =
|
|
2300
|
-
operators["**"].precedence =
|
|
2301
|
-
operators["%"].precedence =
|
|
2302
|
-
operators["*"].precedence =
|
|
2303
|
-
operators["/"].precedence =
|
|
2304
|
-
operators["+"].precedence =
|
|
2305
|
-
operators["-"].precedence =
|
|
2306
|
-
operators["
|
|
2307
|
-
operators["
|
|
2308
|
-
operators["
|
|
2309
|
-
operators["
|
|
2310
|
-
operators["
|
|
2311
|
-
operators["
|
|
2312
|
-
operators["
|
|
2313
|
-
operators["
|
|
2314
|
-
operators["
|
|
2315
|
-
operators["
|
|
2316
|
-
operators["
|
|
2317
|
-
operators["&&"].precedence =
|
|
2318
|
-
operators["||"].precedence =
|
|
2319
|
-
operators["??"].precedence =
|
|
2314
|
+
operators["."].precedence = 17;
|
|
2315
|
+
operators["["].precedence = 17;
|
|
2316
|
+
operators["?."].precedence = 17;
|
|
2317
|
+
operators["!"].precedence = 14;
|
|
2318
|
+
operators["!!"].precedence = 14;
|
|
2319
|
+
operators["++"].precedence = 14;
|
|
2320
|
+
operators["--"].precedence = 14;
|
|
2321
|
+
operators["&-"].precedence = 14;
|
|
2322
|
+
operators["**"].precedence = 13;
|
|
2323
|
+
operators["%"].precedence = 12;
|
|
2324
|
+
operators["*"].precedence = 12;
|
|
2325
|
+
operators["/"].precedence = 12;
|
|
2326
|
+
operators["+"].precedence = 11;
|
|
2327
|
+
operators["-"].precedence = 11;
|
|
2328
|
+
operators["<"].precedence = 9;
|
|
2329
|
+
operators["<="].precedence = 9;
|
|
2330
|
+
operators[">"].precedence = 9;
|
|
2331
|
+
operators[">="].precedence = 9;
|
|
2332
|
+
operators["=="].precedence = 8;
|
|
2333
|
+
operators["!="].precedence = 8;
|
|
2334
|
+
operators["==="].precedence = 8;
|
|
2335
|
+
operators["!=="].precedence = 8;
|
|
2336
|
+
operators["&"].precedence = 7;
|
|
2337
|
+
operators["^"].precedence = 6;
|
|
2338
|
+
operators["|"].precedence = 5;
|
|
2339
|
+
operators["&&"].precedence = 4;
|
|
2340
|
+
operators["||"].precedence = 3;
|
|
2341
|
+
operators["??"].precedence = 3;
|
|
2320
2342
|
operators["&&"].earlyOut = (a) => !a;
|
|
2321
2343
|
operators["||"].earlyOut = (a) => a;
|
|
2322
|
-
operators["??"].earlyOut = (a) => a;
|
|
2323
|
-
operators["
|
|
2344
|
+
operators["??"].earlyOut = (a) => a !== null && a !== void 0;
|
|
2345
|
+
operators["=>"].precedence = 2;
|
|
2346
|
+
operators[","].precedence = 1;
|
|
2324
2347
|
operators["call"].precedence = 1;
|
|
2325
|
-
|
|
2348
|
+
defineOption("strictEquality", {
|
|
2349
|
+
default: false,
|
|
2350
|
+
set(strict) {
|
|
2351
|
+
operators["=="] = strict ? strictEqual : looseEqual;
|
|
2352
|
+
operators["!="] = strict ? strictNotEqual : looseNotEqual;
|
|
2353
|
+
}
|
|
2354
|
+
});
|
|
2326
2355
|
|
|
2327
|
-
// ../../packages/utils.parser/
|
|
2356
|
+
// ../../packages/utils.parser/src/Node.ts
|
|
2328
2357
|
var IS_EXPR_OR_IDENT = /* @__PURE__ */ Symbol("Node - Is Expression Or Identifier");
|
|
2329
2358
|
var Node2 = class _Node {
|
|
2330
2359
|
constructor(lhs, op, rhs) {
|
|
2360
|
+
__publicField(this, "lhs");
|
|
2361
|
+
__publicField(this, "op");
|
|
2362
|
+
__publicField(this, "rhs");
|
|
2331
2363
|
this.lhs = lhs;
|
|
2332
2364
|
this.op = op;
|
|
2333
2365
|
this.rhs = rhs;
|
|
@@ -2357,23 +2389,22 @@ var ko = (() => {
|
|
|
2357
2389
|
* the lambda is called.
|
|
2358
2390
|
*/
|
|
2359
2391
|
get_value(notused, context, globals, node) {
|
|
2360
|
-
|
|
2361
|
-
if (node.op === LAMBDA) {
|
|
2392
|
+
if (this.op === LAMBDA) {
|
|
2362
2393
|
return (...args) => {
|
|
2363
2394
|
let lambdaContext = context;
|
|
2364
|
-
if (
|
|
2365
|
-
lambdaContext =
|
|
2395
|
+
if (this.lhs) {
|
|
2396
|
+
lambdaContext = this.lhs.extendContext(context, args);
|
|
2366
2397
|
}
|
|
2367
|
-
return
|
|
2398
|
+
return this.get_leaf_value(this.rhs, lambdaContext, globals, this);
|
|
2368
2399
|
};
|
|
2369
2400
|
}
|
|
2370
|
-
const lhv =
|
|
2371
|
-
const earlyOut =
|
|
2401
|
+
const lhv = this.get_leaf_value(this.lhs, context, globals, this);
|
|
2402
|
+
const earlyOut = this.op.earlyOut;
|
|
2372
2403
|
if (earlyOut && earlyOut(lhv)) {
|
|
2373
2404
|
return lhv;
|
|
2374
2405
|
}
|
|
2375
|
-
const rhv =
|
|
2376
|
-
return
|
|
2406
|
+
const rhv = this.get_leaf_value(this.rhs, context, globals, this);
|
|
2407
|
+
return this.op(lhv, rhv, context, globals);
|
|
2377
2408
|
}
|
|
2378
2409
|
//
|
|
2379
2410
|
// Class variables.
|
|
@@ -2421,9 +2452,11 @@ var ko = (() => {
|
|
|
2421
2452
|
};
|
|
2422
2453
|
operators["?"].precedence = 4;
|
|
2423
2454
|
|
|
2424
|
-
// ../../packages/utils.parser/
|
|
2455
|
+
// ../../packages/utils.parser/src/Expression.ts
|
|
2425
2456
|
var Expression = class {
|
|
2426
2457
|
constructor(nodes) {
|
|
2458
|
+
__publicField(this, "nodes");
|
|
2459
|
+
__publicField(this, "root");
|
|
2427
2460
|
this.nodes = nodes;
|
|
2428
2461
|
this.root = Node2.create_root(nodes);
|
|
2429
2462
|
}
|
|
@@ -2439,9 +2472,11 @@ var ko = (() => {
|
|
|
2439
2472
|
};
|
|
2440
2473
|
Expression.prototype[Node2.isExpressionOrIdentifierSymbol] = true;
|
|
2441
2474
|
|
|
2442
|
-
// ../../packages/utils.parser/
|
|
2475
|
+
// ../../packages/utils.parser/src/Arguments.ts
|
|
2443
2476
|
var Arguments = class {
|
|
2444
2477
|
constructor(parser, args) {
|
|
2478
|
+
__publicField(this, "parser");
|
|
2479
|
+
__publicField(this, "args");
|
|
2445
2480
|
this.parser = parser;
|
|
2446
2481
|
this.args = args;
|
|
2447
2482
|
}
|
|
@@ -2457,13 +2492,16 @@ var ko = (() => {
|
|
|
2457
2492
|
}
|
|
2458
2493
|
};
|
|
2459
2494
|
|
|
2460
|
-
// ../../packages/utils.parser/
|
|
2495
|
+
// ../../packages/utils.parser/src/identifierExpressions.ts
|
|
2461
2496
|
var IDStart = /[\$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/;
|
|
2462
2497
|
var IDContinue = /[\$0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/;
|
|
2463
2498
|
|
|
2464
|
-
// ../../packages/utils.parser/
|
|
2499
|
+
// ../../packages/utils.parser/src/Identifier.ts
|
|
2465
2500
|
var Identifier = class _Identifier {
|
|
2466
2501
|
constructor(parser, token, dereferences) {
|
|
2502
|
+
__publicField(this, "token");
|
|
2503
|
+
__publicField(this, "dereferences");
|
|
2504
|
+
__publicField(this, "parser");
|
|
2467
2505
|
this.token = token;
|
|
2468
2506
|
this.dereferences = dereferences;
|
|
2469
2507
|
this.parser = parser;
|
|
@@ -2601,7 +2639,7 @@ var ko = (() => {
|
|
|
2601
2639
|
}
|
|
2602
2640
|
};
|
|
2603
2641
|
|
|
2604
|
-
// ../../packages/utils.parser/
|
|
2642
|
+
// ../../packages/utils.parser/src/Parameters.ts
|
|
2605
2643
|
var _names;
|
|
2606
2644
|
var _Parameters = class _Parameters {
|
|
2607
2645
|
constructor(parser, node) {
|
|
@@ -2654,9 +2692,11 @@ var ko = (() => {
|
|
|
2654
2692
|
_names = new WeakMap();
|
|
2655
2693
|
var Parameters = _Parameters;
|
|
2656
2694
|
|
|
2657
|
-
// ../../packages/utils.parser/
|
|
2695
|
+
// ../../packages/utils.parser/src/Ternary.ts
|
|
2658
2696
|
var Ternary = class {
|
|
2659
2697
|
constructor(yes, no) {
|
|
2698
|
+
__publicField(this, "yes");
|
|
2699
|
+
__publicField(this, "no");
|
|
2660
2700
|
Object.assign(this, { yes, no });
|
|
2661
2701
|
}
|
|
2662
2702
|
get_value() {
|
|
@@ -2667,7 +2707,7 @@ var ko = (() => {
|
|
|
2667
2707
|
}
|
|
2668
2708
|
};
|
|
2669
2709
|
|
|
2670
|
-
// ../../packages/utils.parser/
|
|
2710
|
+
// ../../packages/utils.parser/src/Parser.ts
|
|
2671
2711
|
var escapee = {
|
|
2672
2712
|
"'": "'",
|
|
2673
2713
|
'"': '"',
|
|
@@ -2682,6 +2722,12 @@ var ko = (() => {
|
|
|
2682
2722
|
t: " "
|
|
2683
2723
|
};
|
|
2684
2724
|
var Parser = class {
|
|
2725
|
+
constructor() {
|
|
2726
|
+
__publicField(this, "ch");
|
|
2727
|
+
__publicField(this, "at");
|
|
2728
|
+
__publicField(this, "text");
|
|
2729
|
+
__publicField(this, "currentContextGlobals");
|
|
2730
|
+
}
|
|
2685
2731
|
white() {
|
|
2686
2732
|
let ch = this.ch;
|
|
2687
2733
|
while (ch && ch <= " ") {
|
|
@@ -2934,10 +2980,10 @@ ${name} ${msg} of ${this.text}
|
|
|
2934
2980
|
throw this.createError("Bad string");
|
|
2935
2981
|
}
|
|
2936
2982
|
string() {
|
|
2937
|
-
var
|
|
2983
|
+
var _a2, _b;
|
|
2938
2984
|
const ch = this.ch;
|
|
2939
2985
|
if (ch === '"') {
|
|
2940
|
-
return (
|
|
2986
|
+
return (_a2 = this.readString('"')) == null ? void 0 : _a2.join("");
|
|
2941
2987
|
} else if (ch === "'") {
|
|
2942
2988
|
return (_b = this.readString("'")) == null ? void 0 : _b.join("");
|
|
2943
2989
|
} else if (ch === "`") {
|
|
@@ -3150,7 +3196,7 @@ ${name} ${msg} of ${this.text}
|
|
|
3150
3196
|
}
|
|
3151
3197
|
/**
|
|
3152
3198
|
* Use this method to parse expressions that can be followed by additional markup
|
|
3153
|
-
*
|
|
3199
|
+
* separated by a comma, such as in bindings strings.
|
|
3154
3200
|
*
|
|
3155
3201
|
* @returns an expression that cannot contain multiple values separated by commas.
|
|
3156
3202
|
* @see {@link Parser.expression}
|
|
@@ -3351,13 +3397,13 @@ ${name} ${msg} of ${this.text}
|
|
|
3351
3397
|
objectForEach(result, (name, value2) => {
|
|
3352
3398
|
if (value2 instanceof Identifier) {
|
|
3353
3399
|
Object.defineProperty(result, name, {
|
|
3354
|
-
value: function(optionalValue,
|
|
3400
|
+
value: function(optionalValue, options4) {
|
|
3355
3401
|
const currentValue = value2.get_value(void 0, context, globals, node);
|
|
3356
3402
|
if (arguments.length === 0) {
|
|
3357
3403
|
return currentValue;
|
|
3358
3404
|
}
|
|
3359
3405
|
const unchanged = optionalValue === currentValue;
|
|
3360
|
-
if (
|
|
3406
|
+
if (options4 && options4.onlyIfChanged && unchanged) {
|
|
3361
3407
|
return;
|
|
3362
3408
|
}
|
|
3363
3409
|
return value2.set_value(optionalValue, context, globals);
|
|
@@ -3416,7 +3462,7 @@ ${name} ${msg} of ${this.text}
|
|
|
3416
3462
|
}
|
|
3417
3463
|
};
|
|
3418
3464
|
|
|
3419
|
-
// ../../packages/utils.parser/
|
|
3465
|
+
// ../../packages/utils.parser/src/preparse.ts
|
|
3420
3466
|
var specials = ",\"'`{}()/:[\\]";
|
|
3421
3467
|
var bindingToken = RegExp(
|
|
3422
3468
|
[
|
|
@@ -3445,11 +3491,12 @@ ${name} ${msg} of ${this.text}
|
|
|
3445
3491
|
var divisionLookBehind = /[\])"'A-Za-z0-9_$]+$/;
|
|
3446
3492
|
var keywordRegexLookBehind = { in: 1, return: 1, typeof: 1 };
|
|
3447
3493
|
function parseObjectLiteral(objectLiteralString) {
|
|
3448
|
-
|
|
3494
|
+
var _a2, _b;
|
|
3495
|
+
let str = String(objectLiteralString != null ? objectLiteralString : "").trim();
|
|
3449
3496
|
if (str.charCodeAt(0) === 123) str = str.slice(1, -1);
|
|
3450
3497
|
str += "\n,";
|
|
3451
3498
|
const result = new Array();
|
|
3452
|
-
let toks = str.match(bindingToken);
|
|
3499
|
+
let toks = (_a2 = str.match(bindingToken)) != null ? _a2 : [];
|
|
3453
3500
|
let key;
|
|
3454
3501
|
let values = new Array();
|
|
3455
3502
|
let depth = 0;
|
|
@@ -3475,8 +3522,8 @@ ${name} ${msg} of ${this.text}
|
|
|
3475
3522
|
} else if (c === 47 && i && tok.length > 1) {
|
|
3476
3523
|
const match = toks[i - 1].match(divisionLookBehind);
|
|
3477
3524
|
if (match && !keywordRegexLookBehind[match[0]]) {
|
|
3478
|
-
str = str.
|
|
3479
|
-
toks = str.match(bindingToken);
|
|
3525
|
+
str = str.substring(str.indexOf(tok) + 1);
|
|
3526
|
+
toks = (_b = str.match(bindingToken)) != null ? _b : [];
|
|
3480
3527
|
i = -1;
|
|
3481
3528
|
tok = "/";
|
|
3482
3529
|
}
|
|
@@ -3492,8 +3539,8 @@ ${name} ${msg} of ${this.text}
|
|
|
3492
3539
|
return result;
|
|
3493
3540
|
}
|
|
3494
3541
|
|
|
3495
|
-
// ../../packages/computed/
|
|
3496
|
-
var computedState =
|
|
3542
|
+
// ../../packages/computed/src/computed.ts
|
|
3543
|
+
var computedState = /* @__PURE__ */ Symbol("_state");
|
|
3497
3544
|
var DISPOSED_STATE = {
|
|
3498
3545
|
dependencyTracking: null,
|
|
3499
3546
|
dependenciesCount: 0,
|
|
@@ -3505,19 +3552,19 @@ ${name} ${msg} of ${this.text}
|
|
|
3505
3552
|
readFunction: null,
|
|
3506
3553
|
_options: null
|
|
3507
3554
|
};
|
|
3508
|
-
function computed(evaluatorFunctionOrOptions, evaluatorFunctionTarget,
|
|
3555
|
+
function computed(evaluatorFunctionOrOptions, evaluatorFunctionTarget, options4) {
|
|
3509
3556
|
if (typeof evaluatorFunctionOrOptions === "object") {
|
|
3510
|
-
|
|
3557
|
+
options4 = evaluatorFunctionOrOptions;
|
|
3511
3558
|
} else {
|
|
3512
|
-
|
|
3559
|
+
options4 = options4 || {};
|
|
3513
3560
|
if (evaluatorFunctionOrOptions) {
|
|
3514
|
-
|
|
3561
|
+
options4.read = evaluatorFunctionOrOptions;
|
|
3515
3562
|
}
|
|
3516
3563
|
}
|
|
3517
|
-
if (typeof (
|
|
3564
|
+
if (typeof (options4 == null ? void 0 : options4.read) !== "function") {
|
|
3518
3565
|
throw Error("Pass a function that returns the value of the computed");
|
|
3519
3566
|
}
|
|
3520
|
-
const writeFunction =
|
|
3567
|
+
const writeFunction = options4.write;
|
|
3521
3568
|
const state = {
|
|
3522
3569
|
latestValue: void 0,
|
|
3523
3570
|
isStale: true,
|
|
@@ -3527,10 +3574,10 @@ ${name} ${msg} of ${this.text}
|
|
|
3527
3574
|
isDisposed: false,
|
|
3528
3575
|
pure: false,
|
|
3529
3576
|
isSleeping: false,
|
|
3530
|
-
readFunction:
|
|
3531
|
-
evaluatorFunctionTarget: evaluatorFunctionTarget ||
|
|
3532
|
-
disposeWhenNodeIsRemoved:
|
|
3533
|
-
disposeWhen:
|
|
3577
|
+
readFunction: options4.read,
|
|
3578
|
+
evaluatorFunctionTarget: evaluatorFunctionTarget || options4.owner,
|
|
3579
|
+
disposeWhenNodeIsRemoved: options4.disposeWhenNodeIsRemoved || null,
|
|
3580
|
+
disposeWhen: options4.disposeWhen,
|
|
3534
3581
|
domNodeDisposalCallback: null,
|
|
3535
3582
|
dependencyTracking: {},
|
|
3536
3583
|
dependenciesCount: 0,
|
|
@@ -3561,18 +3608,18 @@ ${name} ${msg} of ${this.text}
|
|
|
3561
3608
|
computedObservable.isWriteable = typeof writeFunction === "function";
|
|
3562
3609
|
subscribable.fn.init(computedObservable);
|
|
3563
3610
|
Object.setPrototypeOf(computedObservable, computed.fn);
|
|
3564
|
-
if (
|
|
3611
|
+
if (options4.pure) {
|
|
3565
3612
|
state.pure = true;
|
|
3566
3613
|
state.isSleeping = true;
|
|
3567
3614
|
extend(computedObservable, pureComputedOverrides);
|
|
3568
|
-
} else if (
|
|
3615
|
+
} else if (options4.deferEvaluation) {
|
|
3569
3616
|
extend(computedObservable, deferEvaluationOverrides);
|
|
3570
3617
|
}
|
|
3571
3618
|
if (options_default.deferUpdates) {
|
|
3572
3619
|
extenders.deferred(computedObservable, true);
|
|
3573
3620
|
}
|
|
3574
3621
|
if (options_default.debug) {
|
|
3575
|
-
computedObservable._options =
|
|
3622
|
+
computedObservable._options = options4;
|
|
3576
3623
|
}
|
|
3577
3624
|
if (state.disposeWhenNodeIsRemoved) {
|
|
3578
3625
|
state.suppressDisposalUntilDisposeWhenReturnsFalse = true;
|
|
@@ -3580,7 +3627,7 @@ ${name} ${msg} of ${this.text}
|
|
|
3580
3627
|
state.disposeWhenNodeIsRemoved = null;
|
|
3581
3628
|
}
|
|
3582
3629
|
}
|
|
3583
|
-
if (!state.isSleeping && !
|
|
3630
|
+
if (!state.isSleeping && !options4.deferEvaluation) {
|
|
3584
3631
|
;
|
|
3585
3632
|
computedObservable.evaluateImmediate();
|
|
3586
3633
|
}
|
|
@@ -3708,7 +3755,7 @@ ${name} ${msg} of ${this.text}
|
|
|
3708
3755
|
}
|
|
3709
3756
|
},
|
|
3710
3757
|
evaluateImmediate(notifyChange) {
|
|
3711
|
-
let
|
|
3758
|
+
let state = this[computedState], disposeWhen = state.disposeWhen, changed = false;
|
|
3712
3759
|
if (state.isBeingEvaluated) {
|
|
3713
3760
|
return;
|
|
3714
3761
|
}
|
|
@@ -3717,7 +3764,7 @@ ${name} ${msg} of ${this.text}
|
|
|
3717
3764
|
}
|
|
3718
3765
|
if (state.disposeWhenNodeIsRemoved && !domNodeIsAttachedToDocument(state.disposeWhenNodeIsRemoved) || disposeWhen && disposeWhen()) {
|
|
3719
3766
|
if (!state.suppressDisposalUntilDisposeWhenReturnsFalse) {
|
|
3720
|
-
|
|
3767
|
+
this.dispose();
|
|
3721
3768
|
return;
|
|
3722
3769
|
}
|
|
3723
3770
|
} else {
|
|
@@ -3732,47 +3779,47 @@ ${name} ${msg} of ${this.text}
|
|
|
3732
3779
|
return changed;
|
|
3733
3780
|
},
|
|
3734
3781
|
evaluateImmediate_CallReadWithDependencyDetection(notifyChange) {
|
|
3735
|
-
let
|
|
3782
|
+
let state = this[computedState], changed = false;
|
|
3736
3783
|
const isInitial2 = state.pure ? void 0 : !state.dependenciesCount, dependencyDetectionContext = {
|
|
3737
|
-
computedObservable,
|
|
3784
|
+
computedObservable: this,
|
|
3738
3785
|
disposalCandidates: state.dependencyTracking,
|
|
3739
3786
|
disposalCount: state.dependenciesCount
|
|
3740
3787
|
};
|
|
3741
3788
|
dependencyDetection_exports.begin({
|
|
3742
3789
|
callbackTarget: dependencyDetectionContext,
|
|
3743
3790
|
callback: computedBeginDependencyDetectionCallback,
|
|
3744
|
-
computed:
|
|
3791
|
+
computed: this,
|
|
3745
3792
|
isInitial: isInitial2
|
|
3746
3793
|
});
|
|
3747
3794
|
state.dependencyTracking = {};
|
|
3748
3795
|
state.dependenciesCount = 0;
|
|
3749
3796
|
const newValue = this.evaluateImmediate_CallReadThenEndDependencyDetection(state, dependencyDetectionContext);
|
|
3750
3797
|
if (!state.dependenciesCount) {
|
|
3751
|
-
|
|
3798
|
+
this.dispose();
|
|
3752
3799
|
changed = true;
|
|
3753
3800
|
} else {
|
|
3754
|
-
changed =
|
|
3801
|
+
changed = this.isDifferent(state.latestValue, newValue);
|
|
3755
3802
|
}
|
|
3756
3803
|
if (changed) {
|
|
3757
3804
|
if (!state.isSleeping) {
|
|
3758
|
-
|
|
3805
|
+
this.notifySubscribers(state.latestValue, "beforeChange");
|
|
3759
3806
|
} else {
|
|
3760
|
-
|
|
3807
|
+
this.updateVersion();
|
|
3761
3808
|
}
|
|
3762
3809
|
state.latestValue = newValue;
|
|
3763
3810
|
if (options_default.debug) {
|
|
3764
|
-
|
|
3811
|
+
this._latestValue = newValue;
|
|
3765
3812
|
}
|
|
3766
|
-
|
|
3813
|
+
this.notifySubscribers(state.latestValue, "spectate");
|
|
3767
3814
|
if (!state.isSleeping && notifyChange) {
|
|
3768
|
-
|
|
3815
|
+
this.notifySubscribers(state.latestValue);
|
|
3769
3816
|
}
|
|
3770
|
-
if (
|
|
3771
|
-
|
|
3817
|
+
if (this._recordUpdate) {
|
|
3818
|
+
this._recordUpdate();
|
|
3772
3819
|
}
|
|
3773
3820
|
}
|
|
3774
3821
|
if (isInitial2) {
|
|
3775
|
-
|
|
3822
|
+
this.notifySubscribers(state.latestValue, "awake");
|
|
3776
3823
|
}
|
|
3777
3824
|
return changed;
|
|
3778
3825
|
},
|
|
@@ -3921,17 +3968,17 @@ ${name} ${msg} of ${this.text}
|
|
|
3921
3968
|
const evaluator = evaluatorFunctionOrOptions;
|
|
3922
3969
|
return computed(evaluator, evaluatorFunctionTarget, { pure: true });
|
|
3923
3970
|
} else {
|
|
3924
|
-
let
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
return computed(
|
|
3971
|
+
let options4 = evaluatorFunctionOrOptions;
|
|
3972
|
+
options4 = extend({}, options4);
|
|
3973
|
+
options4.pure = true;
|
|
3974
|
+
return computed(options4, evaluatorFunctionTarget);
|
|
3928
3975
|
}
|
|
3929
3976
|
}
|
|
3930
3977
|
|
|
3931
|
-
// ../../packages/computed/
|
|
3978
|
+
// ../../packages/computed/src/throttleExtender.ts
|
|
3932
3979
|
function throttleExtender(target, timeout) {
|
|
3933
3980
|
target.throttleEvaluation = timeout;
|
|
3934
|
-
let writeTimeoutInstance
|
|
3981
|
+
let writeTimeoutInstance;
|
|
3935
3982
|
return computed({
|
|
3936
3983
|
read: target,
|
|
3937
3984
|
write: function(value2) {
|
|
@@ -3945,7 +3992,7 @@ ${name} ${msg} of ${this.text}
|
|
|
3945
3992
|
var extenders2 = extenders;
|
|
3946
3993
|
extenders2.throttle = throttleExtender;
|
|
3947
3994
|
|
|
3948
|
-
// ../../packages/computed/
|
|
3995
|
+
// ../../packages/computed/src/proxy.ts
|
|
3949
3996
|
var PROXY_SYM = /* @__PURE__ */ Symbol("Knockout Proxied Object");
|
|
3950
3997
|
var MIRROR_SYM = /* @__PURE__ */ Symbol("Knockout Proxied Observables");
|
|
3951
3998
|
function makeComputed(proxy2, fn) {
|
|
@@ -3987,7 +4034,7 @@ ${name} ${msg} of ${this.text}
|
|
|
3987
4034
|
object[prop] = value2;
|
|
3988
4035
|
return true;
|
|
3989
4036
|
},
|
|
3990
|
-
deleteProperty(property) {
|
|
4037
|
+
deleteProperty(_target, property) {
|
|
3991
4038
|
delete mirror[property];
|
|
3992
4039
|
return delete object[property];
|
|
3993
4040
|
},
|
|
@@ -4031,7 +4078,7 @@ ${name} ${msg} of ${this.text}
|
|
|
4031
4078
|
}
|
|
4032
4079
|
Object.assign(proxy, { getObservable, peek: peek2, isProxied });
|
|
4033
4080
|
|
|
4034
|
-
// ../../packages/computed/
|
|
4081
|
+
// ../../packages/computed/src/when.ts
|
|
4035
4082
|
function kowhen(predicate, context, resolve) {
|
|
4036
4083
|
const observable2 = pureComputed(predicate, context).extend({ notify: "always" });
|
|
4037
4084
|
const subscription = observable2.subscribe((value2) => {
|
|
@@ -4048,9 +4095,9 @@ ${name} ${msg} of ${this.text}
|
|
|
4048
4095
|
return callback ? whenFn(callback.bind(context)) : new Promise(whenFn);
|
|
4049
4096
|
}
|
|
4050
4097
|
|
|
4051
|
-
// ../../packages/lifecycle/
|
|
4052
|
-
var SUBSCRIPTIONS =
|
|
4053
|
-
var ANCHOR_NODE =
|
|
4098
|
+
// ../../packages/lifecycle/src/LifeCycle.ts
|
|
4099
|
+
var SUBSCRIPTIONS = /* @__PURE__ */ Symbol("LifeCycle Subscriptions List");
|
|
4100
|
+
var ANCHOR_NODE = /* @__PURE__ */ Symbol("LifeCycle Anchor Node");
|
|
4054
4101
|
var LifeCycle = class _LifeCycle {
|
|
4055
4102
|
// NOTE: For more advanced integration as an ES6 mixin, see e.g.:
|
|
4056
4103
|
// http://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/
|
|
@@ -4099,14 +4146,14 @@ ${name} ${msg} of ${this.text}
|
|
|
4099
4146
|
*/
|
|
4100
4147
|
addEventListener(...args) {
|
|
4101
4148
|
const node = args[0].nodeType ? args.shift() : this[ANCHOR_NODE];
|
|
4102
|
-
const [type, act,
|
|
4149
|
+
const [type, act, options4] = args;
|
|
4103
4150
|
const handler = typeof act === "string" ? this[act].bind(this) : act;
|
|
4104
|
-
this.__addEventListener(node, type, handler,
|
|
4151
|
+
this.__addEventListener(node, type, handler, options4);
|
|
4105
4152
|
}
|
|
4106
|
-
__addEventListener(node, eventType, handler,
|
|
4107
|
-
node.addEventListener(eventType, handler,
|
|
4153
|
+
__addEventListener(node, eventType, handler, options4) {
|
|
4154
|
+
node.addEventListener(eventType, handler, options4);
|
|
4108
4155
|
function dispose() {
|
|
4109
|
-
node.removeEventListener(eventType, handler);
|
|
4156
|
+
node.removeEventListener(eventType, handler, options4);
|
|
4110
4157
|
}
|
|
4111
4158
|
addDisposeCallback(node, dispose);
|
|
4112
4159
|
this.addDisposable({ dispose });
|
|
@@ -4139,7 +4186,7 @@ ${name} ${msg} of ${this.text}
|
|
|
4139
4186
|
}
|
|
4140
4187
|
};
|
|
4141
4188
|
|
|
4142
|
-
// ../../packages/bind/
|
|
4189
|
+
// ../../packages/bind/src/bindingEvent.ts
|
|
4143
4190
|
var contextAncestorBindingInfo = /* @__PURE__ */ Symbol("_ancestorBindingInfo");
|
|
4144
4191
|
var boundElementDomDataKey = data_exports.nextKey();
|
|
4145
4192
|
var bindingEvent = {
|
|
@@ -4164,7 +4211,7 @@ ${name} ${msg} of ${this.text}
|
|
|
4164
4211
|
}
|
|
4165
4212
|
};
|
|
4166
4213
|
|
|
4167
|
-
// ../../packages/bind/
|
|
4214
|
+
// ../../packages/bind/src/bindingContext.ts
|
|
4168
4215
|
var boundElementDomDataKey2 = data_exports.nextKey();
|
|
4169
4216
|
var contextSubscribeSymbol = /* @__PURE__ */ Symbol("Knockout Context Subscription");
|
|
4170
4217
|
var inheritParentIndicator = /* @__PURE__ */ Symbol("Knockout Parent Indicator");
|
|
@@ -4252,10 +4299,10 @@ ${name} ${msg} of ${this.text}
|
|
|
4252
4299
|
this,
|
|
4253
4300
|
dataItemAlias,
|
|
4254
4301
|
function(self, parentContext) {
|
|
4255
|
-
var
|
|
4302
|
+
var _a2;
|
|
4256
4303
|
self.$parentContext = parentContext;
|
|
4257
4304
|
self.$parent = parentContext == null ? void 0 : parentContext.$data;
|
|
4258
|
-
self.$parents = ((
|
|
4305
|
+
self.$parents = ((_a2 = parentContext == null ? void 0 : parentContext.$parents) != null ? _a2 : []).slice(0);
|
|
4259
4306
|
self.$parents.unshift(self.$parent);
|
|
4260
4307
|
if (extendCallback) {
|
|
4261
4308
|
extendCallback(self);
|
|
@@ -4290,9 +4337,14 @@ ${name} ${msg} of ${this.text}
|
|
|
4290
4337
|
return context ? context.$data : void 0;
|
|
4291
4338
|
}
|
|
4292
4339
|
|
|
4293
|
-
// ../../packages/bind/
|
|
4340
|
+
// ../../packages/bind/src/BindingResult.ts
|
|
4294
4341
|
var BindingResult = class {
|
|
4295
4342
|
constructor({ asyncBindingsApplied, rootNode, bindingContext: bindingContext2 }) {
|
|
4343
|
+
__publicField(this, "isSync");
|
|
4344
|
+
__publicField(this, "isComplete");
|
|
4345
|
+
__publicField(this, "completionPromise");
|
|
4346
|
+
__publicField(this, "rootNode");
|
|
4347
|
+
__publicField(this, "bindingContext");
|
|
4296
4348
|
this.rootNode = rootNode;
|
|
4297
4349
|
this.bindingContext = bindingContext2;
|
|
4298
4350
|
this.isSync = asyncBindingsApplied.size === 0;
|
|
@@ -4310,10 +4362,23 @@ ${name} ${msg} of ${this.text}
|
|
|
4310
4362
|
}
|
|
4311
4363
|
};
|
|
4312
4364
|
|
|
4313
|
-
// ../../packages/bind/
|
|
4365
|
+
// ../../packages/bind/src/BindingHandler.ts
|
|
4314
4366
|
var BindingHandler = class extends LifeCycle {
|
|
4315
4367
|
constructor(params) {
|
|
4316
4368
|
super();
|
|
4369
|
+
__publicField(this, "after");
|
|
4370
|
+
__publicField(this, "init");
|
|
4371
|
+
__publicField(this, "update");
|
|
4372
|
+
__publicField(this, "options");
|
|
4373
|
+
__publicField(this, "preprocess");
|
|
4374
|
+
__publicField(this, "$context");
|
|
4375
|
+
// most likly BindingContext but params must be typed first
|
|
4376
|
+
__publicField(this, "$element");
|
|
4377
|
+
__publicField(this, "$data");
|
|
4378
|
+
__publicField(this, "bindingCompletion");
|
|
4379
|
+
__publicField(this, "valueAccessor");
|
|
4380
|
+
__publicField(this, "completeBinding");
|
|
4381
|
+
__publicField(this, "allBindings");
|
|
4317
4382
|
const { $element, valueAccessor, allBindings, $context } = params;
|
|
4318
4383
|
this.$element = $element;
|
|
4319
4384
|
this.valueAccessor = valueAccessor;
|
|
@@ -4372,15 +4437,14 @@ ${name} ${msg} of ${this.text}
|
|
|
4372
4437
|
}
|
|
4373
4438
|
};
|
|
4374
4439
|
|
|
4375
|
-
// ../../packages/bind/
|
|
4440
|
+
// ../../packages/bind/src/LegacyBindingHandler.ts
|
|
4376
4441
|
var PossibleWeakMap = options_default.global.WeakMap || Map;
|
|
4377
4442
|
var legacyBindingMap = new PossibleWeakMap();
|
|
4378
4443
|
var LegacyBindingHandler = class _LegacyBindingHandler extends BindingHandler {
|
|
4379
|
-
get handler() {
|
|
4380
|
-
return void 0;
|
|
4381
|
-
}
|
|
4382
4444
|
constructor(params) {
|
|
4383
4445
|
super(params);
|
|
4446
|
+
__publicField(this, "initReturn");
|
|
4447
|
+
__publicField(this, "onError");
|
|
4384
4448
|
const handler = this.handler;
|
|
4385
4449
|
this.onError = params.onError;
|
|
4386
4450
|
if (typeof handler.dispose === "function") {
|
|
@@ -4392,6 +4456,9 @@ ${name} ${msg} of ${this.text}
|
|
|
4392
4456
|
params.onError("init", e);
|
|
4393
4457
|
}
|
|
4394
4458
|
}
|
|
4459
|
+
get handler() {
|
|
4460
|
+
return void 0;
|
|
4461
|
+
}
|
|
4395
4462
|
onValueChange() {
|
|
4396
4463
|
const handler = this.handler;
|
|
4397
4464
|
if (typeof handler.update !== "function") {
|
|
@@ -4461,7 +4528,7 @@ ${name} ${msg} of ${this.text}
|
|
|
4461
4528
|
}
|
|
4462
4529
|
};
|
|
4463
4530
|
|
|
4464
|
-
// ../../packages/bind/
|
|
4531
|
+
// ../../packages/bind/src/applyBindings.ts
|
|
4465
4532
|
var bindingDoesNotRecurseIntoElementTypes = {
|
|
4466
4533
|
// Don't want bindings that operate on text nodes to mutate <script> and <textarea> contents,
|
|
4467
4534
|
// because it's unexpected and a potential XSS issue.
|
|
@@ -4531,7 +4598,8 @@ ${name} ${msg} of ${this.text}
|
|
|
4531
4598
|
if (isElement) {
|
|
4532
4599
|
virtualElements_exports.normaliseVirtualElementDomStructure(nodeVerified);
|
|
4533
4600
|
}
|
|
4534
|
-
const shouldApplyBindings = isElement ||
|
|
4601
|
+
const shouldApplyBindings = isElement || // Case (1)
|
|
4602
|
+
hasBindings(nodeVerified);
|
|
4535
4603
|
const { shouldBindDescendants } = shouldApplyBindings ? applyBindingsToNodeInternal(nodeVerified, null, bindingContext2, asyncBindingsApplied) : { shouldBindDescendants: true };
|
|
4536
4604
|
if (shouldBindDescendants && !bindingDoesNotRecurseIntoElementTypes[tagNameLower(nodeVerified)]) {
|
|
4537
4605
|
applyBindingsToDescendantsInternal(bindingContext2, nodeVerified, asyncBindingsApplied);
|
|
@@ -4790,7 +4858,7 @@ ${name} ${msg} of ${this.text}
|
|
|
4790
4858
|
options_default.onError(error);
|
|
4791
4859
|
}
|
|
4792
4860
|
|
|
4793
|
-
// ../../packages/bind/
|
|
4861
|
+
// ../../packages/bind/src/arrayToDomNodeChildren.ts
|
|
4794
4862
|
function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {
|
|
4795
4863
|
const mappedNodes = [];
|
|
4796
4864
|
const dependentObservable = computed(
|
|
@@ -4820,12 +4888,12 @@ ${name} ${msg} of ${this.text}
|
|
|
4820
4888
|
}
|
|
4821
4889
|
var lastMappingResultDomDataKey = data_exports.nextKey();
|
|
4822
4890
|
var deletedItemDummyValue = data_exports.nextKey();
|
|
4823
|
-
function setDomNodeChildrenFromArrayMapping(domNode, array, mapping,
|
|
4891
|
+
function setDomNodeChildrenFromArrayMapping(domNode, array, mapping, options4, callbackAfterAddingNodes, editScript) {
|
|
4824
4892
|
array = array || [];
|
|
4825
4893
|
if (typeof array.length === "undefined") {
|
|
4826
4894
|
array = [array];
|
|
4827
4895
|
}
|
|
4828
|
-
|
|
4896
|
+
options4 = options4 || {};
|
|
4829
4897
|
const lastMappingResult = data_exports.get(domNode, lastMappingResultDomDataKey);
|
|
4830
4898
|
const isFirstExecution = !lastMappingResult;
|
|
4831
4899
|
const newMappingResult = new Array();
|
|
@@ -4872,7 +4940,7 @@ ${name} ${msg} of ${this.text}
|
|
|
4872
4940
|
const lastArray = arrayMap(lastMappingResult, function(x) {
|
|
4873
4941
|
return x.arrayEntry;
|
|
4874
4942
|
});
|
|
4875
|
-
const compareOptions = { dontLimitMoves:
|
|
4943
|
+
const compareOptions = { dontLimitMoves: options4.dontLimitMoves, sparse: true };
|
|
4876
4944
|
editScript = compareArrays(lastArray, array, compareOptions);
|
|
4877
4945
|
}
|
|
4878
4946
|
for (let i = 0, editScriptItem, movedIndex, itemIndex; editScriptItem = editScript[i]; i++) {
|
|
@@ -4890,7 +4958,7 @@ ${name} ${msg} of ${this.text}
|
|
|
4890
4958
|
mapData.dependentObservable = void 0;
|
|
4891
4959
|
}
|
|
4892
4960
|
if (fixUpContinuousNodeArray(mapData.mappedNodes, domNode).length) {
|
|
4893
|
-
if (
|
|
4961
|
+
if (options4.beforeRemove) {
|
|
4894
4962
|
newMappingResult.push(mapData);
|
|
4895
4963
|
itemsToProcess.push(mapData);
|
|
4896
4964
|
countWaitingForRemove++;
|
|
@@ -4925,8 +4993,8 @@ ${name} ${msg} of ${this.text}
|
|
|
4925
4993
|
newMappingResult["_countWaitingForRemove"] = countWaitingForRemove;
|
|
4926
4994
|
}
|
|
4927
4995
|
data_exports.set(domNode, lastMappingResultDomDataKey, newMappingResult);
|
|
4928
|
-
callCallback(
|
|
4929
|
-
arrayForEach(nodesToDelete,
|
|
4996
|
+
callCallback(options4.beforeMove, itemsForMoveCallbacks);
|
|
4997
|
+
arrayForEach(nodesToDelete, options4.beforeRemove ? cleanNode : removeNode);
|
|
4930
4998
|
for (let k = 0, nextNode = virtualElements_exports.firstChild(domNode), lastNode, node; mapData = itemsToProcess[k]; k++) {
|
|
4931
4999
|
if (!mapData.mappedNodes) {
|
|
4932
5000
|
extend(
|
|
@@ -4950,15 +5018,15 @@ ${name} ${msg} of ${this.text}
|
|
|
4950
5018
|
mapData.initialized = true;
|
|
4951
5019
|
}
|
|
4952
5020
|
}
|
|
4953
|
-
callCallback(
|
|
5021
|
+
callCallback(options4.beforeRemove, itemsForBeforeRemoveCallbacks);
|
|
4954
5022
|
for (let x = 0; x < itemsForBeforeRemoveCallbacks.length; ++x) {
|
|
4955
5023
|
itemsForBeforeRemoveCallbacks[x].arrayEntry = deletedItemDummyValue;
|
|
4956
5024
|
}
|
|
4957
|
-
callCallback(
|
|
4958
|
-
callCallback(
|
|
5025
|
+
callCallback(options4.afterMove, itemsForMoveCallbacks);
|
|
5026
|
+
callCallback(options4.afterAdd, itemsForAfterAddCallbacks);
|
|
4959
5027
|
}
|
|
4960
5028
|
|
|
4961
|
-
// ../../packages/bind/
|
|
5029
|
+
// ../../packages/bind/src/DescendantBindingHandler.ts
|
|
4962
5030
|
var DescendantBindingHandler = class extends AsyncBindingHandler {
|
|
4963
5031
|
get controlsDescendants() {
|
|
4964
5032
|
return true;
|
|
@@ -4979,7 +5047,7 @@ ${name} ${msg} of ${this.text}
|
|
|
4979
5047
|
}
|
|
4980
5048
|
};
|
|
4981
5049
|
|
|
4982
|
-
// ../../packages/binding.template/
|
|
5050
|
+
// ../../packages/binding.template/src/templateSources.ts
|
|
4983
5051
|
var templateScript = 1;
|
|
4984
5052
|
var templateTextArea = 2;
|
|
4985
5053
|
var templateTemplate = 3;
|
|
@@ -4995,6 +5063,8 @@ ${name} ${msg} of ${this.text}
|
|
|
4995
5063
|
}
|
|
4996
5064
|
var domElement = class {
|
|
4997
5065
|
constructor(element) {
|
|
5066
|
+
__publicField(this, "domElement");
|
|
5067
|
+
__publicField(this, "templateType");
|
|
4998
5068
|
this.domElement = element;
|
|
4999
5069
|
if (element.nodeType === Node.COMMENT_NODE) {
|
|
5000
5070
|
this.templateType = templateElement;
|
|
@@ -5063,12 +5133,12 @@ ${name} ${msg} of ${this.text}
|
|
|
5063
5133
|
}
|
|
5064
5134
|
};
|
|
5065
5135
|
|
|
5066
|
-
// ../../packages/binding.template/
|
|
5136
|
+
// ../../packages/binding.template/src/templateEngine.ts
|
|
5067
5137
|
function templateEngine() {
|
|
5068
5138
|
}
|
|
5069
5139
|
extend(templateEngine.prototype, {
|
|
5070
|
-
renderTemplateSource(templateSource, bindingContext2,
|
|
5071
|
-
|
|
5140
|
+
renderTemplateSource(templateSource, bindingContext2, options4, templateDocument) {
|
|
5141
|
+
options4.onError("Override renderTemplateSource");
|
|
5072
5142
|
},
|
|
5073
5143
|
createJavaScriptEvaluatorBlock(script) {
|
|
5074
5144
|
options_default.onError(new Error("Override createJavaScriptEvaluatorBlock"));
|
|
@@ -5089,13 +5159,13 @@ ${name} ${msg} of ${this.text}
|
|
|
5089
5159
|
throw options_default.onError(new Error("Unknown template type: " + template), false);
|
|
5090
5160
|
}
|
|
5091
5161
|
},
|
|
5092
|
-
renderTemplate(template, bindingContext2,
|
|
5162
|
+
renderTemplate(template, bindingContext2, options4, templateDocument) {
|
|
5093
5163
|
const templateSource = this.makeTemplateSource(template, templateDocument);
|
|
5094
|
-
return this.renderTemplateSource(templateSource, bindingContext2,
|
|
5164
|
+
return this.renderTemplateSource(templateSource, bindingContext2, options4, templateDocument);
|
|
5095
5165
|
}
|
|
5096
5166
|
});
|
|
5097
5167
|
|
|
5098
|
-
// ../../packages/binding.template/
|
|
5168
|
+
// ../../packages/binding.template/src/templating.ts
|
|
5099
5169
|
var _templateEngine;
|
|
5100
5170
|
var cleanContainerDomDataKey = data_exports.nextKey();
|
|
5101
5171
|
function setTemplateEngine(tEngine) {
|
|
@@ -5160,12 +5230,12 @@ ${name} ${msg} of ${this.text}
|
|
|
5160
5230
|
function getFirstNodeFromPossibleArray(nodeOrNodeArray) {
|
|
5161
5231
|
return nodeOrNodeArray.nodeType ? nodeOrNodeArray : nodeOrNodeArray.length > 0 ? nodeOrNodeArray[0] : null;
|
|
5162
5232
|
}
|
|
5163
|
-
function executeTemplate(targetNodeOrNodeArray, renderMode, template, bindingContext2,
|
|
5164
|
-
|
|
5233
|
+
function executeTemplate(targetNodeOrNodeArray, renderMode, template, bindingContext2, options4, afterBindingCallback) {
|
|
5234
|
+
options4 = options4 || {};
|
|
5165
5235
|
const firstTargetNode = targetNodeOrNodeArray && getFirstNodeFromPossibleArray(targetNodeOrNodeArray);
|
|
5166
5236
|
const templateDocument = (firstTargetNode || template || {}).ownerDocument;
|
|
5167
|
-
const templateEngineToUse =
|
|
5168
|
-
const renderedNodesArray = templateEngineToUse.renderTemplate(template, bindingContext2,
|
|
5237
|
+
const templateEngineToUse = options4.templateEngine || _templateEngine;
|
|
5238
|
+
const renderedNodesArray = templateEngineToUse.renderTemplate(template, bindingContext2, options4, templateDocument);
|
|
5169
5239
|
if (typeof renderedNodesArray.length !== "number" || renderedNodesArray.length > 0 && typeof renderedNodesArray[0].nodeType !== "number") {
|
|
5170
5240
|
throw new Error("Template engine must return an array of DOM nodes");
|
|
5171
5241
|
}
|
|
@@ -5186,8 +5256,8 @@ ${name} ${msg} of ${this.text}
|
|
|
5186
5256
|
}
|
|
5187
5257
|
if (haveAddedNodesToParent) {
|
|
5188
5258
|
activateBindingsOnContinuousNodeArray(renderedNodesArray, bindingContext2, afterBindingCallback);
|
|
5189
|
-
if (
|
|
5190
|
-
dependencyDetection_exports.ignore(
|
|
5259
|
+
if (options4.afterRender) {
|
|
5260
|
+
dependencyDetection_exports.ignore(options4.afterRender, null, [renderedNodesArray, bindingContext2["$data"]]);
|
|
5191
5261
|
}
|
|
5192
5262
|
if (renderMode === "replaceChildren") {
|
|
5193
5263
|
bindingEvent.notify(targetNodeOrNodeArray, bindingEvent.childrenComplete);
|
|
@@ -5204,9 +5274,9 @@ ${name} ${msg} of ${this.text}
|
|
|
5204
5274
|
return template;
|
|
5205
5275
|
}
|
|
5206
5276
|
}
|
|
5207
|
-
function renderTemplate(template, dataOrBindingContext,
|
|
5208
|
-
|
|
5209
|
-
if ((
|
|
5277
|
+
function renderTemplate(template, dataOrBindingContext, options4, targetNodeOrNodeArray, renderMode, afterBindingCallback) {
|
|
5278
|
+
options4 = options4 || {};
|
|
5279
|
+
if ((options4.templateEngine || _templateEngine) === void 0) {
|
|
5210
5280
|
throw new Error("Set a template engine before calling renderTemplate");
|
|
5211
5281
|
}
|
|
5212
5282
|
renderMode = renderMode || "replaceChildren";
|
|
@@ -5228,7 +5298,7 @@ ${name} ${msg} of ${this.text}
|
|
|
5228
5298
|
renderMode,
|
|
5229
5299
|
templateName,
|
|
5230
5300
|
bindingContext2,
|
|
5231
|
-
|
|
5301
|
+
options4,
|
|
5232
5302
|
afterBindingCallback
|
|
5233
5303
|
);
|
|
5234
5304
|
if (renderMode === "replaceNode") {
|
|
@@ -5241,23 +5311,23 @@ ${name} ${msg} of ${this.text}
|
|
|
5241
5311
|
);
|
|
5242
5312
|
} else {
|
|
5243
5313
|
return memoization_exports.memoize(function(domNode) {
|
|
5244
|
-
renderTemplate(template, dataOrBindingContext,
|
|
5314
|
+
renderTemplate(template, dataOrBindingContext, options4, domNode, "replaceNode");
|
|
5245
5315
|
});
|
|
5246
5316
|
}
|
|
5247
5317
|
}
|
|
5248
|
-
function renderTemplateForEach(template, arrayOrObservableArray,
|
|
5318
|
+
function renderTemplateForEach(template, arrayOrObservableArray, options4, targetNode, parentBindingContext, afterBindingCallback) {
|
|
5249
5319
|
let arrayItemContext;
|
|
5250
5320
|
function executeTemplateForArrayItem(arrayValue, index) {
|
|
5251
|
-
if (
|
|
5321
|
+
if (options4.as) {
|
|
5252
5322
|
if (options_default.createChildContextWithAs) {
|
|
5253
|
-
arrayItemContext = parentBindingContext.createChildContext(arrayValue,
|
|
5323
|
+
arrayItemContext = parentBindingContext.createChildContext(arrayValue, options4.as, (context) => {
|
|
5254
5324
|
context.$index = index;
|
|
5255
5325
|
});
|
|
5256
5326
|
} else {
|
|
5257
|
-
arrayItemContext = parentBindingContext.extend({ [
|
|
5327
|
+
arrayItemContext = parentBindingContext.extend({ [options4.as]: arrayValue, $index: index });
|
|
5258
5328
|
}
|
|
5259
5329
|
} else {
|
|
5260
|
-
arrayItemContext = parentBindingContext.createChildContext(arrayValue,
|
|
5330
|
+
arrayItemContext = parentBindingContext.createChildContext(arrayValue, options4.as, (context) => {
|
|
5261
5331
|
context.$index = index;
|
|
5262
5332
|
});
|
|
5263
5333
|
}
|
|
@@ -5267,14 +5337,14 @@ ${name} ${msg} of ${this.text}
|
|
|
5267
5337
|
"ignoreTargetNode",
|
|
5268
5338
|
templateName,
|
|
5269
5339
|
arrayItemContext,
|
|
5270
|
-
|
|
5340
|
+
options4,
|
|
5271
5341
|
afterBindingCallback
|
|
5272
5342
|
);
|
|
5273
5343
|
}
|
|
5274
5344
|
const activateBindingsCallback = function(arrayValue, addedNodesArray) {
|
|
5275
5345
|
activateBindingsOnContinuousNodeArray(addedNodesArray, arrayItemContext, afterBindingCallback);
|
|
5276
|
-
if (
|
|
5277
|
-
|
|
5346
|
+
if (options4.afterRender) {
|
|
5347
|
+
options4.afterRender(addedNodesArray, arrayValue);
|
|
5278
5348
|
}
|
|
5279
5349
|
arrayItemContext = null;
|
|
5280
5350
|
};
|
|
@@ -5283,14 +5353,14 @@ ${name} ${msg} of ${this.text}
|
|
|
5283
5353
|
targetNode,
|
|
5284
5354
|
newArray,
|
|
5285
5355
|
executeTemplateForArrayItem,
|
|
5286
|
-
|
|
5356
|
+
options4,
|
|
5287
5357
|
activateBindingsCallback,
|
|
5288
5358
|
changeList
|
|
5289
5359
|
]);
|
|
5290
5360
|
bindingEvent.notify(targetNode, bindingEvent.childrenComplete);
|
|
5291
5361
|
}
|
|
5292
|
-
const shouldHideDestroyed =
|
|
5293
|
-
if (!shouldHideDestroyed && !
|
|
5362
|
+
const shouldHideDestroyed = options4.includeDestroyed === false || options_default.foreachHidesDestroyed && !options4.includeDestroyed;
|
|
5363
|
+
if (!shouldHideDestroyed && !options4.beforeRemove && isObservableArray(arrayOrObservableArray)) {
|
|
5294
5364
|
localSetDomNodeChildrenFromArrayMapping(arrayOrObservableArray.peek());
|
|
5295
5365
|
const subscription = arrayOrObservableArray.subscribe(
|
|
5296
5366
|
function(changeList) {
|
|
@@ -5366,40 +5436,40 @@ ${name} ${msg} of ${this.text}
|
|
|
5366
5436
|
const element = this.$element;
|
|
5367
5437
|
const bindingContext2 = this.$context;
|
|
5368
5438
|
const value2 = this.value;
|
|
5369
|
-
let
|
|
5439
|
+
let options4 = unwrap(value2);
|
|
5370
5440
|
let shouldDisplay = true;
|
|
5371
5441
|
let templateComputed = null;
|
|
5372
5442
|
const elseChainSatisfied = data_exports.get(element, "conditional").elseChainSatisfied;
|
|
5373
5443
|
let templateName;
|
|
5374
|
-
if (typeof
|
|
5444
|
+
if (typeof options4 === "string") {
|
|
5375
5445
|
templateName = value2;
|
|
5376
|
-
|
|
5446
|
+
options4 = {};
|
|
5377
5447
|
} else {
|
|
5378
|
-
templateName =
|
|
5379
|
-
if ("if" in
|
|
5380
|
-
shouldDisplay = unwrap(
|
|
5448
|
+
templateName = options4.name;
|
|
5449
|
+
if ("if" in options4) {
|
|
5450
|
+
shouldDisplay = unwrap(options4.if);
|
|
5381
5451
|
}
|
|
5382
|
-
if (shouldDisplay && "ifnot" in
|
|
5383
|
-
shouldDisplay = !unwrap(
|
|
5452
|
+
if (shouldDisplay && "ifnot" in options4) {
|
|
5453
|
+
shouldDisplay = !unwrap(options4.ifnot);
|
|
5384
5454
|
}
|
|
5385
5455
|
}
|
|
5386
|
-
if ("foreach" in
|
|
5387
|
-
const dataArray = shouldDisplay &&
|
|
5456
|
+
if ("foreach" in options4) {
|
|
5457
|
+
const dataArray = shouldDisplay && options4.foreach || [];
|
|
5388
5458
|
templateComputed = renderTemplateForEach(
|
|
5389
5459
|
templateName || element,
|
|
5390
5460
|
dataArray,
|
|
5391
|
-
|
|
5461
|
+
options4,
|
|
5392
5462
|
element,
|
|
5393
5463
|
bindingContext2,
|
|
5394
5464
|
this.completeBinding
|
|
5395
5465
|
);
|
|
5396
5466
|
elseChainSatisfied((unwrap(dataArray) || []).length !== 0);
|
|
5397
5467
|
} else if (shouldDisplay) {
|
|
5398
|
-
const innerBindingContext = "data" in
|
|
5468
|
+
const innerBindingContext = "data" in options4 ? bindingContext2.createStaticChildContext(options4.data, options4.as) : bindingContext2;
|
|
5399
5469
|
templateComputed = renderTemplate(
|
|
5400
5470
|
templateName || element,
|
|
5401
5471
|
innerBindingContext,
|
|
5402
|
-
|
|
5472
|
+
options4,
|
|
5403
5473
|
element,
|
|
5404
5474
|
void 0,
|
|
5405
5475
|
this.completeBinding
|
|
@@ -5430,12 +5500,12 @@ ${name} ${msg} of ${this.text}
|
|
|
5430
5500
|
}
|
|
5431
5501
|
};
|
|
5432
5502
|
|
|
5433
|
-
// ../../packages/binding.template/
|
|
5503
|
+
// ../../packages/binding.template/src/nativeTemplateEngine.ts
|
|
5434
5504
|
function nativeTemplateEngine() {
|
|
5435
5505
|
}
|
|
5436
5506
|
nativeTemplateEngine.prototype = new templateEngine();
|
|
5437
5507
|
nativeTemplateEngine.prototype.constructor = nativeTemplateEngine;
|
|
5438
|
-
nativeTemplateEngine.prototype.renderTemplateSource = function(templateSource, bindingContext2,
|
|
5508
|
+
nativeTemplateEngine.prototype.renderTemplateSource = function(templateSource, bindingContext2, options4, templateDocument) {
|
|
5439
5509
|
const templateNodes = templateSource.nodes ? templateSource.nodes() : null;
|
|
5440
5510
|
if (templateNodes) {
|
|
5441
5511
|
return makeArray(templateNodes.cloneNode(true).childNodes);
|
|
@@ -5447,7 +5517,7 @@ ${name} ${msg} of ${this.text}
|
|
|
5447
5517
|
nativeTemplateEngine.instance = new nativeTemplateEngine();
|
|
5448
5518
|
setTemplateEngine(nativeTemplateEngine.instance);
|
|
5449
5519
|
|
|
5450
|
-
// ../../packages/binding.template/
|
|
5520
|
+
// ../../packages/binding.template/src/foreach.ts
|
|
5451
5521
|
var TemplateForEachBindingHandler = class extends TemplateBindingHandler {
|
|
5452
5522
|
get value() {
|
|
5453
5523
|
const modelValue = this.valueAccessor();
|
|
@@ -5470,10 +5540,10 @@ ${name} ${msg} of ${this.text}
|
|
|
5470
5540
|
}
|
|
5471
5541
|
};
|
|
5472
5542
|
|
|
5473
|
-
// ../../packages/binding.template/
|
|
5543
|
+
// ../../packages/binding.template/src/index.ts
|
|
5474
5544
|
var bindings = { foreach: TemplateForEachBindingHandler, template: TemplateBindingHandler };
|
|
5475
5545
|
|
|
5476
|
-
// ../../packages/builder/
|
|
5546
|
+
// ../../packages/builder/src/Builder.ts
|
|
5477
5547
|
var domNodeDisposal = {
|
|
5478
5548
|
addDisposeCallback,
|
|
5479
5549
|
removeDisposeCallback,
|
|
@@ -5574,8 +5644,9 @@ ${name} ${msg} of ${this.text}
|
|
|
5574
5644
|
bindingEvent
|
|
5575
5645
|
};
|
|
5576
5646
|
var Builder = class {
|
|
5577
|
-
constructor({ provider: provider2, bindings: bindings6, extenders: extenders3, filters: filters2, options:
|
|
5578
|
-
|
|
5647
|
+
constructor({ provider: provider2, bindings: bindings6, extenders: extenders3, filters: filters2, options: options4 }) {
|
|
5648
|
+
__publicField(this, "providedProperties");
|
|
5649
|
+
Object.assign(knockout.options, options4, { filters: filters2, bindingProviderInstance: provider2 });
|
|
5579
5650
|
provider2.setGlobals(knockout.options.bindingGlobals);
|
|
5580
5651
|
if (Array.isArray(bindings6)) {
|
|
5581
5652
|
for (const bindingsObject of bindings6) {
|
|
@@ -5613,7 +5684,7 @@ ${name} ${msg} of ${this.text}
|
|
|
5613
5684
|
}
|
|
5614
5685
|
};
|
|
5615
5686
|
|
|
5616
|
-
// ../../packages/provider/
|
|
5687
|
+
// ../../packages/provider/src/BindingHandlerObject.ts
|
|
5617
5688
|
var BindingHandlerObject = class {
|
|
5618
5689
|
set(nameOrObject, value2) {
|
|
5619
5690
|
if (typeof nameOrObject === "string") {
|
|
@@ -5641,9 +5712,12 @@ ${name} ${msg} of ${this.text}
|
|
|
5641
5712
|
}
|
|
5642
5713
|
};
|
|
5643
5714
|
|
|
5644
|
-
// ../../packages/provider/
|
|
5715
|
+
// ../../packages/provider/src/Provider.ts
|
|
5645
5716
|
var Provider = class _Provider {
|
|
5646
5717
|
constructor(params) {
|
|
5718
|
+
__publicField(this, "bindingHandlers");
|
|
5719
|
+
__publicField(this, "globals");
|
|
5720
|
+
__publicField(this, "_overloadInstance");
|
|
5647
5721
|
if (this.constructor === _Provider) {
|
|
5648
5722
|
throw new Error("Provider is an abstract base class.");
|
|
5649
5723
|
}
|
|
@@ -5712,14 +5786,15 @@ ${name} ${msg} of ${this.text}
|
|
|
5712
5786
|
}
|
|
5713
5787
|
};
|
|
5714
5788
|
var LegacyProvider = class extends Provider {
|
|
5715
|
-
get FOR_NODE_TYPES() {
|
|
5716
|
-
return [Node.ELEMENT_NODE, Node.TEXT_NODE, Node.COMMENT_NODE];
|
|
5717
|
-
}
|
|
5718
5789
|
constructor(providerObject, parentProvider) {
|
|
5719
5790
|
super();
|
|
5791
|
+
__publicField(this, "providerObject");
|
|
5720
5792
|
Object.assign(this, { providerObject });
|
|
5721
5793
|
this.bindingHandlers = providerObject.bindingHandlers || parentProvider.bindingHandlers;
|
|
5722
5794
|
}
|
|
5795
|
+
get FOR_NODE_TYPES() {
|
|
5796
|
+
return [Node.ELEMENT_NODE, Node.TEXT_NODE, Node.COMMENT_NODE];
|
|
5797
|
+
}
|
|
5723
5798
|
// This function is used if the binding provider doesn't include a getBindingAccessors function.
|
|
5724
5799
|
// It must be called with 'this' set to the provider instance.
|
|
5725
5800
|
getBindingsAndMakeAccessors(node, context) {
|
|
@@ -5740,7 +5815,7 @@ ${name} ${msg} of ${this.text}
|
|
|
5740
5815
|
}
|
|
5741
5816
|
};
|
|
5742
5817
|
|
|
5743
|
-
// ../../packages/provider.bindingstring/
|
|
5818
|
+
// ../../packages/provider.bindingstring/src/BindingStringProvider.ts
|
|
5744
5819
|
var BindingStringProvider = class extends Provider {
|
|
5745
5820
|
/** Call bindingHandler.preprocess on each respective binding string.
|
|
5746
5821
|
*
|
|
@@ -5754,8 +5829,8 @@ ${name} ${msg} of ${this.text}
|
|
|
5754
5829
|
const bindingsAddedByHandler = new Array();
|
|
5755
5830
|
const chainFn = (...args) => bindingsAddedByHandler.push(args);
|
|
5756
5831
|
value2 = handler.preprocess(value2, key, chainFn);
|
|
5757
|
-
for (const [key2,
|
|
5758
|
-
yield* __yieldStar(this.processBinding(key2,
|
|
5832
|
+
for (const [key2, value3] of bindingsAddedByHandler) {
|
|
5833
|
+
yield* __yieldStar(this.processBinding(key2, value3));
|
|
5759
5834
|
}
|
|
5760
5835
|
} else if (property) {
|
|
5761
5836
|
value2 = `{${property}:${value2}}`;
|
|
@@ -5784,7 +5859,7 @@ ${name} ${msg} of ${this.text}
|
|
|
5784
5859
|
}
|
|
5785
5860
|
};
|
|
5786
5861
|
|
|
5787
|
-
// ../../packages/provider.virtual/
|
|
5862
|
+
// ../../packages/provider.virtual/src/VirtualProvider.ts
|
|
5788
5863
|
var VirtualProvider = class extends BindingStringProvider {
|
|
5789
5864
|
get FOR_NODE_TYPES() {
|
|
5790
5865
|
return [Node.ELEMENT_NODE, Node.COMMENT_NODE];
|
|
@@ -5829,7 +5904,7 @@ ${name} ${msg} of ${this.text}
|
|
|
5829
5904
|
}
|
|
5830
5905
|
};
|
|
5831
5906
|
|
|
5832
|
-
// ../../packages/provider.databind/
|
|
5907
|
+
// ../../packages/provider.databind/src/DataBindProvider.ts
|
|
5833
5908
|
var DataBindProvider = class extends BindingStringProvider {
|
|
5834
5909
|
get FOR_NODE_TYPES() {
|
|
5835
5910
|
return [Node.ELEMENT_NODE];
|
|
@@ -5851,7 +5926,7 @@ ${name} ${msg} of ${this.text}
|
|
|
5851
5926
|
}
|
|
5852
5927
|
};
|
|
5853
5928
|
|
|
5854
|
-
// ../../packages/utils.component/
|
|
5929
|
+
// ../../packages/utils.component/src/registry.ts
|
|
5855
5930
|
var loadingSubscribablesCache = {};
|
|
5856
5931
|
var loadedDefinitionsCache = {};
|
|
5857
5932
|
function loadComponentAndNotify(componentName, callback) {
|
|
@@ -5946,7 +6021,7 @@ ${name} ${msg} of ${this.text}
|
|
|
5946
6021
|
loaders: new Array()
|
|
5947
6022
|
};
|
|
5948
6023
|
|
|
5949
|
-
// ../../packages/utils.component/
|
|
6024
|
+
// ../../packages/utils.component/src/loaders.ts
|
|
5950
6025
|
var defaultConfigRegistry = {};
|
|
5951
6026
|
var VIEW_MODEL_FACTORY = /* @__PURE__ */ Symbol("Knockout View Model ViewModel factory");
|
|
5952
6027
|
function register(componentName, config) {
|
|
@@ -6083,8 +6158,12 @@ ${name} ${msg} of ${this.text}
|
|
|
6083
6158
|
function possiblyGetConfigFromAmd(errorCallback, config, callback) {
|
|
6084
6159
|
if (typeof config.require === "string") {
|
|
6085
6160
|
if (window.amdRequire || window.require) {
|
|
6086
|
-
;
|
|
6087
|
-
|
|
6161
|
+
const amdRequire = window.amdRequire || window.require;
|
|
6162
|
+
amdRequire([config.require], callback, function(err) {
|
|
6163
|
+
var _a2;
|
|
6164
|
+
const details = (_a2 = err == null ? void 0 : err.message) != null ? _a2 : String(err || "");
|
|
6165
|
+
errorCallback("Failed to load AMD module: " + config.require + (details ? " \u2014 " + details : ""));
|
|
6166
|
+
});
|
|
6088
6167
|
} else {
|
|
6089
6168
|
errorCallback("Uses require, but no AMD loader is present");
|
|
6090
6169
|
}
|
|
@@ -6099,7 +6178,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6099
6178
|
}
|
|
6100
6179
|
registry.loaders.push(defaultLoader);
|
|
6101
6180
|
|
|
6102
|
-
// ../../packages/utils.component/
|
|
6181
|
+
// ../../packages/utils.component/src/ComponentABC.ts
|
|
6103
6182
|
var ComponentABC = class extends LifeCycle {
|
|
6104
6183
|
/**
|
|
6105
6184
|
* The tag name of the custom element. For example 'my-component'.
|
|
@@ -6115,22 +6194,28 @@ ${name} ${msg} of ${this.text}
|
|
|
6115
6194
|
* 2. An array of DOM nodes
|
|
6116
6195
|
* 3. A document fragment
|
|
6117
6196
|
* 4. An AMD module (with `{require: 'some/template'}`)
|
|
6197
|
+
* If neither this nor `element` is overloaded, the component's own
|
|
6198
|
+
* children serve as its template (children-as-template mode).
|
|
6118
6199
|
* @return {mixed} One of the accepted template types for the ComponentBinding.
|
|
6119
6200
|
*/
|
|
6120
6201
|
static get template() {
|
|
6121
6202
|
if ("template" in this.prototype) {
|
|
6122
|
-
return;
|
|
6203
|
+
return void 0;
|
|
6123
6204
|
}
|
|
6124
|
-
|
|
6205
|
+
const element = this.element;
|
|
6206
|
+
return element ? { element } : void 0;
|
|
6125
6207
|
}
|
|
6126
6208
|
/**
|
|
6127
|
-
*
|
|
6209
|
+
* Overload this to return:
|
|
6128
6210
|
* 1. The element ID
|
|
6129
6211
|
* 2. A DOM node itself
|
|
6130
|
-
*
|
|
6212
|
+
* Leave unset to use children-as-template mode — the component's own
|
|
6213
|
+
* instance children become its template.
|
|
6214
|
+
* @return {string|HTMLElement|undefined} the element ID, actual element,
|
|
6215
|
+
* or undefined to opt into children-as-template.
|
|
6131
6216
|
*/
|
|
6132
6217
|
static get element() {
|
|
6133
|
-
|
|
6218
|
+
return void 0;
|
|
6134
6219
|
}
|
|
6135
6220
|
/**
|
|
6136
6221
|
* @return {bool} True if the component shall load synchronously
|
|
@@ -6155,8 +6240,8 @@ ${name} ${msg} of ${this.text}
|
|
|
6155
6240
|
}
|
|
6156
6241
|
};
|
|
6157
6242
|
|
|
6158
|
-
// ../../packages/utils.component/
|
|
6159
|
-
var
|
|
6243
|
+
// ../../packages/utils.component/src/index.ts
|
|
6244
|
+
var src_default = {
|
|
6160
6245
|
ComponentABC,
|
|
6161
6246
|
// -- Registry --
|
|
6162
6247
|
get: registry.get,
|
|
@@ -6176,7 +6261,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6176
6261
|
}
|
|
6177
6262
|
};
|
|
6178
6263
|
|
|
6179
|
-
// ../../packages/provider.component/
|
|
6264
|
+
// ../../packages/provider.component/src/ComponentProvider.ts
|
|
6180
6265
|
var ComponentProvider = class extends Provider {
|
|
6181
6266
|
get FOR_NODE_TYPES() {
|
|
6182
6267
|
return [Node.ELEMENT_NODE];
|
|
@@ -6217,9 +6302,9 @@ ${name} ${msg} of ${this.text}
|
|
|
6217
6302
|
return null;
|
|
6218
6303
|
}
|
|
6219
6304
|
const tagName = tagNameLower(node);
|
|
6220
|
-
if (
|
|
6305
|
+
if (src_default.isRegistered(tagName)) {
|
|
6221
6306
|
const hasDash = tagName.includes("-");
|
|
6222
|
-
const isUnknownEntity =
|
|
6307
|
+
const isUnknownEntity = Object.prototype.toString.call(node) === "[object HTMLUnknownElement]";
|
|
6223
6308
|
if (hasDash || isUnknownEntity) {
|
|
6224
6309
|
return tagName;
|
|
6225
6310
|
}
|
|
@@ -6254,7 +6339,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6254
6339
|
}
|
|
6255
6340
|
};
|
|
6256
6341
|
|
|
6257
|
-
// ../../packages/provider.attr/
|
|
6342
|
+
// ../../packages/provider.attr/src/AttributeProvider.ts
|
|
6258
6343
|
var AttrProvider = class extends Provider {
|
|
6259
6344
|
get FOR_NODE_TYPES() {
|
|
6260
6345
|
return [Node.ELEMENT_NODE];
|
|
@@ -6306,23 +6391,26 @@ ${name} ${msg} of ${this.text}
|
|
|
6306
6391
|
if (token in this.globals) {
|
|
6307
6392
|
return this.globals[token];
|
|
6308
6393
|
}
|
|
6309
|
-
throw new Error(`The variable '${token} not found.`);
|
|
6394
|
+
throw new Error(`The variable '${token}' not found.`);
|
|
6310
6395
|
}
|
|
6311
6396
|
};
|
|
6312
6397
|
|
|
6313
|
-
// ../../packages/provider.multi/
|
|
6398
|
+
// ../../packages/provider.multi/src/MultiProvider.ts
|
|
6314
6399
|
var MultiProvider = class extends Provider {
|
|
6315
|
-
get FOR_NODE_TYPES() {
|
|
6316
|
-
return this.nodeTypes;
|
|
6317
|
-
}
|
|
6318
6400
|
constructor(params) {
|
|
6319
6401
|
super(params);
|
|
6402
|
+
__publicField(this, "nodeTypes");
|
|
6403
|
+
__publicField(this, "nodeTypeMap");
|
|
6404
|
+
__publicField(this, "providers");
|
|
6320
6405
|
const providers = (params == null ? void 0 : params.providers) || [];
|
|
6321
6406
|
this.nodeTypeMap = {};
|
|
6322
6407
|
this.nodeTypes = [];
|
|
6323
6408
|
this.providers = [];
|
|
6324
6409
|
providers.forEach((p) => this.addProvider(p));
|
|
6325
6410
|
}
|
|
6411
|
+
get FOR_NODE_TYPES() {
|
|
6412
|
+
return this.nodeTypes;
|
|
6413
|
+
}
|
|
6326
6414
|
setGlobals(globals) {
|
|
6327
6415
|
;
|
|
6328
6416
|
[this, ...this.providers].forEach((p) => p.globals = globals);
|
|
@@ -6379,14 +6467,14 @@ ${name} ${msg} of ${this.text}
|
|
|
6379
6467
|
}
|
|
6380
6468
|
};
|
|
6381
6469
|
|
|
6382
|
-
// ../../packages/binding.core/
|
|
6470
|
+
// ../../packages/binding.core/src/attr.ts
|
|
6383
6471
|
var attr = {
|
|
6384
6472
|
update: function(element, valueAccessor, _allBindings) {
|
|
6385
6473
|
const value2 = unwrap(valueAccessor()) || {};
|
|
6386
6474
|
objectForEach(value2, function(attrName, attrValue) {
|
|
6387
6475
|
attrValue = unwrap(attrValue);
|
|
6388
6476
|
const prefixLen = attrName.indexOf(":");
|
|
6389
|
-
const namespace = prefixLen > 0 && element.lookupNamespaceURI(attrName.
|
|
6477
|
+
const namespace = prefixLen > 0 && element.lookupNamespaceURI(attrName.substring(0, prefixLen));
|
|
6390
6478
|
const toRemove = attrValue === false || attrValue === null || attrValue === void 0;
|
|
6391
6479
|
if (toRemove) {
|
|
6392
6480
|
if (namespace) {
|
|
@@ -6409,7 +6497,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6409
6497
|
}
|
|
6410
6498
|
};
|
|
6411
6499
|
|
|
6412
|
-
// ../../packages/binding.core/
|
|
6500
|
+
// ../../packages/binding.core/src/checked.ts
|
|
6413
6501
|
var checked = {
|
|
6414
6502
|
after: ["value", "attr"],
|
|
6415
6503
|
init: function(element, valueAccessor, allBindings) {
|
|
@@ -6491,7 +6579,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6491
6579
|
}
|
|
6492
6580
|
};
|
|
6493
6581
|
|
|
6494
|
-
// ../../packages/binding.core/
|
|
6582
|
+
// ../../packages/binding.core/src/event.ts
|
|
6495
6583
|
function makeEventHandlerShortcut(eventName) {
|
|
6496
6584
|
return {
|
|
6497
6585
|
init: function(element, valueAccessor, allBindings, viewModel, bindingContext2) {
|
|
@@ -6535,10 +6623,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6535
6623
|
}
|
|
6536
6624
|
const bubbleMark = allBindings.get(eventName + "Bubble") !== false;
|
|
6537
6625
|
if (bubble === false || !bubbleMark) {
|
|
6538
|
-
event.
|
|
6539
|
-
if (event.stopPropagation) {
|
|
6540
|
-
event.stopPropagation();
|
|
6541
|
-
}
|
|
6626
|
+
event.stopPropagation();
|
|
6542
6627
|
}
|
|
6543
6628
|
};
|
|
6544
6629
|
if (debounce2) {
|
|
@@ -6558,10 +6643,10 @@ ${name} ${msg} of ${this.text}
|
|
|
6558
6643
|
}
|
|
6559
6644
|
};
|
|
6560
6645
|
|
|
6561
|
-
// ../../packages/binding.core/
|
|
6646
|
+
// ../../packages/binding.core/src/click.ts
|
|
6562
6647
|
var click = makeEventHandlerShortcut("click");
|
|
6563
6648
|
|
|
6564
|
-
// ../../packages/binding.core/
|
|
6649
|
+
// ../../packages/binding.core/src/css.ts
|
|
6565
6650
|
var css = {
|
|
6566
6651
|
aliases: ["class"],
|
|
6567
6652
|
update: function(element, valueAccessor) {
|
|
@@ -6572,16 +6657,16 @@ ${name} ${msg} of ${this.text}
|
|
|
6572
6657
|
toggleDomNodeCssClass(element, className, shouldHaveClass);
|
|
6573
6658
|
});
|
|
6574
6659
|
} else {
|
|
6575
|
-
value2 =
|
|
6660
|
+
value2 = String(value2 != null ? value2 : "").trim();
|
|
6576
6661
|
toggleDomNodeCssClass(element, element[css.classesWrittenByBindingKey], false);
|
|
6577
6662
|
element[css.classesWrittenByBindingKey] = value2;
|
|
6578
6663
|
toggleDomNodeCssClass(element, value2, true);
|
|
6579
6664
|
}
|
|
6580
6665
|
},
|
|
6581
|
-
classesWrittenByBindingKey:
|
|
6666
|
+
classesWrittenByBindingKey: /* @__PURE__ */ Symbol("__ko__cssValue")
|
|
6582
6667
|
};
|
|
6583
6668
|
|
|
6584
|
-
// ../../packages/binding.core/
|
|
6669
|
+
// ../../packages/binding.core/src/descendantsComplete.ts
|
|
6585
6670
|
var DescendantsCompleteHandler = class extends BindingHandler {
|
|
6586
6671
|
onDescendantsComplete() {
|
|
6587
6672
|
if (typeof this.value === "function") {
|
|
@@ -6593,7 +6678,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6593
6678
|
}
|
|
6594
6679
|
};
|
|
6595
6680
|
|
|
6596
|
-
// ../../packages/binding.core/
|
|
6681
|
+
// ../../packages/binding.core/src/enableDisable.ts
|
|
6597
6682
|
var enable = {
|
|
6598
6683
|
update: function(element, valueAccessor) {
|
|
6599
6684
|
const value2 = unwrap(valueAccessor());
|
|
@@ -6612,9 +6697,9 @@ ${name} ${msg} of ${this.text}
|
|
|
6612
6697
|
}
|
|
6613
6698
|
};
|
|
6614
6699
|
|
|
6615
|
-
// ../../packages/binding.core/
|
|
6616
|
-
var hasfocusUpdatingProperty =
|
|
6617
|
-
var hasfocusLastValue =
|
|
6700
|
+
// ../../packages/binding.core/src/hasfocus.ts
|
|
6701
|
+
var hasfocusUpdatingProperty = /* @__PURE__ */ Symbol("__ko_hasfocusUpdating");
|
|
6702
|
+
var hasfocusLastValue = /* @__PURE__ */ Symbol("__ko_hasfocusLastValue");
|
|
6618
6703
|
var hasfocus = {
|
|
6619
6704
|
init: function(element, valueAccessor, _allBindings) {
|
|
6620
6705
|
const handleElementFocusChange = function(isFocused) {
|
|
@@ -6659,7 +6744,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6659
6744
|
}
|
|
6660
6745
|
};
|
|
6661
6746
|
|
|
6662
|
-
// ../../packages/binding.core/
|
|
6747
|
+
// ../../packages/binding.core/src/html.ts
|
|
6663
6748
|
var html = {
|
|
6664
6749
|
init: function() {
|
|
6665
6750
|
return { controlsDescendantBindings: true };
|
|
@@ -6673,7 +6758,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6673
6758
|
allowVirtualElements: true
|
|
6674
6759
|
};
|
|
6675
6760
|
|
|
6676
|
-
// ../../packages/binding.core/
|
|
6761
|
+
// ../../packages/binding.core/src/let.ts
|
|
6677
6762
|
var let_default = {
|
|
6678
6763
|
init: function(element, valueAccessor, _allBindings, _viewModel, bindingContext2) {
|
|
6679
6764
|
const innerContext = bindingContext2["extend"](valueAccessor);
|
|
@@ -6683,9 +6768,9 @@ ${name} ${msg} of ${this.text}
|
|
|
6683
6768
|
allowVirtualElements: true
|
|
6684
6769
|
};
|
|
6685
6770
|
|
|
6686
|
-
// ../../packages/binding.core/
|
|
6771
|
+
// ../../packages/binding.core/src/options.ts
|
|
6687
6772
|
var captionPlaceholder = {};
|
|
6688
|
-
var
|
|
6773
|
+
var options3 = {
|
|
6689
6774
|
init: function(element) {
|
|
6690
6775
|
if (tagNameLower(element) !== "select") {
|
|
6691
6776
|
throw new Error("options binding applies only to SELECT elements");
|
|
@@ -6814,7 +6899,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6814
6899
|
}
|
|
6815
6900
|
};
|
|
6816
6901
|
|
|
6817
|
-
// ../../packages/binding.core/
|
|
6902
|
+
// ../../packages/binding.core/src/selectedOptions.ts
|
|
6818
6903
|
var selectedOptions = {
|
|
6819
6904
|
after: ["options", "foreach"],
|
|
6820
6905
|
init: function(element, valueAccessor, _allBindings) {
|
|
@@ -6845,7 +6930,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6845
6930
|
}
|
|
6846
6931
|
};
|
|
6847
6932
|
|
|
6848
|
-
// ../../packages/binding.core/
|
|
6933
|
+
// ../../packages/binding.core/src/style.ts
|
|
6849
6934
|
var style = {
|
|
6850
6935
|
update: function(element, valueAccessor) {
|
|
6851
6936
|
const value2 = unwrap(valueAccessor() || {});
|
|
@@ -6855,7 +6940,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6855
6940
|
styleValue = "";
|
|
6856
6941
|
}
|
|
6857
6942
|
if (options_default.jQuery) {
|
|
6858
|
-
jQuery(element).css(styleName, styleValue);
|
|
6943
|
+
options_default.jQuery(element).css(styleName, styleValue);
|
|
6859
6944
|
} else {
|
|
6860
6945
|
styleName = styleName.replace(/-(\w)/g, (all, letter) => letter.toUpperCase());
|
|
6861
6946
|
const previousStyle = element.style[styleName];
|
|
@@ -6868,7 +6953,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6868
6953
|
}
|
|
6869
6954
|
};
|
|
6870
6955
|
|
|
6871
|
-
// ../../packages/binding.core/
|
|
6956
|
+
// ../../packages/binding.core/src/submit.ts
|
|
6872
6957
|
var submit = {
|
|
6873
6958
|
init: function(element, valueAccessor, _allBindings, _viewModel, bindingContext2) {
|
|
6874
6959
|
if (typeof valueAccessor() !== "function") {
|
|
@@ -6892,7 +6977,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6892
6977
|
}
|
|
6893
6978
|
};
|
|
6894
6979
|
|
|
6895
|
-
// ../../packages/binding.core/
|
|
6980
|
+
// ../../packages/binding.core/src/text.ts
|
|
6896
6981
|
var text = {
|
|
6897
6982
|
init: function() {
|
|
6898
6983
|
return { controlsDescendantBindings: true };
|
|
@@ -6903,19 +6988,18 @@ ${name} ${msg} of ${this.text}
|
|
|
6903
6988
|
allowVirtualElements: true
|
|
6904
6989
|
};
|
|
6905
6990
|
|
|
6906
|
-
// ../../packages/binding.core/
|
|
6991
|
+
// ../../packages/binding.core/src/textInput.ts
|
|
6907
6992
|
var MSIE_REGEX = /MSIE ([^ ;]+)|rv:([^ )]+)/;
|
|
6908
6993
|
var operaVersion;
|
|
6909
6994
|
var safariVersion;
|
|
6910
|
-
var firefoxVersion;
|
|
6911
6995
|
var ieVersion;
|
|
6912
6996
|
var TextInput = class extends BindingHandler {
|
|
6913
|
-
get aliases() {
|
|
6914
|
-
return "textinput";
|
|
6915
|
-
}
|
|
6916
6997
|
constructor(...args) {
|
|
6917
6998
|
super(...args);
|
|
6918
|
-
this
|
|
6999
|
+
__publicField(this, "previousElementValue");
|
|
7000
|
+
__publicField(this, "elementValueBeforeEvent");
|
|
7001
|
+
__publicField(this, "timeoutHandle");
|
|
7002
|
+
this.previousElementValue = this.$inputElement.value;
|
|
6919
7003
|
if (options_default.debug && this.constructor._forceUpdateOn) {
|
|
6920
7004
|
arrayForEach(this.constructor._forceUpdateOn, (eventName) => {
|
|
6921
7005
|
if (eventName.slice(0, 5) === "after") {
|
|
@@ -6933,6 +7017,12 @@ ${name} ${msg} of ${this.text}
|
|
|
6933
7017
|
}
|
|
6934
7018
|
this.computed("updateView");
|
|
6935
7019
|
}
|
|
7020
|
+
get aliases() {
|
|
7021
|
+
return "textinput";
|
|
7022
|
+
}
|
|
7023
|
+
get $inputElement() {
|
|
7024
|
+
return this.$element;
|
|
7025
|
+
}
|
|
6936
7026
|
eventsIndicatingSyncValueChange() {
|
|
6937
7027
|
return ["input", "change", "blur"];
|
|
6938
7028
|
}
|
|
@@ -6940,7 +7030,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6940
7030
|
return [];
|
|
6941
7031
|
}
|
|
6942
7032
|
updateModel(event) {
|
|
6943
|
-
const element = this.$
|
|
7033
|
+
const element = this.$inputElement;
|
|
6944
7034
|
clearTimeout(this.timeoutHandle);
|
|
6945
7035
|
this.elementValueBeforeEvent = this.timeoutHandle = void 0;
|
|
6946
7036
|
const elementValue = element.value;
|
|
@@ -6954,7 +7044,7 @@ ${name} ${msg} of ${this.text}
|
|
|
6954
7044
|
}
|
|
6955
7045
|
}
|
|
6956
7046
|
deferUpdateModel(event) {
|
|
6957
|
-
const element = this.$
|
|
7047
|
+
const element = this.$inputElement;
|
|
6958
7048
|
if (!this.timeoutHandle) {
|
|
6959
7049
|
this.elementValueBeforeEvent = element.value;
|
|
6960
7050
|
const handler = options_default.debug ? this.updateModel.bind(this, { type: event.type }) : this.updateModel;
|
|
@@ -6968,10 +7058,10 @@ ${name} ${msg} of ${this.text}
|
|
|
6968
7058
|
}
|
|
6969
7059
|
if (this.elementValueBeforeEvent !== void 0 && modelValue === this.elementValueBeforeEvent) {
|
|
6970
7060
|
setTimeout(this.updateView.bind(this), 4);
|
|
6971
|
-
} else if (this.$
|
|
7061
|
+
} else if (this.$inputElement.value !== modelValue) {
|
|
6972
7062
|
this.previousElementValue = modelValue;
|
|
6973
|
-
this.$
|
|
6974
|
-
this.previousElementValue = this.$
|
|
7063
|
+
this.$inputElement.value = modelValue;
|
|
7064
|
+
this.previousElementValue = this.$inputElement.value;
|
|
6975
7065
|
}
|
|
6976
7066
|
}
|
|
6977
7067
|
};
|
|
@@ -6990,36 +7080,21 @@ ${name} ${msg} of ${this.text}
|
|
|
6990
7080
|
return ["keydown"];
|
|
6991
7081
|
}
|
|
6992
7082
|
};
|
|
6993
|
-
var
|
|
6994
|
-
|
|
6995
|
-
return [
|
|
6996
|
-
...super.eventsIndicatingSyncValueChange(),
|
|
6997
|
-
// Firefox <= 3.6 doesn't fire the 'input' event when text is filled in through autocomplete
|
|
6998
|
-
"DOMAutoComplete",
|
|
6999
|
-
// Firefox <=3.5 doesn't fire the 'input' event when text is dropped into the input.
|
|
7000
|
-
"dragdrop",
|
|
7001
|
-
// < 3.5
|
|
7002
|
-
"drop"
|
|
7003
|
-
// 3.5
|
|
7004
|
-
];
|
|
7005
|
-
}
|
|
7006
|
-
};
|
|
7007
|
-
var w2 = options_default.global;
|
|
7008
|
-
if (w2.navigator) {
|
|
7083
|
+
var w = options_default.global;
|
|
7084
|
+
if (w.navigator) {
|
|
7009
7085
|
const parseVersion = (matches) => matches && parseFloat(matches[1]);
|
|
7010
|
-
const userAgent =
|
|
7086
|
+
const userAgent = w.navigator.userAgent;
|
|
7011
7087
|
const isChrome = userAgent.match(/Chrome\/([^ ]+)/);
|
|
7012
7088
|
if (!isChrome) {
|
|
7013
|
-
operaVersion =
|
|
7089
|
+
operaVersion = w.opera && w.opera.version && parseInt(w.opera.version());
|
|
7014
7090
|
safariVersion = parseVersion(userAgent.match(/Version\/([^ ]+) Safari/));
|
|
7015
|
-
firefoxVersion = parseVersion(userAgent.match(/Firefox\/([^ ]*)/));
|
|
7016
7091
|
const ieMatch = userAgent.match(MSIE_REGEX);
|
|
7017
7092
|
ieVersion = ieMatch && (parseFloat(ieMatch[1]) || parseFloat(ieMatch[2]));
|
|
7018
7093
|
}
|
|
7019
7094
|
}
|
|
7020
|
-
var textInput = ieVersion && ieVersion <= 11 ? TextInputIE : safariVersion && safariVersion < 5 ? TextInputLegacySafari : operaVersion && operaVersion < 11 ? TextInputLegacyOpera :
|
|
7095
|
+
var textInput = ieVersion && ieVersion <= 11 ? TextInputIE : safariVersion && safariVersion < 5 ? TextInputLegacySafari : operaVersion && operaVersion < 11 ? TextInputLegacyOpera : TextInput;
|
|
7021
7096
|
|
|
7022
|
-
// ../../packages/binding.core/
|
|
7097
|
+
// ../../packages/binding.core/src/uniqueName.ts
|
|
7023
7098
|
var uniqueName = {
|
|
7024
7099
|
init: function(element, valueAccessor) {
|
|
7025
7100
|
if (valueAccessor()) {
|
|
@@ -7030,13 +7105,13 @@ ${name} ${msg} of ${this.text}
|
|
|
7030
7105
|
currentIndex: 0
|
|
7031
7106
|
};
|
|
7032
7107
|
|
|
7033
|
-
// ../../packages/binding.core/
|
|
7108
|
+
// ../../packages/binding.core/src/value.ts
|
|
7034
7109
|
var value = class extends BindingHandler {
|
|
7035
|
-
static get after() {
|
|
7036
|
-
return ["options", "foreach", "template"];
|
|
7037
|
-
}
|
|
7038
7110
|
constructor(...args) {
|
|
7039
7111
|
super(...args);
|
|
7112
|
+
__publicField(this, "elementValueBeforeEvent");
|
|
7113
|
+
__publicField(this, "propertyChangedFired");
|
|
7114
|
+
__publicField(this, "updateFromModel");
|
|
7040
7115
|
if (this.isCheckboxOrRadio) {
|
|
7041
7116
|
applyBindingAccessorsToNode(this.$element, { checkedValue: this.valueAccessor });
|
|
7042
7117
|
return;
|
|
@@ -7046,32 +7121,35 @@ ${name} ${msg} of ${this.text}
|
|
|
7046
7121
|
if (this.ieAutoCompleteHackNeeded) {
|
|
7047
7122
|
this.addEventListener("propertyChange", () => this.propertyChangedFired = true);
|
|
7048
7123
|
this.addEventListener("focus", () => this.propertyChangedFired = false);
|
|
7049
|
-
this.addEventListener("blur", () => this.
|
|
7124
|
+
this.addEventListener("blur", () => this.propertyChangedFired && this.valueUpdateHandler());
|
|
7050
7125
|
}
|
|
7051
7126
|
arrayForEach(this.eventsToCatch, (eventName) => this.registerEvent(eventName));
|
|
7052
|
-
if (this.isInput && this.$element.type === "file") {
|
|
7127
|
+
if (this.isInput(this.$element) && this.$element.type === "file") {
|
|
7053
7128
|
this.updateFromModel = this.updateFromModelForFile;
|
|
7054
7129
|
} else {
|
|
7055
7130
|
this.updateFromModel = this.updateFromModelForValue;
|
|
7056
7131
|
}
|
|
7057
7132
|
this.computed("updateFromModel");
|
|
7058
7133
|
}
|
|
7134
|
+
static get after() {
|
|
7135
|
+
return ["options", "foreach", "template"];
|
|
7136
|
+
}
|
|
7059
7137
|
get eventsToCatch() {
|
|
7060
7138
|
const requestedEventsToCatch = this.allBindings.get("valueUpdate");
|
|
7061
7139
|
const requestedEventsArray = typeof requestedEventsToCatch === "string" ? [requestedEventsToCatch] : requestedEventsToCatch || [];
|
|
7062
7140
|
return [.../* @__PURE__ */ new Set(["change", ...requestedEventsArray])];
|
|
7063
7141
|
}
|
|
7064
|
-
|
|
7142
|
+
isInput(element) {
|
|
7065
7143
|
return tagNameLower(this.$element) === "input";
|
|
7066
7144
|
}
|
|
7067
7145
|
get isCheckboxOrRadio() {
|
|
7068
7146
|
const e = this.$element;
|
|
7069
|
-
return this.isInput && (e.type == "checkbox" || e.type == "radio");
|
|
7147
|
+
return this.isInput(e) && (e.type == "checkbox" || e.type == "radio");
|
|
7070
7148
|
}
|
|
7071
7149
|
// Workaround for https://github.com/SteveSanderson/knockout/issues/122
|
|
7072
7150
|
// IE doesn't fire "change" events on textboxes if the user selects a value from its autocomplete list
|
|
7073
7151
|
get ieAutoCompleteHackNeeded() {
|
|
7074
|
-
return this.isInput && this.$element.type == "text" && this.$element.autocomplete != "off" && (!this.$element.form || this.$element.form.autocomplete != "off") && MSIE_REGEX.test(window.navigator.userAgent);
|
|
7152
|
+
return this.isInput(this.$element) && this.$element.type == "text" && this.$element.autocomplete != "off" && (!this.$element.form || this.$element.form.autocomplete != "off") && MSIE_REGEX.test(window.navigator.userAgent);
|
|
7075
7153
|
}
|
|
7076
7154
|
valueUpdateHandler() {
|
|
7077
7155
|
this.elementValueBeforeEvent = null;
|
|
@@ -7080,7 +7158,7 @@ ${name} ${msg} of ${this.text}
|
|
|
7080
7158
|
}
|
|
7081
7159
|
registerEvent(eventName) {
|
|
7082
7160
|
let handler = this.valueUpdateHandler.bind(this);
|
|
7083
|
-
if (
|
|
7161
|
+
if (eventName.startsWith("after")) {
|
|
7084
7162
|
handler = () => {
|
|
7085
7163
|
this.elementValueBeforeEvent = selectExtensions.readValue(this.$element);
|
|
7086
7164
|
safeSetTimeout(this.valueUpdateHandler.bind(this), 0);
|
|
@@ -7095,6 +7173,7 @@ ${name} ${msg} of ${this.text}
|
|
|
7095
7173
|
updateFromModelForFile() {
|
|
7096
7174
|
const newValue = unwrap(this.value);
|
|
7097
7175
|
if (newValue === null || newValue === void 0 || newValue === "") {
|
|
7176
|
+
;
|
|
7098
7177
|
this.$element.value = "";
|
|
7099
7178
|
} else {
|
|
7100
7179
|
dependencyDetection_exports.ignore(this.valueUpdateHandler, this);
|
|
@@ -7123,7 +7202,7 @@ ${name} ${msg} of ${this.text}
|
|
|
7123
7202
|
}
|
|
7124
7203
|
};
|
|
7125
7204
|
|
|
7126
|
-
// ../../packages/binding.core/
|
|
7205
|
+
// ../../packages/binding.core/src/visible.ts
|
|
7127
7206
|
var visible = {
|
|
7128
7207
|
update: function(element, valueAccessor) {
|
|
7129
7208
|
const value2 = unwrap(valueAccessor());
|
|
@@ -7141,7 +7220,7 @@ ${name} ${msg} of ${this.text}
|
|
|
7141
7220
|
}
|
|
7142
7221
|
};
|
|
7143
7222
|
|
|
7144
|
-
// ../../packages/binding.core/
|
|
7223
|
+
// ../../packages/binding.core/src/using.ts
|
|
7145
7224
|
var using = {
|
|
7146
7225
|
init: function(element, valueAccessor, _allBindings, _viewModel, bindingContext2) {
|
|
7147
7226
|
const innerContext = bindingContext2.createChildContext(valueAccessor);
|
|
@@ -7151,7 +7230,7 @@ ${name} ${msg} of ${this.text}
|
|
|
7151
7230
|
allowVirtualElements: true
|
|
7152
7231
|
};
|
|
7153
7232
|
|
|
7154
|
-
// ../../packages/binding.core/
|
|
7233
|
+
// ../../packages/binding.core/src/index.ts
|
|
7155
7234
|
var bindings2 = {
|
|
7156
7235
|
attr,
|
|
7157
7236
|
checked,
|
|
@@ -7169,7 +7248,7 @@ ${name} ${msg} of ${this.text}
|
|
|
7169
7248
|
html,
|
|
7170
7249
|
let: let_default,
|
|
7171
7250
|
on: onHandler,
|
|
7172
|
-
options:
|
|
7251
|
+
options: options3,
|
|
7173
7252
|
selectedOptions,
|
|
7174
7253
|
style,
|
|
7175
7254
|
submit,
|
|
@@ -7182,17 +7261,20 @@ ${name} ${msg} of ${this.text}
|
|
|
7182
7261
|
visible
|
|
7183
7262
|
};
|
|
7184
7263
|
|
|
7185
|
-
// ../../packages/binding.if/
|
|
7264
|
+
// ../../packages/binding.if/src/ConditionalBindingHandler.ts
|
|
7186
7265
|
var ConditionalBindingHandler = class extends AsyncBindingHandler {
|
|
7187
|
-
get bindingContext() {
|
|
7188
|
-
throw new Error("bindingContext() must be implemented in the child class");
|
|
7189
|
-
}
|
|
7190
7266
|
constructor(params) {
|
|
7191
7267
|
super(params);
|
|
7268
|
+
__publicField(this, "completesElseChain");
|
|
7269
|
+
__publicField(this, "hasElse");
|
|
7270
|
+
__publicField(this, "ifElseNodes");
|
|
7192
7271
|
this.hasElse = this.detectElse(this.$element);
|
|
7193
7272
|
const elseChainSatisfied = this.completesElseChain = observable();
|
|
7194
7273
|
data_exports.set(this.$element, "conditional", { elseChainSatisfied });
|
|
7195
7274
|
}
|
|
7275
|
+
get bindingContext() {
|
|
7276
|
+
throw new Error("bindingContext() must be implemented in the child class");
|
|
7277
|
+
}
|
|
7196
7278
|
getIfElseNodes() {
|
|
7197
7279
|
if (this.ifElseNodes) {
|
|
7198
7280
|
return this.ifElseNodes;
|
|
@@ -7280,10 +7362,11 @@ ${name} ${msg} of ${this.text}
|
|
|
7280
7362
|
}
|
|
7281
7363
|
};
|
|
7282
7364
|
|
|
7283
|
-
// ../../packages/binding.if/
|
|
7365
|
+
// ../../packages/binding.if/src/ifUnless.ts
|
|
7284
7366
|
var IfBindingHandler = class extends ConditionalBindingHandler {
|
|
7285
7367
|
constructor(...args) {
|
|
7286
7368
|
super(...args);
|
|
7369
|
+
__publicField(this, "ifCondition");
|
|
7287
7370
|
this.ifCondition = this.computed(() => !!unwrap(this.value));
|
|
7288
7371
|
this.computed("render");
|
|
7289
7372
|
}
|
|
@@ -7313,10 +7396,12 @@ ${name} ${msg} of ${this.text}
|
|
|
7313
7396
|
}
|
|
7314
7397
|
};
|
|
7315
7398
|
|
|
7316
|
-
// ../../packages/binding.if/
|
|
7399
|
+
// ../../packages/binding.if/src/with.ts
|
|
7317
7400
|
var WithBindingHandler = class extends ConditionalBindingHandler {
|
|
7318
7401
|
constructor(...args) {
|
|
7319
7402
|
super(...args);
|
|
7403
|
+
__publicField(this, "asOption");
|
|
7404
|
+
__publicField(this, "conditional");
|
|
7320
7405
|
this.asOption = this.allBindings.get("as");
|
|
7321
7406
|
const conditionalFn = this.asOption && !options_default.createChildContextWithAs ? () => Boolean(unwrap(this.value)) : () => unwrap(this.value);
|
|
7322
7407
|
this.conditional = this.computed(conditionalFn);
|
|
@@ -7334,8 +7419,12 @@ ${name} ${msg} of ${this.text}
|
|
|
7334
7419
|
}
|
|
7335
7420
|
};
|
|
7336
7421
|
|
|
7337
|
-
// ../../packages/binding.if/
|
|
7422
|
+
// ../../packages/binding.if/src/else.ts
|
|
7338
7423
|
var ElseBindingHandler = class extends IfBindingHandler {
|
|
7424
|
+
constructor() {
|
|
7425
|
+
super(...arguments);
|
|
7426
|
+
__publicField(this, "_elseChain");
|
|
7427
|
+
}
|
|
7339
7428
|
shouldDisplayIf() {
|
|
7340
7429
|
return super.shouldDisplayIf() || this.value === void 0;
|
|
7341
7430
|
}
|
|
@@ -7364,7 +7453,7 @@ ${name} ${msg} of ${this.text}
|
|
|
7364
7453
|
}
|
|
7365
7454
|
};
|
|
7366
7455
|
|
|
7367
|
-
// ../../packages/binding.if/
|
|
7456
|
+
// ../../packages/binding.if/src/index.ts
|
|
7368
7457
|
var bindings3 = {
|
|
7369
7458
|
if: IfBindingHandler,
|
|
7370
7459
|
with: WithBindingHandler,
|
|
@@ -7374,8 +7463,8 @@ ${name} ${msg} of ${this.text}
|
|
|
7374
7463
|
elseif: ElseBindingHandler
|
|
7375
7464
|
};
|
|
7376
7465
|
|
|
7377
|
-
// ../../packages/binding.foreach/
|
|
7378
|
-
var MAX_LIST_SIZE =
|
|
7466
|
+
// ../../packages/binding.foreach/src/foreach.ts
|
|
7467
|
+
var MAX_LIST_SIZE = Number.MAX_SAFE_INTEGER;
|
|
7379
7468
|
function isPlainObject(o) {
|
|
7380
7469
|
return !!o && typeof o === "object" && o.constructor === Object;
|
|
7381
7470
|
}
|
|
@@ -7401,11 +7490,34 @@ ${name} ${msg} of ${this.text}
|
|
|
7401
7490
|
function valueToChangeAddItem(value2, index) {
|
|
7402
7491
|
return { status: "added", value: value2, index };
|
|
7403
7492
|
}
|
|
7404
|
-
var PENDING_DELETE_INDEX_SYM =
|
|
7405
|
-
var
|
|
7493
|
+
var PENDING_DELETE_INDEX_SYM = /* @__PURE__ */ Symbol("_ko_ffe_pending_delete_index");
|
|
7494
|
+
var _ForEachBinding = class _ForEachBinding extends AsyncBindingHandler {
|
|
7406
7495
|
constructor(params) {
|
|
7407
|
-
var
|
|
7496
|
+
var _a2;
|
|
7408
7497
|
super(params);
|
|
7498
|
+
// NOTE: valid valueAccessors include:
|
|
7499
|
+
// []
|
|
7500
|
+
// observable([])
|
|
7501
|
+
// observableArray([])
|
|
7502
|
+
// computed
|
|
7503
|
+
// {data: array, name: string, as: string}
|
|
7504
|
+
__publicField(this, "afterAdd");
|
|
7505
|
+
__publicField(this, "as");
|
|
7506
|
+
__publicField(this, "beforeRemove");
|
|
7507
|
+
__publicField(this, "container");
|
|
7508
|
+
__publicField(this, "changeSubs");
|
|
7509
|
+
__publicField(this, "data");
|
|
7510
|
+
__publicField(this, "generateContext");
|
|
7511
|
+
__publicField(this, "$indexHasBeenRequested");
|
|
7512
|
+
__publicField(this, "templateNode");
|
|
7513
|
+
__publicField(this, "changeQueue");
|
|
7514
|
+
__publicField(this, "firstLastNodesList");
|
|
7515
|
+
__publicField(this, "indexesToDelete");
|
|
7516
|
+
__publicField(this, "isNotEmpty");
|
|
7517
|
+
__publicField(this, "rendering_queued");
|
|
7518
|
+
__publicField(this, "pendingDeletes");
|
|
7519
|
+
__publicField(this, "afterQueueFlush");
|
|
7520
|
+
__publicField(this, "beforeQueueFlush");
|
|
7409
7521
|
const settings = {};
|
|
7410
7522
|
if (isPlainObject(this.value)) {
|
|
7411
7523
|
Object.assign(settings, this.value);
|
|
@@ -7416,7 +7528,7 @@ ${name} ${msg} of ${this.text}
|
|
|
7416
7528
|
this.generateContext = this.createContextGenerator(this.as);
|
|
7417
7529
|
this.$indexHasBeenRequested = false;
|
|
7418
7530
|
this.templateNode = makeTemplateNode(
|
|
7419
|
-
settings.templateNode || (settings.name ? (
|
|
7531
|
+
settings.templateNode || (settings.name ? (_a2 = document.getElementById(settings.name)) == null ? void 0 : _a2.cloneNode(true) : this.$element)
|
|
7420
7532
|
);
|
|
7421
7533
|
["afterAdd", "beforeRemove", "afterQueueFlush", "beforeQueueFlush"].forEach((p) => {
|
|
7422
7534
|
this[p] = settings[p] || this.allBindings.get(p);
|
|
@@ -7759,14 +7871,14 @@ ${name} ${msg} of ${this.text}
|
|
|
7759
7871
|
* Useful during testing.
|
|
7760
7872
|
*/
|
|
7761
7873
|
static setSync(toggle) {
|
|
7762
|
-
const
|
|
7874
|
+
const w2 = options_default.global;
|
|
7763
7875
|
if (toggle) {
|
|
7764
7876
|
_ForEachBinding.animateFrame = function(frame) {
|
|
7765
7877
|
frame();
|
|
7766
7878
|
};
|
|
7767
7879
|
} else {
|
|
7768
|
-
_ForEachBinding.animateFrame =
|
|
7769
|
-
return
|
|
7880
|
+
_ForEachBinding.animateFrame = w2.requestAnimationFrame || w2.webkitRequestAnimationFrame || w2.mozRequestAnimationFrame || w2.msRequestAnimationFrame || function(cb) {
|
|
7881
|
+
return w2.setTimeout(cb, 1e3 / 60);
|
|
7770
7882
|
};
|
|
7771
7883
|
}
|
|
7772
7884
|
}
|
|
@@ -7784,12 +7896,14 @@ ${name} ${msg} of ${this.text}
|
|
|
7784
7896
|
return PENDING_DELETE_INDEX_SYM;
|
|
7785
7897
|
}
|
|
7786
7898
|
};
|
|
7899
|
+
__publicField(_ForEachBinding, "animateFrame");
|
|
7900
|
+
var ForEachBinding = _ForEachBinding;
|
|
7787
7901
|
|
|
7788
|
-
// ../../packages/binding.foreach/
|
|
7902
|
+
// ../../packages/binding.foreach/src/index.ts
|
|
7789
7903
|
var bindings4 = { foreach: ForEachBinding };
|
|
7790
7904
|
ForEachBinding.setSync(false);
|
|
7791
7905
|
|
|
7792
|
-
// ../../packages/provider.native/
|
|
7906
|
+
// ../../packages/provider.native/src/NativeProvider.ts
|
|
7793
7907
|
var NATIVE_BINDINGS = /* @__PURE__ */ Symbol("Knockout native bindings");
|
|
7794
7908
|
var NativeProvider = class extends Provider {
|
|
7795
7909
|
get FOR_NODE_TYPES() {
|
|
@@ -7850,30 +7964,50 @@ ${name} ${msg} of ${this.text}
|
|
|
7850
7964
|
}
|
|
7851
7965
|
};
|
|
7852
7966
|
|
|
7853
|
-
// ../../packages/utils.jsx/
|
|
7967
|
+
// ../../packages/utils.jsx/src/jsxClean.ts
|
|
7854
7968
|
var DELAY_MS = 25;
|
|
7855
|
-
var MAX_CLEAN_AT_ONCE = 1e3;
|
|
7856
7969
|
var cleanNodeQueue = new Array();
|
|
7857
7970
|
var cleanNodeTimeoutID = null;
|
|
7971
|
+
defineOption("jsxCleanBatchSize", { default: 1e3 });
|
|
7858
7972
|
function queueCleanNode(node) {
|
|
7859
7973
|
cleanNodeQueue.push(node);
|
|
7860
|
-
|
|
7974
|
+
if (options_default.jsxCleanBatchSize === 0) {
|
|
7975
|
+
flushAll();
|
|
7976
|
+
} else {
|
|
7977
|
+
scheduleBatch();
|
|
7978
|
+
}
|
|
7861
7979
|
}
|
|
7862
|
-
function
|
|
7980
|
+
function scheduleBatch() {
|
|
7863
7981
|
if (!cleanNodeTimeoutID && cleanNodeQueue.length) {
|
|
7864
|
-
cleanNodeTimeoutID = setTimeout(
|
|
7982
|
+
cleanNodeTimeoutID = setTimeout(flushBatch, DELAY_MS);
|
|
7865
7983
|
}
|
|
7866
7984
|
}
|
|
7867
|
-
function
|
|
7985
|
+
function flushBatch() {
|
|
7868
7986
|
cleanNodeTimeoutID = null;
|
|
7869
|
-
const
|
|
7987
|
+
const batchSize = Math.trunc(options_default.jsxCleanBatchSize);
|
|
7988
|
+
if (!Number.isFinite(batchSize) || batchSize <= 0) {
|
|
7989
|
+
flushAll();
|
|
7990
|
+
return;
|
|
7991
|
+
}
|
|
7992
|
+
const nodes = cleanNodeQueue.splice(0, batchSize);
|
|
7870
7993
|
for (const node of nodes) {
|
|
7871
7994
|
cleanNode(node);
|
|
7872
7995
|
}
|
|
7873
|
-
|
|
7996
|
+
scheduleBatch();
|
|
7997
|
+
}
|
|
7998
|
+
function flushAll() {
|
|
7999
|
+
if (cleanNodeTimeoutID !== null) {
|
|
8000
|
+
clearTimeout(cleanNodeTimeoutID);
|
|
8001
|
+
cleanNodeTimeoutID = null;
|
|
8002
|
+
}
|
|
8003
|
+
while (cleanNodeQueue.length) {
|
|
8004
|
+
for (const node of cleanNodeQueue.splice(0)) {
|
|
8005
|
+
cleanNode(node);
|
|
8006
|
+
}
|
|
8007
|
+
}
|
|
7874
8008
|
}
|
|
7875
8009
|
|
|
7876
|
-
// ../../packages/utils.jsx/
|
|
8010
|
+
// ../../packages/utils.jsx/src/JsxObserver.ts
|
|
7877
8011
|
var ORIGINAL_JSX_SYM = /* @__PURE__ */ Symbol("Knockout - Original JSX");
|
|
7878
8012
|
var NAMESPACES = {
|
|
7879
8013
|
svg: "http://www.w3.org/2000/svg",
|
|
@@ -7891,6 +8025,14 @@ ${name} ${msg} of ${this.text}
|
|
|
7891
8025
|
*/
|
|
7892
8026
|
constructor(jsxOrObservable, parentNode, insertBefore = null, xmlns, noInitialBinding) {
|
|
7893
8027
|
super();
|
|
8028
|
+
__publicField(this, "adoptedInsertBefore");
|
|
8029
|
+
__publicField(this, "noInitialBinding");
|
|
8030
|
+
__publicField(this, "insertBefore");
|
|
8031
|
+
__publicField(this, "parentNode");
|
|
8032
|
+
__publicField(this, "parentNodeTarget");
|
|
8033
|
+
__publicField(this, "subscriptionsForNode");
|
|
8034
|
+
__publicField(this, "nodeArrayOrObservableAtIndex");
|
|
8035
|
+
__publicField(this, "xmlns");
|
|
7894
8036
|
const parentNodeIsComment = parentNode.nodeType === Node.COMMENT_NODE;
|
|
7895
8037
|
const parentNodeTarget = this.getParentTarget(parentNode);
|
|
7896
8038
|
if (isObservable(jsxOrObservable)) {
|
|
@@ -7938,12 +8080,12 @@ ${name} ${msg} of ${this.text}
|
|
|
7938
8080
|
this.dispose();
|
|
7939
8081
|
}
|
|
7940
8082
|
dispose() {
|
|
7941
|
-
var
|
|
8083
|
+
var _a2;
|
|
7942
8084
|
super.dispose();
|
|
7943
8085
|
const ib = this.insertBefore;
|
|
7944
8086
|
const insertBeforeIsChild = ib && this.parentNodeTarget === ib.parentNode;
|
|
7945
8087
|
if (insertBeforeIsChild && !this.adoptedInsertBefore) {
|
|
7946
|
-
(
|
|
8088
|
+
(_a2 = this.parentNodeTarget) == null ? void 0 : _a2.removeChild(ib);
|
|
7947
8089
|
}
|
|
7948
8090
|
this.removeAllPriorNodes();
|
|
7949
8091
|
Object.assign(this, {
|
|
@@ -7994,7 +8136,7 @@ ${name} ${msg} of ${this.text}
|
|
|
7994
8136
|
this.nodeArrayOrObservableAtIndex.splice(index, 0, this.injectNode(jsx, this.lastNodeFor(index)));
|
|
7995
8137
|
}
|
|
7996
8138
|
injectNode(jsx, nextNode) {
|
|
7997
|
-
var
|
|
8139
|
+
var _a2;
|
|
7998
8140
|
let nodeArrayOrObservable;
|
|
7999
8141
|
if (isObservable(jsx)) {
|
|
8000
8142
|
const { parentNode, xmlns } = this;
|
|
@@ -8015,7 +8157,7 @@ ${name} ${msg} of ${this.text}
|
|
|
8015
8157
|
nodeArrayOrObservable = [this.anyToNode(jsx)];
|
|
8016
8158
|
}
|
|
8017
8159
|
for (const node of nodeArrayOrObservable) {
|
|
8018
|
-
(
|
|
8160
|
+
(_a2 = this.parentNodeTarget) == null ? void 0 : _a2.insertBefore(node, nextNode);
|
|
8019
8161
|
if (shouldApplyBindings && this.canApplyBindings(node)) {
|
|
8020
8162
|
applyBindings($context, node);
|
|
8021
8163
|
}
|
|
@@ -8228,7 +8370,7 @@ ${name} ${msg} of ${this.text}
|
|
|
8228
8370
|
};
|
|
8229
8371
|
var JsxObserver_default = JsxObserver;
|
|
8230
8372
|
|
|
8231
|
-
// ../../packages/utils.jsx/
|
|
8373
|
+
// ../../packages/utils.jsx/src/jsx.ts
|
|
8232
8374
|
function maybeJsx(possibleJsx) {
|
|
8233
8375
|
if (isObservable(possibleJsx)) {
|
|
8234
8376
|
return true;
|
|
@@ -8252,14 +8394,33 @@ ${name} ${msg} of ${this.text}
|
|
|
8252
8394
|
return node[ORIGINAL_JSX_SYM];
|
|
8253
8395
|
}
|
|
8254
8396
|
|
|
8255
|
-
// ../../packages/binding.component/
|
|
8397
|
+
// ../../packages/binding.component/src/componentBinding.ts
|
|
8256
8398
|
var componentLoadingOperationUniqueId = 0;
|
|
8257
8399
|
var ComponentBinding = class extends DescendantBindingHandler {
|
|
8258
8400
|
constructor(params) {
|
|
8259
8401
|
super(params);
|
|
8402
|
+
__publicField(this, "childBindingContext");
|
|
8403
|
+
__publicField(this, "currentLoadingOperationId");
|
|
8404
|
+
__publicField(this, "currentViewModel");
|
|
8405
|
+
__publicField(this, "latestComponentName");
|
|
8406
|
+
__publicField(this, "loadingOperationId");
|
|
8407
|
+
__publicField(this, "originalChildNodes");
|
|
8260
8408
|
this.originalChildNodes = makeArray(virtualElements_exports.childNodes(this.$element));
|
|
8261
8409
|
this.computed("computeApplyComponent");
|
|
8262
8410
|
}
|
|
8411
|
+
/**
|
|
8412
|
+
* True when originalChildNodes contain at least one element or a text
|
|
8413
|
+
* node with non-whitespace content. Whitespace-only children are treated
|
|
8414
|
+
* as "no children" so `<my-comp> </my-comp>` still errors.
|
|
8415
|
+
*/
|
|
8416
|
+
hasMeaningfulChildren() {
|
|
8417
|
+
return this.originalChildNodes.some(
|
|
8418
|
+
(n) => {
|
|
8419
|
+
var _a2;
|
|
8420
|
+
return n.nodeType === Node.ELEMENT_NODE || n.nodeType === Node.TEXT_NODE && ((_a2 = n.nodeValue) != null ? _a2 : "").trim().length > 0;
|
|
8421
|
+
}
|
|
8422
|
+
);
|
|
8423
|
+
}
|
|
8263
8424
|
cloneTemplateIntoElement(componentName, template, element) {
|
|
8264
8425
|
if (!template) {
|
|
8265
8426
|
throw new Error("Component '" + componentName + "' has no template");
|
|
@@ -8318,7 +8479,7 @@ ${name} ${msg} of ${this.text}
|
|
|
8318
8479
|
throw new Error("No component name specified");
|
|
8319
8480
|
}
|
|
8320
8481
|
this.loadingOperationId = this.currentLoadingOperationId = ++componentLoadingOperationUniqueId;
|
|
8321
|
-
|
|
8482
|
+
src_default.get(componentName, (defn) => this.applyComponentDefinition(componentName, componentParams, defn));
|
|
8322
8483
|
}
|
|
8323
8484
|
makeChildBindingContext($component) {
|
|
8324
8485
|
const ctxExtender = (ctx) => Object.assign(ctx, {
|
|
@@ -8348,11 +8509,14 @@ ${name} ${msg} of ${this.text}
|
|
|
8348
8509
|
);
|
|
8349
8510
|
this.childBindingContext = this.makeChildBindingContext(componentViewModel);
|
|
8350
8511
|
const viewTemplate = componentViewModel && componentViewModel.template;
|
|
8351
|
-
if (!viewTemplate && !componentDefinition.template) {
|
|
8352
|
-
throw new Error("Component '" + componentName + "' has no template");
|
|
8353
|
-
}
|
|
8354
8512
|
if (!componentDefinition.template) {
|
|
8355
|
-
|
|
8513
|
+
if (viewTemplate) {
|
|
8514
|
+
this.cloneTemplateIntoElement(componentName, viewTemplate, element);
|
|
8515
|
+
} else if (!this.hasMeaningfulChildren()) {
|
|
8516
|
+
throw new Error("Component '" + componentName + "' has no template");
|
|
8517
|
+
} else {
|
|
8518
|
+
this.cloneTemplateIntoElement(componentName, this.originalChildNodes, element);
|
|
8519
|
+
}
|
|
8356
8520
|
}
|
|
8357
8521
|
if (componentViewModel instanceof LifeCycle) {
|
|
8358
8522
|
componentViewModel.anchorTo(this.$element);
|
|
@@ -8388,7 +8552,7 @@ ${name} ${msg} of ${this.text}
|
|
|
8388
8552
|
}
|
|
8389
8553
|
};
|
|
8390
8554
|
|
|
8391
|
-
// ../../packages/binding.component/
|
|
8555
|
+
// ../../packages/binding.component/src/slotBinding.ts
|
|
8392
8556
|
var SlotBinding = class extends DescendantBindingHandler {
|
|
8393
8557
|
constructor(params) {
|
|
8394
8558
|
super(params);
|
|
@@ -8435,10 +8599,10 @@ ${name} ${msg} of ${this.text}
|
|
|
8435
8599
|
}
|
|
8436
8600
|
};
|
|
8437
8601
|
|
|
8438
|
-
// ../../packages/binding.component/
|
|
8602
|
+
// ../../packages/binding.component/src/index.ts
|
|
8439
8603
|
var bindings5 = { component: ComponentBinding, slot: SlotBinding };
|
|
8440
8604
|
|
|
8441
|
-
// ../../packages/filter.punches/
|
|
8605
|
+
// ../../packages/filter.punches/src/index.ts
|
|
8442
8606
|
var sproto = String.prototype;
|
|
8443
8607
|
var filters = {
|
|
8444
8608
|
// Convert value to uppercase
|
|
@@ -8475,10 +8639,10 @@ ${name} ${msg} of ${this.text}
|
|
|
8475
8639
|
return replacement + value2.slice(-length);
|
|
8476
8640
|
case "middle": {
|
|
8477
8641
|
const leftLen = Math.ceil(length / 2);
|
|
8478
|
-
return value2.
|
|
8642
|
+
return value2.substring(0, leftLen) + replacement + value2.slice(leftLen - length);
|
|
8479
8643
|
}
|
|
8480
8644
|
default:
|
|
8481
|
-
return value2.
|
|
8645
|
+
return value2.substring(0, length) + replacement;
|
|
8482
8646
|
}
|
|
8483
8647
|
} else {
|
|
8484
8648
|
return value2;
|
|
@@ -8494,7 +8658,7 @@ ${name} ${msg} of ${this.text}
|
|
|
8494
8658
|
}
|
|
8495
8659
|
};
|
|
8496
8660
|
|
|
8497
|
-
// ../../packages/utils.functionrewrite/
|
|
8661
|
+
// ../../packages/utils.functionrewrite/src/functionRewrite.ts
|
|
8498
8662
|
var FUNCTION_REX = /\bfunction\s*\(([^)]*)\)\s*\{\s*(?:(return\s)?([^}]+?)[;\s]*)?\}/g;
|
|
8499
8663
|
function functionRewrite(bindingString) {
|
|
8500
8664
|
return bindingString.replace(FUNCTION_REX, (match, args, returnKeyword, rv) => {
|
|
@@ -8515,21 +8679,12 @@ ${name} ${msg} of ${this.text}
|
|
|
8515
8679
|
var expressionRewriting = {
|
|
8516
8680
|
preProcessBindings: (s) => dataBindProvider.preProcessBindings(s)
|
|
8517
8681
|
};
|
|
8518
|
-
var provider = new MultiProvider({
|
|
8519
|
-
new ComponentProvider(),
|
|
8520
|
-
|
|
8521
|
-
new VirtualProvider(),
|
|
8522
|
-
new AttrProvider()
|
|
8523
|
-
] });
|
|
8682
|
+
var provider = new MultiProvider({
|
|
8683
|
+
providers: [new ComponentProvider(), dataBindProvider, new VirtualProvider(), new AttrProvider()]
|
|
8684
|
+
});
|
|
8524
8685
|
var builder = new Builder({
|
|
8525
8686
|
provider,
|
|
8526
|
-
bindings: [
|
|
8527
|
-
bindings2,
|
|
8528
|
-
bindings,
|
|
8529
|
-
bindings3,
|
|
8530
|
-
bindings5,
|
|
8531
|
-
{ each: bindings4.foreach }
|
|
8532
|
-
],
|
|
8687
|
+
bindings: [bindings2, bindings, bindings3, bindings5, { each: bindings4.foreach }],
|
|
8533
8688
|
extenders: {},
|
|
8534
8689
|
filters,
|
|
8535
8690
|
options: {
|
|
@@ -8537,13 +8692,13 @@ ${name} ${msg} of ${this.text}
|
|
|
8537
8692
|
bindingStringPreparsers: [functionRewrite]
|
|
8538
8693
|
}
|
|
8539
8694
|
});
|
|
8540
|
-
var version = "4.
|
|
8695
|
+
var version = "4.1.0";
|
|
8541
8696
|
var index_default = builder.create({
|
|
8542
8697
|
version,
|
|
8543
|
-
components:
|
|
8544
|
-
Component:
|
|
8698
|
+
components: src_default,
|
|
8699
|
+
Component: src_default.ComponentABC,
|
|
8545
8700
|
expressionRewriting
|
|
8546
8701
|
});
|
|
8547
8702
|
return __toCommonJS(index_exports);
|
|
8548
8703
|
})();
|
|
8549
|
-
(typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global).ko = ko.default
|
|
8704
|
+
(typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global).ko = ko.default
|