@dynamic-framework/ui-react 1.7.1 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +10 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/types/components/DInputCurrencyBase.d.ts +2 -1
- package/dist/types/components/DInputSearch.d.ts +1 -1
- package/dist/types/components/DQuickActionButton.d.ts +2 -1
- package/dist/types/components/DQuickActionCheck.d.ts +2 -1
- package/dist/types/components/DQuickActionSelect.d.ts +2 -1
- package/dist/types/components/DQuickActionSwitch.d.ts +2 -1
- package/dist/types/stories/components/DInputSelect.stories.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -659,7 +659,7 @@ function DFormikInput(_a) {
|
|
|
659
659
|
}
|
|
660
660
|
|
|
661
661
|
function DInputCurrencyBase(_a) {
|
|
662
|
-
var { id, name, label = '', placeholder = '', value, isDisabled = false, isReadOnly = false, isLoading = false, hint, isInvalid = false, isValid = false, minValue, maxValue, currencyOptions, currencyCode, onChange, onBlur, onFocus } = _a, rest = __rest(_a, ["id", "name", "label", "placeholder", "value", "isDisabled", "isReadOnly", "isLoading", "hint", "isInvalid", "isValid", "minValue", "maxValue", "currencyOptions", "currencyCode", "onChange", "onBlur", "onFocus"]);
|
|
662
|
+
var { id, name, className, label = '', placeholder = '', value, isDisabled = false, isReadOnly = false, isLoading = false, hint, isInvalid = false, isValid = false, minValue, maxValue, currencyOptions, currencyCode, onChange, onBlur, onFocus } = _a, rest = __rest(_a, ["id", "name", "className", "label", "placeholder", "value", "isDisabled", "isReadOnly", "isLoading", "hint", "isInvalid", "isValid", "minValue", "maxValue", "currencyOptions", "currencyCode", "onChange", "onBlur", "onFocus"]);
|
|
663
663
|
const [internalValueAsNumber, setInternalValueAsNumber] = useState(value);
|
|
664
664
|
const [internalValueAsFormat, setInternalValueAsFormat] = useState('');
|
|
665
665
|
const [internalType, setInternalType] = useState('text');
|
|
@@ -726,7 +726,7 @@ function DInputCurrencyBase(_a) {
|
|
|
726
726
|
const generateSymbolStyleVariables = useMemo(() => ({
|
|
727
727
|
color: `var(--${PREFIX_BS}m-input-currency-symbol-color)`,
|
|
728
728
|
}), []);
|
|
729
|
-
return (jsx(DInput$1, Object.assign({ ref: currencyInputRef, style: generateStyleVariables, id: id, name: name, label: label, placeholder: placeholder, value: valueAsType, isDisabled: isDisabled, isReadOnly: isReadOnly, isLoading: isLoading, hint: hint, isInvalid: isInvalid || internalIsInvalid, isValid: isValid, type: internalType, innerInputMode: "decimal", pattern: "^[0-9]", onChange: changeHandler, onBlur: blurHandler, onFocus: focusHandler, onWheel: wheelHandler, inputStart: (jsx("span", { slot: "input-start", style: generateSymbolStyleVariables, children: currencyCode || currencyOptions.symbol })) }, rest)));
|
|
729
|
+
return (jsx(DInput$1, Object.assign({ ref: currencyInputRef, style: generateStyleVariables, id: id, name: name, className: className, label: label, placeholder: placeholder, value: valueAsType, isDisabled: isDisabled, isReadOnly: isReadOnly, isLoading: isLoading, hint: hint, isInvalid: isInvalid || internalIsInvalid, isValid: isValid, type: internalType, innerInputMode: "decimal", pattern: "^[0-9]", onChange: changeHandler, onBlur: blurHandler, onFocus: focusHandler, onWheel: wheelHandler, inputStart: (jsx("span", { slot: "input-start", style: generateSymbolStyleVariables, children: currencyCode || currencyOptions.symbol })) }, rest)));
|
|
730
730
|
}
|
|
731
731
|
|
|
732
732
|
function DInputCurrency(props) {
|
|
@@ -1150,7 +1150,7 @@ function DProgress({ currentValue, minValue = 0, maxValue = 100, hideCurrentValu
|
|
|
1150
1150
|
return (jsx("div", { className: "progress", children: jsx("div", { className: classNames(generateClasses), role: "progressbar", "aria-label": "Progress bar", style: { width: `${currentValue}%` }, "aria-valuenow": currentValue, "aria-valuemin": minValue, "aria-valuemax": maxValue, children: !hideCurrentValue && formatProgress }) }));
|
|
1151
1151
|
}
|
|
1152
1152
|
|
|
1153
|
-
function DQuickActionButton({ line1, line2, actionLinkText, actionLinkTheme = 'secondary', actionIcon, secondaryActionIcon, actionIconFamilyClass, actionIconFamilyPrefix, representativeImage, representativeIcon, representativeIconTheme = 'secondary', representativeIconHasCircle = false, representativeIconFamilyClass, representativeIconFamilyPrefix, onClick, onClickSecondary, style, }) {
|
|
1153
|
+
function DQuickActionButton({ line1, line2, className, actionLinkText, actionLinkTheme = 'secondary', actionIcon, secondaryActionIcon, actionIconFamilyClass, actionIconFamilyPrefix, representativeImage, representativeIcon, representativeIconTheme = 'secondary', representativeIconHasCircle = false, representativeIconFamilyClass, representativeIconFamilyPrefix, onClick, onClickSecondary, style, }) {
|
|
1154
1154
|
const globalClickHandler = useCallback(() => {
|
|
1155
1155
|
if (actionLinkText) {
|
|
1156
1156
|
return;
|
|
@@ -1167,20 +1167,20 @@ function DQuickActionButton({ line1, line2, actionLinkText, actionLinkTheme = 's
|
|
|
1167
1167
|
onClickSecondary === null || onClickSecondary === void 0 ? void 0 : onClickSecondary();
|
|
1168
1168
|
}, [onClickSecondary]);
|
|
1169
1169
|
const Tag = useMemo(() => (actionLinkText ? 'div' : 'button'), [actionLinkText]);
|
|
1170
|
-
return (jsxs(Tag, { className:
|
|
1170
|
+
return (jsxs(Tag, { className: classNames('d-quick-action-button', className), onClick: !actionLinkText ? globalClickHandler : undefined, style: style, children: [representativeIcon && (jsx(DIcon, { className: "d-quick-action-button-representative-icon", size: representativeIconHasCircle
|
|
1171
1171
|
? `var(--${PREFIX_BS}quick-action-button-representative-icon-size)`
|
|
1172
1172
|
: `var(--${PREFIX_BS}quick-action-button-representative-image-size)`, icon: representativeIcon, hasCircle: representativeIconHasCircle, theme: representativeIconTheme, familyClass: representativeIconFamilyClass, familyPrefix: representativeIconFamilyPrefix })), representativeImage && (jsx("img", { className: "d-quick-action-button-representative-image", src: representativeImage, alt: "" })), jsx("div", { className: "d-quick-action-button-content", children: jsxs("div", { className: "d-quick-action-button-text", children: [jsx("span", { className: "d-quick-action-button-line1", children: line1 }), jsx("small", { className: "d-quick-action-button-line2", children: line2 })] }) }), secondaryActionIcon && (jsx(DButton, { className: "d-quick-action-button-secondary-action-link", type: "button", variant: "link", iconStart: secondaryActionIcon, iconStartFamilyClass: actionIconFamilyClass, iconStartFamilyPrefix: actionIconFamilyPrefix, theme: actionLinkTheme, onClick: secondaryActionLinkClickHandler, isStopPropagationEnabled: true })), actionLinkText && !actionIcon && (jsx(DButton, { className: "d-quick-action-button-action-link", type: "button", variant: "link", theme: actionLinkTheme, text: actionLinkText, onClick: actionLinkClickHandler, isStopPropagationEnabled: true })), actionIcon && !actionLinkText && (jsx(DIcon, { className: "d-quick-action-button-action-icon", icon: actionIcon, size: `var(--${PREFIX_BS}quick-action-button-action-icon-size)`, familyClass: actionIconFamilyClass, familyPrefix: actionIconFamilyPrefix }))] }));
|
|
1173
1173
|
}
|
|
1174
1174
|
|
|
1175
|
-
function DQuickActionCheck({ id, name, value, line1, line2, line3, isChecked, onChange, }) {
|
|
1175
|
+
function DQuickActionCheck({ id, name, value, line1, line2, line3, className, isChecked, onChange, }) {
|
|
1176
1176
|
const changeHandler = useCallback((event) => {
|
|
1177
1177
|
event.stopPropagation();
|
|
1178
1178
|
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
1179
1179
|
}, [onChange]);
|
|
1180
|
-
return (jsxs("label", { className:
|
|
1180
|
+
return (jsxs("label", { className: classNames('d-quick-action-check', className), htmlFor: id, children: [jsx(DInputCheck, { id: id, type: "radio", name: name, value: value, isChecked: isChecked, onChange: changeHandler }), jsxs("div", { className: "d-quick-action-check-detail", children: [jsx("span", { className: "d-quick-action-check-line1", children: line1 }), jsx("span", { className: "d-quick-action-check-line2", children: line2 })] }), jsx("span", { className: "d-quick-action-check-line3", children: line3 })] }));
|
|
1181
1181
|
}
|
|
1182
1182
|
|
|
1183
|
-
function DQuickActionSelect({ id, name, value, line1, line2, isSelected = false, onChange, }) {
|
|
1183
|
+
function DQuickActionSelect({ id, name, value, line1, line2, className, isSelected = false, onChange, }) {
|
|
1184
1184
|
const innerRef = useRef(null);
|
|
1185
1185
|
const changeHandler = useCallback((event) => {
|
|
1186
1186
|
event.stopPropagation();
|
|
@@ -1191,15 +1191,15 @@ function DQuickActionSelect({ id, name, value, line1, line2, isSelected = false,
|
|
|
1191
1191
|
innerRef.current.checked = isSelected;
|
|
1192
1192
|
}
|
|
1193
1193
|
}, [isSelected]);
|
|
1194
|
-
return (jsxs("label", { className:
|
|
1194
|
+
return (jsxs("label", { className: classNames('d-quick-action-select', className), htmlFor: id, children: [jsx("input", { ref: innerRef, id: id, type: "radio", name: name, value: value, onChange: changeHandler }), jsx("span", { className: "d-quick-action-select-line1", children: line1 }), jsx("span", { className: "d-quick-action-select-line2", children: line2 })] }));
|
|
1195
1195
|
}
|
|
1196
1196
|
|
|
1197
|
-
function DQuickActionSwitch({ id, name, label, hint, isChecked, isDisabled, onClick, }) {
|
|
1197
|
+
function DQuickActionSwitch({ id, name, label, hint, className, isChecked, isDisabled, onClick, }) {
|
|
1198
1198
|
const clickHandler = useCallback((event) => {
|
|
1199
1199
|
event.stopPropagation();
|
|
1200
1200
|
onClick === null || onClick === void 0 ? void 0 : onClick(isChecked);
|
|
1201
1201
|
}, [isChecked, onClick]);
|
|
1202
|
-
return (jsxs("button", { className:
|
|
1202
|
+
return (jsxs("button", { className: classNames('d-quick-action-switch', className), type: "button", onClick: clickHandler, children: [jsxs("div", { className: "d-quick-action-switch-content", children: [jsx(DInputSwitch, { id: id, name: name, isDisabled: isDisabled, isChecked: isChecked, isReadonly: true }), jsx("label", { className: "d-quick-action-switch-label", htmlFor: id, children: label })] }), jsx("div", { className: "d-quick-action-switch-hint", children: hint })] }));
|
|
1203
1203
|
}
|
|
1204
1204
|
|
|
1205
1205
|
function DSkeleton({ speed = 2, viewBox, backgroundColor, foregroundColor, children, }) {
|