pds-dev-kit-web-test 2.7.401 → 2.7.403
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/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +8 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.d.ts +6 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +2 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.js +18 -7
- package/package.json +1 -1
|
@@ -39,6 +39,7 @@ var S_CB_AnimationObserverBox_1 = require("../components/S_CB_AnimationObserverB
|
|
|
39
39
|
var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
|
|
40
40
|
var S_HiddenCover_1 = require("../components/S_HiddenCover");
|
|
41
41
|
var useCLINK_1 = __importDefault(require("../hooks/useCLINK"));
|
|
42
|
+
var Text_1 = require("../Text/Text");
|
|
42
43
|
var textSpecFormatOptions_1 = require("../Text/textSpecFormatOptions");
|
|
43
44
|
function Button(props) {
|
|
44
45
|
var _a, _b, _c;
|
|
@@ -68,7 +69,7 @@ function Button(props) {
|
|
|
68
69
|
openNewTab: CB_CONTENT_PROP_CLINK_SPEC_NEWTAB,
|
|
69
70
|
internalSrc: String(CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC)
|
|
70
71
|
}), onClickCLINK = _g.onClickCLINK, CLINKCursor = _g.CLINKCursor;
|
|
71
|
-
var _h =
|
|
72
|
+
var _h = (0, Text_1.getTextStyles)(props.CB_STYLE_PROP_TEXT, device), btnTextStyle = _h.style, btnTextHoverStyle = _h.hoverStyle;
|
|
72
73
|
var _j = getBTNColorStyles(CB_STYLE_PROP_COLOR, device), btnColorStyle = _j.style, btnColorHoverStyle = _j.hoverStyle;
|
|
73
74
|
var _k = (0, util_1.parseProperties)(props, device), propsStyle = _k.style, propsHoverStyle = _k.hoverStyle, _l = _k.layout, paddingLeft = _l.paddingLeft, paddingRight = _l.paddingRight, paddingTop = _l.paddingTop, paddingBottom = _l.paddingBottom, layoutStyle = __rest(_l, ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"]), effect = _k.effect;
|
|
74
75
|
var isEditModeAndHidden = propsStyle.visibility === 'hidden' && mode === 'EDIT';
|
|
@@ -135,7 +136,12 @@ function Button(props) {
|
|
|
135
136
|
paddingLeft: paddingLeft,
|
|
136
137
|
paddingRight: paddingRight,
|
|
137
138
|
paddingBottom: paddingBottom,
|
|
138
|
-
paddingTop: paddingTop
|
|
139
|
+
paddingTop: paddingTop,
|
|
140
|
+
height: '100%',
|
|
141
|
+
display: 'flex',
|
|
142
|
+
alignItems: "".concat(btnTextStyle.alignItems),
|
|
143
|
+
overflowY: btnTextStyle.overflowY,
|
|
144
|
+
scrollbarWidth: btnTextStyle.scrollbarWidth
|
|
139
145
|
} }, { children: (0, jsx_runtime_1.jsxs)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ onMouseLeave: function (e) {
|
|
140
146
|
e.currentTarget.classList.remove('hovered');
|
|
141
147
|
}, className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign(__assign({}, btnTextStyle), propsStyle), layoutStyle), effectCssProperties), btnColorStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word', cursor: CLINKCursor }), hoverStyle: __assign(__assign(__assign(__assign({}, btnTextHoverStyle), propsHoverStyle), btnColorHoverStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word' }), cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, onClick: onClickCLINK }, { children: [textPrefix, textValue(), textSuffix] })) }))] }));
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { CB_TEXT_PROPERTIES_TYPE, IndexForIntersection } from '../../../../util/types';
|
|
2
|
+
import type { CB_TEXT_PROPERTIES_TYPE, Device, IndexForIntersection } from '../../../../util/types';
|
|
3
|
+
import type { CB_STYLE_PROP_TEXT_SPECS } from '../types';
|
|
3
4
|
type Props = CB_TEXT_PROPERTIES_TYPE & IndexForIntersection;
|
|
4
5
|
export default function Text(props: Props): JSX.Element;
|
|
6
|
+
export declare function getTextStyles(props: CB_STYLE_PROP_TEXT_SPECS, device: Device): {
|
|
7
|
+
style: import("styled-components").CSSProperties;
|
|
8
|
+
hoverStyle: import("styled-components").CSSProperties;
|
|
9
|
+
};
|
|
5
10
|
export {};
|
|
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.getTextStyles = void 0;
|
|
17
18
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
19
|
/* eslint-disable react/destructuring-assignment */
|
|
19
20
|
var react_1 = require("react");
|
|
@@ -172,3 +173,4 @@ function getTextStyles(props, device) {
|
|
|
172
173
|
];
|
|
173
174
|
return (0, textUtil_1.parseStyleTextToCSSProp)({ availableSpecCodes: availableSpecCodes, props: props, device: device, propKey: 'TEXT' });
|
|
174
175
|
}
|
|
176
|
+
exports.getTextStyles = getTextStyles;
|
|
@@ -10,5 +10,5 @@ type ParseStyleTextProps<T> = {
|
|
|
10
10
|
propKey: 'TEXT';
|
|
11
11
|
device: Device;
|
|
12
12
|
};
|
|
13
|
-
export declare function getTextCSSPropKey(key: string, cbName: 'TEXT'): "" | "color" | "letterSpacing" | "fontWeight" | "fontFamily" | "lineHeight" | "fontSize" | "HORIZONTAL" | "alignItems" | "overflowY" | "scrollbarWidth";
|
|
13
|
+
export declare function getTextCSSPropKey(key: string, cbName: 'TEXT'): "" | "color" | "letterSpacing" | "fontWeight" | "fontFamily" | "lineHeight" | "fontSize" | "HORIZONTAL" | "alignItems" | "overflowY" | "scrollbarWidth" | "overflow";
|
|
14
14
|
export {};
|
|
@@ -14,8 +14,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.getTextCSSPropKey = exports.parseStyleTextToCSSProp = void 0;
|
|
15
15
|
function parseStyleTextToCSSProp(_a) {
|
|
16
16
|
var availableSpecCodes = _a.availableSpecCodes, props = _a.props, propKey = _a.propKey, device = _a.device;
|
|
17
|
-
|
|
18
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u
|
|
17
|
+
var styleProps = availableSpecCodes.reduce(function (acc, currentKey) {
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
19
19
|
var stringifiedKey = currentKey.toString();
|
|
20
20
|
var keyWithDevice = device === 'DESKTOP' ? currentKey : "".concat(stringifiedKey, ":MOBILE") || currentKey;
|
|
21
21
|
var keyWithHover = "".concat(keyWithDevice.toString(), ":HOVER");
|
|
@@ -106,7 +106,7 @@ function parseStyleTextToCSSProp(_a) {
|
|
|
106
106
|
if (hoverValue === null || hoverValue === undefined) {
|
|
107
107
|
var overflowYValue = value === true ? 'scroll' : 'hidden';
|
|
108
108
|
return {
|
|
109
|
-
style: __assign(__assign({}, acc.style),
|
|
109
|
+
style: __assign(__assign({}, acc.style), { overflowY: overflowYValue }),
|
|
110
110
|
hoverStyle: __assign({}, acc.hoverStyle)
|
|
111
111
|
};
|
|
112
112
|
}
|
|
@@ -115,25 +115,33 @@ function parseStyleTextToCSSProp(_a) {
|
|
|
115
115
|
if (hoverValue === null || hoverValue === undefined) {
|
|
116
116
|
var scrollBarWidthValue = value === true ? 'thin' : 'none';
|
|
117
117
|
return {
|
|
118
|
-
style: __assign(__assign({}, acc.style), (
|
|
118
|
+
style: __assign(__assign({}, acc.style), (_r = {}, _r[cssPropertyKey] = scrollBarWidthValue, _r)),
|
|
119
119
|
hoverStyle: __assign({}, acc.hoverStyle)
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
if (hoverValue === null || hoverValue === undefined) {
|
|
124
124
|
return {
|
|
125
|
-
style: __assign(__assign({}, acc.style), (
|
|
125
|
+
style: __assign(__assign({}, acc.style), (_s = {}, _s[cssPropertyKey] = value, _s)),
|
|
126
126
|
hoverStyle: __assign({}, acc.hoverStyle)
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
return {
|
|
130
|
-
style: __assign(__assign({}, acc.style), (
|
|
131
|
-
hoverStyle: __assign(__assign({}, acc.hoverStyle), (
|
|
130
|
+
style: __assign(__assign({}, acc.style), (_t = {}, _t[cssPropertyKey] = value, _t)),
|
|
131
|
+
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_u = {}, _u[cssPropertyKey] = hoverValue, _u))
|
|
132
132
|
};
|
|
133
133
|
}, {
|
|
134
134
|
style: {},
|
|
135
135
|
hoverStyle: {}
|
|
136
136
|
});
|
|
137
|
+
var fitContentKey = device === 'DESKTOP'
|
|
138
|
+
? 'CB_STYLE_PROP_TEXT_SPEC_FITCONTENT'
|
|
139
|
+
: 'CB_STYLE_PROP_TEXT_SPEC_FITCONTENT:MOBILE';
|
|
140
|
+
var fitContentValue = props[fitContentKey];
|
|
141
|
+
if (fitContentValue === true) {
|
|
142
|
+
styleProps.style.overflowY = 'hidden';
|
|
143
|
+
}
|
|
144
|
+
return styleProps;
|
|
137
145
|
}
|
|
138
146
|
exports.parseStyleTextToCSSProp = parseStyleTextToCSSProp;
|
|
139
147
|
function getTextCSSPropKey(key, cbName) {
|
|
@@ -184,6 +192,9 @@ function getTextCSSPropKey(key, cbName) {
|
|
|
184
192
|
case "CB_STYLE_PROP_".concat(cbName, "_SPEC_SCROLLBAR"):
|
|
185
193
|
case "CB_STYLE_PROP_".concat(cbName, "_SPEC_SCROLLBAR:MOBILE"):
|
|
186
194
|
return 'scrollbarWidth';
|
|
195
|
+
case "CB_STYLE_PROP_".concat(cbName, "_SPEC_FITCONTENT"):
|
|
196
|
+
case "CB_STYLE_PROP_".concat(cbName, "_SPEC_FITCONTENT:MOBILE"):
|
|
197
|
+
return 'overflow';
|
|
187
198
|
default:
|
|
188
199
|
return '';
|
|
189
200
|
}
|