@k-int/stripes-kint-components 1.7.0 → 2.0.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 +18 -0
- package/es/index.js +43 -8
- package/es/lib/ActionList/ActionList.js +48 -28
- package/es/lib/ActionList/ActionListFieldArray.js +52 -16
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +198 -0
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +321 -0
- package/es/lib/CustomProperties/Config/CustomPropertiesView.js +166 -0
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +357 -0
- package/es/lib/CustomProperties/Config/index.js +41 -0
- package/es/lib/FormModal/FormModal.js +126 -0
- package/es/lib/{TypeDown → FormModal}/index.js +2 -2
- package/es/lib/NoResultsMessage/NoResultsMessage.js +1 -1
- package/es/lib/Typedown/Typedown.js +44 -13
- package/es/lib/constants/customProperties.js +60 -0
- package/es/lib/hooks/index.js +16 -0
- package/es/lib/hooks/useCustomProperties.js +112 -0
- package/es/lib/hooks/useMutateCustomProperties.js +143 -0
- package/package.json +4 -2
- package/src/index.js +11 -4
- package/src/lib/ActionList/ActionList.js +30 -23
- package/src/lib/ActionList/ActionListFieldArray.js +36 -2
- package/src/lib/ActionList/README.md +4 -1
- package/src/lib/CustomProperties/Config/CustomPropertiesLookup.js +111 -0
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +237 -0
- package/src/lib/CustomProperties/Config/CustomPropertiesView.js +150 -0
- package/src/lib/CustomProperties/Config/CustomPropertyForm.js +295 -0
- package/src/lib/CustomProperties/Config/index.js +4 -0
- package/src/lib/FormModal/FormModal.js +71 -0
- package/src/lib/FormModal/index.js +1 -0
- package/src/lib/NoResultsMessage/NoResultsMessage.js +2 -2
- package/src/lib/Typedown/Typedown.js +50 -8
- package/src/lib/constants/customProperties.js +9 -0
- package/src/lib/hooks/index.js +2 -0
- package/src/lib/hooks/useCustomProperties.js +73 -0
- package/src/lib/hooks/useMutateCustomProperties.js +62 -0
- package/translations/stripes-kint-components/en.json +47 -1
- package/yarn-error.log +14118 -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/es/lib/TypeDown/TypeDown.js +0 -251
- package/junit.xml +0 -79
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +0 -256
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +0 -799
- 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/EditableRefdataList/EditableRefdataList.js.html +0 -376
- 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/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 -274
- 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 -250
- 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 -769
- 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/Typedown/Typedown.js.html +0 -790
- 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/eventCodes.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +0 -116
- 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 -251
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +0 -115
- 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/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/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 -401
- 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 -286
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +0 -236
- 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.info +0 -1999
- package/src/lib/TypeDown/README.md +0 -1
- package/src/lib/TypeDown/TypeDown.js +0 -228
- package/src/lib/TypeDown/index.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
DEPRECATED - DO NOT USE. You probably want Typedown
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import classnames from 'classnames';
|
|
4
|
-
|
|
5
|
-
import get from 'lodash/get';
|
|
6
|
-
|
|
7
|
-
import { EndOfList, IconButton, Popper } from '@folio/stripes/components';
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
10
|
-
import { interactionStyles } from '@folio/stripes-components/lib/sharedStyles/interactionStyles.css';
|
|
11
|
-
|
|
12
|
-
import SearchField from '../SearchField';
|
|
13
|
-
import css from '../../../styles/TypeDown.css';
|
|
14
|
-
|
|
15
|
-
import { useTypedown, useTypedownData } from '../hooks/typedownHooks';
|
|
16
|
-
import selectorSafe from '../utils/selectorSafe';
|
|
17
|
-
|
|
18
|
-
/* @deprecated
|
|
19
|
-
* Replaced by Typedown and QueryTypedown.
|
|
20
|
-
*/
|
|
21
|
-
const TypeDown = ({
|
|
22
|
-
input,
|
|
23
|
-
meta,
|
|
24
|
-
onChange,
|
|
25
|
-
path,
|
|
26
|
-
pathMutator,
|
|
27
|
-
renderFooter = null,
|
|
28
|
-
renderListItem = null,
|
|
29
|
-
uniqueIdentificationPath = 'id'
|
|
30
|
-
}) => {
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
if (process.env.NODE_ENV === 'development') {
|
|
33
|
-
// eslint-disable-next-line no-console
|
|
34
|
-
console.warn('TypeDown component is deprecated, you likely want either Typedown or QueryTypedown');
|
|
35
|
-
}
|
|
36
|
-
}, []);
|
|
37
|
-
|
|
38
|
-
const selectedUniqueId = get(input.value, uniqueIdentificationPath);
|
|
39
|
-
|
|
40
|
-
const [callPath, setCallPath] = useState(pathMutator(null, path));
|
|
41
|
-
const data = useTypedownData(callPath);
|
|
42
|
-
|
|
43
|
-
// Hook to set up all the essentials
|
|
44
|
-
const {
|
|
45
|
-
refs: {
|
|
46
|
-
listRef,
|
|
47
|
-
triggerRef,
|
|
48
|
-
overlayRef,
|
|
49
|
-
footerRef
|
|
50
|
-
},
|
|
51
|
-
handlers: {
|
|
52
|
-
handleNextFocus,
|
|
53
|
-
listKeyDownHandler,
|
|
54
|
-
searchFieldKeyDownHandler
|
|
55
|
-
},
|
|
56
|
-
variables: {
|
|
57
|
-
open,
|
|
58
|
-
portal,
|
|
59
|
-
resizeRef,
|
|
60
|
-
searchWidth
|
|
61
|
-
}
|
|
62
|
-
} = useTypedown(input.name);
|
|
63
|
-
|
|
64
|
-
const renderItem = useCallback((option) => (
|
|
65
|
-
<div
|
|
66
|
-
className={css.listItem}
|
|
67
|
-
>
|
|
68
|
-
{renderListItem ?
|
|
69
|
-
renderListItem(option) :
|
|
70
|
-
get(option, uniqueIdentificationPath)
|
|
71
|
-
}
|
|
72
|
-
</div>
|
|
73
|
-
), [renderListItem, uniqueIdentificationPath]);
|
|
74
|
-
|
|
75
|
-
const handleChange = useCallback(value => {
|
|
76
|
-
input.onChange(value);
|
|
77
|
-
|
|
78
|
-
if (typeof onChange === 'function') {
|
|
79
|
-
onChange(value);
|
|
80
|
-
}
|
|
81
|
-
}, [input, onChange]);
|
|
82
|
-
|
|
83
|
-
const dropDown = useCallback(() => {
|
|
84
|
-
return (
|
|
85
|
-
<div
|
|
86
|
-
className={css.dropdownMenu}
|
|
87
|
-
id={`typedown-parent-${selectorSafe(input.name)}-menu`}
|
|
88
|
-
style={{ '--searchWidth': `${searchWidth}px` }}
|
|
89
|
-
>
|
|
90
|
-
<div
|
|
91
|
-
ref={listRef}
|
|
92
|
-
className={css.listContainer}
|
|
93
|
-
id="typedown-list"
|
|
94
|
-
>
|
|
95
|
-
{data?.length ? data?.map((d, index) => {
|
|
96
|
-
const isSelected = get(input.value, uniqueIdentificationPath) === get(d, uniqueIdentificationPath);
|
|
97
|
-
return (
|
|
98
|
-
<button
|
|
99
|
-
key={`typedown-button-[${index}]`}
|
|
100
|
-
className={classnames(
|
|
101
|
-
interactionStyles,
|
|
102
|
-
css.fullWidth,
|
|
103
|
-
css.menuButton
|
|
104
|
-
)}
|
|
105
|
-
data-selected={isSelected}
|
|
106
|
-
id={`typedown-button-[${index}]`}
|
|
107
|
-
onClick={() => {
|
|
108
|
-
handleChange(d);
|
|
109
|
-
handleNextFocus();
|
|
110
|
-
}}
|
|
111
|
-
onKeyDown={listKeyDownHandler}
|
|
112
|
-
type="button"
|
|
113
|
-
>
|
|
114
|
-
{renderItem(d)}
|
|
115
|
-
</button>
|
|
116
|
-
);
|
|
117
|
-
}) :
|
|
118
|
-
// TODO test this
|
|
119
|
-
<EndOfList />
|
|
120
|
-
}
|
|
121
|
-
</div>
|
|
122
|
-
{renderFooter &&
|
|
123
|
-
<div
|
|
124
|
-
ref={footerRef}
|
|
125
|
-
className={css.footer}
|
|
126
|
-
id="typedown-footer"
|
|
127
|
-
>
|
|
128
|
-
{renderFooter()}
|
|
129
|
-
</div>
|
|
130
|
-
}
|
|
131
|
-
</div>
|
|
132
|
-
);
|
|
133
|
-
}, [
|
|
134
|
-
data,
|
|
135
|
-
footerRef,
|
|
136
|
-
handleChange,
|
|
137
|
-
handleNextFocus,
|
|
138
|
-
input,
|
|
139
|
-
listKeyDownHandler,
|
|
140
|
-
listRef,
|
|
141
|
-
renderFooter,
|
|
142
|
-
renderItem,
|
|
143
|
-
searchWidth,
|
|
144
|
-
uniqueIdentificationPath
|
|
145
|
-
]);
|
|
146
|
-
|
|
147
|
-
const renderSearchField = () => {
|
|
148
|
-
return (
|
|
149
|
-
<div
|
|
150
|
-
ref={triggerRef}
|
|
151
|
-
id={`typedown-parent-${selectorSafe(input.name)}-searchField`}
|
|
152
|
-
>
|
|
153
|
-
<SearchField
|
|
154
|
-
// Pass meta through so correct styling gets applied to the TextField
|
|
155
|
-
id="typedown-searchField"
|
|
156
|
-
marginBottom0
|
|
157
|
-
meta={meta}
|
|
158
|
-
onChange={e => {
|
|
159
|
-
setCallPath(pathMutator(e.target.value, path));
|
|
160
|
-
}}
|
|
161
|
-
onKeyDown={searchFieldKeyDownHandler}
|
|
162
|
-
/>
|
|
163
|
-
</div>
|
|
164
|
-
);
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
return (
|
|
168
|
-
<div
|
|
169
|
-
ref={resizeRef}
|
|
170
|
-
>
|
|
171
|
-
{renderSearchField()}
|
|
172
|
-
<Popper
|
|
173
|
-
key="typedown-menu-toggle"
|
|
174
|
-
anchorRef={triggerRef}
|
|
175
|
-
className={classnames(
|
|
176
|
-
css.dropdown,
|
|
177
|
-
css.fullWidth
|
|
178
|
-
)}
|
|
179
|
-
isOpen={open}
|
|
180
|
-
modifiers={{
|
|
181
|
-
flip: { boundariesElement: 'viewport', padding: 10 },
|
|
182
|
-
preventOverflow: { boundariesElement: 'viewport', padding: 10 }
|
|
183
|
-
}}
|
|
184
|
-
overlayProps={{
|
|
185
|
-
'ref': overlayRef,
|
|
186
|
-
'tabIndex': '-1',
|
|
187
|
-
'onClick': (e) => { e.stopPropagation(); } // prevent propagation of click events
|
|
188
|
-
}}
|
|
189
|
-
overlayRef={overlayRef}
|
|
190
|
-
portal={portal}
|
|
191
|
-
>
|
|
192
|
-
{dropDown()}
|
|
193
|
-
</Popper>
|
|
194
|
-
{selectedUniqueId && !open &&
|
|
195
|
-
<div
|
|
196
|
-
className={classnames(
|
|
197
|
-
css.selected,
|
|
198
|
-
css.selectedDisplay
|
|
199
|
-
)}
|
|
200
|
-
>
|
|
201
|
-
<div
|
|
202
|
-
className={css.selectedItem}
|
|
203
|
-
>
|
|
204
|
-
{renderItem(input.value)}
|
|
205
|
-
</div>
|
|
206
|
-
<IconButton
|
|
207
|
-
className={css.clearItem}
|
|
208
|
-
icon="times-circle-solid"
|
|
209
|
-
onClick={() => handleChange()}
|
|
210
|
-
/>
|
|
211
|
-
</div>
|
|
212
|
-
}
|
|
213
|
-
</div>
|
|
214
|
-
);
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
TypeDown.propTypes = {
|
|
218
|
-
input: PropTypes.object,
|
|
219
|
-
meta: PropTypes.object,
|
|
220
|
-
onChange: PropTypes.func,
|
|
221
|
-
path: PropTypes.string,
|
|
222
|
-
pathMutator: PropTypes.func,
|
|
223
|
-
renderFooter: PropTypes.func,
|
|
224
|
-
renderListItem: PropTypes.func,
|
|
225
|
-
uniqueIdentificationPath: PropTypes.string
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
export default TypeDown;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './TypeDown';
|