@eccenca/gui-elements 24.0.0-rc.1 → 24.0.0-rc.2
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 +12 -0
- package/dist/cjs/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js +8 -2
- package/dist/cjs/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js.map +1 -1
- package/dist/cjs/components/FlexibleLayout/FlexibleLayoutContainer.js +55 -0
- package/dist/cjs/components/FlexibleLayout/FlexibleLayoutContainer.js.map +1 -0
- package/dist/cjs/components/FlexibleLayout/FlexibleLayoutItem.js +57 -0
- package/dist/cjs/components/FlexibleLayout/FlexibleLayoutItem.js.map +1 -0
- package/dist/cjs/components/FlexibleLayout/index.js +19 -0
- package/dist/cjs/components/FlexibleLayout/index.js.map +1 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js +2 -2
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/Label/Label.js +2 -2
- package/dist/cjs/components/Label/Label.js.map +1 -1
- package/dist/cjs/components/PropertyValuePair/PropertyValueList.js +12 -2
- package/dist/cjs/components/PropertyValuePair/PropertyValueList.js.map +1 -1
- package/dist/cjs/components/PropertyValuePair/PropertyValuePair.js +3 -2
- package/dist/cjs/components/PropertyValuePair/PropertyValuePair.js.map +1 -1
- package/dist/cjs/components/index.js +1 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/esm/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js +8 -2
- package/dist/esm/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js.map +1 -1
- package/dist/esm/components/FlexibleLayout/FlexibleLayoutContainer.js +40 -0
- package/dist/esm/components/FlexibleLayout/FlexibleLayoutContainer.js.map +1 -0
- package/dist/esm/components/FlexibleLayout/FlexibleLayoutItem.js +42 -0
- package/dist/esm/components/FlexibleLayout/FlexibleLayoutItem.js.map +1 -0
- package/dist/esm/components/FlexibleLayout/index.js +3 -0
- package/dist/esm/components/FlexibleLayout/index.js.map +1 -0
- package/dist/esm/components/Icon/canonicalIconNames.js +2 -2
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/Label/Label.js +2 -2
- package/dist/esm/components/Label/Label.js.map +1 -1
- package/dist/esm/components/PropertyValuePair/PropertyValueList.js +12 -2
- package/dist/esm/components/PropertyValuePair/PropertyValueList.js.map +1 -1
- package/dist/esm/components/PropertyValuePair/PropertyValuePair.js +3 -2
- package/dist/esm/components/PropertyValuePair/PropertyValuePair.js.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/types/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.d.ts +5 -1
- package/dist/types/components/FlexibleLayout/FlexibleLayoutContainer.d.ts +31 -0
- package/dist/types/components/FlexibleLayout/FlexibleLayoutItem.d.ts +24 -0
- package/dist/types/components/FlexibleLayout/index.d.ts +2 -0
- package/dist/types/components/Label/Label.d.ts +5 -1
- package/dist/types/components/PropertyValuePair/PropertyValueList.d.ts +8 -2
- package/dist/types/components/PropertyValuePair/PropertyValuePair.d.ts +5 -1
- package/dist/types/components/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.tsx +17 -7
- package/src/cmem/markdown/markdown.scss +6 -3
- package/src/cmem/markdown/markdown.utils.ts +18 -0
- package/src/cmem/markdown/markdownutils.test.ts +13 -0
- package/src/components/FlexibleLayout/FlexibleLayoutContainer.tsx +67 -0
- package/src/components/FlexibleLayout/FlexibleLayoutItem.tsx +59 -0
- package/src/components/FlexibleLayout/flexiblelayout.scss +48 -0
- package/src/components/FlexibleLayout/index.ts +2 -0
- package/src/components/FlexibleLayout/stories/FlexibleLayoutContainer.stories.tsx +31 -0
- package/src/components/FlexibleLayout/stories/FlexibleLayoutItem.stories.tsx +28 -0
- package/src/components/Icon/canonicalIconNames.tsx +2 -2
- package/src/components/Label/Label.tsx +6 -1
- package/src/components/Label/label.scss +6 -0
- package/src/components/PropertyValuePair/PropertyValueList.tsx +26 -3
- package/src/components/PropertyValuePair/PropertyValuePair.tsx +7 -1
- package/src/components/PropertyValuePair/propertyvalue.scss +25 -13
- package/src/components/PropertyValuePair/stories/PropertyValueList.stories.tsx +1 -1
- package/src/components/PropertyValuePair/stories/PropertyValuePair.stories.tsx +1 -1
- package/src/components/Typography/typography.scss +51 -0
- package/src/components/index.scss +1 -0
- package/src/components/index.ts +1 -0
- package/src/configuration/_variables.scss +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyValueList.js","sourceRoot":"","sources":["../../../../src/components/PropertyValuePair/PropertyValueList.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,IAAI,MAAM,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"PropertyValueList.js","sourceRoot":"","sources":["../../../../src/components/PropertyValuePair/PropertyValueList.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,IAAI,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAUxD,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAAC,EAKT;IAJrB,IAAA,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,EACd,QAAQ,cAAA,EACR,oBAAoB,EAApB,YAAY,mBAAG,KAAK,KAAA,EACjB,UAAU,cAJiB,yCAKjC,CADgB;IAEb,IAAM,eAAe,GAAG,YAAY;QAChC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAC,KAAK;YAC/B,IAAM,aAAa,GAAG,KAA2B,CAAC;YAClD,IAAI,aAAa,IAAI,aAAa,CAAC,IAAI,IAAI,aAAa,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;gBAClF,OAAO,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;YACrE,CAAC;YACD,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC;QACJ,CAAC,CAAC,QAAQ,CAAC;IAEf,OAAO,CACH,qCAAI,SAAS,EAAE,UAAG,MAAM,yBAAsB,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAM,UAAU,GAC9F,eAAe,CACf,CACR,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -25,7 +25,7 @@ import { CLASSPREFIX as eccgui } from "../../configuration/constants.js";
|
|
|
25
25
|
import PropertyName from "./PropertyName.js";
|
|
26
26
|
import PropertyValue from "./PropertyValue.js";
|
|
27
27
|
export var PropertyValuePair = function (_a) {
|
|
28
|
-
var children = _a.children, _b = _a.className, className = _b === void 0 ? "" : _b, nowrap = _a.nowrap, _c = _a.hasSpacing, hasSpacing = _c === void 0 ? false : _c, _d = _a.hasDivider, hasDivider = _d === void 0 ? false : _d, otherProps = __rest(_a, ["children", "className", "nowrap", "hasSpacing", "hasDivider"]);
|
|
28
|
+
var children = _a.children, _b = _a.className, className = _b === void 0 ? "" : _b, nowrap = _a.nowrap, _c = _a.hasSpacing, hasSpacing = _c === void 0 ? false : _c, _d = _a.hasDivider, hasDivider = _d === void 0 ? false : _d, _e = _a.singleColumn, singleColumn = _e === void 0 ? false : _e, otherProps = __rest(_a, ["children", "className", "nowrap", "hasSpacing", "hasDivider", "singleColumn"]);
|
|
29
29
|
var alteredChildren = nowrap
|
|
30
30
|
? React.Children.map(children, function (child) {
|
|
31
31
|
var originalChild = child;
|
|
@@ -38,7 +38,8 @@ export var PropertyValuePair = function (_a) {
|
|
|
38
38
|
return (React.createElement("div", __assign({ className: "".concat(eccgui, "-propertyvalue__pair") +
|
|
39
39
|
(className ? " " + className : "") +
|
|
40
40
|
(hasSpacing ? " ".concat(eccgui, "-propertyvalue__pair--hasspacing") : "") +
|
|
41
|
-
(hasDivider ? " ".concat(eccgui, "-propertyvalue__pair--hasdivider") : "")
|
|
41
|
+
(hasDivider ? " ".concat(eccgui, "-propertyvalue__pair--hasdivider") : "") +
|
|
42
|
+
(singleColumn ? " ".concat(eccgui, "-propertyvalue__pair--singlecolumn") : "") }, otherProps), alteredChildren));
|
|
42
43
|
};
|
|
43
44
|
export default PropertyValuePair;
|
|
44
45
|
//# sourceMappingURL=PropertyValuePair.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyValuePair.js","sourceRoot":"","sources":["../../../../src/components/PropertyValuePair/PropertyValuePair.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,IAAI,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,aAAa,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"PropertyValuePair.js","sourceRoot":"","sources":["../../../../src/components/PropertyValuePair/PropertyValuePair.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,IAAI,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAqB5C,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAAC,EAQT;IAPrB,IAAA,QAAQ,cAAA,EACR,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,EACd,MAAM,YAAA,EACN,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,oBAAoB,EAApB,YAAY,mBAAG,KAAK,KAAA,EACjB,UAAU,cAPiB,+EAQjC,CADgB;IAEb,IAAM,eAAe,GAAG,MAAM;QAC1B,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAC,KAAK;YAC/B,IAAM,aAAa,GAAG,KAA2B,CAAC;YAClD,IAAI,aAAa,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,YAAY,IAAI,aAAa,CAAC,IAAI,KAAK,aAAa,CAAC,EAAE,CAAC;gBACtG,OAAO,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;YAC/D,CAAC;YACD,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC;QACJ,CAAC,CAAC,QAAQ,CAAC;IAEf,OAAO,CACH,sCACI,SAAS,EACL,UAAG,MAAM,yBAAsB;YAC/B,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YAClC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAI,MAAM,qCAAkC,CAAC,CAAC,CAAC,EAAE,CAAC;YAChE,CAAC,UAAU,CAAC,CAAC,CAAC,WAAI,MAAM,qCAAkC,CAAC,CAAC,CAAC,EAAE,CAAC;YAChE,CAAC,YAAY,CAAC,CAAC,CAAC,WAAI,MAAM,uCAAoC,CAAC,CAAC,CAAC,EAAE,CAAC,IAEpE,UAAU,GAEb,eAAe,CACd,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -12,6 +12,7 @@ export * from "./Checkbox/Checkbox.js";
|
|
|
12
12
|
export * from "./ContextOverlay/index.js";
|
|
13
13
|
export * from "./Depiction/Depiction.js";
|
|
14
14
|
export * from "./Dialog/index.js";
|
|
15
|
+
export * from "./FlexibleLayout/index.js";
|
|
15
16
|
export * from "./Form/index.js";
|
|
16
17
|
export * from "./Grid/index.js";
|
|
17
18
|
export * from "./HoverToggler/HoverToggler.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,6BAA6B,CAAC;AAC5C,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,mCAAmC,CAAC;AAClD,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAE5B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,6BAA6B,CAAC;AAC5C,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,mCAAmC,CAAC;AAClD,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAE5B,cAAc,cAAc,CAAC"}
|
|
@@ -15,9 +15,13 @@ export interface StringPreviewContentBlobTogglerProps extends Omit<ContentBlobTo
|
|
|
15
15
|
renderPreviewAsMarkdown?: boolean;
|
|
16
16
|
/** White-listing of HTML elements that will be rendered when renderPreviewAsMarkdown is enabled. */
|
|
17
17
|
allowedHtmlElementsInPreview?: string[];
|
|
18
|
+
/** Allows to add non-string elements at the end of the content if the full description is shown, i.e. no toggler is necessary.
|
|
19
|
+
* This allows to add non-string elements to both the full-view content and the pure string content.
|
|
20
|
+
*/
|
|
21
|
+
noTogglerContentSuffix?: JSX.Element;
|
|
18
22
|
}
|
|
19
23
|
/** Version of the content toggler for text only content. */
|
|
20
|
-
export declare function StringPreviewContentBlobToggler({ className, previewMaxLength, toggleExtendText, toggleReduceText, content, fullviewContent, startExtended, firstNonEmptyLineOnly, renderPreviewAsMarkdown, allowedHtmlElementsInPreview, }: StringPreviewContentBlobTogglerProps): React.JSX.Element;
|
|
24
|
+
export declare function StringPreviewContentBlobToggler({ className, previewMaxLength, toggleExtendText, toggleReduceText, content, fullviewContent, startExtended, firstNonEmptyLineOnly, renderPreviewAsMarkdown, allowedHtmlElementsInPreview, noTogglerContentSuffix }: StringPreviewContentBlobTogglerProps): React.JSX.Element;
|
|
21
25
|
/**
|
|
22
26
|
* Takes the first non-empty line from a preview string.
|
|
23
27
|
* @deprecated use `stringPreviewContentBlobTogglerUtils.firstNonEmptyLine`
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DividerProps } from "./../Separation/Divider";
|
|
3
|
+
export interface FlexibleLayoutContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Use the exact space defined by the parent element.
|
|
6
|
+
* This parent element must be displayed using a fixed, relative or absolute position.
|
|
7
|
+
*/
|
|
8
|
+
useAbsoluteSpace?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* If set then the container behaves similar to a column and displays its items on a vertical axis.
|
|
11
|
+
* Children could used as rows in this situation.
|
|
12
|
+
*/
|
|
13
|
+
vertical?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* If true the used amount of space for each item is related to the amout of its content compared to each other.
|
|
16
|
+
* Otherwise the items use equal amounts as long this is possible.
|
|
17
|
+
*/
|
|
18
|
+
noEqualItemSpace?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Quick way to add whitespace between container children.
|
|
21
|
+
* For more complex usecases like dividers you need to use extra `<FlexibleLayoutItem/>` components in combination with `<Divider/>` components.
|
|
22
|
+
*/
|
|
23
|
+
gapSize?: DividerProps["addSpacing"];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Simple layout helper to organize items into rows and columns that are not necessarily need to be aligned.
|
|
27
|
+
* A `FlexibleLayoutContainer` can contain `FlexibleLayoutItem`s.
|
|
28
|
+
* Do not misuse it as grid because it comes without any predefined ratios for widths and heights.
|
|
29
|
+
*/
|
|
30
|
+
export declare const FlexibleLayoutContainer: React.ForwardRefExoticComponent<FlexibleLayoutContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
export default FlexibleLayoutContainer;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface FlexibleLayoutItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Defines the ability for the item to grow.
|
|
5
|
+
* The factor defines how much space the item would take up compared to the other items with a grow factor greater than zero.
|
|
6
|
+
* Must be equal or greater than zero.
|
|
7
|
+
* With a factor of `0` the item cannot grow.
|
|
8
|
+
*/
|
|
9
|
+
growFactor?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Defines the ability for the item to shrink.
|
|
12
|
+
* The factor defines how strong the shrink effect has impact on the item compared to the other items with a shrink factor greater than zero.
|
|
13
|
+
* Must be equal or greater than zero.
|
|
14
|
+
* With a factor of `0` the item cannot shrink.
|
|
15
|
+
*/
|
|
16
|
+
shrinkFactor?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Simple layout helper to organize items into rows and columns that are not necessarily need to be aligned.
|
|
20
|
+
* `FlexibleLayoutItem`s can contain `FlexibleLayoutContainer` for more partitions.
|
|
21
|
+
* `FlexibleLayoutItem` siblings will share all available space from the `FlexibleLayoutContainer` container.
|
|
22
|
+
*/
|
|
23
|
+
export declare const FlexibleLayoutItem: React.ForwardRefExoticComponent<FlexibleLayoutItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
export default FlexibleLayoutItem;
|
|
@@ -26,6 +26,10 @@ export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement>
|
|
|
26
26
|
* If there is no `isLayoutForElement` set then a `span` is used.
|
|
27
27
|
*/
|
|
28
28
|
disabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* visual appearance of the label
|
|
31
|
+
*/
|
|
32
|
+
emphasis?: "strong" | "normal";
|
|
29
33
|
}
|
|
30
|
-
export declare const Label: ({ children, className, disabled, text, info, tooltip, tooltipProps, isLayoutForElement, ...otherLabelProps }: LabelProps) => React.JSX.Element;
|
|
34
|
+
export declare const Label: ({ children, className, disabled, text, info, tooltip, tooltipProps, isLayoutForElement, emphasis, ...otherLabelProps }: LabelProps) => React.JSX.Element;
|
|
31
35
|
export default Label;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export
|
|
3
|
-
|
|
2
|
+
export interface PropertyValueListProps extends React.HTMLAttributes<HTMLDListElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Only use one single column and put property label and value below each other.
|
|
5
|
+
* This property is forwardd to direct `PropertyValuePair` children.
|
|
6
|
+
*/
|
|
7
|
+
singleColumn?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const PropertyValueList: ({ className, children, singleColumn, ...otherProps }: PropertyValueListProps) => React.JSX.Element;
|
|
4
10
|
export default PropertyValueList;
|
|
@@ -12,6 +12,10 @@ export interface PropertyValuePairProps extends React.HTMLAttributes<HTMLDivElem
|
|
|
12
12
|
* Forward the `nowrap` option to it `PropertyName` and `PropertyValue` children.
|
|
13
13
|
*/
|
|
14
14
|
nowrap?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Only use one single column and put property label and value below each other.
|
|
17
|
+
*/
|
|
18
|
+
singleColumn?: boolean;
|
|
15
19
|
}
|
|
16
|
-
export declare const PropertyValuePair: ({ children, className, nowrap, hasSpacing, hasDivider, ...otherProps }: PropertyValuePairProps) => React.JSX.Element;
|
|
20
|
+
export declare const PropertyValuePair: ({ children, className, nowrap, hasSpacing, hasDivider, singleColumn, ...otherProps }: PropertyValuePairProps) => React.JSX.Element;
|
|
17
21
|
export default PropertyValuePair;
|
|
@@ -12,6 +12,7 @@ export * from "./Checkbox/Checkbox";
|
|
|
12
12
|
export * from "./ContextOverlay";
|
|
13
13
|
export * from "./Depiction/Depiction";
|
|
14
14
|
export * from "./Dialog";
|
|
15
|
+
export * from "./FlexibleLayout";
|
|
15
16
|
export * from "./Form";
|
|
16
17
|
export * from "./Grid";
|
|
17
18
|
export * from "./HoverToggler/HoverToggler";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eccenca/gui-elements",
|
|
3
3
|
"description": "GUI elements based on other libraries, usable in React application, written in Typescript.",
|
|
4
|
-
"version": "24.0.0-rc.
|
|
4
|
+
"version": "24.0.0-rc.2",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/eccenca/gui-elements",
|
|
7
7
|
"bugs": "https://github.com/eccenca/gui-elements/issues",
|
|
@@ -18,6 +18,10 @@ export interface StringPreviewContentBlobTogglerProps
|
|
|
18
18
|
renderPreviewAsMarkdown?: boolean;
|
|
19
19
|
/** White-listing of HTML elements that will be rendered when renderPreviewAsMarkdown is enabled. */
|
|
20
20
|
allowedHtmlElementsInPreview?: string[];
|
|
21
|
+
/** Allows to add non-string elements at the end of the content if the full description is shown, i.e. no toggler is necessary.
|
|
22
|
+
* This allows to add non-string elements to both the full-view content and the pure string content.
|
|
23
|
+
*/
|
|
24
|
+
noTogglerContentSuffix?: JSX.Element
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
/** Version of the content toggler for text only content. */
|
|
@@ -32,21 +36,27 @@ export function StringPreviewContentBlobToggler({
|
|
|
32
36
|
firstNonEmptyLineOnly,
|
|
33
37
|
renderPreviewAsMarkdown = false,
|
|
34
38
|
allowedHtmlElementsInPreview,
|
|
39
|
+
noTogglerContentSuffix
|
|
35
40
|
}: StringPreviewContentBlobTogglerProps) {
|
|
36
41
|
const previewMaybeFirstLine = firstNonEmptyLineOnly ? firstNonEmptyLine(content) : content;
|
|
37
42
|
const previewString = previewMaxLength ? previewMaybeFirstLine.substr(0, previewMaxLength) : previewMaybeFirstLine;
|
|
38
43
|
const enableToggler = previewString !== content;
|
|
44
|
+
let previewContent = renderPreviewAsMarkdown ? (
|
|
45
|
+
<Markdown key="markdown-content" allowedElements={allowedHtmlElementsInPreview}>{previewString}</Markdown>
|
|
46
|
+
) : (
|
|
47
|
+
previewString
|
|
48
|
+
)
|
|
49
|
+
if(!enableToggler && noTogglerContentSuffix) {
|
|
50
|
+
previewContent = <>
|
|
51
|
+
{previewContent}
|
|
52
|
+
{noTogglerContentSuffix}
|
|
53
|
+
</>
|
|
54
|
+
}
|
|
39
55
|
|
|
40
56
|
return (
|
|
41
57
|
<ContentBlobToggler
|
|
42
58
|
className={className}
|
|
43
|
-
previewContent={
|
|
44
|
-
renderPreviewAsMarkdown ? (
|
|
45
|
-
<Markdown allowedElements={allowedHtmlElementsInPreview}>{previewString}</Markdown>
|
|
46
|
-
) : (
|
|
47
|
-
previewString
|
|
48
|
-
)
|
|
49
|
-
}
|
|
59
|
+
previewContent={previewContent}
|
|
50
60
|
toggleExtendText={toggleExtendText}
|
|
51
61
|
toggleReduceText={toggleReduceText}
|
|
52
62
|
fullviewContent={fullviewContent}
|
|
@@ -47,13 +47,16 @@
|
|
|
47
47
|
|
|
48
48
|
.#{$eccgui}-typography__contentblock {
|
|
49
49
|
a[href=""] {
|
|
50
|
+
color: currentcolor;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
cursor: text;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
a[href=""]:not(#{$eccgui-selector-text-spot-highlight}) {
|
|
50
56
|
font-size: $eccgui-size-typo-caption;
|
|
51
57
|
line-height: $eccgui-size-typo-caption-lineheight;
|
|
52
|
-
color: currentcolor;
|
|
53
58
|
text-decoration: none;
|
|
54
59
|
vertical-align: super;
|
|
55
|
-
pointer-events: none;
|
|
56
|
-
cursor: text;
|
|
57
60
|
|
|
58
61
|
&::before {
|
|
59
62
|
content: "[";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Extracts the values of all named anchors used in the Markdown string, i.e. of the form <mark name="<value>"></mark>. */
|
|
2
|
+
const extractNamedAnchors = (markdown: string): string[] => {
|
|
3
|
+
const regex = new RegExp("<a\\s+id=\"([^\"]+)\"\\s*>[^<]*</a>", "g")
|
|
4
|
+
const namedAnchors: string[] = []
|
|
5
|
+
|
|
6
|
+
let results = regex.exec(markdown)
|
|
7
|
+
while(results !== null) {
|
|
8
|
+
namedAnchors.push(results[1]);
|
|
9
|
+
results = regex.exec(markdown)
|
|
10
|
+
}
|
|
11
|
+
return namedAnchors
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const utils = {
|
|
15
|
+
extractNamedAnchors
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default utils
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import utils from "./markdown.utils"
|
|
2
|
+
|
|
3
|
+
describe("Markdown utils", () => {
|
|
4
|
+
it("should extract named anchors from the Markdown", () => {
|
|
5
|
+
const namedAnchors = utils.extractNamedAnchors("# Header\n\nsome text\n\n## <a id=\"anchor1\" ></a> point 1\n\n## <a id=\"anchor2\"></a> point 2")
|
|
6
|
+
expect(namedAnchors).toStrictEqual(["anchor1", "anchor2"])
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it("should not extract named anchors from the Markdown that are not following the expected format", () => {
|
|
10
|
+
const namedAnchors = utils.extractNamedAnchors("# <a id=\"anchor\" href=\"http://\">link text</a> \n\n## <a name=\"test\" id=\"anchor2\"></a> point 2")
|
|
11
|
+
expect(namedAnchors).toStrictEqual([])
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React, { forwardRef } from "react"; // @see https://github.com/storybookjs/storybook/issues/8881#issuecomment-831937051
|
|
2
|
+
|
|
3
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
|
+
|
|
5
|
+
import { DividerProps } from "./../Separation/Divider";
|
|
6
|
+
|
|
7
|
+
export interface FlexibleLayoutContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/**
|
|
9
|
+
* Use the exact space defined by the parent element.
|
|
10
|
+
* This parent element must be displayed using a fixed, relative or absolute position.
|
|
11
|
+
*/
|
|
12
|
+
useAbsoluteSpace?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* If set then the container behaves similar to a column and displays its items on a vertical axis.
|
|
15
|
+
* Children could used as rows in this situation.
|
|
16
|
+
*/
|
|
17
|
+
vertical?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* If true the used amount of space for each item is related to the amout of its content compared to each other.
|
|
20
|
+
* Otherwise the items use equal amounts as long this is possible.
|
|
21
|
+
*/
|
|
22
|
+
noEqualItemSpace?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Quick way to add whitespace between container children.
|
|
25
|
+
* For more complex usecases like dividers you need to use extra `<FlexibleLayoutItem/>` components in combination with `<Divider/>` components.
|
|
26
|
+
*/
|
|
27
|
+
gapSize?: DividerProps["addSpacing"];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Simple layout helper to organize items into rows and columns that are not necessarily need to be aligned.
|
|
32
|
+
* A `FlexibleLayoutContainer` can contain `FlexibleLayoutItem`s.
|
|
33
|
+
* Do not misuse it as grid because it comes without any predefined ratios for widths and heights.
|
|
34
|
+
*/
|
|
35
|
+
export const FlexibleLayoutContainer = forwardRef<HTMLDivElement, FlexibleLayoutContainerProps>(
|
|
36
|
+
(
|
|
37
|
+
{
|
|
38
|
+
children,
|
|
39
|
+
className = "",
|
|
40
|
+
useAbsoluteSpace,
|
|
41
|
+
vertical,
|
|
42
|
+
noEqualItemSpace,
|
|
43
|
+
gapSize = "none",
|
|
44
|
+
...otherDivProps
|
|
45
|
+
}: FlexibleLayoutContainerProps,
|
|
46
|
+
ref
|
|
47
|
+
) => {
|
|
48
|
+
return (
|
|
49
|
+
<div
|
|
50
|
+
className={
|
|
51
|
+
`${eccgui}-flexible__container` +
|
|
52
|
+
(useAbsoluteSpace ? ` ${eccgui}-flexible__container--absolutespace` : "") +
|
|
53
|
+
(vertical ? ` ${eccgui}-flexible__container--vertical` : "") +
|
|
54
|
+
(noEqualItemSpace ? ` ${eccgui}-flexible__container--notequalitemspace` : "") +
|
|
55
|
+
(gapSize !== "none" ? ` ${eccgui}-flexible__container--gap-${gapSize}` : "") +
|
|
56
|
+
(className ? " " + className : "")
|
|
57
|
+
}
|
|
58
|
+
ref={ref}
|
|
59
|
+
{...otherDivProps}
|
|
60
|
+
>
|
|
61
|
+
{children}
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
export default FlexibleLayoutContainer;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
|
|
3
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
|
+
|
|
5
|
+
export interface FlexibleLayoutItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/**
|
|
7
|
+
* Defines the ability for the item to grow.
|
|
8
|
+
* The factor defines how much space the item would take up compared to the other items with a grow factor greater than zero.
|
|
9
|
+
* Must be equal or greater than zero.
|
|
10
|
+
* With a factor of `0` the item cannot grow.
|
|
11
|
+
*/
|
|
12
|
+
growFactor?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Defines the ability for the item to shrink.
|
|
15
|
+
* The factor defines how strong the shrink effect has impact on the item compared to the other items with a shrink factor greater than zero.
|
|
16
|
+
* Must be equal or greater than zero.
|
|
17
|
+
* With a factor of `0` the item cannot shrink.
|
|
18
|
+
*/
|
|
19
|
+
shrinkFactor?: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Simple layout helper to organize items into rows and columns that are not necessarily need to be aligned.
|
|
24
|
+
* `FlexibleLayoutItem`s can contain `FlexibleLayoutContainer` for more partitions.
|
|
25
|
+
* `FlexibleLayoutItem` siblings will share all available space from the `FlexibleLayoutContainer` container.
|
|
26
|
+
*/
|
|
27
|
+
export const FlexibleLayoutItem = forwardRef<HTMLDivElement, FlexibleLayoutItemProps>(
|
|
28
|
+
(
|
|
29
|
+
{
|
|
30
|
+
children,
|
|
31
|
+
className = "",
|
|
32
|
+
growFactor = 1,
|
|
33
|
+
shrinkFactor = 1,
|
|
34
|
+
style,
|
|
35
|
+
...otherDivProps
|
|
36
|
+
}: FlexibleLayoutItemProps,
|
|
37
|
+
ref
|
|
38
|
+
) => {
|
|
39
|
+
const sizing = {} as any;
|
|
40
|
+
if (typeof growFactor !== "undefined" && growFactor >= 0 && growFactor !== 1) {
|
|
41
|
+
sizing[`--${eccgui}-flexible-item-grow`] = growFactor.toString(10);
|
|
42
|
+
}
|
|
43
|
+
if (typeof shrinkFactor !== "undefined" && shrinkFactor >= 0 && shrinkFactor !== 1) {
|
|
44
|
+
sizing[`--${eccgui}-flexible-item-shrink`] = shrinkFactor.toString(10);
|
|
45
|
+
}
|
|
46
|
+
return (
|
|
47
|
+
<div
|
|
48
|
+
className={`${eccgui}-flexible__item` + (className ? " " + className : "")}
|
|
49
|
+
style={{ ...(style ?? {}), ...sizing }}
|
|
50
|
+
ref={ref}
|
|
51
|
+
{...otherDivProps}
|
|
52
|
+
>
|
|
53
|
+
{children}
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
export default FlexibleLayoutItem;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.#{$eccgui}-flexible__container {
|
|
2
|
+
--#{$eccgui}-flexible-item-shrink: 1;
|
|
3
|
+
--#{$eccgui}-flexible-item-grow: 1;
|
|
4
|
+
--#{$eccgui}-flexible-container-gapsize: 0;
|
|
5
|
+
|
|
6
|
+
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-flow: row nowrap;
|
|
9
|
+
gap: var(--#{$eccgui}-flexible-container-gapsize);
|
|
10
|
+
place-content: stretch center;
|
|
11
|
+
align-items: stretch;
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.#{$eccgui}-flexible__container--absolutespace {
|
|
16
|
+
position: absolute;
|
|
17
|
+
inset: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.#{$eccgui}-flexible__container--vertical {
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.#{$eccgui}-flexible__container--gap-tiny {
|
|
25
|
+
--#{$eccgui}-flexible-container-gapsize: #{$eccgui-size-block-whitespace * 0.25};
|
|
26
|
+
}
|
|
27
|
+
.#{$eccgui}-flexible__container--gap-small {
|
|
28
|
+
--#{$eccgui}-flexible-container-gapsize: #{$eccgui-size-block-whitespace * 0.5};
|
|
29
|
+
}
|
|
30
|
+
.#{$eccgui}-flexible__container--gap-medium {
|
|
31
|
+
--#{$eccgui}-flexible-container-gapsize: #{$eccgui-size-block-whitespace};
|
|
32
|
+
}
|
|
33
|
+
.#{$eccgui}-flexible__container--gap-large {
|
|
34
|
+
--#{$eccgui}-flexible-container-gapsize: #{$eccgui-size-block-whitespace * 1.5};
|
|
35
|
+
}
|
|
36
|
+
.#{$eccgui}-flexible__container--gap-xlarge {
|
|
37
|
+
--#{$eccgui}-flexible-container-gapsize: #{$eccgui-size-block-whitespace * 2};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.#{$eccgui}-flexible__item {
|
|
41
|
+
position: relative;
|
|
42
|
+
flex: var(--#{$eccgui}-flexible-item-grow) var(--#{$eccgui}-flexible-item-shrink) 100%;
|
|
43
|
+
min-width: 0;
|
|
44
|
+
|
|
45
|
+
.#{$eccgui}-flexible__container--notequalitemspace > & {
|
|
46
|
+
flex-basis: auto;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LoremIpsum } from "react-lorem-ipsum";
|
|
3
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
import { Divider, FlexibleLayoutContainer, FlexibleLayoutItem, HtmlContentBlock } from "../../../../index";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Components/FlexibleLayout/Container",
|
|
9
|
+
component: FlexibleLayoutContainer,
|
|
10
|
+
} as Meta<typeof FlexibleLayoutContainer>;
|
|
11
|
+
|
|
12
|
+
const Template: StoryFn<typeof FlexibleLayoutContainer> = (args) => (
|
|
13
|
+
<div style={{ position: "relative", height: "400px" }}>
|
|
14
|
+
<FlexibleLayoutContainer {...args}>
|
|
15
|
+
<FlexibleLayoutItem>
|
|
16
|
+
<HtmlContentBlock>
|
|
17
|
+
<LoremIpsum p={1} avgSentencesPerParagraph={3} random={false} />
|
|
18
|
+
</HtmlContentBlock>
|
|
19
|
+
</FlexibleLayoutItem>
|
|
20
|
+
<FlexibleLayoutItem>
|
|
21
|
+
<Divider />
|
|
22
|
+
<HtmlContentBlock>
|
|
23
|
+
<LoremIpsum p={3} avgSentencesPerParagraph={2} random={false} />
|
|
24
|
+
</HtmlContentBlock>
|
|
25
|
+
</FlexibleLayoutItem>
|
|
26
|
+
</FlexibleLayoutContainer>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export const Default = Template.bind({});
|
|
31
|
+
Default.args = {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LoremIpsum } from "react-lorem-ipsum";
|
|
3
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
import { FlexibleLayoutContainer, FlexibleLayoutItem, HtmlContentBlock } from "../../../../index";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Components/FlexibleLayout/Item",
|
|
9
|
+
component: FlexibleLayoutItem,
|
|
10
|
+
} as Meta<typeof FlexibleLayoutItem>;
|
|
11
|
+
|
|
12
|
+
const Template: StoryFn<typeof FlexibleLayoutItem> = (args) => (
|
|
13
|
+
<FlexibleLayoutContainer horizontal>
|
|
14
|
+
<FlexibleLayoutItem {...args}>
|
|
15
|
+
<HtmlContentBlock>
|
|
16
|
+
<LoremIpsum p={1} avgSentencesPerParagraph={1} avgWordsPerSentence={3} random={false} />
|
|
17
|
+
</HtmlContentBlock>
|
|
18
|
+
</FlexibleLayoutItem>
|
|
19
|
+
<FlexibleLayoutItem>
|
|
20
|
+
<HtmlContentBlock>
|
|
21
|
+
<LoremIpsum p={2} avgSentencesPerParagraph={4} random={false} />
|
|
22
|
+
</HtmlContentBlock>
|
|
23
|
+
</FlexibleLayoutItem>
|
|
24
|
+
</FlexibleLayoutContainer>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export const Default = Template.bind({});
|
|
28
|
+
Default.args = {};
|
|
@@ -66,9 +66,9 @@ const canonicalIcons = {
|
|
|
66
66
|
"entity-robot": icons.Bot,
|
|
67
67
|
|
|
68
68
|
"item-add-artefact": icons.AddAlt,
|
|
69
|
-
"item-clone": icons.
|
|
69
|
+
"item-clone": icons.Replicate,
|
|
70
70
|
"item-comment": icons.AddComment,
|
|
71
|
-
"item-copy": icons.
|
|
71
|
+
"item-copy": icons.Copy,
|
|
72
72
|
"item-download": icons.Download,
|
|
73
73
|
"item-draggable": icons.Draggable,
|
|
74
74
|
"item-edit": icons.Edit,
|
|
@@ -30,6 +30,10 @@ export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement>
|
|
|
30
30
|
* If there is no `isLayoutForElement` set then a `span` is used.
|
|
31
31
|
*/
|
|
32
32
|
disabled?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* visual appearance of the label
|
|
35
|
+
*/
|
|
36
|
+
emphasis?: "strong" | "normal";
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
export const Label = ({
|
|
@@ -41,6 +45,7 @@ export const Label = ({
|
|
|
41
45
|
tooltip,
|
|
42
46
|
tooltipProps,
|
|
43
47
|
isLayoutForElement = "label",
|
|
48
|
+
emphasis = "normal",
|
|
44
49
|
...otherLabelProps
|
|
45
50
|
}: LabelProps) => {
|
|
46
51
|
let htmlElementstring = isLayoutForElement;
|
|
@@ -66,7 +71,7 @@ export const Label = ({
|
|
|
66
71
|
htmlElementstring,
|
|
67
72
|
{
|
|
68
73
|
className:
|
|
69
|
-
`${eccgui}-label` +
|
|
74
|
+
`${eccgui}-label ${eccgui}-label--${emphasis}` +
|
|
70
75
|
(className ? " " + className : "") +
|
|
71
76
|
(disabled ? ` ${eccgui}-label--disabled` : ""),
|
|
72
77
|
...otherLabelProps,
|
|
@@ -21,6 +21,12 @@ $eccgui-color-label-info: rgba($eccgui-color-workspace-text, $eccgui-opacity-mut
|
|
|
21
21
|
opacity: $eccgui-opacity-disabled;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
.#{$eccgui}-label--strong {
|
|
25
|
+
.#{$eccgui}-label__text {
|
|
26
|
+
font-weight: bolder;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
24
30
|
.#{$eccgui}-label__text {
|
|
25
31
|
.#{$eccgui}-typography__overflowtext--passdown > .#{$eccgui}-label > & {
|
|
26
32
|
display: block;
|
|
@@ -2,12 +2,35 @@ import React from "react";
|
|
|
2
2
|
|
|
3
3
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { PropertyValuePair } from "./PropertyValuePair";
|
|
6
|
+
|
|
7
|
+
export interface PropertyValueListProps extends React.HTMLAttributes<HTMLDListElement> {
|
|
8
|
+
/**
|
|
9
|
+
* Only use one single column and put property label and value below each other.
|
|
10
|
+
* This property is forwardd to direct `PropertyValuePair` children.
|
|
11
|
+
*/
|
|
12
|
+
singleColumn?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const PropertyValueList = ({
|
|
16
|
+
className = "",
|
|
17
|
+
children,
|
|
18
|
+
singleColumn = false,
|
|
19
|
+
...otherProps
|
|
20
|
+
}: PropertyValueListProps) => {
|
|
21
|
+
const alteredChildren = singleColumn
|
|
22
|
+
? React.Children.map(children, (child) => {
|
|
23
|
+
const originalChild = child as React.ReactElement;
|
|
24
|
+
if (originalChild && originalChild.type && originalChild.type === PropertyValuePair) {
|
|
25
|
+
return React.cloneElement(originalChild, { singleColumn: true });
|
|
26
|
+
}
|
|
27
|
+
return child;
|
|
28
|
+
})
|
|
29
|
+
: children;
|
|
6
30
|
|
|
7
|
-
export const PropertyValueList = ({ className = "", children, ...otherProps }: PropertyValueListProps) => {
|
|
8
31
|
return (
|
|
9
32
|
<dl className={`${eccgui}-propertyvalue__list` + (className ? " " + className : "")} {...otherProps}>
|
|
10
|
-
{
|
|
33
|
+
{alteredChildren}
|
|
11
34
|
</dl>
|
|
12
35
|
);
|
|
13
36
|
};
|