@ppg_pl/pallete 0.0.6 → 2.0.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/README.md +9 -1
- package/dist/cjs/{index-160fcb6c.js → index-53e78fc8.js} +3 -1
- package/dist/cjs/index-53e78fc8.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/my-backdrop_8.cjs.entry.js +527 -261
- package/dist/cjs/my-backdrop_8.cjs.entry.js.map +1 -1
- package/dist/cjs/pallete.cjs.js +2 -2
- package/dist/collection/components/api/index.js +4 -2
- package/dist/collection/components/api/index.js.map +1 -1
- package/dist/collection/components/api/services.js +31 -64
- package/dist/collection/components/api/services.js.map +1 -1
- package/dist/collection/components/my-colorinfo/my-colorinfo.js +6 -4
- package/dist/collection/components/my-colorinfo/my-colorinfo.js.map +1 -1
- package/dist/collection/components/my-loader/my-loader.css +1 -1
- package/dist/collection/components/my-modal/my-modal.js +65 -47
- package/dist/collection/components/my-modal/my-modal.js.map +1 -1
- package/dist/collection/components/my-search/my-search.js +28 -2
- package/dist/collection/components/my-search/my-search.js.map +1 -1
- package/dist/collection/components/my-slider/index.js +5 -8
- package/dist/collection/components/my-slider/index.js.map +1 -1
- package/dist/collection/types.js.map +1 -1
- package/dist/components/index2.js +25 -3
- package/dist/components/index2.js.map +1 -1
- package/dist/components/my-colorinfo2.js +4 -3
- package/dist/components/my-colorinfo2.js.map +1 -1
- package/dist/components/my-loader2.js +1 -1
- package/dist/components/my-loader2.js.map +1 -1
- package/dist/components/my-modal2.js +482 -256
- package/dist/components/my-modal2.js.map +1 -1
- package/dist/components/my-search2.js +20 -3
- package/dist/components/my-search2.js.map +1 -1
- package/dist/esm/{index-943c259f.js → index-b0145abf.js} +3 -1
- package/dist/esm/index-b0145abf.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/my-backdrop_8.entry.js +527 -261
- package/dist/esm/my-backdrop_8.entry.js.map +1 -1
- package/dist/esm/pallete.js +3 -3
- package/dist/pallete/p-037cfde2.entry.js +2 -0
- package/dist/pallete/p-037cfde2.entry.js.map +1 -0
- package/dist/pallete/{p-c77aaa54.js → p-c6a049a2.js} +2 -2
- package/dist/pallete/p-c6a049a2.js.map +1 -0
- package/dist/pallete/pallete.esm.js +1 -1
- package/dist/pallete/pallete.esm.js.map +1 -1
- package/dist/types/components/api/index.d.ts +2 -1
- package/dist/types/components/api/services.d.ts +3 -3
- package/dist/types/components/my-modal/my-modal.d.ts +1 -0
- package/dist/types/components/my-search/my-search.d.ts +2 -0
- package/dist/types/components/my-slider/index.d.ts +2 -2
- package/dist/types/components.d.ts +5 -4
- package/dist/types/types.d.ts +35 -24
- package/package.json +5 -5
- package/www/build/p-037cfde2.entry.js +2 -0
- package/www/build/p-037cfde2.entry.js.map +1 -0
- package/www/build/{p-c77aaa54.js → p-c6a049a2.js} +2 -2
- package/www/build/p-c6a049a2.js.map +1 -0
- package/www/build/pallete.esm.js +1 -1
- package/www/build/pallete.esm.js.map +1 -1
- package/www/index.html +1 -1
- package/dist/cjs/index-160fcb6c.js.map +0 -1
- package/dist/esm/index-943c259f.js.map +0 -1
- package/dist/pallete/p-9a7eff4f.entry.js +0 -2
- package/dist/pallete/p-9a7eff4f.entry.js.map +0 -1
- package/dist/pallete/p-c77aaa54.js.map +0 -1
- package/www/build/p-825a7d1d.js +0 -163
- package/www/build/p-9a7eff4f.entry.js +0 -2
- package/www/build/p-9a7eff4f.entry.js.map +0 -1
- package/www/build/p-c77aaa54.js.map +0 -1
- package/www/build/p-fd390eef.css +0 -3
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index$1 = require('./index-
|
|
5
|
+
const index$1 = require('./index-53e78fc8.js');
|
|
6
6
|
|
|
7
7
|
const myBackdropCss = ".pallete-wrapper *{font-family:\"Galatea\", sans-serif}my-backdrop{width:100%;height:100%;background-color:rgba(0, 0, 0, 0.7);position:fixed;z-index:100;left:0;top:0}";
|
|
8
8
|
|
|
@@ -62,6 +62,28 @@ const MyColorBox = class {
|
|
|
62
62
|
};
|
|
63
63
|
MyColorBox.style = myColorboxCss;
|
|
64
64
|
|
|
65
|
+
const APIURL = 'http://147.135.211.144:8055'; //'https://pallete-colors-backend.herokuapp.com';
|
|
66
|
+
const accessToken = 'uBKzhiNM4rkdZSe_PQvKJp9pE-DSTmtu';
|
|
67
|
+
class API {
|
|
68
|
+
async getData(ep) {
|
|
69
|
+
try {
|
|
70
|
+
const request = await fetch(`${APIURL}/${ep}`, {
|
|
71
|
+
method: 'GET',
|
|
72
|
+
headers: {
|
|
73
|
+
'Authorization': `Bearer ${accessToken}`,
|
|
74
|
+
'Content-Type': 'application/json',
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
const response = await request.json();
|
|
78
|
+
return response;
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
console.error(error);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const ApiService = new API();
|
|
86
|
+
|
|
65
87
|
const MyColorInfo = class {
|
|
66
88
|
constructor(hostRef) {
|
|
67
89
|
index$1.registerInstance(this, hostRef);
|
|
@@ -88,13 +110,14 @@ const MyColorInfo = class {
|
|
|
88
110
|
this.closeImage = 'close.png';
|
|
89
111
|
}
|
|
90
112
|
render() {
|
|
91
|
-
var _a, _b, _c, _d, _e, _f
|
|
113
|
+
var _a, _b, _c, _d, _e, _f;
|
|
114
|
+
console.log('current', this.currentColor);
|
|
92
115
|
return (index$1.h("div", { class: `boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`, style: {
|
|
93
116
|
background: this.currentColor.hex,
|
|
94
117
|
maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,
|
|
95
118
|
} }, this.isMobile && index$1.h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: index$1.getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), index$1.h("div", { class: "boxes__box-content__info", style: {
|
|
96
119
|
maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,
|
|
97
|
-
} }, !this.isMobile && index$1.h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: index$1.getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), !this.isMobile && index$1.h("h2", null, this.currentColor.name), !this.isMobile && index$1.h("h4", null, this.currentColor.number), !this.isMobile && index$1.h("div", { class: "divider" }), index$1.h("div", { class: "boxes__box-content__info__value" }, index$1.h("div", { class: "boxes__box-content__info__value-image" }, ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.image
|
|
120
|
+
} }, !this.isMobile && index$1.h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: index$1.getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), !this.isMobile && index$1.h("h2", null, this.currentColor.name), !this.isMobile && index$1.h("h4", null, this.currentColor.number), !this.isMobile && index$1.h("div", { class: "divider" }), index$1.h("div", { class: "boxes__box-content__info__value" }, index$1.h("div", { class: "boxes__box-content__info__value-image" }, ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.image) && index$1.h("img", { src: `${APIURL}/assets/${this.currentColor.image}?access_token=${accessToken}`, alt: "color-image" })), index$1.h("div", { class: "boxes__box-content__info__value-product" }, index$1.h("div", null, !this.isMobile && index$1.h("p", null, "Produkt:"), this.isMobile && index$1.h("h2", null, (_b = this.currentColor) === null || _b === void 0 ? void 0 : _b.name), " ", index$1.h("p", null, this.product)), this.isMobile && index$1.h("div", { class: 'divider' }), this.currentColor && ((_c = this.currentColor.links) === null || _c === void 0 ? void 0 : _c.find((link) => (link === null || link === void 0 ? void 0 : link.shop) === this.shop)) && (index$1.h("a", { onClick: this.goToProduct, class: `${this.currentColor.buttonInverse ? 'inverse' : ''}`, target: "_blank", href: (_e = (_d = this === null || this === void 0 ? void 0 : this.currentColor.links) === null || _d === void 0 ? void 0 : _d.find((link) => (link === null || link === void 0 ? void 0 : link.shop) === this.shop)) === null || _e === void 0 ? void 0 : _e.path }, "przejd\u017A do produktu"))))), index$1.h("div", { class: "boxes__box-content__slider" }, index$1.h("my-slider", { color: this.currentColor.name, shop: this.shop, product: this.product, slides: (_f = this.data) === null || _f === void 0 ? void 0 : _f.images }), ' ')));
|
|
98
121
|
}
|
|
99
122
|
};
|
|
100
123
|
|
|
@@ -258,7 +281,7 @@ const MyModalBundle = class {
|
|
|
258
281
|
};
|
|
259
282
|
MyModalBundle.style = myComponentCss;
|
|
260
283
|
|
|
261
|
-
const myLoaderCss = ".container.sc-my-loader{display:flex;justify-content:center;align-items:center;height:
|
|
284
|
+
const myLoaderCss = ".container.sc-my-loader{display:flex;justify-content:center;align-items:center;height:190px;overflow:hidden}.item.sc-my-loader{width:20px;height:20px;margin:3px;list-style-type:none;transition:0.5s all ease}.item.sc-my-loader:nth-child(1){animation:right-1 1s infinite alternate;background-color:#b8cf40;animation-delay:20ms}@keyframes right-1{0%{transform:translateY(-18px)}100%{transform:translateY(18px)}}.item.sc-my-loader:nth-child(2){animation:right-2 1s infinite alternate;background-color:#ee4b5e;animation-delay:40ms}@keyframes right-2{0%{transform:translateY(-21px)}100%{transform:translateY(21px)}}.item.sc-my-loader:nth-child(3){animation:right-3 1s infinite alternate;background-color:#ea0f47;animation-delay:60ms}@keyframes right-3{0%{transform:translateY(-24px)}100%{transform:translateY(24px)}}.item.sc-my-loader:nth-child(4){animation:right-4 1s infinite alternate;background-color:#d42840;animation-delay:80ms}@keyframes right-4{0%{transform:translateY(-27px)}100%{transform:translateY(27px)}}.item.sc-my-loader:nth-child(5){animation:right-5 1s infinite alternate;background-color:#8b2850;animation-delay:100ms}@keyframes right-5{0%{transform:translateY(-30px)}100%{transform:translateY(30px)}}";
|
|
262
285
|
|
|
263
286
|
const MyLoader = class {
|
|
264
287
|
constructor(hostRef) {
|
|
@@ -270,25 +293,26 @@ const MyLoader = class {
|
|
|
270
293
|
};
|
|
271
294
|
MyLoader.style = myLoaderCss;
|
|
272
295
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
296
|
+
/** @type {import('.')} */
|
|
297
|
+
var esErrors = Error;
|
|
298
|
+
|
|
299
|
+
/** @type {import('./eval')} */
|
|
300
|
+
var _eval = EvalError;
|
|
301
|
+
|
|
302
|
+
/** @type {import('./range')} */
|
|
303
|
+
var range = RangeError;
|
|
304
|
+
|
|
305
|
+
/** @type {import('./ref')} */
|
|
306
|
+
var ref = ReferenceError;
|
|
307
|
+
|
|
308
|
+
/** @type {import('./syntax')} */
|
|
309
|
+
var syntax = SyntaxError;
|
|
310
|
+
|
|
311
|
+
/** @type {import('./type')} */
|
|
312
|
+
var type = TypeError;
|
|
313
|
+
|
|
314
|
+
/** @type {import('./uri')} */
|
|
315
|
+
var uri = URIError;
|
|
292
316
|
|
|
293
317
|
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
294
318
|
var shams = function hasSymbols() {
|
|
@@ -343,46 +367,92 @@ var hasSymbols$1 = function hasNativeSymbols() {
|
|
|
343
367
|
return shams();
|
|
344
368
|
};
|
|
345
369
|
|
|
370
|
+
var test = {
|
|
371
|
+
__proto__: null,
|
|
372
|
+
foo: {}
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
var $Object = Object;
|
|
376
|
+
|
|
377
|
+
/** @type {import('.')} */
|
|
378
|
+
var hasProto$1 = function hasProto() {
|
|
379
|
+
// @ts-expect-error: TS errors on an inherited property for some reason
|
|
380
|
+
return { __proto__: test }.foo === test.foo
|
|
381
|
+
&& !(test instanceof $Object);
|
|
382
|
+
};
|
|
383
|
+
|
|
346
384
|
/* eslint no-invalid-this: 1 */
|
|
347
385
|
|
|
348
386
|
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
349
|
-
var slice = Array.prototype.slice;
|
|
350
387
|
var toStr$1 = Object.prototype.toString;
|
|
388
|
+
var max = Math.max;
|
|
351
389
|
var funcType = '[object Function]';
|
|
352
390
|
|
|
391
|
+
var concatty = function concatty(a, b) {
|
|
392
|
+
var arr = [];
|
|
393
|
+
|
|
394
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
395
|
+
arr[i] = a[i];
|
|
396
|
+
}
|
|
397
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
398
|
+
arr[j + a.length] = b[j];
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
return arr;
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
var slicy = function slicy(arrLike, offset) {
|
|
405
|
+
var arr = [];
|
|
406
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
407
|
+
arr[j] = arrLike[i];
|
|
408
|
+
}
|
|
409
|
+
return arr;
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
var joiny = function (arr, joiner) {
|
|
413
|
+
var str = '';
|
|
414
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
415
|
+
str += arr[i];
|
|
416
|
+
if (i + 1 < arr.length) {
|
|
417
|
+
str += joiner;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
return str;
|
|
421
|
+
};
|
|
422
|
+
|
|
353
423
|
var implementation = function bind(that) {
|
|
354
424
|
var target = this;
|
|
355
|
-
if (typeof target !== 'function' || toStr$1.
|
|
425
|
+
if (typeof target !== 'function' || toStr$1.apply(target) !== funcType) {
|
|
356
426
|
throw new TypeError(ERROR_MESSAGE + target);
|
|
357
427
|
}
|
|
358
|
-
var args =
|
|
428
|
+
var args = slicy(arguments, 1);
|
|
359
429
|
|
|
360
430
|
var bound;
|
|
361
431
|
var binder = function () {
|
|
362
432
|
if (this instanceof bound) {
|
|
363
433
|
var result = target.apply(
|
|
364
434
|
this,
|
|
365
|
-
args
|
|
435
|
+
concatty(args, arguments)
|
|
366
436
|
);
|
|
367
437
|
if (Object(result) === result) {
|
|
368
438
|
return result;
|
|
369
439
|
}
|
|
370
440
|
return this;
|
|
371
|
-
} else {
|
|
372
|
-
return target.apply(
|
|
373
|
-
that,
|
|
374
|
-
args.concat(slice.call(arguments))
|
|
375
|
-
);
|
|
376
441
|
}
|
|
442
|
+
return target.apply(
|
|
443
|
+
that,
|
|
444
|
+
concatty(args, arguments)
|
|
445
|
+
);
|
|
446
|
+
|
|
377
447
|
};
|
|
378
448
|
|
|
379
|
-
var boundLength =
|
|
449
|
+
var boundLength = max(0, target.length - args.length);
|
|
380
450
|
var boundArgs = [];
|
|
381
451
|
for (var i = 0; i < boundLength; i++) {
|
|
382
|
-
boundArgs
|
|
452
|
+
boundArgs[i] = '$' + i;
|
|
383
453
|
}
|
|
384
454
|
|
|
385
|
-
bound = Function('binder', 'return function (' + boundArgs
|
|
455
|
+
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
386
456
|
|
|
387
457
|
if (target.prototype) {
|
|
388
458
|
var Empty = function Empty() {};
|
|
@@ -396,13 +466,24 @@ var implementation = function bind(that) {
|
|
|
396
466
|
|
|
397
467
|
var functionBind = Function.prototype.bind || implementation;
|
|
398
468
|
|
|
399
|
-
var
|
|
469
|
+
var call = Function.prototype.call;
|
|
470
|
+
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
/** @type {import('.')} */
|
|
474
|
+
var hasown = functionBind.call(call, $hasOwn);
|
|
400
475
|
|
|
401
476
|
var undefined$1;
|
|
402
477
|
|
|
403
|
-
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
404
486
|
var $Function = Function;
|
|
405
|
-
var $TypeError$1 = TypeError;
|
|
406
487
|
|
|
407
488
|
// eslint-disable-next-line consistent-return
|
|
408
489
|
var getEvalledConstructor = function (expressionSyntax) {
|
|
@@ -411,19 +492,19 @@ var getEvalledConstructor = function (expressionSyntax) {
|
|
|
411
492
|
} catch (e) {}
|
|
412
493
|
};
|
|
413
494
|
|
|
414
|
-
var $gOPD = Object.getOwnPropertyDescriptor;
|
|
495
|
+
var $gOPD$1 = Object.getOwnPropertyDescriptor;
|
|
415
496
|
|
|
416
497
|
var throwTypeError = function () {
|
|
417
|
-
throw new
|
|
498
|
+
throw new type();
|
|
418
499
|
};
|
|
419
|
-
var ThrowTypeError = $gOPD
|
|
500
|
+
var ThrowTypeError = $gOPD$1
|
|
420
501
|
? (function () {
|
|
421
502
|
try {
|
|
422
503
|
return throwTypeError;
|
|
423
504
|
} catch (calleeThrows) {
|
|
424
505
|
try {
|
|
425
506
|
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
|
426
|
-
return $gOPD(arguments, 'callee').get;
|
|
507
|
+
return $gOPD$1(arguments, 'callee').get;
|
|
427
508
|
} catch (gOPDthrows) {
|
|
428
509
|
return throwTypeError;
|
|
429
510
|
}
|
|
@@ -432,18 +513,24 @@ var ThrowTypeError = $gOPD
|
|
|
432
513
|
: throwTypeError;
|
|
433
514
|
|
|
434
515
|
var hasSymbols = hasSymbols$1();
|
|
516
|
+
var hasProto = hasProto$1();
|
|
435
517
|
|
|
436
|
-
var getProto = Object.getPrototypeOf ||
|
|
518
|
+
var getProto = Object.getPrototypeOf || (
|
|
519
|
+
hasProto
|
|
520
|
+
? function (x) { return x.__proto__; } // eslint-disable-line no-proto
|
|
521
|
+
: null
|
|
522
|
+
);
|
|
437
523
|
|
|
438
524
|
var needsEval = {};
|
|
439
525
|
|
|
440
|
-
var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
|
|
526
|
+
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
|
|
441
527
|
|
|
442
528
|
var INTRINSICS = {
|
|
529
|
+
__proto__: null,
|
|
443
530
|
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
|
|
444
531
|
'%Array%': Array,
|
|
445
532
|
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
|
|
446
|
-
'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined$1,
|
|
533
|
+
'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
|
|
447
534
|
'%AsyncFromSyncIteratorPrototype%': undefined$1,
|
|
448
535
|
'%AsyncFunction%': needsEval,
|
|
449
536
|
'%AsyncGenerator%': needsEval,
|
|
@@ -460,9 +547,9 @@ var INTRINSICS = {
|
|
|
460
547
|
'%decodeURIComponent%': decodeURIComponent,
|
|
461
548
|
'%encodeURI%': encodeURI,
|
|
462
549
|
'%encodeURIComponent%': encodeURIComponent,
|
|
463
|
-
'%Error%':
|
|
550
|
+
'%Error%': esErrors,
|
|
464
551
|
'%eval%': eval, // eslint-disable-line no-eval
|
|
465
|
-
'%EvalError%':
|
|
552
|
+
'%EvalError%': _eval,
|
|
466
553
|
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
|
|
467
554
|
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
|
|
468
555
|
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
|
|
@@ -473,10 +560,10 @@ var INTRINSICS = {
|
|
|
473
560
|
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
|
|
474
561
|
'%isFinite%': isFinite,
|
|
475
562
|
'%isNaN%': isNaN,
|
|
476
|
-
'%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
|
|
563
|
+
'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
|
|
477
564
|
'%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
|
|
478
565
|
'%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
|
|
479
|
-
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
|
|
566
|
+
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
|
|
480
567
|
'%Math%': Math,
|
|
481
568
|
'%Number%': Number,
|
|
482
569
|
'%Object%': Object,
|
|
@@ -484,25 +571,25 @@ var INTRINSICS = {
|
|
|
484
571
|
'%parseInt%': parseInt,
|
|
485
572
|
'%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
|
|
486
573
|
'%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
|
|
487
|
-
'%RangeError%':
|
|
488
|
-
'%ReferenceError%':
|
|
574
|
+
'%RangeError%': range,
|
|
575
|
+
'%ReferenceError%': ref,
|
|
489
576
|
'%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
|
|
490
577
|
'%RegExp%': RegExp,
|
|
491
578
|
'%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
|
|
492
|
-
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
|
|
579
|
+
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
|
|
493
580
|
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
|
|
494
581
|
'%String%': String,
|
|
495
|
-
'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined$1,
|
|
582
|
+
'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
|
|
496
583
|
'%Symbol%': hasSymbols ? Symbol : undefined$1,
|
|
497
|
-
'%SyntaxError%':
|
|
584
|
+
'%SyntaxError%': syntax,
|
|
498
585
|
'%ThrowTypeError%': ThrowTypeError,
|
|
499
586
|
'%TypedArray%': TypedArray,
|
|
500
|
-
'%TypeError%':
|
|
587
|
+
'%TypeError%': type,
|
|
501
588
|
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
|
|
502
589
|
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
|
|
503
590
|
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
|
|
504
591
|
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
|
|
505
|
-
'%URIError%':
|
|
592
|
+
'%URIError%': uri,
|
|
506
593
|
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
|
|
507
594
|
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
|
|
508
595
|
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
|
|
@@ -523,7 +610,7 @@ var doEval = function doEval(name) {
|
|
|
523
610
|
}
|
|
524
611
|
} else if (name === '%AsyncIteratorPrototype%') {
|
|
525
612
|
var gen = doEval('%AsyncGenerator%');
|
|
526
|
-
if (gen) {
|
|
613
|
+
if (gen && getProto) {
|
|
527
614
|
value = getProto(gen.prototype);
|
|
528
615
|
}
|
|
529
616
|
}
|
|
@@ -534,6 +621,7 @@ var doEval = function doEval(name) {
|
|
|
534
621
|
};
|
|
535
622
|
|
|
536
623
|
var LEGACY_ALIASES = {
|
|
624
|
+
__proto__: null,
|
|
537
625
|
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
|
538
626
|
'%ArrayPrototype%': ['Array', 'prototype'],
|
|
539
627
|
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
|
@@ -602,9 +690,9 @@ var stringToPath = function stringToPath(string) {
|
|
|
602
690
|
var first = $strSlice(string, 0, 1);
|
|
603
691
|
var last = $strSlice(string, -1);
|
|
604
692
|
if (first === '%' && last !== '%') {
|
|
605
|
-
throw new
|
|
693
|
+
throw new syntax('invalid intrinsic syntax, expected closing `%`');
|
|
606
694
|
} else if (last === '%' && first !== '%') {
|
|
607
|
-
throw new
|
|
695
|
+
throw new syntax('invalid intrinsic syntax, expected opening `%`');
|
|
608
696
|
}
|
|
609
697
|
var result = [];
|
|
610
698
|
$replace$1(string, rePropName, function (match, number, quote, subString) {
|
|
@@ -617,18 +705,18 @@ var stringToPath = function stringToPath(string) {
|
|
|
617
705
|
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
618
706
|
var intrinsicName = name;
|
|
619
707
|
var alias;
|
|
620
|
-
if (
|
|
708
|
+
if (hasown(LEGACY_ALIASES, intrinsicName)) {
|
|
621
709
|
alias = LEGACY_ALIASES[intrinsicName];
|
|
622
710
|
intrinsicName = '%' + alias[0] + '%';
|
|
623
711
|
}
|
|
624
712
|
|
|
625
|
-
if (
|
|
713
|
+
if (hasown(INTRINSICS, intrinsicName)) {
|
|
626
714
|
var value = INTRINSICS[intrinsicName];
|
|
627
715
|
if (value === needsEval) {
|
|
628
716
|
value = doEval(intrinsicName);
|
|
629
717
|
}
|
|
630
718
|
if (typeof value === 'undefined' && !allowMissing) {
|
|
631
|
-
throw new
|
|
719
|
+
throw new type('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
|
632
720
|
}
|
|
633
721
|
|
|
634
722
|
return {
|
|
@@ -638,19 +726,19 @@ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
|
638
726
|
};
|
|
639
727
|
}
|
|
640
728
|
|
|
641
|
-
throw new
|
|
729
|
+
throw new syntax('intrinsic ' + name + ' does not exist!');
|
|
642
730
|
};
|
|
643
731
|
|
|
644
732
|
var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
645
733
|
if (typeof name !== 'string' || name.length === 0) {
|
|
646
|
-
throw new
|
|
734
|
+
throw new type('intrinsic name must be a non-empty string');
|
|
647
735
|
}
|
|
648
736
|
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
|
649
|
-
throw new
|
|
737
|
+
throw new type('"allowMissing" argument must be a boolean');
|
|
650
738
|
}
|
|
651
739
|
|
|
652
740
|
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
653
|
-
throw new
|
|
741
|
+
throw new syntax('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
654
742
|
}
|
|
655
743
|
var parts = stringToPath(name);
|
|
656
744
|
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
@@ -677,7 +765,7 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
677
765
|
)
|
|
678
766
|
&& first !== last
|
|
679
767
|
) {
|
|
680
|
-
throw new
|
|
768
|
+
throw new syntax('property names with quotes must have matching quotes');
|
|
681
769
|
}
|
|
682
770
|
if (part === 'constructor' || !isOwn) {
|
|
683
771
|
skipFurtherCaching = true;
|
|
@@ -686,17 +774,17 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
686
774
|
intrinsicBaseName += '.' + part;
|
|
687
775
|
intrinsicRealName = '%' + intrinsicBaseName + '%';
|
|
688
776
|
|
|
689
|
-
if (
|
|
777
|
+
if (hasown(INTRINSICS, intrinsicRealName)) {
|
|
690
778
|
value = INTRINSICS[intrinsicRealName];
|
|
691
779
|
} else if (value != null) {
|
|
692
780
|
if (!(part in value)) {
|
|
693
781
|
if (!allowMissing) {
|
|
694
|
-
throw new
|
|
782
|
+
throw new type('base intrinsic for ' + name + ' exists, but the property is not available.');
|
|
695
783
|
}
|
|
696
784
|
return void undefined$1;
|
|
697
785
|
}
|
|
698
|
-
if ($gOPD && (i + 1) >= parts.length) {
|
|
699
|
-
var desc = $gOPD(value, part);
|
|
786
|
+
if ($gOPD$1 && (i + 1) >= parts.length) {
|
|
787
|
+
var desc = $gOPD$1(value, part);
|
|
700
788
|
isOwn = !!desc;
|
|
701
789
|
|
|
702
790
|
// By convention, when a data property is converted to an accessor
|
|
@@ -712,7 +800,7 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
712
800
|
value = value[part];
|
|
713
801
|
}
|
|
714
802
|
} else {
|
|
715
|
-
isOwn =
|
|
803
|
+
isOwn = hasown(value, part);
|
|
716
804
|
value = value[part];
|
|
717
805
|
}
|
|
718
806
|
|
|
@@ -724,6 +812,8 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
724
812
|
return value;
|
|
725
813
|
};
|
|
726
814
|
|
|
815
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
816
|
+
|
|
727
817
|
function createCommonjsModule(fn, basedir, module) {
|
|
728
818
|
return module = {
|
|
729
819
|
path: basedir,
|
|
@@ -753,50 +843,170 @@ function commonjsRequire () {
|
|
|
753
843
|
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
754
844
|
}
|
|
755
845
|
|
|
846
|
+
/** @type {import('.')} */
|
|
847
|
+
var $defineProperty = getIntrinsic('%Object.defineProperty%', true) || false;
|
|
848
|
+
if ($defineProperty) {
|
|
849
|
+
try {
|
|
850
|
+
$defineProperty({}, 'a', { value: 1 });
|
|
851
|
+
} catch (e) {
|
|
852
|
+
// IE 8 has a broken defineProperty
|
|
853
|
+
$defineProperty = false;
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
var esDefineProperty = $defineProperty;
|
|
858
|
+
|
|
859
|
+
var $gOPD = getIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
860
|
+
|
|
861
|
+
if ($gOPD) {
|
|
862
|
+
try {
|
|
863
|
+
$gOPD([], 'length');
|
|
864
|
+
} catch (e) {
|
|
865
|
+
// IE 8 has a broken gOPD
|
|
866
|
+
$gOPD = null;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
var gopd = $gOPD;
|
|
871
|
+
|
|
872
|
+
/** @type {import('.')} */
|
|
873
|
+
var defineDataProperty = function defineDataProperty(
|
|
874
|
+
obj,
|
|
875
|
+
property,
|
|
876
|
+
value
|
|
877
|
+
) {
|
|
878
|
+
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
|
879
|
+
throw new type('`obj` must be an object or a function`');
|
|
880
|
+
}
|
|
881
|
+
if (typeof property !== 'string' && typeof property !== 'symbol') {
|
|
882
|
+
throw new type('`property` must be a string or a symbol`');
|
|
883
|
+
}
|
|
884
|
+
if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
|
|
885
|
+
throw new type('`nonEnumerable`, if provided, must be a boolean or null');
|
|
886
|
+
}
|
|
887
|
+
if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
|
|
888
|
+
throw new type('`nonWritable`, if provided, must be a boolean or null');
|
|
889
|
+
}
|
|
890
|
+
if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
|
|
891
|
+
throw new type('`nonConfigurable`, if provided, must be a boolean or null');
|
|
892
|
+
}
|
|
893
|
+
if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
|
|
894
|
+
throw new type('`loose`, if provided, must be a boolean');
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
|
898
|
+
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
|
899
|
+
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
|
900
|
+
var loose = arguments.length > 6 ? arguments[6] : false;
|
|
901
|
+
|
|
902
|
+
/* @type {false | TypedPropertyDescriptor<unknown>} */
|
|
903
|
+
var desc = !!gopd && gopd(obj, property);
|
|
904
|
+
|
|
905
|
+
if (esDefineProperty) {
|
|
906
|
+
esDefineProperty(obj, property, {
|
|
907
|
+
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
|
908
|
+
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
|
909
|
+
value: value,
|
|
910
|
+
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
|
911
|
+
});
|
|
912
|
+
} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
|
|
913
|
+
// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
|
|
914
|
+
obj[property] = value; // eslint-disable-line no-param-reassign
|
|
915
|
+
} else {
|
|
916
|
+
throw new syntax('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
|
|
917
|
+
}
|
|
918
|
+
};
|
|
919
|
+
|
|
920
|
+
var hasPropertyDescriptors = function hasPropertyDescriptors() {
|
|
921
|
+
return !!esDefineProperty;
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
|
|
925
|
+
// node v0.6 has a bug where array lengths can be Set but not Defined
|
|
926
|
+
if (!esDefineProperty) {
|
|
927
|
+
return null;
|
|
928
|
+
}
|
|
929
|
+
try {
|
|
930
|
+
return esDefineProperty([], 'length', { value: 1 }).length !== 1;
|
|
931
|
+
} catch (e) {
|
|
932
|
+
// In Firefox 4-22, defining length on an array throws an exception.
|
|
933
|
+
return true;
|
|
934
|
+
}
|
|
935
|
+
};
|
|
936
|
+
|
|
937
|
+
var hasPropertyDescriptors_1 = hasPropertyDescriptors;
|
|
938
|
+
|
|
939
|
+
var hasDescriptors = hasPropertyDescriptors_1();
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
var $floor$1 = getIntrinsic('%Math.floor%');
|
|
944
|
+
|
|
945
|
+
/** @type {import('.')} */
|
|
946
|
+
var setFunctionLength = function setFunctionLength(fn, length) {
|
|
947
|
+
if (typeof fn !== 'function') {
|
|
948
|
+
throw new type('`fn` is not a function');
|
|
949
|
+
}
|
|
950
|
+
if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor$1(length) !== length) {
|
|
951
|
+
throw new type('`length` must be a positive 32-bit integer');
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
var loose = arguments.length > 2 && !!arguments[2];
|
|
955
|
+
|
|
956
|
+
var functionLengthIsConfigurable = true;
|
|
957
|
+
var functionLengthIsWritable = true;
|
|
958
|
+
if ('length' in fn && gopd) {
|
|
959
|
+
var desc = gopd(fn, 'length');
|
|
960
|
+
if (desc && !desc.configurable) {
|
|
961
|
+
functionLengthIsConfigurable = false;
|
|
962
|
+
}
|
|
963
|
+
if (desc && !desc.writable) {
|
|
964
|
+
functionLengthIsWritable = false;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
|
969
|
+
if (hasDescriptors) {
|
|
970
|
+
defineDataProperty(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
|
|
971
|
+
} else {
|
|
972
|
+
defineDataProperty(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
return fn;
|
|
976
|
+
};
|
|
977
|
+
|
|
756
978
|
var callBind = createCommonjsModule(function (module) {
|
|
757
979
|
|
|
758
980
|
|
|
759
981
|
|
|
760
982
|
|
|
983
|
+
|
|
984
|
+
|
|
761
985
|
var $apply = getIntrinsic('%Function.prototype.apply%');
|
|
762
986
|
var $call = getIntrinsic('%Function.prototype.call%');
|
|
763
987
|
var $reflectApply = getIntrinsic('%Reflect.apply%', true) || functionBind.call($call, $apply);
|
|
764
988
|
|
|
765
|
-
var $gOPD = getIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
766
|
-
var $defineProperty = getIntrinsic('%Object.defineProperty%', true);
|
|
767
|
-
var $max = getIntrinsic('%Math.max%');
|
|
768
989
|
|
|
769
|
-
|
|
770
|
-
try {
|
|
771
|
-
$defineProperty({}, 'a', { value: 1 });
|
|
772
|
-
} catch (e) {
|
|
773
|
-
// IE 8 has a broken defineProperty
|
|
774
|
-
$defineProperty = null;
|
|
775
|
-
}
|
|
776
|
-
}
|
|
990
|
+
var $max = getIntrinsic('%Math.max%');
|
|
777
991
|
|
|
778
992
|
module.exports = function callBind(originalFunction) {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
var desc = $gOPD(func, 'length');
|
|
782
|
-
if (desc.configurable) {
|
|
783
|
-
// original length, plus the receiver, minus any additional arguments (after the receiver)
|
|
784
|
-
$defineProperty(
|
|
785
|
-
func,
|
|
786
|
-
'length',
|
|
787
|
-
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
|
|
788
|
-
);
|
|
789
|
-
}
|
|
993
|
+
if (typeof originalFunction !== 'function') {
|
|
994
|
+
throw new type('a function is required');
|
|
790
995
|
}
|
|
791
|
-
|
|
996
|
+
var func = $reflectApply(functionBind, $call, arguments);
|
|
997
|
+
return setFunctionLength(
|
|
998
|
+
func,
|
|
999
|
+
1 + $max(0, originalFunction.length - (arguments.length - 1)),
|
|
1000
|
+
true
|
|
1001
|
+
);
|
|
792
1002
|
};
|
|
793
1003
|
|
|
794
1004
|
var applyBind = function applyBind() {
|
|
795
1005
|
return $reflectApply(functionBind, $apply, arguments);
|
|
796
1006
|
};
|
|
797
1007
|
|
|
798
|
-
if (
|
|
799
|
-
|
|
1008
|
+
if (esDefineProperty) {
|
|
1009
|
+
esDefineProperty(module.exports, 'apply', { value: applyBind });
|
|
800
1010
|
} else {
|
|
801
1011
|
module.exports.apply = applyBind;
|
|
802
1012
|
}
|
|
@@ -1062,6 +1272,14 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
|
1062
1272
|
if (isString(obj)) {
|
|
1063
1273
|
return markBoxed(inspect(String(obj)));
|
|
1064
1274
|
}
|
|
1275
|
+
// note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
|
|
1276
|
+
/* eslint-env browser */
|
|
1277
|
+
if (typeof window !== 'undefined' && obj === window) {
|
|
1278
|
+
return '{ [object Window] }';
|
|
1279
|
+
}
|
|
1280
|
+
if (obj === commonjsGlobal) {
|
|
1281
|
+
return '{ [object globalThis] }';
|
|
1282
|
+
}
|
|
1065
1283
|
if (!isDate(obj) && !isRegExp$1(obj)) {
|
|
1066
1284
|
var ys = arrObjKeys(obj, inspect);
|
|
1067
1285
|
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
@@ -1338,7 +1556,6 @@ function arrObjKeys(obj, inspect) {
|
|
|
1338
1556
|
return xs;
|
|
1339
1557
|
}
|
|
1340
1558
|
|
|
1341
|
-
var $TypeError = getIntrinsic('%TypeError%');
|
|
1342
1559
|
var $WeakMap = getIntrinsic('%WeakMap%', true);
|
|
1343
1560
|
var $Map = getIntrinsic('%Map%', true);
|
|
1344
1561
|
|
|
@@ -1350,53 +1567,62 @@ var $mapSet = callBound('Map.prototype.set', true);
|
|
|
1350
1567
|
var $mapHas = callBound('Map.prototype.has', true);
|
|
1351
1568
|
|
|
1352
1569
|
/*
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
* used nodes can be accessed relatively quickly.
|
|
1359
|
-
*/
|
|
1570
|
+
* This function traverses the list returning the node corresponding to the given key.
|
|
1571
|
+
*
|
|
1572
|
+
* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.
|
|
1573
|
+
*/
|
|
1574
|
+
/** @type {import('.').listGetNode} */
|
|
1360
1575
|
var listGetNode = function (list, key) { // eslint-disable-line consistent-return
|
|
1361
|
-
|
|
1576
|
+
/** @type {typeof list | NonNullable<(typeof list)['next']>} */
|
|
1577
|
+
var prev = list;
|
|
1578
|
+
/** @type {(typeof list)['next']} */
|
|
1579
|
+
var curr;
|
|
1580
|
+
for (; (curr = prev.next) !== null; prev = curr) {
|
|
1362
1581
|
if (curr.key === key) {
|
|
1363
1582
|
prev.next = curr.next;
|
|
1364
|
-
|
|
1583
|
+
// eslint-disable-next-line no-extra-parens
|
|
1584
|
+
curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
|
|
1365
1585
|
list.next = curr; // eslint-disable-line no-param-reassign
|
|
1366
1586
|
return curr;
|
|
1367
1587
|
}
|
|
1368
1588
|
}
|
|
1369
1589
|
};
|
|
1370
1590
|
|
|
1591
|
+
/** @type {import('.').listGet} */
|
|
1371
1592
|
var listGet = function (objects, key) {
|
|
1372
1593
|
var node = listGetNode(objects, key);
|
|
1373
1594
|
return node && node.value;
|
|
1374
1595
|
};
|
|
1596
|
+
/** @type {import('.').listSet} */
|
|
1375
1597
|
var listSet = function (objects, key, value) {
|
|
1376
1598
|
var node = listGetNode(objects, key);
|
|
1377
1599
|
if (node) {
|
|
1378
1600
|
node.value = value;
|
|
1379
1601
|
} else {
|
|
1380
1602
|
// Prepend the new node to the beginning of the list
|
|
1381
|
-
objects.next = { // eslint-disable-line no-param-reassign
|
|
1603
|
+
objects.next = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
|
|
1382
1604
|
key: key,
|
|
1383
1605
|
next: objects.next,
|
|
1384
1606
|
value: value
|
|
1385
|
-
};
|
|
1607
|
+
});
|
|
1386
1608
|
}
|
|
1387
1609
|
};
|
|
1610
|
+
/** @type {import('.').listHas} */
|
|
1388
1611
|
var listHas = function (objects, key) {
|
|
1389
1612
|
return !!listGetNode(objects, key);
|
|
1390
1613
|
};
|
|
1391
1614
|
|
|
1615
|
+
/** @type {import('.')} */
|
|
1392
1616
|
var sideChannel = function getSideChannel() {
|
|
1393
|
-
var $wm;
|
|
1394
|
-
var $m;
|
|
1395
|
-
var $o;
|
|
1617
|
+
/** @type {WeakMap<object, unknown>} */ var $wm;
|
|
1618
|
+
/** @type {Map<object, unknown>} */ var $m;
|
|
1619
|
+
/** @type {import('.').RootNode<unknown>} */ var $o;
|
|
1620
|
+
|
|
1621
|
+
/** @type {import('.').Channel} */
|
|
1396
1622
|
var channel = {
|
|
1397
1623
|
assert: function (key) {
|
|
1398
1624
|
if (!channel.has(key)) {
|
|
1399
|
-
throw new
|
|
1625
|
+
throw new type('Side channel does not contain ' + objectInspect(key));
|
|
1400
1626
|
}
|
|
1401
1627
|
},
|
|
1402
1628
|
get: function (key) { // eslint-disable-line consistent-return
|
|
@@ -1443,11 +1669,7 @@ var sideChannel = function getSideChannel() {
|
|
|
1443
1669
|
$mapSet($m, key, value);
|
|
1444
1670
|
} else {
|
|
1445
1671
|
if (!$o) {
|
|
1446
|
-
|
|
1447
|
-
* Initialize the linked list as an empty node, so that we don't have
|
|
1448
|
-
* to special-case handling of the first node: we can always refer to
|
|
1449
|
-
* it as (previous node).next, instead of something like (list).head
|
|
1450
|
-
*/
|
|
1672
|
+
// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
|
|
1451
1673
|
$o = { key: {}, next: null };
|
|
1452
1674
|
}
|
|
1453
1675
|
listSet($o, key, value);
|
|
@@ -1755,10 +1977,13 @@ var defaultFormat = formats['default'];
|
|
|
1755
1977
|
var defaults$2 = {
|
|
1756
1978
|
addQueryPrefix: false,
|
|
1757
1979
|
allowDots: false,
|
|
1980
|
+
allowEmptyArrays: false,
|
|
1981
|
+
arrayFormat: 'indices',
|
|
1758
1982
|
charset: 'utf-8',
|
|
1759
1983
|
charsetSentinel: false,
|
|
1760
1984
|
delimiter: '&',
|
|
1761
1985
|
encode: true,
|
|
1986
|
+
encodeDotInKeys: false,
|
|
1762
1987
|
encoder: utils.encode,
|
|
1763
1988
|
encodeValuesOnly: false,
|
|
1764
1989
|
format: defaultFormat,
|
|
@@ -1787,8 +2012,10 @@ var stringify = function stringify(
|
|
|
1787
2012
|
prefix,
|
|
1788
2013
|
generateArrayPrefix,
|
|
1789
2014
|
commaRoundTrip,
|
|
2015
|
+
allowEmptyArrays,
|
|
1790
2016
|
strictNullHandling,
|
|
1791
2017
|
skipNulls,
|
|
2018
|
+
encodeDotInKeys,
|
|
1792
2019
|
encoder,
|
|
1793
2020
|
filter,
|
|
1794
2021
|
sort,
|
|
@@ -1870,7 +2097,13 @@ var stringify = function stringify(
|
|
|
1870
2097
|
objKeys = sort ? keys.sort(sort) : keys;
|
|
1871
2098
|
}
|
|
1872
2099
|
|
|
1873
|
-
var
|
|
2100
|
+
var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix;
|
|
2101
|
+
|
|
2102
|
+
var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
|
|
2103
|
+
|
|
2104
|
+
if (allowEmptyArrays && isArray$1(obj) && obj.length === 0) {
|
|
2105
|
+
return adjustedPrefix + '[]';
|
|
2106
|
+
}
|
|
1874
2107
|
|
|
1875
2108
|
for (var j = 0; j < objKeys.length; ++j) {
|
|
1876
2109
|
var key = objKeys[j];
|
|
@@ -1880,9 +2113,10 @@ var stringify = function stringify(
|
|
|
1880
2113
|
continue;
|
|
1881
2114
|
}
|
|
1882
2115
|
|
|
2116
|
+
var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key;
|
|
1883
2117
|
var keyPrefix = isArray$1(obj)
|
|
1884
|
-
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix,
|
|
1885
|
-
: adjustedPrefix + (allowDots ? '.' +
|
|
2118
|
+
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
|
|
2119
|
+
: adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
|
|
1886
2120
|
|
|
1887
2121
|
sideChannel$1.set(object, step);
|
|
1888
2122
|
var valueSideChannel = sideChannel();
|
|
@@ -1892,8 +2126,10 @@ var stringify = function stringify(
|
|
|
1892
2126
|
keyPrefix,
|
|
1893
2127
|
generateArrayPrefix,
|
|
1894
2128
|
commaRoundTrip,
|
|
2129
|
+
allowEmptyArrays,
|
|
1895
2130
|
strictNullHandling,
|
|
1896
2131
|
skipNulls,
|
|
2132
|
+
encodeDotInKeys,
|
|
1897
2133
|
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$1(obj) ? null : encoder,
|
|
1898
2134
|
filter,
|
|
1899
2135
|
sort,
|
|
@@ -1915,6 +2151,14 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
|
1915
2151
|
return defaults$2;
|
|
1916
2152
|
}
|
|
1917
2153
|
|
|
2154
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
2155
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
|
|
2159
|
+
throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
2160
|
+
}
|
|
2161
|
+
|
|
1918
2162
|
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
1919
2163
|
throw new TypeError('Encoder has to be a function.');
|
|
1920
2164
|
}
|
|
@@ -1938,13 +2182,32 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
|
1938
2182
|
filter = opts.filter;
|
|
1939
2183
|
}
|
|
1940
2184
|
|
|
2185
|
+
var arrayFormat;
|
|
2186
|
+
if (opts.arrayFormat in arrayPrefixGenerators) {
|
|
2187
|
+
arrayFormat = opts.arrayFormat;
|
|
2188
|
+
} else if ('indices' in opts) {
|
|
2189
|
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
2190
|
+
} else {
|
|
2191
|
+
arrayFormat = defaults$2.arrayFormat;
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
2195
|
+
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults$2.allowDots : !!opts.allowDots;
|
|
2199
|
+
|
|
1941
2200
|
return {
|
|
1942
2201
|
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$2.addQueryPrefix,
|
|
1943
|
-
allowDots:
|
|
2202
|
+
allowDots: allowDots,
|
|
2203
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults$2.allowEmptyArrays,
|
|
2204
|
+
arrayFormat: arrayFormat,
|
|
1944
2205
|
charset: charset,
|
|
1945
2206
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$2.charsetSentinel,
|
|
2207
|
+
commaRoundTrip: opts.commaRoundTrip,
|
|
1946
2208
|
delimiter: typeof opts.delimiter === 'undefined' ? defaults$2.delimiter : opts.delimiter,
|
|
1947
2209
|
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$2.encode,
|
|
2210
|
+
encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults$2.encodeDotInKeys,
|
|
1948
2211
|
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$2.encoder,
|
|
1949
2212
|
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$2.encodeValuesOnly,
|
|
1950
2213
|
filter: filter,
|
|
@@ -1978,20 +2241,8 @@ var stringify_1 = function (object, opts) {
|
|
|
1978
2241
|
return '';
|
|
1979
2242
|
}
|
|
1980
2243
|
|
|
1981
|
-
var arrayFormat;
|
|
1982
|
-
|
|
1983
|
-
arrayFormat = opts.arrayFormat;
|
|
1984
|
-
} else if (opts && 'indices' in opts) {
|
|
1985
|
-
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
1986
|
-
} else {
|
|
1987
|
-
arrayFormat = 'indices';
|
|
1988
|
-
}
|
|
1989
|
-
|
|
1990
|
-
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
1991
|
-
if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
1992
|
-
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
1993
|
-
}
|
|
1994
|
-
var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
|
|
2244
|
+
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
|
|
2245
|
+
var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
|
|
1995
2246
|
|
|
1996
2247
|
if (!objKeys) {
|
|
1997
2248
|
objKeys = Object.keys(obj);
|
|
@@ -2013,8 +2264,10 @@ var stringify_1 = function (object, opts) {
|
|
|
2013
2264
|
key,
|
|
2014
2265
|
generateArrayPrefix,
|
|
2015
2266
|
commaRoundTrip,
|
|
2267
|
+
options.allowEmptyArrays,
|
|
2016
2268
|
options.strictNullHandling,
|
|
2017
2269
|
options.skipNulls,
|
|
2270
|
+
options.encodeDotInKeys,
|
|
2018
2271
|
options.encode ? options.encoder : null,
|
|
2019
2272
|
options.filter,
|
|
2020
2273
|
options.sort,
|
|
@@ -2049,15 +2302,18 @@ var isArray = Array.isArray;
|
|
|
2049
2302
|
|
|
2050
2303
|
var defaults$1 = {
|
|
2051
2304
|
allowDots: false,
|
|
2305
|
+
allowEmptyArrays: false,
|
|
2052
2306
|
allowPrototypes: false,
|
|
2053
2307
|
allowSparse: false,
|
|
2054
2308
|
arrayLimit: 20,
|
|
2055
2309
|
charset: 'utf-8',
|
|
2056
2310
|
charsetSentinel: false,
|
|
2057
2311
|
comma: false,
|
|
2312
|
+
decodeDotInKeys: true,
|
|
2058
2313
|
decoder: utils.decode,
|
|
2059
2314
|
delimiter: '&',
|
|
2060
2315
|
depth: 5,
|
|
2316
|
+
duplicates: 'combine',
|
|
2061
2317
|
ignoreQueryPrefix: false,
|
|
2062
2318
|
interpretNumericEntities: false,
|
|
2063
2319
|
parameterLimit: 1000,
|
|
@@ -2091,7 +2347,8 @@ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
|
|
2091
2347
|
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
|
2092
2348
|
|
|
2093
2349
|
var parseValues = function parseQueryStringValues(str, options) {
|
|
2094
|
-
var obj = {};
|
|
2350
|
+
var obj = { __proto__: null };
|
|
2351
|
+
|
|
2095
2352
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
2096
2353
|
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
2097
2354
|
var parts = cleanStr.split(options.delimiter, limit);
|
|
@@ -2144,9 +2401,10 @@ var parseValues = function parseQueryStringValues(str, options) {
|
|
|
2144
2401
|
val = isArray(val) ? [val] : val;
|
|
2145
2402
|
}
|
|
2146
2403
|
|
|
2147
|
-
|
|
2404
|
+
var existing = has.call(obj, key);
|
|
2405
|
+
if (existing && options.duplicates === 'combine') {
|
|
2148
2406
|
obj[key] = utils.combine(obj[key], val);
|
|
2149
|
-
} else {
|
|
2407
|
+
} else if (!existing || options.duplicates === 'last') {
|
|
2150
2408
|
obj[key] = val;
|
|
2151
2409
|
}
|
|
2152
2410
|
}
|
|
@@ -2162,24 +2420,25 @@ var parseObject = function (chain, val, options, valuesParsed) {
|
|
|
2162
2420
|
var root = chain[i];
|
|
2163
2421
|
|
|
2164
2422
|
if (root === '[]' && options.parseArrays) {
|
|
2165
|
-
obj = [].concat(leaf);
|
|
2423
|
+
obj = options.allowEmptyArrays && leaf === '' ? [] : [].concat(leaf);
|
|
2166
2424
|
} else {
|
|
2167
2425
|
obj = options.plainObjects ? Object.create(null) : {};
|
|
2168
2426
|
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
2169
|
-
var
|
|
2170
|
-
|
|
2427
|
+
var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
|
|
2428
|
+
var index = parseInt(decodedRoot, 10);
|
|
2429
|
+
if (!options.parseArrays && decodedRoot === '') {
|
|
2171
2430
|
obj = { 0: leaf };
|
|
2172
2431
|
} else if (
|
|
2173
2432
|
!isNaN(index)
|
|
2174
|
-
&& root !==
|
|
2175
|
-
&& String(index) ===
|
|
2433
|
+
&& root !== decodedRoot
|
|
2434
|
+
&& String(index) === decodedRoot
|
|
2176
2435
|
&& index >= 0
|
|
2177
2436
|
&& (options.parseArrays && index <= options.arrayLimit)
|
|
2178
2437
|
) {
|
|
2179
2438
|
obj = [];
|
|
2180
2439
|
obj[index] = leaf;
|
|
2181
|
-
} else if (
|
|
2182
|
-
obj[
|
|
2440
|
+
} else if (decodedRoot !== '__proto__') {
|
|
2441
|
+
obj[decodedRoot] = leaf;
|
|
2183
2442
|
}
|
|
2184
2443
|
}
|
|
2185
2444
|
|
|
@@ -2248,7 +2507,15 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
|
2248
2507
|
return defaults$1;
|
|
2249
2508
|
}
|
|
2250
2509
|
|
|
2251
|
-
if (
|
|
2510
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
2511
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
|
|
2515
|
+
throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2518
|
+
if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
|
|
2252
2519
|
throw new TypeError('Decoder has to be a function.');
|
|
2253
2520
|
}
|
|
2254
2521
|
|
|
@@ -2257,18 +2524,29 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
|
2257
2524
|
}
|
|
2258
2525
|
var charset = typeof opts.charset === 'undefined' ? defaults$1.charset : opts.charset;
|
|
2259
2526
|
|
|
2527
|
+
var duplicates = typeof opts.duplicates === 'undefined' ? defaults$1.duplicates : opts.duplicates;
|
|
2528
|
+
|
|
2529
|
+
if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
|
|
2530
|
+
throw new TypeError('The duplicates option must be either combine, first, or last');
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults$1.allowDots : !!opts.allowDots;
|
|
2534
|
+
|
|
2260
2535
|
return {
|
|
2261
|
-
allowDots:
|
|
2536
|
+
allowDots: allowDots,
|
|
2537
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults$1.allowEmptyArrays,
|
|
2262
2538
|
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults$1.allowPrototypes,
|
|
2263
2539
|
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults$1.allowSparse,
|
|
2264
2540
|
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults$1.arrayLimit,
|
|
2265
2541
|
charset: charset,
|
|
2266
2542
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
|
|
2267
2543
|
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults$1.comma,
|
|
2544
|
+
decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults$1.decodeDotInKeys,
|
|
2268
2545
|
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults$1.decoder,
|
|
2269
2546
|
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults$1.delimiter,
|
|
2270
2547
|
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
2271
2548
|
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults$1.depth,
|
|
2549
|
+
duplicates: duplicates,
|
|
2272
2550
|
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
2273
2551
|
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults$1.interpretNumericEntities,
|
|
2274
2552
|
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults$1.parameterLimit,
|
|
@@ -2310,85 +2588,52 @@ var lib = {
|
|
|
2310
2588
|
stringify: stringify_1
|
|
2311
2589
|
};
|
|
2312
2590
|
|
|
2591
|
+
const limit = 100;
|
|
2313
2592
|
const fetchProductColorsQuery = (id, page) => lib.stringify({
|
|
2314
|
-
|
|
2593
|
+
fields: ['*', 'products.*'].join(','),
|
|
2594
|
+
filter: {
|
|
2315
2595
|
products: {
|
|
2316
|
-
|
|
2317
|
-
|
|
2596
|
+
Product_id: {
|
|
2597
|
+
_eq: id,
|
|
2318
2598
|
},
|
|
2319
2599
|
},
|
|
2320
2600
|
},
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
page: page || 1,
|
|
2325
|
-
pageSize: 100,
|
|
2326
|
-
},
|
|
2601
|
+
meta: '*',
|
|
2602
|
+
page: page || 1,
|
|
2603
|
+
limit,
|
|
2327
2604
|
}, {
|
|
2328
|
-
encodeValuesOnly: true,
|
|
2605
|
+
encodeValuesOnly: true,
|
|
2329
2606
|
});
|
|
2330
|
-
const fetchCategoryColorsQuery = (
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2607
|
+
const fetchCategoryColorsQuery = (id, page) => lib.stringify({
|
|
2608
|
+
fields: ['*', 'Category.*', 'products.*'].join(','),
|
|
2609
|
+
filter: {
|
|
2610
|
+
Category: {
|
|
2611
|
+
Category_id: {
|
|
2612
|
+
_eq: id,
|
|
2335
2613
|
},
|
|
2336
2614
|
},
|
|
2337
2615
|
},
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
page: 1,
|
|
2342
|
-
pageSize: 100,
|
|
2343
|
-
},
|
|
2616
|
+
meta: '*',
|
|
2617
|
+
page: page || 1,
|
|
2618
|
+
limit,
|
|
2344
2619
|
}, {
|
|
2345
|
-
encodeValuesOnly: true,
|
|
2620
|
+
encodeValuesOnly: true,
|
|
2346
2621
|
});
|
|
2347
|
-
const fetchColorByNumber = (
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
number: {
|
|
2354
|
-
$contains: colorNumber,
|
|
2355
|
-
},
|
|
2356
|
-
},
|
|
2357
|
-
{
|
|
2358
|
-
products: {
|
|
2359
|
-
id: {
|
|
2360
|
-
$eq: productId,
|
|
2361
|
-
},
|
|
2362
|
-
},
|
|
2363
|
-
},
|
|
2364
|
-
],
|
|
2365
|
-
},
|
|
2366
|
-
{
|
|
2367
|
-
$and: [
|
|
2368
|
-
{
|
|
2369
|
-
name: {
|
|
2370
|
-
$contains: colorNumber,
|
|
2371
|
-
},
|
|
2372
|
-
},
|
|
2373
|
-
{
|
|
2374
|
-
products: {
|
|
2375
|
-
id: {
|
|
2376
|
-
$eq: productId,
|
|
2377
|
-
},
|
|
2378
|
-
},
|
|
2379
|
-
},
|
|
2380
|
-
],
|
|
2622
|
+
const fetchColorByNumber = (id, colorNumber) => lib.stringify({
|
|
2623
|
+
fields: ['*', 'Category.*'].join(','),
|
|
2624
|
+
filter: {
|
|
2625
|
+
Category: {
|
|
2626
|
+
Category_id: {
|
|
2627
|
+
_eq: id,
|
|
2381
2628
|
},
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
pagination: {
|
|
2387
|
-
page: 1,
|
|
2388
|
-
pageSize: 100,
|
|
2629
|
+
},
|
|
2630
|
+
number: {
|
|
2631
|
+
_contains: colorNumber,
|
|
2632
|
+
},
|
|
2389
2633
|
},
|
|
2634
|
+
meta: '*',
|
|
2390
2635
|
}, {
|
|
2391
|
-
encodeValuesOnly: true,
|
|
2636
|
+
encodeValuesOnly: true,
|
|
2392
2637
|
});
|
|
2393
2638
|
|
|
2394
2639
|
const myModalCss = ".pallete-wrapper *{font-family:\"Galatea\", sans-serif}.my-modal{box-shadow:1px 1px 1px #ccc;background-color:#fff;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);max-width:1555px;width:90%;z-index:1000;text-align:center;padding:35px 40px;max-height:calc(100vh - 100px);overflow-y:auto}@media (max-width: 1024px){.my-modal{padding:80px 20px 20px}}.my-modal::-webkit-scrollbar{display:none}.my-modal .loader{display:flex;flex-direction:column;align-items:center;justify-content:center;height:300px}.my-modal>img{width:300px;object-fit:cover}@media (max-width: 768px){.my-modal>img{width:200px}}.my-modal__close{position:absolute;right:20px;top:20px;background:transparent;border:none}.my-modal__close>img{width:45px;height:45px;object-fit:cover;cursor:pointer}@media (max-width: 1024px){.my-modal__close{top:65px}}.my-modal__see-more{font-size:22px;margin-bottom:27px;display:flex;justify-content:center;align-items:center}@media (max-width: 1024px){.my-modal__see-more{font-size:18px}}.my-modal__see-more img{width:45px;height:45px}@media (max-width: 1024px){.my-modal__see-more img{display:none}}.my-modal__wrapper{display:flex;flex-direction:column;position:relative}.my-modal__wrapper .boxes{display:flex;flex-direction:column;flex-wrap:wrap}.my-modal__wrapper .boxes__list{display:flex;flex-wrap:wrap;gap:5px 5px}@media (max-width: 1024px){.my-modal__wrapper .boxes__list{justify-content:center}}.my-modal__wrapper .boxes__box-content{width:100%;margin-bottom:5px;height:500px;text-align:left;display:flex;flex-direction:row;justify-content:space-between;position:relative}.my-modal__wrapper .boxes__box-content .closebtn{position:absolute;right:10px;top:10px;width:53px;height:53px;cursor:pointer;object-fit:cover;z-index:9999}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content{flex-direction:column-reverse;height:auto}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content{margin:0 auto}}.my-modal__wrapper .boxes__box-content__info{width:40%;padding:50px 40px;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info{width:100%;padding:15px;min-height:100px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info{min-height:auto}}.my-modal__wrapper .boxes__box-content__info h2{font-size:35px;font-weight:normal;text-transform:capitalize;margin-bottom:7px;color:#232323}.my-modal__wrapper .boxes__box-content__info h4{margin-top:0px;margin-bottom:15px;font-size:16px;color:#4c4c4c}.my-modal__wrapper .boxes__box-content__info .divider{border:1px solid #4c4c4c;opacity:0.2;margin-bottom:20px}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info .divider{margin:10px 0px}}.my-modal__wrapper .boxes__box-content__info__value{display:flex;flex-direction:row;justify-content:flex-start}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value{justify-content:flex-start}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value{flex-direction:column}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-image{margin:0 auto;margin-bottom:10px}}.my-modal__wrapper .boxes__box-content__info__value-image img{width:114px;object-fit:cover}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-image img{width:75px}}.my-modal__wrapper .boxes__box-content__info__value-product{color:#232323;margin-left:10px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:26px;margin:0;margin-right:10px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:16px}}.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:20px;margin-top:0px;margin-bottom:0px}.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:20px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:0}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:10px}}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product>div{display:flex;justify-content:flex-start;align-items:center}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product>div{flex-direction:column}}.my-modal__wrapper .boxes__box-content__slider{width:60%;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__slider{width:100%;display:block}}.my-modal__wrapper .boxes__box-content__white *{color:#fff}.my-modal__wrapper .boxes__box-content__white h2{color:#fff}.my-modal__wrapper .pagination{margin:10px 0px;font-size:16px;display:flex;flex-direction:row;align-items:center;justify-content:center}.my-modal__wrapper .pagination>span{margin:0 3px;cursor:pointer;min-width:20px;padding:5px;box-shadow:1px 1px 1px #ccc}.my-modal__wrapper .pagination .current{background-color:wheat}.my-modal .categories{padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid #dfdfdf;display:flex;flex-direction:column;align-items:flex-start}.my-modal .categories__container{display:flex;flex-wrap:nowrap;gap:5px 5px;overflow-x:auto;width:100%}@media (max-width: 1024px){.my-modal .categories__container{padding-bottom:5px}}.my-modal .categories__slide-information{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.my-modal .categories__slide-information span{color:#4c4c4c;font-size:16px;font-weight:normal}.my-modal .categories__slide-information span:first-of-type{margin-left:7px}.my-modal .categories__slide-information span:last-of-type{margin-right:7px}.my-modal .button,.my-modal a{background-color:#fff;font-size:16px;box-shadow:0 10px 20px 0 rgba(0, 0, 0, 0.1);border-radius:22.5px;padding:15px 30px;color:#232323;text-decoration:none;display:block;text-align:center;transition:all 0.7s ease-in-out;border:none;cursor:pointer}.my-modal .button:hover,.my-modal a:hover{color:#fff;background-color:#232323}.my-modal .button.inverse,.my-modal a.inverse{background-color:#232323;color:#fff}.my-modal .button.inverse:hover,.my-modal a.inverse:hover{color:#232323;background-color:#fff}@media (max-width: 1024px){.my-modal .button,.my-modal a{max-width:150px;font-size:13px;padding:12px 25px}}@media (max-width: 768px){.my-modal .button,.my-modal a{margin:0 auto}}.my-modal>.button{margin:10px auto}";
|
|
@@ -2396,6 +2641,7 @@ const myModalCss = ".pallete-wrapper *{font-family:\"Galatea\", sans-serif}.my-m
|
|
|
2396
2641
|
const MyModal = class {
|
|
2397
2642
|
constructor(hostRef) {
|
|
2398
2643
|
index$1.registerInstance(this, hostRef);
|
|
2644
|
+
this.clearSearchText = index$1.createEvent(this, "clearSearchText", 7);
|
|
2399
2645
|
this.close = index$1.createEvent(this, "close", 7);
|
|
2400
2646
|
this.readyToCLose = index$1.createEvent(this, "readyToCLose", 7);
|
|
2401
2647
|
this.boxDesktopWidth = 130;
|
|
@@ -2451,10 +2697,18 @@ const MyModal = class {
|
|
|
2451
2697
|
};
|
|
2452
2698
|
this.fetchProductData = async () => {
|
|
2453
2699
|
try {
|
|
2454
|
-
const
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2700
|
+
const shopResponse = await ApiService.getData(`items/Shop?filter[name][_eq]=${this.shop}`);
|
|
2701
|
+
const shop = shopResponse === null || shopResponse === void 0 ? void 0 : shopResponse.data[0];
|
|
2702
|
+
if (shop.id) {
|
|
2703
|
+
const response = await ApiService.getData(`items/Product?filter[name][_eq]=${this.product}&fields=*,images.*,Shop.*,Category.*.*.*.*`);
|
|
2704
|
+
const product = response === null || response === void 0 ? void 0 : response.data[0];
|
|
2705
|
+
if (product) {
|
|
2706
|
+
if (product.Shop.find((s) => s.Shop_id === shop.id)) {
|
|
2707
|
+
this.data = Object.assign(Object.assign({}, response.data[0]), { id: response.data[0].id });
|
|
2708
|
+
}
|
|
2709
|
+
else {
|
|
2710
|
+
return null;
|
|
2711
|
+
}
|
|
2458
2712
|
}
|
|
2459
2713
|
}
|
|
2460
2714
|
}
|
|
@@ -2465,17 +2719,16 @@ const MyModal = class {
|
|
|
2465
2719
|
this.preloader = false;
|
|
2466
2720
|
}
|
|
2467
2721
|
};
|
|
2468
|
-
// TODO:
|
|
2469
2722
|
this.fetchProductColors = async (id, page) => {
|
|
2470
2723
|
this.loading = true;
|
|
2471
2724
|
try {
|
|
2472
|
-
const response = await ApiService.getData(`
|
|
2725
|
+
const response = await ApiService.getData(`items/Color?${fetchProductColorsQuery(id, page)}`);
|
|
2473
2726
|
if (response) {
|
|
2474
2727
|
this.colors = {
|
|
2475
2728
|
list: response &&
|
|
2476
2729
|
response.data &&
|
|
2477
|
-
response.data.map((item) => (Object.assign({
|
|
2478
|
-
pagination: response.meta
|
|
2730
|
+
response.data.map((item) => (Object.assign({}, item))),
|
|
2731
|
+
pagination: response.meta,
|
|
2479
2732
|
};
|
|
2480
2733
|
}
|
|
2481
2734
|
}
|
|
@@ -2486,16 +2739,16 @@ const MyModal = class {
|
|
|
2486
2739
|
this.loading = false;
|
|
2487
2740
|
}
|
|
2488
2741
|
};
|
|
2489
|
-
this.fetchCategoryColors = async (
|
|
2742
|
+
this.fetchCategoryColors = async (id, page) => {
|
|
2490
2743
|
this.loading = true;
|
|
2491
2744
|
try {
|
|
2492
|
-
const response = await ApiService.getData(`
|
|
2745
|
+
const response = await ApiService.getData(`items/Color?${fetchCategoryColorsQuery(id, page)}`);
|
|
2493
2746
|
if (response) {
|
|
2494
2747
|
this.colors = {
|
|
2495
2748
|
list: response &&
|
|
2496
2749
|
response.data &&
|
|
2497
|
-
response.data.map((item) => (Object.assign({
|
|
2498
|
-
pagination: response.meta
|
|
2750
|
+
response.data.map((item) => (Object.assign({}, item))),
|
|
2751
|
+
pagination: response.meta,
|
|
2499
2752
|
};
|
|
2500
2753
|
}
|
|
2501
2754
|
}
|
|
@@ -2506,29 +2759,21 @@ const MyModal = class {
|
|
|
2506
2759
|
this.loading = false;
|
|
2507
2760
|
}
|
|
2508
2761
|
};
|
|
2509
|
-
// private onIntersection = async (entries: any) => {
|
|
2510
|
-
// console.log(entries[0]);
|
|
2511
|
-
// if (entries[0].intersectionRatio === 0) {
|
|
2512
|
-
// console.log('d');
|
|
2513
|
-
// }
|
|
2514
|
-
// };
|
|
2515
|
-
// private handleObserve = () => {
|
|
2516
|
-
// console.log(this.modalEl.shadowRoot);
|
|
2517
|
-
// const boxesList: any = (this.modalEl as any).querySelector('.my-modal__wrapper');
|
|
2518
|
-
// console.log(boxesList);
|
|
2519
|
-
// if (boxesList) {
|
|
2520
|
-
// this.observer = new IntersectionObserver(this.onIntersection);
|
|
2521
|
-
// this.observer.observe(boxesList);
|
|
2522
|
-
// }
|
|
2523
|
-
// };
|
|
2524
2762
|
this.onPage = (page) => {
|
|
2525
|
-
|
|
2763
|
+
if (this.data) {
|
|
2764
|
+
if (this.selectedCategory) {
|
|
2765
|
+
this.fetchCategoryColors(this.selectedCategory, page);
|
|
2766
|
+
}
|
|
2767
|
+
else {
|
|
2768
|
+
this.fetchProductColors(String(this.data.id), page);
|
|
2769
|
+
}
|
|
2770
|
+
}
|
|
2526
2771
|
this.page = page;
|
|
2527
2772
|
this.currentColor = null;
|
|
2528
2773
|
this.currentIndex = null;
|
|
2529
2774
|
};
|
|
2530
2775
|
this.handleCategoryClick = (color) => {
|
|
2531
|
-
if (this.selectedCategory && color && this.selectedCategory
|
|
2776
|
+
if (this.selectedCategory && color && this.selectedCategory === color && !this.showRange) {
|
|
2532
2777
|
this.data && this.fetchProductColors(String(this.data.id));
|
|
2533
2778
|
this.selectedCategory = null;
|
|
2534
2779
|
}
|
|
@@ -2537,6 +2782,7 @@ const MyModal = class {
|
|
|
2537
2782
|
this.selectedCategory = color;
|
|
2538
2783
|
}
|
|
2539
2784
|
this.currentColor = null;
|
|
2785
|
+
this.clearSearchText.emit();
|
|
2540
2786
|
};
|
|
2541
2787
|
this.shop = undefined;
|
|
2542
2788
|
this.product = undefined;
|
|
@@ -2562,9 +2808,9 @@ const MyModal = class {
|
|
|
2562
2808
|
this.infoBoxWidth = newValue * this.boxWidth;
|
|
2563
2809
|
}
|
|
2564
2810
|
watchPropHandler(newValue) {
|
|
2565
|
-
if (newValue.
|
|
2811
|
+
if (newValue.Category.length > 0) {
|
|
2566
2812
|
this.showRange = true;
|
|
2567
|
-
this.handleCategoryClick(newValue.
|
|
2813
|
+
this.handleCategoryClick(newValue.Category[0].Category_id.id);
|
|
2568
2814
|
}
|
|
2569
2815
|
else {
|
|
2570
2816
|
this.fetchProductColors(String(newValue.id));
|
|
@@ -2588,21 +2834,23 @@ const MyModal = class {
|
|
|
2588
2834
|
this.displayForMobile();
|
|
2589
2835
|
}
|
|
2590
2836
|
async searchColorsHandler(event) {
|
|
2591
|
-
|
|
2837
|
+
this.loading = true;
|
|
2838
|
+
this.currentColor = null;
|
|
2592
2839
|
// if search is empty set to first category to not showing whole product colors
|
|
2593
2840
|
if (event.detail === '') {
|
|
2594
|
-
this.handleCategoryClick(
|
|
2841
|
+
this.handleCategoryClick(this.selectedCategory);
|
|
2842
|
+
this.loading = true;
|
|
2595
2843
|
}
|
|
2596
2844
|
try {
|
|
2597
2845
|
if (this.data && this.data.id && event.detail !== '') {
|
|
2598
|
-
this.selectedCategory
|
|
2599
|
-
const response = await ApiService.getData(`colors?${fetchColorByNumber(Number(this.data.id), event.detail)}`);
|
|
2846
|
+
const response = await ApiService.getData(`items/Color?${fetchColorByNumber(Number(this.selectedCategory), event.detail)}`);
|
|
2600
2847
|
if (response) {
|
|
2601
2848
|
this.colors = {
|
|
2602
|
-
list: response &&
|
|
2849
|
+
list: (response &&
|
|
2603
2850
|
response.data &&
|
|
2604
|
-
response.data.map((item) => (Object.assign({
|
|
2605
|
-
|
|
2851
|
+
response.data.map((item) => (Object.assign({}, item)))) ||
|
|
2852
|
+
[],
|
|
2853
|
+
pagination: response.meta,
|
|
2606
2854
|
};
|
|
2607
2855
|
}
|
|
2608
2856
|
}
|
|
@@ -2610,6 +2858,9 @@ const MyModal = class {
|
|
|
2610
2858
|
catch (error) {
|
|
2611
2859
|
console.error(error);
|
|
2612
2860
|
}
|
|
2861
|
+
finally {
|
|
2862
|
+
this.loading = false;
|
|
2863
|
+
}
|
|
2613
2864
|
}
|
|
2614
2865
|
componentWillLoad() {
|
|
2615
2866
|
this.preloader = true;
|
|
@@ -2621,11 +2872,9 @@ const MyModal = class {
|
|
|
2621
2872
|
this.colorTimer();
|
|
2622
2873
|
}
|
|
2623
2874
|
render() {
|
|
2624
|
-
var _a, _b, _c, _d
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
return (index$1.h("my-colorbox", { key: c.id, onClick: () => this.handleCategoryClick(c), color: c.attributes.hex, name: c.attributes.name, shop: this.shop, product: this.product, isCategoryActive: ((_a = this.selectedCategory) === null || _a === void 0 ? void 0 : _a.id) === c.id }));
|
|
2628
|
-
})), this.isMobile && (index$1.h("div", { class: 'categories__slide-information', style: { width: `${this.infoBoxWidth}px` } }, index$1.h("span", null, "Przewi\u0144 w lewo"), index$1.h("span", null, "Przewi\u0144 w prawo"))))), index$1.h("div", { class: 'my-modal__wrapper' }, this.loading && index$1.h("my-loader", null), !this.loading && this.colors && (index$1.h("div", { class: 'container_boxes' }, this.colors.list.length > 0 ? (this.chunks(this.colors.list).map((color, index) => {
|
|
2875
|
+
var _a, _b, _c, _d;
|
|
2876
|
+
console.log(this.colors);
|
|
2877
|
+
return (index$1.h("div", { class: `my-modal`, onMouseEnter: () => this.handleReadyToClose(false), onMouseLeave: () => this.handleReadyToClose(true) }, this.preloader && (index$1.h("div", { class: 'loader' }, index$1.h("my-loader", null))), !this.preloader && (index$1.h("button", { class: "my-modal__close", onClick: () => this.closeModalHandler() }, index$1.h("img", { src: index$1.getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }))), !this.preloader && this.data && this.data.modalLogo && index$1.h("img", { src: `${APIURL}/assets/${(_a = this.data) === null || _a === void 0 ? void 0 : _a.modalLogo}?access_token=${accessToken}`, alt: "modal-logo" }), !this.preloader && this.data && (index$1.h("p", { class: "my-modal__see-more" }, (_b = this.data) === null || _b === void 0 ? void 0 : _b.modalDescription)), this.showRange && (index$1.h("div", { class: 'categories' }, this.data && index$1.h("my-search", { productId: Number((_c = this.data) === null || _c === void 0 ? void 0 : _c.id), isMobile: this.isMobile }), index$1.h("div", { class: 'categories__container', style: { maxWidth: `${this.infoBoxWidth}px` } }, (_d = this.data) === null || _d === void 0 ? void 0 : _d.Category.map((c) => (index$1.h("my-colorbox", { key: c.id, onClick: () => this.handleCategoryClick(c.Category_id.id), color: c.Category_id.hex, name: c.Category_id.category_name, shop: this.shop, product: this.product, isCategoryActive: this.selectedCategory === c.Category_id.id })))), this.isMobile && (index$1.h("div", { class: 'categories__slide-information', style: { width: `${this.infoBoxWidth}px` } }, index$1.h("span", null, "Przewi\u0144 w lewo"), index$1.h("span", null, "Przewi\u0144 w prawo"))))), index$1.h("div", { class: 'my-modal__wrapper' }, this.loading && index$1.h("my-loader", null), !this.loading && this.colors && (index$1.h("div", { class: 'container_boxes' }, this.colors.list.length > 0 ? (this.chunks(this.colors.list).map((color, index) => {
|
|
2629
2878
|
var _a;
|
|
2630
2879
|
return (index$1.h("div", { key: index, class: "boxes" }, index$1.h("div", { class: "boxes__list" }, color.map((c) => {
|
|
2631
2880
|
var _a;
|
|
@@ -2644,10 +2893,10 @@ const MyModal = class {
|
|
|
2644
2893
|
];
|
|
2645
2894
|
}, color: c.hex, name: c.name, isActive: ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) === c.id, shop: this.shop, product: this.product }));
|
|
2646
2895
|
})), ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) && index === this.currentIndex && (index$1.h("my-colorinfo", { currentColor: this.currentColor, shop: this.shop, product: this.product, data: this.data, isMobile: this.isMobile, infoBoxWidth: this.infoBoxWidth }))));
|
|
2647
|
-
})) : (index$1.h("p", null, "Brak wynik\u00F3w")), this.colors.pagination.
|
|
2896
|
+
})) : (index$1.h("p", null, "Brak wynik\u00F3w")), this.colors.pagination.filter_count > limit && (index$1.h("div", { class: 'pagination' }, Array.from({ length: Math.ceil(this.colors.pagination.filter_count / limit) }).map((_, i) => (index$1.h("span", { class: i + 1 === this.page ? 'current' : '', onClick: e => {
|
|
2648
2897
|
e.preventDefault();
|
|
2649
2898
|
this.onPage(i + 1);
|
|
2650
|
-
}, key: `#${i + 1
|
|
2899
|
+
}, key: `#${i + 1}` }, i + 1)))))))), !this.preloader && this.isMobile && (index$1.h("button", { class: "button", onClick: () => this.closeModalHandler() }, "Zamknij"))));
|
|
2651
2900
|
}
|
|
2652
2901
|
static get assetsDirs() { return ["assets"]; }
|
|
2653
2902
|
get modalEl() { return index$1.getElement(this); }
|
|
@@ -2660,6 +2909,17 @@ MyModal.style = myModalCss;
|
|
|
2660
2909
|
|
|
2661
2910
|
const mySearchCss = ".pallete-wrapper.sc-my-search *.sc-my-search{font-family:\"Galatea\", sans-serif}.search.sc-my-search{position:relative;width:400px}@media (max-width: 768px){.search.sc-my-search{width:100%}}.search.sc-my-search input.sc-my-search{margin-bottom:12px;font-size:16px;padding:19px;border-radius:27.35px;border:1px solid #dfdfdf;width:100%}.search.sc-my-search button.sc-my-search{position:absolute;border:none;background-color:transparent;right:-20px;top:0;width:50px;height:calc(100% - 12px);display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer}";
|
|
2662
2911
|
|
|
2912
|
+
function debounce(func, wait) {
|
|
2913
|
+
let timeout;
|
|
2914
|
+
return function executedFunction(...args) {
|
|
2915
|
+
const later = () => {
|
|
2916
|
+
clearTimeout(timeout);
|
|
2917
|
+
func(...args);
|
|
2918
|
+
};
|
|
2919
|
+
clearTimeout(timeout);
|
|
2920
|
+
timeout = setTimeout(later, wait);
|
|
2921
|
+
};
|
|
2922
|
+
}
|
|
2663
2923
|
const MySearch = class {
|
|
2664
2924
|
constructor(hostRef) {
|
|
2665
2925
|
index$1.registerInstance(this, hostRef);
|
|
@@ -2667,6 +2927,10 @@ const MySearch = class {
|
|
|
2667
2927
|
this.fetchColorsByName = (text) => {
|
|
2668
2928
|
this.searchColors.emit(text);
|
|
2669
2929
|
};
|
|
2930
|
+
this.debouncedInputChangeValue = debounce((value) => {
|
|
2931
|
+
this.fetchColorsByName(value);
|
|
2932
|
+
this.searchText = value;
|
|
2933
|
+
}, 300);
|
|
2670
2934
|
this.productId = undefined;
|
|
2671
2935
|
this.isMobile = undefined;
|
|
2672
2936
|
this.searchIcon = 'search.svg';
|
|
@@ -2674,12 +2938,14 @@ const MySearch = class {
|
|
|
2674
2938
|
}
|
|
2675
2939
|
onInputChangeValue(event) {
|
|
2676
2940
|
const value = event.target.value;
|
|
2677
|
-
this.
|
|
2678
|
-
this.searchText = value;
|
|
2941
|
+
this.debouncedInputChangeValue(value);
|
|
2679
2942
|
}
|
|
2680
2943
|
fetchColorsByNameHandle(newValue) {
|
|
2681
2944
|
this.fetchColorsByName(newValue);
|
|
2682
2945
|
}
|
|
2946
|
+
clearSearchTextHandler() {
|
|
2947
|
+
this.searchText = null;
|
|
2948
|
+
}
|
|
2683
2949
|
render() {
|
|
2684
2950
|
return (index$1.h("div", { class: 'search' }, index$1.h("input", { placeholder: this.isMobile ? 'Wyszukaj kolor' : 'Wyszukaj kolor po nazwie bądź numerze', value: this.searchText || '', type: "text", onInput: this.onInputChangeValue.bind(this) }), index$1.h("button", { onClick: () => {
|
|
2685
2951
|
this.searchText && this.fetchColorsByName(this.searchText);
|
|
@@ -7965,9 +8231,9 @@ const JcSwiper = class {
|
|
|
7965
8231
|
render() {
|
|
7966
8232
|
return (index$1.h("div", { class: "slider-wrapper" }, index$1.h("div", { class: "swiper mySwiper2" }, index$1.h("div", { class: "swiper-wrapper" }, this.slides &&
|
|
7967
8233
|
this.slides.length > 0 &&
|
|
7968
|
-
this.slides.map((slide) => (index$1.h("div", { key: slide.id, class: "swiper-slide" }, index$1.h("img", { src: slide.
|
|
8234
|
+
this.slides.map((slide) => (index$1.h("div", { key: slide.id, class: "swiper-slide" }, index$1.h("img", { src: `${APIURL}/assets/${slide.directus_files_id}?access_token=${accessToken}`, alt: "room_image" }))))), index$1.h("div", { onClick: this.colorInteraction, class: "swiper-button-next" }), index$1.h("div", { onClick: this.colorInteraction, class: "swiper-button-prev" })), index$1.h("div", { class: "swiper mySwiper" }, index$1.h("div", { class: "swiper-wrapper" }, this.slides &&
|
|
7969
8235
|
this.slides.length > 0 &&
|
|
7970
|
-
this.slides.map((slide) => (index$1.h("div", { key: slide.id, class: "swiper-slide" }, index$1.h("img", { src: slide.
|
|
8236
|
+
this.slides.map((slide) => (index$1.h("div", { key: slide.id, class: "swiper-slide" }, index$1.h("img", { src: `${APIURL}/assets/${slide.directus_files_id}?access_token=${accessToken}`, alt: "room_image" }))))))));
|
|
7971
8237
|
}
|
|
7972
8238
|
get modalEl() { return index$1.getElement(this); }
|
|
7973
8239
|
};
|