Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/@buffetjs/core/node_modules/reactstrap/es/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { Reference } from 'react-popper';
import { DropdownContext } from './DropdownContext';
import { mapToCssModules, tagPropType } from './utils';
import Button from './Button';
var propTypes = {
caret: PropTypes.bool,
color: PropTypes.string,
children: PropTypes.node,
className: PropTypes.string,
cssModule: PropTypes.object,
disabled: PropTypes.bool,
onClick: PropTypes.func,
'aria-haspopup': PropTypes.bool,
split: PropTypes.bool,
tag: tagPropType,
nav: PropTypes.bool
};
var defaultProps = {
color: 'secondary',
'aria-haspopup': true
};
var DropdownToggle = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(DropdownToggle, _React$Component);
function DropdownToggle(props) {
var _this;
_this = _React$Component.call(this, props) || this;
_this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
return _this;
}
var _proto = DropdownToggle.prototype;
_proto.onClick = function onClick(e) {
if (this.props.disabled || this.context.disabled) {
e.preventDefault();
return;
}
if (this.props.nav && !this.props.tag) {
e.preventDefault();
}
if (this.props.onClick) {
this.props.onClick(e);
}
this.context.toggle(e);
};
_proto.getRole = function getRole() {
return this.context.menuRole || this.props['aria-haspopup'];
};
_proto.render = function render() {
var _this2 = this;
var _this$props = this.props,
className = _this$props.className,
color = _this$props.color,
cssModule = _this$props.cssModule,
caret = _this$props.caret,
split = _this$props.split,
nav = _this$props.nav,
tag = _this$props.tag,
innerRef = _this$props.innerRef,
props = _objectWithoutPropertiesLoose(_this$props, ["className", "color", "cssModule", "caret", "split", "nav", "tag", "innerRef"]);
var ariaLabel = props['aria-label'] || 'Toggle Dropdown';
var classes = mapToCssModules(classNames(className, {
'dropdown-toggle': caret || split,
'dropdown-toggle-split': split,
'nav-link': nav
}), cssModule);
var children = typeof props.children !== 'undefined' ? props.children : /*#__PURE__*/React.createElement("span", {
className: "sr-only"
}, ariaLabel);
var Tag;
if (nav && !tag) {
Tag = 'a';
props.href = '#';
} else if (!tag) {
Tag = Button;
props.color = color;
props.cssModule = cssModule;
} else {
Tag = tag;
}
if (this.context.inNavbar) {
return /*#__PURE__*/React.createElement(Tag, _extends({}, props, {
className: classes,
onClick: this.onClick,
"aria-expanded": this.context.isOpen,
"aria-haspopup": this.getRole(),
children: children
}));
}
return /*#__PURE__*/React.createElement(Reference, {
innerRef: innerRef
}, function (_ref) {
var _ref2;
var ref = _ref.ref;
return /*#__PURE__*/React.createElement(Tag, _extends({}, props, (_ref2 = {}, _ref2[typeof Tag === 'string' ? 'ref' : 'innerRef'] = ref, _ref2), {
className: classes,
onClick: _this2.onClick,
"aria-expanded": _this2.context.isOpen,
"aria-haspopup": _this2.getRole(),
children: children
}));
});
};
return DropdownToggle;
}(React.Component);
DropdownToggle.propTypes = propTypes;
DropdownToggle.defaultProps = defaultProps;
DropdownToggle.contextType = DropdownContext;
export default DropdownToggle; |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0044 ]-- |