@superblocksteam/library 2.0.0-next.6 → 2.0.0-next.60
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-DYlFaJFn.js} +2 -2
- package/dist/{allPaths-CQicmj05.js.map → allPaths-DYlFaJFn.js.map} +1 -1
- package/dist/{allPaths-JTh0AvL-.js → allPaths-v1SIFiS6.js} +2 -2
- package/dist/{allPaths-JTh0AvL-.js.map → allPaths-v1SIFiS6.js.map} +1 -1
- package/dist/{allPathsLoader-BzKYsLDE.js → allPathsLoader-Cx6CWV57.js} +3 -3
- package/dist/{allPathsLoader-DUkr4f2u.js.map → allPathsLoader-Cx6CWV57.js.map} +1 -1
- package/dist/{allPathsLoader-DUkr4f2u.js → allPathsLoader-DtxO6UXt.js} +3 -3
- package/dist/{allPathsLoader-BzKYsLDE.js.map → allPathsLoader-DtxO6UXt.js.map} +1 -1
- package/dist/{index-U8MX-8Hu.js → index-DvPGGRJu.js} +1887 -942
- package/dist/{index-U8MX-8Hu.js.map → index-DvPGGRJu.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{splitPathsBySizeLoader-4uQi8FeZ.js → splitPathsBySizeLoader-Bgyysw_N.js} +2 -2
- package/dist/{splitPathsBySizeLoader-4uQi8FeZ.js.map → splitPathsBySizeLoader-Bgyysw_N.js.map} +1 -1
- package/dist/{splitPathsBySizeLoader-D1iVVUla.js → splitPathsBySizeLoader-JAb4JrDJ.js} +2 -2
- package/dist/{splitPathsBySizeLoader-D1iVVUla.js.map → splitPathsBySizeLoader-JAb4JrDJ.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 +19 -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/internal-details/lib/types.d.ts +3 -0
- package/dist-types/lib/internal-details/scope/global.d.ts +1 -0
- 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/date-picker/date-picker-component.d.ts +3 -3
- package/dist-types/lib/user-facing/components/date-picker/utils.d.ts +1 -1
- 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/input/index.d.ts +5 -11
- package/dist-types/lib/user-facing/components/input/props.d.ts +5 -11
- 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/switch/index.d.ts +1 -1
- package/dist-types/lib/user-facing/components/switch/props.d.ts +1 -1
- 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/form-inputs-properties.d.ts +1 -1
- 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-Cx6CWV57.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-Bgyysw_N.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;
|
|
46571
|
-
}
|
|
46572
|
-
if (this.connectionTimeout) {
|
|
46573
|
-
clearTimeout(this.connectionTimeout);
|
|
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);
|
|
46574
47030
|
}
|
|
46575
|
-
|
|
47031
|
+
return super.respondError(requestId, error, exception);
|
|
46576
47032
|
}
|
|
46577
|
-
|
|
46578
|
-
|
|
46579
|
-
|
|
46580
|
-
this.logger.error(`Connection timed out after ${(_a2 = this.timeouts) == null ? void 0 : _a2.connectionTimeoutInSeconds} seconds`);
|
|
46581
|
-
this.close();
|
|
46582
|
-
};
|
|
46583
|
-
}
|
|
46584
|
-
resetNoResponseTimeout(requestId) {
|
|
46585
|
-
var _a2, _b2;
|
|
46586
|
-
if (!((_a2 = this.timeouts) == null ? void 0 : _a2.noResponseTimeoutInSeconds)) {
|
|
46587
|
-
return;
|
|
46588
|
-
}
|
|
46589
|
-
const responseHandler = this.responseHandler.get(requestId);
|
|
46590
|
-
if (!responseHandler) {
|
|
46591
|
-
return;
|
|
47033
|
+
addEvent(eventName, attributes2) {
|
|
47034
|
+
if (this.lastActiveSpan) {
|
|
47035
|
+
this.lastActiveSpan.addEvent(eventName, attributes2, /* @__PURE__ */ new Date());
|
|
46592
47036
|
}
|
|
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) {
|
|
@@ -96866,10 +97381,25 @@ const microPatches = (oldValue, newValue, baseStr) => {
|
|
|
96866
97381
|
}
|
|
96867
97382
|
];
|
|
96868
97383
|
}
|
|
97384
|
+
if (isPrimitive(oldValue) || isPrimitive(newValue)) {
|
|
97385
|
+
if (oldValue !== newValue) {
|
|
97386
|
+
return [
|
|
97387
|
+
{
|
|
97388
|
+
op: "update",
|
|
97389
|
+
path: pathStringToArray(baseStr),
|
|
97390
|
+
value: newValue
|
|
97391
|
+
}
|
|
97392
|
+
];
|
|
97393
|
+
}
|
|
97394
|
+
return [];
|
|
97395
|
+
}
|
|
96869
97396
|
const diffs = diff(oldValue, newValue);
|
|
96870
97397
|
const basePath = pathStringToArray(baseStr);
|
|
96871
97398
|
return diffs.map((diff2) => toMobXPatchFromMicroDiff(diff2, basePath));
|
|
96872
97399
|
};
|
|
97400
|
+
function isPrimitive(value) {
|
|
97401
|
+
return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined";
|
|
97402
|
+
}
|
|
96873
97403
|
function toMobXPatchFromMicroDiff(diff2, basePath) {
|
|
96874
97404
|
const type5 = diff2.type;
|
|
96875
97405
|
const fullPath = [...basePath, ...diff2.path];
|
|
@@ -97391,6 +97921,9 @@ const rootStore$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
97391
97921
|
__proto__: null,
|
|
97392
97922
|
default: rootStore
|
|
97393
97923
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
97924
|
+
const generateId = () => {
|
|
97925
|
+
return Math.random().toString(36).substring(2, 15);
|
|
97926
|
+
};
|
|
97394
97927
|
class OperationAPI {
|
|
97395
97928
|
constructor(serverUrl) {
|
|
97396
97929
|
__publicField(this, "socket");
|
|
@@ -97438,6 +97971,10 @@ class OperationAPI {
|
|
|
97438
97971
|
var _a2;
|
|
97439
97972
|
return (_a2 = this.socket) == null ? void 0 : _a2.call.editor.deleteEntity(payload);
|
|
97440
97973
|
});
|
|
97974
|
+
__publicField(this, "editorRenameElement", async (payload) => {
|
|
97975
|
+
var _a2;
|
|
97976
|
+
return (_a2 = this.socket) == null ? void 0 : _a2.call.editor.renameElement(payload);
|
|
97977
|
+
});
|
|
97441
97978
|
__publicField(this, "editorUpdateTheme", async (payload) => {
|
|
97442
97979
|
var _a2;
|
|
97443
97980
|
return (_a2 = this.socket) == null ? void 0 : _a2.call.editor.updateTheme(payload);
|
|
@@ -97570,6 +98107,7 @@ async function connectSocket(serverUrl, peerId, userId) {
|
|
|
97570
98107
|
]
|
|
97571
98108
|
},
|
|
97572
98109
|
[],
|
|
98110
|
+
trace$1.getTracer("superblocks-ui-framework"),
|
|
97573
98111
|
{
|
|
97574
98112
|
connectionTimeoutInSeconds: 6 * 60,
|
|
97575
98113
|
noResponseTimeoutInSeconds: 5 * 60
|
|
@@ -97584,7 +98122,7 @@ async function connectSocket(serverUrl, peerId, userId) {
|
|
|
97584
98122
|
return void 0;
|
|
97585
98123
|
}
|
|
97586
98124
|
}
|
|
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];
|
|
98125
|
+
_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
98126
|
class OperationManager {
|
|
97589
98127
|
constructor() {
|
|
97590
98128
|
__runInitializers(_init3, 5, this);
|
|
@@ -97623,7 +98161,7 @@ class OperationManager {
|
|
|
97623
98161
|
return [];
|
|
97624
98162
|
}
|
|
97625
98163
|
executeOrAddToBatch(operation) {
|
|
97626
|
-
const transactionId = this.batchOperationTransactionId ?? generateId
|
|
98164
|
+
const transactionId = this.batchOperationTransactionId ?? generateId();
|
|
97627
98165
|
const payload = this.waitingForBatch ? operation.payload : {
|
|
97628
98166
|
...operation.payload,
|
|
97629
98167
|
transaction: {
|
|
@@ -97697,7 +98235,7 @@ class OperationManager {
|
|
|
97697
98235
|
}
|
|
97698
98236
|
batchUpdate(performOperations) {
|
|
97699
98237
|
this.waitingForBatch = true;
|
|
97700
|
-
this.batchOperationTransactionId = generateId
|
|
98238
|
+
this.batchOperationTransactionId = generateId();
|
|
97701
98239
|
performOperations();
|
|
97702
98240
|
editorBridge.editOpRequest("editor:batchUpdate", {
|
|
97703
98241
|
updates: this.batchOperations.map(
|
|
@@ -97856,6 +98394,27 @@ class OperationManager {
|
|
|
97856
98394
|
setWidgetProperty(sourceId, property, value, callback) {
|
|
97857
98395
|
this.setWidgetProperties(sourceId, { [property]: value }, callback);
|
|
97858
98396
|
}
|
|
98397
|
+
renameWidget(params) {
|
|
98398
|
+
var _a2;
|
|
98399
|
+
const widgetMeta = getEditStore().runtimeEntitiesManager.getAnyEditorWidgetMeta(
|
|
98400
|
+
params.sourceId
|
|
98401
|
+
);
|
|
98402
|
+
const oldName = ((_a2 = widgetMeta == null ? void 0 : widgetMeta.name) == null ? void 0 : _a2.value) ?? "";
|
|
98403
|
+
const kind = (widgetMeta == null ? void 0 : widgetMeta.type) === "SbPage" ? "page" : "component";
|
|
98404
|
+
const scopeName = (widgetMeta == null ? void 0 : widgetMeta.scopeId) ? rootStore.entityManager.getScopeName(widgetMeta.scopeId) : void 0;
|
|
98405
|
+
if (!scopeName) {
|
|
98406
|
+
console.error("No scope name found for widget", params.sourceId);
|
|
98407
|
+
return;
|
|
98408
|
+
}
|
|
98409
|
+
const renameRequest = {
|
|
98410
|
+
elementId: params.sourceId,
|
|
98411
|
+
newName: params.newName,
|
|
98412
|
+
oldName,
|
|
98413
|
+
kind,
|
|
98414
|
+
scopeName
|
|
98415
|
+
};
|
|
98416
|
+
editorBridge.editOpRequest("editor:renameElement", renameRequest);
|
|
98417
|
+
}
|
|
97859
98418
|
async ensureFilesSynced() {
|
|
97860
98419
|
await sourceUpdateApi.ensureFilesSynced();
|
|
97861
98420
|
}
|
|
@@ -97874,6 +98433,7 @@ __decorateElement(_init3, 1, "deleteComponents", _deleteComponents_dec, Operatio
|
|
|
97874
98433
|
__decorateElement(_init3, 1, "writeRuntimeProperties", _writeRuntimeProperties_dec, OperationManager);
|
|
97875
98434
|
__decorateElement(_init3, 1, "setWidgetProperties", _setWidgetProperties_dec, OperationManager);
|
|
97876
98435
|
__decorateElement(_init3, 1, "setWidgetProperty", _setWidgetProperty_dec, OperationManager);
|
|
98436
|
+
__decorateElement(_init3, 1, "renameWidget", _renameWidget_dec, OperationManager);
|
|
97877
98437
|
__decoratorMetadata(_init3, OperationManager);
|
|
97878
98438
|
class PropertiesPanelManager {
|
|
97879
98439
|
constructor(runtimeEntitiesManager, entityManager) {
|
|
@@ -98082,7 +98642,7 @@ function getPropertyValue$1({
|
|
|
98082
98642
|
}
|
|
98083
98643
|
const getNormalizedIdInfo = (params) => {
|
|
98084
98644
|
var _a2, _b2;
|
|
98085
|
-
const name = (
|
|
98645
|
+
const name = (_a2 = params.bind) == null ? void 0 : _a2.entityName;
|
|
98086
98646
|
const scopeId = ((_b2 = params.bind) == null ? void 0 : _b2.scopeId) ?? params.fallbackScopeId;
|
|
98087
98647
|
return {
|
|
98088
98648
|
name,
|
|
@@ -98145,7 +98705,6 @@ class RuntimeWidgetsManager {
|
|
|
98145
98705
|
const childSourceId = child.props[WIDGET_SOURCE_ID_ATTRIBUTE];
|
|
98146
98706
|
const { name: childName, scopeId: childScopeId } = getNormalizedIdInfo({
|
|
98147
98707
|
bind: getBindingIdentifier(child.props.bind),
|
|
98148
|
-
propsName: child.props.name,
|
|
98149
98708
|
fallbackScopeId
|
|
98150
98709
|
});
|
|
98151
98710
|
const childIdentifier = this.nameManager.registerAndGetIdentifiers({
|
|
@@ -98733,18 +99292,39 @@ const filterSafeStackDimensionProperties = (existingProps) => {
|
|
|
98733
99292
|
};
|
|
98734
99293
|
const filterSafeGridDimensionProperties = (existingProps) => {
|
|
98735
99294
|
const { width, height } = existingProps;
|
|
98736
|
-
|
|
98737
|
-
let safeWidth;
|
|
99295
|
+
const safeDimensions = {};
|
|
98738
99296
|
if ((height == null ? void 0 : height.mode) === "rows" || (height == null ? void 0 : height.mode) === "fit") {
|
|
98739
|
-
|
|
99297
|
+
safeDimensions.height = Property.Dimension(height);
|
|
98740
99298
|
}
|
|
98741
99299
|
if ((width == null ? void 0 : width.mode) === "columns") {
|
|
98742
|
-
|
|
99300
|
+
safeDimensions.width = Property.Dimension(width);
|
|
99301
|
+
}
|
|
99302
|
+
return safeDimensions;
|
|
99303
|
+
};
|
|
99304
|
+
const defaultSizeForComponent = (componentType, isFreeform, draggedDimensions) => {
|
|
99305
|
+
const height = Property.Dimension(Dim.fit());
|
|
99306
|
+
if (isFreeform) {
|
|
99307
|
+
const guWidth = (draggedDimensions == null ? void 0 : draggedDimensions.widthGU) ?? 4;
|
|
99308
|
+
return {
|
|
99309
|
+
height,
|
|
99310
|
+
width: Property.Dimension(Dim.col(guWidth))
|
|
99311
|
+
};
|
|
99312
|
+
}
|
|
99313
|
+
switch (componentType) {
|
|
99314
|
+
case "SbText":
|
|
99315
|
+
case "SbButton":
|
|
99316
|
+
case "SbCheckbox":
|
|
99317
|
+
case "SbSwitch":
|
|
99318
|
+
return { height, width: Property.Dimension(Dim.fit()) };
|
|
99319
|
+
case "SbImage":
|
|
99320
|
+
return {
|
|
99321
|
+
height,
|
|
99322
|
+
width: Property.Dimension(Dim.px((draggedDimensions == null ? void 0 : draggedDimensions.widthPx) ?? 288))
|
|
99323
|
+
// Matches widget config response. This should never be undefined though.
|
|
99324
|
+
};
|
|
99325
|
+
default:
|
|
99326
|
+
return { height, width: Property.Dimension(Dim.fill()) };
|
|
98743
99327
|
}
|
|
98744
|
-
return {
|
|
98745
|
-
width: safeWidth,
|
|
98746
|
-
height: safeHeight
|
|
98747
|
-
};
|
|
98748
99328
|
};
|
|
98749
99329
|
const isWidgetGrid = (widget) => {
|
|
98750
99330
|
var _a2;
|
|
@@ -98892,7 +99472,7 @@ class GridManager {
|
|
|
98892
99472
|
};
|
|
98893
99473
|
}
|
|
98894
99474
|
get lazyTargetGridInfo() {
|
|
98895
|
-
var _a2, _b2;
|
|
99475
|
+
var _a2, _b2, _c2;
|
|
98896
99476
|
const targetRect = this.dnd.activeTargetRect;
|
|
98897
99477
|
const dropTargetId = this.dnd.dropTargetId;
|
|
98898
99478
|
if (!targetRect || !dropTargetId) {
|
|
@@ -98913,7 +99493,7 @@ class GridManager {
|
|
|
98913
99493
|
const targetPadding = entityValues == null ? void 0 : entityValues.padding;
|
|
98914
99494
|
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
99495
|
const tileWidth = (targetRect.width - xPadding) / targetColumns;
|
|
98916
|
-
const tileHeight = (entityValues == null ? void 0 : entityValues.
|
|
99496
|
+
const tileHeight = ((_c2 = entityValues == null ? void 0 : entityValues.rowHeight) == null ? void 0 : _c2.value) ?? 12;
|
|
98917
99497
|
const targetHeightGU = Math.ceil(targetRect.height / tileHeight);
|
|
98918
99498
|
return {
|
|
98919
99499
|
targetColumns,
|
|
@@ -99443,6 +100023,16 @@ class DragAndDropManager {
|
|
|
99443
100023
|
registerStores({
|
|
99444
100024
|
DragAndDropManager: this
|
|
99445
100025
|
});
|
|
100026
|
+
startEditorSync({
|
|
100027
|
+
store: this,
|
|
100028
|
+
storeId: "dnd",
|
|
100029
|
+
projection(store) {
|
|
100030
|
+
return {
|
|
100031
|
+
isDragging: store._isDragging,
|
|
100032
|
+
isDraggingNewComponent: store._isDraggingNewComponent
|
|
100033
|
+
};
|
|
100034
|
+
}
|
|
100035
|
+
});
|
|
99446
100036
|
}
|
|
99447
100037
|
get isDragging() {
|
|
99448
100038
|
return this._isDragging;
|
|
@@ -109560,11 +110150,10 @@ const DuplicatedNamePopover = observer(({ name, children, showWarning, sourceId
|
|
|
109560
110150
|
(evt) => {
|
|
109561
110151
|
evt.preventDefault();
|
|
109562
110152
|
evt.stopPropagation();
|
|
109563
|
-
getEditStore().operationManager.
|
|
110153
|
+
getEditStore().operationManager.renameWidget({
|
|
109564
110154
|
sourceId,
|
|
109565
|
-
|
|
109566
|
-
|
|
109567
|
-
);
|
|
110155
|
+
newName
|
|
110156
|
+
});
|
|
109568
110157
|
},
|
|
109569
110158
|
[newName, sourceId]
|
|
109570
110159
|
);
|
|
@@ -110208,9 +110797,24 @@ const InternalGlobalScope = internalCreateScope(() => ({}), {
|
|
|
110208
110797
|
name: GLOBAL_SCOPE_ID,
|
|
110209
110798
|
scopeId: GLOBAL_SCOPE_ID
|
|
110210
110799
|
});
|
|
110800
|
+
const globalName = getName("Global");
|
|
110211
110801
|
const GlobalScope = registerScope(
|
|
110212
110802
|
({ children }) => {
|
|
110213
110803
|
const { theme } = useTheme();
|
|
110804
|
+
useEffect(() => {
|
|
110805
|
+
const global2 = rootStore.entityManager.getEntity(
|
|
110806
|
+
GLOBAL_SCOPE_ID,
|
|
110807
|
+
globalName
|
|
110808
|
+
);
|
|
110809
|
+
if (!global2) {
|
|
110810
|
+
rootStore.entityManager.createEntity({
|
|
110811
|
+
name: globalName,
|
|
110812
|
+
type: "global",
|
|
110813
|
+
props: {},
|
|
110814
|
+
scopeId: GLOBAL_SCOPE_ID
|
|
110815
|
+
});
|
|
110816
|
+
}
|
|
110817
|
+
}, []);
|
|
110214
110818
|
useEffect(() => {
|
|
110215
110819
|
const name = getName("Theme");
|
|
110216
110820
|
const existingTheme = rootStore.entityManager.getEntity(
|
|
@@ -110236,6 +110840,13 @@ const GlobalScope = registerScope(
|
|
|
110236
110840
|
},
|
|
110237
110841
|
InternalGlobalScope
|
|
110238
110842
|
);
|
|
110843
|
+
const updateGlobalScope = (global2) => {
|
|
110844
|
+
rootStore.entityManager.updateEntity({
|
|
110845
|
+
name: globalName,
|
|
110846
|
+
props: global2,
|
|
110847
|
+
scopeId: GLOBAL_SCOPE_ID
|
|
110848
|
+
});
|
|
110849
|
+
};
|
|
110239
110850
|
function createEntityProxy(entityName) {
|
|
110240
110851
|
return new Proxy(
|
|
110241
110852
|
{},
|
|
@@ -110251,6 +110862,17 @@ const Theme = createEntityProxy("Theme");
|
|
|
110251
110862
|
const Global = createEntityProxy("Global");
|
|
110252
110863
|
const Embed = createEntityProxy("Embed");
|
|
110253
110864
|
const Env = createEntityProxy("Env");
|
|
110865
|
+
const getPreviousAndCurrentWidgetProps = (updates, widgetMeta) => {
|
|
110866
|
+
const previousProps = widgetMeta.props;
|
|
110867
|
+
const newProps = Object.entries(updates).reduce(
|
|
110868
|
+
(acc, [key2, value]) => {
|
|
110869
|
+
acc[key2] = value.value;
|
|
110870
|
+
return acc;
|
|
110871
|
+
},
|
|
110872
|
+
{ ...previousProps }
|
|
110873
|
+
);
|
|
110874
|
+
return [previousProps, newProps];
|
|
110875
|
+
};
|
|
110254
110876
|
const getSizeProp = ({
|
|
110255
110877
|
label,
|
|
110256
110878
|
controlType,
|
|
@@ -110377,6 +110999,9 @@ const spacing = (options) => {
|
|
|
110377
110999
|
}
|
|
110378
111000
|
return themeValue ?? Theme.spacing;
|
|
110379
111001
|
},
|
|
111002
|
+
isVisible: function() {
|
|
111003
|
+
return this.layout !== "freeform";
|
|
111004
|
+
},
|
|
110380
111005
|
...rest
|
|
110381
111006
|
});
|
|
110382
111007
|
if (defaultSpacing || themeValue) {
|
|
@@ -110519,7 +111144,7 @@ const getAlignmentProps = () => {
|
|
|
110519
111144
|
})
|
|
110520
111145
|
};
|
|
110521
111146
|
};
|
|
110522
|
-
const containerLayout = () => Prop.union({
|
|
111147
|
+
const containerLayout = (sizeProps) => Prop.union({
|
|
110523
111148
|
shared: {
|
|
110524
111149
|
layout: Prop.string().readAndWrite().default("vertical").propertiesPanel({
|
|
110525
111150
|
label: "Layout",
|
|
@@ -110544,35 +111169,58 @@ const containerLayout = () => Prop.union({
|
|
|
110544
111169
|
tooltip: "Horizontal"
|
|
110545
111170
|
}
|
|
110546
111171
|
]
|
|
111172
|
+
}).onEdit(({ sourceId, updates, widgetMeta }) => {
|
|
111173
|
+
var _a2, _b2, _c2, _d2;
|
|
111174
|
+
const [previousProps, newProps] = getPreviousAndCurrentWidgetProps(updates, widgetMeta);
|
|
111175
|
+
const baseUpdate = {
|
|
111176
|
+
[sourceId]: {
|
|
111177
|
+
props: updates,
|
|
111178
|
+
meta: {}
|
|
111179
|
+
}
|
|
111180
|
+
};
|
|
111181
|
+
if (previousProps.layout !== "freeform" && newProps.layout === "freeform" && ((_a2 = newProps.width) == null ? void 0 : _a2.mode) === "fit") {
|
|
111182
|
+
const editStore2 = rootStore.editStore;
|
|
111183
|
+
if (!editStore2) {
|
|
111184
|
+
return baseUpdate;
|
|
111185
|
+
}
|
|
111186
|
+
const runtimeWidgetRect = (_d2 = (_c2 = (_b2 = editStore2.interactionLayerManager.getSourceIdElements(sourceId)) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.firstElementChild) == null ? void 0 : _d2.getBoundingClientRect();
|
|
111187
|
+
const pixelWidth = runtimeWidgetRect == null ? void 0 : runtimeWidgetRect.width;
|
|
111188
|
+
baseUpdate[sourceId].props = {
|
|
111189
|
+
...updates,
|
|
111190
|
+
// fit-contenet width does not make sense grid component
|
|
111191
|
+
width: pixelWidth ? Property.Dimension(Dim.px(pixelWidth)) : Property.Static(Dim.fill())
|
|
111192
|
+
};
|
|
111193
|
+
}
|
|
111194
|
+
return baseUpdate;
|
|
110547
111195
|
})
|
|
110548
111196
|
},
|
|
110549
111197
|
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
111198
|
{
|
|
110570
111199
|
layout: Prop.literal("vertical"),
|
|
110571
|
-
...getAlignmentProps()
|
|
111200
|
+
...getAlignmentProps(),
|
|
111201
|
+
...sizeProps
|
|
110572
111202
|
},
|
|
110573
111203
|
{
|
|
110574
111204
|
layout: Prop.literal("horizontal"),
|
|
110575
|
-
...getAlignmentProps()
|
|
111205
|
+
...getAlignmentProps(),
|
|
111206
|
+
...sizeProps
|
|
111207
|
+
},
|
|
111208
|
+
{
|
|
111209
|
+
layout: Prop.literal("freeform"),
|
|
111210
|
+
// 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
|
|
111211
|
+
...sizeProps,
|
|
111212
|
+
columns: Prop.number().readAndWrite().propertiesPanel({
|
|
111213
|
+
label: "Columns",
|
|
111214
|
+
placeholder: "Enter columns",
|
|
111215
|
+
helpText: "The total number of columns used to subdivide the grid horizontally. Each child component’s width will be defined relative to this total"
|
|
111216
|
+
}).default(12),
|
|
111217
|
+
rowHeight: Prop.dimension().readAndWrite().propertiesPanel({
|
|
111218
|
+
label: "Row height",
|
|
111219
|
+
placeholder: "row height in pixels",
|
|
111220
|
+
controlType: "DIMENSION_VALUE_CONTROL",
|
|
111221
|
+
dimensionUnit: "px",
|
|
111222
|
+
helpText: "The pixel height of each row in the grid. Child components can span multiple rows to maintain consistent vertical alignment"
|
|
111223
|
+
}).default(DEFAULT_GRID_ROW_SIZE)
|
|
110576
111224
|
}
|
|
110577
111225
|
]
|
|
110578
111226
|
});
|
|
@@ -114231,6 +114879,8 @@ const useWidgetNodeRef = (instanceId) => {
|
|
|
114231
114879
|
return nodeRef;
|
|
114232
114880
|
};
|
|
114233
114881
|
const DraggableWidget = observer(function DraggableWidget2(props) {
|
|
114882
|
+
const editStore2 = getEditStore();
|
|
114883
|
+
const disableDrag = !editStore2.ui.dnd.canDragWidget(props.instanceId) || editStore2.ui.dnd.isDraggingNewComponent;
|
|
114234
114884
|
const {
|
|
114235
114885
|
setNodeRef: setDraggableNodeRef,
|
|
114236
114886
|
isDragging,
|
|
@@ -114238,7 +114888,7 @@ const DraggableWidget = observer(function DraggableWidget2(props) {
|
|
|
114238
114888
|
attributes: attributes2
|
|
114239
114889
|
} = useComponentDraggable({
|
|
114240
114890
|
instanceId: props.instanceId,
|
|
114241
|
-
disableDrag:
|
|
114891
|
+
disableDrag: disableDrag ?? false
|
|
114242
114892
|
});
|
|
114243
114893
|
const widgetNode = useWidgetNodeRef(props.instanceId);
|
|
114244
114894
|
useEffect(() => {
|
|
@@ -114253,6 +114903,20 @@ const DraggableWidget = observer(function DraggableWidget2(props) {
|
|
|
114253
114903
|
...attributes2,
|
|
114254
114904
|
className: "sb-draggable-wrapper",
|
|
114255
114905
|
"data-is-dragged": isDragging,
|
|
114906
|
+
onPointerDown: (e3) => {
|
|
114907
|
+
if (!disableDrag) {
|
|
114908
|
+
listeners == null ? void 0 : listeners.onPointerDown(e3);
|
|
114909
|
+
} else {
|
|
114910
|
+
e3.stopPropagation();
|
|
114911
|
+
}
|
|
114912
|
+
},
|
|
114913
|
+
onPointerMove: (e3) => {
|
|
114914
|
+
if (!disableDrag) {
|
|
114915
|
+
listeners == null ? void 0 : listeners.onPointerMove(e3);
|
|
114916
|
+
} else {
|
|
114917
|
+
e3.stopPropagation();
|
|
114918
|
+
}
|
|
114919
|
+
},
|
|
114256
114920
|
children: props.children
|
|
114257
114921
|
}
|
|
114258
114922
|
);
|
|
@@ -114608,6 +115272,178 @@ var KeyValuePropertyType = /* @__PURE__ */ ((KeyValuePropertyType2) => {
|
|
|
114608
115272
|
KeyValuePropertyType2["EMAIL"] = "email";
|
|
114609
115273
|
return KeyValuePropertyType2;
|
|
114610
115274
|
})(KeyValuePropertyType || {});
|
|
115275
|
+
const DEFAULT_TABLE_DATA = [
|
|
115276
|
+
{
|
|
115277
|
+
photo: "https://cdn.superblocks.com/sample-data/rachel_kim",
|
|
115278
|
+
name: "Rachel Kim",
|
|
115279
|
+
email: "rachel.kim89@gmail.com",
|
|
115280
|
+
role: "Vendor Partner",
|
|
115281
|
+
company: "Urban Threads Co.",
|
|
115282
|
+
status: "Active",
|
|
115283
|
+
date_joined: "2023-04-12",
|
|
115284
|
+
last_activity: "2025-06-07T16:20:00Z"
|
|
115285
|
+
},
|
|
115286
|
+
{
|
|
115287
|
+
photo: "https://cdn.superblocks.com/sample-data/daniel_vargas",
|
|
115288
|
+
name: "Daniel Vargas",
|
|
115289
|
+
email: "dvargas1984@yahoo.com",
|
|
115290
|
+
role: "Logistics Contact",
|
|
115291
|
+
company: "Vargas Freight Ltd.",
|
|
115292
|
+
status: "Pending",
|
|
115293
|
+
date_joined: "2024-01-23",
|
|
115294
|
+
last_activity: "2025-05-30T13:45:00Z"
|
|
115295
|
+
},
|
|
115296
|
+
{
|
|
115297
|
+
photo: "https://cdn.superblocks.com/sample-data/sophie_liu",
|
|
115298
|
+
name: "Sophie Liu",
|
|
115299
|
+
email: "sophie.liu.personal@gmail.com",
|
|
115300
|
+
role: "Retail Manager",
|
|
115301
|
+
company: "Modern Goods",
|
|
115302
|
+
status: "Active",
|
|
115303
|
+
date_joined: "2022-09-10",
|
|
115304
|
+
last_activity: "2025-06-08T09:03:00Z"
|
|
115305
|
+
},
|
|
115306
|
+
{
|
|
115307
|
+
photo: "https://cdn.superblocks.com/sample-data/omar_el-sayed",
|
|
115308
|
+
name: "Omar El-Sayed",
|
|
115309
|
+
email: "omarsayed78@hotmail.com",
|
|
115310
|
+
role: "Accounts Payable",
|
|
115311
|
+
company: "Sayed Textiles",
|
|
115312
|
+
status: "Inactive",
|
|
115313
|
+
date_joined: "2021-06-05",
|
|
115314
|
+
last_activity: "2024-12-18T11:40:00Z"
|
|
115315
|
+
},
|
|
115316
|
+
{
|
|
115317
|
+
photo: "https://cdn.superblocks.com/sample-data/grace_nguyen",
|
|
115318
|
+
name: "Grace Nguyen",
|
|
115319
|
+
email: "gracenguyen23@icloud.com",
|
|
115320
|
+
role: "Product Supplier",
|
|
115321
|
+
company: "Green Earth Supplies",
|
|
115322
|
+
status: "Active",
|
|
115323
|
+
date_joined: "2023-11-03",
|
|
115324
|
+
last_activity: "2025-06-08T17:28:00Z"
|
|
115325
|
+
},
|
|
115326
|
+
{
|
|
115327
|
+
photo: "https://cdn.superblocks.com/sample-data/alex_romero",
|
|
115328
|
+
name: "Alex Romero",
|
|
115329
|
+
email: "alex.romero@gmail.com",
|
|
115330
|
+
role: "Client Account Owner",
|
|
115331
|
+
company: "Romero & Co.",
|
|
115332
|
+
status: "Suspended",
|
|
115333
|
+
date_joined: "2022-02-28",
|
|
115334
|
+
last_activity: "2025-03-11T08:20:00Z"
|
|
115335
|
+
},
|
|
115336
|
+
{
|
|
115337
|
+
photo: "https://cdn.superblocks.com/sample-data/lena_schmidt",
|
|
115338
|
+
name: "Lena Schmidt",
|
|
115339
|
+
email: "lena_schmidt92@gmx.de",
|
|
115340
|
+
role: "Wholesale Contact",
|
|
115341
|
+
company: "Schmidt Imports",
|
|
115342
|
+
status: "Active",
|
|
115343
|
+
date_joined: "2021-12-01",
|
|
115344
|
+
last_activity: "2025-06-06T21:10:00Z"
|
|
115345
|
+
},
|
|
115346
|
+
{
|
|
115347
|
+
photo: "https://cdn.superblocks.com/sample-data/devon_price",
|
|
115348
|
+
name: "Devon Price",
|
|
115349
|
+
email: "devon.price22@aol.com",
|
|
115350
|
+
role: "Fulfillment Liaison",
|
|
115351
|
+
company: "DepotLink",
|
|
115352
|
+
status: "Active",
|
|
115353
|
+
date_joined: "2024-05-17",
|
|
115354
|
+
last_activity: "2025-06-08T10:42:00Z"
|
|
115355
|
+
},
|
|
115356
|
+
{
|
|
115357
|
+
photo: "https://cdn.superblocks.com/sample-data/isabella_rossi",
|
|
115358
|
+
name: "Isabella Rossi",
|
|
115359
|
+
email: "bella.rossi@gmail.com",
|
|
115360
|
+
role: "Procurement Agent",
|
|
115361
|
+
company: "Rossi Global Sourcing",
|
|
115362
|
+
status: "Pending",
|
|
115363
|
+
date_joined: "2023-07-19",
|
|
115364
|
+
last_activity: "2025-05-29T14:05:00Z"
|
|
115365
|
+
},
|
|
115366
|
+
{
|
|
115367
|
+
photo: "https://cdn.superblocks.com/sample-data/tariq_khan",
|
|
115368
|
+
name: "Tariq Khan",
|
|
115369
|
+
email: "tariq.khan92@protonmail.com",
|
|
115370
|
+
role: "International Ops Lead",
|
|
115371
|
+
company: "CrossPort Trade Inc.",
|
|
115372
|
+
status: "Active",
|
|
115373
|
+
date_joined: "2022-11-08",
|
|
115374
|
+
last_activity: "2025-06-08T16:11:00Z"
|
|
115375
|
+
},
|
|
115376
|
+
{
|
|
115377
|
+
photo: "https://cdn.superblocks.com/sample-data/emily_zhang",
|
|
115378
|
+
name: "Emily Zhang",
|
|
115379
|
+
email: "emilyzhang.home@gmail.com",
|
|
115380
|
+
role: "Logistics Coordinator",
|
|
115381
|
+
company: "Zhang Export Ltd.",
|
|
115382
|
+
status: "Active",
|
|
115383
|
+
date_joined: "2023-03-12",
|
|
115384
|
+
last_activity: "2025-06-08T19:02:00Z"
|
|
115385
|
+
}
|
|
115386
|
+
];
|
|
115387
|
+
const DEFAULT_TABLE_COLUMNS = {
|
|
115388
|
+
name: {
|
|
115389
|
+
columnType: "text",
|
|
115390
|
+
label: "Name"
|
|
115391
|
+
},
|
|
115392
|
+
email: {
|
|
115393
|
+
columnType: "email",
|
|
115394
|
+
label: "Email"
|
|
115395
|
+
},
|
|
115396
|
+
role: {
|
|
115397
|
+
columnType: "text",
|
|
115398
|
+
label: "Role"
|
|
115399
|
+
},
|
|
115400
|
+
company: {
|
|
115401
|
+
columnType: "text",
|
|
115402
|
+
label: "Company"
|
|
115403
|
+
},
|
|
115404
|
+
status: {
|
|
115405
|
+
columnType: "tags",
|
|
115406
|
+
tagDisplayConfig: {
|
|
115407
|
+
Active: {
|
|
115408
|
+
color: "#14CDB733"
|
|
115409
|
+
},
|
|
115410
|
+
Pending: {
|
|
115411
|
+
color: "#FF9F3533"
|
|
115412
|
+
},
|
|
115413
|
+
Inactive: {
|
|
115414
|
+
color: "#a6a0a033"
|
|
115415
|
+
},
|
|
115416
|
+
Suspended: {
|
|
115417
|
+
color: "#FF62A433"
|
|
115418
|
+
}
|
|
115419
|
+
},
|
|
115420
|
+
label: "Status"
|
|
115421
|
+
},
|
|
115422
|
+
date_joined: {
|
|
115423
|
+
columnType: "date",
|
|
115424
|
+
inputFormat: "YYYY-MM-DD",
|
|
115425
|
+
outputFormat: "MM-DD-YYYY",
|
|
115426
|
+
label: "Date joined"
|
|
115427
|
+
},
|
|
115428
|
+
last_activity: {
|
|
115429
|
+
columnType: "date",
|
|
115430
|
+
inputFormat: "YYYY-MM-DDTHH:mm:ssZ",
|
|
115431
|
+
outputFormat: "MM-DD-YYYY",
|
|
115432
|
+
label: "Last activity"
|
|
115433
|
+
},
|
|
115434
|
+
photo: {
|
|
115435
|
+
columnType: "image",
|
|
115436
|
+
label: "Photo"
|
|
115437
|
+
}
|
|
115438
|
+
};
|
|
115439
|
+
const DEFAULT_TABLE_KEYS = Object.keys(DEFAULT_TABLE_COLUMNS);
|
|
115440
|
+
const CLEARED_TABLE_COLUMNS = DEFAULT_TABLE_KEYS.reduce(
|
|
115441
|
+
(acc, key2) => {
|
|
115442
|
+
acc[key2] = void 0;
|
|
115443
|
+
return acc;
|
|
115444
|
+
},
|
|
115445
|
+
{}
|
|
115446
|
+
);
|
|
114611
115447
|
function getParentInfo(parent) {
|
|
114612
115448
|
const parentComponentMeta = getEditStore().runtimeEntitiesManager.getAnyEditorWidgetMeta(parent.id);
|
|
114613
115449
|
const isParentGridLike = isWidgetGrid(parentComponentMeta);
|
|
@@ -114777,8 +115613,8 @@ function getComponentBaseProperties(componentType, parentInfo) {
|
|
|
114777
115613
|
"https://lowcode.s3.us-west-2.amazonaws.com/eilish-billie.jpeg"
|
|
114778
115614
|
);
|
|
114779
115615
|
properties2.fillContainer = Property.Static(true);
|
|
114780
|
-
properties2.width = Property.Dimension(Dim.px(300));
|
|
114781
|
-
properties2.height = Property.Dimension(Dim.
|
|
115616
|
+
properties2.width = parentInfo.isGridLike ? Property.Dimension(Dim.col(4)) : Property.Dimension(Dim.px(300));
|
|
115617
|
+
properties2.height = Property.Dimension(Dim.fit());
|
|
114782
115618
|
break;
|
|
114783
115619
|
case "SbKeyValue":
|
|
114784
115620
|
properties2.sourceData = Property.Static({
|
|
@@ -114853,9 +115689,26 @@ function getComponentBaseProperties(componentType, parentInfo) {
|
|
|
114853
115689
|
case "SbSection":
|
|
114854
115690
|
children = getSectionChildren();
|
|
114855
115691
|
break;
|
|
115692
|
+
case "SbTable":
|
|
115693
|
+
properties2.tableData = Property.Static(DEFAULT_TABLE_DATA);
|
|
115694
|
+
properties2.columns = Property.Static(DEFAULT_TABLE_COLUMNS);
|
|
115695
|
+
properties2.header = Property.Static("Customers");
|
|
115696
|
+
properties2.searchPlaceholder = Property.Static("Search...");
|
|
115697
|
+
break;
|
|
114856
115698
|
}
|
|
115699
|
+
const { width, height, ...restProperties } = properties2;
|
|
115700
|
+
const safeDimensions = parentInfo.isGridLike ? filterSafeGridDimensionProperties({
|
|
115701
|
+
width: width == null ? void 0 : width.value,
|
|
115702
|
+
height: height == null ? void 0 : height.value
|
|
115703
|
+
}) : filterSafeStackDimensionProperties({
|
|
115704
|
+
width: width == null ? void 0 : width.value,
|
|
115705
|
+
height: height == null ? void 0 : height.value
|
|
115706
|
+
});
|
|
114857
115707
|
return {
|
|
114858
|
-
properties:
|
|
115708
|
+
properties: {
|
|
115709
|
+
...restProperties,
|
|
115710
|
+
...safeDimensions
|
|
115711
|
+
},
|
|
114859
115712
|
children,
|
|
114860
115713
|
name: (_b2 = properties2.name) == null ? void 0 : _b2.value
|
|
114861
115714
|
};
|
|
@@ -114896,6 +115749,7 @@ async function createComponent({
|
|
|
114896
115749
|
componentType,
|
|
114897
115750
|
parentInfo.type
|
|
114898
115751
|
);
|
|
115752
|
+
const isGridLike = willWrapInSectionAndColumn && componentType !== "SbColumn" ? true : parentInfo.isGridLike;
|
|
114899
115753
|
const tagName = componentType;
|
|
114900
115754
|
const {
|
|
114901
115755
|
properties: propertiesFromType,
|
|
@@ -114903,11 +115757,11 @@ async function createComponent({
|
|
|
114903
115757
|
name
|
|
114904
115758
|
} = getComponentBaseProperties(componentType, {
|
|
114905
115759
|
// will wrap in a column with grid layout if dropping on a page or section directly
|
|
114906
|
-
isGridLike
|
|
115760
|
+
isGridLike
|
|
114907
115761
|
});
|
|
114908
115762
|
const properties2 = {
|
|
114909
|
-
...
|
|
114910
|
-
...
|
|
115763
|
+
...propertiesFromType,
|
|
115764
|
+
...baseProperties
|
|
114911
115765
|
};
|
|
114912
115766
|
console.log("creating component", { tagName, properties: properties2 });
|
|
114913
115767
|
const parentElement = { source: parent };
|
|
@@ -115057,12 +115911,10 @@ const handleGridDropForNewComponent = ({
|
|
|
115057
115911
|
baseProperties: {
|
|
115058
115912
|
marginTop: Property.Dimension(Dim.row((activeRectGU == null ? void 0 : activeRectGU.yGU) ?? 0)),
|
|
115059
115913
|
marginLeft: Property.Dimension(Dim.col((activeRectGU == null ? void 0 : activeRectGU.xGU) ?? 0)),
|
|
115060
|
-
|
|
115061
|
-
|
|
115062
|
-
|
|
115063
|
-
|
|
115064
|
-
(activeRectGU == null ? void 0 : activeRectGU.heightGU) ? Dim.rows(activeRectGU == null ? void 0 : activeRectGU.heightGU) : Dim.fit()
|
|
115065
|
-
)
|
|
115914
|
+
...defaultSizeForComponent(componentType, true, {
|
|
115915
|
+
widthGU: activeRectGU == null ? void 0 : activeRectGU.widthGU,
|
|
115916
|
+
heightGU: activeRectGU == null ? void 0 : activeRectGU.heightGU
|
|
115917
|
+
})
|
|
115066
115918
|
},
|
|
115067
115919
|
scopeName
|
|
115068
115920
|
});
|
|
@@ -115214,10 +116066,17 @@ const handleStackDropForNewComponent = ({
|
|
|
115214
116066
|
throw new Error("Missing drop source id");
|
|
115215
116067
|
}
|
|
115216
116068
|
const scopeName = rootStore.entityManager.getScopeName(dropScopeId);
|
|
116069
|
+
const dragRect = editStore2.ui.dnd.activeDragRect;
|
|
115217
116070
|
return createComponent({
|
|
115218
116071
|
componentType,
|
|
115219
116072
|
parent: { index: dropInfo.insertionIndex, id: dropSourceId },
|
|
115220
|
-
scopeName
|
|
116073
|
+
scopeName,
|
|
116074
|
+
baseProperties: {
|
|
116075
|
+
...defaultSizeForComponent(componentType, false, {
|
|
116076
|
+
widthPx: dragRect == null ? void 0 : dragRect.width,
|
|
116077
|
+
heightPx: dragRect == null ? void 0 : dragRect.height
|
|
116078
|
+
})
|
|
116079
|
+
}
|
|
115221
116080
|
});
|
|
115222
116081
|
};
|
|
115223
116082
|
const handleStackDrop = async ({
|
|
@@ -115747,6 +116606,14 @@ const InteractionRectHandles = (props) => {
|
|
|
115747
116606
|
const { instanceId, isDragging, selectionType } = props;
|
|
115748
116607
|
const [showPopover, setShowPopover] = useState(null);
|
|
115749
116608
|
const { canResizeWidth: canResizeWidth2, canResizeHeight: canResizeHeight2 } = useResizeCapabilities(instanceId);
|
|
116609
|
+
const timeoutRef = useRef(null);
|
|
116610
|
+
useEffect(() => {
|
|
116611
|
+
return () => {
|
|
116612
|
+
if (timeoutRef.current) {
|
|
116613
|
+
clearTimeout(timeoutRef.current);
|
|
116614
|
+
}
|
|
116615
|
+
};
|
|
116616
|
+
}, []);
|
|
115750
116617
|
const throttledResizeWidget = useMemo$2(
|
|
115751
116618
|
() => lodashExports.throttle((e3) => {
|
|
115752
116619
|
var _a2;
|
|
@@ -115777,14 +116644,18 @@ const InteractionRectHandles = (props) => {
|
|
|
115777
116644
|
var _a2;
|
|
115778
116645
|
e3.stopPropagation();
|
|
115779
116646
|
e3.preventDefault();
|
|
116647
|
+
if (timeoutRef.current) {
|
|
116648
|
+
clearTimeout(timeoutRef.current);
|
|
116649
|
+
timeoutRef.current = null;
|
|
116650
|
+
}
|
|
115780
116651
|
if ((position2 === "left" || position2 === "right") && !canResizeWidth2) {
|
|
115781
116652
|
setShowPopover(position2);
|
|
115782
|
-
setTimeout(() => setShowPopover(null), 3e3);
|
|
116653
|
+
timeoutRef.current = setTimeout(() => setShowPopover(null), 3e3);
|
|
115783
116654
|
return;
|
|
115784
116655
|
}
|
|
115785
116656
|
if ((position2 === "top" || position2 === "bottom") && !canResizeHeight2) {
|
|
115786
116657
|
setShowPopover(position2);
|
|
115787
|
-
setTimeout(() => setShowPopover(null), 3e3);
|
|
116658
|
+
timeoutRef.current = setTimeout(() => setShowPopover(null), 3e3);
|
|
115788
116659
|
return;
|
|
115789
116660
|
}
|
|
115790
116661
|
setShowPopover(null);
|
|
@@ -115858,6 +116729,15 @@ const InteractionRectHandles = (props) => {
|
|
|
115858
116729
|
popoverClassName: "bp5-unstyled-popover",
|
|
115859
116730
|
isOpen: showPopover === pos2,
|
|
115860
116731
|
placement: pos2,
|
|
116732
|
+
onInteraction: (nextOpenState, e3) => {
|
|
116733
|
+
if ((e3 == null ? void 0 : e3.type) === "mousedown" && nextOpenState === false && showPopover === pos2) {
|
|
116734
|
+
if (timeoutRef.current) {
|
|
116735
|
+
clearTimeout(timeoutRef.current);
|
|
116736
|
+
timeoutRef.current = null;
|
|
116737
|
+
}
|
|
116738
|
+
setShowPopover(null);
|
|
116739
|
+
}
|
|
116740
|
+
},
|
|
115861
116741
|
modifiers: {
|
|
115862
116742
|
flip: {
|
|
115863
116743
|
enabled: true,
|
|
@@ -116494,6 +117374,7 @@ const EditWrapper = observer(function EditWrapper2(props) {
|
|
|
116494
117374
|
Component: props.component,
|
|
116495
117375
|
identifier: identifier2,
|
|
116496
117376
|
widgetProps: props.widgetProps,
|
|
117377
|
+
showErrors: true,
|
|
116497
117378
|
children
|
|
116498
117379
|
}
|
|
116499
117380
|
)
|
|
@@ -116773,7 +117654,6 @@ const registerSbComponent = (type5, config2, Component3) => {
|
|
|
116773
117654
|
const identifier2 = useRef();
|
|
116774
117655
|
const { name: passedName, scopeId } = getNormalizedIdInfo({
|
|
116775
117656
|
bind: getBindingIdentifier(props.bind),
|
|
116776
|
-
propsName: props.name,
|
|
116777
117657
|
fallbackScopeId
|
|
116778
117658
|
});
|
|
116779
117659
|
if (!identifier2.current) {
|
|
@@ -117253,8 +118133,16 @@ const textStyleProp = ({
|
|
|
117253
118133
|
propertiesPanel
|
|
117254
118134
|
} = {}) => Prop.composite(baseProp).readAndWrite().propertiesPanel({
|
|
117255
118135
|
...basePropertiesPaneDisplay,
|
|
117256
|
-
...propertiesPanel
|
|
118136
|
+
...propertiesPanel,
|
|
118137
|
+
isJSConvertible: false
|
|
117257
118138
|
});
|
|
118139
|
+
const colorProp = (schema) => {
|
|
118140
|
+
return Prop.string().readAndWrite().propertiesPanel({
|
|
118141
|
+
...schema,
|
|
118142
|
+
controlType: "COLOR_PICKER",
|
|
118143
|
+
isJSConvertible: true
|
|
118144
|
+
});
|
|
118145
|
+
};
|
|
117258
118146
|
const labelTextStyle = () => textStyleProp({
|
|
117259
118147
|
propertiesPanel: {
|
|
117260
118148
|
label: "Label style",
|
|
@@ -117268,23 +118156,41 @@ const labelTextStyle = () => textStyleProp({
|
|
|
117268
118156
|
default: Theme.colors.neutral900
|
|
117269
118157
|
}
|
|
117270
118158
|
}));
|
|
117271
|
-
const
|
|
117272
|
-
|
|
117273
|
-
|
|
117274
|
-
|
|
117275
|
-
|
|
118159
|
+
const createPerSideBorder = (border2) => {
|
|
118160
|
+
return {
|
|
118161
|
+
left: {
|
|
118162
|
+
color: border2.borderColor.default,
|
|
118163
|
+
width: border2.borderWidth,
|
|
118164
|
+
style: border2.borderStyle
|
|
118165
|
+
},
|
|
118166
|
+
right: {
|
|
118167
|
+
color: border2.borderColor.default,
|
|
118168
|
+
width: border2.borderWidth,
|
|
118169
|
+
style: border2.borderStyle
|
|
118170
|
+
},
|
|
118171
|
+
top: {
|
|
118172
|
+
color: border2.borderColor.default,
|
|
118173
|
+
width: border2.borderWidth,
|
|
118174
|
+
style: border2.borderStyle
|
|
118175
|
+
},
|
|
118176
|
+
bottom: {
|
|
118177
|
+
color: border2.borderColor.default,
|
|
118178
|
+
width: border2.borderWidth,
|
|
118179
|
+
style: border2.borderStyle
|
|
118180
|
+
}
|
|
118181
|
+
};
|
|
118182
|
+
};
|
|
117276
118183
|
const border = (propertiesPanelConfig = {}) => {
|
|
117277
|
-
return Prop.
|
|
117278
|
-
top: perSideBorderDef(),
|
|
117279
|
-
right: perSideBorderDef(),
|
|
117280
|
-
bottom: perSideBorderDef(),
|
|
117281
|
-
left: perSideBorderDef()
|
|
117282
|
-
}).propertiesPanel({
|
|
118184
|
+
return Prop.any().readAndWrite().propertiesPanel({
|
|
117283
118185
|
label: "Border",
|
|
117284
118186
|
controlType: "BORDER_CONTROL",
|
|
117285
118187
|
helpText: "Controls the border of the component",
|
|
118188
|
+
visibility: "SHOW_NAME",
|
|
118189
|
+
isRemovable: true,
|
|
118190
|
+
defaultOnAdd: () => createPerSideBorder(Theme.defaultBorder),
|
|
118191
|
+
isJSConvertible: false,
|
|
117286
118192
|
...propertiesPanelConfig
|
|
117287
|
-
})
|
|
118193
|
+
});
|
|
117288
118194
|
};
|
|
117289
118195
|
const createBorderRadiusObject = (borderRadius2) => {
|
|
117290
118196
|
return {
|
|
@@ -117295,18 +118201,17 @@ const createBorderRadiusObject = (borderRadius2) => {
|
|
|
117295
118201
|
};
|
|
117296
118202
|
};
|
|
117297
118203
|
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);
|
|
118204
|
+
return Prop.any().default(() => {
|
|
118205
|
+
const borderRadius2 = Theme.defaultBorder.borderRadius;
|
|
118206
|
+
return borderRadius2.value !== 0 ? createBorderRadiusObject(borderRadius2) : void 0;
|
|
117306
118207
|
}).readAndWrite().propertiesPanel({
|
|
117307
118208
|
label: "Border radius",
|
|
117308
118209
|
controlType: "BORDER_RADIUS_CONTROL",
|
|
117309
118210
|
helpText: "Controls the border radius of the component",
|
|
118211
|
+
visibility: "SHOW_NAME",
|
|
118212
|
+
isRemovable: true,
|
|
118213
|
+
defaultOnAdd: () => createBorderRadiusObject(Theme.defaultBorder.borderRadius),
|
|
118214
|
+
isJSConvertible: false,
|
|
117310
118215
|
...propertiesPanelConfig
|
|
117311
118216
|
});
|
|
117312
118217
|
};
|
|
@@ -117318,35 +118223,49 @@ const buildPerSideBorder = (border2) => {
|
|
|
117318
118223
|
left: border2()
|
|
117319
118224
|
};
|
|
117320
118225
|
};
|
|
117321
|
-
const PRIMARY_BUTTON_BORDER_OBJECT =
|
|
117322
|
-
|
|
117323
|
-
|
|
117324
|
-
|
|
117325
|
-
|
|
117326
|
-
|
|
117327
|
-
}
|
|
117328
|
-
const SECONDARY_BUTTON_BORDER_OBJECT =
|
|
117329
|
-
|
|
117330
|
-
|
|
117331
|
-
|
|
117332
|
-
|
|
118226
|
+
const PRIMARY_BUTTON_BORDER_OBJECT = function() {
|
|
118227
|
+
return buildPerSideBorder(() => ({
|
|
118228
|
+
color: this.backgroundColor,
|
|
118229
|
+
width: Dim.px(1),
|
|
118230
|
+
style: "solid"
|
|
118231
|
+
}));
|
|
118232
|
+
};
|
|
118233
|
+
const SECONDARY_BUTTON_BORDER_OBJECT = function() {
|
|
118234
|
+
return buildPerSideBorder(() => ({
|
|
118235
|
+
color: Theme.colors.primary500,
|
|
118236
|
+
width: Dim.px(1),
|
|
118237
|
+
style: "solid"
|
|
118238
|
+
}));
|
|
118239
|
+
};
|
|
117333
118240
|
const getDefaultBorderObject = function() {
|
|
117334
118241
|
switch (this.variant) {
|
|
117335
118242
|
case "primary":
|
|
117336
|
-
return PRIMARY_BUTTON_BORDER_OBJECT;
|
|
118243
|
+
return PRIMARY_BUTTON_BORDER_OBJECT.bind(this)();
|
|
117337
118244
|
case "secondary":
|
|
117338
|
-
return SECONDARY_BUTTON_BORDER_OBJECT;
|
|
118245
|
+
return SECONDARY_BUTTON_BORDER_OBJECT.bind(this)();
|
|
117339
118246
|
default:
|
|
117340
|
-
return
|
|
118247
|
+
return onePixelTransparentBorderObject();
|
|
117341
118248
|
}
|
|
117342
118249
|
};
|
|
117343
|
-
|
|
117344
|
-
return
|
|
117345
|
-
|
|
117346
|
-
|
|
117347
|
-
|
|
117348
|
-
|
|
117349
|
-
|
|
118250
|
+
function getDefaultBorderRadius() {
|
|
118251
|
+
return function() {
|
|
118252
|
+
let borderRadius2;
|
|
118253
|
+
switch (this.variant) {
|
|
118254
|
+
case "PRIMARY_BUTTON":
|
|
118255
|
+
borderRadius2 = Theme.buttons.primary.borderRadius;
|
|
118256
|
+
break;
|
|
118257
|
+
case "SECONDARY_BUTTON":
|
|
118258
|
+
borderRadius2 = Theme.buttons.secondary.borderRadius;
|
|
118259
|
+
break;
|
|
118260
|
+
case "TERTIARY_BUTTON":
|
|
118261
|
+
borderRadius2 = Theme.buttons.tertiary.borderRadius;
|
|
118262
|
+
break;
|
|
118263
|
+
default:
|
|
118264
|
+
borderRadius2 = Theme.buttons.primary.borderRadius;
|
|
118265
|
+
}
|
|
118266
|
+
return createBorderRadiusObject(borderRadius2);
|
|
118267
|
+
};
|
|
118268
|
+
}
|
|
117350
118269
|
const textStyle$3 = textStyleProp().default(function() {
|
|
117351
118270
|
return {
|
|
117352
118271
|
variant: "buttonLabel",
|
|
@@ -117402,47 +118321,24 @@ const propertiesDefinition$h = {
|
|
|
117402
118321
|
}
|
|
117403
118322
|
}),
|
|
117404
118323
|
textStyle: textStyle$3,
|
|
117405
|
-
backgroundColor:
|
|
117406
|
-
const defaultThemeBackground = getButtonThemeDefaultBackgroundColor(
|
|
117407
|
-
Theme,
|
|
117408
|
-
this.variant
|
|
117409
|
-
);
|
|
117410
|
-
return defaultThemeBackground === "transparent" ? void 0 : defaultThemeBackground;
|
|
117411
|
-
}).propertiesPanel({
|
|
118324
|
+
backgroundColor: colorProp({
|
|
117412
118325
|
label: "Background color",
|
|
117413
|
-
controlType: "COLOR_PICKER",
|
|
117414
118326
|
visibility: "SHOW_NAME",
|
|
117415
118327
|
isRemovable: true,
|
|
117416
118328
|
defaultOnAdd: function() {
|
|
117417
118329
|
return getButtonThemeDefaultBackgroundColor(Theme, this.variant);
|
|
117418
118330
|
}
|
|
118331
|
+
}).default(function() {
|
|
118332
|
+
const defaultThemeBackground = getButtonThemeDefaultBackgroundColor(
|
|
118333
|
+
Theme,
|
|
118334
|
+
this.variant
|
|
118335
|
+
);
|
|
118336
|
+
return defaultThemeBackground === "transparent" ? void 0 : defaultThemeBackground;
|
|
117419
118337
|
}),
|
|
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
|
|
118338
|
+
border: border({
|
|
118339
|
+
defaultOnAdd: SECONDARY_BUTTON_BORDER_OBJECT
|
|
118340
|
+
}).default(getDefaultBorderObject),
|
|
118341
|
+
borderRadius: borderRadius().default(getDefaultBorderRadius),
|
|
117446
118342
|
labelAlignment: Prop.string().readAndWrite().default("center").propertiesPanel({
|
|
117447
118343
|
label: "Label alignment",
|
|
117448
118344
|
controlType: "RADIO_BUTTON_GROUP",
|
|
@@ -117639,9 +118535,8 @@ const commonLayoutProps = {
|
|
|
117639
118535
|
...visible()
|
|
117640
118536
|
};
|
|
117641
118537
|
Section.category(PropsPanelCategory.Appearance).children({
|
|
117642
|
-
backgroundColor:
|
|
118538
|
+
backgroundColor: colorProp({
|
|
117643
118539
|
label: "Background",
|
|
117644
|
-
controlType: "COLOR_PICKER",
|
|
117645
118540
|
helpText: "Changes the color of the background"
|
|
117646
118541
|
}),
|
|
117647
118542
|
border: border(),
|
|
@@ -117785,11 +118680,11 @@ const getStackChildStyle = ({
|
|
|
117785
118680
|
parentWidth
|
|
117786
118681
|
}) => {
|
|
117787
118682
|
const height = (childProps == null ? void 0 : childProps.height) ?? Dim.fit();
|
|
117788
|
-
const heightCss =
|
|
118683
|
+
const heightCss = (
|
|
117789
118684
|
// 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
118685
|
// if parent height is fit-content, child height 100% will cause unexpected height if child is empty container
|
|
117791
|
-
{ height: "100%" }
|
|
117792
|
-
)
|
|
118686
|
+
childCount === 1 && (height == null ? void 0 : height.mode) === "fill" && (parentHeight == null ? void 0 : parentHeight.mode) !== "fit" ? { height: "100%" } : dimToCSS(height, "height", primary === "height")
|
|
118687
|
+
);
|
|
117793
118688
|
const width = (childProps == null ? void 0 : childProps.width) ?? Dim.fit();
|
|
117794
118689
|
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
118690
|
const minWidthCss = getMinMaxCss(
|
|
@@ -117983,11 +118878,13 @@ const propertiesDefinition$g = {
|
|
|
117983
118878
|
}).default(false)
|
|
117984
118879
|
}).add(visible()),
|
|
117985
118880
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
117986
|
-
backgroundColor:
|
|
118881
|
+
backgroundColor: colorProp({
|
|
117987
118882
|
label: "Background",
|
|
117988
|
-
|
|
117989
|
-
|
|
117990
|
-
|
|
118883
|
+
helpText: "Changes the color of the background",
|
|
118884
|
+
visibility: "SHOW_NAME",
|
|
118885
|
+
isRemovable: true,
|
|
118886
|
+
defaultOnAdd: () => Theme.colors.appBackground ?? "#ffffff"
|
|
118887
|
+
}).default(void 0).validate(VALIDATORS.TEXT_ALLOW_UNDEFINED),
|
|
117991
118888
|
border: border()
|
|
117992
118889
|
})
|
|
117993
118890
|
};
|
|
@@ -118197,13 +119094,11 @@ const useHeightObserver = () => {
|
|
|
118197
119094
|
label: "Columns",
|
|
118198
119095
|
placeholder: "Enter columns"
|
|
118199
119096
|
}),
|
|
118200
|
-
|
|
118201
|
-
label: "
|
|
118202
|
-
placeholder: "Enter
|
|
118203
|
-
|
|
118204
|
-
|
|
118205
|
-
label: "Row size",
|
|
118206
|
-
placeholder: "Enter row size"
|
|
119097
|
+
rowHeight: Prop.dimension().readAndWrite().propertiesPanel({
|
|
119098
|
+
label: "Row height",
|
|
119099
|
+
placeholder: "Enter row height",
|
|
119100
|
+
controlType: "DIMENSION_VALUE_CONTROL",
|
|
119101
|
+
dimensionUnit: "px"
|
|
118207
119102
|
}),
|
|
118208
119103
|
...spacing({ themeValue: Dim.px(0) })
|
|
118209
119104
|
}),
|
|
@@ -118222,10 +119117,10 @@ const InternalGrid = ({
|
|
|
118222
119117
|
children = EMPTY_ARRAY$1,
|
|
118223
119118
|
...props
|
|
118224
119119
|
}) => {
|
|
118225
|
-
var _a2;
|
|
119120
|
+
var _a2, _b2;
|
|
118226
119121
|
const isEditing = Boolean((_a2 = rootStore.editStore) == null ? void 0 : _a2.isInitialized);
|
|
118227
119122
|
const { style: style2, ...passThroughProps } = usePassthroughProps(props);
|
|
118228
|
-
const rowHeight = props.
|
|
119123
|
+
const rowHeight = ((_b2 = props.rowHeight) == null ? void 0 : _b2.value) ?? 12;
|
|
118229
119124
|
const childrenArray = useMemo$2(() => {
|
|
118230
119125
|
let childrenArray2 = Array.isArray(children) ? children : [children];
|
|
118231
119126
|
if (!isEditing) {
|
|
@@ -118247,9 +119142,9 @@ const InternalGrid = ({
|
|
|
118247
119142
|
);
|
|
118248
119143
|
const positions = childrenArray.reduce(
|
|
118249
119144
|
(acc, child) => {
|
|
118250
|
-
var _a3,
|
|
119145
|
+
var _a3, _b3, _c2;
|
|
118251
119146
|
let width = ((_a3 = child.props.width) == null ? void 0 : _a3.value) ?? 1;
|
|
118252
|
-
if (((
|
|
119147
|
+
if (((_b3 = child.props.width) == null ? void 0 : _b3.mode) === "fill") {
|
|
118253
119148
|
width = columns;
|
|
118254
119149
|
}
|
|
118255
119150
|
acc[getChildName(child)] = {
|
|
@@ -118277,8 +119172,8 @@ const InternalGrid = ({
|
|
|
118277
119172
|
};
|
|
118278
119173
|
}, [columns, props.spacing, rowHeight, style2]);
|
|
118279
119174
|
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";
|
|
119175
|
+
var _a3, _b3;
|
|
119176
|
+
const heightMode = ((_a3 = child.props.height) == null ? void 0 : _a3.mode) ?? "fit";
|
|
118282
119177
|
const top2 = gridPositions[getChildName(child)].top;
|
|
118283
119178
|
const left2 = gridPositions[getChildName(child)].left;
|
|
118284
119179
|
const rows = gridPositions[getChildName(child)].height;
|
|
@@ -118296,7 +119191,7 @@ const InternalGrid = ({
|
|
|
118296
119191
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
118297
119192
|
Component3,
|
|
118298
119193
|
{
|
|
118299
|
-
staticHeight: (((
|
|
119194
|
+
staticHeight: (((_b3 = child.props.height) == null ? void 0 : _b3.value) ?? 0) * rowHeight,
|
|
118300
119195
|
onHeightChanged: (height) => {
|
|
118301
119196
|
dispatchHeight({
|
|
118302
119197
|
type: "SET_HEIGHT",
|
|
@@ -118353,60 +119248,30 @@ const StaticComponent = ({
|
|
|
118353
119248
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...style2, width: "100%", height: "100%" }, children });
|
|
118354
119249
|
};
|
|
118355
119250
|
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)
|
|
119251
|
+
layout: Section.category(PropsPanelCategory.Layout).add(
|
|
119252
|
+
containerLayout({
|
|
119253
|
+
...spacing(),
|
|
119254
|
+
...padding({
|
|
119255
|
+
default: function() {
|
|
119256
|
+
return this.variant === "card" ? BASE_THEME_NEW_APPS.padding : {
|
|
119257
|
+
top: Dim.px(0),
|
|
119258
|
+
bottom: Dim.px(0),
|
|
119259
|
+
left: Dim.px(0),
|
|
119260
|
+
right: Dim.px(0)
|
|
119261
|
+
};
|
|
119262
|
+
}
|
|
119263
|
+
}),
|
|
119264
|
+
...margin(),
|
|
119265
|
+
...size$2({
|
|
119266
|
+
defaultsOnAdd: {
|
|
119267
|
+
minWidth: Dim.px(0),
|
|
119268
|
+
minHeight: Dim.px(0),
|
|
119269
|
+
maxWidth: Dim.px(200),
|
|
119270
|
+
maxHeight: Dim.px(120)
|
|
119271
|
+
}
|
|
119272
|
+
})
|
|
118408
119273
|
})
|
|
118409
|
-
|
|
119274
|
+
).add(shouldScrollContents(true)).add(visible()),
|
|
118410
119275
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
118411
119276
|
variant: Prop.string().readAndWrite().default("none").propertiesPanel({
|
|
118412
119277
|
label: "Variant",
|
|
@@ -118424,18 +119289,13 @@ const propertiesDefinition$f = {
|
|
|
118424
119289
|
helpText: "Changes the color of the background",
|
|
118425
119290
|
visibility: "SHOW_NAME",
|
|
118426
119291
|
isRemovable: true,
|
|
118427
|
-
defaultOnAdd:
|
|
118428
|
-
return Theme.colors.appBackground ?? "#ffffff";
|
|
118429
|
-
}
|
|
119292
|
+
defaultOnAdd: () => Theme.colors.appBackground ?? "#ffffff"
|
|
118430
119293
|
}),
|
|
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);
|
|
119294
|
+
border: border().default(function() {
|
|
119295
|
+
return this.variant === "card" ? createPerSideBorder(Theme.defaultBorder) : void 0;
|
|
119296
|
+
}),
|
|
119297
|
+
borderRadius: borderRadius().default(function() {
|
|
119298
|
+
return this.variant === "card" ? createBorderRadiusObject(Theme.defaultBorder.borderRadius) : void 0;
|
|
118439
119299
|
})
|
|
118440
119300
|
})
|
|
118441
119301
|
};
|
|
@@ -118512,12 +119372,11 @@ const InternalContainer = (props) => {
|
|
|
118512
119372
|
InternalGrid,
|
|
118513
119373
|
{
|
|
118514
119374
|
margin: void 0,
|
|
118515
|
-
spacing:
|
|
119375
|
+
spacing: Dim.px(0),
|
|
118516
119376
|
isVisible: props.isVisible ?? true,
|
|
118517
119377
|
"data-container-layer": "container-inner-grid",
|
|
118518
119378
|
columns: props.columns,
|
|
118519
|
-
|
|
118520
|
-
rowSize: props.rowSize,
|
|
119379
|
+
rowHeight: props.rowHeight,
|
|
118521
119380
|
children: props.children
|
|
118522
119381
|
}
|
|
118523
119382
|
) : props.layout === "horizontal" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -118551,22 +119410,28 @@ const SbContainer = registerSbComponent(
|
|
|
118551
119410
|
InternalContainer
|
|
118552
119411
|
);
|
|
118553
119412
|
const propertiesDefinition$e = {
|
|
118554
|
-
layout: Section.category(PropsPanelCategory.Layout).add(
|
|
118555
|
-
|
|
118556
|
-
|
|
118557
|
-
|
|
118558
|
-
|
|
118559
|
-
|
|
118560
|
-
|
|
118561
|
-
|
|
118562
|
-
|
|
119413
|
+
layout: Section.category(PropsPanelCategory.Layout).add(
|
|
119414
|
+
containerLayout({
|
|
119415
|
+
...spacing(),
|
|
119416
|
+
...padding(),
|
|
119417
|
+
...size$2({
|
|
119418
|
+
defaults: {
|
|
119419
|
+
width: Dim.fill(),
|
|
119420
|
+
height: Dim.fill()
|
|
119421
|
+
},
|
|
119422
|
+
hasMinHeight: false,
|
|
119423
|
+
hasMaxHeight: false,
|
|
119424
|
+
showHeight: () => false
|
|
119425
|
+
})
|
|
118563
119426
|
})
|
|
118564
119427
|
).add(shouldScrollContents(true)).add(visible()),
|
|
118565
119428
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
118566
|
-
backgroundColor:
|
|
119429
|
+
backgroundColor: colorProp({
|
|
118567
119430
|
label: "Background",
|
|
118568
|
-
|
|
118569
|
-
|
|
119431
|
+
helpText: "Changes the color of the background",
|
|
119432
|
+
visibility: "SHOW_NAME",
|
|
119433
|
+
isRemovable: true,
|
|
119434
|
+
defaultOnAdd: () => Theme.colors.appBackground ?? "#ffffff"
|
|
118570
119435
|
}),
|
|
118571
119436
|
border: border()
|
|
118572
119437
|
})
|
|
@@ -118596,7 +119461,6 @@ const SbColumn = registerSbComponent(
|
|
|
118596
119461
|
verticalAlign: props.verticalAlign,
|
|
118597
119462
|
horizontalAlign: props.horizontalAlign,
|
|
118598
119463
|
columns: props.columns,
|
|
118599
|
-
rows: props.rows,
|
|
118600
119464
|
padding: props.padding,
|
|
118601
119465
|
variant: "none",
|
|
118602
119466
|
backgroundColor: props.backgroundColor,
|
|
@@ -125707,6 +126571,9 @@ const labelWidth = Prop.any().readAndWrite().default(Dim.percent(30)).properties
|
|
|
125707
126571
|
label: "Label width",
|
|
125708
126572
|
controlType: "SIMPLE_SIZE_CONTROL",
|
|
125709
126573
|
helpText: "Control the width of the label subcomponent in the input",
|
|
126574
|
+
isVisible: function() {
|
|
126575
|
+
return !!this.label && this.labelPosition === "left";
|
|
126576
|
+
},
|
|
125710
126577
|
options: [
|
|
125711
126578
|
{
|
|
125712
126579
|
label: "Fluid",
|
|
@@ -125733,7 +126600,8 @@ const customValidationProperties = {
|
|
|
125733
126600
|
helpText: "Sets a custom validation rule",
|
|
125734
126601
|
controlType: "INPUT_TEXT",
|
|
125735
126602
|
placeholder: "{{/./.test(Input1.value)}}",
|
|
125736
|
-
isRemovable: true
|
|
126603
|
+
isRemovable: true,
|
|
126604
|
+
visibility: "SHOW_NAME"
|
|
125737
126605
|
}),
|
|
125738
126606
|
customErrorMessage: Prop.string().readAndWrite().default("").propertiesPanel({
|
|
125739
126607
|
label: "Error",
|
|
@@ -125741,15 +126609,18 @@ const customValidationProperties = {
|
|
|
125741
126609
|
controlType: "INPUT_TEXT",
|
|
125742
126610
|
placeholder: "Enter error message",
|
|
125743
126611
|
isRemovable: true,
|
|
126612
|
+
visibility: "SHOW_NAME",
|
|
125744
126613
|
isVisible: function() {
|
|
125745
126614
|
return this.customValidationRule !== void 0;
|
|
125746
126615
|
}
|
|
125747
126616
|
})
|
|
125748
126617
|
};
|
|
125749
|
-
const labelPosition = Prop.string().readAndWrite().default("top").propertiesPanel({
|
|
126618
|
+
const labelPosition = () => Prop.string().readAndWrite().default("top").propertiesPanel({
|
|
125750
126619
|
label: "Label position",
|
|
125751
126620
|
controlType: "RADIO_BUTTON_GROUP",
|
|
125752
|
-
isVisible: (
|
|
126621
|
+
isVisible: function() {
|
|
126622
|
+
return !!this.label;
|
|
126623
|
+
},
|
|
125753
126624
|
options: [
|
|
125754
126625
|
{
|
|
125755
126626
|
label: "Above",
|
|
@@ -125963,7 +126834,7 @@ const propertiesDefinition$d = {
|
|
|
125963
126834
|
})
|
|
125964
126835
|
}),
|
|
125965
126836
|
appearance: Section.category(PropsPanelCategory.Appearance).add({
|
|
125966
|
-
labelPosition,
|
|
126837
|
+
labelPosition: labelPosition(),
|
|
125967
126838
|
labelStyle: labelTextStyle(),
|
|
125968
126839
|
placeholderText: Prop.string().readAndWrite().default("Enter text").propertiesPanel({
|
|
125969
126840
|
helpText: "Sets a placeholder text for the input",
|
|
@@ -125972,11 +126843,10 @@ const propertiesDefinition$d = {
|
|
|
125972
126843
|
placeholder: "Input text"
|
|
125973
126844
|
}),
|
|
125974
126845
|
textStyle: textStyle$2,
|
|
125975
|
-
backgroundColor:
|
|
126846
|
+
backgroundColor: colorProp({
|
|
125976
126847
|
label: "Background",
|
|
125977
|
-
controlType: "COLOR_PICKER",
|
|
125978
126848
|
helpText: "Changes the color of the background"
|
|
125979
|
-
}),
|
|
126849
|
+
}).default(() => Theme.colors.neutral),
|
|
125980
126850
|
border: border().default(void 0),
|
|
125981
126851
|
borderRadius: borderRadius(),
|
|
125982
126852
|
icon: Prop.string().readAndWrite().propertiesPanel({
|
|
@@ -126010,23 +126880,7 @@ const propertiesDefinition$d = {
|
|
|
126010
126880
|
controlType: "SWITCH"
|
|
126011
126881
|
})
|
|
126012
126882
|
}),
|
|
126013
|
-
layout: Section.category(PropsPanelCategory.Layout).add(padding({ themeValue: INPUT_PADDING, default: INPUT_PADDING })).add(size$2()).add(margin()).add(
|
|
126014
|
-
// TODO: Should be before visibility props, but there's no way to do that with the layout helper
|
|
126015
|
-
Prop.union({
|
|
126016
|
-
shared: {
|
|
126017
|
-
labelPosition: Prop.string()
|
|
126018
|
-
},
|
|
126019
|
-
variants: [
|
|
126020
|
-
{
|
|
126021
|
-
labelPosition: Prop.literal("left"),
|
|
126022
|
-
labelWidth
|
|
126023
|
-
},
|
|
126024
|
-
{
|
|
126025
|
-
labelPosition: Prop.literal("top")
|
|
126026
|
-
}
|
|
126027
|
-
]
|
|
126028
|
-
})
|
|
126029
|
-
).add(visible()),
|
|
126883
|
+
layout: Section.category(PropsPanelCategory.Layout).add(padding({ themeValue: INPUT_PADDING, default: INPUT_PADDING })).add(size$2()).add(margin()).add({ labelWidth }).add(visible()),
|
|
126030
126884
|
interaction: Section.category(PropsPanelCategory.Interaction).add(
|
|
126031
126885
|
Prop.union({
|
|
126032
126886
|
shared: {
|
|
@@ -133210,6 +134064,7 @@ const useStyle = (props) => {
|
|
|
133210
134064
|
return {
|
|
133211
134065
|
overflow: props.shouldScroll ? "auto" : "hidden",
|
|
133212
134066
|
textAlign: (_a2 = props.textAlign) == null ? void 0 : _a2.toLowerCase(),
|
|
134067
|
+
alignItems: getVerticalAlignment(props.verticalAlign),
|
|
133213
134068
|
color: (_c2 = (_b2 = props.textStyle) == null ? void 0 : _b2.textColor) == null ? void 0 : _c2.default,
|
|
133214
134069
|
...props.style
|
|
133215
134070
|
};
|
|
@@ -133231,6 +134086,17 @@ const getTextAlignClass = (textAlign) => {
|
|
|
133231
134086
|
};
|
|
133232
134087
|
}
|
|
133233
134088
|
};
|
|
134089
|
+
const getVerticalAlignment = (verticalAlign) => {
|
|
134090
|
+
switch (verticalAlign) {
|
|
134091
|
+
case "top":
|
|
134092
|
+
return "flex-start";
|
|
134093
|
+
case "bottom":
|
|
134094
|
+
return "flex-end";
|
|
134095
|
+
case "center":
|
|
134096
|
+
default:
|
|
134097
|
+
return "center";
|
|
134098
|
+
}
|
|
134099
|
+
};
|
|
133234
134100
|
const useIconContainerStyles = ({
|
|
133235
134101
|
iconGap,
|
|
133236
134102
|
textAlign
|
|
@@ -133412,8 +134278,7 @@ const ModalComponent = (props) => {
|
|
|
133412
134278
|
padding: props.styleProps.padding ?? ZERO_PADDING,
|
|
133413
134279
|
spacing: props.spacing ?? Dim.px(0),
|
|
133414
134280
|
columns: props.columns ?? 48,
|
|
133415
|
-
|
|
133416
|
-
rowSize: props.rowSize,
|
|
134281
|
+
rowHeight: props.rowHeight,
|
|
133417
134282
|
shouldScrollContents: true,
|
|
133418
134283
|
variant: "none",
|
|
133419
134284
|
children: props.children
|
|
@@ -133428,8 +134293,7 @@ const ModalComponent = (props) => {
|
|
|
133428
134293
|
props.styleProps.padding,
|
|
133429
134294
|
props.spacing,
|
|
133430
134295
|
props.columns,
|
|
133431
|
-
props.
|
|
133432
|
-
props.rowSize,
|
|
134296
|
+
props.rowHeight,
|
|
133433
134297
|
props.children
|
|
133434
134298
|
]
|
|
133435
134299
|
);
|
|
@@ -133507,12 +134371,16 @@ const ModalComponent = (props) => {
|
|
|
133507
134371
|
] });
|
|
133508
134372
|
};
|
|
133509
134373
|
const propertiesDefinition$a = {
|
|
133510
|
-
layout: Section.category(PropsPanelCategory.Layout).add(
|
|
134374
|
+
layout: Section.category(PropsPanelCategory.Layout).add(
|
|
134375
|
+
containerLayout({
|
|
134376
|
+
...spacing(),
|
|
134377
|
+
...padding()
|
|
134378
|
+
})
|
|
134379
|
+
),
|
|
133511
134380
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
133512
|
-
backgroundColor:
|
|
134381
|
+
backgroundColor: colorProp({
|
|
133513
134382
|
label: "Background color",
|
|
133514
|
-
helpText: "The background color of the component"
|
|
133515
|
-
controlType: "COLOR_PICKER"
|
|
134383
|
+
helpText: "The background color of the component"
|
|
133516
134384
|
}),
|
|
133517
134385
|
border: Prop.any().readAndWrite().propertiesPanel({
|
|
133518
134386
|
label: "Border",
|
|
@@ -133697,20 +134565,13 @@ const SbModal = registerSbComponent(
|
|
|
133697
134565
|
verticalAlign: props.verticalAlign,
|
|
133698
134566
|
spacing: props.spacing ?? Dim.px(0),
|
|
133699
134567
|
columns: props.columns,
|
|
133700
|
-
|
|
133701
|
-
rowSize: props.rowSize,
|
|
134568
|
+
rowHeight: props.rowHeight,
|
|
133702
134569
|
dropTargetRef,
|
|
133703
134570
|
children: props.children
|
|
133704
134571
|
}
|
|
133705
134572
|
);
|
|
133706
134573
|
}
|
|
133707
134574
|
);
|
|
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
134575
|
const CompactMode = {
|
|
133715
134576
|
SHORT: "SHORT",
|
|
133716
134577
|
DEFAULT: "DEFAULT",
|
|
@@ -133746,13 +134607,6 @@ var EditInputType = /* @__PURE__ */ ((EditInputType2) => {
|
|
|
133746
134607
|
EditInputType2["Date"] = "DATE";
|
|
133747
134608
|
return EditInputType2;
|
|
133748
134609
|
})(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
134610
|
var ImageSize = /* @__PURE__ */ ((ImageSize2) => {
|
|
133757
134611
|
ImageSize2["Fixed"] = "FIXED";
|
|
133758
134612
|
ImageSize2["Fit"] = "FIT";
|
|
@@ -133785,6 +134639,142 @@ const ColumnType = {
|
|
|
133785
134639
|
EMAIL: "email",
|
|
133786
134640
|
LINK: "link"
|
|
133787
134641
|
};
|
|
134642
|
+
const JUSTIFY_CONTENT = {
|
|
134643
|
+
LEFT: "flex-start",
|
|
134644
|
+
CENTER: "center",
|
|
134645
|
+
RIGHT: "flex-end"
|
|
134646
|
+
};
|
|
134647
|
+
const ALIGN_ITEMS = {
|
|
134648
|
+
TOP: "flex-start",
|
|
134649
|
+
CENTER: "center",
|
|
134650
|
+
BOTTOM: "flex-end"
|
|
134651
|
+
};
|
|
134652
|
+
const TEXT_ALIGN = {
|
|
134653
|
+
LEFT: "left",
|
|
134654
|
+
CENTER: "center",
|
|
134655
|
+
RIGHT: "right"
|
|
134656
|
+
};
|
|
134657
|
+
const TEXT_SIZES = {
|
|
134658
|
+
HEADING1: "24px",
|
|
134659
|
+
HEADING2: "18px",
|
|
134660
|
+
HEADING3: "16px",
|
|
134661
|
+
PARAGRAPH: "14px",
|
|
134662
|
+
PARAGRAPH2: "12px"
|
|
134663
|
+
};
|
|
134664
|
+
var FontStyleTypes = /* @__PURE__ */ ((FontStyleTypes2) => {
|
|
134665
|
+
FontStyleTypes2["BOLD"] = "BOLD";
|
|
134666
|
+
FontStyleTypes2["ITALIC"] = "ITALIC";
|
|
134667
|
+
FontStyleTypes2["REGULAR"] = "REGULAR";
|
|
134668
|
+
FontStyleTypes2["UNDERLINE"] = "UNDERLINE";
|
|
134669
|
+
return FontStyleTypes2;
|
|
134670
|
+
})(FontStyleTypes || {});
|
|
134671
|
+
const TABLE_SIZES = {
|
|
134672
|
+
[CompactMode.VERY_SHORT]: {
|
|
134673
|
+
COLUMN_HEADER_HEIGHT: 48,
|
|
134674
|
+
TABLE_HEADER_HEIGHT: 60,
|
|
134675
|
+
TABLE_FOOTER_HEIGHT: 48,
|
|
134676
|
+
ROW_HEIGHT: 28,
|
|
134677
|
+
ROW_FONT_SIZE: 14,
|
|
134678
|
+
PAGINATION_CONTROLS_HEIGHT: 24,
|
|
134679
|
+
IMAGE_SIZE: 22,
|
|
134680
|
+
LINK_MENU_HEIGHT: 28,
|
|
134681
|
+
LINK_MENU_ICON_SIZE: IconSize$1.LARGE,
|
|
134682
|
+
ROW_PADDING: 0
|
|
134683
|
+
},
|
|
134684
|
+
[CompactMode.SHORT]: {
|
|
134685
|
+
COLUMN_HEADER_HEIGHT: 48,
|
|
134686
|
+
TABLE_HEADER_HEIGHT: 60,
|
|
134687
|
+
TABLE_FOOTER_HEIGHT: 48,
|
|
134688
|
+
ROW_HEIGHT: 36,
|
|
134689
|
+
ROW_FONT_SIZE: 14,
|
|
134690
|
+
PAGINATION_CONTROLS_HEIGHT: 24,
|
|
134691
|
+
IMAGE_SIZE: 28,
|
|
134692
|
+
LINK_MENU_HEIGHT: 32,
|
|
134693
|
+
LINK_MENU_ICON_SIZE: IconSize$1.LARGE,
|
|
134694
|
+
ROW_PADDING: 2
|
|
134695
|
+
},
|
|
134696
|
+
[CompactMode.DEFAULT]: {
|
|
134697
|
+
COLUMN_HEADER_HEIGHT: 48,
|
|
134698
|
+
TABLE_HEADER_HEIGHT: 60,
|
|
134699
|
+
TABLE_FOOTER_HEIGHT: 48,
|
|
134700
|
+
ROW_HEIGHT: 48,
|
|
134701
|
+
ROW_FONT_SIZE: 14,
|
|
134702
|
+
PAGINATION_CONTROLS_HEIGHT: 32,
|
|
134703
|
+
IMAGE_SIZE: 32,
|
|
134704
|
+
LINK_MENU_HEIGHT: 36,
|
|
134705
|
+
LINK_MENU_ICON_SIZE: IconSize$1.XL,
|
|
134706
|
+
ROW_PADDING: 5
|
|
134707
|
+
},
|
|
134708
|
+
[CompactMode.TALL]: {
|
|
134709
|
+
COLUMN_HEADER_HEIGHT: 36,
|
|
134710
|
+
TABLE_HEADER_HEIGHT: 60,
|
|
134711
|
+
TABLE_FOOTER_HEIGHT: 60,
|
|
134712
|
+
ROW_HEIGHT: 58,
|
|
134713
|
+
ROW_FONT_SIZE: 14,
|
|
134714
|
+
PAGINATION_CONTROLS_HEIGHT: 36,
|
|
134715
|
+
IMAGE_SIZE: 36,
|
|
134716
|
+
LINK_MENU_HEIGHT: 36,
|
|
134717
|
+
LINK_MENU_ICON_SIZE: IconSize$1.XL,
|
|
134718
|
+
ROW_PADDING: 10
|
|
134719
|
+
}
|
|
134720
|
+
};
|
|
134721
|
+
const DEFAULT_TABLE_COLUMN_WIDTH = 150;
|
|
134722
|
+
const TABLE_COLUMN_MIN_WIDTH = 20;
|
|
134723
|
+
const PARSED_INPUT_TYPES = [
|
|
134724
|
+
EditInputType.Number,
|
|
134725
|
+
EditInputType.Checkbox
|
|
134726
|
+
];
|
|
134727
|
+
const TextBoxEditTypes = [
|
|
134728
|
+
EditInputType.Text,
|
|
134729
|
+
EditInputType.Number,
|
|
134730
|
+
EditInputType.Email
|
|
134731
|
+
];
|
|
134732
|
+
const DEFAULT_CELL_TEXT_STYLE_VARIANT = "body2";
|
|
134733
|
+
const DEFAULT_CELL_CLASS_NAME = getTextCssClassFromVariant(
|
|
134734
|
+
DEFAULT_CELL_TEXT_STYLE_VARIANT
|
|
134735
|
+
);
|
|
134736
|
+
const DEFAULT_HEADING_TEXT_STYLE_VARIANT = "heading3";
|
|
134737
|
+
const TABLE_COLUMN_HEADER_DEFAULT_TYPOGRAPHY = "heading6";
|
|
134738
|
+
var Condition0Type = /* @__PURE__ */ ((Condition0Type2) => {
|
|
134739
|
+
Condition0Type2["all"] = "all";
|
|
134740
|
+
Condition0Type2["isEmpty"] = "isEmpty";
|
|
134741
|
+
Condition0Type2["isNotEmpty"] = "isNotEmpty";
|
|
134742
|
+
Condition0Type2["isTrue"] = "isTrue";
|
|
134743
|
+
Condition0Type2["isFalse"] = "isFalse";
|
|
134744
|
+
return Condition0Type2;
|
|
134745
|
+
})(Condition0Type || {});
|
|
134746
|
+
var Condition1Type = /* @__PURE__ */ ((Condition1Type2) => {
|
|
134747
|
+
Condition1Type2["textIs"] = "textIs";
|
|
134748
|
+
Condition1Type2["textContains"] = "textContains";
|
|
134749
|
+
Condition1Type2["textDoesNotContain"] = "textDoesNotContain";
|
|
134750
|
+
Condition1Type2["textStartsWith"] = "textStartsWith";
|
|
134751
|
+
Condition1Type2["textEndsWith"] = "textEndsWith";
|
|
134752
|
+
Condition1Type2["isEqualTo"] = "isEqualTo";
|
|
134753
|
+
Condition1Type2["isNotEqualTo"] = "isNotEqualTo";
|
|
134754
|
+
Condition1Type2["isLessThan"] = "isLessThan";
|
|
134755
|
+
Condition1Type2["isLessThanOrEqualTo"] = "isLessThanOrEqualTo";
|
|
134756
|
+
Condition1Type2["isGreaterThan"] = "isGreaterThan";
|
|
134757
|
+
Condition1Type2["isGreaterThanOrEqualTo"] = "isGreaterThanOrEqualTo";
|
|
134758
|
+
Condition1Type2["dateIs"] = "dateIs";
|
|
134759
|
+
Condition1Type2["dateIsBefore"] = "dateIsBefore";
|
|
134760
|
+
Condition1Type2["dateIsAfter"] = "dateIsAfter";
|
|
134761
|
+
return Condition1Type2;
|
|
134762
|
+
})(Condition1Type || {});
|
|
134763
|
+
var Condition2Type = /* @__PURE__ */ ((Condition2Type2) => {
|
|
134764
|
+
Condition2Type2["isBetween"] = "isBetween";
|
|
134765
|
+
Condition2Type2["dateIsBetween"] = "dateIsBetween";
|
|
134766
|
+
return Condition2Type2;
|
|
134767
|
+
})(Condition2Type || {});
|
|
134768
|
+
const TABLE_MULTISELECT_COLID$1 = "SB_$$_MULTISELECT";
|
|
134769
|
+
const tagColorPalette = [
|
|
134770
|
+
"#27BBFF33",
|
|
134771
|
+
"#FF9F3533",
|
|
134772
|
+
"#14CDB733",
|
|
134773
|
+
"#7C4FF833",
|
|
134774
|
+
"#FF62A433",
|
|
134775
|
+
"#9D585833",
|
|
134776
|
+
"#FF484833"
|
|
134777
|
+
];
|
|
133788
134778
|
const CurrencyList = CC.getCodes();
|
|
133789
134779
|
const tableColumnTypes = [
|
|
133790
134780
|
{
|
|
@@ -133841,7 +134831,7 @@ const cellIconProps = {
|
|
|
133841
134831
|
label: "Cell icon",
|
|
133842
134832
|
controlType: "ICON_SELECTOR"
|
|
133843
134833
|
}),
|
|
133844
|
-
cellIconPosition: Prop.string().readAndWrite().propertiesPanel({
|
|
134834
|
+
cellIconPosition: Prop.string().readAndWrite().default("left").propertiesPanel({
|
|
133845
134835
|
label: "Cell icon position",
|
|
133846
134836
|
controlType: "RADIO_BUTTON_GROUP",
|
|
133847
134837
|
options: [
|
|
@@ -133859,7 +134849,7 @@ const cellIconProps = {
|
|
|
133859
134849
|
})
|
|
133860
134850
|
};
|
|
133861
134851
|
const textStyleProps = {
|
|
133862
|
-
horizontalAlign: Prop.string().readAndWrite().propertiesPanel({
|
|
134852
|
+
horizontalAlign: Prop.string().readAndWrite().default("left").propertiesPanel({
|
|
133863
134853
|
label: "Horizontal alignment",
|
|
133864
134854
|
controlType: "RADIO_BUTTON_GROUP",
|
|
133865
134855
|
options: [
|
|
@@ -133868,7 +134858,7 @@ const textStyleProps = {
|
|
|
133868
134858
|
{ value: "right", icon: "RIGHT_ALIGN" }
|
|
133869
134859
|
]
|
|
133870
134860
|
}),
|
|
133871
|
-
verticalAlign: Prop.string().readAndWrite().propertiesPanel({
|
|
134861
|
+
verticalAlign: Prop.string().readAndWrite().default("top").propertiesPanel({
|
|
133872
134862
|
label: "Vertical alignment",
|
|
133873
134863
|
controlType: "RADIO_BUTTON_GROUP",
|
|
133874
134864
|
options: [
|
|
@@ -133881,17 +134871,17 @@ const textStyleProps = {
|
|
|
133881
134871
|
label: "Cell style",
|
|
133882
134872
|
controlType: "TEXT_STYLE"
|
|
133883
134873
|
}),
|
|
133884
|
-
cellBackground:
|
|
133885
|
-
label: "Background color"
|
|
133886
|
-
|
|
133887
|
-
})
|
|
134874
|
+
cellBackground: colorProp({
|
|
134875
|
+
label: "Background color"
|
|
134876
|
+
}).readAndWrite()
|
|
133888
134877
|
};
|
|
133889
134878
|
const textColumnProperties = {
|
|
133890
134879
|
general: {
|
|
133891
|
-
|
|
133892
|
-
|
|
133893
|
-
|
|
133894
|
-
|
|
134880
|
+
// TODO: bring this back when we are ready
|
|
134881
|
+
// computedValue: Prop.string().readAndWrite().propertiesPanel({
|
|
134882
|
+
// label: "Computed value",
|
|
134883
|
+
// controlType: "COMPUTE_TABLE_VALUE",
|
|
134884
|
+
// }),
|
|
133895
134885
|
displayedValue: Prop.string().readAndWrite().propertiesPanel({
|
|
133896
134886
|
label: "Displayed value",
|
|
133897
134887
|
controlType: "COMPUTE_TABLE_VALUE"
|
|
@@ -133938,26 +134928,24 @@ const buttonColumnProperties = {
|
|
|
133938
134928
|
}
|
|
133939
134929
|
]
|
|
133940
134930
|
}),
|
|
133941
|
-
buttonBackgroundColor:
|
|
133942
|
-
label: "Background color"
|
|
133943
|
-
|
|
133944
|
-
|
|
133945
|
-
|
|
133946
|
-
|
|
133947
|
-
|
|
133948
|
-
|
|
133949
|
-
|
|
133950
|
-
label: "Background color",
|
|
133951
|
-
controlType: "COLOR_PICKER"
|
|
133952
|
-
})
|
|
134931
|
+
buttonBackgroundColor: colorProp({
|
|
134932
|
+
label: "Background color"
|
|
134933
|
+
}).readAndWrite(),
|
|
134934
|
+
buttonLabelColor: colorProp({
|
|
134935
|
+
label: "Label color"
|
|
134936
|
+
}).readAndWrite(),
|
|
134937
|
+
backgroundColor: colorProp({
|
|
134938
|
+
label: "Background color"
|
|
134939
|
+
}).readAndWrite()
|
|
133953
134940
|
}
|
|
133954
134941
|
};
|
|
133955
134942
|
const numberColumnProperties = {
|
|
133956
134943
|
general: {
|
|
133957
|
-
|
|
133958
|
-
|
|
133959
|
-
|
|
133960
|
-
|
|
134944
|
+
// TODO: bring this back when we are ready
|
|
134945
|
+
// computedValue: Prop.string().readAndWrite().propertiesPanel({
|
|
134946
|
+
// label: "Computed value",
|
|
134947
|
+
// controlType: "COMPUTE_TABLE_VALUE",
|
|
134948
|
+
// }),
|
|
133961
134949
|
notation: Prop.string().readAndWrite().propertiesPanel({
|
|
133962
134950
|
label: "Number format",
|
|
133963
134951
|
controlType: "DROP_DOWN",
|
|
@@ -134064,12 +135052,12 @@ const imageColumnProperties = {
|
|
|
134064
135052
|
};
|
|
134065
135053
|
const dateColumnProperties = {
|
|
134066
135054
|
general: {
|
|
134067
|
-
|
|
135055
|
+
inputFormat: Prop.string().readAndWrite().propertiesPanel({
|
|
134068
135056
|
label: "Value format",
|
|
134069
135057
|
controlType: "DROP_DOWN",
|
|
134070
135058
|
options: DATE_INPUT_FORMATS
|
|
134071
135059
|
}),
|
|
134072
|
-
|
|
135060
|
+
outputFormat: Prop.string().readAndWrite().propertiesPanel({
|
|
134073
135061
|
label: "Display format",
|
|
134074
135062
|
controlType: "DROP_DOWN",
|
|
134075
135063
|
options: DATE_OUTPUT_FORMATS
|
|
@@ -134101,38 +135089,39 @@ const dateColumnProperties = {
|
|
|
134101
135089
|
};
|
|
134102
135090
|
const booleanColumnProperties = {
|
|
134103
135091
|
general: {
|
|
134104
|
-
|
|
134105
|
-
|
|
134106
|
-
|
|
134107
|
-
|
|
135092
|
+
// TODO: bring this back when we are ready
|
|
135093
|
+
// computedValue: Prop.string().readAndWrite().propertiesPanel({
|
|
135094
|
+
// label: "Computed value",
|
|
135095
|
+
// controlType: "COMPUTE_TABLE_VALUE",
|
|
135096
|
+
// }),
|
|
134108
135097
|
},
|
|
134109
135098
|
presentation: {
|
|
134110
135099
|
...textStyleProps,
|
|
134111
|
-
booleanStyleFalse: Prop.string().readAndWrite().propertiesPanel({
|
|
135100
|
+
booleanStyleFalse: Prop.string().readAndWrite().default("empty").propertiesPanel({
|
|
134112
135101
|
label: "False value",
|
|
134113
|
-
controlType: "
|
|
135102
|
+
controlType: "RADIO_BUTTON",
|
|
134114
135103
|
options: [
|
|
134115
135104
|
{
|
|
134116
|
-
|
|
134117
|
-
value:
|
|
135105
|
+
name: "",
|
|
135106
|
+
value: "empty"
|
|
134118
135107
|
},
|
|
134119
135108
|
{
|
|
134120
|
-
|
|
135109
|
+
name: "Close",
|
|
134121
135110
|
isIcon: true,
|
|
134122
135111
|
icon: "CLOSE",
|
|
134123
|
-
value:
|
|
135112
|
+
value: "close"
|
|
134124
135113
|
},
|
|
134125
135114
|
{
|
|
134126
|
-
|
|
135115
|
+
name: "Minus",
|
|
134127
135116
|
isIcon: true,
|
|
134128
135117
|
icon: "MINUS",
|
|
134129
|
-
value:
|
|
135118
|
+
value: "minus"
|
|
134130
135119
|
},
|
|
134131
135120
|
{
|
|
134132
|
-
|
|
135121
|
+
name: "Empty checkbox",
|
|
134133
135122
|
isIcon: true,
|
|
134134
135123
|
icon: "EMPTY_CHECKBOX",
|
|
134135
|
-
value:
|
|
135124
|
+
value: "empty_checkbox"
|
|
134136
135125
|
}
|
|
134137
135126
|
]
|
|
134138
135127
|
})
|
|
@@ -134140,10 +135129,11 @@ const booleanColumnProperties = {
|
|
|
134140
135129
|
};
|
|
134141
135130
|
const videoColumnProperties = {
|
|
134142
135131
|
general: {
|
|
134143
|
-
|
|
134144
|
-
|
|
134145
|
-
|
|
134146
|
-
|
|
135132
|
+
// TODO: bring this back when we are ready
|
|
135133
|
+
// computedValue: Prop.string().readAndWrite().propertiesPanel({
|
|
135134
|
+
// label: "Computed value",
|
|
135135
|
+
// controlType: "COMPUTE_TABLE_VALUE",
|
|
135136
|
+
// }),
|
|
134147
135137
|
},
|
|
134148
135138
|
presentation: {
|
|
134149
135139
|
...textStyleProps
|
|
@@ -134184,6 +135174,10 @@ const columnPanelConfig = {
|
|
|
134184
135174
|
})
|
|
134185
135175
|
},
|
|
134186
135176
|
variants: [
|
|
135177
|
+
{
|
|
135178
|
+
columnType: Prop.unset(),
|
|
135179
|
+
...textColumnProperties.general
|
|
135180
|
+
},
|
|
134187
135181
|
{
|
|
134188
135182
|
columnType: Prop.literal(ColumnType.TEXT),
|
|
134189
135183
|
...textColumnProperties.general
|
|
@@ -134268,6 +135262,10 @@ const columnPanelConfig = {
|
|
|
134268
135262
|
columnType: Prop.string()
|
|
134269
135263
|
},
|
|
134270
135264
|
variants: [
|
|
135265
|
+
{
|
|
135266
|
+
columnType: Prop.unset(),
|
|
135267
|
+
...textColumnProperties.presentation
|
|
135268
|
+
},
|
|
134271
135269
|
{
|
|
134272
135270
|
columnType: Prop.literal(ColumnType.TEXT),
|
|
134273
135271
|
...textColumnProperties.presentation
|
|
@@ -134387,142 +135385,6 @@ const columnPanelConfig = {
|
|
|
134387
135385
|
// }),
|
|
134388
135386
|
// ),
|
|
134389
135387
|
};
|
|
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
135388
|
function useCachedValue(value, isEqualFn = lodashExports.isEqual) {
|
|
134527
135389
|
const cached = useRef(value);
|
|
134528
135390
|
if (cached.current !== value && !isEqualFn(cached.current, value)) {
|
|
@@ -136383,10 +137245,6 @@ const HeaderCellContentWrapper = qe$1.div`
|
|
|
136383
137245
|
var _a2, _b2;
|
|
136384
137246
|
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
137247
|
}};
|
|
136386
|
-
|
|
136387
|
-
span {
|
|
136388
|
-
${({ shouldCapitalize }) => shouldCapitalize && `text-transform: capitalize;`}
|
|
136389
|
-
}
|
|
136390
137248
|
`;
|
|
136391
137249
|
const TableIconWrapper = qe$1.div`
|
|
136392
137250
|
width: ${(props) => props.tableSizes.TABLE_FOOTER_HEIGHT}px;
|
|
@@ -136557,11 +137415,11 @@ const StyledEmptyCheckbox = qe$1(SvgEmptyCheckbox)`
|
|
|
136557
137415
|
}
|
|
136558
137416
|
`;
|
|
136559
137417
|
const RadioButtonControlIcons = {
|
|
136560
|
-
|
|
136561
|
-
|
|
136562
|
-
|
|
136563
|
-
|
|
136564
|
-
|
|
137418
|
+
empty: (_props) => null,
|
|
137419
|
+
check: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(StyledCheckOutlined, { ...props }),
|
|
137420
|
+
close: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(StyledCloseOutlined, { ...props }),
|
|
137421
|
+
minus: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(StyledMinusOutlined, { ...props }),
|
|
137422
|
+
empty_checkbox: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
136565
137423
|
"span",
|
|
136566
137424
|
{
|
|
136567
137425
|
style: {
|
|
@@ -143581,14 +144439,14 @@ function getLoaderFn(options) {
|
|
|
143581
144439
|
if (!(loader === "all")) return [3, 3];
|
|
143582
144440
|
return [4, import(
|
|
143583
144441
|
/* webpackChunkName: "blueprint-icons-all-paths-loader" */
|
|
143584
|
-
"./allPathsLoader-
|
|
144442
|
+
"./allPathsLoader-DtxO6UXt.js"
|
|
143585
144443
|
)];
|
|
143586
144444
|
case 2:
|
|
143587
144445
|
return [2, _b2.sent().allPathsLoader];
|
|
143588
144446
|
case 3:
|
|
143589
144447
|
return [4, import(
|
|
143590
144448
|
/* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
|
|
143591
|
-
"./splitPathsBySizeLoader-
|
|
144449
|
+
"./splitPathsBySizeLoader-JAb4JrDJ.js"
|
|
143592
144450
|
)];
|
|
143593
144451
|
case 4:
|
|
143594
144452
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -151606,14 +152464,8 @@ class DatePickerComponent extends React__default.Component {
|
|
|
151606
152464
|
const _date = moment(date4, format3);
|
|
151607
152465
|
return _date.isValid() ? _date.toDate() : void 0;
|
|
151608
152466
|
});
|
|
151609
|
-
__publicField(this, "getNormalizedDateFormat", () => {
|
|
151610
|
-
return normalizeDateFormat(this.props.dateFormat || ISO_DATE_FORMAT);
|
|
151611
|
-
});
|
|
151612
|
-
__publicField(this, "getNormalizedDisplayDateFormat", () => {
|
|
151613
|
-
return this.props.displayDateFormat ? normalizeDateFormat(this.props.displayDateFormat) : void 0;
|
|
151614
|
-
});
|
|
151615
152467
|
__publicField(this, "shouldWrapTime", () => {
|
|
151616
|
-
const dateFormat = this.
|
|
152468
|
+
const dateFormat = this.normalizedDateFormat;
|
|
151617
152469
|
const showTime = formatIncludesTime(dateFormat);
|
|
151618
152470
|
const timePrecision = getTimePrecision(dateFormat);
|
|
151619
152471
|
return showTime && this.props.twentyFourHourTime && timePrecision === TimePrecision.MINUTE;
|
|
@@ -151636,25 +152488,8 @@ class DatePickerComponent extends React__default.Component {
|
|
|
151636
152488
|
}
|
|
151637
152489
|
return today.toDate();
|
|
151638
152490
|
});
|
|
151639
|
-
__publicField(this, "getCurrentValue", () => {
|
|
151640
|
-
if (this.props.selectedDate && typeof this.props.selectedDate === "string") {
|
|
151641
|
-
const dateFormat = this.getNormalizedDateFormat();
|
|
151642
|
-
const withoutTz = stripTimezoneFromString(
|
|
151643
|
-
this.props.selectedDate,
|
|
151644
|
-
dateFormat
|
|
151645
|
-
);
|
|
151646
|
-
const converted = convertDateStringTimezone(
|
|
151647
|
-
withoutTz,
|
|
151648
|
-
NO_TZ_FORMAT,
|
|
151649
|
-
this.valueTimezone,
|
|
151650
|
-
this.displayTimezone
|
|
151651
|
-
);
|
|
151652
|
-
return converted;
|
|
151653
|
-
}
|
|
151654
|
-
return null;
|
|
151655
|
-
});
|
|
151656
152491
|
__publicField(this, "getPopoverFooter", () => {
|
|
151657
|
-
const dateFormat = this.
|
|
152492
|
+
const dateFormat = this.normalizedDateFormat;
|
|
151658
152493
|
const showTime = formatIncludesTime(dateFormat);
|
|
151659
152494
|
const shouldWrapTime = this.shouldWrapTime();
|
|
151660
152495
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -151668,7 +152503,7 @@ class DatePickerComponent extends React__default.Component {
|
|
|
151668
152503
|
{
|
|
151669
152504
|
text: "Today",
|
|
151670
152505
|
onClick: () => {
|
|
151671
|
-
const dateFormat2 = this.
|
|
152506
|
+
const dateFormat2 = this.normalizedDateFormat;
|
|
151672
152507
|
const today = moment().tz(this.valueTimezone).format(dateFormat2);
|
|
151673
152508
|
this.props.onDateSelected(today);
|
|
151674
152509
|
},
|
|
@@ -151690,7 +152525,7 @@ class DatePickerComponent extends React__default.Component {
|
|
|
151690
152525
|
);
|
|
151691
152526
|
});
|
|
151692
152527
|
__publicField(this, "formatDisplayDate", (date4) => {
|
|
151693
|
-
const displayDateFormat = this.
|
|
152528
|
+
const displayDateFormat = this.normalizedDisplayDateFormat ?? this.normalizedDateFormat;
|
|
151694
152529
|
const withoutTz = stripTimezoneFromDate(
|
|
151695
152530
|
date4,
|
|
151696
152531
|
displayDateFormat,
|
|
@@ -151699,7 +152534,7 @@ class DatePickerComponent extends React__default.Component {
|
|
|
151699
152534
|
return withoutTz;
|
|
151700
152535
|
});
|
|
151701
152536
|
__publicField(this, "formatSelectedDate", (date4) => {
|
|
151702
|
-
const dateFormat = this.
|
|
152537
|
+
const dateFormat = this.normalizedDateFormat;
|
|
151703
152538
|
const dateStr = stripTimezoneFromDate(date4, dateFormat, moment.tz.guess());
|
|
151704
152539
|
const converted = convertDateStringTimezone(
|
|
151705
152540
|
dateStr,
|
|
@@ -151710,7 +152545,7 @@ class DatePickerComponent extends React__default.Component {
|
|
|
151710
152545
|
return converted;
|
|
151711
152546
|
});
|
|
151712
152547
|
__publicField(this, "parseSelectedDate", (dateStr) => {
|
|
151713
|
-
const dateFormat = this.
|
|
152548
|
+
const dateFormat = this.normalizedDateFormat;
|
|
151714
152549
|
const converted = stripTimezoneFromString(dateStr, dateFormat);
|
|
151715
152550
|
return new Date(converted);
|
|
151716
152551
|
});
|
|
@@ -151718,8 +152553,8 @@ class DatePickerComponent extends React__default.Component {
|
|
|
151718
152553
|
__publicField(this, "onInputChanged", (event) => {
|
|
151719
152554
|
const displayFormattedDateStr = event.target.value;
|
|
151720
152555
|
if (displayFormattedDateStr) {
|
|
151721
|
-
const dateFormat = this.
|
|
151722
|
-
const displayFormat = this.
|
|
152556
|
+
const dateFormat = this.normalizedDateFormat;
|
|
152557
|
+
const displayFormat = this.normalizedDisplayDateFormat || dateFormat;
|
|
151723
152558
|
if (!isValidDate(displayFormattedDateStr)) {
|
|
151724
152559
|
this.props.onDateSelected(displayFormattedDateStr);
|
|
151725
152560
|
return;
|
|
@@ -151739,7 +152574,7 @@ class DatePickerComponent extends React__default.Component {
|
|
|
151739
152574
|
* @param selectedDayOnly date in the local timezone
|
|
151740
152575
|
*/
|
|
151741
152576
|
__publicField(this, "onDayChanged", (selectedDayOnly) => {
|
|
151742
|
-
const dateFormat = this.
|
|
152577
|
+
const dateFormat = this.normalizedDateFormat;
|
|
151743
152578
|
if (selectedDayOnly && (!this.props.selectedDate || !moment(this.props.selectedDate, dateFormat).isSame(
|
|
151744
152579
|
selectedDayOnly,
|
|
151745
152580
|
"days"
|
|
@@ -151784,25 +152619,48 @@ class DatePickerComponent extends React__default.Component {
|
|
|
151784
152619
|
if (!this.props.selectedDate) return;
|
|
151785
152620
|
if (prevProps.timezone !== this.props.timezone) {
|
|
151786
152621
|
const localTimezone = moment.tz.guess();
|
|
151787
|
-
const nextDate = moment.tz(this.props.selectedDate, prevProps.timezone ?? localTimezone).tz(this.props.timezone ?? localTimezone).format(this.
|
|
152622
|
+
const nextDate = moment.tz(this.props.selectedDate, prevProps.timezone ?? localTimezone).tz(this.props.timezone ?? localTimezone).format(this.normalizedDateFormat);
|
|
151788
152623
|
this.props.onDateSelected(nextDate);
|
|
151789
152624
|
}
|
|
151790
152625
|
}
|
|
152626
|
+
get normalizedDateFormat() {
|
|
152627
|
+
return normalizeDateFormat(this.props.dateFormat || ISO_DATE_FORMAT);
|
|
152628
|
+
}
|
|
152629
|
+
get normalizedDisplayDateFormat() {
|
|
152630
|
+
return this.props.displayDateFormat ? normalizeDateFormat(this.props.displayDateFormat) : void 0;
|
|
152631
|
+
}
|
|
151791
152632
|
get valueTimezone() {
|
|
151792
152633
|
return this.props.timezone || moment.tz.guess();
|
|
151793
152634
|
}
|
|
151794
152635
|
get displayTimezone() {
|
|
151795
152636
|
return this.props.displayTimezone || moment.tz.guess();
|
|
151796
152637
|
}
|
|
152638
|
+
get currentValue() {
|
|
152639
|
+
if (this.props.selectedDate && typeof this.props.selectedDate === "string") {
|
|
152640
|
+
const dateFormat = this.normalizedDateFormat;
|
|
152641
|
+
const withoutTz = stripTimezoneFromString(
|
|
152642
|
+
this.props.selectedDate,
|
|
152643
|
+
dateFormat
|
|
152644
|
+
);
|
|
152645
|
+
const converted = convertDateStringTimezone(
|
|
152646
|
+
withoutTz,
|
|
152647
|
+
NO_TZ_FORMAT,
|
|
152648
|
+
this.valueTimezone,
|
|
152649
|
+
this.displayTimezone
|
|
152650
|
+
);
|
|
152651
|
+
return converted;
|
|
152652
|
+
}
|
|
152653
|
+
return null;
|
|
152654
|
+
}
|
|
151797
152655
|
render() {
|
|
151798
|
-
const dateFormat = this.
|
|
151799
|
-
const displayFormat = this.
|
|
152656
|
+
const dateFormat = this.normalizedDateFormat;
|
|
152657
|
+
const displayFormat = this.normalizedDisplayDateFormat || dateFormat;
|
|
151800
152658
|
const anchor = this.props.selectedDate && moment(this.props.selectedDate, dateFormat).isValid() ? moment(this.props.selectedDate, dateFormat) : moment();
|
|
151801
152659
|
const year = anchor.get("year");
|
|
151802
152660
|
const minDate = this.props.minDate ? this.getValidDate(this.props.minDate, dateFormat) : anchor.clone().set({ month: 0, date: 1, year: year - 10 }).toDate();
|
|
151803
152661
|
const maxDate = this.props.maxDate ? this.getValidDate(this.props.maxDate, dateFormat) : anchor.clone().set({ month: 11, date: 31, year: year + 10 }).toDate();
|
|
151804
152662
|
const showTime = formatIncludesTime(dateFormat);
|
|
151805
|
-
const currentValue = this.
|
|
152663
|
+
const currentValue = this.currentValue;
|
|
151806
152664
|
const timePrecision = getTimePrecision(dateFormat);
|
|
151807
152665
|
const initialMonth = this.getInitialMonth(currentValue, minDate, maxDate);
|
|
151808
152666
|
const styleVars = {
|
|
@@ -152041,8 +152899,10 @@ const InputCellWrapper = qe$1.div`
|
|
|
152041
152899
|
return `${minHeight}px`;
|
|
152042
152900
|
}};
|
|
152043
152901
|
text-align: ${(props) => {
|
|
152044
|
-
var _a2
|
|
152045
|
-
|
|
152902
|
+
var _a2;
|
|
152903
|
+
if ((_a2 = props == null ? void 0 : props.cellProperties) == null ? void 0 : _a2.horizontalAlign) {
|
|
152904
|
+
return TEXT_ALIGN[props.cellProperties.horizontalAlign];
|
|
152905
|
+
}
|
|
152046
152906
|
}};
|
|
152047
152907
|
font-size: ${(props) => {
|
|
152048
152908
|
return `${TABLE_SIZES[props.$compactMode].ROW_FONT_SIZE}px`;
|
|
@@ -153899,7 +154759,7 @@ const renderCell = ({
|
|
|
153899
154759
|
);
|
|
153900
154760
|
}
|
|
153901
154761
|
if (typeof value === "boolean") {
|
|
153902
|
-
const ButtonIcon = value ? RadioButtonControlIcons["
|
|
154762
|
+
const ButtonIcon = value ? RadioButtonControlIcons["check"] : RadioButtonControlIcons[cellProps.booleanStyleFalse || "empty"];
|
|
153903
154763
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
153904
154764
|
CellWrapper,
|
|
153905
154765
|
{
|
|
@@ -153914,7 +154774,7 @@ const renderCell = ({
|
|
|
153914
154774
|
}
|
|
153915
154775
|
if (lodashExports.isString(value) && ["true", "false"].includes(value.toLocaleLowerCase())) {
|
|
153916
154776
|
const booleanValue = value.toLocaleLowerCase() === "true";
|
|
153917
|
-
const ButtonIcon = booleanValue ? RadioButtonControlIcons["
|
|
154777
|
+
const ButtonIcon = booleanValue ? RadioButtonControlIcons["check"] : RadioButtonControlIcons[cellProps.booleanStyleFalse || "empty"];
|
|
153918
154778
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
153919
154779
|
CellWrapper,
|
|
153920
154780
|
{
|
|
@@ -154297,11 +155157,12 @@ function getDefaultColumnProperties(accessor, index2, widgetName, isDerived) {
|
|
|
154297
155157
|
enableFilter: true,
|
|
154298
155158
|
enableSort: true,
|
|
154299
155159
|
isVisible: true,
|
|
154300
|
-
isDerived:
|
|
155160
|
+
isDerived: !!isDerived,
|
|
154301
155161
|
label: accessor,
|
|
154302
155162
|
computedValue: getDefaultComputedValue(
|
|
154303
155163
|
accessor,
|
|
154304
|
-
widgetName
|
|
155164
|
+
widgetName,
|
|
155165
|
+
isDerived ?? false
|
|
154305
155166
|
),
|
|
154306
155167
|
linkUrl: "",
|
|
154307
155168
|
linkLabel: "",
|
|
@@ -154318,6 +155179,9 @@ function getDefaultColumnProperties(accessor, index2, widgetName, isDerived) {
|
|
|
154318
155179
|
};
|
|
154319
155180
|
}
|
|
154320
155181
|
function getDefaultComputedValue(accessor, widgetName, isDerived) {
|
|
155182
|
+
if (isDerived) {
|
|
155183
|
+
return "";
|
|
155184
|
+
}
|
|
154321
155185
|
return `{{${widgetName}.tableDataWithInserts.map((currentRow) => { return currentRow${getDottedPathTo(
|
|
154322
155186
|
accessor
|
|
154323
155187
|
)} })}}`;
|
|
@@ -154445,7 +155309,8 @@ function createTableColumns(props) {
|
|
|
154445
155309
|
const defaultProperties = getDefaultColumnProperties(
|
|
154446
155310
|
derivedColumnKey,
|
|
154447
155311
|
index2,
|
|
154448
|
-
props.widgetName
|
|
155312
|
+
props.widgetName,
|
|
155313
|
+
true
|
|
154449
155314
|
);
|
|
154450
155315
|
tableColumns[derivedColumnKey] = {
|
|
154451
155316
|
...defaultProperties,
|
|
@@ -154548,20 +155413,6 @@ function getSelectedRows(props) {
|
|
|
154548
155413
|
const selectedRows = selectedRowIndices.map((ind) => filteredTableData[ind]).filter(Boolean);
|
|
154549
155414
|
return selectedRows;
|
|
154550
155415
|
}
|
|
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
155416
|
function getFilteredTableData(props) {
|
|
154566
155417
|
var _a2;
|
|
154567
155418
|
if (!props.tableData) {
|
|
@@ -154758,20 +155609,22 @@ function getFilteredTableData(props) {
|
|
|
154758
155609
|
});
|
|
154759
155610
|
}
|
|
154760
155611
|
};
|
|
155612
|
+
const searchText = props.searchText ?? "";
|
|
154761
155613
|
const getSearchKey = () => {
|
|
154762
|
-
if (
|
|
154763
|
-
return
|
|
155614
|
+
if (searchText && props.enableClientSideSearch !== false) {
|
|
155615
|
+
return searchText.toLowerCase();
|
|
154764
155616
|
}
|
|
154765
155617
|
return "";
|
|
154766
155618
|
};
|
|
155619
|
+
const filters = props.filters;
|
|
154767
155620
|
const finalTableData = sortedTableData.filter((item) => {
|
|
154768
155621
|
var _a3;
|
|
154769
155622
|
const searchFound = getSearchKey() ? Object.values(item).join(", ").toLowerCase().includes(getSearchKey()) : true;
|
|
154770
155623
|
if (!searchFound) return false;
|
|
154771
155624
|
for (const [columnName, { byValue, condition }] of Object.entries(
|
|
154772
|
-
(
|
|
155625
|
+
(filters == null ? void 0 : filters.byColumn) ?? {}
|
|
154773
155626
|
)) {
|
|
154774
|
-
const column2 = props.columns[columnName];
|
|
155627
|
+
const column2 = ((_a3 = props.columns) == null ? void 0 : _a3[columnName]) ?? {};
|
|
154775
155628
|
const value = item[columnName];
|
|
154776
155629
|
if (byValue) {
|
|
154777
155630
|
const columnType = column2 && column2.columnType ? column2.columnType : "text";
|
|
@@ -154879,12 +155732,53 @@ function getFilteredTableData(props) {
|
|
|
154879
155732
|
}
|
|
154880
155733
|
const propertiesDefinition$9 = {
|
|
154881
155734
|
general: Section.category(PropsPanelCategory.Content).children({
|
|
154882
|
-
|
|
155735
|
+
header: Prop.string().readAndWrite().default("").propertiesPanel({
|
|
154883
155736
|
label: "Header",
|
|
154884
155737
|
placeholder: "Table name",
|
|
154885
155738
|
helpText: "A header displayed at the top of the table"
|
|
154886
155739
|
}),
|
|
154887
|
-
tableData: Prop.array().
|
|
155740
|
+
tableData: Prop.array().onEdit(({ sourceId, updates, widgetMeta }) => {
|
|
155741
|
+
try {
|
|
155742
|
+
const [previousWidget, newWidget] = getPreviousAndCurrentWidgetProps(updates, widgetMeta);
|
|
155743
|
+
if (lodashExports.isEqual(previousWidget == null ? void 0 : previousWidget.tableData, DEFAULT_TABLE_DATA)) {
|
|
155744
|
+
let updatedTableData = newWidget == null ? void 0 : newWidget.tableData;
|
|
155745
|
+
if (typeof updatedTableData === "string") {
|
|
155746
|
+
updatedTableData = JSON.parse(updatedTableData);
|
|
155747
|
+
}
|
|
155748
|
+
if (!Array.isArray(updatedTableData) || typeof updatedTableData[0] !== "object") {
|
|
155749
|
+
return {
|
|
155750
|
+
[sourceId]: {
|
|
155751
|
+
props: {
|
|
155752
|
+
columns: Property.Static({})
|
|
155753
|
+
},
|
|
155754
|
+
meta: {}
|
|
155755
|
+
}
|
|
155756
|
+
};
|
|
155757
|
+
}
|
|
155758
|
+
const colKeys = Object.keys(updatedTableData[0] ?? {});
|
|
155759
|
+
if (!lodashExports.isEqual(colKeys, DEFAULT_TABLE_KEYS)) {
|
|
155760
|
+
return {
|
|
155761
|
+
[sourceId]: {
|
|
155762
|
+
props: {
|
|
155763
|
+
columns: Property.Static(CLEARED_TABLE_COLUMNS)
|
|
155764
|
+
},
|
|
155765
|
+
meta: {}
|
|
155766
|
+
}
|
|
155767
|
+
};
|
|
155768
|
+
}
|
|
155769
|
+
}
|
|
155770
|
+
return {};
|
|
155771
|
+
} catch (_e2) {
|
|
155772
|
+
return {
|
|
155773
|
+
[sourceId]: {
|
|
155774
|
+
props: {
|
|
155775
|
+
columns: Property.Static(CLEARED_TABLE_COLUMNS)
|
|
155776
|
+
},
|
|
155777
|
+
meta: {}
|
|
155778
|
+
}
|
|
155779
|
+
};
|
|
155780
|
+
}
|
|
155781
|
+
}).readable().propertiesPanel({
|
|
154888
155782
|
label: "Data",
|
|
154889
155783
|
placeholder: '[{ "col1": "val1" }]',
|
|
154890
155784
|
isJSConvertible: false,
|
|
@@ -154917,8 +155811,15 @@ const propertiesDefinition$9 = {
|
|
|
154917
155811
|
helpText: "Enable per column filtering"
|
|
154918
155812
|
}),
|
|
154919
155813
|
defaultFilters: Prop.any().readAndWrite().propertiesPanel({
|
|
154920
|
-
|
|
154921
|
-
|
|
155814
|
+
controlType: "COMPUTED_CODE_EDITOR",
|
|
155815
|
+
label: "Default filters",
|
|
155816
|
+
visibility: "SHOW_NAME",
|
|
155817
|
+
isJSConvertible: false,
|
|
155818
|
+
isRemovable: true,
|
|
155819
|
+
helpText: "Allows specifying the filters that will be used on page load",
|
|
155820
|
+
isVisible: function() {
|
|
155821
|
+
return this.isFilterable && this.pageType !== "server_side";
|
|
155822
|
+
}
|
|
154922
155823
|
}),
|
|
154923
155824
|
// enableRowInsertion: Prop.boolean()
|
|
154924
155825
|
// .readAndWrite()
|
|
@@ -154946,37 +155847,46 @@ const propertiesDefinition$9 = {
|
|
|
154946
155847
|
label: "CSV download",
|
|
154947
155848
|
helpText: "Enable CSV download"
|
|
154948
155849
|
}),
|
|
154949
|
-
|
|
155850
|
+
paginationType: Prop.string().default("none").readAndWrite().propertiesPanel({
|
|
154950
155851
|
label: "Pagination type",
|
|
154951
155852
|
controlType: "DROP_DOWN",
|
|
154952
155853
|
helpText: "For server side pagination bind the Table.pageNo property in your API and call it onPageChange",
|
|
154953
155854
|
options: [
|
|
154954
|
-
{ label: "None", value:
|
|
154955
|
-
{ label: "Client side", value:
|
|
154956
|
-
{ label: "Server side", value:
|
|
155855
|
+
{ label: "None", value: "none" },
|
|
155856
|
+
{ label: "Client side", value: "client_side" },
|
|
155857
|
+
{ label: "Server side", value: "server_side" }
|
|
154957
155858
|
]
|
|
154958
155859
|
}),
|
|
154959
|
-
configuredPageSize: Prop.
|
|
155860
|
+
configuredPageSize: Prop.any().readAndWrite().propertiesPanel({
|
|
154960
155861
|
label: "Page size",
|
|
154961
155862
|
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
155863
|
controlType: "DROP_DOWN",
|
|
154963
155864
|
options: [
|
|
154964
|
-
{
|
|
155865
|
+
{
|
|
155866
|
+
label: "Auto",
|
|
155867
|
+
value: "auto"
|
|
155868
|
+
},
|
|
154965
155869
|
{ label: "5", value: 5 },
|
|
154966
155870
|
{ label: "10", value: 10 },
|
|
154967
155871
|
{ label: "20", value: 20 },
|
|
154968
155872
|
{ label: "50", value: 50 }
|
|
154969
|
-
]
|
|
155873
|
+
],
|
|
155874
|
+
isVisible: function() {
|
|
155875
|
+
return this.paginationType === "client_side";
|
|
155876
|
+
}
|
|
154970
155877
|
}),
|
|
154971
155878
|
defaultSort: Prop.composite({
|
|
154972
|
-
|
|
154973
|
-
column: Prop.string().default("name").propertiesPanel({
|
|
155879
|
+
column: Prop.string().propertiesPanel({
|
|
154974
155880
|
label: "Column",
|
|
154975
155881
|
controlType: "SELECT_TABLE_COLUMN"
|
|
154976
155882
|
}),
|
|
154977
155883
|
asc: Prop.boolean().default(true).propertiesPanel({
|
|
154978
155884
|
label: "Order",
|
|
154979
|
-
controlType: "RADIO_BUTTON_GROUP"
|
|
155885
|
+
controlType: "RADIO_BUTTON_GROUP",
|
|
155886
|
+
options: [
|
|
155887
|
+
{ label: "Ascending", value: true },
|
|
155888
|
+
{ label: "Descending", value: false }
|
|
155889
|
+
]
|
|
154980
155890
|
})
|
|
154981
155891
|
}).propertiesPanel({
|
|
154982
155892
|
label: "Default sort",
|
|
@@ -154989,7 +155899,10 @@ const propertiesDefinition$9 = {
|
|
|
154989
155899
|
}),
|
|
154990
155900
|
defaultSearchText: Prop.string().readAndWrite().propertiesPanel({
|
|
154991
155901
|
label: "Default search",
|
|
154992
|
-
helpText: "Sets the default search text"
|
|
155902
|
+
helpText: "Sets the default search text",
|
|
155903
|
+
isVisible: function() {
|
|
155904
|
+
return this.enableClientSideSearch !== false;
|
|
155905
|
+
}
|
|
154993
155906
|
}),
|
|
154994
155907
|
searchPlaceholder: Prop.string().readAndWrite().propertiesPanel({
|
|
154995
155908
|
label: "Search placeholder",
|
|
@@ -155017,17 +155930,13 @@ const propertiesDefinition$9 = {
|
|
|
155017
155930
|
label: "Cell style",
|
|
155018
155931
|
controlType: "TEXT_STYLE"
|
|
155019
155932
|
}),
|
|
155020
|
-
backgroundColor:
|
|
155933
|
+
backgroundColor: colorProp({
|
|
155021
155934
|
label: "Background color",
|
|
155022
|
-
helpText: "Sets the background color of the table"
|
|
155023
|
-
controlType: "COLOR_PICKER"
|
|
155024
|
-
// themeValue: "{{ theme.colors.neutral }}",
|
|
155935
|
+
helpText: "Sets the background color of the table"
|
|
155025
155936
|
}),
|
|
155026
|
-
selectedRowBackgroundColor:
|
|
155937
|
+
selectedRowBackgroundColor: colorProp({
|
|
155027
155938
|
label: "Selected row background color",
|
|
155028
|
-
helpText: "Sets the background color of the selected row"
|
|
155029
|
-
controlType: "COLOR_PICKER"
|
|
155030
|
-
// themeValue: "{{ theme.colors.neutral50 }}",
|
|
155939
|
+
helpText: "Sets the background color of the selected row"
|
|
155031
155940
|
}),
|
|
155032
155941
|
border: border({ helpText: "Sets the border of the table" }),
|
|
155033
155942
|
borderRadius: borderRadius({
|
|
@@ -155079,11 +155988,9 @@ const propertiesDefinition$9 = {
|
|
|
155079
155988
|
label: "Search",
|
|
155080
155989
|
controlType: "TEXT_STYLE"
|
|
155081
155990
|
}),
|
|
155082
|
-
"searchProps.backgroundColor":
|
|
155991
|
+
"searchProps.backgroundColor": colorProp({
|
|
155083
155992
|
label: "Search background color",
|
|
155084
|
-
helpText: "Sets the background color of the search"
|
|
155085
|
-
controlType: "COLOR_PICKER"
|
|
155086
|
-
// themeValue:"{{ theme.colors.neutral }}",
|
|
155993
|
+
helpText: "Sets the background color of the search"
|
|
155087
155994
|
}),
|
|
155088
155995
|
"searchProps.border": border({
|
|
155089
155996
|
label: "Search border",
|
|
@@ -155135,7 +156042,6 @@ const propertiesDefinition$9 = {
|
|
|
155135
156042
|
selectedRow: Prop.any().readable().default(getSelectedRow),
|
|
155136
156043
|
selectedRowSchema: Prop.any().readable().default(getSelectedRowSchema),
|
|
155137
156044
|
selectedRows: Prop.any().readable().default(getSelectedRows),
|
|
155138
|
-
pageSize: Prop.number().readable().default(getPageSize),
|
|
155139
156045
|
filteredTableData: Prop.any().readable().default(function() {
|
|
155140
156046
|
if (!this) return [];
|
|
155141
156047
|
return getFilteredTableData(this)[0];
|
|
@@ -155150,15 +156056,23 @@ const propertiesDefinition$9 = {
|
|
|
155150
156056
|
// editedRowIndices: Prop.any().readable().default(getEditedRowIndices),
|
|
155151
156057
|
}),
|
|
155152
156058
|
meta: Section.category(PropsPanelCategory.Meta).children({
|
|
155153
|
-
selectedRowIndex: Prop.number().readable()
|
|
156059
|
+
selectedRowIndex: Prop.number().readable().default(function() {
|
|
156060
|
+
return this.defaultSelectedRow;
|
|
156061
|
+
}),
|
|
155154
156062
|
selectedRowIndices: Prop.any().readable(),
|
|
155155
|
-
|
|
155156
|
-
|
|
155157
|
-
|
|
155158
|
-
|
|
156063
|
+
sortedColumn: Prop.any().readable().default(function() {
|
|
156064
|
+
return this.defaultSort;
|
|
156065
|
+
}),
|
|
156066
|
+
searchText: Prop.string().readable().default(function() {
|
|
156067
|
+
return this.defaultSearchText ?? "";
|
|
156068
|
+
}),
|
|
156069
|
+
filters: Prop.any().readable().default(function() {
|
|
156070
|
+
return this.defaultFilters;
|
|
156071
|
+
}),
|
|
155159
156072
|
hiddenColumns: Prop.any().readable(),
|
|
155160
156073
|
columnFreezes: Prop.any().readable(),
|
|
155161
|
-
tagsColorAssignment: Prop.any().readable()
|
|
156074
|
+
tagsColorAssignment: Prop.any().readable(),
|
|
156075
|
+
pageNo: Prop.number().readable().default(() => 0)
|
|
155162
156076
|
// editOverrides: Prop.any().readable(),
|
|
155163
156077
|
// currentEditFocus: Prop.any().readable(),
|
|
155164
156078
|
// currentEditDropdownSearchText: Prop.string().default("").readable(),
|
|
@@ -164627,11 +165541,11 @@ const TableDataDownload = ({
|
|
|
164627
165541
|
columns,
|
|
164628
165542
|
tableSizes,
|
|
164629
165543
|
widgetName,
|
|
164630
|
-
|
|
165544
|
+
header,
|
|
164631
165545
|
tableCellTextStyle
|
|
164632
165546
|
}) => {
|
|
164633
165547
|
const [selected, setSelected] = React__default.useState(false);
|
|
164634
|
-
const tableName =
|
|
165548
|
+
const tableName = header ? header : widgetName;
|
|
164635
165549
|
const fileName = tableName;
|
|
164636
165550
|
const handleSelectMenu = useCallback(() => {
|
|
164637
165551
|
setSelected(true);
|
|
@@ -164863,13 +165777,13 @@ const TablePagination = ({
|
|
|
164863
165777
|
prevPageClick,
|
|
164864
165778
|
pageCount,
|
|
164865
165779
|
pageNo,
|
|
164866
|
-
|
|
165780
|
+
paginationType,
|
|
164867
165781
|
updatePageNo,
|
|
164868
165782
|
tableSizes,
|
|
164869
165783
|
theme
|
|
164870
165784
|
}) => {
|
|
164871
|
-
switch (
|
|
164872
|
-
case
|
|
165785
|
+
switch (paginationType) {
|
|
165786
|
+
case "server_side":
|
|
164873
165787
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
164874
165788
|
TableServerPagination,
|
|
164875
165789
|
{
|
|
@@ -164880,7 +165794,7 @@ const TablePagination = ({
|
|
|
164880
165794
|
themeColors: theme.colors
|
|
164881
165795
|
}
|
|
164882
165796
|
);
|
|
164883
|
-
case
|
|
165797
|
+
case "client_side":
|
|
164884
165798
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
164885
165799
|
TableClientPagination,
|
|
164886
165800
|
{
|
|
@@ -164964,11 +165878,11 @@ const TableFooter = ({
|
|
|
164964
165878
|
prevPageClick,
|
|
164965
165879
|
pageNo,
|
|
164966
165880
|
pageCount,
|
|
164967
|
-
|
|
165881
|
+
paginationType,
|
|
164968
165882
|
tableColumns,
|
|
164969
165883
|
tableData,
|
|
164970
165884
|
filteredOrderMap,
|
|
164971
|
-
|
|
165885
|
+
header,
|
|
164972
165886
|
tableSizes,
|
|
164973
165887
|
borderColor,
|
|
164974
165888
|
updatePageNo,
|
|
@@ -165132,11 +166046,11 @@ const TableFooter = ({
|
|
|
165132
166046
|
columns: tableColumns,
|
|
165133
166047
|
widgetName,
|
|
165134
166048
|
tableSizes,
|
|
165135
|
-
|
|
166049
|
+
header,
|
|
165136
166050
|
tableCellTextStyle
|
|
165137
166051
|
}
|
|
165138
166052
|
),
|
|
165139
|
-
|
|
166053
|
+
paginationType !== "server_side" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
165140
166054
|
RowWrapper,
|
|
165141
166055
|
{
|
|
165142
166056
|
className: `${CLASS_NAMES.BUILTIN_BODY} show-page-items`,
|
|
@@ -165158,7 +166072,7 @@ const TableFooter = ({
|
|
|
165158
166072
|
prevPageClick,
|
|
165159
166073
|
pageNo,
|
|
165160
166074
|
pageCount,
|
|
165161
|
-
|
|
166075
|
+
paginationType,
|
|
165162
166076
|
currentPageIndex,
|
|
165163
166077
|
tableSizes,
|
|
165164
166078
|
theme
|
|
@@ -167233,8 +168147,9 @@ const DescendingIcon = qe$1(SvgSort)`
|
|
|
167233
168147
|
}
|
|
167234
168148
|
`;
|
|
167235
168149
|
const TableHeaderCell = (props) => {
|
|
167236
|
-
var _a2
|
|
168150
|
+
var _a2;
|
|
167237
168151
|
const { column: column2, selectRows } = props;
|
|
168152
|
+
const resizerProps = column2.getResizerProps();
|
|
167238
168153
|
const resizingColumnId = useRef("");
|
|
167239
168154
|
const handleSortColumn = () => {
|
|
167240
168155
|
if (!props.isSortable || props.isResizingColumn) return;
|
|
@@ -167250,7 +168165,6 @@ const TableHeaderCell = (props) => {
|
|
|
167250
168165
|
defaultTextStyleVariant: TABLE_COLUMN_HEADER_DEFAULT_TYPOGRAPHY,
|
|
167251
168166
|
textStyle: props.columnHeaderProps
|
|
167252
168167
|
});
|
|
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
168168
|
const { setColumnFilter } = props;
|
|
167255
168169
|
const setFilter = useCallback(
|
|
167256
168170
|
(filter2) => {
|
|
@@ -167312,7 +168226,6 @@ const TableHeaderCell = (props) => {
|
|
|
167312
168226
|
HeaderCellContentWrapper,
|
|
167313
168227
|
{
|
|
167314
168228
|
columnProperties: props.columnProperties,
|
|
167315
|
-
shouldCapitalize: !columnHeaderTextStyleHasTextTransform && props.columnName === column2.id,
|
|
167316
168229
|
style: columnHeaderStyleProps.style,
|
|
167317
168230
|
className: `${getTextCssClassFromVariant(
|
|
167318
168231
|
columnHeaderStyleProps.textStyleVariant
|
|
@@ -167338,23 +168251,23 @@ const TableHeaderCell = (props) => {
|
|
|
167338
168251
|
e3.stopPropagation();
|
|
167339
168252
|
},
|
|
167340
168253
|
onDragOver: (e3) => {
|
|
167341
|
-
var _a3,
|
|
168254
|
+
var _a3, _b2;
|
|
167342
168255
|
if (props.columnIndex !== props.mutableHeaderDragRef.current && props.mutableHeaderDragRef.current !== -1) {
|
|
167343
168256
|
if (props.mutableHeaderDragRef.current > props.columnIndex) {
|
|
167344
168257
|
(_a3 = parentRef.current) == null ? void 0 : _a3.classList.add("highlight-left");
|
|
167345
168258
|
} else if (props.mutableHeaderDragRef.current < props.columnIndex) {
|
|
167346
|
-
(
|
|
168259
|
+
(_b2 = parentRef.current) == null ? void 0 : _b2.classList.add("highlight-right");
|
|
167347
168260
|
}
|
|
167348
168261
|
}
|
|
167349
168262
|
e3.preventDefault();
|
|
167350
168263
|
},
|
|
167351
168264
|
onDragEnter: (e3) => {
|
|
167352
|
-
var _a3,
|
|
168265
|
+
var _a3, _b2;
|
|
167353
168266
|
if (props.columnIndex !== props.mutableHeaderDragRef.current && props.mutableHeaderDragRef.current !== -1) {
|
|
167354
168267
|
if (props.mutableHeaderDragRef.current > props.columnIndex) {
|
|
167355
168268
|
(_a3 = parentRef.current) == null ? void 0 : _a3.classList.add("highlight-left");
|
|
167356
168269
|
} else if (props.mutableHeaderDragRef.current < props.columnIndex) {
|
|
167357
|
-
(
|
|
168270
|
+
(_b2 = parentRef.current) == null ? void 0 : _b2.classList.add("highlight-right");
|
|
167358
168271
|
}
|
|
167359
168272
|
}
|
|
167360
168273
|
e3.preventDefault();
|
|
@@ -167406,7 +168319,7 @@ const TableHeaderCell = (props) => {
|
|
|
167406
168319
|
isFrozen: getIsColumnFrozen(
|
|
167407
168320
|
props.column.id,
|
|
167408
168321
|
props.columnFreezes,
|
|
167409
|
-
(
|
|
168322
|
+
(_a2 = props.columnProperties) == null ? void 0 : _a2.isFrozen
|
|
167410
168323
|
),
|
|
167411
168324
|
theme: props.theme,
|
|
167412
168325
|
updateProperty: props.updateProperty
|
|
@@ -167415,11 +168328,21 @@ const TableHeaderCell = (props) => {
|
|
|
167415
168328
|
props.showResizer && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
167416
168329
|
"div",
|
|
167417
168330
|
{
|
|
167418
|
-
...
|
|
168331
|
+
...resizerProps,
|
|
167419
168332
|
className: `resizer ${column2.isResizing ? "isResizing" : ""}`,
|
|
167420
168333
|
onClick: (e3) => {
|
|
167421
168334
|
e3.preventDefault();
|
|
167422
168335
|
e3.stopPropagation();
|
|
168336
|
+
},
|
|
168337
|
+
onMouseDown: (e3) => {
|
|
168338
|
+
resizerProps.onMouseDown(e3);
|
|
168339
|
+
e3.stopPropagation();
|
|
168340
|
+
e3.preventDefault();
|
|
168341
|
+
},
|
|
168342
|
+
onTouchStart: (e3) => {
|
|
168343
|
+
resizerProps.onTouchStart(e3);
|
|
168344
|
+
e3.stopPropagation();
|
|
168345
|
+
e3.preventDefault();
|
|
167423
168346
|
}
|
|
167424
168347
|
}
|
|
167425
168348
|
)
|
|
@@ -168020,10 +168943,10 @@ const Table = (props) => {
|
|
|
168020
168943
|
const selectedRowIndex = props.selectedRowIndex;
|
|
168021
168944
|
const selectedRowIndices = props.selectedRowIndices || [];
|
|
168022
168945
|
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);
|
|
168946
|
+
const hasFooter = props.paginationType !== "none" || props.isDownloadable || props.numEdits != null && props.numEdits > 0 || props.isInsertionEnabled || canDelete;
|
|
168947
|
+
const hasHeader = props.isSearchable || !lodashExports.isEmpty(props.header) || props.hiddenColumns && ((_a2 = props.hiddenColumns) == null ? void 0 : _a2.length) > 0;
|
|
168948
|
+
const pageSize = props.paginationType === "none" ? props.tableData.length : props.pageSize;
|
|
168949
|
+
const pageCount = Math.ceil(props.tableData.length / pageSize) || 1;
|
|
168027
168950
|
const currentPageIndex = props.pageNo < pageCount ? props.pageNo : 0;
|
|
168028
168951
|
const {
|
|
168029
168952
|
getTableProps,
|
|
@@ -168053,7 +168976,7 @@ const Table = (props) => {
|
|
|
168053
168976
|
);
|
|
168054
168977
|
let startIndex = currentPageIndex * pageSize;
|
|
168055
168978
|
let endIndex = startIndex + pageSize;
|
|
168056
|
-
if (props.
|
|
168979
|
+
if (props.paginationType === "server_side") {
|
|
168057
168980
|
startIndex = 0;
|
|
168058
168981
|
endIndex = props.tableData.length;
|
|
168059
168982
|
}
|
|
@@ -168604,7 +169527,7 @@ const Table = (props) => {
|
|
|
168604
169527
|
showFrozenColShadow,
|
|
168605
169528
|
tabIndex: 0,
|
|
168606
169529
|
className: CLASS_NAMES.DEFAULT_CONTAINER,
|
|
168607
|
-
showColumnBorders: props.showColumnBorders && (props.
|
|
169530
|
+
showColumnBorders: props.showColumnBorders && (props.paginationType !== "none" || subPage.length > 0),
|
|
168608
169531
|
colors: theme.colors,
|
|
168609
169532
|
onKeyDown: handleKeyDown,
|
|
168610
169533
|
"data-selecting-cells": tableManager.focusedCellIndices.length > 0,
|
|
@@ -168619,7 +169542,7 @@ const Table = (props) => {
|
|
|
168619
169542
|
searchKey: props.searchKey,
|
|
168620
169543
|
tableSizes,
|
|
168621
169544
|
compactMode: getCompactMode(props.compactMode),
|
|
168622
|
-
title: props.
|
|
169545
|
+
title: props.header,
|
|
168623
169546
|
columns: props.columns,
|
|
168624
169547
|
hiddenColumns: props.hiddenColumns,
|
|
168625
169548
|
searchPlaceholder: props.searchPlaceholder,
|
|
@@ -168692,7 +169615,7 @@ const Table = (props) => {
|
|
|
168692
169615
|
columnProperties: column2.columnProperties,
|
|
168693
169616
|
rawTableData: props.rawTableData,
|
|
168694
169617
|
transformedTableData: props.tableData,
|
|
168695
|
-
isFilterable: props.isFilterable && props.
|
|
169618
|
+
isFilterable: props.isFilterable && props.paginationType !== "server_side",
|
|
168696
169619
|
filter: (_b3 = (_a3 = props.filters) == null ? void 0 : _a3.byColumn) == null ? void 0 : _b3[column2.id],
|
|
168697
169620
|
setColumnFilter: props.setColumnFilter,
|
|
168698
169621
|
isHidden: column2.isHidden,
|
|
@@ -168768,11 +169691,11 @@ const Table = (props) => {
|
|
|
168768
169691
|
prevPageClick: props.prevPageClick,
|
|
168769
169692
|
pageNo: props.pageNo,
|
|
168770
169693
|
pageCount,
|
|
168771
|
-
|
|
169694
|
+
paginationType: props.paginationType,
|
|
168772
169695
|
tableColumns: props.columns,
|
|
168773
169696
|
tableData: props.tableData,
|
|
168774
169697
|
filteredOrderMap: props.filteredOrderMap,
|
|
168775
|
-
|
|
169698
|
+
header: props.header,
|
|
168776
169699
|
tableSizes,
|
|
168777
169700
|
updatePageNo: props.updatePageNo,
|
|
168778
169701
|
widgetName: props.widgetName,
|
|
@@ -169397,14 +170320,14 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
169397
170320
|
__publicField(this, "getTopVisibleIndex", () => {
|
|
169398
170321
|
const page = this.props.pageNo || 1;
|
|
169399
170322
|
const pageSize = this.props.pageSize || 1;
|
|
169400
|
-
const isPaginated = this.props.
|
|
170323
|
+
const isPaginated = this.props.paginationType !== "none";
|
|
169401
170324
|
return isPaginated ? (page - 1) * pageSize : 0;
|
|
169402
170325
|
});
|
|
169403
170326
|
__publicField(this, "getBottomVisibleIndex", () => {
|
|
169404
170327
|
const allEdits = this.props.allEdits ?? [];
|
|
169405
170328
|
const page = this.props.pageNo || 1;
|
|
169406
170329
|
const pageSize = this.props.pageSize || 1;
|
|
169407
|
-
const isPaginated = this.props.
|
|
170330
|
+
const isPaginated = this.props.paginationType !== "none";
|
|
169408
170331
|
return isPaginated ? Math.min(allEdits.length - 1, page * pageSize - 1) : allEdits.length - 1;
|
|
169409
170332
|
});
|
|
169410
170333
|
__publicField(this, "handlePaste", (event) => {
|
|
@@ -169464,7 +170387,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
169464
170387
|
);
|
|
169465
170388
|
const data2 = [];
|
|
169466
170389
|
let largestRow = 0;
|
|
169467
|
-
const isMultiPage = this.props.
|
|
170390
|
+
const isMultiPage = this.props.paginationType === "server_side" || this.props.paginationType === "client_side";
|
|
169468
170391
|
const page = this.props.pageNo || 1;
|
|
169469
170392
|
const pageSize = this.props.pageSize || 1;
|
|
169470
170393
|
for (const cell of this.currentCellFocus ?? []) {
|
|
@@ -169582,6 +170505,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
169582
170505
|
}
|
|
169583
170506
|
});
|
|
169584
170507
|
__publicField(this, "handleEditStart", (rowIndex, columnId, startingValue) => {
|
|
170508
|
+
this.props.disableDrag(true);
|
|
169585
170509
|
this.props.disableNudge(true);
|
|
169586
170510
|
this.props.setCurrentEditFocus({ row: rowIndex, columnId }, startingValue);
|
|
169587
170511
|
});
|
|
@@ -169898,7 +170822,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
169898
170822
|
}
|
|
169899
170823
|
if (relativePosition === tableData.length) {
|
|
169900
170824
|
setTimeout(() => {
|
|
169901
|
-
if (this.props.
|
|
170825
|
+
if (this.props.paginationType === "none") {
|
|
169902
170826
|
const tableScroller = this.getTableScroller();
|
|
169903
170827
|
tableScroller == null ? void 0 : tableScroller.scrollTo({
|
|
169904
170828
|
top: (tableScroller == null ? void 0 : tableScroller.scrollHeight) + 40,
|
|
@@ -170373,7 +171297,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
170373
171297
|
columnSizeMap: this.props.columnSizeMap,
|
|
170374
171298
|
pageNo,
|
|
170375
171299
|
pageSize: Math.max(1, pageSize),
|
|
170376
|
-
|
|
171300
|
+
paginationType: this.props.paginationType || "none",
|
|
170377
171301
|
selectedRowIndex: this.props.multiRowSelection ? -1 : this.props.selectedRowIndex ?? -1,
|
|
170378
171302
|
multiRowSelection: this.props.multiRowSelection,
|
|
170379
171303
|
selectedRowIndices: this.getComputedSelectedRowIndices(),
|
|
@@ -170385,19 +171309,18 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
170385
171309
|
handleResizeColumn: this.handleResizeColumn,
|
|
170386
171310
|
updatePageNo: this.updatePageNumber,
|
|
170387
171311
|
handleReorderColumn: this.handleReorderColumn,
|
|
170388
|
-
disableDrag:
|
|
170389
|
-
},
|
|
171312
|
+
disableDrag: this.props.disableDrag,
|
|
170390
171313
|
searchTableData: this.handleSearchTable,
|
|
170391
171314
|
filters: this.props.filters,
|
|
170392
171315
|
setColumnFilter: this.handleSetColumnFilter,
|
|
170393
171316
|
compactMode: getCompactMode(this.props.compactMode),
|
|
170394
171317
|
showColumnBorders: this.props.showColumnBorders,
|
|
170395
171318
|
sortTableColumn: this.handleColumnSorting,
|
|
170396
|
-
isSortable: this.props.
|
|
171319
|
+
isSortable: this.props.paginationType !== "server_side",
|
|
170397
171320
|
isSearchable: this.props.isSearchable,
|
|
170398
171321
|
isDownloadable: this.props.isDownloadable,
|
|
170399
171322
|
isFilterable: this.props.isFilterable,
|
|
170400
|
-
|
|
171323
|
+
header: this.props.header,
|
|
170401
171324
|
hiddenColumns: this.props.hiddenColumns ?? [],
|
|
170402
171325
|
columnFreezes: this.props.columnFreezes ?? {},
|
|
170403
171326
|
numEdits,
|
|
@@ -170513,6 +171436,7 @@ const SbTable = registerSbComponent(
|
|
|
170513
171436
|
propertiesDefinition: propertiesDefinition$9
|
|
170514
171437
|
},
|
|
170515
171438
|
(props) => {
|
|
171439
|
+
var _a2;
|
|
170516
171440
|
const { update } = useActions();
|
|
170517
171441
|
const { features } = useEditor();
|
|
170518
171442
|
const { theme } = useTheme();
|
|
@@ -170549,7 +171473,8 @@ const SbTable = registerSbComponent(
|
|
|
170549
171473
|
);
|
|
170550
171474
|
const setPageNo = useCallback(
|
|
170551
171475
|
(value, rowContext, triggerEventHandlers = false) => {
|
|
170552
|
-
|
|
171476
|
+
const newPageNo = Math.max(value - 1, 0);
|
|
171477
|
+
update((e3) => e3.pageNo = newPageNo);
|
|
170553
171478
|
if (triggerEventHandlers) {
|
|
170554
171479
|
onPageChange == null ? void 0 : onPageChange(rowContext);
|
|
170555
171480
|
}
|
|
@@ -170665,9 +171590,9 @@ const SbTable = registerSbComponent(
|
|
|
170665
171590
|
return [
|
|
170666
171591
|
key22,
|
|
170667
171592
|
async (args) => {
|
|
170668
|
-
var
|
|
171593
|
+
var _a3;
|
|
170669
171594
|
await (value == null ? void 0 : value(args.context));
|
|
170670
|
-
(
|
|
171595
|
+
(_a3 = args.onComplete) == null ? void 0 : _a3.call(args);
|
|
170671
171596
|
}
|
|
170672
171597
|
];
|
|
170673
171598
|
}
|
|
@@ -170685,27 +171610,59 @@ const SbTable = registerSbComponent(
|
|
|
170685
171610
|
},
|
|
170686
171611
|
[features.nudging]
|
|
170687
171612
|
);
|
|
171613
|
+
const [pageSize, setPageSize] = useState(props.configuredPageSize);
|
|
171614
|
+
useEffect(() => {
|
|
171615
|
+
setPageSize(props.configuredPageSize);
|
|
171616
|
+
}, [props.configuredPageSize]);
|
|
171617
|
+
const autoPageSize = useMemo$2(() => {
|
|
171618
|
+
var _a3, _b2;
|
|
171619
|
+
if (typeof pageSize === "number" && pageSize > 0) return pageSize;
|
|
171620
|
+
if (((_a3 = props.height) == null ? void 0 : _a3.mode) === "px" && typeof props.height.value === "number") {
|
|
171621
|
+
const compactMode = getCompactMode(props.compactMode);
|
|
171622
|
+
const tableSizes = TABLE_SIZES[compactMode];
|
|
171623
|
+
const componentHeight = props.height.value;
|
|
171624
|
+
const headerHeight = props.isSearchable || props.tableHeader || ((_b2 = props.hiddenColumns) == null ? void 0 : _b2.length) > 0 ? tableSizes.TABLE_HEADER_HEIGHT : 0;
|
|
171625
|
+
const scrollbarSize = 8;
|
|
171626
|
+
const mainHeight = componentHeight - headerHeight - scrollbarSize - tableSizes.TABLE_FOOTER_HEIGHT - tableSizes.COLUMN_HEADER_HEIGHT;
|
|
171627
|
+
return Math.floor(mainHeight / (tableSizes.ROW_HEIGHT + 1));
|
|
171628
|
+
}
|
|
171629
|
+
return 10;
|
|
171630
|
+
}, [
|
|
171631
|
+
pageSize,
|
|
171632
|
+
props.height,
|
|
171633
|
+
props.compactMode,
|
|
171634
|
+
(_a2 = props.hiddenColumns) == null ? void 0 : _a2.length,
|
|
171635
|
+
props.isSearchable,
|
|
171636
|
+
props.tableHeader
|
|
171637
|
+
]);
|
|
171638
|
+
const disableDrag = useCallback(
|
|
171639
|
+
(disable) => {
|
|
171640
|
+
features.dragAndDrop.set(!disable);
|
|
171641
|
+
},
|
|
171642
|
+
[features.dragAndDrop]
|
|
171643
|
+
);
|
|
170688
171644
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ...passthroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
170689
171645
|
TableWidget,
|
|
170690
171646
|
{
|
|
170691
171647
|
...props,
|
|
171648
|
+
pageSize: autoPageSize,
|
|
170692
171649
|
enableRowInsertion: false,
|
|
170693
171650
|
enableRowDeletion: false,
|
|
170694
|
-
defaultSearchText: props.defaultSearchText ?? "",
|
|
170695
171651
|
searchPlaceholder: props.searchPlaceholder ?? "",
|
|
170696
171652
|
searchText: props.searchText ?? "",
|
|
170697
|
-
|
|
171653
|
+
paginationType: props.paginationType,
|
|
170698
171654
|
columns: transformedColumns,
|
|
170699
|
-
|
|
170700
|
-
|
|
171655
|
+
filters: props.filters ?? EMPTY_OBJ,
|
|
171656
|
+
header: props.header ?? "",
|
|
170701
171657
|
tableData: props.tableData ?? EMPTY_ARRAY,
|
|
170702
171658
|
currentEditDropdownSearchText: props.currentEditDropdownSearchText,
|
|
170703
171659
|
selectedRowIndices: props.selectedRowIndices ?? EMPTY_ARRAY,
|
|
170704
171660
|
showColumnBorders: props.showColumnBorders ?? false,
|
|
170705
171661
|
compactMode: getCompactMode(props.compactMode),
|
|
170706
|
-
border: props.border ?? theme.defaultBorder,
|
|
171662
|
+
border: props.border ?? createPerSideBorder(theme.defaultBorder),
|
|
170707
171663
|
borderRadius: props.borderRadius ?? theme.defaultBorder.borderRadius,
|
|
170708
171664
|
disableNudge,
|
|
171665
|
+
disableDrag,
|
|
170709
171666
|
setSelectedRowData,
|
|
170710
171667
|
setPageNo,
|
|
170711
171668
|
setColumnOrder,
|
|
@@ -173149,6 +174106,10 @@ const StyledSingleDropDown = qe$1(SingleDropDown)`
|
|
|
173149
174106
|
display: -webkit-box;
|
|
173150
174107
|
-webkit-line-clamp: 1;
|
|
173151
174108
|
-webkit-box-orient: vertical;
|
|
174109
|
+
|
|
174110
|
+
&:disabled {
|
|
174111
|
+
cursor: not-allowed;
|
|
174112
|
+
}
|
|
173152
174113
|
}
|
|
173153
174114
|
`;
|
|
173154
174115
|
const StyledCrossIcon = qe$1(SvgCrossXs)`
|
|
@@ -173630,7 +174591,8 @@ class DropDownComponent extends React__default.PureComponent {
|
|
|
173630
174591
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicSVG, { iconName: this.props.icon, size: this.props.iconSize })
|
|
173631
174592
|
}
|
|
173632
174593
|
) : null;
|
|
173633
|
-
const
|
|
174594
|
+
const selectedItemHasIcon = !!(selectedIndex > -1 && ((_c2 = this.props.options[selectedIndex]) == null ? void 0 : _c2.icon));
|
|
174595
|
+
const singleSelectDropdownIconElement = selectedItemHasIcon ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
173634
174596
|
StyledIconSpan,
|
|
173635
174597
|
{
|
|
173636
174598
|
className: this.getIconClassNames(
|
|
@@ -173639,7 +174601,13 @@ class DropDownComponent extends React__default.PureComponent {
|
|
|
173639
174601
|
style: {
|
|
173640
174602
|
left: ((_e2 = (_d2 = this.props.inputPadding) == null ? void 0 : _d2.left) == null ? void 0 : _e2.value) ?? 0
|
|
173641
174603
|
},
|
|
173642
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
174604
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
174605
|
+
DynamicSVG,
|
|
174606
|
+
{
|
|
174607
|
+
iconName: this.props.options[selectedIndex].icon,
|
|
174608
|
+
size: this.props.iconSize
|
|
174609
|
+
}
|
|
174610
|
+
)
|
|
173643
174611
|
}
|
|
173644
174612
|
) : defaultIconElement;
|
|
173645
174613
|
const tagOptionIconElement = (tagIndex) => {
|
|
@@ -173650,7 +174618,7 @@ class DropDownComponent extends React__default.PureComponent {
|
|
|
173650
174618
|
return null;
|
|
173651
174619
|
};
|
|
173652
174620
|
const paddingVarDeclarations = createCssVariablesForPadding(
|
|
173653
|
-
!!this.props.icon,
|
|
174621
|
+
!!this.props.icon || selectedItemHasIcon,
|
|
173654
174622
|
this.props.inputPadding,
|
|
173655
174623
|
this.props.iconSize
|
|
173656
174624
|
);
|
|
@@ -173769,6 +174737,7 @@ class DropDownComponent extends React__default.PureComponent {
|
|
|
173769
174737
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
173770
174738
|
MultiDropDown,
|
|
173771
174739
|
{
|
|
174740
|
+
disabled: this.props.disabled,
|
|
173772
174741
|
overflowTags: this.props.overflowTags,
|
|
173773
174742
|
items: this.props.options,
|
|
173774
174743
|
labelHeight: this.props.vertical ? 26 : 0,
|
|
@@ -173941,22 +174910,7 @@ const propertiesDefinition$8 = {
|
|
|
173941
174910
|
})
|
|
173942
174911
|
}),
|
|
173943
174912
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
173944
|
-
labelPosition:
|
|
173945
|
-
label: "Label position",
|
|
173946
|
-
controlType: "RADIO_BUTTON_GROUP",
|
|
173947
|
-
options: [
|
|
173948
|
-
{
|
|
173949
|
-
icon: "ICON_LEFT_ALIGN",
|
|
173950
|
-
value: "left",
|
|
173951
|
-
label: "Beside"
|
|
173952
|
-
},
|
|
173953
|
-
{
|
|
173954
|
-
icon: "VERTICAL_TOP",
|
|
173955
|
-
value: "top",
|
|
173956
|
-
label: "Above"
|
|
173957
|
-
}
|
|
173958
|
-
]
|
|
173959
|
-
}),
|
|
174913
|
+
labelPosition: labelPosition(),
|
|
173960
174914
|
labelStyle: labelTextStyle(),
|
|
173961
174915
|
icon: Prop.string().propertiesPanel({
|
|
173962
174916
|
label: "Icon",
|
|
@@ -173978,13 +174932,16 @@ const propertiesDefinition$8 = {
|
|
|
173978
174932
|
}),
|
|
173979
174933
|
layout: Section.category(PropsPanelCategory.Layout).add(padding({ themeValue: DROPDOWN_PADDING, default: DROPDOWN_PADDING })).add(size$2()).add(margin()).add(visible()),
|
|
173980
174934
|
interaction: Section.category(PropsPanelCategory.Interaction).children({
|
|
173981
|
-
|
|
174935
|
+
multiselect: Prop.boolean().readAndWrite().default(false).propertiesPanel({
|
|
173982
174936
|
label: "Multi-select",
|
|
173983
174937
|
helpText: "Allows users to select either a single option or multiple options"
|
|
173984
174938
|
}),
|
|
173985
174939
|
allowSelectAll: Prop.boolean().readAndWrite().default(false).propertiesPanel({
|
|
173986
174940
|
label: "Select/Deselect all",
|
|
173987
|
-
helpText: "Enable a button to select/deselect all options"
|
|
174941
|
+
helpText: "Enable a button to select/deselect all options",
|
|
174942
|
+
isVisible: function() {
|
|
174943
|
+
return this.multiselect;
|
|
174944
|
+
}
|
|
173988
174945
|
}),
|
|
173989
174946
|
allowClearing: Prop.boolean().readAndWrite().default(false).propertiesPanel({
|
|
173990
174947
|
label: "Clearable",
|
|
@@ -174029,7 +174986,7 @@ const propertiesDefinition$8 = {
|
|
|
174029
174986
|
}),
|
|
174030
174987
|
derived: Section.category(PropsPanelCategory.Derived).children({
|
|
174031
174988
|
value: Prop.any().readable().default(function() {
|
|
174032
|
-
return this.
|
|
174989
|
+
return this.multiselect ? this.selectedOptionArr : this.selectedOptionValue;
|
|
174033
174990
|
}),
|
|
174034
174991
|
defaultTransformation: Prop.any().readable().default(function() {
|
|
174035
174992
|
if (!Array.isArray(this.options)) return;
|
|
@@ -174085,9 +175042,9 @@ const propertiesDefinition$8 = {
|
|
|
174085
175042
|
validationErrors: Prop.any().readable().default(function() {
|
|
174086
175043
|
const errors2 = {};
|
|
174087
175044
|
if (this.isRequired) {
|
|
174088
|
-
if (this.
|
|
175045
|
+
if (this.multiselect && this.selectedIndexArr && this.selectedIndexArr.length === 0) {
|
|
174089
175046
|
errors2.isRequired = "Required";
|
|
174090
|
-
} else if (!this.
|
|
175047
|
+
} else if (!this.multiselect && !this.selectedOption) {
|
|
174091
175048
|
errors2.isRequired = "Required";
|
|
174092
175049
|
}
|
|
174093
175050
|
}
|
|
@@ -174098,7 +175055,7 @@ const propertiesDefinition$8 = {
|
|
|
174098
175055
|
}),
|
|
174099
175056
|
selectedOptionValue: Prop.any().readable().default(function() {
|
|
174100
175057
|
var _a2;
|
|
174101
|
-
if (this.
|
|
175058
|
+
if (this.multiselect) return;
|
|
174102
175059
|
const normalizedValue = normalizeFunction(
|
|
174103
175060
|
this.metaSelectedOptionValue,
|
|
174104
175061
|
(_a2 = this.transformation) == null ? void 0 : _a2.value
|
|
@@ -174113,7 +175070,7 @@ const propertiesDefinition$8 = {
|
|
|
174113
175070
|
}
|
|
174114
175071
|
}),
|
|
174115
175072
|
selectedOptionValues: Prop.any().readable().default(function() {
|
|
174116
|
-
if (!this.
|
|
175073
|
+
if (!this.multiselect) return;
|
|
174117
175074
|
const normalize2 = (val) => {
|
|
174118
175075
|
var _a2;
|
|
174119
175076
|
return normalizeFunction(val, (_a2 = this.transformation) == null ? void 0 : _a2.value);
|
|
@@ -174134,7 +175091,7 @@ const propertiesDefinition$8 = {
|
|
|
174134
175091
|
}),
|
|
174135
175092
|
selectedOption: Prop.any().readable().default(function() {
|
|
174136
175093
|
var _a2;
|
|
174137
|
-
if (this.
|
|
175094
|
+
if (this.multiselect) return;
|
|
174138
175095
|
const normalizedValue = normalizeFunction(
|
|
174139
175096
|
this.metaSelectedOptionValue,
|
|
174140
175097
|
(_a2 = this.transformation) == null ? void 0 : _a2.value
|
|
@@ -174144,7 +175101,7 @@ const propertiesDefinition$8 = {
|
|
|
174144
175101
|
);
|
|
174145
175102
|
}),
|
|
174146
175103
|
selectedOptionArr: Prop.any().readable().default(function() {
|
|
174147
|
-
if (!this.
|
|
175104
|
+
if (!this.multiselect) return;
|
|
174148
175105
|
const normalize2 = (val) => {
|
|
174149
175106
|
var _a2;
|
|
174150
175107
|
return normalizeFunction(val, (_a2 = this.transformation) == null ? void 0 : _a2.value);
|
|
@@ -174160,7 +175117,7 @@ const propertiesDefinition$8 = {
|
|
|
174160
175117
|
}),
|
|
174161
175118
|
selectedIndex: Prop.number().readable().default(function() {
|
|
174162
175119
|
var _a2;
|
|
174163
|
-
if (this.
|
|
175120
|
+
if (this.multiselect) return;
|
|
174164
175121
|
const normalizedValue = normalizeFunction(
|
|
174165
175122
|
this.metaSelectedOptionValue,
|
|
174166
175123
|
(_a2 = this.transformation) == null ? void 0 : _a2.value
|
|
@@ -174270,20 +175227,20 @@ const SbDropdown = registerSbComponent(
|
|
|
174270
175227
|
},
|
|
174271
175228
|
[props.isTouched, update]
|
|
174272
175229
|
);
|
|
174273
|
-
const {
|
|
175230
|
+
const { multiselect, onOptionChange: propOnOptionChange } = props;
|
|
174274
175231
|
const onOptionSelected = useCallback(
|
|
174275
175232
|
(selectedOption) => {
|
|
174276
175233
|
if (selectedOption === null) {
|
|
174277
175234
|
if (props.selectedOption) {
|
|
174278
175235
|
update((e3) => e3.metaSelectedOptionValue = -1);
|
|
174279
|
-
if (!
|
|
175236
|
+
if (!multiselect) {
|
|
174280
175237
|
onClear();
|
|
174281
175238
|
}
|
|
174282
175239
|
}
|
|
174283
175240
|
return;
|
|
174284
175241
|
}
|
|
174285
175242
|
let isChanged = true;
|
|
174286
|
-
if (!
|
|
175243
|
+
if (!multiselect) {
|
|
174287
175244
|
if (props.selectedOption) {
|
|
174288
175245
|
isChanged = !lodashExports.isEqual(
|
|
174289
175246
|
normalize2(props.selectedOption.value),
|
|
@@ -174315,7 +175272,7 @@ const SbDropdown = registerSbComponent(
|
|
|
174315
175272
|
}
|
|
174316
175273
|
},
|
|
174317
175274
|
[
|
|
174318
|
-
|
|
175275
|
+
multiselect,
|
|
174319
175276
|
props.isTouched,
|
|
174320
175277
|
props.selectedOption,
|
|
174321
175278
|
propOnOptionChange,
|
|
@@ -174424,7 +175381,7 @@ const SbDropdown = registerSbComponent(
|
|
|
174424
175381
|
onFocusChange: handleFocusChange,
|
|
174425
175382
|
onSearchTextChange: onDebouncedSearchTextChange
|
|
174426
175383
|
};
|
|
174427
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownContainer, { ...passthroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownStyleOverrides, { vertical: props.labelPosition === "top", children: props.
|
|
175384
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownContainer, { ...passthroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownStyleOverrides, { vertical: props.labelPosition === "top", children: props.multiselect ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
174428
175385
|
DropDownComponent,
|
|
174429
175386
|
{
|
|
174430
175387
|
...commonProps,
|
|
@@ -174729,17 +175686,6 @@ const SbCheckbox = registerSbComponent(
|
|
|
174729
175686
|
) });
|
|
174730
175687
|
}
|
|
174731
175688
|
);
|
|
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
175689
|
const adjustDateFormatSideEffect = (params) => {
|
|
174744
175690
|
const widgetMeta = params.widgetMeta;
|
|
174745
175691
|
const widgetState = params.widgetState;
|
|
@@ -174824,13 +175770,20 @@ const propertiesDefinition$6 = {
|
|
|
174824
175770
|
visibility: "SHOW_NAME"
|
|
174825
175771
|
}),
|
|
174826
175772
|
defaultDate: Prop.string().propertiesPanel({
|
|
174827
|
-
|
|
175773
|
+
controlType: "DATE_PICKER",
|
|
175774
|
+
defaultOnAdd: function() {
|
|
175775
|
+
if (this.manageTimezone) {
|
|
175776
|
+
return moment().tz(this.valueTimezone || moment.tz.guess()).format(this.dateFormat);
|
|
175777
|
+
}
|
|
175778
|
+
return moment().format(this.dateFormat);
|
|
175779
|
+
},
|
|
174828
175780
|
helpText: "Sets the default date of the component. The date is updated if the default date changes",
|
|
175781
|
+
isRemovable: true,
|
|
175782
|
+
label: "Default date",
|
|
174829
175783
|
placeholder: "Enter default date",
|
|
174830
|
-
|
|
174831
|
-
isRemovable: true
|
|
175784
|
+
visibility: "SHOW_NAME"
|
|
174832
175785
|
}).onEdit(adjustDateFormatSideEffect),
|
|
174833
|
-
dateFormat: Prop.string().readAndWrite().default(
|
|
175786
|
+
dateFormat: Prop.string().readAndWrite().default(ISO_DATE_FORMAT).propertiesPanel({
|
|
174834
175787
|
label: "Value format",
|
|
174835
175788
|
helpText: "Sets the format of the selected date",
|
|
174836
175789
|
controlType: "DROP_DOWN",
|
|
@@ -174880,22 +175833,7 @@ const propertiesDefinition$6 = {
|
|
|
174880
175833
|
}),
|
|
174881
175834
|
layout: basicLayout(),
|
|
174882
175835
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
174883
|
-
labelPosition:
|
|
174884
|
-
label: "Label position",
|
|
174885
|
-
controlType: "RADIO_BUTTON_GROUP",
|
|
174886
|
-
options: [
|
|
174887
|
-
{
|
|
174888
|
-
icon: "ICON_LEFT_ALIGN",
|
|
174889
|
-
value: "left",
|
|
174890
|
-
label: "Beside"
|
|
174891
|
-
},
|
|
174892
|
-
{
|
|
174893
|
-
icon: "VERTICAL_TOP",
|
|
174894
|
-
value: "top",
|
|
174895
|
-
label: "Above"
|
|
174896
|
-
}
|
|
174897
|
-
]
|
|
174898
|
-
}),
|
|
175836
|
+
labelPosition: labelPosition(),
|
|
174899
175837
|
labelStyle: labelTextStyle(),
|
|
174900
175838
|
// TODO(code-mode): Add color pickers, border controls, etc.
|
|
174901
175839
|
icon: Prop.string().readAndWrite().default("calendar_today").propertiesPanel({
|
|
@@ -174958,16 +175896,16 @@ const propertiesDefinition$6 = {
|
|
|
174958
175896
|
if (this.isRequired && !this.selectedDate) {
|
|
174959
175897
|
errors2.isRequired = "Required";
|
|
174960
175898
|
}
|
|
174961
|
-
if (this.selectedDate && this.dateFormat && !
|
|
175899
|
+
if (this.selectedDate && this.dateFormat && !moment(this.selectedDate, this.dateFormat, true).isValid()) {
|
|
174962
175900
|
errors2.dateInvalid = "Invalid date";
|
|
174963
175901
|
}
|
|
174964
|
-
if (this.minDate && this.selectedDate &&
|
|
174965
|
-
|
|
175902
|
+
if (this.minDate && this.selectedDate && moment(this.selectedDate, this.dateFormat).isBefore(
|
|
175903
|
+
moment(this.minDate, this.dateFormat)
|
|
174966
175904
|
)) {
|
|
174967
175905
|
errors2.minDate = "Date must be greater than or equal to " + this.minDate;
|
|
174968
175906
|
}
|
|
174969
|
-
if (this.maxDate && this.selectedDate &&
|
|
174970
|
-
|
|
175907
|
+
if (this.maxDate && this.selectedDate && moment(this.selectedDate, this.dateFormat).isAfter(
|
|
175908
|
+
moment(this.maxDate, this.dateFormat)
|
|
174971
175909
|
)) {
|
|
174972
175910
|
errors2.maxDate = "Date must be less than or equal to " + this.maxDate;
|
|
174973
175911
|
}
|
|
@@ -174980,12 +175918,12 @@ const propertiesDefinition$6 = {
|
|
|
174980
175918
|
return Object.keys(this.validationErrors ?? {}).length === 0;
|
|
174981
175919
|
}),
|
|
174982
175920
|
outputDateLocal: Prop.string().readable().default(function() {
|
|
174983
|
-
return
|
|
175921
|
+
return moment(this.selectedDate, this.dateFormat).format(
|
|
174984
175922
|
"YYYY-MM-DDTHH:mm:ss.SSSZ"
|
|
174985
175923
|
);
|
|
174986
175924
|
}),
|
|
174987
175925
|
outputDateUtc: Prop.string().readable().default(function() {
|
|
174988
|
-
return
|
|
175926
|
+
return moment(this.selectedDate, this.dateFormat).toISOString();
|
|
174989
175927
|
}),
|
|
174990
175928
|
showError: Prop.boolean().readable().default(function() {
|
|
174991
175929
|
const hasValue2 = !!this.value;
|
|
@@ -175135,7 +176073,7 @@ const propertiesDefinition$5 = {
|
|
|
175135
176073
|
})
|
|
175136
176074
|
}),
|
|
175137
176075
|
derived: Section.category(PropsPanelCategory.Derived).children({
|
|
175138
|
-
|
|
176076
|
+
isToggledOn: Prop.boolean().readable().default(function() {
|
|
175139
176077
|
return this.isChecked;
|
|
175140
176078
|
}),
|
|
175141
176079
|
validationErrors: Prop.any().readable().default(function() {
|
|
@@ -175181,6 +176119,7 @@ const SwitchComponentGroup = styleAsClass`
|
|
|
175181
176119
|
flex-direction: column;
|
|
175182
176120
|
gap: 2px;
|
|
175183
176121
|
justify-content: space-between;
|
|
176122
|
+
max-width: 100%;
|
|
175184
176123
|
`;
|
|
175185
176124
|
const SwitchContainerClassName = styleAsClass`
|
|
175186
176125
|
display: flex;
|
|
@@ -175371,11 +176310,9 @@ const propertiesDefinition$4 = {
|
|
|
175371
176310
|
})
|
|
175372
176311
|
}).add(margin()).add(visible()),
|
|
175373
176312
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
175374
|
-
color:
|
|
176313
|
+
color: colorProp({
|
|
175375
176314
|
label: "Color",
|
|
175376
|
-
controlType: "COLOR_PICKER",
|
|
175377
176315
|
helpText: "Changes the color of the icon"
|
|
175378
|
-
// themeValue:"{{ theme.colors.neutral700 }}",
|
|
175379
176316
|
}),
|
|
175380
176317
|
animateLoading: Prop.boolean().readAndWrite().default(true).propertiesPanel({
|
|
175381
176318
|
label: "Loading animation",
|
|
@@ -175592,9 +176529,8 @@ const propertiesDefinition$3 = {
|
|
|
175592
176529
|
})
|
|
175593
176530
|
}),
|
|
175594
176531
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
175595
|
-
backgroundColor:
|
|
176532
|
+
backgroundColor: colorProp({
|
|
175596
176533
|
label: "Background",
|
|
175597
|
-
controlType: "COLOR_PICKER",
|
|
175598
176534
|
helpText: "Changes the color of the background"
|
|
175599
176535
|
}),
|
|
175600
176536
|
border: border(),
|
|
@@ -176766,6 +177702,11 @@ const EmbedWrapper = (props) => {
|
|
|
176766
177702
|
"sb-create-component",
|
|
176767
177703
|
createComponentListener
|
|
176768
177704
|
);
|
|
177705
|
+
const globalSyncListener = (event) => {
|
|
177706
|
+
const { global: global2 } = event.data.payload;
|
|
177707
|
+
updateGlobalScope(global2);
|
|
177708
|
+
};
|
|
177709
|
+
iframeMessageHandler.addEventListener("sb-global-sync", globalSyncListener);
|
|
176769
177710
|
return () => {
|
|
176770
177711
|
iframeMessageHandler.removeEventListener(
|
|
176771
177712
|
"sb-bootstrap-response",
|
|
@@ -176787,6 +177728,10 @@ const EmbedWrapper = (props) => {
|
|
|
176787
177728
|
"sb-create-component",
|
|
176788
177729
|
createComponentListener
|
|
176789
177730
|
);
|
|
177731
|
+
iframeMessageHandler.removeEventListener(
|
|
177732
|
+
"sb-global-sync",
|
|
177733
|
+
globalSyncListener
|
|
177734
|
+
);
|
|
176790
177735
|
};
|
|
176791
177736
|
}, []);
|
|
176792
177737
|
useEffect(() => {
|
|
@@ -178277,7 +179222,7 @@ const generateTextStyles = (textStyles, builtinTypographies, fallbackFont) => {
|
|
|
178277
179222
|
|
|
178278
179223
|
.${CLASS_NAMES.INPUT} {
|
|
178279
179224
|
input::placeholder,
|
|
178280
|
-
textarea::placeholder {
|
|
179225
|
+
.${INPUT$1}::placeholder, textarea::placeholder {
|
|
178281
179226
|
${styleFromTextBlockWithColors(textStyles.inputPlaceholder)}
|
|
178282
179227
|
}
|
|
178283
179228
|
}
|
|
@@ -178405,7 +179350,7 @@ function applyThemeToIframe(generatedTheme) {
|
|
|
178405
179350
|
const originalLog = console.log;
|
|
178406
179351
|
console.log = (...args) => {
|
|
178407
179352
|
const processedArgs = args.map((arg) => {
|
|
178408
|
-
if (arg && typeof arg === "object" && getBindingIdentifier(arg)) {
|
|
179353
|
+
if (arg && typeof arg === "object" && (getBindingIdentifier(arg) || getBindingIdentifier(arg.bind ?? {}))) {
|
|
178409
179354
|
return JSON.parse(JSON.stringify(arg));
|
|
178410
179355
|
}
|
|
178411
179356
|
return arg;
|
|
@@ -190031,4 +190976,4 @@ export {
|
|
|
190031
190976
|
copyToClipboard as y,
|
|
190032
190977
|
navigateTo as z
|
|
190033
190978
|
};
|
|
190034
|
-
//# sourceMappingURL=index-
|
|
190979
|
+
//# sourceMappingURL=index-DvPGGRJu.js.map
|