@deephaven/js-plugin-ui
Version:
1,355 lines • 3.53 MB
JavaScript
"use strict";
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value2) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key] = value2;
var __publicField = (obj, key, value2) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value2);
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const React = require("react");
const dashboard = require("@deephaven/dashboard");
const Log = require("@deephaven/log");
const jsapiBootstrap = require("@deephaven/jsapi-bootstrap");
const components = require("@deephaven/components");
const ReactDOM = require("react-dom");
const reactRedux = require("react-redux");
const plugin = require("@deephaven/plugin");
const icons = require("@deephaven/icons");
const IrisGrid = require("@deephaven/iris-grid");
const jsapiComponents = require("@deephaven/jsapi-components");
const console$1 = require("@deephaven/console");
function _interopNamespaceDefault(e2) {
const n2 = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
if (e2) {
for (const k2 in e2) {
if (k2 !== "default") {
const d2 = Object.getOwnPropertyDescriptor(e2, k2);
Object.defineProperty(n2, k2, d2.get ? d2 : {
enumerable: true,
get: () => e2[k2]
});
}
}
}
n2.default = e2;
return Object.freeze(n2);
}
const icons__namespace = /* @__PURE__ */ _interopNamespaceDefault(icons);
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x2) {
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
}
function getAugmentedNamespace(n2) {
if (n2.__esModule) return n2;
var f2 = n2.default;
if (typeof f2 == "function") {
var a = function a2() {
if (this instanceof a2) {
return Reflect.construct(f2, arguments, this.constructor);
}
return f2.apply(this, arguments);
};
a.prototype = f2.prototype;
} else a = {};
Object.defineProperty(a, "__esModule", { value: true });
Object.keys(n2).forEach(function(k2) {
var d2 = Object.getOwnPropertyDescriptor(n2, k2);
Object.defineProperty(a, k2, d2.get ? d2 : {
enumerable: true,
get: function() {
return n2[k2];
}
});
});
return a;
}
var jsxRuntime = { exports: {} };
var reactJsxRuntime_production_min = {};
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty$4 = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === void 0) {
throw new TypeError("Object.assign cannot be called with null or undefined");
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
var test1 = new String("abc");
test1[5] = "de";
if (Object.getOwnPropertyNames(test1)[0] === "5") {
return false;
}
var test2 = {};
for (var i = 0; i < 10; i++) {
test2["_" + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function(n2) {
return test2[n2];
});
if (order2.join("") !== "0123456789") {
return false;
}
var test3 = {};
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
return false;
}
return true;
} catch (err) {
return false;
}
}
shouldUseNative() ? Object.assign : function(target, source) {
var from2;
var to = toObject(target);
var symbols;
for (var s2 = 1; s2 < arguments.length; s2++) {
from2 = Object(arguments[s2]);
for (var key in from2) {
if (hasOwnProperty$4.call(from2, key)) {
to[key] = from2[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from2);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from2, symbols[i])) {
to[symbols[i]] = from2[symbols[i]];
}
}
}
}
return to;
};
/** @license React v17.0.2
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var f$1 = React, g$2 = 60103;
reactJsxRuntime_production_min.Fragment = 60107;
if ("function" === typeof Symbol && Symbol.for) {
var h$2 = Symbol.for;
g$2 = h$2("react.element");
reactJsxRuntime_production_min.Fragment = h$2("react.fragment");
}
var m$2 = f$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, n$1 = Object.prototype.hasOwnProperty, p$3 = { key: true, ref: true, __self: true, __source: true };
function q$1(c2, a, k2) {
var b2, d2 = {}, e2 = null, l2 = null;
void 0 !== k2 && (e2 = "" + k2);
void 0 !== a.key && (e2 = "" + a.key);
void 0 !== a.ref && (l2 = a.ref);
for (b2 in a) n$1.call(a, b2) && !p$3.hasOwnProperty(b2) && (d2[b2] = a[b2]);
if (c2 && c2.defaultProps) for (b2 in a = c2.defaultProps, a) void 0 === d2[b2] && (d2[b2] = a[b2]);
return { $$typeof: g$2, type: c2, key: e2, ref: l2, props: d2, _owner: m$2.current };
}
reactJsxRuntime_production_min.jsx = q$1;
reactJsxRuntime_production_min.jsxs = q$1;
{
jsxRuntime.exports = reactJsxRuntime_production_min;
}
var jsxRuntimeExports = jsxRuntime.exports;
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
let nanoid = (size = 21) => {
let id = "";
let bytes = crypto.getRandomValues(new Uint8Array(size |= 0));
while (size--) {
id += urlAlphabet[bytes[size] & 63];
}
return id;
};
function isElementOfType(node2, type) {
return /* @__PURE__ */ React.isValidElement(node2) && node2.type === type;
}
var EMPTY_ARRAY$2 = Object.freeze([]);
function useContextOrThrow(context) {
var message = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "No value available in context. Was code wrapped in a provider?";
var value2 = React.useContext(context);
if (value2 == null) {
throw new Error(message);
}
return value2;
}
var FUNC_ERROR_TEXT = "Expected a function";
var NAN$1 = 0 / 0;
var symbolTag$1 = "[object Symbol]";
var reTrim$1 = /^\s+|\s+$/g;
var reIsBadHex$1 = /^[-+]0x[0-9a-f]+$/i;
var reIsBinary$1 = /^0b[01]+$/i;
var reIsOctal$1 = /^0o[0-7]+$/i;
var freeParseInt$1 = parseInt;
var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
var root$2 = freeGlobal || freeSelf || Function("return this")();
var objectProto$1 = Object.prototype;
var objectToString$1 = objectProto$1.toString;
var nativeMax = Math.max, nativeMin = Math.min;
var now = function() {
return root$2.Date.now();
};
function debounce(func, wait, options) {
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
if (typeof func != "function") {
throw new TypeError(FUNC_ERROR_TEXT);
}
wait = toNumber$1(wait) || 0;
if (isObject$5(options)) {
leading = !!options.leading;
maxing = "maxWait" in options;
maxWait = maxing ? nativeMax(toNumber$1(options.maxWait) || 0, wait) : maxWait;
trailing = "trailing" in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
var args = lastArgs, thisArg = lastThis;
lastArgs = lastThis = void 0;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time) {
lastInvokeTime = time;
timerId = setTimeout(timerExpired, wait);
return leading ? invokeFunc(time) : result;
}
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, result2 = wait - timeSinceLastCall;
return maxing ? nativeMin(result2, maxWait - timeSinceLastInvoke) : result2;
}
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
}
function timerExpired() {
var time = now();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
timerId = setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time) {
timerId = void 0;
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = void 0;
return result;
}
function cancel() {
if (timerId !== void 0) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = void 0;
}
function flush() {
return timerId === void 0 ? result : trailingEdge(now());
}
function debounced() {
var time = now(), isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === void 0) {
return leadingEdge(lastCallTime);
}
if (maxing) {
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === void 0) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
function isObject$5(value2) {
var type = typeof value2;
return !!value2 && (type == "object" || type == "function");
}
function isObjectLike$1(value2) {
return !!value2 && typeof value2 == "object";
}
function isSymbol$2(value2) {
return typeof value2 == "symbol" || isObjectLike$1(value2) && objectToString$1.call(value2) == symbolTag$1;
}
function toNumber$1(value2) {
if (typeof value2 == "number") {
return value2;
}
if (isSymbol$2(value2)) {
return NAN$1;
}
if (isObject$5(value2)) {
var other = typeof value2.valueOf == "function" ? value2.valueOf() : value2;
value2 = isObject$5(other) ? other + "" : other;
}
if (typeof value2 != "string") {
return value2 === 0 ? value2 : +value2;
}
value2 = value2.replace(reTrim$1, "");
var isBinary = reIsBinary$1.test(value2);
return isBinary || reIsOctal$1.test(value2) ? freeParseInt$1(value2.slice(2), isBinary ? 2 : 8) : reIsBadHex$1.test(value2) ? NAN$1 : +value2;
}
var lodash_debounce = debounce;
const debounce$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodash_debounce);
function useDebouncedCallback(callback, debounceMs) {
var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
var {
leading = false,
trailing = true,
maxWait
} = options;
var debouncedCallback = React.useMemo(() => debounce$1(callback, debounceMs, maxWait != null ? (
// lodash checks `'maxWait' in options`
// and lower clamps to the debounce if it exists at all
{
leading,
trailing,
maxWait
}
) : {
leading,
trailing
}), [callback, debounceMs, leading, trailing, maxWait]);
React.useEffect(() => () => debouncedCallback.cancel(), [debouncedCallback]);
return debouncedCallback;
}
function usePrevious(value2) {
var ref = React.useRef();
React.useEffect(function getPrev() {
ref.current = value2;
});
return ref.current;
}
function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info2 = gen[key](arg);
var value2 = info2.value;
} catch (error) {
reject(error);
return;
}
if (info2.done) {
resolve(value2);
} else {
Promise.resolve(value2).then(_next, _throw);
}
}
function _asyncToGenerator$1(fn) {
return function() {
var self3 = this, args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self3, args);
function _next(value2) {
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value2);
}
function _throw(err) {
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(void 0);
});
};
}
function usePromiseFactory(promiseFactory) {
var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : EMPTY_ARRAY$2;
var {
autoLoad = true
} = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
var [data2, setData] = React.useState(null);
var [error, setError] = React.useState(null);
var [isLoading, setIsLoading] = React.useState(false);
var loadPromise = React.useCallback(/* @__PURE__ */ _asyncToGenerator$1(function* () {
setIsLoading(true);
try {
var resolved = yield promiseFactory(...args);
setData(resolved);
setError(null);
} catch (err) {
setData(null);
setError(err);
} finally {
setIsLoading(false);
}
}), [promiseFactory, ...args]);
React.useEffect(() => {
if (autoLoad) {
loadPromise();
}
}, [autoLoad, loadPromise]);
return {
data: data2,
error,
isError: error != null,
isLoading,
reload: loadPromise
};
}
const styles$3 = '/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n/* stylelint-disable-next-line number-max-precision */\n.ui-portal-panel {\n height: 100%;\n width: 100%;\n position: relative;\n overflow: hidden;\n}\n.ui-table-container {\n height: 100%;\n width: 100%;\n position: relative;\n}\n.dh-react-panel {\n display: grid;\n}\n.dh-react-panel .dh-inner-react-panel {\n min-width: 0;\n}\n.dh-react-panel .dh-inner-react-panel > .dh-flex,\n.dh-react-panel .dh-inner-react-panel > .dh-grid {\n align-self: stretch;\n}\n.dh-react-panel .dh-inner-react-panel .dh-tabs {\n flex: auto;\n height: 100%;\n}\n.dh-react-panel .dh-inner-react-panel .iris-grid {\n min-height: 70px;\n border: 1px solid var(--dh-color-bg);\n border-radius: 4px;\n}\n.dh-react-panel .dh-inner-react-panel .iris-grid canvas {\n position: absolute;\n}\n.dh-react-panel:has(.dh-inner-react-panel > .iris-grid:only-child), .dh-react-panel:has(.dh-inner-react-panel > .ui-table-container:only-child > .iris-grid:only-child), .dh-react-panel:has(.dh-inner-react-panel > .chart-wrapper:only-child) {\n padding: 0 !important;\n}\n.dh-react-panel:has(.dh-inner-react-panel > .iris-grid:only-child) .iris-grid, .dh-react-panel:has(.dh-inner-react-panel > .ui-table-container:only-child > .iris-grid:only-child) .iris-grid, .dh-react-panel:has(.dh-inner-react-panel > .chart-wrapper:only-child) .iris-grid {\n border: none;\n border-radius: 0;\n}\n.ui-text-wrap-balance {\n text-wrap: balance;\n}\n.ui-monospace-text {\n font-family: "Fira Mono", menlo, monaco, consolas, "Liberation Mono", "Courier New", monospace;\n white-space: pre;\n}\n.ui-widget-error-view {\n overflow: hidden;\n width: 100%;\n}\n.ui-widget-error-contextual-help section[class*=spectrum-ContextualHelp-dialog] {\n width: fit-content;\n}\n.ui-markdown {\n padding: 0;\n}';
const TRACK_MEMO_SYMBOL = Symbol();
const GET_ORIGINAL_SYMBOL = Symbol();
const AFFECTED_PROPERTY$1 = "a";
const IS_TARGET_COPIED_PROPERTY = "f";
const PROXY_PROPERTY = "p";
const PROXY_CACHE_PROPERTY = "c";
const TARGET_CACHE_PROPERTY = "t";
const HAS_KEY_PROPERTY$1 = "h";
const ALL_OWN_KEYS_PROPERTY$1 = "w";
const HAS_OWN_KEY_PROPERTY$1 = "o";
const KEYS_PROPERTY$1 = "k";
let newProxy = (target, handler) => new Proxy(target, handler);
const getProto = Object.getPrototypeOf;
const objectsToTrack = /* @__PURE__ */ new WeakMap();
const isObjectToTrack = (obj) => obj && (objectsToTrack.has(obj) ? objectsToTrack.get(obj) : getProto(obj) === Object.prototype || getProto(obj) === Array.prototype);
const isObject$4 = (x2) => typeof x2 === "object" && x2 !== null;
const needsToCopyTargetObject = (obj) => Object.values(Object.getOwnPropertyDescriptors(obj)).some((descriptor) => !descriptor.configurable && !descriptor.writable);
const copyTargetObject = (obj) => {
if (Array.isArray(obj)) {
return Array.from(obj);
}
const descriptors = Object.getOwnPropertyDescriptors(obj);
Object.values(descriptors).forEach((desc2) => {
desc2.configurable = true;
});
return Object.create(getProto(obj), descriptors);
};
const createProxyHandler = (origObj, isTargetCopied) => {
const state = {
[IS_TARGET_COPIED_PROPERTY]: isTargetCopied
};
let trackObject = false;
const recordUsage = (type, key) => {
if (!trackObject) {
let used = state[AFFECTED_PROPERTY$1].get(origObj);
if (!used) {
used = {};
state[AFFECTED_PROPERTY$1].set(origObj, used);
}
if (type === ALL_OWN_KEYS_PROPERTY$1) {
used[ALL_OWN_KEYS_PROPERTY$1] = true;
} else {
let set = used[type];
if (!set) {
set = /* @__PURE__ */ new Set();
used[type] = set;
}
set.add(key);
}
}
};
const recordObjectAsUsed = () => {
trackObject = true;
state[AFFECTED_PROPERTY$1].delete(origObj);
};
const handler = {
get(target, key) {
if (key === GET_ORIGINAL_SYMBOL) {
return origObj;
}
recordUsage(KEYS_PROPERTY$1, key);
return createProxy(Reflect.get(target, key), state[AFFECTED_PROPERTY$1], state[PROXY_CACHE_PROPERTY], state[TARGET_CACHE_PROPERTY]);
},
has(target, key) {
if (key === TRACK_MEMO_SYMBOL) {
recordObjectAsUsed();
return true;
}
recordUsage(HAS_KEY_PROPERTY$1, key);
return Reflect.has(target, key);
},
getOwnPropertyDescriptor(target, key) {
recordUsage(HAS_OWN_KEY_PROPERTY$1, key);
return Reflect.getOwnPropertyDescriptor(target, key);
},
ownKeys(target) {
recordUsage(ALL_OWN_KEYS_PROPERTY$1);
return Reflect.ownKeys(target);
}
};
if (isTargetCopied) {
handler.set = handler.deleteProperty = () => false;
}
return [handler, state];
};
const getOriginalObject = (obj) => (
// unwrap proxy
obj[GET_ORIGINAL_SYMBOL] || // otherwise
obj
);
const createProxy = (obj, affected, proxyCache, targetCache2) => {
if (!isObjectToTrack(obj))
return obj;
let targetAndCopied = targetCache2 && targetCache2.get(obj);
if (!targetAndCopied) {
const target2 = getOriginalObject(obj);
if (needsToCopyTargetObject(target2)) {
targetAndCopied = [target2, copyTargetObject(target2)];
} else {
targetAndCopied = [target2];
}
targetCache2 === null || targetCache2 === void 0 ? void 0 : targetCache2.set(obj, targetAndCopied);
}
const [target, copiedTarget] = targetAndCopied;
let handlerAndState = proxyCache && proxyCache.get(target);
if (!handlerAndState || handlerAndState[1][IS_TARGET_COPIED_PROPERTY] !== !!copiedTarget) {
handlerAndState = createProxyHandler(target, !!copiedTarget);
handlerAndState[1][PROXY_PROPERTY] = newProxy(copiedTarget || target, handlerAndState[0]);
if (proxyCache) {
proxyCache.set(target, handlerAndState);
}
}
handlerAndState[1][AFFECTED_PROPERTY$1] = affected;
handlerAndState[1][PROXY_CACHE_PROPERTY] = proxyCache;
handlerAndState[1][TARGET_CACHE_PROPERTY] = targetCache2;
return handlerAndState[1][PROXY_PROPERTY];
};
const isAllOwnKeysChanged = (prevObj, nextObj) => {
const prevKeys = Reflect.ownKeys(prevObj);
const nextKeys = Reflect.ownKeys(nextObj);
return prevKeys.length !== nextKeys.length || prevKeys.some((k2, i) => k2 !== nextKeys[i]);
};
const isChanged = (prevObj, nextObj, affected, cache2, isEqual2 = Object.is) => {
if (isEqual2(prevObj, nextObj)) {
return false;
}
if (!isObject$4(prevObj) || !isObject$4(nextObj))
return true;
const used = affected.get(getOriginalObject(prevObj));
if (!used)
return true;
if (cache2) {
const hit = cache2.get(prevObj);
if (hit === nextObj) {
return false;
}
cache2.set(prevObj, nextObj);
}
let changed = null;
for (const key of used[HAS_KEY_PROPERTY$1] || []) {
changed = Reflect.has(prevObj, key) !== Reflect.has(nextObj, key);
if (changed)
return changed;
}
if (used[ALL_OWN_KEYS_PROPERTY$1] === true) {
changed = isAllOwnKeysChanged(prevObj, nextObj);
if (changed)
return changed;
} else {
for (const key of used[HAS_OWN_KEY_PROPERTY$1] || []) {
const hasPrev = !!Reflect.getOwnPropertyDescriptor(prevObj, key);
const hasNext = !!Reflect.getOwnPropertyDescriptor(nextObj, key);
changed = hasPrev !== hasNext;
if (changed)
return changed;
}
}
for (const key of used[KEYS_PROPERTY$1] || []) {
changed = isChanged(prevObj[key], nextObj[key], affected, cache2, isEqual2);
if (changed)
return changed;
}
if (changed === null)
throw new Error("invalid used");
return changed;
};
const trackMemo = (obj) => {
if (isObjectToTrack(obj)) {
return TRACK_MEMO_SYMBOL in obj;
}
return false;
};
const getUntracked = (obj) => {
if (isObjectToTrack(obj)) {
return obj[GET_ORIGINAL_SYMBOL] || null;
}
return null;
};
const targetCache = /* @__PURE__ */ new WeakMap();
const HAS_KEY_PROPERTY = "h";
const ALL_OWN_KEYS_PROPERTY = "w";
const HAS_OWN_KEY_PROPERTY = "o";
const KEYS_PROPERTY = "k";
const trackMemoUntrackedObjSet = /* @__PURE__ */ new WeakSet();
const isObject$3 = (x2) => typeof x2 === "object" && x2 !== null;
const untrack = (x2, seen) => {
if (!isObject$3(x2))
return x2;
const untrackedObj = getUntracked(x2);
if (untrackedObj) {
trackMemo(x2);
trackMemoUntrackedObjSet.add(untrackedObj);
return untrackedObj;
}
if (!seen.has(x2)) {
seen.add(x2);
Object.entries(x2).forEach(([k2, v2]) => {
const vv = untrack(v2, seen);
if (!Object.is(vv, v2))
x2[k2] = vv;
});
}
return x2;
};
const touchAffected = (dst, src, affected) => {
var _a2, _b, _c;
if (!isObject$3(dst) || !isObject$3(src))
return;
const untrackedObj = getUntracked(src);
const used = affected.get(untrackedObj || src);
if (!used) {
if (trackMemoUntrackedObjSet.has(untrackedObj)) {
trackMemo(dst);
}
return;
}
(_a2 = used[HAS_KEY_PROPERTY]) === null || _a2 === void 0 ? void 0 : _a2.forEach((key) => {
Reflect.has(dst, key);
});
if (used[ALL_OWN_KEYS_PROPERTY] === true) {
Reflect.ownKeys(dst);
}
(_b = used[HAS_OWN_KEY_PROPERTY]) === null || _b === void 0 ? void 0 : _b.forEach((key) => {
Reflect.getOwnPropertyDescriptor(dst, key);
});
(_c = used[KEYS_PROPERTY]) === null || _c === void 0 ? void 0 : _c.forEach((key) => {
touchAffected(dst[key], src[key], affected);
});
};
const isOriginalEqual = (x2, y) => {
for (let xx = x2; xx; x2 = xx, xx = getUntracked(xx))
;
for (let yy = y; yy; y = yy, yy = getUntracked(yy))
;
return Object.is(x2, y);
};
const OBJ_PROPERTY = "o";
const RESULT_PROPERTY = "r";
const AFFECTED_PROPERTY = "a";
function memoize(fn, options) {
var _a2;
let memoListHead = 0;
const size = (_a2 = void 0) !== null && _a2 !== void 0 ? _a2 : 1;
const memoList = [];
const resultCache = (options === null || options === void 0 ? void 0 : options.noWeakMap) ? null : /* @__PURE__ */ new WeakMap();
const memoizedFn = (obj) => {
const cache2 = resultCache === null || resultCache === void 0 ? void 0 : resultCache.get(obj);
if (cache2) {
return cache2;
}
for (let i = 0; i < size; i += 1) {
const memo = memoList[(memoListHead + i) % size];
if (!memo)
break;
const { [OBJ_PROPERTY]: memoObj, [AFFECTED_PROPERTY]: memoAffected, [RESULT_PROPERTY]: memoResult } = memo;
if (!isChanged(memoObj, obj, memoAffected, /* @__PURE__ */ new WeakMap(), isOriginalEqual)) {
touchAffected(obj, memoObj, memoAffected);
resultCache === null || resultCache === void 0 ? void 0 : resultCache.set(obj, memoResult);
return memoResult;
}
}
const affected = /* @__PURE__ */ new WeakMap();
const proxy = createProxy(obj, affected, void 0, targetCache);
const result = untrack(fn(proxy), /* @__PURE__ */ new WeakSet());
touchAffected(obj, obj, affected);
const entry = {
[OBJ_PROPERTY]: obj,
[RESULT_PROPERTY]: result,
[AFFECTED_PROPERTY]: affected
};
memoListHead = (memoListHead - 1 + size) % size;
memoList[memoListHead] = entry;
resultCache === null || resultCache === void 0 ? void 0 : resultCache.set(obj, result);
return result;
};
return memoizedFn;
}
function ownKeys$5(object, enumerableOnly) {
var keys2 = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
enumerableOnly && (symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
})), keys2.push.apply(keys2, symbols);
}
return keys2;
}
function _objectSpread$3(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys$5(Object(source), true).forEach(function(key) {
_defineProperty$n(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
function _defineProperty$n(obj, key, value2) {
key = _toPropertyKey$m(key);
if (key in obj) {
Object.defineProperty(obj, key, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value2;
}
return obj;
}
function _toPropertyKey$m(arg) {
var key = _toPrimitive$m(arg, "string");
return typeof key === "symbol" ? key : String(key);
}
function _toPrimitive$m(input2, hint) {
if (typeof input2 !== "object" || input2 === null) return input2;
var prim = input2[Symbol.toPrimitive];
if (prim !== void 0) {
var res2 = prim.call(input2, hint);
if (typeof res2 !== "object") return res2;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input2);
}
var getDefaultWorkspaceSettings = (store) => store.defaultWorkspaceSettings;
var getWorkspace = (store) => {
var {
workspace
} = store;
return workspace;
};
var getSettings = memoize((store) => {
var _getWorkspace$data$se, _getWorkspace;
var customizedSettings = (_getWorkspace$data$se = (_getWorkspace = getWorkspace(store)) === null || _getWorkspace === void 0 ? void 0 : _getWorkspace.data.settings) !== null && _getWorkspace$data$se !== void 0 ? _getWorkspace$data$se : {};
var settings = _objectSpread$3({}, getDefaultWorkspaceSettings(store));
var keys2 = Object.keys(customizedSettings);
for (var i = 0; i < keys2.length; i += 1) {
var key = keys2[i];
if (customizedSettings[key] !== void 0) {
settings[key] = customizedSettings[key];
}
}
return settings;
});
var SET_WORKSPACE = "SET_WORKSPACE";
var setWorkspace = (workspace) => ({
type: SET_WORKSPACE,
payload: workspace
});
var EMPTY_ARRAY$1 = Object.freeze([]);
var EMPTY_FUNCTION$5 = () => void 0;
function ensureArray(value2) {
return Array.isArray(value2) ? value2 : [value2];
}
function assertNotNull$1(value2) {
var message = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "Value is null or undefined";
if (value2 == null) throw new Error(message);
}
var classnames = { exports: {} };
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
(function(module2) {
(function() {
var hasOwn2 = {}.hasOwnProperty;
function classNames2() {
var classes = "";
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (arg) {
classes = appendClass(classes, parseValue(arg));
}
}
return classes;
}
function parseValue(arg) {
if (typeof arg === "string" || typeof arg === "number") {
return arg;
}
if (typeof arg !== "object") {
return "";
}
if (Array.isArray(arg)) {
return classNames2.apply(null, arg);
}
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
return arg.toString();
}
var classes = "";
for (var key in arg) {
if (hasOwn2.call(arg, key) && arg[key]) {
classes = appendClass(classes, key);
}
}
return classes;
}
function appendClass(value2, newClass) {
if (!newClass) {
return value2;
}
if (value2) {
return value2 + " " + newClass;
}
return value2 + newClass;
}
if (module2.exports) {
classNames2.default = classNames2;
module2.exports = classNames2;
} else {
window.classNames = classNames2;
}
})();
})(classnames);
var classnamesExports = classnames.exports;
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
var safeIsNaN = Number.isNaN || function ponyfill(value2) {
return typeof value2 === "number" && value2 !== value2;
};
function isEqual(first, second) {
if (first === second) {
return true;
}
if (safeIsNaN(first) && safeIsNaN(second)) {
return true;
}
return false;
}
function areInputsEqual(newInputs, lastInputs) {
if (newInputs.length !== lastInputs.length) {
return false;
}
for (var i = 0; i < newInputs.length; i++) {
if (!isEqual(newInputs[i], lastInputs[i])) {
return false;
}
}
return true;
}
function memoizeOne(resultFn, isEqual2) {
if (isEqual2 === void 0) {
isEqual2 = areInputsEqual;
}
var lastThis;
var lastArgs = [];
var lastResult;
var calledOnce = false;
function memoized() {
var newArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
newArgs[_i] = arguments[_i];
}
if (calledOnce && lastThis === this && isEqual2(newArgs, lastArgs)) {
return lastResult;
}
lastResult = resultFn.apply(this, newArgs);
calledOnce = true;
lastThis = this;
lastArgs = newArgs;
return lastResult;
}
return memoized;
}
function _defineProperty$m(obj, key, value2) {
key = _toPropertyKey$l(key);
if (key in obj) {
Object.defineProperty(obj, key, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value2;
}
return obj;
}
function _toPropertyKey$l(arg) {
var key = _toPrimitive$l(arg, "string");
return typeof key === "symbol" ? key : String(key);
}
function _toPrimitive$l(input2, hint) {
if (typeof input2 !== "object" || input2 === null) return input2;
var prim = input2[Symbol.toPrimitive];
if (prim !== void 0) {
var res2 = prim.call(input2, hint);
if (typeof res2 !== "object") return res2;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input2);
}
class ConsoleEvent {
}
_defineProperty$m(ConsoleEvent, "SESSION_OPENED", "ConsoleEvent.SESSION_OPENED");
_defineProperty$m(ConsoleEvent, "SESSION_CLOSED", "ConsoleEvent.SESSION_CLOSED");
_defineProperty$m(ConsoleEvent, "FOCUS_HISTORY", "ConsoleEvent.FOCUS_HISTORY");
_defineProperty$m(ConsoleEvent, "SEND_COMMAND", "ConsoleEvent.SEND_COMMAND");
_defineProperty$m(ConsoleEvent, "SETTINGS_CHANGED", "ConsoleEvent.SETTINGS_CHANGED");
function _defineProperty$l(obj, key, value2) {
key = _toPropertyKey$k(key);
if (key in obj) {
Object.defineProperty(obj, key, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value2;
}
return obj;
}
function _toPropertyKey$k(arg) {
var key = _toPrimitive$k(arg, "string");
return typeof key === "symbol" ? key : String(key);
}
function _toPrimitive$k(input2, hint) {
if (typeof input2 !== "object" || input2 === null) return input2;
var prim = input2[Symbol.toPrimitive];
if (prim !== void 0) {
var res2 = prim.call(input2, hint);
if (typeof res2 !== "object") return res2;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input2);
}
class InputFilterEvent {
}
_defineProperty$l(InputFilterEvent, "TABLE_CHANGED", "InputFilterEvent.TABLE_CHANGED");
_defineProperty$l(InputFilterEvent, "COLUMNS_CHANGED", "InputFilterEvent.COLUMNS_CHANGED");
_defineProperty$l(InputFilterEvent, "FILTERS_CHANGED", "InputFilterEvent.FILTERS_CHANGED");
_defineProperty$l(InputFilterEvent, "CLEAR_ALL_FILTERS", "InputFilterEvent.CLEAR_ALL_FILTERS");
_defineProperty$l(InputFilterEvent, "COLUMN_SELECTED", "InputFilterEvent.COLUMN_SELECTED");
_defineProperty$l(InputFilterEvent, "OPEN_DROPDOWN", "InputFilterEvent.OPEN_DROPDOWN");
_defineProperty$l(InputFilterEvent, "OPEN_INPUT", "InputFilterEvent.OPEN_INPUT");
_defineProperty$l(InputFilterEvent, "OPEN_FILTER_SET_MANAGER", "InputFilterEvent.OPEN_FILTER_SET_MANAGER");
var TabEvent = Object.freeze({
focus: "TabEvent.focus",
blur: "TabEvent.blur"
});
function _defineProperty$k(obj, key, value2) {
key = _toPropertyKey$j(key);
if (key in obj) {
Object.defineProperty(obj, key, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value2;
}
return obj;
}
function _toPropertyKey$j(arg) {
var key = _toPrimitive$j(arg, "string");
return typeof key === "symbol" ? key : String(key);
}
function _toPrimitive$j(input2, hint) {
if (typeof input2 !== "object" || input2 === null) return input2;
var prim = input2[Symbol.toPrimitive];
if (prim !== void 0) {
var res2 = prim.call(input2, hint);
if (typeof res2 !== "object") return res2;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input2);
}
class PanelContextMenu extends React.PureComponent {
constructor(props) {
super(props);
this.handleCloseTab = this.handleCloseTab.bind(this);
this.handleCloseTabsRight = this.handleCloseTabsRight.bind(this);
this.handleCloseTabsAll = this.handleCloseTabsAll.bind(this);
this.handleReopenLast = this.handleReopenLast.bind(this);
}
getAllTabs() {
var _glContainer$tab$head, _glContainer$tab, _glContainer$tab$head2;
var {
glContainer
} = this.props;
return [...(_glContainer$tab$head = glContainer === null || glContainer === void 0 ? void 0 : (_glContainer$tab = glContainer.tab) === null || _glContainer$tab === void 0 ? void 0 : (_glContainer$tab$head2 = _glContainer$tab.header) === null || _glContainer$tab$head2 === void 0 ? void 0 : _glContainer$tab$head2.tabs) !== null && _glContainer$tab$head !== void 0 ? _glContainer$tab$head : []];
}
handleCloseTab() {
var {
glContainer
} = this.props;
glContainer.close();
}
handleCloseTabsAll() {
var tabs = this.getAllTabs();
tabs.forEach((tab2) => {
var _container;
return (_container = (tab2 === null || tab2 === void 0 ? void 0 : tab2.contentItem).container) === null || _container === void 0 ? void 0 : _container.close();
});
}
handleCloseTabsRight() {
var {
glContainer
} = this.props;
var tabs = this.getAllTabs();
for (var i = tabs.length - 1; i > 0; i -= 1) {
var _tabs$i$contentItem, _tabs$i$contentItem$c, _glContainer$tab2, _glContainer$tab2$con, _glContainer$tab2$con2, _container2, _tabs$i;
if (((_tabs$i$contentItem = tabs[i].contentItem) === null || _tabs$i$contentItem === void 0 ? void 0 : (_tabs$i$contentItem$c = _tabs$i$contentItem.config) === null || _tabs$i$contentItem$c === void 0 ? void 0 : _tabs$i$contentItem$c.id) === ((_glContainer$tab2 = glContainer.tab) === null || _glContainer$tab2 === void 0 ? void 0 : (_glContainer$tab2$con = _glContainer$tab2.contentItem) === null || _glContainer$tab2$con === void 0 ? void 0 : (_glContainer$tab2$con2 = _glContainer$tab2$con.config) === null || _glContainer$tab2$con2 === void 0 ? void 0 : _glContainer$tab2$con2.id)) {
break;
}
(_container2 = ((_tabs$i = tabs[i]) === null || _tabs$i === void 0 ? void 0 : _tabs$i.contentItem).container) === null || _container2 === void 0 ? void 0 : _container2.close();
}
}
handleReopenLast() {
var {
glContainer,
glEventHub
} = this.props;
glEventHub.emit(dashboard.PanelEvent.REOPEN_LAST, glContainer);
}
canCloseTabsRight() {
var {
glContainer
} = this.props;
var tabs = this.getAllTabs();
var disabled2 = true;
for (var i = tabs.length - 1; i > 0; i -= 1) {
var _tabs$i$contentItem2, _tabs$i$contentItem2$, _glContainer$tab3, _glContainer$tab3$con, _glContainer$tab3$con2, _tabs$i2, _tabs$i2$contentItem, _tabs$i2$contentItem$;
if (((_tabs$i$contentItem2 = tabs[i].contentItem) === null || _tabs$i$contentItem2 === void 0 ? void 0 : (_tabs$i$contentItem2$ = _tabs$i$contentItem2.config) === null || _tabs$i$contentItem2$ === void 0 ? void 0 : _tabs$i$contentItem2$.id) === ((_glContainer$tab3 = glContainer.tab) === null || _glContainer$tab3 === void 0 ? void 0 : (_glContainer$tab3$con = _glContainer$tab3.contentItem) === null || _glContainer$tab3$con === void 0 ? void 0 : (_glContainer$tab3$con2 = _glContainer$tab3$con.config) === null || _glContainer$tab3$con2 === void 0 ? void 0 : _glContainer$tab3$con2.id)) {
break;
}
var closable = Boolean((_tabs$i2 = tabs[i]) === null || _tabs$i2 === void 0 ? void 0 : (_tabs$i2$contentItem = _tabs$i2.contentItem) === null || _tabs$i2$contentItem === void 0 ? void 0 : (_tabs$i2$contentItem$ = _tabs$i2$contentItem.config) === null || _tabs$i2$contentItem$ === void 0 ? void 0 : _tabs$i2$contentItem$.isClosable);
if (closable) {
disabled2 = false;
break;
}
}
return disabled2;
}
canCloseAny() {
var tabs = this.getAllTabs();
var disabled2 = true;
for (var i = tabs.length - 1; i > 0; i -= 1) {
var _tabs$i3, _tabs$i3$contentItem, _tabs$i3$contentItem$;
var closable = Boolean((_tabs$i3 = tabs[i]) === null || _tabs$i3 === void 0 ? void 0 : (_tabs$i3$contentItem = _tabs$i3.contentItem) === null || _tabs$i3$contentItem === void 0 ? void 0 : (_tabs$i3$contentItem$ = _tabs$i3$contentItem.config) === null || _tabs$i3$contentItem$ === void 0 ? void 0 : _tabs$i3$contentItem$.isClosable);
if (closable) {
disabled2 = false;
break;
}
}
return disabled2;
}
canReopenLast() {
var _LayoutUtils$getStack, _workspace$data$close;
var {
workspace,
glContainer
} = this.props;
var stackId = (_LayoutUtils$getStack = dashboard.LayoutUtils.getStackForConfig(glContainer.layoutManager.root, glContainer.getConfig())) === null || _LayoutUtils$getStack === void 0 ? void 0 : _LayoutUtils$getStack.config.id;
return !((_workspace$data$close = workspace.data.closed) !== null && _workspace$data$close !== void 0 && _workspace$data$close.some((panel) => panel.parentStackId === stackId));
}
render() {
var _glContainer$tab4, _glContainer$tab4$con, _glContainer$tab4$con2;
var {
additionalActions,
glContainer
} = this.props;
var contextActions = [...additionalActions];
contextActions.push(() => ({
title: "Re-open closed panel",
group: components.ContextActions.groups.medium + 2004,
action: this.handleReopenLast,
disabled: this.canReopenLast()
}));
var closable = (_glContainer$tab4 = glContainer.tab) === null || _glContainer$tab4 === void 0 ? void 0 : (_glContainer$tab4$con = _glContainer$tab4.contentItem) === null || _glContainer$tab4$con === void 0 ? void 0 : (_glContainer$tab4$con2 = _glContainer$tab4$con.config) === null || _glContainer$tab4$con2 === void 0 ? void 0 : _glContainer$tab4$con2.isClosable;
contextActions.push({
title: "Close",
order: 10,
group: components.ContextActions.groups.low,
action: this.handleCloseTab,
disabled: closable === void 0 || !closable
});
contextActions.push(() => ({
title: "Close Tabs to Right",
order: 20,
group: components.ContextActions.groups.low,
action: this.handleCloseTabsRight,
disabled: this.canCloseTabsRight()
}));
contextActions.push(() => ({
title: "Close All",
order: 30,
group: components.ContextActions.groups.low,
action: this.handleCloseTabsAll,
disabled: this.canCloseAny()
}));
return /* @__PURE__ */ jsxRuntimeExports.jsx(components.ContextActions, {
actions: contextActions
});
}
}
_defineProperty$k(PanelContextMenu, "defaultProps", {
additionalActions: []
});
var mapStateToProps = (state) => ({
workspace: getWorkspace(state)
});
var ConnectedPanelContextMenu = reactRedux.connect(mapStateToProps, {
setWorkspace
})(PanelContextMenu);
function _defineProperty$j(obj, key, value2) {
key = _toPropertyKey$i(key);
if (key in obj) {
Object.defineProperty(obj, key, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value2;
}
return obj;
}
function _toPropertyKey$i(arg) {
var key = _toPrimitive$i(arg, "string");
return typeof key === "symbol" ? key : String(key);
}
function _toPrimitive$i(input2, hint) {
if (typeof input2 !== "object" || input2 === null) return input2;
var prim = input2[Symbol.toPrimitive];
if (prim !== void 0) {
var res2 = prim.call(input2, hint);
if (typeof res2 !== "object") return res2;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input2);
}
class RenameDialog extends React.PureComponent {
constructor(props) {
super(props);
_defineProperty$j(this, "renameInputRef", void 0);
this.handleRenameDialogOpened = this.handleRenameDialogOpened.bind(this);
this.handleRenameInputChange = this.handleRenameInputChange.bind(this);
this.handleRenameCancel = this.handleRenameCancel.bind(this);
this.handleRenameSubmit = this.handleRenameSubmit.bind(this);
this.renameInputRef = /* @__PURE__ */ React.createRef();
var {
value: value2
} = props;
this.state = {
value: value2,
valueWasValidated: false
};
}
componentDidUpdate(prevProps) {
var {
isShown: prevIsShown
} = prevProps;
var {
isShown
} = this.props;
if (isShown && !prevIsShown) {
this.resetState();
}
}
resetState() {
var {
value: value2
} = this.props;
this.setState({
value: value2,
valueWasValidated: false
});
}
handleRenameDialogOpened() {
var _this$renameInputRef, _this$renameInputRef$;
(_this$renameInputRef = this.renameInputRef) === null || _this$renameInputRef === void 0 ? void 0 : (_this$renameInputRef$ = _this$renameInputRef.current) === null || _this$renameInputRef$ === void 0 ? void 0 : _this$renameInputRef$.focus();
}
handleRenameInputChange(event) {
this.setState({
value: event.target.value
});
}
handleRenameCancel() {
var {
onCancel
} = this.props;
onCancel();
}
handleRenameSubmit(event) {
event.stopPropagation();
event.preventDefault();
var {
value: value2
} = this.state;
var newTitle = value2 === null || value2 === void 0 ? void 0 : value2.trim();
if (newTitle !== void 0 && newTitle !== "") {
var {
onSubmit
} = this.props;
onSubmit(newTitle);
} else {
this.setState({
value: newTitle,
valueWasValidated: true
});
}
}
renderRenameDialog() {
var {
isShared,
isOwner,
itemType
} = this.props;
var {
value: value2,
valueWasValidated
} = this.state;
return /* @__PURE__ */ jsxRuntimeExports.jsxs("form", {
className: classNames("p-3", {
"was-validated": valueWasValidated
}),
onSubmit: this.handleRenameSubmit,
noValidate: true,
role: "presentation",
onMouseDown: (event) => {
event.stopPropagation();
},
onMouseUp: (event) => {
event.stopPropagation();
},
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
className: "form-group",
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("label", {
htmlFor: "rename-dialog-".concat(itemType, "-input"),
children: ["Rename ", itemType]
}), /* @__PURE__ */ jsxRuntimeExports.jsx("input", {
type: "text",
className: "form-control",
id: "rename-dialog-".concat(itemType, "-input"),
value: value2 !== null && value2 !== void 0 ? value2 : void 0,
ref: this.renameInputRef,
onChange: this.handleRenameInputChange,
required: true
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
className: "invalid-feedback",
children: [itemType, " name cannot be empty"]
}), (isShared || !isOwner) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
className: "pt-2",
children: ["Renaming this ", itemType, " will rename for all users."]
})]
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
className: "text-right",
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(components.Button, {
kind: "secondary",
className: "mr-2",
onClick: this.handleRenameCancel,
children: "Cancel"
}), /* @__PURE__ */ jsxRuntimeExports.jsx(components.Button, {
kind: "primary",
type: "submit",
children: "Rename"
})]
})]
});
}
render() {
var {
isShown,
onCancel
} = this.props;
return /* @__PURE__ */ jsxRuntimeExports.jsx(components.Popper, {
isShown,
onEntered: this.handleRenameDialogOpened,
onExited: onCancel,
options: {
placement: "bottom"
},
interactive: true,
closeOnBlur: true,
children: this.renderRenameDialog()
});
}
}
_defineProperty$j(RenameDialog, "defaultProps", {
isShared: false,
isOwner: true,
itemType: "Item",
value: ""
});
function _defineProperty$i(obj, key, value2) {
key = _toPropertyKey$h(key);
if (key in obj) {
Object.defineProperty(obj, key, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value2;
}
return obj;
}
function _toPropertyKey$h(arg) {
var key = _toPrimitive$h(arg, "string");
return typeof key === "symbol" ? key : String(key);
}
function _toPrimitive$h(input2, hint) {
if (typeof input2 !== "object" || input2 === null) return input2;
var prim = input2[Symbol.toPrimitive];
if (prim !== void 0) {
var res2 = prim.call(input2, hint);
if (typeof res2 !== "object") return res2;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input2);
}
var log$b = Log.module("Panel");
class Panel extends React.PureComponent {
constructor(props) {
super(props);
_defineProperty$i(this, "ref", void 0);
_defineProperty$i(this, "getAdditionalActions", memoizeOne((actions, isClonable, isRenamable) => {
var additionalActions = [];
if (isClonable) {
additionalActions.push(this.getCloneAction());
}
if (isRenamable) {
additionalActions.push(this.getRenameAction());
}
return [...additionalActions, ...actions];
}));
this.handleClearAllFilters = this.handleClearAllFilters.bind(this);
this.handleCopyPanel = this.handleCopyPanel.bind(this);
this.handleFocus = this.handleFocus.bind(this);
this.handleBlur = this.handleBlur.bind(this);
this.handleHide = this.handleHide.bind(this);
this.handleResize = this.handleResize.bind(this);
this.handleSessionClosed = this.handleSessionClosed.bind(this);
this.handleSessionOpened = this.handleSessionOpened.bind(this);
this.handleBeforeShow = this.handleBeforeShow.bind(this);
this.handleShow = this.handleShow.bind(this);
this.handleTabBlur = this.handleTabBlur.bind(this);
this.handleTabFocus = this.handleTabFocus.bind(this);
this.handleRenameCancel = this.handleRenameCancel.bind(this);
this.handleRenameSubmit = this.handleRenameSubmit.bind(this);
this.handleShowRenameDialog = this.handleShowRenameDialog.bind(this);
this.handleTabClicked = this.handleTabClicked.bind(this);
this.handleTab = this.handleTab.bind(this);
this.ref = /* @__PURE__ */ React.createRef();
var {
glContainer
} = this.props;
this.state = {
title: dashboard.LayoutUtils.getTitleFromContainer(glContainer),
showRenameDialog: false,
isWithinPanel: true
};
}
componentDidMount() {
var _this$ref$current, _this$ref$current$par;
var {
componentPanel,
glContainer,
glEventHub
} = this.props;
glContainer.on("resize", this.handleResize);
glContainer.on("show", this.handleBeforeShow);
glContainer.on("shown", this.handleShow);
glContainer.on("hide", this.handleHide);
glContainer.on("tab", this.handleTab);
glContainer.on("tabClicked", this.handleTabClicked);
glEventHub.on(ConsoleEvent.SESSION_CLOSED, this.handleSessionClosed);
glEventHub.on(ConsoleEvent.SESSION_OPENED, this.handleSessionOpened);
glEventHub.on(TabEvent.focus, this.handleTabFocus);
glEventHub.on(TabEvent.blur, this.handleTabBlur);
glEventHub.on(InputFilterEvent.CLEAR_ALL_FILTERS, this.handleClearAllFilters);
glEventHub.emit(dashboard.PanelEvent.MOUNT, componentPanel !== null && componentPanel !== void 0 ? componentPanel : this);
this.setState({
isWithinPanel