@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.
|
@@ -512,6 +512,17 @@ var focusTrap = function (_a) {
|
|
|
512
512
|
};
|
|
513
513
|
};
|
|
514
514
|
|
|
515
|
+
var selectKeyboardEventHandler = function (_a) {
|
|
516
|
+
var event = _a.event, isDisabled = _a.isDisabled, onClick = _a.onClick, value = _a.value, onKeyDown = _a.onKeyDown;
|
|
517
|
+
if ((event.key === 'Enter' || event.key === ' ') && !isDisabled) {
|
|
518
|
+
event.preventDefault();
|
|
519
|
+
onClick(value);
|
|
520
|
+
}
|
|
521
|
+
if (onKeyDown) {
|
|
522
|
+
onKeyDown(event);
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
|
|
515
526
|
var toggleInert = function (_a) {
|
|
516
527
|
var elements = _a.elements, isInert = _a.isInert;
|
|
517
528
|
var snapshots = elements
|
|
@@ -18839,9 +18850,9 @@ var Locale;
|
|
|
18839
18850
|
})(Locale || (Locale = {}));
|
|
18840
18851
|
moment.locale(Locale.swedish);
|
|
18841
18852
|
|
|
18842
|
-
var formatDateToLocale = function (date, withYear) {
|
|
18853
|
+
var formatDateToLocale = function (date, withYear, withDay) {
|
|
18843
18854
|
var _a, _b;
|
|
18844
|
-
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();
|
|
18855
|
+
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();
|
|
18845
18856
|
};
|
|
18846
18857
|
|
|
18847
18858
|
var sv = {exports: {}};
|
|
@@ -18961,6 +18972,7 @@ build.makeCateringPortionsString = makeCateringPortionsString;
|
|
|
18961
18972
|
build.moment = moment;
|
|
18962
18973
|
build.nameRegex = nameRegex;
|
|
18963
18974
|
build.phoneRegex = phoneRegex;
|
|
18975
|
+
build.selectKeyboardEventHandler = selectKeyboardEventHandler;
|
|
18964
18976
|
build.toggleInert = toggleInert;
|
|
18965
18977
|
build.useDetectDevice = useDetectDevice;
|
|
18966
18978
|
build.useFixedModalScroll = useFixedModalScroll;
|