@sb1/ffe-cards-react 17.5.1 → 17.5.3

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.
@@ -46,9 +46,11 @@ function WithCardActionForwardRef(props, ref) {
46
46
  : cardActionInnerRef }, restCardAction)));
47
47
  }, []);
48
48
  return (React.createElement(Comp, __assign({}, rest, { className: classNames(className, isUsingCardAction && "".concat(baseClassName, "--clickable")), onClick: function (e) {
49
- var _a, _b;
50
- if (!((_a = cardActionInnerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
51
- (_b = cardActionInnerRef.current) === null || _b === void 0 ? void 0 : _b.click();
49
+ var _a, _b, _c;
50
+ var hasSelectedText = !!((_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.toString().length);
51
+ if (!hasSelectedText &&
52
+ !((_b = cardActionInnerRef.current) === null || _b === void 0 ? void 0 : _b.contains(e.target))) {
53
+ (_c = cardActionInnerRef.current) === null || _c === void 0 ? void 0 : _c.click();
52
54
  }
53
55
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
54
56
  }, ref: ref }), children({
@@ -1 +1 @@
1
- {"root":["../src/CardBase.tsx","../src/fixedForwardRef.tsx","../src/index.ts","../src/mergeRefs.ts","../src/types.ts","../src/GroupCard/GroupCard.tsx","../src/GroupCard/GroupCardElement.tsx","../src/GroupCard/GroupCardFooter.tsx","../src/GroupCard/GroupCardTitle.tsx","../src/IconCard/IconCard.tsx","../src/IllustrationCard/IllustrationCard.tsx","../src/ImageCard/ImageCard.tsx","../src/StippledCard/StippledCard.tsx","../src/TextCard/TextCard.tsx","../src/components/CardAction.tsx","../src/components/CardName.tsx","../src/components/ComponentBase.tsx","../src/components/Subtext.tsx","../src/components/Text.tsx","../src/components/Title.tsx","../src/components/WithCardAction.tsx","../src/components/index.ts"],"version":"5.6.2"}
1
+ {"root":["../src/CardBase.tsx","../src/fixedForwardRef.tsx","../src/index.ts","../src/mergeRefs.ts","../src/types.ts","../src/GroupCard/GroupCard.tsx","../src/GroupCard/GroupCardElement.tsx","../src/GroupCard/GroupCardFooter.tsx","../src/GroupCard/GroupCardTitle.tsx","../src/IconCard/IconCard.tsx","../src/IllustrationCard/IllustrationCard.tsx","../src/ImageCard/ImageCard.tsx","../src/StippledCard/StippledCard.tsx","../src/TextCard/TextCard.tsx","../src/components/CardAction.tsx","../src/components/CardName.tsx","../src/components/ComponentBase.tsx","../src/components/Subtext.tsx","../src/components/Text.tsx","../src/components/Title.tsx","../src/components/WithCardAction.tsx","../src/components/index.ts"],"version":"5.6.3"}
@@ -75,9 +75,11 @@ function WithCardActionForwardRef(props, ref) {
75
75
  : cardActionInnerRef }, restCardAction)));
76
76
  }, []);
77
77
  return (react_1.default.createElement(Comp, __assign({}, rest, { className: (0, classnames_1.default)(className, isUsingCardAction && "".concat(baseClassName, "--clickable")), onClick: function (e) {
78
- var _a, _b;
79
- if (!((_a = cardActionInnerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
80
- (_b = cardActionInnerRef.current) === null || _b === void 0 ? void 0 : _b.click();
78
+ var _a, _b, _c;
79
+ var hasSelectedText = !!((_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.toString().length);
80
+ if (!hasSelectedText &&
81
+ !((_b = cardActionInnerRef.current) === null || _b === void 0 ? void 0 : _b.contains(e.target))) {
82
+ (_c = cardActionInnerRef.current) === null || _c === void 0 ? void 0 : _c.click();
81
83
  }
82
84
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
83
85
  }, ref: ref }), children({
@@ -1 +1 @@
1
- {"root":["../src/CardBase.tsx","../src/fixedForwardRef.tsx","../src/index.ts","../src/mergeRefs.ts","../src/types.ts","../src/GroupCard/GroupCard.tsx","../src/GroupCard/GroupCardElement.tsx","../src/GroupCard/GroupCardFooter.tsx","../src/GroupCard/GroupCardTitle.tsx","../src/IconCard/IconCard.tsx","../src/IllustrationCard/IllustrationCard.tsx","../src/ImageCard/ImageCard.tsx","../src/StippledCard/StippledCard.tsx","../src/TextCard/TextCard.tsx","../src/components/CardAction.tsx","../src/components/CardName.tsx","../src/components/ComponentBase.tsx","../src/components/Subtext.tsx","../src/components/Text.tsx","../src/components/Title.tsx","../src/components/WithCardAction.tsx","../src/components/index.ts"],"version":"5.6.2"}
1
+ {"root":["../src/CardBase.tsx","../src/fixedForwardRef.tsx","../src/index.ts","../src/mergeRefs.ts","../src/types.ts","../src/GroupCard/GroupCard.tsx","../src/GroupCard/GroupCardElement.tsx","../src/GroupCard/GroupCardFooter.tsx","../src/GroupCard/GroupCardTitle.tsx","../src/IconCard/IconCard.tsx","../src/IllustrationCard/IllustrationCard.tsx","../src/ImageCard/ImageCard.tsx","../src/StippledCard/StippledCard.tsx","../src/TextCard/TextCard.tsx","../src/components/CardAction.tsx","../src/components/CardName.tsx","../src/components/ComponentBase.tsx","../src/components/Subtext.tsx","../src/components/Text.tsx","../src/components/Title.tsx","../src/components/WithCardAction.tsx","../src/components/index.ts"],"version":"5.6.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-cards-react",
3
- "version": "17.5.1",
3
+ "version": "17.5.3",
4
4
  "description": "React implementation of ffe-react",
5
5
  "license": "MIT",
6
6
  "author": "SpareBank 1",
@@ -26,7 +26,7 @@
26
26
  "test:watch": "ffe-buildtool jest --watch"
27
27
  },
28
28
  "dependencies": {
29
- "@sb1/ffe-cards": "^20.2.0"
29
+ "@sb1/ffe-cards": "^20.2.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@sb1/ffe-buildtool": "^0.9.0",
@@ -40,5 +40,5 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "671f9cd4a5c589643d12589a4454f40994eabb28"
43
+ "gitHead": "d6c59e910bbe5b73b1cf8e8c978bee70f7941207"
44
44
  }
@@ -1 +1 @@
1
- {"root":["../src/CardBase.tsx","../src/fixedForwardRef.tsx","../src/index.ts","../src/mergeRefs.ts","../src/types.ts","../src/GroupCard/GroupCard.tsx","../src/GroupCard/GroupCardElement.tsx","../src/GroupCard/GroupCardFooter.tsx","../src/GroupCard/GroupCardTitle.tsx","../src/IconCard/IconCard.tsx","../src/IllustrationCard/IllustrationCard.tsx","../src/ImageCard/ImageCard.tsx","../src/StippledCard/StippledCard.tsx","../src/TextCard/TextCard.tsx","../src/components/CardAction.tsx","../src/components/CardName.tsx","../src/components/ComponentBase.tsx","../src/components/Subtext.tsx","../src/components/Text.tsx","../src/components/Title.tsx","../src/components/WithCardAction.tsx","../src/components/index.ts"],"version":"5.6.2"}
1
+ {"root":["../src/CardBase.tsx","../src/fixedForwardRef.tsx","../src/index.ts","../src/mergeRefs.ts","../src/types.ts","../src/GroupCard/GroupCard.tsx","../src/GroupCard/GroupCardElement.tsx","../src/GroupCard/GroupCardFooter.tsx","../src/GroupCard/GroupCardTitle.tsx","../src/IconCard/IconCard.tsx","../src/IllustrationCard/IllustrationCard.tsx","../src/ImageCard/ImageCard.tsx","../src/StippledCard/StippledCard.tsx","../src/TextCard/TextCard.tsx","../src/components/CardAction.tsx","../src/components/CardName.tsx","../src/components/ComponentBase.tsx","../src/components/Subtext.tsx","../src/components/Text.tsx","../src/components/Title.tsx","../src/components/WithCardAction.tsx","../src/components/index.ts"],"version":"5.6.3"}