@superblocksteam/library 2.0.6-next.32 → 2.0.6-next.34
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/{allPaths-xFVQQD0y.js → allPaths-BhIhuhyr.js} +2 -2
- package/dist/{allPaths-xFVQQD0y.js.map → allPaths-BhIhuhyr.js.map} +1 -1
- package/dist/{allPaths-x2mqpZFN.js → allPaths-C-GS61ep.js} +2 -2
- package/dist/{allPaths-x2mqpZFN.js.map → allPaths-C-GS61ep.js.map} +1 -1
- package/dist/{allPathsLoader-BRtFt6t5.js → allPathsLoader-okzKZ8ZK.js} +3 -3
- package/dist/{allPathsLoader-BcutVQcb.js.map → allPathsLoader-okzKZ8ZK.js.map} +1 -1
- package/dist/{allPathsLoader-BcutVQcb.js → allPathsLoader-yqClhllT.js} +3 -3
- package/dist/{allPathsLoader-BRtFt6t5.js.map → allPathsLoader-yqClhllT.js.map} +1 -1
- package/dist/{devtools-consolidated-Bx5_5I-I.js → devtools-consolidated-BQ5Eme4s.js} +2 -2
- package/dist/{devtools-consolidated-Bx5_5I-I.js.map → devtools-consolidated-BQ5Eme4s.js.map} +1 -1
- package/dist/{icons-NrNO8p_u.js → icons-lSlfQ50w.js} +10 -14
- package/dist/icons-lSlfQ50w.js.map +1 -0
- package/dist/{index-CJnCDVsr.js → index-CQOHJMew.js} +365 -1429
- package/dist/{index-CJnCDVsr.js.map → index-CQOHJMew.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{splitPathsBySizeLoader-BIQRx5NP.js → splitPathsBySizeLoader-BV47-5ws.js} +2 -2
- package/dist/{splitPathsBySizeLoader-BIQRx5NP.js.map → splitPathsBySizeLoader-BV47-5ws.js.map} +1 -1
- package/dist/{splitPathsBySizeLoader-B6PtJR5E.js → splitPathsBySizeLoader-DOjF2YSu.js} +2 -2
- package/dist/{splitPathsBySizeLoader-B6PtJR5E.js.map → splitPathsBySizeLoader-DOjF2YSu.js.map} +1 -1
- package/dist-types/lib/internal-details/lib/evaluator/base-entity-manager.d.ts +6 -6
- package/dist-types/lib/internal-details/lib/evaluator/compute-engines.d.ts +2 -1
- package/dist-types/lib/internal-details/lib/evaluator/lazy-function.d.ts +2 -1
- package/dist-types/lib/internal-details/lib/features/component-registry.d.ts +5 -0
- package/dist-types/lib/user-facing/components/button/index.d.ts +26 -26
- package/dist-types/lib/user-facing/components/button/props.d.ts +26 -26
- package/dist-types/lib/user-facing/components/checkbox/index.d.ts +31 -31
- package/dist-types/lib/user-facing/components/checkbox/props.d.ts +31 -31
- package/dist-types/lib/user-facing/components/column/index.d.ts +19 -19
- package/dist-types/lib/user-facing/components/column/props.d.ts +19 -19
- package/dist-types/lib/user-facing/components/container/index.d.ts +21 -21
- package/dist-types/lib/user-facing/components/container/props.d.ts +21 -21
- package/dist-types/lib/user-facing/components/custom/register-custom-component.d.ts +9 -9
- package/dist-types/lib/user-facing/components/date-picker/index.d.ts +48 -48
- package/dist-types/lib/user-facing/components/date-picker/props.d.ts +48 -48
- package/dist-types/lib/user-facing/components/dropdown/index.d.ts +54 -54
- package/dist-types/lib/user-facing/components/dropdown/props.d.ts +54 -54
- package/dist-types/lib/user-facing/components/grid/index.d.ts +13 -13
- package/dist-types/lib/user-facing/components/icon/index.d.ts +13 -13
- package/dist-types/lib/user-facing/components/icon/props.d.ts +13 -13
- package/dist-types/lib/user-facing/components/image/index.d.ts +20 -20
- package/dist-types/lib/user-facing/components/image/props.d.ts +23 -23
- package/dist-types/lib/user-facing/components/input/index.d.ts +63 -63
- package/dist-types/lib/user-facing/components/input/props.d.ts +63 -63
- package/dist-types/lib/user-facing/components/key-value/properties-props.d.ts +21 -21
- package/dist-types/lib/user-facing/components/key-value/props.d.ts +27 -27
- package/dist-types/lib/user-facing/components/modal/index.d.ts +27 -27
- package/dist-types/lib/user-facing/components/modal/props.d.ts +27 -27
- package/dist-types/lib/user-facing/components/page/index.d.ts +13 -13
- package/dist-types/lib/user-facing/components/page/props.d.ts +13 -13
- package/dist-types/lib/user-facing/components/section/index.d.ts +16 -16
- package/dist-types/lib/user-facing/components/section/props.d.ts +16 -16
- package/dist-types/lib/user-facing/components/slideout/props.d.ts +11 -11
- package/dist-types/lib/user-facing/components/stack/index.d.ts +38 -38
- package/dist-types/lib/user-facing/components/switch/index.d.ts +32 -32
- package/dist-types/lib/user-facing/components/switch/props.d.ts +32 -32
- package/dist-types/lib/user-facing/components/table/column-properties-panel.d.ts +262 -161
- package/dist-types/lib/user-facing/components/table/index.d.ts +306 -205
- package/dist-types/lib/user-facing/components/table/props.d.ts +306 -205
- package/dist-types/lib/user-facing/components/table/table-utilities.d.ts +4 -4
- package/dist-types/lib/user-facing/components/table/table-widget.d.ts +5 -1
- package/dist-types/lib/user-facing/components/table/types.d.ts +31 -28
- package/dist-types/lib/user-facing/components/text/index.d.ts +35 -35
- package/dist-types/lib/user-facing/components/text/props.d.ts +35 -35
- package/dist-types/lib/user-facing/entities/api/props.d.ts +10 -10
- package/dist-types/lib/user-facing/entities/timer/props.d.ts +12 -12
- package/dist-types/lib/user-facing/entities/variable/props.d.ts +7 -7
- package/dist-types/lib/user-facing/properties-panel/mixins/appearance-properties.d.ts +12 -12
- package/dist-types/lib/user-facing/properties-panel/mixins/appearance.d.ts +2 -2
- package/dist-types/lib/user-facing/properties-panel/mixins/form-inputs-properties.d.ts +10 -10
- package/dist-types/lib/user-facing/properties-panel/mixins/layout-section.d.ts +45 -45
- package/dist-types/lib/user-facing/properties-panel/mixins/loading.d.ts +1 -1
- package/dist-types/lib/user-facing/properties-panel/props-builder.d.ts +20 -9
- package/package.json +2 -2
- package/dist/icons-NrNO8p_u.js.map +0 -1
|
@@ -49,7 +49,7 @@ var __privateMethod = (obj, member, method4) => (__accessCheck(obj, member, "acc
|
|
|
49
49
|
var _removeSourceIdElement_dec, _setSourceIdElement_dec, _setActiveRootInstanceId_dec, _init, _cancelApi_dec, _runApi_dec, _init2, _renameWidget_dec, _setWidgetProperty_dec, _setWidgetProperties_dec, _writeRuntimeProperties_dec, _deleteComponents_dec, _dropComponent_dec, _createComponent_dec, _batchUpdate_dec, _clearPendingTransactions_dec, _addPendingTransaction_dec, _executeOrAddToBatch_dec, _init3, _addOptimisticCreateWidget_dec, _processRootWidget_dec, _init4, _refreshPositionsAndGetDropConstraints_dec, _init5, _updateChildPositions_dec, _setWidgetPosition_dec, _setActiveTargetRect_dec, _setActiveDragRect_dec, _setDropTargetId_dec, _setInvalidDropTarget_dec, _setValidRootIds_dec, _cancelNewComponentDrag_dec, _startNewComponentDrag_dec, _setIsDragging_dec, _setWidgetFeatures_dec, _init6;
|
|
50
50
|
import * as React from "react";
|
|
51
51
|
import React__default, { isValidElement as isValidElement$1, version as version$2, createContext, useContext, useEffect, useRef, useLayoutEffect as useLayoutEffect$2, Component, useState, useMemo as useMemo$2, useCallback, forwardRef, useImperativeHandle, cloneElement as cloneElement$1, createElement, Suspense, Children, memo, useReducer, useSyncExternalStore, PureComponent, createRef } from "react";
|
|
52
|
-
import { S as SvgClose, a as SvgSystemDanger, b as SvgSystemInfo, c as SvgSystemError, d as SvgSystemSuccess, e as SvgPlus, f as SvgHide, g as SvgChevronDown, h as SvgEmptyCheckbox, i as SvgMinus, j as SvgCheckmark, k as
|
|
52
|
+
import { S as SvgClose, a as SvgSystemDanger, b as SvgSystemInfo, c as SvgSystemError, d as SvgSystemSuccess, e as SvgPlus, f as SvgHide, g as SvgChevronDown, h as SvgEmptyCheckbox, i as SvgMinus, j as SvgCheckmark, k as SvgPlay, l as SvgDownload, m as SvgTrash, n as SvgFilter, o as SvgFreeze, p as SvgSort, q as SvgEllipsis, r as SvgCrossXs, s as SvgClark } from "./icons-lSlfQ50w.js";
|
|
53
53
|
import * as ReactDOM from "react-dom";
|
|
54
54
|
import ReactDOM__default, { unstable_batchedUpdates, flushSync, createPortal } from "react-dom";
|
|
55
55
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
@@ -6001,11 +6001,11 @@ function PropertyInfo(value, type5 = "STATIC", extra) {
|
|
|
6001
6001
|
const Property = {
|
|
6002
6002
|
Static: (value) => PropertyInfo(value, "STATIC"),
|
|
6003
6003
|
Binding: (value) => PropertyInfo(value, "BINDING"),
|
|
6004
|
-
Template: (value) => PropertyInfo(value, "TEMPLATE"),
|
|
6004
|
+
Template: (value, args) => PropertyInfo(value, "TEMPLATE", { args }),
|
|
6005
6005
|
Expression: (value) => PropertyInfo(value, "EXPRESSION"),
|
|
6006
6006
|
Event: (value) => PropertyInfo(value, "EVENT"),
|
|
6007
6007
|
Dimension: (value) => PropertyInfo(value, "DIMENSION"),
|
|
6008
|
-
Computed: (value, args) => PropertyInfo(value, "COMPUTED",
|
|
6008
|
+
Computed: (value, args) => PropertyInfo(value, "COMPUTED", { args }),
|
|
6009
6009
|
Any: (value, type5 = "STATIC") => PropertyInfo(value, type5)
|
|
6010
6010
|
};
|
|
6011
6011
|
function isPropertyInfo(value) {
|
|
@@ -6025,6 +6025,18 @@ function withBindingIdentifier(params, identifier2) {
|
|
|
6025
6025
|
[BindingMetaSymbol]: identifier2
|
|
6026
6026
|
};
|
|
6027
6027
|
}
|
|
6028
|
+
function getSingleArgString(arg) {
|
|
6029
|
+
if (Array.isArray(arg)) {
|
|
6030
|
+
return `{ ${arg.map(getSingleArgString).join(", ")} }`;
|
|
6031
|
+
}
|
|
6032
|
+
return arg.name;
|
|
6033
|
+
}
|
|
6034
|
+
function getComputedArgsString(args) {
|
|
6035
|
+
if (!args || args.length === 0) {
|
|
6036
|
+
return "";
|
|
6037
|
+
}
|
|
6038
|
+
return args.map(getSingleArgString).join(", ");
|
|
6039
|
+
}
|
|
6028
6040
|
const isDimension = (value) => {
|
|
6029
6041
|
return typeof value === "object" && value !== null && "mode" in value && ["px", "fit", "fill", "%", "columns", "rows"].includes(value.mode) && (value.mode === "fit" || "value" in value);
|
|
6030
6042
|
};
|
|
@@ -82975,6 +82987,11 @@ class Prop {
|
|
|
82975
82987
|
this.prop.nestedBindings = true;
|
|
82976
82988
|
throw new Error("Nested bindings are not supported yet");
|
|
82977
82989
|
}
|
|
82990
|
+
contextual(computedArgs) {
|
|
82991
|
+
this.prop.contextual = true;
|
|
82992
|
+
this.prop.computedArgs = computedArgs;
|
|
82993
|
+
return this;
|
|
82994
|
+
}
|
|
82978
82995
|
validate(validateFn) {
|
|
82979
82996
|
this.prop.validate = validateFn;
|
|
82980
82997
|
return this;
|
|
@@ -83096,6 +83113,9 @@ class Prop {
|
|
|
83096
83113
|
...rest
|
|
83097
83114
|
};
|
|
83098
83115
|
}
|
|
83116
|
+
if (this.prop.computedArgs) {
|
|
83117
|
+
propertiesPanelDisplay.computedArgs = typeof this.prop.computedArgs === "function" ? this.prop.computedArgs(entity) : this.prop.computedArgs;
|
|
83118
|
+
}
|
|
83099
83119
|
const propertiesPanelDisplayWithPanelConfig = {
|
|
83100
83120
|
...propertiesPanelDisplay,
|
|
83101
83121
|
...panelConfig && { panelConfig }
|
|
@@ -83506,7 +83526,7 @@ function registerStores(stores) {
|
|
|
83506
83526
|
internalStores = { ...internalStores, ...stores };
|
|
83507
83527
|
if (SUPPORTED_MODES.includes("production")) {
|
|
83508
83528
|
if (Object.keys(internalStores).length === Object.keys(stores).length) {
|
|
83509
|
-
import("./devtools-consolidated-
|
|
83529
|
+
import("./devtools-consolidated-BQ5Eme4s.js").then(({ initializeCustomDevTools, setRegisteredStores }) => {
|
|
83510
83530
|
setRegisteredStores(internalStores);
|
|
83511
83531
|
initializeCustomDevTools();
|
|
83512
83532
|
}).catch((error) => {
|
|
@@ -83519,7 +83539,7 @@ function registerStores(stores) {
|
|
|
83519
83539
|
}
|
|
83520
83540
|
}
|
|
83521
83541
|
const DevToolsInternal = React__default.lazy(() => {
|
|
83522
|
-
return import("./devtools-consolidated-
|
|
83542
|
+
return import("./devtools-consolidated-BQ5Eme4s.js").then((module2) => ({
|
|
83523
83543
|
default: module2.CustomDevTools
|
|
83524
83544
|
}));
|
|
83525
83545
|
});
|
|
@@ -83612,9 +83632,32 @@ class EvalComputeEngine {
|
|
|
83612
83632
|
})()
|
|
83613
83633
|
}`
|
|
83614
83634
|
));
|
|
83635
|
+
__publicField(this, "statementFunctionNoSnapshot", new Function(
|
|
83636
|
+
ARGS_VAR_NAME,
|
|
83637
|
+
USER_JS_CODE_VAR_NAME,
|
|
83638
|
+
/*js*/
|
|
83639
|
+
`return (() => {
|
|
83640
|
+
"use strict";
|
|
83641
|
+
return eval("(" + ${USER_JS_CODE_VAR_NAME} + ")").call(this, ...${ARGS_VAR_NAME});
|
|
83642
|
+
})()`
|
|
83643
|
+
));
|
|
83615
83644
|
}
|
|
83616
|
-
compute({
|
|
83645
|
+
compute({
|
|
83646
|
+
snapshot,
|
|
83647
|
+
entityName,
|
|
83648
|
+
func,
|
|
83649
|
+
args,
|
|
83650
|
+
path: path2,
|
|
83651
|
+
excludeState
|
|
83652
|
+
}) {
|
|
83617
83653
|
try {
|
|
83654
|
+
if (excludeState) {
|
|
83655
|
+
return this.statementFunctionNoSnapshot.call(
|
|
83656
|
+
snapshot[entityName.value],
|
|
83657
|
+
args || [],
|
|
83658
|
+
func.toString()
|
|
83659
|
+
);
|
|
83660
|
+
}
|
|
83618
83661
|
const globalScope = createGlobalObject({ snapshot });
|
|
83619
83662
|
return this.statementFunction.call(
|
|
83620
83663
|
snapshot[entityName.value],
|
|
@@ -84018,7 +84061,7 @@ const isLazyFunction = (value) => {
|
|
|
84018
84061
|
return typeof value === "function" && value[lazyFunctionSymbol];
|
|
84019
84062
|
};
|
|
84020
84063
|
const LazyFunction = (source2, args = []) => {
|
|
84021
|
-
const argsObj =
|
|
84064
|
+
const argsObj = getComputedArgsString(args);
|
|
84022
84065
|
const func = new Function(argsObj, source2);
|
|
84023
84066
|
func[lazyFunctionSymbol] = true;
|
|
84024
84067
|
return func;
|
|
@@ -84353,7 +84396,6 @@ class EntityManager {
|
|
|
84353
84396
|
}
|
|
84354
84397
|
addProperty(scopeId, name, prop, eov) {
|
|
84355
84398
|
if (prop.split(".").includes(RECORD_PATH_IDENTIFIER)) {
|
|
84356
|
-
console.log(`ALERT: Cannot add a property with a record path (${prop})`);
|
|
84357
84399
|
return;
|
|
84358
84400
|
}
|
|
84359
84401
|
const entity = this.getScope(scopeId).getEntity(name);
|
|
@@ -84409,6 +84451,14 @@ class EntityManager {
|
|
|
84409
84451
|
}
|
|
84410
84452
|
return;
|
|
84411
84453
|
}
|
|
84454
|
+
let finalProp = prop;
|
|
84455
|
+
if (isNested) {
|
|
84456
|
+
finalProp = this.componentRegistry.getPropertyWithRecordIdentifier(
|
|
84457
|
+
entityType,
|
|
84458
|
+
prop
|
|
84459
|
+
);
|
|
84460
|
+
}
|
|
84461
|
+
const managedProp = this.componentRegistry.getManagedProps(entityType).find((p) => p.path === finalProp);
|
|
84412
84462
|
const getValue2 = computed(() => {
|
|
84413
84463
|
let ret = null;
|
|
84414
84464
|
try {
|
|
@@ -84417,18 +84467,30 @@ class EntityManager {
|
|
|
84417
84467
|
ret = metaParent[finalSegment];
|
|
84418
84468
|
} else {
|
|
84419
84469
|
if (isComputed) {
|
|
84420
|
-
|
|
84421
|
-
|
|
84422
|
-
|
|
84423
|
-
|
|
84424
|
-
|
|
84425
|
-
|
|
84470
|
+
if (managedProp == null ? void 0 : managedProp.contextual) {
|
|
84471
|
+
ret = function(context2) {
|
|
84472
|
+
return computeEngine.compute({
|
|
84473
|
+
snapshot: snapshot(scopeId),
|
|
84474
|
+
entityName: name,
|
|
84475
|
+
func: eov.value,
|
|
84476
|
+
path: prop,
|
|
84477
|
+
args: [context2],
|
|
84478
|
+
excludeState: true
|
|
84479
|
+
});
|
|
84480
|
+
};
|
|
84481
|
+
} else {
|
|
84482
|
+
ret = computeEngine.compute({
|
|
84483
|
+
snapshot: snapshot(scopeId),
|
|
84484
|
+
entityName: name,
|
|
84485
|
+
func: eov.value,
|
|
84486
|
+
path: prop
|
|
84487
|
+
});
|
|
84488
|
+
}
|
|
84426
84489
|
} else {
|
|
84427
84490
|
ret = eov.value;
|
|
84428
84491
|
}
|
|
84429
84492
|
}
|
|
84430
|
-
|
|
84431
|
-
if (managedProp == null ? void 0 : managedProp.validate) {
|
|
84493
|
+
if ((managedProp == null ? void 0 : managedProp.validate) && typeof ret !== "function") {
|
|
84432
84494
|
const currentState = snapshot(scopeId);
|
|
84433
84495
|
const entity2 = currentState[name.value];
|
|
84434
84496
|
const validationResult = managedProp.validate(ret, entity2);
|
|
@@ -84446,13 +84508,13 @@ class EntityManager {
|
|
|
84446
84508
|
if (!validationResult.valid) {
|
|
84447
84509
|
return void 0;
|
|
84448
84510
|
}
|
|
84449
|
-
|
|
84511
|
+
ret = validationResult.result;
|
|
84450
84512
|
}
|
|
84513
|
+
return ret;
|
|
84451
84514
|
} catch (_e2) {
|
|
84452
84515
|
console.log("Could not compute property value");
|
|
84453
84516
|
return void 0;
|
|
84454
84517
|
}
|
|
84455
|
-
return ret;
|
|
84456
84518
|
});
|
|
84457
84519
|
const setValue = (value) => {
|
|
84458
84520
|
const metaParent = getMetaParent();
|
|
@@ -85919,6 +85981,24 @@ class ComponentRegistry {
|
|
|
85919
85981
|
getComponent(type5) {
|
|
85920
85982
|
return this._typeRegistry.get(type5) ?? this._customComponentRegistry.get(type5);
|
|
85921
85983
|
}
|
|
85984
|
+
/**
|
|
85985
|
+
* Get the property path with the record identifier if it exists. For example,
|
|
85986
|
+
* `columns.columnName.label` becomes `columns.*.label`, for record properties.
|
|
85987
|
+
*/
|
|
85988
|
+
getPropertyWithRecordIdentifier(type5, path2) {
|
|
85989
|
+
const managedProps = this.getManagedProps(type5);
|
|
85990
|
+
const splitPath = path2.split(".");
|
|
85991
|
+
if (splitPath.length === 1) {
|
|
85992
|
+
return path2;
|
|
85993
|
+
}
|
|
85994
|
+
const [parentKey, _maybeTheRecordKey, ...rest] = splitPath;
|
|
85995
|
+
for (const prop of managedProps) {
|
|
85996
|
+
if (prop.path.startsWith(parentKey) && prop.path.includes(RECORD_PATH_IDENTIFIER) && rest.length > 0 && prop.path.endsWith(rest.join("."))) {
|
|
85997
|
+
return [parentKey, RECORD_PATH_IDENTIFIER, rest.join(".")].join(".");
|
|
85998
|
+
}
|
|
85999
|
+
}
|
|
86000
|
+
return path2;
|
|
86001
|
+
}
|
|
85922
86002
|
}
|
|
85923
86003
|
const DEFAULT_ANONYMOUS_SOURCE_ID = "SB--anon-src";
|
|
85924
86004
|
const DEFAULT_ROOT_KEY = Symbol("DEFAULT_KEY");
|
|
@@ -86940,7 +87020,10 @@ function getPropertyValue$1({
|
|
|
86940
87020
|
}
|
|
86941
87021
|
if (property.type === "COMPUTED" && typeof property.value === "string" && scopeId && name) {
|
|
86942
87022
|
try {
|
|
86943
|
-
return LazyFunction(
|
|
87023
|
+
return LazyFunction(
|
|
87024
|
+
getRuntimeComputedExpression(property.value),
|
|
87025
|
+
property.args
|
|
87026
|
+
);
|
|
86944
87027
|
} catch (e3) {
|
|
86945
87028
|
console.error("Error generating computed value", e3);
|
|
86946
87029
|
const entity = rootStore.entityManager.getEntity(scopeId, name);
|
|
@@ -91080,14 +91163,14 @@ function getLoaderFn$1(options) {
|
|
|
91080
91163
|
if (!(loader === "all")) return [3, 3];
|
|
91081
91164
|
return [4, import(
|
|
91082
91165
|
/* webpackChunkName: "blueprint-icons-all-paths-loader" */
|
|
91083
|
-
"./allPathsLoader-
|
|
91166
|
+
"./allPathsLoader-yqClhllT.js"
|
|
91084
91167
|
)];
|
|
91085
91168
|
case 2:
|
|
91086
91169
|
return [2, _b2.sent().allPathsLoader];
|
|
91087
91170
|
case 3:
|
|
91088
91171
|
return [4, import(
|
|
91089
91172
|
/* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
|
|
91090
|
-
"./splitPathsBySizeLoader-
|
|
91173
|
+
"./splitPathsBySizeLoader-BV47-5ws.js"
|
|
91091
91174
|
)];
|
|
91092
91175
|
case 4:
|
|
91093
91176
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -119098,7 +119181,7 @@ function useTypographyStyling({
|
|
|
119098
119181
|
};
|
|
119099
119182
|
}
|
|
119100
119183
|
const DEFAULT_ICON_SPACING = 8;
|
|
119101
|
-
const DEFAULT_ICON_SIZE
|
|
119184
|
+
const DEFAULT_ICON_SIZE = 16;
|
|
119102
119185
|
const ICON_POSITION_OPTIONS = [
|
|
119103
119186
|
{
|
|
119104
119187
|
icon: "ICON_LEFT_ALIGN",
|
|
@@ -126306,9 +126389,9 @@ const getIconPositionStyle = ({
|
|
|
126306
126389
|
right: offsetRight === "auto" ? offsetRight : `${offsetRight}px`
|
|
126307
126390
|
};
|
|
126308
126391
|
};
|
|
126309
|
-
const getIconPadding = (paddingValue = INPUT_PADDING.right, iconSize = DEFAULT_ICON_SIZE
|
|
126392
|
+
const getIconPadding = (paddingValue = INPUT_PADDING.right, iconSize = DEFAULT_ICON_SIZE, withSpacing = true) => {
|
|
126310
126393
|
const spacing2 = withSpacing ? DEFAULT_ICON_SPACING : 0;
|
|
126311
|
-
const baseValue = iconSize ? iconSize + spacing2 : DEFAULT_ICON_SIZE
|
|
126394
|
+
const baseValue = iconSize ? iconSize + spacing2 : DEFAULT_ICON_SIZE;
|
|
126312
126395
|
return Dim.px(baseValue + (paddingValue.value ?? 0));
|
|
126313
126396
|
};
|
|
126314
126397
|
const DEFAULT_LABEL_WIDTH_IN_PERCENT = 30;
|
|
@@ -127062,7 +127145,7 @@ const useInputIconSize = ({
|
|
|
127062
127145
|
textStyleVariant: textStyle2.variant,
|
|
127063
127146
|
defaultTextStyleVariant: DEFAULT_INPUT_TEXT_STYLE_VARIANT
|
|
127064
127147
|
})
|
|
127065
|
-
) : DEFAULT_ICON_SIZE
|
|
127148
|
+
) : DEFAULT_ICON_SIZE;
|
|
127066
127149
|
};
|
|
127067
127150
|
const useInputGroupStylingProps = (props2) => {
|
|
127068
127151
|
const { theme } = useTheme$1();
|
|
@@ -127279,7 +127362,7 @@ const _InputComponent = class _InputComponent extends React__default.Component {
|
|
|
127279
127362
|
(padding2, iconPosition, iconSize) => {
|
|
127280
127363
|
var _a2, _b2;
|
|
127281
127364
|
let adjustedForIcon = {};
|
|
127282
|
-
const horizontalPadding = iconSize ? iconSize + DEFAULT_ICON_SPACING : DEFAULT_ICON_SIZE
|
|
127365
|
+
const horizontalPadding = iconSize ? iconSize + DEFAULT_ICON_SPACING : DEFAULT_ICON_SIZE;
|
|
127283
127366
|
if (iconPosition === "left") {
|
|
127284
127367
|
adjustedForIcon = {
|
|
127285
127368
|
left: Dim.px(horizontalPadding + (((_a2 = padding2.left) == null ? void 0 : _a2.value) ?? 0))
|
|
@@ -127365,7 +127448,7 @@ const _InputComponent = class _InputComponent extends React__default.Component {
|
|
|
127365
127448
|
);
|
|
127366
127449
|
});
|
|
127367
127450
|
__publicField(this, "passwordIconComponent", () => {
|
|
127368
|
-
const iconSize = this.props.iconSize ?? DEFAULT_ICON_SIZE
|
|
127451
|
+
const iconSize = this.props.iconSize ?? DEFAULT_ICON_SIZE;
|
|
127369
127452
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
127370
127453
|
Button$4,
|
|
127371
127454
|
{
|
|
@@ -127422,7 +127505,7 @@ const _InputComponent = class _InputComponent extends React__default.Component {
|
|
|
127422
127505
|
});
|
|
127423
127506
|
__publicField(this, "renderInputComponent", (inputType) => isNumericInput(inputType) ? this.numericInputComponent() : this.textInputComponent());
|
|
127424
127507
|
__publicField(this, "renderIcon", () => {
|
|
127425
|
-
const iconSize = this.props.iconSize ?? DEFAULT_ICON_SIZE
|
|
127508
|
+
const iconSize = this.props.iconSize ?? DEFAULT_ICON_SIZE;
|
|
127426
127509
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
127427
127510
|
"div",
|
|
127428
127511
|
{
|
|
@@ -134989,7 +135072,7 @@ function requireButton() {
|
|
|
134989
135072
|
}
|
|
134990
135073
|
var buttonExports = /* @__PURE__ */ requireButton();
|
|
134991
135074
|
const AntdButton = /* @__PURE__ */ getDefaultExportFromCjs(buttonExports);
|
|
134992
|
-
const StyledButton
|
|
135075
|
+
const StyledButton = qe$1(AntdButton)`
|
|
134993
135076
|
color: ${(props2) => props2.color};
|
|
134994
135077
|
${({ $width }) => $width ? `width: ${$width}` : ""};
|
|
134995
135078
|
${({ $bordered }) => !$bordered ? "border: 0px;" : ""};
|
|
@@ -135004,7 +135087,7 @@ const Button$2 = memo(
|
|
|
135004
135087
|
forwardRef(
|
|
135005
135088
|
({ bordered = true, width, children, ...buttonProps }, ref2) => {
|
|
135006
135089
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
135007
|
-
StyledButton
|
|
135090
|
+
StyledButton,
|
|
135008
135091
|
{
|
|
135009
135092
|
$bordered: bordered,
|
|
135010
135093
|
$width: width,
|
|
@@ -135785,8 +135868,7 @@ const RowDensity = {
|
|
|
135785
135868
|
};
|
|
135786
135869
|
const HorizontalAlignment = {
|
|
135787
135870
|
left: "left",
|
|
135788
|
-
right: "right"
|
|
135789
|
-
center: "center"
|
|
135871
|
+
right: "right"
|
|
135790
135872
|
};
|
|
135791
135873
|
const VerticalAlignment = {
|
|
135792
135874
|
center: "center"
|
|
@@ -135903,7 +135985,7 @@ const PARSED_INPUT_TYPES = [
|
|
|
135903
135985
|
EditInputType.Number,
|
|
135904
135986
|
EditInputType.Checkbox
|
|
135905
135987
|
];
|
|
135906
|
-
|
|
135988
|
+
[
|
|
135907
135989
|
EditInputType.Text,
|
|
135908
135990
|
EditInputType.Number,
|
|
135909
135991
|
EditInputType.Email
|
|
@@ -136005,15 +136087,26 @@ const tableColumnTypes = [
|
|
|
136005
136087
|
value: ColumnType.EMAIL
|
|
136006
136088
|
}
|
|
136007
136089
|
];
|
|
136090
|
+
const currentRowArg = (entity) => {
|
|
136091
|
+
return {
|
|
136092
|
+
name: "currentRow",
|
|
136093
|
+
description: "Current row of the table. Use this to access the current row's data.",
|
|
136094
|
+
type: "object",
|
|
136095
|
+
schema: entity.tableData && Array.isArray(entity.tableData) && entity.tableData.length > 0 ? entity.tableData[0] : {}
|
|
136096
|
+
};
|
|
136097
|
+
};
|
|
136098
|
+
const tableContextualArgs = function(entity) {
|
|
136099
|
+
return [[currentRowArg(entity)]];
|
|
136100
|
+
};
|
|
136008
136101
|
const cellIconProps = {
|
|
136009
|
-
cellIcon: Prop.string().readAndWrite().propertiesPanel({
|
|
136102
|
+
cellIcon: Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
|
|
136010
136103
|
label: "Cell icon",
|
|
136011
136104
|
controlType: "ICON_SELECTOR",
|
|
136012
136105
|
isRemovable: true,
|
|
136013
136106
|
visibility: "SHOW_NAME",
|
|
136014
136107
|
defaultOnAdd: "info"
|
|
136015
136108
|
}),
|
|
136016
|
-
cellIconPosition: Prop.string().default("left").readAndWrite().propertiesPanel({
|
|
136109
|
+
cellIconPosition: Prop.string().default("left").contextual(tableContextualArgs).readAndWrite().propertiesPanel({
|
|
136017
136110
|
label: "Cell icon position",
|
|
136018
136111
|
controlType: "RADIO_BUTTON_GROUP",
|
|
136019
136112
|
options: [
|
|
@@ -136030,7 +136123,7 @@ const cellIconProps = {
|
|
|
136030
136123
|
]
|
|
136031
136124
|
})
|
|
136032
136125
|
};
|
|
136033
|
-
const horizontalAlignProp = () => Prop.string().readAndWrite().propertiesPanel({
|
|
136126
|
+
const horizontalAlignProp = () => Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
|
|
136034
136127
|
label: "Horizontal alignment",
|
|
136035
136128
|
controlType: "RADIO_BUTTON_GROUP",
|
|
136036
136129
|
options: [
|
|
@@ -136039,7 +136132,7 @@ const horizontalAlignProp = () => Prop.string().readAndWrite().propertiesPanel({
|
|
|
136039
136132
|
{ value: "right", icon: "RIGHT_ALIGN" }
|
|
136040
136133
|
]
|
|
136041
136134
|
}).default("left");
|
|
136042
|
-
const verticalAlignProp = () => Prop.string().readAndWrite().propertiesPanel({
|
|
136135
|
+
const verticalAlignProp = () => Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
|
|
136043
136136
|
label: "Vertical alignment",
|
|
136044
136137
|
controlType: "RADIO_BUTTON_GROUP",
|
|
136045
136138
|
options: [
|
|
@@ -136050,7 +136143,7 @@ const verticalAlignProp = () => Prop.string().readAndWrite().propertiesPanel({
|
|
|
136050
136143
|
}).default("center");
|
|
136051
136144
|
const cellBackgroundProp = colorProp({
|
|
136052
136145
|
label: "Background color"
|
|
136053
|
-
}).default(() => Theme.colors.neutral).readAndWrite();
|
|
136146
|
+
}).contextual(tableContextualArgs).default(() => Theme.colors.neutral).readAndWrite();
|
|
136054
136147
|
const textStyleProps = {
|
|
136055
136148
|
horizontalAlign: horizontalAlignProp(),
|
|
136056
136149
|
verticalAlign: verticalAlignProp(),
|
|
@@ -136058,7 +136151,7 @@ const textStyleProps = {
|
|
|
136058
136151
|
propertiesPanel: {
|
|
136059
136152
|
label: "Cell text style"
|
|
136060
136153
|
}
|
|
136061
|
-
}).default(() => ({
|
|
136154
|
+
}).contextual(tableContextualArgs).default(() => ({
|
|
136062
136155
|
variant: DEFAULT_CELL_TEXT_STYLE_VARIANT
|
|
136063
136156
|
})),
|
|
136064
136157
|
cellBackground: cellBackgroundProp
|
|
@@ -136073,22 +136166,22 @@ const computedValueUnion = Prop.union({
|
|
|
136073
136166
|
},
|
|
136074
136167
|
{
|
|
136075
136168
|
isDerived: Prop.literal(true),
|
|
136076
|
-
computedValue: Prop.string().readAndWrite().propertiesPanel({
|
|
136169
|
+
computedValue: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
|
|
136077
136170
|
label: "Computed value"
|
|
136078
|
-
// todo: add special control that can use currentRow
|
|
136079
136171
|
})
|
|
136080
136172
|
}
|
|
136081
136173
|
]
|
|
136082
136174
|
}).getProps();
|
|
136083
136175
|
const textColumnProperties = {
|
|
136084
136176
|
general: {
|
|
136085
|
-
displayedValue: Prop.string().readAndWrite().propertiesPanel({
|
|
136177
|
+
displayedValue: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
|
|
136086
136178
|
label: "Displayed value",
|
|
136087
136179
|
controlType: "COMPUTE_TABLE_VALUE"
|
|
136088
136180
|
})
|
|
136089
136181
|
},
|
|
136090
136182
|
presentation: {
|
|
136091
|
-
|
|
136183
|
+
...cellIconProps,
|
|
136184
|
+
textWrap: Prop.boolean().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
|
|
136092
136185
|
label: "Wrap text",
|
|
136093
136186
|
controlType: "SWITCH"
|
|
136094
136187
|
}),
|
|
@@ -136098,23 +136191,25 @@ const textColumnProperties = {
|
|
|
136098
136191
|
const emailColumnProperties = { ...textColumnProperties };
|
|
136099
136192
|
const buttonColumnProperties = {
|
|
136100
136193
|
general: {
|
|
136101
|
-
buttonLabel: Prop.string().default("Action").readAndWrite().propertiesPanel({
|
|
136194
|
+
buttonLabel: Prop.string().default("Action").contextual(tableContextualArgs).readAndWrite().propertiesPanel({
|
|
136102
136195
|
label: "Button label",
|
|
136103
136196
|
controlType: "COMPUTE_TABLE_VALUE"
|
|
136104
136197
|
}),
|
|
136105
|
-
isDisabled: Prop.boolean().readAndWrite().propertiesPanel({
|
|
136198
|
+
isDisabled: Prop.boolean().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
|
|
136106
136199
|
label: "Disabled",
|
|
136107
136200
|
controlType: "SWITCH"
|
|
136108
136201
|
})
|
|
136109
136202
|
},
|
|
136110
136203
|
presentation: {
|
|
136111
|
-
buttonIcon: Prop.string().readAndWrite().propertiesPanel({
|
|
136204
|
+
buttonIcon: Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
|
|
136112
136205
|
label: "Button icon",
|
|
136113
136206
|
controlType: "ICON_SELECTOR",
|
|
136114
136207
|
isRemovable: true,
|
|
136115
136208
|
visibility: "SHOW_NAME"
|
|
136116
136209
|
}),
|
|
136117
|
-
buttonIconPosition: Prop.string().readAndWrite().
|
|
136210
|
+
buttonIconPosition: Prop.string().readAndWrite().contextual(
|
|
136211
|
+
tableContextualArgs
|
|
136212
|
+
).default("left").propertiesPanel({
|
|
136118
136213
|
label: "Cell icon position",
|
|
136119
136214
|
controlType: "RADIO_BUTTON_GROUP",
|
|
136120
136215
|
options: [
|
|
@@ -136130,7 +136225,9 @@ const buttonColumnProperties = {
|
|
|
136130
136225
|
}
|
|
136131
136226
|
]
|
|
136132
136227
|
}),
|
|
136133
|
-
buttonVariant: Prop.string().default("primary").
|
|
136228
|
+
buttonVariant: Prop.string().default("primary").contextual(
|
|
136229
|
+
tableContextualArgs
|
|
136230
|
+
).readAndWrite().propertiesPanel({
|
|
136134
136231
|
label: "Button variant",
|
|
136135
136232
|
controlType: "DROP_DOWN",
|
|
136136
136233
|
options: [
|
|
@@ -136148,7 +136245,9 @@ const buttonColumnProperties = {
|
|
|
136148
136245
|
}
|
|
136149
136246
|
]
|
|
136150
136247
|
}),
|
|
136151
|
-
buttonTextStyle: textStyleProp().
|
|
136248
|
+
buttonTextStyle: textStyleProp().contextual(
|
|
136249
|
+
tableContextualArgs
|
|
136250
|
+
).default(function() {
|
|
136152
136251
|
return {
|
|
136153
136252
|
variant: "buttonLabel",
|
|
136154
136253
|
textColor: {
|
|
@@ -136166,28 +136265,32 @@ const buttonColumnProperties = {
|
|
|
136166
136265
|
defaultOnAdd: function() {
|
|
136167
136266
|
return getButtonThemeDefaultBackgroundColor(Theme, "primary");
|
|
136168
136267
|
}
|
|
136169
|
-
}).
|
|
136268
|
+
}).contextual(
|
|
136269
|
+
tableContextualArgs
|
|
136270
|
+
).readAndWrite(),
|
|
136170
136271
|
buttonBorder: border({
|
|
136171
136272
|
defaultOnAdd: SECONDARY_BUTTON_BORDER_OBJECT,
|
|
136172
136273
|
treatDefaultAsNull: function() {
|
|
136173
136274
|
return true;
|
|
136174
136275
|
}
|
|
136175
|
-
}).
|
|
136276
|
+
}).readAndWrite().contextual(
|
|
136277
|
+
tableContextualArgs
|
|
136278
|
+
).default(getDefaultBorderObject)
|
|
136176
136279
|
}
|
|
136177
136280
|
};
|
|
136178
136281
|
const numberColumnProperties = {
|
|
136179
136282
|
general: {
|
|
136180
|
-
notation: Prop.string().readAndWrite().propertiesPanel({
|
|
136283
|
+
notation: Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
|
|
136181
136284
|
label: "Number format",
|
|
136182
136285
|
controlType: "DROP_DOWN",
|
|
136183
136286
|
options: NUMBER_FORMATTING_OPTIONS
|
|
136184
136287
|
}),
|
|
136185
|
-
minimumFractionDigits: Prop.number().readAndWrite().propertiesPanel({
|
|
136288
|
+
minimumFractionDigits: Prop.number().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
|
|
136186
136289
|
label: "Minimum fraction digits",
|
|
136187
136290
|
isRemovable: true,
|
|
136188
136291
|
visibility: "SHOW_NAME"
|
|
136189
136292
|
}),
|
|
136190
|
-
maximumFractionDigits: Prop.number().readAndWrite().propertiesPanel({
|
|
136293
|
+
maximumFractionDigits: Prop.number().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
|
|
136191
136294
|
label: "Maximum fraction digits",
|
|
136192
136295
|
isRemovable: true,
|
|
136193
136296
|
visibility: "SHOW_NAME"
|
|
@@ -136195,7 +136298,7 @@ const numberColumnProperties = {
|
|
|
136195
136298
|
},
|
|
136196
136299
|
presentation: {
|
|
136197
136300
|
...cellIconProps,
|
|
136198
|
-
textWrap: Prop.boolean().readAndWrite().propertiesPanel({
|
|
136301
|
+
textWrap: Prop.boolean().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
|
|
136199
136302
|
label: "Wrap text",
|
|
136200
136303
|
controlType: "SWITCH"
|
|
136201
136304
|
}),
|
|
@@ -136208,7 +136311,9 @@ const percentageColumnProperties = {
|
|
|
136208
136311
|
};
|
|
136209
136312
|
const currencyColumnProperties = {
|
|
136210
136313
|
general: {
|
|
136211
|
-
currency: Prop.string().default("USD").
|
|
136314
|
+
currency: Prop.string().default("USD").contextual(
|
|
136315
|
+
tableContextualArgs
|
|
136316
|
+
).readAndWrite().propertiesPanel({
|
|
136212
136317
|
label: "Currency",
|
|
136213
136318
|
controlType: "DROP_DOWN",
|
|
136214
136319
|
options: CurrencyList.map((currency) => ({
|
|
@@ -136222,12 +136327,11 @@ const currencyColumnProperties = {
|
|
|
136222
136327
|
};
|
|
136223
136328
|
const linkColumnProperties = {
|
|
136224
136329
|
general: {
|
|
136225
|
-
|
|
136226
|
-
|
|
136227
|
-
|
|
136228
|
-
|
|
136229
|
-
|
|
136230
|
-
linkLabel: Prop.string().readAndWrite().propertiesPanel({
|
|
136330
|
+
linkUrl: Prop.string().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
|
|
136331
|
+
label: "Link URL",
|
|
136332
|
+
controlType: "COMPUTE_TABLE_VALUE"
|
|
136333
|
+
}),
|
|
136334
|
+
linkLabel: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
|
|
136231
136335
|
label: "Link label",
|
|
136232
136336
|
controlType: "COMPUTE_TABLE_VALUE"
|
|
136233
136337
|
})
|
|
@@ -136243,13 +136347,15 @@ const linkColumnProperties = {
|
|
|
136243
136347
|
};
|
|
136244
136348
|
const imageColumnProperties = {
|
|
136245
136349
|
general: {
|
|
136246
|
-
openImageUrl: Prop.boolean().default(false).readAndWrite().propertiesPanel({
|
|
136350
|
+
openImageUrl: Prop.boolean().contextual(tableContextualArgs).default(false).readAndWrite().propertiesPanel({
|
|
136247
136351
|
label: "Open URL on click",
|
|
136248
136352
|
controlType: "SWITCH"
|
|
136249
136353
|
})
|
|
136250
136354
|
},
|
|
136251
136355
|
presentation: {
|
|
136252
|
-
imageSize: Prop.string().readAndWrite().
|
|
136356
|
+
imageSize: Prop.string().readAndWrite().contextual(
|
|
136357
|
+
tableContextualArgs
|
|
136358
|
+
).propertiesPanel({
|
|
136253
136359
|
label: "Image sizing",
|
|
136254
136360
|
controlType: "DROP_DOWN",
|
|
136255
136361
|
options: [
|
|
@@ -136275,14 +136381,14 @@ const imageColumnProperties = {
|
|
|
136275
136381
|
}
|
|
136276
136382
|
]
|
|
136277
136383
|
}),
|
|
136278
|
-
imageBorderRadius: borderRadius(),
|
|
136279
|
-
horizontalAlign: horizontalAlignProp(),
|
|
136384
|
+
imageBorderRadius: borderRadius().contextual(tableContextualArgs),
|
|
136385
|
+
horizontalAlign: horizontalAlignProp().contextual(tableContextualArgs),
|
|
136280
136386
|
cellBackground: cellBackgroundProp
|
|
136281
136387
|
}
|
|
136282
136388
|
};
|
|
136283
136389
|
const manageTimezoneUnion = Prop.union({
|
|
136284
136390
|
shared: {
|
|
136285
|
-
manageTimezone: Prop.boolean().default(false).readAndWrite().propertiesPanel({
|
|
136391
|
+
manageTimezone: Prop.boolean().default(false).contextual(tableContextualArgs).readAndWrite().propertiesPanel({
|
|
136286
136392
|
label: "Manage timezone",
|
|
136287
136393
|
controlType: "SWITCH"
|
|
136288
136394
|
})
|
|
@@ -136293,12 +136399,12 @@ const manageTimezoneUnion = Prop.union({
|
|
|
136293
136399
|
},
|
|
136294
136400
|
{
|
|
136295
136401
|
manageTimezone: Prop.literal(true),
|
|
136296
|
-
valueTimezone: Prop.string().readAndWrite().propertiesPanel({
|
|
136402
|
+
valueTimezone: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
|
|
136297
136403
|
label: "Value timezone",
|
|
136298
136404
|
controlType: "DROP_DOWN",
|
|
136299
136405
|
options: TIMEZONE_OPTIONS
|
|
136300
136406
|
}),
|
|
136301
|
-
displayTimezone: Prop.string().readAndWrite().propertiesPanel({
|
|
136407
|
+
displayTimezone: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
|
|
136302
136408
|
label: "Display timezone",
|
|
136303
136409
|
controlType: "DROP_DOWN",
|
|
136304
136410
|
options: TIMEZONE_OPTIONS
|
|
@@ -136308,12 +136414,12 @@ const manageTimezoneUnion = Prop.union({
|
|
|
136308
136414
|
}).getProps();
|
|
136309
136415
|
const dateColumnProperties = {
|
|
136310
136416
|
general: {
|
|
136311
|
-
inputFormat: Prop.string().readAndWrite().propertiesPanel({
|
|
136417
|
+
inputFormat: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
|
|
136312
136418
|
label: "Value format",
|
|
136313
136419
|
controlType: "DROP_DOWN",
|
|
136314
136420
|
options: DATE_INPUT_FORMATS
|
|
136315
136421
|
}),
|
|
136316
|
-
outputFormat: Prop.string().readAndWrite().propertiesPanel({
|
|
136422
|
+
outputFormat: Prop.string().contextual(tableContextualArgs).readAndWrite().propertiesPanel({
|
|
136317
136423
|
label: "Display format",
|
|
136318
136424
|
controlType: "DROP_DOWN",
|
|
136319
136425
|
options: DATE_OUTPUT_FORMATS
|
|
@@ -136322,7 +136428,7 @@ const dateColumnProperties = {
|
|
|
136322
136428
|
},
|
|
136323
136429
|
presentation: {
|
|
136324
136430
|
...cellIconProps,
|
|
136325
|
-
textWrap: Prop.boolean().readAndWrite().propertiesPanel({
|
|
136431
|
+
textWrap: Prop.boolean().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
|
|
136326
136432
|
label: "Wrap text",
|
|
136327
136433
|
controlType: "SWITCH"
|
|
136328
136434
|
}),
|
|
@@ -136378,7 +136484,7 @@ const tagsColumnProperties = {
|
|
|
136378
136484
|
horizontalAlign: horizontalAlignProp(),
|
|
136379
136485
|
verticalAlign: verticalAlignProp(),
|
|
136380
136486
|
cellBackground: cellBackgroundProp,
|
|
136381
|
-
tagsWrap: Prop.boolean().readAndWrite().propertiesPanel({
|
|
136487
|
+
tagsWrap: Prop.boolean().readAndWrite().contextual(tableContextualArgs).propertiesPanel({
|
|
136382
136488
|
label: "Wrap tags",
|
|
136383
136489
|
controlType: "SWITCH"
|
|
136384
136490
|
}),
|
|
@@ -138428,7 +138534,9 @@ const ColumnHeaderWrapper = qe$1.div`
|
|
|
138428
138534
|
gap: 4px;
|
|
138429
138535
|
justify-content: ${(props2) => {
|
|
138430
138536
|
var _a2, _b2;
|
|
138431
|
-
return ((_a2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _a2.horizontalAlign) && JUSTIFY_CONTENT[(
|
|
138537
|
+
return ((_a2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _a2.horizontalAlign) && JUSTIFY_CONTENT[getFirstPropertyValue(
|
|
138538
|
+
(_b2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _b2.horizontalAlign
|
|
138539
|
+
) ?? HorizontalAlignment.left];
|
|
138432
138540
|
}};
|
|
138433
138541
|
align-items: center;
|
|
138434
138542
|
overflow: hidden;
|
|
@@ -138443,7 +138551,9 @@ const HeaderCellContentWrapper = qe$1.div`
|
|
|
138443
138551
|
flex: 1;
|
|
138444
138552
|
justify-content: ${(props2) => {
|
|
138445
138553
|
var _a2, _b2;
|
|
138446
|
-
return ((_a2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _a2.horizontalAlign) && JUSTIFY_CONTENT[(
|
|
138554
|
+
return ((_a2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _a2.horizontalAlign) && JUSTIFY_CONTENT[getFirstPropertyValue(
|
|
138555
|
+
(_b2 = props2 == null ? void 0 : props2.columnProperties) == null ? void 0 : _b2.horizontalAlign
|
|
138556
|
+
) ?? HorizontalAlignment.left];
|
|
138447
138557
|
}};
|
|
138448
138558
|
`;
|
|
138449
138559
|
const TableIconWrapper = qe$1.div`
|
|
@@ -145617,14 +145727,14 @@ function getLoaderFn(options) {
|
|
|
145617
145727
|
if (!(loader === "all")) return [3, 3];
|
|
145618
145728
|
return [4, import(
|
|
145619
145729
|
/* webpackChunkName: "blueprint-icons-all-paths-loader" */
|
|
145620
|
-
"./allPathsLoader-
|
|
145730
|
+
"./allPathsLoader-okzKZ8ZK.js"
|
|
145621
145731
|
)];
|
|
145622
145732
|
case 2:
|
|
145623
145733
|
return [2, _b2.sent().allPathsLoader];
|
|
145624
145734
|
case 3:
|
|
145625
145735
|
return [4, import(
|
|
145626
145736
|
/* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
|
|
145627
|
-
"./splitPathsBySizeLoader-
|
|
145737
|
+
"./splitPathsBySizeLoader-DOjF2YSu.js"
|
|
145628
145738
|
)];
|
|
145629
145739
|
case 4:
|
|
145630
145740
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -153457,7 +153567,7 @@ const getClearableIconRight = memoizeOne$1(
|
|
|
153457
153567
|
}
|
|
153458
153568
|
const iconPadding = getIconPadding(
|
|
153459
153569
|
inputPadding == null ? void 0 : inputPadding.right,
|
|
153460
|
-
iconSize ?? DEFAULT_ICON_SIZE
|
|
153570
|
+
iconSize ?? DEFAULT_ICON_SIZE,
|
|
153461
153571
|
false
|
|
153462
153572
|
);
|
|
153463
153573
|
return iconPadding.value;
|
|
@@ -153971,7 +154081,7 @@ class DatePickerComponent extends React__default.Component {
|
|
|
153971
154081
|
DynamicSVG,
|
|
153972
154082
|
{
|
|
153973
154083
|
iconName: this.props.icon,
|
|
153974
|
-
size: this.props.iconSize ?? DEFAULT_ICON_SIZE
|
|
154084
|
+
size: this.props.iconSize ?? DEFAULT_ICON_SIZE
|
|
153975
154085
|
}
|
|
153976
154086
|
)
|
|
153977
154087
|
}
|
|
@@ -154004,258 +154114,6 @@ class DatePickerComponent extends React__default.Component {
|
|
|
154004
154114
|
);
|
|
154005
154115
|
}
|
|
154006
154116
|
}
|
|
154007
|
-
const DEFAULT_ICON_SIZE = 18;
|
|
154008
|
-
const DropdownEntireObjectOption$1 = "$$ENTIRE_OBJECT";
|
|
154009
|
-
const INVALID_LABEL_MSG = "Invalid label, should be a string";
|
|
154010
|
-
const extractDropdownOptions = (options, transformation) => {
|
|
154011
|
-
let opts = options;
|
|
154012
|
-
if (!Array.isArray(options)) {
|
|
154013
|
-
opts = [options];
|
|
154014
|
-
}
|
|
154015
|
-
let defaultLabelKey;
|
|
154016
|
-
const useEntireObjectAsValue = (transformation == null ? void 0 : transformation.value) === DropdownEntireObjectOption$1;
|
|
154017
|
-
const optionWithDefaultKey = (option) => {
|
|
154018
|
-
var _a2;
|
|
154019
|
-
if (defaultLabelKey) {
|
|
154020
|
-
return {
|
|
154021
|
-
label: typeof option[defaultLabelKey] === "object" ? INVALID_LABEL_MSG : option[defaultLabelKey],
|
|
154022
|
-
value: option
|
|
154023
|
-
};
|
|
154024
|
-
} else {
|
|
154025
|
-
defaultLabelKey = (_a2 = Object.keys(option).sort()) == null ? void 0 : _a2[0];
|
|
154026
|
-
return {
|
|
154027
|
-
label: typeof option[defaultLabelKey] === "object" ? INVALID_LABEL_MSG : option[defaultLabelKey],
|
|
154028
|
-
value: option
|
|
154029
|
-
};
|
|
154030
|
-
}
|
|
154031
|
-
};
|
|
154032
|
-
return opts.map((option) => {
|
|
154033
|
-
if (!option) {
|
|
154034
|
-
return null;
|
|
154035
|
-
}
|
|
154036
|
-
if (typeof option !== "object") {
|
|
154037
|
-
return { label: option, value: option };
|
|
154038
|
-
}
|
|
154039
|
-
if (transformation) {
|
|
154040
|
-
if (option[transformation.label] == null || !useEntireObjectAsValue && option[transformation.value] == null) {
|
|
154041
|
-
return optionWithDefaultKey(option);
|
|
154042
|
-
}
|
|
154043
|
-
return {
|
|
154044
|
-
label: typeof option[transformation.label] === "object" ? INVALID_LABEL_MSG : option[transformation.label],
|
|
154045
|
-
value: useEntireObjectAsValue ? option : option[transformation.value]
|
|
154046
|
-
};
|
|
154047
|
-
}
|
|
154048
|
-
if (option.label == null || option.value == null) {
|
|
154049
|
-
return optionWithDefaultKey(option);
|
|
154050
|
-
}
|
|
154051
|
-
return option;
|
|
154052
|
-
}).filter((opt) => opt && opt.value != null && opt.label != null);
|
|
154053
|
-
};
|
|
154054
|
-
const CellStyle = Ae$1`
|
|
154055
|
-
border-radius: 4px;
|
|
154056
|
-
z-index: 3;
|
|
154057
|
-
${({ $position }) => {
|
|
154058
|
-
return Ae$1`
|
|
154059
|
-
width: ${($position == null ? void 0 : $position.width) ? ($position == null ? void 0 : $position.width) - 2 : ""}px;
|
|
154060
|
-
`;
|
|
154061
|
-
}};
|
|
154062
|
-
box-shadow:
|
|
154063
|
-
0px 0px 1px rgba(27, 30, 34, 0.24),
|
|
154064
|
-
0px 1px 3px rgba(27, 30, 34, 0.12),
|
|
154065
|
-
0px 12px 24px rgba(27, 30, 34, 0.12);
|
|
154066
|
-
.bp5-control-group:not(.bp5-vertical) > *:not(.bp5-divider) {
|
|
154067
|
-
margin-right: 0px;
|
|
154068
|
-
}
|
|
154069
|
-
.bp5-control-group {
|
|
154070
|
-
// TODO(wylie): Follow the instructions here for removing .bp5-popover-wrapper
|
|
154071
|
-
// https://github.com/palantir/blueprint/wiki/Popover2-migration
|
|
154072
|
-
.bp5-input-group::before {
|
|
154073
|
-
top: 2px;
|
|
154074
|
-
height: 100%;
|
|
154075
|
-
}
|
|
154076
|
-
}
|
|
154077
|
-
&&& {
|
|
154078
|
-
.bp5-input,
|
|
154079
|
-
.bp5-multi-select {
|
|
154080
|
-
border: none !important; // blueprint border style is important, need to override
|
|
154081
|
-
.bp5-tag-input-values {
|
|
154082
|
-
margin-top: 0px;
|
|
154083
|
-
}
|
|
154084
|
-
}
|
|
154085
|
-
}
|
|
154086
|
-
|
|
154087
|
-
&&&&& {
|
|
154088
|
-
.bp5-tag {
|
|
154089
|
-
margin-top: 1px;
|
|
154090
|
-
}
|
|
154091
|
-
}
|
|
154092
|
-
|
|
154093
|
-
position: absolute;
|
|
154094
|
-
top: 0px;
|
|
154095
|
-
left: 0px;
|
|
154096
|
-
`;
|
|
154097
|
-
const InputCellWrapper = qe$1.div`
|
|
154098
|
-
${CellStyle}
|
|
154099
|
-
position: absolute;
|
|
154100
|
-
top: 0;
|
|
154101
|
-
left: 0;
|
|
154102
|
-
&&&&& {
|
|
154103
|
-
textarea {
|
|
154104
|
-
padding-top: 0px;
|
|
154105
|
-
padding-bottom: 0px;
|
|
154106
|
-
}
|
|
154107
|
-
input {
|
|
154108
|
-
${(props2) => {
|
|
154109
|
-
var _a2, _b2;
|
|
154110
|
-
const height = ((_a2 = props2.$position) == null ? void 0 : _a2.height) != null ? (_b2 = props2.$position) == null ? void 0 : _b2.height : 0;
|
|
154111
|
-
if (height) {
|
|
154112
|
-
return `height: ${height}px;`;
|
|
154113
|
-
}
|
|
154114
|
-
}}
|
|
154115
|
-
}
|
|
154116
|
-
textarea,
|
|
154117
|
-
input {
|
|
154118
|
-
padding-left: 10px;
|
|
154119
|
-
min-height: ${({ $position, $rowDensity }) => {
|
|
154120
|
-
const minHeight = ($position == null ? void 0 : $position.height) != null ? ($position == null ? void 0 : $position.height) - TABLE_SIZES[$rowDensity].ROW_PADDING * 2 : 0;
|
|
154121
|
-
return `${minHeight}px`;
|
|
154122
|
-
}};
|
|
154123
|
-
text-align: ${(props2) => {
|
|
154124
|
-
var _a2;
|
|
154125
|
-
if ((_a2 = props2 == null ? void 0 : props2.cellProperties) == null ? void 0 : _a2.horizontalAlign) {
|
|
154126
|
-
return TEXT_ALIGN[props2.cellProperties.horizontalAlign];
|
|
154127
|
-
}
|
|
154128
|
-
}};
|
|
154129
|
-
font-size: ${(props2) => {
|
|
154130
|
-
return `${TABLE_SIZES[props2.$rowDensity].ROW_FONT_SIZE}px`;
|
|
154131
|
-
}};
|
|
154132
|
-
line-height: 1.5;
|
|
154133
|
-
border: none;
|
|
154134
|
-
&:focus {
|
|
154135
|
-
border: none;
|
|
154136
|
-
box-shadow: none;
|
|
154137
|
-
}
|
|
154138
|
-
}
|
|
154139
|
-
}
|
|
154140
|
-
`;
|
|
154141
|
-
const DropdownCellWrapper = qe$1.div`
|
|
154142
|
-
${CellStyle};
|
|
154143
|
-
height: 100%;
|
|
154144
|
-
.${CONTROL_GROUP} {
|
|
154145
|
-
height: 100%;
|
|
154146
|
-
}
|
|
154147
|
-
|
|
154148
|
-
&&&&& .${POPOVER_OPEN$1} input {
|
|
154149
|
-
${({ clearable }) => clearable && "padding-right: 50px"}
|
|
154150
|
-
}
|
|
154151
|
-
|
|
154152
|
-
.dropdown-wrapper {
|
|
154153
|
-
height: 100%;
|
|
154154
|
-
*:not(.${CLASS_NAMES.DROPDOWN_CLEAR_ICON}) {
|
|
154155
|
-
height: 100%;
|
|
154156
|
-
}
|
|
154157
|
-
.${CLASS_NAMES.INPUT}::before {
|
|
154158
|
-
top: calc(50% + 1px);
|
|
154159
|
-
transform: translateY(-50%);
|
|
154160
|
-
height: ${DEFAULT_ICON_SIZE}px;
|
|
154161
|
-
}
|
|
154162
|
-
|
|
154163
|
-
input {
|
|
154164
|
-
height: 100%;
|
|
154165
|
-
}
|
|
154166
|
-
}
|
|
154167
|
-
`;
|
|
154168
|
-
const DateCellWrapper = qe$1(DropdownCellWrapper)`
|
|
154169
|
-
${CellStyle}
|
|
154170
|
-
height: 100%;
|
|
154171
|
-
.${CONTROL_GROUP} {
|
|
154172
|
-
height: 100%;
|
|
154173
|
-
}
|
|
154174
|
-
.${POPOVER_TARGET$1} {
|
|
154175
|
-
height: 100%;
|
|
154176
|
-
* {
|
|
154177
|
-
height: 100%;
|
|
154178
|
-
}
|
|
154179
|
-
}
|
|
154180
|
-
&&&&& {
|
|
154181
|
-
input {
|
|
154182
|
-
height: 100%;
|
|
154183
|
-
min-height: 100%;
|
|
154184
|
-
top: 0px;
|
|
154185
|
-
padding-top: 0px;
|
|
154186
|
-
padding-bottom: 0px;
|
|
154187
|
-
}
|
|
154188
|
-
}
|
|
154189
|
-
`;
|
|
154190
|
-
const EditDateCell = (props2) => {
|
|
154191
|
-
const { value, editProps, inputPosition } = props2;
|
|
154192
|
-
const { handleEditStop, editMinDate, editMaxDate, editTwentyFourHourTime } = editProps;
|
|
154193
|
-
const {
|
|
154194
|
-
inputFormat,
|
|
154195
|
-
outputFormat,
|
|
154196
|
-
timezone,
|
|
154197
|
-
manageTimezone,
|
|
154198
|
-
displayTimezone
|
|
154199
|
-
} = props2.cellProps;
|
|
154200
|
-
const [date4, setDate2] = useState(value);
|
|
154201
|
-
const [closed, setClosed] = useState(false);
|
|
154202
|
-
const handleDateChange = useCallback(
|
|
154203
|
-
(date22) => {
|
|
154204
|
-
setDate2(date22);
|
|
154205
|
-
},
|
|
154206
|
-
[setDate2]
|
|
154207
|
-
);
|
|
154208
|
-
const handleDatepickerClose = useCallback(() => {
|
|
154209
|
-
if (closed) return;
|
|
154210
|
-
setClosed(true);
|
|
154211
|
-
handleEditStop({ shouldSave: true, value: date4, validationErrors: [] });
|
|
154212
|
-
}, [handleEditStop, closed, date4]);
|
|
154213
|
-
useEffect(() => {
|
|
154214
|
-
return () => {
|
|
154215
|
-
handleEditStop({ shouldSave: false });
|
|
154216
|
-
};
|
|
154217
|
-
}, []);
|
|
154218
|
-
const formattedMinDate = useMemo$2(() => {
|
|
154219
|
-
if (editMinDate) {
|
|
154220
|
-
return hooks(editMinDate, ISO_DATE_FORMAT).format(ISO_DATE_FORMAT);
|
|
154221
|
-
}
|
|
154222
|
-
}, [editMinDate]);
|
|
154223
|
-
const formattedMaxDate = useMemo$2(() => {
|
|
154224
|
-
if (editMaxDate) {
|
|
154225
|
-
return hooks(editMaxDate, ISO_DATE_FORMAT).format(ISO_DATE_FORMAT);
|
|
154226
|
-
}
|
|
154227
|
-
}, [editMaxDate]);
|
|
154228
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154229
|
-
DateCellWrapper,
|
|
154230
|
-
{
|
|
154231
|
-
$position: inputPosition,
|
|
154232
|
-
$rowDensity: props2.rowDensity,
|
|
154233
|
-
cellProperties: props2.cellProps.cellProperties,
|
|
154234
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154235
|
-
DatePickerComponent,
|
|
154236
|
-
{
|
|
154237
|
-
label: "",
|
|
154238
|
-
dateFormat: inputFormat,
|
|
154239
|
-
displayDateFormat: outputFormat,
|
|
154240
|
-
datePickerType: DatePickerType.DATE_PICKER,
|
|
154241
|
-
onDateSelected: handleDateChange,
|
|
154242
|
-
isLoading: false,
|
|
154243
|
-
isDisabled: false,
|
|
154244
|
-
selectedDate: date4,
|
|
154245
|
-
forceOpen: true,
|
|
154246
|
-
onDatePickerClosed: handleDatepickerClose,
|
|
154247
|
-
use24HourTime: editTwentyFourHourTime ?? true,
|
|
154248
|
-
minDate: formattedMinDate,
|
|
154249
|
-
maxDate: formattedMaxDate,
|
|
154250
|
-
timezone: manageTimezone ? timezone : void 0,
|
|
154251
|
-
displayTimezone: manageTimezone ? displayTimezone : void 0,
|
|
154252
|
-
showTimezone: false,
|
|
154253
|
-
errorMessagePlacement: "tooltip"
|
|
154254
|
-
}
|
|
154255
|
-
)
|
|
154256
|
-
}
|
|
154257
|
-
);
|
|
154258
|
-
};
|
|
154259
154117
|
function usePointerDownOutside({
|
|
154260
154118
|
wrapperRefs,
|
|
154261
154119
|
wrapperIds,
|
|
@@ -154302,385 +154160,6 @@ function usePointerDownOutside({
|
|
|
154302
154160
|
};
|
|
154303
154161
|
}, [wrapperRefs, wrapperIds, wrapperSelectors, onClickOutside]);
|
|
154304
154162
|
}
|
|
154305
|
-
const EditInputCell = (props2) => {
|
|
154306
|
-
var _a2, _b2, _c2;
|
|
154307
|
-
const { value, editProps, targetCellRef, inputPosition } = props2;
|
|
154308
|
-
const {
|
|
154309
|
-
handleEditStop,
|
|
154310
|
-
editInputType,
|
|
154311
|
-
editCustomValidationRule,
|
|
154312
|
-
editCustomErrorMessage,
|
|
154313
|
-
editMaxLength,
|
|
154314
|
-
editMinLength,
|
|
154315
|
-
editIsRequired,
|
|
154316
|
-
handleEditChange
|
|
154317
|
-
} = editProps;
|
|
154318
|
-
const [inputValue, setInputValue] = useState(
|
|
154319
|
-
typeof value === "object" && value ? JSON.stringify(value, null, 2) : value
|
|
154320
|
-
);
|
|
154321
|
-
const inputMemo = useRef(inputValue);
|
|
154322
|
-
const [validationErrors, setValidationErrors] = useState([]);
|
|
154323
|
-
const inputWrapperRef = useRef(null);
|
|
154324
|
-
const validateValue = useCallback(
|
|
154325
|
-
(toValidate) => {
|
|
154326
|
-
const errors2 = getInputValidationErrors({
|
|
154327
|
-
inputType: editInputType ?? "TEXT",
|
|
154328
|
-
text: String(toValidate ?? ""),
|
|
154329
|
-
emailRegex: new RegExp(`^${EmailRegexString}$`),
|
|
154330
|
-
customValidationRule: String(editCustomValidationRule),
|
|
154331
|
-
customErrorMessage: editCustomErrorMessage,
|
|
154332
|
-
maxLength: editMaxLength,
|
|
154333
|
-
minLength: editMinLength,
|
|
154334
|
-
isRequired: editIsRequired ?? false
|
|
154335
|
-
});
|
|
154336
|
-
const validationErrors2 = getErrorMessages(errors2);
|
|
154337
|
-
setValidationErrors(validationErrors2);
|
|
154338
|
-
return validationErrors2;
|
|
154339
|
-
},
|
|
154340
|
-
[
|
|
154341
|
-
editInputType,
|
|
154342
|
-
editCustomValidationRule,
|
|
154343
|
-
editCustomErrorMessage,
|
|
154344
|
-
editMaxLength,
|
|
154345
|
-
editMinLength,
|
|
154346
|
-
editIsRequired
|
|
154347
|
-
]
|
|
154348
|
-
);
|
|
154349
|
-
useEffect(() => {
|
|
154350
|
-
validateValue(inputMemo.current);
|
|
154351
|
-
}, [validateValue]);
|
|
154352
|
-
const debouncedValidation = c(validateValue, 50);
|
|
154353
|
-
const handleValueChange = useCallback(
|
|
154354
|
-
(val) => {
|
|
154355
|
-
setInputValue(val);
|
|
154356
|
-
inputMemo.current = val;
|
|
154357
|
-
handleEditChange(val);
|
|
154358
|
-
debouncedValidation(val);
|
|
154359
|
-
},
|
|
154360
|
-
[debouncedValidation, handleEditChange]
|
|
154361
|
-
);
|
|
154362
|
-
const handleKeyDown = useCallback(
|
|
154363
|
-
(e3) => {
|
|
154364
|
-
if (e3.key === "Enter") {
|
|
154365
|
-
e3.preventDefault();
|
|
154366
|
-
const errors2 = validateValue(inputMemo.current);
|
|
154367
|
-
handleEditStop({
|
|
154368
|
-
shouldSave: true,
|
|
154369
|
-
value: inputMemo.current,
|
|
154370
|
-
validationErrors: errors2
|
|
154371
|
-
});
|
|
154372
|
-
}
|
|
154373
|
-
if (e3.key !== "Tab" && e3.key !== "Escape" && e3.key !== "Enter") {
|
|
154374
|
-
e3.stopPropagation();
|
|
154375
|
-
}
|
|
154376
|
-
},
|
|
154377
|
-
[handleEditStop, validateValue]
|
|
154378
|
-
);
|
|
154379
|
-
const saveChange = useCallback(() => {
|
|
154380
|
-
handleEditStop({
|
|
154381
|
-
shouldSave: true,
|
|
154382
|
-
value: inputValue,
|
|
154383
|
-
validationErrors
|
|
154384
|
-
});
|
|
154385
|
-
}, [handleEditStop, inputValue, validationErrors]);
|
|
154386
|
-
usePointerDownOutside({
|
|
154387
|
-
wrapperRefs: [inputWrapperRef],
|
|
154388
|
-
wrapperSelectors: ["[data-test=table-edit-input]"],
|
|
154389
|
-
onClickOutside: saveChange
|
|
154390
|
-
});
|
|
154391
|
-
useEffect(() => {
|
|
154392
|
-
return () => {
|
|
154393
|
-
handleEditStop({ shouldSave: false });
|
|
154394
|
-
};
|
|
154395
|
-
}, []);
|
|
154396
|
-
if (!targetCellRef.current || typeof (inputPosition == null ? void 0 : inputPosition.top) === "undefined" || // Validate that the intended element exists
|
|
154397
|
-
!((_c2 = (_b2 = (_a2 = targetCellRef.current.childNodes) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.getAttribute) == null ? void 0 : _c2.call(
|
|
154398
|
-
_b2,
|
|
154399
|
-
"data-superblocks"
|
|
154400
|
-
))) {
|
|
154401
|
-
return null;
|
|
154402
|
-
}
|
|
154403
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154404
|
-
Popper,
|
|
154405
|
-
{
|
|
154406
|
-
targetNode: targetCellRef.current.childNodes[0],
|
|
154407
|
-
isOpen: true,
|
|
154408
|
-
placement: "auto",
|
|
154409
|
-
useDefaultModifiers: false,
|
|
154410
|
-
zIndex: 1,
|
|
154411
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154412
|
-
InputCellWrapper,
|
|
154413
|
-
{
|
|
154414
|
-
"data-test": `table-edit-input`,
|
|
154415
|
-
$position: inputPosition,
|
|
154416
|
-
$rowDensity: props2.rowDensity,
|
|
154417
|
-
cellProperties: props2.cellProps.cellProperties,
|
|
154418
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154419
|
-
"input",
|
|
154420
|
-
{
|
|
154421
|
-
value: inputValue,
|
|
154422
|
-
onChange: handleValueChange,
|
|
154423
|
-
onKeyDown: handleKeyDown
|
|
154424
|
-
}
|
|
154425
|
-
)
|
|
154426
|
-
}
|
|
154427
|
-
)
|
|
154428
|
-
}
|
|
154429
|
-
);
|
|
154430
|
-
};
|
|
154431
|
-
const EditMultiSelectCell = (props2) => {
|
|
154432
|
-
const dropdownRef = useRef(null);
|
|
154433
|
-
const { editProps, inputPosition, cellProps } = props2;
|
|
154434
|
-
const {
|
|
154435
|
-
currentEditValue,
|
|
154436
|
-
handleEditStop,
|
|
154437
|
-
handleEditChange,
|
|
154438
|
-
editIsRequired,
|
|
154439
|
-
editOptions = [],
|
|
154440
|
-
transformation,
|
|
154441
|
-
onDropdownSearchTextChanged
|
|
154442
|
-
// editDropdownClientSideFiltering,
|
|
154443
|
-
// currentEditDropdownSearchText,
|
|
154444
|
-
// dropdownOptionsLoading,
|
|
154445
|
-
} = editProps;
|
|
154446
|
-
const selectedOptions = useMemo$2(() => {
|
|
154447
|
-
return Array.isArray(currentEditValue) ? currentEditValue : currentEditValue != null ? [currentEditValue] : [];
|
|
154448
|
-
}, [currentEditValue]);
|
|
154449
|
-
const transformedEditOptions = useMemo$2(() => {
|
|
154450
|
-
return extractDropdownOptions(editOptions, transformation);
|
|
154451
|
-
}, [editOptions, transformation]);
|
|
154452
|
-
useMemo$2(() => {
|
|
154453
|
-
return selectedOptions ? selectedOptions.map((o) => lodashExports.findIndex(transformedEditOptions, { value: o })).filter((ind) => ind !== -1) : [];
|
|
154454
|
-
}, [selectedOptions, transformedEditOptions]);
|
|
154455
|
-
useCallback(
|
|
154456
|
-
(selectedOption) => {
|
|
154457
|
-
if (selectedOption) {
|
|
154458
|
-
const isAlreadySelected = selectedOptions.includes(
|
|
154459
|
-
selectedOption.value
|
|
154460
|
-
);
|
|
154461
|
-
if (!isAlreadySelected) {
|
|
154462
|
-
handleEditChange(
|
|
154463
|
-
[...selectedOptions, selectedOption.value],
|
|
154464
|
-
[
|
|
154465
|
-
{
|
|
154466
|
-
label: selectedOption.label,
|
|
154467
|
-
value: JSON.stringify(selectedOption.value)
|
|
154468
|
-
}
|
|
154469
|
-
]
|
|
154470
|
-
);
|
|
154471
|
-
} else {
|
|
154472
|
-
handleEditChange(
|
|
154473
|
-
selectedOptions.filter(
|
|
154474
|
-
(opt) => opt !== selectedOption.value,
|
|
154475
|
-
[selectedOption]
|
|
154476
|
-
)
|
|
154477
|
-
);
|
|
154478
|
-
}
|
|
154479
|
-
}
|
|
154480
|
-
},
|
|
154481
|
-
[handleEditChange, selectedOptions]
|
|
154482
|
-
);
|
|
154483
|
-
useCallback(
|
|
154484
|
-
(removedIndex) => {
|
|
154485
|
-
const newSelectedValues = selectedOptions.filter(
|
|
154486
|
-
(value) => lodashExports.findIndex(transformedEditOptions, { value }) !== removedIndex
|
|
154487
|
-
);
|
|
154488
|
-
handleEditChange(newSelectedValues);
|
|
154489
|
-
},
|
|
154490
|
-
[handleEditChange, selectedOptions, transformedEditOptions]
|
|
154491
|
-
);
|
|
154492
|
-
useCallback(
|
|
154493
|
-
(options) => {
|
|
154494
|
-
handleEditChange(
|
|
154495
|
-
options.map(({ value }) => value),
|
|
154496
|
-
options.map((val) => ({ ...val, value: JSON.stringify(val.value) }))
|
|
154497
|
-
);
|
|
154498
|
-
},
|
|
154499
|
-
[handleEditChange]
|
|
154500
|
-
);
|
|
154501
|
-
useCallback(
|
|
154502
|
-
(query) => {
|
|
154503
|
-
onDropdownSearchTextChanged == null ? void 0 : onDropdownSearchTextChanged(query);
|
|
154504
|
-
},
|
|
154505
|
-
[onDropdownSearchTextChanged]
|
|
154506
|
-
);
|
|
154507
|
-
const handleDropdownClose = useCallback(() => {
|
|
154508
|
-
const validationErrors = selectedOptions.length === 0 && editIsRequired ? ["This field is required"] : [];
|
|
154509
|
-
handleEditStop({
|
|
154510
|
-
shouldSave: true,
|
|
154511
|
-
value: selectedOptions,
|
|
154512
|
-
validationErrors
|
|
154513
|
-
});
|
|
154514
|
-
}, [handleEditStop, selectedOptions, editIsRequired]);
|
|
154515
|
-
usePointerDownOutside({
|
|
154516
|
-
onClickOutside: handleDropdownClose,
|
|
154517
|
-
wrapperRefs: [dropdownRef],
|
|
154518
|
-
wrapperSelectors: [".bp5-multi-select-popover"]
|
|
154519
|
-
});
|
|
154520
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154521
|
-
DropdownCellWrapper,
|
|
154522
|
-
{
|
|
154523
|
-
$position: inputPosition,
|
|
154524
|
-
$rowDensity: props2.rowDensity,
|
|
154525
|
-
ref: dropdownRef,
|
|
154526
|
-
cellProperties: cellProps.cellProperties
|
|
154527
|
-
}
|
|
154528
|
-
);
|
|
154529
|
-
};
|
|
154530
|
-
const EditSingleSelectCell = (props2) => {
|
|
154531
|
-
const { value, editProps, inputPosition } = props2;
|
|
154532
|
-
const {
|
|
154533
|
-
handleEditStop,
|
|
154534
|
-
// editIsRequired,
|
|
154535
|
-
editOptions = [],
|
|
154536
|
-
transformation,
|
|
154537
|
-
onDropdownSearchTextChanged,
|
|
154538
|
-
editDropdownClientSideFiltering,
|
|
154539
|
-
// currentEditDropdownSearchText,
|
|
154540
|
-
// dropdownOptionsLoading,
|
|
154541
|
-
allowClearing
|
|
154542
|
-
} = editProps;
|
|
154543
|
-
const transformedEditOptions = useMemo$2(() => {
|
|
154544
|
-
return extractDropdownOptions(editOptions, transformation);
|
|
154545
|
-
}, [editOptions, transformation]);
|
|
154546
|
-
useMemo$2(() => {
|
|
154547
|
-
return transformedEditOptions.findIndex((opt) => opt.value === value);
|
|
154548
|
-
}, [value, transformedEditOptions]);
|
|
154549
|
-
useCallback(
|
|
154550
|
-
(val) => {
|
|
154551
|
-
handleEditStop({
|
|
154552
|
-
shouldSave: true,
|
|
154553
|
-
value: val == null ? void 0 : val.value,
|
|
154554
|
-
validationErrors: [],
|
|
154555
|
-
dropdownOption: {
|
|
154556
|
-
...val,
|
|
154557
|
-
value: (val == null ? void 0 : val.value) ? JSON.stringify(val == null ? void 0 : val.value) : ""
|
|
154558
|
-
}
|
|
154559
|
-
});
|
|
154560
|
-
},
|
|
154561
|
-
[handleEditStop]
|
|
154562
|
-
);
|
|
154563
|
-
useCallback(
|
|
154564
|
-
(query) => {
|
|
154565
|
-
onDropdownSearchTextChanged == null ? void 0 : onDropdownSearchTextChanged(query);
|
|
154566
|
-
},
|
|
154567
|
-
[onDropdownSearchTextChanged]
|
|
154568
|
-
);
|
|
154569
|
-
useEffect(() => {
|
|
154570
|
-
return () => {
|
|
154571
|
-
if (editDropdownClientSideFiltering) {
|
|
154572
|
-
handleEditStop({ shouldSave: false });
|
|
154573
|
-
}
|
|
154574
|
-
};
|
|
154575
|
-
}, [editDropdownClientSideFiltering]);
|
|
154576
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154577
|
-
DropdownCellWrapper,
|
|
154578
|
-
{
|
|
154579
|
-
$rowDensity: props2.rowDensity,
|
|
154580
|
-
cellProperties: props2.cellProps.cellProperties,
|
|
154581
|
-
$position: inputPosition,
|
|
154582
|
-
clearable: allowClearing
|
|
154583
|
-
}
|
|
154584
|
-
);
|
|
154585
|
-
};
|
|
154586
|
-
const useGetInputPosition = (tableEl, cellEl) => {
|
|
154587
|
-
const firstRender = useRef(true);
|
|
154588
|
-
const [tableRect, setTableRect] = useState();
|
|
154589
|
-
const [cellRect, setCellRect] = useState();
|
|
154590
|
-
const measureTable = useCallback(() => {
|
|
154591
|
-
if (tableEl) {
|
|
154592
|
-
setTableRect(tableEl.getBoundingClientRect());
|
|
154593
|
-
}
|
|
154594
|
-
}, [tableEl]);
|
|
154595
|
-
const measureCell = useCallback(() => {
|
|
154596
|
-
if (cellEl) {
|
|
154597
|
-
setCellRect(cellEl.getBoundingClientRect());
|
|
154598
|
-
}
|
|
154599
|
-
}, [cellEl]);
|
|
154600
|
-
const measureCellAndTable = useCallback(() => {
|
|
154601
|
-
measureCell();
|
|
154602
|
-
measureTable();
|
|
154603
|
-
}, [measureCell, measureTable]);
|
|
154604
|
-
const debouncedMeasureCellAndTable = c(
|
|
154605
|
-
measureCellAndTable,
|
|
154606
|
-
10
|
|
154607
|
-
);
|
|
154608
|
-
const debouncedMeasureCell = c(measureCell, 10);
|
|
154609
|
-
useLayoutEffect$2(measureTable, [measureTable]);
|
|
154610
|
-
useLayoutEffect$2(measureCell, [measureCell]);
|
|
154611
|
-
if (firstRender.current) {
|
|
154612
|
-
firstRender.current = false;
|
|
154613
|
-
measureTable();
|
|
154614
|
-
measureCell();
|
|
154615
|
-
}
|
|
154616
|
-
useEffect(() => {
|
|
154617
|
-
if (debouncedMeasureCell) {
|
|
154618
|
-
tableEl == null ? void 0 : tableEl.addEventListener("scroll", debouncedMeasureCell);
|
|
154619
|
-
}
|
|
154620
|
-
return () => {
|
|
154621
|
-
if (debouncedMeasureCell) {
|
|
154622
|
-
tableEl == null ? void 0 : tableEl.removeEventListener("scroll", debouncedMeasureCell);
|
|
154623
|
-
}
|
|
154624
|
-
};
|
|
154625
|
-
}, [tableEl, debouncedMeasureCell]);
|
|
154626
|
-
useResizeObserver(
|
|
154627
|
-
tableEl,
|
|
154628
|
-
debouncedMeasureCellAndTable ?? measureCellAndTable
|
|
154629
|
-
);
|
|
154630
|
-
useResizeObserver(cellEl, debouncedMeasureCell ?? measureCell);
|
|
154631
|
-
const top2 = cellRect && tableRect && tableEl ? cellRect.top - tableRect.top + tableEl.scrollTop : void 0;
|
|
154632
|
-
const left2 = cellRect && tableRect && tableEl ? cellRect.left - tableRect.left + tableEl.scrollLeft : void 0;
|
|
154633
|
-
return {
|
|
154634
|
-
width: (cellRect == null ? void 0 : cellRect.width) && left2 === 0 ? (cellRect == null ? void 0 : cellRect.width) - 10 : cellRect == null ? void 0 : cellRect.width,
|
|
154635
|
-
height: cellRect == null ? void 0 : cellRect.height,
|
|
154636
|
-
top: top2,
|
|
154637
|
-
left: left2 === 0 ? 10 : left2,
|
|
154638
|
-
maxHeight: tableRect && top2 ? (tableRect == null ? void 0 : tableRect.height) - top2 : void 0
|
|
154639
|
-
};
|
|
154640
|
-
};
|
|
154641
|
-
const EditCell = (props2) => {
|
|
154642
|
-
var _a2;
|
|
154643
|
-
const tableRef = useRef(
|
|
154644
|
-
document == null ? void 0 : document.querySelector(
|
|
154645
|
-
`[data-test=table-component-${props2.tableName}] tbody`
|
|
154646
|
-
)
|
|
154647
|
-
);
|
|
154648
|
-
const inputPosition = useGetInputPosition(
|
|
154649
|
-
tableRef == null ? void 0 : tableRef.current,
|
|
154650
|
-
(_a2 = props2.targetCellRef) == null ? void 0 : _a2.current
|
|
154651
|
-
);
|
|
154652
|
-
const propsToPass = useMemo$2(() => {
|
|
154653
|
-
return {
|
|
154654
|
-
editProps: props2.editProps,
|
|
154655
|
-
value: props2.value,
|
|
154656
|
-
rowDensity: props2.rowDensity,
|
|
154657
|
-
cellProps: props2.cellProps,
|
|
154658
|
-
inputPosition,
|
|
154659
|
-
theme: props2.theme
|
|
154660
|
-
};
|
|
154661
|
-
}, [
|
|
154662
|
-
inputPosition,
|
|
154663
|
-
props2.cellProps,
|
|
154664
|
-
props2.rowDensity,
|
|
154665
|
-
props2.editProps,
|
|
154666
|
-
props2.value,
|
|
154667
|
-
props2.theme
|
|
154668
|
-
]);
|
|
154669
|
-
switch (props2.editProps.editInputType) {
|
|
154670
|
-
case EditInputType.Dropdown:
|
|
154671
|
-
if (props2.editProps.editMultiSelect) {
|
|
154672
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(EditMultiSelectCell, { ...propsToPass });
|
|
154673
|
-
}
|
|
154674
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(EditSingleSelectCell, { ...propsToPass });
|
|
154675
|
-
case EditInputType.Date:
|
|
154676
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(EditDateCell, { ...propsToPass });
|
|
154677
|
-
case EditInputType.Email:
|
|
154678
|
-
case EditInputType.Number:
|
|
154679
|
-
case EditInputType.Text:
|
|
154680
|
-
default:
|
|
154681
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(EditInputCell, { ...propsToPass, targetCellRef: props2.targetCellRef });
|
|
154682
|
-
}
|
|
154683
|
-
};
|
|
154684
154163
|
const CheckboxInput = ({
|
|
154685
154164
|
isChecked,
|
|
154686
154165
|
isDisabled,
|
|
@@ -154731,279 +154210,6 @@ const CheckboxInput = ({
|
|
|
154731
154210
|
}
|
|
154732
154211
|
);
|
|
154733
154212
|
};
|
|
154734
|
-
const StyledCellWrapper = qe$1(CellWrapper)`
|
|
154735
|
-
${(props2) => {
|
|
154736
|
-
var _a2, _b2;
|
|
154737
|
-
return ((_a2 = props2 == null ? void 0 : props2.cellProperties) == null ? void 0 : _a2.horizontalAlign) === HorizontalAlignment.right ? "padding-right: 10px;" : ((_b2 = props2 == null ? void 0 : props2.cellProperties) == null ? void 0 : _b2.horizontalAlign) === HorizontalAlignment.center ? "padding-left: 19px;" : "";
|
|
154738
|
-
}};
|
|
154739
|
-
|
|
154740
|
-
> div {
|
|
154741
|
-
width: unset !important;
|
|
154742
|
-
}
|
|
154743
|
-
|
|
154744
|
-
.checkbox-container {
|
|
154745
|
-
display: none;
|
|
154746
|
-
}
|
|
154747
|
-
|
|
154748
|
-
.read-mode-component {
|
|
154749
|
-
display: flex;
|
|
154750
|
-
}
|
|
154751
|
-
|
|
154752
|
-
&[data-is-focused="true"] {
|
|
154753
|
-
.read-mode-component {
|
|
154754
|
-
display: none;
|
|
154755
|
-
}
|
|
154756
|
-
|
|
154757
|
-
.checkbox-container {
|
|
154758
|
-
display: flex;
|
|
154759
|
-
}
|
|
154760
|
-
}
|
|
154761
|
-
|
|
154762
|
-
&:hover:not([data-is-focused="true"]) {
|
|
154763
|
-
.read-mode-component {
|
|
154764
|
-
display: none;
|
|
154765
|
-
}
|
|
154766
|
-
|
|
154767
|
-
.checkbox-container {
|
|
154768
|
-
display: flex;
|
|
154769
|
-
}
|
|
154770
|
-
}
|
|
154771
|
-
`;
|
|
154772
|
-
const EditCheckboxCell = (props2) => {
|
|
154773
|
-
var _a2;
|
|
154774
|
-
const {
|
|
154775
|
-
value,
|
|
154776
|
-
editProps,
|
|
154777
|
-
readModeComponent,
|
|
154778
|
-
isFocused: propsIsFocused
|
|
154779
|
-
} = props2;
|
|
154780
|
-
const { handleOneClickEdit } = editProps;
|
|
154781
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
154782
|
-
StyledCellWrapper,
|
|
154783
|
-
{
|
|
154784
|
-
rowDensity: props2.rowDensity,
|
|
154785
|
-
cellProperties: props2.cellProperties,
|
|
154786
|
-
"data-is-focused": propsIsFocused,
|
|
154787
|
-
"data-test": `edit-checkbox-active-${value}`,
|
|
154788
|
-
style: {
|
|
154789
|
-
height: ((_a2 = TABLE_SIZES == null ? void 0 : TABLE_SIZES[props2.rowDensity]) == null ? void 0 : _a2.ROW_HEIGHT) - 8
|
|
154790
|
-
},
|
|
154791
|
-
children: [
|
|
154792
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154793
|
-
"div",
|
|
154794
|
-
{
|
|
154795
|
-
className: "read-mode-component",
|
|
154796
|
-
"data-test": `edit-checkbox-${value}`,
|
|
154797
|
-
style: {
|
|
154798
|
-
height: "100%",
|
|
154799
|
-
alignItems: "center"
|
|
154800
|
-
},
|
|
154801
|
-
children: readModeComponent
|
|
154802
|
-
}
|
|
154803
|
-
),
|
|
154804
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154805
|
-
CheckboxInput,
|
|
154806
|
-
{
|
|
154807
|
-
isChecked: value,
|
|
154808
|
-
isValid: true,
|
|
154809
|
-
isDisabled: false,
|
|
154810
|
-
onClick: handleOneClickEdit
|
|
154811
|
-
}
|
|
154812
|
-
)
|
|
154813
|
-
]
|
|
154814
|
-
}
|
|
154815
|
-
);
|
|
154816
|
-
};
|
|
154817
|
-
const LinkLike = qe$1.div`
|
|
154818
|
-
cursor: pointer;
|
|
154819
|
-
`;
|
|
154820
|
-
const IconStyles = Ae$1`
|
|
154821
|
-
height: ${({ rowDensity }) => {
|
|
154822
|
-
var _a2;
|
|
154823
|
-
return ((_a2 = TABLE_SIZES[rowDensity]) == null ? void 0 : _a2.LINK_MENU_HEIGHT) ?? 32;
|
|
154824
|
-
}}px;
|
|
154825
|
-
padding: ${({ rowDensity }) => rowDensity === RowDensity["extra-small"] ? "7px" : rowDensity === RowDensity.small ? "9px" : "10px"};
|
|
154826
|
-
`;
|
|
154827
|
-
const StyledButton = qe$1(Button$5)`
|
|
154828
|
-
border: none;
|
|
154829
|
-
${IconStyles}
|
|
154830
|
-
`;
|
|
154831
|
-
const LinkMenu = qe$1.div`
|
|
154832
|
-
display: flex;
|
|
154833
|
-
align-items: center;
|
|
154834
|
-
a {
|
|
154835
|
-
${IconStyles}
|
|
154836
|
-
}
|
|
154837
|
-
|
|
154838
|
-
svg > path {
|
|
154839
|
-
fill: none !important;
|
|
154840
|
-
}
|
|
154841
|
-
`;
|
|
154842
|
-
const OpenLinkButton = ({
|
|
154843
|
-
url: url2,
|
|
154844
|
-
openInNewTab,
|
|
154845
|
-
rowDensity
|
|
154846
|
-
}) => {
|
|
154847
|
-
var _a2, _b2, _c2, _d2;
|
|
154848
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip$2, { title: "Open", children: openInNewTab === void 0 || openInNewTab === true ? (
|
|
154849
|
-
// todo laura: ask omar about how linking should work
|
|
154850
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154851
|
-
"a",
|
|
154852
|
-
{
|
|
154853
|
-
href: url2,
|
|
154854
|
-
target: "_blank",
|
|
154855
|
-
"aria-disabled": true,
|
|
154856
|
-
"data-test": "table-cell-link-open",
|
|
154857
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154858
|
-
SvgExternalLink,
|
|
154859
|
-
{
|
|
154860
|
-
style: {
|
|
154861
|
-
height: ((_a2 = TABLE_SIZES[rowDensity]) == null ? void 0 : _a2.LINK_MENU_ICON_SIZE) ?? 16,
|
|
154862
|
-
width: ((_b2 = TABLE_SIZES[rowDensity]) == null ? void 0 : _b2.LINK_MENU_ICON_SIZE) ?? 16
|
|
154863
|
-
}
|
|
154864
|
-
}
|
|
154865
|
-
)
|
|
154866
|
-
}
|
|
154867
|
-
)
|
|
154868
|
-
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154869
|
-
PlainLink,
|
|
154870
|
-
{
|
|
154871
|
-
href: url2,
|
|
154872
|
-
rel: "noreferrer nofollow",
|
|
154873
|
-
target: "_parent",
|
|
154874
|
-
"data-test": "table-cell-link-open",
|
|
154875
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154876
|
-
SvgExternalLink,
|
|
154877
|
-
{
|
|
154878
|
-
style: {
|
|
154879
|
-
height: ((_c2 = TABLE_SIZES[rowDensity]) == null ? void 0 : _c2.LINK_MENU_ICON_SIZE) ?? 16,
|
|
154880
|
-
width: ((_d2 = TABLE_SIZES[rowDensity]) == null ? void 0 : _d2.LINK_MENU_ICON_SIZE) ?? 16
|
|
154881
|
-
}
|
|
154882
|
-
}
|
|
154883
|
-
)
|
|
154884
|
-
}
|
|
154885
|
-
) });
|
|
154886
|
-
};
|
|
154887
|
-
const EditableLinkCell = (props2) => {
|
|
154888
|
-
const {
|
|
154889
|
-
isHidden: isHidden2,
|
|
154890
|
-
url: url2,
|
|
154891
|
-
label,
|
|
154892
|
-
openInNewTab,
|
|
154893
|
-
isEdited,
|
|
154894
|
-
value,
|
|
154895
|
-
cellProperties,
|
|
154896
|
-
rowDensity,
|
|
154897
|
-
isFocused,
|
|
154898
|
-
defaultValue: defaultValue2,
|
|
154899
|
-
maxLinesPerRow,
|
|
154900
|
-
isMultiselecting
|
|
154901
|
-
} = props2;
|
|
154902
|
-
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
154903
|
-
const cellRef = useRef(null);
|
|
154904
|
-
const popperRef = useRef(null);
|
|
154905
|
-
useEffect(() => {
|
|
154906
|
-
if (isMenuOpen && !isFocused) {
|
|
154907
|
-
setIsMenuOpen(false);
|
|
154908
|
-
} else if (!isMenuOpen && isFocused) {
|
|
154909
|
-
setIsMenuOpen(true);
|
|
154910
|
-
}
|
|
154911
|
-
}, [isFocused, isMenuOpen]);
|
|
154912
|
-
const { cellTextStyle, horizontalAlign, verticalAlign, textWrap } = cellProperties;
|
|
154913
|
-
const [className, styles] = useMemo$2(() => {
|
|
154914
|
-
const options = {
|
|
154915
|
-
canWrap: textWrap,
|
|
154916
|
-
maxLines: maxLinesPerRow
|
|
154917
|
-
};
|
|
154918
|
-
return [
|
|
154919
|
-
getCellClass(options),
|
|
154920
|
-
{
|
|
154921
|
-
...getCellWrapStyles(options),
|
|
154922
|
-
...buildCellStyles({
|
|
154923
|
-
cellTextStyle,
|
|
154924
|
-
horizontalAlign,
|
|
154925
|
-
verticalAlign
|
|
154926
|
-
})
|
|
154927
|
-
}
|
|
154928
|
-
];
|
|
154929
|
-
}, [textWrap, maxLinesPerRow, cellTextStyle, horizontalAlign, verticalAlign]);
|
|
154930
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
154931
|
-
CellWrapper,
|
|
154932
|
-
{
|
|
154933
|
-
ref: cellRef,
|
|
154934
|
-
isHidden: isHidden2,
|
|
154935
|
-
cellProperties,
|
|
154936
|
-
rowDensity,
|
|
154937
|
-
className,
|
|
154938
|
-
style: styles,
|
|
154939
|
-
children: [
|
|
154940
|
-
!value && defaultValue2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultValueWrapper, { children: defaultValue2 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154941
|
-
LinkLike,
|
|
154942
|
-
{
|
|
154943
|
-
style: {
|
|
154944
|
-
height: "100%",
|
|
154945
|
-
display: "flex",
|
|
154946
|
-
alignItems: "center"
|
|
154947
|
-
},
|
|
154948
|
-
className: CLASS_NAMES.LINK,
|
|
154949
|
-
children: isEdited ? value : label
|
|
154950
|
-
}
|
|
154951
|
-
),
|
|
154952
|
-
isMenuOpen && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154953
|
-
Popper,
|
|
154954
|
-
{
|
|
154955
|
-
zIndex: 3,
|
|
154956
|
-
isOpen: isMenuOpen,
|
|
154957
|
-
targetNode: cellRef.current || void 0,
|
|
154958
|
-
placement: "bottom-start",
|
|
154959
|
-
ref: popperRef,
|
|
154960
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
154961
|
-
LinkMenu,
|
|
154962
|
-
{
|
|
154963
|
-
"data-test": "table-cell-link-menu",
|
|
154964
|
-
rowDensity,
|
|
154965
|
-
className: CLASS_NAMES.POPOVER_WRAPPER,
|
|
154966
|
-
style: isMultiselecting ? {
|
|
154967
|
-
display: "none"
|
|
154968
|
-
} : void 0,
|
|
154969
|
-
children: [
|
|
154970
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip$2, { title: "Copy", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154971
|
-
StyledButton,
|
|
154972
|
-
{
|
|
154973
|
-
rowDensity,
|
|
154974
|
-
onClick: () => {
|
|
154975
|
-
copy$1(url2);
|
|
154976
|
-
},
|
|
154977
|
-
"data-test": "table-cell-link-copy",
|
|
154978
|
-
type: "link",
|
|
154979
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154980
|
-
SvgCopy,
|
|
154981
|
-
{
|
|
154982
|
-
style: {
|
|
154983
|
-
height: 16,
|
|
154984
|
-
width: 16
|
|
154985
|
-
}
|
|
154986
|
-
}
|
|
154987
|
-
)
|
|
154988
|
-
}
|
|
154989
|
-
) }),
|
|
154990
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
154991
|
-
OpenLinkButton,
|
|
154992
|
-
{
|
|
154993
|
-
url: url2,
|
|
154994
|
-
openInNewTab,
|
|
154995
|
-
rowDensity
|
|
154996
|
-
}
|
|
154997
|
-
)
|
|
154998
|
-
]
|
|
154999
|
-
}
|
|
155000
|
-
)
|
|
155001
|
-
}
|
|
155002
|
-
)
|
|
155003
|
-
]
|
|
155004
|
-
}
|
|
155005
|
-
);
|
|
155006
|
-
};
|
|
155007
154213
|
var lib = {};
|
|
155008
154214
|
var players = {};
|
|
155009
154215
|
var utils = {};
|
|
@@ -161288,7 +160494,7 @@ const formatByType = (value, type5, options) => {
|
|
|
161288
160494
|
return text;
|
|
161289
160495
|
}
|
|
161290
160496
|
};
|
|
161291
|
-
|
|
160497
|
+
qe$1.div`
|
|
161292
160498
|
position: relative;
|
|
161293
160499
|
height: 100%;
|
|
161294
160500
|
width: 100%;
|
|
@@ -161312,20 +160518,20 @@ const StyledEditableDiv = qe$1.div`
|
|
|
161312
160518
|
}
|
|
161313
160519
|
}
|
|
161314
160520
|
`;
|
|
161315
|
-
|
|
160521
|
+
qe$1.div`
|
|
161316
160522
|
position: relative;
|
|
161317
160523
|
height: 100%;
|
|
161318
160524
|
width: 100%;
|
|
161319
160525
|
padding: 0px;
|
|
161320
160526
|
`;
|
|
161321
|
-
|
|
160527
|
+
qe$1.div`
|
|
161322
160528
|
position: relative;
|
|
161323
160529
|
height: 100%;
|
|
161324
160530
|
width: 100%;
|
|
161325
160531
|
border-radius: 4px;
|
|
161326
160532
|
overflow: hidden;
|
|
161327
160533
|
`;
|
|
161328
|
-
|
|
160534
|
+
qe$1.div`
|
|
161329
160535
|
position: absolute;
|
|
161330
160536
|
top: 0px;
|
|
161331
160537
|
left: 0px;
|
|
@@ -161334,180 +160540,17 @@ const EditMarker = qe$1.div`
|
|
|
161334
160540
|
border-style: solid;
|
|
161335
160541
|
border-width: 10px 10px 0 0;
|
|
161336
160542
|
`;
|
|
161337
|
-
|
|
160543
|
+
qe$1(SvgChevronDown)`
|
|
161338
160544
|
width: 16px;
|
|
161339
160545
|
height: 16px;
|
|
161340
160546
|
flex-shrink: 0;
|
|
161341
160547
|
visibility: hidden;
|
|
161342
160548
|
`;
|
|
161343
|
-
|
|
160549
|
+
qe$1.div`
|
|
161344
160550
|
width: 100%;
|
|
161345
160551
|
height: 100%;
|
|
161346
160552
|
position: relative;
|
|
161347
160553
|
`;
|
|
161348
|
-
const EditableCell = (props2) => {
|
|
161349
|
-
const cellRef = useRef(null);
|
|
161350
|
-
const { theme } = props2;
|
|
161351
|
-
const {
|
|
161352
|
-
validationErrors,
|
|
161353
|
-
isEdited,
|
|
161354
|
-
isEditFocused,
|
|
161355
|
-
handleEditStart,
|
|
161356
|
-
editInputType
|
|
161357
|
-
} = props2.editProps;
|
|
161358
|
-
const isDropdownType = editInputType === EditInputType.Dropdown || editInputType === EditInputType.Date;
|
|
161359
|
-
const onEditableCellClick = useCallback(() => {
|
|
161360
|
-
if (!isEditFocused && isDropdownType) {
|
|
161361
|
-
handleEditStart();
|
|
161362
|
-
}
|
|
161363
|
-
}, [isEditFocused, isDropdownType, handleEditStart]);
|
|
161364
|
-
const onEditableCellDoubleClick = useCallback(
|
|
161365
|
-
(e3) => {
|
|
161366
|
-
if (!isEditFocused && !isDropdownType) {
|
|
161367
|
-
e3.stopPropagation();
|
|
161368
|
-
handleEditStart();
|
|
161369
|
-
}
|
|
161370
|
-
},
|
|
161371
|
-
[handleEditStart, isDropdownType, isEditFocused]
|
|
161372
|
-
);
|
|
161373
|
-
if (editInputType === EditInputType.Checkbox) {
|
|
161374
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(EditableCellWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(StyledCheckmarkWrapper, { className: "editable-cell", children: [
|
|
161375
|
-
isEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
161376
|
-
EditMarker,
|
|
161377
|
-
{
|
|
161378
|
-
style: {
|
|
161379
|
-
borderColor: `${theme.colors.primary500} transparent transparent transparent`,
|
|
161380
|
-
top: (theme.defaultBorder.borderRadius.value ?? 0) > 8 ? 2 : 0,
|
|
161381
|
-
left: (theme.defaultBorder.borderRadius.value ?? 0) > 8 ? 2 : 0
|
|
161382
|
-
}
|
|
161383
|
-
}
|
|
161384
|
-
),
|
|
161385
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
161386
|
-
EditCheckboxCell,
|
|
161387
|
-
{
|
|
161388
|
-
editProps: props2.editProps,
|
|
161389
|
-
value: props2.rawValue,
|
|
161390
|
-
rowDensity: props2.rowDensity,
|
|
161391
|
-
cellProperties: props2.cellProps.cellProperties,
|
|
161392
|
-
isFocused: props2.cellProps.isFocused,
|
|
161393
|
-
readModeComponent: renderCell({
|
|
161394
|
-
value: props2.value,
|
|
161395
|
-
columnType: props2.columnType,
|
|
161396
|
-
cellProps: props2.cellProps,
|
|
161397
|
-
position: props2.position,
|
|
161398
|
-
theme
|
|
161399
|
-
})
|
|
161400
|
-
}
|
|
161401
|
-
)
|
|
161402
|
-
] }) });
|
|
161403
|
-
}
|
|
161404
|
-
if (isEditFocused) {
|
|
161405
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(EditingCellWrapper, { ref: cellRef, className: "editing-cell-wrapper", children: [
|
|
161406
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
161407
|
-
"div",
|
|
161408
|
-
{
|
|
161409
|
-
"data-superblocks": "table-editor",
|
|
161410
|
-
style: { position: "absolute", top: 0, left: 0 }
|
|
161411
|
-
}
|
|
161412
|
-
),
|
|
161413
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { visibility: "hidden" }, children: renderCell({
|
|
161414
|
-
value: props2.value,
|
|
161415
|
-
columnType: props2.columnType,
|
|
161416
|
-
cellProps: props2.cellProps,
|
|
161417
|
-
position: props2.position,
|
|
161418
|
-
maxLinesPerRow: props2.maxLinesPerRow,
|
|
161419
|
-
theme
|
|
161420
|
-
}) }),
|
|
161421
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
161422
|
-
EditCell,
|
|
161423
|
-
{
|
|
161424
|
-
targetCellRef: cellRef,
|
|
161425
|
-
editProps: props2.editProps,
|
|
161426
|
-
value: props2.editProps.editInputType && TextBoxEditTypes.includes(
|
|
161427
|
-
props2.editProps.editInputType
|
|
161428
|
-
) ? props2.editProps.currentEditValue : props2.rawValue,
|
|
161429
|
-
tableName: props2.tableName,
|
|
161430
|
-
rowDensity: props2.rowDensity,
|
|
161431
|
-
cellProps: props2.cellProps,
|
|
161432
|
-
theme
|
|
161433
|
-
}
|
|
161434
|
-
)
|
|
161435
|
-
] });
|
|
161436
|
-
}
|
|
161437
|
-
const { linkUrl, linkLabel, openInNewTab } = props2.cellProps.cellProperties;
|
|
161438
|
-
const defaultValue2 = props2.isInserted ? `Set ${props2.columnName}...` : "";
|
|
161439
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
161440
|
-
EditableCellWrapper,
|
|
161441
|
-
{
|
|
161442
|
-
onClick: onEditableCellClick,
|
|
161443
|
-
onDoubleClick: onEditableCellDoubleClick,
|
|
161444
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
161445
|
-
StyledEditableDiv,
|
|
161446
|
-
{
|
|
161447
|
-
$isValid: validationErrors.length === 0,
|
|
161448
|
-
"data-test": props2.columnType === "link" ? `editable-link-${props2.tableName}-${props2.value}` : `editable-cell-${props2.tableName}-${props2.value}`,
|
|
161449
|
-
className: `editable-cell ${isDropdownType ? "dropdown-preview" : ""}`,
|
|
161450
|
-
"data-align": props2.cellProps.cellProperties.verticalAlign,
|
|
161451
|
-
hoverColor: theme.colors.neutral,
|
|
161452
|
-
style: {
|
|
161453
|
-
borderRadius: styleFromDimension(theme.defaultBorder.borderRadius),
|
|
161454
|
-
...validationErrors.length === 0 ? {} : {
|
|
161455
|
-
border: generateBorderStyle(theme.defaultBorder),
|
|
161456
|
-
borderColor: theme.colors.danger
|
|
161457
|
-
}
|
|
161458
|
-
},
|
|
161459
|
-
children: [
|
|
161460
|
-
isEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
161461
|
-
EditMarker,
|
|
161462
|
-
{
|
|
161463
|
-
style: {
|
|
161464
|
-
borderColor: `${theme.colors.primary500} transparent transparent transparent`,
|
|
161465
|
-
top: (theme.defaultBorder.borderRadius.value ?? 0) > 8 ? 2 : 0,
|
|
161466
|
-
left: (theme.defaultBorder.borderRadius.value ?? 0) > 8 ? 2 : 0
|
|
161467
|
-
}
|
|
161468
|
-
}
|
|
161469
|
-
),
|
|
161470
|
-
props2.columnType === "link" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
161471
|
-
EditableLinkCell,
|
|
161472
|
-
{
|
|
161473
|
-
url: linkUrl ?? "",
|
|
161474
|
-
label: linkLabel ?? linkUrl ?? "",
|
|
161475
|
-
openInNewTab,
|
|
161476
|
-
isHidden: props2.cellProps.isHidden,
|
|
161477
|
-
isEdited,
|
|
161478
|
-
value: props2.rawValue,
|
|
161479
|
-
cellProperties: props2.cellProps.cellProperties,
|
|
161480
|
-
rowDensity: props2.rowDensity,
|
|
161481
|
-
isFocused: props2.cellProps.isFocused,
|
|
161482
|
-
position: props2.position,
|
|
161483
|
-
defaultValue: defaultValue2,
|
|
161484
|
-
maxLinesPerRow: props2.maxLinesPerRow,
|
|
161485
|
-
isMultiselecting: props2.cellProps.isMultiselecting
|
|
161486
|
-
}
|
|
161487
|
-
) : renderCell({
|
|
161488
|
-
value: props2.value,
|
|
161489
|
-
columnType: props2.columnType,
|
|
161490
|
-
editInputType: props2.editProps.editInputType,
|
|
161491
|
-
cellProps: props2.cellProps,
|
|
161492
|
-
position: props2.position,
|
|
161493
|
-
defaultValue: defaultValue2,
|
|
161494
|
-
maxLinesPerRow: props2.maxLinesPerRow,
|
|
161495
|
-
theme
|
|
161496
|
-
}),
|
|
161497
|
-
(editInputType === EditInputType.Dropdown || editInputType === EditInputType.Date) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
161498
|
-
StyledChevronDown,
|
|
161499
|
-
{
|
|
161500
|
-
style: {
|
|
161501
|
-
color: theme.colors.neutral300
|
|
161502
|
-
}
|
|
161503
|
-
}
|
|
161504
|
-
)
|
|
161505
|
-
]
|
|
161506
|
-
}
|
|
161507
|
-
)
|
|
161508
|
-
}
|
|
161509
|
-
);
|
|
161510
|
-
};
|
|
161511
160554
|
const getCellClassAndStyleMemo = lodashExports.memoize(
|
|
161512
160555
|
(canWrap, maxLines, cellTextStyle, horizontalAlign, verticalAlign) => {
|
|
161513
160556
|
const options = {
|
|
@@ -161529,18 +160572,13 @@ const getCellClassAndStyleMemo = lodashExports.memoize(
|
|
|
161529
160572
|
// Custom resolver to create a unique key based on nested properties
|
|
161530
160573
|
(...args) => JSON.stringify(args)
|
|
161531
160574
|
);
|
|
161532
|
-
function getCellProperties(tableCellTextStyle, columnProperties,
|
|
161533
|
-
var _a2, _b2, _c2
|
|
161534
|
-
const
|
|
161535
|
-
|
|
161536
|
-
|
|
161537
|
-
);
|
|
161538
|
-
const cellTextStyleColor = getPropertyValue(
|
|
161539
|
-
(_e2 = (_d2 = (_c2 = columnProperties.cellProps) == null ? void 0 : _c2.textStyle) == null ? void 0 : _d2.textColor) == null ? void 0 : _e2.default,
|
|
161540
|
-
rowIndex
|
|
161541
|
-
);
|
|
160575
|
+
function getCellProperties(tableCellTextStyle, columnProperties, currentRow = {}) {
|
|
160576
|
+
var _a2, _b2, _c2;
|
|
160577
|
+
const cellProps = getPropertyValue(columnProperties.cellProps, currentRow);
|
|
160578
|
+
const cellTextStyleColor = (_b2 = (_a2 = cellProps == null ? void 0 : cellProps.textStyle) == null ? void 0 : _a2.textColor) == null ? void 0 : _b2.default;
|
|
160579
|
+
const cellTextStyleVariant = (_c2 = cellProps == null ? void 0 : cellProps.textStyle) == null ? void 0 : _c2.variant;
|
|
161542
160580
|
const cellTextStyleForRow = {
|
|
161543
|
-
...
|
|
160581
|
+
...cellProps == null ? void 0 : cellProps.textStyle,
|
|
161544
160582
|
variant: cellTextStyleVariant,
|
|
161545
160583
|
textColor: cellTextStyleColor ? {
|
|
161546
160584
|
default: cellTextStyleColor
|
|
@@ -161548,95 +160586,92 @@ function getCellProperties(tableCellTextStyle, columnProperties, rowIndex) {
|
|
|
161548
160586
|
};
|
|
161549
160587
|
const cellTextStyle = cellTextStyleForRow ?? tableCellTextStyle;
|
|
161550
160588
|
const cellProperties = {
|
|
161551
|
-
isDisabled: getPropertyValue(columnProperties.isDisabled,
|
|
160589
|
+
isDisabled: getPropertyValue(columnProperties.isDisabled, currentRow),
|
|
161552
160590
|
horizontalAlign: getPropertyValue(
|
|
161553
160591
|
columnProperties.horizontalAlign,
|
|
161554
|
-
|
|
160592
|
+
currentRow
|
|
160593
|
+
),
|
|
160594
|
+
verticalAlign: getPropertyValue(columnProperties.verticalAlign, currentRow),
|
|
160595
|
+
cellBackground: getPropertyValue(
|
|
160596
|
+
columnProperties.cellBackground,
|
|
160597
|
+
currentRow
|
|
161555
160598
|
),
|
|
161556
|
-
verticalAlign: getPropertyValue(columnProperties.verticalAlign, rowIndex),
|
|
161557
|
-
cellBackground: getPropertyValue(columnProperties.cellBackground, rowIndex),
|
|
161558
160599
|
buttonBackgroundColor: getPropertyValue(
|
|
161559
160600
|
columnProperties.buttonBackgroundColor,
|
|
161560
|
-
|
|
160601
|
+
currentRow
|
|
161561
160602
|
),
|
|
161562
|
-
buttonBorder: getPropertyValue(
|
|
161563
|
-
|
|
161564
|
-
rowIndex,
|
|
161565
|
-
true
|
|
161566
|
-
),
|
|
161567
|
-
buttonVariant: getPropertyValue(columnProperties.buttonVariant, rowIndex),
|
|
160603
|
+
buttonBorder: getPropertyValue(columnProperties.buttonBorder, currentRow),
|
|
160604
|
+
buttonVariant: getPropertyValue(columnProperties.buttonVariant, currentRow),
|
|
161568
160605
|
buttonTextStyle: getPropertyValue(
|
|
161569
160606
|
columnProperties.buttonTextStyle,
|
|
161570
|
-
|
|
161571
|
-
true
|
|
160607
|
+
currentRow
|
|
161572
160608
|
),
|
|
161573
160609
|
cellIcon: getPropertyValue(
|
|
161574
160610
|
columnProperties.columnType === "button" ? columnProperties.buttonIcon : columnProperties.cellIcon,
|
|
161575
|
-
|
|
160611
|
+
currentRow
|
|
161576
160612
|
),
|
|
161577
160613
|
cellIconPosition: getPropertyValue(
|
|
161578
160614
|
columnProperties.columnType === "button" ? columnProperties.buttonIconPosition : columnProperties.cellIconPosition,
|
|
161579
|
-
|
|
160615
|
+
currentRow
|
|
161580
160616
|
) ?? "left",
|
|
161581
|
-
buttonLabel: getPropertyValue(columnProperties.buttonLabel,
|
|
161582
|
-
linkUrl: getPropertyValue(columnProperties.linkUrl,
|
|
161583
|
-
linkLabel: getPropertyValue(columnProperties.linkLabel,
|
|
161584
|
-
openInNewTab: getPropertyValue(
|
|
161585
|
-
columnProperties.openInNewTab,
|
|
161586
|
-
rowIndex,
|
|
161587
|
-
true
|
|
161588
|
-
),
|
|
160617
|
+
buttonLabel: getPropertyValue(columnProperties.buttonLabel, currentRow),
|
|
160618
|
+
linkUrl: getPropertyValue(columnProperties.linkUrl, currentRow),
|
|
160619
|
+
linkLabel: getPropertyValue(columnProperties.linkLabel, currentRow),
|
|
160620
|
+
openInNewTab: getPropertyValue(columnProperties.openInNewTab, currentRow),
|
|
161589
160621
|
cellTextStyle,
|
|
161590
160622
|
displayedValue: getPropertyValue(
|
|
161591
160623
|
columnProperties.displayedValue,
|
|
161592
|
-
|
|
161593
|
-
true
|
|
160624
|
+
currentRow
|
|
161594
160625
|
),
|
|
161595
|
-
tagsWrap: getPropertyValue(columnProperties.tagsWrap,
|
|
161596
|
-
textWrap: getPropertyValue(columnProperties.textWrap,
|
|
161597
|
-
imageSize: getPropertyValue(columnProperties.imageSize,
|
|
160626
|
+
tagsWrap: getPropertyValue(columnProperties.tagsWrap, currentRow),
|
|
160627
|
+
textWrap: getPropertyValue(columnProperties.textWrap, currentRow),
|
|
160628
|
+
imageSize: getPropertyValue(columnProperties.imageSize, currentRow),
|
|
161598
160629
|
imageBorderRadius: getPropertyValue(
|
|
161599
160630
|
columnProperties.imageBorderRadius,
|
|
161600
|
-
|
|
161601
|
-
true
|
|
161602
|
-
),
|
|
161603
|
-
openImageUrl: getPropertyValue(
|
|
161604
|
-
columnProperties.openImageUrl,
|
|
161605
|
-
rowIndex,
|
|
161606
|
-
true
|
|
160631
|
+
currentRow
|
|
161607
160632
|
),
|
|
160633
|
+
openImageUrl: getPropertyValue(columnProperties.openImageUrl, currentRow),
|
|
161608
160634
|
minimumFractionDigits: getPropertyValue(
|
|
161609
160635
|
columnProperties.minimumFractionDigits,
|
|
161610
|
-
|
|
160636
|
+
currentRow
|
|
161611
160637
|
),
|
|
161612
160638
|
maximumFractionDigits: getPropertyValue(
|
|
161613
160639
|
columnProperties.maximumFractionDigits,
|
|
161614
|
-
|
|
160640
|
+
currentRow
|
|
161615
160641
|
),
|
|
161616
|
-
currency: getPropertyValue(columnProperties.currency,
|
|
161617
|
-
inputFormat: getPropertyValue(columnProperties.inputFormat,
|
|
161618
|
-
outputFormat: getPropertyValue(columnProperties.outputFormat,
|
|
160642
|
+
currency: getPropertyValue(columnProperties.currency, currentRow),
|
|
160643
|
+
inputFormat: getPropertyValue(columnProperties.inputFormat, currentRow),
|
|
160644
|
+
outputFormat: getPropertyValue(columnProperties.outputFormat, currentRow),
|
|
161619
160645
|
manageTimezone: columnProperties.manageTimezone,
|
|
161620
|
-
timezone: getPropertyValue(columnProperties.timezone,
|
|
160646
|
+
timezone: getPropertyValue(columnProperties.timezone, currentRow),
|
|
161621
160647
|
displayTimezone: getPropertyValue(
|
|
161622
160648
|
columnProperties.displayTimezone,
|
|
161623
|
-
|
|
160649
|
+
currentRow
|
|
161624
160650
|
)
|
|
161625
160651
|
};
|
|
161626
160652
|
return cellProperties;
|
|
161627
160653
|
}
|
|
161628
|
-
function
|
|
161629
|
-
|
|
161630
|
-
|
|
161631
|
-
|
|
161632
|
-
|
|
161633
|
-
|
|
161634
|
-
|
|
161635
|
-
|
|
160654
|
+
function isContextualFunction(value) {
|
|
160655
|
+
return typeof value === "function";
|
|
160656
|
+
}
|
|
160657
|
+
function getPropertyValue(value, currentRow) {
|
|
160658
|
+
if (isContextualFunction(value) && currentRow) {
|
|
160659
|
+
try {
|
|
160660
|
+
return value({ currentRow });
|
|
160661
|
+
} catch (error) {
|
|
160662
|
+
console.error("Error evaluating context-aware property:", error);
|
|
160663
|
+
return void 0;
|
|
160664
|
+
}
|
|
160665
|
+
} else if (isContextualFunction(value)) {
|
|
160666
|
+
return value({ currentRow: {} });
|
|
161636
160667
|
}
|
|
160668
|
+
return value;
|
|
161637
160669
|
}
|
|
161638
160670
|
function getFirstPropertyValue(value) {
|
|
161639
|
-
|
|
160671
|
+
if (isContextualFunction(value)) {
|
|
160672
|
+
return value({ currentRow: {} });
|
|
160673
|
+
}
|
|
160674
|
+
return value;
|
|
161640
160675
|
}
|
|
161641
160676
|
const renderCell = ({
|
|
161642
160677
|
value,
|
|
@@ -172823,11 +171858,13 @@ const downloadTableData = ({
|
|
|
172823
171858
|
);
|
|
172824
171859
|
const headerData = visibleColumns.map((column2) => column2.Header).map((v2) => sanitizeItem(v2));
|
|
172825
171860
|
const rowData = data2.map(
|
|
172826
|
-
(
|
|
171861
|
+
(_15, index2) => visibleColumns.map((column2) => {
|
|
171862
|
+
const itemIndex = (filteredOrderMap == null ? void 0 : filteredOrderMap[index2]) ?? index2;
|
|
171863
|
+
const item = data2[itemIndex];
|
|
172827
171864
|
const cellProperties = getCellProperties(
|
|
172828
171865
|
tableCellTextStyle,
|
|
172829
171866
|
column2.columnProperties,
|
|
172830
|
-
|
|
171867
|
+
item
|
|
172831
171868
|
);
|
|
172832
171869
|
const value = item[column2.columnProperties.id];
|
|
172833
171870
|
return formatByType(value, column2.columnProperties.columnType, {
|
|
@@ -174140,7 +173177,7 @@ function getUniqueValues({
|
|
|
174140
173177
|
formattedValue: formatByType(
|
|
174141
173178
|
value,
|
|
174142
173179
|
columnProperties.columnType,
|
|
174143
|
-
getCellProperties(tableCellTextStyle, columnProperties,
|
|
173180
|
+
getCellProperties(tableCellTextStyle, columnProperties, row)
|
|
174144
173181
|
),
|
|
174145
173182
|
rawValue: value,
|
|
174146
173183
|
index: 0
|
|
@@ -174156,7 +173193,7 @@ function getUniqueValues({
|
|
|
174156
173193
|
formattedValue: formatByType(
|
|
174157
173194
|
rawValue,
|
|
174158
173195
|
columnProperties.columnType,
|
|
174159
|
-
getCellProperties(tableCellTextStyle, columnProperties,
|
|
173196
|
+
getCellProperties(tableCellTextStyle, columnProperties, row)
|
|
174160
173197
|
),
|
|
174161
173198
|
rawValue,
|
|
174162
173199
|
index: 0
|
|
@@ -176887,6 +175924,23 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
176887
175924
|
onComplete();
|
|
176888
175925
|
}
|
|
176889
175926
|
});
|
|
175927
|
+
__publicField(this, "columnPropertyFunctionMap", /* @__PURE__ */ new WeakMap());
|
|
175928
|
+
__publicField(this, "functionCounter", 0);
|
|
175929
|
+
__publicField(this, "getColumnPropertiesString", (columnProperties) => {
|
|
175930
|
+
return Object.keys(columnProperties).reduce((acc, key2) => {
|
|
175931
|
+
const val = columnProperties[key2];
|
|
175932
|
+
if (typeof val === "function") {
|
|
175933
|
+
if (!this.columnPropertyFunctionMap.has(val)) {
|
|
175934
|
+
this.columnPropertyFunctionMap.set(
|
|
175935
|
+
val,
|
|
175936
|
+
`__func_${this.functionCounter++}`
|
|
175937
|
+
);
|
|
175938
|
+
}
|
|
175939
|
+
return acc + `${key2} ${this.columnPropertyFunctionMap.get(val)}`;
|
|
175940
|
+
}
|
|
175941
|
+
return acc + `${key2}: ${JSON.stringify(val)}`;
|
|
175942
|
+
});
|
|
175943
|
+
});
|
|
176890
175944
|
__publicField(this, "getEmptyRow", () => {
|
|
176891
175945
|
const columnKeys = getAllTableColumnKeys(this.props.tableData);
|
|
176892
175946
|
const selectedRow = {};
|
|
@@ -176956,7 +176010,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
176956
176010
|
}
|
|
176957
176011
|
return getPropertyValue(
|
|
176958
176012
|
this.props.columns[columnId].cellBackground,
|
|
176959
|
-
originalRowIndex
|
|
176013
|
+
this.props.tableData[originalRowIndex]
|
|
176960
176014
|
);
|
|
176961
176015
|
});
|
|
176962
176016
|
__publicField(this, "getIsLoading", () => {
|
|
@@ -177696,7 +176750,6 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
177696
176750
|
const columnsArray = [];
|
|
177697
176751
|
const { sortedColumn, columnOrder, columnSizeMap, columns, columnFreezes } = this.props;
|
|
177698
176752
|
let allColumns = columns;
|
|
177699
|
-
const tableProps = this.props;
|
|
177700
176753
|
const sortColumn = sortedColumn == null ? void 0 : sortedColumn.column;
|
|
177701
176754
|
const sortOrder = sortedColumn == null ? void 0 : sortedColumn.asc;
|
|
177702
176755
|
allColumns = reorderColumns(allColumns, columnOrder ?? [], columnFreezes);
|
|
@@ -177800,212 +176853,16 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
177800
176853
|
index: this.props.multiRowSelection ? columnProperties.index + 1 : columnProperties.index,
|
|
177801
176854
|
notation: columnNotation
|
|
177802
176855
|
},
|
|
177803
|
-
Cell: (
|
|
177804
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i, _j, _k, _l2, _m2, _n2, _o2, _p2, _q, _r2, _s2, _t2, _u2, _v, _w, _x, _y;
|
|
177805
|
-
const currentRowIndex = props2.cell.row.index;
|
|
177806
|
-
const originalRowIndex = ((_a2 = this.props.filteredOrderMap) == null ? void 0 : _a2[currentRowIndex]) ?? currentRowIndex;
|
|
177807
|
-
const isEdited = ((_b2 = this.props.editOverrides) == null ? void 0 : _b2[originalRowIndex]) != null && columnProperties.id in this.props.editOverrides[originalRowIndex];
|
|
177808
|
-
const isInserted = this.getIsRowInserted(originalRowIndex);
|
|
177809
|
-
const isDeleted = this.getIsRowDeleted(originalRowIndex);
|
|
177810
|
-
const indexInTableDataWithInserts = ((_c2 = this.props.tableDataWithInsertsOrderMap) == null ? void 0 : _c2[originalRowIndex]) ?? originalRowIndex;
|
|
177811
|
-
const cellProperties = getCellProperties(
|
|
177812
|
-
(_e2 = (_d2 = this.props) == null ? void 0 : _d2.cellProps) == null ? void 0 : _e2.textStyle,
|
|
177813
|
-
columnProperties,
|
|
177814
|
-
indexInTableDataWithInserts
|
|
177815
|
-
);
|
|
177816
|
-
const isEditable = !isDeleted && (isInserted ? columnProperties.isEditableOnInsertion : columnProperties.isEditable);
|
|
177817
|
-
if (isEditable) {
|
|
177818
|
-
let rawValue;
|
|
177819
|
-
if (isInserted) {
|
|
177820
|
-
rawValue = (_h2 = (_g2 = (_f2 = this.props.inserts) == null ? void 0 : _f2.insertedRowsById) == null ? void 0 : _g2[originalRowIndex]) == null ? void 0 : _h2[columnProperties.id];
|
|
177821
|
-
} else if (isEdited) {
|
|
177822
|
-
rawValue = (_j = (_i = this.props.editOverrides) == null ? void 0 : _i[originalRowIndex]) == null ? void 0 : _j[columnProperties.id].value;
|
|
177823
|
-
} else if (columnProperties.isDerived) {
|
|
177824
|
-
rawValue = props2.cell.value;
|
|
177825
|
-
} else {
|
|
177826
|
-
rawValue = (_l2 = (_k = this.props.tableData) == null ? void 0 : _k[originalRowIndex]) == null ? void 0 : _l2[columnProperties.id];
|
|
177827
|
-
}
|
|
177828
|
-
const value = isInserted ? rawValue ?? "" : props2.cell.value;
|
|
177829
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
177830
|
-
EditableCell,
|
|
177831
|
-
{
|
|
177832
|
-
theme: this.props.theme,
|
|
177833
|
-
value,
|
|
177834
|
-
rawValue,
|
|
177835
|
-
columnType: columnProperties.columnType,
|
|
177836
|
-
isInserted,
|
|
177837
|
-
columnName: columnProperties.label,
|
|
177838
|
-
cellProps: {
|
|
177839
|
-
isHidden: isHidden2,
|
|
177840
|
-
cellProperties,
|
|
177841
|
-
tagsColorAssignment: (_m2 = this.cachedTagColorAssignment) == null ? void 0 : _m2[columnProperties.id],
|
|
177842
|
-
notation: columnNotation,
|
|
177843
|
-
currency: columnProperties.currency,
|
|
177844
|
-
minimumFractionDigits: columnProperties.minimumFractionDigits,
|
|
177845
|
-
maximumFractionDigits: columnProperties.maximumFractionDigits,
|
|
177846
|
-
booleanStyleFalse: columnProperties.booleanStyleFalse,
|
|
177847
|
-
rowDensity: this.props.rowDensity,
|
|
177848
|
-
isFocused: props2.isFocused,
|
|
177849
|
-
displayedValue: this.getDisplayedValueForEditCell({
|
|
177850
|
-
columnId: columnProperties.id,
|
|
177851
|
-
rawValue,
|
|
177852
|
-
displayedValue: cellProperties.displayedValue,
|
|
177853
|
-
useLabelAsDisplayValue: columnProperties.useLabelAsDisplayValue
|
|
177854
|
-
}),
|
|
177855
|
-
cellIcon: getPropertyValue(
|
|
177856
|
-
columnProperties.cellIcon,
|
|
177857
|
-
indexInTableDataWithInserts,
|
|
177858
|
-
true
|
|
177859
|
-
),
|
|
177860
|
-
cellIconPosition: columnProperties.cellIconPosition ?? "left",
|
|
177861
|
-
inputFormat: getPropertyValue(
|
|
177862
|
-
columnProperties.inputFormat,
|
|
177863
|
-
indexInTableDataWithInserts,
|
|
177864
|
-
true
|
|
177865
|
-
),
|
|
177866
|
-
outputFormat: getPropertyValue(
|
|
177867
|
-
columnProperties.outputFormat,
|
|
177868
|
-
indexInTableDataWithInserts,
|
|
177869
|
-
true
|
|
177870
|
-
),
|
|
177871
|
-
manageTimezone: columnProperties.manageTimezone,
|
|
177872
|
-
timezone: getPropertyValue(
|
|
177873
|
-
columnProperties.timezone,
|
|
177874
|
-
indexInTableDataWithInserts,
|
|
177875
|
-
true
|
|
177876
|
-
),
|
|
177877
|
-
displayTimezone: getPropertyValue(
|
|
177878
|
-
columnProperties.displayTimezone,
|
|
177879
|
-
indexInTableDataWithInserts,
|
|
177880
|
-
true
|
|
177881
|
-
),
|
|
177882
|
-
isMultiselecting: this.currentCellFocus.length > 1
|
|
177883
|
-
},
|
|
177884
|
-
editProps: {
|
|
177885
|
-
handleEditStart: this.handleEditStart.bind(
|
|
177886
|
-
this,
|
|
177887
|
-
originalRowIndex,
|
|
177888
|
-
columnProperties.id,
|
|
177889
|
-
this.getCellValue(
|
|
177890
|
-
originalRowIndex,
|
|
177891
|
-
columnProperties.id
|
|
177892
|
-
)
|
|
177893
|
-
),
|
|
177894
|
-
handleEditChange: this.debouncedEditChange,
|
|
177895
|
-
handleEditStop: this.onEditStop.bind(
|
|
177896
|
-
this,
|
|
177897
|
-
columnProperties,
|
|
177898
|
-
currentRowIndex
|
|
177899
|
-
),
|
|
177900
|
-
onDropdownSearchTextChanged: () => props2.onDropdownSearchTextChanged(),
|
|
177901
|
-
currentEditDropdownSearchText: this.props.currentEditDropdownSearchText,
|
|
177902
|
-
handleOneClickEdit: this.handleOneClickEdit.bind(
|
|
177903
|
-
this,
|
|
177904
|
-
columnProperties,
|
|
177905
|
-
originalRowIndex
|
|
177906
|
-
),
|
|
177907
|
-
isEditFocused: ((_n2 = this.props.currentEditFocus) == null ? void 0 : _n2.row) === originalRowIndex && ((_o2 = this.props.currentEditFocus) == null ? void 0 : _o2.columnId) === columnProperties.id,
|
|
177908
|
-
isEdited,
|
|
177909
|
-
currentEditValue: this.props.currentEditValue,
|
|
177910
|
-
editInputType: columnProperties.editInputType,
|
|
177911
|
-
editCustomValidationRule: this.customEditValidation[columnProperties.id],
|
|
177912
|
-
editCustomErrorMessage: this.customEditMessage[columnProperties.id],
|
|
177913
|
-
editMaxLength: columnProperties.editMaxLength,
|
|
177914
|
-
editMinLength: columnProperties.editMinLength,
|
|
177915
|
-
editIsRequired: isInserted ? columnProperties.isRequiredOnInsertion : columnProperties.editIsRequired,
|
|
177916
|
-
editMultiSelect: columnProperties.editMultiSelect,
|
|
177917
|
-
allowClearing: columnProperties.allowClearing,
|
|
177918
|
-
dropdownOptionsLoading: this.getDropdownOptionsLoading(),
|
|
177919
|
-
editDropdownClientSideFiltering: columnProperties.editDropdownClientSideFiltering,
|
|
177920
|
-
editOptions: this.editOptions[columnProperties.id],
|
|
177921
|
-
transformation: columnProperties.transformation,
|
|
177922
|
-
validationErrors: isInserted ? ((_r2 = (_q = (_p2 = this.props.inserts) == null ? void 0 : _p2.insertedRowValidations) == null ? void 0 : _q[originalRowIndex]) == null ? void 0 : _r2[columnProperties.id]) ?? [] : ((_u2 = (_t2 = (_s2 = this.props.editOverrides) == null ? void 0 : _s2[originalRowIndex]) == null ? void 0 : _t2[columnProperties.id]) == null ? void 0 : _u2.validationErrors) ?? [],
|
|
177923
|
-
editMinDate: columnProperties.editMinDate,
|
|
177924
|
-
editMaxDate: columnProperties.editMaxDate,
|
|
177925
|
-
editTwentyFourHourTime: columnProperties.editTwentyFourHourTime
|
|
177926
|
-
},
|
|
177927
|
-
tableName: this.props.widgetName,
|
|
177928
|
-
rowDensity: getRowDensity(this.props.rowDensity),
|
|
177929
|
-
maxLinesPerRow: this.props.maxLinesPerRow,
|
|
177930
|
-
position: {
|
|
177931
|
-
currentRowIndex,
|
|
177932
|
-
columnId: columnProperties.id,
|
|
177933
|
-
originalRowIndex
|
|
177934
|
-
}
|
|
177935
|
-
}
|
|
177936
|
-
);
|
|
177937
|
-
} else if (columnProperties.columnType === ColumnType.BUTTON) {
|
|
177938
|
-
const buttonProps = {
|
|
177939
|
-
rowIndex: currentRowIndex,
|
|
177940
|
-
isSelected: !!props2.row.isSelected,
|
|
177941
|
-
isDisabled: cellProperties.isDisabled,
|
|
177942
|
-
onClick: (onComplete) => {
|
|
177943
|
-
this.handleTableButtonClick(columnProperties.id, onComplete);
|
|
177944
|
-
},
|
|
177945
|
-
handleRowSelect: this.handleRowSelect,
|
|
177946
|
-
backgroundColor: cellProperties.buttonBackgroundColor,
|
|
177947
|
-
buttonBorder: cellProperties.buttonBorder,
|
|
177948
|
-
buttonVariant: cellProperties.buttonVariant ?? "primary",
|
|
177949
|
-
buttonTextStyle: cellProperties.buttonTextStyle,
|
|
177950
|
-
cellIcon: getPropertyValue(
|
|
177951
|
-
columnProperties.buttonIcon,
|
|
177952
|
-
indexInTableDataWithInserts
|
|
177953
|
-
),
|
|
177954
|
-
cellIconPosition: cellProperties.cellIconPosition ?? "left",
|
|
177955
|
-
rowDensity: this.props.rowDensity,
|
|
177956
|
-
id: columnProperties.id,
|
|
177957
|
-
buttonLabel: cellProperties.buttonLabel ?? "Action",
|
|
177958
|
-
isHidden: isHidden2,
|
|
177959
|
-
theme: this.props.theme
|
|
177960
|
-
};
|
|
177961
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(TableButton, { ...buttonProps });
|
|
177962
|
-
} else if (columnProperties.columnType === "link") {
|
|
177963
|
-
return renderLink({
|
|
177964
|
-
cellProperties,
|
|
177965
|
-
isHidden: isHidden2,
|
|
177966
|
-
rowDensity: this.props.rowDensity,
|
|
177967
|
-
position: {
|
|
177968
|
-
columnId: columnProperties.id
|
|
177969
|
-
},
|
|
177970
|
-
maxLinesPerRow: this.props.maxLinesPerRow,
|
|
177971
|
-
tableCellTextStyle: (_v = this.props.cellProps) == null ? void 0 : _v.textStyle,
|
|
177972
|
-
value: props2.cell.value
|
|
177973
|
-
});
|
|
177974
|
-
} else {
|
|
177975
|
-
return renderCell({
|
|
177976
|
-
theme: this.props.theme,
|
|
177977
|
-
value: props2.cell.value,
|
|
177978
|
-
columnType: columnProperties.columnType,
|
|
177979
|
-
editInputType: columnProperties.editInputType,
|
|
177980
|
-
maxLinesPerRow: this.props.maxLinesPerRow,
|
|
177981
|
-
tableCellTextStyle: (_w = this.props.cellProps) == null ? void 0 : _w.textStyle,
|
|
177982
|
-
typographies: this.props.theme.typographies,
|
|
177983
|
-
cellProps: {
|
|
177984
|
-
// since these are overridden by the cellProperties
|
|
177985
|
-
...columnProperties,
|
|
177986
|
-
...getCellProperties(
|
|
177987
|
-
(_x = tableProps == null ? void 0 : tableProps.cellProps) == null ? void 0 : _x.textStyle,
|
|
177988
|
-
columnProperties,
|
|
177989
|
-
indexInTableDataWithInserts
|
|
177990
|
-
),
|
|
177991
|
-
isHidden: isHidden2,
|
|
177992
|
-
cellProperties,
|
|
177993
|
-
tagsColorAssignment: (_y = this.cachedTagColorAssignment) == null ? void 0 : _y[columnProperties.id],
|
|
177994
|
-
booleanStyleFalse: columnProperties.booleanStyleFalse,
|
|
177995
|
-
rowDensity: this.props.rowDensity,
|
|
177996
|
-
isFocused: props2.isFocused,
|
|
177997
|
-
isMultiselecting: this.currentCellFocus.length > 1
|
|
177998
|
-
},
|
|
177999
|
-
position: {
|
|
178000
|
-
columnId: columnProperties.id
|
|
178001
|
-
}
|
|
178002
|
-
});
|
|
178003
|
-
}
|
|
178004
|
-
}
|
|
176856
|
+
Cell: this.createTableCell(columnProperties, isHidden2)
|
|
178005
176857
|
};
|
|
178006
176858
|
columnsArray.push(columnData);
|
|
178007
176859
|
}
|
|
178008
|
-
const columnString = JSON.stringify(columnsArray)
|
|
176860
|
+
const columnString = JSON.stringify(columnsArray, (key2, value) => {
|
|
176861
|
+
if (key2 === "columnProperties") {
|
|
176862
|
+
return this.getColumnPropertiesString(value);
|
|
176863
|
+
}
|
|
176864
|
+
return value;
|
|
176865
|
+
});
|
|
178009
176866
|
if (columnString === this.previousColumnsString) {
|
|
178010
176867
|
return this.previousColumns;
|
|
178011
176868
|
}
|
|
@@ -178013,6 +176870,85 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
178013
176870
|
this.previousColumns = columnsArray;
|
|
178014
176871
|
return columnsArray;
|
|
178015
176872
|
}
|
|
176873
|
+
createTableCell(columnProperties, isHidden2) {
|
|
176874
|
+
return (props2) => {
|
|
176875
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
176876
|
+
const currentRowIndex = props2.cell.row.index;
|
|
176877
|
+
((_a2 = this.props.filteredOrderMap) == null ? void 0 : _a2[currentRowIndex]) ?? currentRowIndex;
|
|
176878
|
+
const cellProperties = getCellProperties(
|
|
176879
|
+
(_c2 = (_b2 = this.props) == null ? void 0 : _b2.cellProps) == null ? void 0 : _c2.textStyle,
|
|
176880
|
+
columnProperties,
|
|
176881
|
+
props2.cell.row.original
|
|
176882
|
+
);
|
|
176883
|
+
if (columnProperties.columnType === ColumnType.BUTTON) {
|
|
176884
|
+
const buttonProps = {
|
|
176885
|
+
rowIndex: currentRowIndex,
|
|
176886
|
+
isSelected: !!props2.row.isSelected,
|
|
176887
|
+
isDisabled: cellProperties.isDisabled,
|
|
176888
|
+
onClick: (onComplete) => {
|
|
176889
|
+
this.handleTableButtonClick(columnProperties.id, onComplete);
|
|
176890
|
+
},
|
|
176891
|
+
handleRowSelect: this.handleRowSelect,
|
|
176892
|
+
backgroundColor: cellProperties.buttonBackgroundColor,
|
|
176893
|
+
buttonBorder: cellProperties.buttonBorder,
|
|
176894
|
+
buttonVariant: cellProperties.buttonVariant ?? "primary",
|
|
176895
|
+
buttonTextStyle: cellProperties.buttonTextStyle,
|
|
176896
|
+
cellIcon: getPropertyValue(
|
|
176897
|
+
columnProperties.buttonIcon,
|
|
176898
|
+
props2.cell.row.original
|
|
176899
|
+
),
|
|
176900
|
+
cellIconPosition: cellProperties.cellIconPosition ?? "left",
|
|
176901
|
+
rowDensity: this.props.rowDensity,
|
|
176902
|
+
id: columnProperties.id,
|
|
176903
|
+
buttonLabel: cellProperties.buttonLabel ?? "Action",
|
|
176904
|
+
isHidden: isHidden2,
|
|
176905
|
+
theme: this.props.theme
|
|
176906
|
+
};
|
|
176907
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TableButton, { ...buttonProps });
|
|
176908
|
+
} else if (columnProperties.columnType === "link") {
|
|
176909
|
+
return renderLink({
|
|
176910
|
+
cellProperties,
|
|
176911
|
+
isHidden: isHidden2,
|
|
176912
|
+
rowDensity: this.props.rowDensity,
|
|
176913
|
+
position: {
|
|
176914
|
+
columnId: columnProperties.id
|
|
176915
|
+
},
|
|
176916
|
+
maxLinesPerRow: this.props.maxLinesPerRow,
|
|
176917
|
+
tableCellTextStyle: (_d2 = this.props.cellProps) == null ? void 0 : _d2.textStyle,
|
|
176918
|
+
value: props2.cell.value
|
|
176919
|
+
});
|
|
176920
|
+
} else {
|
|
176921
|
+
return renderCell({
|
|
176922
|
+
theme: this.props.theme,
|
|
176923
|
+
value: props2.cell.value,
|
|
176924
|
+
columnType: columnProperties.columnType,
|
|
176925
|
+
editInputType: columnProperties.editInputType,
|
|
176926
|
+
maxLinesPerRow: this.props.maxLinesPerRow,
|
|
176927
|
+
tableCellTextStyle: (_e2 = this.props.cellProps) == null ? void 0 : _e2.textStyle,
|
|
176928
|
+
typographies: this.props.theme.typographies,
|
|
176929
|
+
cellProps: {
|
|
176930
|
+
// since these are overridden by the cellProperties
|
|
176931
|
+
...columnProperties,
|
|
176932
|
+
...getCellProperties(
|
|
176933
|
+
(_g2 = (_f2 = this.props) == null ? void 0 : _f2.cellProps) == null ? void 0 : _g2.textStyle,
|
|
176934
|
+
columnProperties,
|
|
176935
|
+
props2.cell.row.original
|
|
176936
|
+
),
|
|
176937
|
+
isHidden: isHidden2,
|
|
176938
|
+
cellProperties,
|
|
176939
|
+
tagsColorAssignment: (_h2 = this.cachedTagColorAssignment) == null ? void 0 : _h2[columnProperties.id],
|
|
176940
|
+
booleanStyleFalse: columnProperties.booleanStyleFalse,
|
|
176941
|
+
rowDensity: this.props.rowDensity,
|
|
176942
|
+
isFocused: props2.isFocused,
|
|
176943
|
+
isMultiselecting: this.currentCellFocus.length > 1
|
|
176944
|
+
},
|
|
176945
|
+
position: {
|
|
176946
|
+
columnId: columnProperties.id
|
|
176947
|
+
}
|
|
176948
|
+
});
|
|
176949
|
+
}
|
|
176950
|
+
};
|
|
176951
|
+
}
|
|
178016
176952
|
static getParsedComputedValues(value) {
|
|
178017
176953
|
let computedValues = [];
|
|
178018
176954
|
if (lodashExports.isString(value)) {
|
|
@@ -181354,8 +180290,8 @@ const StyledCrossIcon = qe$1(SvgCrossXs)`
|
|
|
181354
180290
|
right: ${({ right: right2 }) => `${right2}px`};
|
|
181355
180291
|
top: 50%;
|
|
181356
180292
|
transform: translateY(-50%);
|
|
181357
|
-
height: ${({ iconSize }) => `${iconSize ?? DEFAULT_ICON_SIZE
|
|
181358
|
-
width: ${({ iconSize }) => `${iconSize ?? DEFAULT_ICON_SIZE
|
|
180293
|
+
height: ${({ iconSize }) => `${iconSize ?? DEFAULT_ICON_SIZE}px`};
|
|
180294
|
+
width: ${({ iconSize }) => `${iconSize ?? DEFAULT_ICON_SIZE}px`};
|
|
181359
180295
|
z-index: 4; // TODO: do we need to use Layers?
|
|
181360
180296
|
cursor: pointer;
|
|
181361
180297
|
`;
|
|
@@ -186237,9 +185173,9 @@ const generateDropdownStyles = (theme) => {
|
|
|
186237
185173
|
transform: translateY(-50%);
|
|
186238
185174
|
z-index: 99;
|
|
186239
185175
|
background-repeat: no-repeat;
|
|
186240
|
-
background-size: ${DEFAULT_ICON_SIZE
|
|
186241
|
-
width: ${DEFAULT_ICON_SIZE
|
|
186242
|
-
height: ${DEFAULT_ICON_SIZE
|
|
185176
|
+
background-size: ${DEFAULT_ICON_SIZE}px;
|
|
185177
|
+
width: ${DEFAULT_ICON_SIZE}px;
|
|
185178
|
+
height: ${DEFAULT_ICON_SIZE}px;
|
|
186243
185179
|
display: block;
|
|
186244
185180
|
position: absolute;
|
|
186245
185181
|
cursor: pointer;
|
|
@@ -198486,4 +197422,4 @@ export {
|
|
|
198486
197422
|
SbTimer as y,
|
|
198487
197423
|
SbApi as z
|
|
198488
197424
|
};
|
|
198489
|
-
//# sourceMappingURL=index-
|
|
197425
|
+
//# sourceMappingURL=index-CQOHJMew.js.map
|