@xh/hoist 73.0.0-SNAPSHOT.1738198923410 → 73.0.0-SNAPSHOT.1738248972394
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 +13 -2
- package/admin/jsonsearch/JsonSearch.ts +294 -0
- package/admin/jsonsearch/impl/JsonSearchImplModel.ts +175 -0
- package/admin/tabs/general/config/ConfigPanel.ts +26 -4
- package/admin/tabs/userData/jsonblob/JsonBlobPanel.ts +47 -10
- package/admin/tabs/userData/prefs/UserPreferencePanel.ts +45 -15
- package/build/types/admin/jsonsearch/JsonSearch.d.ts +17 -0
- package/build/types/admin/jsonsearch/impl/JsonSearchImplModel.d.ts +32 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -4,32 +4,62 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Copyright © 2025 Extremely Heavy Industries Inc.
|
|
6
6
|
*/
|
|
7
|
+
|
|
8
|
+
import * as Col from '@xh/hoist/admin/columns/Rest';
|
|
9
|
+
import * as AdminCol from '@xh/hoist/admin/columns';
|
|
7
10
|
import {prefEditorDialog} from '@xh/hoist/admin/tabs/userData/prefs/editor/PrefEditorDialog';
|
|
8
11
|
import {UserPreferenceModel} from '@xh/hoist/admin/tabs/userData/prefs/UserPreferenceModel';
|
|
12
|
+
import {hframe} from '@xh/hoist/cmp/layout';
|
|
9
13
|
import {creates, hoistCmp} from '@xh/hoist/core';
|
|
10
14
|
import {button} from '@xh/hoist/desktop/cmp/button';
|
|
15
|
+
import {jsonSearchButton} from '@xh/hoist/admin/jsonsearch/JsonSearch';
|
|
11
16
|
import {panel} from '@xh/hoist/desktop/cmp/panel';
|
|
12
17
|
import {restGrid} from '@xh/hoist/desktop/cmp/rest';
|
|
18
|
+
import {toolbarSep} from '@xh/hoist/desktop/cmp/toolbar';
|
|
13
19
|
import {Icon} from '@xh/hoist/icon';
|
|
14
20
|
|
|
15
21
|
export const userPreferencePanel = hoistCmp.factory({
|
|
16
22
|
model: creates(UserPreferenceModel),
|
|
17
23
|
|
|
18
24
|
render({model}) {
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
return hframe(
|
|
26
|
+
panel({
|
|
27
|
+
items: [
|
|
28
|
+
restGrid({
|
|
29
|
+
extraToolbarItems: () => [
|
|
30
|
+
button({
|
|
31
|
+
icon: Icon.gear(),
|
|
32
|
+
text: 'Configure',
|
|
33
|
+
onClick: () => (model.showEditorDialog = true)
|
|
34
|
+
}),
|
|
35
|
+
toolbarSep(),
|
|
36
|
+
jsonSearchButton({
|
|
37
|
+
subjectName: 'User Preference',
|
|
38
|
+
docSearchUrl: 'jsonSearch/searchUserPreferences',
|
|
39
|
+
gridModelConfig: {
|
|
40
|
+
sortBy: ['groupName', 'name', 'owner'],
|
|
41
|
+
columns: [
|
|
42
|
+
{
|
|
43
|
+
field: {name: 'owner', type: 'string'},
|
|
44
|
+
width: 200
|
|
45
|
+
},
|
|
46
|
+
{...AdminCol.groupName},
|
|
47
|
+
{...AdminCol.name},
|
|
48
|
+
{
|
|
49
|
+
field: {name: 'json', type: 'string'},
|
|
50
|
+
hidden: true
|
|
51
|
+
},
|
|
52
|
+
{...Col.lastUpdated}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
groupByOptions: ['owner', 'groupName', 'name']
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
}),
|
|
59
|
+
prefEditorDialog()
|
|
60
|
+
],
|
|
61
|
+
mask: 'onLoad'
|
|
62
|
+
})
|
|
63
|
+
);
|
|
34
64
|
}
|
|
35
65
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GridConfig } from '@xh/hoist/cmp/grid';
|
|
2
|
+
import { HoistProps, SelectOption } from '@xh/hoist/core';
|
|
3
|
+
export interface JsonSearchButtonProps extends HoistProps {
|
|
4
|
+
/** Descriptive label for the type of records being searched - will be auto-pluralized. */
|
|
5
|
+
subjectName: string;
|
|
6
|
+
/** Endpoint to search and return matches - Hoist `JsonSearchController` action expected. */
|
|
7
|
+
docSearchUrl: string;
|
|
8
|
+
/** Config for GridModel used to display search results. */
|
|
9
|
+
gridModelConfig: GridConfig;
|
|
10
|
+
/** Field names on returned results to enable for grouping in the search results grid. */
|
|
11
|
+
groupByOptions: Array<SelectOption | any>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Main entry point component for the JSON search feature. Supported out-of-the-box for a limited
|
|
15
|
+
* set of Hoist artifacts that hold JSON values: JSONBlob, Configs, and User Preferences.
|
|
16
|
+
*/
|
|
17
|
+
export declare const jsonSearchButton: import("@xh/hoist/core").ElementFactory<JsonSearchButtonProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { GridConfig, GridModel } from '@xh/hoist/cmp/grid';
|
|
2
|
+
import { HoistModel, TaskObserver } from '@xh/hoist/core';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class JsonSearchImplModel extends HoistModel {
|
|
7
|
+
xhImpl: boolean;
|
|
8
|
+
private matchingNodesUrl;
|
|
9
|
+
gridModel: GridModel;
|
|
10
|
+
docLoadTask: TaskObserver;
|
|
11
|
+
nodeLoadTask: TaskObserver;
|
|
12
|
+
groupBy: string;
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
error: any;
|
|
15
|
+
path: string;
|
|
16
|
+
readerContentType: 'document' | 'matches';
|
|
17
|
+
pathFormat: 'XPath' | 'JSONPath';
|
|
18
|
+
readerContent: string;
|
|
19
|
+
matchingNodeCount: number;
|
|
20
|
+
get subjectName(): string;
|
|
21
|
+
get docSearchUrl(): string;
|
|
22
|
+
get gridModelConfig(): GridConfig;
|
|
23
|
+
get selectedRecord(): import("../../../data").StoreRecord;
|
|
24
|
+
get groupByOptions(): any[];
|
|
25
|
+
toggleSearchIsOpen(): void;
|
|
26
|
+
constructor();
|
|
27
|
+
onLinked(): void;
|
|
28
|
+
loadMatchingDocsAsync(): Promise<void>;
|
|
29
|
+
private loadReaderContentAsync;
|
|
30
|
+
private convertToXPath;
|
|
31
|
+
private setGroupBy;
|
|
32
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "73.0.0-SNAPSHOT.
|
|
3
|
+
"version": "73.0.0-SNAPSHOT.1738248972394",
|
|
4
4
|
"description": "Hoist add-on for building and deploying React Applications.",
|
|
5
5
|
"repository": "github:xh/hoist-react",
|
|
6
6
|
"homepage": "https://xh.io",
|