@k-int/stripes-kint-components 2.1.2 → 2.3.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 +26 -4
- package/es/index.js +150 -4
- package/es/lib/ActionList/ActionList.js +10 -2
- package/es/lib/ActionList/ActionListFieldArray.js +53 -11
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +3 -2
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +88 -44
- package/es/lib/CustomProperties/Config/{CustomPropertiesView.js → CustomPropertyView.js} +27 -14
- package/es/lib/CustomProperties/Config/index.js +6 -4
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +72 -0
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +133 -0
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +279 -0
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +370 -0
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +156 -0
- package/es/lib/CustomProperties/Edit/index.js +51 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +216 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +236 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +159 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +119 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +173 -0
- package/es/lib/CustomProperties/Filter/index.js +59 -0
- package/es/lib/CustomProperties/Filter/useOperators.js +138 -0
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +97 -0
- package/es/lib/CustomProperties/Filter/useValueProps.js +101 -0
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +73 -0
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +187 -0
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +204 -0
- package/es/lib/CustomProperties/View/index.js +35 -0
- package/es/lib/CustomProperties/index.js +125 -0
- package/es/lib/EditableRefdataList/EditableRefdataList.js +12 -16
- package/es/lib/FormModal/FormModal.js +20 -11
- package/es/lib/QueryTypedown/QueryTypedown.js +9 -4
- package/es/lib/constants/customProperties.js +4 -1
- package/es/lib/hooks/index.js +16 -0
- package/es/lib/hooks/typedownHooks/useTypedownData.js +9 -2
- package/es/lib/hooks/useAvailableCustomProperties.js +106 -0
- package/es/lib/hooks/useInvalidateRefdata.js +53 -0
- package/es/lib/hooks/useMutateRefdataValue.js +11 -6
- package/es/lib/hooks/useRefdata.js +1 -3
- package/es/lib/utils/groupCustomPropertiesByCtx.js +69 -0
- package/es/lib/utils/index.js +24 -0
- package/es/lib/utils/refdataQueryKey.js +48 -0
- package/es/lib/utils/typedownQueryKey.js +48 -0
- package/es/lib/utils/validators.js +160 -0
- package/git_translate.sh +8 -0
- package/junit.xml +38 -38
- package/package.json +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +11 -2
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +25 -13
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +5 -2
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesView.js.html +75 -9
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +195 -33
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +10 -10
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +7 -22
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/index.html +27 -27
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +16 -10
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +24 -9
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/renderHelpText.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +202 -0
- package/src/artifacts/coverage-jest/lcov.info +366 -296
- package/src/index.js +35 -3
- package/src/lib/ActionList/ActionList.js +8 -2
- package/src/lib/ActionList/ActionListFieldArray.js +44 -17
- package/src/lib/ActionList/README.md +24 -20
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +3 -2
- package/src/lib/CustomProperties/Config/CustomPropertyForm.js +77 -23
- package/src/lib/CustomProperties/Config/{CustomPropertiesView.js → CustomPropertyView.js} +31 -9
- 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 +37 -22
- 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/generateKiwtQueryParams.js +2 -2
- 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 +79 -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 +59 -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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "CustomPropertiesView", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _CustomPropertiesView.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "CustomPropertiesViewCtx", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _CustomPropertiesViewCtx.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "CustomPropertyCard", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _CustomPropertyCard.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
var _CustomPropertiesView = _interopRequireDefault(require("./CustomPropertiesView"));
|
|
26
|
+
|
|
27
|
+
var _CustomPropertiesViewCtx = _interopRequireDefault(require("./CustomPropertiesViewCtx"));
|
|
28
|
+
|
|
29
|
+
var _CustomPropertyCard = _interopRequireDefault(require("./CustomPropertyCard"));
|
|
30
|
+
|
|
31
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
|
+
|
|
33
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
34
|
+
return a;
|
|
35
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "CustomPropertiesEdit", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _Edit.CustomPropertiesEdit;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "CustomPropertiesEditCtx", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _Edit.CustomPropertiesEditCtx;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "CustomPropertiesFilter", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _Filter.CustomPropertiesFilter;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "CustomPropertiesFilterField", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _Filter.CustomPropertiesFilterField;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "CustomPropertiesFilterFieldArray", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _Filter.CustomPropertiesFilterFieldArray;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "CustomPropertiesFilterForm", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _Filter.CustomPropertiesFilterForm;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "CustomPropertiesListField", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _Edit.CustomPropertiesListField;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "CustomPropertiesLookup", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _Config.CustomPropertiesLookup;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "CustomPropertiesSettings", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _Config.CustomPropertiesSettings;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "CustomPropertiesView", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function get() {
|
|
63
|
+
return _View.CustomPropertiesView;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "CustomPropertiesViewCtx", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function get() {
|
|
69
|
+
return _View.CustomPropertiesViewCtx;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "CustomPropertyCard", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function get() {
|
|
75
|
+
return _View.CustomPropertyCard;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "CustomPropertyField", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function get() {
|
|
81
|
+
return _Edit.CustomPropertyField;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "CustomPropertyForm", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function get() {
|
|
87
|
+
return _Config.CustomPropertyForm;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "CustomPropertyFormCard", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function get() {
|
|
93
|
+
return _Edit.CustomPropertyFormCard;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "CustomPropertyView", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function get() {
|
|
99
|
+
return _Config.CustomPropertyView;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "useOperators", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function get() {
|
|
105
|
+
return _Filter.useOperators;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "useParseActiveFilterStrings", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function get() {
|
|
111
|
+
return _Filter.useParseActiveFilterStrings;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
var _Config = require("./Config");
|
|
116
|
+
|
|
117
|
+
var _Edit = require("./Edit");
|
|
118
|
+
|
|
119
|
+
var _View = require("./View");
|
|
120
|
+
|
|
121
|
+
var _Filter = require("./Filter");
|
|
122
|
+
|
|
123
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
124
|
+
return a;
|
|
125
|
+
};
|
|
@@ -123,7 +123,10 @@ var EditableRefdataList = function EditableRefdataList(_ref) {
|
|
|
123
123
|
label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
124
124
|
id: "stripes-kint-components.editableRefdataList.edit"
|
|
125
125
|
}),
|
|
126
|
-
icon: 'edit'
|
|
126
|
+
icon: 'edit',
|
|
127
|
+
callback: function callback(data) {
|
|
128
|
+
return editRefdataValue(data);
|
|
129
|
+
}
|
|
127
130
|
}];
|
|
128
131
|
|
|
129
132
|
if (!(refdata !== null && refdata !== void 0 && refdata.internal)) {
|
|
@@ -132,27 +135,18 @@ var EditableRefdataList = function EditableRefdataList(_ref) {
|
|
|
132
135
|
label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
133
136
|
id: "stripes-kint-components.editableRefdataList.delete"
|
|
134
137
|
}),
|
|
135
|
-
icon: 'trash'
|
|
138
|
+
icon: 'trash',
|
|
139
|
+
callback: function callback(data) {
|
|
140
|
+
return deleteRefdataValue(data.id);
|
|
141
|
+
}
|
|
136
142
|
});
|
|
137
143
|
}
|
|
138
144
|
|
|
139
145
|
return actionArray;
|
|
140
146
|
};
|
|
141
147
|
|
|
142
|
-
var actionCalls = {
|
|
143
|
-
create: refdata !== null && refdata !== void 0 && refdata.internal ? null : function (data) {
|
|
144
|
-
return editRefdataValue(data);
|
|
145
|
-
},
|
|
146
|
-
edit: function edit(data) {
|
|
147
|
-
return editRefdataValue(data);
|
|
148
|
-
},
|
|
149
|
-
delete: function _delete(data) {
|
|
150
|
-
return deleteRefdataValue(data.id);
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
148
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionList.default, {
|
|
154
149
|
actionAssigner: actionAssigner,
|
|
155
|
-
actionCalls: actionCalls,
|
|
156
150
|
columnMapping: {
|
|
157
151
|
label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
158
152
|
id: "stripes-kint-components.editableRefdataList.label"
|
|
@@ -167,13 +161,15 @@ var EditableRefdataList = function EditableRefdataList(_ref) {
|
|
|
167
161
|
return false;
|
|
168
162
|
}
|
|
169
163
|
},
|
|
164
|
+
createCallback: refdata !== null && refdata !== void 0 && refdata.internal ? null : function (data) {
|
|
165
|
+
return editRefdataValue(data);
|
|
166
|
+
},
|
|
170
167
|
editableFields: {
|
|
171
168
|
value: function value() {
|
|
172
169
|
return false;
|
|
173
170
|
}
|
|
174
171
|
},
|
|
175
|
-
visibleFields: ['label', 'value']
|
|
176
|
-
|
|
172
|
+
visibleFields: ['label', 'value']
|
|
177
173
|
});
|
|
178
174
|
};
|
|
179
175
|
|
|
@@ -15,8 +15,8 @@ var _components = require("@folio/stripes/components");
|
|
|
15
15
|
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
|
|
18
|
-
var _excluded = ["onClose"],
|
|
19
|
-
_excluded2 = ["children", "modalProps", "onSubmit"];
|
|
18
|
+
var _excluded = ["footer", "onClose"],
|
|
19
|
+
_excluded2 = ["children", "labelOverrides", "modalProps", "onSubmit"];
|
|
20
20
|
|
|
21
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
22
|
|
|
@@ -41,7 +41,10 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
|
|
|
41
41
|
|
|
42
42
|
var FormModal = function FormModal(_ref) {
|
|
43
43
|
var _children = _ref.children,
|
|
44
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
45
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
44
46
|
_ref$modalProps = _ref.modalProps,
|
|
47
|
+
footer = _ref$modalProps.footer,
|
|
45
48
|
onClose = _ref$modalProps.onClose,
|
|
46
49
|
modalProps = _objectWithoutProperties(_ref$modalProps, _excluded),
|
|
47
50
|
onSubmit = _ref.onSubmit,
|
|
@@ -59,22 +62,26 @@ var FormModal = function FormModal(_ref) {
|
|
|
59
62
|
restart();
|
|
60
63
|
};
|
|
61
64
|
|
|
62
|
-
var handleSubmitAndClear = function handleSubmitAndClear() {
|
|
63
|
-
handleSubmit();
|
|
64
|
-
restart();
|
|
65
|
-
};
|
|
66
|
-
|
|
67
65
|
var renderFooter = function renderFooter() {
|
|
66
|
+
var _labelOverrides$save, _labelOverrides$cance;
|
|
67
|
+
|
|
68
|
+
if (footer) {
|
|
69
|
+
return footer({
|
|
70
|
+
handleSubmit: handleSubmit,
|
|
71
|
+
handleClose: handleClose
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
68
75
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.ModalFooter, {
|
|
69
76
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
70
77
|
buttonStyle: "primary",
|
|
71
|
-
onClick:
|
|
72
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
78
|
+
onClick: handleSubmit,
|
|
79
|
+
children: (_labelOverrides$save = labelOverrides.save) !== null && _labelOverrides$save !== void 0 ? _labelOverrides$save : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
73
80
|
id: "stripes-kint-components.save"
|
|
74
81
|
})
|
|
75
82
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
76
83
|
onClick: handleClose,
|
|
77
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
84
|
+
children: (_labelOverrides$cance = labelOverrides.cancel) !== null && _labelOverrides$cance !== void 0 ? _labelOverrides$cance : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
78
85
|
id: "stripes-kint-components.cancel"
|
|
79
86
|
})
|
|
80
87
|
})]
|
|
@@ -82,7 +89,7 @@ var FormModal = function FormModal(_ref) {
|
|
|
82
89
|
};
|
|
83
90
|
|
|
84
91
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("form", {
|
|
85
|
-
onSubmit:
|
|
92
|
+
onSubmit: handleSubmit,
|
|
86
93
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Modal, _objectSpread(_objectSpread({
|
|
87
94
|
enforceFocus: false,
|
|
88
95
|
footer: renderFooter(),
|
|
@@ -97,7 +104,9 @@ var FormModal = function FormModal(_ref) {
|
|
|
97
104
|
|
|
98
105
|
FormModal.propTypes = {
|
|
99
106
|
children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node, _propTypes.default.func]),
|
|
107
|
+
labelOverrides: _propTypes.default.object,
|
|
100
108
|
modalProps: _propTypes.default.shape({
|
|
109
|
+
footer: _propTypes.default.func,
|
|
101
110
|
onClose: _propTypes.default.func
|
|
102
111
|
}),
|
|
103
112
|
onSubmit: _propTypes.default.func
|
|
@@ -17,7 +17,7 @@ var _typedownHooks = require("../hooks/typedownHooks");
|
|
|
17
17
|
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
|
|
20
|
-
var _excluded = ["path", "pathMutator"];
|
|
20
|
+
var _excluded = ["dataFormatter", "path", "pathMutator"];
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
@@ -57,7 +57,11 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
var QueryTypedown = function QueryTypedown(_ref) {
|
|
60
|
-
var
|
|
60
|
+
var _ref$dataFormatter = _ref.dataFormatter,
|
|
61
|
+
dataFormatter = _ref$dataFormatter === void 0 ? function (d) {
|
|
62
|
+
return d;
|
|
63
|
+
} : _ref$dataFormatter,
|
|
64
|
+
path = _ref.path,
|
|
61
65
|
pathMutator = _ref.pathMutator,
|
|
62
66
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
63
67
|
|
|
@@ -66,7 +70,7 @@ var QueryTypedown = function QueryTypedown(_ref) {
|
|
|
66
70
|
callPath = _useState2[0],
|
|
67
71
|
setCallPath = _useState2[1];
|
|
68
72
|
|
|
69
|
-
var data = (0, _typedownHooks.useTypedownData)(callPath);
|
|
73
|
+
var data = dataFormatter((0, _typedownHooks.useTypedownData)(path, callPath));
|
|
70
74
|
|
|
71
75
|
var onType = function onType(e) {
|
|
72
76
|
setCallPath(pathMutator(e.target.value, path));
|
|
@@ -78,11 +82,12 @@ var QueryTypedown = function QueryTypedown(_ref) {
|
|
|
78
82
|
}));
|
|
79
83
|
};
|
|
80
84
|
|
|
81
|
-
__signature__(QueryTypedown, "useState{[callPath, setCallPath](pathMutator(null, path))}\nuseTypedownData{
|
|
85
|
+
__signature__(QueryTypedown, "useState{[callPath, setCallPath](pathMutator(null, path))}\nuseTypedownData{}", function () {
|
|
82
86
|
return [_typedownHooks.useTypedownData];
|
|
83
87
|
});
|
|
84
88
|
|
|
85
89
|
QueryTypedown.propTypes = {
|
|
90
|
+
dataFormatter: _propTypes.default.func,
|
|
86
91
|
path: _propTypes.default.string,
|
|
87
92
|
pathMutator: _propTypes.default.func
|
|
88
93
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TYPE_CLASS_PREFIX = exports.TEXT_CLASS_NAME = exports.REFDATA_DEFINITION_CLASS_NAME = exports.REFDATA_CLASS_NAME = exports.INTEGER_CLASS_NAME = exports.DECIMAL_CLASS_NAME = exports.CONTAINER_CLASS_NAME = exports.BOOLEAN_CLASS_NAME = exports.BLOB_CLASS_NAME = void 0;
|
|
6
|
+
exports.TYPE_CLASS_PREFIX = exports.TEXT_CLASS_NAME = exports.REFDATA_DEFINITION_CLASS_NAME = exports.REFDATA_CLASS_NAME = exports.INTEGER_CLASS_NAME = exports.DECIMAL_CLASS_NAME = exports.DATE_CLASS_NAME = exports.CONTAINER_CLASS_NAME = exports.BOOLEAN_CLASS_NAME = exports.BLOB_CLASS_NAME = void 0;
|
|
7
7
|
|
|
8
8
|
(function () {
|
|
9
9
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
@@ -32,6 +32,8 @@ var REFDATA_DEFINITION_CLASS_NAME = 'com.k_int.web.toolkit.custprops.types.Custo
|
|
|
32
32
|
exports.REFDATA_DEFINITION_CLASS_NAME = REFDATA_DEFINITION_CLASS_NAME;
|
|
33
33
|
var TEXT_CLASS_NAME = 'com.k_int.web.toolkit.custprops.types.CustomPropertyText';
|
|
34
34
|
exports.TEXT_CLASS_NAME = TEXT_CLASS_NAME;
|
|
35
|
+
var DATE_CLASS_NAME = 'com.k_int.web.toolkit.custprops.types.CustomPropertyLocalDate';
|
|
36
|
+
exports.DATE_CLASS_NAME = DATE_CLASS_NAME;
|
|
35
37
|
;
|
|
36
38
|
|
|
37
39
|
(function () {
|
|
@@ -50,6 +52,7 @@ exports.TEXT_CLASS_NAME = TEXT_CLASS_NAME;
|
|
|
50
52
|
reactHotLoader.register(REFDATA_CLASS_NAME, "REFDATA_CLASS_NAME", "/home/ethan/FolioModules/stripes-kint-components/src/lib/constants/customProperties.js");
|
|
51
53
|
reactHotLoader.register(REFDATA_DEFINITION_CLASS_NAME, "REFDATA_DEFINITION_CLASS_NAME", "/home/ethan/FolioModules/stripes-kint-components/src/lib/constants/customProperties.js");
|
|
52
54
|
reactHotLoader.register(TEXT_CLASS_NAME, "TEXT_CLASS_NAME", "/home/ethan/FolioModules/stripes-kint-components/src/lib/constants/customProperties.js");
|
|
55
|
+
reactHotLoader.register(DATE_CLASS_NAME, "DATE_CLASS_NAME", "/home/ethan/FolioModules/stripes-kint-components/src/lib/constants/customProperties.js");
|
|
53
56
|
})();
|
|
54
57
|
|
|
55
58
|
;
|
package/es/lib/hooks/index.js
CHANGED
|
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "useActiveElement", {
|
|
|
9
9
|
return _useActiveElement.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "useAvailableCustomProperties", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _useAvailableCustomProperties.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
Object.defineProperty(exports, "useCustomProperties", {
|
|
13
19
|
enumerable: true,
|
|
14
20
|
get: function get() {
|
|
@@ -21,6 +27,12 @@ Object.defineProperty(exports, "useHelperApp", {
|
|
|
21
27
|
return _useHelperApp.default;
|
|
22
28
|
}
|
|
23
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "useInvalidateRefdata", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _useInvalidateRefdata.default;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
24
36
|
Object.defineProperty(exports, "useKiwtFieldArray", {
|
|
25
37
|
enumerable: true,
|
|
26
38
|
get: function get() {
|
|
@@ -106,6 +118,10 @@ var _useCustomProperties = _interopRequireDefault(require("./useCustomProperties
|
|
|
106
118
|
|
|
107
119
|
var _useMutateCustomProperties = _interopRequireDefault(require("./useMutateCustomProperties"));
|
|
108
120
|
|
|
121
|
+
var _useAvailableCustomProperties = _interopRequireDefault(require("./useAvailableCustomProperties"));
|
|
122
|
+
|
|
123
|
+
var _useInvalidateRefdata = _interopRequireDefault(require("./useInvalidateRefdata"));
|
|
124
|
+
|
|
109
125
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
110
126
|
|
|
111
127
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
@@ -11,6 +11,8 @@ var _reactQuery = require("react-query");
|
|
|
11
11
|
|
|
12
12
|
var _core = require("@folio/stripes/core");
|
|
13
13
|
|
|
14
|
+
var _utils = require("../../utils");
|
|
15
|
+
|
|
14
16
|
(function () {
|
|
15
17
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
16
18
|
enterModule && enterModule(module);
|
|
@@ -32,11 +34,16 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
|
|
|
32
34
|
return a;
|
|
33
35
|
};
|
|
34
36
|
|
|
35
|
-
var useTypedownData = function useTypedownData(callPath) {
|
|
37
|
+
var useTypedownData = function useTypedownData(path, callPath) {
|
|
36
38
|
var ky = (0, _core.useOkapiKy)();
|
|
39
|
+
var queryKey = (0, _utils.typedownQueryKey)(path);
|
|
40
|
+
|
|
41
|
+
if (callPath) {
|
|
42
|
+
queryKey.push(callPath);
|
|
43
|
+
}
|
|
37
44
|
|
|
38
45
|
var _useQuery = (0, _reactQuery.useQuery)( // Ensure when multiple apps are using this function that each one gets memoized individually
|
|
39
|
-
|
|
46
|
+
queryKey, function () {
|
|
40
47
|
return ky(callPath).json();
|
|
41
48
|
}),
|
|
42
49
|
data = _useQuery.data,
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _reactIntl = require("react-intl");
|
|
11
|
+
|
|
12
|
+
(function () {
|
|
13
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
14
|
+
enterModule && enterModule(module);
|
|
15
|
+
})();
|
|
16
|
+
|
|
17
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
18
|
+
|
|
19
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
|
+
|
|
21
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
22
|
+
|
|
23
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
24
|
+
|
|
25
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
26
|
+
|
|
27
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
28
|
+
|
|
29
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
30
|
+
|
|
31
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
32
|
+
|
|
33
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
34
|
+
|
|
35
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
36
|
+
|
|
37
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
38
|
+
return a;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
var useAvailableCustomProperties = function useAvailableCustomProperties() {
|
|
42
|
+
var customProperties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
43
|
+
var intl = (0, _reactIntl.useIntl)();
|
|
44
|
+
|
|
45
|
+
var _useState = (0, _react.useState)([]),
|
|
46
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
47
|
+
custProps = _useState2[0],
|
|
48
|
+
setCustProps = _useState2[1];
|
|
49
|
+
|
|
50
|
+
(0, _react.useEffect)(function () {
|
|
51
|
+
if (customProperties.length !== custProps.length) {
|
|
52
|
+
setCustProps(customProperties.map(function (customProperty) {
|
|
53
|
+
var _customProperty$categ;
|
|
54
|
+
|
|
55
|
+
var options = customProperty === null || customProperty === void 0 ? void 0 : (_customProperty$categ = customProperty.category) === null || _customProperty$categ === void 0 ? void 0 : _customProperty$categ.values;
|
|
56
|
+
|
|
57
|
+
if (options) {
|
|
58
|
+
options = [{
|
|
59
|
+
label: intl.formatMessage({
|
|
60
|
+
id: 'stripes-kint-components.notSet'
|
|
61
|
+
}),
|
|
62
|
+
value: ''
|
|
63
|
+
}].concat(_toConsumableArray(options));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
description: customProperty.description,
|
|
68
|
+
label: customProperty.label,
|
|
69
|
+
primary: customProperty.primary,
|
|
70
|
+
type: customProperty.type,
|
|
71
|
+
options: options,
|
|
72
|
+
value: customProperty.name,
|
|
73
|
+
defaultInternal: customProperty.defaultInternal
|
|
74
|
+
};
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
}, [custProps, customProperties, intl]);
|
|
78
|
+
return custProps;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
__signature__(useAvailableCustomProperties, "useIntl{intl}\nuseState{[custProps, setCustProps]([])}\nuseEffect{}", function () {
|
|
82
|
+
return [_reactIntl.useIntl];
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
var _default = useAvailableCustomProperties;
|
|
86
|
+
var _default2 = _default;
|
|
87
|
+
exports.default = _default2;
|
|
88
|
+
;
|
|
89
|
+
|
|
90
|
+
(function () {
|
|
91
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
92
|
+
|
|
93
|
+
if (!reactHotLoader) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
reactHotLoader.register(useAvailableCustomProperties, "useAvailableCustomProperties", "/home/ethan/FolioModules/stripes-kint-components/src/lib/hooks/useAvailableCustomProperties.js");
|
|
98
|
+
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/hooks/useAvailableCustomProperties.js");
|
|
99
|
+
})();
|
|
100
|
+
|
|
101
|
+
;
|
|
102
|
+
|
|
103
|
+
(function () {
|
|
104
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
105
|
+
leaveModule && leaveModule(module);
|
|
106
|
+
})();
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactQuery = require("react-query");
|
|
9
|
+
|
|
10
|
+
var _utils = require("../utils");
|
|
11
|
+
|
|
12
|
+
(function () {
|
|
13
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
14
|
+
enterModule && enterModule(module);
|
|
15
|
+
})();
|
|
16
|
+
|
|
17
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var useInvalidateRefdata = function useInvalidateRefdata(desc) {
|
|
22
|
+
var queryClient = (0, _reactQuery.useQueryClient)();
|
|
23
|
+
return function () {
|
|
24
|
+
return queryClient.invalidateQueries((0, _utils.refdataQueryKey)(desc));
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
__signature__(useInvalidateRefdata, "useQueryClient{queryClient}", function () {
|
|
29
|
+
return [_reactQuery.useQueryClient];
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
var _default = useInvalidateRefdata;
|
|
33
|
+
var _default2 = _default;
|
|
34
|
+
exports.default = _default2;
|
|
35
|
+
;
|
|
36
|
+
|
|
37
|
+
(function () {
|
|
38
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
39
|
+
|
|
40
|
+
if (!reactHotLoader) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
reactHotLoader.register(useInvalidateRefdata, "useInvalidateRefdata", "/home/ethan/FolioModules/stripes-kint-components/src/lib/hooks/useInvalidateRefdata.js");
|
|
45
|
+
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/hooks/useInvalidateRefdata.js");
|
|
46
|
+
})();
|
|
47
|
+
|
|
48
|
+
;
|
|
49
|
+
|
|
50
|
+
(function () {
|
|
51
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
52
|
+
leaveModule && leaveModule(module);
|
|
53
|
+
})();
|
|
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactQuery = require("react-query");
|
|
11
9
|
|
|
12
10
|
var _core = require("@folio/stripes/core");
|
|
13
11
|
|
|
12
|
+
var _useInvalidateRefdata = _interopRequireDefault(require("./useInvalidateRefdata"));
|
|
13
|
+
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
16
|
(function () {
|
|
@@ -38,6 +38,7 @@ var useMutateRefdataValue = function useMutateRefdataValue(_ref) {
|
|
|
38
38
|
} : _ref$returnQueryObjec;
|
|
39
39
|
var returnObj = {};
|
|
40
40
|
var ky = (0, _core.useOkapiKy)();
|
|
41
|
+
var invalidateRefdata = (0, _useInvalidateRefdata.default)();
|
|
41
42
|
var deleteQueryObject = (0, _reactQuery.useMutation)(['stripes-kint-components', 'useMutateRefdataValue', 'delete', id], /*#__PURE__*/function () {
|
|
42
43
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(data) {
|
|
43
44
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -52,7 +53,9 @@ var useMutateRefdataValue = function useMutateRefdataValue(_ref) {
|
|
|
52
53
|
_delete: true
|
|
53
54
|
}]
|
|
54
55
|
}
|
|
55
|
-
}).json().then(afterQueryCalls === null || afterQueryCalls === void 0 ? void 0 : afterQueryCalls.delete))
|
|
56
|
+
}).json().then(afterQueryCalls === null || afterQueryCalls === void 0 ? void 0 : afterQueryCalls.delete).then(function () {
|
|
57
|
+
return invalidateRefdata();
|
|
58
|
+
}));
|
|
56
59
|
|
|
57
60
|
case 1:
|
|
58
61
|
case "end":
|
|
@@ -77,7 +80,9 @@ var useMutateRefdataValue = function useMutateRefdataValue(_ref) {
|
|
|
77
80
|
id: id,
|
|
78
81
|
values: [data]
|
|
79
82
|
}
|
|
80
|
-
}).json().then(afterQueryCalls === null || afterQueryCalls === void 0 ? void 0 : afterQueryCalls.put))
|
|
83
|
+
}).json().then(afterQueryCalls === null || afterQueryCalls === void 0 ? void 0 : afterQueryCalls.put).then(function () {
|
|
84
|
+
return invalidateRefdata();
|
|
85
|
+
}));
|
|
81
86
|
|
|
82
87
|
case 1:
|
|
83
88
|
case "end":
|
|
@@ -107,8 +112,8 @@ var useMutateRefdataValue = function useMutateRefdataValue(_ref) {
|
|
|
107
112
|
return returnObj;
|
|
108
113
|
};
|
|
109
114
|
|
|
110
|
-
__signature__(useMutateRefdataValue, "useOkapiKy{ky}\nuseMutation{deleteQueryObject}\nuseMutation{putQueryObject}", function () {
|
|
111
|
-
return [_core.useOkapiKy, _reactQuery.useMutation, _reactQuery.useMutation];
|
|
115
|
+
__signature__(useMutateRefdataValue, "useOkapiKy{ky}\nuseInvalidateRefdata{invalidateRefdata}\nuseMutation{deleteQueryObject}\nuseMutation{putQueryObject}", function () {
|
|
116
|
+
return [_core.useOkapiKy, _useInvalidateRefdata.default, _reactQuery.useMutation, _reactQuery.useMutation];
|
|
112
117
|
});
|
|
113
118
|
|
|
114
119
|
var _default = useMutateRefdataValue;
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
9
|
|
|
12
10
|
var _reactQuery = require("react-query");
|
|
@@ -54,7 +52,7 @@ var useRefdata = function useRefdata(_ref) {
|
|
|
54
52
|
|
|
55
53
|
var query = (0, _utils.generateKiwtQuery)(options, nsValues);
|
|
56
54
|
var path = "".concat(endpoint).concat(query);
|
|
57
|
-
var queryObject = (0, _reactQuery.useQuery)(
|
|
55
|
+
var queryObject = (0, _reactQuery.useQuery)((0, _utils.refdataQueryKey)(desc), function () {
|
|
58
56
|
return ky(path).json();
|
|
59
57
|
}, queryParams);
|
|
60
58
|
|