@k-int/stripes-kint-components 5.35.0 → 5.36.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/index.js +12 -0
- package/es/lib/Files/FileUploader/FileUploader.js +119 -0
- package/es/lib/Files/FileUploader/index.js +13 -0
- package/es/lib/Files/FileView/FileView.js +116 -0
- package/es/lib/Files/FileView/index.js +13 -0
- package/es/lib/Files/index.js +27 -0
- package/es/lib/Files/useFileHandlers.js +133 -0
- package/es/lib/utils/downloadBlob.js +42 -0
- package/es/lib/utils/index.js +9 -1
- package/package.json +2 -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/Files/FileUploader/FileUploader.js.html +487 -0
- package/src/artifacts/coverage-jest/Files/FileUploader/index.html +131 -0
- package/src/artifacts/coverage-jest/Files/FileUploader/index.js.html +88 -0
- package/src/artifacts/coverage-jest/Files/FileView/FileView.js.html +430 -0
- package/src/artifacts/coverage-jest/Files/FileView/index.html +131 -0
- package/src/artifacts/coverage-jest/Files/FileView/index.js.html +88 -0
- package/src/artifacts/coverage-jest/Files/index.html +131 -0
- package/src/artifacts/coverage-jest/Files/index.js.html +94 -0
- package/src/artifacts/coverage-jest/Files/useFileHandlers.js.html +469 -0
- 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 +1 -1
- 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 +51 -51
- 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 +12 -12
- package/src/artifacts/coverage-jest/SASQViewComponent/index.html +15 -15
- 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 +9 -9
- package/src/artifacts/coverage-jest/Tags/hooks/index.html +16 -16
- package/src/artifacts/coverage-jest/Tags/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/useTags.js.html +9 -9
- package/src/artifacts/coverage-jest/Tags/hooks/useTagsEnabled.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/index.html +15 -15
- 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 +457 -257
- 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 +15 -15
- 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 +9 -9
- 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/useCustProps.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 +17 -17
- 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/useMutateTemplates/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateTemplates/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateTemplates/useMutateTemplates.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useParallelBatchFetch.js.html +9 -9
- package/src/artifacts/coverage-jest/hooks/usePrevNextPagination.js.html +31 -31
- package/src/artifacts/coverage-jest/hooks/useQIndex.js.html +9 -9
- 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 +95 -50
- package/src/artifacts/coverage-jest/utils/buildUrl.js.html +12 -12
- package/src/artifacts/coverage-jest/utils/downloadBlob.js.html +211 -0
- 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 +3 -3
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/generateKiwtQueryParams.js.html +17 -17
- 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 +24 -9
- package/src/artifacts/coverage-jest/utils/index.js.html +5 -2
- package/src/artifacts/coverage-jest/utils/matchString/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString/matchString.js.html +1 -1
- 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 +1 -1
- package/src/artifacts/coverage-jest/utils/stringStyling/highlightString.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/stringStyling/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/stringStyling/index.js.html +1 -1
- 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/index.js +2 -0
- package/src/lib/Files/FileUploader/FileUploader.js +134 -0
- package/src/lib/Files/FileUploader/index.js +1 -0
- package/src/lib/Files/FileView/FileView.js +115 -0
- package/src/lib/Files/FileView/index.js +1 -0
- package/src/lib/Files/index.js +3 -0
- package/src/lib/Files/useFileHandlers.js +128 -0
- package/src/lib/utils/downloadBlob.js +42 -0
- package/src/lib/utils/index.js +1 -0
- package/styles/FileUploader.css +34 -0
- package/styles/FileView.css +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [5.36.0](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.35.0...v5.36.0) (2026-04-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **Files:** useFileHandlers/FileUploader/FileView ([afb03e5](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/afb03e5b88d8f5f4471645cf958837b46b6babea))
|
|
7
|
+
|
|
1
8
|
# [5.35.0](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.34.1...v5.35.0) (2026-04-13)
|
|
2
9
|
|
|
3
10
|
|
package/es/index.js
CHANGED
|
@@ -345,6 +345,18 @@ Object.keys(_Settings).forEach(function (key) {
|
|
|
345
345
|
});
|
|
346
346
|
var _ActionList = _interopRequireDefault(require("./lib/ActionList"));
|
|
347
347
|
var _Typedown = _interopRequireDefault(require("./lib/Typedown"));
|
|
348
|
+
var _Files = require("./lib/Files");
|
|
349
|
+
Object.keys(_Files).forEach(function (key) {
|
|
350
|
+
if (key === "default" || key === "__esModule") return;
|
|
351
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
352
|
+
if (key in exports && exports[key] === _Files[key]) return;
|
|
353
|
+
Object.defineProperty(exports, key, {
|
|
354
|
+
enumerable: true,
|
|
355
|
+
get: function () {
|
|
356
|
+
return _Files[key];
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
});
|
|
348
360
|
var _QueryTypedown = _interopRequireDefault(require("./lib/QueryTypedown"));
|
|
349
361
|
var _ButtonTypedown = _interopRequireDefault(require("./lib/ButtonTypedown"));
|
|
350
362
|
var _SearchField = _interopRequireDefault(require("./lib/SearchField"));
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _reactDropzone = require("react-dropzone");
|
|
9
|
+
var _isFunction = _interopRequireDefault(require("lodash/isFunction"));
|
|
10
|
+
var _bind = _interopRequireDefault(require("classnames/bind"));
|
|
11
|
+
var _components = require("@folio/stripes/components");
|
|
12
|
+
var _FileUploader = _interopRequireDefault(require("../../../../styles/FileUploader.css"));
|
|
13
|
+
var _hooks = require("../../hooks");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
const cx = _bind.default.bind(_FileUploader.default);
|
|
17
|
+
|
|
18
|
+
// This is copied from stripes-data-transfer-components and tweaked
|
|
19
|
+
const FileUploader = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
accept,
|
|
22
|
+
children,
|
|
23
|
+
disabled,
|
|
24
|
+
dropzoneProps = {},
|
|
25
|
+
// Any additional dropzone props
|
|
26
|
+
intlKey: passedIntlKey,
|
|
27
|
+
intlNS: passedIntlNS,
|
|
28
|
+
labelOverrides = {},
|
|
29
|
+
maxFiles,
|
|
30
|
+
multiple = true,
|
|
31
|
+
onDrop,
|
|
32
|
+
onDragEnter,
|
|
33
|
+
onDragLeave
|
|
34
|
+
} = _ref;
|
|
35
|
+
const {
|
|
36
|
+
getRootProps,
|
|
37
|
+
getInputProps,
|
|
38
|
+
open,
|
|
39
|
+
isDragActive
|
|
40
|
+
} = (0, _reactDropzone.useDropzone)({
|
|
41
|
+
accept,
|
|
42
|
+
disabled,
|
|
43
|
+
multiple,
|
|
44
|
+
maxFiles,
|
|
45
|
+
noClick: true,
|
|
46
|
+
onDrop,
|
|
47
|
+
onDragEnter,
|
|
48
|
+
onDragLeave,
|
|
49
|
+
...dropzoneProps
|
|
50
|
+
});
|
|
51
|
+
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
52
|
+
const updateClassName = cx({
|
|
53
|
+
upload: true,
|
|
54
|
+
activeUpload: isDragActive
|
|
55
|
+
});
|
|
56
|
+
const titleClassName = cx({
|
|
57
|
+
uploadTitle: true,
|
|
58
|
+
activeUploadTitle: isDragActive
|
|
59
|
+
});
|
|
60
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
61
|
+
"aria-disabled": disabled,
|
|
62
|
+
"data-test-file-uploader": true,
|
|
63
|
+
...getRootProps({
|
|
64
|
+
role: 'presentation'
|
|
65
|
+
}),
|
|
66
|
+
className: updateClassName,
|
|
67
|
+
"data-testid": "fileUploader-input",
|
|
68
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
69
|
+
...getInputProps()
|
|
70
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
71
|
+
className: titleClassName,
|
|
72
|
+
"data-test-title": true,
|
|
73
|
+
children: isDragActive ? kintIntl.formatKintMessage({
|
|
74
|
+
id: 'files.dropToUpload',
|
|
75
|
+
overrideValue: labelOverrides.dropToUpload
|
|
76
|
+
}) : kintIntl.formatKintMessage({
|
|
77
|
+
id: 'files.dragAndDropToUpload',
|
|
78
|
+
overrideValue: labelOverrides.dragAndDropToUpload
|
|
79
|
+
})
|
|
80
|
+
}), !isDragActive && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
81
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
82
|
+
className: _FileUploader.default.secondaryArea,
|
|
83
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
84
|
+
buttonStyle: "primary",
|
|
85
|
+
disabled: disabled,
|
|
86
|
+
marginBottom0: true,
|
|
87
|
+
onClick: open,
|
|
88
|
+
children: kintIntl.formatKintMessage({
|
|
89
|
+
id: 'files.uploadButton',
|
|
90
|
+
overrideValue: labelOverrides.uploadButton
|
|
91
|
+
})
|
|
92
|
+
})
|
|
93
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
94
|
+
className: _FileUploader.default.children,
|
|
95
|
+
children: (0, _isFunction.default)(children) ? children(open) : children
|
|
96
|
+
})]
|
|
97
|
+
})]
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
FileUploader.propTypes = {
|
|
101
|
+
accept: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
102
|
+
children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
103
|
+
disabled: _propTypes.default.bool,
|
|
104
|
+
// eslint-disable-next-line react/forbid-prop-types
|
|
105
|
+
dropzoneProps: _propTypes.default.object,
|
|
106
|
+
intlKey: _propTypes.default.string,
|
|
107
|
+
intlNS: _propTypes.default.string,
|
|
108
|
+
labelOverrides: _propTypes.default.shape({
|
|
109
|
+
dropToUpload: _propTypes.default.string,
|
|
110
|
+
dragAndDropToUpload: _propTypes.default.string,
|
|
111
|
+
uploadButton: _propTypes.default.string
|
|
112
|
+
}),
|
|
113
|
+
maxFiles: _propTypes.default.number,
|
|
114
|
+
multiple: _propTypes.default.bool,
|
|
115
|
+
onDrop: _propTypes.default.func.isRequired,
|
|
116
|
+
onDragEnter: _propTypes.default.func,
|
|
117
|
+
onDragLeave: _propTypes.default.func
|
|
118
|
+
};
|
|
119
|
+
var _default = exports.default = FileUploader;
|
|
@@ -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 _FileUploader.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _FileUploader = _interopRequireDefault(require("./FileUploader"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _components = require("@folio/stripes/components");
|
|
9
|
+
var _hooks = require("../../hooks");
|
|
10
|
+
var _FileView = _interopRequireDefault(require("../../../../styles/FileView.css"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const FileView = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
canDownload,
|
|
16
|
+
file,
|
|
17
|
+
onDownload,
|
|
18
|
+
intlKey: passedIntlKey,
|
|
19
|
+
intlNS: passedIntlNS,
|
|
20
|
+
labelOverrides = {},
|
|
21
|
+
onDelete
|
|
22
|
+
} = _ref;
|
|
23
|
+
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
24
|
+
if (!file) return null;
|
|
25
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
26
|
+
className: _FileView.default.fileViewContainer,
|
|
27
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
28
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
29
|
+
xs: 6,
|
|
30
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
31
|
+
label: kintIntl.formatKintMessage({
|
|
32
|
+
id: 'files.filename',
|
|
33
|
+
overrideValue: labelOverrides.filename
|
|
34
|
+
}),
|
|
35
|
+
children: canDownload ?
|
|
36
|
+
/*#__PURE__*/
|
|
37
|
+
/* eslint-disable-next-line jsx-a11y/anchor-is-valid */
|
|
38
|
+
(0, _jsxRuntime.jsxs)("a", {
|
|
39
|
+
"data-test-fileview-name": true,
|
|
40
|
+
href: "#",
|
|
41
|
+
onClick: e => {
|
|
42
|
+
onDownload(file);
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
e.stopPropagation();
|
|
45
|
+
},
|
|
46
|
+
rel: "noopener noreferrer",
|
|
47
|
+
style: {
|
|
48
|
+
wordBreak: 'break-all'
|
|
49
|
+
},
|
|
50
|
+
target: "_blank",
|
|
51
|
+
children: [file.name, /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
|
|
52
|
+
icon: "external-link"
|
|
53
|
+
})]
|
|
54
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
55
|
+
"data-test-fileview-name": true,
|
|
56
|
+
children: file.name
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
60
|
+
xs: 4,
|
|
61
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
62
|
+
label: kintIntl.formatKintMessage({
|
|
63
|
+
id: 'files.uploaded',
|
|
64
|
+
overrideValue: labelOverrides.uploaded
|
|
65
|
+
}),
|
|
66
|
+
value: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
67
|
+
"data-test-fileview-uploaded": true,
|
|
68
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
69
|
+
children: kintIntl.formatDate(file.modified)
|
|
70
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
71
|
+
children: kintIntl.formatTime(file.modified)
|
|
72
|
+
})]
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
76
|
+
xs: 2,
|
|
77
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
78
|
+
id: `file-${file?.id}-delete-button`,
|
|
79
|
+
text: kintIntl.formatKintMessage({
|
|
80
|
+
id: 'files.remove',
|
|
81
|
+
overrideValue: labelOverrides.remove
|
|
82
|
+
}),
|
|
83
|
+
children: _ref2 => {
|
|
84
|
+
let {
|
|
85
|
+
ariaIds,
|
|
86
|
+
ref
|
|
87
|
+
} = _ref2;
|
|
88
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
89
|
+
ref: ref,
|
|
90
|
+
"aria-labelledby": ariaIds.text,
|
|
91
|
+
"data-test-fileview-delete": true,
|
|
92
|
+
icon: "trash",
|
|
93
|
+
onClick: e => {
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
onDelete(file);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
})]
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
FileView.propTypes = {
|
|
105
|
+
file: _propTypes.default.shape({
|
|
106
|
+
name: _propTypes.default.string
|
|
107
|
+
}),
|
|
108
|
+
intlKey: _propTypes.default.string,
|
|
109
|
+
intlNS: _propTypes.default.string,
|
|
110
|
+
labelOverrides: _propTypes.default.shape({
|
|
111
|
+
filename: _propTypes.default.string,
|
|
112
|
+
remove: _propTypes.default.string,
|
|
113
|
+
uploaded: _propTypes.default.string
|
|
114
|
+
})
|
|
115
|
+
};
|
|
116
|
+
var _default = exports.default = FileView;
|
|
@@ -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 _FileView.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _FileView = _interopRequireDefault(require("./FileView"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "FileUploader", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _FileUploader.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "FileView", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _FileView.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "useFileHandlers", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _useFileHandlers.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var _FileView = _interopRequireDefault(require("./FileView"));
|
|
25
|
+
var _FileUploader = _interopRequireDefault(require("./FileUploader"));
|
|
26
|
+
var _useFileHandlers = _interopRequireDefault(require("./useFileHandlers"));
|
|
27
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactQuery = require("react-query");
|
|
9
|
+
var _core = require("@folio/stripes/core");
|
|
10
|
+
var _utils = require("../utils");
|
|
11
|
+
// This is copied and adapted from stripes-erm-components
|
|
12
|
+
|
|
13
|
+
const useFileHandlers = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
// When fetchFile is true, will AUTOMATICALLY fetch not only
|
|
16
|
+
// fileMetadata but ALSO file itself
|
|
17
|
+
fetchFile = false,
|
|
18
|
+
/* fileEndpoint can be a string or
|
|
19
|
+
* {
|
|
20
|
+
* download: string | function,
|
|
21
|
+
* metadata: string | function
|
|
22
|
+
* upload: string | function,
|
|
23
|
+
* }
|
|
24
|
+
*/
|
|
25
|
+
fileEndpoint,
|
|
26
|
+
fileField = 'upload',
|
|
27
|
+
fileMappings = {},
|
|
28
|
+
// A mapping from file -> formData field,
|
|
29
|
+
fileId // An OPTIONAL id for a file which results in fetching and returning file metadata
|
|
30
|
+
} = _ref;
|
|
31
|
+
const ky = (0, _core.useOkapiKy)();
|
|
32
|
+
|
|
33
|
+
// A method which resolves the endpoint to hit based on fileEndpoint
|
|
34
|
+
const resolveEndpoint = (0, _react.useCallback)((type, file) => {
|
|
35
|
+
if (typeof fileEndpoint === 'string') {
|
|
36
|
+
// We have a base endpoint, configure default behaviour
|
|
37
|
+
switch (type) {
|
|
38
|
+
case 'upload':
|
|
39
|
+
return fileEndpoint;
|
|
40
|
+
case 'download':
|
|
41
|
+
return `${fileEndpoint}/${file?.id}/raw`;
|
|
42
|
+
case 'metadata':
|
|
43
|
+
return `${fileEndpoint}/${file.id}`;
|
|
44
|
+
default:
|
|
45
|
+
throw new TypeError(`Unsupported endpoint type ${type}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (typeof fileEndpoint !== 'object') {
|
|
49
|
+
throw new TypeError(`Unsupported fileEndpoint type ${typeof fileEndpoint}`);
|
|
50
|
+
}
|
|
51
|
+
const config = fileEndpoint[type];
|
|
52
|
+
if (config === null) {
|
|
53
|
+
throw new TypeError(`Unsupported fileEndpoint[${type}] is not configured`);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Finally we have configured behaviour
|
|
57
|
+
switch (typeof config) {
|
|
58
|
+
case 'function':
|
|
59
|
+
return config(file);
|
|
60
|
+
case 'string':
|
|
61
|
+
return config;
|
|
62
|
+
default:
|
|
63
|
+
// If we have hit the end then we've done something wrong
|
|
64
|
+
throw new TypeError(`Unsupported configuration for fileEndpoint[${type}]: ${typeof config}`);
|
|
65
|
+
}
|
|
66
|
+
}, [fileEndpoint]);
|
|
67
|
+
const {
|
|
68
|
+
mutateAsync: handleUploadFile
|
|
69
|
+
} = (0, _reactQuery.useMutation)([fileEndpoint, 'handleUpload'], file => {
|
|
70
|
+
const formData = new FormData();
|
|
71
|
+
formData.append(fileField, file);
|
|
72
|
+
Object.entries(fileMappings).forEach(_ref2 => {
|
|
73
|
+
let [key, value] = _ref2;
|
|
74
|
+
if (typeof value === 'string') {
|
|
75
|
+
formData.append(key, value);
|
|
76
|
+
} else if (typeof value === 'function') {
|
|
77
|
+
formData.append(key, value(file));
|
|
78
|
+
} else {
|
|
79
|
+
throw new TypeError('Invalid fileMapping: ' + key);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return ky.post(resolveEndpoint('upload', file), {
|
|
83
|
+
body: formData
|
|
84
|
+
}).json();
|
|
85
|
+
});
|
|
86
|
+
const {
|
|
87
|
+
data: fileBlob,
|
|
88
|
+
isLoading: isFileLoading,
|
|
89
|
+
refetch: refetchFile
|
|
90
|
+
} = (0, _reactQuery.useQuery)({
|
|
91
|
+
queryKey: [fileEndpoint, 'content', fileId],
|
|
92
|
+
queryFn: () => ky.get(resolveEndpoint('download', {
|
|
93
|
+
id: fileId
|
|
94
|
+
})).blob(),
|
|
95
|
+
enabled: !!fileId && typeof fileId === 'string' && fetchFile,
|
|
96
|
+
staleTime: Infinity // Assume the file won't change underneath us.
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// We are declaratively fetching a file via a function, useMutation is more convenient here
|
|
100
|
+
// NOTE even if fileBlob already exists this will refetch it for download
|
|
101
|
+
const {
|
|
102
|
+
mutate: getFile,
|
|
103
|
+
mutateAsync: getFileAsync
|
|
104
|
+
} = (0, _reactQuery.useMutation)([fileEndpoint, 'getFile'], file => ky.get(resolveEndpoint('download', file)).blob());
|
|
105
|
+
const handleDownloadFile = (0, _react.useCallback)(fileMetadata => {
|
|
106
|
+
return getFileAsync(fileMetadata)
|
|
107
|
+
/* In this instance we want the file name back as it was handed in, whitespace and all */.then((0, _utils.downloadBlob)(fileMetadata.name, {
|
|
108
|
+
processWhitespace: false
|
|
109
|
+
}));
|
|
110
|
+
}, [getFileAsync]);
|
|
111
|
+
const {
|
|
112
|
+
data: fileMetadata,
|
|
113
|
+
isLoading: isFileMetadataLoading
|
|
114
|
+
} = (0, _reactQuery.useQuery)({
|
|
115
|
+
queryKey: [fileEndpoint, 'metadata', fileId],
|
|
116
|
+
queryFn: () => ky.get(resolveEndpoint('metadata', {
|
|
117
|
+
id: fileId
|
|
118
|
+
})).json(),
|
|
119
|
+
enabled: !!fileId && typeof fileId === 'string'
|
|
120
|
+
});
|
|
121
|
+
return {
|
|
122
|
+
file: fileBlob,
|
|
123
|
+
fileMetadata,
|
|
124
|
+
getFile,
|
|
125
|
+
getFileAsync,
|
|
126
|
+
handleDownloadFile,
|
|
127
|
+
handleUploadFile,
|
|
128
|
+
isFileLoading,
|
|
129
|
+
isFileMetadataLoading,
|
|
130
|
+
refetchFile
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
var _default = exports.default = useFileHandlers;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* The options block allows for a very customisable approach to naming files
|
|
9
|
+
* and applying extensions. The default options are chosen in order to keep default
|
|
10
|
+
* behaviour found in other apps, but this can now be changed use case by use case.
|
|
11
|
+
*
|
|
12
|
+
* This is copied from stripes-erm-components
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const downloadBlob = function (name) {
|
|
16
|
+
let {
|
|
17
|
+
fileExt = '',
|
|
18
|
+
spaceDelimiter = '_',
|
|
19
|
+
dotDelimiter = '',
|
|
20
|
+
processWhitespace = true,
|
|
21
|
+
processDots = false
|
|
22
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
23
|
+
let downloadName = name;
|
|
24
|
+
if (processWhitespace) {
|
|
25
|
+
downloadName = downloadName.replaceAll(/\s/g, spaceDelimiter);
|
|
26
|
+
}
|
|
27
|
+
if (processDots) {
|
|
28
|
+
downloadName = downloadName.replaceAll(/\./g, dotDelimiter);
|
|
29
|
+
}
|
|
30
|
+
if (fileExt.length) {
|
|
31
|
+
downloadName = `${downloadName}.${fileExt}`;
|
|
32
|
+
}
|
|
33
|
+
return blob => {
|
|
34
|
+
const url = URL.createObjectURL(blob);
|
|
35
|
+
const a = document.createElement('a');
|
|
36
|
+
a.href = url;
|
|
37
|
+
a.download = downloadName;
|
|
38
|
+
a.click();
|
|
39
|
+
URL.revokeObjectURL(url);
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
var _default = exports.default = downloadBlob;
|
package/es/lib/utils/index.js
CHANGED
|
@@ -23,7 +23,8 @@ var _exportNames = {
|
|
|
23
23
|
deparseKiwtQueryFiltersObject: true,
|
|
24
24
|
parseErrorResponse: true,
|
|
25
25
|
modConfigEntriesQueryKey: true,
|
|
26
|
-
parseModConfigEntry: true
|
|
26
|
+
parseModConfigEntry: true,
|
|
27
|
+
downloadBlob: true
|
|
27
28
|
};
|
|
28
29
|
Object.defineProperty(exports, "buildUrl", {
|
|
29
30
|
enumerable: true,
|
|
@@ -43,6 +44,12 @@ Object.defineProperty(exports, "deparseKiwtQueryFiltersObject", {
|
|
|
43
44
|
return _filterParsers.deparseKiwtQueryFiltersObject;
|
|
44
45
|
}
|
|
45
46
|
});
|
|
47
|
+
Object.defineProperty(exports, "downloadBlob", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () {
|
|
50
|
+
return _downloadBlob.default;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
46
53
|
Object.defineProperty(exports, "generateKiwtQuery", {
|
|
47
54
|
enumerable: true,
|
|
48
55
|
get: function () {
|
|
@@ -172,4 +179,5 @@ var _filterParsers = require("./filterParsers");
|
|
|
172
179
|
var _parseErrorResponse = _interopRequireDefault(require("./parseErrorResponse"));
|
|
173
180
|
var _modConfigEntriesQueryKey = _interopRequireDefault(require("./modConfigEntriesQueryKey"));
|
|
174
181
|
var _parseModConfigEntry = _interopRequireDefault(require("./parseModConfigEntry"));
|
|
182
|
+
var _downloadBlob = _interopRequireDefault(require("./downloadBlob"));
|
|
175
183
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k-int/stripes-kint-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.36.0",
|
|
4
4
|
"description": "Stripes Component library for K-Int specific applications",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css"
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@rehooks/local-storage": "^2.4.4",
|
|
30
30
|
"compose-function": "^3.0.3",
|
|
31
|
+
"react-dropzone": "^15.0.0",
|
|
31
32
|
"react-resize-detector": "^11.0.0",
|
|
32
33
|
"zustand": "^5.0.0"
|
|
33
34
|
},
|
|
@@ -358,7 +358,7 @@ export default ActionList;
|
|
|
358
358
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
359
359
|
Code coverage generated by
|
|
360
360
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
361
|
-
at 2026-04-
|
|
361
|
+
at 2026-04-16T17:02:24.586Z
|
|
362
362
|
</div>
|
|
363
363
|
<script src="../prettify.js"></script>
|
|
364
364
|
<script>
|
|
@@ -1495,7 +1495,7 @@ export default ActionListFieldArray;
|
|
|
1495
1495
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1496
1496
|
Code coverage generated by
|
|
1497
1497
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1498
|
-
at 2026-04-
|
|
1498
|
+
at 2026-04-16T17:02:24.586Z
|
|
1499
1499
|
</div>
|
|
1500
1500
|
<script src="../prettify.js"></script>
|
|
1501
1501
|
<script>
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
132
132
|
Code coverage generated by
|
|
133
133
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
134
|
-
at 2026-04-
|
|
134
|
+
at 2026-04-16T17:02:24.586Z
|
|
135
135
|
</div>
|
|
136
136
|
<script src="../prettify.js"></script>
|
|
137
137
|
<script>
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
74
74
|
Code coverage generated by
|
|
75
75
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
76
|
-
at 2026-04-
|
|
76
|
+
at 2026-04-16T17:02:24.586Z
|
|
77
77
|
</div>
|
|
78
78
|
<script src="../prettify.js"></script>
|
|
79
79
|
<script>
|
|
@@ -421,7 +421,7 @@ ButtonTypedown.propTypes = {
|
|
|
421
421
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
422
422
|
Code coverage generated by
|
|
423
423
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
424
|
-
at 2026-04-
|
|
424
|
+
at 2026-04-16T17:02:24.586Z
|
|
425
425
|
</div>
|
|
426
426
|
<script src="../prettify.js"></script>
|
|
427
427
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at 2026-04-
|
|
119
|
+
at 2026-04-16T17:02:24.586Z
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
74
74
|
Code coverage generated by
|
|
75
75
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
76
|
-
at 2026-04-
|
|
76
|
+
at 2026-04-16T17:02:24.586Z
|
|
77
77
|
</div>
|
|
78
78
|
<script src="../prettify.js"></script>
|
|
79
79
|
<script>
|
|
@@ -553,7 +553,7 @@ export default ComboButton;
|
|
|
553
553
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
554
554
|
Code coverage generated by
|
|
555
555
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
556
|
-
at 2026-04-
|
|
556
|
+
at 2026-04-16T17:02:24.586Z
|
|
557
557
|
</div>
|
|
558
558
|
<script src="../prettify.js"></script>
|
|
559
559
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at 2026-04-
|
|
119
|
+
at 2026-04-16T17:02:24.586Z
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
74
74
|
Code coverage generated by
|
|
75
75
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
76
|
-
at 2026-04-
|
|
76
|
+
at 2026-04-16T17:02:24.586Z
|
|
77
77
|
</div>
|
|
78
78
|
<script src="../prettify.js"></script>
|
|
79
79
|
<script>
|
|
@@ -649,7 +649,7 @@ export default CustomPropertiesLookup;
|
|
|
649
649
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
650
650
|
Code coverage generated by
|
|
651
651
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
652
|
-
at 2026-04-
|
|
652
|
+
at 2026-04-16T17:02:24.586Z
|
|
653
653
|
</div>
|
|
654
654
|
<script src="../../prettify.js"></script>
|
|
655
655
|
<script>
|
package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesSettings.js.html
CHANGED
|
@@ -1360,7 +1360,7 @@ export default CustomPropertiesSettings;
|
|
|
1360
1360
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1361
1361
|
Code coverage generated by
|
|
1362
1362
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1363
|
-
at 2026-04-
|
|
1363
|
+
at 2026-04-16T17:02:24.586Z
|
|
1364
1364
|
</div>
|
|
1365
1365
|
<script src="../../prettify.js"></script>
|
|
1366
1366
|
<script>
|