@gisce/react-ooui 1.1.67 → 1.1.68

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,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import React__default, { useContext, useState, useEffect, useRef, useLayoutEffect, Component, useCallback, forwardRef, useImperativeHandle } from "react";
3
- import { Tooltip as Tooltip$2, Typography as Typography$1, Form as Form$3, Row, Col, Modal, Button as Button$1, Dropdown, Menu, Spin, Divider, Space, Input as Input$1, Select, Checkbox, Alert, Timeline as Timeline$1, Statistic, Card, Tag as Tag$1, message as message$1, DatePicker as DatePicker$1, TimePicker, InputNumber, Progress, Pagination, Tabs, Popover, Radio as Radio$1, Switch as Switch$1, Steps as Steps$1, Layout } from "antd";
3
+ import { Tooltip as Tooltip$2, Typography as Typography$1, Form as Form$3, Row, Col, Modal, Button as Button$1, Dropdown, Menu, Spin, Divider, Space, Input as Input$1, Select, Checkbox, Alert, Timeline as Timeline$1, Statistic, Card, Tag as Tag$1, message as message$1, DatePicker as DatePicker$1, TimePicker, InputNumber, Progress, Avatar as Avatar$1, Pagination, Tabs, Popover, Radio as Radio$1, Switch as Switch$1, Steps as Steps$1, Layout } from "antd";
4
4
  import { Label as Label$1, Field as Field$2, Tree as Tree$1, Reference as Reference$1, Selection as Selection$1, Many2one as Many2one$1, Boolean as Boolean$2, Container as Container$1, parseContext, Form as Form$4, Integer as Integer$1, SearchFieldTypes, SearchFilter as SearchFilter$1, transformDomainForChildWidget, graphProcessor, parseGraph, graphFieldUtils } from "@gisce/ooui";
5
5
  import * as AntIcons from "@ant-design/icons";
6
6
  import AntIcons__default, { QuestionCircleOutlined, ExclamationCircleOutlined as ExclamationCircleOutlined$3, LoadingOutlined as LoadingOutlined$3, DownOutlined, WarningOutlined, CloseOutlined as CloseOutlined$3, CheckOutlined as CheckOutlined$3, TranslationOutlined, FolderOpenOutlined, DownloadOutlined, ClearOutlined, StarFilled, StarOutlined, UpOutlined, SearchOutlined, RightCircleOutlined, ThunderboltOutlined, PrinterOutlined, EnterOutlined as EnterOutlined$3, PlusSquareOutlined, MinusSquareOutlined, FileAddOutlined, AlignLeftOutlined, ApiOutlined, DeleteOutlined, LeftOutlined, RightOutlined, EyeOutlined, FormOutlined, TableOutlined, AreaChartOutlined, CalendarOutlined, LinkOutlined, SaveOutlined, CopyOutlined as CopyOutlined$3, InfoCircleOutlined as InfoCircleOutlined$3, ReloadOutlined, EditOutlined as EditOutlined$3, FilterOutlined, CloseCircleFilled as CloseCircleFilled$3, BorderOuterOutlined, SettingOutlined, ExportOutlined } from "@ant-design/icons";
@@ -15168,6 +15168,27 @@ const ProgressBar = (e) => /* @__PURE__ */ jsx(Field$1, {
15168
15168
  model: l
15169
15169
  })]
15170
15170
  });
15171
+ }, Avatar = (e) => {
15172
+ console.log("Avatar Props", e);
15173
+ const {
15174
+ ooui: t,
15175
+ value: r
15176
+ } = e;
15177
+ if (!r)
15178
+ return null;
15179
+ let n = r;
15180
+ t.selectionValues.size ? n = t.selectionValues.get(r) : Array.isArray(r) && (n = r[1]);
15181
+ const a = n.toString().split(" ").filter((s) => s.length > 1).slice(0, 3).map((s) => s[0].toUpperCase()).join(""), o = colorFromString(n);
15182
+ return /* @__PURE__ */ jsx(Tooltip$2, {
15183
+ title: n,
15184
+ children: /* @__PURE__ */ jsx(Avatar$1, {
15185
+ alt: n,
15186
+ style: {
15187
+ backgroundColor: o
15188
+ },
15189
+ children: a
15190
+ })
15191
+ });
15171
15192
  };
15172
15193
  //! moment.js
15173
15194
  //! version : 2.29.4
@@ -17790,6 +17811,9 @@ const DatePickerConfig = {
17790
17811
  selectionValues: r.selectionValues,
17791
17812
  context: n
17792
17813
  })
17814
+ }), AvatarFn = (e, t, r, n) => /* @__PURE__ */ jsx(Avatar, {
17815
+ ooui: r,
17816
+ value: e
17793
17817
  });
17794
17818
  function Tree(e) {
17795
17819
  const {
@@ -17834,7 +17858,8 @@ function Tree(e) {
17834
17858
  tag: TagComponent,
17835
17859
  selection: SelectionComponent,
17836
17860
  date: dateComponentFn,
17837
- datetime: dateTimeComponentFn
17861
+ datetime: dateTimeComponentFn,
17862
+ avatar: AvatarFn
17838
17863
  }, g);
17839
17864
  O(Y), w.current.string && q !== w.current.string && ($ == null || $(w.current.string));
17840
17865
  }, [a]), useEffect(() => {