@yuntijs/ui
Version:
☁️ Yunti UI - an open-source UI component library for building Cloud Native web apps
72 lines • 4.7 kB
JavaScript
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
import { MenuOption } from '@lexical/react/LexicalTypeaheadMenuPlugin';
export var MentionMenuOption = /*#__PURE__*/function (_MenuOption) {
_inherits(MentionMenuOption, _MenuOption);
var _super = _createSuper(MentionMenuOption);
function MentionMenuOption(_ref) {
var _this;
var label = _ref.label,
value = _ref.value,
title = _ref.title,
data = _ref.data,
icon = _ref.icon,
extraElement = _ref.extraElement,
keywords = _ref.keywords,
keyboardShortcut = _ref.keyboardShortcut,
disabled = _ref.disabled,
triggers = _ref.triggers,
onSelect = _ref.onSelect,
children = _ref.children,
isChild = _ref.isChild;
_classCallCheck(this, MentionMenuOption);
_this = _super.call(this, value);
_defineProperty(_assertThisInitialized(_this), "label", void 0);
_defineProperty(_assertThisInitialized(_this), "value", void 0);
_defineProperty(_assertThisInitialized(_this), "htmlTitle", void 0);
// for Tree, the same as label
_defineProperty(_assertThisInitialized(_this), "title", void 0);
// for Tree, the same as value
_defineProperty(_assertThisInitialized(_this), "key", void 0);
_defineProperty(_assertThisInitialized(_this), "icon", void 0);
_defineProperty(_assertThisInitialized(_this), "extraElement", void 0);
_defineProperty(_assertThisInitialized(_this), "keywords", void 0);
_defineProperty(_assertThisInitialized(_this), "keyboardShortcut", void 0);
_defineProperty(_assertThisInitialized(_this), "onSelect", void 0);
_defineProperty(_assertThisInitialized(_this), "disabled", void 0);
_defineProperty(_assertThisInitialized(_this), "triggers", void 0);
_defineProperty(_assertThisInitialized(_this), "data", void 0);
_defineProperty(_assertThisInitialized(_this), "children", void 0);
_defineProperty(_assertThisInitialized(_this), "isChild", void 0);
_this.value = value;
_this.label = label;
_this.htmlTitle = title;
_this.title = label;
_this.key = value;
_this.keywords = keywords || [];
_this.icon = icon;
_this.extraElement = extraElement;
_this.keyboardShortcut = keyboardShortcut;
_this.onSelect = onSelect.bind(_assertThisInitialized(_this));
_this.disabled = disabled;
_this.triggers = triggers;
_this.data = data;
_this.isChild = isChild !== null && isChild !== void 0 ? isChild : false;
_this.children = children === null || children === void 0 ? void 0 : children.map(function (m) {
return new MentionMenuOption(_objectSpread(_objectSpread({}, m), {}, {
isChild: true
}));
});
return _this;
}
return _createClass(MentionMenuOption);
}(MenuOption);