@superblocksteam/library 2.0.0-next.32 → 2.0.0-next.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{allPaths-BpeB2CxS.js → allPaths-BPEggTbd.js} +2 -2
- package/dist/{allPaths-BpeB2CxS.js.map → allPaths-BPEggTbd.js.map} +1 -1
- package/dist/{allPaths-BDjfzn82.js → allPaths-PR2rTiD5.js} +2 -2
- package/dist/{allPaths-BDjfzn82.js.map → allPaths-PR2rTiD5.js.map} +1 -1
- package/dist/{allPathsLoader-CnJzd6Xx.js → allPathsLoader-BWLDGMsQ.js} +3 -3
- package/dist/{allPathsLoader-CnJzd6Xx.js.map → allPathsLoader-BWLDGMsQ.js.map} +1 -1
- package/dist/{allPathsLoader-V4FREx0I.js → allPathsLoader-C82irE62.js} +3 -3
- package/dist/{allPathsLoader-V4FREx0I.js.map → allPathsLoader-C82irE62.js.map} +1 -1
- package/dist/{index-RG7SFiT3.js → index--MyJLg0V.js} +318 -49
- package/dist/{index-RG7SFiT3.js.map → index--MyJLg0V.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{splitPathsBySizeLoader-ZzgI9e09.js → splitPathsBySizeLoader-2qHY2dmp.js} +2 -2
- package/dist/{splitPathsBySizeLoader-ZzgI9e09.js.map → splitPathsBySizeLoader-2qHY2dmp.js.map} +1 -1
- package/dist/{splitPathsBySizeLoader-D_n88SPK.js → splitPathsBySizeLoader-aKrjndrG.js} +2 -2
- package/dist/{splitPathsBySizeLoader-D_n88SPK.js.map → splitPathsBySizeLoader-aKrjndrG.js.map} +1 -1
- package/dist-types/edit-mode/default-table-data.d.ts +64 -0
- 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 +2 -2
- package/dist-types/lib/user-facing/components/table/index.d.ts +6 -6
- package/dist-types/lib/user-facing/components/table/props.d.ts +6 -6
- package/dist-types/lib/user-facing/components/table/table-component.d.ts +1 -1
- package/dist-types/lib/user-facing/components/table/table-styles.d.ts +0 -1
- package/dist-types/lib/user-facing/components/table/types.d.ts +3 -4
- package/package.json +2 -2
|
@@ -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-BWLDGMsQ.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-2qHY2dmp.js"
|
|
2701
2701
|
)];
|
|
2702
2702
|
case 4:
|
|
2703
2703
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -114427,6 +114427,8 @@ const useWidgetNodeRef = (instanceId) => {
|
|
|
114427
114427
|
return nodeRef;
|
|
114428
114428
|
};
|
|
114429
114429
|
const DraggableWidget = observer(function DraggableWidget2(props) {
|
|
114430
|
+
const editStore2 = getEditStore();
|
|
114431
|
+
const disableDrag = !editStore2.ui.dnd.canDragWidget(props.instanceId) || editStore2.ui.dnd.isDraggingNewComponent;
|
|
114430
114432
|
const {
|
|
114431
114433
|
setNodeRef: setDraggableNodeRef,
|
|
114432
114434
|
isDragging,
|
|
@@ -114434,7 +114436,7 @@ const DraggableWidget = observer(function DraggableWidget2(props) {
|
|
|
114434
114436
|
attributes: attributes2
|
|
114435
114437
|
} = useComponentDraggable({
|
|
114436
114438
|
instanceId: props.instanceId,
|
|
114437
|
-
disableDrag:
|
|
114439
|
+
disableDrag: disableDrag ?? false
|
|
114438
114440
|
});
|
|
114439
114441
|
const widgetNode = useWidgetNodeRef(props.instanceId);
|
|
114440
114442
|
useEffect(() => {
|
|
@@ -114449,6 +114451,20 @@ const DraggableWidget = observer(function DraggableWidget2(props) {
|
|
|
114449
114451
|
...attributes2,
|
|
114450
114452
|
className: "sb-draggable-wrapper",
|
|
114451
114453
|
"data-is-dragged": isDragging,
|
|
114454
|
+
onPointerDown: (e3) => {
|
|
114455
|
+
if (!disableDrag) {
|
|
114456
|
+
listeners == null ? void 0 : listeners.onPointerDown(e3);
|
|
114457
|
+
} else {
|
|
114458
|
+
e3.stopPropagation();
|
|
114459
|
+
}
|
|
114460
|
+
},
|
|
114461
|
+
onPointerMove: (e3) => {
|
|
114462
|
+
if (!disableDrag) {
|
|
114463
|
+
listeners == null ? void 0 : listeners.onPointerMove(e3);
|
|
114464
|
+
} else {
|
|
114465
|
+
e3.stopPropagation();
|
|
114466
|
+
}
|
|
114467
|
+
},
|
|
114452
114468
|
children: props.children
|
|
114453
114469
|
}
|
|
114454
114470
|
);
|
|
@@ -114804,6 +114820,178 @@ var KeyValuePropertyType = /* @__PURE__ */ ((KeyValuePropertyType2) => {
|
|
|
114804
114820
|
KeyValuePropertyType2["EMAIL"] = "email";
|
|
114805
114821
|
return KeyValuePropertyType2;
|
|
114806
114822
|
})(KeyValuePropertyType || {});
|
|
114823
|
+
const DEFAULT_TABLE_DATA = [
|
|
114824
|
+
{
|
|
114825
|
+
photo: "https://cdn.superblocks.com/sample-data/rachel_kim",
|
|
114826
|
+
name: "Rachel Kim",
|
|
114827
|
+
email: "rachel.kim89@gmail.com",
|
|
114828
|
+
role: "Vendor Partner",
|
|
114829
|
+
company: "Urban Threads Co.",
|
|
114830
|
+
status: "Active",
|
|
114831
|
+
date_joined: "2023-04-12",
|
|
114832
|
+
last_activity: "2025-06-07T16:20:00Z"
|
|
114833
|
+
},
|
|
114834
|
+
{
|
|
114835
|
+
photo: "https://cdn.superblocks.com/sample-data/daniel_vargas",
|
|
114836
|
+
name: "Daniel Vargas",
|
|
114837
|
+
email: "dvargas1984@yahoo.com",
|
|
114838
|
+
role: "Logistics Contact",
|
|
114839
|
+
company: "Vargas Freight Ltd.",
|
|
114840
|
+
status: "Pending",
|
|
114841
|
+
date_joined: "2024-01-23",
|
|
114842
|
+
last_activity: "2025-05-30T13:45:00Z"
|
|
114843
|
+
},
|
|
114844
|
+
{
|
|
114845
|
+
photo: "https://cdn.superblocks.com/sample-data/sophie_liu",
|
|
114846
|
+
name: "Sophie Liu",
|
|
114847
|
+
email: "sophie.liu.personal@gmail.com",
|
|
114848
|
+
role: "Retail Manager",
|
|
114849
|
+
company: "Modern Goods",
|
|
114850
|
+
status: "Active",
|
|
114851
|
+
date_joined: "2022-09-10",
|
|
114852
|
+
last_activity: "2025-06-08T09:03:00Z"
|
|
114853
|
+
},
|
|
114854
|
+
{
|
|
114855
|
+
photo: "https://cdn.superblocks.com/sample-data/omar_el-sayed",
|
|
114856
|
+
name: "Omar El-Sayed",
|
|
114857
|
+
email: "omarsayed78@hotmail.com",
|
|
114858
|
+
role: "Accounts Payable",
|
|
114859
|
+
company: "Sayed Textiles",
|
|
114860
|
+
status: "Inactive",
|
|
114861
|
+
date_joined: "2021-06-05",
|
|
114862
|
+
last_activity: "2024-12-18T11:40:00Z"
|
|
114863
|
+
},
|
|
114864
|
+
{
|
|
114865
|
+
photo: "https://cdn.superblocks.com/sample-data/grace_nguyen",
|
|
114866
|
+
name: "Grace Nguyen",
|
|
114867
|
+
email: "gracenguyen23@icloud.com",
|
|
114868
|
+
role: "Product Supplier",
|
|
114869
|
+
company: "Green Earth Supplies",
|
|
114870
|
+
status: "Active",
|
|
114871
|
+
date_joined: "2023-11-03",
|
|
114872
|
+
last_activity: "2025-06-08T17:28:00Z"
|
|
114873
|
+
},
|
|
114874
|
+
{
|
|
114875
|
+
photo: "https://cdn.superblocks.com/sample-data/alex_romero",
|
|
114876
|
+
name: "Alex Romero",
|
|
114877
|
+
email: "alex.romero@gmail.com",
|
|
114878
|
+
role: "Client Account Owner",
|
|
114879
|
+
company: "Romero & Co.",
|
|
114880
|
+
status: "Suspended",
|
|
114881
|
+
date_joined: "2022-02-28",
|
|
114882
|
+
last_activity: "2025-03-11T08:20:00Z"
|
|
114883
|
+
},
|
|
114884
|
+
{
|
|
114885
|
+
photo: "https://cdn.superblocks.com/sample-data/lena_schmidt",
|
|
114886
|
+
name: "Lena Schmidt",
|
|
114887
|
+
email: "lena_schmidt92@gmx.de",
|
|
114888
|
+
role: "Wholesale Contact",
|
|
114889
|
+
company: "Schmidt Imports",
|
|
114890
|
+
status: "Active",
|
|
114891
|
+
date_joined: "2021-12-01",
|
|
114892
|
+
last_activity: "2025-06-06T21:10:00Z"
|
|
114893
|
+
},
|
|
114894
|
+
{
|
|
114895
|
+
photo: "https://cdn.superblocks.com/sample-data/devon_price",
|
|
114896
|
+
name: "Devon Price",
|
|
114897
|
+
email: "devon.price22@aol.com",
|
|
114898
|
+
role: "Fulfillment Liaison",
|
|
114899
|
+
company: "DepotLink",
|
|
114900
|
+
status: "Active",
|
|
114901
|
+
date_joined: "2024-05-17",
|
|
114902
|
+
last_activity: "2025-06-08T10:42:00Z"
|
|
114903
|
+
},
|
|
114904
|
+
{
|
|
114905
|
+
photo: "https://cdn.superblocks.com/sample-data/isabella_rossi",
|
|
114906
|
+
name: "Isabella Rossi",
|
|
114907
|
+
email: "bella.rossi@gmail.com",
|
|
114908
|
+
role: "Procurement Agent",
|
|
114909
|
+
company: "Rossi Global Sourcing",
|
|
114910
|
+
status: "Pending",
|
|
114911
|
+
date_joined: "2023-07-19",
|
|
114912
|
+
last_activity: "2025-05-29T14:05:00Z"
|
|
114913
|
+
},
|
|
114914
|
+
{
|
|
114915
|
+
photo: "https://cdn.superblocks.com/sample-data/tariq_khan",
|
|
114916
|
+
name: "Tariq Khan",
|
|
114917
|
+
email: "tariq.khan92@protonmail.com",
|
|
114918
|
+
role: "International Ops Lead",
|
|
114919
|
+
company: "CrossPort Trade Inc.",
|
|
114920
|
+
status: "Active",
|
|
114921
|
+
date_joined: "2022-11-08",
|
|
114922
|
+
last_activity: "2025-06-08T16:11:00Z"
|
|
114923
|
+
},
|
|
114924
|
+
{
|
|
114925
|
+
photo: "https://cdn.superblocks.com/sample-data/emily_zhang",
|
|
114926
|
+
name: "Emily Zhang",
|
|
114927
|
+
email: "emilyzhang.home@gmail.com",
|
|
114928
|
+
role: "Logistics Coordinator",
|
|
114929
|
+
company: "Zhang Export Ltd.",
|
|
114930
|
+
status: "Active",
|
|
114931
|
+
date_joined: "2023-03-12",
|
|
114932
|
+
last_activity: "2025-06-08T19:02:00Z"
|
|
114933
|
+
}
|
|
114934
|
+
];
|
|
114935
|
+
const DEFAULT_TABLE_COLUMNS = {
|
|
114936
|
+
name: {
|
|
114937
|
+
columnType: "text",
|
|
114938
|
+
label: "Name"
|
|
114939
|
+
},
|
|
114940
|
+
email: {
|
|
114941
|
+
columnType: "email",
|
|
114942
|
+
label: "Email"
|
|
114943
|
+
},
|
|
114944
|
+
role: {
|
|
114945
|
+
columnType: "text",
|
|
114946
|
+
label: "Role"
|
|
114947
|
+
},
|
|
114948
|
+
company: {
|
|
114949
|
+
columnType: "text",
|
|
114950
|
+
label: "Company"
|
|
114951
|
+
},
|
|
114952
|
+
status: {
|
|
114953
|
+
columnType: "tags",
|
|
114954
|
+
tagDisplayConfig: {
|
|
114955
|
+
Active: {
|
|
114956
|
+
color: "#14CDB733"
|
|
114957
|
+
},
|
|
114958
|
+
Pending: {
|
|
114959
|
+
color: "#FF9F3533"
|
|
114960
|
+
},
|
|
114961
|
+
Inactive: {
|
|
114962
|
+
color: "#a6a0a033"
|
|
114963
|
+
},
|
|
114964
|
+
Suspended: {
|
|
114965
|
+
color: "#FF62A433"
|
|
114966
|
+
}
|
|
114967
|
+
},
|
|
114968
|
+
label: "Status"
|
|
114969
|
+
},
|
|
114970
|
+
date_joined: {
|
|
114971
|
+
columnType: "date",
|
|
114972
|
+
inputFormat: "YYYY-MM-DD",
|
|
114973
|
+
outputFormat: "MM-DD-YYYY",
|
|
114974
|
+
label: "Date joined"
|
|
114975
|
+
},
|
|
114976
|
+
last_activity: {
|
|
114977
|
+
columnType: "date",
|
|
114978
|
+
inputFormat: "YYYY-MM-DDTHH:mm:ssZ",
|
|
114979
|
+
outputFormat: "MM-DD-YYYY",
|
|
114980
|
+
label: "Last activity"
|
|
114981
|
+
},
|
|
114982
|
+
photo: {
|
|
114983
|
+
columnType: "image",
|
|
114984
|
+
label: "Photo"
|
|
114985
|
+
}
|
|
114986
|
+
};
|
|
114987
|
+
const DEFAULT_TABLE_KEYS = Object.keys(DEFAULT_TABLE_COLUMNS);
|
|
114988
|
+
const CLEARED_TABLE_COLUMNS = DEFAULT_TABLE_KEYS.reduce(
|
|
114989
|
+
(acc, key2) => {
|
|
114990
|
+
acc[key2] = void 0;
|
|
114991
|
+
return acc;
|
|
114992
|
+
},
|
|
114993
|
+
{}
|
|
114994
|
+
);
|
|
114807
114995
|
function getParentInfo(parent) {
|
|
114808
114996
|
const parentComponentMeta = getEditStore().runtimeEntitiesManager.getAnyEditorWidgetMeta(parent.id);
|
|
114809
114997
|
const isParentGridLike = isWidgetGrid(parentComponentMeta);
|
|
@@ -115049,6 +115237,12 @@ function getComponentBaseProperties(componentType, parentInfo) {
|
|
|
115049
115237
|
case "SbSection":
|
|
115050
115238
|
children = getSectionChildren();
|
|
115051
115239
|
break;
|
|
115240
|
+
case "SbTable":
|
|
115241
|
+
properties2.tableData = Property.Static(DEFAULT_TABLE_DATA);
|
|
115242
|
+
properties2.columns = Property.Static(DEFAULT_TABLE_COLUMNS);
|
|
115243
|
+
properties2.header = Property.Static("Customers");
|
|
115244
|
+
properties2.searchPlaceholder = Property.Static("Search...");
|
|
115245
|
+
break;
|
|
115052
115246
|
}
|
|
115053
115247
|
return {
|
|
115054
115248
|
properties: properties2,
|
|
@@ -136644,10 +136838,6 @@ const HeaderCellContentWrapper = qe$1.div`
|
|
|
136644
136838
|
var _a2, _b2;
|
|
136645
136839
|
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];
|
|
136646
136840
|
}};
|
|
136647
|
-
|
|
136648
|
-
span {
|
|
136649
|
-
${({ shouldCapitalize }) => shouldCapitalize && `text-transform: capitalize;`}
|
|
136650
|
-
}
|
|
136651
136841
|
`;
|
|
136652
136842
|
const TableIconWrapper = qe$1.div`
|
|
136653
136843
|
width: ${(props) => props.tableSizes.TABLE_FOOTER_HEIGHT}px;
|
|
@@ -143842,14 +144032,14 @@ function getLoaderFn(options) {
|
|
|
143842
144032
|
if (!(loader === "all")) return [3, 3];
|
|
143843
144033
|
return [4, import(
|
|
143844
144034
|
/* webpackChunkName: "blueprint-icons-all-paths-loader" */
|
|
143845
|
-
"./allPathsLoader-
|
|
144035
|
+
"./allPathsLoader-C82irE62.js"
|
|
143846
144036
|
)];
|
|
143847
144037
|
case 2:
|
|
143848
144038
|
return [2, _b2.sent().allPathsLoader];
|
|
143849
144039
|
case 3:
|
|
143850
144040
|
return [4, import(
|
|
143851
144041
|
/* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
|
|
143852
|
-
"./splitPathsBySizeLoader-
|
|
144042
|
+
"./splitPathsBySizeLoader-aKrjndrG.js"
|
|
143853
144043
|
)];
|
|
143854
144044
|
case 4:
|
|
143855
144045
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -154822,7 +155012,7 @@ function getPageSize(props) {
|
|
|
154822
155012
|
const compactMode = getCompactMode(props.compactMode);
|
|
154823
155013
|
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;
|
|
154824
155014
|
const tableSizes = TABLE_SIZES[compactMode];
|
|
154825
|
-
const headerHeight = props.isSearchable || props.
|
|
155015
|
+
const headerHeight = props.isSearchable || props.header || ((_d2 = props.hiddenColumns) == null ? void 0 : _d2.length) > 0 ? tableSizes.TABLE_HEADER_HEIGHT : 0;
|
|
154826
155016
|
const scrollbarSize = 8;
|
|
154827
155017
|
const mainHeight = (componentHeight ?? 100) - headerHeight - scrollbarSize - tableSizes.TABLE_FOOTER_HEIGHT - tableSizes.COLUMN_HEADER_HEIGHT;
|
|
154828
155018
|
const pageSize = Math.floor(mainHeight / (tableSizes.ROW_HEIGHT + 1));
|
|
@@ -155024,20 +155214,22 @@ function getFilteredTableData(props) {
|
|
|
155024
155214
|
});
|
|
155025
155215
|
}
|
|
155026
155216
|
};
|
|
155217
|
+
const searchText = props.searchText ?? "";
|
|
155027
155218
|
const getSearchKey = () => {
|
|
155028
|
-
if (
|
|
155029
|
-
return
|
|
155219
|
+
if (searchText && props.enableClientSideSearch !== false) {
|
|
155220
|
+
return searchText.toLowerCase();
|
|
155030
155221
|
}
|
|
155031
155222
|
return "";
|
|
155032
155223
|
};
|
|
155224
|
+
const filters = props.filters;
|
|
155033
155225
|
const finalTableData = sortedTableData.filter((item) => {
|
|
155034
155226
|
var _a3;
|
|
155035
155227
|
const searchFound = getSearchKey() ? Object.values(item).join(", ").toLowerCase().includes(getSearchKey()) : true;
|
|
155036
155228
|
if (!searchFound) return false;
|
|
155037
155229
|
for (const [columnName, { byValue, condition }] of Object.entries(
|
|
155038
|
-
(
|
|
155230
|
+
(filters == null ? void 0 : filters.byColumn) ?? {}
|
|
155039
155231
|
)) {
|
|
155040
|
-
const column2 = props.columns[columnName];
|
|
155232
|
+
const column2 = ((_a3 = props.columns) == null ? void 0 : _a3[columnName]) ?? {};
|
|
155041
155233
|
const value = item[columnName];
|
|
155042
155234
|
if (byValue) {
|
|
155043
155235
|
const columnType = column2 && column2.columnType ? column2.columnType : "text";
|
|
@@ -155145,12 +155337,53 @@ function getFilteredTableData(props) {
|
|
|
155145
155337
|
}
|
|
155146
155338
|
const propertiesDefinition$9 = {
|
|
155147
155339
|
general: Section.category(PropsPanelCategory.Content).children({
|
|
155148
|
-
|
|
155340
|
+
header: Prop.string().readAndWrite().default("").propertiesPanel({
|
|
155149
155341
|
label: "Header",
|
|
155150
155342
|
placeholder: "Table name",
|
|
155151
155343
|
helpText: "A header displayed at the top of the table"
|
|
155152
155344
|
}),
|
|
155153
|
-
tableData: Prop.array().
|
|
155345
|
+
tableData: Prop.array().onEdit(({ sourceId, updates, widgetMeta }) => {
|
|
155346
|
+
try {
|
|
155347
|
+
const [previousWidget, newWidget] = getPreviousAndCurrentWidgetProps(updates, widgetMeta);
|
|
155348
|
+
if (lodashExports.isEqual(previousWidget == null ? void 0 : previousWidget.tableData, DEFAULT_TABLE_DATA)) {
|
|
155349
|
+
let updatedTableData = newWidget == null ? void 0 : newWidget.tableData;
|
|
155350
|
+
if (typeof updatedTableData === "string") {
|
|
155351
|
+
updatedTableData = JSON.parse(updatedTableData);
|
|
155352
|
+
}
|
|
155353
|
+
if (!Array.isArray(updatedTableData) || typeof updatedTableData[0] !== "object") {
|
|
155354
|
+
return {
|
|
155355
|
+
[sourceId]: {
|
|
155356
|
+
props: {
|
|
155357
|
+
columns: Property.Static({})
|
|
155358
|
+
},
|
|
155359
|
+
meta: {}
|
|
155360
|
+
}
|
|
155361
|
+
};
|
|
155362
|
+
}
|
|
155363
|
+
const colKeys = Object.keys(updatedTableData[0] ?? {});
|
|
155364
|
+
if (!lodashExports.isEqual(colKeys, DEFAULT_TABLE_KEYS)) {
|
|
155365
|
+
return {
|
|
155366
|
+
[sourceId]: {
|
|
155367
|
+
props: {
|
|
155368
|
+
columns: Property.Static(CLEARED_TABLE_COLUMNS)
|
|
155369
|
+
},
|
|
155370
|
+
meta: {}
|
|
155371
|
+
}
|
|
155372
|
+
};
|
|
155373
|
+
}
|
|
155374
|
+
}
|
|
155375
|
+
return {};
|
|
155376
|
+
} catch (_e2) {
|
|
155377
|
+
return {
|
|
155378
|
+
[sourceId]: {
|
|
155379
|
+
props: {
|
|
155380
|
+
columns: Property.Static(CLEARED_TABLE_COLUMNS)
|
|
155381
|
+
},
|
|
155382
|
+
meta: {}
|
|
155383
|
+
}
|
|
155384
|
+
};
|
|
155385
|
+
}
|
|
155386
|
+
}).readable().propertiesPanel({
|
|
155154
155387
|
label: "Data",
|
|
155155
155388
|
placeholder: '[{ "col1": "val1" }]',
|
|
155156
155389
|
isJSConvertible: false,
|
|
@@ -155183,8 +155416,15 @@ const propertiesDefinition$9 = {
|
|
|
155183
155416
|
helpText: "Enable per column filtering"
|
|
155184
155417
|
}),
|
|
155185
155418
|
defaultFilters: Prop.any().readAndWrite().propertiesPanel({
|
|
155186
|
-
|
|
155187
|
-
|
|
155419
|
+
controlType: "COMPUTED_CODE_EDITOR",
|
|
155420
|
+
label: "Default filters",
|
|
155421
|
+
visibility: "SHOW_NAME",
|
|
155422
|
+
isJSConvertible: false,
|
|
155423
|
+
isRemovable: true,
|
|
155424
|
+
helpText: "Allows specifying the filters that will be used on page load",
|
|
155425
|
+
isVisible: function() {
|
|
155426
|
+
return this.isFilterable && this.pageType !== PaginationTypes.SERVER_SIDE;
|
|
155427
|
+
}
|
|
155188
155428
|
}),
|
|
155189
155429
|
// enableRowInsertion: Prop.boolean()
|
|
155190
155430
|
// .readAndWrite()
|
|
@@ -155235,14 +155475,17 @@ const propertiesDefinition$9 = {
|
|
|
155235
155475
|
]
|
|
155236
155476
|
}),
|
|
155237
155477
|
defaultSort: Prop.composite({
|
|
155238
|
-
|
|
155239
|
-
column: Prop.string().default("name").propertiesPanel({
|
|
155478
|
+
column: Prop.string().propertiesPanel({
|
|
155240
155479
|
label: "Column",
|
|
155241
155480
|
controlType: "SELECT_TABLE_COLUMN"
|
|
155242
155481
|
}),
|
|
155243
155482
|
asc: Prop.boolean().default(true).propertiesPanel({
|
|
155244
155483
|
label: "Order",
|
|
155245
|
-
controlType: "RADIO_BUTTON_GROUP"
|
|
155484
|
+
controlType: "RADIO_BUTTON_GROUP",
|
|
155485
|
+
options: [
|
|
155486
|
+
{ label: "Ascending", value: true },
|
|
155487
|
+
{ label: "Descending", value: false }
|
|
155488
|
+
]
|
|
155246
155489
|
})
|
|
155247
155490
|
}).propertiesPanel({
|
|
155248
155491
|
label: "Default sort",
|
|
@@ -155255,7 +155498,10 @@ const propertiesDefinition$9 = {
|
|
|
155255
155498
|
}),
|
|
155256
155499
|
defaultSearchText: Prop.string().readAndWrite().propertiesPanel({
|
|
155257
155500
|
label: "Default search",
|
|
155258
|
-
helpText: "Sets the default search text"
|
|
155501
|
+
helpText: "Sets the default search text",
|
|
155502
|
+
isVisible: function() {
|
|
155503
|
+
return this.enableClientSideSearch !== false;
|
|
155504
|
+
}
|
|
155259
155505
|
}),
|
|
155260
155506
|
searchPlaceholder: Prop.string().readAndWrite().propertiesPanel({
|
|
155261
155507
|
label: "Search placeholder",
|
|
@@ -155410,12 +155656,20 @@ const propertiesDefinition$9 = {
|
|
|
155410
155656
|
// editedRowIndices: Prop.any().readable().default(getEditedRowIndices),
|
|
155411
155657
|
}),
|
|
155412
155658
|
meta: Section.category(PropsPanelCategory.Meta).children({
|
|
155413
|
-
selectedRowIndex: Prop.number().readable()
|
|
155659
|
+
selectedRowIndex: Prop.number().readable().default(function() {
|
|
155660
|
+
return this.defaultSelectedRow;
|
|
155661
|
+
}),
|
|
155414
155662
|
selectedRowIndices: Prop.any().readable(),
|
|
155415
155663
|
pageNo: Prop.number().readable().default(() => 1),
|
|
155416
|
-
sortedColumn: Prop.any().readable()
|
|
155417
|
-
|
|
155418
|
-
|
|
155664
|
+
sortedColumn: Prop.any().readable().default(function() {
|
|
155665
|
+
return this.defaultSort;
|
|
155666
|
+
}),
|
|
155667
|
+
searchText: Prop.string().readable().default(function() {
|
|
155668
|
+
return this.defaultSearchText ?? "";
|
|
155669
|
+
}),
|
|
155670
|
+
filters: Prop.any().readable().default(function() {
|
|
155671
|
+
return this.defaultFilters;
|
|
155672
|
+
}),
|
|
155419
155673
|
hiddenColumns: Prop.any().readable(),
|
|
155420
155674
|
columnFreezes: Prop.any().readable(),
|
|
155421
155675
|
tagsColorAssignment: Prop.any().readable()
|
|
@@ -164887,11 +165141,11 @@ const TableDataDownload = ({
|
|
|
164887
165141
|
columns,
|
|
164888
165142
|
tableSizes,
|
|
164889
165143
|
widgetName,
|
|
164890
|
-
|
|
165144
|
+
header,
|
|
164891
165145
|
tableCellTextStyle
|
|
164892
165146
|
}) => {
|
|
164893
165147
|
const [selected, setSelected] = React__default.useState(false);
|
|
164894
|
-
const tableName =
|
|
165148
|
+
const tableName = header ? header : widgetName;
|
|
164895
165149
|
const fileName = tableName;
|
|
164896
165150
|
const handleSelectMenu = useCallback(() => {
|
|
164897
165151
|
setSelected(true);
|
|
@@ -165228,7 +165482,7 @@ const TableFooter = ({
|
|
|
165228
165482
|
tableColumns,
|
|
165229
165483
|
tableData,
|
|
165230
165484
|
filteredOrderMap,
|
|
165231
|
-
|
|
165485
|
+
header,
|
|
165232
165486
|
tableSizes,
|
|
165233
165487
|
borderColor,
|
|
165234
165488
|
updatePageNo,
|
|
@@ -165392,7 +165646,7 @@ const TableFooter = ({
|
|
|
165392
165646
|
columns: tableColumns,
|
|
165393
165647
|
widgetName,
|
|
165394
165648
|
tableSizes,
|
|
165395
|
-
|
|
165649
|
+
header,
|
|
165396
165650
|
tableCellTextStyle
|
|
165397
165651
|
}
|
|
165398
165652
|
),
|
|
@@ -167493,8 +167747,9 @@ const DescendingIcon = qe$1(SvgSort)`
|
|
|
167493
167747
|
}
|
|
167494
167748
|
`;
|
|
167495
167749
|
const TableHeaderCell = (props) => {
|
|
167496
|
-
var _a2
|
|
167750
|
+
var _a2;
|
|
167497
167751
|
const { column: column2, selectRows } = props;
|
|
167752
|
+
const resizerProps = column2.getResizerProps();
|
|
167498
167753
|
const resizingColumnId = useRef("");
|
|
167499
167754
|
const handleSortColumn = () => {
|
|
167500
167755
|
if (!props.isSortable || props.isResizingColumn) return;
|
|
@@ -167510,7 +167765,6 @@ const TableHeaderCell = (props) => {
|
|
|
167510
167765
|
defaultTextStyleVariant: TABLE_COLUMN_HEADER_DEFAULT_TYPOGRAPHY,
|
|
167511
167766
|
textStyle: props.columnHeaderProps
|
|
167512
167767
|
});
|
|
167513
|
-
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";
|
|
167514
167768
|
const { setColumnFilter } = props;
|
|
167515
167769
|
const setFilter = useCallback(
|
|
167516
167770
|
(filter2) => {
|
|
@@ -167572,7 +167826,6 @@ const TableHeaderCell = (props) => {
|
|
|
167572
167826
|
HeaderCellContentWrapper,
|
|
167573
167827
|
{
|
|
167574
167828
|
columnProperties: props.columnProperties,
|
|
167575
|
-
shouldCapitalize: !columnHeaderTextStyleHasTextTransform && props.columnName === column2.id,
|
|
167576
167829
|
style: columnHeaderStyleProps.style,
|
|
167577
167830
|
className: `${getTextCssClassFromVariant(
|
|
167578
167831
|
columnHeaderStyleProps.textStyleVariant
|
|
@@ -167598,23 +167851,23 @@ const TableHeaderCell = (props) => {
|
|
|
167598
167851
|
e3.stopPropagation();
|
|
167599
167852
|
},
|
|
167600
167853
|
onDragOver: (e3) => {
|
|
167601
|
-
var _a3,
|
|
167854
|
+
var _a3, _b2;
|
|
167602
167855
|
if (props.columnIndex !== props.mutableHeaderDragRef.current && props.mutableHeaderDragRef.current !== -1) {
|
|
167603
167856
|
if (props.mutableHeaderDragRef.current > props.columnIndex) {
|
|
167604
167857
|
(_a3 = parentRef.current) == null ? void 0 : _a3.classList.add("highlight-left");
|
|
167605
167858
|
} else if (props.mutableHeaderDragRef.current < props.columnIndex) {
|
|
167606
|
-
(
|
|
167859
|
+
(_b2 = parentRef.current) == null ? void 0 : _b2.classList.add("highlight-right");
|
|
167607
167860
|
}
|
|
167608
167861
|
}
|
|
167609
167862
|
e3.preventDefault();
|
|
167610
167863
|
},
|
|
167611
167864
|
onDragEnter: (e3) => {
|
|
167612
|
-
var _a3,
|
|
167865
|
+
var _a3, _b2;
|
|
167613
167866
|
if (props.columnIndex !== props.mutableHeaderDragRef.current && props.mutableHeaderDragRef.current !== -1) {
|
|
167614
167867
|
if (props.mutableHeaderDragRef.current > props.columnIndex) {
|
|
167615
167868
|
(_a3 = parentRef.current) == null ? void 0 : _a3.classList.add("highlight-left");
|
|
167616
167869
|
} else if (props.mutableHeaderDragRef.current < props.columnIndex) {
|
|
167617
|
-
(
|
|
167870
|
+
(_b2 = parentRef.current) == null ? void 0 : _b2.classList.add("highlight-right");
|
|
167618
167871
|
}
|
|
167619
167872
|
}
|
|
167620
167873
|
e3.preventDefault();
|
|
@@ -167666,7 +167919,7 @@ const TableHeaderCell = (props) => {
|
|
|
167666
167919
|
isFrozen: getIsColumnFrozen(
|
|
167667
167920
|
props.column.id,
|
|
167668
167921
|
props.columnFreezes,
|
|
167669
|
-
(
|
|
167922
|
+
(_a2 = props.columnProperties) == null ? void 0 : _a2.isFrozen
|
|
167670
167923
|
),
|
|
167671
167924
|
theme: props.theme,
|
|
167672
167925
|
updateProperty: props.updateProperty
|
|
@@ -167675,11 +167928,21 @@ const TableHeaderCell = (props) => {
|
|
|
167675
167928
|
props.showResizer && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
167676
167929
|
"div",
|
|
167677
167930
|
{
|
|
167678
|
-
...
|
|
167931
|
+
...resizerProps,
|
|
167679
167932
|
className: `resizer ${column2.isResizing ? "isResizing" : ""}`,
|
|
167680
167933
|
onClick: (e3) => {
|
|
167681
167934
|
e3.preventDefault();
|
|
167682
167935
|
e3.stopPropagation();
|
|
167936
|
+
},
|
|
167937
|
+
onMouseDown: (e3) => {
|
|
167938
|
+
resizerProps.onMouseDown(e3);
|
|
167939
|
+
e3.stopPropagation();
|
|
167940
|
+
e3.preventDefault();
|
|
167941
|
+
},
|
|
167942
|
+
onTouchStart: (e3) => {
|
|
167943
|
+
resizerProps.onTouchStart(e3);
|
|
167944
|
+
e3.stopPropagation();
|
|
167945
|
+
e3.preventDefault();
|
|
167683
167946
|
}
|
|
167684
167947
|
}
|
|
167685
167948
|
)
|
|
@@ -168281,7 +168544,7 @@ const Table = (props) => {
|
|
|
168281
168544
|
const selectedRowIndices = props.selectedRowIndices || [];
|
|
168282
168545
|
const canDelete = props.isDeletionEnabled && (selectedRowIndices.length > 0 || selectedRowIndex != null && selectedRowIndex >= 0);
|
|
168283
168546
|
const hasFooter = props.pageType !== PaginationTypes.NONE || props.isDownloadable || props.numEdits != null && props.numEdits > 0 || props.isInsertionEnabled || canDelete;
|
|
168284
|
-
const hasHeader = props.isSearchable || !lodashExports.isEmpty(props.
|
|
168547
|
+
const hasHeader = props.isSearchable || !lodashExports.isEmpty(props.header) || props.hiddenColumns && ((_a2 = props.hiddenColumns) == null ? void 0 : _a2.length) > 0;
|
|
168285
168548
|
const pageSize = props.pageType === PaginationTypes.NONE ? props.tableData.length : props.pageSize;
|
|
168286
168549
|
const pageCount = Math.ceil(props.tableData.length / pageSize) || 1;
|
|
168287
168550
|
const currentPageIndex = props.pageNo < pageCount ? props.pageNo : 0;
|
|
@@ -168879,7 +169142,7 @@ const Table = (props) => {
|
|
|
168879
169142
|
searchKey: props.searchKey,
|
|
168880
169143
|
tableSizes,
|
|
168881
169144
|
compactMode: getCompactMode(props.compactMode),
|
|
168882
|
-
title: props.
|
|
169145
|
+
title: props.header,
|
|
168883
169146
|
columns: props.columns,
|
|
168884
169147
|
hiddenColumns: props.hiddenColumns,
|
|
168885
169148
|
searchPlaceholder: props.searchPlaceholder,
|
|
@@ -169032,7 +169295,7 @@ const Table = (props) => {
|
|
|
169032
169295
|
tableColumns: props.columns,
|
|
169033
169296
|
tableData: props.tableData,
|
|
169034
169297
|
filteredOrderMap: props.filteredOrderMap,
|
|
169035
|
-
|
|
169298
|
+
header: props.header,
|
|
169036
169299
|
tableSizes,
|
|
169037
169300
|
updatePageNo: props.updatePageNo,
|
|
169038
169301
|
widgetName: props.widgetName,
|
|
@@ -169842,6 +170105,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
169842
170105
|
}
|
|
169843
170106
|
});
|
|
169844
170107
|
__publicField(this, "handleEditStart", (rowIndex, columnId, startingValue) => {
|
|
170108
|
+
this.props.disableDrag(true);
|
|
169845
170109
|
this.props.disableNudge(true);
|
|
169846
170110
|
this.props.setCurrentEditFocus({ row: rowIndex, columnId }, startingValue);
|
|
169847
170111
|
});
|
|
@@ -170645,8 +170909,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
170645
170909
|
handleResizeColumn: this.handleResizeColumn,
|
|
170646
170910
|
updatePageNo: this.updatePageNumber,
|
|
170647
170911
|
handleReorderColumn: this.handleReorderColumn,
|
|
170648
|
-
disableDrag:
|
|
170649
|
-
},
|
|
170912
|
+
disableDrag: this.props.disableDrag,
|
|
170650
170913
|
searchTableData: this.handleSearchTable,
|
|
170651
170914
|
filters: this.props.filters,
|
|
170652
170915
|
setColumnFilter: this.handleSetColumnFilter,
|
|
@@ -170657,7 +170920,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
170657
170920
|
isSearchable: this.props.isSearchable,
|
|
170658
170921
|
isDownloadable: this.props.isDownloadable,
|
|
170659
170922
|
isFilterable: this.props.isFilterable,
|
|
170660
|
-
|
|
170923
|
+
header: this.props.header,
|
|
170661
170924
|
hiddenColumns: this.props.hiddenColumns ?? [],
|
|
170662
170925
|
columnFreezes: this.props.columnFreezes ?? {},
|
|
170663
170926
|
numEdits,
|
|
@@ -170945,19 +171208,24 @@ const SbTable = registerSbComponent(
|
|
|
170945
171208
|
},
|
|
170946
171209
|
[features.nudging]
|
|
170947
171210
|
);
|
|
171211
|
+
const disableDrag = useCallback(
|
|
171212
|
+
(disable) => {
|
|
171213
|
+
features.dragAndDrop.set(!disable);
|
|
171214
|
+
},
|
|
171215
|
+
[features.dragAndDrop]
|
|
171216
|
+
);
|
|
170948
171217
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ...passthroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
170949
171218
|
TableWidget,
|
|
170950
171219
|
{
|
|
170951
171220
|
...props,
|
|
170952
171221
|
enableRowInsertion: false,
|
|
170953
171222
|
enableRowDeletion: false,
|
|
170954
|
-
defaultSearchText: props.defaultSearchText ?? "",
|
|
170955
171223
|
searchPlaceholder: props.searchPlaceholder ?? "",
|
|
170956
171224
|
searchText: props.searchText ?? "",
|
|
170957
171225
|
pageType: props.pageType,
|
|
170958
171226
|
columns: transformedColumns,
|
|
170959
|
-
|
|
170960
|
-
|
|
171227
|
+
filters: props.filters ?? EMPTY_OBJ,
|
|
171228
|
+
header: props.header ?? "",
|
|
170961
171229
|
tableData: props.tableData ?? EMPTY_ARRAY,
|
|
170962
171230
|
currentEditDropdownSearchText: props.currentEditDropdownSearchText,
|
|
170963
171231
|
selectedRowIndices: props.selectedRowIndices ?? EMPTY_ARRAY,
|
|
@@ -170966,6 +171234,7 @@ const SbTable = registerSbComponent(
|
|
|
170966
171234
|
border: props.border ?? createPerSideBorder(theme.defaultBorder),
|
|
170967
171235
|
borderRadius: props.borderRadius ?? theme.defaultBorder.borderRadius,
|
|
170968
171236
|
disableNudge,
|
|
171237
|
+
disableDrag,
|
|
170969
171238
|
setSelectedRowData,
|
|
170970
171239
|
setPageNo,
|
|
170971
171240
|
setColumnOrder,
|
|
@@ -190292,4 +190561,4 @@ export {
|
|
|
190292
190561
|
copyToClipboard as y,
|
|
190293
190562
|
navigateTo as z
|
|
190294
190563
|
};
|
|
190295
|
-
//# sourceMappingURL=index
|
|
190564
|
+
//# sourceMappingURL=index--MyJLg0V.js.map
|