@k-int/stripes-kint-components 5.6.1 → 5.7.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 +7 -0
- package/es/lib/ActionList/ActionListFieldArray.js +32 -37
- package/es/lib/ComboButton/ComboButton.js +5 -6
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +4 -7
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +29 -32
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +58 -58
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +2 -2
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +32 -33
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +3 -3
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +5 -10
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +18 -25
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +5 -5
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +2 -2
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +1 -1
- package/es/lib/CustomProperties/Edit/testResources.js +11 -12
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +6 -11
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +20 -28
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +1 -1
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +6 -6
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +8 -8
- package/es/lib/CustomProperties/Filter/testResources.js +1 -2
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +1 -2
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +1 -1
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +18 -26
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +7 -11
- package/es/lib/CycleButton/CycleButton.js +1 -1
- package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +26 -38
- package/es/lib/EditableRefdataList/EditableRefdataList.js +26 -33
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +1 -1
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +5 -5
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +10 -12
- package/es/lib/EditableSettingsList/SettingField/SettingField.js +4 -4
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +4 -7
- package/es/lib/IconSelect/IconSelect.js +5 -9
- package/es/lib/NoResultsMessage/NoResultsMessage.js +4 -4
- package/es/lib/RefdataButtons/RefdataButtons.js +3 -3
- package/es/lib/RefdataCategoriesSettings/RefdataCategoriesSettings.js +13 -17
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +21 -28
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +5 -6
- package/es/lib/RichSelect/RichSelect.js +14 -19
- package/es/lib/RichSelect/useSelectedOption.js +1 -2
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +14 -17
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +6 -8
- package/es/lib/SASQRoute/SASQRoute.js +2 -2
- package/es/lib/SASQViewComponent/SASQViewComponent.js +5 -9
- package/es/lib/SettingPage/SettingPagePane.js +2 -2
- package/es/lib/SettingsFormContainer/SettingsFormContainer.js +2 -2
- package/es/lib/Typedown/Typedown.js +34 -32
- package/es/lib/hooks/typedownHooks/useTypedown.js +2 -2
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +2 -2
- package/es/lib/hooks/useActionListRef.js +1 -1
- package/es/lib/hooks/useActiveElement.js +1 -1
- package/es/lib/hooks/useCustomProperties.js +2 -2
- package/es/lib/hooks/useHelperApp.js +6 -6
- package/es/lib/hooks/useIntlKeyStore.js +4 -7
- package/es/lib/hooks/useKintIntl.js +5 -11
- package/es/lib/hooks/useKiwtSASQuery.js +1 -1
- package/es/lib/hooks/useModConfigEntries.js +2 -2
- package/es/lib/hooks/useMutateCustomProperties.js +8 -8
- package/es/lib/hooks/useMutateModConfigEntry.js +2 -2
- package/es/lib/hooks/useMutateRefdataCategory.js +4 -4
- package/es/lib/hooks/useMutateRefdataValue.js +6 -6
- package/es/lib/hooks/useQIndex.js +5 -5
- package/es/lib/hooks/useRefdata.js +3 -3
- package/es/lib/hooks/useTemplates.js +4 -4
- package/es/lib/settingsHooks/useAppSettings.js +7 -11
- package/es/lib/settingsHooks/useSettingSection.js +2 -2
- package/es/lib/settingsHooks/useSettings.js +3 -3
- package/es/lib/utils/buildUrl.js +2 -3
- package/es/lib/utils/filterParsers/deparseKiwtQueryFilters.js +5 -5
- package/es/lib/utils/filterParsers/parseKiwtQueryFilters.js +2 -2
- package/es/lib/utils/filterParsers/parseKiwtQueryGroups.js +4 -5
- package/es/lib/utils/filterParsers/parseKiwtQueryString.js +1 -1
- package/es/lib/utils/generateKiwtQueryParams.js +28 -37
- package/es/lib/utils/groupCustomPropertiesByCtx.js +2 -3
- package/es/lib/utils/matchString.js +5 -7
- package/es/lib/utils/parseErrorResponse.js +2 -3
- package/es/lib/utils/selectorSafe.js +2 -3
- package/es/lib/utils/sortByLabel.js +2 -3
- package/es/lib/validators/validators.js +3 -3
- package/package.json +2 -4
- package/src/lib/Typedown/Typedown.js +12 -5
- package/styles/TypeDown.css +6 -1
|
@@ -28,6 +28,7 @@ const Typedown = ({
|
|
|
28
28
|
renderFooter = null,
|
|
29
29
|
renderListItem = null,
|
|
30
30
|
required,
|
|
31
|
+
selectedStyles, // A way to pass any styles that need to be applied globally on selection
|
|
31
32
|
uniqueIdentificationPath = 'id'
|
|
32
33
|
}) => {
|
|
33
34
|
const selectedUniqueId = get(input.value, uniqueIdentificationPath);
|
|
@@ -86,12 +87,12 @@ const Typedown = ({
|
|
|
86
87
|
}
|
|
87
88
|
} = useTypedown(input.name);
|
|
88
89
|
|
|
89
|
-
const renderItem = useCallback((option) => (
|
|
90
|
+
const renderItem = useCallback((option, optionIsSelected = false) => (
|
|
90
91
|
<div
|
|
91
92
|
className={css.listItem}
|
|
92
93
|
>
|
|
93
94
|
{renderListItem ?
|
|
94
|
-
renderListItem(option, currentlyTyped, exactMatch) :
|
|
95
|
+
renderListItem(option, currentlyTyped, exactMatch, optionIsSelected) :
|
|
95
96
|
get(option, uniqueIdentificationPath)
|
|
96
97
|
}
|
|
97
98
|
</div>
|
|
@@ -119,12 +120,15 @@ const Typedown = ({
|
|
|
119
120
|
>
|
|
120
121
|
{displayData?.length ? displayData?.map((d, index) => {
|
|
121
122
|
const isSelectedEval = isSelected ? isSelected(input.value, d) : get(input.value, uniqueIdentificationPath) === get(d, uniqueIdentificationPath);
|
|
123
|
+
|
|
124
|
+
const selectedCSS = selectedStyles ?? css.selectedMenuButton;
|
|
122
125
|
return (
|
|
123
126
|
<button
|
|
124
127
|
key={`typedown-button-[${index}]`}
|
|
125
128
|
className={classnames(
|
|
126
129
|
css.fullWidth,
|
|
127
|
-
css.menuButton
|
|
130
|
+
css.menuButton,
|
|
131
|
+
{ [`${selectedCSS}`]: isSelectedEval },
|
|
128
132
|
)}
|
|
129
133
|
data-selected={isSelectedEval}
|
|
130
134
|
id={`typedown-button-[${index}]`}
|
|
@@ -135,7 +139,7 @@ const Typedown = ({
|
|
|
135
139
|
onKeyDown={listKeyDownHandler}
|
|
136
140
|
type="button"
|
|
137
141
|
>
|
|
138
|
-
{renderItem(d)}
|
|
142
|
+
{renderItem(d, isSelectedEval)}
|
|
139
143
|
</button>
|
|
140
144
|
);
|
|
141
145
|
}) :
|
|
@@ -161,13 +165,15 @@ const Typedown = ({
|
|
|
161
165
|
footerRef,
|
|
162
166
|
handleChange,
|
|
163
167
|
handleNextFocus,
|
|
164
|
-
input,
|
|
168
|
+
input.name,
|
|
169
|
+
input.value,
|
|
165
170
|
isSelected,
|
|
166
171
|
listKeyDownHandler,
|
|
167
172
|
listRef,
|
|
168
173
|
renderFooter,
|
|
169
174
|
renderItem,
|
|
170
175
|
searchWidth,
|
|
176
|
+
selectedStyles,
|
|
171
177
|
uniqueIdentificationPath
|
|
172
178
|
]);
|
|
173
179
|
|
|
@@ -270,6 +276,7 @@ Typedown.propTypes = {
|
|
|
270
276
|
renderFooter: PropTypes.func,
|
|
271
277
|
renderListItem: PropTypes.func,
|
|
272
278
|
required: PropTypes.bool,
|
|
279
|
+
selectedStyles: PropTypes.string,
|
|
273
280
|
uniqueIdentificationPath: PropTypes.string
|
|
274
281
|
};
|
|
275
282
|
|
package/styles/TypeDown.css
CHANGED
|
@@ -33,7 +33,12 @@
|
|
|
33
33
|
text-align: left;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
.menuButton[data-selected=true], .selected {
|
|
36
|
+
/* .menuButton[data-selected=true], .selected {
|
|
37
|
+
background-color: var(--primary);
|
|
38
|
+
color: #fff;
|
|
39
|
+
} */
|
|
40
|
+
|
|
41
|
+
.selectedMenuButton {
|
|
37
42
|
background-color: var(--primary);
|
|
38
43
|
color: #fff;
|
|
39
44
|
}
|