@gisce/react-ooui 1.0.16 → 1.0.17

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ActionView.d.ts","sourceRoot":"","sources":["ActionView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAIf,OAAO,EAAsB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAsB7D,aAAK,KAAK,GAAG;IACX,MAAM,EAAE,GAAG,CAAC;IACZ,OAAO,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,WAAW,EAAE,IAAI,CAAC;IAClB,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,gBAAgB,CAAC,EAAE,GAAG,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,oBAAY,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;;AAsZF,wBAAsC"}
1
+ {"version":3,"file":"ActionView.d.ts","sourceRoot":"","sources":["ActionView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAIf,OAAO,EAAsB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAsB7D,aAAK,KAAK,GAAG;IACX,MAAM,EAAE,GAAG,CAAC;IACZ,OAAO,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,WAAW,EAAE,IAAI,CAAC;IAClB,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,gBAAgB,CAAC,EAAE,GAAG,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,oBAAY,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;;AAuZF,wBAAsC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -66,6 +66,7 @@ function FormActionBar() {
66
66
  formRef,
67
67
  setFormHasChanges,
68
68
  searchTreeRef,
69
+ goToResourceId,
69
70
  } = useContext(ActionViewContext) as ActionViewContextType;
70
71
  const { t, lang } = useContext(LocaleContext) as LocaleContextType;
71
72
 
@@ -182,9 +183,7 @@ function FormActionBar() {
182
183
  });
183
184
 
184
185
  if (newId) {
185
- await searchTreeRef?.current?.refreshResults();
186
- setCurrentId?.(newId);
187
- setCurrentItemIndex?.(currentItemIndex! + 1);
186
+ await goToResourceId?.(newId);
188
187
  }
189
188
  } catch (e) {
190
189
  showErrorDialog(JSON.stringify(e));
@@ -45,11 +45,11 @@ export type ActionViewContextType = {
45
45
  setTotalItems: (totalItems: number) => void;
46
46
  searchTreeNameSearch?: string;
47
47
  setSearchTreeNameSearch?: (searchString?: string) => void;
48
+ goToResourceId?: (id: number) => Promise<void>;
48
49
  };
49
50
 
50
- export const ActionViewContext = React.createContext<ActionViewContextType | null>(
51
- null
52
- );
51
+ export const ActionViewContext =
52
+ React.createContext<ActionViewContextType | null>(null);
53
53
 
54
54
  type ActionViewProviderProps = ActionViewContextType & {
55
55
  children: React.ReactNode;
@@ -92,6 +92,7 @@ const ActionViewProvider = (props: ActionViewProviderProps): any => {
92
92
  selectedRowItems,
93
93
  searchTreeNameSearch,
94
94
  setSearchTreeNameSearch,
95
+ goToResourceId,
95
96
  } = props;
96
97
 
97
98
  useEffect(() => {
@@ -151,6 +152,7 @@ const ActionViewProvider = (props: ActionViewProviderProps): any => {
151
152
  setTotalItems,
152
153
  searchTreeNameSearch,
153
154
  setSearchTreeNameSearch,
155
+ goToResourceId,
154
156
  }}
155
157
  >
156
158
  {children}
@@ -451,6 +451,7 @@ function ActionView(props: Props, ref: any) {
451
451
  setSelectedRowItems={setSelectedRowItems}
452
452
  setSearchTreeNameSearch={setSearchTreeNameSearch}
453
453
  searchTreeNameSearch={searchTreeNameSearch}
454
+ goToResourceId={goToResourceId}
454
455
  >
455
456
  {viewContent()}
456
457
  </ActionViewProvider>