@k-int/stripes-kint-components 2.2.0 → 2.3.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 +29 -0
- package/es/index.js +125 -9
- package/es/lib/ActionList/ActionList.js +8 -33
- package/es/lib/ActionList/ActionListFieldArray.js +50 -49
- package/es/lib/ActionList/index.js +1 -5
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +1 -35
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +3 -39
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +1 -34
- package/es/lib/CustomProperties/Config/{CustomPropertiesView.js → CustomPropertyView.js} +4 -33
- package/es/lib/CustomProperties/Config/index.js +7 -9
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +43 -0
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +100 -0
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +243 -0
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +337 -0
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +127 -0
- package/es/lib/CustomProperties/Edit/index.js +47 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +183 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +204 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +126 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +90 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +139 -0
- package/es/lib/CustomProperties/Filter/index.js +55 -0
- package/es/lib/CustomProperties/Filter/useOperators.js +100 -0
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +64 -0
- package/es/lib/CustomProperties/Filter/useValueProps.js +67 -0
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +44 -0
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +155 -0
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +175 -0
- package/es/lib/CustomProperties/View/index.js +31 -0
- package/es/lib/CustomProperties/index.js +121 -0
- package/es/lib/EditableRefdataList/EditableRefdataList.js +13 -51
- package/es/lib/EditableRefdataList/index.js +1 -5
- package/es/lib/EditableSettingsList/EditableSettingsList.js +1 -30
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +1 -30
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +1 -30
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +1 -34
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +1 -34
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +1 -34
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -41
- package/es/lib/EditableSettingsList/SettingField/SettingField.js +1 -34
- package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +1 -30
- package/es/lib/EditableSettingsList/SettingField/index.js +1 -5
- package/es/lib/EditableSettingsList/index.js +1 -5
- package/es/lib/FormModal/FormModal.js +21 -34
- package/es/lib/FormModal/index.js +1 -5
- package/es/lib/NoResultsMessage/NoResultsMessage.js +1 -30
- package/es/lib/NoResultsMessage/index.js +1 -5
- package/es/lib/QueryTypedown/QueryTypedown.js +9 -37
- package/es/lib/QueryTypedown/index.js +1 -5
- package/es/lib/RefdataButtons/RefdataButtons.js +1 -34
- package/es/lib/RefdataButtons/index.js +1 -5
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +1 -34
- package/es/lib/SASQLookupComponent/index.js +1 -5
- package/es/lib/SASQRoute/SASQRoute.js +1 -30
- package/es/lib/SASQRoute/index.js +1 -5
- package/es/lib/SASQViewComponent/SASQViewComponent.js +1 -34
- package/es/lib/SASQViewComponent/index.js +1 -5
- package/es/lib/SearchField/SearchField.js +1 -31
- package/es/lib/SearchField/index.js +1 -5
- package/es/lib/SettingPage/SettingPage.js +1 -34
- package/es/lib/SettingPage/SettingPagePane.js +1 -32
- package/es/lib/SettingPage/index.js +1 -5
- package/es/lib/Typedown/Typedown.js +1 -34
- package/es/lib/Typedown/index.js +1 -5
- package/es/lib/constants/customProperties.js +3 -37
- package/es/lib/constants/eventCodes.js +1 -31
- package/es/lib/contexts/SettingsContext.js +1 -30
- package/es/lib/contexts/index.js +1 -5
- package/es/lib/hooks/index.js +16 -4
- package/es/lib/hooks/settingsHooks/index.js +1 -5
- package/es/lib/hooks/settingsHooks/useSettingSection.js +1 -34
- package/es/lib/hooks/settingsHooks/useSettings.js +1 -36
- package/es/lib/hooks/typedownHooks/index.js +1 -5
- package/es/lib/hooks/typedownHooks/useTypedown.js +1 -34
- package/es/lib/hooks/typedownHooks/useTypedownData.js +9 -35
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +1 -34
- package/es/lib/hooks/useActiveElement.js +1 -32
- package/es/lib/hooks/useAvailableCustomProperties.js +73 -0
- package/es/lib/hooks/useCustomProperties.js +1 -34
- package/es/lib/hooks/useHelperApp.js +1 -34
- package/es/lib/hooks/useInvalidateRefdata.js +20 -0
- package/es/lib/hooks/useKiwtFieldArray.js +1 -34
- package/es/lib/hooks/useKiwtSASQuery.js +1 -35
- package/es/lib/hooks/useLocalStorageState.js +1 -34
- package/es/lib/hooks/useMutateCustomProperties.js +1 -34
- package/es/lib/hooks/useMutateRefdataValue.js +10 -38
- package/es/lib/hooks/useQIndex.js +1 -34
- package/es/lib/hooks/useRefdata.js +2 -37
- package/es/lib/hooks/useTemplates.js +1 -34
- package/es/lib/utils/buildUrl.js +2 -31
- package/es/lib/utils/generateKiwtQuery.js +1 -30
- package/es/lib/utils/generateKiwtQueryParams.js +1 -30
- package/es/lib/utils/groupCustomPropertiesByCtx.js +41 -0
- package/es/lib/utils/index.js +25 -5
- package/es/lib/utils/refdataOptions.js +1 -30
- package/es/lib/utils/refdataQueryKey.js +19 -0
- package/es/lib/utils/renderHelpText.js +1 -30
- package/es/lib/utils/selectorSafe.js +1 -30
- package/es/lib/utils/sortByLabel.js +1 -30
- package/es/lib/utils/toCamelCase.js +1 -30
- package/es/lib/utils/typedownQueryKey.js +19 -0
- package/es/lib/utils/validators.js +59 -31
- package/git_translate.sh +8 -0
- package/package.json +1 -1
- package/src/index.js +27 -3
- package/src/lib/ActionList/ActionList.js +5 -2
- package/src/lib/ActionList/ActionListFieldArray.js +31 -9
- package/src/lib/ActionList/README.md +23 -20
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +2 -2
- package/src/lib/CustomProperties/Config/{CustomPropertiesView.js → CustomPropertyView.js} +3 -3
- package/src/lib/CustomProperties/Config/index.js +1 -1
- package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.js +35 -0
- package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +85 -0
- package/src/lib/CustomProperties/Edit/CustomPropertiesListField.js +194 -0
- package/src/lib/CustomProperties/Edit/CustomPropertyField.js +299 -0
- package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.js +131 -0
- package/src/lib/CustomProperties/Edit/index.js +5 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.js +125 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +148 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +113 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +74 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesRule.js +122 -0
- package/src/lib/CustomProperties/Filter/index.js +6 -0
- package/src/lib/CustomProperties/Filter/useOperators.js +55 -0
- package/src/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +35 -0
- package/src/lib/CustomProperties/Filter/useValueProps.js +45 -0
- package/src/lib/CustomProperties/View/CustomPropertiesView.js +36 -0
- package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.js +112 -0
- package/src/lib/CustomProperties/View/CustomPropertyCard.js +177 -0
- package/src/lib/CustomProperties/View/index.js +3 -0
- package/src/lib/CustomProperties/index.js +30 -0
- package/src/lib/EditableRefdataList/EditableRefdataList.js +13 -10
- package/src/lib/FormModal/FormModal.js +39 -17
- package/src/lib/QueryTypedown/QueryTypedown.js +3 -1
- package/src/lib/constants/customProperties.js +1 -0
- package/src/lib/hooks/index.js +2 -0
- package/src/lib/hooks/typedownHooks/useTypedownData.js +9 -3
- package/src/lib/hooks/useAvailableCustomProperties.js +40 -0
- package/src/lib/hooks/useInvalidateRefdata.js +11 -0
- package/src/lib/hooks/useMutateRefdataValue.js +7 -3
- package/src/lib/hooks/useRefdata.js +2 -3
- package/src/lib/utils/groupCustomPropertiesByCtx.js +13 -0
- package/src/lib/utils/index.js +5 -0
- package/src/lib/utils/refdataQueryKey.js +9 -0
- package/src/lib/utils/typedownQueryKey.js +9 -0
- package/src/lib/utils/validators.js +40 -0
- package/translate.sh +63 -0
- package/translations/stripes-kint-components/ar.json +105 -0
- package/translations/stripes-kint-components/ca.json +1 -0
- package/translations/stripes-kint-components/cs_CZ.json +105 -0
- package/translations/stripes-kint-components/da.json +1 -0
- package/translations/stripes-kint-components/de.json +105 -0
- package/translations/stripes-kint-components/en.json +54 -2
- package/translations/stripes-kint-components/es.json +105 -0
- package/translations/stripes-kint-components/fr.json +105 -0
- package/translations/stripes-kint-components/he.json +1 -0
- package/translations/stripes-kint-components/hi_IN.json +105 -0
- package/translations/stripes-kint-components/hu.json +105 -0
- package/translations/stripes-kint-components/it_IT.json +105 -0
- package/translations/stripes-kint-components/ja.json +105 -0
- package/translations/stripes-kint-components/ko.json +105 -0
- package/translations/stripes-kint-components/nb.json +1 -0
- package/translations/stripes-kint-components/nn.json +1 -0
- package/translations/stripes-kint-components/pl.json +105 -0
- package/translations/stripes-kint-components/pt_PT.json +105 -0
- package/translations/stripes-kint-components/ru.json +105 -0
- package/translations/stripes-kint-components/sv.json +105 -0
- package/translations/stripes-kint-components/ur.json +1 -0
- package/translations/stripes-kint-components/zh_CN.json +105 -0
- package/es/artifacts/coverage-jest/lcov-report/block-navigation.js +0 -109
- package/es/artifacts/coverage-jest/lcov-report/prettify.js +0 -998
- package/es/artifacts/coverage-jest/lcov-report/sorter.js +0 -238
- package/junit.xml +0 -79
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +0 -286
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +0 -925
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +0 -146
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +0 -418
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +0 -808
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesView.js.html +0 -601
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +0 -1135
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +0 -176
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +0 -97
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +0 -373
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +0 -223
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +0 -211
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +0 -376
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +0 -262
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +0 -436
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +0 -161
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +0 -146
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +0 -283
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +0 -319
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +0 -184
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +0 -370
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +0 -949
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +0 -301
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +0 -253
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +0 -214
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +0 -211
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +0 -178
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +0 -146
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +0 -91
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +0 -919
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/base.css +0 -224
- package/src/artifacts/coverage-jest/lcov-report/block-navigation.js +0 -87
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +0 -112
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +0 -97
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +0 -91
- package/src/artifacts/coverage-jest/lcov-report/favicon.png +0 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +0 -281
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +0 -121
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +0 -146
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +0 -91
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +0 -163
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +0 -403
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +0 -161
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +0 -520
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +0 -163
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +0 -163
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +0 -157
- package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +0 -313
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +0 -283
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +0 -274
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +0 -178
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +0 -136
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +0 -271
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +0 -301
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +0 -208
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +0 -268
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +0 -166
- package/src/artifacts/coverage-jest/lcov-report/index.html +0 -416
- package/src/artifacts/coverage-jest/lcov-report/prettify.css +0 -1
- package/src/artifacts/coverage-jest/lcov-report/prettify.js +0 -2
- package/src/artifacts/coverage-jest/lcov-report/sort-arrow-sprite.png +0 -0
- package/src/artifacts/coverage-jest/lcov-report/sorter.js +0 -196
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +0 -193
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +0 -109
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +0 -454
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +0 -251
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +0 -121
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +0 -106
- package/src/artifacts/coverage-jest/lcov-report/utils/renderHelpText.js.html +0 -166
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +0 -103
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +0 -130
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +0 -127
- package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +0 -202
- package/src/artifacts/coverage-jest/lcov.info +0 -2562
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<title>Code coverage report for hooks/typedownHooks/useTypedownData.js</title>
|
|
7
|
-
<meta charset="utf-8" />
|
|
8
|
-
<link rel="stylesheet" href="../../prettify.css" />
|
|
9
|
-
<link rel="stylesheet" href="../../base.css" />
|
|
10
|
-
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
|
|
11
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
-
<style type='text/css'>
|
|
13
|
-
.coverage-summary .sorter {
|
|
14
|
-
background-image: url(../../sort-arrow-sprite.png);
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class='wrapper'>
|
|
21
|
-
<div class='pad1'>
|
|
22
|
-
<h1><a href="../../index.html">All files</a> / <a href="index.html">hooks/typedownHooks</a> useTypedownData.js</h1>
|
|
23
|
-
<div class='clearfix'>
|
|
24
|
-
|
|
25
|
-
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">0% </span>
|
|
27
|
-
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/9</span>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">0% </span>
|
|
34
|
-
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/2</span>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">0% </span>
|
|
41
|
-
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>0/3</span>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">0% </span>
|
|
48
|
-
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/9</span>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</div>
|
|
54
|
-
<p class="quiet">
|
|
55
|
-
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
-
</p>
|
|
57
|
-
<template id="filterTemplate">
|
|
58
|
-
<div class="quiet">
|
|
59
|
-
Filter:
|
|
60
|
-
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
-
</div>
|
|
62
|
-
</template>
|
|
63
|
-
</div>
|
|
64
|
-
<div class='status-line low'></div>
|
|
65
|
-
<pre><table class="coverage">
|
|
66
|
-
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
|
-
<a name='L2'></a><a href='#L2'>2</a>
|
|
68
|
-
<a name='L3'></a><a href='#L3'>3</a>
|
|
69
|
-
<a name='L4'></a><a href='#L4'>4</a>
|
|
70
|
-
<a name='L5'></a><a href='#L5'>5</a>
|
|
71
|
-
<a name='L6'></a><a href='#L6'>6</a>
|
|
72
|
-
<a name='L7'></a><a href='#L7'>7</a>
|
|
73
|
-
<a name='L8'></a><a href='#L8'>8</a>
|
|
74
|
-
<a name='L9'></a><a href='#L9'>9</a>
|
|
75
|
-
<a name='L10'></a><a href='#L10'>10</a>
|
|
76
|
-
<a name='L11'></a><a href='#L11'>11</a>
|
|
77
|
-
<a name='L12'></a><a href='#L12'>12</a>
|
|
78
|
-
<a name='L13'></a><a href='#L13'>13</a>
|
|
79
|
-
<a name='L14'></a><a href='#L14'>14</a>
|
|
80
|
-
<a name='L15'></a><a href='#L15'>15</a>
|
|
81
|
-
<a name='L16'></a><a href='#L16'>16</a>
|
|
82
|
-
<a name='L17'></a><a href='#L17'>17</a>
|
|
83
|
-
<a name='L18'></a><a href='#L18'>18</a>
|
|
84
|
-
<a name='L19'></a><a href='#L19'>19</a>
|
|
85
|
-
<a name='L20'></a><a href='#L20'>20</a>
|
|
86
|
-
<a name='L21'></a><a href='#L21'>21</a>
|
|
87
|
-
<a name='L22'></a><a href='#L22'>22</a>
|
|
88
|
-
<a name='L23'></a><a href='#L23'>23</a>
|
|
89
|
-
<a name='L24'></a><a href='#L24'>24</a>
|
|
90
|
-
<a name='L25'></a><a href='#L25'>25</a>
|
|
91
|
-
<a name='L26'></a><a href='#L26'>26</a>
|
|
92
|
-
<a name='L27'></a><a href='#L27'>27</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
93
|
-
<span class="cline-any cline-neutral"> </span>
|
|
94
|
-
<span class="cline-any cline-neutral"> </span>
|
|
95
|
-
<span class="cline-any cline-neutral"> </span>
|
|
96
|
-
<span class="cline-any cline-no"> </span>
|
|
97
|
-
<span class="cline-any cline-no"> </span>
|
|
98
|
-
<span class="cline-any cline-neutral"> </span>
|
|
99
|
-
<span class="cline-any cline-no"> </span>
|
|
100
|
-
<span class="cline-any cline-neutral"> </span>
|
|
101
|
-
<span class="cline-any cline-neutral"> </span>
|
|
102
|
-
<span class="cline-any cline-no"> </span>
|
|
103
|
-
<span class="cline-any cline-neutral"> </span>
|
|
104
|
-
<span class="cline-any cline-neutral"> </span>
|
|
105
|
-
<span class="cline-any cline-neutral"> </span>
|
|
106
|
-
<span class="cline-any cline-neutral"> </span>
|
|
107
|
-
<span class="cline-any cline-no"> </span>
|
|
108
|
-
<span class="cline-any cline-no"> </span>
|
|
109
|
-
<span class="cline-any cline-no"> </span>
|
|
110
|
-
<span class="cline-any cline-no"> </span>
|
|
111
|
-
<span class="cline-any cline-neutral"> </span>
|
|
112
|
-
<span class="cline-any cline-neutral"> </span>
|
|
113
|
-
<span class="cline-any cline-neutral"> </span>
|
|
114
|
-
<span class="cline-any cline-no"> </span>
|
|
115
|
-
<span class="cline-any cline-neutral"> </span>
|
|
116
|
-
<span class="cline-any cline-neutral"> </span>
|
|
117
|
-
<span class="cline-any cline-neutral"> </span>
|
|
118
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { useEffect, useState } from 'react';
|
|
119
|
-
import { useQuery } from 'react-query';
|
|
120
|
-
import { useOkapiKy } from '@folio/stripes/core';
|
|
121
|
-
|
|
122
|
-
const useTypedownData = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(c</span>allPath) => {</span>
|
|
123
|
-
const ky = <span class="cstat-no" title="statement not covered" >useOkapiKy();</span>
|
|
124
|
-
|
|
125
|
-
const { data, isLoading } = <span class="cstat-no" title="statement not covered" >useQuery(</span>
|
|
126
|
-
// Ensure when multiple apps are using this function that each one gets memoized individually
|
|
127
|
-
['stripes-kint-components', 'typedown', callPath],
|
|
128
|
-
<span class="fstat-no" title="function not covered" > ()</span> => <span class="cstat-no" title="statement not covered" >ky(callPath).json()</span>
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
// Smooth out transitions while data changes by only displaying once call has been loaded.
|
|
133
|
-
const [contentData, setContentData] = <span class="cstat-no" title="statement not covered" >useState();</span>
|
|
134
|
-
<span class="cstat-no" title="statement not covered" > useEffect(<span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
135
|
-
<span class="cstat-no" title="statement not covered" > if (!isLoading) {</span>
|
|
136
|
-
<span class="cstat-no" title="statement not covered" > setContentData(data);</span>
|
|
137
|
-
}
|
|
138
|
-
}, [data, isLoading]);
|
|
139
|
-
|
|
140
|
-
<span class="cstat-no" title="statement not covered" > return contentData;</span>
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
export default useTypedownData;
|
|
144
|
-
</pre></td></tr></table></pre>
|
|
145
|
-
|
|
146
|
-
<div class='push'></div><!-- for sticky footer -->
|
|
147
|
-
</div><!-- /wrapper -->
|
|
148
|
-
<div class='footer quiet pad2 space-top1 center small'>
|
|
149
|
-
Code coverage generated by
|
|
150
|
-
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
151
|
-
at Fri Mar 11 2022 16:43:16 GMT+0000 (Greenwich Mean Time)
|
|
152
|
-
</div>
|
|
153
|
-
<script src="../../prettify.js"></script>
|
|
154
|
-
<script>
|
|
155
|
-
window.onload = function () {
|
|
156
|
-
prettyPrint();
|
|
157
|
-
};
|
|
158
|
-
</script>
|
|
159
|
-
<script src="../../sorter.js"></script>
|
|
160
|
-
<script src="../../block-navigation.js"></script>
|
|
161
|
-
</body>
|
|
162
|
-
</html>
|
|
163
|
-
|
package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<title>Code coverage report for hooks/typedownHooks/useTypedownToggle.js</title>
|
|
7
|
-
<meta charset="utf-8" />
|
|
8
|
-
<link rel="stylesheet" href="../../prettify.css" />
|
|
9
|
-
<link rel="stylesheet" href="../../base.css" />
|
|
10
|
-
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
|
|
11
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
-
<style type='text/css'>
|
|
13
|
-
.coverage-summary .sorter {
|
|
14
|
-
background-image: url(../../sort-arrow-sprite.png);
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class='wrapper'>
|
|
21
|
-
<div class='pad1'>
|
|
22
|
-
<h1><a href="../../index.html">All files</a> / <a href="index.html">hooks/typedownHooks</a> useTypedownToggle.js</h1>
|
|
23
|
-
<div class='clearfix'>
|
|
24
|
-
|
|
25
|
-
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">0% </span>
|
|
27
|
-
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/11</span>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">0% </span>
|
|
34
|
-
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/8</span>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">0% </span>
|
|
41
|
-
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>0/3</span>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">0% </span>
|
|
48
|
-
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/11</span>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</div>
|
|
54
|
-
<p class="quiet">
|
|
55
|
-
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
-
</p>
|
|
57
|
-
<template id="filterTemplate">
|
|
58
|
-
<div class="quiet">
|
|
59
|
-
Filter:
|
|
60
|
-
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
-
</div>
|
|
62
|
-
</template>
|
|
63
|
-
</div>
|
|
64
|
-
<div class='status-line low'></div>
|
|
65
|
-
<pre><table class="coverage">
|
|
66
|
-
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
|
-
<a name='L2'></a><a href='#L2'>2</a>
|
|
68
|
-
<a name='L3'></a><a href='#L3'>3</a>
|
|
69
|
-
<a name='L4'></a><a href='#L4'>4</a>
|
|
70
|
-
<a name='L5'></a><a href='#L5'>5</a>
|
|
71
|
-
<a name='L6'></a><a href='#L6'>6</a>
|
|
72
|
-
<a name='L7'></a><a href='#L7'>7</a>
|
|
73
|
-
<a name='L8'></a><a href='#L8'>8</a>
|
|
74
|
-
<a name='L9'></a><a href='#L9'>9</a>
|
|
75
|
-
<a name='L10'></a><a href='#L10'>10</a>
|
|
76
|
-
<a name='L11'></a><a href='#L11'>11</a>
|
|
77
|
-
<a name='L12'></a><a href='#L12'>12</a>
|
|
78
|
-
<a name='L13'></a><a href='#L13'>13</a>
|
|
79
|
-
<a name='L14'></a><a href='#L14'>14</a>
|
|
80
|
-
<a name='L15'></a><a href='#L15'>15</a>
|
|
81
|
-
<a name='L16'></a><a href='#L16'>16</a>
|
|
82
|
-
<a name='L17'></a><a href='#L17'>17</a>
|
|
83
|
-
<a name='L18'></a><a href='#L18'>18</a>
|
|
84
|
-
<a name='L19'></a><a href='#L19'>19</a>
|
|
85
|
-
<a name='L20'></a><a href='#L20'>20</a>
|
|
86
|
-
<a name='L21'></a><a href='#L21'>21</a>
|
|
87
|
-
<a name='L22'></a><a href='#L22'>22</a>
|
|
88
|
-
<a name='L23'></a><a href='#L23'>23</a>
|
|
89
|
-
<a name='L24'></a><a href='#L24'>24</a>
|
|
90
|
-
<a name='L25'></a><a href='#L25'>25</a>
|
|
91
|
-
<a name='L26'></a><a href='#L26'>26</a>
|
|
92
|
-
<a name='L27'></a><a href='#L27'>27</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
93
|
-
<span class="cline-any cline-neutral"> </span>
|
|
94
|
-
<span class="cline-any cline-neutral"> </span>
|
|
95
|
-
<span class="cline-any cline-neutral"> </span>
|
|
96
|
-
<span class="cline-any cline-no"> </span>
|
|
97
|
-
<span class="cline-any cline-no"> </span>
|
|
98
|
-
<span class="cline-any cline-no"> </span>
|
|
99
|
-
<span class="cline-any cline-no"> </span>
|
|
100
|
-
<span class="cline-any cline-neutral"> </span>
|
|
101
|
-
<span class="cline-any cline-neutral"> </span>
|
|
102
|
-
<span class="cline-any cline-no"> </span>
|
|
103
|
-
<span class="cline-any cline-neutral"> </span>
|
|
104
|
-
<span class="cline-any cline-neutral"> </span>
|
|
105
|
-
<span class="cline-any cline-no"> </span>
|
|
106
|
-
<span class="cline-any cline-no"> </span>
|
|
107
|
-
<span class="cline-any cline-neutral"> </span>
|
|
108
|
-
<span class="cline-any cline-no"> </span>
|
|
109
|
-
<span class="cline-any cline-no"> </span>
|
|
110
|
-
<span class="cline-any cline-no"> </span>
|
|
111
|
-
<span class="cline-any cline-neutral"> </span>
|
|
112
|
-
<span class="cline-any cline-neutral"> </span>
|
|
113
|
-
<span class="cline-any cline-neutral"> </span>
|
|
114
|
-
<span class="cline-any cline-no"> </span>
|
|
115
|
-
<span class="cline-any cline-neutral"> </span>
|
|
116
|
-
<span class="cline-any cline-neutral"> </span>
|
|
117
|
-
<span class="cline-any cline-neutral"> </span>
|
|
118
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { useCallback, useEffect, useState } from 'react';
|
|
119
|
-
import useActiveElement from '../useActiveElement';
|
|
120
|
-
import selectorSafe from '../../utils/selectorSafe';
|
|
121
|
-
|
|
122
|
-
const useTypedownToggle = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(n</span>ame) => {</span>
|
|
123
|
-
const [open, setOpen] = <span class="cstat-no" title="statement not covered" >useState(false);</span>
|
|
124
|
-
const onToggle = <span class="cstat-no" title="statement not covered" >useCallback(<span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
125
|
-
<span class="cstat-no" title="statement not covered" > setOpen(!open);</span>
|
|
126
|
-
}, [open, setOpen]);
|
|
127
|
-
|
|
128
|
-
const { hasParent } = <span class="cstat-no" title="statement not covered" >useActiveElement();</span>
|
|
129
|
-
|
|
130
|
-
// Trawl up element stack and check if a typedown-parent exists, use that to toggle
|
|
131
|
-
const openBool = <span class="cstat-no" title="statement not covered" >!open && hasParent(`typedown-parent-${selectorSafe(name)}`);</span>
|
|
132
|
-
const closeBool = <span class="cstat-no" title="statement not covered" >open && !hasParent(`typedown-parent-${selectorSafe(name)}`);</span>
|
|
133
|
-
|
|
134
|
-
<span class="cstat-no" title="statement not covered" > useEffect(<span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
135
|
-
<span class="cstat-no" title="statement not covered" > if (openBool || closeBool) {</span>
|
|
136
|
-
<span class="cstat-no" title="statement not covered" > onToggle();</span>
|
|
137
|
-
}
|
|
138
|
-
}, [closeBool, onToggle, openBool]);
|
|
139
|
-
|
|
140
|
-
<span class="cstat-no" title="statement not covered" > return { open, onToggle };</span>
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
export default useTypedownToggle;
|
|
144
|
-
</pre></td></tr></table></pre>
|
|
145
|
-
|
|
146
|
-
<div class='push'></div><!-- for sticky footer -->
|
|
147
|
-
</div><!-- /wrapper -->
|
|
148
|
-
<div class='footer quiet pad2 space-top1 center small'>
|
|
149
|
-
Code coverage generated by
|
|
150
|
-
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
151
|
-
at Fri Mar 11 2022 16:43:16 GMT+0000 (Greenwich Mean Time)
|
|
152
|
-
</div>
|
|
153
|
-
<script src="../../prettify.js"></script>
|
|
154
|
-
<script>
|
|
155
|
-
window.onload = function () {
|
|
156
|
-
prettyPrint();
|
|
157
|
-
};
|
|
158
|
-
</script>
|
|
159
|
-
<script src="../../sorter.js"></script>
|
|
160
|
-
<script src="../../block-navigation.js"></script>
|
|
161
|
-
</body>
|
|
162
|
-
</html>
|
|
163
|
-
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<title>Code coverage report for hooks/useActiveElement.js</title>
|
|
7
|
-
<meta charset="utf-8" />
|
|
8
|
-
<link rel="stylesheet" href="../prettify.css" />
|
|
9
|
-
<link rel="stylesheet" href="../base.css" />
|
|
10
|
-
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
|
|
11
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
-
<style type='text/css'>
|
|
13
|
-
.coverage-summary .sorter {
|
|
14
|
-
background-image: url(../sort-arrow-sprite.png);
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class='wrapper'>
|
|
21
|
-
<div class='pad1'>
|
|
22
|
-
<h1><a href="../index.html">All files</a> / <a href="index.html">hooks</a> useActiveElement.js</h1>
|
|
23
|
-
<div class='clearfix'>
|
|
24
|
-
|
|
25
|
-
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">0% </span>
|
|
27
|
-
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/11</span>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">100% </span>
|
|
34
|
-
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/0</span>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">0% </span>
|
|
41
|
-
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>0/5</span>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">0% </span>
|
|
48
|
-
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/11</span>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</div>
|
|
54
|
-
<p class="quiet">
|
|
55
|
-
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
-
</p>
|
|
57
|
-
<template id="filterTemplate">
|
|
58
|
-
<div class="quiet">
|
|
59
|
-
Filter:
|
|
60
|
-
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
-
</div>
|
|
62
|
-
</template>
|
|
63
|
-
</div>
|
|
64
|
-
<div class='status-line low'></div>
|
|
65
|
-
<pre><table class="coverage">
|
|
66
|
-
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
|
-
<a name='L2'></a><a href='#L2'>2</a>
|
|
68
|
-
<a name='L3'></a><a href='#L3'>3</a>
|
|
69
|
-
<a name='L4'></a><a href='#L4'>4</a>
|
|
70
|
-
<a name='L5'></a><a href='#L5'>5</a>
|
|
71
|
-
<a name='L6'></a><a href='#L6'>6</a>
|
|
72
|
-
<a name='L7'></a><a href='#L7'>7</a>
|
|
73
|
-
<a name='L8'></a><a href='#L8'>8</a>
|
|
74
|
-
<a name='L9'></a><a href='#L9'>9</a>
|
|
75
|
-
<a name='L10'></a><a href='#L10'>10</a>
|
|
76
|
-
<a name='L11'></a><a href='#L11'>11</a>
|
|
77
|
-
<a name='L12'></a><a href='#L12'>12</a>
|
|
78
|
-
<a name='L13'></a><a href='#L13'>13</a>
|
|
79
|
-
<a name='L14'></a><a href='#L14'>14</a>
|
|
80
|
-
<a name='L15'></a><a href='#L15'>15</a>
|
|
81
|
-
<a name='L16'></a><a href='#L16'>16</a>
|
|
82
|
-
<a name='L17'></a><a href='#L17'>17</a>
|
|
83
|
-
<a name='L18'></a><a href='#L18'>18</a>
|
|
84
|
-
<a name='L19'></a><a href='#L19'>19</a>
|
|
85
|
-
<a name='L20'></a><a href='#L20'>20</a>
|
|
86
|
-
<a name='L21'></a><a href='#L21'>21</a>
|
|
87
|
-
<a name='L22'></a><a href='#L22'>22</a>
|
|
88
|
-
<a name='L23'></a><a href='#L23'>23</a>
|
|
89
|
-
<a name='L24'></a><a href='#L24'>24</a>
|
|
90
|
-
<a name='L25'></a><a href='#L25'>25</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
91
|
-
<span class="cline-any cline-neutral"> </span>
|
|
92
|
-
<span class="cline-any cline-neutral"> </span>
|
|
93
|
-
<span class="cline-any cline-no"> </span>
|
|
94
|
-
<span class="cline-any cline-no"> </span>
|
|
95
|
-
<span class="cline-any cline-neutral"> </span>
|
|
96
|
-
<span class="cline-any cline-no"> </span>
|
|
97
|
-
<span class="cline-any cline-no"> </span>
|
|
98
|
-
<span class="cline-any cline-neutral"> </span>
|
|
99
|
-
<span class="cline-any cline-no"> </span>
|
|
100
|
-
<span class="cline-any cline-no"> </span>
|
|
101
|
-
<span class="cline-any cline-neutral"> </span>
|
|
102
|
-
<span class="cline-any cline-neutral"> </span>
|
|
103
|
-
<span class="cline-any cline-no"> </span>
|
|
104
|
-
<span class="cline-any cline-no"> </span>
|
|
105
|
-
<span class="cline-any cline-no"> </span>
|
|
106
|
-
<span class="cline-any cline-no"> </span>
|
|
107
|
-
<span class="cline-any cline-neutral"> </span>
|
|
108
|
-
<span class="cline-any cline-neutral"> </span>
|
|
109
|
-
<span class="cline-any cline-neutral"> </span>
|
|
110
|
-
<span class="cline-any cline-no"> </span>
|
|
111
|
-
<span class="cline-any cline-neutral"> </span>
|
|
112
|
-
<span class="cline-any cline-neutral"> </span>
|
|
113
|
-
<span class="cline-any cline-neutral"> </span>
|
|
114
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { useEffect, useState } from 'react';
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const useActiveElement = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
118
|
-
const [active, setActive] = <span class="cstat-no" title="statement not covered" >useState(document.activeElement);</span>
|
|
119
|
-
|
|
120
|
-
const handleFocusIn = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
121
|
-
<span class="cstat-no" title="statement not covered" > setActive(document.activeElement);</span>
|
|
122
|
-
};
|
|
123
|
-
const hasParent = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(i</span>d) => {</span>
|
|
124
|
-
<span class="cstat-no" title="statement not covered" > return active.closest(`[id^=${id}]`) !== null;</span>
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
<span class="cstat-no" title="statement not covered" > useEffect(<span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
128
|
-
<span class="cstat-no" title="statement not covered" > document.addEventListener('focusin', handleFocusIn);</span>
|
|
129
|
-
<span class="cstat-no" title="statement not covered" > return <span class="fstat-no" title="function not covered" >()</span> => {</span>
|
|
130
|
-
<span class="cstat-no" title="statement not covered" > document.removeEventListener('focusin', handleFocusIn);</span>
|
|
131
|
-
};
|
|
132
|
-
}, []);
|
|
133
|
-
|
|
134
|
-
<span class="cstat-no" title="statement not covered" > return { active, hasParent };</span>
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
export default useActiveElement;
|
|
138
|
-
</pre></td></tr></table></pre>
|
|
139
|
-
|
|
140
|
-
<div class='push'></div><!-- for sticky footer -->
|
|
141
|
-
</div><!-- /wrapper -->
|
|
142
|
-
<div class='footer quiet pad2 space-top1 center small'>
|
|
143
|
-
Code coverage generated by
|
|
144
|
-
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
145
|
-
at Fri Mar 11 2022 16:43:16 GMT+0000 (Greenwich Mean Time)
|
|
146
|
-
</div>
|
|
147
|
-
<script src="../prettify.js"></script>
|
|
148
|
-
<script>
|
|
149
|
-
window.onload = function () {
|
|
150
|
-
prettyPrint();
|
|
151
|
-
};
|
|
152
|
-
</script>
|
|
153
|
-
<script src="../sorter.js"></script>
|
|
154
|
-
<script src="../block-navigation.js"></script>
|
|
155
|
-
</body>
|
|
156
|
-
</html>
|
|
157
|
-
|