@cloudflare/component-card 5.0.64 → 6.0.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.
- package/CHANGELOG.md +1042 -3214
- package/es/Card.js +25 -19
- package/es/CardBlock.js +12 -9
- package/es/CardContent.js +10 -7
- package/es/CardControl.js +36 -30
- package/es/CardDrawer.js +10 -7
- package/es/CardDrawers.js +31 -24
- package/es/CardFooter.js +10 -7
- package/es/CardMessages.js +13 -10
- package/es/CardPropTypes.js +2 -2
- package/es/CardSection.js +25 -19
- package/es/CardToolbar.js +27 -21
- package/es/CardToolbarDrawerTrigger.js +8 -7
- package/es/CardToolbarLink.js +6 -5
- package/lib/CardBlock.js +14 -8
- package/lib/CardDrawers.js +18 -10
- package/lib/CardToolbarDrawerTrigger.js +14 -8
- package/lib/index.js +18 -18
- package/package.json +11 -11
package/lib/CardDrawers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -23,9 +23,11 @@ var _CardDrawer = _interopRequireDefault(require("./CardDrawer"));
|
|
|
23
23
|
|
|
24
24
|
var _CardToolbarLink = _interopRequireDefault(require("./CardToolbarLink"));
|
|
25
25
|
|
|
26
|
+
var _excluded = ["id", "name", "content", "drawerComponent", "onClick", "href", "ariaLabel"];
|
|
27
|
+
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
29
|
|
|
28
|
-
function _extends() { _extends = Object.assign
|
|
30
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
31
|
|
|
30
32
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
31
33
|
|
|
@@ -35,29 +37,35 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
35
37
|
|
|
36
38
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
37
39
|
|
|
38
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
40
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
39
41
|
|
|
40
|
-
function
|
|
42
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
41
43
|
|
|
42
|
-
function
|
|
44
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
45
|
+
|
|
46
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
43
47
|
|
|
44
|
-
function
|
|
48
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
45
49
|
|
|
46
|
-
function
|
|
50
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
51
|
+
|
|
52
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
47
53
|
|
|
48
|
-
function
|
|
54
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
49
55
|
|
|
50
56
|
var UNIQUE_ID = 0;
|
|
51
57
|
|
|
52
58
|
var CardDrawers = /*#__PURE__*/function (_React$Component) {
|
|
53
59
|
_inherits(CardDrawers, _React$Component);
|
|
54
60
|
|
|
61
|
+
var _super = _createSuper(CardDrawers);
|
|
62
|
+
|
|
55
63
|
function CardDrawers(props) {
|
|
56
64
|
var _this;
|
|
57
65
|
|
|
58
66
|
_classCallCheck(this, CardDrawers);
|
|
59
67
|
|
|
60
|
-
_this =
|
|
68
|
+
_this = _super.call(this, props);
|
|
61
69
|
_this._cardId = UNIQUE_ID++; // Map from drawer it to an array of functions to execute when the drawer
|
|
62
70
|
// opens or closes. onClick events can be defined in the drawers prop array,
|
|
63
71
|
// or, if drawerComponent is used to replace CardDrawer, a setToggleFunction
|
|
@@ -119,7 +127,7 @@ var CardDrawers = /*#__PURE__*/function (_React$Component) {
|
|
|
119
127
|
onClick = _ref2.onClick,
|
|
120
128
|
href = _ref2.href,
|
|
121
129
|
ariaLabel = _ref2.ariaLabel,
|
|
122
|
-
rest = _objectWithoutProperties(_ref2,
|
|
130
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
123
131
|
|
|
124
132
|
// The component used for the drawer can be overridden
|
|
125
133
|
var Drawer = drawerComponent || _CardDrawer.default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -21,28 +21,34 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
21
21
|
|
|
22
22
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
23
23
|
|
|
24
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
24
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
25
|
|
|
26
|
-
function
|
|
26
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
27
|
|
|
28
|
-
function
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
29
|
|
|
30
|
-
function
|
|
30
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
31
|
|
|
32
|
-
function
|
|
32
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
33
33
|
|
|
34
34
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
35
|
|
|
36
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
+
|
|
38
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
+
|
|
36
40
|
var CardToolbarDrawerTrigger = /*#__PURE__*/function (_React$Component) {
|
|
37
41
|
_inherits(CardToolbarDrawerTrigger, _React$Component);
|
|
38
42
|
|
|
43
|
+
var _super = _createSuper(CardToolbarDrawerTrigger);
|
|
44
|
+
|
|
39
45
|
function CardToolbarDrawerTrigger(props) {
|
|
40
46
|
var _this;
|
|
41
47
|
|
|
42
48
|
_classCallCheck(this, CardToolbarDrawerTrigger);
|
|
43
49
|
|
|
44
|
-
_this =
|
|
45
|
-
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(
|
|
50
|
+
_this = _super.call(this, props);
|
|
51
|
+
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
|
46
52
|
return _this;
|
|
47
53
|
}
|
|
48
54
|
|
package/lib/index.js
CHANGED
|
@@ -27,34 +27,46 @@ Object.defineProperty(exports, "CardControl", {
|
|
|
27
27
|
return _CardControl.default;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "CardDrawer", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _CardDrawer.default;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
30
36
|
Object.defineProperty(exports, "CardDrawers", {
|
|
31
37
|
enumerable: true,
|
|
32
38
|
get: function get() {
|
|
33
39
|
return _CardDrawers.default;
|
|
34
40
|
}
|
|
35
41
|
});
|
|
42
|
+
Object.defineProperty(exports, "CardFooter", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _CardFooter.default;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
36
48
|
Object.defineProperty(exports, "CardMessages", {
|
|
37
49
|
enumerable: true,
|
|
38
50
|
get: function get() {
|
|
39
51
|
return _CardMessages.default;
|
|
40
52
|
}
|
|
41
53
|
});
|
|
42
|
-
Object.defineProperty(exports, "
|
|
54
|
+
Object.defineProperty(exports, "CardPropTypes", {
|
|
43
55
|
enumerable: true,
|
|
44
56
|
get: function get() {
|
|
45
|
-
return
|
|
57
|
+
return _CardPropTypes.default;
|
|
46
58
|
}
|
|
47
59
|
});
|
|
48
|
-
Object.defineProperty(exports, "
|
|
60
|
+
Object.defineProperty(exports, "CardSection", {
|
|
49
61
|
enumerable: true,
|
|
50
62
|
get: function get() {
|
|
51
|
-
return
|
|
63
|
+
return _CardSection.default;
|
|
52
64
|
}
|
|
53
65
|
});
|
|
54
|
-
Object.defineProperty(exports, "
|
|
66
|
+
Object.defineProperty(exports, "CardTitle", {
|
|
55
67
|
enumerable: true,
|
|
56
68
|
get: function get() {
|
|
57
|
-
return
|
|
69
|
+
return _CardTitle.default;
|
|
58
70
|
}
|
|
59
71
|
});
|
|
60
72
|
Object.defineProperty(exports, "CardToolbar", {
|
|
@@ -75,18 +87,6 @@ Object.defineProperty(exports, "CardToolbarLink", {
|
|
|
75
87
|
return _CardToolbarLink.default;
|
|
76
88
|
}
|
|
77
89
|
});
|
|
78
|
-
Object.defineProperty(exports, "CardPropTypes", {
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function get() {
|
|
81
|
-
return _CardPropTypes.default;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
Object.defineProperty(exports, "CardDrawer", {
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function get() {
|
|
87
|
-
return _CardDrawer.default;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
90
|
|
|
91
91
|
var _Card = _interopRequireDefault(require("./Card"));
|
|
92
92
|
|
package/package.json
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/component-card",
|
|
3
3
|
"description": "Cloudflare Card Component",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "6.0.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
7
7
|
"author": "James Kyle <jkyle@cloudflare.com>",
|
|
8
8
|
"license": "BSD-3-Clause",
|
|
9
9
|
"publishConfig": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"access": "public",
|
|
11
|
+
"main": "lib/index.js",
|
|
12
|
+
"module": "es/index.js"
|
|
12
13
|
},
|
|
13
14
|
"dependencies": {
|
|
14
|
-
"@cloudflare/component-arrow-swivel": "^
|
|
15
|
-
"@cloudflare/component-button": "^
|
|
16
|
-
"@cloudflare/component-link": "^
|
|
17
|
-
"@cloudflare/component-page": "^
|
|
18
|
-
"@cloudflare/style-container": "^7.8.44",
|
|
15
|
+
"@cloudflare/component-arrow-swivel": "^4.0.0",
|
|
16
|
+
"@cloudflare/component-button": "^4.0.0",
|
|
17
|
+
"@cloudflare/component-link": "^6.0.0",
|
|
18
|
+
"@cloudflare/component-page": "^6.0.0",
|
|
19
19
|
"prop-types": "^15.6.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
+
"@cloudflare/style-container": "^7.9.0",
|
|
22
23
|
"react": "^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0"
|
|
23
24
|
},
|
|
24
25
|
"stratus": {
|
|
@@ -31,6 +32,5 @@
|
|
|
31
32
|
"test": "stratus test",
|
|
32
33
|
"test-coverage": "stratus test --coverage",
|
|
33
34
|
"test-watch": "stratus test --watch"
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
}
|
|
35
|
+
}
|
|
36
|
+
}
|