@trafilea/afrodita-components 5.0.0-beta.200 → 5.0.0-beta.201
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/build/index.esm.js +150 -150
- package/build/index.esm.js.map +1 -1
- package/build/index.js +150 -150
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
|
@@ -5373,6 +5373,153 @@ var MultiColorPicker = function (_a) {
|
|
|
5373
5373
|
return (jsxs$1(ColorRadioGroup$1, __assign$1({ value: selectedColor, onChange: onChangeHandler }, { children: [jsx$1(ColorRadioGroup$1.Label, { label: label, values: valueLabels }, void 0), jsx$1(ColorRadioGroup$1.OptionsContainer, { children: renderOptions(selectedColor, options) }, void 0)] }), void 0));
|
|
5374
5374
|
};
|
|
5375
5375
|
|
|
5376
|
+
/**
|
|
5377
|
+
* @returns number formatted with "," and 2 decimals as string
|
|
5378
|
+
*/
|
|
5379
|
+
var decimalFormat = function (number) {
|
|
5380
|
+
return number.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
|
|
5381
|
+
};
|
|
5382
|
+
|
|
5383
|
+
var isEmpty = function (value) {
|
|
5384
|
+
return value.length === 0;
|
|
5385
|
+
};
|
|
5386
|
+
var isEmail = function (value) {
|
|
5387
|
+
return /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(value);
|
|
5388
|
+
};
|
|
5389
|
+
var isNumber$1 = function (value) {
|
|
5390
|
+
return /^[0-9]*$/.test(value);
|
|
5391
|
+
};
|
|
5392
|
+
var isPhoneNumber = function (value) {
|
|
5393
|
+
return /^\d{10}$/.test(value);
|
|
5394
|
+
};
|
|
5395
|
+
var isValidDate = function (value) {
|
|
5396
|
+
return /^\d{4}-\d{2}-\d{2}$/.test(value);
|
|
5397
|
+
};
|
|
5398
|
+
|
|
5399
|
+
var mouseClickEvents = ['mousedown', 'click', 'mouseup'];
|
|
5400
|
+
var simulateMouseClick = function (element) {
|
|
5401
|
+
mouseClickEvents.forEach(function (mouseEventType) {
|
|
5402
|
+
return element.dispatchEvent(new MouseEvent(mouseEventType, {
|
|
5403
|
+
view: window,
|
|
5404
|
+
bubbles: true,
|
|
5405
|
+
cancelable: true,
|
|
5406
|
+
buttons: 1,
|
|
5407
|
+
}));
|
|
5408
|
+
});
|
|
5409
|
+
};
|
|
5410
|
+
|
|
5411
|
+
var sliceString = function (str, maxLength) {
|
|
5412
|
+
return str.length > maxLength ? "".concat(str.slice(0, maxLength), "...") : str;
|
|
5413
|
+
};
|
|
5414
|
+
|
|
5415
|
+
var formatPrice = function (value, _a) {
|
|
5416
|
+
var _b;
|
|
5417
|
+
var _c = _a === void 0 ? {} : _a, _d = _c.locale, locale = _d === void 0 ? 'en-US' : _d, _e = _c.currency, currency = _e === void 0 ? 'USD' : _e;
|
|
5418
|
+
var _f = value.toFixed(3).split('.'), integer = _f[0], fraction = _f[1];
|
|
5419
|
+
// this prevents `Intl.NumberFormat` from rounding the number
|
|
5420
|
+
var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, 2)) !== null && _b !== void 0 ? _b : 0));
|
|
5421
|
+
return new Intl.NumberFormat(locale, {
|
|
5422
|
+
style: 'currency',
|
|
5423
|
+
currency: currency,
|
|
5424
|
+
maximumFractionDigits: 3,
|
|
5425
|
+
}).format(valueToFormat);
|
|
5426
|
+
};
|
|
5427
|
+
|
|
5428
|
+
var getSrcSet = function (imgLink) {
|
|
5429
|
+
var breakpoints = [];
|
|
5430
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
5431
|
+
breakpoints[_i - 1] = arguments[_i];
|
|
5432
|
+
}
|
|
5433
|
+
return breakpoints
|
|
5434
|
+
.reduce(function (prev, curr) { return "".concat(prev, " ").concat(imgLink, " ").concat(curr, "w,"); }, '')
|
|
5435
|
+
.slice(0, -1)
|
|
5436
|
+
.trimStart();
|
|
5437
|
+
};
|
|
5438
|
+
|
|
5439
|
+
/* eslint-disable no-param-reassign */
|
|
5440
|
+
var index$2 = function (breakpoints) {
|
|
5441
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
5442
|
+
literal = _ref.literal,
|
|
5443
|
+
overlap = _ref.overlap;
|
|
5444
|
+
|
|
5445
|
+
var mq = literal ? breakpoints : ['&'].concat(breakpoints);
|
|
5446
|
+
|
|
5447
|
+
function flatten(obj) {
|
|
5448
|
+
if (typeof obj !== 'object' || obj == null) {
|
|
5449
|
+
return [];
|
|
5450
|
+
}
|
|
5451
|
+
|
|
5452
|
+
if (Array.isArray(obj)) {
|
|
5453
|
+
return obj.map(flatten);
|
|
5454
|
+
}
|
|
5455
|
+
|
|
5456
|
+
var slots = {};
|
|
5457
|
+
var objects = {};
|
|
5458
|
+
var props = {};
|
|
5459
|
+
Object.keys(obj).forEach(function (key) {
|
|
5460
|
+
// Check if value is an array, but skip if it looks like a selector.
|
|
5461
|
+
// key.indexOf('&') === 0
|
|
5462
|
+
|
|
5463
|
+
var item = obj[key];
|
|
5464
|
+
if (!Array.isArray(item) && literal) item = [item];
|
|
5465
|
+
|
|
5466
|
+
if ((literal || Array.isArray(item)) && key.charCodeAt(0) !== 38) {
|
|
5467
|
+
var prior = void 0;
|
|
5468
|
+
item.forEach(function (v, index) {
|
|
5469
|
+
// Optimize by removing duplicated media query entries
|
|
5470
|
+
// when they are explicitly known to overlap.
|
|
5471
|
+
if (overlap && prior === v) {
|
|
5472
|
+
return;
|
|
5473
|
+
}
|
|
5474
|
+
|
|
5475
|
+
if (v == null) {
|
|
5476
|
+
// Do not create entries for undefined values as this will
|
|
5477
|
+
// generate empty media media quries
|
|
5478
|
+
return;
|
|
5479
|
+
}
|
|
5480
|
+
|
|
5481
|
+
prior = v;
|
|
5482
|
+
|
|
5483
|
+
if (index === 0 && !literal) {
|
|
5484
|
+
props[key] = v;
|
|
5485
|
+
} else if (slots[mq[index]] === undefined) {
|
|
5486
|
+
var _slots$mq$index;
|
|
5487
|
+
|
|
5488
|
+
slots[mq[index]] = (_slots$mq$index = {}, _slots$mq$index[key] = v, _slots$mq$index);
|
|
5489
|
+
} else {
|
|
5490
|
+
slots[mq[index]][key] = v;
|
|
5491
|
+
}
|
|
5492
|
+
});
|
|
5493
|
+
} else if (typeof item === 'object') {
|
|
5494
|
+
objects[key] = flatten(item);
|
|
5495
|
+
} else {
|
|
5496
|
+
props[key] = item;
|
|
5497
|
+
}
|
|
5498
|
+
});
|
|
5499
|
+
|
|
5500
|
+
// Ensure that all slots and then child objects are pushed to the end
|
|
5501
|
+
mq.forEach(function (el) {
|
|
5502
|
+
if (slots[el]) {
|
|
5503
|
+
props[el] = slots[el];
|
|
5504
|
+
}
|
|
5505
|
+
});
|
|
5506
|
+
Object.assign(props, objects);
|
|
5507
|
+
return props;
|
|
5508
|
+
}
|
|
5509
|
+
|
|
5510
|
+
return function () {
|
|
5511
|
+
for (var _len = arguments.length, values = Array(_len), _key = 0; _key < _len; _key++) {
|
|
5512
|
+
values[_key] = arguments[_key];
|
|
5513
|
+
}
|
|
5514
|
+
|
|
5515
|
+
return values.map(flatten);
|
|
5516
|
+
};
|
|
5517
|
+
};
|
|
5518
|
+
|
|
5519
|
+
var mediaQueries = index$2(["@media(max-width: 900px)", "@media(min-width: 900px)"], {
|
|
5520
|
+
literal: true,
|
|
5521
|
+
});
|
|
5522
|
+
|
|
5376
5523
|
var Image$2 = newStyled.img(templateObject_1$1e || (templateObject_1$1e = __makeTemplateObject(["\n ", "\n\n width: 4.063rem;\n height: 5.375rem;\n box-sizing: border-box;\n cursor: pointer;\n border: ", ";\n"], ["\n ", "\n\n width: 4.063rem;\n height: 5.375rem;\n box-sizing: border-box;\n cursor: pointer;\n border: ", ";\n"])), function (_a) {
|
|
5377
5524
|
var borderRadiusVariant = _a.borderRadiusVariant;
|
|
5378
5525
|
return borderRadiusVariant &&
|
|
@@ -5386,7 +5533,7 @@ var Image$2 = newStyled.img(templateObject_1$1e || (templateObject_1$1e = __make
|
|
|
5386
5533
|
var ImageSmallPreview = function (_a) {
|
|
5387
5534
|
var imageUrl = _a.imageUrl, alt = _a.alt, _b = _a.selected, selected = _b === void 0 ? false : _b, className = _a.className, borderRadiusVariant = _a.borderRadiusVariant, previewImgBorderColor = _a.previewImgBorderColor;
|
|
5388
5535
|
var theme = useTheme();
|
|
5389
|
-
return (jsx$1(Image$2, { className: className, src: imageUrl, alt: alt, selected: selected, theme: theme, borderRadiusVariant: borderRadiusVariant, previewImgBorderColor: previewImgBorderColor }, void 0));
|
|
5536
|
+
return (jsx$1(Image$2, { className: className, src: imageUrl, srcSet: getSrcSet(imageUrl, 180, 360), alt: alt, selected: selected, theme: theme, borderRadiusVariant: borderRadiusVariant, previewImgBorderColor: previewImgBorderColor }, void 0));
|
|
5390
5537
|
};
|
|
5391
5538
|
var templateObject_1$1e;
|
|
5392
5539
|
|
|
@@ -8435,7 +8582,7 @@ var ResizeObserver = /** @class */ (function () {
|
|
|
8435
8582
|
};
|
|
8436
8583
|
});
|
|
8437
8584
|
|
|
8438
|
-
var index$
|
|
8585
|
+
var index$1 = (function () {
|
|
8439
8586
|
// Export existing implementation if available.
|
|
8440
8587
|
if (typeof global$1.ResizeObserver !== 'undefined') {
|
|
8441
8588
|
return global$1.ResizeObserver;
|
|
@@ -8506,7 +8653,7 @@ var InnerSlider = /*#__PURE__*/function (_React$Component) {
|
|
|
8506
8653
|
_this.lazyLoadTimer = setInterval(_this.progressiveLazyLoad, 1000);
|
|
8507
8654
|
}
|
|
8508
8655
|
|
|
8509
|
-
_this.ro = new index$
|
|
8656
|
+
_this.ro = new index$1(function () {
|
|
8510
8657
|
if (_this.state.animating) {
|
|
8511
8658
|
_this.onWindowResized(false); // don't set trackStyle hence don't break animation
|
|
8512
8659
|
|
|
@@ -12090,153 +12237,6 @@ var InputLabel = function (_a) {
|
|
|
12090
12237
|
};
|
|
12091
12238
|
var templateObject_1$_, templateObject_2$H;
|
|
12092
12239
|
|
|
12093
|
-
/**
|
|
12094
|
-
* @returns number formatted with "," and 2 decimals as string
|
|
12095
|
-
*/
|
|
12096
|
-
var decimalFormat = function (number) {
|
|
12097
|
-
return number.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
|
|
12098
|
-
};
|
|
12099
|
-
|
|
12100
|
-
var isEmpty = function (value) {
|
|
12101
|
-
return value.length === 0;
|
|
12102
|
-
};
|
|
12103
|
-
var isEmail = function (value) {
|
|
12104
|
-
return /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(value);
|
|
12105
|
-
};
|
|
12106
|
-
var isNumber$1 = function (value) {
|
|
12107
|
-
return /^[0-9]*$/.test(value);
|
|
12108
|
-
};
|
|
12109
|
-
var isPhoneNumber = function (value) {
|
|
12110
|
-
return /^\d{10}$/.test(value);
|
|
12111
|
-
};
|
|
12112
|
-
var isValidDate = function (value) {
|
|
12113
|
-
return /^\d{4}-\d{2}-\d{2}$/.test(value);
|
|
12114
|
-
};
|
|
12115
|
-
|
|
12116
|
-
var mouseClickEvents = ['mousedown', 'click', 'mouseup'];
|
|
12117
|
-
var simulateMouseClick = function (element) {
|
|
12118
|
-
mouseClickEvents.forEach(function (mouseEventType) {
|
|
12119
|
-
return element.dispatchEvent(new MouseEvent(mouseEventType, {
|
|
12120
|
-
view: window,
|
|
12121
|
-
bubbles: true,
|
|
12122
|
-
cancelable: true,
|
|
12123
|
-
buttons: 1,
|
|
12124
|
-
}));
|
|
12125
|
-
});
|
|
12126
|
-
};
|
|
12127
|
-
|
|
12128
|
-
var sliceString = function (str, maxLength) {
|
|
12129
|
-
return str.length > maxLength ? "".concat(str.slice(0, maxLength), "...") : str;
|
|
12130
|
-
};
|
|
12131
|
-
|
|
12132
|
-
var formatPrice = function (value, _a) {
|
|
12133
|
-
var _b;
|
|
12134
|
-
var _c = _a === void 0 ? {} : _a, _d = _c.locale, locale = _d === void 0 ? 'en-US' : _d, _e = _c.currency, currency = _e === void 0 ? 'USD' : _e;
|
|
12135
|
-
var _f = value.toFixed(3).split('.'), integer = _f[0], fraction = _f[1];
|
|
12136
|
-
// this prevents `Intl.NumberFormat` from rounding the number
|
|
12137
|
-
var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, 2)) !== null && _b !== void 0 ? _b : 0));
|
|
12138
|
-
return new Intl.NumberFormat(locale, {
|
|
12139
|
-
style: 'currency',
|
|
12140
|
-
currency: currency,
|
|
12141
|
-
maximumFractionDigits: 3,
|
|
12142
|
-
}).format(valueToFormat);
|
|
12143
|
-
};
|
|
12144
|
-
|
|
12145
|
-
var getSrcSet = function (imgLink) {
|
|
12146
|
-
var breakpoints = [];
|
|
12147
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
12148
|
-
breakpoints[_i - 1] = arguments[_i];
|
|
12149
|
-
}
|
|
12150
|
-
return breakpoints
|
|
12151
|
-
.reduce(function (prev, curr) { return "".concat(prev, " ").concat(imgLink, " ").concat(curr, "w,"); }, '')
|
|
12152
|
-
.slice(0, -1)
|
|
12153
|
-
.trimStart();
|
|
12154
|
-
};
|
|
12155
|
-
|
|
12156
|
-
/* eslint-disable no-param-reassign */
|
|
12157
|
-
var index$1 = function (breakpoints) {
|
|
12158
|
-
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
12159
|
-
literal = _ref.literal,
|
|
12160
|
-
overlap = _ref.overlap;
|
|
12161
|
-
|
|
12162
|
-
var mq = literal ? breakpoints : ['&'].concat(breakpoints);
|
|
12163
|
-
|
|
12164
|
-
function flatten(obj) {
|
|
12165
|
-
if (typeof obj !== 'object' || obj == null) {
|
|
12166
|
-
return [];
|
|
12167
|
-
}
|
|
12168
|
-
|
|
12169
|
-
if (Array.isArray(obj)) {
|
|
12170
|
-
return obj.map(flatten);
|
|
12171
|
-
}
|
|
12172
|
-
|
|
12173
|
-
var slots = {};
|
|
12174
|
-
var objects = {};
|
|
12175
|
-
var props = {};
|
|
12176
|
-
Object.keys(obj).forEach(function (key) {
|
|
12177
|
-
// Check if value is an array, but skip if it looks like a selector.
|
|
12178
|
-
// key.indexOf('&') === 0
|
|
12179
|
-
|
|
12180
|
-
var item = obj[key];
|
|
12181
|
-
if (!Array.isArray(item) && literal) item = [item];
|
|
12182
|
-
|
|
12183
|
-
if ((literal || Array.isArray(item)) && key.charCodeAt(0) !== 38) {
|
|
12184
|
-
var prior = void 0;
|
|
12185
|
-
item.forEach(function (v, index) {
|
|
12186
|
-
// Optimize by removing duplicated media query entries
|
|
12187
|
-
// when they are explicitly known to overlap.
|
|
12188
|
-
if (overlap && prior === v) {
|
|
12189
|
-
return;
|
|
12190
|
-
}
|
|
12191
|
-
|
|
12192
|
-
if (v == null) {
|
|
12193
|
-
// Do not create entries for undefined values as this will
|
|
12194
|
-
// generate empty media media quries
|
|
12195
|
-
return;
|
|
12196
|
-
}
|
|
12197
|
-
|
|
12198
|
-
prior = v;
|
|
12199
|
-
|
|
12200
|
-
if (index === 0 && !literal) {
|
|
12201
|
-
props[key] = v;
|
|
12202
|
-
} else if (slots[mq[index]] === undefined) {
|
|
12203
|
-
var _slots$mq$index;
|
|
12204
|
-
|
|
12205
|
-
slots[mq[index]] = (_slots$mq$index = {}, _slots$mq$index[key] = v, _slots$mq$index);
|
|
12206
|
-
} else {
|
|
12207
|
-
slots[mq[index]][key] = v;
|
|
12208
|
-
}
|
|
12209
|
-
});
|
|
12210
|
-
} else if (typeof item === 'object') {
|
|
12211
|
-
objects[key] = flatten(item);
|
|
12212
|
-
} else {
|
|
12213
|
-
props[key] = item;
|
|
12214
|
-
}
|
|
12215
|
-
});
|
|
12216
|
-
|
|
12217
|
-
// Ensure that all slots and then child objects are pushed to the end
|
|
12218
|
-
mq.forEach(function (el) {
|
|
12219
|
-
if (slots[el]) {
|
|
12220
|
-
props[el] = slots[el];
|
|
12221
|
-
}
|
|
12222
|
-
});
|
|
12223
|
-
Object.assign(props, objects);
|
|
12224
|
-
return props;
|
|
12225
|
-
}
|
|
12226
|
-
|
|
12227
|
-
return function () {
|
|
12228
|
-
for (var _len = arguments.length, values = Array(_len), _key = 0; _key < _len; _key++) {
|
|
12229
|
-
values[_key] = arguments[_key];
|
|
12230
|
-
}
|
|
12231
|
-
|
|
12232
|
-
return values.map(flatten);
|
|
12233
|
-
};
|
|
12234
|
-
};
|
|
12235
|
-
|
|
12236
|
-
var mediaQueries = index$1(["@media(max-width: 900px)", "@media(min-width: 900px)"], {
|
|
12237
|
-
literal: true,
|
|
12238
|
-
});
|
|
12239
|
-
|
|
12240
12240
|
var containerByStatus = function (theme, status) {
|
|
12241
12241
|
if (status === InputValidationType.Valid)
|
|
12242
12242
|
return theme.colors.shades[700].color;
|