@gisce/react-ooui 1.4.14 → 1.4.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.4.14",
3
+ "version": "1.4.16",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -287,89 +287,84 @@ function TreeActionBar(props: Props) {
287
287
  }}
288
288
  />
289
289
 
290
- {previewFeatures && (
291
- <>
292
- {separator()}
293
- <DropdownButton
294
- icon={
295
- <Icon
296
- component={() => (
297
- <svg
298
- xmlns="http://www.w3.org/2000/svg"
299
- className="icon icon-tabler icon-tabler-database-export"
300
- width="1em"
301
- height="1em"
302
- viewBox="0 0 24 24"
303
- strokeWidth="1.5"
304
- fill="none"
305
- stroke="currentColor"
306
- strokeLinecap="round"
307
- strokeLinejoin="round"
308
- >
309
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
310
- <ellipse cx="12" cy="6" rx="8" ry="3" />
311
- <path d="M4 6v6c0 1.657 3.582 3 8 3a19.84 19.84 0 0 0 3.302 -.267m4.698 -2.733v-6" />
312
- <path d="M4 12v6c0 1.599 3.335 2.905 7.538 2.995m8.462 -6.995v-2m-6 7h7m-3 -3l3 3l-3 3" />
313
- </svg>
314
- )}
315
- />
316
- }
317
- tooltip={t("export")}
318
- items={[
319
- {
320
- id: "print_screen",
321
- name: t("printScreen"),
322
- },
323
- {
324
- id: "export",
325
- name: t("advancedExport"),
326
- },
327
- ]}
328
- onItemClick={(itemClicked: any) => {
329
- if (itemClicked.id === "print_screen") {
330
- let idsToExport =
331
- selectedRowItems?.map((item) => item.id) || [];
290
+ {separator()}
291
+ <DropdownButton
292
+ icon={
293
+ <Icon
294
+ component={() => (
295
+ <svg
296
+ xmlns="http://www.w3.org/2000/svg"
297
+ className="icon icon-tabler icon-tabler-database-export"
298
+ width="1em"
299
+ height="1em"
300
+ viewBox="0 0 24 24"
301
+ strokeWidth="1.5"
302
+ fill="none"
303
+ stroke="currentColor"
304
+ strokeLinecap="round"
305
+ strokeLinejoin="round"
306
+ >
307
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
308
+ <ellipse cx="12" cy="6" rx="8" ry="3" />
309
+ <path d="M4 6v6c0 1.657 3.582 3 8 3a19.84 19.84 0 0 0 3.302 -.267m4.698 -2.733v-6" />
310
+ <path d="M4 12v6c0 1.599 3.335 2.905 7.538 2.995m8.462 -6.995v-2m-6 7h7m-3 -3l3 3l-3 3" />
311
+ </svg>
312
+ )}
313
+ />
314
+ }
315
+ tooltip={t("export")}
316
+ items={[
317
+ {
318
+ id: "print_screen",
319
+ name: t("printScreen"),
320
+ },
321
+ {
322
+ id: "export",
323
+ name: t("advancedExport"),
324
+ },
325
+ ]}
326
+ onItemClick={(itemClicked: any) => {
327
+ if (itemClicked.id === "print_screen") {
328
+ let idsToExport = selectedRowItems?.map((item) => item.id) || [];
332
329
 
333
- if (idsToExport.length === 0) {
334
- idsToExport = results?.map((item) => item.id) || [];
335
- }
330
+ if (idsToExport.length === 0) {
331
+ idsToExport = results?.map((item) => item.id) || [];
332
+ }
336
333
 
337
- runAction({
338
- id: -1,
339
- model: currentModel,
340
- report_name: "printscreen.list",
341
- type: "ir.actions.report.xml",
342
- datas: {
343
- model: currentModel,
344
- ids: idsToExport,
345
- },
346
- });
347
- return;
348
- }
334
+ runAction({
335
+ id: -1,
336
+ model: currentModel,
337
+ report_name: "printscreen.list",
338
+ type: "ir.actions.report.xml",
339
+ datas: {
340
+ model: currentModel,
341
+ ids: idsToExport,
342
+ },
343
+ });
344
+ return;
345
+ }
349
346
 
350
- setExportModalVisible(true);
351
- }}
352
- disabled={
353
- duplicatingItem || removingItem || treeIsLoading || hasNameSearch
354
- }
355
- />
356
- <ExportModal
357
- visible={exportModalVisible}
358
- locale={lang}
359
- onClose={() => setExportModalVisible(false)}
360
- model={currentModel!}
361
- domain={mergeParams(
362
- searchTreeRef?.current?.getDomain() || [],
363
- searchParams || []
364
- )}
365
- limit={limit}
366
- totalRegisters={totalItems || 0}
367
- selectedRegistersToExport={selectedRowItems}
368
- visibleRegisters={results?.length || 0}
369
- context={parentContext}
370
- />
371
- </>
372
- )}
347
+ setExportModalVisible(true);
348
+ }}
349
+ disabled={
350
+ duplicatingItem || removingItem || treeIsLoading || hasNameSearch
351
+ }
352
+ />
353
+ <ExportModal
354
+ visible={exportModalVisible}
355
+ locale={lang}
356
+ onClose={() => setExportModalVisible(false)}
357
+ model={currentModel!}
358
+ domain={mergeParams(
359
+ searchTreeRef?.current?.getDomain() || [],
360
+ searchParams || []
361
+ )}
362
+ limit={limit}
363
+ totalRegisters={totalItems || 0}
364
+ selectedRegistersToExport={selectedRowItems}
365
+ visibleRegisters={results?.length || 0}
366
+ context={parentContext}
367
+ />
373
368
  </Space>
374
369
  );
375
370
  }
@@ -150,8 +150,7 @@ function getIconForKey(
150
150
  const TablerIcon = () =>
151
151
  React.createElement(TablerIcons[tablerKey] as any, {
152
152
  fill: "transparent",
153
- height: 17,
154
- width: 17,
153
+ size: props?.style?.fontSize || 17
155
154
  });
156
155
  const CustomIcon = () =>
157
156
  React.createElement(Icon, {
@@ -24,6 +24,19 @@ export function Default(): React.ReactElement {
24
24
  // suffix={"€"}
25
25
  />
26
26
  </DashboardGridItem>
27
+ <DashboardGridItem
28
+ title="test"
29
+ parms={{ w: 3, h: 9, x: 0, y: 0, id: 10 }}
30
+ >
31
+ <GraphIndicator
32
+ model="res.partner"
33
+ context={{}}
34
+ domain={{}}
35
+ icon={"bolt"}
36
+ showPercent={true}
37
+ // suffix={"€"}
38
+ />
39
+ </DashboardGridItem>
27
40
  </DashboardGrid>
28
41
  </LocaleProvider>
29
42
  );
@@ -297,7 +297,7 @@ function CommonIndicator({
297
297
  fontSize = maxFontSize;
298
298
  }
299
299
 
300
- const IconElement: any = icon && iconMapper(icon);
300
+ const IconElement: any = icon && iconMapper(icon, {style: {fontSize: fontSize * 0.7}});
301
301
 
302
302
  return (
303
303
  <div
@@ -373,13 +373,13 @@ function PercentageIndicator({
373
373
  tw = tw * 1.5;
374
374
  }
375
375
 
376
- const IconElement: any = icon && iconMapper(icon);
377
-
378
376
  if (tw >= width * 0.85 || fontSize * 2 < twoLinesHeight) {
379
377
  const maxFontSize = ((width * 0.85) / tw) * fontSize;
380
378
  fontSize = maxFontSize;
381
379
  }
382
380
 
381
+ const IconElement: any = icon && iconMapper(icon, {style: {fontSize}});
382
+
383
383
  return (
384
384
  <div
385
385
  ref={measureRef}