@homecode/ui 4.22.11 → 4.22.13
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/esm/src/components/DatePickerInput/DatePickerInput.js +1 -1
- package/dist/esm/src/components/Icon/icons/chat.svg.js +17 -0
- package/dist/esm/src/components/Icon/icons/index.js +1 -0
- package/dist/esm/src/components/Popup/Popup.js +4 -1
- package/dist/esm/types/src/components/Icon/icons/index.d.ts +1 -0
- package/dist/esm/types/src/components/Menu/Menu.d.ts +1 -0
- package/dist/esm/types/src/components/Popup/Popup.d.ts +1 -0
- package/dist/esm/types/src/components/Scroll/Scroll.d.ts +1 -0
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ function DatePickerInput(props) {
|
|
|
13
13
|
return (jsx(Popup, { size: size, focusControl: true, direction: "bottom-right", ...popupProps, trigger:
|
|
14
14
|
// @ts-ignore
|
|
15
15
|
jsx(Button, { variant: variant, size: size, children: isRange ? (jsxs(Fragment, { children: [jsx(DateTime, { value: strToDate(value[0]), format: displayFormat }), ' - ', jsx(DateTime, { value: strToDate(value[1]), format: displayFormat })] })) : (jsx(DateTime, { value: strToDate(value), format: displayFormat })) }), contentProps: {
|
|
16
|
-
className: cn(S.popupContent, props.doubleCalendar && S.doubleCalendar, S[`size-${size}`]),
|
|
16
|
+
className: cn(S.popupContent, props.doubleCalendar && S.doubleCalendar, S[`size-${size}`], popupProps?.contentProps?.className),
|
|
17
17
|
}, content: jsx(DatePicker, { ...props, className: S.content, calendarProps: { className: S.calendar } }) }));
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
var SvgChat = function SvgChat(props) {
|
|
5
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
viewBox: "0 0 24 24"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
|
+
d: "M21.336 1.656H2.621c-1.268 0-2.34 1.072-2.34 2.34v12.867c0 1.268 1.072 2.34 2.34 2.34h11.135l3.783 4.16a.39.39 0 0 0 .678-.262v-3.899h3.12c1.267 0 2.339-1.071 2.339-2.34V3.997c0-1.268-1.072-2.34-2.34-2.34M4.96 6.726h5.849a.39.39 0 1 1 0 .779H4.96a.39.39 0 1 1 0-.78m13.257 7.018H4.96a.39.39 0 1 1 0-.78h13.257a.39.39 0 1 1 0 .78m0-3.12H4.96a.39.39 0 1 1 0-.78h13.257a.39.39 0 1 1 0 .78",
|
|
11
|
+
style: {
|
|
12
|
+
strokeWidth: 0.38991
|
|
13
|
+
}
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { SvgChat as default };
|
|
@@ -5,6 +5,7 @@ var ICONS = {
|
|
|
5
5
|
brain: () => import('./brain.svg.js'),
|
|
6
6
|
brokenImage: () => import('./brokenImage.svg.js'),
|
|
7
7
|
camera: () => import('./camera.svg.js'),
|
|
8
|
+
chat: () => import('./chat.svg.js'),
|
|
8
9
|
check: () => import('./check.svg.js'),
|
|
9
10
|
close: () => import('./close.svg.js'),
|
|
10
11
|
colors: () => import('./colors.svg.js'),
|
|
@@ -215,6 +215,7 @@ class Popup extends Component {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
}, 100);
|
|
218
|
+
isControllable = () => typeof this.props.isOpen === 'boolean';
|
|
218
219
|
isLastClickInside = () => this.pointerDownTarget &&
|
|
219
220
|
(this.pointerDownTarget.closest(`.${S.trigger}`) ||
|
|
220
221
|
this.pointerDownTarget.closest(`.${S.content}`));
|
|
@@ -273,12 +274,14 @@ class Popup extends Component {
|
|
|
273
274
|
onFocus = e => {
|
|
274
275
|
this.focused = true;
|
|
275
276
|
this.props.triggerProps?.onFocus?.(e);
|
|
276
|
-
if (!this.pointerPressed)
|
|
277
|
+
if (!this.pointerPressed && (!this.isControllable() || this.props.isOpen))
|
|
277
278
|
this.open();
|
|
278
279
|
};
|
|
279
280
|
onBlur = e => {
|
|
280
281
|
this.focused = false;
|
|
281
282
|
this.props.triggerProps?.onBlur?.(e);
|
|
283
|
+
if (this.isControllable() && this.props.isOpen)
|
|
284
|
+
return;
|
|
282
285
|
// give time to fire clicks inside popup
|
|
283
286
|
this.timers.after(60, () => {
|
|
284
287
|
if (!this.isLastClickInside())
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MenuGroupProps, MenuItemProps, MenuProps } from './Menu.types';
|
|
2
|
+
export { type MenuProps };
|
|
2
3
|
export declare const Menu: import("react").ForwardRefExoticComponent<MenuProps & import("react").RefAttributes<Scroll>> & {
|
|
3
4
|
Item: import("react").ForwardRefExoticComponent<MenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
5
|
Group: import("react").FC<MenuGroupProps>;
|
|
@@ -54,6 +54,7 @@ export declare class Popup extends Component<T.Props> {
|
|
|
54
54
|
updateOffset: () => void;
|
|
55
55
|
applyOffset(): void;
|
|
56
56
|
checkHover: any;
|
|
57
|
+
isControllable: () => boolean;
|
|
57
58
|
isLastClickInside: () => any;
|
|
58
59
|
onDocPointerDown: (e: PointerEvent) => void;
|
|
59
60
|
onDocPointerUp: (e: PointerEvent) => void;
|