@itwin/core-react 4.3.1 → 4.4.0

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +7 -4
  2. package/lib/cjs/core-react/contextmenu/ContextMenu.scss +3 -8
  3. package/lib/cjs/core-react/contextmenu/ContextSubMenu.js +1 -1
  4. package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
  5. package/lib/cjs/core-react/dialog/Dialog.d.ts +0 -9
  6. package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
  7. package/lib/cjs/core-react/dialog/Dialog.js +4 -96
  8. package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
  9. package/lib/cjs/core-react/dialog/Dialog.scss +1 -31
  10. package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts +1 -1
  11. package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts.map +1 -1
  12. package/lib/cjs/core-react/icons/ConditionalIconItem.js.map +1 -1
  13. package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
  14. package/lib/cjs/core-react/utils/IconHelper.d.ts.map +1 -1
  15. package/lib/cjs/core-react/utils/IconHelper.js +1 -1
  16. package/lib/cjs/core-react/utils/IconHelper.js.map +1 -1
  17. package/lib/esm/core-react/contextmenu/ContextMenu.scss +3 -8
  18. package/lib/esm/core-react/contextmenu/ContextSubMenu.js +2 -2
  19. package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
  20. package/lib/esm/core-react/dialog/Dialog.d.ts +0 -9
  21. package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
  22. package/lib/esm/core-react/dialog/Dialog.js +4 -96
  23. package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
  24. package/lib/esm/core-react/dialog/Dialog.scss +1 -31
  25. package/lib/esm/core-react/icons/ConditionalIconItem.d.ts +1 -1
  26. package/lib/esm/core-react/icons/ConditionalIconItem.d.ts.map +1 -1
  27. package/lib/esm/core-react/icons/ConditionalIconItem.js.map +1 -1
  28. package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
  29. package/lib/esm/core-react/utils/IconHelper.d.ts.map +1 -1
  30. package/lib/esm/core-react/utils/IconHelper.js +1 -1
  31. package/lib/esm/core-react/utils/IconHelper.js.map +1 -1
  32. package/package.json +5 -6
@@ -1 +1 @@
1
- {"version":3,"file":"IconHelper.js","sourceRoot":"","sources":["../../../../src/core-react/utils/IconHelper.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,MAAM,OAAO,UAAU;IACd,MAAM,KAAK,YAAY;QAC5B,OAAO,yBAAyB,CAAC;IACnC,CAAC;IACM,MAAM,KAAK,sBAAsB;QACtC,OAAO,gCAAgC,CAAC;IAC1C,CAAC;IACD;;;OAGG;IACI,MAAM,CAAC,gBAAgB,CAC5B,IAIuB,EACvB,YAA+B;QAE/B,uBAAuB;QACvB,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QAEvB,uBAAuB;QACvB,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,IAAI,CAAC;YACjD,OAAO,CACL,oBAAC,IAAI,IACH,QAAQ,EAAE,mBAAmB,CAAC,QAAQ,CAAC,IAA2B,CAAC,GACnE,CACH,CAAC;QACJ,uBAAuB;QACvB,IAAI,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;YAAE,OAAO,oBAAC,IAAI,IAAC,QAAQ,EAAE,IAAI,GAAI,CAAC;QAEhE,qBAAqB;QACrB,IAAI,CAAC,CAAC,IAAI,YAAY,sBAAsB,CAAC,IAAI,OAAO,IAAI,KAAK,Q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QAED,IACE,YAAY;YACZ,OAAO,IAAI,KAAK,QAAQ;YACxB,IAAI,KAAK,UAAU,CAAC,YAAY,EAChC;YACA,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;SACrD;QAED,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,YAAY,sBAAsB;YACpE,OAAO,IAAI,CAAC;QAEd,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\nimport * as React from \"react\";\nimport { ConditionalStringValue } from \"@itwin/appui-abstract\";\nimport type { IconSpec } from \"../icons/IconComponent\";\nimport { Icon } from \"../icons/IconComponent\";\nimport { ConditionalIconItem } from \"../icons/ConditionalIconItem\";\n\n/** Icon Helper Class used to store the data needed to generate an <Icon> for use in any control that shows an icon.\n * @public\n */\nexport class IconHelper {\n public static get reactIconKey(): string {\n return \"#-react-iconspec-node-#\";\n }\n public static get conditionalIconItemKey(): string {\n return \"#-conditional-icon-item-node-#\";\n }\n /** Returns an <Icon> ReactNode from the many ways an icon can be specified.\n * @param icon abstract icon specification.\n * @param internalData a map that may hold a React.ReactNode stored in an abstract item definition.\n */\n public static getIconReactNode(\n icon:\n | string\n | ConditionalStringValue\n | React.ReactNode\n | ConditionalIconItem,\n internalData?: Map<string, any>\n ): React.ReactNode {\n // istanbul ignore else\n if (!icon) return null;\n\n // istanbul ignore else\n if (ConditionalIconItem.isConditionalIconItem(icon))\n return (\n <Icon\n iconSpec={ConditionalIconItem.getValue(icon as ConditionalIconItem)}\n />\n );\n // istanbul ignore else\n if (React.isValidElement(icon)) return <Icon iconSpec={icon} />;\n\n // istanbul ignore if\n if (!(icon instanceof ConditionalStringValue) && typeof icon !== \"string\")\n return null;\n\n const iconString = ConditionalStringValue.getValue(icon);\n if (!iconString) return null;\n\n // istanbul ignore else\n if (iconString === IconHelper.reactIconKey) {\n // istanbul ignore else\n if (internalData)\n return (\n <Icon\n iconSpec={\n internalData.get(IconHelper.reactIconKey) as React.ReactNode\n }\n />\n );\n return null;\n } else if (iconString === IconHelper.conditionalIconItemKey) {\n // istanbul ignore else\n if (internalData) {\n const iconItem = internalData.get(\n IconHelper.conditionalIconItemKey\n ) as ConditionalIconItem;\n return <Icon iconSpec={ConditionalIconItem.getValue(iconItem)} />;\n }\n return null;\n }\n return <Icon iconSpec={iconString} />;\n }\n\n /** Returns an icon definition that can be stored in an abstract item definition. If the iconSpec specifies a ReactNode\n * then the react data is stored in the internalData map and the key to the react data is returned.\n * @param iconSpec any supported variations of how an icon can be defined in an abstract item or IconProps.\n * @param internalData a map supplied by the caller to store away react element if React.ReactNode\n */\n public static getIconData(\n iconSpec: IconSpec,\n internalData?: Map<string, any>\n ): string | ConditionalStringValue {\n let icon;\n if (ConditionalIconItem.isConditionalIconItem(iconSpec)) {\n icon = IconHelper.conditionalIconItemKey;\n // istanbul ignore else\n if (internalData)\n internalData.set(IconHelper.conditionalIconItemKey, iconSpec);\n return icon;\n } else {\n icon = React.isValidElement(iconSpec)\n ? IconHelper.reactIconKey\n : iconSpec;\n }\n\n if (\n internalData &&\n typeof icon === \"string\" &&\n icon === IconHelper.reactIconKey\n ) {\n internalData.set(IconHelper.reactIconKey, iconSpec);\n }\n\n if (typeof icon === \"string\" || icon instanceof ConditionalStringValue)\n return icon;\n\n return \"\";\n }\n}\n"]}
1
+ {"version":3,"file":"IconHelper.js","sourceRoot":"","sources":["../../../../src/core-react/utils/IconHelper.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,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Q,GAAG,YAAY,CAAC,GAAG,CAC/B,UAAU,CAAC,sBAAsB,CACX,CAAC;gBACzB,OAAO,oBAAC,IAAI,IAAC,QAAQ,EAAE,mBAAmB,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAI,CAAC;aACnE;YACD,OAAO,IAAI,CAAC;SACb;QACD,OAAO,oBAAC,IAAI,IAAC,QAAQ,EAAE,UAAU,GAAI,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CACvB,QAAkB,EAClB,YAA+B;QAE/B,IAAI,IAAI,CAAC;QACT,IAAI,mBAAmB,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE;YACvD,IAAI,GAAG,UAAU,CAAC,sBAAsB,CAAC;YACzC,uBAAuB;YACvB,IAAI,YAAY;gBACd,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;YAChE,OAAO,IAAI,CAAC;SACb;aAAM;YACL,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC;gBACnC,CAAC,CAAC,UAAU,CAAC,YAAY;gBACzB,CAAC,CAAC,QAAQ,CAAC;SACd;QAED,IACE,YAAY;YACZ,OAAO,IAAI,KAAK,QAAQ;YACxB,IAAI,KAAK,UAAU,CAAC,YAAY,EAChC;YACA,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;SACrD;QAED,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,YAAY,sBAAsB;YACpE,OAAO,IAAI,CAAC;QAEd,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\nimport * as React from \"react\";\nimport { ConditionalStringValue } from \"@itwin/appui-abstract\";\nimport type { IconSpec } from \"../icons/IconComponent\";\nimport { Icon } from \"../icons/IconComponent\";\nimport { ConditionalIconItem } from \"../icons/ConditionalIconItem\";\n\n/** Icon Helper Class used to store the data needed to generate an <Icon> for use in any control that shows an icon.\n * @public\n */\nexport class IconHelper {\n public static get reactIconKey(): string {\n return \"#-react-iconspec-node-#\";\n }\n public static get conditionalIconItemKey(): string {\n return \"#-conditional-icon-item-node-#\";\n }\n /** Returns an <Icon> ReactNode from the many ways an icon can be specified.\n * @param icon abstract icon specification.\n * @param internalData a map that may hold a React.ReactNode stored in an abstract item definition.\n */\n public static getIconReactNode(\n icon:\n | string\n | ConditionalStringValue\n | React.ReactNode\n | ConditionalIconItem,\n internalData?: Map<string, any>\n ): React.ReactNode {\n // istanbul ignore else\n if (!icon) return null;\n\n // istanbul ignore else\n if (ConditionalIconItem.isConditionalIconItem(icon))\n return <Icon iconSpec={ConditionalIconItem.getValue(icon)} />;\n // istanbul ignore else\n if (React.isValidElement(icon)) return <Icon iconSpec={icon} />;\n\n // istanbul ignore if\n if (!(icon instanceof ConditionalStringValue) && typeof icon !== \"string\")\n return null;\n\n const iconString = ConditionalStringValue.getValue(icon);\n if (!iconString) return null;\n\n // istanbul ignore else\n if (iconString === IconHelper.reactIconKey) {\n // istanbul ignore else\n if (internalData)\n return (\n <Icon\n iconSpec={\n internalData.get(IconHelper.reactIconKey) as React.ReactNode\n }\n />\n );\n return null;\n } else if (iconString === IconHelper.conditionalIconItemKey) {\n // istanbul ignore else\n if (internalData) {\n const iconItem = internalData.get(\n IconHelper.conditionalIconItemKey\n ) as ConditionalIconItem;\n return <Icon iconSpec={ConditionalIconItem.getValue(iconItem)} />;\n }\n return null;\n }\n return <Icon iconSpec={iconString} />;\n }\n\n /** Returns an icon definition that can be stored in an abstract item definition. If the iconSpec specifies a ReactNode\n * then the react data is stored in the internalData map and the key to the react data is returned.\n * @param iconSpec any supported variations of how an icon can be defined in an abstract item or IconProps.\n * @param internalData a map supplied by the caller to store away react element if React.ReactNode\n */\n public static getIconData(\n iconSpec: IconSpec,\n internalData?: Map<string, any>\n ): string | ConditionalStringValue {\n let icon;\n if (ConditionalIconItem.isConditionalIconItem(iconSpec)) {\n icon = IconHelper.conditionalIconItemKey;\n // istanbul ignore else\n if (internalData)\n internalData.set(IconHelper.conditionalIconItemKey, iconSpec);\n return icon;\n } else {\n icon = React.isValidElement(iconSpec)\n ? IconHelper.reactIconKey\n : iconSpec;\n }\n\n if (\n internalData &&\n typeof icon === \"string\" &&\n icon === IconHelper.reactIconKey\n ) {\n internalData.set(IconHelper.reactIconKey, iconSpec);\n }\n\n if (typeof icon === \"string\" || icon instanceof ConditionalStringValue)\n return icon;\n\n return \"\";\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/core-react",
3
- "version": "4.3.1",
3
+ "version": "4.4.0",
4
4
  "description": "iTwin.js UI core components",
5
5
  "main": "lib/cjs/core-react.js",
6
6
  "module": "lib/esm/core-react.js",
@@ -40,7 +40,7 @@
40
40
  "@itwin/core-common": "^3.7.0",
41
41
  "@itwin/core-geometry": "^3.7.0",
42
42
  "@itwin/core-i18n": "^3.7.0",
43
- "@itwin/eslint-plugin": "^3.7.0",
43
+ "@itwin/eslint-plugin": "^4.0.0-dev.45",
44
44
  "@testing-library/dom": "^8.11.2",
45
45
  "@testing-library/react": "^12.0.0",
46
46
  "@testing-library/react-hooks": "^7.0.2",
@@ -59,7 +59,7 @@
59
59
  "chai": "^4.1.2",
60
60
  "chai-as-promised": "^7",
61
61
  "cpx2": "^3.0.0",
62
- "eslint": "^7.11.0",
62
+ "eslint": "^8.44.0",
63
63
  "ignore-styles": "^5.0.1",
64
64
  "jsdom": "^19.0.0",
65
65
  "jsdom-global": "3.0.2",
@@ -76,8 +76,7 @@
76
76
  "ts-node": "^10.8.2",
77
77
  "typemoq": "^2.1.0",
78
78
  "typescript": "~5.0.2",
79
- "eslint-config-prettier": "~8.8.0",
80
- "@rushstack/eslint-patch": "^1.3.0"
79
+ "eslint-config-prettier": "~8.8.0"
81
80
  },
82
81
  "//dependencies": [
83
82
  "NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API",
@@ -85,7 +84,7 @@
85
84
  ],
86
85
  "dependencies": {
87
86
  "@bentley/icons-generic": "^1.0.34",
88
- "@itwin/itwinui-react": "^2.11.6",
87
+ "@itwin/itwinui-react": "^2.11.11",
89
88
  "@itwin/itwinui-variables": "^2.0.0",
90
89
  "@itwin/itwinui-icons-react": "^2.1.0",
91
90
  "classnames": "2.3.1",