phx-react 1.3.741 → 1.3.743
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/Dropdown/Dropdown.d.ts +3 -3
- package/dist/cjs/components/Dropdown/Dropdown.js +79 -30
- package/dist/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.d.ts +3 -3
- package/dist/esm/components/Dropdown/Dropdown.js +65 -16
- package/dist/esm/components/Dropdown/Dropdown.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import * as SolidIcons from '@heroicons/react/24/solid';
|
|
3
1
|
import * as OutlineIcons from '@heroicons/react/24/outline';
|
|
2
|
+
import * as SolidIcons from '@heroicons/react/24/solid';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
export type IconName = keyof typeof SolidIcons | keyof typeof OutlineIcons;
|
|
5
5
|
export interface DropdownProps {
|
|
6
6
|
className?: string;
|
|
@@ -28,4 +28,4 @@ export interface DropdownProps {
|
|
|
28
28
|
widthContent?: any;
|
|
29
29
|
isFullContentOption?: boolean;
|
|
30
30
|
}
|
|
31
|
-
export declare function PHXDropdown({ className,
|
|
31
|
+
export declare function PHXDropdown({ buttonContent, className, defaultDate, disabledDate, endDisabled, loading, max, min, onChangeDate, optionTitle, options, origin, soft, startDisabled, type, widthContent, isFullContentOption, }: DropdownProps): React.JSX.Element;
|
|
@@ -2,57 +2,106 @@
|
|
|
2
2
|
exports.__esModule = true;
|
|
3
3
|
exports.PHXDropdown = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
|
-
var react_1 =
|
|
6
|
-
var react_2 = require("@headlessui/react");
|
|
5
|
+
var react_1 = require("@headlessui/react");
|
|
7
6
|
var solid_1 = require("@heroicons/react/20/solid");
|
|
8
|
-
var SolidIcons = tslib_1.__importStar(require("@heroicons/react/24/solid"));
|
|
9
7
|
var OutlineIcons = tslib_1.__importStar(require("@heroicons/react/24/outline"));
|
|
8
|
+
var SolidIcons = tslib_1.__importStar(require("@heroicons/react/24/solid"));
|
|
9
|
+
var react_2 = tslib_1.__importStar(require("react"));
|
|
10
|
+
var react_dom_1 = tslib_1.__importDefault(require("react-dom"));
|
|
10
11
|
var types_1 = require("../types");
|
|
11
12
|
var Calendar_1 = tslib_1.__importDefault(require("../DatePicker/components/Calendar"));
|
|
12
13
|
var Loading_1 = require("../Loading");
|
|
13
14
|
function PHXDropdown(_a) {
|
|
14
|
-
var className = _a.className,
|
|
15
|
+
var buttonContent = _a.buttonContent, className = _a.className, defaultDate = _a.defaultDate, disabledDate = _a.disabledDate, endDisabled = _a.endDisabled, loading = _a.loading, max = _a.max, min = _a.min, onChangeDate = _a.onChangeDate, optionTitle = _a.optionTitle, options = _a.options, _b = _a.origin, origin = _b === void 0 ? 'left' : _b, _c = _a.soft, soft = _c === void 0 ? false : _c, startDisabled = _a.startDisabled, _d = _a.type, type = _d === void 0 ? 'default' : _d, widthContent = _a.widthContent, _e = _a.isFullContentOption, isFullContentOption = _e === void 0 ? false : _e;
|
|
16
|
+
var _f = (0, react_2.useState)(null), portalElement = _f[0], setPortalElement = _f[1];
|
|
17
|
+
var menuButtonRef = (0, react_2.useRef)(null);
|
|
18
|
+
(0, react_2.useEffect)(function () {
|
|
19
|
+
var element = document.createElement('div');
|
|
20
|
+
document.body.appendChild(element);
|
|
21
|
+
setPortalElement(element);
|
|
22
|
+
return function () {
|
|
23
|
+
document.body.removeChild(element);
|
|
24
|
+
};
|
|
25
|
+
}, []);
|
|
26
|
+
var calculatePosition = function () {
|
|
27
|
+
if (menuButtonRef.current && portalElement) {
|
|
28
|
+
var buttonRect = menuButtonRef.current.getBoundingClientRect();
|
|
29
|
+
portalElement.style.position = 'absolute';
|
|
30
|
+
switch (origin) {
|
|
31
|
+
case 'left':
|
|
32
|
+
portalElement.style.top = "".concat(buttonRect.bottom + window.scrollY, "px");
|
|
33
|
+
portalElement.style.left = "".concat(buttonRect.left + window.scrollX, "px");
|
|
34
|
+
break;
|
|
35
|
+
case 'right':
|
|
36
|
+
portalElement.style.top = "".concat(buttonRect.bottom + window.scrollY, "px");
|
|
37
|
+
portalElement.style.right = "".concat(window.innerWidth - buttonRect.right, "px");
|
|
38
|
+
break;
|
|
39
|
+
case 'top-left':
|
|
40
|
+
portalElement.style.bottom = "".concat(window.innerHeight - buttonRect.top + window.scrollY, "px");
|
|
41
|
+
portalElement.style.left = "".concat(buttonRect.left + window.scrollX, "px");
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
portalElement.style.top = "".concat(buttonRect.bottom + window.scrollY, "px");
|
|
45
|
+
portalElement.style.left = "".concat(buttonRect.left + window.scrollX, "px");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
(0, react_2.useEffect)(function () {
|
|
50
|
+
if (portalElement) {
|
|
51
|
+
calculatePosition();
|
|
52
|
+
}
|
|
53
|
+
}, [portalElement]);
|
|
54
|
+
(0, react_2.useEffect)(function () {
|
|
55
|
+
var handleResize = function () {
|
|
56
|
+
calculatePosition();
|
|
57
|
+
};
|
|
58
|
+
window.addEventListener('resize', handleResize);
|
|
59
|
+
window.addEventListener('scroll', handleResize);
|
|
60
|
+
return function () {
|
|
61
|
+
window.removeEventListener('resize', handleResize);
|
|
62
|
+
window.removeEventListener('scroll', handleResize);
|
|
63
|
+
};
|
|
64
|
+
}, [portalElement]);
|
|
15
65
|
var Icon = function (_a) {
|
|
16
66
|
var active = _a.active, icon = _a.icon, iconOutline = _a.iconOutline;
|
|
17
67
|
// @ts-ignore
|
|
18
68
|
var Icon = iconOutline ? OutlineIcons[icon] : SolidIcons[icon];
|
|
19
|
-
return
|
|
69
|
+
return react_2["default"].createElement(Icon, { className: (0, types_1.classNames)('h-4 w-4', active && 'font-semibold') });
|
|
20
70
|
};
|
|
21
|
-
return (
|
|
22
|
-
|
|
71
|
+
var renderMenuItems = function () { return (react_2["default"].createElement(react_1.Transition, { as: react_2.Fragment, enter: 'transition ease-out duration-100', enterFrom: 'transform opacity-0 scale-95', enterTo: 'transform opacity-100 scale-100', leave: 'transition ease-in duration-75', leaveFrom: 'transform opacity-100 scale-100', leaveTo: 'transform opacity-0 scale-95' },
|
|
72
|
+
react_2["default"].createElement(react_1.Menu.Items, { className: (0, types_1.classNames)(origin === 'left' && 'left-0 origin-top-left', origin === 'right' && 'right-0 origin-top-right', origin === 'top-left' && 'bottom-8 left-0', type === 'date-picker' ? '' : 'border px-1', 'absolute z-10 mt-1.5 max-h-96 min-w-[7.2rem] overflow-y-auto whitespace-nowrap rounded-lg bg-white shadow-[0rem_0.25rem_0.375rem_-0.125rem_rgba(26,26,26,.2)] focus:outline-none') }, type === 'date-picker' ? (react_2["default"].createElement(Calendar_1["default"], { defaultDate: defaultDate, disabledDate: disabledDate, endDisabled: endDisabled, max: max, min: min, onChangeDate: onChangeDate, startDisabled: startDisabled })) : (react_2["default"].createElement(react_2["default"].Fragment, null,
|
|
73
|
+
optionTitle && react_2["default"].createElement("p", { className: 'px-2.5 pb-1 pt-2 text-xs font-semibold' }, optionTitle),
|
|
74
|
+
react_2["default"].createElement("div", { className: 'py-1' }, options === null || options === void 0 ? void 0 : options.map(function (item) { return (react_2["default"].createElement(react_1.Menu.Item, { key: item.content }, function (_a) {
|
|
75
|
+
var active = _a.active;
|
|
76
|
+
return (react_2["default"].createElement("div", { className: (0, types_1.classNames)(active ? 'cursor-pointer rounded-lg bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-2.5 py-2 text-xs', item.active && !item.destructive && 'rounded-lg bg-gray-200 font-semibold text-gray-900', item.destructive && !item.active && 'text-red-800 hover:bg-red-100', item.destructive && item.active && 'rounded-lg bg-red-200 font-semibold text-red-800'), onClick: item.onClick },
|
|
77
|
+
react_2["default"].createElement("div", { className: (0, types_1.classNames)(item.icon && 'flex items-center gap-x-2') },
|
|
78
|
+
item.icon && react_2["default"].createElement(Icon, { active: item.active, icon: item.icon, iconOutline: item.iconOutline }),
|
|
79
|
+
react_2["default"].createElement("p", { className: "".concat(widthContent, " overflow-ellipsis break-words ").concat(isFullContentOption ? 'whitespace-normal' : '') }, item.content))));
|
|
80
|
+
})); }))))))); };
|
|
81
|
+
return (react_2["default"].createElement("div", { className: (0, types_1.classNames)('relative max-w-full md:max-w-fit', type === 'ellipsis-icon' && 'flex items-center') },
|
|
82
|
+
react_2["default"].createElement(react_1.Menu, { as: 'div', className: (0, types_1.classNames)('relative inline-block w-full text-left', className && "".concat(className), type === 'ellipsis-icon' && 'flex items-center') }, function (_a) {
|
|
23
83
|
var open = _a.open;
|
|
24
|
-
return (
|
|
25
|
-
|
|
26
|
-
|
|
84
|
+
return (react_2["default"].createElement(react_2["default"].Fragment, null,
|
|
85
|
+
react_2["default"].createElement("div", null,
|
|
86
|
+
react_2["default"].createElement(react_1.Menu.Button, { ref: menuButtonRef, className: (0, types_1.classNames)('w-full', (type === 'default' || type === 'date-picker') &&
|
|
27
87
|
!soft &&
|
|
28
88
|
"rounded-lg border border-gray-300 border-b-gray-400 bg-white px-2.5 py-1.5 text-xs font-normal text-gray-900 shadow-sm hover:bg-gray-50 active:border-b-gray-100 active:bg-gray-100 active:pb-[0.3rem] active:pt-[0.45rem] active:shadow-[0rem_0.125rem_0.1rem_0rem_#0004_inset] ".concat(open ? '!border-b-gray-100 !bg-gray-100 !shadow-[0rem_0.125rem_0.1rem_0rem_#0004_inset]' : ''), type === 'icon-only' &&
|
|
29
89
|
!soft &&
|
|
30
90
|
'flex items-center rounded-full bg-gray-100 text-gray-600 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:ring-offset-gray-100', soft &&
|
|
31
91
|
"rounded-lg bg-indigo-50 px-2.5 py-1.5 text-xs font-normal text-gray-700 shadow-sm hover:bg-indigo-100 active:pb-[0.3rem] active:pt-[0.45rem] active:shadow-[0rem_0.125rem_0.1rem_0rem_#0004_inset] ".concat(open ? '!bg-indigo-100 shadow-[0rem_0.125rem_0.1rem_0rem_#0004_inset]' : ''), type === 'soft-small' &&
|
|
32
92
|
"rounded-lg bg-gray-200 px-2 py-1 text-xs hover:bg-gray-300 active:pb-[0.2rem] active:pt-[0.35rem] active:shadow-[0rem_0.125rem_0.1rem_0rem_#0004_inset]\n ".concat(open ? '!bg-gray-300 shadow-[0rem_0.125rem_0.1rem_0rem_#0004_inset]' : '', "\n "), type === 'ellipsis-icon' && 'flex items-center') },
|
|
33
|
-
|
|
93
|
+
react_2["default"].createElement("div", { className: (0, types_1.classNames)((type === 'default' || type === 'date-picker' || type === 'soft-small') &&
|
|
34
94
|
'flex items-center justify-between gap-x-1 text-gray-900 md:justify-center', type === 'ellipsis-icon' && 'flex items-center') },
|
|
35
|
-
|
|
95
|
+
react_2["default"].createElement("p", { className: (0, types_1.classNames)('max-w-[200px] truncate', type === 'icon-only' && 'sr-only') }, buttonContent),
|
|
36
96
|
(type === 'default' || type === 'date-picker' || type === 'soft-small') &&
|
|
37
|
-
(open && origin === 'top-left' ? (
|
|
38
|
-
type === 'icon-only' &&
|
|
39
|
-
type === 'ellipsis-icon' && (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
react_1["default"].createElement(react_2.Menu.Items, { className: (0, types_1.classNames)(origin === 'left' && 'left-0 origin-top-left', origin === 'right' && 'right-0 origin-top-right', origin === 'top-left' && 'bottom-8 left-0', type === 'date-picker' ? '' : 'border px-1', 'absolute z-10 mt-1.5 max-h-96 min-w-[7.2rem] overflow-y-auto whitespace-nowrap rounded-lg bg-white shadow-[0rem_0.25rem_0.375rem_-0.125rem_rgba(26,26,26,.2)] focus:outline-none') }, type === 'date-picker' ? (react_1["default"].createElement(Calendar_1["default"], { onChangeDate: onChangeDate, defaultDate: defaultDate, max: max, min: min, startDisabled: startDisabled, endDisabled: endDisabled, disabledDate: disabledDate })) : (react_1["default"].createElement(react_1["default"].Fragment, null,
|
|
43
|
-
optionTitle && react_1["default"].createElement("p", { className: 'px-2.5 pb-1 pt-2 text-xs font-semibold' }, optionTitle),
|
|
44
|
-
react_1["default"].createElement("div", { className: 'py-1' }, options === null || options === void 0 ? void 0 : options.map(function (item) { return (react_1["default"].createElement(react_2.Menu.Item, { key: item.content }, function (_a) {
|
|
45
|
-
var active = _a.active;
|
|
46
|
-
return (react_1["default"].createElement("div", { className: (0, types_1.classNames)(active ? 'cursor-pointer rounded-lg bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-2.5 py-2 text-xs', item.active &&
|
|
47
|
-
!item.destructive &&
|
|
48
|
-
'rounded-lg bg-gray-200 font-semibold text-gray-900', item.destructive && !item.active && 'text-red-800 hover:bg-red-100', item.destructive && item.active && 'rounded-lg bg-red-200 font-semibold text-red-800'), onClick: item.onClick },
|
|
49
|
-
react_1["default"].createElement("div", { className: (0, types_1.classNames)(item.icon && 'flex items-center gap-x-2') },
|
|
50
|
-
item.icon && (react_1["default"].createElement(Icon, { active: item.active, icon: item.icon, iconOutline: item.iconOutline })),
|
|
51
|
-
react_1["default"].createElement("p", { className: "".concat(widthContent, " overflow-ellipsis break-words ").concat(isFullContentOption ? 'whitespace-normal' : '', " ") }, item.content))));
|
|
52
|
-
})); }))))))));
|
|
97
|
+
(open && origin === 'top-left' ? (react_2["default"].createElement(solid_1.ChevronUpIcon, { "aria-hidden": 'true', className: 'mt-0.5 h-4 w-4' })) : (react_2["default"].createElement(solid_1.ChevronDownIcon, { "aria-hidden": 'true', className: 'mt-0.5 h-4 w-4' }))),
|
|
98
|
+
type === 'icon-only' && react_2["default"].createElement(solid_1.EllipsisHorizontalIcon, { "aria-hidden": 'true', className: 'h-4 w-4' }),
|
|
99
|
+
type === 'ellipsis-icon' && (react_2["default"].createElement("div", { className: 'rounded-lg p-1 hover:bg-gray-300' },
|
|
100
|
+
react_2["default"].createElement(solid_1.EllipsisHorizontalIcon, { "aria-hidden": 'true', className: 'h-4 w-4' })))))),
|
|
101
|
+
portalElement ? react_dom_1["default"].createPortal(renderMenuItems(), portalElement) : null));
|
|
53
102
|
}),
|
|
54
|
-
loading && (
|
|
55
|
-
|
|
103
|
+
loading && (react_2["default"].createElement("div", { className: 'absolute left-[1px] top-[1px] flex h-[calc(100%-2px)] w-[calc(100%-2px)] items-center justify-center rounded-[14px] bg-white' },
|
|
104
|
+
react_2["default"].createElement(Loading_1.PHXSpinner, { className: 'h-[16px] w-[16px] text-gray-400' })))));
|
|
56
105
|
}
|
|
57
106
|
exports.PHXDropdown = PHXDropdown;
|
|
58
107
|
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":";;;;AAAA,2CAAoD;AACpD,mDAAkG;AAClG,gFAA2D;AAC3D,4EAAuD;AACvD,qDAAoE;AACpE,gEAAgC;AAChC,kCAAqC;AACrC,uFAAwD;AACxD,sCAAuC;AA+BvC,SAAgB,WAAW,CAAC,EAkBZ;QAjBd,aAAa,mBAAA,EACb,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,YAAY,kBAAA,EACZ,WAAW,iBAAA,EACX,OAAO,aAAA,EACP,GAAG,SAAA,EACH,GAAG,SAAA,EACH,YAAY,kBAAA,EACZ,WAAW,iBAAA,EACX,OAAO,aAAA,EACP,cAAe,EAAf,MAAM,mBAAG,MAAM,KAAA,EACf,YAAY,EAAZ,IAAI,mBAAG,KAAK,KAAA,EACZ,aAAa,mBAAA,EACb,YAAgB,EAAhB,IAAI,mBAAG,SAAS,KAAA,EAChB,YAAY,kBAAA,EACZ,2BAA2B,EAA3B,mBAAmB,mBAAG,KAAK,KAAA;IAErB,IAAA,KAAoC,IAAA,gBAAQ,EAAqB,IAAI,CAAC,EAArE,aAAa,QAAA,EAAE,gBAAgB,QAAsC,CAAA;IAC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ACL,aAAa,CAAC,CAAC,CAAC,sBAAQ,CAAC,YAAY,CAAC,eAAe,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAC9E,CACJ;QArDc,CAqDd,CACI;QACN,OAAO,IAAI,CACV,0CAAK,SAAS,EAAC,+HAA+H;YAC5I,iCAAC,oBAAU,IAAC,SAAS,EAAC,iCAAiC,GAAG,CACtD,CACP,CACG,CACP,CAAA;AACH,CAAC;AA9ND,kCA8NC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import * as SolidIcons from '@heroicons/react/24/solid';
|
|
3
1
|
import * as OutlineIcons from '@heroicons/react/24/outline';
|
|
2
|
+
import * as SolidIcons from '@heroicons/react/24/solid';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
export type IconName = keyof typeof SolidIcons | keyof typeof OutlineIcons;
|
|
5
5
|
export interface DropdownProps {
|
|
6
6
|
className?: string;
|
|
@@ -28,4 +28,4 @@ export interface DropdownProps {
|
|
|
28
28
|
widthContent?: any;
|
|
29
29
|
isFullContentOption?: boolean;
|
|
30
30
|
}
|
|
31
|
-
export declare function PHXDropdown({ className,
|
|
31
|
+
export declare function PHXDropdown({ buttonContent, className, defaultDate, disabledDate, endDisabled, loading, max, min, onChangeDate, optionTitle, options, origin, soft, startDisabled, type, widthContent, isFullContentOption, }: DropdownProps): React.JSX.Element;
|
|
@@ -1,25 +1,85 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
2
1
|
import { Menu, Transition } from '@headlessui/react';
|
|
3
2
|
import { ChevronDownIcon, ChevronUpIcon, EllipsisHorizontalIcon } from '@heroicons/react/20/solid';
|
|
4
|
-
import * as SolidIcons from '@heroicons/react/24/solid';
|
|
5
3
|
import * as OutlineIcons from '@heroicons/react/24/outline';
|
|
4
|
+
import * as SolidIcons from '@heroicons/react/24/solid';
|
|
5
|
+
import React, { Fragment, useEffect, useRef, useState } from 'react';
|
|
6
|
+
import ReactDOM from 'react-dom';
|
|
6
7
|
import { classNames } from '../types';
|
|
7
8
|
import Calendar from '../DatePicker/components/Calendar';
|
|
8
9
|
import { PHXSpinner } from '../Loading';
|
|
9
10
|
export function PHXDropdown(_a) {
|
|
10
|
-
var className = _a.className,
|
|
11
|
+
var buttonContent = _a.buttonContent, className = _a.className, defaultDate = _a.defaultDate, disabledDate = _a.disabledDate, endDisabled = _a.endDisabled, loading = _a.loading, max = _a.max, min = _a.min, onChangeDate = _a.onChangeDate, optionTitle = _a.optionTitle, options = _a.options, _b = _a.origin, origin = _b === void 0 ? 'left' : _b, _c = _a.soft, soft = _c === void 0 ? false : _c, startDisabled = _a.startDisabled, _d = _a.type, type = _d === void 0 ? 'default' : _d, widthContent = _a.widthContent, _e = _a.isFullContentOption, isFullContentOption = _e === void 0 ? false : _e;
|
|
12
|
+
var _f = useState(null), portalElement = _f[0], setPortalElement = _f[1];
|
|
13
|
+
var menuButtonRef = useRef(null);
|
|
14
|
+
useEffect(function () {
|
|
15
|
+
var element = document.createElement('div');
|
|
16
|
+
document.body.appendChild(element);
|
|
17
|
+
setPortalElement(element);
|
|
18
|
+
return function () {
|
|
19
|
+
document.body.removeChild(element);
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
var calculatePosition = function () {
|
|
23
|
+
if (menuButtonRef.current && portalElement) {
|
|
24
|
+
var buttonRect = menuButtonRef.current.getBoundingClientRect();
|
|
25
|
+
portalElement.style.position = 'absolute';
|
|
26
|
+
switch (origin) {
|
|
27
|
+
case 'left':
|
|
28
|
+
portalElement.style.top = "".concat(buttonRect.bottom + window.scrollY, "px");
|
|
29
|
+
portalElement.style.left = "".concat(buttonRect.left + window.scrollX, "px");
|
|
30
|
+
break;
|
|
31
|
+
case 'right':
|
|
32
|
+
portalElement.style.top = "".concat(buttonRect.bottom + window.scrollY, "px");
|
|
33
|
+
portalElement.style.right = "".concat(window.innerWidth - buttonRect.right, "px");
|
|
34
|
+
break;
|
|
35
|
+
case 'top-left':
|
|
36
|
+
portalElement.style.bottom = "".concat(window.innerHeight - buttonRect.top + window.scrollY, "px");
|
|
37
|
+
portalElement.style.left = "".concat(buttonRect.left + window.scrollX, "px");
|
|
38
|
+
break;
|
|
39
|
+
default:
|
|
40
|
+
portalElement.style.top = "".concat(buttonRect.bottom + window.scrollY, "px");
|
|
41
|
+
portalElement.style.left = "".concat(buttonRect.left + window.scrollX, "px");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
useEffect(function () {
|
|
46
|
+
if (portalElement) {
|
|
47
|
+
calculatePosition();
|
|
48
|
+
}
|
|
49
|
+
}, [portalElement]);
|
|
50
|
+
useEffect(function () {
|
|
51
|
+
var handleResize = function () {
|
|
52
|
+
calculatePosition();
|
|
53
|
+
};
|
|
54
|
+
window.addEventListener('resize', handleResize);
|
|
55
|
+
window.addEventListener('scroll', handleResize);
|
|
56
|
+
return function () {
|
|
57
|
+
window.removeEventListener('resize', handleResize);
|
|
58
|
+
window.removeEventListener('scroll', handleResize);
|
|
59
|
+
};
|
|
60
|
+
}, [portalElement]);
|
|
11
61
|
var Icon = function (_a) {
|
|
12
62
|
var active = _a.active, icon = _a.icon, iconOutline = _a.iconOutline;
|
|
13
63
|
// @ts-ignore
|
|
14
64
|
var Icon = iconOutline ? OutlineIcons[icon] : SolidIcons[icon];
|
|
15
65
|
return React.createElement(Icon, { className: classNames('h-4 w-4', active && 'font-semibold') });
|
|
16
66
|
};
|
|
67
|
+
var renderMenuItems = function () { return (React.createElement(Transition, { as: Fragment, enter: 'transition ease-out duration-100', enterFrom: 'transform opacity-0 scale-95', enterTo: 'transform opacity-100 scale-100', leave: 'transition ease-in duration-75', leaveFrom: 'transform opacity-100 scale-100', leaveTo: 'transform opacity-0 scale-95' },
|
|
68
|
+
React.createElement(Menu.Items, { className: classNames(origin === 'left' && 'left-0 origin-top-left', origin === 'right' && 'right-0 origin-top-right', origin === 'top-left' && 'bottom-8 left-0', type === 'date-picker' ? '' : 'border px-1', 'absolute z-10 mt-1.5 max-h-96 min-w-[7.2rem] overflow-y-auto whitespace-nowrap rounded-lg bg-white shadow-[0rem_0.25rem_0.375rem_-0.125rem_rgba(26,26,26,.2)] focus:outline-none') }, type === 'date-picker' ? (React.createElement(Calendar, { defaultDate: defaultDate, disabledDate: disabledDate, endDisabled: endDisabled, max: max, min: min, onChangeDate: onChangeDate, startDisabled: startDisabled })) : (React.createElement(React.Fragment, null,
|
|
69
|
+
optionTitle && React.createElement("p", { className: 'px-2.5 pb-1 pt-2 text-xs font-semibold' }, optionTitle),
|
|
70
|
+
React.createElement("div", { className: 'py-1' }, options === null || options === void 0 ? void 0 : options.map(function (item) { return (React.createElement(Menu.Item, { key: item.content }, function (_a) {
|
|
71
|
+
var active = _a.active;
|
|
72
|
+
return (React.createElement("div", { className: classNames(active ? 'cursor-pointer rounded-lg bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-2.5 py-2 text-xs', item.active && !item.destructive && 'rounded-lg bg-gray-200 font-semibold text-gray-900', item.destructive && !item.active && 'text-red-800 hover:bg-red-100', item.destructive && item.active && 'rounded-lg bg-red-200 font-semibold text-red-800'), onClick: item.onClick },
|
|
73
|
+
React.createElement("div", { className: classNames(item.icon && 'flex items-center gap-x-2') },
|
|
74
|
+
item.icon && React.createElement(Icon, { active: item.active, icon: item.icon, iconOutline: item.iconOutline }),
|
|
75
|
+
React.createElement("p", { className: "".concat(widthContent, " overflow-ellipsis break-words ").concat(isFullContentOption ? 'whitespace-normal' : '') }, item.content))));
|
|
76
|
+
})); }))))))); };
|
|
17
77
|
return (React.createElement("div", { className: classNames('relative max-w-full md:max-w-fit', type === 'ellipsis-icon' && 'flex items-center') },
|
|
18
78
|
React.createElement(Menu, { as: 'div', className: classNames('relative inline-block w-full text-left', className && "".concat(className), type === 'ellipsis-icon' && 'flex items-center') }, function (_a) {
|
|
19
79
|
var open = _a.open;
|
|
20
80
|
return (React.createElement(React.Fragment, null,
|
|
21
81
|
React.createElement("div", null,
|
|
22
|
-
React.createElement(Menu.Button, { className: classNames('w-full', (type === 'default' || type === 'date-picker') &&
|
|
82
|
+
React.createElement(Menu.Button, { ref: menuButtonRef, className: classNames('w-full', (type === 'default' || type === 'date-picker') &&
|
|
23
83
|
!soft &&
|
|
24
84
|
"rounded-lg border border-gray-300 border-b-gray-400 bg-white px-2.5 py-1.5 text-xs font-normal text-gray-900 shadow-sm hover:bg-gray-50 active:border-b-gray-100 active:bg-gray-100 active:pb-[0.3rem] active:pt-[0.45rem] active:shadow-[0rem_0.125rem_0.1rem_0rem_#0004_inset] ".concat(open ? '!border-b-gray-100 !bg-gray-100 !shadow-[0rem_0.125rem_0.1rem_0rem_#0004_inset]' : ''), type === 'icon-only' &&
|
|
25
85
|
!soft &&
|
|
@@ -34,18 +94,7 @@ export function PHXDropdown(_a) {
|
|
|
34
94
|
type === 'icon-only' && React.createElement(EllipsisHorizontalIcon, { "aria-hidden": 'true', className: 'h-4 w-4' }),
|
|
35
95
|
type === 'ellipsis-icon' && (React.createElement("div", { className: 'rounded-lg p-1 hover:bg-gray-300' },
|
|
36
96
|
React.createElement(EllipsisHorizontalIcon, { "aria-hidden": 'true', className: 'h-4 w-4' })))))),
|
|
37
|
-
|
|
38
|
-
React.createElement(Menu.Items, { className: classNames(origin === 'left' && 'left-0 origin-top-left', origin === 'right' && 'right-0 origin-top-right', origin === 'top-left' && 'bottom-8 left-0', type === 'date-picker' ? '' : 'border px-1', 'absolute z-10 mt-1.5 max-h-96 min-w-[7.2rem] overflow-y-auto whitespace-nowrap rounded-lg bg-white shadow-[0rem_0.25rem_0.375rem_-0.125rem_rgba(26,26,26,.2)] focus:outline-none') }, type === 'date-picker' ? (React.createElement(Calendar, { onChangeDate: onChangeDate, defaultDate: defaultDate, max: max, min: min, startDisabled: startDisabled, endDisabled: endDisabled, disabledDate: disabledDate })) : (React.createElement(React.Fragment, null,
|
|
39
|
-
optionTitle && React.createElement("p", { className: 'px-2.5 pb-1 pt-2 text-xs font-semibold' }, optionTitle),
|
|
40
|
-
React.createElement("div", { className: 'py-1' }, options === null || options === void 0 ? void 0 : options.map(function (item) { return (React.createElement(Menu.Item, { key: item.content }, function (_a) {
|
|
41
|
-
var active = _a.active;
|
|
42
|
-
return (React.createElement("div", { className: classNames(active ? 'cursor-pointer rounded-lg bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-2.5 py-2 text-xs', item.active &&
|
|
43
|
-
!item.destructive &&
|
|
44
|
-
'rounded-lg bg-gray-200 font-semibold text-gray-900', item.destructive && !item.active && 'text-red-800 hover:bg-red-100', item.destructive && item.active && 'rounded-lg bg-red-200 font-semibold text-red-800'), onClick: item.onClick },
|
|
45
|
-
React.createElement("div", { className: classNames(item.icon && 'flex items-center gap-x-2') },
|
|
46
|
-
item.icon && (React.createElement(Icon, { active: item.active, icon: item.icon, iconOutline: item.iconOutline })),
|
|
47
|
-
React.createElement("p", { className: "".concat(widthContent, " overflow-ellipsis break-words ").concat(isFullContentOption ? 'whitespace-normal' : '', " ") }, item.content))));
|
|
48
|
-
})); }))))))));
|
|
97
|
+
portalElement ? ReactDOM.createPortal(renderMenuItems(), portalElement) : null));
|
|
49
98
|
}),
|
|
50
99
|
loading && (React.createElement("div", { className: 'absolute left-[1px] top-[1px] flex h-[calc(100%-2px)] w-[calc(100%-2px)] items-center justify-center rounded-[14px] bg-white' },
|
|
51
100
|
React.createElement(PHXSpinner, { className: 'h-[16px] w-[16px] text-gray-400' })))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM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