@citygross/components 0.16.5 → 0.16.7
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.
|
@@ -519,6 +519,17 @@ var focusTrap = function (_a) {
|
|
|
519
519
|
};
|
|
520
520
|
};
|
|
521
521
|
|
|
522
|
+
var selectKeyboardEventHandler = function (_a) {
|
|
523
|
+
var event = _a.event, isDisabled = _a.isDisabled, onClick = _a.onClick, value = _a.value, onKeyDown = _a.onKeyDown;
|
|
524
|
+
if ((event.key === 'Enter' || event.key === ' ') && !isDisabled) {
|
|
525
|
+
event.preventDefault();
|
|
526
|
+
onClick(value);
|
|
527
|
+
}
|
|
528
|
+
if (onKeyDown) {
|
|
529
|
+
onKeyDown(event);
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
|
|
522
533
|
var toggleInert = function (_a) {
|
|
523
534
|
var elements = _a.elements, isInert = _a.isInert;
|
|
524
535
|
var snapshots = elements
|
|
@@ -18846,9 +18857,9 @@ var Locale;
|
|
|
18846
18857
|
})(Locale || (Locale = {}));
|
|
18847
18858
|
moment.locale(Locale.swedish);
|
|
18848
18859
|
|
|
18849
|
-
var formatDateToLocale = function (date, withYear) {
|
|
18860
|
+
var formatDateToLocale = function (date, withYear, withDay) {
|
|
18850
18861
|
var _a, _b;
|
|
18851
|
-
return (_b = (_a = moment(new Date(date))) === null || _a === void 0 ? void 0 : _a.format("dddd D MMMM ".concat(withYear ? 'YYYY' : ''))) === null || _b === void 0 ? void 0 : _b.toLocaleLowerCase();
|
|
18862
|
+
return (_b = (_a = moment(new Date(date))) === null || _a === void 0 ? void 0 : _a.format("".concat(withDay ? 'dddd ' : '', "D MMMM ").concat(withYear ? 'YYYY' : ''))) === null || _b === void 0 ? void 0 : _b.toLocaleLowerCase();
|
|
18852
18863
|
};
|
|
18853
18864
|
|
|
18854
18865
|
var sv = {exports: {}};
|
|
@@ -18968,6 +18979,7 @@ index.__exports.makeCateringPortionsString = makeCateringPortionsString;
|
|
|
18968
18979
|
index.__exports.moment = moment;
|
|
18969
18980
|
index.__exports.nameRegex = nameRegex;
|
|
18970
18981
|
index.__exports.phoneRegex = phoneRegex;
|
|
18982
|
+
index.__exports.selectKeyboardEventHandler = selectKeyboardEventHandler;
|
|
18971
18983
|
index.__exports.toggleInert = toggleInert;
|
|
18972
18984
|
index.__exports.useDetectDevice = useDetectDevice;
|
|
18973
18985
|
index.__exports.useFixedModalScroll = useFixedModalScroll;
|