@k-int/stripes-kint-components 4.4.3 → 4.5.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/CHANGELOG.md +8 -5
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +2 -2
- package/es/lib/QueryTypedown/QueryTypedown.js +8 -1
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +5 -2
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +5 -1
- package/es/lib/hooks/useHelperApp.js +11 -4
- package/junit.xml +139 -139
- package/package.json +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +128 -50
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +15 -15
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +5 -5
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +4 -4
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/CycleButton.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +13 -4
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +12 -3
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +38 -23
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +15 -15
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +4 -4
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/IconSelect.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +23 -8
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +11 -2
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +20 -5
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/RichSelect.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +12 -3
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +10 -10
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +30 -18
- package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKeyStore.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useSASQQueryMeta.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/index.html +43 -43
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/index.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useAppSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useSettingSection.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useSettings.js.html +9 -3
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/parseKiwtQueryGroups.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +45 -3
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/validators/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/validators/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/validators/validators.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov.info +388 -342
- package/src/lib/CustomProperties/View/CustomPropertyCard.js +3 -3
- package/src/lib/QueryTypedown/QueryTypedown.js +8 -3
- package/src/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +3 -0
- package/src/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +5 -0
- package/src/lib/hooks/useHelperApp.js +14 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
## 4.
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
## 4.4.2 2023-02-15
|
|
1
|
+
## 4.5.0 2023-03-16
|
|
2
|
+
* ERM-2879 FOLIO > Agreement App > Supplementary properties is showing the value of 'Visibility' as 'Public' regardless of selection
|
|
5
3
|
* selectorSafe -- Ensured better compatibility with other scripts now it's used in a user facing place.
|
|
6
|
-
|
|
4
|
+
* useHelperApp: No longer redraws when keys of passed helper objects have not changed
|
|
5
|
+
* Export all hooks by default, both regular hooks and settings specific hooks
|
|
6
|
+
* QueryTypedown
|
|
7
|
+
* Added 'userQuery' state and a useEffect for the 'callPath' so that it is correctly updated upon a user input change
|
|
8
|
+
* ResponsiveButtonGroup
|
|
9
|
+
* Now fires an event 'responsive-button-group-loaded' or 'responsive-button-group-loaded-<id>' depending on whether or not an id has been passed to the ResponsiveButtonGroup
|
|
7
10
|
## 4.4.1 2023-02-08
|
|
8
11
|
* CustomPropertiesSettings
|
|
9
12
|
* Added displayConditions which act in the same way as below, allowing for programatic turning on/off of access to certain actions
|
|
@@ -113,8 +113,8 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
|
|
|
113
113
|
overrideValue: labelOverrides.visibility
|
|
114
114
|
}),
|
|
115
115
|
children: kintIntl.formatKintMessage({
|
|
116
|
-
id: 'customProperties.internalFalse',
|
|
117
|
-
overrideValue: labelOverrides.internalFalse
|
|
116
|
+
id: internalFalse ? 'customProperties.internalFalse' : 'customProperties.internalTrue',
|
|
117
|
+
overrideValue: internalFalse ? labelOverrides.internalFalse : labelOverrides.internalTrue
|
|
118
118
|
})
|
|
119
119
|
})
|
|
120
120
|
}), internalFalse && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
@@ -40,9 +40,16 @@ var QueryTypedown = function QueryTypedown(_ref) {
|
|
|
40
40
|
callPath = _useState2[0],
|
|
41
41
|
setCallPath = _useState2[1];
|
|
42
42
|
var data = dataFormatter((0, _typedownHooks.useTypedownData)(path, callPath));
|
|
43
|
+
var _useState3 = (0, _react.useState)(''),
|
|
44
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
45
|
+
userQuery = _useState4[0],
|
|
46
|
+
setUserQuery = _useState4[1];
|
|
43
47
|
var onType = function onType(e) {
|
|
44
|
-
|
|
48
|
+
setUserQuery(e.target.value);
|
|
45
49
|
};
|
|
50
|
+
(0, _react.useEffect)(function () {
|
|
51
|
+
setCallPath(pathMutator(userQuery, path));
|
|
52
|
+
}, [path, pathMutator, userQuery]);
|
|
46
53
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typedown.default, _objectSpread(_objectSpread({}, rest), {}, {
|
|
47
54
|
dataOptions: data,
|
|
48
55
|
onType: onType
|
|
@@ -12,7 +12,7 @@ var _components = require("@folio/stripes/components");
|
|
|
12
12
|
var _ResponsiveButtonGroup = _interopRequireDefault(require("../../../styles/ResponsiveButtonGroup.css"));
|
|
13
13
|
var _useResponsiveButtonGroupSizing = _interopRequireDefault(require("./useResponsiveButtonGroupSizing"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
var _excluded = ["children", "className", "dropdownTriggerProps", "fullWidth", "marginBottom0", "selectedIndex", "tagName"];
|
|
15
|
+
var _excluded = ["children", "className", "dropdownTriggerProps", "fullWidth", "id", "marginBottom0", "selectedIndex", "tagName"];
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
18
18
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -32,6 +32,7 @@ var propTypes = {
|
|
|
32
32
|
className: _propTypes.default.string,
|
|
33
33
|
dropdownTriggerProps: _propTypes.default.object,
|
|
34
34
|
fullWidth: _propTypes.default.bool,
|
|
35
|
+
id: _propTypes.default.string,
|
|
35
36
|
marginBottom0: _propTypes.default.bool,
|
|
36
37
|
selectedIndex: _propTypes.default.number,
|
|
37
38
|
tagName: _propTypes.default.string
|
|
@@ -61,13 +62,15 @@ var ResponsiveButtonGroup = function ResponsiveButtonGroup(props) {
|
|
|
61
62
|
dropdownTriggerProps = _props$dropdownTrigge === void 0 ? {} : _props$dropdownTrigge,
|
|
62
63
|
_props$fullWidth = props.fullWidth,
|
|
63
64
|
fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth,
|
|
65
|
+
id = props.id,
|
|
64
66
|
marginBottom0 = props.marginBottom0,
|
|
65
67
|
selectedIndex = props.selectedIndex,
|
|
66
68
|
_props$tagName = props.tagName,
|
|
67
69
|
Tag = _props$tagName === void 0 ? 'div' : _props$tagName,
|
|
68
70
|
rest = _objectWithoutProperties(props, _excluded);
|
|
69
71
|
var _useResponsiveButtonG = (0, _useResponsiveButtonGroupSizing.default)({
|
|
70
|
-
buttons: childButtons
|
|
72
|
+
buttons: childButtons,
|
|
73
|
+
id: id
|
|
71
74
|
}),
|
|
72
75
|
buttons = _useResponsiveButtonG.buttons,
|
|
73
76
|
cachedSizeArray = _useResponsiveButtonG.cachedSizeArray,
|
|
@@ -16,8 +16,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
16
16
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
18
|
var useResponsiveButtonGroupSizing = function useResponsiveButtonGroupSizing(_ref) {
|
|
19
|
-
var
|
|
19
|
+
var id = _ref.id,
|
|
20
|
+
_ref$buttons = _ref.buttons,
|
|
20
21
|
buttons = _ref$buttons === void 0 ? [] : _ref$buttons;
|
|
22
|
+
var eventString = 'responsive-button-group-loaded' + (id ? "-".concat(id) : '');
|
|
23
|
+
var loadedEvent = new Event(eventString);
|
|
21
24
|
var isMounted = (0, _react.useRef)(false);
|
|
22
25
|
(0, _react.useEffect)(function () {
|
|
23
26
|
isMounted.current = true;
|
|
@@ -63,6 +66,7 @@ var useResponsiveButtonGroupSizing = function useResponsiveButtonGroupSizing(_re
|
|
|
63
66
|
if (!(cachedSizeArray !== null && cachedSizeArray !== void 0 && cachedSizeArray.length) && sizeArray !== null && sizeArray !== void 0 && sizeArray.length) {
|
|
64
67
|
setCachedSizeArray(sizeArray);
|
|
65
68
|
setReady(true);
|
|
69
|
+
document.dispatchEvent(loadedEvent);
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
}, 150), [cachedSizeArray, sizeArray]);
|
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _reactRouterDom = require("react-router-dom");
|
|
10
10
|
var _queryString = _interopRequireDefault(require("query-string"));
|
|
11
|
+
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -23,6 +24,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
23
24
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
24
25
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
25
26
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
+
var helperObject = {};
|
|
26
28
|
var useHelperApp = function useHelperApp(helpers) {
|
|
27
29
|
var history = (0, _reactRouterDom.useHistory)();
|
|
28
30
|
var location = (0, _reactRouterDom.useLocation)();
|
|
@@ -38,6 +40,10 @@ var useHelperApp = function useHelperApp(helpers) {
|
|
|
38
40
|
return currentHelper === hlp;
|
|
39
41
|
};
|
|
40
42
|
(0, _react.useEffect)(function () {
|
|
43
|
+
// Keep object outside of hook to avoid redraw, oncly change when keys change
|
|
44
|
+
if (!(0, _isEqual.default)(Object.keys(helperObject), Object.keys(helpers))) {
|
|
45
|
+
helperObject = helpers;
|
|
46
|
+
}
|
|
41
47
|
if (currentHelper !== (query === null || query === void 0 ? void 0 : query.helper)) {
|
|
42
48
|
var newQuery = _objectSpread(_objectSpread({}, query), {}, {
|
|
43
49
|
helper: currentHelper
|
|
@@ -47,14 +53,14 @@ var useHelperApp = function useHelperApp(helpers) {
|
|
|
47
53
|
search: "?".concat(_queryString.default.stringify(newQuery))
|
|
48
54
|
});
|
|
49
55
|
}
|
|
50
|
-
}, [currentHelper, history, location, query]);
|
|
56
|
+
}, [currentHelper, helpers, history, location, query]);
|
|
51
57
|
|
|
52
58
|
// Set the HelperComponent
|
|
53
59
|
var HelperComponent = (0, _react.useMemo)(function () {
|
|
54
60
|
return function (props) {
|
|
55
61
|
if (!(query !== null && query !== void 0 && query.helper)) return null;
|
|
56
62
|
var Component = null;
|
|
57
|
-
Component =
|
|
63
|
+
Component = helperObject[query === null || query === void 0 ? void 0 : query.helper];
|
|
58
64
|
if (!Component) return null;
|
|
59
65
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread({
|
|
60
66
|
onToggle: function onToggle() {
|
|
@@ -62,16 +68,17 @@ var useHelperApp = function useHelperApp(helpers) {
|
|
|
62
68
|
}
|
|
63
69
|
}, props));
|
|
64
70
|
};
|
|
65
|
-
}, [handleToggleHelper, query.helper
|
|
71
|
+
}, [handleToggleHelper, query.helper]);
|
|
66
72
|
|
|
67
73
|
// Set up the helperToggleFunctions
|
|
68
74
|
var helperToggleFunctions = {};
|
|
69
|
-
Object.keys(
|
|
75
|
+
Object.keys(helperObject).forEach(function (h) {
|
|
70
76
|
helperToggleFunctions[h] = function () {
|
|
71
77
|
return handleToggleHelper(h);
|
|
72
78
|
};
|
|
73
79
|
});
|
|
74
80
|
return {
|
|
81
|
+
currentHelper: currentHelper,
|
|
75
82
|
HelperComponent: HelperComponent,
|
|
76
83
|
helperToggleFunctions: helperToggleFunctions,
|
|
77
84
|
isOpen: isOpen
|