@activecollab/components 1.0.51 → 1.0.52
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/dist/cjs/components/EntityCard/EntityCard.js +4 -8
- package/dist/cjs/components/EntityCard/EntityCard.js.map +1 -1
- package/dist/cjs/components/EntityCard/Styles.js +1 -15
- package/dist/cjs/components/EntityCard/Styles.js.map +1 -1
- package/dist/esm/components/EntityCard/EntityCard.d.ts +2 -2
- package/dist/esm/components/EntityCard/EntityCard.d.ts.map +1 -1
- package/dist/esm/components/EntityCard/EntityCard.js +5 -9
- package/dist/esm/components/EntityCard/EntityCard.js.map +1 -1
- package/dist/esm/components/EntityCard/Styles.d.ts +0 -1
- package/dist/esm/components/EntityCard/Styles.d.ts.map +1 -1
- package/dist/esm/components/EntityCard/Styles.js +0 -9
- package/dist/esm/components/EntityCard/Styles.js.map +1 -1
- package/dist/index.js +4 -15
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -23,8 +23,7 @@ var EntityCard = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
23
23
|
var _ref$renderAs = _ref.renderAs,
|
|
24
24
|
renderAs = _ref$renderAs === void 0 ? "list-item" : _ref$renderAs,
|
|
25
25
|
properties = _ref.properties,
|
|
26
|
-
|
|
27
|
-
linkClassName = _ref.linkClassName;
|
|
26
|
+
className = _ref.className;
|
|
28
27
|
var renderAsListItem = (0, _react.useCallback)(function (properties) {
|
|
29
28
|
return properties.filter(function (p) {
|
|
30
29
|
return p.showInList;
|
|
@@ -67,19 +66,16 @@ var EntityCard = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
67
66
|
return renderProperty(p);
|
|
68
67
|
})));
|
|
69
68
|
}, []);
|
|
70
|
-
return /*#__PURE__*/_react.default.createElement(_Styles.
|
|
71
|
-
href: link,
|
|
72
|
-
className: linkClassName
|
|
73
|
-
}, /*#__PURE__*/_react.default.createElement(_Styles.StyledEntityCard, {
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement(_Styles.StyledEntityCard, {
|
|
74
70
|
ref: ref,
|
|
75
71
|
hoverable: true,
|
|
76
72
|
className: (0, _classnames.default)("entity-card-wrapper", {
|
|
77
73
|
"grid-item": renderAs === "grid-item",
|
|
78
74
|
"list-item": renderAs === "list-item"
|
|
79
|
-
}),
|
|
75
|
+
}, className),
|
|
80
76
|
paperType: renderAs === "grid-item" ? "paper-1" : "paper-2",
|
|
81
77
|
$renderAs: renderAs
|
|
82
|
-
}, renderAs === "list-item" ? renderAsListItem(properties) : null, renderAs === "grid-item" ? renderAsGridItem(properties) : null)
|
|
78
|
+
}, renderAs === "list-item" ? renderAsListItem(properties) : null, renderAs === "grid-item" ? renderAsGridItem(properties) : null);
|
|
83
79
|
});
|
|
84
80
|
exports.EntityCard = EntityCard;
|
|
85
81
|
EntityCard.displayName = "EntityCard";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/EntityCard/EntityCard.tsx"],"names":["EntityCard","ref","renderAs","properties","
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/EntityCard/EntityCard.tsx"],"names":["EntityCard","ref","renderAs","properties","className","renderAsListItem","filter","p","showInList","map","name","render","renderAsGridItem","headerSection","cardSection","bodySection","footerSection","renderProperty","displayName"],"mappings":";;;;;;;;;AAAA;;AAOA;;AACA;;;;;;;;AAoBO,IAAMA,UAAU,gBAAG,uBACxB,gBAMEC,GANF,EAOK;AAAA,2BALDC,QAKC;AAAA,MALDA,QAKC,8BALU,WAKV;AAAA,MAJDC,UAIC,QAJDA,UAIC;AAAA,MAHDC,SAGC,QAHDA,SAGC;AACH,MAAMC,gBAAgB,GAAG,wBAAY,UAACF,UAAD,EAAqC;AACxE,WAAOA,UAAU,CACdG,MADI,CACG,UAACC,CAAD;AAAA,aAAOA,CAAC,CAACC,UAAT;AAAA,KADH,EAEJC,GA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AAd,CAAkB,UAACF,CAAD;AAAA,aAAOU,cAAc,CAACV,CAAD,CAArB;AAAA,KAAlB,CADH,CAPF,CADF;AAaD,GA5BwB,EA4BtB,EA5BsB,CAAzB;AA8BA,sBACE,6BAAC,wBAAD;AACE,IAAA,GAAG,EAAEN,GADP;AAEE,IAAA,SAAS,MAFX;AAGE,IAAA,SAAS,EAAE,yBACT,qBADS,EAET;AACE,mBAAaC,QAAQ,KAAK,WAD5B;AAEE,mBAAaA,QAAQ,KAAK;AAF5B,KAFS,EAMTE,SANS,CAHb;AAWE,IAAA,SAAS,EAAEF,QAAQ,KAAK,WAAb,GAA2B,SAA3B,GAAuC,SAXpD;AAYE,IAAA,SAAS,EAAEA;AAZb,KAcGA,QAAQ,KAAK,WAAb,GAA2BG,gBAAgB,CAACF,UAAD,CAA3C,GAA0D,IAd7D,EAeGD,QAAQ,KAAK,WAAb,GAA2BU,gBAAgB,CAACT,UAAD,CAA3C,GAA0D,IAf7D,CADF;AAmBD,CAtEuB,CAAnB;;AAyEPH,UAAU,CAACkB,WAAX,GAAyB,YAAzB","sourcesContent":["import React, {\n Ref,\n HTMLAttributes,\n forwardRef,\n ReactNode,\n useCallback,\n} from \"react\";\nimport classnames from \"classnames\";\nimport { StyledEntityCard } from \"./Styles\";\n\nexport type cardSection = \"header\" | \"body\" | \"footer\";\n\nexport interface IEntityProperties {\n name: string;\n render: () => ReactNode;\n showInList?: boolean;\n cardSection: cardSection;\n className?: string;\n}\n\nexport interface IEntityCardProps {\n renderAs?: \"list-item\" | \"grid-item\";\n properties: IEntityProperties[];\n ref?: Ref<HTMLDivElement>;\n link?: string;\n className?: string;\n}\n\nexport const EntityCard = forwardRef(\n (\n {\n renderAs = \"list-item\",\n properties,\n className,\n }: HTMLAttributes<HTMLDivElement> & IEntityCardProps,\n ref: Ref<HTMLDivElement> | null | undefined\n ) => {\n const renderAsListItem = useCallback((properties: IEntityProperties[]) => {\n return properties\n .filter((p) => p.showInList)\n .map((p) => {\n return (\n <div key={p.name} className={`entity-property-${p.name}`}>\n {p.render()}\n </div>\n );\n });\n }, []);\n\n const renderAsGridItem = useCallback((properties: IEntityProperties[]) => {\n const headerSection = properties.filter(\n (p: IEntityProperties) => p.cardSection === \"header\"\n );\n const bodySection = properties.filter(\n (p: IEntityProperties) => p.cardSection === \"body\"\n );\n const footerSection = properties.filter(\n (p) => p.cardSection === \"footer\"\n );\n const renderProperty = (p: IEntityProperties): ReactNode => (\n <div key={p.name} className={`entity-property-${p.name}`}>\n {p.render()}\n </div>\n );\n return (\n <>\n <div className={\"card-header\"}>\n {headerSection.map((p) => renderProperty(p))}\n </div>\n <div className={\"card-body\"}>\n {bodySection.map((p) => renderProperty(p))}\n </div>\n <div className={\"card-footer\"}>\n {footerSection.map((p) => renderProperty(p))}\n </div>\n </>\n );\n }, []);\n\n return (\n <StyledEntityCard\n ref={ref}\n hoverable\n className={classnames(\n \"entity-card-wrapper\",\n {\n \"grid-item\": renderAs === \"grid-item\",\n \"list-item\": renderAs === \"list-item\",\n },\n className\n )}\n paperType={renderAs === \"grid-item\" ? \"paper-1\" : \"paper-2\"}\n $renderAs={renderAs}\n >\n {renderAs === \"list-item\" ? renderAsListItem(properties) : null}\n {renderAs === \"grid-item\" ? renderAsGridItem(properties) : null}\n </StyledEntityCard>\n );\n }\n);\n\nEntityCard.displayName = \"EntityCard\";\n"],"file":"EntityCard.js"}
|
|
@@ -5,16 +5,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.StyledEntityCard = void 0;
|
|
9
9
|
|
|
10
10
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
11
|
|
|
12
|
-
var _BoxSizingStyle = require("../BoxSizingStyle");
|
|
13
|
-
|
|
14
12
|
var _Card = require("../Card");
|
|
15
13
|
|
|
16
|
-
var _FontStyle = require("../FontStyle");
|
|
17
|
-
|
|
18
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
15
|
|
|
20
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -29,14 +25,4 @@ var StyledEntityCard = (0, _styledComponents.default)(_Card.Card).withConfig({
|
|
|
29
25
|
});
|
|
30
26
|
exports.StyledEntityCard = StyledEntityCard;
|
|
31
27
|
StyledEntityCard.displayName = "StyledEntityCard";
|
|
32
|
-
|
|
33
|
-
var StyledLinkEntityCard = _styledComponents.default.a.withConfig({
|
|
34
|
-
displayName: "Styles__StyledLinkEntityCard",
|
|
35
|
-
componentId: "sc-3vmxf-1"
|
|
36
|
-
})(["", " ", " ", ""], {
|
|
37
|
-
"textDecoration": "none"
|
|
38
|
-
}, _FontStyle.FontStyle, _BoxSizingStyle.BoxSizingStyle);
|
|
39
|
-
|
|
40
|
-
exports.StyledLinkEntityCard = StyledLinkEntityCard;
|
|
41
|
-
StyledLinkEntityCard.displayName = "StyledLinkEntityCard";
|
|
42
28
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/EntityCard/Styles.ts"],"names":["StyledEntityCard","Card","props","$renderAs","css","displayName"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/EntityCard/Styles.ts"],"names":["StyledEntityCard","Card","props","$renderAs","css","displayName"],"mappings":";;;;;;;;;AAAA;;AACA;;;;;;AAEO,IAAMA,gBAAgB,GAAG,+BAAOC,UAAP,CAAH;AAAA;AAAA;AAAA,iDAIzB,UAACC,KAAD;AAAA,SACAA,KAAK,CAACC,SAAN,KAAoB,WAApB,QACAC,qBADA,+FADA;AAAA,CAJyB,EAczB,UAACF,KAAD;AAAA,SACAA,KAAK,CAACC,SAAN,KAAoB,WAApB,QACAC,qBADA,2FADA;AAAA,CAdyB,CAAtB;;AA2BPJ,gBAAgB,CAACK,WAAjB,GAA+B,kBAA/B","sourcesContent":["import styled, { css } from \"styled-components\";\nimport { Card } from \"../Card\";\n\nexport const StyledEntityCard = styled(Card)<{ $renderAs: string }>`\n padding: 12px;\n line-height: 1.375;\n\n ${(props) =>\n props.$renderAs === \"list-item\" &&\n css`\n display: grid;\n grid-auto-flow: column;\n align-items: center;\n min-height: 48px;\n margin-bottom: 4px;\n `}\n\n ${(props) =>\n props.$renderAs === \"grid-item\" &&\n css`\n display: flex;\n flex-direction: column;\n height: 250px;\n width: 250px;\n\n .card-body {\n flex-grow: 1;\n }\n `}\n`;\nStyledEntityCard.displayName = \"StyledEntityCard\";\n"],"file":"Styles.js"}
|
|
@@ -12,7 +12,7 @@ export interface IEntityCardProps {
|
|
|
12
12
|
properties: IEntityProperties[];
|
|
13
13
|
ref?: Ref<HTMLDivElement>;
|
|
14
14
|
link?: string;
|
|
15
|
-
|
|
15
|
+
className?: string;
|
|
16
16
|
}
|
|
17
|
-
export declare const EntityCard: React.ForwardRefExoticComponent<Pick<React.HTMLAttributes<HTMLDivElement> & IEntityCardProps, "link" |
|
|
17
|
+
export declare const EntityCard: React.ForwardRefExoticComponent<Pick<React.HTMLAttributes<HTMLDivElement> & IEntityCardProps, "link" | "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "cs" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "tw" | "renderAs" | "properties"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
18
|
//# sourceMappingURL=EntityCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityCard.d.ts","sourceRoot":"","sources":["../../../../src/components/EntityCard/EntityCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,GAAG,EAGH,SAAS,EAEV,MAAM,OAAO,CAAC;AAIf,oBAAY,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC;IACrC,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"EntityCard.d.ts","sourceRoot":"","sources":["../../../../src/components/EntityCard/EntityCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,GAAG,EAGH,SAAS,EAEV,MAAM,OAAO,CAAC;AAIf,oBAAY,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC;IACrC,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,uqJAuEtB,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React, { forwardRef, useCallback } from "react";
|
|
2
2
|
import classnames from "classnames";
|
|
3
|
-
import { StyledEntityCard
|
|
3
|
+
import { StyledEntityCard } from "./Styles";
|
|
4
4
|
export var EntityCard = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
5
5
|
var _ref$renderAs = _ref.renderAs,
|
|
6
6
|
renderAs = _ref$renderAs === void 0 ? "list-item" : _ref$renderAs,
|
|
7
7
|
properties = _ref.properties,
|
|
8
|
-
|
|
9
|
-
linkClassName = _ref.linkClassName;
|
|
8
|
+
className = _ref.className;
|
|
10
9
|
var renderAsListItem = useCallback(function (properties) {
|
|
11
10
|
return properties.filter(function (p) {
|
|
12
11
|
return p.showInList;
|
|
@@ -49,19 +48,16 @@ export var EntityCard = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
49
48
|
return renderProperty(p);
|
|
50
49
|
})));
|
|
51
50
|
}, []);
|
|
52
|
-
return /*#__PURE__*/React.createElement(
|
|
53
|
-
href: link,
|
|
54
|
-
className: linkClassName
|
|
55
|
-
}, /*#__PURE__*/React.createElement(StyledEntityCard, {
|
|
51
|
+
return /*#__PURE__*/React.createElement(StyledEntityCard, {
|
|
56
52
|
ref: ref,
|
|
57
53
|
hoverable: true,
|
|
58
54
|
className: classnames("entity-card-wrapper", {
|
|
59
55
|
"grid-item": renderAs === "grid-item",
|
|
60
56
|
"list-item": renderAs === "list-item"
|
|
61
|
-
}),
|
|
57
|
+
}, className),
|
|
62
58
|
paperType: renderAs === "grid-item" ? "paper-1" : "paper-2",
|
|
63
59
|
$renderAs: renderAs
|
|
64
|
-
}, renderAs === "list-item" ? renderAsListItem(properties) : null, renderAs === "grid-item" ? renderAsGridItem(properties) : null)
|
|
60
|
+
}, renderAs === "list-item" ? renderAsListItem(properties) : null, renderAs === "grid-item" ? renderAsGridItem(properties) : null);
|
|
65
61
|
});
|
|
66
62
|
EntityCard.displayName = "EntityCard";
|
|
67
63
|
//# sourceMappingURL=EntityCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/EntityCard/EntityCard.tsx"],"names":["React","forwardRef","useCallback","classnames","StyledEntityCard","
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/EntityCard/EntityCard.tsx"],"names":["React","forwardRef","useCallback","classnames","StyledEntityCard","EntityCard","ref","renderAs","properties","className","renderAsListItem","filter","p","showInList","map","name","render","renderAsGridItem","headerSection","cardSection","bodySection","footerSection","renderProperty","displayName"],"mappings":"AAAA,OAAOA,KAAP,IAGEC,UAHF,EAKEC,WALF,QAMO,OANP;AAOA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAASC,gBAAT,QAAiC,UAAjC;AAoBA,OAAO,IAAMC,UAAU,gBAAGJ,UAAU,CAClC,gBAMEK,GANF,EAOK;AAAA,2BALDC,QAKC;AA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ACV,CAAD,CAArB;AAAA,KAAlB,CADH,CADF,eAIE;AAAK,MAAA,SAAS,EAAE;AAAhB,OACGQ,WAAW,CAACN,GAAZ,CAAgB,UAACF,CAAD;AAAA,aAAOU,cAAc,CAACV,CAAD,CAArB;AAAA,KAAhB,CADH,CAJF,eAOE;AAAK,MAAA,SAAS,EAAE;AAAhB,OACGS,aAAa,CAACP,GAAd,CAAkB,UAACF,CAAD;AAAA,aAAOU,cAAc,CAACV,CAAD,CAArB;AAAA,KAAlB,CADH,CAPF,CADF;AAaD,GA5BmC,EA4BjC,EA5BiC,CAApC;AA8BA,sBACE,oBAAC,gBAAD;AACE,IAAA,GAAG,EAAEN,GADP;AAEE,IAAA,SAAS,MAFX;AAGE,IAAA,SAAS,EAAEH,UAAU,CACnB,qBADmB,EAEnB;AACE,mBAAaI,QAAQ,KAAK,WAD5B;AAEE,mBAAaA,QAAQ,KAAK;AAF5B,KAFmB,EAMnBE,SANmB,CAHvB;AAWE,IAAA,SAAS,EAAEF,QAAQ,KAAK,WAAb,GAA2B,SAA3B,GAAuC,SAXpD;AAYE,IAAA,SAAS,EAAEA;AAZb,KAcGA,QAAQ,KAAK,WAAb,GAA2BG,gBAAgB,CAACF,UAAD,CAA3C,GAA0D,IAd7D,EAeGD,QAAQ,KAAK,WAAb,GAA2BU,gBAAgB,CAACT,UAAD,CAA3C,GAA0D,IAf7D,CADF;AAmBD,CAtEiC,CAA7B;AAyEPH,UAAU,CAACkB,WAAX,GAAyB,YAAzB","sourcesContent":["import React, {\n Ref,\n HTMLAttributes,\n forwardRef,\n ReactNode,\n useCallback,\n} from \"react\";\nimport classnames from \"classnames\";\nimport { StyledEntityCard } from \"./Styles\";\n\nexport type cardSection = \"header\" | \"body\" | \"footer\";\n\nexport interface IEntityProperties {\n name: string;\n render: () => ReactNode;\n showInList?: boolean;\n cardSection: cardSection;\n className?: string;\n}\n\nexport interface IEntityCardProps {\n renderAs?: \"list-item\" | \"grid-item\";\n properties: IEntityProperties[];\n ref?: Ref<HTMLDivElement>;\n link?: string;\n className?: string;\n}\n\nexport const EntityCard = forwardRef(\n (\n {\n renderAs = \"list-item\",\n properties,\n className,\n }: HTMLAttributes<HTMLDivElement> & IEntityCardProps,\n ref: Ref<HTMLDivElement> | null | undefined\n ) => {\n const renderAsListItem = useCallback((properties: IEntityProperties[]) => {\n return properties\n .filter((p) => p.showInList)\n .map((p) => {\n return (\n <div key={p.name} className={`entity-property-${p.name}`}>\n {p.render()}\n </div>\n );\n });\n }, []);\n\n const renderAsGridItem = useCallback((properties: IEntityProperties[]) => {\n const headerSection = properties.filter(\n (p: IEntityProperties) => p.cardSection === \"header\"\n );\n const bodySection = properties.filter(\n (p: IEntityProperties) => p.cardSection === \"body\"\n );\n const footerSection = properties.filter(\n (p) => p.cardSection === \"footer\"\n );\n const renderProperty = (p: IEntityProperties): ReactNode => (\n <div key={p.name} className={`entity-property-${p.name}`}>\n {p.render()}\n </div>\n );\n return (\n <>\n <div className={\"card-header\"}>\n {headerSection.map((p) => renderProperty(p))}\n </div>\n <div className={\"card-body\"}>\n {bodySection.map((p) => renderProperty(p))}\n </div>\n <div className={\"card-footer\"}>\n {footerSection.map((p) => renderProperty(p))}\n </div>\n </>\n );\n }, []);\n\n return (\n <StyledEntityCard\n ref={ref}\n hoverable\n className={classnames(\n \"entity-card-wrapper\",\n {\n \"grid-item\": renderAs === \"grid-item\",\n \"list-item\": renderAs === \"list-item\",\n },\n className\n )}\n paperType={renderAs === \"grid-item\" ? \"paper-1\" : \"paper-2\"}\n $renderAs={renderAs}\n >\n {renderAs === \"list-item\" ? renderAsListItem(properties) : null}\n {renderAs === \"grid-item\" ? renderAsGridItem(properties) : null}\n </StyledEntityCard>\n );\n }\n);\n\nEntityCard.displayName = \"EntityCard\";\n"],"file":"EntityCard.js"}
|
|
@@ -2,5 +2,4 @@
|
|
|
2
2
|
export declare const StyledEntityCard: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("react").HTMLAttributes<HTMLDivElement> & import("../Card").ICardProps, keyof import("react").HTMLAttributes<HTMLDivElement> | "hoverable" | "paperType"> & import("react").RefAttributes<HTMLDivElement>>, any, {
|
|
3
3
|
$renderAs: string;
|
|
4
4
|
}, never>;
|
|
5
|
-
export declare const StyledLinkEntityCard: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
6
5
|
//# sourceMappingURL=Styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/EntityCard/Styles.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/EntityCard/Styles.ts"],"names":[],"mappings":";AAGA,eAAO,MAAM,gBAAgB;eAA6B,MAAM;SA0B/D,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import { BoxSizingStyle } from "../BoxSizingStyle";
|
|
3
2
|
import { Card } from "../Card";
|
|
4
|
-
import { FontStyle } from "../FontStyle";
|
|
5
3
|
export var StyledEntityCard = styled(Card).withConfig({
|
|
6
4
|
displayName: "Styles__StyledEntityCard",
|
|
7
5
|
componentId: "sc-3vmxf-0"
|
|
@@ -11,11 +9,4 @@ export var StyledEntityCard = styled(Card).withConfig({
|
|
|
11
9
|
return props.$renderAs === "grid-item" && css(["display:flex;flex-direction:column;height:250px;width:250px;.card-body{flex-grow:1;}"]);
|
|
12
10
|
});
|
|
13
11
|
StyledEntityCard.displayName = "StyledEntityCard";
|
|
14
|
-
export var StyledLinkEntityCard = styled.a.withConfig({
|
|
15
|
-
displayName: "Styles__StyledLinkEntityCard",
|
|
16
|
-
componentId: "sc-3vmxf-1"
|
|
17
|
-
})(["", " ", " ", ""], {
|
|
18
|
-
"textDecoration": "none"
|
|
19
|
-
}, FontStyle, BoxSizingStyle);
|
|
20
|
-
StyledLinkEntityCard.displayName = "StyledLinkEntityCard";
|
|
21
12
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/EntityCard/Styles.ts"],"names":["styled","css","
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/EntityCard/Styles.ts"],"names":["styled","css","Card","StyledEntityCard","props","$renderAs","displayName"],"mappings":"AAAA,OAAOA,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AACA,SAASC,IAAT,QAAqB,SAArB;AAEA,OAAO,IAAMC,gBAAgB,GAAGH,MAAM,CAACE,IAAD,CAAT;AAAA;AAAA;AAAA,iDAIzB,UAACE,KAAD;AAAA,SACAA,KAAK,CAACC,SAAN,KAAoB,WAApB,IACAJ,GADA,8FADA;AAAA,CAJyB,EAczB,UAACG,KAAD;AAAA,SACAA,KAAK,CAACC,SAAN,KAAoB,WAApB,IACAJ,GADA,0FADA;AAAA,CAdyB,CAAtB;AA2BPE,gBAAgB,CAACG,WAAjB,GAA+B,kBAA/B","sourcesContent":["import styled, { css } from \"styled-components\";\nimport { Card } from \"../Card\";\n\nexport const StyledEntityCard = styled(Card)<{ $renderAs: string }>`\n padding: 12px;\n line-height: 1.375;\n\n ${(props) =>\n props.$renderAs === \"list-item\" &&\n css`\n display: grid;\n grid-auto-flow: column;\n align-items: center;\n min-height: 48px;\n margin-bottom: 4px;\n `}\n\n ${(props) =>\n props.$renderAs === \"grid-item\" &&\n css`\n display: flex;\n flex-direction: column;\n height: 250px;\n width: 250px;\n\n .card-body {\n flex-grow: 1;\n }\n `}\n`;\nStyledEntityCard.displayName = \"StyledEntityCard\";\n"],"file":"Styles.js"}
|
package/dist/index.js
CHANGED
|
@@ -3219,20 +3219,12 @@
|
|
|
3219
3219
|
return props.$renderAs === "grid-item" && styled.css(["display:flex;flex-direction:column;height:250px;width:250px;.card-body{flex-grow:1;}"]);
|
|
3220
3220
|
});
|
|
3221
3221
|
StyledEntityCard.displayName = "StyledEntityCard";
|
|
3222
|
-
var StyledLinkEntityCard = styled__default["default"].a.withConfig({
|
|
3223
|
-
displayName: "Styles__StyledLinkEntityCard",
|
|
3224
|
-
componentId: "sc-3vmxf-1"
|
|
3225
|
-
})(["", " ", " ", ""], {
|
|
3226
|
-
"textDecoration": "none"
|
|
3227
|
-
}, FontStyle, BoxSizingStyle);
|
|
3228
|
-
StyledLinkEntityCard.displayName = "StyledLinkEntityCard";
|
|
3229
3222
|
|
|
3230
3223
|
var EntityCard = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3231
3224
|
var _ref$renderAs = _ref.renderAs,
|
|
3232
3225
|
renderAs = _ref$renderAs === void 0 ? "list-item" : _ref$renderAs,
|
|
3233
3226
|
properties = _ref.properties,
|
|
3234
|
-
|
|
3235
|
-
linkClassName = _ref.linkClassName;
|
|
3227
|
+
className = _ref.className;
|
|
3236
3228
|
var renderAsListItem = React.useCallback(function (properties) {
|
|
3237
3229
|
return properties.filter(function (p) {
|
|
3238
3230
|
return p.showInList;
|
|
@@ -3275,19 +3267,16 @@
|
|
|
3275
3267
|
return renderProperty(p);
|
|
3276
3268
|
})));
|
|
3277
3269
|
}, []);
|
|
3278
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
3279
|
-
href: link,
|
|
3280
|
-
className: linkClassName
|
|
3281
|
-
}, /*#__PURE__*/React__default["default"].createElement(StyledEntityCard, {
|
|
3270
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledEntityCard, {
|
|
3282
3271
|
ref: ref,
|
|
3283
3272
|
hoverable: true,
|
|
3284
3273
|
className: classnames__default["default"]("entity-card-wrapper", {
|
|
3285
3274
|
"grid-item": renderAs === "grid-item",
|
|
3286
3275
|
"list-item": renderAs === "list-item"
|
|
3287
|
-
}),
|
|
3276
|
+
}, className),
|
|
3288
3277
|
paperType: renderAs === "grid-item" ? "paper-1" : "paper-2",
|
|
3289
3278
|
$renderAs: renderAs
|
|
3290
|
-
}, renderAs === "list-item" ? renderAsListItem(properties) : null, renderAs === "grid-item" ? renderAsGridItem(properties) : null)
|
|
3279
|
+
}, renderAs === "list-item" ? renderAsListItem(properties) : null, renderAs === "grid-item" ? renderAsGridItem(properties) : null);
|
|
3291
3280
|
});
|
|
3292
3281
|
EntityCard.displayName = "EntityCard";
|
|
3293
3282
|
|