@leav/ui 1.5.0-3c27eb12 → 1.5.0-51531ec3

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.
@@ -4,12 +4,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
4
4
  // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
5
  import { KitIdCard } from 'aristid-ds';
6
6
  export const IdCard = ({ item }) => {
7
- const { id, label, preview, subLabel } = item;
7
+ const { id, label, preview, subLabel, color } = item;
8
8
  const itemLabel = label ?? id;
9
9
  const avatarProps = { label: itemLabel };
10
10
  if (preview) {
11
11
  avatarProps.src = preview.small;
12
12
  }
13
- return _jsx(KitIdCard, { avatarProps: avatarProps, title: label ?? id, description: subLabel ?? undefined });
13
+ return (_jsx(KitIdCard, { avatarProps: avatarProps, title: label ?? id, description: subLabel ?? undefined, color: color ?? undefined }));
14
14
  };
15
15
  //# sourceMappingURL=IdCard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IdCard.js","sourceRoot":"","sources":["../../../src/components/Explorer/IdCard.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AASrC,MAAM,CAAC,MAAM,MAAM,GAAoC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE;IAC9D,MAAM,EAAC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAC,GAAG,IAAI,CAAC;IAC5C,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE,CAAC;IAC9B,MAAM,WAAW,GAAe,EAAC,KAAK,EAAE,SAAS,EAAC,CAAC;IAEnD,IAAI,OAAO,EAAE,CAAC;QACV,WAAW,CAAC,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC;IACpC,CAAC;IAED,OAAO,KAAC,SAAS,IAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,EAAE,WAAW,EAAE,QAAQ,IAAI,SAAS,GAAI,CAAC;AAC3G,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {KitIdCard} from 'aristid-ds';\nimport {type IKitAvatar} from 'aristid-ds/dist/Kit/DataDisplay/Avatar/types';\nimport {type FunctionComponent} from 'react';\nimport {type RecordIdentityFragment} from '_ui/_gqlTypes';\n\ninterface IIdCardProps {\n item: RecordIdentityFragment['whoAmI'];\n}\n\nexport const IdCard: FunctionComponent<IIdCardProps> = ({item}) => {\n const {id, label, preview, subLabel} = item;\n const itemLabel = label ?? id;\n const avatarProps: IKitAvatar = {label: itemLabel};\n\n if (preview) {\n avatarProps.src = preview.small;\n }\n\n return <KitIdCard avatarProps={avatarProps} title={label ?? id} description={subLabel ?? undefined} />;\n};\n"]}
1
+ {"version":3,"file":"IdCard.js","sourceRoot":"","sources":["../../../src/components/Explorer/IdCard.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AASrC,MAAM,CAAC,MAAM,MAAM,GAAoC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE;IAC9D,MAAM,EAAC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAC,GAAG,IAAI,CAAC;IACnD,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE,CAAC;IAC9B,MAAM,WAAW,GAAe,EAAC,KAAK,EAAE,SAAS,EAAC,CAAC;IAEnD,IAAI,OAAO,EAAE,CAAC;QACV,WAAW,CAAC,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC;IACpC,CAAC;IAED,OAAO,CACH,KAAC,SAAS,IACN,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,WAAW,EAAE,QAAQ,IAAI,SAAS,EAClC,KAAK,EAAE,KAAK,IAAI,SAAS,GAC3B,CACL,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {KitIdCard} from 'aristid-ds';\nimport {type IKitAvatar} from 'aristid-ds/dist/Kit/DataDisplay/Avatar/types';\nimport {type FunctionComponent} from 'react';\nimport {type RecordIdentityFragment} from '_ui/_gqlTypes';\n\ninterface IIdCardProps {\n item: RecordIdentityFragment['whoAmI'];\n}\n\nexport const IdCard: FunctionComponent<IIdCardProps> = ({item}) => {\n const {id, label, preview, subLabel, color} = item;\n const itemLabel = label ?? id;\n const avatarProps: IKitAvatar = {label: itemLabel};\n\n if (preview) {\n avatarProps.src = preview.small;\n }\n\n return (\n <KitIdCard\n avatarProps={avatarProps}\n title={label ?? id}\n description={subLabel ?? undefined}\n color={color ?? undefined}\n />\n );\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import TreeNodeItem from './TreeNodeItem';
3
3
  import { TreeFieldWrapper } from './TreeFieldWrapper';
4
- export const TreeNodeList = ({ attribute, backendValues, removeTreeNode, isReadOnly, }) => (_jsx(TreeFieldWrapper, { children: backendValues.map((value, index) => (_jsx(TreeNodeItem, { isReadOnly: isReadOnly, color: value.treeValue.record.whoAmI.color, label: value.treeValue.record.whoAmI.label, ancestors: value.treeValue.ancestors, canDelete: !isReadOnly &&
4
+ export const TreeNodeList = ({ attribute, backendValues, removeTreeNode, isReadOnly, }) => (_jsx(TreeFieldWrapper, { children: backendValues.map((value, index) => (_jsx(TreeNodeItem, { isReadOnly: isReadOnly, color: value.treeValue?.record.whoAmI.color, label: value.treeValue?.record.whoAmI.label, ancestors: value.treeValue?.ancestors, canDelete: !isReadOnly &&
5
5
  ((attribute.required && attribute.multiple_values && backendValues.length > 1) ||
6
6
  !attribute.required), onClickToDelete: () => removeTreeNode(value) }, index))) }));
7
7
  //# sourceMappingURL=TreeNodeList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeNodeList.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeList.tsx"],"names":[],"mappings":";AAMA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AASpD,MAAM,CAAC,MAAM,YAAY,GAA6C,CAAC,EACnE,SAAS,EACT,aAAa,EACb,cAAc,EACd,UAAU,GACb,EAAE,EAAE,CAAC,CACF,KAAC,gBAAgB,cACZ,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CACjC,KAAC,YAAY,IAET,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAC1C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAC1C,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,EACpC,SAAS,EACL,CAAC,UAAU;YACX,CAAC,CAAC,SAAS,CAAC,QAAQ,IAAI,SAAS,CAAC,eAAe,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;gBAC1E,CAAC,SAAS,CAAC,QAAQ,CAAC,EAE5B,eAAe,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,IAVvC,KAAK,CAWZ,CACL,CAAC,GACa,CACtB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type FunctionComponent} from 'react';\nimport {type RecordFormElementsValueTreeValue} from '_ui/hooks/useGetRecordForm';\nimport {type RecordFormAttributeTreeAttributeFragment} from '_ui/_gqlTypes';\nimport TreeNodeItem from './TreeNodeItem';\nimport {TreeFieldWrapper} from './TreeFieldWrapper';\n\ninterface IDisplayTreeNodeProps {\n attribute: RecordFormAttributeTreeAttributeFragment;\n backendValues: RecordFormElementsValueTreeValue[];\n removeTreeNode: (nodeValue: RecordFormElementsValueTreeValue) => void;\n isReadOnly: boolean;\n}\n\nexport const TreeNodeList: FunctionComponent<IDisplayTreeNodeProps> = ({\n attribute,\n backendValues,\n removeTreeNode,\n isReadOnly,\n}) => (\n <TreeFieldWrapper>\n {backendValues.map((value, index) => (\n <TreeNodeItem\n key={index}\n isReadOnly={isReadOnly}\n color={value.treeValue.record.whoAmI.color}\n label={value.treeValue.record.whoAmI.label}\n ancestors={value.treeValue.ancestors}\n canDelete={\n !isReadOnly &&\n ((attribute.required && attribute.multiple_values && backendValues.length > 1) ||\n !attribute.required)\n }\n onClickToDelete={() => removeTreeNode(value)}\n />\n ))}\n </TreeFieldWrapper>\n);\n"]}
1
+ {"version":3,"file":"TreeNodeList.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeList.tsx"],"names":[],"mappings":";AAMA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AASpD,MAAM,CAAC,MAAM,YAAY,GAA6C,CAAC,EACnE,SAAS,EACT,aAAa,EACb,cAAc,EACd,UAAU,GACb,EAAE,EAAE,CAAC,CACF,KAAC,gBAAgB,cACZ,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CACjC,KAAC,YAAY,IAET,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,EAC3C,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,EAC3C,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,EACrC,SAAS,EACL,CAAC,UAAU;YACX,CAAC,CAAC,SAAS,CAAC,QAAQ,IAAI,SAAS,CAAC,eAAe,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;gBAC1E,CAAC,SAAS,CAAC,QAAQ,CAAC,EAE5B,eAAe,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,IAVvC,KAAK,CAWZ,CACL,CAAC,GACa,CACtB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type FunctionComponent} from 'react';\nimport {type RecordFormElementsValueTreeValue} from '_ui/hooks/useGetRecordForm';\nimport {type RecordFormAttributeTreeAttributeFragment} from '_ui/_gqlTypes';\nimport TreeNodeItem from './TreeNodeItem';\nimport {TreeFieldWrapper} from './TreeFieldWrapper';\n\ninterface IDisplayTreeNodeProps {\n attribute: RecordFormAttributeTreeAttributeFragment;\n backendValues: RecordFormElementsValueTreeValue[];\n removeTreeNode: (nodeValue: RecordFormElementsValueTreeValue) => void;\n isReadOnly: boolean;\n}\n\nexport const TreeNodeList: FunctionComponent<IDisplayTreeNodeProps> = ({\n attribute,\n backendValues,\n removeTreeNode,\n isReadOnly,\n}) => (\n <TreeFieldWrapper>\n {backendValues.map((value, index) => (\n <TreeNodeItem\n key={index}\n isReadOnly={isReadOnly}\n color={value.treeValue?.record.whoAmI.color}\n label={value.treeValue?.record.whoAmI.label}\n ancestors={value.treeValue?.ancestors}\n canDelete={\n !isReadOnly &&\n ((attribute.required && attribute.multiple_values && backendValues.length > 1) ||\n !attribute.required)\n }\n onClickToDelete={() => removeTreeNode(value)}\n />\n ))}\n </TreeFieldWrapper>\n);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leav/ui",
3
- "version": "1.5.0-3c27eb12",
3
+ "version": "1.5.0-51531ec3",
4
4
  "description": "Shared React components and hooks",
5
5
  "scripts": {
6
6
  "prepublishOnly": "yarn build",
@@ -44,7 +44,7 @@
44
44
  "@types/react-table": "7.7.12",
45
45
  "@types/uuid": "^9",
46
46
  "antd": "5.22.2",
47
- "aristid-ds": "14.0.0-cb7dc4f",
47
+ "aristid-ds": "14.0.0-058a8ae",
48
48
  "babel-jest": "29.3.1",
49
49
  "commander": "9.5.0",
50
50
  "graphql": "16.12.0",