@superblocksteam/library 2.0.0-next.5 → 2.0.0-next.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{allPaths-CQicmj05.js → allPaths-BYc1qceP.js} +2 -2
- package/dist/{allPaths-CQicmj05.js.map → allPaths-BYc1qceP.js.map} +1 -1
- package/dist/{allPaths-JTh0AvL-.js → allPaths-z4Itey0t.js} +2 -2
- package/dist/{allPaths-JTh0AvL-.js.map → allPaths-z4Itey0t.js.map} +1 -1
- package/dist/{allPathsLoader-BzKYsLDE.js → allPathsLoader-C6F1yurZ.js} +3 -3
- package/dist/{allPathsLoader-DUkr4f2u.js.map → allPathsLoader-C6F1yurZ.js.map} +1 -1
- package/dist/{allPathsLoader-DUkr4f2u.js → allPathsLoader-D4nBGZ9l.js} +3 -3
- package/dist/{allPathsLoader-BzKYsLDE.js.map → allPathsLoader-D4nBGZ9l.js.map} +1 -1
- package/dist/{index-U8MX-8Hu.js → index-Dq7YJbaW.js} +1740 -835
- package/dist/{index-U8MX-8Hu.js.map → index-Dq7YJbaW.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{splitPathsBySizeLoader-4uQi8FeZ.js → splitPathsBySizeLoader-B15P9j3b.js} +2 -2
- package/dist/{splitPathsBySizeLoader-4uQi8FeZ.js.map → splitPathsBySizeLoader-B15P9j3b.js.map} +1 -1
- package/dist/{splitPathsBySizeLoader-D1iVVUla.js → splitPathsBySizeLoader-CN949ATZ.js} +2 -2
- package/dist/{splitPathsBySizeLoader-D1iVVUla.js.map → splitPathsBySizeLoader-CN949ATZ.js.map} +1 -1
- package/dist-types/edit-mode/default-table-data.d.ts +64 -0
- package/dist-types/edit-mode/dnd/utils.d.ts +11 -1
- package/dist-types/edit-mode/features/operation-store.d.ts +4 -0
- package/dist-types/edit-mode/source-update-api.d.ts +2 -1
- package/dist-types/lib/internal-details/identifier-normalizer.d.ts +0 -1
- package/dist-types/lib/internal-details/lib/evaluator/base-entity-manager.d.ts +3 -2
- package/dist-types/lib/internal-details/lib/evaluator/compute-engines.d.ts +2 -1
- package/dist-types/lib/internal-details/lib/evaluator/entity-manager.d.ts +8 -0
- package/dist-types/lib/internal-details/lib/evaluator/lazy-function.d.ts +1 -1
- package/dist-types/lib/user-facing/components/button/props.d.ts +0 -5
- package/dist-types/lib/user-facing/components/column/index.d.ts +8 -21
- package/dist-types/lib/user-facing/components/column/props.d.ts +20 -33
- package/dist-types/lib/user-facing/components/container/index.d.ts +8 -22
- package/dist-types/lib/user-facing/components/container/props.d.ts +7 -22
- package/dist-types/lib/user-facing/components/dropdown/index.d.ts +1 -1
- package/dist-types/lib/user-facing/components/dropdown/props.d.ts +1 -1
- package/dist-types/lib/user-facing/components/dropdown/types.d.ts +1 -1
- package/dist-types/lib/user-facing/components/grid/index.d.ts +8 -8
- package/dist-types/lib/user-facing/components/image/index.d.ts +1 -1
- package/dist-types/lib/user-facing/components/image/props.d.ts +1 -1
- package/dist-types/lib/user-facing/components/modal/index.d.ts +8 -13
- package/dist-types/lib/user-facing/components/modal/modal-component.d.ts +1 -1
- package/dist-types/lib/user-facing/components/modal/props.d.ts +8 -13
- package/dist-types/lib/user-facing/components/pixel-input/index.d.ts +7 -0
- package/dist-types/lib/user-facing/components/section/index.d.ts +2 -2
- package/dist-types/lib/user-facing/components/section/props.d.ts +2 -2
- package/dist-types/lib/user-facing/components/stack/index.d.ts +2 -2
- package/dist-types/lib/user-facing/components/table/column-properties-panel.d.ts +45 -40
- package/dist-types/lib/user-facing/components/table/components/boolean-value-icons.d.ts +5 -5
- package/dist-types/lib/user-facing/components/table/components/table-data-download.d.ts +2 -2
- package/dist-types/lib/user-facing/components/table/components/table-footer.d.ts +4 -4
- package/dist-types/lib/user-facing/components/table/components/table-pagination.d.ts +3 -3
- package/dist-types/lib/user-facing/components/table/derived-properties.d.ts +0 -1
- package/dist-types/lib/user-facing/components/table/index.d.ts +55 -51
- package/dist-types/lib/user-facing/components/table/props.d.ts +56 -53
- package/dist-types/lib/user-facing/components/table/table-component.d.ts +3 -3
- package/dist-types/lib/user-facing/components/table/table-styles.d.ts +0 -1
- package/dist-types/lib/user-facing/components/table/table-utilities.d.ts +1 -3
- package/dist-types/lib/user-facing/components/table/types.d.ts +8 -19
- package/dist-types/lib/user-facing/properties-panel/mixins/appearance-properties.d.ts +1 -0
- package/dist-types/lib/user-facing/properties-panel/mixins/appearance.d.ts +4 -8
- package/dist-types/lib/user-facing/properties-panel/mixins/layout-section.d.ts +12 -14
- package/dist-types/lib/user-facing/properties-panel/props-builder.d.ts +1 -0
- package/dist-types/lib/user-facing/themes/constants.d.ts +2 -0
- package/package.json +4 -3
|
@@ -46,7 +46,7 @@ var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use
|
|
|
46
46
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
47
47
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
48
48
|
var __privateMethod = (obj, member, method4) => (__accessCheck(obj, member, "access private method"), method4);
|
|
49
|
-
var _removeSourceIdElement_dec, _setSourceIdElement_dec, _setActiveRootInstanceId_dec, _init, _cancelApi_dec, _runApi_dec, _init2, _setWidgetProperty_dec, _setWidgetProperties_dec, _writeRuntimeProperties_dec, _deleteComponents_dec, _dropComponent_dec, _createComponent_dec, _batchUpdate_dec, _clearPendingTransactions_dec, _addPendingTransaction_dec, _executeOrAddToBatch_dec, _init3, _addOptimisticCreateWidget_dec, _processRootWidget_dec, _init4, _refreshPositionsAndGetDropConstraints_dec, _init5, _updateChildPositions_dec, _setWidgetPosition_dec, _setActiveTargetRect_dec, _setActiveDragRect_dec, _setDropTargetId_dec, _setInvalidDropTarget_dec, _setValidRootIds_dec, _cancelNewComponentDrag_dec, _startNewComponentDrag_dec, _setIsDragging_dec, _setWidgetFeatures_dec, _init6;
|
|
49
|
+
var _removeSourceIdElement_dec, _setSourceIdElement_dec, _setActiveRootInstanceId_dec, _init, _cancelApi_dec, _runApi_dec, _init2, _renameWidget_dec, _setWidgetProperty_dec, _setWidgetProperties_dec, _writeRuntimeProperties_dec, _deleteComponents_dec, _dropComponent_dec, _createComponent_dec, _batchUpdate_dec, _clearPendingTransactions_dec, _addPendingTransaction_dec, _executeOrAddToBatch_dec, _init3, _addOptimisticCreateWidget_dec, _processRootWidget_dec, _init4, _refreshPositionsAndGetDropConstraints_dec, _init5, _updateChildPositions_dec, _setWidgetPosition_dec, _setActiveTargetRect_dec, _setActiveDragRect_dec, _setDropTargetId_dec, _setInvalidDropTarget_dec, _setValidRootIds_dec, _cancelNewComponentDrag_dec, _startNewComponentDrag_dec, _setIsDragging_dec, _setWidgetFeatures_dec, _init6;
|
|
50
50
|
import * as React from "react";
|
|
51
51
|
import React__default, { useMemo as useMemo$2, createContext, useContext, isValidElement as isValidElement$1, cloneElement as cloneElement$1, Children, useState, createElement, useRef, useLayoutEffect as useLayoutEffect$2, forwardRef, memo, version as version$2, useEffect, Component, useCallback, useImperativeHandle, useReducer, PureComponent, useSyncExternalStore, Suspense, createRef } from "react";
|
|
52
52
|
import { S as SvgClose, a as SvgSystemDanger, b as SvgSystemInfo, c as SvgSystemError, d as SvgSystemSuccess, e as SvgPlus, f as SvgHide, g as SvgChevronDown, h as SvgEmptyCheckbox, i as SvgMinus, j as SvgCheckmark, k as SvgCopy, l as SvgExternalLink, m as SvgPlay, n as SvgDownload, o as SvgTrash, p as SvgFilter, q as SvgFreeze, r as SvgSort, s as SvgEllipsis, t as SvgCrossXs } from "./icons-D_yAT9A6.js";
|
|
@@ -2690,14 +2690,14 @@ function getLoaderFn$1(options) {
|
|
|
2690
2690
|
if (!(loader === "all")) return [3, 3];
|
|
2691
2691
|
return [4, import(
|
|
2692
2692
|
/* webpackChunkName: "blueprint-icons-all-paths-loader" */
|
|
2693
|
-
"./allPathsLoader-
|
|
2693
|
+
"./allPathsLoader-C6F1yurZ.js"
|
|
2694
2694
|
)];
|
|
2695
2695
|
case 2:
|
|
2696
2696
|
return [2, _b2.sent().allPathsLoader];
|
|
2697
2697
|
case 3:
|
|
2698
2698
|
return [4, import(
|
|
2699
2699
|
/* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
|
|
2700
|
-
"./splitPathsBySizeLoader-
|
|
2700
|
+
"./splitPathsBySizeLoader-B15P9j3b.js"
|
|
2701
2701
|
)];
|
|
2702
2702
|
case 4:
|
|
2703
2703
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -10229,11 +10229,12 @@ const cyrb53$1 = (str, seed2 = 0) => {
|
|
|
10229
10229
|
h22 ^= Math.imul(h1 ^ h1 >>> 13, 3266489909);
|
|
10230
10230
|
return 4294967296 * (2097151 & h22) + (h1 >>> 0);
|
|
10231
10231
|
};
|
|
10232
|
-
function PropertyInfo(value, type5 = "STATIC") {
|
|
10232
|
+
function PropertyInfo(value, type5 = "STATIC", extra) {
|
|
10233
10233
|
return {
|
|
10234
10234
|
__info: true,
|
|
10235
10235
|
value,
|
|
10236
|
-
type: type5
|
|
10236
|
+
type: type5,
|
|
10237
|
+
...extra
|
|
10237
10238
|
};
|
|
10238
10239
|
}
|
|
10239
10240
|
const Property = {
|
|
@@ -10243,7 +10244,7 @@ const Property = {
|
|
|
10243
10244
|
Expression: (value) => PropertyInfo(value, "EXPRESSION"),
|
|
10244
10245
|
Event: (value) => PropertyInfo(value, "EVENT"),
|
|
10245
10246
|
Dimension: (value) => PropertyInfo(value, "DIMENSION"),
|
|
10246
|
-
Computed: (value) => PropertyInfo(value, "COMPUTED"),
|
|
10247
|
+
Computed: (value, args) => PropertyInfo(value, "COMPUTED", args ? { args } : {}),
|
|
10247
10248
|
Any: (value, type5 = "STATIC") => PropertyInfo(value, type5)
|
|
10248
10249
|
};
|
|
10249
10250
|
function isPropertyInfo(value) {
|
|
@@ -45784,6 +45785,240 @@ const SUPERBLOCKS_AUTHORIZATION_HEADER = "x-superblocks-authorization";
|
|
|
45784
45785
|
akeylesssecretsmanager: srcExports.SecretsV1.Store,
|
|
45785
45786
|
couchbase: srcExports.CouchbasePluginV1.Plugin
|
|
45786
45787
|
});
|
|
45788
|
+
var TMP_HTTP_STATUS_CODE = "http.status_code";
|
|
45789
|
+
var TMP_HTTP_ROUTE = "http.route";
|
|
45790
|
+
var TMP_MESSAGING_SYSTEM = "messaging.system";
|
|
45791
|
+
var TMP_MESSAGING_DESTINATION_KIND = "messaging.destination_kind";
|
|
45792
|
+
var SEMATTRS_HTTP_STATUS_CODE = TMP_HTTP_STATUS_CODE;
|
|
45793
|
+
var SEMATTRS_HTTP_ROUTE = TMP_HTTP_ROUTE;
|
|
45794
|
+
var SEMATTRS_MESSAGING_SYSTEM = TMP_MESSAGING_SYSTEM;
|
|
45795
|
+
var SEMATTRS_MESSAGING_DESTINATION_KIND = TMP_MESSAGING_DESTINATION_KIND;
|
|
45796
|
+
const OBS_TAG_API_ID = "api-id";
|
|
45797
|
+
const OBS_TAG_HTTP_ROUTE = SEMATTRS_HTTP_ROUTE;
|
|
45798
|
+
const OBS_TAG_HTTP_STATUS_CODE = SEMATTRS_HTTP_STATUS_CODE;
|
|
45799
|
+
const OBS_TAG_APPLICATION_ID = "application-id";
|
|
45800
|
+
const OBS_TAG_BRANCH = "branch";
|
|
45801
|
+
const OBS_TAG_COMMIT_ID = "commit-id";
|
|
45802
|
+
const OBS_SOCKET_STATUS_CODE = "socket.status-code";
|
|
45803
|
+
class SocketErrorException extends Error {
|
|
45804
|
+
constructor(code3, message2) {
|
|
45805
|
+
super(message2);
|
|
45806
|
+
this.code = code3;
|
|
45807
|
+
this.message = message2;
|
|
45808
|
+
}
|
|
45809
|
+
}
|
|
45810
|
+
class ISocket {
|
|
45811
|
+
constructor(ws2, requestHandlers, globalMiddlewares, timeouts, logger) {
|
|
45812
|
+
this.responseHandler = /* @__PURE__ */ new Map();
|
|
45813
|
+
this.ws = ws2;
|
|
45814
|
+
this.requestHandlers = requestHandlers;
|
|
45815
|
+
this.globalMiddlewares = globalMiddlewares;
|
|
45816
|
+
this.nxtRequestId = 0;
|
|
45817
|
+
this.logger = logger ?? { error: console.error };
|
|
45818
|
+
this.timeouts = timeouts;
|
|
45819
|
+
this.resetConnectionTimeout();
|
|
45820
|
+
this.ws.addEventListener("message", async (event) => {
|
|
45821
|
+
const eventData = JSON.parse(event.data.toString());
|
|
45822
|
+
return this.handleMessage(eventData);
|
|
45823
|
+
});
|
|
45824
|
+
}
|
|
45825
|
+
async handleMessage(message2) {
|
|
45826
|
+
this.resetConnectionTimeout();
|
|
45827
|
+
if (message2.request) {
|
|
45828
|
+
const parts = message2.request.method.split(".");
|
|
45829
|
+
let handlers = this.requestHandlers;
|
|
45830
|
+
for (const part of parts) {
|
|
45831
|
+
handlers = handlers[part];
|
|
45832
|
+
if (!handlers) {
|
|
45833
|
+
return this.respondError(message2.request.id, {
|
|
45834
|
+
code: 2,
|
|
45835
|
+
message: `unknown method ${message2.request.method}`
|
|
45836
|
+
});
|
|
45837
|
+
}
|
|
45838
|
+
}
|
|
45839
|
+
if (!Array.isArray(handlers)) {
|
|
45840
|
+
return this.respondError(message2.request.id, {
|
|
45841
|
+
code: 2,
|
|
45842
|
+
message: "unknown method"
|
|
45843
|
+
});
|
|
45844
|
+
}
|
|
45845
|
+
handlers = [...this.globalMiddlewares, ...handlers];
|
|
45846
|
+
if (message2.request.setAuthorization) {
|
|
45847
|
+
this.peerAuthorization = message2.request.setAuthorization;
|
|
45848
|
+
}
|
|
45849
|
+
const reqCtx = {
|
|
45850
|
+
peerAuthorization: this.peerAuthorization,
|
|
45851
|
+
method: message2.request.method,
|
|
45852
|
+
requestId: message2.request.id
|
|
45853
|
+
};
|
|
45854
|
+
const client2 = createISocketClient(this);
|
|
45855
|
+
const payload = message2.request.payload;
|
|
45856
|
+
let alreadyResponded = false;
|
|
45857
|
+
const generateNextFn = (idx) => {
|
|
45858
|
+
let wasCalled = false;
|
|
45859
|
+
return async () => {
|
|
45860
|
+
if (alreadyResponded) {
|
|
45861
|
+
throw new SocketErrorException(4, "next() was called after the response was sent");
|
|
45862
|
+
}
|
|
45863
|
+
const handler = handlers[idx];
|
|
45864
|
+
if (!handler) {
|
|
45865
|
+
throw new SocketErrorException(5, "cannot call past the last handler in the chain");
|
|
45866
|
+
}
|
|
45867
|
+
if (wasCalled) {
|
|
45868
|
+
throw new SocketErrorException(6, "next() was called multiple times");
|
|
45869
|
+
}
|
|
45870
|
+
wasCalled = true;
|
|
45871
|
+
return this.callHandler(handler, payload, reqCtx, client2, generateNextFn(idx + 1));
|
|
45872
|
+
};
|
|
45873
|
+
};
|
|
45874
|
+
let response;
|
|
45875
|
+
try {
|
|
45876
|
+
response = await generateNextFn(0)();
|
|
45877
|
+
} catch (error) {
|
|
45878
|
+
const socketError = error instanceof SocketErrorException ? { code: error.code, message: error.message } : { code: 3, message: error.toString() };
|
|
45879
|
+
return this.respondError(message2.request.id, socketError, error);
|
|
45880
|
+
}
|
|
45881
|
+
this.respond(message2.request.id, response);
|
|
45882
|
+
alreadyResponded = true;
|
|
45883
|
+
} else if (message2.response && message2.response.id) {
|
|
45884
|
+
const responseHandler = this.responseHandler.get(message2.response.id);
|
|
45885
|
+
if (!responseHandler) {
|
|
45886
|
+
return;
|
|
45887
|
+
}
|
|
45888
|
+
if (message2.response.error) {
|
|
45889
|
+
responseHandler.reject(message2.response.error);
|
|
45890
|
+
}
|
|
45891
|
+
responseHandler.resolve(message2.response.payload);
|
|
45892
|
+
clearTimeout(responseHandler.timeout);
|
|
45893
|
+
this.responseHandler.delete(message2.response.id);
|
|
45894
|
+
} else {
|
|
45895
|
+
return this.respondError(-1, {
|
|
45896
|
+
code: 3,
|
|
45897
|
+
message: "unknown request id"
|
|
45898
|
+
});
|
|
45899
|
+
}
|
|
45900
|
+
}
|
|
45901
|
+
async callHandler(handler, params, ctx, client2, next2) {
|
|
45902
|
+
return handler(params, ctx, client2, next2);
|
|
45903
|
+
}
|
|
45904
|
+
request(method4, params, authorization) {
|
|
45905
|
+
return new Promise((resolve, reject) => {
|
|
45906
|
+
const requestId = ++this.nxtRequestId;
|
|
45907
|
+
this.responseHandler.set(requestId, {
|
|
45908
|
+
resolve: (result) => resolve(result),
|
|
45909
|
+
reject: (error) => reject(error)
|
|
45910
|
+
});
|
|
45911
|
+
let toSend = { request: { method: method4, payload: params, id: requestId, setAuthorization: authorization } };
|
|
45912
|
+
toSend = this.decorateToSend(toSend);
|
|
45913
|
+
this.ws.send(JSON.stringify(toSend));
|
|
45914
|
+
this.resetConnectionTimeout();
|
|
45915
|
+
this.resetNoResponseTimeout(requestId);
|
|
45916
|
+
});
|
|
45917
|
+
}
|
|
45918
|
+
decorateToSend(message2) {
|
|
45919
|
+
return message2;
|
|
45920
|
+
}
|
|
45921
|
+
respond(requestId, result) {
|
|
45922
|
+
const toSend = {
|
|
45923
|
+
response: {
|
|
45924
|
+
payload: result,
|
|
45925
|
+
id: requestId,
|
|
45926
|
+
error: null
|
|
45927
|
+
}
|
|
45928
|
+
};
|
|
45929
|
+
return this.ws.send(JSON.stringify(toSend));
|
|
45930
|
+
}
|
|
45931
|
+
respondError(requestId, error, exception) {
|
|
45932
|
+
const toSend = {
|
|
45933
|
+
response: {
|
|
45934
|
+
payload: null,
|
|
45935
|
+
id: requestId,
|
|
45936
|
+
error
|
|
45937
|
+
}
|
|
45938
|
+
};
|
|
45939
|
+
return this.ws.send(JSON.stringify(toSend));
|
|
45940
|
+
}
|
|
45941
|
+
resetConnectionTimeout() {
|
|
45942
|
+
var _a2, _b2;
|
|
45943
|
+
if (!((_a2 = this.timeouts) == null ? void 0 : _a2.connectionTimeoutInSeconds)) {
|
|
45944
|
+
return;
|
|
45945
|
+
}
|
|
45946
|
+
if (this.connectionTimeout) {
|
|
45947
|
+
clearTimeout(this.connectionTimeout);
|
|
45948
|
+
}
|
|
45949
|
+
this.connectionTimeout = setTimeout(this.handleConnectionTimeout(), ((_b2 = this.timeouts) == null ? void 0 : _b2.connectionTimeoutInSeconds) * 1e3);
|
|
45950
|
+
}
|
|
45951
|
+
handleConnectionTimeout() {
|
|
45952
|
+
return () => {
|
|
45953
|
+
var _a2;
|
|
45954
|
+
this.logger.error(`Connection timed out after ${(_a2 = this.timeouts) == null ? void 0 : _a2.connectionTimeoutInSeconds} seconds`);
|
|
45955
|
+
this.close();
|
|
45956
|
+
};
|
|
45957
|
+
}
|
|
45958
|
+
resetNoResponseTimeout(requestId) {
|
|
45959
|
+
var _a2, _b2;
|
|
45960
|
+
if (!((_a2 = this.timeouts) == null ? void 0 : _a2.noResponseTimeoutInSeconds)) {
|
|
45961
|
+
return;
|
|
45962
|
+
}
|
|
45963
|
+
const responseHandler = this.responseHandler.get(requestId);
|
|
45964
|
+
if (!responseHandler) {
|
|
45965
|
+
return;
|
|
45966
|
+
}
|
|
45967
|
+
const noResponseTimeout = responseHandler.timeout;
|
|
45968
|
+
const reject = responseHandler.reject;
|
|
45969
|
+
if (responseHandler.timeout) {
|
|
45970
|
+
clearTimeout(noResponseTimeout);
|
|
45971
|
+
}
|
|
45972
|
+
responseHandler.timeout = setTimeout(this.handleNoResponseTimeout(reject), ((_b2 = this.timeouts) == null ? void 0 : _b2.noResponseTimeoutInSeconds) * 1e3);
|
|
45973
|
+
}
|
|
45974
|
+
handleNoResponseTimeout(reject) {
|
|
45975
|
+
return () => {
|
|
45976
|
+
var _a2;
|
|
45977
|
+
const message2 = `Request timed out after ${(_a2 = this.timeouts) == null ? void 0 : _a2.noResponseTimeoutInSeconds} seconds`;
|
|
45978
|
+
this.logger.error(message2);
|
|
45979
|
+
reject({ code: 7, message: message2 });
|
|
45980
|
+
};
|
|
45981
|
+
}
|
|
45982
|
+
close() {
|
|
45983
|
+
clearTimeout(this.connectionTimeout);
|
|
45984
|
+
this.responseHandler.forEach((handler, key2) => {
|
|
45985
|
+
clearTimeout(handler.timeout);
|
|
45986
|
+
this.logger.error(`Rejecting pending requestId ${key2} due to connection close`);
|
|
45987
|
+
handler.reject({ code: 8, message: "Connection closed" });
|
|
45988
|
+
});
|
|
45989
|
+
this.ws.close();
|
|
45990
|
+
}
|
|
45991
|
+
}
|
|
45992
|
+
const proxyTarget = Object.freeze(() => {
|
|
45993
|
+
});
|
|
45994
|
+
function createIsocketProxy(socket, path2) {
|
|
45995
|
+
return new Proxy(proxyTarget, {
|
|
45996
|
+
get(_target, prop) {
|
|
45997
|
+
const childPath = path2 ? `${path2}.${prop}` : prop;
|
|
45998
|
+
if (childPath === "then") {
|
|
45999
|
+
return void 0;
|
|
46000
|
+
}
|
|
46001
|
+
return createIsocketProxy(socket, childPath);
|
|
46002
|
+
},
|
|
46003
|
+
apply(_target, _thisArg, args) {
|
|
46004
|
+
if (path2 === void 0) {
|
|
46005
|
+
throw new Error("The root object is not callable");
|
|
46006
|
+
}
|
|
46007
|
+
if (path2.endsWith(".apply") && args.length === 2 && Array.isArray(args[1])) {
|
|
46008
|
+
path2 = path2.slice(0, -".apply".length);
|
|
46009
|
+
args = args[1];
|
|
46010
|
+
}
|
|
46011
|
+
return socket.request(path2, args[0]);
|
|
46012
|
+
}
|
|
46013
|
+
});
|
|
46014
|
+
}
|
|
46015
|
+
function createISocketClient(socket) {
|
|
46016
|
+
return {
|
|
46017
|
+
close: () => socket.close(),
|
|
46018
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46019
|
+
call: createIsocketProxy(socket, void 0)
|
|
46020
|
+
};
|
|
46021
|
+
}
|
|
45787
46022
|
var _globalThis = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
|
|
45788
46023
|
var VERSION = "1.9.0";
|
|
45789
46024
|
var re$2 = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
@@ -46028,7 +46263,7 @@ var __spreadArray$3 = function(to2, from2, pack) {
|
|
|
46028
46263
|
}
|
|
46029
46264
|
return to2.concat(ar2 || Array.prototype.slice.call(from2));
|
|
46030
46265
|
};
|
|
46031
|
-
var API_NAME$
|
|
46266
|
+
var API_NAME$3 = "diag";
|
|
46032
46267
|
var DiagAPI = (
|
|
46033
46268
|
/** @class */
|
|
46034
46269
|
function() {
|
|
@@ -46072,7 +46307,7 @@ var DiagAPI = (
|
|
|
46072
46307
|
};
|
|
46073
46308
|
self2.setLogger = setLogger;
|
|
46074
46309
|
self2.disable = function() {
|
|
46075
|
-
unregisterGlobal(API_NAME$
|
|
46310
|
+
unregisterGlobal(API_NAME$3, self2);
|
|
46076
46311
|
};
|
|
46077
46312
|
self2.createComponentLogger = function(options) {
|
|
46078
46313
|
return new DiagComponentLogger(options);
|
|
@@ -46313,7 +46548,7 @@ var __spreadArray$1 = function(to2, from2, pack) {
|
|
|
46313
46548
|
}
|
|
46314
46549
|
return to2.concat(ar2 || Array.prototype.slice.call(from2));
|
|
46315
46550
|
};
|
|
46316
|
-
var API_NAME$
|
|
46551
|
+
var API_NAME$2 = "context";
|
|
46317
46552
|
var NOOP_CONTEXT_MANAGER = new NoopContextManager();
|
|
46318
46553
|
var ContextAPI = (
|
|
46319
46554
|
/** @class */
|
|
@@ -46327,7 +46562,7 @@ var ContextAPI = (
|
|
|
46327
46562
|
return this._instance;
|
|
46328
46563
|
};
|
|
46329
46564
|
ContextAPI2.prototype.setGlobalContextManager = function(contextManager) {
|
|
46330
|
-
return registerGlobal(API_NAME$
|
|
46565
|
+
return registerGlobal(API_NAME$2, contextManager, DiagAPI.instance());
|
|
46331
46566
|
};
|
|
46332
46567
|
ContextAPI2.prototype.active = function() {
|
|
46333
46568
|
return this._getContextManager().active();
|
|
@@ -46344,15 +46579,232 @@ var ContextAPI = (
|
|
|
46344
46579
|
return this._getContextManager().bind(context2, target);
|
|
46345
46580
|
};
|
|
46346
46581
|
ContextAPI2.prototype._getContextManager = function() {
|
|
46347
|
-
return getGlobal$1(API_NAME$
|
|
46582
|
+
return getGlobal$1(API_NAME$2) || NOOP_CONTEXT_MANAGER;
|
|
46348
46583
|
};
|
|
46349
46584
|
ContextAPI2.prototype.disable = function() {
|
|
46350
46585
|
this._getContextManager().disable();
|
|
46351
|
-
unregisterGlobal(API_NAME$
|
|
46586
|
+
unregisterGlobal(API_NAME$2, DiagAPI.instance());
|
|
46352
46587
|
};
|
|
46353
46588
|
return ContextAPI2;
|
|
46354
46589
|
}()
|
|
46355
46590
|
);
|
|
46591
|
+
var TraceFlags;
|
|
46592
|
+
(function(TraceFlags2) {
|
|
46593
|
+
TraceFlags2[TraceFlags2["NONE"] = 0] = "NONE";
|
|
46594
|
+
TraceFlags2[TraceFlags2["SAMPLED"] = 1] = "SAMPLED";
|
|
46595
|
+
})(TraceFlags || (TraceFlags = {}));
|
|
46596
|
+
var INVALID_SPANID = "0000000000000000";
|
|
46597
|
+
var INVALID_TRACEID = "00000000000000000000000000000000";
|
|
46598
|
+
var INVALID_SPAN_CONTEXT = {
|
|
46599
|
+
traceId: INVALID_TRACEID,
|
|
46600
|
+
spanId: INVALID_SPANID,
|
|
46601
|
+
traceFlags: TraceFlags.NONE
|
|
46602
|
+
};
|
|
46603
|
+
var NonRecordingSpan = (
|
|
46604
|
+
/** @class */
|
|
46605
|
+
function() {
|
|
46606
|
+
function NonRecordingSpan2(_spanContext) {
|
|
46607
|
+
if (_spanContext === void 0) {
|
|
46608
|
+
_spanContext = INVALID_SPAN_CONTEXT;
|
|
46609
|
+
}
|
|
46610
|
+
this._spanContext = _spanContext;
|
|
46611
|
+
}
|
|
46612
|
+
NonRecordingSpan2.prototype.spanContext = function() {
|
|
46613
|
+
return this._spanContext;
|
|
46614
|
+
};
|
|
46615
|
+
NonRecordingSpan2.prototype.setAttribute = function(_key, _value) {
|
|
46616
|
+
return this;
|
|
46617
|
+
};
|
|
46618
|
+
NonRecordingSpan2.prototype.setAttributes = function(_attributes) {
|
|
46619
|
+
return this;
|
|
46620
|
+
};
|
|
46621
|
+
NonRecordingSpan2.prototype.addEvent = function(_name, _attributes) {
|
|
46622
|
+
return this;
|
|
46623
|
+
};
|
|
46624
|
+
NonRecordingSpan2.prototype.addLink = function(_link) {
|
|
46625
|
+
return this;
|
|
46626
|
+
};
|
|
46627
|
+
NonRecordingSpan2.prototype.addLinks = function(_links) {
|
|
46628
|
+
return this;
|
|
46629
|
+
};
|
|
46630
|
+
NonRecordingSpan2.prototype.setStatus = function(_status) {
|
|
46631
|
+
return this;
|
|
46632
|
+
};
|
|
46633
|
+
NonRecordingSpan2.prototype.updateName = function(_name) {
|
|
46634
|
+
return this;
|
|
46635
|
+
};
|
|
46636
|
+
NonRecordingSpan2.prototype.end = function(_endTime) {
|
|
46637
|
+
};
|
|
46638
|
+
NonRecordingSpan2.prototype.isRecording = function() {
|
|
46639
|
+
return false;
|
|
46640
|
+
};
|
|
46641
|
+
NonRecordingSpan2.prototype.recordException = function(_exception, _time) {
|
|
46642
|
+
};
|
|
46643
|
+
return NonRecordingSpan2;
|
|
46644
|
+
}()
|
|
46645
|
+
);
|
|
46646
|
+
var SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
|
|
46647
|
+
function getSpan(context2) {
|
|
46648
|
+
return context2.getValue(SPAN_KEY) || void 0;
|
|
46649
|
+
}
|
|
46650
|
+
function getActiveSpan() {
|
|
46651
|
+
return getSpan(ContextAPI.getInstance().active());
|
|
46652
|
+
}
|
|
46653
|
+
function setSpan(context2, span) {
|
|
46654
|
+
return context2.setValue(SPAN_KEY, span);
|
|
46655
|
+
}
|
|
46656
|
+
function deleteSpan(context2) {
|
|
46657
|
+
return context2.deleteValue(SPAN_KEY);
|
|
46658
|
+
}
|
|
46659
|
+
function setSpanContext(context2, spanContext) {
|
|
46660
|
+
return setSpan(context2, new NonRecordingSpan(spanContext));
|
|
46661
|
+
}
|
|
46662
|
+
function getSpanContext(context2) {
|
|
46663
|
+
var _a2;
|
|
46664
|
+
return (_a2 = getSpan(context2)) === null || _a2 === void 0 ? void 0 : _a2.spanContext();
|
|
46665
|
+
}
|
|
46666
|
+
var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
|
|
46667
|
+
var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;
|
|
46668
|
+
function isValidTraceId(traceId) {
|
|
46669
|
+
return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;
|
|
46670
|
+
}
|
|
46671
|
+
function isValidSpanId(spanId) {
|
|
46672
|
+
return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;
|
|
46673
|
+
}
|
|
46674
|
+
function isSpanContextValid(spanContext) {
|
|
46675
|
+
return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId);
|
|
46676
|
+
}
|
|
46677
|
+
function wrapSpanContext(spanContext) {
|
|
46678
|
+
return new NonRecordingSpan(spanContext);
|
|
46679
|
+
}
|
|
46680
|
+
var contextApi = ContextAPI.getInstance();
|
|
46681
|
+
var NoopTracer = (
|
|
46682
|
+
/** @class */
|
|
46683
|
+
function() {
|
|
46684
|
+
function NoopTracer2() {
|
|
46685
|
+
}
|
|
46686
|
+
NoopTracer2.prototype.startSpan = function(name, options, context2) {
|
|
46687
|
+
if (context2 === void 0) {
|
|
46688
|
+
context2 = contextApi.active();
|
|
46689
|
+
}
|
|
46690
|
+
var root2 = Boolean(options === null || options === void 0 ? void 0 : options.root);
|
|
46691
|
+
if (root2) {
|
|
46692
|
+
return new NonRecordingSpan();
|
|
46693
|
+
}
|
|
46694
|
+
var parentFromContext = context2 && getSpanContext(context2);
|
|
46695
|
+
if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) {
|
|
46696
|
+
return new NonRecordingSpan(parentFromContext);
|
|
46697
|
+
} else {
|
|
46698
|
+
return new NonRecordingSpan();
|
|
46699
|
+
}
|
|
46700
|
+
};
|
|
46701
|
+
NoopTracer2.prototype.startActiveSpan = function(name, arg2, arg3, arg4) {
|
|
46702
|
+
var opts;
|
|
46703
|
+
var ctx;
|
|
46704
|
+
var fn3;
|
|
46705
|
+
if (arguments.length < 2) {
|
|
46706
|
+
return;
|
|
46707
|
+
} else if (arguments.length === 2) {
|
|
46708
|
+
fn3 = arg2;
|
|
46709
|
+
} else if (arguments.length === 3) {
|
|
46710
|
+
opts = arg2;
|
|
46711
|
+
fn3 = arg3;
|
|
46712
|
+
} else {
|
|
46713
|
+
opts = arg2;
|
|
46714
|
+
ctx = arg3;
|
|
46715
|
+
fn3 = arg4;
|
|
46716
|
+
}
|
|
46717
|
+
var parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
|
|
46718
|
+
var span = this.startSpan(name, opts, parentContext);
|
|
46719
|
+
var contextWithSpanSet = setSpan(parentContext, span);
|
|
46720
|
+
return contextApi.with(contextWithSpanSet, fn3, void 0, span);
|
|
46721
|
+
};
|
|
46722
|
+
return NoopTracer2;
|
|
46723
|
+
}()
|
|
46724
|
+
);
|
|
46725
|
+
function isSpanContext(spanContext) {
|
|
46726
|
+
return typeof spanContext === "object" && typeof spanContext["spanId"] === "string" && typeof spanContext["traceId"] === "string" && typeof spanContext["traceFlags"] === "number";
|
|
46727
|
+
}
|
|
46728
|
+
var NOOP_TRACER = new NoopTracer();
|
|
46729
|
+
var ProxyTracer = (
|
|
46730
|
+
/** @class */
|
|
46731
|
+
function() {
|
|
46732
|
+
function ProxyTracer2(_provider, name, version2, options) {
|
|
46733
|
+
this._provider = _provider;
|
|
46734
|
+
this.name = name;
|
|
46735
|
+
this.version = version2;
|
|
46736
|
+
this.options = options;
|
|
46737
|
+
}
|
|
46738
|
+
ProxyTracer2.prototype.startSpan = function(name, options, context2) {
|
|
46739
|
+
return this._getTracer().startSpan(name, options, context2);
|
|
46740
|
+
};
|
|
46741
|
+
ProxyTracer2.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
|
|
46742
|
+
var tracer = this._getTracer();
|
|
46743
|
+
return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
|
|
46744
|
+
};
|
|
46745
|
+
ProxyTracer2.prototype._getTracer = function() {
|
|
46746
|
+
if (this._delegate) {
|
|
46747
|
+
return this._delegate;
|
|
46748
|
+
}
|
|
46749
|
+
var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
|
|
46750
|
+
if (!tracer) {
|
|
46751
|
+
return NOOP_TRACER;
|
|
46752
|
+
}
|
|
46753
|
+
this._delegate = tracer;
|
|
46754
|
+
return this._delegate;
|
|
46755
|
+
};
|
|
46756
|
+
return ProxyTracer2;
|
|
46757
|
+
}()
|
|
46758
|
+
);
|
|
46759
|
+
var NoopTracerProvider = (
|
|
46760
|
+
/** @class */
|
|
46761
|
+
function() {
|
|
46762
|
+
function NoopTracerProvider2() {
|
|
46763
|
+
}
|
|
46764
|
+
NoopTracerProvider2.prototype.getTracer = function(_name, _version, _options) {
|
|
46765
|
+
return new NoopTracer();
|
|
46766
|
+
};
|
|
46767
|
+
return NoopTracerProvider2;
|
|
46768
|
+
}()
|
|
46769
|
+
);
|
|
46770
|
+
var NOOP_TRACER_PROVIDER = new NoopTracerProvider();
|
|
46771
|
+
var ProxyTracerProvider = (
|
|
46772
|
+
/** @class */
|
|
46773
|
+
function() {
|
|
46774
|
+
function ProxyTracerProvider2() {
|
|
46775
|
+
}
|
|
46776
|
+
ProxyTracerProvider2.prototype.getTracer = function(name, version2, options) {
|
|
46777
|
+
var _a2;
|
|
46778
|
+
return (_a2 = this.getDelegateTracer(name, version2, options)) !== null && _a2 !== void 0 ? _a2 : new ProxyTracer(this, name, version2, options);
|
|
46779
|
+
};
|
|
46780
|
+
ProxyTracerProvider2.prototype.getDelegate = function() {
|
|
46781
|
+
var _a2;
|
|
46782
|
+
return (_a2 = this._delegate) !== null && _a2 !== void 0 ? _a2 : NOOP_TRACER_PROVIDER;
|
|
46783
|
+
};
|
|
46784
|
+
ProxyTracerProvider2.prototype.setDelegate = function(delegate) {
|
|
46785
|
+
this._delegate = delegate;
|
|
46786
|
+
};
|
|
46787
|
+
ProxyTracerProvider2.prototype.getDelegateTracer = function(name, version2, options) {
|
|
46788
|
+
var _a2;
|
|
46789
|
+
return (_a2 = this._delegate) === null || _a2 === void 0 ? void 0 : _a2.getTracer(name, version2, options);
|
|
46790
|
+
};
|
|
46791
|
+
return ProxyTracerProvider2;
|
|
46792
|
+
}()
|
|
46793
|
+
);
|
|
46794
|
+
var SpanKind;
|
|
46795
|
+
(function(SpanKind2) {
|
|
46796
|
+
SpanKind2[SpanKind2["INTERNAL"] = 0] = "INTERNAL";
|
|
46797
|
+
SpanKind2[SpanKind2["SERVER"] = 1] = "SERVER";
|
|
46798
|
+
SpanKind2[SpanKind2["CLIENT"] = 2] = "CLIENT";
|
|
46799
|
+
SpanKind2[SpanKind2["PRODUCER"] = 3] = "PRODUCER";
|
|
46800
|
+
SpanKind2[SpanKind2["CONSUMER"] = 4] = "CONSUMER";
|
|
46801
|
+
})(SpanKind || (SpanKind = {}));
|
|
46802
|
+
var SpanStatusCode;
|
|
46803
|
+
(function(SpanStatusCode2) {
|
|
46804
|
+
SpanStatusCode2[SpanStatusCode2["UNSET"] = 0] = "UNSET";
|
|
46805
|
+
SpanStatusCode2[SpanStatusCode2["OK"] = 1] = "OK";
|
|
46806
|
+
SpanStatusCode2[SpanStatusCode2["ERROR"] = 2] = "ERROR";
|
|
46807
|
+
})(SpanStatusCode || (SpanStatusCode = {}));
|
|
46356
46808
|
var context$2 = ContextAPI.getInstance();
|
|
46357
46809
|
var NoopTextMapPropagator = (
|
|
46358
46810
|
/** @class */
|
|
@@ -46383,7 +46835,7 @@ function setBaggage(context2, baggage) {
|
|
|
46383
46835
|
function deleteBaggage(context2) {
|
|
46384
46836
|
return context2.deleteValue(BAGGAGE_KEY);
|
|
46385
46837
|
}
|
|
46386
|
-
var API_NAME = "propagation";
|
|
46838
|
+
var API_NAME$1 = "propagation";
|
|
46387
46839
|
var NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();
|
|
46388
46840
|
var PropagationAPI = (
|
|
46389
46841
|
/** @class */
|
|
@@ -46402,7 +46854,7 @@ var PropagationAPI = (
|
|
|
46402
46854
|
return this._instance;
|
|
46403
46855
|
};
|
|
46404
46856
|
PropagationAPI2.prototype.setGlobalPropagator = function(propagator) {
|
|
46405
|
-
return registerGlobal(API_NAME, propagator, DiagAPI.instance());
|
|
46857
|
+
return registerGlobal(API_NAME$1, propagator, DiagAPI.instance());
|
|
46406
46858
|
};
|
|
46407
46859
|
PropagationAPI2.prototype.inject = function(context2, carrier, setter) {
|
|
46408
46860
|
if (setter === void 0) {
|
|
@@ -46420,230 +46872,177 @@ var PropagationAPI = (
|
|
|
46420
46872
|
return this._getGlobalPropagator().fields();
|
|
46421
46873
|
};
|
|
46422
46874
|
PropagationAPI2.prototype.disable = function() {
|
|
46423
|
-
unregisterGlobal(API_NAME, DiagAPI.instance());
|
|
46875
|
+
unregisterGlobal(API_NAME$1, DiagAPI.instance());
|
|
46424
46876
|
};
|
|
46425
46877
|
PropagationAPI2.prototype._getGlobalPropagator = function() {
|
|
46426
|
-
return getGlobal$1(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;
|
|
46878
|
+
return getGlobal$1(API_NAME$1) || NOOP_TEXT_MAP_PROPAGATOR;
|
|
46427
46879
|
};
|
|
46428
46880
|
return PropagationAPI2;
|
|
46429
46881
|
}()
|
|
46430
46882
|
);
|
|
46431
46883
|
var propagation = PropagationAPI.getInstance();
|
|
46432
|
-
|
|
46433
|
-
|
|
46434
|
-
|
|
46435
|
-
|
|
46436
|
-
|
|
46884
|
+
var API_NAME = "trace";
|
|
46885
|
+
var TraceAPI = (
|
|
46886
|
+
/** @class */
|
|
46887
|
+
function() {
|
|
46888
|
+
function TraceAPI2() {
|
|
46889
|
+
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
46890
|
+
this.wrapSpanContext = wrapSpanContext;
|
|
46891
|
+
this.isSpanContextValid = isSpanContextValid;
|
|
46892
|
+
this.deleteSpan = deleteSpan;
|
|
46893
|
+
this.getSpan = getSpan;
|
|
46894
|
+
this.getActiveSpan = getActiveSpan;
|
|
46895
|
+
this.getSpanContext = getSpanContext;
|
|
46896
|
+
this.setSpan = setSpan;
|
|
46897
|
+
this.setSpanContext = setSpanContext;
|
|
46898
|
+
}
|
|
46899
|
+
TraceAPI2.getInstance = function() {
|
|
46900
|
+
if (!this._instance) {
|
|
46901
|
+
this._instance = new TraceAPI2();
|
|
46902
|
+
}
|
|
46903
|
+
return this._instance;
|
|
46904
|
+
};
|
|
46905
|
+
TraceAPI2.prototype.setGlobalTracerProvider = function(provider) {
|
|
46906
|
+
var success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance());
|
|
46907
|
+
if (success) {
|
|
46908
|
+
this._proxyTracerProvider.setDelegate(provider);
|
|
46909
|
+
}
|
|
46910
|
+
return success;
|
|
46911
|
+
};
|
|
46912
|
+
TraceAPI2.prototype.getTracerProvider = function() {
|
|
46913
|
+
return getGlobal$1(API_NAME) || this._proxyTracerProvider;
|
|
46914
|
+
};
|
|
46915
|
+
TraceAPI2.prototype.getTracer = function(name, version2) {
|
|
46916
|
+
return this.getTracerProvider().getTracer(name, version2);
|
|
46917
|
+
};
|
|
46918
|
+
TraceAPI2.prototype.disable = function() {
|
|
46919
|
+
unregisterGlobal(API_NAME, DiagAPI.instance());
|
|
46920
|
+
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
46921
|
+
};
|
|
46922
|
+
return TraceAPI2;
|
|
46923
|
+
}()
|
|
46924
|
+
);
|
|
46925
|
+
var trace$1 = TraceAPI.getInstance();
|
|
46926
|
+
function isPromise(obj) {
|
|
46927
|
+
return obj !== null && typeof obj === "object" && typeof obj.then === "function";
|
|
46928
|
+
}
|
|
46929
|
+
const endSpan = (traced, span) => {
|
|
46930
|
+
try {
|
|
46931
|
+
const result = traced();
|
|
46932
|
+
if (isPromise(result)) {
|
|
46933
|
+
return Promise.resolve(result).catch((err) => {
|
|
46934
|
+
setHttpStatusFromError(span, typeof err === "string" ? new Error(err) : err);
|
|
46935
|
+
throw err;
|
|
46936
|
+
}).finally(() => span.end());
|
|
46937
|
+
} else {
|
|
46938
|
+
span.end();
|
|
46939
|
+
return result;
|
|
46940
|
+
}
|
|
46941
|
+
} catch (error) {
|
|
46942
|
+
setHttpStatusFromError(span, error);
|
|
46943
|
+
span.end();
|
|
46944
|
+
throw error;
|
|
46437
46945
|
}
|
|
46946
|
+
};
|
|
46947
|
+
function setHttpStatusFromError(span, error) {
|
|
46948
|
+
span.setAttribute(OBS_TAG_HTTP_STATUS_CODE, 500);
|
|
46949
|
+
span.recordException(error);
|
|
46950
|
+
span.setStatus({ code: SpanStatusCode.ERROR, message: error.message });
|
|
46438
46951
|
}
|
|
46439
|
-
class ISocket {
|
|
46440
|
-
constructor(ws2, requestHandlers, globalMiddlewares, timeouts, logger) {
|
|
46441
|
-
|
|
46442
|
-
this.
|
|
46443
|
-
this.
|
|
46444
|
-
this.
|
|
46445
|
-
|
|
46446
|
-
|
|
46447
|
-
|
|
46448
|
-
this.
|
|
46449
|
-
this.
|
|
46450
|
-
|
|
46451
|
-
|
|
46952
|
+
class TracedSocket extends ISocket {
|
|
46953
|
+
constructor(ws2, requestHandlers, globalMiddlewares, tracer, timeouts, logger) {
|
|
46954
|
+
super(ws2, requestHandlers, globalMiddlewares, timeouts, logger);
|
|
46955
|
+
this.activeSpanByRequestId = /* @__PURE__ */ new Map();
|
|
46956
|
+
this.middlewareSpanByReqId = /* @__PURE__ */ new Map();
|
|
46957
|
+
this.tracer = tracer;
|
|
46958
|
+
}
|
|
46959
|
+
async callHandler(handler, params, ctx, client2, next2) {
|
|
46960
|
+
let currentContext = context$2.active();
|
|
46961
|
+
const middleWareSpan = this.middlewareSpanByReqId.get(ctx.requestId);
|
|
46962
|
+
const activeSpan = this.activeSpanByRequestId.get(ctx.requestId);
|
|
46963
|
+
if (middleWareSpan) {
|
|
46964
|
+
middleWareSpan.end();
|
|
46965
|
+
if (activeSpan) {
|
|
46966
|
+
currentContext = trace$1.setSpan(context$2.active(), activeSpan);
|
|
46967
|
+
}
|
|
46968
|
+
}
|
|
46969
|
+
let result;
|
|
46970
|
+
await context$2.with(currentContext, async () => {
|
|
46971
|
+
await this.tracer.startActiveSpan(`WS HANDLER ${handler.name === "" ? ctx.method : handler.name}`, {
|
|
46972
|
+
attributes: {
|
|
46973
|
+
[SEMATTRS_MESSAGING_SYSTEM]: "ws",
|
|
46974
|
+
[SEMATTRS_MESSAGING_DESTINATION_KIND]: "websocket"
|
|
46975
|
+
},
|
|
46976
|
+
kind: SpanKind.SERVER
|
|
46977
|
+
}, async (span) => {
|
|
46978
|
+
this.middlewareSpanByReqId.set(ctx.requestId, span);
|
|
46979
|
+
result = await endSpan(() => super.callHandler(handler, params, ctx, client2, next2), span);
|
|
46980
|
+
this.middlewareSpanByReqId.delete(ctx.requestId);
|
|
46981
|
+
});
|
|
46452
46982
|
});
|
|
46983
|
+
return result;
|
|
46453
46984
|
}
|
|
46454
46985
|
async handleMessage(message2) {
|
|
46455
|
-
this.resetConnectionTimeout();
|
|
46456
46986
|
if (message2.request) {
|
|
46457
|
-
const
|
|
46458
|
-
|
|
46459
|
-
for (const part of parts) {
|
|
46460
|
-
handlers = handlers[part];
|
|
46461
|
-
if (!handlers) {
|
|
46462
|
-
return this.respondError(message2.request.id, {
|
|
46463
|
-
code: 2,
|
|
46464
|
-
message: `unknown method ${message2.request.method}`
|
|
46465
|
-
});
|
|
46466
|
-
}
|
|
46467
|
-
}
|
|
46468
|
-
if (!Array.isArray(handlers)) {
|
|
46469
|
-
return this.respondError(message2.request.id, {
|
|
46470
|
-
code: 2,
|
|
46471
|
-
message: "unknown method"
|
|
46472
|
-
});
|
|
46473
|
-
}
|
|
46474
|
-
handlers = [...this.globalMiddlewares, ...handlers];
|
|
46475
|
-
if (message2.request.setAuthorization) {
|
|
46476
|
-
this.peerAuthorization = message2.request.setAuthorization;
|
|
46477
|
-
}
|
|
46478
|
-
const reqCtx = {
|
|
46479
|
-
peerAuthorization: this.peerAuthorization,
|
|
46480
|
-
method: message2.request.method,
|
|
46481
|
-
requestId: message2.request.id
|
|
46482
|
-
};
|
|
46483
|
-
const client2 = createISocketClient(this);
|
|
46987
|
+
const spanName = message2.request.method;
|
|
46988
|
+
const requestId = message2.request.id;
|
|
46484
46989
|
const payload = message2.request.payload;
|
|
46485
|
-
|
|
46486
|
-
|
|
46487
|
-
|
|
46488
|
-
|
|
46489
|
-
|
|
46490
|
-
|
|
46491
|
-
|
|
46492
|
-
|
|
46493
|
-
|
|
46494
|
-
|
|
46495
|
-
|
|
46496
|
-
|
|
46497
|
-
|
|
46498
|
-
|
|
46499
|
-
|
|
46500
|
-
|
|
46501
|
-
|
|
46502
|
-
};
|
|
46503
|
-
|
|
46504
|
-
|
|
46505
|
-
|
|
46506
|
-
} catch (error) {
|
|
46507
|
-
const socketError = error instanceof SocketErrorException ? { code: error.code, message: error.message } : { code: 3, message: error.toString() };
|
|
46508
|
-
return this.respondError(message2.request.id, socketError, error);
|
|
46509
|
-
}
|
|
46510
|
-
this.respond(message2.request.id, response);
|
|
46511
|
-
alreadyResponded = true;
|
|
46512
|
-
} else if (message2.response && message2.response.id) {
|
|
46513
|
-
const responseHandler = this.responseHandler.get(message2.response.id);
|
|
46514
|
-
if (!responseHandler) {
|
|
46515
|
-
return;
|
|
46516
|
-
}
|
|
46517
|
-
if (message2.response.error) {
|
|
46518
|
-
responseHandler.reject(message2.response.error);
|
|
46519
|
-
}
|
|
46520
|
-
responseHandler.resolve(message2.response.payload);
|
|
46521
|
-
clearTimeout(responseHandler.timeout);
|
|
46522
|
-
this.responseHandler.delete(message2.response.id);
|
|
46523
|
-
} else {
|
|
46524
|
-
return this.respondError(-1, {
|
|
46525
|
-
code: 3,
|
|
46526
|
-
message: "unknown request id"
|
|
46527
|
-
});
|
|
46990
|
+
await context$2.with(propagation.extract(ROOT_CONTEXT, message2.request), async () => await this.tracer.startActiveSpan(`WS SERVER ${spanName}`, {
|
|
46991
|
+
attributes: {
|
|
46992
|
+
[SEMATTRS_MESSAGING_SYSTEM]: "ws",
|
|
46993
|
+
[SEMATTRS_MESSAGING_DESTINATION_KIND]: "websocket",
|
|
46994
|
+
[OBS_TAG_HTTP_ROUTE]: spanName,
|
|
46995
|
+
[OBS_TAG_APPLICATION_ID]: payload == null ? void 0 : payload["applicationId"],
|
|
46996
|
+
[OBS_TAG_API_ID]: payload == null ? void 0 : payload["apiId"],
|
|
46997
|
+
[OBS_TAG_BRANCH]: (payload == null ? void 0 : payload["branch"]) ?? (payload == null ? void 0 : payload["branchName"]),
|
|
46998
|
+
[OBS_TAG_COMMIT_ID]: payload == null ? void 0 : payload["commitId"]
|
|
46999
|
+
},
|
|
47000
|
+
kind: SpanKind.SERVER
|
|
47001
|
+
}, async (span) => {
|
|
47002
|
+
this.lastActiveSpan = span;
|
|
47003
|
+
this.activeSpanByRequestId.set(requestId, span);
|
|
47004
|
+
const result = await endSpan(() => super.handleMessage(message2), span);
|
|
47005
|
+
this.activeSpanByRequestId.delete(requestId);
|
|
47006
|
+
return result;
|
|
47007
|
+
}));
|
|
47008
|
+
} else if (message2.response) {
|
|
47009
|
+
this.addEvent("ws.received-response", { ["ws.response.id"]: message2.response.id });
|
|
47010
|
+
return await super.handleMessage(message2);
|
|
46528
47011
|
}
|
|
46529
47012
|
}
|
|
46530
|
-
async callHandler(handler, params, ctx, client2, next2) {
|
|
46531
|
-
return handler(params, ctx, client2, next2);
|
|
46532
|
-
}
|
|
46533
47013
|
request(method4, params, authorization) {
|
|
46534
|
-
|
|
46535
|
-
|
|
46536
|
-
|
|
46537
|
-
|
|
46538
|
-
|
|
46539
|
-
|
|
46540
|
-
const toSend = { request: { method: method4, payload: params, id: requestId, setAuthorization: authorization } };
|
|
46541
|
-
propagation.inject(context$2.active(), toSend.request);
|
|
46542
|
-
this.ws.send(JSON.stringify(toSend));
|
|
46543
|
-
this.resetConnectionTimeout();
|
|
46544
|
-
this.resetNoResponseTimeout(requestId);
|
|
46545
|
-
});
|
|
47014
|
+
this.addEvent("ws.send-request", { ["ws.request.method"]: method4, ["ws.request.id"]: this.nxtRequestId });
|
|
47015
|
+
return super.request(method4, params, authorization);
|
|
47016
|
+
}
|
|
47017
|
+
decorateToSend(message2) {
|
|
47018
|
+
propagation.inject(context$2.active(), message2.request);
|
|
47019
|
+
return message2;
|
|
46546
47020
|
}
|
|
46547
47021
|
respond(requestId, result) {
|
|
46548
|
-
|
|
46549
|
-
|
|
46550
|
-
payload: result,
|
|
46551
|
-
id: requestId,
|
|
46552
|
-
error: null
|
|
46553
|
-
}
|
|
46554
|
-
};
|
|
46555
|
-
return this.ws.send(JSON.stringify(toSend));
|
|
47022
|
+
this.addEvent("ws.send-response", { ["ws.response.id"]: requestId });
|
|
47023
|
+
return super.respond(requestId, result);
|
|
46556
47024
|
}
|
|
46557
47025
|
respondError(requestId, error, exception) {
|
|
46558
|
-
|
|
46559
|
-
|
|
46560
|
-
|
|
46561
|
-
|
|
46562
|
-
error
|
|
46563
|
-
}
|
|
46564
|
-
};
|
|
46565
|
-
return this.ws.send(JSON.stringify(toSend));
|
|
46566
|
-
}
|
|
46567
|
-
resetConnectionTimeout() {
|
|
46568
|
-
var _a2, _b2;
|
|
46569
|
-
if (!((_a2 = this.timeouts) == null ? void 0 : _a2.connectionTimeoutInSeconds)) {
|
|
46570
|
-
return;
|
|
47026
|
+
this.addEvent("ws.send-error", { ["ws.response.id"]: requestId });
|
|
47027
|
+
if (this.lastActiveSpan) {
|
|
47028
|
+
setHttpStatusFromError(this.lastActiveSpan, exception ?? new Error(error.message));
|
|
47029
|
+
this.lastActiveSpan.setAttribute(OBS_SOCKET_STATUS_CODE, error.code);
|
|
46571
47030
|
}
|
|
46572
|
-
|
|
46573
|
-
clearTimeout(this.connectionTimeout);
|
|
46574
|
-
}
|
|
46575
|
-
this.connectionTimeout = setTimeout(this.handleConnectionTimeout(), ((_b2 = this.timeouts) == null ? void 0 : _b2.connectionTimeoutInSeconds) * 1e3);
|
|
46576
|
-
}
|
|
46577
|
-
handleConnectionTimeout() {
|
|
46578
|
-
return () => {
|
|
46579
|
-
var _a2;
|
|
46580
|
-
this.logger.error(`Connection timed out after ${(_a2 = this.timeouts) == null ? void 0 : _a2.connectionTimeoutInSeconds} seconds`);
|
|
46581
|
-
this.close();
|
|
46582
|
-
};
|
|
47031
|
+
return super.respondError(requestId, error, exception);
|
|
46583
47032
|
}
|
|
46584
|
-
|
|
46585
|
-
|
|
46586
|
-
|
|
46587
|
-
return;
|
|
47033
|
+
addEvent(eventName, attributes2) {
|
|
47034
|
+
if (this.lastActiveSpan) {
|
|
47035
|
+
this.lastActiveSpan.addEvent(eventName, attributes2, /* @__PURE__ */ new Date());
|
|
46588
47036
|
}
|
|
46589
|
-
const responseHandler = this.responseHandler.get(requestId);
|
|
46590
|
-
if (!responseHandler) {
|
|
46591
|
-
return;
|
|
46592
|
-
}
|
|
46593
|
-
const noResponseTimeout = responseHandler.timeout;
|
|
46594
|
-
const reject = responseHandler.reject;
|
|
46595
|
-
if (responseHandler.timeout) {
|
|
46596
|
-
clearTimeout(noResponseTimeout);
|
|
46597
|
-
}
|
|
46598
|
-
responseHandler.timeout = setTimeout(this.handleNoResponseTimeout(reject), ((_b2 = this.timeouts) == null ? void 0 : _b2.noResponseTimeoutInSeconds) * 1e3);
|
|
46599
|
-
}
|
|
46600
|
-
handleNoResponseTimeout(reject) {
|
|
46601
|
-
return () => {
|
|
46602
|
-
var _a2;
|
|
46603
|
-
const message2 = `Request timed out after ${(_a2 = this.timeouts) == null ? void 0 : _a2.noResponseTimeoutInSeconds} seconds`;
|
|
46604
|
-
this.logger.error(message2);
|
|
46605
|
-
reject({ code: 7, message: message2 });
|
|
46606
|
-
};
|
|
46607
47037
|
}
|
|
46608
47038
|
close() {
|
|
46609
|
-
|
|
46610
|
-
|
|
46611
|
-
clearTimeout(handler.timeout);
|
|
46612
|
-
this.logger.error(`Rejecting pending requestId ${key2} due to connection close`);
|
|
46613
|
-
handler.reject({ code: 8, message: "Connection closed" });
|
|
46614
|
-
});
|
|
46615
|
-
this.ws.close();
|
|
46616
|
-
}
|
|
46617
|
-
}
|
|
46618
|
-
const proxyTarget = Object.freeze(() => {
|
|
46619
|
-
});
|
|
46620
|
-
function createIsocketProxy(socket, path2) {
|
|
46621
|
-
return new Proxy(proxyTarget, {
|
|
46622
|
-
get(_target, prop) {
|
|
46623
|
-
const childPath = path2 ? `${path2}.${prop}` : prop;
|
|
46624
|
-
if (childPath === "then") {
|
|
46625
|
-
return void 0;
|
|
46626
|
-
}
|
|
46627
|
-
return createIsocketProxy(socket, childPath);
|
|
46628
|
-
},
|
|
46629
|
-
apply(_target, _thisArg, args) {
|
|
46630
|
-
if (path2 === void 0) {
|
|
46631
|
-
throw new Error("The root object is not callable");
|
|
46632
|
-
}
|
|
46633
|
-
if (path2.endsWith(".apply") && args.length === 2 && Array.isArray(args[1])) {
|
|
46634
|
-
path2 = path2.slice(0, -".apply".length);
|
|
46635
|
-
args = args[1];
|
|
46636
|
-
}
|
|
46637
|
-
return socket.request(path2, args[0]);
|
|
47039
|
+
for (const span of this.activeSpanByRequestId.values()) {
|
|
47040
|
+
span.end();
|
|
46638
47041
|
}
|
|
46639
|
-
|
|
46640
|
-
|
|
46641
|
-
|
|
46642
|
-
|
|
46643
|
-
close: () => socket.close(),
|
|
46644
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46645
|
-
call: createIsocketProxy(socket, void 0)
|
|
46646
|
-
};
|
|
47042
|
+
this.activeSpanByRequestId = /* @__PURE__ */ new Map();
|
|
47043
|
+
this.lastActiveSpan = void 0;
|
|
47044
|
+
super.close();
|
|
47045
|
+
}
|
|
46647
47046
|
}
|
|
46648
47047
|
var ws$1 = null;
|
|
46649
47048
|
if (typeof WebSocket !== "undefined") {
|
|
@@ -46668,9 +47067,9 @@ function connectWebSocket(wsUrl, protocol) {
|
|
|
46668
47067
|
});
|
|
46669
47068
|
});
|
|
46670
47069
|
}
|
|
46671
|
-
class ISocketWithClientAuth extends
|
|
46672
|
-
constructor(ws2, authorization, requestHandlers, globalMiddlewares, timeouts) {
|
|
46673
|
-
super(ws2, requestHandlers, globalMiddlewares, timeouts);
|
|
47070
|
+
class ISocketWithClientAuth extends TracedSocket {
|
|
47071
|
+
constructor(ws2, authorization, requestHandlers, globalMiddlewares, tracer, timeouts) {
|
|
47072
|
+
super(ws2, requestHandlers, globalMiddlewares, tracer, timeouts);
|
|
46674
47073
|
this.hasSentAuth = false;
|
|
46675
47074
|
this.authorization = authorization;
|
|
46676
47075
|
}
|
|
@@ -47933,12 +48332,11 @@ const TriggerStepType = {
|
|
|
47933
48332
|
SET_PROFILE: "setProfile",
|
|
47934
48333
|
TRIGGER_EVENT: "triggerEvent"
|
|
47935
48334
|
};
|
|
47936
|
-
|
|
47937
|
-
|
|
47938
|
-
|
|
47939
|
-
|
|
47940
|
-
|
|
47941
|
-
})(ThemeMode || (ThemeMode = {}));
|
|
48335
|
+
const ThemeMode = {
|
|
48336
|
+
LIGHT: "LIGHT",
|
|
48337
|
+
DARK: "DARK",
|
|
48338
|
+
AUTO: "AUTO"
|
|
48339
|
+
};
|
|
47942
48340
|
const CUSTOM_THEME_TYPOGRAPHY_KEY = "custom";
|
|
47943
48341
|
({
|
|
47944
48342
|
top: Dim.px(11),
|
|
@@ -48339,12 +48737,23 @@ const noBorder = (theme) => ({
|
|
|
48339
48737
|
style: "solid",
|
|
48340
48738
|
color: theme.colors.neutral100
|
|
48341
48739
|
});
|
|
48740
|
+
const onePixelTransparentBorder = () => ({
|
|
48741
|
+
width: Dim.px(1),
|
|
48742
|
+
style: "solid",
|
|
48743
|
+
color: "transparent"
|
|
48744
|
+
});
|
|
48342
48745
|
const noBorderOject = (theme) => ({
|
|
48343
48746
|
left: noBorder(theme),
|
|
48344
48747
|
right: noBorder(theme),
|
|
48345
48748
|
top: noBorder(theme),
|
|
48346
48749
|
bottom: noBorder(theme)
|
|
48347
48750
|
});
|
|
48751
|
+
const onePixelTransparentBorderObject = () => ({
|
|
48752
|
+
left: onePixelTransparentBorder(),
|
|
48753
|
+
right: onePixelTransparentBorder(),
|
|
48754
|
+
top: onePixelTransparentBorder(),
|
|
48755
|
+
bottom: onePixelTransparentBorder()
|
|
48756
|
+
});
|
|
48348
48757
|
({
|
|
48349
48758
|
topLeft: Dim.px(0),
|
|
48350
48759
|
topRight: Dim.px(0),
|
|
@@ -48363,7 +48772,7 @@ const BASE_THEME_V5 = {
|
|
|
48363
48772
|
mode: ThemeMode.LIGHT,
|
|
48364
48773
|
primaryColor: colors.ACCENT_BLUE_500,
|
|
48365
48774
|
padding: PADDING_PRESETS_BY_THEME_VERSION[5].medium.value,
|
|
48366
|
-
spacing: Dim.px(
|
|
48775
|
+
spacing: Dim.px(12),
|
|
48367
48776
|
palette: {
|
|
48368
48777
|
dark: DEFAULT_DARK_PALETTE,
|
|
48369
48778
|
light: DEFAULT_LIGHT_PALETTE
|
|
@@ -48486,6 +48895,7 @@ const KEY_VALUE_PADDING = {
|
|
|
48486
48895
|
bottom: Dim.px(12)
|
|
48487
48896
|
};
|
|
48488
48897
|
const KEY_VALUE_SPACING = Dim.px(24);
|
|
48898
|
+
const DEFAULT_GRID_ROW_SIZE = 12;
|
|
48489
48899
|
const READABILITY_THRESHOLD = 20;
|
|
48490
48900
|
const CONTRAST_TEXT_THRESHOLD = 25;
|
|
48491
48901
|
const MAX_ITERATIONS = 10;
|
|
@@ -53574,7 +53984,7 @@ var Reaction = /* @__PURE__ */ function() {
|
|
|
53574
53984
|
_proto.toString = function toString22() {
|
|
53575
53985
|
return "Reaction[" + this.name_ + "]";
|
|
53576
53986
|
};
|
|
53577
|
-
_proto.trace = function trace$
|
|
53987
|
+
_proto.trace = function trace$12(enterBreakPoint) {
|
|
53578
53988
|
if (enterBreakPoint === void 0) {
|
|
53579
53989
|
enterBreakPoint = false;
|
|
53580
53990
|
}
|
|
@@ -56881,9 +57291,6 @@ __decorateElement(_init, 1, "setActiveRootInstanceId", _setActiveRootInstanceId_
|
|
|
56881
57291
|
__decorateElement(_init, 1, "setSourceIdElement", _setSourceIdElement_dec, InteractionLayerManager);
|
|
56882
57292
|
__decorateElement(_init, 1, "removeSourceIdElement", _removeSourceIdElement_dec, InteractionLayerManager);
|
|
56883
57293
|
__decoratorMetadata(_init, InteractionLayerManager);
|
|
56884
|
-
const generateId$1 = () => {
|
|
56885
|
-
return Math.random().toString(36).substring(2, 15);
|
|
56886
|
-
};
|
|
56887
57294
|
const CancelApisTrigger = {
|
|
56888
57295
|
type: TriggerStepType.CANCEL_APIS,
|
|
56889
57296
|
async execute(_context, step) {
|
|
@@ -57022,7 +57429,8 @@ const SetComponentPropertyTrigger = {
|
|
|
57022
57429
|
name: context2.name,
|
|
57023
57430
|
func: (state, value2, step2) => {
|
|
57024
57431
|
var _a2;
|
|
57025
|
-
|
|
57432
|
+
if (!state) return;
|
|
57433
|
+
state[(_a2 = step2.widget) == null ? void 0 : _a2.name][step2.propertyName] = value2;
|
|
57026
57434
|
},
|
|
57027
57435
|
args: [value, step]
|
|
57028
57436
|
});
|
|
@@ -57123,7 +57531,8 @@ const RunJsTrigger = {
|
|
|
57123
57531
|
scopeId: context2.scopeId,
|
|
57124
57532
|
name: context2.name,
|
|
57125
57533
|
func: step.handler,
|
|
57126
|
-
args: [context2.additionalContext]
|
|
57534
|
+
args: [context2.additionalContext],
|
|
57535
|
+
excludeState: true
|
|
57127
57536
|
});
|
|
57128
57537
|
}
|
|
57129
57538
|
}
|
|
@@ -75055,7 +75464,7 @@ var dimensionMaxMap = {
|
|
|
75055
75464
|
xxl: "1599.98px"
|
|
75056
75465
|
};
|
|
75057
75466
|
var SiderContext = /* @__PURE__ */ React.createContext({});
|
|
75058
|
-
var generateId = /* @__PURE__ */ function() {
|
|
75467
|
+
var generateId$1 = /* @__PURE__ */ function() {
|
|
75059
75468
|
var i3 = 0;
|
|
75060
75469
|
return function() {
|
|
75061
75470
|
var prefix2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
@@ -75113,7 +75522,7 @@ var Sider = /* @__PURE__ */ React.forwardRef(function(_a2, ref2) {
|
|
|
75113
75522
|
};
|
|
75114
75523
|
}, [breakpoint]);
|
|
75115
75524
|
useEffect(function() {
|
|
75116
|
-
var uniqueId3 = generateId("ant-sider-");
|
|
75525
|
+
var uniqueId3 = generateId$1("ant-sider-");
|
|
75117
75526
|
siderHook.addSider(uniqueId3);
|
|
75118
75527
|
return function() {
|
|
75119
75528
|
return siderHook.removeSider(uniqueId3);
|
|
@@ -89953,7 +90362,10 @@ const SetStateVarTrigger = {
|
|
|
89953
90362
|
context2.rootStore.entityManager.runCode({
|
|
89954
90363
|
scopeId: context2.scopeId,
|
|
89955
90364
|
name: context2.name,
|
|
89956
|
-
func: (state, value2, step2) =>
|
|
90365
|
+
func: (state, value2, step2) => {
|
|
90366
|
+
if (!state) return;
|
|
90367
|
+
state[step2.state.name].value = value2;
|
|
90368
|
+
},
|
|
89957
90369
|
args: [value, step]
|
|
89958
90370
|
});
|
|
89959
90371
|
},
|
|
@@ -94346,6 +94758,9 @@ class Prop {
|
|
|
94346
94758
|
validate: defaultValidator
|
|
94347
94759
|
};
|
|
94348
94760
|
}
|
|
94761
|
+
static unset() {
|
|
94762
|
+
return new Prop("any");
|
|
94763
|
+
}
|
|
94349
94764
|
static string() {
|
|
94350
94765
|
return new Prop("string", VALIDATORS.TEXT);
|
|
94351
94766
|
}
|
|
@@ -95007,6 +95422,7 @@ function createGlobalObject({
|
|
|
95007
95422
|
);
|
|
95008
95423
|
}
|
|
95009
95424
|
const prettyPrintFunction = (func, args) => {
|
|
95425
|
+
if (!func) return "";
|
|
95010
95426
|
const funcStr = func.toString().replace(/\s+/g, " ").trim();
|
|
95011
95427
|
const argsStr = args.map((arg) => {
|
|
95012
95428
|
try {
|
|
@@ -95051,13 +95467,22 @@ class EvalComputeEngine {
|
|
|
95051
95467
|
}
|
|
95052
95468
|
}
|
|
95053
95469
|
class DirectComputeEngine {
|
|
95054
|
-
compute({
|
|
95470
|
+
compute({
|
|
95471
|
+
snapshot,
|
|
95472
|
+
entityName,
|
|
95473
|
+
func,
|
|
95474
|
+
args,
|
|
95475
|
+
path: path2,
|
|
95476
|
+
excludeState
|
|
95477
|
+
}) {
|
|
95478
|
+
if (!func) return void 0;
|
|
95055
95479
|
try {
|
|
95056
|
-
|
|
95057
|
-
|
|
95058
|
-
|
|
95059
|
-
|
|
95060
|
-
|
|
95480
|
+
const entity = snapshot[entityName.value];
|
|
95481
|
+
const funcArgs = args || [];
|
|
95482
|
+
if (excludeState) {
|
|
95483
|
+
return func.call(entity, ...funcArgs);
|
|
95484
|
+
}
|
|
95485
|
+
return func.call(entity, snapshot, ...funcArgs);
|
|
95061
95486
|
} catch (error) {
|
|
95062
95487
|
console.log(`Error in direct(${entityName.value}.${path2})`, {
|
|
95063
95488
|
error,
|
|
@@ -95416,8 +95841,9 @@ const lazyFunctionSymbol = Symbol("lazy-function");
|
|
|
95416
95841
|
const isLazyFunction = (value) => {
|
|
95417
95842
|
return typeof value === "function" && value[lazyFunctionSymbol];
|
|
95418
95843
|
};
|
|
95419
|
-
const LazyFunction = (source2) => {
|
|
95420
|
-
const
|
|
95844
|
+
const LazyFunction = (source2, args = []) => {
|
|
95845
|
+
const argsObj = `{ ${args.join(", ")} }`;
|
|
95846
|
+
const func = new Function(argsObj, source2);
|
|
95421
95847
|
func[lazyFunctionSymbol] = true;
|
|
95422
95848
|
return func;
|
|
95423
95849
|
};
|
|
@@ -95852,6 +96278,93 @@ class EntityManager {
|
|
|
95852
96278
|
delete scope.entityMeta[params.name.value];
|
|
95853
96279
|
(_b2 = (_a2 = this.atoms) == null ? void 0 : _a2[params.scopeId]) == null ? true : delete _b2[params.name.value];
|
|
95854
96280
|
}
|
|
96281
|
+
deleteProperty(params) {
|
|
96282
|
+
var _a2, _b2;
|
|
96283
|
+
const { scopeId, name, prop } = params;
|
|
96284
|
+
if (prop.split(".").includes(RECORD_PATH_IDENTIFIER)) {
|
|
96285
|
+
return;
|
|
96286
|
+
}
|
|
96287
|
+
const scope = this.getScope(scopeId);
|
|
96288
|
+
const entity = scope.getEntity(name);
|
|
96289
|
+
const entityMeta = scope.getEntityMeta(name);
|
|
96290
|
+
if (!entity || !entityMeta) {
|
|
96291
|
+
console.warn(`Entity ${name.value} not found in scope ${scopeId}`);
|
|
96292
|
+
return;
|
|
96293
|
+
}
|
|
96294
|
+
const pathSegments = prop.split(".");
|
|
96295
|
+
const isNested = pathSegments.length > 1;
|
|
96296
|
+
const finalSegment = pathSegments.pop() || "";
|
|
96297
|
+
const parentSegments = isNested ? pathSegments : [];
|
|
96298
|
+
let propParent = entity;
|
|
96299
|
+
let metaParent = entityMeta;
|
|
96300
|
+
if (isNested) {
|
|
96301
|
+
for (const segment of parentSegments) {
|
|
96302
|
+
if (!(segment in propParent) || !(segment in metaParent)) {
|
|
96303
|
+
return;
|
|
96304
|
+
}
|
|
96305
|
+
propParent = propParent[segment];
|
|
96306
|
+
metaParent = metaParent[segment];
|
|
96307
|
+
}
|
|
96308
|
+
}
|
|
96309
|
+
if (finalSegment in propParent) {
|
|
96310
|
+
delete propParent[finalSegment];
|
|
96311
|
+
}
|
|
96312
|
+
if (finalSegment in metaParent) {
|
|
96313
|
+
delete metaParent[finalSegment];
|
|
96314
|
+
}
|
|
96315
|
+
if ((_b2 = (_a2 = this.atoms[scopeId]) == null ? void 0 : _a2[name.value]) == null ? void 0 : _b2[prop]) {
|
|
96316
|
+
delete this.atoms[scopeId][name.value][prop];
|
|
96317
|
+
}
|
|
96318
|
+
}
|
|
96319
|
+
/*
|
|
96320
|
+
This is a helper method to delete obsolete nested properties
|
|
96321
|
+
It handles cases like deleting custom columns on the table
|
|
96322
|
+
*/
|
|
96323
|
+
deleteObsoleteNestedProperties(scopeId, name, currentProps, entity) {
|
|
96324
|
+
for (const [propKey, propValue] of Object.entries(currentProps)) {
|
|
96325
|
+
if (propValue && typeof propValue === "object" && !Array.isArray(propValue)) {
|
|
96326
|
+
const entityPropValue = entity[propKey];
|
|
96327
|
+
if (!entityPropValue || typeof entityPropValue !== "object" || Array.isArray(entityPropValue)) {
|
|
96328
|
+
continue;
|
|
96329
|
+
}
|
|
96330
|
+
const currentKeys = new Set(Object.keys(propValue));
|
|
96331
|
+
const existingKeys = Object.keys(entityPropValue);
|
|
96332
|
+
const keysToDelete = existingKeys.filter(
|
|
96333
|
+
(key2) => !currentKeys.has(key2)
|
|
96334
|
+
);
|
|
96335
|
+
for (const keyToDelete of keysToDelete) {
|
|
96336
|
+
const obsoleteObj = entityPropValue[keyToDelete];
|
|
96337
|
+
if (obsoleteObj && typeof obsoleteObj === "object") {
|
|
96338
|
+
const nestedProps = this.getNestedPropertyPaths(
|
|
96339
|
+
`${propKey}.${keyToDelete}`,
|
|
96340
|
+
obsoleteObj
|
|
96341
|
+
);
|
|
96342
|
+
for (const nestedProp of nestedProps) {
|
|
96343
|
+
this.deleteProperty({ scopeId, name, prop: nestedProp });
|
|
96344
|
+
}
|
|
96345
|
+
}
|
|
96346
|
+
this.deleteProperty({
|
|
96347
|
+
scopeId,
|
|
96348
|
+
name,
|
|
96349
|
+
prop: `${propKey}.${keyToDelete}`
|
|
96350
|
+
});
|
|
96351
|
+
}
|
|
96352
|
+
}
|
|
96353
|
+
}
|
|
96354
|
+
}
|
|
96355
|
+
getNestedPropertyPaths(basePath, obj) {
|
|
96356
|
+
const paths = [];
|
|
96357
|
+
if (obj && typeof obj === "object" && !Array.isArray(obj)) {
|
|
96358
|
+
for (const [key2, value] of Object.entries(obj)) {
|
|
96359
|
+
const currentPath = `${basePath}.${key2}`;
|
|
96360
|
+
paths.push(currentPath);
|
|
96361
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
96362
|
+
paths.push(...this.getNestedPropertyPaths(currentPath, value));
|
|
96363
|
+
}
|
|
96364
|
+
}
|
|
96365
|
+
}
|
|
96366
|
+
return paths;
|
|
96367
|
+
}
|
|
95855
96368
|
deleteEntityById(params) {
|
|
95856
96369
|
const scope = this.getScope(params.scopeId);
|
|
95857
96370
|
const name = scope.getEntityName(params.entityId);
|
|
@@ -95886,6 +96399,7 @@ class EntityManager {
|
|
|
95886
96399
|
if (instanceId) {
|
|
95887
96400
|
scope.idToName[instanceId] = name;
|
|
95888
96401
|
}
|
|
96402
|
+
this.deleteObsoleteNestedProperties(scopeId, name, props, entity);
|
|
95889
96403
|
const managedPropsForType = this.componentRegistry.getManagedProps(type5);
|
|
95890
96404
|
const functionalProps = toExecutablesOrValues(props, managedPropsForType);
|
|
95891
96405
|
const addedProperties = /* @__PURE__ */ new Set();
|
|
@@ -95932,14 +96446,15 @@ class EntityManager {
|
|
|
95932
96446
|
scope.setEntityName(instanceId, newName, existingName);
|
|
95933
96447
|
}
|
|
95934
96448
|
runCode(params) {
|
|
95935
|
-
const { scopeId, name, func, args } = params;
|
|
96449
|
+
const { scopeId, name, func, args, excludeState } = params;
|
|
95936
96450
|
const state = this.getState(scopeId);
|
|
95937
96451
|
const computeEngine = this.dirComputeEngine;
|
|
95938
96452
|
computeEngine.compute({
|
|
95939
96453
|
snapshot: state,
|
|
95940
96454
|
entityName: name,
|
|
95941
96455
|
func,
|
|
95942
|
-
args
|
|
96456
|
+
args,
|
|
96457
|
+
excludeState
|
|
95943
96458
|
});
|
|
95944
96459
|
}
|
|
95945
96460
|
computeValue(params) {
|
|
@@ -97391,6 +97906,9 @@ const rootStore$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
97391
97906
|
__proto__: null,
|
|
97392
97907
|
default: rootStore
|
|
97393
97908
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
97909
|
+
const generateId = () => {
|
|
97910
|
+
return Math.random().toString(36).substring(2, 15);
|
|
97911
|
+
};
|
|
97394
97912
|
class OperationAPI {
|
|
97395
97913
|
constructor(serverUrl) {
|
|
97396
97914
|
__publicField(this, "socket");
|
|
@@ -97438,6 +97956,10 @@ class OperationAPI {
|
|
|
97438
97956
|
var _a2;
|
|
97439
97957
|
return (_a2 = this.socket) == null ? void 0 : _a2.call.editor.deleteEntity(payload);
|
|
97440
97958
|
});
|
|
97959
|
+
__publicField(this, "editorRenameElement", async (payload) => {
|
|
97960
|
+
var _a2;
|
|
97961
|
+
return (_a2 = this.socket) == null ? void 0 : _a2.call.editor.renameElement(payload);
|
|
97962
|
+
});
|
|
97441
97963
|
__publicField(this, "editorUpdateTheme", async (payload) => {
|
|
97442
97964
|
var _a2;
|
|
97443
97965
|
return (_a2 = this.socket) == null ? void 0 : _a2.call.editor.updateTheme(payload);
|
|
@@ -97570,6 +98092,7 @@ async function connectSocket(serverUrl, peerId, userId) {
|
|
|
97570
98092
|
]
|
|
97571
98093
|
},
|
|
97572
98094
|
[],
|
|
98095
|
+
trace$1.getTracer("superblocks-ui-framework"),
|
|
97573
98096
|
{
|
|
97574
98097
|
connectionTimeoutInSeconds: 6 * 60,
|
|
97575
98098
|
noResponseTimeoutInSeconds: 5 * 60
|
|
@@ -97584,7 +98107,7 @@ async function connectSocket(serverUrl, peerId, userId) {
|
|
|
97584
98107
|
return void 0;
|
|
97585
98108
|
}
|
|
97586
98109
|
}
|
|
97587
|
-
_executeOrAddToBatch_dec = [action], _addPendingTransaction_dec = [action], _clearPendingTransactions_dec = [action], _batchUpdate_dec = [action], _createComponent_dec = [action], _dropComponent_dec = [action], _deleteComponents_dec = [action], _writeRuntimeProperties_dec = [action], _setWidgetProperties_dec = [action], _setWidgetProperty_dec = [action];
|
|
98110
|
+
_executeOrAddToBatch_dec = [action], _addPendingTransaction_dec = [action], _clearPendingTransactions_dec = [action], _batchUpdate_dec = [action], _createComponent_dec = [action], _dropComponent_dec = [action], _deleteComponents_dec = [action], _writeRuntimeProperties_dec = [action], _setWidgetProperties_dec = [action], _setWidgetProperty_dec = [action], _renameWidget_dec = [action];
|
|
97588
98111
|
class OperationManager {
|
|
97589
98112
|
constructor() {
|
|
97590
98113
|
__runInitializers(_init3, 5, this);
|
|
@@ -97623,7 +98146,7 @@ class OperationManager {
|
|
|
97623
98146
|
return [];
|
|
97624
98147
|
}
|
|
97625
98148
|
executeOrAddToBatch(operation) {
|
|
97626
|
-
const transactionId = this.batchOperationTransactionId ?? generateId
|
|
98149
|
+
const transactionId = this.batchOperationTransactionId ?? generateId();
|
|
97627
98150
|
const payload = this.waitingForBatch ? operation.payload : {
|
|
97628
98151
|
...operation.payload,
|
|
97629
98152
|
transaction: {
|
|
@@ -97697,7 +98220,7 @@ class OperationManager {
|
|
|
97697
98220
|
}
|
|
97698
98221
|
batchUpdate(performOperations) {
|
|
97699
98222
|
this.waitingForBatch = true;
|
|
97700
|
-
this.batchOperationTransactionId = generateId
|
|
98223
|
+
this.batchOperationTransactionId = generateId();
|
|
97701
98224
|
performOperations();
|
|
97702
98225
|
editorBridge.editOpRequest("editor:batchUpdate", {
|
|
97703
98226
|
updates: this.batchOperations.map(
|
|
@@ -97856,6 +98379,27 @@ class OperationManager {
|
|
|
97856
98379
|
setWidgetProperty(sourceId, property, value, callback) {
|
|
97857
98380
|
this.setWidgetProperties(sourceId, { [property]: value }, callback);
|
|
97858
98381
|
}
|
|
98382
|
+
renameWidget(params) {
|
|
98383
|
+
var _a2;
|
|
98384
|
+
const widgetMeta = getEditStore().runtimeEntitiesManager.getAnyEditorWidgetMeta(
|
|
98385
|
+
params.sourceId
|
|
98386
|
+
);
|
|
98387
|
+
const oldName = ((_a2 = widgetMeta == null ? void 0 : widgetMeta.name) == null ? void 0 : _a2.value) ?? "";
|
|
98388
|
+
const kind = (widgetMeta == null ? void 0 : widgetMeta.type) === "SbPage" ? "page" : "component";
|
|
98389
|
+
const scopeName = (widgetMeta == null ? void 0 : widgetMeta.scopeId) ? rootStore.entityManager.getScopeName(widgetMeta.scopeId) : void 0;
|
|
98390
|
+
if (!scopeName) {
|
|
98391
|
+
console.error("No scope name found for widget", params.sourceId);
|
|
98392
|
+
return;
|
|
98393
|
+
}
|
|
98394
|
+
const renameRequest = {
|
|
98395
|
+
elementId: params.sourceId,
|
|
98396
|
+
newName: params.newName,
|
|
98397
|
+
oldName,
|
|
98398
|
+
kind,
|
|
98399
|
+
scopeName
|
|
98400
|
+
};
|
|
98401
|
+
editorBridge.editOpRequest("editor:renameElement", renameRequest);
|
|
98402
|
+
}
|
|
97859
98403
|
async ensureFilesSynced() {
|
|
97860
98404
|
await sourceUpdateApi.ensureFilesSynced();
|
|
97861
98405
|
}
|
|
@@ -97874,6 +98418,7 @@ __decorateElement(_init3, 1, "deleteComponents", _deleteComponents_dec, Operatio
|
|
|
97874
98418
|
__decorateElement(_init3, 1, "writeRuntimeProperties", _writeRuntimeProperties_dec, OperationManager);
|
|
97875
98419
|
__decorateElement(_init3, 1, "setWidgetProperties", _setWidgetProperties_dec, OperationManager);
|
|
97876
98420
|
__decorateElement(_init3, 1, "setWidgetProperty", _setWidgetProperty_dec, OperationManager);
|
|
98421
|
+
__decorateElement(_init3, 1, "renameWidget", _renameWidget_dec, OperationManager);
|
|
97877
98422
|
__decoratorMetadata(_init3, OperationManager);
|
|
97878
98423
|
class PropertiesPanelManager {
|
|
97879
98424
|
constructor(runtimeEntitiesManager, entityManager) {
|
|
@@ -98082,7 +98627,7 @@ function getPropertyValue$1({
|
|
|
98082
98627
|
}
|
|
98083
98628
|
const getNormalizedIdInfo = (params) => {
|
|
98084
98629
|
var _a2, _b2;
|
|
98085
|
-
const name = (
|
|
98630
|
+
const name = (_a2 = params.bind) == null ? void 0 : _a2.entityName;
|
|
98086
98631
|
const scopeId = ((_b2 = params.bind) == null ? void 0 : _b2.scopeId) ?? params.fallbackScopeId;
|
|
98087
98632
|
return {
|
|
98088
98633
|
name,
|
|
@@ -98145,7 +98690,6 @@ class RuntimeWidgetsManager {
|
|
|
98145
98690
|
const childSourceId = child.props[WIDGET_SOURCE_ID_ATTRIBUTE];
|
|
98146
98691
|
const { name: childName, scopeId: childScopeId } = getNormalizedIdInfo({
|
|
98147
98692
|
bind: getBindingIdentifier(child.props.bind),
|
|
98148
|
-
propsName: child.props.name,
|
|
98149
98693
|
fallbackScopeId
|
|
98150
98694
|
});
|
|
98151
98695
|
const childIdentifier = this.nameManager.registerAndGetIdentifiers({
|
|
@@ -98733,18 +99277,33 @@ const filterSafeStackDimensionProperties = (existingProps) => {
|
|
|
98733
99277
|
};
|
|
98734
99278
|
const filterSafeGridDimensionProperties = (existingProps) => {
|
|
98735
99279
|
const { width, height } = existingProps;
|
|
98736
|
-
|
|
98737
|
-
let safeWidth;
|
|
99280
|
+
const safeDimensions = {};
|
|
98738
99281
|
if ((height == null ? void 0 : height.mode) === "rows" || (height == null ? void 0 : height.mode) === "fit") {
|
|
98739
|
-
|
|
99282
|
+
safeDimensions.height = Property.Dimension(height);
|
|
98740
99283
|
}
|
|
98741
99284
|
if ((width == null ? void 0 : width.mode) === "columns") {
|
|
98742
|
-
|
|
99285
|
+
safeDimensions.width = Property.Dimension(width);
|
|
98743
99286
|
}
|
|
98744
|
-
return
|
|
98745
|
-
|
|
98746
|
-
|
|
98747
|
-
|
|
99287
|
+
return safeDimensions;
|
|
99288
|
+
};
|
|
99289
|
+
const defaultSizeForComponent = (componentType, isFreeform, activeRectGUWidth) => {
|
|
99290
|
+
const height = Property.Dimension(Dim.fit());
|
|
99291
|
+
if (isFreeform) {
|
|
99292
|
+
return {
|
|
99293
|
+
height,
|
|
99294
|
+
width: Property.Dimension(Dim.col(activeRectGUWidth ?? 4))
|
|
99295
|
+
};
|
|
99296
|
+
}
|
|
99297
|
+
const componentsWithFitWidth = [
|
|
99298
|
+
"SbText",
|
|
99299
|
+
"SbButton",
|
|
99300
|
+
"SbCheckbox",
|
|
99301
|
+
"SbSwitch"
|
|
99302
|
+
];
|
|
99303
|
+
if (componentsWithFitWidth.includes(componentType)) {
|
|
99304
|
+
return { height, width: Property.Dimension(Dim.fit()) };
|
|
99305
|
+
}
|
|
99306
|
+
return { height, width: Property.Dimension(Dim.fill()) };
|
|
98748
99307
|
};
|
|
98749
99308
|
const isWidgetGrid = (widget) => {
|
|
98750
99309
|
var _a2;
|
|
@@ -98892,7 +99451,7 @@ class GridManager {
|
|
|
98892
99451
|
};
|
|
98893
99452
|
}
|
|
98894
99453
|
get lazyTargetGridInfo() {
|
|
98895
|
-
var _a2, _b2;
|
|
99454
|
+
var _a2, _b2, _c2;
|
|
98896
99455
|
const targetRect = this.dnd.activeTargetRect;
|
|
98897
99456
|
const dropTargetId = this.dnd.dropTargetId;
|
|
98898
99457
|
if (!targetRect || !dropTargetId) {
|
|
@@ -98913,7 +99472,7 @@ class GridManager {
|
|
|
98913
99472
|
const targetPadding = entityValues == null ? void 0 : entityValues.padding;
|
|
98914
99473
|
const xPadding = (((_a2 = targetPadding == null ? void 0 : targetPadding.left) == null ? void 0 : _a2.value) ?? 0) + (((_b2 = targetPadding == null ? void 0 : targetPadding.right) == null ? void 0 : _b2.value) ?? 0);
|
|
98915
99474
|
const tileWidth = (targetRect.width - xPadding) / targetColumns;
|
|
98916
|
-
const tileHeight = (entityValues == null ? void 0 : entityValues.
|
|
99475
|
+
const tileHeight = ((_c2 = entityValues == null ? void 0 : entityValues.rowHeight) == null ? void 0 : _c2.value) ?? 12;
|
|
98917
99476
|
const targetHeightGU = Math.ceil(targetRect.height / tileHeight);
|
|
98918
99477
|
return {
|
|
98919
99478
|
targetColumns,
|
|
@@ -109560,11 +110119,10 @@ const DuplicatedNamePopover = observer(({ name, children, showWarning, sourceId
|
|
|
109560
110119
|
(evt) => {
|
|
109561
110120
|
evt.preventDefault();
|
|
109562
110121
|
evt.stopPropagation();
|
|
109563
|
-
getEditStore().operationManager.
|
|
110122
|
+
getEditStore().operationManager.renameWidget({
|
|
109564
110123
|
sourceId,
|
|
109565
|
-
|
|
109566
|
-
|
|
109567
|
-
);
|
|
110124
|
+
newName
|
|
110125
|
+
});
|
|
109568
110126
|
},
|
|
109569
110127
|
[newName, sourceId]
|
|
109570
110128
|
);
|
|
@@ -110251,6 +110809,17 @@ const Theme = createEntityProxy("Theme");
|
|
|
110251
110809
|
const Global = createEntityProxy("Global");
|
|
110252
110810
|
const Embed = createEntityProxy("Embed");
|
|
110253
110811
|
const Env = createEntityProxy("Env");
|
|
110812
|
+
const getPreviousAndCurrentWidgetProps = (updates, widgetMeta) => {
|
|
110813
|
+
const previousProps = widgetMeta.props;
|
|
110814
|
+
const newProps = Object.entries(updates).reduce(
|
|
110815
|
+
(acc, [key2, value]) => {
|
|
110816
|
+
acc[key2] = value.value;
|
|
110817
|
+
return acc;
|
|
110818
|
+
},
|
|
110819
|
+
{ ...previousProps }
|
|
110820
|
+
);
|
|
110821
|
+
return [previousProps, newProps];
|
|
110822
|
+
};
|
|
110254
110823
|
const getSizeProp = ({
|
|
110255
110824
|
label,
|
|
110256
110825
|
controlType,
|
|
@@ -110377,6 +110946,9 @@ const spacing = (options) => {
|
|
|
110377
110946
|
}
|
|
110378
110947
|
return themeValue ?? Theme.spacing;
|
|
110379
110948
|
},
|
|
110949
|
+
isVisible: function() {
|
|
110950
|
+
return this.layout !== "freeform";
|
|
110951
|
+
},
|
|
110380
110952
|
...rest
|
|
110381
110953
|
});
|
|
110382
110954
|
if (defaultSpacing || themeValue) {
|
|
@@ -110519,7 +111091,7 @@ const getAlignmentProps = () => {
|
|
|
110519
111091
|
})
|
|
110520
111092
|
};
|
|
110521
111093
|
};
|
|
110522
|
-
const containerLayout = () => Prop.union({
|
|
111094
|
+
const containerLayout = (sizeProps) => Prop.union({
|
|
110523
111095
|
shared: {
|
|
110524
111096
|
layout: Prop.string().readAndWrite().default("vertical").propertiesPanel({
|
|
110525
111097
|
label: "Layout",
|
|
@@ -110544,35 +111116,58 @@ const containerLayout = () => Prop.union({
|
|
|
110544
111116
|
tooltip: "Horizontal"
|
|
110545
111117
|
}
|
|
110546
111118
|
]
|
|
111119
|
+
}).onEdit(({ sourceId, updates, widgetMeta }) => {
|
|
111120
|
+
var _a2, _b2, _c2, _d2;
|
|
111121
|
+
const [previousProps, newProps] = getPreviousAndCurrentWidgetProps(updates, widgetMeta);
|
|
111122
|
+
const baseUpdate = {
|
|
111123
|
+
[sourceId]: {
|
|
111124
|
+
props: updates,
|
|
111125
|
+
meta: {}
|
|
111126
|
+
}
|
|
111127
|
+
};
|
|
111128
|
+
if (previousProps.layout !== "freeform" && newProps.layout === "freeform" && ((_a2 = newProps.width) == null ? void 0 : _a2.mode) === "fit") {
|
|
111129
|
+
const editStore2 = rootStore.editStore;
|
|
111130
|
+
if (!editStore2) {
|
|
111131
|
+
return baseUpdate;
|
|
111132
|
+
}
|
|
111133
|
+
const runtimeWidgetRect = (_d2 = (_c2 = (_b2 = editStore2.interactionLayerManager.getSourceIdElements(sourceId)) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.firstElementChild) == null ? void 0 : _d2.getBoundingClientRect();
|
|
111134
|
+
const pixelWidth = runtimeWidgetRect == null ? void 0 : runtimeWidgetRect.width;
|
|
111135
|
+
baseUpdate[sourceId].props = {
|
|
111136
|
+
...updates,
|
|
111137
|
+
// fit-contenet width does not make sense grid component
|
|
111138
|
+
width: pixelWidth ? Property.Dimension(Dim.px(pixelWidth)) : Property.Static(Dim.fill())
|
|
111139
|
+
};
|
|
111140
|
+
}
|
|
111141
|
+
return baseUpdate;
|
|
110547
111142
|
})
|
|
110548
111143
|
},
|
|
110549
111144
|
variants: [
|
|
110550
|
-
{
|
|
110551
|
-
layout: Prop.literal("freeform"),
|
|
110552
|
-
columns: Prop.number().readAndWrite().propertiesPanel({
|
|
110553
|
-
label: "Columns",
|
|
110554
|
-
placeholder: "Enter columns"
|
|
110555
|
-
}).default(48),
|
|
110556
|
-
rows: Prop.number().readAndWrite().propertiesPanel({
|
|
110557
|
-
label: "Rows",
|
|
110558
|
-
placeholder: "Enter rows",
|
|
110559
|
-
visibility: "SHOW_NAME",
|
|
110560
|
-
defaultOnAdd: 12
|
|
110561
|
-
}),
|
|
110562
|
-
rowSize: Prop.number().readAndWrite().propertiesPanel({
|
|
110563
|
-
label: "Row size",
|
|
110564
|
-
placeholder: "Enter row size",
|
|
110565
|
-
visibility: "SHOW_NAME",
|
|
110566
|
-
defaultOnAdd: 12
|
|
110567
|
-
})
|
|
110568
|
-
},
|
|
110569
111145
|
{
|
|
110570
111146
|
layout: Prop.literal("vertical"),
|
|
110571
|
-
...getAlignmentProps()
|
|
111147
|
+
...getAlignmentProps(),
|
|
111148
|
+
...sizeProps
|
|
110572
111149
|
},
|
|
110573
111150
|
{
|
|
110574
111151
|
layout: Prop.literal("horizontal"),
|
|
110575
|
-
...getAlignmentProps()
|
|
111152
|
+
...getAlignmentProps(),
|
|
111153
|
+
...sizeProps
|
|
111154
|
+
},
|
|
111155
|
+
{
|
|
111156
|
+
layout: Prop.literal("freeform"),
|
|
111157
|
+
// put sizing props before the columns and rowHeight. Due to limit of Union, we need to put freefrom variant last because sizing props are merged with other variants, the last one will decide sizing props position
|
|
111158
|
+
...sizeProps,
|
|
111159
|
+
columns: Prop.number().readAndWrite().propertiesPanel({
|
|
111160
|
+
label: "Columns",
|
|
111161
|
+
placeholder: "Enter columns",
|
|
111162
|
+
helpText: "The total number of columns used to subdivide the grid horizontally. Each child component’s width will be defined relative to this total"
|
|
111163
|
+
}).default(12),
|
|
111164
|
+
rowHeight: Prop.dimension().readAndWrite().propertiesPanel({
|
|
111165
|
+
label: "Row height",
|
|
111166
|
+
placeholder: "row height in pixels",
|
|
111167
|
+
controlType: "DIMENSION_VALUE_CONTROL",
|
|
111168
|
+
dimensionUnit: "px",
|
|
111169
|
+
helpText: "The pixel height of each row in the grid. Child components can span multiple rows to maintain consistent vertical alignment"
|
|
111170
|
+
}).default(DEFAULT_GRID_ROW_SIZE)
|
|
110576
111171
|
}
|
|
110577
111172
|
]
|
|
110578
111173
|
});
|
|
@@ -114231,6 +114826,8 @@ const useWidgetNodeRef = (instanceId) => {
|
|
|
114231
114826
|
return nodeRef;
|
|
114232
114827
|
};
|
|
114233
114828
|
const DraggableWidget = observer(function DraggableWidget2(props) {
|
|
114829
|
+
const editStore2 = getEditStore();
|
|
114830
|
+
const disableDrag = !editStore2.ui.dnd.canDragWidget(props.instanceId) || editStore2.ui.dnd.isDraggingNewComponent;
|
|
114234
114831
|
const {
|
|
114235
114832
|
setNodeRef: setDraggableNodeRef,
|
|
114236
114833
|
isDragging,
|
|
@@ -114238,7 +114835,7 @@ const DraggableWidget = observer(function DraggableWidget2(props) {
|
|
|
114238
114835
|
attributes: attributes2
|
|
114239
114836
|
} = useComponentDraggable({
|
|
114240
114837
|
instanceId: props.instanceId,
|
|
114241
|
-
disableDrag:
|
|
114838
|
+
disableDrag: disableDrag ?? false
|
|
114242
114839
|
});
|
|
114243
114840
|
const widgetNode = useWidgetNodeRef(props.instanceId);
|
|
114244
114841
|
useEffect(() => {
|
|
@@ -114253,6 +114850,20 @@ const DraggableWidget = observer(function DraggableWidget2(props) {
|
|
|
114253
114850
|
...attributes2,
|
|
114254
114851
|
className: "sb-draggable-wrapper",
|
|
114255
114852
|
"data-is-dragged": isDragging,
|
|
114853
|
+
onPointerDown: (e3) => {
|
|
114854
|
+
if (!disableDrag) {
|
|
114855
|
+
listeners == null ? void 0 : listeners.onPointerDown(e3);
|
|
114856
|
+
} else {
|
|
114857
|
+
e3.stopPropagation();
|
|
114858
|
+
}
|
|
114859
|
+
},
|
|
114860
|
+
onPointerMove: (e3) => {
|
|
114861
|
+
if (!disableDrag) {
|
|
114862
|
+
listeners == null ? void 0 : listeners.onPointerMove(e3);
|
|
114863
|
+
} else {
|
|
114864
|
+
e3.stopPropagation();
|
|
114865
|
+
}
|
|
114866
|
+
},
|
|
114256
114867
|
children: props.children
|
|
114257
114868
|
}
|
|
114258
114869
|
);
|
|
@@ -114608,6 +115219,178 @@ var KeyValuePropertyType = /* @__PURE__ */ ((KeyValuePropertyType2) => {
|
|
|
114608
115219
|
KeyValuePropertyType2["EMAIL"] = "email";
|
|
114609
115220
|
return KeyValuePropertyType2;
|
|
114610
115221
|
})(KeyValuePropertyType || {});
|
|
115222
|
+
const DEFAULT_TABLE_DATA = [
|
|
115223
|
+
{
|
|
115224
|
+
photo: "https://cdn.superblocks.com/sample-data/rachel_kim",
|
|
115225
|
+
name: "Rachel Kim",
|
|
115226
|
+
email: "rachel.kim89@gmail.com",
|
|
115227
|
+
role: "Vendor Partner",
|
|
115228
|
+
company: "Urban Threads Co.",
|
|
115229
|
+
status: "Active",
|
|
115230
|
+
date_joined: "2023-04-12",
|
|
115231
|
+
last_activity: "2025-06-07T16:20:00Z"
|
|
115232
|
+
},
|
|
115233
|
+
{
|
|
115234
|
+
photo: "https://cdn.superblocks.com/sample-data/daniel_vargas",
|
|
115235
|
+
name: "Daniel Vargas",
|
|
115236
|
+
email: "dvargas1984@yahoo.com",
|
|
115237
|
+
role: "Logistics Contact",
|
|
115238
|
+
company: "Vargas Freight Ltd.",
|
|
115239
|
+
status: "Pending",
|
|
115240
|
+
date_joined: "2024-01-23",
|
|
115241
|
+
last_activity: "2025-05-30T13:45:00Z"
|
|
115242
|
+
},
|
|
115243
|
+
{
|
|
115244
|
+
photo: "https://cdn.superblocks.com/sample-data/sophie_liu",
|
|
115245
|
+
name: "Sophie Liu",
|
|
115246
|
+
email: "sophie.liu.personal@gmail.com",
|
|
115247
|
+
role: "Retail Manager",
|
|
115248
|
+
company: "Modern Goods",
|
|
115249
|
+
status: "Active",
|
|
115250
|
+
date_joined: "2022-09-10",
|
|
115251
|
+
last_activity: "2025-06-08T09:03:00Z"
|
|
115252
|
+
},
|
|
115253
|
+
{
|
|
115254
|
+
photo: "https://cdn.superblocks.com/sample-data/omar_el-sayed",
|
|
115255
|
+
name: "Omar El-Sayed",
|
|
115256
|
+
email: "omarsayed78@hotmail.com",
|
|
115257
|
+
role: "Accounts Payable",
|
|
115258
|
+
company: "Sayed Textiles",
|
|
115259
|
+
status: "Inactive",
|
|
115260
|
+
date_joined: "2021-06-05",
|
|
115261
|
+
last_activity: "2024-12-18T11:40:00Z"
|
|
115262
|
+
},
|
|
115263
|
+
{
|
|
115264
|
+
photo: "https://cdn.superblocks.com/sample-data/grace_nguyen",
|
|
115265
|
+
name: "Grace Nguyen",
|
|
115266
|
+
email: "gracenguyen23@icloud.com",
|
|
115267
|
+
role: "Product Supplier",
|
|
115268
|
+
company: "Green Earth Supplies",
|
|
115269
|
+
status: "Active",
|
|
115270
|
+
date_joined: "2023-11-03",
|
|
115271
|
+
last_activity: "2025-06-08T17:28:00Z"
|
|
115272
|
+
},
|
|
115273
|
+
{
|
|
115274
|
+
photo: "https://cdn.superblocks.com/sample-data/alex_romero",
|
|
115275
|
+
name: "Alex Romero",
|
|
115276
|
+
email: "alex.romero@gmail.com",
|
|
115277
|
+
role: "Client Account Owner",
|
|
115278
|
+
company: "Romero & Co.",
|
|
115279
|
+
status: "Suspended",
|
|
115280
|
+
date_joined: "2022-02-28",
|
|
115281
|
+
last_activity: "2025-03-11T08:20:00Z"
|
|
115282
|
+
},
|
|
115283
|
+
{
|
|
115284
|
+
photo: "https://cdn.superblocks.com/sample-data/lena_schmidt",
|
|
115285
|
+
name: "Lena Schmidt",
|
|
115286
|
+
email: "lena_schmidt92@gmx.de",
|
|
115287
|
+
role: "Wholesale Contact",
|
|
115288
|
+
company: "Schmidt Imports",
|
|
115289
|
+
status: "Active",
|
|
115290
|
+
date_joined: "2021-12-01",
|
|
115291
|
+
last_activity: "2025-06-06T21:10:00Z"
|
|
115292
|
+
},
|
|
115293
|
+
{
|
|
115294
|
+
photo: "https://cdn.superblocks.com/sample-data/devon_price",
|
|
115295
|
+
name: "Devon Price",
|
|
115296
|
+
email: "devon.price22@aol.com",
|
|
115297
|
+
role: "Fulfillment Liaison",
|
|
115298
|
+
company: "DepotLink",
|
|
115299
|
+
status: "Active",
|
|
115300
|
+
date_joined: "2024-05-17",
|
|
115301
|
+
last_activity: "2025-06-08T10:42:00Z"
|
|
115302
|
+
},
|
|
115303
|
+
{
|
|
115304
|
+
photo: "https://cdn.superblocks.com/sample-data/isabella_rossi",
|
|
115305
|
+
name: "Isabella Rossi",
|
|
115306
|
+
email: "bella.rossi@gmail.com",
|
|
115307
|
+
role: "Procurement Agent",
|
|
115308
|
+
company: "Rossi Global Sourcing",
|
|
115309
|
+
status: "Pending",
|
|
115310
|
+
date_joined: "2023-07-19",
|
|
115311
|
+
last_activity: "2025-05-29T14:05:00Z"
|
|
115312
|
+
},
|
|
115313
|
+
{
|
|
115314
|
+
photo: "https://cdn.superblocks.com/sample-data/tariq_khan",
|
|
115315
|
+
name: "Tariq Khan",
|
|
115316
|
+
email: "tariq.khan92@protonmail.com",
|
|
115317
|
+
role: "International Ops Lead",
|
|
115318
|
+
company: "CrossPort Trade Inc.",
|
|
115319
|
+
status: "Active",
|
|
115320
|
+
date_joined: "2022-11-08",
|
|
115321
|
+
last_activity: "2025-06-08T16:11:00Z"
|
|
115322
|
+
},
|
|
115323
|
+
{
|
|
115324
|
+
photo: "https://cdn.superblocks.com/sample-data/emily_zhang",
|
|
115325
|
+
name: "Emily Zhang",
|
|
115326
|
+
email: "emilyzhang.home@gmail.com",
|
|
115327
|
+
role: "Logistics Coordinator",
|
|
115328
|
+
company: "Zhang Export Ltd.",
|
|
115329
|
+
status: "Active",
|
|
115330
|
+
date_joined: "2023-03-12",
|
|
115331
|
+
last_activity: "2025-06-08T19:02:00Z"
|
|
115332
|
+
}
|
|
115333
|
+
];
|
|
115334
|
+
const DEFAULT_TABLE_COLUMNS = {
|
|
115335
|
+
name: {
|
|
115336
|
+
columnType: "text",
|
|
115337
|
+
label: "Name"
|
|
115338
|
+
},
|
|
115339
|
+
email: {
|
|
115340
|
+
columnType: "email",
|
|
115341
|
+
label: "Email"
|
|
115342
|
+
},
|
|
115343
|
+
role: {
|
|
115344
|
+
columnType: "text",
|
|
115345
|
+
label: "Role"
|
|
115346
|
+
},
|
|
115347
|
+
company: {
|
|
115348
|
+
columnType: "text",
|
|
115349
|
+
label: "Company"
|
|
115350
|
+
},
|
|
115351
|
+
status: {
|
|
115352
|
+
columnType: "tags",
|
|
115353
|
+
tagDisplayConfig: {
|
|
115354
|
+
Active: {
|
|
115355
|
+
color: "#14CDB733"
|
|
115356
|
+
},
|
|
115357
|
+
Pending: {
|
|
115358
|
+
color: "#FF9F3533"
|
|
115359
|
+
},
|
|
115360
|
+
Inactive: {
|
|
115361
|
+
color: "#a6a0a033"
|
|
115362
|
+
},
|
|
115363
|
+
Suspended: {
|
|
115364
|
+
color: "#FF62A433"
|
|
115365
|
+
}
|
|
115366
|
+
},
|
|
115367
|
+
label: "Status"
|
|
115368
|
+
},
|
|
115369
|
+
date_joined: {
|
|
115370
|
+
columnType: "date",
|
|
115371
|
+
inputFormat: "YYYY-MM-DD",
|
|
115372
|
+
outputFormat: "MM-DD-YYYY",
|
|
115373
|
+
label: "Date joined"
|
|
115374
|
+
},
|
|
115375
|
+
last_activity: {
|
|
115376
|
+
columnType: "date",
|
|
115377
|
+
inputFormat: "YYYY-MM-DDTHH:mm:ssZ",
|
|
115378
|
+
outputFormat: "MM-DD-YYYY",
|
|
115379
|
+
label: "Last activity"
|
|
115380
|
+
},
|
|
115381
|
+
photo: {
|
|
115382
|
+
columnType: "image",
|
|
115383
|
+
label: "Photo"
|
|
115384
|
+
}
|
|
115385
|
+
};
|
|
115386
|
+
const DEFAULT_TABLE_KEYS = Object.keys(DEFAULT_TABLE_COLUMNS);
|
|
115387
|
+
const CLEARED_TABLE_COLUMNS = DEFAULT_TABLE_KEYS.reduce(
|
|
115388
|
+
(acc, key2) => {
|
|
115389
|
+
acc[key2] = void 0;
|
|
115390
|
+
return acc;
|
|
115391
|
+
},
|
|
115392
|
+
{}
|
|
115393
|
+
);
|
|
114611
115394
|
function getParentInfo(parent) {
|
|
114612
115395
|
const parentComponentMeta = getEditStore().runtimeEntitiesManager.getAnyEditorWidgetMeta(parent.id);
|
|
114613
115396
|
const isParentGridLike = isWidgetGrid(parentComponentMeta);
|
|
@@ -114853,9 +115636,26 @@ function getComponentBaseProperties(componentType, parentInfo) {
|
|
|
114853
115636
|
case "SbSection":
|
|
114854
115637
|
children = getSectionChildren();
|
|
114855
115638
|
break;
|
|
115639
|
+
case "SbTable":
|
|
115640
|
+
properties2.tableData = Property.Static(DEFAULT_TABLE_DATA);
|
|
115641
|
+
properties2.columns = Property.Static(DEFAULT_TABLE_COLUMNS);
|
|
115642
|
+
properties2.header = Property.Static("Customers");
|
|
115643
|
+
properties2.searchPlaceholder = Property.Static("Search...");
|
|
115644
|
+
break;
|
|
114856
115645
|
}
|
|
115646
|
+
const { width, height, ...restProperties } = properties2;
|
|
115647
|
+
const safeDimensions = parentInfo.isGridLike ? filterSafeGridDimensionProperties({
|
|
115648
|
+
width: width == null ? void 0 : width.value,
|
|
115649
|
+
height: height == null ? void 0 : height.value
|
|
115650
|
+
}) : filterSafeStackDimensionProperties({
|
|
115651
|
+
width: width == null ? void 0 : width.value,
|
|
115652
|
+
height: height == null ? void 0 : height.value
|
|
115653
|
+
});
|
|
114857
115654
|
return {
|
|
114858
|
-
properties:
|
|
115655
|
+
properties: {
|
|
115656
|
+
...restProperties,
|
|
115657
|
+
...safeDimensions
|
|
115658
|
+
},
|
|
114859
115659
|
children,
|
|
114860
115660
|
name: (_b2 = properties2.name) == null ? void 0 : _b2.value
|
|
114861
115661
|
};
|
|
@@ -114896,6 +115696,7 @@ async function createComponent({
|
|
|
114896
115696
|
componentType,
|
|
114897
115697
|
parentInfo.type
|
|
114898
115698
|
);
|
|
115699
|
+
const isGridLike = willWrapInSectionAndColumn && componentType !== "SbColumn" ? true : parentInfo.isGridLike;
|
|
114899
115700
|
const tagName = componentType;
|
|
114900
115701
|
const {
|
|
114901
115702
|
properties: propertiesFromType,
|
|
@@ -114903,7 +115704,7 @@ async function createComponent({
|
|
|
114903
115704
|
name
|
|
114904
115705
|
} = getComponentBaseProperties(componentType, {
|
|
114905
115706
|
// will wrap in a column with grid layout if dropping on a page or section directly
|
|
114906
|
-
isGridLike
|
|
115707
|
+
isGridLike
|
|
114907
115708
|
});
|
|
114908
115709
|
const properties2 = {
|
|
114909
115710
|
...baseProperties,
|
|
@@ -115057,12 +115858,7 @@ const handleGridDropForNewComponent = ({
|
|
|
115057
115858
|
baseProperties: {
|
|
115058
115859
|
marginTop: Property.Dimension(Dim.row((activeRectGU == null ? void 0 : activeRectGU.yGU) ?? 0)),
|
|
115059
115860
|
marginLeft: Property.Dimension(Dim.col((activeRectGU == null ? void 0 : activeRectGU.xGU) ?? 0)),
|
|
115060
|
-
|
|
115061
|
-
(activeRectGU == null ? void 0 : activeRectGU.widthGU) ? Dim.col(activeRectGU == null ? void 0 : activeRectGU.widthGU) : Dim.col(4)
|
|
115062
|
-
),
|
|
115063
|
-
height: Property.Dimension(
|
|
115064
|
-
(activeRectGU == null ? void 0 : activeRectGU.heightGU) ? Dim.rows(activeRectGU == null ? void 0 : activeRectGU.heightGU) : Dim.fit()
|
|
115065
|
-
)
|
|
115861
|
+
...defaultSizeForComponent(componentType, true, activeRectGU == null ? void 0 : activeRectGU.widthGU)
|
|
115066
115862
|
},
|
|
115067
115863
|
scopeName
|
|
115068
115864
|
});
|
|
@@ -115217,7 +116013,10 @@ const handleStackDropForNewComponent = ({
|
|
|
115217
116013
|
return createComponent({
|
|
115218
116014
|
componentType,
|
|
115219
116015
|
parent: { index: dropInfo.insertionIndex, id: dropSourceId },
|
|
115220
|
-
scopeName
|
|
116016
|
+
scopeName,
|
|
116017
|
+
baseProperties: {
|
|
116018
|
+
...defaultSizeForComponent(componentType, false)
|
|
116019
|
+
}
|
|
115221
116020
|
});
|
|
115222
116021
|
};
|
|
115223
116022
|
const handleStackDrop = async ({
|
|
@@ -115747,6 +116546,14 @@ const InteractionRectHandles = (props) => {
|
|
|
115747
116546
|
const { instanceId, isDragging, selectionType } = props;
|
|
115748
116547
|
const [showPopover, setShowPopover] = useState(null);
|
|
115749
116548
|
const { canResizeWidth: canResizeWidth2, canResizeHeight: canResizeHeight2 } = useResizeCapabilities(instanceId);
|
|
116549
|
+
const timeoutRef = useRef(null);
|
|
116550
|
+
useEffect(() => {
|
|
116551
|
+
return () => {
|
|
116552
|
+
if (timeoutRef.current) {
|
|
116553
|
+
clearTimeout(timeoutRef.current);
|
|
116554
|
+
}
|
|
116555
|
+
};
|
|
116556
|
+
}, []);
|
|
115750
116557
|
const throttledResizeWidget = useMemo$2(
|
|
115751
116558
|
() => lodashExports.throttle((e3) => {
|
|
115752
116559
|
var _a2;
|
|
@@ -115777,14 +116584,18 @@ const InteractionRectHandles = (props) => {
|
|
|
115777
116584
|
var _a2;
|
|
115778
116585
|
e3.stopPropagation();
|
|
115779
116586
|
e3.preventDefault();
|
|
116587
|
+
if (timeoutRef.current) {
|
|
116588
|
+
clearTimeout(timeoutRef.current);
|
|
116589
|
+
timeoutRef.current = null;
|
|
116590
|
+
}
|
|
115780
116591
|
if ((position2 === "left" || position2 === "right") && !canResizeWidth2) {
|
|
115781
116592
|
setShowPopover(position2);
|
|
115782
|
-
setTimeout(() => setShowPopover(null), 3e3);
|
|
116593
|
+
timeoutRef.current = setTimeout(() => setShowPopover(null), 3e3);
|
|
115783
116594
|
return;
|
|
115784
116595
|
}
|
|
115785
116596
|
if ((position2 === "top" || position2 === "bottom") && !canResizeHeight2) {
|
|
115786
116597
|
setShowPopover(position2);
|
|
115787
|
-
setTimeout(() => setShowPopover(null), 3e3);
|
|
116598
|
+
timeoutRef.current = setTimeout(() => setShowPopover(null), 3e3);
|
|
115788
116599
|
return;
|
|
115789
116600
|
}
|
|
115790
116601
|
setShowPopover(null);
|
|
@@ -115858,6 +116669,15 @@ const InteractionRectHandles = (props) => {
|
|
|
115858
116669
|
popoverClassName: "bp5-unstyled-popover",
|
|
115859
116670
|
isOpen: showPopover === pos2,
|
|
115860
116671
|
placement: pos2,
|
|
116672
|
+
onInteraction: (nextOpenState, e3) => {
|
|
116673
|
+
if ((e3 == null ? void 0 : e3.type) === "mousedown" && nextOpenState === false && showPopover === pos2) {
|
|
116674
|
+
if (timeoutRef.current) {
|
|
116675
|
+
clearTimeout(timeoutRef.current);
|
|
116676
|
+
timeoutRef.current = null;
|
|
116677
|
+
}
|
|
116678
|
+
setShowPopover(null);
|
|
116679
|
+
}
|
|
116680
|
+
},
|
|
115861
116681
|
modifiers: {
|
|
115862
116682
|
flip: {
|
|
115863
116683
|
enabled: true,
|
|
@@ -116494,6 +117314,7 @@ const EditWrapper = observer(function EditWrapper2(props) {
|
|
|
116494
117314
|
Component: props.component,
|
|
116495
117315
|
identifier: identifier2,
|
|
116496
117316
|
widgetProps: props.widgetProps,
|
|
117317
|
+
showErrors: true,
|
|
116497
117318
|
children
|
|
116498
117319
|
}
|
|
116499
117320
|
)
|
|
@@ -116773,7 +117594,6 @@ const registerSbComponent = (type5, config2, Component3) => {
|
|
|
116773
117594
|
const identifier2 = useRef();
|
|
116774
117595
|
const { name: passedName, scopeId } = getNormalizedIdInfo({
|
|
116775
117596
|
bind: getBindingIdentifier(props.bind),
|
|
116776
|
-
propsName: props.name,
|
|
116777
117597
|
fallbackScopeId
|
|
116778
117598
|
});
|
|
116779
117599
|
if (!identifier2.current) {
|
|
@@ -117253,8 +118073,16 @@ const textStyleProp = ({
|
|
|
117253
118073
|
propertiesPanel
|
|
117254
118074
|
} = {}) => Prop.composite(baseProp).readAndWrite().propertiesPanel({
|
|
117255
118075
|
...basePropertiesPaneDisplay,
|
|
117256
|
-
...propertiesPanel
|
|
118076
|
+
...propertiesPanel,
|
|
118077
|
+
isJSConvertible: false
|
|
117257
118078
|
});
|
|
118079
|
+
const colorProp = (schema) => {
|
|
118080
|
+
return Prop.string().readAndWrite().propertiesPanel({
|
|
118081
|
+
...schema,
|
|
118082
|
+
controlType: "COLOR_PICKER",
|
|
118083
|
+
isJSConvertible: true
|
|
118084
|
+
});
|
|
118085
|
+
};
|
|
117258
118086
|
const labelTextStyle = () => textStyleProp({
|
|
117259
118087
|
propertiesPanel: {
|
|
117260
118088
|
label: "Label style",
|
|
@@ -117268,23 +118096,41 @@ const labelTextStyle = () => textStyleProp({
|
|
|
117268
118096
|
default: Theme.colors.neutral900
|
|
117269
118097
|
}
|
|
117270
118098
|
}));
|
|
117271
|
-
const
|
|
117272
|
-
|
|
117273
|
-
|
|
117274
|
-
|
|
117275
|
-
|
|
118099
|
+
const createPerSideBorder = (border2) => {
|
|
118100
|
+
return {
|
|
118101
|
+
left: {
|
|
118102
|
+
color: border2.borderColor.default,
|
|
118103
|
+
width: border2.borderWidth,
|
|
118104
|
+
style: border2.borderStyle
|
|
118105
|
+
},
|
|
118106
|
+
right: {
|
|
118107
|
+
color: border2.borderColor.default,
|
|
118108
|
+
width: border2.borderWidth,
|
|
118109
|
+
style: border2.borderStyle
|
|
118110
|
+
},
|
|
118111
|
+
top: {
|
|
118112
|
+
color: border2.borderColor.default,
|
|
118113
|
+
width: border2.borderWidth,
|
|
118114
|
+
style: border2.borderStyle
|
|
118115
|
+
},
|
|
118116
|
+
bottom: {
|
|
118117
|
+
color: border2.borderColor.default,
|
|
118118
|
+
width: border2.borderWidth,
|
|
118119
|
+
style: border2.borderStyle
|
|
118120
|
+
}
|
|
118121
|
+
};
|
|
118122
|
+
};
|
|
117276
118123
|
const border = (propertiesPanelConfig = {}) => {
|
|
117277
|
-
return Prop.
|
|
117278
|
-
top: perSideBorderDef(),
|
|
117279
|
-
right: perSideBorderDef(),
|
|
117280
|
-
bottom: perSideBorderDef(),
|
|
117281
|
-
left: perSideBorderDef()
|
|
117282
|
-
}).propertiesPanel({
|
|
118124
|
+
return Prop.any().readAndWrite().propertiesPanel({
|
|
117283
118125
|
label: "Border",
|
|
117284
118126
|
controlType: "BORDER_CONTROL",
|
|
117285
118127
|
helpText: "Controls the border of the component",
|
|
118128
|
+
visibility: "SHOW_NAME",
|
|
118129
|
+
isRemovable: true,
|
|
118130
|
+
defaultOnAdd: () => createPerSideBorder(Theme.defaultBorder),
|
|
118131
|
+
isJSConvertible: false,
|
|
117286
118132
|
...propertiesPanelConfig
|
|
117287
|
-
})
|
|
118133
|
+
});
|
|
117288
118134
|
};
|
|
117289
118135
|
const createBorderRadiusObject = (borderRadius2) => {
|
|
117290
118136
|
return {
|
|
@@ -117295,18 +118141,17 @@ const createBorderRadiusObject = (borderRadius2) => {
|
|
|
117295
118141
|
};
|
|
117296
118142
|
};
|
|
117297
118143
|
const borderRadius = (propertiesPanelConfig = {}) => {
|
|
117298
|
-
return Prop.
|
|
117299
|
-
|
|
117300
|
-
|
|
117301
|
-
bottomRight: Prop.dimension().readAndWrite(),
|
|
117302
|
-
bottomLeft: Prop.dimension().readAndWrite()
|
|
117303
|
-
}).default(function() {
|
|
117304
|
-
const borderRadius2 = Theme.defaultBorder.borderRadius ?? Dim.px(0);
|
|
117305
|
-
return createBorderRadiusObject(borderRadius2);
|
|
118144
|
+
return Prop.any().default(() => {
|
|
118145
|
+
const borderRadius2 = Theme.defaultBorder.borderRadius;
|
|
118146
|
+
return borderRadius2.value !== 0 ? createBorderRadiusObject(borderRadius2) : void 0;
|
|
117306
118147
|
}).readAndWrite().propertiesPanel({
|
|
117307
118148
|
label: "Border radius",
|
|
117308
118149
|
controlType: "BORDER_RADIUS_CONTROL",
|
|
117309
118150
|
helpText: "Controls the border radius of the component",
|
|
118151
|
+
visibility: "SHOW_NAME",
|
|
118152
|
+
isRemovable: true,
|
|
118153
|
+
defaultOnAdd: () => createBorderRadiusObject(Theme.defaultBorder.borderRadius),
|
|
118154
|
+
isJSConvertible: false,
|
|
117310
118155
|
...propertiesPanelConfig
|
|
117311
118156
|
});
|
|
117312
118157
|
};
|
|
@@ -117318,35 +118163,49 @@ const buildPerSideBorder = (border2) => {
|
|
|
117318
118163
|
left: border2()
|
|
117319
118164
|
};
|
|
117320
118165
|
};
|
|
117321
|
-
const PRIMARY_BUTTON_BORDER_OBJECT =
|
|
117322
|
-
|
|
117323
|
-
|
|
117324
|
-
|
|
117325
|
-
|
|
117326
|
-
|
|
117327
|
-
}
|
|
117328
|
-
const SECONDARY_BUTTON_BORDER_OBJECT =
|
|
117329
|
-
|
|
117330
|
-
|
|
117331
|
-
|
|
117332
|
-
|
|
118166
|
+
const PRIMARY_BUTTON_BORDER_OBJECT = function() {
|
|
118167
|
+
return buildPerSideBorder(() => ({
|
|
118168
|
+
color: this.backgroundColor,
|
|
118169
|
+
width: Dim.px(1),
|
|
118170
|
+
style: "solid"
|
|
118171
|
+
}));
|
|
118172
|
+
};
|
|
118173
|
+
const SECONDARY_BUTTON_BORDER_OBJECT = function() {
|
|
118174
|
+
return buildPerSideBorder(() => ({
|
|
118175
|
+
color: Theme.colors.primary500,
|
|
118176
|
+
width: Dim.px(1),
|
|
118177
|
+
style: "solid"
|
|
118178
|
+
}));
|
|
118179
|
+
};
|
|
117333
118180
|
const getDefaultBorderObject = function() {
|
|
117334
118181
|
switch (this.variant) {
|
|
117335
118182
|
case "primary":
|
|
117336
|
-
return PRIMARY_BUTTON_BORDER_OBJECT;
|
|
118183
|
+
return PRIMARY_BUTTON_BORDER_OBJECT.bind(this)();
|
|
117337
118184
|
case "secondary":
|
|
117338
|
-
return SECONDARY_BUTTON_BORDER_OBJECT;
|
|
118185
|
+
return SECONDARY_BUTTON_BORDER_OBJECT.bind(this)();
|
|
117339
118186
|
default:
|
|
117340
|
-
return
|
|
118187
|
+
return onePixelTransparentBorderObject();
|
|
117341
118188
|
}
|
|
117342
118189
|
};
|
|
117343
|
-
|
|
117344
|
-
return
|
|
117345
|
-
|
|
117346
|
-
|
|
117347
|
-
|
|
117348
|
-
|
|
117349
|
-
|
|
118190
|
+
function getDefaultBorderRadius() {
|
|
118191
|
+
return function() {
|
|
118192
|
+
let borderRadius2;
|
|
118193
|
+
switch (this.variant) {
|
|
118194
|
+
case "PRIMARY_BUTTON":
|
|
118195
|
+
borderRadius2 = Theme.buttons.primary.borderRadius;
|
|
118196
|
+
break;
|
|
118197
|
+
case "SECONDARY_BUTTON":
|
|
118198
|
+
borderRadius2 = Theme.buttons.secondary.borderRadius;
|
|
118199
|
+
break;
|
|
118200
|
+
case "TERTIARY_BUTTON":
|
|
118201
|
+
borderRadius2 = Theme.buttons.tertiary.borderRadius;
|
|
118202
|
+
break;
|
|
118203
|
+
default:
|
|
118204
|
+
borderRadius2 = Theme.buttons.primary.borderRadius;
|
|
118205
|
+
}
|
|
118206
|
+
return createBorderRadiusObject(borderRadius2);
|
|
118207
|
+
};
|
|
118208
|
+
}
|
|
117350
118209
|
const textStyle$3 = textStyleProp().default(function() {
|
|
117351
118210
|
return {
|
|
117352
118211
|
variant: "buttonLabel",
|
|
@@ -117402,47 +118261,24 @@ const propertiesDefinition$h = {
|
|
|
117402
118261
|
}
|
|
117403
118262
|
}),
|
|
117404
118263
|
textStyle: textStyle$3,
|
|
117405
|
-
backgroundColor:
|
|
117406
|
-
const defaultThemeBackground = getButtonThemeDefaultBackgroundColor(
|
|
117407
|
-
Theme,
|
|
117408
|
-
this.variant
|
|
117409
|
-
);
|
|
117410
|
-
return defaultThemeBackground === "transparent" ? void 0 : defaultThemeBackground;
|
|
117411
|
-
}).propertiesPanel({
|
|
118264
|
+
backgroundColor: colorProp({
|
|
117412
118265
|
label: "Background color",
|
|
117413
|
-
controlType: "COLOR_PICKER",
|
|
117414
118266
|
visibility: "SHOW_NAME",
|
|
117415
118267
|
isRemovable: true,
|
|
117416
118268
|
defaultOnAdd: function() {
|
|
117417
118269
|
return getButtonThemeDefaultBackgroundColor(Theme, this.variant);
|
|
117418
118270
|
}
|
|
118271
|
+
}).default(function() {
|
|
118272
|
+
const defaultThemeBackground = getButtonThemeDefaultBackgroundColor(
|
|
118273
|
+
Theme,
|
|
118274
|
+
this.variant
|
|
118275
|
+
);
|
|
118276
|
+
return defaultThemeBackground === "transparent" ? void 0 : defaultThemeBackground;
|
|
117419
118277
|
}),
|
|
117420
|
-
border:
|
|
117421
|
-
|
|
117422
|
-
|
|
117423
|
-
|
|
117424
|
-
isRemovable: true,
|
|
117425
|
-
defaultOnAdd: SECONDARY_BUTTON_BORDER_OBJECT,
|
|
117426
|
-
visibility: "SHOW_NAME"
|
|
117427
|
-
}).readAndWrite(),
|
|
117428
|
-
borderRadius: borderRadius().default(function() {
|
|
117429
|
-
let borderRadius2;
|
|
117430
|
-
switch (this.variant) {
|
|
117431
|
-
case "PRIMARY_BUTTON":
|
|
117432
|
-
borderRadius2 = Theme.buttons.primary.borderRadius;
|
|
117433
|
-
break;
|
|
117434
|
-
case "SECONDARY_BUTTON":
|
|
117435
|
-
borderRadius2 = Theme.buttons.secondary.borderRadius;
|
|
117436
|
-
break;
|
|
117437
|
-
case "TERTIARY_BUTTON":
|
|
117438
|
-
borderRadius2 = Theme.buttons.tertiary.borderRadius;
|
|
117439
|
-
break;
|
|
117440
|
-
default:
|
|
117441
|
-
borderRadius2 = Theme.buttons.primary.borderRadius;
|
|
117442
|
-
}
|
|
117443
|
-
return createBorderRadiusObject(borderRadius2);
|
|
117444
|
-
}),
|
|
117445
|
-
// Horizontal label alignment
|
|
118278
|
+
border: border({
|
|
118279
|
+
defaultOnAdd: SECONDARY_BUTTON_BORDER_OBJECT
|
|
118280
|
+
}).default(getDefaultBorderObject),
|
|
118281
|
+
borderRadius: borderRadius().default(getDefaultBorderRadius),
|
|
117446
118282
|
labelAlignment: Prop.string().readAndWrite().default("center").propertiesPanel({
|
|
117447
118283
|
label: "Label alignment",
|
|
117448
118284
|
controlType: "RADIO_BUTTON_GROUP",
|
|
@@ -117639,9 +118475,8 @@ const commonLayoutProps = {
|
|
|
117639
118475
|
...visible()
|
|
117640
118476
|
};
|
|
117641
118477
|
Section.category(PropsPanelCategory.Appearance).children({
|
|
117642
|
-
backgroundColor:
|
|
118478
|
+
backgroundColor: colorProp({
|
|
117643
118479
|
label: "Background",
|
|
117644
|
-
controlType: "COLOR_PICKER",
|
|
117645
118480
|
helpText: "Changes the color of the background"
|
|
117646
118481
|
}),
|
|
117647
118482
|
border: border(),
|
|
@@ -117785,11 +118620,11 @@ const getStackChildStyle = ({
|
|
|
117785
118620
|
parentWidth
|
|
117786
118621
|
}) => {
|
|
117787
118622
|
const height = (childProps == null ? void 0 : childProps.height) ?? Dim.fit();
|
|
117788
|
-
const heightCss =
|
|
118623
|
+
const heightCss = (
|
|
117789
118624
|
// using 100% height when there is only one child and user's intention to set the child height as exact 100%, e.g. an image with large original height
|
|
117790
118625
|
// if parent height is fit-content, child height 100% will cause unexpected height if child is empty container
|
|
117791
|
-
{ height: "100%" }
|
|
117792
|
-
)
|
|
118626
|
+
childCount === 1 && (height == null ? void 0 : height.mode) === "fill" && (parentHeight == null ? void 0 : parentHeight.mode) !== "fit" ? { height: "100%" } : dimToCSS(height, "height", primary === "height")
|
|
118627
|
+
);
|
|
117793
118628
|
const width = (childProps == null ? void 0 : childProps.width) ?? Dim.fit();
|
|
117794
118629
|
const widthCss = childCount === 1 && (width == null ? void 0 : width.mode) === "fill" && (parentWidth == null ? void 0 : parentWidth.mode) !== "fit" ? { width: "100%" } : dimToCSS(width, "width", primary === "width");
|
|
117795
118630
|
const minWidthCss = getMinMaxCss(
|
|
@@ -117983,11 +118818,13 @@ const propertiesDefinition$g = {
|
|
|
117983
118818
|
}).default(false)
|
|
117984
118819
|
}).add(visible()),
|
|
117985
118820
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
117986
|
-
backgroundColor:
|
|
118821
|
+
backgroundColor: colorProp({
|
|
117987
118822
|
label: "Background",
|
|
117988
|
-
|
|
117989
|
-
|
|
117990
|
-
|
|
118823
|
+
helpText: "Changes the color of the background",
|
|
118824
|
+
visibility: "SHOW_NAME",
|
|
118825
|
+
isRemovable: true,
|
|
118826
|
+
defaultOnAdd: () => Theme.colors.appBackground ?? "#ffffff"
|
|
118827
|
+
}).default(void 0).validate(VALIDATORS.TEXT_ALLOW_UNDEFINED),
|
|
117991
118828
|
border: border()
|
|
117992
118829
|
})
|
|
117993
118830
|
};
|
|
@@ -118197,13 +119034,11 @@ const useHeightObserver = () => {
|
|
|
118197
119034
|
label: "Columns",
|
|
118198
119035
|
placeholder: "Enter columns"
|
|
118199
119036
|
}),
|
|
118200
|
-
|
|
118201
|
-
label: "
|
|
118202
|
-
placeholder: "Enter
|
|
118203
|
-
|
|
118204
|
-
|
|
118205
|
-
label: "Row size",
|
|
118206
|
-
placeholder: "Enter row size"
|
|
119037
|
+
rowHeight: Prop.dimension().readAndWrite().propertiesPanel({
|
|
119038
|
+
label: "Row height",
|
|
119039
|
+
placeholder: "Enter row height",
|
|
119040
|
+
controlType: "DIMENSION_VALUE_CONTROL",
|
|
119041
|
+
dimensionUnit: "px"
|
|
118207
119042
|
}),
|
|
118208
119043
|
...spacing({ themeValue: Dim.px(0) })
|
|
118209
119044
|
}),
|
|
@@ -118222,10 +119057,10 @@ const InternalGrid = ({
|
|
|
118222
119057
|
children = EMPTY_ARRAY$1,
|
|
118223
119058
|
...props
|
|
118224
119059
|
}) => {
|
|
118225
|
-
var _a2;
|
|
119060
|
+
var _a2, _b2;
|
|
118226
119061
|
const isEditing = Boolean((_a2 = rootStore.editStore) == null ? void 0 : _a2.isInitialized);
|
|
118227
119062
|
const { style: style2, ...passThroughProps } = usePassthroughProps(props);
|
|
118228
|
-
const rowHeight = props.
|
|
119063
|
+
const rowHeight = ((_b2 = props.rowHeight) == null ? void 0 : _b2.value) ?? 12;
|
|
118229
119064
|
const childrenArray = useMemo$2(() => {
|
|
118230
119065
|
let childrenArray2 = Array.isArray(children) ? children : [children];
|
|
118231
119066
|
if (!isEditing) {
|
|
@@ -118247,9 +119082,9 @@ const InternalGrid = ({
|
|
|
118247
119082
|
);
|
|
118248
119083
|
const positions = childrenArray.reduce(
|
|
118249
119084
|
(acc, child) => {
|
|
118250
|
-
var _a3,
|
|
119085
|
+
var _a3, _b3, _c2;
|
|
118251
119086
|
let width = ((_a3 = child.props.width) == null ? void 0 : _a3.value) ?? 1;
|
|
118252
|
-
if (((
|
|
119087
|
+
if (((_b3 = child.props.width) == null ? void 0 : _b3.mode) === "fill") {
|
|
118253
119088
|
width = columns;
|
|
118254
119089
|
}
|
|
118255
119090
|
acc[getChildName(child)] = {
|
|
@@ -118277,8 +119112,8 @@ const InternalGrid = ({
|
|
|
118277
119112
|
};
|
|
118278
119113
|
}, [columns, props.spacing, rowHeight, style2]);
|
|
118279
119114
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(DragDisplay, { passThroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: gridStyle, className: props.className, children: childrenArray.map((child) => {
|
|
118280
|
-
var _a3;
|
|
118281
|
-
const heightMode = child.props.height ?? "fit";
|
|
119115
|
+
var _a3, _b3;
|
|
119116
|
+
const heightMode = ((_a3 = child.props.height) == null ? void 0 : _a3.mode) ?? "fit";
|
|
118282
119117
|
const top2 = gridPositions[getChildName(child)].top;
|
|
118283
119118
|
const left2 = gridPositions[getChildName(child)].left;
|
|
118284
119119
|
const rows = gridPositions[getChildName(child)].height;
|
|
@@ -118296,7 +119131,7 @@ const InternalGrid = ({
|
|
|
118296
119131
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
118297
119132
|
Component3,
|
|
118298
119133
|
{
|
|
118299
|
-
staticHeight: (((
|
|
119134
|
+
staticHeight: (((_b3 = child.props.height) == null ? void 0 : _b3.value) ?? 0) * rowHeight,
|
|
118300
119135
|
onHeightChanged: (height) => {
|
|
118301
119136
|
dispatchHeight({
|
|
118302
119137
|
type: "SET_HEIGHT",
|
|
@@ -118353,60 +119188,30 @@ const StaticComponent = ({
|
|
|
118353
119188
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...style2, width: "100%", height: "100%" }, children });
|
|
118354
119189
|
};
|
|
118355
119190
|
const propertiesDefinition$f = {
|
|
118356
|
-
layout: Section.category(PropsPanelCategory.Layout).add(
|
|
118357
|
-
|
|
118358
|
-
|
|
118359
|
-
|
|
118360
|
-
|
|
118361
|
-
|
|
118362
|
-
|
|
118363
|
-
|
|
118364
|
-
|
|
118365
|
-
|
|
118366
|
-
|
|
118367
|
-
|
|
118368
|
-
|
|
118369
|
-
|
|
118370
|
-
|
|
118371
|
-
|
|
118372
|
-
|
|
118373
|
-
|
|
118374
|
-
|
|
118375
|
-
|
|
118376
|
-
|
|
118377
|
-
|
|
118378
|
-
controlType: "HEIGHT_DROPDOWN"
|
|
118379
|
-
}),
|
|
118380
|
-
// the default min/max width/height should be undefined, but currently if no default is set, the add button is not working
|
|
118381
|
-
minWidth: Prop.dimension().readAndWrite().propertiesPanel({
|
|
118382
|
-
label: "Min width",
|
|
118383
|
-
controlType: "WIDTH_DROPDOWN",
|
|
118384
|
-
isRemovable: true,
|
|
118385
|
-
visibility: "SHOW_NAME",
|
|
118386
|
-
defaultOnAdd: Dim.px(0)
|
|
118387
|
-
}),
|
|
118388
|
-
maxWidth: Prop.dimension().readAndWrite().propertiesPanel({
|
|
118389
|
-
label: "Max width",
|
|
118390
|
-
controlType: "WIDTH_DROPDOWN",
|
|
118391
|
-
isRemovable: true,
|
|
118392
|
-
visibility: "SHOW_NAME",
|
|
118393
|
-
defaultOnAdd: Dim.px(200)
|
|
118394
|
-
}),
|
|
118395
|
-
minHeight: Prop.dimension().readAndWrite().propertiesPanel({
|
|
118396
|
-
label: "Min height",
|
|
118397
|
-
controlType: "HEIGHT_DROPDOWN",
|
|
118398
|
-
isRemovable: true,
|
|
118399
|
-
visibility: "SHOW_NAME",
|
|
118400
|
-
defaultOnAdd: Dim.px(0)
|
|
118401
|
-
}),
|
|
118402
|
-
maxHeight: Prop.dimension().readAndWrite().propertiesPanel({
|
|
118403
|
-
label: "Max height",
|
|
118404
|
-
controlType: "HEIGHT_DROPDOWN",
|
|
118405
|
-
isRemovable: true,
|
|
118406
|
-
visibility: "SHOW_NAME",
|
|
118407
|
-
defaultOnAdd: Dim.px(120)
|
|
119191
|
+
layout: Section.category(PropsPanelCategory.Layout).add(
|
|
119192
|
+
containerLayout({
|
|
119193
|
+
...spacing(),
|
|
119194
|
+
...padding({
|
|
119195
|
+
default: function() {
|
|
119196
|
+
return this.variant === "card" ? BASE_THEME_NEW_APPS.padding : {
|
|
119197
|
+
top: Dim.px(0),
|
|
119198
|
+
bottom: Dim.px(0),
|
|
119199
|
+
left: Dim.px(0),
|
|
119200
|
+
right: Dim.px(0)
|
|
119201
|
+
};
|
|
119202
|
+
}
|
|
119203
|
+
}),
|
|
119204
|
+
...margin(),
|
|
119205
|
+
...size$2({
|
|
119206
|
+
defaultsOnAdd: {
|
|
119207
|
+
minWidth: Dim.px(0),
|
|
119208
|
+
minHeight: Dim.px(0),
|
|
119209
|
+
maxWidth: Dim.px(200),
|
|
119210
|
+
maxHeight: Dim.px(120)
|
|
119211
|
+
}
|
|
119212
|
+
})
|
|
118408
119213
|
})
|
|
118409
|
-
|
|
119214
|
+
).add(shouldScrollContents(true)).add(visible()),
|
|
118410
119215
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
118411
119216
|
variant: Prop.string().readAndWrite().default("none").propertiesPanel({
|
|
118412
119217
|
label: "Variant",
|
|
@@ -118424,18 +119229,13 @@ const propertiesDefinition$f = {
|
|
|
118424
119229
|
helpText: "Changes the color of the background",
|
|
118425
119230
|
visibility: "SHOW_NAME",
|
|
118426
119231
|
isRemovable: true,
|
|
118427
|
-
defaultOnAdd:
|
|
118428
|
-
return Theme.colors.appBackground ?? "#ffffff";
|
|
118429
|
-
}
|
|
119232
|
+
defaultOnAdd: () => Theme.colors.appBackground ?? "#ffffff"
|
|
118430
119233
|
}),
|
|
118431
|
-
border: border()
|
|
118432
|
-
|
|
118433
|
-
|
|
118434
|
-
|
|
118435
|
-
|
|
118436
|
-
}).default(function() {
|
|
118437
|
-
const borderRadius2 = this.variant === "card" ? Theme.defaultBorder.borderRadius : Dim.px(0);
|
|
118438
|
-
return createBorderRadiusObject(borderRadius2);
|
|
119234
|
+
border: border().default(function() {
|
|
119235
|
+
return this.variant === "card" ? createPerSideBorder(Theme.defaultBorder) : void 0;
|
|
119236
|
+
}),
|
|
119237
|
+
borderRadius: borderRadius().default(function() {
|
|
119238
|
+
return this.variant === "card" ? createBorderRadiusObject(Theme.defaultBorder.borderRadius) : void 0;
|
|
118439
119239
|
})
|
|
118440
119240
|
})
|
|
118441
119241
|
};
|
|
@@ -118512,12 +119312,11 @@ const InternalContainer = (props) => {
|
|
|
118512
119312
|
InternalGrid,
|
|
118513
119313
|
{
|
|
118514
119314
|
margin: void 0,
|
|
118515
|
-
spacing:
|
|
119315
|
+
spacing: Dim.px(0),
|
|
118516
119316
|
isVisible: props.isVisible ?? true,
|
|
118517
119317
|
"data-container-layer": "container-inner-grid",
|
|
118518
119318
|
columns: props.columns,
|
|
118519
|
-
|
|
118520
|
-
rowSize: props.rowSize,
|
|
119319
|
+
rowHeight: props.rowHeight,
|
|
118521
119320
|
children: props.children
|
|
118522
119321
|
}
|
|
118523
119322
|
) : props.layout === "horizontal" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -118551,22 +119350,28 @@ const SbContainer = registerSbComponent(
|
|
|
118551
119350
|
InternalContainer
|
|
118552
119351
|
);
|
|
118553
119352
|
const propertiesDefinition$e = {
|
|
118554
|
-
layout: Section.category(PropsPanelCategory.Layout).add(
|
|
118555
|
-
|
|
118556
|
-
|
|
118557
|
-
|
|
118558
|
-
|
|
118559
|
-
|
|
118560
|
-
|
|
118561
|
-
|
|
118562
|
-
|
|
119353
|
+
layout: Section.category(PropsPanelCategory.Layout).add(
|
|
119354
|
+
containerLayout({
|
|
119355
|
+
...spacing(),
|
|
119356
|
+
...padding(),
|
|
119357
|
+
...size$2({
|
|
119358
|
+
defaults: {
|
|
119359
|
+
width: Dim.fill(),
|
|
119360
|
+
height: Dim.fill()
|
|
119361
|
+
},
|
|
119362
|
+
hasMinHeight: false,
|
|
119363
|
+
hasMaxHeight: false,
|
|
119364
|
+
showHeight: () => false
|
|
119365
|
+
})
|
|
118563
119366
|
})
|
|
118564
119367
|
).add(shouldScrollContents(true)).add(visible()),
|
|
118565
119368
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
118566
|
-
backgroundColor:
|
|
119369
|
+
backgroundColor: colorProp({
|
|
118567
119370
|
label: "Background",
|
|
118568
|
-
|
|
118569
|
-
|
|
119371
|
+
helpText: "Changes the color of the background",
|
|
119372
|
+
visibility: "SHOW_NAME",
|
|
119373
|
+
isRemovable: true,
|
|
119374
|
+
defaultOnAdd: () => Theme.colors.appBackground ?? "#ffffff"
|
|
118570
119375
|
}),
|
|
118571
119376
|
border: border()
|
|
118572
119377
|
})
|
|
@@ -118596,7 +119401,6 @@ const SbColumn = registerSbComponent(
|
|
|
118596
119401
|
verticalAlign: props.verticalAlign,
|
|
118597
119402
|
horizontalAlign: props.horizontalAlign,
|
|
118598
119403
|
columns: props.columns,
|
|
118599
|
-
rows: props.rows,
|
|
118600
119404
|
padding: props.padding,
|
|
118601
119405
|
variant: "none",
|
|
118602
119406
|
backgroundColor: props.backgroundColor,
|
|
@@ -125972,11 +126776,10 @@ const propertiesDefinition$d = {
|
|
|
125972
126776
|
placeholder: "Input text"
|
|
125973
126777
|
}),
|
|
125974
126778
|
textStyle: textStyle$2,
|
|
125975
|
-
backgroundColor:
|
|
126779
|
+
backgroundColor: colorProp({
|
|
125976
126780
|
label: "Background",
|
|
125977
|
-
controlType: "COLOR_PICKER",
|
|
125978
126781
|
helpText: "Changes the color of the background"
|
|
125979
|
-
}),
|
|
126782
|
+
}).default(() => Theme.colors.neutral),
|
|
125980
126783
|
border: border().default(void 0),
|
|
125981
126784
|
borderRadius: borderRadius(),
|
|
125982
126785
|
icon: Prop.string().readAndWrite().propertiesPanel({
|
|
@@ -133210,6 +134013,7 @@ const useStyle = (props) => {
|
|
|
133210
134013
|
return {
|
|
133211
134014
|
overflow: props.shouldScroll ? "auto" : "hidden",
|
|
133212
134015
|
textAlign: (_a2 = props.textAlign) == null ? void 0 : _a2.toLowerCase(),
|
|
134016
|
+
alignItems: getVerticalAlignment(props.verticalAlign),
|
|
133213
134017
|
color: (_c2 = (_b2 = props.textStyle) == null ? void 0 : _b2.textColor) == null ? void 0 : _c2.default,
|
|
133214
134018
|
...props.style
|
|
133215
134019
|
};
|
|
@@ -133231,6 +134035,17 @@ const getTextAlignClass = (textAlign) => {
|
|
|
133231
134035
|
};
|
|
133232
134036
|
}
|
|
133233
134037
|
};
|
|
134038
|
+
const getVerticalAlignment = (verticalAlign) => {
|
|
134039
|
+
switch (verticalAlign) {
|
|
134040
|
+
case "top":
|
|
134041
|
+
return "flex-start";
|
|
134042
|
+
case "bottom":
|
|
134043
|
+
return "flex-end";
|
|
134044
|
+
case "center":
|
|
134045
|
+
default:
|
|
134046
|
+
return "center";
|
|
134047
|
+
}
|
|
134048
|
+
};
|
|
133234
134049
|
const useIconContainerStyles = ({
|
|
133235
134050
|
iconGap,
|
|
133236
134051
|
textAlign
|
|
@@ -133412,8 +134227,7 @@ const ModalComponent = (props) => {
|
|
|
133412
134227
|
padding: props.styleProps.padding ?? ZERO_PADDING,
|
|
133413
134228
|
spacing: props.spacing ?? Dim.px(0),
|
|
133414
134229
|
columns: props.columns ?? 48,
|
|
133415
|
-
|
|
133416
|
-
rowSize: props.rowSize,
|
|
134230
|
+
rowHeight: props.rowHeight,
|
|
133417
134231
|
shouldScrollContents: true,
|
|
133418
134232
|
variant: "none",
|
|
133419
134233
|
children: props.children
|
|
@@ -133428,8 +134242,7 @@ const ModalComponent = (props) => {
|
|
|
133428
134242
|
props.styleProps.padding,
|
|
133429
134243
|
props.spacing,
|
|
133430
134244
|
props.columns,
|
|
133431
|
-
props.
|
|
133432
|
-
props.rowSize,
|
|
134245
|
+
props.rowHeight,
|
|
133433
134246
|
props.children
|
|
133434
134247
|
]
|
|
133435
134248
|
);
|
|
@@ -133507,12 +134320,16 @@ const ModalComponent = (props) => {
|
|
|
133507
134320
|
] });
|
|
133508
134321
|
};
|
|
133509
134322
|
const propertiesDefinition$a = {
|
|
133510
|
-
layout: Section.category(PropsPanelCategory.Layout).add(
|
|
134323
|
+
layout: Section.category(PropsPanelCategory.Layout).add(
|
|
134324
|
+
containerLayout({
|
|
134325
|
+
...spacing(),
|
|
134326
|
+
...padding()
|
|
134327
|
+
})
|
|
134328
|
+
),
|
|
133511
134329
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
133512
|
-
backgroundColor:
|
|
134330
|
+
backgroundColor: colorProp({
|
|
133513
134331
|
label: "Background color",
|
|
133514
|
-
helpText: "The background color of the component"
|
|
133515
|
-
controlType: "COLOR_PICKER"
|
|
134332
|
+
helpText: "The background color of the component"
|
|
133516
134333
|
}),
|
|
133517
134334
|
border: Prop.any().readAndWrite().propertiesPanel({
|
|
133518
134335
|
label: "Border",
|
|
@@ -133697,20 +134514,13 @@ const SbModal = registerSbComponent(
|
|
|
133697
134514
|
verticalAlign: props.verticalAlign,
|
|
133698
134515
|
spacing: props.spacing ?? Dim.px(0),
|
|
133699
134516
|
columns: props.columns,
|
|
133700
|
-
|
|
133701
|
-
rowSize: props.rowSize,
|
|
134517
|
+
rowHeight: props.rowHeight,
|
|
133702
134518
|
dropTargetRef,
|
|
133703
134519
|
children: props.children
|
|
133704
134520
|
}
|
|
133705
134521
|
);
|
|
133706
134522
|
}
|
|
133707
134523
|
);
|
|
133708
|
-
var PaginationTypes = /* @__PURE__ */ ((PaginationTypes2) => {
|
|
133709
|
-
PaginationTypes2["NONE"] = "NONE";
|
|
133710
|
-
PaginationTypes2["CLIENT_SIDE"] = "CLIENT_SIDE";
|
|
133711
|
-
PaginationTypes2["SERVER_SIDE"] = "SERVER_SIDE";
|
|
133712
|
-
return PaginationTypes2;
|
|
133713
|
-
})(PaginationTypes || {});
|
|
133714
134524
|
const CompactMode = {
|
|
133715
134525
|
SHORT: "SHORT",
|
|
133716
134526
|
DEFAULT: "DEFAULT",
|
|
@@ -133746,13 +134556,6 @@ var EditInputType = /* @__PURE__ */ ((EditInputType2) => {
|
|
|
133746
134556
|
EditInputType2["Date"] = "DATE";
|
|
133747
134557
|
return EditInputType2;
|
|
133748
134558
|
})(EditInputType || {});
|
|
133749
|
-
var BooleanStyleFalse = /* @__PURE__ */ ((BooleanStyleFalse2) => {
|
|
133750
|
-
BooleanStyleFalse2["EMPTY"] = "EMPTY";
|
|
133751
|
-
BooleanStyleFalse2["CLOSE"] = "CLOSE";
|
|
133752
|
-
BooleanStyleFalse2["MINUS"] = "MINUS";
|
|
133753
|
-
BooleanStyleFalse2["EMPTY_CHECKBOX"] = "EMPTY_CHECKBOX";
|
|
133754
|
-
return BooleanStyleFalse2;
|
|
133755
|
-
})(BooleanStyleFalse || {});
|
|
133756
134559
|
var ImageSize = /* @__PURE__ */ ((ImageSize2) => {
|
|
133757
134560
|
ImageSize2["Fixed"] = "FIXED";
|
|
133758
134561
|
ImageSize2["Fit"] = "FIT";
|
|
@@ -133785,6 +134588,142 @@ const ColumnType = {
|
|
|
133785
134588
|
EMAIL: "email",
|
|
133786
134589
|
LINK: "link"
|
|
133787
134590
|
};
|
|
134591
|
+
const JUSTIFY_CONTENT = {
|
|
134592
|
+
LEFT: "flex-start",
|
|
134593
|
+
CENTER: "center",
|
|
134594
|
+
RIGHT: "flex-end"
|
|
134595
|
+
};
|
|
134596
|
+
const ALIGN_ITEMS = {
|
|
134597
|
+
TOP: "flex-start",
|
|
134598
|
+
CENTER: "center",
|
|
134599
|
+
BOTTOM: "flex-end"
|
|
134600
|
+
};
|
|
134601
|
+
const TEXT_ALIGN = {
|
|
134602
|
+
LEFT: "left",
|
|
134603
|
+
CENTER: "center",
|
|
134604
|
+
RIGHT: "right"
|
|
134605
|
+
};
|
|
134606
|
+
const TEXT_SIZES = {
|
|
134607
|
+
HEADING1: "24px",
|
|
134608
|
+
HEADING2: "18px",
|
|
134609
|
+
HEADING3: "16px",
|
|
134610
|
+
PARAGRAPH: "14px",
|
|
134611
|
+
PARAGRAPH2: "12px"
|
|
134612
|
+
};
|
|
134613
|
+
var FontStyleTypes = /* @__PURE__ */ ((FontStyleTypes2) => {
|
|
134614
|
+
FontStyleTypes2["BOLD"] = "BOLD";
|
|
134615
|
+
FontStyleTypes2["ITALIC"] = "ITALIC";
|
|
134616
|
+
FontStyleTypes2["REGULAR"] = "REGULAR";
|
|
134617
|
+
FontStyleTypes2["UNDERLINE"] = "UNDERLINE";
|
|
134618
|
+
return FontStyleTypes2;
|
|
134619
|
+
})(FontStyleTypes || {});
|
|
134620
|
+
const TABLE_SIZES = {
|
|
134621
|
+
[CompactMode.VERY_SHORT]: {
|
|
134622
|
+
COLUMN_HEADER_HEIGHT: 48,
|
|
134623
|
+
TABLE_HEADER_HEIGHT: 60,
|
|
134624
|
+
TABLE_FOOTER_HEIGHT: 48,
|
|
134625
|
+
ROW_HEIGHT: 28,
|
|
134626
|
+
ROW_FONT_SIZE: 14,
|
|
134627
|
+
PAGINATION_CONTROLS_HEIGHT: 24,
|
|
134628
|
+
IMAGE_SIZE: 22,
|
|
134629
|
+
LINK_MENU_HEIGHT: 28,
|
|
134630
|
+
LINK_MENU_ICON_SIZE: IconSize$1.LARGE,
|
|
134631
|
+
ROW_PADDING: 0
|
|
134632
|
+
},
|
|
134633
|
+
[CompactMode.SHORT]: {
|
|
134634
|
+
COLUMN_HEADER_HEIGHT: 48,
|
|
134635
|
+
TABLE_HEADER_HEIGHT: 60,
|
|
134636
|
+
TABLE_FOOTER_HEIGHT: 48,
|
|
134637
|
+
ROW_HEIGHT: 36,
|
|
134638
|
+
ROW_FONT_SIZE: 14,
|
|
134639
|
+
PAGINATION_CONTROLS_HEIGHT: 24,
|
|
134640
|
+
IMAGE_SIZE: 28,
|
|
134641
|
+
LINK_MENU_HEIGHT: 32,
|
|
134642
|
+
LINK_MENU_ICON_SIZE: IconSize$1.LARGE,
|
|
134643
|
+
ROW_PADDING: 2
|
|
134644
|
+
},
|
|
134645
|
+
[CompactMode.DEFAULT]: {
|
|
134646
|
+
COLUMN_HEADER_HEIGHT: 48,
|
|
134647
|
+
TABLE_HEADER_HEIGHT: 60,
|
|
134648
|
+
TABLE_FOOTER_HEIGHT: 48,
|
|
134649
|
+
ROW_HEIGHT: 48,
|
|
134650
|
+
ROW_FONT_SIZE: 14,
|
|
134651
|
+
PAGINATION_CONTROLS_HEIGHT: 32,
|
|
134652
|
+
IMAGE_SIZE: 32,
|
|
134653
|
+
LINK_MENU_HEIGHT: 36,
|
|
134654
|
+
LINK_MENU_ICON_SIZE: IconSize$1.XL,
|
|
134655
|
+
ROW_PADDING: 5
|
|
134656
|
+
},
|
|
134657
|
+
[CompactMode.TALL]: {
|
|
134658
|
+
COLUMN_HEADER_HEIGHT: 36,
|
|
134659
|
+
TABLE_HEADER_HEIGHT: 60,
|
|
134660
|
+
TABLE_FOOTER_HEIGHT: 60,
|
|
134661
|
+
ROW_HEIGHT: 58,
|
|
134662
|
+
ROW_FONT_SIZE: 14,
|
|
134663
|
+
PAGINATION_CONTROLS_HEIGHT: 36,
|
|
134664
|
+
IMAGE_SIZE: 36,
|
|
134665
|
+
LINK_MENU_HEIGHT: 36,
|
|
134666
|
+
LINK_MENU_ICON_SIZE: IconSize$1.XL,
|
|
134667
|
+
ROW_PADDING: 10
|
|
134668
|
+
}
|
|
134669
|
+
};
|
|
134670
|
+
const DEFAULT_TABLE_COLUMN_WIDTH = 150;
|
|
134671
|
+
const TABLE_COLUMN_MIN_WIDTH = 20;
|
|
134672
|
+
const PARSED_INPUT_TYPES = [
|
|
134673
|
+
EditInputType.Number,
|
|
134674
|
+
EditInputType.Checkbox
|
|
134675
|
+
];
|
|
134676
|
+
const TextBoxEditTypes = [
|
|
134677
|
+
EditInputType.Text,
|
|
134678
|
+
EditInputType.Number,
|
|
134679
|
+
EditInputType.Email
|
|
134680
|
+
];
|
|
134681
|
+
const DEFAULT_CELL_TEXT_STYLE_VARIANT = "body2";
|
|
134682
|
+
const DEFAULT_CELL_CLASS_NAME = getTextCssClassFromVariant(
|
|
134683
|
+
DEFAULT_CELL_TEXT_STYLE_VARIANT
|
|
134684
|
+
);
|
|
134685
|
+
const DEFAULT_HEADING_TEXT_STYLE_VARIANT = "heading3";
|
|
134686
|
+
const TABLE_COLUMN_HEADER_DEFAULT_TYPOGRAPHY = "heading6";
|
|
134687
|
+
var Condition0Type = /* @__PURE__ */ ((Condition0Type2) => {
|
|
134688
|
+
Condition0Type2["all"] = "all";
|
|
134689
|
+
Condition0Type2["isEmpty"] = "isEmpty";
|
|
134690
|
+
Condition0Type2["isNotEmpty"] = "isNotEmpty";
|
|
134691
|
+
Condition0Type2["isTrue"] = "isTrue";
|
|
134692
|
+
Condition0Type2["isFalse"] = "isFalse";
|
|
134693
|
+
return Condition0Type2;
|
|
134694
|
+
})(Condition0Type || {});
|
|
134695
|
+
var Condition1Type = /* @__PURE__ */ ((Condition1Type2) => {
|
|
134696
|
+
Condition1Type2["textIs"] = "textIs";
|
|
134697
|
+
Condition1Type2["textContains"] = "textContains";
|
|
134698
|
+
Condition1Type2["textDoesNotContain"] = "textDoesNotContain";
|
|
134699
|
+
Condition1Type2["textStartsWith"] = "textStartsWith";
|
|
134700
|
+
Condition1Type2["textEndsWith"] = "textEndsWith";
|
|
134701
|
+
Condition1Type2["isEqualTo"] = "isEqualTo";
|
|
134702
|
+
Condition1Type2["isNotEqualTo"] = "isNotEqualTo";
|
|
134703
|
+
Condition1Type2["isLessThan"] = "isLessThan";
|
|
134704
|
+
Condition1Type2["isLessThanOrEqualTo"] = "isLessThanOrEqualTo";
|
|
134705
|
+
Condition1Type2["isGreaterThan"] = "isGreaterThan";
|
|
134706
|
+
Condition1Type2["isGreaterThanOrEqualTo"] = "isGreaterThanOrEqualTo";
|
|
134707
|
+
Condition1Type2["dateIs"] = "dateIs";
|
|
134708
|
+
Condition1Type2["dateIsBefore"] = "dateIsBefore";
|
|
134709
|
+
Condition1Type2["dateIsAfter"] = "dateIsAfter";
|
|
134710
|
+
return Condition1Type2;
|
|
134711
|
+
})(Condition1Type || {});
|
|
134712
|
+
var Condition2Type = /* @__PURE__ */ ((Condition2Type2) => {
|
|
134713
|
+
Condition2Type2["isBetween"] = "isBetween";
|
|
134714
|
+
Condition2Type2["dateIsBetween"] = "dateIsBetween";
|
|
134715
|
+
return Condition2Type2;
|
|
134716
|
+
})(Condition2Type || {});
|
|
134717
|
+
const TABLE_MULTISELECT_COLID$1 = "SB_$$_MULTISELECT";
|
|
134718
|
+
const tagColorPalette = [
|
|
134719
|
+
"#27BBFF33",
|
|
134720
|
+
"#FF9F3533",
|
|
134721
|
+
"#14CDB733",
|
|
134722
|
+
"#7C4FF833",
|
|
134723
|
+
"#FF62A433",
|
|
134724
|
+
"#9D585833",
|
|
134725
|
+
"#FF484833"
|
|
134726
|
+
];
|
|
133788
134727
|
const CurrencyList = CC.getCodes();
|
|
133789
134728
|
const tableColumnTypes = [
|
|
133790
134729
|
{
|
|
@@ -133841,7 +134780,7 @@ const cellIconProps = {
|
|
|
133841
134780
|
label: "Cell icon",
|
|
133842
134781
|
controlType: "ICON_SELECTOR"
|
|
133843
134782
|
}),
|
|
133844
|
-
cellIconPosition: Prop.string().readAndWrite().propertiesPanel({
|
|
134783
|
+
cellIconPosition: Prop.string().readAndWrite().default("left").propertiesPanel({
|
|
133845
134784
|
label: "Cell icon position",
|
|
133846
134785
|
controlType: "RADIO_BUTTON_GROUP",
|
|
133847
134786
|
options: [
|
|
@@ -133859,7 +134798,7 @@ const cellIconProps = {
|
|
|
133859
134798
|
})
|
|
133860
134799
|
};
|
|
133861
134800
|
const textStyleProps = {
|
|
133862
|
-
horizontalAlign: Prop.string().readAndWrite().propertiesPanel({
|
|
134801
|
+
horizontalAlign: Prop.string().readAndWrite().default("left").propertiesPanel({
|
|
133863
134802
|
label: "Horizontal alignment",
|
|
133864
134803
|
controlType: "RADIO_BUTTON_GROUP",
|
|
133865
134804
|
options: [
|
|
@@ -133868,7 +134807,7 @@ const textStyleProps = {
|
|
|
133868
134807
|
{ value: "right", icon: "RIGHT_ALIGN" }
|
|
133869
134808
|
]
|
|
133870
134809
|
}),
|
|
133871
|
-
verticalAlign: Prop.string().readAndWrite().propertiesPanel({
|
|
134810
|
+
verticalAlign: Prop.string().readAndWrite().default("top").propertiesPanel({
|
|
133872
134811
|
label: "Vertical alignment",
|
|
133873
134812
|
controlType: "RADIO_BUTTON_GROUP",
|
|
133874
134813
|
options: [
|
|
@@ -133881,17 +134820,17 @@ const textStyleProps = {
|
|
|
133881
134820
|
label: "Cell style",
|
|
133882
134821
|
controlType: "TEXT_STYLE"
|
|
133883
134822
|
}),
|
|
133884
|
-
cellBackground:
|
|
133885
|
-
label: "Background color"
|
|
133886
|
-
|
|
133887
|
-
})
|
|
134823
|
+
cellBackground: colorProp({
|
|
134824
|
+
label: "Background color"
|
|
134825
|
+
}).readAndWrite()
|
|
133888
134826
|
};
|
|
133889
134827
|
const textColumnProperties = {
|
|
133890
134828
|
general: {
|
|
133891
|
-
|
|
133892
|
-
|
|
133893
|
-
|
|
133894
|
-
|
|
134829
|
+
// TODO: bring this back when we are ready
|
|
134830
|
+
// computedValue: Prop.string().readAndWrite().propertiesPanel({
|
|
134831
|
+
// label: "Computed value",
|
|
134832
|
+
// controlType: "COMPUTE_TABLE_VALUE",
|
|
134833
|
+
// }),
|
|
133895
134834
|
displayedValue: Prop.string().readAndWrite().propertiesPanel({
|
|
133896
134835
|
label: "Displayed value",
|
|
133897
134836
|
controlType: "COMPUTE_TABLE_VALUE"
|
|
@@ -133938,26 +134877,24 @@ const buttonColumnProperties = {
|
|
|
133938
134877
|
}
|
|
133939
134878
|
]
|
|
133940
134879
|
}),
|
|
133941
|
-
buttonBackgroundColor:
|
|
133942
|
-
label: "Background color"
|
|
133943
|
-
|
|
133944
|
-
|
|
133945
|
-
|
|
133946
|
-
|
|
133947
|
-
|
|
133948
|
-
|
|
133949
|
-
|
|
133950
|
-
label: "Background color",
|
|
133951
|
-
controlType: "COLOR_PICKER"
|
|
133952
|
-
})
|
|
134880
|
+
buttonBackgroundColor: colorProp({
|
|
134881
|
+
label: "Background color"
|
|
134882
|
+
}).readAndWrite(),
|
|
134883
|
+
buttonLabelColor: colorProp({
|
|
134884
|
+
label: "Label color"
|
|
134885
|
+
}).readAndWrite(),
|
|
134886
|
+
backgroundColor: colorProp({
|
|
134887
|
+
label: "Background color"
|
|
134888
|
+
}).readAndWrite()
|
|
133953
134889
|
}
|
|
133954
134890
|
};
|
|
133955
134891
|
const numberColumnProperties = {
|
|
133956
134892
|
general: {
|
|
133957
|
-
|
|
133958
|
-
|
|
133959
|
-
|
|
133960
|
-
|
|
134893
|
+
// TODO: bring this back when we are ready
|
|
134894
|
+
// computedValue: Prop.string().readAndWrite().propertiesPanel({
|
|
134895
|
+
// label: "Computed value",
|
|
134896
|
+
// controlType: "COMPUTE_TABLE_VALUE",
|
|
134897
|
+
// }),
|
|
133961
134898
|
notation: Prop.string().readAndWrite().propertiesPanel({
|
|
133962
134899
|
label: "Number format",
|
|
133963
134900
|
controlType: "DROP_DOWN",
|
|
@@ -134064,12 +135001,12 @@ const imageColumnProperties = {
|
|
|
134064
135001
|
};
|
|
134065
135002
|
const dateColumnProperties = {
|
|
134066
135003
|
general: {
|
|
134067
|
-
|
|
135004
|
+
inputFormat: Prop.string().readAndWrite().propertiesPanel({
|
|
134068
135005
|
label: "Value format",
|
|
134069
135006
|
controlType: "DROP_DOWN",
|
|
134070
135007
|
options: DATE_INPUT_FORMATS
|
|
134071
135008
|
}),
|
|
134072
|
-
|
|
135009
|
+
outputFormat: Prop.string().readAndWrite().propertiesPanel({
|
|
134073
135010
|
label: "Display format",
|
|
134074
135011
|
controlType: "DROP_DOWN",
|
|
134075
135012
|
options: DATE_OUTPUT_FORMATS
|
|
@@ -134101,38 +135038,39 @@ const dateColumnProperties = {
|
|
|
134101
135038
|
};
|
|
134102
135039
|
const booleanColumnProperties = {
|
|
134103
135040
|
general: {
|
|
134104
|
-
|
|
134105
|
-
|
|
134106
|
-
|
|
134107
|
-
|
|
135041
|
+
// TODO: bring this back when we are ready
|
|
135042
|
+
// computedValue: Prop.string().readAndWrite().propertiesPanel({
|
|
135043
|
+
// label: "Computed value",
|
|
135044
|
+
// controlType: "COMPUTE_TABLE_VALUE",
|
|
135045
|
+
// }),
|
|
134108
135046
|
},
|
|
134109
135047
|
presentation: {
|
|
134110
135048
|
...textStyleProps,
|
|
134111
|
-
booleanStyleFalse: Prop.string().readAndWrite().propertiesPanel({
|
|
135049
|
+
booleanStyleFalse: Prop.string().readAndWrite().default("empty").propertiesPanel({
|
|
134112
135050
|
label: "False value",
|
|
134113
|
-
controlType: "
|
|
135051
|
+
controlType: "RADIO_BUTTON",
|
|
134114
135052
|
options: [
|
|
134115
135053
|
{
|
|
134116
|
-
|
|
134117
|
-
value:
|
|
135054
|
+
name: "",
|
|
135055
|
+
value: "empty"
|
|
134118
135056
|
},
|
|
134119
135057
|
{
|
|
134120
|
-
|
|
135058
|
+
name: "Close",
|
|
134121
135059
|
isIcon: true,
|
|
134122
135060
|
icon: "CLOSE",
|
|
134123
|
-
value:
|
|
135061
|
+
value: "close"
|
|
134124
135062
|
},
|
|
134125
135063
|
{
|
|
134126
|
-
|
|
135064
|
+
name: "Minus",
|
|
134127
135065
|
isIcon: true,
|
|
134128
135066
|
icon: "MINUS",
|
|
134129
|
-
value:
|
|
135067
|
+
value: "minus"
|
|
134130
135068
|
},
|
|
134131
135069
|
{
|
|
134132
|
-
|
|
135070
|
+
name: "Empty checkbox",
|
|
134133
135071
|
isIcon: true,
|
|
134134
135072
|
icon: "EMPTY_CHECKBOX",
|
|
134135
|
-
value:
|
|
135073
|
+
value: "empty_checkbox"
|
|
134136
135074
|
}
|
|
134137
135075
|
]
|
|
134138
135076
|
})
|
|
@@ -134140,10 +135078,11 @@ const booleanColumnProperties = {
|
|
|
134140
135078
|
};
|
|
134141
135079
|
const videoColumnProperties = {
|
|
134142
135080
|
general: {
|
|
134143
|
-
|
|
134144
|
-
|
|
134145
|
-
|
|
134146
|
-
|
|
135081
|
+
// TODO: bring this back when we are ready
|
|
135082
|
+
// computedValue: Prop.string().readAndWrite().propertiesPanel({
|
|
135083
|
+
// label: "Computed value",
|
|
135084
|
+
// controlType: "COMPUTE_TABLE_VALUE",
|
|
135085
|
+
// }),
|
|
134147
135086
|
},
|
|
134148
135087
|
presentation: {
|
|
134149
135088
|
...textStyleProps
|
|
@@ -134184,6 +135123,10 @@ const columnPanelConfig = {
|
|
|
134184
135123
|
})
|
|
134185
135124
|
},
|
|
134186
135125
|
variants: [
|
|
135126
|
+
{
|
|
135127
|
+
columnType: Prop.unset(),
|
|
135128
|
+
...textColumnProperties.general
|
|
135129
|
+
},
|
|
134187
135130
|
{
|
|
134188
135131
|
columnType: Prop.literal(ColumnType.TEXT),
|
|
134189
135132
|
...textColumnProperties.general
|
|
@@ -134268,6 +135211,10 @@ const columnPanelConfig = {
|
|
|
134268
135211
|
columnType: Prop.string()
|
|
134269
135212
|
},
|
|
134270
135213
|
variants: [
|
|
135214
|
+
{
|
|
135215
|
+
columnType: Prop.unset(),
|
|
135216
|
+
...textColumnProperties.presentation
|
|
135217
|
+
},
|
|
134271
135218
|
{
|
|
134272
135219
|
columnType: Prop.literal(ColumnType.TEXT),
|
|
134273
135220
|
...textColumnProperties.presentation
|
|
@@ -134387,142 +135334,6 @@ const columnPanelConfig = {
|
|
|
134387
135334
|
// }),
|
|
134388
135335
|
// ),
|
|
134389
135336
|
};
|
|
134390
|
-
const JUSTIFY_CONTENT = {
|
|
134391
|
-
LEFT: "flex-start",
|
|
134392
|
-
CENTER: "center",
|
|
134393
|
-
RIGHT: "flex-end"
|
|
134394
|
-
};
|
|
134395
|
-
const ALIGN_ITEMS = {
|
|
134396
|
-
TOP: "flex-start",
|
|
134397
|
-
CENTER: "center",
|
|
134398
|
-
BOTTOM: "flex-end"
|
|
134399
|
-
};
|
|
134400
|
-
const TEXT_ALIGN = {
|
|
134401
|
-
LEFT: "left",
|
|
134402
|
-
CENTER: "center",
|
|
134403
|
-
RIGHT: "right"
|
|
134404
|
-
};
|
|
134405
|
-
const TEXT_SIZES = {
|
|
134406
|
-
HEADING1: "24px",
|
|
134407
|
-
HEADING2: "18px",
|
|
134408
|
-
HEADING3: "16px",
|
|
134409
|
-
PARAGRAPH: "14px",
|
|
134410
|
-
PARAGRAPH2: "12px"
|
|
134411
|
-
};
|
|
134412
|
-
var FontStyleTypes = /* @__PURE__ */ ((FontStyleTypes2) => {
|
|
134413
|
-
FontStyleTypes2["BOLD"] = "BOLD";
|
|
134414
|
-
FontStyleTypes2["ITALIC"] = "ITALIC";
|
|
134415
|
-
FontStyleTypes2["REGULAR"] = "REGULAR";
|
|
134416
|
-
FontStyleTypes2["UNDERLINE"] = "UNDERLINE";
|
|
134417
|
-
return FontStyleTypes2;
|
|
134418
|
-
})(FontStyleTypes || {});
|
|
134419
|
-
const TABLE_SIZES = {
|
|
134420
|
-
[CompactMode.VERY_SHORT]: {
|
|
134421
|
-
COLUMN_HEADER_HEIGHT: 48,
|
|
134422
|
-
TABLE_HEADER_HEIGHT: 60,
|
|
134423
|
-
TABLE_FOOTER_HEIGHT: 48,
|
|
134424
|
-
ROW_HEIGHT: 28,
|
|
134425
|
-
ROW_FONT_SIZE: 14,
|
|
134426
|
-
PAGINATION_CONTROLS_HEIGHT: 24,
|
|
134427
|
-
IMAGE_SIZE: 22,
|
|
134428
|
-
LINK_MENU_HEIGHT: 28,
|
|
134429
|
-
LINK_MENU_ICON_SIZE: IconSize$1.LARGE,
|
|
134430
|
-
ROW_PADDING: 0
|
|
134431
|
-
},
|
|
134432
|
-
[CompactMode.SHORT]: {
|
|
134433
|
-
COLUMN_HEADER_HEIGHT: 48,
|
|
134434
|
-
TABLE_HEADER_HEIGHT: 60,
|
|
134435
|
-
TABLE_FOOTER_HEIGHT: 48,
|
|
134436
|
-
ROW_HEIGHT: 36,
|
|
134437
|
-
ROW_FONT_SIZE: 14,
|
|
134438
|
-
PAGINATION_CONTROLS_HEIGHT: 24,
|
|
134439
|
-
IMAGE_SIZE: 28,
|
|
134440
|
-
LINK_MENU_HEIGHT: 32,
|
|
134441
|
-
LINK_MENU_ICON_SIZE: IconSize$1.LARGE,
|
|
134442
|
-
ROW_PADDING: 2
|
|
134443
|
-
},
|
|
134444
|
-
[CompactMode.DEFAULT]: {
|
|
134445
|
-
COLUMN_HEADER_HEIGHT: 48,
|
|
134446
|
-
TABLE_HEADER_HEIGHT: 60,
|
|
134447
|
-
TABLE_FOOTER_HEIGHT: 48,
|
|
134448
|
-
ROW_HEIGHT: 48,
|
|
134449
|
-
ROW_FONT_SIZE: 14,
|
|
134450
|
-
PAGINATION_CONTROLS_HEIGHT: 32,
|
|
134451
|
-
IMAGE_SIZE: 32,
|
|
134452
|
-
LINK_MENU_HEIGHT: 36,
|
|
134453
|
-
LINK_MENU_ICON_SIZE: IconSize$1.XL,
|
|
134454
|
-
ROW_PADDING: 5
|
|
134455
|
-
},
|
|
134456
|
-
[CompactMode.TALL]: {
|
|
134457
|
-
COLUMN_HEADER_HEIGHT: 36,
|
|
134458
|
-
TABLE_HEADER_HEIGHT: 60,
|
|
134459
|
-
TABLE_FOOTER_HEIGHT: 60,
|
|
134460
|
-
ROW_HEIGHT: 58,
|
|
134461
|
-
ROW_FONT_SIZE: 14,
|
|
134462
|
-
PAGINATION_CONTROLS_HEIGHT: 36,
|
|
134463
|
-
IMAGE_SIZE: 36,
|
|
134464
|
-
LINK_MENU_HEIGHT: 36,
|
|
134465
|
-
LINK_MENU_ICON_SIZE: IconSize$1.XL,
|
|
134466
|
-
ROW_PADDING: 10
|
|
134467
|
-
}
|
|
134468
|
-
};
|
|
134469
|
-
const DEFAULT_TABLE_COLUMN_WIDTH = 150;
|
|
134470
|
-
const TABLE_COLUMN_MIN_WIDTH = 20;
|
|
134471
|
-
const PARSED_INPUT_TYPES = [
|
|
134472
|
-
EditInputType.Number,
|
|
134473
|
-
EditInputType.Checkbox
|
|
134474
|
-
];
|
|
134475
|
-
const TextBoxEditTypes = [
|
|
134476
|
-
EditInputType.Text,
|
|
134477
|
-
EditInputType.Number,
|
|
134478
|
-
EditInputType.Email
|
|
134479
|
-
];
|
|
134480
|
-
const DEFAULT_CELL_TEXT_STYLE_VARIANT = "body2";
|
|
134481
|
-
const DEFAULT_CELL_CLASS_NAME = getTextCssClassFromVariant(
|
|
134482
|
-
DEFAULT_CELL_TEXT_STYLE_VARIANT
|
|
134483
|
-
);
|
|
134484
|
-
const DEFAULT_HEADING_TEXT_STYLE_VARIANT = "heading3";
|
|
134485
|
-
const TABLE_COLUMN_HEADER_DEFAULT_TYPOGRAPHY = "heading6";
|
|
134486
|
-
var Condition0Type = /* @__PURE__ */ ((Condition0Type2) => {
|
|
134487
|
-
Condition0Type2["all"] = "all";
|
|
134488
|
-
Condition0Type2["isEmpty"] = "isEmpty";
|
|
134489
|
-
Condition0Type2["isNotEmpty"] = "isNotEmpty";
|
|
134490
|
-
Condition0Type2["isTrue"] = "isTrue";
|
|
134491
|
-
Condition0Type2["isFalse"] = "isFalse";
|
|
134492
|
-
return Condition0Type2;
|
|
134493
|
-
})(Condition0Type || {});
|
|
134494
|
-
var Condition1Type = /* @__PURE__ */ ((Condition1Type2) => {
|
|
134495
|
-
Condition1Type2["textIs"] = "textIs";
|
|
134496
|
-
Condition1Type2["textContains"] = "textContains";
|
|
134497
|
-
Condition1Type2["textDoesNotContain"] = "textDoesNotContain";
|
|
134498
|
-
Condition1Type2["textStartsWith"] = "textStartsWith";
|
|
134499
|
-
Condition1Type2["textEndsWith"] = "textEndsWith";
|
|
134500
|
-
Condition1Type2["isEqualTo"] = "isEqualTo";
|
|
134501
|
-
Condition1Type2["isNotEqualTo"] = "isNotEqualTo";
|
|
134502
|
-
Condition1Type2["isLessThan"] = "isLessThan";
|
|
134503
|
-
Condition1Type2["isLessThanOrEqualTo"] = "isLessThanOrEqualTo";
|
|
134504
|
-
Condition1Type2["isGreaterThan"] = "isGreaterThan";
|
|
134505
|
-
Condition1Type2["isGreaterThanOrEqualTo"] = "isGreaterThanOrEqualTo";
|
|
134506
|
-
Condition1Type2["dateIs"] = "dateIs";
|
|
134507
|
-
Condition1Type2["dateIsBefore"] = "dateIsBefore";
|
|
134508
|
-
Condition1Type2["dateIsAfter"] = "dateIsAfter";
|
|
134509
|
-
return Condition1Type2;
|
|
134510
|
-
})(Condition1Type || {});
|
|
134511
|
-
var Condition2Type = /* @__PURE__ */ ((Condition2Type2) => {
|
|
134512
|
-
Condition2Type2["isBetween"] = "isBetween";
|
|
134513
|
-
Condition2Type2["dateIsBetween"] = "dateIsBetween";
|
|
134514
|
-
return Condition2Type2;
|
|
134515
|
-
})(Condition2Type || {});
|
|
134516
|
-
const TABLE_MULTISELECT_COLID$1 = "SB_$$_MULTISELECT";
|
|
134517
|
-
const tagColorPalette = [
|
|
134518
|
-
"#27BBFF33",
|
|
134519
|
-
"#FF9F3533",
|
|
134520
|
-
"#14CDB733",
|
|
134521
|
-
"#7C4FF833",
|
|
134522
|
-
"#FF62A433",
|
|
134523
|
-
"#9D585833",
|
|
134524
|
-
"#FF484833"
|
|
134525
|
-
];
|
|
134526
135337
|
function useCachedValue(value, isEqualFn = lodashExports.isEqual) {
|
|
134527
135338
|
const cached = useRef(value);
|
|
134528
135339
|
if (cached.current !== value && !isEqualFn(cached.current, value)) {
|
|
@@ -136383,10 +137194,6 @@ const HeaderCellContentWrapper = qe$1.div`
|
|
|
136383
137194
|
var _a2, _b2;
|
|
136384
137195
|
return ((_a2 = props == null ? void 0 : props.columnProperties) == null ? void 0 : _a2.horizontalAlign) && JUSTIFY_CONTENT[(_b2 = props == null ? void 0 : props.columnProperties) == null ? void 0 : _b2.horizontalAlign];
|
|
136385
137196
|
}};
|
|
136386
|
-
|
|
136387
|
-
span {
|
|
136388
|
-
${({ shouldCapitalize }) => shouldCapitalize && `text-transform: capitalize;`}
|
|
136389
|
-
}
|
|
136390
137197
|
`;
|
|
136391
137198
|
const TableIconWrapper = qe$1.div`
|
|
136392
137199
|
width: ${(props) => props.tableSizes.TABLE_FOOTER_HEIGHT}px;
|
|
@@ -136557,11 +137364,11 @@ const StyledEmptyCheckbox = qe$1(SvgEmptyCheckbox)`
|
|
|
136557
137364
|
}
|
|
136558
137365
|
`;
|
|
136559
137366
|
const RadioButtonControlIcons = {
|
|
136560
|
-
|
|
136561
|
-
|
|
136562
|
-
|
|
136563
|
-
|
|
136564
|
-
|
|
137367
|
+
empty: (_props) => null,
|
|
137368
|
+
check: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(StyledCheckOutlined, { ...props }),
|
|
137369
|
+
close: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(StyledCloseOutlined, { ...props }),
|
|
137370
|
+
minus: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(StyledMinusOutlined, { ...props }),
|
|
137371
|
+
empty_checkbox: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
136565
137372
|
"span",
|
|
136566
137373
|
{
|
|
136567
137374
|
style: {
|
|
@@ -143581,14 +144388,14 @@ function getLoaderFn(options) {
|
|
|
143581
144388
|
if (!(loader === "all")) return [3, 3];
|
|
143582
144389
|
return [4, import(
|
|
143583
144390
|
/* webpackChunkName: "blueprint-icons-all-paths-loader" */
|
|
143584
|
-
"./allPathsLoader-
|
|
144391
|
+
"./allPathsLoader-D4nBGZ9l.js"
|
|
143585
144392
|
)];
|
|
143586
144393
|
case 2:
|
|
143587
144394
|
return [2, _b2.sent().allPathsLoader];
|
|
143588
144395
|
case 3:
|
|
143589
144396
|
return [4, import(
|
|
143590
144397
|
/* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
|
|
143591
|
-
"./splitPathsBySizeLoader-
|
|
144398
|
+
"./splitPathsBySizeLoader-CN949ATZ.js"
|
|
143592
144399
|
)];
|
|
143593
144400
|
case 4:
|
|
143594
144401
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -153899,7 +154706,7 @@ const renderCell = ({
|
|
|
153899
154706
|
);
|
|
153900
154707
|
}
|
|
153901
154708
|
if (typeof value === "boolean") {
|
|
153902
|
-
const ButtonIcon = value ? RadioButtonControlIcons["
|
|
154709
|
+
const ButtonIcon = value ? RadioButtonControlIcons["check"] : RadioButtonControlIcons[cellProps.booleanStyleFalse || "empty"];
|
|
153903
154710
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
153904
154711
|
CellWrapper,
|
|
153905
154712
|
{
|
|
@@ -153914,7 +154721,7 @@ const renderCell = ({
|
|
|
153914
154721
|
}
|
|
153915
154722
|
if (lodashExports.isString(value) && ["true", "false"].includes(value.toLocaleLowerCase())) {
|
|
153916
154723
|
const booleanValue = value.toLocaleLowerCase() === "true";
|
|
153917
|
-
const ButtonIcon = booleanValue ? RadioButtonControlIcons["
|
|
154724
|
+
const ButtonIcon = booleanValue ? RadioButtonControlIcons["check"] : RadioButtonControlIcons[cellProps.booleanStyleFalse || "empty"];
|
|
153918
154725
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
153919
154726
|
CellWrapper,
|
|
153920
154727
|
{
|
|
@@ -154297,11 +155104,12 @@ function getDefaultColumnProperties(accessor, index2, widgetName, isDerived) {
|
|
|
154297
155104
|
enableFilter: true,
|
|
154298
155105
|
enableSort: true,
|
|
154299
155106
|
isVisible: true,
|
|
154300
|
-
isDerived:
|
|
155107
|
+
isDerived: !!isDerived,
|
|
154301
155108
|
label: accessor,
|
|
154302
155109
|
computedValue: getDefaultComputedValue(
|
|
154303
155110
|
accessor,
|
|
154304
|
-
widgetName
|
|
155111
|
+
widgetName,
|
|
155112
|
+
isDerived ?? false
|
|
154305
155113
|
),
|
|
154306
155114
|
linkUrl: "",
|
|
154307
155115
|
linkLabel: "",
|
|
@@ -154318,6 +155126,9 @@ function getDefaultColumnProperties(accessor, index2, widgetName, isDerived) {
|
|
|
154318
155126
|
};
|
|
154319
155127
|
}
|
|
154320
155128
|
function getDefaultComputedValue(accessor, widgetName, isDerived) {
|
|
155129
|
+
if (isDerived) {
|
|
155130
|
+
return "";
|
|
155131
|
+
}
|
|
154321
155132
|
return `{{${widgetName}.tableDataWithInserts.map((currentRow) => { return currentRow${getDottedPathTo(
|
|
154322
155133
|
accessor
|
|
154323
155134
|
)} })}}`;
|
|
@@ -154445,7 +155256,8 @@ function createTableColumns(props) {
|
|
|
154445
155256
|
const defaultProperties = getDefaultColumnProperties(
|
|
154446
155257
|
derivedColumnKey,
|
|
154447
155258
|
index2,
|
|
154448
|
-
props.widgetName
|
|
155259
|
+
props.widgetName,
|
|
155260
|
+
true
|
|
154449
155261
|
);
|
|
154450
155262
|
tableColumns[derivedColumnKey] = {
|
|
154451
155263
|
...defaultProperties,
|
|
@@ -154548,20 +155360,6 @@ function getSelectedRows(props) {
|
|
|
154548
155360
|
const selectedRows = selectedRowIndices.map((ind) => filteredTableData[ind]).filter(Boolean);
|
|
154549
155361
|
return selectedRows;
|
|
154550
155362
|
}
|
|
154551
|
-
function getPageSize(props) {
|
|
154552
|
-
var _a2, _b2, _c2, _d2;
|
|
154553
|
-
if (props.configuredPageSize && typeof props.configuredPageSize === "number" && props.configuredPageSize > 0) {
|
|
154554
|
-
return props.configuredPageSize;
|
|
154555
|
-
}
|
|
154556
|
-
const compactMode = getCompactMode(props.compactMode);
|
|
154557
|
-
const componentHeight = ((_a2 = props == null ? void 0 : props.height) == null ? void 0 : _a2.mode) === "px" ? (_b2 = props == null ? void 0 : props.height) == null ? void 0 : _b2.value : (((_c2 = props == null ? void 0 : props.height) == null ? void 0 : _c2.value) ?? 0) * 12;
|
|
154558
|
-
const tableSizes = TABLE_SIZES[compactMode];
|
|
154559
|
-
const headerHeight = props.isSearchable || props.tableHeader || ((_d2 = props.hiddenColumns) == null ? void 0 : _d2.length) > 0 ? tableSizes.TABLE_HEADER_HEIGHT : 0;
|
|
154560
|
-
const scrollbarSize = 8;
|
|
154561
|
-
const mainHeight = (componentHeight ?? 100) - headerHeight - scrollbarSize - tableSizes.TABLE_FOOTER_HEIGHT - tableSizes.COLUMN_HEADER_HEIGHT;
|
|
154562
|
-
const pageSize = Math.floor(mainHeight / (tableSizes.ROW_HEIGHT + 1));
|
|
154563
|
-
return Math.max(pageSize, 1);
|
|
154564
|
-
}
|
|
154565
155363
|
function getFilteredTableData(props) {
|
|
154566
155364
|
var _a2;
|
|
154567
155365
|
if (!props.tableData) {
|
|
@@ -154758,20 +155556,22 @@ function getFilteredTableData(props) {
|
|
|
154758
155556
|
});
|
|
154759
155557
|
}
|
|
154760
155558
|
};
|
|
155559
|
+
const searchText = props.searchText ?? "";
|
|
154761
155560
|
const getSearchKey = () => {
|
|
154762
|
-
if (
|
|
154763
|
-
return
|
|
155561
|
+
if (searchText && props.enableClientSideSearch !== false) {
|
|
155562
|
+
return searchText.toLowerCase();
|
|
154764
155563
|
}
|
|
154765
155564
|
return "";
|
|
154766
155565
|
};
|
|
155566
|
+
const filters = props.filters;
|
|
154767
155567
|
const finalTableData = sortedTableData.filter((item) => {
|
|
154768
155568
|
var _a3;
|
|
154769
155569
|
const searchFound = getSearchKey() ? Object.values(item).join(", ").toLowerCase().includes(getSearchKey()) : true;
|
|
154770
155570
|
if (!searchFound) return false;
|
|
154771
155571
|
for (const [columnName, { byValue, condition }] of Object.entries(
|
|
154772
|
-
(
|
|
155572
|
+
(filters == null ? void 0 : filters.byColumn) ?? {}
|
|
154773
155573
|
)) {
|
|
154774
|
-
const column2 = props.columns[columnName];
|
|
155574
|
+
const column2 = ((_a3 = props.columns) == null ? void 0 : _a3[columnName]) ?? {};
|
|
154775
155575
|
const value = item[columnName];
|
|
154776
155576
|
if (byValue) {
|
|
154777
155577
|
const columnType = column2 && column2.columnType ? column2.columnType : "text";
|
|
@@ -154879,12 +155679,53 @@ function getFilteredTableData(props) {
|
|
|
154879
155679
|
}
|
|
154880
155680
|
const propertiesDefinition$9 = {
|
|
154881
155681
|
general: Section.category(PropsPanelCategory.Content).children({
|
|
154882
|
-
|
|
155682
|
+
header: Prop.string().readAndWrite().default("").propertiesPanel({
|
|
154883
155683
|
label: "Header",
|
|
154884
155684
|
placeholder: "Table name",
|
|
154885
155685
|
helpText: "A header displayed at the top of the table"
|
|
154886
155686
|
}),
|
|
154887
|
-
tableData: Prop.array().
|
|
155687
|
+
tableData: Prop.array().onEdit(({ sourceId, updates, widgetMeta }) => {
|
|
155688
|
+
try {
|
|
155689
|
+
const [previousWidget, newWidget] = getPreviousAndCurrentWidgetProps(updates, widgetMeta);
|
|
155690
|
+
if (lodashExports.isEqual(previousWidget == null ? void 0 : previousWidget.tableData, DEFAULT_TABLE_DATA)) {
|
|
155691
|
+
let updatedTableData = newWidget == null ? void 0 : newWidget.tableData;
|
|
155692
|
+
if (typeof updatedTableData === "string") {
|
|
155693
|
+
updatedTableData = JSON.parse(updatedTableData);
|
|
155694
|
+
}
|
|
155695
|
+
if (!Array.isArray(updatedTableData) || typeof updatedTableData[0] !== "object") {
|
|
155696
|
+
return {
|
|
155697
|
+
[sourceId]: {
|
|
155698
|
+
props: {
|
|
155699
|
+
columns: Property.Static({})
|
|
155700
|
+
},
|
|
155701
|
+
meta: {}
|
|
155702
|
+
}
|
|
155703
|
+
};
|
|
155704
|
+
}
|
|
155705
|
+
const colKeys = Object.keys(updatedTableData[0] ?? {});
|
|
155706
|
+
if (!lodashExports.isEqual(colKeys, DEFAULT_TABLE_KEYS)) {
|
|
155707
|
+
return {
|
|
155708
|
+
[sourceId]: {
|
|
155709
|
+
props: {
|
|
155710
|
+
columns: Property.Static(CLEARED_TABLE_COLUMNS)
|
|
155711
|
+
},
|
|
155712
|
+
meta: {}
|
|
155713
|
+
}
|
|
155714
|
+
};
|
|
155715
|
+
}
|
|
155716
|
+
}
|
|
155717
|
+
return {};
|
|
155718
|
+
} catch (_e2) {
|
|
155719
|
+
return {
|
|
155720
|
+
[sourceId]: {
|
|
155721
|
+
props: {
|
|
155722
|
+
columns: Property.Static(CLEARED_TABLE_COLUMNS)
|
|
155723
|
+
},
|
|
155724
|
+
meta: {}
|
|
155725
|
+
}
|
|
155726
|
+
};
|
|
155727
|
+
}
|
|
155728
|
+
}).readable().propertiesPanel({
|
|
154888
155729
|
label: "Data",
|
|
154889
155730
|
placeholder: '[{ "col1": "val1" }]',
|
|
154890
155731
|
isJSConvertible: false,
|
|
@@ -154917,8 +155758,15 @@ const propertiesDefinition$9 = {
|
|
|
154917
155758
|
helpText: "Enable per column filtering"
|
|
154918
155759
|
}),
|
|
154919
155760
|
defaultFilters: Prop.any().readAndWrite().propertiesPanel({
|
|
154920
|
-
|
|
154921
|
-
|
|
155761
|
+
controlType: "COMPUTED_CODE_EDITOR",
|
|
155762
|
+
label: "Default filters",
|
|
155763
|
+
visibility: "SHOW_NAME",
|
|
155764
|
+
isJSConvertible: false,
|
|
155765
|
+
isRemovable: true,
|
|
155766
|
+
helpText: "Allows specifying the filters that will be used on page load",
|
|
155767
|
+
isVisible: function() {
|
|
155768
|
+
return this.isFilterable && this.pageType !== "server_side";
|
|
155769
|
+
}
|
|
154922
155770
|
}),
|
|
154923
155771
|
// enableRowInsertion: Prop.boolean()
|
|
154924
155772
|
// .readAndWrite()
|
|
@@ -154946,37 +155794,46 @@ const propertiesDefinition$9 = {
|
|
|
154946
155794
|
label: "CSV download",
|
|
154947
155795
|
helpText: "Enable CSV download"
|
|
154948
155796
|
}),
|
|
154949
|
-
|
|
155797
|
+
paginationType: Prop.string().default("none").readAndWrite().propertiesPanel({
|
|
154950
155798
|
label: "Pagination type",
|
|
154951
155799
|
controlType: "DROP_DOWN",
|
|
154952
155800
|
helpText: "For server side pagination bind the Table.pageNo property in your API and call it onPageChange",
|
|
154953
155801
|
options: [
|
|
154954
|
-
{ label: "None", value:
|
|
154955
|
-
{ label: "Client side", value:
|
|
154956
|
-
{ label: "Server side", value:
|
|
155802
|
+
{ label: "None", value: "none" },
|
|
155803
|
+
{ label: "Client side", value: "client_side" },
|
|
155804
|
+
{ label: "Server side", value: "server_side" }
|
|
154957
155805
|
]
|
|
154958
155806
|
}),
|
|
154959
|
-
configuredPageSize: Prop.
|
|
155807
|
+
configuredPageSize: Prop.any().readAndWrite().propertiesPanel({
|
|
154960
155808
|
label: "Page size",
|
|
154961
155809
|
helpText: "Sets the number of items per page. If set to 'Auto', this value will be calculated based on the height of the table.",
|
|
154962
155810
|
controlType: "DROP_DOWN",
|
|
154963
155811
|
options: [
|
|
154964
|
-
{
|
|
155812
|
+
{
|
|
155813
|
+
label: "Auto",
|
|
155814
|
+
value: "auto"
|
|
155815
|
+
},
|
|
154965
155816
|
{ label: "5", value: 5 },
|
|
154966
155817
|
{ label: "10", value: 10 },
|
|
154967
155818
|
{ label: "20", value: 20 },
|
|
154968
155819
|
{ label: "50", value: 50 }
|
|
154969
|
-
]
|
|
155820
|
+
],
|
|
155821
|
+
isVisible: function() {
|
|
155822
|
+
return this.paginationType === "client_side";
|
|
155823
|
+
}
|
|
154970
155824
|
}),
|
|
154971
155825
|
defaultSort: Prop.composite({
|
|
154972
|
-
|
|
154973
|
-
column: Prop.string().default("name").propertiesPanel({
|
|
155826
|
+
column: Prop.string().propertiesPanel({
|
|
154974
155827
|
label: "Column",
|
|
154975
155828
|
controlType: "SELECT_TABLE_COLUMN"
|
|
154976
155829
|
}),
|
|
154977
155830
|
asc: Prop.boolean().default(true).propertiesPanel({
|
|
154978
155831
|
label: "Order",
|
|
154979
|
-
controlType: "RADIO_BUTTON_GROUP"
|
|
155832
|
+
controlType: "RADIO_BUTTON_GROUP",
|
|
155833
|
+
options: [
|
|
155834
|
+
{ label: "Ascending", value: true },
|
|
155835
|
+
{ label: "Descending", value: false }
|
|
155836
|
+
]
|
|
154980
155837
|
})
|
|
154981
155838
|
}).propertiesPanel({
|
|
154982
155839
|
label: "Default sort",
|
|
@@ -154989,7 +155846,10 @@ const propertiesDefinition$9 = {
|
|
|
154989
155846
|
}),
|
|
154990
155847
|
defaultSearchText: Prop.string().readAndWrite().propertiesPanel({
|
|
154991
155848
|
label: "Default search",
|
|
154992
|
-
helpText: "Sets the default search text"
|
|
155849
|
+
helpText: "Sets the default search text",
|
|
155850
|
+
isVisible: function() {
|
|
155851
|
+
return this.enableClientSideSearch !== false;
|
|
155852
|
+
}
|
|
154993
155853
|
}),
|
|
154994
155854
|
searchPlaceholder: Prop.string().readAndWrite().propertiesPanel({
|
|
154995
155855
|
label: "Search placeholder",
|
|
@@ -155017,17 +155877,13 @@ const propertiesDefinition$9 = {
|
|
|
155017
155877
|
label: "Cell style",
|
|
155018
155878
|
controlType: "TEXT_STYLE"
|
|
155019
155879
|
}),
|
|
155020
|
-
backgroundColor:
|
|
155880
|
+
backgroundColor: colorProp({
|
|
155021
155881
|
label: "Background color",
|
|
155022
|
-
helpText: "Sets the background color of the table"
|
|
155023
|
-
controlType: "COLOR_PICKER"
|
|
155024
|
-
// themeValue: "{{ theme.colors.neutral }}",
|
|
155882
|
+
helpText: "Sets the background color of the table"
|
|
155025
155883
|
}),
|
|
155026
|
-
selectedRowBackgroundColor:
|
|
155884
|
+
selectedRowBackgroundColor: colorProp({
|
|
155027
155885
|
label: "Selected row background color",
|
|
155028
|
-
helpText: "Sets the background color of the selected row"
|
|
155029
|
-
controlType: "COLOR_PICKER"
|
|
155030
|
-
// themeValue: "{{ theme.colors.neutral50 }}",
|
|
155886
|
+
helpText: "Sets the background color of the selected row"
|
|
155031
155887
|
}),
|
|
155032
155888
|
border: border({ helpText: "Sets the border of the table" }),
|
|
155033
155889
|
borderRadius: borderRadius({
|
|
@@ -155079,11 +155935,9 @@ const propertiesDefinition$9 = {
|
|
|
155079
155935
|
label: "Search",
|
|
155080
155936
|
controlType: "TEXT_STYLE"
|
|
155081
155937
|
}),
|
|
155082
|
-
"searchProps.backgroundColor":
|
|
155938
|
+
"searchProps.backgroundColor": colorProp({
|
|
155083
155939
|
label: "Search background color",
|
|
155084
|
-
helpText: "Sets the background color of the search"
|
|
155085
|
-
controlType: "COLOR_PICKER"
|
|
155086
|
-
// themeValue:"{{ theme.colors.neutral }}",
|
|
155940
|
+
helpText: "Sets the background color of the search"
|
|
155087
155941
|
}),
|
|
155088
155942
|
"searchProps.border": border({
|
|
155089
155943
|
label: "Search border",
|
|
@@ -155135,7 +155989,6 @@ const propertiesDefinition$9 = {
|
|
|
155135
155989
|
selectedRow: Prop.any().readable().default(getSelectedRow),
|
|
155136
155990
|
selectedRowSchema: Prop.any().readable().default(getSelectedRowSchema),
|
|
155137
155991
|
selectedRows: Prop.any().readable().default(getSelectedRows),
|
|
155138
|
-
pageSize: Prop.number().readable().default(getPageSize),
|
|
155139
155992
|
filteredTableData: Prop.any().readable().default(function() {
|
|
155140
155993
|
if (!this) return [];
|
|
155141
155994
|
return getFilteredTableData(this)[0];
|
|
@@ -155150,15 +156003,23 @@ const propertiesDefinition$9 = {
|
|
|
155150
156003
|
// editedRowIndices: Prop.any().readable().default(getEditedRowIndices),
|
|
155151
156004
|
}),
|
|
155152
156005
|
meta: Section.category(PropsPanelCategory.Meta).children({
|
|
155153
|
-
selectedRowIndex: Prop.number().readable()
|
|
156006
|
+
selectedRowIndex: Prop.number().readable().default(function() {
|
|
156007
|
+
return this.defaultSelectedRow;
|
|
156008
|
+
}),
|
|
155154
156009
|
selectedRowIndices: Prop.any().readable(),
|
|
155155
|
-
|
|
155156
|
-
|
|
155157
|
-
|
|
155158
|
-
|
|
156010
|
+
sortedColumn: Prop.any().readable().default(function() {
|
|
156011
|
+
return this.defaultSort;
|
|
156012
|
+
}),
|
|
156013
|
+
searchText: Prop.string().readable().default(function() {
|
|
156014
|
+
return this.defaultSearchText ?? "";
|
|
156015
|
+
}),
|
|
156016
|
+
filters: Prop.any().readable().default(function() {
|
|
156017
|
+
return this.defaultFilters;
|
|
156018
|
+
}),
|
|
155159
156019
|
hiddenColumns: Prop.any().readable(),
|
|
155160
156020
|
columnFreezes: Prop.any().readable(),
|
|
155161
|
-
tagsColorAssignment: Prop.any().readable()
|
|
156021
|
+
tagsColorAssignment: Prop.any().readable(),
|
|
156022
|
+
pageNo: Prop.number().readable().default(() => 0)
|
|
155162
156023
|
// editOverrides: Prop.any().readable(),
|
|
155163
156024
|
// currentEditFocus: Prop.any().readable(),
|
|
155164
156025
|
// currentEditDropdownSearchText: Prop.string().default("").readable(),
|
|
@@ -164627,11 +165488,11 @@ const TableDataDownload = ({
|
|
|
164627
165488
|
columns,
|
|
164628
165489
|
tableSizes,
|
|
164629
165490
|
widgetName,
|
|
164630
|
-
|
|
165491
|
+
header,
|
|
164631
165492
|
tableCellTextStyle
|
|
164632
165493
|
}) => {
|
|
164633
165494
|
const [selected, setSelected] = React__default.useState(false);
|
|
164634
|
-
const tableName =
|
|
165495
|
+
const tableName = header ? header : widgetName;
|
|
164635
165496
|
const fileName = tableName;
|
|
164636
165497
|
const handleSelectMenu = useCallback(() => {
|
|
164637
165498
|
setSelected(true);
|
|
@@ -164863,13 +165724,13 @@ const TablePagination = ({
|
|
|
164863
165724
|
prevPageClick,
|
|
164864
165725
|
pageCount,
|
|
164865
165726
|
pageNo,
|
|
164866
|
-
|
|
165727
|
+
paginationType,
|
|
164867
165728
|
updatePageNo,
|
|
164868
165729
|
tableSizes,
|
|
164869
165730
|
theme
|
|
164870
165731
|
}) => {
|
|
164871
|
-
switch (
|
|
164872
|
-
case
|
|
165732
|
+
switch (paginationType) {
|
|
165733
|
+
case "server_side":
|
|
164873
165734
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
164874
165735
|
TableServerPagination,
|
|
164875
165736
|
{
|
|
@@ -164880,7 +165741,7 @@ const TablePagination = ({
|
|
|
164880
165741
|
themeColors: theme.colors
|
|
164881
165742
|
}
|
|
164882
165743
|
);
|
|
164883
|
-
case
|
|
165744
|
+
case "client_side":
|
|
164884
165745
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
164885
165746
|
TableClientPagination,
|
|
164886
165747
|
{
|
|
@@ -164964,11 +165825,11 @@ const TableFooter = ({
|
|
|
164964
165825
|
prevPageClick,
|
|
164965
165826
|
pageNo,
|
|
164966
165827
|
pageCount,
|
|
164967
|
-
|
|
165828
|
+
paginationType,
|
|
164968
165829
|
tableColumns,
|
|
164969
165830
|
tableData,
|
|
164970
165831
|
filteredOrderMap,
|
|
164971
|
-
|
|
165832
|
+
header,
|
|
164972
165833
|
tableSizes,
|
|
164973
165834
|
borderColor,
|
|
164974
165835
|
updatePageNo,
|
|
@@ -165132,11 +165993,11 @@ const TableFooter = ({
|
|
|
165132
165993
|
columns: tableColumns,
|
|
165133
165994
|
widgetName,
|
|
165134
165995
|
tableSizes,
|
|
165135
|
-
|
|
165996
|
+
header,
|
|
165136
165997
|
tableCellTextStyle
|
|
165137
165998
|
}
|
|
165138
165999
|
),
|
|
165139
|
-
|
|
166000
|
+
paginationType !== "server_side" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
165140
166001
|
RowWrapper,
|
|
165141
166002
|
{
|
|
165142
166003
|
className: `${CLASS_NAMES.BUILTIN_BODY} show-page-items`,
|
|
@@ -165158,7 +166019,7 @@ const TableFooter = ({
|
|
|
165158
166019
|
prevPageClick,
|
|
165159
166020
|
pageNo,
|
|
165160
166021
|
pageCount,
|
|
165161
|
-
|
|
166022
|
+
paginationType,
|
|
165162
166023
|
currentPageIndex,
|
|
165163
166024
|
tableSizes,
|
|
165164
166025
|
theme
|
|
@@ -167233,8 +168094,9 @@ const DescendingIcon = qe$1(SvgSort)`
|
|
|
167233
168094
|
}
|
|
167234
168095
|
`;
|
|
167235
168096
|
const TableHeaderCell = (props) => {
|
|
167236
|
-
var _a2
|
|
168097
|
+
var _a2;
|
|
167237
168098
|
const { column: column2, selectRows } = props;
|
|
168099
|
+
const resizerProps = column2.getResizerProps();
|
|
167238
168100
|
const resizingColumnId = useRef("");
|
|
167239
168101
|
const handleSortColumn = () => {
|
|
167240
168102
|
if (!props.isSortable || props.isResizingColumn) return;
|
|
@@ -167250,7 +168112,6 @@ const TableHeaderCell = (props) => {
|
|
|
167250
168112
|
defaultTextStyleVariant: TABLE_COLUMN_HEADER_DEFAULT_TYPOGRAPHY,
|
|
167251
168113
|
textStyle: props.columnHeaderProps
|
|
167252
168114
|
});
|
|
167253
|
-
const columnHeaderTextStyleHasTextTransform = ((_a2 = columnHeaderStyleProps == null ? void 0 : columnHeaderStyleProps.style) == null ? void 0 : _a2.textTransform) !== void 0 && ((_b2 = columnHeaderStyleProps == null ? void 0 : columnHeaderStyleProps.style) == null ? void 0 : _b2.textTransform) !== "none";
|
|
167254
168115
|
const { setColumnFilter } = props;
|
|
167255
168116
|
const setFilter = useCallback(
|
|
167256
168117
|
(filter2) => {
|
|
@@ -167312,7 +168173,6 @@ const TableHeaderCell = (props) => {
|
|
|
167312
168173
|
HeaderCellContentWrapper,
|
|
167313
168174
|
{
|
|
167314
168175
|
columnProperties: props.columnProperties,
|
|
167315
|
-
shouldCapitalize: !columnHeaderTextStyleHasTextTransform && props.columnName === column2.id,
|
|
167316
168176
|
style: columnHeaderStyleProps.style,
|
|
167317
168177
|
className: `${getTextCssClassFromVariant(
|
|
167318
168178
|
columnHeaderStyleProps.textStyleVariant
|
|
@@ -167338,23 +168198,23 @@ const TableHeaderCell = (props) => {
|
|
|
167338
168198
|
e3.stopPropagation();
|
|
167339
168199
|
},
|
|
167340
168200
|
onDragOver: (e3) => {
|
|
167341
|
-
var _a3,
|
|
168201
|
+
var _a3, _b2;
|
|
167342
168202
|
if (props.columnIndex !== props.mutableHeaderDragRef.current && props.mutableHeaderDragRef.current !== -1) {
|
|
167343
168203
|
if (props.mutableHeaderDragRef.current > props.columnIndex) {
|
|
167344
168204
|
(_a3 = parentRef.current) == null ? void 0 : _a3.classList.add("highlight-left");
|
|
167345
168205
|
} else if (props.mutableHeaderDragRef.current < props.columnIndex) {
|
|
167346
|
-
(
|
|
168206
|
+
(_b2 = parentRef.current) == null ? void 0 : _b2.classList.add("highlight-right");
|
|
167347
168207
|
}
|
|
167348
168208
|
}
|
|
167349
168209
|
e3.preventDefault();
|
|
167350
168210
|
},
|
|
167351
168211
|
onDragEnter: (e3) => {
|
|
167352
|
-
var _a3,
|
|
168212
|
+
var _a3, _b2;
|
|
167353
168213
|
if (props.columnIndex !== props.mutableHeaderDragRef.current && props.mutableHeaderDragRef.current !== -1) {
|
|
167354
168214
|
if (props.mutableHeaderDragRef.current > props.columnIndex) {
|
|
167355
168215
|
(_a3 = parentRef.current) == null ? void 0 : _a3.classList.add("highlight-left");
|
|
167356
168216
|
} else if (props.mutableHeaderDragRef.current < props.columnIndex) {
|
|
167357
|
-
(
|
|
168217
|
+
(_b2 = parentRef.current) == null ? void 0 : _b2.classList.add("highlight-right");
|
|
167358
168218
|
}
|
|
167359
168219
|
}
|
|
167360
168220
|
e3.preventDefault();
|
|
@@ -167406,7 +168266,7 @@ const TableHeaderCell = (props) => {
|
|
|
167406
168266
|
isFrozen: getIsColumnFrozen(
|
|
167407
168267
|
props.column.id,
|
|
167408
168268
|
props.columnFreezes,
|
|
167409
|
-
(
|
|
168269
|
+
(_a2 = props.columnProperties) == null ? void 0 : _a2.isFrozen
|
|
167410
168270
|
),
|
|
167411
168271
|
theme: props.theme,
|
|
167412
168272
|
updateProperty: props.updateProperty
|
|
@@ -167415,11 +168275,21 @@ const TableHeaderCell = (props) => {
|
|
|
167415
168275
|
props.showResizer && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
167416
168276
|
"div",
|
|
167417
168277
|
{
|
|
167418
|
-
...
|
|
168278
|
+
...resizerProps,
|
|
167419
168279
|
className: `resizer ${column2.isResizing ? "isResizing" : ""}`,
|
|
167420
168280
|
onClick: (e3) => {
|
|
167421
168281
|
e3.preventDefault();
|
|
167422
168282
|
e3.stopPropagation();
|
|
168283
|
+
},
|
|
168284
|
+
onMouseDown: (e3) => {
|
|
168285
|
+
resizerProps.onMouseDown(e3);
|
|
168286
|
+
e3.stopPropagation();
|
|
168287
|
+
e3.preventDefault();
|
|
168288
|
+
},
|
|
168289
|
+
onTouchStart: (e3) => {
|
|
168290
|
+
resizerProps.onTouchStart(e3);
|
|
168291
|
+
e3.stopPropagation();
|
|
168292
|
+
e3.preventDefault();
|
|
167423
168293
|
}
|
|
167424
168294
|
}
|
|
167425
168295
|
)
|
|
@@ -168020,10 +168890,10 @@ const Table = (props) => {
|
|
|
168020
168890
|
const selectedRowIndex = props.selectedRowIndex;
|
|
168021
168891
|
const selectedRowIndices = props.selectedRowIndices || [];
|
|
168022
168892
|
const canDelete = props.isDeletionEnabled && (selectedRowIndices.length > 0 || selectedRowIndex != null && selectedRowIndex >= 0);
|
|
168023
|
-
const hasFooter = props.
|
|
168024
|
-
const hasHeader = props.isSearchable || !lodashExports.isEmpty(props.
|
|
168025
|
-
const pageSize = props.
|
|
168026
|
-
const pageCount = Math.ceil(props.tableData.length / pageSize);
|
|
168893
|
+
const hasFooter = props.paginationType !== "none" || props.isDownloadable || props.numEdits != null && props.numEdits > 0 || props.isInsertionEnabled || canDelete;
|
|
168894
|
+
const hasHeader = props.isSearchable || !lodashExports.isEmpty(props.header) || props.hiddenColumns && ((_a2 = props.hiddenColumns) == null ? void 0 : _a2.length) > 0;
|
|
168895
|
+
const pageSize = props.paginationType === "none" ? props.tableData.length : props.pageSize;
|
|
168896
|
+
const pageCount = Math.ceil(props.tableData.length / pageSize) || 1;
|
|
168027
168897
|
const currentPageIndex = props.pageNo < pageCount ? props.pageNo : 0;
|
|
168028
168898
|
const {
|
|
168029
168899
|
getTableProps,
|
|
@@ -168053,7 +168923,7 @@ const Table = (props) => {
|
|
|
168053
168923
|
);
|
|
168054
168924
|
let startIndex = currentPageIndex * pageSize;
|
|
168055
168925
|
let endIndex = startIndex + pageSize;
|
|
168056
|
-
if (props.
|
|
168926
|
+
if (props.paginationType === "server_side") {
|
|
168057
168927
|
startIndex = 0;
|
|
168058
168928
|
endIndex = props.tableData.length;
|
|
168059
168929
|
}
|
|
@@ -168604,7 +169474,7 @@ const Table = (props) => {
|
|
|
168604
169474
|
showFrozenColShadow,
|
|
168605
169475
|
tabIndex: 0,
|
|
168606
169476
|
className: CLASS_NAMES.DEFAULT_CONTAINER,
|
|
168607
|
-
showColumnBorders: props.showColumnBorders && (props.
|
|
169477
|
+
showColumnBorders: props.showColumnBorders && (props.paginationType !== "none" || subPage.length > 0),
|
|
168608
169478
|
colors: theme.colors,
|
|
168609
169479
|
onKeyDown: handleKeyDown,
|
|
168610
169480
|
"data-selecting-cells": tableManager.focusedCellIndices.length > 0,
|
|
@@ -168619,7 +169489,7 @@ const Table = (props) => {
|
|
|
168619
169489
|
searchKey: props.searchKey,
|
|
168620
169490
|
tableSizes,
|
|
168621
169491
|
compactMode: getCompactMode(props.compactMode),
|
|
168622
|
-
title: props.
|
|
169492
|
+
title: props.header,
|
|
168623
169493
|
columns: props.columns,
|
|
168624
169494
|
hiddenColumns: props.hiddenColumns,
|
|
168625
169495
|
searchPlaceholder: props.searchPlaceholder,
|
|
@@ -168692,7 +169562,7 @@ const Table = (props) => {
|
|
|
168692
169562
|
columnProperties: column2.columnProperties,
|
|
168693
169563
|
rawTableData: props.rawTableData,
|
|
168694
169564
|
transformedTableData: props.tableData,
|
|
168695
|
-
isFilterable: props.isFilterable && props.
|
|
169565
|
+
isFilterable: props.isFilterable && props.paginationType !== "server_side",
|
|
168696
169566
|
filter: (_b3 = (_a3 = props.filters) == null ? void 0 : _a3.byColumn) == null ? void 0 : _b3[column2.id],
|
|
168697
169567
|
setColumnFilter: props.setColumnFilter,
|
|
168698
169568
|
isHidden: column2.isHidden,
|
|
@@ -168768,11 +169638,11 @@ const Table = (props) => {
|
|
|
168768
169638
|
prevPageClick: props.prevPageClick,
|
|
168769
169639
|
pageNo: props.pageNo,
|
|
168770
169640
|
pageCount,
|
|
168771
|
-
|
|
169641
|
+
paginationType: props.paginationType,
|
|
168772
169642
|
tableColumns: props.columns,
|
|
168773
169643
|
tableData: props.tableData,
|
|
168774
169644
|
filteredOrderMap: props.filteredOrderMap,
|
|
168775
|
-
|
|
169645
|
+
header: props.header,
|
|
168776
169646
|
tableSizes,
|
|
168777
169647
|
updatePageNo: props.updatePageNo,
|
|
168778
169648
|
widgetName: props.widgetName,
|
|
@@ -169397,14 +170267,14 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
169397
170267
|
__publicField(this, "getTopVisibleIndex", () => {
|
|
169398
170268
|
const page = this.props.pageNo || 1;
|
|
169399
170269
|
const pageSize = this.props.pageSize || 1;
|
|
169400
|
-
const isPaginated = this.props.
|
|
170270
|
+
const isPaginated = this.props.paginationType !== "none";
|
|
169401
170271
|
return isPaginated ? (page - 1) * pageSize : 0;
|
|
169402
170272
|
});
|
|
169403
170273
|
__publicField(this, "getBottomVisibleIndex", () => {
|
|
169404
170274
|
const allEdits = this.props.allEdits ?? [];
|
|
169405
170275
|
const page = this.props.pageNo || 1;
|
|
169406
170276
|
const pageSize = this.props.pageSize || 1;
|
|
169407
|
-
const isPaginated = this.props.
|
|
170277
|
+
const isPaginated = this.props.paginationType !== "none";
|
|
169408
170278
|
return isPaginated ? Math.min(allEdits.length - 1, page * pageSize - 1) : allEdits.length - 1;
|
|
169409
170279
|
});
|
|
169410
170280
|
__publicField(this, "handlePaste", (event) => {
|
|
@@ -169464,7 +170334,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
169464
170334
|
);
|
|
169465
170335
|
const data2 = [];
|
|
169466
170336
|
let largestRow = 0;
|
|
169467
|
-
const isMultiPage = this.props.
|
|
170337
|
+
const isMultiPage = this.props.paginationType === "server_side" || this.props.paginationType === "client_side";
|
|
169468
170338
|
const page = this.props.pageNo || 1;
|
|
169469
170339
|
const pageSize = this.props.pageSize || 1;
|
|
169470
170340
|
for (const cell of this.currentCellFocus ?? []) {
|
|
@@ -169582,6 +170452,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
169582
170452
|
}
|
|
169583
170453
|
});
|
|
169584
170454
|
__publicField(this, "handleEditStart", (rowIndex, columnId, startingValue) => {
|
|
170455
|
+
this.props.disableDrag(true);
|
|
169585
170456
|
this.props.disableNudge(true);
|
|
169586
170457
|
this.props.setCurrentEditFocus({ row: rowIndex, columnId }, startingValue);
|
|
169587
170458
|
});
|
|
@@ -169898,7 +170769,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
169898
170769
|
}
|
|
169899
170770
|
if (relativePosition === tableData.length) {
|
|
169900
170771
|
setTimeout(() => {
|
|
169901
|
-
if (this.props.
|
|
170772
|
+
if (this.props.paginationType === "none") {
|
|
169902
170773
|
const tableScroller = this.getTableScroller();
|
|
169903
170774
|
tableScroller == null ? void 0 : tableScroller.scrollTo({
|
|
169904
170775
|
top: (tableScroller == null ? void 0 : tableScroller.scrollHeight) + 40,
|
|
@@ -170373,7 +171244,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
170373
171244
|
columnSizeMap: this.props.columnSizeMap,
|
|
170374
171245
|
pageNo,
|
|
170375
171246
|
pageSize: Math.max(1, pageSize),
|
|
170376
|
-
|
|
171247
|
+
paginationType: this.props.paginationType || "none",
|
|
170377
171248
|
selectedRowIndex: this.props.multiRowSelection ? -1 : this.props.selectedRowIndex ?? -1,
|
|
170378
171249
|
multiRowSelection: this.props.multiRowSelection,
|
|
170379
171250
|
selectedRowIndices: this.getComputedSelectedRowIndices(),
|
|
@@ -170385,19 +171256,18 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
170385
171256
|
handleResizeColumn: this.handleResizeColumn,
|
|
170386
171257
|
updatePageNo: this.updatePageNumber,
|
|
170387
171258
|
handleReorderColumn: this.handleReorderColumn,
|
|
170388
|
-
disableDrag:
|
|
170389
|
-
},
|
|
171259
|
+
disableDrag: this.props.disableDrag,
|
|
170390
171260
|
searchTableData: this.handleSearchTable,
|
|
170391
171261
|
filters: this.props.filters,
|
|
170392
171262
|
setColumnFilter: this.handleSetColumnFilter,
|
|
170393
171263
|
compactMode: getCompactMode(this.props.compactMode),
|
|
170394
171264
|
showColumnBorders: this.props.showColumnBorders,
|
|
170395
171265
|
sortTableColumn: this.handleColumnSorting,
|
|
170396
|
-
isSortable: this.props.
|
|
171266
|
+
isSortable: this.props.paginationType !== "server_side",
|
|
170397
171267
|
isSearchable: this.props.isSearchable,
|
|
170398
171268
|
isDownloadable: this.props.isDownloadable,
|
|
170399
171269
|
isFilterable: this.props.isFilterable,
|
|
170400
|
-
|
|
171270
|
+
header: this.props.header,
|
|
170401
171271
|
hiddenColumns: this.props.hiddenColumns ?? [],
|
|
170402
171272
|
columnFreezes: this.props.columnFreezes ?? {},
|
|
170403
171273
|
numEdits,
|
|
@@ -170513,6 +171383,7 @@ const SbTable = registerSbComponent(
|
|
|
170513
171383
|
propertiesDefinition: propertiesDefinition$9
|
|
170514
171384
|
},
|
|
170515
171385
|
(props) => {
|
|
171386
|
+
var _a2;
|
|
170516
171387
|
const { update } = useActions();
|
|
170517
171388
|
const { features } = useEditor();
|
|
170518
171389
|
const { theme } = useTheme();
|
|
@@ -170549,7 +171420,8 @@ const SbTable = registerSbComponent(
|
|
|
170549
171420
|
);
|
|
170550
171421
|
const setPageNo = useCallback(
|
|
170551
171422
|
(value, rowContext, triggerEventHandlers = false) => {
|
|
170552
|
-
|
|
171423
|
+
const newPageNo = Math.max(value - 1, 0);
|
|
171424
|
+
update((e3) => e3.pageNo = newPageNo);
|
|
170553
171425
|
if (triggerEventHandlers) {
|
|
170554
171426
|
onPageChange == null ? void 0 : onPageChange(rowContext);
|
|
170555
171427
|
}
|
|
@@ -170665,9 +171537,9 @@ const SbTable = registerSbComponent(
|
|
|
170665
171537
|
return [
|
|
170666
171538
|
key22,
|
|
170667
171539
|
async (args) => {
|
|
170668
|
-
var
|
|
171540
|
+
var _a3;
|
|
170669
171541
|
await (value == null ? void 0 : value(args.context));
|
|
170670
|
-
(
|
|
171542
|
+
(_a3 = args.onComplete) == null ? void 0 : _a3.call(args);
|
|
170671
171543
|
}
|
|
170672
171544
|
];
|
|
170673
171545
|
}
|
|
@@ -170685,27 +171557,59 @@ const SbTable = registerSbComponent(
|
|
|
170685
171557
|
},
|
|
170686
171558
|
[features.nudging]
|
|
170687
171559
|
);
|
|
171560
|
+
const [pageSize, setPageSize] = useState(props.configuredPageSize);
|
|
171561
|
+
useEffect(() => {
|
|
171562
|
+
setPageSize(props.configuredPageSize);
|
|
171563
|
+
}, [props.configuredPageSize]);
|
|
171564
|
+
const autoPageSize = useMemo$2(() => {
|
|
171565
|
+
var _a3, _b2;
|
|
171566
|
+
if (typeof pageSize === "number" && pageSize > 0) return pageSize;
|
|
171567
|
+
if (((_a3 = props.height) == null ? void 0 : _a3.mode) === "px" && typeof props.height.value === "number") {
|
|
171568
|
+
const compactMode = getCompactMode(props.compactMode);
|
|
171569
|
+
const tableSizes = TABLE_SIZES[compactMode];
|
|
171570
|
+
const componentHeight = props.height.value;
|
|
171571
|
+
const headerHeight = props.isSearchable || props.tableHeader || ((_b2 = props.hiddenColumns) == null ? void 0 : _b2.length) > 0 ? tableSizes.TABLE_HEADER_HEIGHT : 0;
|
|
171572
|
+
const scrollbarSize = 8;
|
|
171573
|
+
const mainHeight = componentHeight - headerHeight - scrollbarSize - tableSizes.TABLE_FOOTER_HEIGHT - tableSizes.COLUMN_HEADER_HEIGHT;
|
|
171574
|
+
return Math.floor(mainHeight / (tableSizes.ROW_HEIGHT + 1));
|
|
171575
|
+
}
|
|
171576
|
+
return 10;
|
|
171577
|
+
}, [
|
|
171578
|
+
pageSize,
|
|
171579
|
+
props.height,
|
|
171580
|
+
props.compactMode,
|
|
171581
|
+
(_a2 = props.hiddenColumns) == null ? void 0 : _a2.length,
|
|
171582
|
+
props.isSearchable,
|
|
171583
|
+
props.tableHeader
|
|
171584
|
+
]);
|
|
171585
|
+
const disableDrag = useCallback(
|
|
171586
|
+
(disable) => {
|
|
171587
|
+
features.dragAndDrop.set(!disable);
|
|
171588
|
+
},
|
|
171589
|
+
[features.dragAndDrop]
|
|
171590
|
+
);
|
|
170688
171591
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ...passthroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
170689
171592
|
TableWidget,
|
|
170690
171593
|
{
|
|
170691
171594
|
...props,
|
|
171595
|
+
pageSize: autoPageSize,
|
|
170692
171596
|
enableRowInsertion: false,
|
|
170693
171597
|
enableRowDeletion: false,
|
|
170694
|
-
defaultSearchText: props.defaultSearchText ?? "",
|
|
170695
171598
|
searchPlaceholder: props.searchPlaceholder ?? "",
|
|
170696
171599
|
searchText: props.searchText ?? "",
|
|
170697
|
-
|
|
171600
|
+
paginationType: props.paginationType,
|
|
170698
171601
|
columns: transformedColumns,
|
|
170699
|
-
|
|
170700
|
-
|
|
171602
|
+
filters: props.filters ?? EMPTY_OBJ,
|
|
171603
|
+
header: props.header ?? "",
|
|
170701
171604
|
tableData: props.tableData ?? EMPTY_ARRAY,
|
|
170702
171605
|
currentEditDropdownSearchText: props.currentEditDropdownSearchText,
|
|
170703
171606
|
selectedRowIndices: props.selectedRowIndices ?? EMPTY_ARRAY,
|
|
170704
171607
|
showColumnBorders: props.showColumnBorders ?? false,
|
|
170705
171608
|
compactMode: getCompactMode(props.compactMode),
|
|
170706
|
-
border: props.border ?? theme.defaultBorder,
|
|
171609
|
+
border: props.border ?? createPerSideBorder(theme.defaultBorder),
|
|
170707
171610
|
borderRadius: props.borderRadius ?? theme.defaultBorder.borderRadius,
|
|
170708
171611
|
disableNudge,
|
|
171612
|
+
disableDrag,
|
|
170709
171613
|
setSelectedRowData,
|
|
170710
171614
|
setPageNo,
|
|
170711
171615
|
setColumnOrder,
|
|
@@ -173149,6 +174053,10 @@ const StyledSingleDropDown = qe$1(SingleDropDown)`
|
|
|
173149
174053
|
display: -webkit-box;
|
|
173150
174054
|
-webkit-line-clamp: 1;
|
|
173151
174055
|
-webkit-box-orient: vertical;
|
|
174056
|
+
|
|
174057
|
+
&:disabled {
|
|
174058
|
+
cursor: not-allowed;
|
|
174059
|
+
}
|
|
173152
174060
|
}
|
|
173153
174061
|
`;
|
|
173154
174062
|
const StyledCrossIcon = qe$1(SvgCrossXs)`
|
|
@@ -173630,7 +174538,8 @@ class DropDownComponent extends React__default.PureComponent {
|
|
|
173630
174538
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicSVG, { iconName: this.props.icon, size: this.props.iconSize })
|
|
173631
174539
|
}
|
|
173632
174540
|
) : null;
|
|
173633
|
-
const
|
|
174541
|
+
const selectedItemHasIcon = !!(selectedIndex > -1 && ((_c2 = this.props.options[selectedIndex]) == null ? void 0 : _c2.icon));
|
|
174542
|
+
const singleSelectDropdownIconElement = selectedItemHasIcon ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
173634
174543
|
StyledIconSpan,
|
|
173635
174544
|
{
|
|
173636
174545
|
className: this.getIconClassNames(
|
|
@@ -173639,7 +174548,13 @@ class DropDownComponent extends React__default.PureComponent {
|
|
|
173639
174548
|
style: {
|
|
173640
174549
|
left: ((_e2 = (_d2 = this.props.inputPadding) == null ? void 0 : _d2.left) == null ? void 0 : _e2.value) ?? 0
|
|
173641
174550
|
},
|
|
173642
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
174551
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
174552
|
+
DynamicSVG,
|
|
174553
|
+
{
|
|
174554
|
+
iconName: this.props.options[selectedIndex].icon,
|
|
174555
|
+
size: this.props.iconSize
|
|
174556
|
+
}
|
|
174557
|
+
)
|
|
173643
174558
|
}
|
|
173644
174559
|
) : defaultIconElement;
|
|
173645
174560
|
const tagOptionIconElement = (tagIndex) => {
|
|
@@ -173650,7 +174565,7 @@ class DropDownComponent extends React__default.PureComponent {
|
|
|
173650
174565
|
return null;
|
|
173651
174566
|
};
|
|
173652
174567
|
const paddingVarDeclarations = createCssVariablesForPadding(
|
|
173653
|
-
!!this.props.icon,
|
|
174568
|
+
!!this.props.icon || selectedItemHasIcon,
|
|
173654
174569
|
this.props.inputPadding,
|
|
173655
174570
|
this.props.iconSize
|
|
173656
174571
|
);
|
|
@@ -173769,6 +174684,7 @@ class DropDownComponent extends React__default.PureComponent {
|
|
|
173769
174684
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
173770
174685
|
MultiDropDown,
|
|
173771
174686
|
{
|
|
174687
|
+
disabled: this.props.disabled,
|
|
173772
174688
|
overflowTags: this.props.overflowTags,
|
|
173773
174689
|
items: this.props.options,
|
|
173774
174690
|
labelHeight: this.props.vertical ? 26 : 0,
|
|
@@ -173978,13 +174894,16 @@ const propertiesDefinition$8 = {
|
|
|
173978
174894
|
}),
|
|
173979
174895
|
layout: Section.category(PropsPanelCategory.Layout).add(padding({ themeValue: DROPDOWN_PADDING, default: DROPDOWN_PADDING })).add(size$2()).add(margin()).add(visible()),
|
|
173980
174896
|
interaction: Section.category(PropsPanelCategory.Interaction).children({
|
|
173981
|
-
|
|
174897
|
+
multiselect: Prop.boolean().readAndWrite().default(false).propertiesPanel({
|
|
173982
174898
|
label: "Multi-select",
|
|
173983
174899
|
helpText: "Allows users to select either a single option or multiple options"
|
|
173984
174900
|
}),
|
|
173985
174901
|
allowSelectAll: Prop.boolean().readAndWrite().default(false).propertiesPanel({
|
|
173986
174902
|
label: "Select/Deselect all",
|
|
173987
|
-
helpText: "Enable a button to select/deselect all options"
|
|
174903
|
+
helpText: "Enable a button to select/deselect all options",
|
|
174904
|
+
isVisible: function() {
|
|
174905
|
+
return this.multiselect;
|
|
174906
|
+
}
|
|
173988
174907
|
}),
|
|
173989
174908
|
allowClearing: Prop.boolean().readAndWrite().default(false).propertiesPanel({
|
|
173990
174909
|
label: "Clearable",
|
|
@@ -174029,7 +174948,7 @@ const propertiesDefinition$8 = {
|
|
|
174029
174948
|
}),
|
|
174030
174949
|
derived: Section.category(PropsPanelCategory.Derived).children({
|
|
174031
174950
|
value: Prop.any().readable().default(function() {
|
|
174032
|
-
return this.
|
|
174951
|
+
return this.multiselect ? this.selectedOptionArr : this.selectedOptionValue;
|
|
174033
174952
|
}),
|
|
174034
174953
|
defaultTransformation: Prop.any().readable().default(function() {
|
|
174035
174954
|
if (!Array.isArray(this.options)) return;
|
|
@@ -174085,9 +175004,9 @@ const propertiesDefinition$8 = {
|
|
|
174085
175004
|
validationErrors: Prop.any().readable().default(function() {
|
|
174086
175005
|
const errors2 = {};
|
|
174087
175006
|
if (this.isRequired) {
|
|
174088
|
-
if (this.
|
|
175007
|
+
if (this.multiselect && this.selectedIndexArr && this.selectedIndexArr.length === 0) {
|
|
174089
175008
|
errors2.isRequired = "Required";
|
|
174090
|
-
} else if (!this.
|
|
175009
|
+
} else if (!this.multiselect && !this.selectedOption) {
|
|
174091
175010
|
errors2.isRequired = "Required";
|
|
174092
175011
|
}
|
|
174093
175012
|
}
|
|
@@ -174098,7 +175017,7 @@ const propertiesDefinition$8 = {
|
|
|
174098
175017
|
}),
|
|
174099
175018
|
selectedOptionValue: Prop.any().readable().default(function() {
|
|
174100
175019
|
var _a2;
|
|
174101
|
-
if (this.
|
|
175020
|
+
if (this.multiselect) return;
|
|
174102
175021
|
const normalizedValue = normalizeFunction(
|
|
174103
175022
|
this.metaSelectedOptionValue,
|
|
174104
175023
|
(_a2 = this.transformation) == null ? void 0 : _a2.value
|
|
@@ -174113,7 +175032,7 @@ const propertiesDefinition$8 = {
|
|
|
174113
175032
|
}
|
|
174114
175033
|
}),
|
|
174115
175034
|
selectedOptionValues: Prop.any().readable().default(function() {
|
|
174116
|
-
if (!this.
|
|
175035
|
+
if (!this.multiselect) return;
|
|
174117
175036
|
const normalize2 = (val) => {
|
|
174118
175037
|
var _a2;
|
|
174119
175038
|
return normalizeFunction(val, (_a2 = this.transformation) == null ? void 0 : _a2.value);
|
|
@@ -174134,7 +175053,7 @@ const propertiesDefinition$8 = {
|
|
|
174134
175053
|
}),
|
|
174135
175054
|
selectedOption: Prop.any().readable().default(function() {
|
|
174136
175055
|
var _a2;
|
|
174137
|
-
if (this.
|
|
175056
|
+
if (this.multiselect) return;
|
|
174138
175057
|
const normalizedValue = normalizeFunction(
|
|
174139
175058
|
this.metaSelectedOptionValue,
|
|
174140
175059
|
(_a2 = this.transformation) == null ? void 0 : _a2.value
|
|
@@ -174144,7 +175063,7 @@ const propertiesDefinition$8 = {
|
|
|
174144
175063
|
);
|
|
174145
175064
|
}),
|
|
174146
175065
|
selectedOptionArr: Prop.any().readable().default(function() {
|
|
174147
|
-
if (!this.
|
|
175066
|
+
if (!this.multiselect) return;
|
|
174148
175067
|
const normalize2 = (val) => {
|
|
174149
175068
|
var _a2;
|
|
174150
175069
|
return normalizeFunction(val, (_a2 = this.transformation) == null ? void 0 : _a2.value);
|
|
@@ -174160,7 +175079,7 @@ const propertiesDefinition$8 = {
|
|
|
174160
175079
|
}),
|
|
174161
175080
|
selectedIndex: Prop.number().readable().default(function() {
|
|
174162
175081
|
var _a2;
|
|
174163
|
-
if (this.
|
|
175082
|
+
if (this.multiselect) return;
|
|
174164
175083
|
const normalizedValue = normalizeFunction(
|
|
174165
175084
|
this.metaSelectedOptionValue,
|
|
174166
175085
|
(_a2 = this.transformation) == null ? void 0 : _a2.value
|
|
@@ -174270,20 +175189,20 @@ const SbDropdown = registerSbComponent(
|
|
|
174270
175189
|
},
|
|
174271
175190
|
[props.isTouched, update]
|
|
174272
175191
|
);
|
|
174273
|
-
const {
|
|
175192
|
+
const { multiselect, onOptionChange: propOnOptionChange } = props;
|
|
174274
175193
|
const onOptionSelected = useCallback(
|
|
174275
175194
|
(selectedOption) => {
|
|
174276
175195
|
if (selectedOption === null) {
|
|
174277
175196
|
if (props.selectedOption) {
|
|
174278
175197
|
update((e3) => e3.metaSelectedOptionValue = -1);
|
|
174279
|
-
if (!
|
|
175198
|
+
if (!multiselect) {
|
|
174280
175199
|
onClear();
|
|
174281
175200
|
}
|
|
174282
175201
|
}
|
|
174283
175202
|
return;
|
|
174284
175203
|
}
|
|
174285
175204
|
let isChanged = true;
|
|
174286
|
-
if (!
|
|
175205
|
+
if (!multiselect) {
|
|
174287
175206
|
if (props.selectedOption) {
|
|
174288
175207
|
isChanged = !lodashExports.isEqual(
|
|
174289
175208
|
normalize2(props.selectedOption.value),
|
|
@@ -174315,7 +175234,7 @@ const SbDropdown = registerSbComponent(
|
|
|
174315
175234
|
}
|
|
174316
175235
|
},
|
|
174317
175236
|
[
|
|
174318
|
-
|
|
175237
|
+
multiselect,
|
|
174319
175238
|
props.isTouched,
|
|
174320
175239
|
props.selectedOption,
|
|
174321
175240
|
propOnOptionChange,
|
|
@@ -174424,7 +175343,7 @@ const SbDropdown = registerSbComponent(
|
|
|
174424
175343
|
onFocusChange: handleFocusChange,
|
|
174425
175344
|
onSearchTextChange: onDebouncedSearchTextChange
|
|
174426
175345
|
};
|
|
174427
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownContainer, { ...passthroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownStyleOverrides, { vertical: props.labelPosition === "top", children: props.
|
|
175346
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownContainer, { ...passthroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownStyleOverrides, { vertical: props.labelPosition === "top", children: props.multiselect ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
174428
175347
|
DropDownComponent,
|
|
174429
175348
|
{
|
|
174430
175349
|
...commonProps,
|
|
@@ -174729,17 +175648,6 @@ const SbCheckbox = registerSbComponent(
|
|
|
174729
175648
|
) });
|
|
174730
175649
|
}
|
|
174731
175650
|
);
|
|
174732
|
-
const getPreviousAndCurrentWidgetProps = (updates, widgetMeta) => {
|
|
174733
|
-
const previousProps = widgetMeta.props;
|
|
174734
|
-
const newProps = Object.entries(updates).reduce(
|
|
174735
|
-
(acc, [key2, value]) => {
|
|
174736
|
-
acc[key2] = value.value;
|
|
174737
|
-
return acc;
|
|
174738
|
-
},
|
|
174739
|
-
{ ...previousProps }
|
|
174740
|
-
);
|
|
174741
|
-
return [previousProps, newProps];
|
|
174742
|
-
};
|
|
174743
175651
|
const adjustDateFormatSideEffect = (params) => {
|
|
174744
175652
|
const widgetMeta = params.widgetMeta;
|
|
174745
175653
|
const widgetState = params.widgetState;
|
|
@@ -175371,11 +176279,9 @@ const propertiesDefinition$4 = {
|
|
|
175371
176279
|
})
|
|
175372
176280
|
}).add(margin()).add(visible()),
|
|
175373
176281
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
175374
|
-
color:
|
|
176282
|
+
color: colorProp({
|
|
175375
176283
|
label: "Color",
|
|
175376
|
-
controlType: "COLOR_PICKER",
|
|
175377
176284
|
helpText: "Changes the color of the icon"
|
|
175378
|
-
// themeValue:"{{ theme.colors.neutral700 }}",
|
|
175379
176285
|
}),
|
|
175380
176286
|
animateLoading: Prop.boolean().readAndWrite().default(true).propertiesPanel({
|
|
175381
176287
|
label: "Loading animation",
|
|
@@ -175592,9 +176498,8 @@ const propertiesDefinition$3 = {
|
|
|
175592
176498
|
})
|
|
175593
176499
|
}),
|
|
175594
176500
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
175595
|
-
backgroundColor:
|
|
176501
|
+
backgroundColor: colorProp({
|
|
175596
176502
|
label: "Background",
|
|
175597
|
-
controlType: "COLOR_PICKER",
|
|
175598
176503
|
helpText: "Changes the color of the background"
|
|
175599
176504
|
}),
|
|
175600
176505
|
border: border(),
|
|
@@ -178277,7 +179182,7 @@ const generateTextStyles = (textStyles, builtinTypographies, fallbackFont) => {
|
|
|
178277
179182
|
|
|
178278
179183
|
.${CLASS_NAMES.INPUT} {
|
|
178279
179184
|
input::placeholder,
|
|
178280
|
-
textarea::placeholder {
|
|
179185
|
+
.${INPUT$1}::placeholder, textarea::placeholder {
|
|
178281
179186
|
${styleFromTextBlockWithColors(textStyles.inputPlaceholder)}
|
|
178282
179187
|
}
|
|
178283
179188
|
}
|
|
@@ -178405,7 +179310,7 @@ function applyThemeToIframe(generatedTheme) {
|
|
|
178405
179310
|
const originalLog = console.log;
|
|
178406
179311
|
console.log = (...args) => {
|
|
178407
179312
|
const processedArgs = args.map((arg) => {
|
|
178408
|
-
if (arg && typeof arg === "object" && getBindingIdentifier(arg)) {
|
|
179313
|
+
if (arg && typeof arg === "object" && (getBindingIdentifier(arg) || getBindingIdentifier(arg.bind ?? {}))) {
|
|
178409
179314
|
return JSON.parse(JSON.stringify(arg));
|
|
178410
179315
|
}
|
|
178411
179316
|
return arg;
|
|
@@ -190031,4 +190936,4 @@ export {
|
|
|
190031
190936
|
copyToClipboard as y,
|
|
190032
190937
|
navigateTo as z
|
|
190033
190938
|
};
|
|
190034
|
-
//# sourceMappingURL=index-
|
|
190939
|
+
//# sourceMappingURL=index-Dq7YJbaW.js.map
|