@equinor/apollo-components 3.1.0 → 3.1.1
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/index.d.ts +26 -104
- package/dist/index.js +296 -1066
- package/dist/index.mjs +260 -1020
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -649,16 +649,16 @@ var require_lodash = __commonJS({
|
|
|
649
649
|
}
|
|
650
650
|
return result;
|
|
651
651
|
}
|
|
652
|
-
function setToArray(
|
|
653
|
-
var index = -1, result = Array(
|
|
654
|
-
|
|
652
|
+
function setToArray(set) {
|
|
653
|
+
var index = -1, result = Array(set.size);
|
|
654
|
+
set.forEach(function(value) {
|
|
655
655
|
result[++index] = value;
|
|
656
656
|
});
|
|
657
657
|
return result;
|
|
658
658
|
}
|
|
659
|
-
function setToPairs(
|
|
660
|
-
var index = -1, result = Array(
|
|
661
|
-
|
|
659
|
+
function setToPairs(set) {
|
|
660
|
+
var index = -1, result = Array(set.size);
|
|
661
|
+
set.forEach(function(value) {
|
|
662
662
|
result[++index] = [value, value];
|
|
663
663
|
});
|
|
664
664
|
return result;
|
|
@@ -756,7 +756,7 @@ var require_lodash = __commonJS({
|
|
|
756
756
|
function object() {
|
|
757
757
|
}
|
|
758
758
|
return function(proto) {
|
|
759
|
-
if (!
|
|
759
|
+
if (!isObject(proto)) {
|
|
760
760
|
return {};
|
|
761
761
|
}
|
|
762
762
|
if (objectCreate) {
|
|
@@ -1095,7 +1095,7 @@ var require_lodash = __commonJS({
|
|
|
1095
1095
|
function baseAt(object, paths) {
|
|
1096
1096
|
var index = -1, length = paths.length, result2 = Array2(length), skip = object == null;
|
|
1097
1097
|
while (++index < length) {
|
|
1098
|
-
result2[index] = skip ? undefined2 :
|
|
1098
|
+
result2[index] = skip ? undefined2 : get(object, paths[index]);
|
|
1099
1099
|
}
|
|
1100
1100
|
return result2;
|
|
1101
1101
|
}
|
|
@@ -1118,7 +1118,7 @@ var require_lodash = __commonJS({
|
|
|
1118
1118
|
if (result2 !== undefined2) {
|
|
1119
1119
|
return result2;
|
|
1120
1120
|
}
|
|
1121
|
-
if (!
|
|
1121
|
+
if (!isObject(value)) {
|
|
1122
1122
|
return value;
|
|
1123
1123
|
}
|
|
1124
1124
|
var isArr = isArray(value);
|
|
@@ -1465,7 +1465,7 @@ var require_lodash = __commonJS({
|
|
|
1465
1465
|
return true;
|
|
1466
1466
|
}
|
|
1467
1467
|
function baseIsNative(value) {
|
|
1468
|
-
if (!
|
|
1468
|
+
if (!isObject(value) || isMasked(value)) {
|
|
1469
1469
|
return false;
|
|
1470
1470
|
}
|
|
1471
1471
|
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
@@ -1505,7 +1505,7 @@ var require_lodash = __commonJS({
|
|
|
1505
1505
|
return result2;
|
|
1506
1506
|
}
|
|
1507
1507
|
function baseKeysIn(object) {
|
|
1508
|
-
if (!
|
|
1508
|
+
if (!isObject(object)) {
|
|
1509
1509
|
return nativeKeysIn(object);
|
|
1510
1510
|
}
|
|
1511
1511
|
var isProto = isPrototype(object), result2 = [];
|
|
@@ -1536,11 +1536,11 @@ var require_lodash = __commonJS({
|
|
|
1536
1536
|
};
|
|
1537
1537
|
}
|
|
1538
1538
|
function baseMatchesProperty(path, srcValue) {
|
|
1539
|
-
if (
|
|
1539
|
+
if (isKey(path) && isStrictComparable(srcValue)) {
|
|
1540
1540
|
return matchesStrictComparable(toKey(path), srcValue);
|
|
1541
1541
|
}
|
|
1542
1542
|
return function(object) {
|
|
1543
|
-
var objValue =
|
|
1543
|
+
var objValue = get(object, path);
|
|
1544
1544
|
return objValue === undefined2 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
1545
1545
|
};
|
|
1546
1546
|
}
|
|
@@ -1550,7 +1550,7 @@ var require_lodash = __commonJS({
|
|
|
1550
1550
|
}
|
|
1551
1551
|
baseFor(source, function(srcValue, key) {
|
|
1552
1552
|
stack || (stack = new Stack());
|
|
1553
|
-
if (
|
|
1553
|
+
if (isObject(srcValue)) {
|
|
1554
1554
|
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
|
1555
1555
|
} else {
|
|
1556
1556
|
var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined2;
|
|
@@ -1586,11 +1586,11 @@ var require_lodash = __commonJS({
|
|
|
1586
1586
|
} else {
|
|
1587
1587
|
newValue = [];
|
|
1588
1588
|
}
|
|
1589
|
-
} else if (
|
|
1589
|
+
} else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
|
1590
1590
|
newValue = objValue;
|
|
1591
1591
|
if (isArguments(objValue)) {
|
|
1592
1592
|
newValue = toPlainObject(objValue);
|
|
1593
|
-
} else if (!
|
|
1593
|
+
} else if (!isObject(objValue) || isFunction(objValue)) {
|
|
1594
1594
|
newValue = initCloneObject(srcValue);
|
|
1595
1595
|
}
|
|
1596
1596
|
} else {
|
|
@@ -1729,7 +1729,7 @@ var require_lodash = __commonJS({
|
|
|
1729
1729
|
return shuffleSelf(array, baseClamp(n, 0, array.length));
|
|
1730
1730
|
}
|
|
1731
1731
|
function baseSet(object, path, value, customizer) {
|
|
1732
|
-
if (!
|
|
1732
|
+
if (!isObject(object)) {
|
|
1733
1733
|
return object;
|
|
1734
1734
|
}
|
|
1735
1735
|
path = castPath(path, object);
|
|
@@ -1743,7 +1743,7 @@ var require_lodash = __commonJS({
|
|
|
1743
1743
|
var objValue = nested[key];
|
|
1744
1744
|
newValue = customizer ? customizer(objValue, key, nested) : undefined2;
|
|
1745
1745
|
if (newValue === undefined2) {
|
|
1746
|
-
newValue =
|
|
1746
|
+
newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
|
|
1747
1747
|
}
|
|
1748
1748
|
}
|
|
1749
1749
|
assignValue(nested, key, newValue);
|
|
@@ -1875,9 +1875,9 @@ var require_lodash = __commonJS({
|
|
|
1875
1875
|
isCommon = false;
|
|
1876
1876
|
includes2 = arrayIncludesWith;
|
|
1877
1877
|
} else if (length >= LARGE_ARRAY_SIZE) {
|
|
1878
|
-
var
|
|
1879
|
-
if (
|
|
1880
|
-
return setToArray(
|
|
1878
|
+
var set2 = iteratee2 ? null : createSet(array);
|
|
1879
|
+
if (set2) {
|
|
1880
|
+
return setToArray(set2);
|
|
1881
1881
|
}
|
|
1882
1882
|
isCommon = false;
|
|
1883
1883
|
includes2 = cacheHas;
|
|
@@ -1966,7 +1966,7 @@ var require_lodash = __commonJS({
|
|
|
1966
1966
|
if (isArray(value)) {
|
|
1967
1967
|
return value;
|
|
1968
1968
|
}
|
|
1969
|
-
return
|
|
1969
|
+
return isKey(value, object) ? [value] : stringToPath(toString(value));
|
|
1970
1970
|
}
|
|
1971
1971
|
var castRest = baseRest;
|
|
1972
1972
|
function castSlice(array, start, end) {
|
|
@@ -2193,7 +2193,7 @@ var require_lodash = __commonJS({
|
|
|
2193
2193
|
return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
|
|
2194
2194
|
}
|
|
2195
2195
|
var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
|
|
2196
|
-
return
|
|
2196
|
+
return isObject(result2) ? result2 : thisBinding;
|
|
2197
2197
|
};
|
|
2198
2198
|
}
|
|
2199
2199
|
function createCurry(func, bitmask, arity) {
|
|
@@ -2529,7 +2529,7 @@ var require_lodash = __commonJS({
|
|
|
2529
2529
|
return objValue;
|
|
2530
2530
|
}
|
|
2531
2531
|
function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
|
|
2532
|
-
if (
|
|
2532
|
+
if (isObject(objValue) && isObject(srcValue)) {
|
|
2533
2533
|
stack.set(srcValue, objValue);
|
|
2534
2534
|
baseMerge(objValue, srcValue, undefined2, customDefaultsMerge, stack);
|
|
2535
2535
|
stack["delete"](srcValue);
|
|
@@ -2537,7 +2537,7 @@ var require_lodash = __commonJS({
|
|
|
2537
2537
|
return objValue;
|
|
2538
2538
|
}
|
|
2539
2539
|
function customOmitClone(value) {
|
|
2540
|
-
return
|
|
2540
|
+
return isPlainObject(value) ? undefined2 : value;
|
|
2541
2541
|
}
|
|
2542
2542
|
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
2543
2543
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
|
|
@@ -2877,7 +2877,7 @@ var require_lodash = __commonJS({
|
|
|
2877
2877
|
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
2878
2878
|
}
|
|
2879
2879
|
function isIterateeCall(value, index, object) {
|
|
2880
|
-
if (!
|
|
2880
|
+
if (!isObject(object)) {
|
|
2881
2881
|
return false;
|
|
2882
2882
|
}
|
|
2883
2883
|
var type = typeof index;
|
|
@@ -2886,7 +2886,7 @@ var require_lodash = __commonJS({
|
|
|
2886
2886
|
}
|
|
2887
2887
|
return false;
|
|
2888
2888
|
}
|
|
2889
|
-
function
|
|
2889
|
+
function isKey(value, object) {
|
|
2890
2890
|
if (isArray(value)) {
|
|
2891
2891
|
return false;
|
|
2892
2892
|
}
|
|
@@ -2920,7 +2920,7 @@ var require_lodash = __commonJS({
|
|
|
2920
2920
|
return value === proto;
|
|
2921
2921
|
}
|
|
2922
2922
|
function isStrictComparable(value) {
|
|
2923
|
-
return value === value && !
|
|
2923
|
+
return value === value && !isObject(value);
|
|
2924
2924
|
}
|
|
2925
2925
|
function matchesStrictComparable(key, srcValue) {
|
|
2926
2926
|
return function(object) {
|
|
@@ -3059,7 +3059,7 @@ var require_lodash = __commonJS({
|
|
|
3059
3059
|
array.length = size2;
|
|
3060
3060
|
return array;
|
|
3061
3061
|
}
|
|
3062
|
-
var
|
|
3062
|
+
var stringToPath = memoizeCapped(function(string) {
|
|
3063
3063
|
var result2 = [];
|
|
3064
3064
|
if (string.charCodeAt(0) === 46) {
|
|
3065
3065
|
result2.push("");
|
|
@@ -3124,7 +3124,7 @@ var require_lodash = __commonJS({
|
|
|
3124
3124
|
}
|
|
3125
3125
|
return result2;
|
|
3126
3126
|
}
|
|
3127
|
-
function
|
|
3127
|
+
function compact(array) {
|
|
3128
3128
|
var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = [];
|
|
3129
3129
|
while (++index < length) {
|
|
3130
3130
|
var value = array[index];
|
|
@@ -3638,7 +3638,7 @@ var require_lodash = __commonJS({
|
|
|
3638
3638
|
if (fromIndex < 0) {
|
|
3639
3639
|
fromIndex = nativeMax(length + fromIndex, 0);
|
|
3640
3640
|
}
|
|
3641
|
-
return
|
|
3641
|
+
return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
|
|
3642
3642
|
}
|
|
3643
3643
|
var invokeMap = baseRest(function(collection, path, args) {
|
|
3644
3644
|
var index = -1, isFunc = typeof path == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
|
|
@@ -3706,7 +3706,7 @@ var require_lodash = __commonJS({
|
|
|
3706
3706
|
return 0;
|
|
3707
3707
|
}
|
|
3708
3708
|
if (isArrayLike(collection)) {
|
|
3709
|
-
return
|
|
3709
|
+
return isString(collection) ? stringSize(collection) : collection.length;
|
|
3710
3710
|
}
|
|
3711
3711
|
var tag = getTag(collection);
|
|
3712
3712
|
if (tag == mapTag || tag == setTag) {
|
|
@@ -3802,7 +3802,7 @@ var require_lodash = __commonJS({
|
|
|
3802
3802
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
3803
3803
|
}
|
|
3804
3804
|
wait = toNumber(wait) || 0;
|
|
3805
|
-
if (
|
|
3805
|
+
if (isObject(options)) {
|
|
3806
3806
|
leading = !!options.leading;
|
|
3807
3807
|
maxing = "maxWait" in options;
|
|
3808
3808
|
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
@@ -3972,7 +3972,7 @@ var require_lodash = __commonJS({
|
|
|
3972
3972
|
if (typeof func != "function") {
|
|
3973
3973
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
3974
3974
|
}
|
|
3975
|
-
if (
|
|
3975
|
+
if (isObject(options)) {
|
|
3976
3976
|
leading = "leading" in options ? !!options.leading : leading;
|
|
3977
3977
|
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
3978
3978
|
}
|
|
@@ -4038,7 +4038,7 @@ var require_lodash = __commonJS({
|
|
|
4038
4038
|
var isBuffer = nativeIsBuffer || stubFalse;
|
|
4039
4039
|
var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
|
|
4040
4040
|
function isElement(value) {
|
|
4041
|
-
return isObjectLike(value) && value.nodeType === 1 && !
|
|
4041
|
+
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
|
|
4042
4042
|
}
|
|
4043
4043
|
function isEmpty(value) {
|
|
4044
4044
|
if (value == null) {
|
|
@@ -4074,13 +4074,13 @@ var require_lodash = __commonJS({
|
|
|
4074
4074
|
return false;
|
|
4075
4075
|
}
|
|
4076
4076
|
var tag = baseGetTag(value);
|
|
4077
|
-
return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !
|
|
4077
|
+
return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value);
|
|
4078
4078
|
}
|
|
4079
4079
|
function isFinite(value) {
|
|
4080
4080
|
return typeof value == "number" && nativeIsFinite(value);
|
|
4081
4081
|
}
|
|
4082
4082
|
function isFunction(value) {
|
|
4083
|
-
if (!
|
|
4083
|
+
if (!isObject(value)) {
|
|
4084
4084
|
return false;
|
|
4085
4085
|
}
|
|
4086
4086
|
var tag = baseGetTag(value);
|
|
@@ -4092,7 +4092,7 @@ var require_lodash = __commonJS({
|
|
|
4092
4092
|
function isLength(value) {
|
|
4093
4093
|
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
4094
4094
|
}
|
|
4095
|
-
function
|
|
4095
|
+
function isObject(value) {
|
|
4096
4096
|
var type = typeof value;
|
|
4097
4097
|
return value != null && (type == "object" || type == "function");
|
|
4098
4098
|
}
|
|
@@ -4125,7 +4125,7 @@ var require_lodash = __commonJS({
|
|
|
4125
4125
|
function isNumber(value) {
|
|
4126
4126
|
return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
|
|
4127
4127
|
}
|
|
4128
|
-
function
|
|
4128
|
+
function isPlainObject(value) {
|
|
4129
4129
|
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
4130
4130
|
return false;
|
|
4131
4131
|
}
|
|
@@ -4141,14 +4141,14 @@ var require_lodash = __commonJS({
|
|
|
4141
4141
|
return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
|
|
4142
4142
|
}
|
|
4143
4143
|
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
4144
|
-
function
|
|
4144
|
+
function isString(value) {
|
|
4145
4145
|
return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
|
|
4146
4146
|
}
|
|
4147
4147
|
function isSymbol(value) {
|
|
4148
4148
|
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
4149
4149
|
}
|
|
4150
4150
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
4151
|
-
function
|
|
4151
|
+
function isUndefined(value) {
|
|
4152
4152
|
return value === undefined2;
|
|
4153
4153
|
}
|
|
4154
4154
|
function isWeakMap(value) {
|
|
@@ -4166,7 +4166,7 @@ var require_lodash = __commonJS({
|
|
|
4166
4166
|
return [];
|
|
4167
4167
|
}
|
|
4168
4168
|
if (isArrayLike(value)) {
|
|
4169
|
-
return
|
|
4169
|
+
return isString(value) ? stringToArray(value) : copyArray(value);
|
|
4170
4170
|
}
|
|
4171
4171
|
if (symIterator && value[symIterator]) {
|
|
4172
4172
|
return iteratorToArray(value[symIterator]());
|
|
@@ -4199,9 +4199,9 @@ var require_lodash = __commonJS({
|
|
|
4199
4199
|
if (isSymbol(value)) {
|
|
4200
4200
|
return NAN;
|
|
4201
4201
|
}
|
|
4202
|
-
if (
|
|
4202
|
+
if (isObject(value)) {
|
|
4203
4203
|
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
4204
|
-
value =
|
|
4204
|
+
value = isObject(other) ? other + "" : other;
|
|
4205
4205
|
}
|
|
4206
4206
|
if (typeof value != "string") {
|
|
4207
4207
|
return value === 0 ? value : +value;
|
|
@@ -4295,7 +4295,7 @@ var require_lodash = __commonJS({
|
|
|
4295
4295
|
function functionsIn(object) {
|
|
4296
4296
|
return object == null ? [] : baseFunctions(object, keysIn(object));
|
|
4297
4297
|
}
|
|
4298
|
-
function
|
|
4298
|
+
function get(object, path, defaultValue) {
|
|
4299
4299
|
var result2 = object == null ? undefined2 : baseGet(object, path);
|
|
4300
4300
|
return result2 === undefined2 ? defaultValue : result2;
|
|
4301
4301
|
}
|
|
@@ -4406,7 +4406,7 @@ var require_lodash = __commonJS({
|
|
|
4406
4406
|
}
|
|
4407
4407
|
return object;
|
|
4408
4408
|
}
|
|
4409
|
-
function
|
|
4409
|
+
function set(object, path, value) {
|
|
4410
4410
|
return object == null ? object : baseSet(object, path, value);
|
|
4411
4411
|
}
|
|
4412
4412
|
function setWith(object, path, value, customizer) {
|
|
@@ -4422,7 +4422,7 @@ var require_lodash = __commonJS({
|
|
|
4422
4422
|
var Ctor = object && object.constructor;
|
|
4423
4423
|
if (isArrLike) {
|
|
4424
4424
|
accumulator = isArr ? new Ctor() : [];
|
|
4425
|
-
} else if (
|
|
4425
|
+
} else if (isObject(object)) {
|
|
4426
4426
|
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
|
|
4427
4427
|
} else {
|
|
4428
4428
|
accumulator = {};
|
|
@@ -4707,7 +4707,7 @@ var require_lodash = __commonJS({
|
|
|
4707
4707
|
}
|
|
4708
4708
|
function truncate(string, options) {
|
|
4709
4709
|
var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
|
|
4710
|
-
if (
|
|
4710
|
+
if (isObject(options)) {
|
|
4711
4711
|
var separator = "separator" in options ? options.separator : separator;
|
|
4712
4712
|
length = "length" in options ? toInteger(options.length) : length;
|
|
4713
4713
|
omission = "omission" in options ? baseToString(options.omission) : omission;
|
|
@@ -4837,13 +4837,13 @@ var require_lodash = __commonJS({
|
|
|
4837
4837
|
});
|
|
4838
4838
|
function mixin(object, source, options) {
|
|
4839
4839
|
var props = keys(source), methodNames = baseFunctions(source, props);
|
|
4840
|
-
if (options == null && !(
|
|
4840
|
+
if (options == null && !(isObject(source) && (methodNames.length || !props.length))) {
|
|
4841
4841
|
options = source;
|
|
4842
4842
|
source = object;
|
|
4843
4843
|
object = this;
|
|
4844
4844
|
methodNames = baseFunctions(source, keys(source));
|
|
4845
4845
|
}
|
|
4846
|
-
var chain2 = !(
|
|
4846
|
+
var chain2 = !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object);
|
|
4847
4847
|
arrayEach(methodNames, function(methodName) {
|
|
4848
4848
|
var func = source[methodName];
|
|
4849
4849
|
object[methodName] = func;
|
|
@@ -4880,7 +4880,7 @@ var require_lodash = __commonJS({
|
|
|
4880
4880
|
var overEvery = createOver(arrayEvery);
|
|
4881
4881
|
var overSome = createOver(arraySome);
|
|
4882
4882
|
function property(path) {
|
|
4883
|
-
return
|
|
4883
|
+
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
|
|
4884
4884
|
}
|
|
4885
4885
|
function propertyOf(object) {
|
|
4886
4886
|
return function(path) {
|
|
@@ -4922,7 +4922,7 @@ var require_lodash = __commonJS({
|
|
|
4922
4922
|
if (isArray(value)) {
|
|
4923
4923
|
return arrayMap(value, toKey);
|
|
4924
4924
|
}
|
|
4925
|
-
return isSymbol(value) ? [value] : copyArray(
|
|
4925
|
+
return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
|
|
4926
4926
|
}
|
|
4927
4927
|
function uniqueId(prefix) {
|
|
4928
4928
|
var id = ++idCounter;
|
|
@@ -4981,7 +4981,7 @@ var require_lodash = __commonJS({
|
|
|
4981
4981
|
lodash.castArray = castArray;
|
|
4982
4982
|
lodash.chain = chain;
|
|
4983
4983
|
lodash.chunk = chunk;
|
|
4984
|
-
lodash.compact =
|
|
4984
|
+
lodash.compact = compact;
|
|
4985
4985
|
lodash.concat = concat;
|
|
4986
4986
|
lodash.cond = cond;
|
|
4987
4987
|
lodash.conforms = conforms;
|
|
@@ -5069,7 +5069,7 @@ var require_lodash = __commonJS({
|
|
|
5069
5069
|
lodash.rest = rest;
|
|
5070
5070
|
lodash.reverse = reverse;
|
|
5071
5071
|
lodash.sampleSize = sampleSize;
|
|
5072
|
-
lodash.set =
|
|
5072
|
+
lodash.set = set;
|
|
5073
5073
|
lodash.setWith = setWith;
|
|
5074
5074
|
lodash.shuffle = shuffle;
|
|
5075
5075
|
lodash.slice = slice;
|
|
@@ -5153,7 +5153,7 @@ var require_lodash = __commonJS({
|
|
|
5153
5153
|
lodash.forInRight = forInRight;
|
|
5154
5154
|
lodash.forOwn = forOwn;
|
|
5155
5155
|
lodash.forOwnRight = forOwnRight;
|
|
5156
|
-
lodash.get =
|
|
5156
|
+
lodash.get = get;
|
|
5157
5157
|
lodash.gt = gt;
|
|
5158
5158
|
lodash.gte = gte;
|
|
5159
5159
|
lodash.has = has;
|
|
@@ -5189,16 +5189,16 @@ var require_lodash = __commonJS({
|
|
|
5189
5189
|
lodash.isNil = isNil;
|
|
5190
5190
|
lodash.isNull = isNull;
|
|
5191
5191
|
lodash.isNumber = isNumber;
|
|
5192
|
-
lodash.isObject =
|
|
5192
|
+
lodash.isObject = isObject;
|
|
5193
5193
|
lodash.isObjectLike = isObjectLike;
|
|
5194
|
-
lodash.isPlainObject =
|
|
5194
|
+
lodash.isPlainObject = isPlainObject;
|
|
5195
5195
|
lodash.isRegExp = isRegExp;
|
|
5196
5196
|
lodash.isSafeInteger = isSafeInteger;
|
|
5197
5197
|
lodash.isSet = isSet;
|
|
5198
|
-
lodash.isString =
|
|
5198
|
+
lodash.isString = isString;
|
|
5199
5199
|
lodash.isSymbol = isSymbol;
|
|
5200
5200
|
lodash.isTypedArray = isTypedArray;
|
|
5201
|
-
lodash.isUndefined =
|
|
5201
|
+
lodash.isUndefined = isUndefined;
|
|
5202
5202
|
lodash.isWeakMap = isWeakMap;
|
|
5203
5203
|
lodash.isWeakSet = isWeakSet;
|
|
5204
5204
|
lodash.join = join;
|
|
@@ -5458,6 +5458,62 @@ var require_lodash = __commonJS({
|
|
|
5458
5458
|
}
|
|
5459
5459
|
});
|
|
5460
5460
|
|
|
5461
|
+
// src/index.ts
|
|
5462
|
+
export * from "apollo-common";
|
|
5463
|
+
|
|
5464
|
+
// ../apollo-utils/src/form-meta/utils.tsx
|
|
5465
|
+
var import_lodash = __toESM(require_lodash());
|
|
5466
|
+
|
|
5467
|
+
// ../../node_modules/react-hook-form/dist/index.esm.mjs
|
|
5468
|
+
import React from "react";
|
|
5469
|
+
var isWeb = typeof window !== "undefined" && typeof window.HTMLElement !== "undefined" && typeof document !== "undefined";
|
|
5470
|
+
var VALIDATION_MODE = {
|
|
5471
|
+
onBlur: "onBlur",
|
|
5472
|
+
onChange: "onChange",
|
|
5473
|
+
onSubmit: "onSubmit",
|
|
5474
|
+
onTouched: "onTouched",
|
|
5475
|
+
all: "all"
|
|
5476
|
+
};
|
|
5477
|
+
var HookFormContext = React.createContext(null);
|
|
5478
|
+
var useFormContext = () => React.useContext(HookFormContext);
|
|
5479
|
+
var defaultOptions = {
|
|
5480
|
+
mode: VALIDATION_MODE.onSubmit,
|
|
5481
|
+
reValidateMode: VALIDATION_MODE.onChange,
|
|
5482
|
+
shouldFocusError: true
|
|
5483
|
+
};
|
|
5484
|
+
|
|
5485
|
+
// ../apollo-utils/src/form-meta/utils.tsx
|
|
5486
|
+
var formMeta = {
|
|
5487
|
+
_editMode: false,
|
|
5488
|
+
_isNew: false,
|
|
5489
|
+
_hasRemoteChange: false
|
|
5490
|
+
};
|
|
5491
|
+
function useEditMode() {
|
|
5492
|
+
const { watch } = useFormContext();
|
|
5493
|
+
return watch("_editMode") ?? false;
|
|
5494
|
+
}
|
|
5495
|
+
function useHasRemoteChange() {
|
|
5496
|
+
const { watch } = useFormContext();
|
|
5497
|
+
return watch("_hasRemoteChange") ?? false;
|
|
5498
|
+
}
|
|
5499
|
+
function useGetIsNew() {
|
|
5500
|
+
const { getValues } = useFormContext();
|
|
5501
|
+
return () => getValues("_isNew") ?? false;
|
|
5502
|
+
}
|
|
5503
|
+
function useSetFormMeta() {
|
|
5504
|
+
const { setValue } = useFormContext();
|
|
5505
|
+
return (newValues) => objectKeys(newValues).forEach((key) => newValues[key] && setValue(key, newValues[key]));
|
|
5506
|
+
}
|
|
5507
|
+
function objectKeys(obj) {
|
|
5508
|
+
return Object.keys(obj);
|
|
5509
|
+
}
|
|
5510
|
+
function removeFormMeta(withFormMeta) {
|
|
5511
|
+
return (0, import_lodash.omit)(withFormMeta, Object.keys(formMeta));
|
|
5512
|
+
}
|
|
5513
|
+
function addFormMeta(withoutFormMeta) {
|
|
5514
|
+
return { ...formMeta, ...withoutFormMeta };
|
|
5515
|
+
}
|
|
5516
|
+
|
|
5461
5517
|
// src/AppShell/AppShell.tsx
|
|
5462
5518
|
import { Icon, TopBar } from "@equinor/eds-core-react";
|
|
5463
5519
|
import { apps } from "@equinor/eds-icons";
|
|
@@ -5566,9 +5622,6 @@ import { tokens as tokens2 } from "@equinor/eds-tokens";
|
|
|
5566
5622
|
import styled3 from "styled-components";
|
|
5567
5623
|
|
|
5568
5624
|
// src/cells/utils.tsx
|
|
5569
|
-
import { Icon as Icon3 } from "@equinor/eds-core-react";
|
|
5570
|
-
import { error_filled, warning_filled } from "@equinor/eds-icons";
|
|
5571
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
5572
5625
|
function stringToHslColor(str, s = 80, l = 85) {
|
|
5573
5626
|
let hash = 0;
|
|
5574
5627
|
for (let i = 0; i < str.length; i++) {
|
|
@@ -5577,43 +5630,9 @@ function stringToHslColor(str, s = 80, l = 85) {
|
|
|
5577
5630
|
const h = hash % 360;
|
|
5578
5631
|
return "hsl(" + h + ", " + s + "%, " + l + "%)";
|
|
5579
5632
|
}
|
|
5580
|
-
function stopPropagation(handler) {
|
|
5581
|
-
return (e) => {
|
|
5582
|
-
e.stopPropagation();
|
|
5583
|
-
handler(e);
|
|
5584
|
-
};
|
|
5585
|
-
}
|
|
5586
|
-
function getHelperTextProps({
|
|
5587
|
-
error,
|
|
5588
|
-
warning,
|
|
5589
|
-
helperText
|
|
5590
|
-
}) {
|
|
5591
|
-
if (error)
|
|
5592
|
-
return {
|
|
5593
|
-
variant: "error",
|
|
5594
|
-
helperText: error.message,
|
|
5595
|
-
helperIcon: /* @__PURE__ */ jsx3(Icon3, {
|
|
5596
|
-
data: error_filled,
|
|
5597
|
-
size: 16
|
|
5598
|
-
})
|
|
5599
|
-
};
|
|
5600
|
-
if (warning)
|
|
5601
|
-
return {
|
|
5602
|
-
variant: "warning",
|
|
5603
|
-
helperText: warning.message,
|
|
5604
|
-
helperIcon: /* @__PURE__ */ jsx3(Icon3, {
|
|
5605
|
-
data: warning_filled,
|
|
5606
|
-
size: 16
|
|
5607
|
-
})
|
|
5608
|
-
};
|
|
5609
|
-
return {
|
|
5610
|
-
helperText,
|
|
5611
|
-
helperIcon: null
|
|
5612
|
-
};
|
|
5613
|
-
}
|
|
5614
5633
|
|
|
5615
5634
|
// src/cells/ChipsCell.tsx
|
|
5616
|
-
import { jsx as
|
|
5635
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
5617
5636
|
var ChipsWrapper = styled3.div`
|
|
5618
5637
|
display: flex;
|
|
5619
5638
|
align-items: center;
|
|
@@ -5632,8 +5651,8 @@ var Chip = styled3.div`
|
|
|
5632
5651
|
`;
|
|
5633
5652
|
var ChipsCell = (props) => {
|
|
5634
5653
|
var _a;
|
|
5635
|
-
return /* @__PURE__ */
|
|
5636
|
-
children: (_a = props.values) == null ? void 0 : _a.map((value) => /* @__PURE__ */
|
|
5654
|
+
return /* @__PURE__ */ jsx3(ChipsWrapper, {
|
|
5655
|
+
children: (_a = props.values) == null ? void 0 : _a.map((value) => /* @__PURE__ */ jsx3(Chip, {
|
|
5637
5656
|
backgroundColor: stringToHslColor(value),
|
|
5638
5657
|
children: value
|
|
5639
5658
|
}, value))
|
|
@@ -5672,7 +5691,7 @@ var StickyHeaderCell = styled4(StickyCell)`
|
|
|
5672
5691
|
`;
|
|
5673
5692
|
|
|
5674
5693
|
// src/cells/DynamicCell.tsx
|
|
5675
|
-
import { jsx as
|
|
5694
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
5676
5695
|
var StyledStickyCell = styled5(StickyCell)`
|
|
5677
5696
|
background-color: ${({ backgroundColor: bg }) => bg ? `${bg} !important` : `inherit`};
|
|
5678
5697
|
`;
|
|
@@ -5683,797 +5702,26 @@ function DynamicCell({ cell, highlight, getStickyCellColor }) {
|
|
|
5683
5702
|
var _a;
|
|
5684
5703
|
const cellContent = flexRender(cell.column.columnDef.cell, cell.getContext());
|
|
5685
5704
|
if ((_a = cell.column.columnDef.meta) == null ? void 0 : _a.sticky) {
|
|
5686
|
-
return /* @__PURE__ */
|
|
5705
|
+
return /* @__PURE__ */ jsx4(StyledStickyCell, {
|
|
5687
5706
|
backgroundColor: getStickyCellColor == null ? void 0 : getStickyCellColor(cell),
|
|
5688
5707
|
"data-column": cell.column.id,
|
|
5689
5708
|
children: cellContent
|
|
5690
5709
|
});
|
|
5691
5710
|
}
|
|
5692
|
-
return /* @__PURE__ */
|
|
5711
|
+
return /* @__PURE__ */ jsx4(StyledCell, {
|
|
5693
5712
|
"data-column": cell.column.id,
|
|
5694
5713
|
backgroundColor: highlight ? "#d5eaf4" : void 0,
|
|
5695
5714
|
children: cellContent
|
|
5696
5715
|
});
|
|
5697
5716
|
}
|
|
5698
5717
|
|
|
5699
|
-
// src/cells/EditableCheckboxCell.tsx
|
|
5700
|
-
import { Checkbox, EdsProvider } from "@equinor/eds-core-react";
|
|
5701
|
-
|
|
5702
|
-
// ../../node_modules/react-hook-form/dist/index.esm.mjs
|
|
5703
|
-
import React from "react";
|
|
5704
|
-
var isCheckBoxInput = (element) => element.type === "checkbox";
|
|
5705
|
-
var isDateObject = (value) => value instanceof Date;
|
|
5706
|
-
var isNullOrUndefined = (value) => value == null;
|
|
5707
|
-
var isObjectType = (value) => typeof value === "object";
|
|
5708
|
-
var isObject = (value) => !isNullOrUndefined(value) && !Array.isArray(value) && isObjectType(value) && !isDateObject(value);
|
|
5709
|
-
var getEventValue = (event) => isObject(event) && event.target ? isCheckBoxInput(event.target) ? event.target.checked : event.target.value : event;
|
|
5710
|
-
var getNodeParentName = (name) => name.substring(0, name.search(/\.\d+(\.|$)/)) || name;
|
|
5711
|
-
var isNameInFieldArray = (names, name) => names.has(getNodeParentName(name));
|
|
5712
|
-
var isPlainObject = (tempObject) => {
|
|
5713
|
-
const prototypeCopy = tempObject.constructor && tempObject.constructor.prototype;
|
|
5714
|
-
return isObject(prototypeCopy) && prototypeCopy.hasOwnProperty("isPrototypeOf");
|
|
5715
|
-
};
|
|
5716
|
-
var isWeb = typeof window !== "undefined" && typeof window.HTMLElement !== "undefined" && typeof document !== "undefined";
|
|
5717
|
-
function cloneObject(data) {
|
|
5718
|
-
let copy;
|
|
5719
|
-
const isArray = Array.isArray(data);
|
|
5720
|
-
if (data instanceof Date) {
|
|
5721
|
-
copy = new Date(data);
|
|
5722
|
-
} else if (data instanceof Set) {
|
|
5723
|
-
copy = new Set(data);
|
|
5724
|
-
} else if (!(isWeb && (data instanceof Blob || data instanceof FileList)) && (isArray || isObject(data))) {
|
|
5725
|
-
copy = isArray ? [] : {};
|
|
5726
|
-
if (!Array.isArray(data) && !isPlainObject(data)) {
|
|
5727
|
-
copy = data;
|
|
5728
|
-
} else {
|
|
5729
|
-
for (const key in data) {
|
|
5730
|
-
copy[key] = cloneObject(data[key]);
|
|
5731
|
-
}
|
|
5732
|
-
}
|
|
5733
|
-
} else {
|
|
5734
|
-
return data;
|
|
5735
|
-
}
|
|
5736
|
-
return copy;
|
|
5737
|
-
}
|
|
5738
|
-
var compact = (value) => Array.isArray(value) ? value.filter(Boolean) : [];
|
|
5739
|
-
var isUndefined = (val) => val === void 0;
|
|
5740
|
-
var get = (obj, path, defaultValue) => {
|
|
5741
|
-
if (!path || !isObject(obj)) {
|
|
5742
|
-
return defaultValue;
|
|
5743
|
-
}
|
|
5744
|
-
const result = compact(path.split(/[,[\].]+?/)).reduce((result2, key) => isNullOrUndefined(result2) ? result2 : result2[key], obj);
|
|
5745
|
-
return isUndefined(result) || result === obj ? isUndefined(obj[path]) ? defaultValue : obj[path] : result;
|
|
5746
|
-
};
|
|
5747
|
-
var EVENTS = {
|
|
5748
|
-
BLUR: "blur",
|
|
5749
|
-
FOCUS_OUT: "focusout",
|
|
5750
|
-
CHANGE: "change"
|
|
5751
|
-
};
|
|
5752
|
-
var VALIDATION_MODE = {
|
|
5753
|
-
onBlur: "onBlur",
|
|
5754
|
-
onChange: "onChange",
|
|
5755
|
-
onSubmit: "onSubmit",
|
|
5756
|
-
onTouched: "onTouched",
|
|
5757
|
-
all: "all"
|
|
5758
|
-
};
|
|
5759
|
-
var HookFormContext = React.createContext(null);
|
|
5760
|
-
var useFormContext = () => React.useContext(HookFormContext);
|
|
5761
|
-
var getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => {
|
|
5762
|
-
const result = {
|
|
5763
|
-
defaultValues: control._defaultValues
|
|
5764
|
-
};
|
|
5765
|
-
for (const key in formState) {
|
|
5766
|
-
Object.defineProperty(result, key, {
|
|
5767
|
-
get: () => {
|
|
5768
|
-
const _key = key;
|
|
5769
|
-
if (control._proxyFormState[_key] !== VALIDATION_MODE.all) {
|
|
5770
|
-
control._proxyFormState[_key] = !isRoot || VALIDATION_MODE.all;
|
|
5771
|
-
}
|
|
5772
|
-
localProxyFormState && (localProxyFormState[_key] = true);
|
|
5773
|
-
return formState[_key];
|
|
5774
|
-
}
|
|
5775
|
-
});
|
|
5776
|
-
}
|
|
5777
|
-
return result;
|
|
5778
|
-
};
|
|
5779
|
-
var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;
|
|
5780
|
-
var shouldRenderFormState = (formStateData, _proxyFormState, updateFormState, isRoot) => {
|
|
5781
|
-
updateFormState(formStateData);
|
|
5782
|
-
const { name, ...formState } = formStateData;
|
|
5783
|
-
return isEmptyObject(formState) || Object.keys(formState).length >= Object.keys(_proxyFormState).length || Object.keys(formState).find((key) => _proxyFormState[key] === (!isRoot || VALIDATION_MODE.all));
|
|
5784
|
-
};
|
|
5785
|
-
var convertToArrayPayload = (value) => Array.isArray(value) ? value : [value];
|
|
5786
|
-
var shouldSubscribeByName = (name, signalName, exact) => exact && signalName ? name === signalName : !name || !signalName || name === signalName || convertToArrayPayload(name).some((currentName) => currentName && (currentName.startsWith(signalName) || signalName.startsWith(currentName)));
|
|
5787
|
-
function useSubscribe(props) {
|
|
5788
|
-
const _props = React.useRef(props);
|
|
5789
|
-
_props.current = props;
|
|
5790
|
-
React.useEffect(() => {
|
|
5791
|
-
const subscription = !props.disabled && _props.current.subject && _props.current.subject.subscribe({
|
|
5792
|
-
next: _props.current.next
|
|
5793
|
-
});
|
|
5794
|
-
return () => {
|
|
5795
|
-
subscription && subscription.unsubscribe();
|
|
5796
|
-
};
|
|
5797
|
-
}, [props.disabled]);
|
|
5798
|
-
}
|
|
5799
|
-
function useFormState(props) {
|
|
5800
|
-
const methods = useFormContext();
|
|
5801
|
-
const { control = methods.control, disabled, name, exact } = props || {};
|
|
5802
|
-
const [formState, updateFormState] = React.useState(control._formState);
|
|
5803
|
-
const _mounted = React.useRef(true);
|
|
5804
|
-
const _localProxyFormState = React.useRef({
|
|
5805
|
-
isDirty: false,
|
|
5806
|
-
isLoading: false,
|
|
5807
|
-
dirtyFields: false,
|
|
5808
|
-
touchedFields: false,
|
|
5809
|
-
isValidating: false,
|
|
5810
|
-
isValid: false,
|
|
5811
|
-
errors: false
|
|
5812
|
-
});
|
|
5813
|
-
const _name = React.useRef(name);
|
|
5814
|
-
_name.current = name;
|
|
5815
|
-
useSubscribe({
|
|
5816
|
-
disabled,
|
|
5817
|
-
next: (value) => _mounted.current && shouldSubscribeByName(_name.current, value.name, exact) && shouldRenderFormState(value, _localProxyFormState.current, control._updateFormState) && updateFormState({
|
|
5818
|
-
...control._formState,
|
|
5819
|
-
...value
|
|
5820
|
-
}),
|
|
5821
|
-
subject: control._subjects.state
|
|
5822
|
-
});
|
|
5823
|
-
React.useEffect(() => {
|
|
5824
|
-
_mounted.current = true;
|
|
5825
|
-
_localProxyFormState.current.isValid && control._updateValid(true);
|
|
5826
|
-
return () => {
|
|
5827
|
-
_mounted.current = false;
|
|
5828
|
-
};
|
|
5829
|
-
}, [control]);
|
|
5830
|
-
return getProxyFormState(formState, control, _localProxyFormState.current, false);
|
|
5831
|
-
}
|
|
5832
|
-
var isString = (value) => typeof value === "string";
|
|
5833
|
-
var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) => {
|
|
5834
|
-
if (isString(names)) {
|
|
5835
|
-
isGlobal && _names.watch.add(names);
|
|
5836
|
-
return get(formValues, names, defaultValue);
|
|
5837
|
-
}
|
|
5838
|
-
if (Array.isArray(names)) {
|
|
5839
|
-
return names.map((fieldName) => (isGlobal && _names.watch.add(fieldName), get(formValues, fieldName)));
|
|
5840
|
-
}
|
|
5841
|
-
isGlobal && (_names.watchAll = true);
|
|
5842
|
-
return formValues;
|
|
5843
|
-
};
|
|
5844
|
-
function useWatch(props) {
|
|
5845
|
-
const methods = useFormContext();
|
|
5846
|
-
const { control = methods.control, name, defaultValue, disabled, exact } = props || {};
|
|
5847
|
-
const _name = React.useRef(name);
|
|
5848
|
-
_name.current = name;
|
|
5849
|
-
useSubscribe({
|
|
5850
|
-
disabled,
|
|
5851
|
-
subject: control._subjects.values,
|
|
5852
|
-
next: (formState) => {
|
|
5853
|
-
if (shouldSubscribeByName(_name.current, formState.name, exact)) {
|
|
5854
|
-
updateValue(cloneObject(generateWatchOutput(_name.current, control._names, formState.values || control._formValues, false, defaultValue)));
|
|
5855
|
-
}
|
|
5856
|
-
}
|
|
5857
|
-
});
|
|
5858
|
-
const [value, updateValue] = React.useState(control._getWatch(name, defaultValue));
|
|
5859
|
-
React.useEffect(() => control._removeUnmounted());
|
|
5860
|
-
return value;
|
|
5861
|
-
}
|
|
5862
|
-
var isKey = (value) => /^\w*$/.test(value);
|
|
5863
|
-
var stringToPath = (input) => compact(input.replace(/["|']|\]/g, "").split(/\.|\[/));
|
|
5864
|
-
function set(object, path, value) {
|
|
5865
|
-
let index = -1;
|
|
5866
|
-
const tempPath = isKey(path) ? [path] : stringToPath(path);
|
|
5867
|
-
const length = tempPath.length;
|
|
5868
|
-
const lastIndex = length - 1;
|
|
5869
|
-
while (++index < length) {
|
|
5870
|
-
const key = tempPath[index];
|
|
5871
|
-
let newValue = value;
|
|
5872
|
-
if (index !== lastIndex) {
|
|
5873
|
-
const objValue = object[key];
|
|
5874
|
-
newValue = isObject(objValue) || Array.isArray(objValue) ? objValue : !isNaN(+tempPath[index + 1]) ? [] : {};
|
|
5875
|
-
}
|
|
5876
|
-
object[key] = newValue;
|
|
5877
|
-
object = object[key];
|
|
5878
|
-
}
|
|
5879
|
-
return object;
|
|
5880
|
-
}
|
|
5881
|
-
function useController(props) {
|
|
5882
|
-
const methods = useFormContext();
|
|
5883
|
-
const { name, control = methods.control, shouldUnregister } = props;
|
|
5884
|
-
const isArrayField = isNameInFieldArray(control._names.array, name);
|
|
5885
|
-
const value = useWatch({
|
|
5886
|
-
control,
|
|
5887
|
-
name,
|
|
5888
|
-
defaultValue: get(control._formValues, name, get(control._defaultValues, name, props.defaultValue)),
|
|
5889
|
-
exact: true
|
|
5890
|
-
});
|
|
5891
|
-
const formState = useFormState({
|
|
5892
|
-
control,
|
|
5893
|
-
name
|
|
5894
|
-
});
|
|
5895
|
-
const _registerProps = React.useRef(control.register(name, {
|
|
5896
|
-
...props.rules,
|
|
5897
|
-
value
|
|
5898
|
-
}));
|
|
5899
|
-
React.useEffect(() => {
|
|
5900
|
-
const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
|
|
5901
|
-
const updateMounted = (name2, value2) => {
|
|
5902
|
-
const field = get(control._fields, name2);
|
|
5903
|
-
if (field) {
|
|
5904
|
-
field._f.mount = value2;
|
|
5905
|
-
}
|
|
5906
|
-
};
|
|
5907
|
-
updateMounted(name, true);
|
|
5908
|
-
if (_shouldUnregisterField) {
|
|
5909
|
-
const value2 = cloneObject(get(control._options.defaultValues, name));
|
|
5910
|
-
set(control._defaultValues, name, value2);
|
|
5911
|
-
if (isUndefined(get(control._formValues, name))) {
|
|
5912
|
-
set(control._formValues, name, value2);
|
|
5913
|
-
}
|
|
5914
|
-
}
|
|
5915
|
-
return () => {
|
|
5916
|
-
(isArrayField ? _shouldUnregisterField && !control._state.action : _shouldUnregisterField) ? control.unregister(name) : updateMounted(name, false);
|
|
5917
|
-
};
|
|
5918
|
-
}, [name, control, isArrayField, shouldUnregister]);
|
|
5919
|
-
return {
|
|
5920
|
-
field: {
|
|
5921
|
-
name,
|
|
5922
|
-
value,
|
|
5923
|
-
onChange: React.useCallback((event) => _registerProps.current.onChange({
|
|
5924
|
-
target: {
|
|
5925
|
-
value: getEventValue(event),
|
|
5926
|
-
name
|
|
5927
|
-
},
|
|
5928
|
-
type: EVENTS.CHANGE
|
|
5929
|
-
}), [name]),
|
|
5930
|
-
onBlur: React.useCallback(() => _registerProps.current.onBlur({
|
|
5931
|
-
target: {
|
|
5932
|
-
value: get(control._formValues, name),
|
|
5933
|
-
name
|
|
5934
|
-
},
|
|
5935
|
-
type: EVENTS.BLUR
|
|
5936
|
-
}), [name, control]),
|
|
5937
|
-
ref: (elm) => {
|
|
5938
|
-
const field = get(control._fields, name);
|
|
5939
|
-
if (field && elm) {
|
|
5940
|
-
field._f.ref = {
|
|
5941
|
-
focus: () => elm.focus(),
|
|
5942
|
-
select: () => elm.select(),
|
|
5943
|
-
setCustomValidity: (message) => elm.setCustomValidity(message),
|
|
5944
|
-
reportValidity: () => elm.reportValidity()
|
|
5945
|
-
};
|
|
5946
|
-
}
|
|
5947
|
-
}
|
|
5948
|
-
},
|
|
5949
|
-
formState,
|
|
5950
|
-
fieldState: Object.defineProperties({}, {
|
|
5951
|
-
invalid: {
|
|
5952
|
-
enumerable: true,
|
|
5953
|
-
get: () => !!get(formState.errors, name)
|
|
5954
|
-
},
|
|
5955
|
-
isDirty: {
|
|
5956
|
-
enumerable: true,
|
|
5957
|
-
get: () => !!get(formState.dirtyFields, name)
|
|
5958
|
-
},
|
|
5959
|
-
isTouched: {
|
|
5960
|
-
enumerable: true,
|
|
5961
|
-
get: () => !!get(formState.touchedFields, name)
|
|
5962
|
-
},
|
|
5963
|
-
error: {
|
|
5964
|
-
enumerable: true,
|
|
5965
|
-
get: () => get(formState.errors, name)
|
|
5966
|
-
}
|
|
5967
|
-
})
|
|
5968
|
-
};
|
|
5969
|
-
}
|
|
5970
|
-
var Controller = (props) => props.render(useController(props));
|
|
5971
|
-
var defaultOptions = {
|
|
5972
|
-
mode: VALIDATION_MODE.onSubmit,
|
|
5973
|
-
reValidateMode: VALIDATION_MODE.onChange,
|
|
5974
|
-
shouldFocusError: true
|
|
5975
|
-
};
|
|
5976
|
-
|
|
5977
|
-
// src/formMeta/utils.tsx
|
|
5978
|
-
var import_lodash = __toESM(require_lodash());
|
|
5979
|
-
var formMeta = {
|
|
5980
|
-
_editMode: false,
|
|
5981
|
-
_isNew: false,
|
|
5982
|
-
_hasRemoteChange: false
|
|
5983
|
-
};
|
|
5984
|
-
function useEditMode() {
|
|
5985
|
-
const { watch } = useFormContext();
|
|
5986
|
-
return watch("_editMode") ?? false;
|
|
5987
|
-
}
|
|
5988
|
-
function useHasRemoteChange() {
|
|
5989
|
-
const { watch } = useFormContext();
|
|
5990
|
-
return watch("_hasRemoteChange") ?? false;
|
|
5991
|
-
}
|
|
5992
|
-
function useGetIsNew() {
|
|
5993
|
-
const { getValues } = useFormContext();
|
|
5994
|
-
return () => getValues("_isNew") ?? false;
|
|
5995
|
-
}
|
|
5996
|
-
function useSetFormMeta() {
|
|
5997
|
-
const { setValue } = useFormContext();
|
|
5998
|
-
return (newValues) => objectKeys(newValues).forEach((key) => newValues[key] && setValue(key, newValues[key]));
|
|
5999
|
-
}
|
|
6000
|
-
function objectKeys(obj) {
|
|
6001
|
-
return Object.keys(obj);
|
|
6002
|
-
}
|
|
6003
|
-
function removeFormMeta(withFormMeta) {
|
|
6004
|
-
return (0, import_lodash.omit)(withFormMeta, Object.keys(formMeta));
|
|
6005
|
-
}
|
|
6006
|
-
function addFormMeta(withoutFormMeta) {
|
|
6007
|
-
return { ...formMeta, ...withoutFormMeta };
|
|
6008
|
-
}
|
|
6009
|
-
|
|
6010
|
-
// src/cells/EditableCheckboxCell.tsx
|
|
6011
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
6012
|
-
function EditableCheckboxCell(context) {
|
|
6013
|
-
const editMode = useEditMode();
|
|
6014
|
-
const { control } = useFormContext();
|
|
6015
|
-
if (!editMode)
|
|
6016
|
-
return /* @__PURE__ */ jsx6(EdsProvider, {
|
|
6017
|
-
density: "compact",
|
|
6018
|
-
children: /* @__PURE__ */ jsx6(Checkbox, {
|
|
6019
|
-
enterKeyHint: "next",
|
|
6020
|
-
"aria-label": "readonly",
|
|
6021
|
-
readOnly: true,
|
|
6022
|
-
checked: context.getValue(),
|
|
6023
|
-
disabled: true
|
|
6024
|
-
})
|
|
6025
|
-
});
|
|
6026
|
-
return /* @__PURE__ */ jsx6(Controller, {
|
|
6027
|
-
control,
|
|
6028
|
-
name: context.column.id,
|
|
6029
|
-
render: ({ field: { value, ...field } }) => /* @__PURE__ */ jsx6(EdsProvider, {
|
|
6030
|
-
density: "compact",
|
|
6031
|
-
children: /* @__PURE__ */ jsx6(Checkbox, {
|
|
6032
|
-
enterKeyHint: "send",
|
|
6033
|
-
"aria-label": "editable",
|
|
6034
|
-
checked: value,
|
|
6035
|
-
...field
|
|
6036
|
-
})
|
|
6037
|
-
})
|
|
6038
|
-
});
|
|
6039
|
-
}
|
|
6040
|
-
|
|
6041
|
-
// src/cells/EditableDateCell.tsx
|
|
6042
|
-
import { TextField } from "@equinor/eds-core-react";
|
|
6043
|
-
import { useMemo } from "react";
|
|
6044
|
-
import styled7 from "styled-components";
|
|
6045
|
-
|
|
6046
|
-
// src/cells/TypographyCustom.tsx
|
|
6047
|
-
import {
|
|
6048
|
-
Typography as EdsTypography
|
|
6049
|
-
} from "@equinor/eds-core-react";
|
|
6050
|
-
import { tokens as tokens3 } from "@equinor/eds-tokens";
|
|
6051
|
-
import styled6 from "styled-components";
|
|
6052
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
6053
|
-
var truncateStyle = {
|
|
6054
|
-
overflow: "hidden",
|
|
6055
|
-
whiteSpace: "nowrap",
|
|
6056
|
-
textOverflow: "ellipsis"
|
|
6057
|
-
};
|
|
6058
|
-
var TypographyCustom = (props) => {
|
|
6059
|
-
const { truncate, style: styleFromProps, ...edsTypographyProps } = props;
|
|
6060
|
-
if (truncate)
|
|
6061
|
-
return /* @__PURE__ */ jsx7(HoverCapture, {
|
|
6062
|
-
children: /* @__PURE__ */ jsx7(EdsTypography, {
|
|
6063
|
-
...edsTypographyProps,
|
|
6064
|
-
style: {
|
|
6065
|
-
...styleFromProps,
|
|
6066
|
-
...truncateStyle
|
|
6067
|
-
}
|
|
6068
|
-
})
|
|
6069
|
-
});
|
|
6070
|
-
return /* @__PURE__ */ jsx7(EdsTypography, {
|
|
6071
|
-
...edsTypographyProps,
|
|
6072
|
-
style: styleFromProps
|
|
6073
|
-
});
|
|
6074
|
-
};
|
|
6075
|
-
var HoverCapture = styled6.div`
|
|
6076
|
-
height: ${tokens3.typography.table.cell_text.lineHeight};
|
|
6077
|
-
background-color: inherit;
|
|
6078
|
-
|
|
6079
|
-
position: relative;
|
|
6080
|
-
width: 100%;
|
|
6081
|
-
|
|
6082
|
-
&:hover {
|
|
6083
|
-
z-index: 1;
|
|
6084
|
-
}
|
|
6085
|
-
|
|
6086
|
-
& > * {
|
|
6087
|
-
width: inherit;
|
|
6088
|
-
position: absolute;
|
|
6089
|
-
}
|
|
6090
|
-
|
|
6091
|
-
&:hover > * {
|
|
6092
|
-
width: auto;
|
|
6093
|
-
z-index: 1;
|
|
6094
|
-
padding: 0.5em 1em;
|
|
6095
|
-
margin: -0.5em -1em;
|
|
6096
|
-
|
|
6097
|
-
background-color: inherit;
|
|
6098
|
-
}
|
|
6099
|
-
`;
|
|
6100
|
-
|
|
6101
|
-
// src/cells/EditableDateCell.tsx
|
|
6102
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
6103
|
-
function EditableDateCell(props) {
|
|
6104
|
-
const { dateStringFormatter, ...context } = props;
|
|
6105
|
-
const rawValue = context.getValue();
|
|
6106
|
-
const editMode = useEditMode();
|
|
6107
|
-
const { control } = useFormContext();
|
|
6108
|
-
const formattedValue = useMemo(
|
|
6109
|
-
() => (dateStringFormatter == null ? void 0 : dateStringFormatter(rawValue)) ?? rawValue,
|
|
6110
|
-
[rawValue, dateStringFormatter]
|
|
6111
|
-
);
|
|
6112
|
-
if (!editMode)
|
|
6113
|
-
return /* @__PURE__ */ jsx8(TypographyCustom, {
|
|
6114
|
-
truncate: true,
|
|
6115
|
-
children: formattedValue
|
|
6116
|
-
});
|
|
6117
|
-
return /* @__PURE__ */ jsx8(Controller, {
|
|
6118
|
-
control,
|
|
6119
|
-
name: context.column.id,
|
|
6120
|
-
render: ({ field: { value, onChange, ...field }, fieldState: { error } }) => /* @__PURE__ */ jsx8(InlineTextField, {
|
|
6121
|
-
id: context.column.id,
|
|
6122
|
-
type: "date",
|
|
6123
|
-
autoComplete: "none",
|
|
6124
|
-
value: value ? parseISODate(value) : "",
|
|
6125
|
-
onChange: (e) => onChange(e.target.value ? parseISODate(e.target.value) : ""),
|
|
6126
|
-
...getHelperTextProps({ error }),
|
|
6127
|
-
...field
|
|
6128
|
-
})
|
|
6129
|
-
});
|
|
6130
|
-
}
|
|
6131
|
-
function parseISODate(dateString) {
|
|
6132
|
-
const date = new Date(dateString);
|
|
6133
|
-
const offset = date.getTimezoneOffset();
|
|
6134
|
-
const dateWithoutOffset = new Date(date.getTime() - offset * 60 * 1e3);
|
|
6135
|
-
return dateWithoutOffset.toISOString().split("T")[0];
|
|
6136
|
-
}
|
|
6137
|
-
var InlineTextField = styled7(TextField)`
|
|
6138
|
-
/*
|
|
6139
|
-
TODO: Improve input based on feedback from UX
|
|
6140
|
-
& > div {
|
|
6141
|
-
background: transparent;
|
|
6142
|
-
margin: 0 -0.5rem;
|
|
6143
|
-
padding: 0 0.5rem;
|
|
6144
|
-
box-shadow: none;
|
|
6145
|
-
width: auto;
|
|
6146
|
-
}
|
|
6147
|
-
|
|
6148
|
-
input {
|
|
6149
|
-
padding: 0;
|
|
6150
|
-
letter-spacing: 0;
|
|
6151
|
-
font-weight: 400;
|
|
6152
|
-
color: inherit;
|
|
6153
|
-
|
|
6154
|
-
::placeholder {
|
|
6155
|
-
color: red;
|
|
6156
|
-
}
|
|
6157
|
-
} */
|
|
6158
|
-
`;
|
|
6159
|
-
|
|
6160
|
-
// src/cells/EditableDropdownCell.tsx
|
|
6161
|
-
import { Autocomplete } from "@equinor/eds-core-react";
|
|
6162
|
-
import styled8 from "styled-components";
|
|
6163
|
-
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
6164
|
-
function buildEmptyOption() {
|
|
6165
|
-
return { label: "", value: "" };
|
|
6166
|
-
}
|
|
6167
|
-
function EditableDropdownCell(props) {
|
|
6168
|
-
const { options, ...context } = props;
|
|
6169
|
-
const editMode = useEditMode();
|
|
6170
|
-
const { control } = useFormContext();
|
|
6171
|
-
if (!editMode)
|
|
6172
|
-
return /* @__PURE__ */ jsx9(TypographyCustom, {
|
|
6173
|
-
truncate: true,
|
|
6174
|
-
children: context.getValue()
|
|
6175
|
-
});
|
|
6176
|
-
return /* @__PURE__ */ jsx9(Controller, {
|
|
6177
|
-
control,
|
|
6178
|
-
name: context.column.id,
|
|
6179
|
-
render: ({ field: { value, onChange, ...field } }) => {
|
|
6180
|
-
const selectedOption = options.find((option) => option.value === value) ?? buildEmptyOption;
|
|
6181
|
-
return /* @__PURE__ */ jsx9(AutocompleteCustom, {
|
|
6182
|
-
label: "",
|
|
6183
|
-
selectedOptions: selectedOption && [selectedOption],
|
|
6184
|
-
options,
|
|
6185
|
-
optionLabel: (option) => (option == null ? void 0 : option.label) ?? "",
|
|
6186
|
-
"aria-required": true,
|
|
6187
|
-
hideClearButton: true,
|
|
6188
|
-
"aria-autocomplete": "none",
|
|
6189
|
-
onOptionsChange: (changes) => {
|
|
6190
|
-
const [change] = changes.selectedItems;
|
|
6191
|
-
onChange(change == null ? void 0 : change.value);
|
|
6192
|
-
},
|
|
6193
|
-
...field
|
|
6194
|
-
});
|
|
6195
|
-
}
|
|
6196
|
-
});
|
|
6197
|
-
}
|
|
6198
|
-
var AutocompleteCustom = styled8(Autocomplete)`
|
|
6199
|
-
input[type='text'] {
|
|
6200
|
-
overflow: hidden;
|
|
6201
|
-
white-space: nowrap;
|
|
6202
|
-
text-overflow: ellipsis;
|
|
6203
|
-
padding-right: ${({ hideClearButton }) => hideClearButton ? `calc(8px + (24px * 1))` : `calc(8px + (24px * 2))`};
|
|
6204
|
-
}
|
|
6205
|
-
`;
|
|
6206
|
-
|
|
6207
|
-
// src/cells/EditableNumberCell.tsx
|
|
6208
|
-
import { TextField as TextField2 } from "@equinor/eds-core-react";
|
|
6209
|
-
import styled9 from "styled-components";
|
|
6210
|
-
import { Fragment, jsx as jsx10 } from "react/jsx-runtime";
|
|
6211
|
-
function EditableNumberCell(context) {
|
|
6212
|
-
const editMode = useEditMode();
|
|
6213
|
-
const { control } = useFormContext();
|
|
6214
|
-
if (!editMode)
|
|
6215
|
-
return /* @__PURE__ */ jsx10(TypographyCustom, {
|
|
6216
|
-
truncate: true,
|
|
6217
|
-
children: context.getValue()
|
|
6218
|
-
});
|
|
6219
|
-
return /* @__PURE__ */ jsx10(Controller, {
|
|
6220
|
-
control,
|
|
6221
|
-
name: context.column.id,
|
|
6222
|
-
render: ({ field: { onChange, ...field }, fieldState: { error } }) => /* @__PURE__ */ jsx10(Fragment, {
|
|
6223
|
-
children: /* @__PURE__ */ jsx10(InlineTextField2, {
|
|
6224
|
-
id: context.column.id,
|
|
6225
|
-
type: "number",
|
|
6226
|
-
autoComplete: "none",
|
|
6227
|
-
onChange: (e) => onChange(e.target.valueAsNumber),
|
|
6228
|
-
...field,
|
|
6229
|
-
...getHelperTextProps({ error })
|
|
6230
|
-
})
|
|
6231
|
-
})
|
|
6232
|
-
});
|
|
6233
|
-
}
|
|
6234
|
-
var InlineTextField2 = styled9(TextField2)`
|
|
6235
|
-
/*
|
|
6236
|
-
TODO: Improve input based on feedback from UX
|
|
6237
|
-
& > div {
|
|
6238
|
-
background: transparent;
|
|
6239
|
-
margin: 0 -0.5rem;
|
|
6240
|
-
padding: 0 0.5rem;
|
|
6241
|
-
box-shadow: none;
|
|
6242
|
-
width: auto;
|
|
6243
|
-
}
|
|
6244
|
-
|
|
6245
|
-
input {
|
|
6246
|
-
padding: 0;
|
|
6247
|
-
letter-spacing: 0;
|
|
6248
|
-
font-weight: 400;
|
|
6249
|
-
color: inherit;
|
|
6250
|
-
|
|
6251
|
-
::placeholder {
|
|
6252
|
-
color: red;
|
|
6253
|
-
}
|
|
6254
|
-
} */
|
|
6255
|
-
`;
|
|
6256
|
-
|
|
6257
|
-
// src/cells/EditableTextAreaCell.tsx
|
|
6258
|
-
import { Button as Button2, Dialog as EDS, Icon as Icon4, TextField as TextField3 } from "@equinor/eds-core-react";
|
|
6259
|
-
import { useState as useState3 } from "react";
|
|
6260
|
-
import styled10 from "styled-components";
|
|
6261
|
-
|
|
6262
|
-
// src/cells/PopoverCell.tsx
|
|
6263
|
-
import { Popover, Typography } from "@equinor/eds-core-react";
|
|
6264
|
-
import { useRef, useState as useState2 } from "react";
|
|
6265
|
-
import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
6266
|
-
var PopoverCell = (props) => {
|
|
6267
|
-
const [open, setOpen] = useState2(false);
|
|
6268
|
-
const anchorRef = useRef(null);
|
|
6269
|
-
const handleClick = () => setOpen(!open);
|
|
6270
|
-
const handleClose = () => setOpen(false);
|
|
6271
|
-
return /* @__PURE__ */ jsxs3("div", {
|
|
6272
|
-
style: { position: "relative" },
|
|
6273
|
-
ref: anchorRef,
|
|
6274
|
-
children: [
|
|
6275
|
-
/* @__PURE__ */ jsx11(TypographyCustom, {
|
|
6276
|
-
truncate: true,
|
|
6277
|
-
onClick: stopPropagation(handleClick),
|
|
6278
|
-
children: String(props.value)
|
|
6279
|
-
}),
|
|
6280
|
-
/* @__PURE__ */ jsxs3(Popover, {
|
|
6281
|
-
id: props.id,
|
|
6282
|
-
open,
|
|
6283
|
-
"aria-controls": "expand cell",
|
|
6284
|
-
anchorEl: anchorRef.current,
|
|
6285
|
-
onClose: handleClose,
|
|
6286
|
-
placement: "bottom",
|
|
6287
|
-
children: [
|
|
6288
|
-
props.title && /* @__PURE__ */ jsx11(Popover.Title, {
|
|
6289
|
-
children: /* @__PURE__ */ jsx11(Popover.Header, {
|
|
6290
|
-
children: props.title
|
|
6291
|
-
})
|
|
6292
|
-
}),
|
|
6293
|
-
/* @__PURE__ */ jsx11(Popover.Content, {
|
|
6294
|
-
children: /* @__PURE__ */ jsx11(Typography, {
|
|
6295
|
-
children: String(props.value)
|
|
6296
|
-
})
|
|
6297
|
-
})
|
|
6298
|
-
]
|
|
6299
|
-
})
|
|
6300
|
-
]
|
|
6301
|
-
});
|
|
6302
|
-
};
|
|
6303
|
-
|
|
6304
|
-
// src/cells/EditableTextAreaCell.tsx
|
|
6305
|
-
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
6306
|
-
function EditableTextAreaCell(props) {
|
|
6307
|
-
const { dialogTitle, ...context } = props;
|
|
6308
|
-
const [textareaValue, setTextareaValue] = useState3(context.getValue());
|
|
6309
|
-
const [open, setOpen] = useState3(false);
|
|
6310
|
-
const editMode = useEditMode();
|
|
6311
|
-
const { control } = useFormContext();
|
|
6312
|
-
const name = context.column.id;
|
|
6313
|
-
if (!editMode)
|
|
6314
|
-
return /* @__PURE__ */ jsx12(PopoverCell, {
|
|
6315
|
-
id: name + "popover",
|
|
6316
|
-
value: context.getValue(),
|
|
6317
|
-
title: "Comment"
|
|
6318
|
-
});
|
|
6319
|
-
const openDialog = () => setOpen(true);
|
|
6320
|
-
const closeDialog = () => setOpen(false);
|
|
6321
|
-
return /* @__PURE__ */ jsx12(Controller, {
|
|
6322
|
-
control,
|
|
6323
|
-
name,
|
|
6324
|
-
render: ({ field: { onChange, ref, ...field }, fieldState: { error } }) => /* @__PURE__ */ jsxs4(Fragment2, {
|
|
6325
|
-
children: [
|
|
6326
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
6327
|
-
style: {
|
|
6328
|
-
display: "flex",
|
|
6329
|
-
alignItems: "center",
|
|
6330
|
-
position: "relative"
|
|
6331
|
-
},
|
|
6332
|
-
children: [
|
|
6333
|
-
/* @__PURE__ */ jsx12(StyledTextField, {
|
|
6334
|
-
id: field.name,
|
|
6335
|
-
onChange,
|
|
6336
|
-
ref,
|
|
6337
|
-
...field,
|
|
6338
|
-
...getHelperTextProps({ error })
|
|
6339
|
-
}),
|
|
6340
|
-
/* @__PURE__ */ jsx12(IconButton, {
|
|
6341
|
-
variant: "ghost_icon",
|
|
6342
|
-
onClick: stopPropagation(openDialog),
|
|
6343
|
-
children: /* @__PURE__ */ jsx12(Icon4, {
|
|
6344
|
-
name: "arrow_up",
|
|
6345
|
-
size: 24,
|
|
6346
|
-
style: { transform: "rotateZ(45deg)" }
|
|
6347
|
-
})
|
|
6348
|
-
})
|
|
6349
|
-
]
|
|
6350
|
-
}),
|
|
6351
|
-
/* @__PURE__ */ jsxs4(EDS, {
|
|
6352
|
-
open,
|
|
6353
|
-
onClose: () => {
|
|
6354
|
-
closeDialog();
|
|
6355
|
-
onChange(textareaValue);
|
|
6356
|
-
},
|
|
6357
|
-
isDismissable: true,
|
|
6358
|
-
style: { width: "min(50rem, calc(100vw - 4rem))" },
|
|
6359
|
-
children: [
|
|
6360
|
-
/* @__PURE__ */ jsx12(EDS.Header, {
|
|
6361
|
-
children: /* @__PURE__ */ jsx12(EDS.Title, {
|
|
6362
|
-
children: dialogTitle
|
|
6363
|
-
})
|
|
6364
|
-
}),
|
|
6365
|
-
/* @__PURE__ */ jsx12(EDS.Content, {
|
|
6366
|
-
children: /* @__PURE__ */ jsx12(TextField3, {
|
|
6367
|
-
style: {
|
|
6368
|
-
maxWidth: "100%",
|
|
6369
|
-
marginTop: "1rem"
|
|
6370
|
-
},
|
|
6371
|
-
id: field.name + "modal",
|
|
6372
|
-
multiline: true,
|
|
6373
|
-
rows: 8,
|
|
6374
|
-
name: field.name + "modal",
|
|
6375
|
-
value: textareaValue,
|
|
6376
|
-
onChange: (e) => {
|
|
6377
|
-
setTextareaValue(e.target.value);
|
|
6378
|
-
}
|
|
6379
|
-
})
|
|
6380
|
-
}),
|
|
6381
|
-
/* @__PURE__ */ jsxs4(EDS.Actions, {
|
|
6382
|
-
style: { display: "flex", gap: "1rem" },
|
|
6383
|
-
children: [
|
|
6384
|
-
/* @__PURE__ */ jsx12(Button2, {
|
|
6385
|
-
onClick: () => {
|
|
6386
|
-
closeDialog();
|
|
6387
|
-
onChange(textareaValue);
|
|
6388
|
-
},
|
|
6389
|
-
children: "Submit"
|
|
6390
|
-
}),
|
|
6391
|
-
/* @__PURE__ */ jsx12(Button2, {
|
|
6392
|
-
variant: "ghost",
|
|
6393
|
-
onClick: () => {
|
|
6394
|
-
closeDialog();
|
|
6395
|
-
setTextareaValue(context.getValue());
|
|
6396
|
-
},
|
|
6397
|
-
children: "Cancel"
|
|
6398
|
-
})
|
|
6399
|
-
]
|
|
6400
|
-
})
|
|
6401
|
-
]
|
|
6402
|
-
})
|
|
6403
|
-
]
|
|
6404
|
-
})
|
|
6405
|
-
});
|
|
6406
|
-
}
|
|
6407
|
-
var StyledTextField = styled10(TextField3)`
|
|
6408
|
-
& input {
|
|
6409
|
-
padding-right: 40px;
|
|
6410
|
-
letter-spacing: 0;
|
|
6411
|
-
overflow: hidden;
|
|
6412
|
-
white-space: nowrap;
|
|
6413
|
-
text-overflow: ellipsis;
|
|
6414
|
-
}
|
|
6415
|
-
`;
|
|
6416
|
-
var IconButton = styled10(Button2)`
|
|
6417
|
-
position: absolute;
|
|
6418
|
-
height: 32px;
|
|
6419
|
-
width: 32px;
|
|
6420
|
-
right: 4px;
|
|
6421
|
-
`;
|
|
6422
|
-
|
|
6423
|
-
// src/cells/EditableTextFieldCell.tsx
|
|
6424
|
-
import { TextField as TextField4 } from "@equinor/eds-core-react";
|
|
6425
|
-
import styled11 from "styled-components";
|
|
6426
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
6427
|
-
function EditableTextFieldCell(context) {
|
|
6428
|
-
const { control } = useFormContext();
|
|
6429
|
-
const editMode = useEditMode();
|
|
6430
|
-
if (!editMode)
|
|
6431
|
-
return /* @__PURE__ */ jsx13(TypographyCustom, {
|
|
6432
|
-
truncate: true,
|
|
6433
|
-
children: context.getValue()
|
|
6434
|
-
});
|
|
6435
|
-
return /* @__PURE__ */ jsx13(Controller, {
|
|
6436
|
-
control,
|
|
6437
|
-
name: context.column.id,
|
|
6438
|
-
render: ({ field: { value, ...field }, fieldState: { error } }) => /* @__PURE__ */ jsx13(InlineTextField3, {
|
|
6439
|
-
id: context.column.id,
|
|
6440
|
-
autoComplete: "none",
|
|
6441
|
-
value: String(value),
|
|
6442
|
-
...field,
|
|
6443
|
-
...getHelperTextProps({ error })
|
|
6444
|
-
})
|
|
6445
|
-
});
|
|
6446
|
-
}
|
|
6447
|
-
var InlineTextField3 = styled11(TextField4)`
|
|
6448
|
-
/*
|
|
6449
|
-
TODO: Improve input based on feedback from UX
|
|
6450
|
-
& > div {
|
|
6451
|
-
background: transparent;
|
|
6452
|
-
margin: 0 -0.5rem;
|
|
6453
|
-
padding: 0 0.5rem;
|
|
6454
|
-
box-shadow: none;
|
|
6455
|
-
width: auto;
|
|
6456
|
-
}
|
|
6457
|
-
|
|
6458
|
-
input {
|
|
6459
|
-
padding: 0;
|
|
6460
|
-
letter-spacing: 0;
|
|
6461
|
-
font-weight: 400;
|
|
6462
|
-
color: inherit;
|
|
6463
|
-
|
|
6464
|
-
::placeholder {
|
|
6465
|
-
color: red;
|
|
6466
|
-
}
|
|
6467
|
-
} */
|
|
6468
|
-
`;
|
|
6469
|
-
|
|
6470
5718
|
// src/cells/HeaderCell.tsx
|
|
6471
|
-
import { Icon as
|
|
5719
|
+
import { Icon as Icon3, Table as Table3 } from "@equinor/eds-core-react";
|
|
6472
5720
|
import { arrow_drop_down, arrow_drop_up } from "@equinor/eds-icons";
|
|
6473
5721
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
6474
|
-
import
|
|
6475
|
-
import { jsx as
|
|
6476
|
-
var HeaderDiv =
|
|
5722
|
+
import styled6 from "styled-components";
|
|
5723
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
5724
|
+
var HeaderDiv = styled6.div`
|
|
6477
5725
|
display: flex;
|
|
6478
5726
|
align-items: center;
|
|
6479
5727
|
gap: 0.25rem;
|
|
@@ -6492,16 +5740,16 @@ var HeaderCell = ({ header }) => {
|
|
|
6492
5740
|
colSpan: header.colSpan
|
|
6493
5741
|
};
|
|
6494
5742
|
if ((_a = header.column.columnDef.meta) == null ? void 0 : _a.sticky) {
|
|
6495
|
-
return /* @__PURE__ */
|
|
5743
|
+
return /* @__PURE__ */ jsx5(StickyHeaderCell, {
|
|
6496
5744
|
...cellProps,
|
|
6497
|
-
children: /* @__PURE__ */
|
|
5745
|
+
children: /* @__PURE__ */ jsx5(HeaderContent, {
|
|
6498
5746
|
header
|
|
6499
5747
|
})
|
|
6500
5748
|
}, header.id);
|
|
6501
5749
|
}
|
|
6502
|
-
return /* @__PURE__ */
|
|
5750
|
+
return /* @__PURE__ */ jsx5(Table3.Cell, {
|
|
6503
5751
|
...cellProps,
|
|
6504
|
-
children: /* @__PURE__ */
|
|
5752
|
+
children: /* @__PURE__ */ jsx5(HeaderContent, {
|
|
6505
5753
|
header
|
|
6506
5754
|
})
|
|
6507
5755
|
}, header.id);
|
|
@@ -6509,17 +5757,17 @@ var HeaderCell = ({ header }) => {
|
|
|
6509
5757
|
function HeaderContent({ header }) {
|
|
6510
5758
|
if (header.isPlaceholder)
|
|
6511
5759
|
return null;
|
|
6512
|
-
return /* @__PURE__ */
|
|
5760
|
+
return /* @__PURE__ */ jsxs3(HeaderDiv, {
|
|
6513
5761
|
children: [
|
|
6514
5762
|
flexRender2(header.column.columnDef.header, header.getContext()),
|
|
6515
5763
|
{
|
|
6516
|
-
asc: /* @__PURE__ */
|
|
5764
|
+
asc: /* @__PURE__ */ jsx5(Icon3, {
|
|
6517
5765
|
data: arrow_drop_up
|
|
6518
5766
|
}),
|
|
6519
|
-
desc: /* @__PURE__ */
|
|
5767
|
+
desc: /* @__PURE__ */ jsx5(Icon3, {
|
|
6520
5768
|
data: arrow_drop_down
|
|
6521
5769
|
}),
|
|
6522
|
-
none: /* @__PURE__ */
|
|
5770
|
+
none: /* @__PURE__ */ jsx5(Icon3, {
|
|
6523
5771
|
data: arrow_drop_down
|
|
6524
5772
|
})
|
|
6525
5773
|
}[header.column.getIsSorted()] ?? null
|
|
@@ -6540,10 +5788,11 @@ function getSort({ column }) {
|
|
|
6540
5788
|
}
|
|
6541
5789
|
|
|
6542
5790
|
// src/cells/HierarchyCell.tsx
|
|
6543
|
-
import { tokens as
|
|
6544
|
-
import
|
|
6545
|
-
import {
|
|
6546
|
-
|
|
5791
|
+
import { tokens as tokens3 } from "@equinor/eds-tokens";
|
|
5792
|
+
import { TypographyCustom } from "apollo-common";
|
|
5793
|
+
import styled7, { css as css3 } from "styled-components";
|
|
5794
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
5795
|
+
var CellWrapper = styled7(TypographyCustom)`
|
|
6547
5796
|
height: 100%;
|
|
6548
5797
|
display: flex;
|
|
6549
5798
|
align-items: center;
|
|
@@ -6551,11 +5800,11 @@ var CellWrapper = styled13(TypographyCustom)`
|
|
|
6551
5800
|
${({ depth, expanded }) => expanded && depth === 0 && "font-weight: bold;"}
|
|
6552
5801
|
|
|
6553
5802
|
${({ depth }) => depth > 0 && css3`
|
|
6554
|
-
border-left: 3px solid ${
|
|
5803
|
+
border-left: 3px solid ${tokens3.colors.infographic.primary__moss_green_34.hex};
|
|
6555
5804
|
gap: 0.5rem;
|
|
6556
5805
|
.--divider {
|
|
6557
5806
|
width: ${depth * 32}px;
|
|
6558
|
-
background-color: ${
|
|
5807
|
+
background-color: ${tokens3.colors.infographic.primary__moss_green_34.hex};
|
|
6559
5808
|
height: 3px;
|
|
6560
5809
|
border-radius: 0 5px 5px 0;
|
|
6561
5810
|
}
|
|
@@ -6563,11 +5812,11 @@ var CellWrapper = styled13(TypographyCustom)`
|
|
|
6563
5812
|
`;
|
|
6564
5813
|
function HierarchyCell(cell, options = {}) {
|
|
6565
5814
|
var _a, _b;
|
|
6566
|
-
return /* @__PURE__ */
|
|
5815
|
+
return /* @__PURE__ */ jsxs4(CellWrapper, {
|
|
6567
5816
|
depth: ((_a = options.getRowDepth) == null ? void 0 : _a.call(options)) ?? cell.row.depth,
|
|
6568
5817
|
expanded: cell.row.getIsExpanded(),
|
|
6569
5818
|
children: [
|
|
6570
|
-
/* @__PURE__ */
|
|
5819
|
+
/* @__PURE__ */ jsx6("span", {
|
|
6571
5820
|
className: "--divider"
|
|
6572
5821
|
}),
|
|
6573
5822
|
((_b = options.getDisplayName) == null ? void 0 : _b.call(options)) ?? cell.getValue()
|
|
@@ -6576,11 +5825,12 @@ function HierarchyCell(cell, options = {}) {
|
|
|
6576
5825
|
}
|
|
6577
5826
|
|
|
6578
5827
|
// src/cells/SelectColumnDef.tsx
|
|
6579
|
-
import { Button as
|
|
5828
|
+
import { Button as Button2, Checkbox, Icon as Icon4, Radio } from "@equinor/eds-core-react";
|
|
6580
5829
|
import { chevron_down, chevron_up } from "@equinor/eds-icons";
|
|
6581
|
-
import
|
|
6582
|
-
import
|
|
6583
|
-
|
|
5830
|
+
import { stopPropagation } from "apollo-common";
|
|
5831
|
+
import styled8 from "styled-components";
|
|
5832
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
5833
|
+
var CellWrapper2 = styled8.div`
|
|
6584
5834
|
display: flex;
|
|
6585
5835
|
align-items: center;
|
|
6586
5836
|
width: 48px;
|
|
@@ -6592,8 +5842,8 @@ function SelectColumnDef(props) {
|
|
|
6592
5842
|
return {
|
|
6593
5843
|
id: "select",
|
|
6594
5844
|
size: props.includeExpansionButton ? 96 : 48,
|
|
6595
|
-
header: ({ table }) => selectionMode !== "single" ? /* @__PURE__ */
|
|
6596
|
-
children: /* @__PURE__ */
|
|
5845
|
+
header: ({ table }) => selectionMode !== "single" ? /* @__PURE__ */ jsx7(CellWrapper2, {
|
|
5846
|
+
children: /* @__PURE__ */ jsx7(Checkbox, {
|
|
6597
5847
|
checked: table.getIsAllRowsSelected(),
|
|
6598
5848
|
indeterminate: table.getIsSomeRowsSelected(),
|
|
6599
5849
|
"aria-label": table.getIsAllRowsSelected() ? "Deselect all rows" : "Select all rows",
|
|
@@ -6602,28 +5852,28 @@ function SelectColumnDef(props) {
|
|
|
6602
5852
|
}) : null,
|
|
6603
5853
|
cell: ({ table, row }) => {
|
|
6604
5854
|
const paddingLeft = "0px";
|
|
6605
|
-
return /* @__PURE__ */
|
|
5855
|
+
return /* @__PURE__ */ jsx7(CellWrapper2, {
|
|
6606
5856
|
paddingLeft,
|
|
6607
5857
|
rowDepth: row.depth,
|
|
6608
|
-
children: /* @__PURE__ */
|
|
5858
|
+
children: /* @__PURE__ */ jsxs5(Fragment, {
|
|
6609
5859
|
children: [
|
|
6610
|
-
selectionMode === "single" ? /* @__PURE__ */
|
|
5860
|
+
selectionMode === "single" ? /* @__PURE__ */ jsx7(Radio, {
|
|
6611
5861
|
checked: row.getIsSelected(),
|
|
6612
5862
|
"aria-label": `Select row ${row.id}`,
|
|
6613
5863
|
onChange: stopPropagation(row.getToggleSelectedHandler())
|
|
6614
|
-
}) : /* @__PURE__ */
|
|
5864
|
+
}) : /* @__PURE__ */ jsx7(Checkbox, {
|
|
6615
5865
|
checked: row.getIsSelected(),
|
|
6616
5866
|
indeterminate: row.getIsSomeSelected(),
|
|
6617
5867
|
"aria-label": `Select row ${row.id}`,
|
|
6618
5868
|
onChange: stopPropagation(row.getToggleSelectedHandler())
|
|
6619
5869
|
}),
|
|
6620
|
-
row.getCanExpand() && table.options.enableExpanding && /* @__PURE__ */
|
|
5870
|
+
row.getCanExpand() && table.options.enableExpanding && /* @__PURE__ */ jsx7(Button2, {
|
|
6621
5871
|
variant: "ghost_icon",
|
|
6622
5872
|
color: "secondary",
|
|
6623
5873
|
"aria-label": row.getIsExpanded() ? "Close group" : "Expand group",
|
|
6624
5874
|
onClick: stopPropagation(row.getToggleExpandedHandler()),
|
|
6625
5875
|
style: { cursor: "pointer" },
|
|
6626
|
-
children: /* @__PURE__ */
|
|
5876
|
+
children: /* @__PURE__ */ jsx7(Icon4, {
|
|
6627
5877
|
data: row.getIsExpanded() ? chevron_up : chevron_down
|
|
6628
5878
|
})
|
|
6629
5879
|
})
|
|
@@ -6635,10 +5885,10 @@ function SelectColumnDef(props) {
|
|
|
6635
5885
|
}
|
|
6636
5886
|
|
|
6637
5887
|
// src/DataTable/components/ColumnSelect.tsx
|
|
6638
|
-
import { Button as
|
|
5888
|
+
import { Button as Button3, Checkbox as Checkbox2, Divider, Icon as Icon5, Popover, Tooltip } from "@equinor/eds-core-react";
|
|
6639
5889
|
import { close, view_column } from "@equinor/eds-icons";
|
|
6640
|
-
import { useRef
|
|
6641
|
-
import
|
|
5890
|
+
import { useRef, useState as useState2 } from "react";
|
|
5891
|
+
import styled9 from "styled-components";
|
|
6642
5892
|
|
|
6643
5893
|
// src/DataTable/utils.tsx
|
|
6644
5894
|
function capitalizeHeader(context) {
|
|
@@ -6670,28 +5920,28 @@ function getFunctionValueOrDefault(valueOrFn, fnProps, defaultValue) {
|
|
|
6670
5920
|
}
|
|
6671
5921
|
|
|
6672
5922
|
// src/DataTable/components/ColumnSelect.tsx
|
|
6673
|
-
import { Fragment as
|
|
6674
|
-
var ColumnSelectContent =
|
|
5923
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
5924
|
+
var ColumnSelectContent = styled9.div`
|
|
6675
5925
|
display: grid;
|
|
6676
5926
|
grid-template-columns: repeat(2, 1fr);
|
|
6677
5927
|
grid-gap: 0.5rem;
|
|
6678
5928
|
`;
|
|
6679
|
-
var ActionsWrapper =
|
|
5929
|
+
var ActionsWrapper = styled9.div`
|
|
6680
5930
|
display: flex;
|
|
6681
5931
|
align-items: center;
|
|
6682
5932
|
justify-content: flex-end;
|
|
6683
5933
|
gap: 0.5rem;
|
|
6684
5934
|
`;
|
|
6685
5935
|
function ColumnSelect({ table }) {
|
|
6686
|
-
const [isOpen, setIsOpen] =
|
|
6687
|
-
const referenceElement =
|
|
5936
|
+
const [isOpen, setIsOpen] = useState2(false);
|
|
5937
|
+
const referenceElement = useRef(null);
|
|
6688
5938
|
const selectableColumns = table.getAllLeafColumns().filter((column) => column.id !== "select");
|
|
6689
|
-
return /* @__PURE__ */
|
|
5939
|
+
return /* @__PURE__ */ jsxs6(Fragment2, {
|
|
6690
5940
|
children: [
|
|
6691
|
-
/* @__PURE__ */
|
|
5941
|
+
/* @__PURE__ */ jsx8(Tooltip, {
|
|
6692
5942
|
title: "Select columns",
|
|
6693
5943
|
placement: "left",
|
|
6694
|
-
children: /* @__PURE__ */
|
|
5944
|
+
children: /* @__PURE__ */ jsx8(Button3, {
|
|
6695
5945
|
"aria-haspopup": true,
|
|
6696
5946
|
id: "column-select-anchor",
|
|
6697
5947
|
"aria-controls": "column-select-popover",
|
|
@@ -6699,29 +5949,29 @@ function ColumnSelect({ table }) {
|
|
|
6699
5949
|
ref: referenceElement,
|
|
6700
5950
|
variant: "ghost_icon",
|
|
6701
5951
|
onClick: () => setIsOpen(true),
|
|
6702
|
-
children: /* @__PURE__ */
|
|
5952
|
+
children: /* @__PURE__ */ jsx8(Icon5, {
|
|
6703
5953
|
name: "view_column",
|
|
6704
5954
|
data: view_column
|
|
6705
5955
|
})
|
|
6706
5956
|
})
|
|
6707
5957
|
}),
|
|
6708
|
-
/* @__PURE__ */
|
|
5958
|
+
/* @__PURE__ */ jsxs6(Popover, {
|
|
6709
5959
|
open: isOpen,
|
|
6710
5960
|
id: "column-select-popover",
|
|
6711
5961
|
anchorEl: referenceElement.current,
|
|
6712
5962
|
placement: "bottom-end",
|
|
6713
5963
|
onClose: () => setIsOpen(false),
|
|
6714
5964
|
children: [
|
|
6715
|
-
/* @__PURE__ */
|
|
5965
|
+
/* @__PURE__ */ jsxs6(Popover.Header, {
|
|
6716
5966
|
children: [
|
|
6717
|
-
/* @__PURE__ */
|
|
5967
|
+
/* @__PURE__ */ jsx8(Popover.Title, {
|
|
6718
5968
|
children: "Column settings"
|
|
6719
5969
|
}),
|
|
6720
|
-
/* @__PURE__ */
|
|
5970
|
+
/* @__PURE__ */ jsx8(Button3, {
|
|
6721
5971
|
variant: "ghost_icon",
|
|
6722
5972
|
"aria-label": "Close column select",
|
|
6723
5973
|
onClick: () => setIsOpen(false),
|
|
6724
|
-
children: /* @__PURE__ */
|
|
5974
|
+
children: /* @__PURE__ */ jsx8(Icon5, {
|
|
6725
5975
|
name: "close",
|
|
6726
5976
|
data: close,
|
|
6727
5977
|
size: 24
|
|
@@ -6729,22 +5979,22 @@ function ColumnSelect({ table }) {
|
|
|
6729
5979
|
})
|
|
6730
5980
|
]
|
|
6731
5981
|
}),
|
|
6732
|
-
/* @__PURE__ */
|
|
5982
|
+
/* @__PURE__ */ jsxs6(Popover.Content, {
|
|
6733
5983
|
children: [
|
|
6734
|
-
/* @__PURE__ */
|
|
5984
|
+
/* @__PURE__ */ jsx8(ColumnSelectContent, {
|
|
6735
5985
|
children: selectableColumns.map((column) => {
|
|
6736
|
-
return /* @__PURE__ */
|
|
5986
|
+
return /* @__PURE__ */ jsx8(Checkbox2, {
|
|
6737
5987
|
checked: column.getIsVisible(),
|
|
6738
5988
|
label: getColumnHeader(column),
|
|
6739
5989
|
onChange: column.getToggleVisibilityHandler()
|
|
6740
5990
|
}, column.id);
|
|
6741
5991
|
})
|
|
6742
5992
|
}),
|
|
6743
|
-
/* @__PURE__ */
|
|
5993
|
+
/* @__PURE__ */ jsx8(Divider, {
|
|
6744
5994
|
variant: "small"
|
|
6745
5995
|
}),
|
|
6746
|
-
/* @__PURE__ */
|
|
6747
|
-
children: /* @__PURE__ */
|
|
5996
|
+
/* @__PURE__ */ jsx8(ActionsWrapper, {
|
|
5997
|
+
children: /* @__PURE__ */ jsx8(Button3, {
|
|
6748
5998
|
color: "secondary",
|
|
6749
5999
|
variant: "ghost",
|
|
6750
6000
|
disabled: table.getIsAllColumnsVisible(),
|
|
@@ -6762,12 +6012,12 @@ function ColumnSelect({ table }) {
|
|
|
6762
6012
|
|
|
6763
6013
|
// src/DataTable/components/TableHeader.tsx
|
|
6764
6014
|
import { Table as Table4 } from "@equinor/eds-core-react";
|
|
6765
|
-
import { jsx as
|
|
6015
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
6766
6016
|
function TableHeader({ table, sticky }) {
|
|
6767
|
-
return /* @__PURE__ */
|
|
6017
|
+
return /* @__PURE__ */ jsx9(Table4.Head, {
|
|
6768
6018
|
sticky,
|
|
6769
|
-
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */
|
|
6770
|
-
children: headerGroup.headers.map((header) => /* @__PURE__ */
|
|
6019
|
+
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx9(Table4.Row, {
|
|
6020
|
+
children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx9(HeaderCell, {
|
|
6771
6021
|
header
|
|
6772
6022
|
}, header.id))
|
|
6773
6023
|
}, headerGroup.id))
|
|
@@ -6782,28 +6032,29 @@ import {
|
|
|
6782
6032
|
getSortedRowModel,
|
|
6783
6033
|
useReactTable
|
|
6784
6034
|
} from "@tanstack/react-table";
|
|
6785
|
-
import {
|
|
6786
|
-
import
|
|
6035
|
+
import { TypographyCustom as TypographyCustom2 } from "apollo-common";
|
|
6036
|
+
import { useEffect as useEffect3, useRef as useRef2, useState as useState4 } from "react";
|
|
6037
|
+
import styled15 from "styled-components";
|
|
6787
6038
|
|
|
6788
6039
|
// src/DataTable/components/BasicTable.tsx
|
|
6789
6040
|
import { Table as EdsTable } from "@equinor/eds-core-react";
|
|
6790
6041
|
|
|
6791
6042
|
// src/DataTable/components/PlaceholderRow.tsx
|
|
6792
|
-
import { DotProgress, Table as Table5, Typography
|
|
6793
|
-
import
|
|
6794
|
-
import { jsx as
|
|
6795
|
-
var PlaceholderTextWrapper =
|
|
6043
|
+
import { DotProgress, Table as Table5, Typography } from "@equinor/eds-core-react";
|
|
6044
|
+
import styled10 from "styled-components";
|
|
6045
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
6046
|
+
var PlaceholderTextWrapper = styled10.div`
|
|
6796
6047
|
display: flex;
|
|
6797
6048
|
justify-content: center;
|
|
6798
6049
|
`;
|
|
6799
6050
|
function PlaceholderRow({ isLoading }) {
|
|
6800
|
-
return /* @__PURE__ */
|
|
6801
|
-
children: /* @__PURE__ */
|
|
6051
|
+
return /* @__PURE__ */ jsx10(Table5.Row, {
|
|
6052
|
+
children: /* @__PURE__ */ jsx10(Table5.Cell, {
|
|
6802
6053
|
colSpan: 100,
|
|
6803
|
-
children: /* @__PURE__ */
|
|
6804
|
-
children: isLoading ? /* @__PURE__ */
|
|
6054
|
+
children: /* @__PURE__ */ jsx10(PlaceholderTextWrapper, {
|
|
6055
|
+
children: isLoading ? /* @__PURE__ */ jsx10(DotProgress, {
|
|
6805
6056
|
color: "primary"
|
|
6806
|
-
}) : /* @__PURE__ */
|
|
6057
|
+
}) : /* @__PURE__ */ jsx10(Typography, {
|
|
6807
6058
|
children: "No data available"
|
|
6808
6059
|
})
|
|
6809
6060
|
})
|
|
@@ -6813,8 +6064,8 @@ function PlaceholderRow({ isLoading }) {
|
|
|
6813
6064
|
|
|
6814
6065
|
// src/DataTable/components/TableBody.tsx
|
|
6815
6066
|
import { Table as Table6 } from "@equinor/eds-core-react";
|
|
6816
|
-
import
|
|
6817
|
-
var TableBody =
|
|
6067
|
+
import styled11 from "styled-components";
|
|
6068
|
+
var TableBody = styled11(Table6.Body)`
|
|
6818
6069
|
// The following attribute are important for fixed column width
|
|
6819
6070
|
// CHANGE THES WITH CAUTION
|
|
6820
6071
|
background: inherit;
|
|
@@ -6822,12 +6073,12 @@ var TableBody = styled17(Table6.Body)`
|
|
|
6822
6073
|
|
|
6823
6074
|
// src/DataTable/components/TableRow.tsx
|
|
6824
6075
|
import { Table as Table7 } from "@equinor/eds-core-react";
|
|
6825
|
-
import
|
|
6826
|
-
import { jsx as
|
|
6076
|
+
import styled12 from "styled-components";
|
|
6077
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
6827
6078
|
function TableRow({ row, rowConfig, cellConfig }) {
|
|
6828
6079
|
var _a;
|
|
6829
6080
|
const rowWrapper = rowConfig == null ? void 0 : rowConfig.rowWrapper;
|
|
6830
|
-
const tableRowContent = /* @__PURE__ */
|
|
6081
|
+
const tableRowContent = /* @__PURE__ */ jsx11(StyledTableRow, {
|
|
6831
6082
|
active: row.getIsSelected(),
|
|
6832
6083
|
style: {
|
|
6833
6084
|
cursor: (rowConfig == null ? void 0 : rowConfig.onClick) ? "pointer" : "initial",
|
|
@@ -6841,7 +6092,7 @@ function TableRow({ row, rowConfig, cellConfig }) {
|
|
|
6841
6092
|
onMouseLeave: handleRowEvent(row, rowConfig == null ? void 0 : rowConfig.onMouseLeave),
|
|
6842
6093
|
children: row.getVisibleCells().map((cell) => {
|
|
6843
6094
|
var _a2;
|
|
6844
|
-
return /* @__PURE__ */
|
|
6095
|
+
return /* @__PURE__ */ jsx11(DynamicCell, {
|
|
6845
6096
|
cell,
|
|
6846
6097
|
getStickyCellColor: cellConfig == null ? void 0 : cellConfig.getStickyCellColor,
|
|
6847
6098
|
highlight: (_a2 = cellConfig == null ? void 0 : cellConfig.getShouldHighlight) == null ? void 0 : _a2.call(cellConfig, cell)
|
|
@@ -6850,7 +6101,7 @@ function TableRow({ row, rowConfig, cellConfig }) {
|
|
|
6850
6101
|
});
|
|
6851
6102
|
return rowWrapper ? rowWrapper({ row, children: tableRowContent }) : tableRowContent;
|
|
6852
6103
|
}
|
|
6853
|
-
var StyledTableRow =
|
|
6104
|
+
var StyledTableRow = styled12(Table7.Row)`
|
|
6854
6105
|
/* Background color must be inherited here. Does not work with inline styling */
|
|
6855
6106
|
${({ active }) => active ? "" : "background-color: inherit;"}
|
|
6856
6107
|
`;
|
|
@@ -6863,7 +6114,7 @@ function handleRowEvent(row, handler) {
|
|
|
6863
6114
|
}
|
|
6864
6115
|
|
|
6865
6116
|
// src/DataTable/components/BasicTable.tsx
|
|
6866
|
-
import { jsx as
|
|
6117
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
6867
6118
|
function BasicTable({
|
|
6868
6119
|
table,
|
|
6869
6120
|
rowConfig,
|
|
@@ -6873,22 +6124,22 @@ function BasicTable({
|
|
|
6873
6124
|
tableCaption
|
|
6874
6125
|
}) {
|
|
6875
6126
|
const tableRows = table.getRowModel().rows;
|
|
6876
|
-
return /* @__PURE__ */
|
|
6127
|
+
return /* @__PURE__ */ jsxs7(EdsTable, {
|
|
6877
6128
|
children: [
|
|
6878
|
-
/* @__PURE__ */
|
|
6129
|
+
/* @__PURE__ */ jsx12(EdsTable.Caption, {
|
|
6879
6130
|
hidden: true,
|
|
6880
6131
|
children: tableCaption
|
|
6881
6132
|
}),
|
|
6882
|
-
/* @__PURE__ */
|
|
6133
|
+
/* @__PURE__ */ jsx12(TableHeader, {
|
|
6883
6134
|
sticky: stickyHeader,
|
|
6884
6135
|
table
|
|
6885
6136
|
}),
|
|
6886
|
-
/* @__PURE__ */
|
|
6887
|
-
children: tableRows.length ? tableRows.map((row) => /* @__PURE__ */
|
|
6137
|
+
/* @__PURE__ */ jsx12(TableBody, {
|
|
6138
|
+
children: tableRows.length ? tableRows.map((row) => /* @__PURE__ */ jsx12(TableRow, {
|
|
6888
6139
|
row,
|
|
6889
6140
|
rowConfig,
|
|
6890
6141
|
cellConfig
|
|
6891
|
-
}, row.id)) : /* @__PURE__ */
|
|
6142
|
+
}, row.id)) : /* @__PURE__ */ jsx12(PlaceholderRow, {
|
|
6892
6143
|
isLoading
|
|
6893
6144
|
})
|
|
6894
6145
|
})
|
|
@@ -6897,20 +6148,20 @@ function BasicTable({
|
|
|
6897
6148
|
}
|
|
6898
6149
|
|
|
6899
6150
|
// src/DataTable/components/DataTableHeader.tsx
|
|
6900
|
-
import { Typography as
|
|
6151
|
+
import { Typography as Typography2 } from "@equinor/eds-core-react";
|
|
6901
6152
|
import { search } from "@equinor/eds-icons";
|
|
6902
|
-
import
|
|
6153
|
+
import styled14 from "styled-components";
|
|
6903
6154
|
|
|
6904
6155
|
// src/DataTable/filters/DebouncedInput.tsx
|
|
6905
|
-
import { Button as
|
|
6156
|
+
import { Button as Button4, Icon as Icon6, Input, Tooltip as Tooltip2 } from "@equinor/eds-core-react";
|
|
6906
6157
|
import { close as close2 } from "@equinor/eds-icons";
|
|
6907
|
-
import { useEffect, useState as
|
|
6908
|
-
import
|
|
6909
|
-
import { jsx as
|
|
6910
|
-
var Wrapper3 =
|
|
6158
|
+
import { useEffect, useState as useState3 } from "react";
|
|
6159
|
+
import styled13 from "styled-components";
|
|
6160
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
6161
|
+
var Wrapper3 = styled13.div`
|
|
6911
6162
|
width: 200px;
|
|
6912
6163
|
`;
|
|
6913
|
-
var CloseButton =
|
|
6164
|
+
var CloseButton = styled13(Button4)`
|
|
6914
6165
|
width: 24px;
|
|
6915
6166
|
height: 24px;
|
|
6916
6167
|
`;
|
|
@@ -6921,7 +6172,7 @@ function DebouncedInput({
|
|
|
6921
6172
|
debounce = 500,
|
|
6922
6173
|
...props
|
|
6923
6174
|
}) {
|
|
6924
|
-
const [value, setValue] =
|
|
6175
|
+
const [value, setValue] = useState3(initialValue);
|
|
6925
6176
|
useEffect(() => {
|
|
6926
6177
|
setValue(initialValue);
|
|
6927
6178
|
}, [initialValue]);
|
|
@@ -6931,21 +6182,21 @@ function DebouncedInput({
|
|
|
6931
6182
|
}, debounce);
|
|
6932
6183
|
return () => clearTimeout(timeout);
|
|
6933
6184
|
}, [value]);
|
|
6934
|
-
return /* @__PURE__ */
|
|
6935
|
-
children: /* @__PURE__ */
|
|
6185
|
+
return /* @__PURE__ */ jsx13(Wrapper3, {
|
|
6186
|
+
children: /* @__PURE__ */ jsx13(Input, {
|
|
6936
6187
|
...props,
|
|
6937
6188
|
value,
|
|
6938
|
-
leftAdornments: icon && /* @__PURE__ */
|
|
6189
|
+
leftAdornments: icon && /* @__PURE__ */ jsx13(Icon6, {
|
|
6939
6190
|
name: icon.name,
|
|
6940
6191
|
data: icon,
|
|
6941
6192
|
size: 18
|
|
6942
6193
|
}),
|
|
6943
|
-
rightAdornments: !!value && /* @__PURE__ */
|
|
6194
|
+
rightAdornments: !!value && /* @__PURE__ */ jsx13(Tooltip2, {
|
|
6944
6195
|
title: "Clear input",
|
|
6945
|
-
children: /* @__PURE__ */
|
|
6196
|
+
children: /* @__PURE__ */ jsx13(CloseButton, {
|
|
6946
6197
|
variant: "ghost_icon",
|
|
6947
6198
|
onClick: () => setValue(""),
|
|
6948
|
-
children: /* @__PURE__ */
|
|
6199
|
+
children: /* @__PURE__ */ jsx13(Icon6, {
|
|
6949
6200
|
name: close2.name,
|
|
6950
6201
|
data: close2,
|
|
6951
6202
|
size: 18
|
|
@@ -6968,15 +6219,15 @@ var fuzzyFilter = (row, columnId, value, addMeta) => {
|
|
|
6968
6219
|
};
|
|
6969
6220
|
|
|
6970
6221
|
// src/DataTable/components/DataTableHeader.tsx
|
|
6971
|
-
import { Fragment as
|
|
6972
|
-
var TableBannerWrapper =
|
|
6222
|
+
import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
6223
|
+
var TableBannerWrapper = styled14.div`
|
|
6973
6224
|
display: flex;
|
|
6974
6225
|
align-items: center;
|
|
6975
6226
|
justify-content: space-between;
|
|
6976
6227
|
gap: 0.5rem;
|
|
6977
6228
|
padding: ${(props) => props.padding || "1rem"};
|
|
6978
6229
|
`;
|
|
6979
|
-
var FilterContainer =
|
|
6230
|
+
var FilterContainer = styled14.div`
|
|
6980
6231
|
display: flex;
|
|
6981
6232
|
align-items: center;
|
|
6982
6233
|
gap: 1rem;
|
|
@@ -6989,14 +6240,14 @@ function TableBanner({
|
|
|
6989
6240
|
globalFilter
|
|
6990
6241
|
}) {
|
|
6991
6242
|
var _a;
|
|
6992
|
-
return /* @__PURE__ */
|
|
6243
|
+
return /* @__PURE__ */ jsxs8(TableBannerWrapper, {
|
|
6993
6244
|
className: "--table-caption",
|
|
6994
6245
|
padding: bannerConfig == null ? void 0 : bannerConfig.padding,
|
|
6995
6246
|
children: [
|
|
6996
|
-
/* @__PURE__ */
|
|
6247
|
+
/* @__PURE__ */ jsxs8(FilterContainer, {
|
|
6997
6248
|
className: "--filter-container-left",
|
|
6998
6249
|
children: [
|
|
6999
|
-
(bannerConfig == null ? void 0 : bannerConfig.enableTableCaption) && /* @__PURE__ */
|
|
6250
|
+
(bannerConfig == null ? void 0 : bannerConfig.enableTableCaption) && /* @__PURE__ */ jsx14(Typography2, {
|
|
7000
6251
|
variant: "h3",
|
|
7001
6252
|
as: "h2",
|
|
7002
6253
|
children: tableCaption
|
|
@@ -7004,20 +6255,20 @@ function TableBanner({
|
|
|
7004
6255
|
(_a = bannerConfig == null ? void 0 : bannerConfig.customActions) == null ? void 0 : _a.call(bannerConfig, table)
|
|
7005
6256
|
]
|
|
7006
6257
|
}),
|
|
7007
|
-
/* @__PURE__ */
|
|
6258
|
+
/* @__PURE__ */ jsx14(FilterContainer, {
|
|
7008
6259
|
className: "--filter-container-right",
|
|
7009
|
-
children: /* @__PURE__ */
|
|
6260
|
+
children: /* @__PURE__ */ jsxs8(Fragment3, {
|
|
7010
6261
|
children: [
|
|
7011
|
-
(bannerConfig == null ? void 0 : bannerConfig.enableGlobalFilterInput) && /* @__PURE__ */
|
|
6262
|
+
(bannerConfig == null ? void 0 : bannerConfig.enableGlobalFilterInput) && /* @__PURE__ */ jsx14(DebouncedInput, {
|
|
7012
6263
|
value: globalFilter.state,
|
|
7013
6264
|
icon: search,
|
|
7014
6265
|
placeholder: bannerConfig.globalFilterPlaceholder ?? "Search all columns",
|
|
7015
6266
|
onChange: (value) => globalFilter.onChange(String(value))
|
|
7016
6267
|
}),
|
|
7017
|
-
(bannerConfig == null ? void 0 : bannerConfig.enableColumnSelect) && /* @__PURE__ */
|
|
6268
|
+
(bannerConfig == null ? void 0 : bannerConfig.enableColumnSelect) && /* @__PURE__ */ jsx14(ColumnSelect, {
|
|
7018
6269
|
table
|
|
7019
6270
|
}),
|
|
7020
|
-
(bannerConfig == null ? void 0 : bannerConfig.totalRowCount) && /* @__PURE__ */
|
|
6271
|
+
(bannerConfig == null ? void 0 : bannerConfig.totalRowCount) && /* @__PURE__ */ jsxs8("span", {
|
|
7021
6272
|
children: [
|
|
7022
6273
|
table.options.data.length.toLocaleString(),
|
|
7023
6274
|
" /",
|
|
@@ -7039,19 +6290,19 @@ import { useVirtualizer } from "@tanstack/react-virtual";
|
|
|
7039
6290
|
|
|
7040
6291
|
// src/DataTable/components/PaddingRow.tsx
|
|
7041
6292
|
import { Table as Table8 } from "@equinor/eds-core-react";
|
|
7042
|
-
import { jsx as
|
|
6293
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
7043
6294
|
var PaddingRow = (props) => {
|
|
7044
6295
|
if (!props.height)
|
|
7045
6296
|
return null;
|
|
7046
|
-
return /* @__PURE__ */
|
|
7047
|
-
children: /* @__PURE__ */
|
|
6297
|
+
return /* @__PURE__ */ jsx15(Table8.Row, {
|
|
6298
|
+
children: /* @__PURE__ */ jsx15(Table8.Cell, {
|
|
7048
6299
|
style: { height: `${props.height}px` }
|
|
7049
6300
|
})
|
|
7050
6301
|
});
|
|
7051
6302
|
};
|
|
7052
6303
|
|
|
7053
6304
|
// src/DataTable/components/VirtualTable.tsx
|
|
7054
|
-
import { jsx as
|
|
6305
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
7055
6306
|
function VirtualTable({
|
|
7056
6307
|
table,
|
|
7057
6308
|
rowConfig,
|
|
@@ -7070,32 +6321,32 @@ function VirtualTable({
|
|
|
7070
6321
|
const virtualRows = rowVirtualizer.getVirtualItems();
|
|
7071
6322
|
const paddingTop = virtualRows.length > 0 ? ((_a = virtualRows == null ? void 0 : virtualRows[0]) == null ? void 0 : _a.start) || 0 : 0;
|
|
7072
6323
|
const paddingBottom = virtualRows.length > 0 ? rowVirtualizer.getTotalSize() - (((_b = virtualRows == null ? void 0 : virtualRows[virtualRows.length - 1]) == null ? void 0 : _b.end) || 0) : 0;
|
|
7073
|
-
return /* @__PURE__ */
|
|
6324
|
+
return /* @__PURE__ */ jsxs9(Table9, {
|
|
7074
6325
|
children: [
|
|
7075
|
-
/* @__PURE__ */
|
|
6326
|
+
/* @__PURE__ */ jsx16(Table9.Caption, {
|
|
7076
6327
|
hidden: true,
|
|
7077
6328
|
children: props.tableCaption
|
|
7078
6329
|
}),
|
|
7079
|
-
/* @__PURE__ */
|
|
6330
|
+
/* @__PURE__ */ jsx16(TableHeader, {
|
|
7080
6331
|
sticky: props.stickyHeader,
|
|
7081
6332
|
table
|
|
7082
6333
|
}),
|
|
7083
|
-
/* @__PURE__ */
|
|
6334
|
+
/* @__PURE__ */ jsxs9(TableBody, {
|
|
7084
6335
|
children: [
|
|
7085
|
-
/* @__PURE__ */
|
|
6336
|
+
/* @__PURE__ */ jsx16(PaddingRow, {
|
|
7086
6337
|
height: paddingTop
|
|
7087
6338
|
}),
|
|
7088
6339
|
rows.length ? virtualRows.map((virtualRow) => {
|
|
7089
6340
|
const row = rows[virtualRow.index];
|
|
7090
|
-
return /* @__PURE__ */
|
|
6341
|
+
return /* @__PURE__ */ jsx16(TableRow, {
|
|
7091
6342
|
row,
|
|
7092
6343
|
rowConfig,
|
|
7093
6344
|
cellConfig
|
|
7094
6345
|
}, row.id);
|
|
7095
|
-
}) : /* @__PURE__ */
|
|
6346
|
+
}) : /* @__PURE__ */ jsx16(PlaceholderRow, {
|
|
7096
6347
|
isLoading: props.isLoading
|
|
7097
6348
|
}),
|
|
7098
|
-
/* @__PURE__ */
|
|
6349
|
+
/* @__PURE__ */ jsx16(PaddingRow, {
|
|
7099
6350
|
height: paddingBottom
|
|
7100
6351
|
})
|
|
7101
6352
|
]
|
|
@@ -7134,8 +6385,8 @@ function useFetchMoreOnBottomReached(tableContainerRef, infiniteScrollConfig) {
|
|
|
7134
6385
|
}
|
|
7135
6386
|
|
|
7136
6387
|
// src/DataTable/DataTable.tsx
|
|
7137
|
-
import { jsx as
|
|
7138
|
-
var DataTableWrapper =
|
|
6388
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
6389
|
+
var DataTableWrapper = styled15.div`
|
|
7139
6390
|
width: ${(props) => props.width ?? "100%"};
|
|
7140
6391
|
|
|
7141
6392
|
.--table-container {
|
|
@@ -7155,12 +6406,12 @@ var DataTableWrapper = styled21.div`
|
|
|
7155
6406
|
function DataTable(props) {
|
|
7156
6407
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
7157
6408
|
const { columns, data, bannerConfig, cellConfig, sorting } = props;
|
|
7158
|
-
const [internalColumnVisibility, setInternalColumnVisibility] =
|
|
6409
|
+
const [internalColumnVisibility, setInternalColumnVisibility] = useState4({});
|
|
7159
6410
|
const [columnVisibility, setColumnVisibility] = [
|
|
7160
6411
|
((_a = props.columnVisibility) == null ? void 0 : _a.state) ?? internalColumnVisibility,
|
|
7161
6412
|
((_b = props.columnVisibility) == null ? void 0 : _b.onChange) ?? setInternalColumnVisibility
|
|
7162
6413
|
];
|
|
7163
|
-
const [internalGlobalFilterState, setInternalGlobalFilterState] =
|
|
6414
|
+
const [internalGlobalFilterState, setInternalGlobalFilterState] = useState4("");
|
|
7164
6415
|
const [globalFilterState, setGlobalFilterState] = [
|
|
7165
6416
|
((_c = props.globalFilter) == null ? void 0 : _c.state) ?? internalGlobalFilterState,
|
|
7166
6417
|
((_d = props.globalFilter) == null ? void 0 : _d.onChange) ?? setInternalGlobalFilterState
|
|
@@ -7169,17 +6420,17 @@ function DataTable(props) {
|
|
|
7169
6420
|
function enableGlobalFilter(value) {
|
|
7170
6421
|
return enableOrUndefined(shouldEnableGlobalFilter, value);
|
|
7171
6422
|
}
|
|
7172
|
-
const [internalSortingState, setInternalSortingState] =
|
|
6423
|
+
const [internalSortingState, setInternalSortingState] = useState4([]);
|
|
7173
6424
|
const [sortingState, setSortingState] = [
|
|
7174
6425
|
((_f = props.sorting) == null ? void 0 : _f.state) ?? internalSortingState,
|
|
7175
6426
|
((_g = props.sorting) == null ? void 0 : _g.onChange) ?? setInternalSortingState
|
|
7176
6427
|
];
|
|
7177
|
-
const [internalRowSelectionState, setInternalRowSelectionState] =
|
|
6428
|
+
const [internalRowSelectionState, setInternalRowSelectionState] = useState4({});
|
|
7178
6429
|
const [rowSelectionState, setRowSelectionState] = [
|
|
7179
6430
|
((_h = props.rowSelection) == null ? void 0 : _h.state) ?? internalRowSelectionState,
|
|
7180
6431
|
((_i = props.rowSelection) == null ? void 0 : _i.onChange) ?? setInternalRowSelectionState
|
|
7181
6432
|
];
|
|
7182
|
-
const [internalExpandedState, setInternalExpandedState] =
|
|
6433
|
+
const [internalExpandedState, setInternalExpandedState] = useState4({});
|
|
7183
6434
|
const [expandedState, setExpandedState] = [
|
|
7184
6435
|
((_j = props.expansion) == null ? void 0 : _j.state) ?? internalExpandedState,
|
|
7185
6436
|
((_k = props.expansion) == null ? void 0 : _k.onChange) ?? setInternalExpandedState
|
|
@@ -7198,7 +6449,7 @@ function DataTable(props) {
|
|
|
7198
6449
|
defaultColumn: {
|
|
7199
6450
|
cell: ({ cell }) => {
|
|
7200
6451
|
const truncateMode = getFunctionValueOrDefault(cellConfig == null ? void 0 : cellConfig.truncateMode, cell, "hover");
|
|
7201
|
-
return /* @__PURE__ */
|
|
6452
|
+
return /* @__PURE__ */ jsx17(TypographyCustom2, {
|
|
7202
6453
|
truncate: truncateMode === "hover",
|
|
7203
6454
|
children: cell.getValue()
|
|
7204
6455
|
});
|
|
@@ -7229,23 +6480,23 @@ function DataTable(props) {
|
|
|
7229
6480
|
}
|
|
7230
6481
|
}, [table, (_p = props.expansion) == null ? void 0 : _p.expandAllByDefault]);
|
|
7231
6482
|
const { isLoading, rowConfig } = props;
|
|
7232
|
-
const tableContainerRef =
|
|
6483
|
+
const tableContainerRef = useRef2(null);
|
|
7233
6484
|
const onTableContainerScroll = useFetchMoreOnBottomReached(
|
|
7234
6485
|
tableContainerRef,
|
|
7235
6486
|
props.infiniteScroll
|
|
7236
6487
|
);
|
|
7237
|
-
return /* @__PURE__ */
|
|
6488
|
+
return /* @__PURE__ */ jsxs10(DataTableWrapper, {
|
|
7238
6489
|
height: props == null ? void 0 : props.height,
|
|
7239
6490
|
width: props == null ? void 0 : props.width,
|
|
7240
6491
|
tableLayout: props == null ? void 0 : props.tableLayout,
|
|
7241
6492
|
children: [
|
|
7242
|
-
props.bannerConfig && /* @__PURE__ */
|
|
6493
|
+
props.bannerConfig && /* @__PURE__ */ jsx17(TableBanner, {
|
|
7243
6494
|
table,
|
|
7244
6495
|
bannerConfig: props.bannerConfig,
|
|
7245
6496
|
globalFilter: { state: globalFilterState, onChange: setGlobalFilterState },
|
|
7246
6497
|
tableCaption: props.tableCaption
|
|
7247
6498
|
}),
|
|
7248
|
-
/* @__PURE__ */
|
|
6499
|
+
/* @__PURE__ */ jsx17("div", {
|
|
7249
6500
|
...props.tableContainerProps,
|
|
7250
6501
|
className: "--table-container " + ((_q = props.tableContainerProps) == null ? void 0 : _q.className),
|
|
7251
6502
|
onScroll: ((_r = props.tableContainerProps) == null ? void 0 : _r.onScroll) ?? onTableContainerScroll,
|
|
@@ -7258,7 +6509,7 @@ function DataTable(props) {
|
|
|
7258
6509
|
}
|
|
7259
6510
|
}
|
|
7260
6511
|
},
|
|
7261
|
-
children: (props == null ? void 0 : props.virtual) ? /* @__PURE__ */
|
|
6512
|
+
children: (props == null ? void 0 : props.virtual) ? /* @__PURE__ */ jsx17(VirtualTable, {
|
|
7262
6513
|
containerRef: tableContainerRef,
|
|
7263
6514
|
tableCaption: props.tableCaption,
|
|
7264
6515
|
table,
|
|
@@ -7266,7 +6517,7 @@ function DataTable(props) {
|
|
|
7266
6517
|
cellConfig,
|
|
7267
6518
|
isLoading,
|
|
7268
6519
|
stickyHeader: props.stickyHeader
|
|
7269
|
-
}) : /* @__PURE__ */
|
|
6520
|
+
}) : /* @__PURE__ */ jsx17(BasicTable, {
|
|
7270
6521
|
tableCaption: props.tableCaption,
|
|
7271
6522
|
table,
|
|
7272
6523
|
rowConfig,
|
|
@@ -7281,33 +6532,22 @@ function DataTable(props) {
|
|
|
7281
6532
|
export {
|
|
7282
6533
|
AppShell,
|
|
7283
6534
|
AppSidebar,
|
|
7284
|
-
AutocompleteCustom,
|
|
7285
6535
|
ChipsCell,
|
|
7286
6536
|
ColumnSelect,
|
|
7287
6537
|
DataTable,
|
|
7288
6538
|
DynamicCell,
|
|
7289
|
-
EditableCheckboxCell,
|
|
7290
|
-
EditableDateCell,
|
|
7291
|
-
EditableDropdownCell,
|
|
7292
|
-
EditableNumberCell,
|
|
7293
|
-
EditableTextAreaCell,
|
|
7294
|
-
EditableTextFieldCell,
|
|
7295
6539
|
HeaderCell,
|
|
7296
6540
|
HierarchyCell,
|
|
7297
|
-
PopoverCell,
|
|
7298
6541
|
SelectColumnDef,
|
|
7299
6542
|
StickyCell,
|
|
7300
6543
|
StickyHeaderCell,
|
|
7301
6544
|
StyledStickyCell,
|
|
7302
6545
|
TableHeader,
|
|
7303
|
-
TypographyCustom,
|
|
7304
6546
|
addFormMeta,
|
|
7305
6547
|
capitalizeHeader,
|
|
7306
|
-
getHelperTextProps,
|
|
7307
6548
|
leftCellShadow,
|
|
7308
6549
|
prependSelectColumn,
|
|
7309
6550
|
removeFormMeta,
|
|
7310
|
-
stopPropagation,
|
|
7311
6551
|
stringToHslColor,
|
|
7312
6552
|
useEditMode,
|
|
7313
6553
|
useGetIsNew,
|