@k-int/stripes-kint-components 5.33.0 → 5.33.2
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 +14 -0
- package/LICENSE +1 -1
- package/es/__mocks__/@folio/stripes/components.js +3 -7
- package/es/__mocks__/@folio/stripes/core.js +4 -6
- package/es/__mocks__/@folio/stripes/smart-components.js +4 -6
- package/es/__mocks__/react-query.js +4 -6
- package/es/__mocks__/react-router-dom.js +6 -6
- package/es/lib/ActionList/ActionList.js +26 -33
- package/es/lib/ActionList/ActionListFieldArray.js +103 -119
- package/es/lib/ButtonTypedown/ButtonTypedown.js +25 -33
- package/es/lib/ComboButton/ComboButton.js +42 -47
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +11 -17
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +42 -46
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +58 -58
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +4 -8
- 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 +29 -35
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +61 -59
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +20 -20
- 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 +22 -33
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +24 -37
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +1 -1
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +6 -6
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +3 -6
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +4 -8
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +15 -19
- 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 +17 -25
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +3 -6
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +7 -11
- package/es/lib/CycleButton/CycleButton.js +9 -17
- package/es/lib/FormModal/FormModal.js +24 -32
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +23 -30
- package/es/lib/IconSelect/IconSelect.js +22 -32
- package/es/lib/NoResultsMessage/NoResultsMessage.js +4 -5
- package/es/lib/NumberField/NumberField.js +17 -25
- package/es/lib/NumberField/NumberField.test.js +6 -7
- package/es/lib/QueryTypedown/QueryTypedown.js +8 -15
- package/es/lib/RefdataButtons/RefdataButtons.js +6 -9
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +48 -60
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +5 -6
- package/es/lib/RichSelect/RichSelect.js +31 -36
- package/es/lib/RichSelect/useSelectedOption.js +1 -2
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +91 -94
- package/es/lib/SASQLookupComponent/SASQLookupComponent.test.js +44 -36
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +42 -53
- package/es/lib/SASQLookupComponent/TableBody/TableBody.test.js +19 -23
- package/es/lib/SASQRoute/SASQRoute.js +25 -29
- package/es/lib/SASQRoute/SASQRoute.test.js +11 -13
- package/es/lib/SASQViewComponent/SASQViewComponent.js +68 -76
- package/es/lib/SASQViewComponent/SASQViewComponent.test.js +4 -8
- package/es/lib/SearchField/SearchField.js +7 -13
- package/es/lib/SearchKeyControl/SearchKeyControl.js +8 -13
- package/es/lib/SearchKeyControl/SearchKeyControl.test.js +2 -6
- package/es/lib/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js +30 -46
- package/es/lib/Settings/EditableRefdataList/EditableRefdataList.js +33 -43
- package/es/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js +7 -11
- package/es/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js +13 -20
- package/es/lib/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js +10 -12
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.js +10 -15
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.test.js +3 -3
- package/es/lib/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js +19 -26
- package/es/lib/Settings/SettingPage/SettingPagePane/SettingPagePane.js +2 -2
- package/es/lib/Settings/Settings/Settings.js +14 -16
- package/es/lib/Settings/SettingsFormContainer/SettingsFormContainer.js +30 -35
- package/es/lib/Settings/StaticSettingsField/StaticSettingsField.js +5 -8
- package/es/lib/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js +18 -22
- package/es/lib/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js +2 -2
- package/es/lib/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js +1 -1
- package/es/lib/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js +3 -7
- package/es/lib/Settings/hooks/useAppSettings/useAppSettings.js +7 -11
- package/es/lib/Settings/hooks/useSettingSection/useSettingSection.js +16 -22
- package/es/lib/Settings/hooks/useSettings/useSettings.js +62 -60
- package/es/lib/Tags/Tags.js +5 -8
- package/es/lib/Tags/hooks/useTags.js +1 -1
- package/es/lib/Tags/hooks/useTagsEnabled.js +2 -3
- package/es/lib/Tags/tagsConfig.js +1 -1
- package/es/lib/Typedown/Typedown.js +21 -28
- package/es/lib/hooks/__mocks__/index.js +3 -7
- package/es/lib/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js +20 -26
- package/es/lib/hooks/intlHooks/useKintIntl/useKintIntl.js +24 -34
- package/es/lib/hooks/typedownHooks/useTypedown.js +11 -12
- 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 +6 -10
- package/es/lib/hooks/useHelperApp.js +13 -16
- package/es/lib/hooks/useKiwtFieldArray.js +7 -8
- package/es/lib/hooks/useKiwtSASQuery.js +15 -19
- package/es/lib/hooks/useLocalPageStore.js +7 -10
- package/es/lib/hooks/useModConfigEntries.js +2 -2
- package/es/lib/hooks/useMutateCustomProperties/useMutateCustomProperties.js +10 -17
- package/es/lib/hooks/useMutateGeneric/useMutateGeneric.js +2 -2
- package/es/lib/hooks/useMutateModConfigEntry.js +2 -2
- package/es/lib/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js +15 -21
- package/es/lib/hooks/useMutateRefdataValue/useMutateRefdataValue.js +16 -23
- package/es/lib/hooks/usePrevNextPagination.js +17 -19
- package/es/lib/hooks/useQIndex.js +11 -14
- package/es/lib/hooks/useRefdata.js +3 -3
- package/es/lib/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js +9 -13
- package/es/lib/hooks/useTemplates.js +4 -4
- 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/generateKiwtQueryParams.js +94 -107
- package/es/lib/utils/groupCustomPropertiesByCtx.js +5 -9
- package/es/lib/utils/index.js +34 -13
- package/es/lib/utils/matchString/index.js +13 -0
- package/es/lib/utils/{matchString.js → matchString/matchString.js} +8 -9
- package/es/lib/utils/matchString/matchString.test.js +40 -0
- package/es/lib/utils/parseErrorResponse.js +3 -7
- package/es/lib/utils/selectorSafe.js +2 -3
- package/es/lib/utils/sortByLabel.js +2 -3
- package/es/lib/utils/stringStyling/boldString.js +30 -0
- package/es/lib/utils/stringStyling/boldString.test.js +47 -0
- package/es/lib/utils/stringStyling/highlightString.js +30 -0
- package/es/lib/utils/stringStyling/highlightString.test.js +51 -0
- package/es/lib/utils/stringStyling/index.js +20 -0
- package/es/lib/validators/validators.js +6 -9
- package/package.json +1 -1
- package/src/artifacts/coverage-jest/ActionList/ActionList.js.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/ActionListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/index.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/ButtonTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/ComboButton.js.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/index.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyForm.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyView.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEdit.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesListField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyFormCard.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilter.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesRule.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useOperators.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useParseActiveFilterStrings.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useValueProps.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesView.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesViewCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertyCard.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/CycleButton.js.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/index.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/FieldLabel.js.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/index.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/index.js.html +1 -1
- package/src/artifacts/coverage-jest/FormModal/FormModal.js.html +1 -1
- package/src/artifacts/coverage-jest/FormModal/index.html +1 -1
- package/src/artifacts/coverage-jest/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/FormattedKintMessage/FormattedKintMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/FormattedKintMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/FormattedKintMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/IconSelect/IconSelect.js.html +1 -1
- package/src/artifacts/coverage-jest/IconSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/IconSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/NoResultsMessage/NoResultsMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/NoResultsMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/NumberField.js.html +15 -15
- package/src/artifacts/coverage-jest/NumberField/index.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/QueryTypedown/QueryTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/QueryTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/RefdataButtons.js.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/index.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/index.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/RichSelect.js.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/useSelectedOption.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/SASQLookupComponent.js.html +31 -31
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/TableBody.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/SASQRoute.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/SASQViewComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/SearchField.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/index.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/SearchKeyControl.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/index.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/EditableRefdataList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/SettingField.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPage.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/SettingPagePane.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/Settings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/SettingsFormContainer.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsField.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/queryKeys.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/SettingsContext.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/useAppSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/useSettingSection.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/useSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/Tags.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/useTags.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/useTagsEnabled.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/index.html +1 -1
- package/src/artifacts/coverage-jest/Tags/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/tagsConfig.js.html +1 -1
- package/src/artifacts/coverage-jest/Typedown/Typedown.js.html +1 -1
- package/src/artifacts/coverage-jest/Typedown/index.html +1 -1
- package/src/artifacts/coverage-jest/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/cobertura-coverage.xml +267 -238
- package/src/artifacts/coverage-jest/constants/comparators.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/customProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/endpoints.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/constants/pagination.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/useIntlKey.js.html +7 -7
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js.html +6 -6
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/useKintIntl.js.html +6 -6
- package/src/artifacts/coverage-jest/hooks/typedownHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownData.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useActionListRef.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useActiveElement.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useHelperApp.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/useInvalidateRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useKiwtFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useKiwtSASQuery.js.html +9 -9
- package/src/artifacts/coverage-jest/hooks/useLocalPageStore.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useLocalStorageState.js.html +5 -5
- package/src/artifacts/coverage-jest/hooks/useModConfigEntries.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/useMutateCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/useMutateGeneric.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateModConfigEntry.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/useMutateRefdataValue.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/usePrevNextPagination.js.html +20 -20
- package/src/artifacts/coverage-jest/hooks/useQIndex.js.html +8 -8
- package/src/artifacts/coverage-jest/hooks/useRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useSASQQueryMeta.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useTemplates.js.html +1 -1
- package/src/artifacts/coverage-jest/index.html +49 -19
- package/src/artifacts/coverage-jest/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/deparseKiwtQueryFilters.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryFilters.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryGroups.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryString.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/generateKiwtQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/generateKiwtQueryParams.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/groupCustomPropertiesByCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/index.html +9 -39
- package/src/artifacts/coverage-jest/utils/index.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/matchString/index.html +131 -0
- package/src/artifacts/coverage-jest/utils/matchString/index.js.html +88 -0
- package/src/artifacts/coverage-jest/utils/{matchString.js.html → matchString/matchString.js.html} +82 -55
- package/src/artifacts/coverage-jest/utils/modConfigEntriesQueryKey.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/parseErrorResponse.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/parseModConfigEntry.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/refdataQueryKey.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/selectorSafe.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/sortByLabel.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/stringStyling/boldString.js.html +190 -0
- package/src/artifacts/coverage-jest/utils/stringStyling/highlightString.js.html +190 -0
- package/src/artifacts/coverage-jest/utils/stringStyling/index.html +146 -0
- package/src/artifacts/coverage-jest/utils/stringStyling/index.js.html +91 -0
- package/src/artifacts/coverage-jest/utils/toCamelCase.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/typedownQueryKey.js.html +1 -1
- package/src/artifacts/coverage-jest/validators/index.html +1 -1
- package/src/artifacts/coverage-jest/validators/index.js.html +1 -1
- package/src/artifacts/coverage-jest/validators/validators.js.html +1 -1
- package/src/lib/utils/index.js +1 -1
- package/src/lib/utils/matchString/index.js +1 -0
- package/src/lib/utils/matchString/matchString.js +44 -0
- package/src/lib/utils/matchString/matchString.test.js +68 -0
- package/src/lib/utils/stringStyling/boldString.js +35 -0
- package/src/lib/utils/stringStyling/boldString.test.js +59 -0
- package/src/lib/utils/stringStyling/highlightString.js +35 -0
- package/src/lib/utils/stringStyling/highlightString.test.js +67 -0
- package/src/lib/utils/stringStyling/index.js +2 -0
- package/styles/TypeDown.css +2 -2
- package/styles/stringMatchStyles.css +3 -0
- package/es/lib/utils/highlightString.js +0 -45
- package/src/artifacts/coverage-jest/utils/highlightString.js.html +0 -259
- package/src/lib/utils/highlightString.js +0 -58
- package/src/lib/utils/matchString.js +0 -35
|
@@ -4,9 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
const _excluded = ["searchKey", "filterConfig", "filterKeys", "sortKeys", "stats", "sort", "filters"];
|
|
8
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
7
|
const conditionalEncodeURIComponent = function (str) {
|
|
11
8
|
let encode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
12
9
|
if (encode) {
|
|
@@ -20,40 +17,36 @@ const conditionalEncodeURIComponent = function (str) {
|
|
|
20
17
|
const buildFilterOptionBlock = function (opf) {
|
|
21
18
|
let isNested = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
22
19
|
let encode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
23
|
-
if (opf
|
|
20
|
+
if (opf?.groupValues) {
|
|
24
21
|
const groupValues = opf.groupValues;
|
|
25
22
|
|
|
26
23
|
// Small utility function to add negation and brackets to the options block where necessary
|
|
27
|
-
const negationAndNesting = str =>
|
|
24
|
+
const negationAndNesting = str => `${groupValues?.NOT ? '!' : ''}${isNested || groupValues?.NOT ? '(' : ''}${str}${isNested || groupValues?.NOT ? ')' : ''}`;
|
|
28
25
|
|
|
29
26
|
// First check whether groupValues is ANDed or ORed together
|
|
30
|
-
if (groupValues
|
|
31
|
-
var _groupValues$OR;
|
|
27
|
+
if (groupValues?.AND && Array.isArray(groupValues.AND) || groupValues?.OR && Array.isArray(groupValues.OR)) {
|
|
32
28
|
// AND takes precedence
|
|
33
29
|
if (groupValues.AND) {
|
|
34
|
-
|
|
35
|
-
return negationAndNesting(groupValues === null || groupValues === void 0 || (_groupValues$AND = groupValues.AND) === null || _groupValues$AND === void 0 || (_groupValues$AND = _groupValues$AND.map(gvo => buildFilterOptionBlock(gvo, true, encode))) === null || _groupValues$AND === void 0 ? void 0 : _groupValues$AND.join('&&'));
|
|
30
|
+
return negationAndNesting(groupValues?.AND?.map(gvo => buildFilterOptionBlock(gvo, true, encode))?.join('&&'));
|
|
36
31
|
}
|
|
37
|
-
return negationAndNesting(groupValues
|
|
32
|
+
return negationAndNesting(groupValues?.OR?.map(gvo => buildFilterOptionBlock(gvo, true, encode))?.join('||'));
|
|
38
33
|
}
|
|
39
34
|
// If neither valid OR nor AND exist, ignore the block
|
|
40
|
-
} else if (opf
|
|
35
|
+
} else if (opf?.values) {
|
|
41
36
|
// Build the values filter block
|
|
42
37
|
const innerFilters = [];
|
|
43
38
|
opf.values.forEach(opfv => {
|
|
44
39
|
if (opf.path) {
|
|
45
|
-
|
|
46
|
-
innerFilters.push("".concat(opf.path).concat((_opf$comparator = opf.comparator) !== null && _opf$comparator !== void 0 ? _opf$comparator : '==').concat(opfv));
|
|
40
|
+
innerFilters.push(`${opf.path}${opf.comparator ?? '=='}${opfv}`);
|
|
47
41
|
} else {
|
|
48
42
|
innerFilters.push(opfv);
|
|
49
43
|
}
|
|
50
44
|
});
|
|
51
45
|
return conditionalEncodeURIComponent(innerFilters.join('||'), encode);
|
|
52
|
-
} else if (opf
|
|
46
|
+
} else if (opf?.value) {
|
|
53
47
|
// If no value OR values, then ignore
|
|
54
48
|
if (opf.path) {
|
|
55
|
-
|
|
56
|
-
const filterString = "".concat(opf.path).concat((_opf$comparator2 = opf.comparator) !== null && _opf$comparator2 !== void 0 ? _opf$comparator2 : '==').concat(opf.value);
|
|
49
|
+
const filterString = `${opf.path}${opf.comparator ?? '=='}${opf.value}`;
|
|
57
50
|
return conditionalEncodeURIComponent(filterString, encode);
|
|
58
51
|
}
|
|
59
52
|
return conditionalEncodeURIComponent(opf.value, encode);
|
|
@@ -81,74 +74,73 @@ const generateKiwtQueryParams = function (options, nsValues) {
|
|
|
81
74
|
sort
|
|
82
75
|
} = nsValues;
|
|
83
76
|
const {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
77
|
+
searchKey = '',
|
|
78
|
+
/*
|
|
79
|
+
* Array of objects to configure how filters coming from `nsValues.filters` are mapped into KIWT filter strings.
|
|
80
|
+
*
|
|
81
|
+
* Example structure:
|
|
82
|
+
* [
|
|
83
|
+
* {
|
|
84
|
+
* name: 'status', // Matches filter key in URL (e.g., filters=status.active)
|
|
85
|
+
* filterPrefix: 'filters=', // Optional, defaults to 'filters='
|
|
86
|
+
* // Optional function to entirely customize how the array of values is mapped to a string.
|
|
87
|
+
* // (e.g., ['active', 'cancelled'] => 'is:active and is:cancelled')
|
|
88
|
+
* // Defaults to constructing from `values` map below
|
|
89
|
+
* // valuesMapping: (filterValues) => string,
|
|
90
|
+
* values: [ // Optional: Specific configuration for individual filter values
|
|
91
|
+
* {
|
|
92
|
+
* name: 'active', // Matches filter value in URL
|
|
93
|
+
* value: 'activeValue', // Actual value to use in the KIWT query (defaults to name)
|
|
94
|
+
* comparator: '==' // Optional comparator override (defaults to '==')
|
|
95
|
+
* },
|
|
96
|
+
* // ... other values
|
|
97
|
+
* ]
|
|
98
|
+
* }
|
|
99
|
+
* ]
|
|
100
|
+
*/
|
|
101
|
+
filterConfig = [],
|
|
102
|
+
/* Assumtion made that if no filterKey is provided then the given filterValues for that key are standalaone, ie require no comparator or key */
|
|
103
|
+
filterKeys = {},
|
|
104
|
+
sortKeys = {},
|
|
105
|
+
stats = true,
|
|
106
|
+
/* Of the form [{ path: 'this.is.some.path', direction: 'asc'/'desc', value: 'someOverrideValue'}, ...]
|
|
107
|
+
* If only path is passed then assume asc.
|
|
108
|
+
* If value is passed then we ignore path/direction and append "sort=${value}" directly
|
|
109
|
+
*/
|
|
110
|
+
sort: optionsSort,
|
|
111
|
+
/* Of the form
|
|
112
|
+
[
|
|
113
|
+
{
|
|
114
|
+
path: 'this.is.some.path'
|
|
115
|
+
comparator: '=='
|
|
116
|
+
value: 'this is a value' //OR
|
|
117
|
+
values: ['value1', 'value2'] //OR
|
|
118
|
+
groupValues: { // This is an object containing objects either in groups of AND or OR. AND takes precedence
|
|
119
|
+
AND: [
|
|
120
|
+
// Objects of the same shape as an individual filters object, recursively.
|
|
121
|
+
],
|
|
122
|
+
NOT: true // When this is set to true, the entire group is negated
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
...
|
|
126
|
+
]
|
|
127
|
+
* This (with value instead of values) will construct a query param: "filters=this.is.some.path==this is a value"
|
|
128
|
+
* If only value is passed, then it will construct directly: "filters=value"
|
|
129
|
+
* If no comparator is passed, it assumes '=='
|
|
130
|
+
* Values overwrites value and will construct "filters=this.is.some.path==value1||this.is.some.path==value2"
|
|
131
|
+
* Values WITHOUT path will construct "filters=value1||value2"
|
|
132
|
+
*
|
|
133
|
+
* GroupValues will override everything above, and group into brackets.
|
|
134
|
+
*
|
|
135
|
+
* If more complex query building is desired, this should be done externally and passed in as a standalone 'value'
|
|
136
|
+
*/
|
|
137
|
+
filters: optionsFilters,
|
|
138
|
+
...rest
|
|
139
|
+
} = options;
|
|
147
140
|
const paramsArray = [];
|
|
148
141
|
if (query) {
|
|
149
|
-
|
|
150
|
-
paramsArray.push(
|
|
151
|
-
paramsArray.push("term=".concat(conditionalEncodeURIComponent(query, encode)));
|
|
142
|
+
paramsArray.push(...((qindex || searchKey)?.split(',') ?? []).map(m => `match=${conditionalEncodeURIComponent(m, encode)}`));
|
|
143
|
+
paramsArray.push(`term=${conditionalEncodeURIComponent(query, encode)}`);
|
|
152
144
|
}
|
|
153
145
|
|
|
154
146
|
// Actually build the optionsFilters block (Moved logic to its own function to allow recursion)
|
|
@@ -156,66 +148,61 @@ const generateKiwtQueryParams = function (options, nsValues) {
|
|
|
156
148
|
optionsFilters.forEach(opf => {
|
|
157
149
|
const optionsBlock = buildFilterOptionBlock(opf, false, encode);
|
|
158
150
|
if (optionsBlock) {
|
|
159
|
-
paramsArray.push(
|
|
151
|
+
paramsArray.push(`filters=${optionsBlock}`);
|
|
160
152
|
}
|
|
161
153
|
});
|
|
162
154
|
}
|
|
163
155
|
if (filters) {
|
|
164
156
|
const filterMap = {};
|
|
165
157
|
filters.split(',').forEach(filter => {
|
|
166
|
-
|
|
167
|
-
const [filterName, ...filterRest] = (_filter$trim$split = (_filter$trim = filter.trim()) === null || _filter$trim === void 0 ? void 0 : _filter$trim.split('.')) !== null && _filter$trim$split !== void 0 ? _filter$trim$split : [];
|
|
158
|
+
const [filterName, ...filterRest] = filter.trim()?.split('.') ?? [];
|
|
168
159
|
const filterValue = filterRest.join('.');
|
|
169
160
|
if (filterMap[filterName] === undefined) filterMap[filterName] = [];
|
|
170
161
|
filterMap[filterName].push(filterValue);
|
|
171
162
|
});
|
|
172
163
|
|
|
173
164
|
// We now have a filterMap of shape { status: ['active', 'cancelled'], type: ['local'] }
|
|
174
|
-
Object.entries(filterMap).forEach(
|
|
175
|
-
let [filterName, filterValues] =
|
|
165
|
+
Object.entries(filterMap).forEach(_ref => {
|
|
166
|
+
let [filterName, filterValues] = _ref;
|
|
176
167
|
const filterConfigEntry = filterConfig.find(conf => conf.name === filterName);
|
|
177
168
|
const filterKey = filterKeys[filterName];
|
|
178
169
|
if (filterConfigEntry) {
|
|
179
|
-
var _filterConfigEntry$fi;
|
|
180
170
|
// We have a direct mapping instruction, use it
|
|
181
171
|
|
|
182
172
|
// Do we have a specific way to map values to a string?
|
|
183
173
|
const filterString = filterConfigEntry.valuesMapping ? filterConfigEntry.valuesMapping(filterValues) : filterValues.map(v => {
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
const fceValue = (_fcValueEntry$value = fcValueEntry.value) !== null && _fcValueEntry$value !== void 0 ? _fcValueEntry$value : v;
|
|
174
|
+
const fcValueEntry = filterConfigEntry?.values?.find(fce => fce.name === v) ?? {};
|
|
175
|
+
const fceValue = fcValueEntry.value ?? v;
|
|
187
176
|
// This is especially useful where comparator acts strangely for a single value, such as `filters=foo isNotSet`
|
|
188
|
-
const fceComparator =
|
|
189
|
-
return
|
|
177
|
+
const fceComparator = fcValueEntry.comparator ?? '==';
|
|
178
|
+
return `${filterKey ?? filterName}${fceComparator}${fceValue ?? v}`;
|
|
190
179
|
}).join('||');
|
|
191
180
|
|
|
192
181
|
// This will NOT be url encoded by this component
|
|
193
|
-
const filterPrefix =
|
|
194
|
-
paramsArray.push(
|
|
182
|
+
const filterPrefix = filterConfigEntry.filterPrefix ?? 'filters=';
|
|
183
|
+
paramsArray.push(`${filterPrefix}${conditionalEncodeURIComponent(filterString, encode)}`);
|
|
195
184
|
} else if (!filterKey) {
|
|
196
185
|
// These filters have no key mapping so we just pass the values to the backend as-is.
|
|
197
|
-
paramsArray.push(...(filterValues
|
|
186
|
+
paramsArray.push(...(filterValues ?? []).map(f => `filters=${conditionalEncodeURIComponent(f, encode)}`));
|
|
198
187
|
} else {
|
|
199
|
-
const filterString = filterValues.map(v =>
|
|
200
|
-
paramsArray.push(
|
|
188
|
+
const filterString = filterValues.map(v => `${filterKey}==${v}`).join('||');
|
|
189
|
+
paramsArray.push(`filters=${conditionalEncodeURIComponent(filterString, encode)}`);
|
|
201
190
|
}
|
|
202
191
|
});
|
|
203
192
|
}
|
|
204
193
|
if (optionsSort && optionsSort.length > 0) {
|
|
205
194
|
optionsSort.forEach(os => {
|
|
206
195
|
if (os.value) {
|
|
207
|
-
paramsArray.push(
|
|
196
|
+
paramsArray.push(`sort=${conditionalEncodeURIComponent(os.value, encode)}`);
|
|
208
197
|
} else if (os.path) {
|
|
209
|
-
var _os$direction;
|
|
210
198
|
// If no path then ignore
|
|
211
|
-
const sortString =
|
|
212
|
-
paramsArray.push(
|
|
199
|
+
const sortString = `${os.path};${os.direction ?? 'asc'}`;
|
|
200
|
+
paramsArray.push(`sort=${conditionalEncodeURIComponent(sortString, encode)}`);
|
|
213
201
|
}
|
|
214
202
|
});
|
|
215
203
|
}
|
|
216
204
|
if (sort) {
|
|
217
|
-
|
|
218
|
-
paramsArray.push(...((_sort$trim$split = (_sort$trim = sort.trim()) === null || _sort$trim === void 0 ? void 0 : _sort$trim.split(',')) !== null && _sort$trim$split !== void 0 ? _sort$trim$split : []).map(sortKey => {
|
|
205
|
+
paramsArray.push(...(sort.trim()?.split(',') ?? []).map(sortKey => {
|
|
219
206
|
const reverse = sortKey.startsWith('-');
|
|
220
207
|
let term = sortKey.replace('-', '');
|
|
221
208
|
if (term in sortKeys) {
|
|
@@ -228,8 +215,8 @@ const generateKiwtQueryParams = function (options, nsValues) {
|
|
|
228
215
|
const descending = field.startsWith('-');
|
|
229
216
|
const sortField = field.replace('-', '');
|
|
230
217
|
const sortOrder = reverse && !descending || !reverse && descending ? 'desc' : 'asc';
|
|
231
|
-
const sortString =
|
|
232
|
-
return
|
|
218
|
+
const sortString = `${sortField};${sortOrder}`;
|
|
219
|
+
return `sort=${conditionalEncodeURIComponent(sortString, encode)}`;
|
|
233
220
|
});
|
|
234
221
|
return sortStrings.join('&');
|
|
235
222
|
}));
|
|
@@ -239,7 +226,7 @@ const generateKiwtQueryParams = function (options, nsValues) {
|
|
|
239
226
|
}
|
|
240
227
|
for (const [key, value] of Object.entries(rest)) {
|
|
241
228
|
if (!keysToIgnore.includes(key)) {
|
|
242
|
-
paramsArray.push(
|
|
229
|
+
paramsArray.push(`${key}=${conditionalEncodeURIComponent(value, encode)}`);
|
|
243
230
|
}
|
|
244
231
|
}
|
|
245
232
|
return paramsArray;
|
|
@@ -4,18 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
10
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
11
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
7
|
const groupCustomPropertiesByCtx = function () {
|
|
13
8
|
let customProperties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
14
9
|
return customProperties.reduce((acc, curr) => {
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
const ctx = curr.ctx ?? 'isNull';
|
|
11
|
+
const returnObj = {
|
|
12
|
+
...acc
|
|
13
|
+
};
|
|
14
|
+
returnObj[ctx] = [...(acc?.[ctx] ?? []), curr];
|
|
19
15
|
return returnObj;
|
|
20
16
|
}, {});
|
|
21
17
|
};
|
package/es/lib/utils/index.js
CHANGED
|
@@ -3,12 +3,28 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
generateKiwtQuery: true,
|
|
8
|
+
generateKiwtQueryParams: true,
|
|
9
|
+
selectorSafe: true,
|
|
10
|
+
buildUrl: true,
|
|
11
|
+
refdataOptions: true,
|
|
12
|
+
refdataQueryKey: true,
|
|
13
|
+
typedownQueryKey: true,
|
|
14
|
+
groupCustomPropertiesByCtx: true,
|
|
15
|
+
sortByLabel: true,
|
|
16
|
+
toCamelCase: true,
|
|
17
|
+
matchString: true,
|
|
18
|
+
parseKiwtQueryGroups: true,
|
|
19
|
+
parseKiwtQueryString: true,
|
|
20
|
+
parseKiwtQueryFilters: true,
|
|
21
|
+
parseKiwtQueryFiltersRecursive: true,
|
|
22
|
+
deparseKiwtQueryFilters: true,
|
|
23
|
+
deparseKiwtQueryFiltersObject: true,
|
|
24
|
+
parseErrorResponse: true,
|
|
25
|
+
modConfigEntriesQueryKey: true,
|
|
26
|
+
parseModConfigEntry: true
|
|
27
|
+
};
|
|
12
28
|
Object.defineProperty(exports, "buildUrl", {
|
|
13
29
|
enumerable: true,
|
|
14
30
|
get: function () {
|
|
@@ -45,12 +61,6 @@ Object.defineProperty(exports, "groupCustomPropertiesByCtx", {
|
|
|
45
61
|
return _groupCustomPropertiesByCtx.default;
|
|
46
62
|
}
|
|
47
63
|
});
|
|
48
|
-
Object.defineProperty(exports, "highlightString", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return _highlightString.highlightString;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
64
|
Object.defineProperty(exports, "matchString", {
|
|
55
65
|
enumerable: true,
|
|
56
66
|
get: function () {
|
|
@@ -146,7 +156,18 @@ var _groupCustomPropertiesByCtx = _interopRequireDefault(require("./groupCustomP
|
|
|
146
156
|
var _sortByLabel = _interopRequireDefault(require("./sortByLabel"));
|
|
147
157
|
var _toCamelCase = _interopRequireDefault(require("./toCamelCase"));
|
|
148
158
|
var _matchString = _interopRequireDefault(require("./matchString"));
|
|
149
|
-
var
|
|
159
|
+
var _stringStyling = require("./stringStyling");
|
|
160
|
+
Object.keys(_stringStyling).forEach(function (key) {
|
|
161
|
+
if (key === "default" || key === "__esModule") return;
|
|
162
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
163
|
+
if (key in exports && exports[key] === _stringStyling[key]) return;
|
|
164
|
+
Object.defineProperty(exports, key, {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
get: function () {
|
|
167
|
+
return _stringStyling[key];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
|
150
171
|
var _filterParsers = require("./filterParsers");
|
|
151
172
|
var _parseErrorResponse = _interopRequireDefault(require("./parseErrorResponse"));
|
|
152
173
|
var _modConfigEntriesQueryKey = _interopRequireDefault(require("./modConfigEntriesQueryKey"));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _matchString.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _matchString = _interopRequireDefault(require("./matchString"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -7,28 +7,27 @@ exports.default = void 0;
|
|
|
7
7
|
var _escapeRegExp = _interopRequireDefault(require("lodash/escapeRegExp"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
const matchString = function (match, str) {
|
|
10
|
-
var _str$split2;
|
|
11
10
|
let ignoreNull = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
12
11
|
let simpleSplit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
13
12
|
// Simple regex split -- this is default behaviour
|
|
14
|
-
const regexSimple = new RegExp(
|
|
13
|
+
const regexSimple = new RegExp(`${match.split(/(\s+)/).filter(h => h.trim()).map(hl => '(' + (0, _escapeRegExp.default)(hl) + ')').join('|')}`, 'gi');
|
|
15
14
|
|
|
16
|
-
// Split
|
|
17
|
-
const
|
|
15
|
+
// Split Elvis "The King" Presley into [Elvis, The King, Presley]
|
|
16
|
+
const quotedParts = match.match(/"[^"]*"|\S+/g) || [];
|
|
17
|
+
const regex = new RegExp(`${quotedParts.filter(h => h.trim()).map(quotedSection => {
|
|
18
18
|
if (quotedSection.charAt(0) === '"' && quotedSection.charAt(quotedSection.length - 1) === '"') {
|
|
19
|
-
return quotedSection.slice(1,
|
|
19
|
+
return quotedSection.slice(1, -1);
|
|
20
20
|
}
|
|
21
21
|
return quotedSection;
|
|
22
|
-
}).map(hl => '(' + (0, _escapeRegExp.default)(hl) + ')').join('|')
|
|
22
|
+
}).map(hl => '(' + (0, _escapeRegExp.default)(hl) + ')').join('|')}`, 'gi');
|
|
23
23
|
if (ignoreNull && !match) {
|
|
24
24
|
const nullRegex = /a^/gi; // Should match nothing
|
|
25
25
|
|
|
26
26
|
return [[str], nullRegex];
|
|
27
27
|
}
|
|
28
28
|
if (simpleSplit) {
|
|
29
|
-
|
|
30
|
-
return [(_str$split = str.split(regexSimple)) === null || _str$split === void 0 ? void 0 : _str$split.filter(s => s && s.trim()), regexSimple];
|
|
29
|
+
return [str.split(regexSimple)?.filter(s => s != null && s !== ''), regexSimple];
|
|
31
30
|
}
|
|
32
|
-
return [
|
|
31
|
+
return [str.split(regex)?.filter(s => s != null && s !== ''), regex];
|
|
33
32
|
};
|
|
34
33
|
var _default = exports.default = matchString;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _matchString = _interopRequireDefault(require("./matchString"));
|
|
4
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
5
|
+
describe('matchString', () => {
|
|
6
|
+
describe('simpleSplit=true (default)', () => {
|
|
7
|
+
test.each([['hello', 'say hello world', 'hello', 'splits by matched term'], ['HELLO', 'say hello world', 'hello', 'match is case insensitive'], ['foo bar', 'foo baz bar', 'foo', 'highlights individual words'], ['foo bar', 'foo baz bar', 'bar', 'highlights individual words (second word)'], ['foo.bar', 'foo.bar baz', 'foo.bar', 'handles regex special characters'], ['(test)', '(test) value', '(test)', 'handles parentheses']])('%s: when searching "%s", parts should contain "%s"', (term, str, expected) => {
|
|
8
|
+
const [parts] = (0, _matchString.default)(term, str);
|
|
9
|
+
expect(parts).toContain(expected);
|
|
10
|
+
});
|
|
11
|
+
test.each([['AN', 'AN 2025', 'start of string'], ['AN 2025', 'AN 2025', 'full match'], ['AB', 'AB CD EF', 'multiple spaces'], ['world', 'hello world', 'end of string'], ['a', 'a b a', 'multiple matches'], ['A', 'AN 2025', 'single character'], ['AN ', 'AN 2025', 'trailing space']])('preserves original string structure for "%s" in "%s" (%s)', (term, str) => {
|
|
12
|
+
const [parts] = (0, _matchString.default)(term, str);
|
|
13
|
+
expect(parts.join('')).toBe(str);
|
|
14
|
+
});
|
|
15
|
+
test('returns full string when no match found', () => {
|
|
16
|
+
const [parts] = (0, _matchString.default)('xyz', 'hello world');
|
|
17
|
+
expect(parts).toEqual(['hello world']);
|
|
18
|
+
});
|
|
19
|
+
test('returns regex as second element with correct flags', () => {
|
|
20
|
+
const [, regex] = (0, _matchString.default)('test', 'this is a test');
|
|
21
|
+
expect(regex).toBeInstanceOf(RegExp);
|
|
22
|
+
expect(regex.flags).toMatch(/g/);
|
|
23
|
+
expect(regex.flags).toMatch(/i/);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
describe('simpleSplit=false (quoted string support)', () => {
|
|
27
|
+
test.each([['"The King"', 'Elvis The King Presley', 'The King', 'quoted phrases as single term'], ['AN', 'AN 2025', 'AN', 'start of string'], ['AN ', 'AN 2025', 'AN', 'trailing space'], ['"AN 2025"', 'AN 2025', 'AN 2025', 'full match of quoted phrase'], ['hello', 'hello world', 'hello', 'partial match'], ['AB', 'AB CD EF', 'AB', 'multiple spaces'], ['world', 'hello world', 'world', 'end of string'], ['a', 'a b a', 'a', 'multiple matches'], ['A', 'AN 2025', 'A', 'single character']])('simpleSplit=false: %s in "%s" should preserve string and contain "%s"', (term, str, expected) => {
|
|
28
|
+
const [parts] = (0, _matchString.default)(term, str, true, false);
|
|
29
|
+
expect(parts.join('')).toBe(str);
|
|
30
|
+
expect(parts).toContain(expected);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
describe('ignoreNull behavior', () => {
|
|
34
|
+
test('returns full string with non-matching regex when match is empty and ignoreNull=true', () => {
|
|
35
|
+
const [parts, regex] = (0, _matchString.default)('', 'hello world', true);
|
|
36
|
+
expect(parts).toEqual(['hello world']);
|
|
37
|
+
expect(regex.exec('anything')).toBeNull();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -5,20 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
const parseErrorResponse = async responseObj => {
|
|
8
|
-
var _find$, _ref, _responseObj$headers;
|
|
9
8
|
let errorResp = {
|
|
10
9
|
message: 'something went wrong'
|
|
11
10
|
};
|
|
12
11
|
if (!responseObj) {
|
|
13
12
|
return errorResp;
|
|
14
13
|
}
|
|
15
|
-
const code = responseObj
|
|
14
|
+
const code = responseObj?.status;
|
|
16
15
|
|
|
17
16
|
// Assume text if we can't find content type
|
|
18
|
-
const contentType =
|
|
19
|
-
var _header$;
|
|
20
|
-
return ((_header$ = header[0]) === null || _header$ === void 0 ? void 0 : _header$.toLowerCase()) === 'content-type';
|
|
21
|
-
})) === null || _ref === void 0 ? void 0 : _ref[1]) !== null && _find$ !== void 0 ? _find$ : 'application/text';
|
|
17
|
+
const contentType = [...(responseObj?.headers ?? [])]?.find(header => header[0]?.toLowerCase() === 'content-type')?.[1] ?? 'application/text';
|
|
22
18
|
if (contentType.includes('json')) {
|
|
23
19
|
errorResp = await responseObj.json();
|
|
24
20
|
} else {
|
|
@@ -27,7 +23,7 @@ const parseErrorResponse = async responseObj => {
|
|
|
27
23
|
code,
|
|
28
24
|
message: await responseObj.text()
|
|
29
25
|
};
|
|
30
|
-
} catch
|
|
26
|
+
} catch {
|
|
31
27
|
errorResp = {
|
|
32
28
|
code,
|
|
33
29
|
message: 'something went wrong'
|
|
@@ -5,12 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
const selectorSafe = string => {
|
|
8
|
-
var _string$normalize;
|
|
9
8
|
// Normalise to separate diacritics from their base characters as "marks"
|
|
10
9
|
// then strip out all marks.
|
|
11
|
-
return
|
|
10
|
+
return string.normalize('NFKD')?.replace(/\p{M}/gu, '')
|
|
12
11
|
// Then swap out any non-letter/number characters (Also ignore - and _) for `_`
|
|
13
|
-
|
|
12
|
+
?.replace(/[^\p{L}\p{N}\-_]/gu, '_');
|
|
14
13
|
};
|
|
15
14
|
var _default = exports.default = selectorSafe;
|
|
16
15
|
/*
|
|
@@ -5,9 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
const sortByLabel = (a, b) => {
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const bl = (_b$label$toLowerCase = (_b$label = b.label) === null || _b$label === void 0 ? void 0 : _b$label.toLowerCase()) !== null && _b$label$toLowerCase !== void 0 ? _b$label$toLowerCase : (_b$id = b.id) === null || _b$id === void 0 ? void 0 : _b$id.toLowerCase();
|
|
8
|
+
const al = a.label?.toLowerCase() ?? a.id?.toLowerCase();
|
|
9
|
+
const bl = b.label?.toLowerCase() ?? b.id?.toLowerCase();
|
|
11
10
|
if (al < bl) {
|
|
12
11
|
return -1;
|
|
13
12
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _matchString = _interopRequireDefault(require("../matchString"));
|
|
8
|
+
var _stringMatchStyles = _interopRequireDefault(require("../../../../styles/stringMatchStyles.css"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const boldString = function (match, str) {
|
|
12
|
+
let ignoreNull = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
13
|
+
let simpleSplit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
14
|
+
const [parts, regex] = (0, _matchString.default)(match, str, ignoreNull, simpleSplit);
|
|
15
|
+
return parts.map((part, i) => {
|
|
16
|
+
// RegExp is stateful, set up a new one to work with
|
|
17
|
+
const immutableRegex = new RegExp(regex);
|
|
18
|
+
if (immutableRegex.exec(part) !== null) {
|
|
19
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("strong", {
|
|
20
|
+
className: _stringMatchStyles.default.whitespacePre,
|
|
21
|
+
children: part
|
|
22
|
+
}, `bold-strong-${part}-${i}`);
|
|
23
|
+
}
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
25
|
+
className: _stringMatchStyles.default.whitespacePre,
|
|
26
|
+
children: part
|
|
27
|
+
}, `bold-span-${part}-${i}`);
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
var _default = exports.default = boldString;
|