@smart-react-components/ui 2.0.0-alpha-99 → 2.0.0-alpha-100
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/Dropdown/index.js +14 -2
- package/package.json +1 -1
package/Dropdown/index.js
CHANGED
|
@@ -10,6 +10,18 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
13
25
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
27
|
};
|
|
@@ -18,7 +30,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
30
|
};
|
|
19
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
32
|
const react_1 = __importDefault(require("react"));
|
|
21
|
-
const FixedBox_1 =
|
|
33
|
+
const FixedBox_1 = __importStar(require("../FixedBox"));
|
|
22
34
|
__exportStar(require("../FixedBox"), exports);
|
|
23
35
|
const Dropdown = ({ afterHide, afterShow, beforeHide, beforeShow, breakpoint, children, elementProps = {}, hasHideAnimation, hasShowAnimation, isDismissible, maxWidth, minWidth, position, setStatus, space, status, transitionClassName, transitionDuration, triggerInteraction }) => {
|
|
24
36
|
var _a, _b, _c, _d;
|
|
@@ -29,7 +41,7 @@ const Dropdown = ({ afterHide, afterShow, beforeHide, beforeShow, breakpoint, ch
|
|
|
29
41
|
getTriggerEl().dispatchEvent(new Event('src.fixedBox.setPosition'));
|
|
30
42
|
}, [(_c = (_b = (_a = children === null || children === void 0 ? void 0 : children[1]) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.children) === null || _c === void 0 ? void 0 : _c.length]);
|
|
31
43
|
return (react_1.default.createElement(FixedBox_1.default, { afterHide: afterHide, afterShow: afterShow, beforeHide: beforeHide, beforeShow: beforeShow, breakpoint: breakpoint, elementProps: Object.assign({ overflow: ['initial', true] }, elementProps), hasHideAnimation: hasHideAnimation, hasShowAnimation: hasShowAnimation, isDismissible: isDismissible, maxWidth: maxWidth, minWidth: minWidth, position: position, setStatus: setStatus !== null && setStatus !== void 0 ? setStatus : setLocalStatus, space: space, status: status !== null && status !== void 0 ? status : localStatus, transitionClassName: transitionClassName, transitionDuration: transitionDuration, triggerInteraction: triggerInteraction },
|
|
32
|
-
react_1.default.cloneElement(children[0], {
|
|
44
|
+
react_1.default.cloneElement(children[0], { ref: (_d = children[0].ref) !== null && _d !== void 0 ? _d : triggerEl, cursor: triggerInteraction & FixedBox_1.TriggerInteraction.CLICK ? '$cursor.dropdown' : undefined }),
|
|
33
45
|
react_1.default.cloneElement(children[1], { setStatus: setStatus !== null && setStatus !== void 0 ? setStatus : setLocalStatus })));
|
|
34
46
|
};
|
|
35
47
|
exports.default = Dropdown;
|