@headless-adminapp/app 1.1.6 → 1.1.8
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/app/index.d.ts +0 -1
- package/app/index.js +1 -3
- package/builders/DefineFormExperience.d.ts +1 -1
- package/components/ScrollView/index.d.ts +1 -0
- package/components/ScrollView/index.js +24 -1
- package/dataform/utils/index.d.ts +2 -2
- package/index.css +29 -0
- package/metadata/hooks/useExperienceViewCommands.js +2 -2
- package/metadata/hooks/useExperienceViewSubgridCommands.js +2 -2
- package/package.json +2 -2
package/app/index.d.ts
CHANGED
package/app/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AppProvider = exports.useAppContext = exports.AppContext = void 0;
|
|
4
4
|
var context_1 = require("./context");
|
|
5
5
|
Object.defineProperty(exports, "AppContext", { enumerable: true, get: function () { return context_1.AppContext; } });
|
|
6
6
|
var hooks_1 = require("./hooks");
|
|
7
7
|
Object.defineProperty(exports, "useAppContext", { enumerable: true, get: function () { return hooks_1.useAppContext; } });
|
|
8
8
|
var AppProvider_1 = require("./AppProvider");
|
|
9
9
|
Object.defineProperty(exports, "AppProvider", { enumerable: true, get: function () { return AppProvider_1.AppProvider; } });
|
|
10
|
-
var LayoutProvider_1 = require("./LayoutProvider");
|
|
11
|
-
Object.defineProperty(exports, "LayoutProvider", { enumerable: true, get: function () { return LayoutProvider_1.LayoutProvider; } });
|
|
@@ -20,7 +20,7 @@ export declare namespace DefineFormExperience {
|
|
|
20
20
|
type TabColumn<S extends SchemaAttributes = SchemaAttributes> = {
|
|
21
21
|
sections: Section<S>[];
|
|
22
22
|
};
|
|
23
|
-
type Section<S extends SchemaAttributes = SchemaAttributes> = Pick<$Section<S>, 'label' | 'columnCount' | 'labelPosition' | 'name' | 'localizedLabels' | 'hidden' | 'hideLabel' | 'noPadding'> & {
|
|
23
|
+
type Section<S extends SchemaAttributes = SchemaAttributes> = Pick<$Section<S>, 'label' | 'columnCount' | 'labelPosition' | 'name' | 'localizedLabels' | 'hidden' | 'hideLabel' | 'noPadding' | 'fullHeight'> & {
|
|
24
24
|
controls: SectionControl<S>[];
|
|
25
25
|
};
|
|
26
26
|
export type SectionControl<S extends SchemaAttributes = SchemaAttributes> = $SectionControl<S> | keyof S;
|
|
@@ -6,6 +6,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ScrollView = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const clsx_1 = __importDefault(require("clsx"));
|
|
9
|
+
const react_1 = require("react");
|
|
9
10
|
const react_custom_scrollbars_2_1 = require("react-custom-scrollbars-2");
|
|
10
|
-
|
|
11
|
+
function getReaminingSpace(div) {
|
|
12
|
+
return div.scrollHeight - div.scrollTop - div.clientHeight;
|
|
13
|
+
}
|
|
14
|
+
const ScrollView = ({ children, className, rtl, autoHide, onScroll, shadowEffect = false, }) => {
|
|
15
|
+
const [isTop, setIsTop] = (0, react_1.useState)(true);
|
|
16
|
+
const [isBottom, setIsBottom] = (0, react_1.useState)(false);
|
|
17
|
+
const handleScroll = (event) => {
|
|
18
|
+
const div = event.target;
|
|
19
|
+
const remainingSpace = getReaminingSpace(div);
|
|
20
|
+
const _isTop = div.scrollTop === 0;
|
|
21
|
+
const _isBottom = remainingSpace <= 0;
|
|
22
|
+
if (isTop !== _isTop) {
|
|
23
|
+
setIsTop(_isTop);
|
|
24
|
+
}
|
|
25
|
+
if (isBottom !== _isBottom) {
|
|
26
|
+
setIsBottom(_isBottom);
|
|
27
|
+
}
|
|
28
|
+
if (onScroll) {
|
|
29
|
+
onScroll(event);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(react_custom_scrollbars_2_1.Scrollbars, { autoHide: autoHide, className: (0, clsx_1.default)(className, 'hdl-scrollbar', rtl && 'rtl', shadowEffect && !isTop && 'hdl-scrollbar-shadow-top', shadowEffect && !isBottom && 'hdl-scrollbar-shadow-bottom'), onScroll: handleScroll, children: children }));
|
|
33
|
+
};
|
|
11
34
|
exports.ScrollView = ScrollView;
|
|
@@ -32,12 +32,12 @@ export declare const generateValidationSchema: (<A extends SchemaAttributes = Sc
|
|
|
32
32
|
schema: Schema<A>;
|
|
33
33
|
columns: string[];
|
|
34
34
|
readonlyAttributes?: string[];
|
|
35
|
-
editableGrids
|
|
35
|
+
editableGrids?: Array<{
|
|
36
36
|
schema: Schema;
|
|
37
37
|
columns: string[];
|
|
38
38
|
attributeName: string;
|
|
39
39
|
required?: boolean;
|
|
40
|
-
}
|
|
40
|
+
}>;
|
|
41
41
|
language: string;
|
|
42
42
|
strings: FormValidationStringSet;
|
|
43
43
|
region: string;
|
package/index.css
CHANGED
|
@@ -2,3 +2,32 @@
|
|
|
2
2
|
margin-right: 0 !important;
|
|
3
3
|
margin-left: -15px;
|
|
4
4
|
}
|
|
5
|
+
|
|
6
|
+
.hdl-scrollbar-shadow-top::before {
|
|
7
|
+
content: ' ';
|
|
8
|
+
position: absolute;
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
height: 40px;
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
background: linear-gradient(
|
|
15
|
+
to bottom,
|
|
16
|
+
var(--colorNeutralStrokeAlpha),
|
|
17
|
+
transparent
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
.hdl-scrollbar-shadow-bottom::after {
|
|
21
|
+
content: ' ';
|
|
22
|
+
position: absolute;
|
|
23
|
+
bottom: 0;
|
|
24
|
+
left: 0;
|
|
25
|
+
right: 0;
|
|
26
|
+
height: 40px;
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
background: linear-gradient(
|
|
29
|
+
to top,
|
|
30
|
+
var(--colorNeutralStrokeAlpha),
|
|
31
|
+
transparent
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useExperienceViewCommands = useExperienceViewCommands;
|
|
4
|
-
const app_1 = require("@headless-adminapp/app/app");
|
|
5
4
|
const react_query_1 = require("@tanstack/react-query");
|
|
5
|
+
const useAppContext_1 = require("../../app/hooks/useAppContext");
|
|
6
6
|
const useExperienceStore_1 = require("./useExperienceStore");
|
|
7
7
|
/** @todo move in different dir */
|
|
8
8
|
function useExperienceViewCommands(logicalName) {
|
|
9
9
|
const experienceStore = (0, useExperienceStore_1.useExperienceStore)();
|
|
10
|
-
const { appExperience: { viewCommands }, } = (0,
|
|
10
|
+
const { appExperience: { viewCommands }, } = (0, useAppContext_1.useAppContext)();
|
|
11
11
|
const { data: commands } = (0, react_query_1.useQuery)({
|
|
12
12
|
queryKey: ['experience-schema-view-commands', logicalName],
|
|
13
13
|
queryFn: async () => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useExperienceViewSubgridCommands = useExperienceViewSubgridCommands;
|
|
4
|
-
const app_1 = require("@headless-adminapp/app/app");
|
|
5
4
|
const react_query_1 = require("@tanstack/react-query");
|
|
5
|
+
const useAppContext_1 = require("../../app/hooks/useAppContext");
|
|
6
6
|
const useExperienceStore_1 = require("./useExperienceStore");
|
|
7
7
|
/** @todo move in different dir */
|
|
8
8
|
function useExperienceViewSubgridCommands(logicalName) {
|
|
9
9
|
const experienceStore = (0, useExperienceStore_1.useExperienceStore)();
|
|
10
|
-
const { appExperience: { subgridCommands }, } = (0,
|
|
10
|
+
const { appExperience: { subgridCommands }, } = (0, useAppContext_1.useAppContext)();
|
|
11
11
|
const { data: commands } = (0, react_query_1.useQuery)({
|
|
12
12
|
queryKey: ['experience-schema-view-subgrid-commands', logicalName],
|
|
13
13
|
queryFn: async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/app",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"uuid": "11.0.3",
|
|
37
37
|
"yup": "^1.4.0"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "918b655a582c5c63864e8bbe6999289ec959b917"
|
|
40
40
|
}
|