@entur-partner/common 11.1.2 → 11.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common.cjs.development.js +21 -51
- package/dist/common.cjs.development.js.map +1 -1
- package/dist/common.cjs.production.min.js +1 -1
- package/dist/common.cjs.production.min.js.map +1 -1
- package/dist/common.esm.js +22 -52
- package/dist/common.esm.js.map +1 -1
- package/dist/styles.css +82 -82
- package/package.json +3 -3
package/dist/common.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { localeDate, localeDateTime, isDate, isDateString, splitUrlPath, isString, isFunction, assertIsDefined, hasAllPermissions, hasOneOfPermissions } from '@entur-partner/util';
|
|
3
3
|
import cx from 'classnames';
|
|
4
|
-
import { Children, Component, useState,
|
|
4
|
+
import { Children, Component, useState, useEffect, useRef } from 'react';
|
|
5
5
|
import { BreadcrumbItem, BreadcrumbNavigation, Pagination } from '@entur/menu';
|
|
6
6
|
import { Link as Link$1, useInRouterContext, useBlocker } from 'react-router-dom';
|
|
7
7
|
import { ButtonGroup, SecondaryButton, PrimaryButton, Button } from '@entur/button';
|
|
@@ -694,16 +694,12 @@ var MultiLanguageInput = function MultiLanguageInput(_ref) {
|
|
|
694
694
|
};
|
|
695
695
|
|
|
696
696
|
var _excluded$4 = ["label", "organisations", "onChange", "selectedOrganisationId"];
|
|
697
|
-
function isInShadowDom(el) {
|
|
698
|
-
return (el == null ? void 0 : el.getRootNode()) instanceof ShadowRoot;
|
|
699
|
-
}
|
|
700
697
|
var OrganisationDropDown = function OrganisationDropDown(_ref) {
|
|
701
698
|
var label = _ref.label,
|
|
702
699
|
organisations = _ref.organisations,
|
|
703
700
|
handleChange = _ref.onChange,
|
|
704
701
|
selectedOrganisationId = _ref.selectedOrganisationId,
|
|
705
702
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
706
|
-
var wrapperRef = useRef(null);
|
|
707
703
|
var _useState = useState(),
|
|
708
704
|
selectedOrganisation = _useState[0],
|
|
709
705
|
setSelectedOrganisation = _useState[1];
|
|
@@ -712,53 +708,27 @@ var OrganisationDropDown = function OrganisationDropDown(_ref) {
|
|
|
712
708
|
return org.organisationId === selectedOrganisationId;
|
|
713
709
|
}));
|
|
714
710
|
}, [selectedOrganisationId, organisations]);
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
ref: wrapperRef,
|
|
737
|
-
onMouseDown: handleMouseDown,
|
|
738
|
-
onMouseUp: handleMouseUp,
|
|
739
|
-
children: jsx(SearchableDropdown, _extends({
|
|
740
|
-
label: label,
|
|
741
|
-
items: [].concat(organisations.sort(function (a, b) {
|
|
742
|
-
return a.tradingName.localeCompare(b.tradingName, "nb");
|
|
743
|
-
}).map(function (organisation) {
|
|
744
|
-
return {
|
|
745
|
-
value: organisation.organisationId,
|
|
746
|
-
label: organisation.tradingName
|
|
747
|
-
};
|
|
748
|
-
})),
|
|
749
|
-
selectedItem: selectedOrganisation ? {
|
|
750
|
-
value: selectedOrganisation.organisationId,
|
|
751
|
-
label: selectedOrganisation.tradingName
|
|
752
|
-
} : null,
|
|
753
|
-
onChange: function onChange(selectedValue) {
|
|
754
|
-
if (selectedValue) {
|
|
755
|
-
handleChange(selectedValue.value);
|
|
756
|
-
}
|
|
757
|
-
},
|
|
758
|
-
clearable: false
|
|
759
|
-
}, rest))
|
|
760
|
-
})
|
|
761
|
-
);
|
|
711
|
+
return jsx(SearchableDropdown, _extends({
|
|
712
|
+
label: label,
|
|
713
|
+
items: [].concat(organisations.sort(function (a, b) {
|
|
714
|
+
return a.tradingName.localeCompare(b.tradingName, "nb");
|
|
715
|
+
}).map(function (organisation) {
|
|
716
|
+
return {
|
|
717
|
+
value: organisation.organisationId,
|
|
718
|
+
label: organisation.tradingName
|
|
719
|
+
};
|
|
720
|
+
})),
|
|
721
|
+
selectedItem: selectedOrganisation ? {
|
|
722
|
+
value: selectedOrganisation.organisationId,
|
|
723
|
+
label: selectedOrganisation.tradingName
|
|
724
|
+
} : null,
|
|
725
|
+
onChange: function onChange(selectedValue) {
|
|
726
|
+
if (selectedValue) {
|
|
727
|
+
handleChange(selectedValue.value);
|
|
728
|
+
}
|
|
729
|
+
},
|
|
730
|
+
clearable: false
|
|
731
|
+
}, rest));
|
|
762
732
|
};
|
|
763
733
|
|
|
764
734
|
/**
|