@superblocksteam/library 2.0.0-next.31 → 2.0.0-next.33
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-CEF7eymC.js → allPaths-BVrg1pz2.js} +2 -2
- package/dist/{allPaths-CEF7eymC.js.map → allPaths-BVrg1pz2.js.map} +1 -1
- package/dist/{allPaths-qHt9NRRE.js → allPaths-EKlKXcmC.js} +2 -2
- package/dist/{allPaths-qHt9NRRE.js.map → allPaths-EKlKXcmC.js.map} +1 -1
- package/dist/{allPathsLoader-C_jYLeY9.js → allPathsLoader-BY9j7WyS.js} +3 -3
- package/dist/{allPathsLoader-hWLqt9nZ.js.map → allPathsLoader-BY9j7WyS.js.map} +1 -1
- package/dist/{allPathsLoader-hWLqt9nZ.js → allPathsLoader-CwKpLPZa.js} +3 -3
- package/dist/{allPathsLoader-C_jYLeY9.js.map → allPathsLoader-CwKpLPZa.js.map} +1 -1
- package/dist/{index-e6o5xaRw.js → index-BrVR4QxR.js} +281 -48
- package/dist/{index-e6o5xaRw.js.map → index-BrVR4QxR.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{splitPathsBySizeLoader-BclYBPrJ.js → splitPathsBySizeLoader-BLG5xgfE.js} +2 -2
- package/dist/{splitPathsBySizeLoader-BclYBPrJ.js.map → splitPathsBySizeLoader-BLG5xgfE.js.map} +1 -1
- package/dist/{splitPathsBySizeLoader-DiRcmbhL.js → splitPathsBySizeLoader-BcyuYAqD.js} +2 -2
- package/dist/{splitPathsBySizeLoader-DiRcmbhL.js.map → splitPathsBySizeLoader-BcyuYAqD.js.map} +1 -1
- package/dist-types/edit-mode/default-table-data.d.ts +64 -0
- package/dist-types/lib/internal-details/identifier-normalizer.d.ts +0 -1
- 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 +2 -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-BY9j7WyS.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-BLG5xgfE.js"
|
|
2701
2701
|
)];
|
|
2702
2702
|
case 4:
|
|
2703
2703
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -98227,7 +98227,7 @@ function getPropertyValue$1({
|
|
|
98227
98227
|
}
|
|
98228
98228
|
const getNormalizedIdInfo = (params) => {
|
|
98229
98229
|
var _a2, _b2;
|
|
98230
|
-
const name = (
|
|
98230
|
+
const name = (_a2 = params.bind) == null ? void 0 : _a2.entityName;
|
|
98231
98231
|
const scopeId = ((_b2 = params.bind) == null ? void 0 : _b2.scopeId) ?? params.fallbackScopeId;
|
|
98232
98232
|
return {
|
|
98233
98233
|
name,
|
|
@@ -98290,7 +98290,6 @@ class RuntimeWidgetsManager {
|
|
|
98290
98290
|
const childSourceId = child.props[WIDGET_SOURCE_ID_ATTRIBUTE];
|
|
98291
98291
|
const { name: childName, scopeId: childScopeId } = getNormalizedIdInfo({
|
|
98292
98292
|
bind: getBindingIdentifier(child.props.bind),
|
|
98293
|
-
propsName: child.props.name,
|
|
98294
98293
|
fallbackScopeId
|
|
98295
98294
|
});
|
|
98296
98295
|
const childIdentifier = this.nameManager.registerAndGetIdentifiers({
|
|
@@ -114805,6 +114804,178 @@ var KeyValuePropertyType = /* @__PURE__ */ ((KeyValuePropertyType2) => {
|
|
|
114805
114804
|
KeyValuePropertyType2["EMAIL"] = "email";
|
|
114806
114805
|
return KeyValuePropertyType2;
|
|
114807
114806
|
})(KeyValuePropertyType || {});
|
|
114807
|
+
const DEFAULT_TABLE_DATA = [
|
|
114808
|
+
{
|
|
114809
|
+
photo: "https://cdn.superblocks.com/sample-data/rachel_kim",
|
|
114810
|
+
name: "Rachel Kim",
|
|
114811
|
+
email: "rachel.kim89@gmail.com",
|
|
114812
|
+
role: "Vendor Partner",
|
|
114813
|
+
company: "Urban Threads Co.",
|
|
114814
|
+
status: "Active",
|
|
114815
|
+
date_joined: "2023-04-12",
|
|
114816
|
+
last_activity: "2025-06-07T16:20:00Z"
|
|
114817
|
+
},
|
|
114818
|
+
{
|
|
114819
|
+
photo: "https://cdn.superblocks.com/sample-data/daniel_vargas",
|
|
114820
|
+
name: "Daniel Vargas",
|
|
114821
|
+
email: "dvargas1984@yahoo.com",
|
|
114822
|
+
role: "Logistics Contact",
|
|
114823
|
+
company: "Vargas Freight Ltd.",
|
|
114824
|
+
status: "Pending",
|
|
114825
|
+
date_joined: "2024-01-23",
|
|
114826
|
+
last_activity: "2025-05-30T13:45:00Z"
|
|
114827
|
+
},
|
|
114828
|
+
{
|
|
114829
|
+
photo: "https://cdn.superblocks.com/sample-data/sophie_liu",
|
|
114830
|
+
name: "Sophie Liu",
|
|
114831
|
+
email: "sophie.liu.personal@gmail.com",
|
|
114832
|
+
role: "Retail Manager",
|
|
114833
|
+
company: "Modern Goods",
|
|
114834
|
+
status: "Active",
|
|
114835
|
+
date_joined: "2022-09-10",
|
|
114836
|
+
last_activity: "2025-06-08T09:03:00Z"
|
|
114837
|
+
},
|
|
114838
|
+
{
|
|
114839
|
+
photo: "https://cdn.superblocks.com/sample-data/omar_el-sayed",
|
|
114840
|
+
name: "Omar El-Sayed",
|
|
114841
|
+
email: "omarsayed78@hotmail.com",
|
|
114842
|
+
role: "Accounts Payable",
|
|
114843
|
+
company: "Sayed Textiles",
|
|
114844
|
+
status: "Inactive",
|
|
114845
|
+
date_joined: "2021-06-05",
|
|
114846
|
+
last_activity: "2024-12-18T11:40:00Z"
|
|
114847
|
+
},
|
|
114848
|
+
{
|
|
114849
|
+
photo: "https://cdn.superblocks.com/sample-data/grace_nguyen",
|
|
114850
|
+
name: "Grace Nguyen",
|
|
114851
|
+
email: "gracenguyen23@icloud.com",
|
|
114852
|
+
role: "Product Supplier",
|
|
114853
|
+
company: "Green Earth Supplies",
|
|
114854
|
+
status: "Active",
|
|
114855
|
+
date_joined: "2023-11-03",
|
|
114856
|
+
last_activity: "2025-06-08T17:28:00Z"
|
|
114857
|
+
},
|
|
114858
|
+
{
|
|
114859
|
+
photo: "https://cdn.superblocks.com/sample-data/alex_romero",
|
|
114860
|
+
name: "Alex Romero",
|
|
114861
|
+
email: "alex.romero@gmail.com",
|
|
114862
|
+
role: "Client Account Owner",
|
|
114863
|
+
company: "Romero & Co.",
|
|
114864
|
+
status: "Suspended",
|
|
114865
|
+
date_joined: "2022-02-28",
|
|
114866
|
+
last_activity: "2025-03-11T08:20:00Z"
|
|
114867
|
+
},
|
|
114868
|
+
{
|
|
114869
|
+
photo: "https://cdn.superblocks.com/sample-data/lena_schmidt",
|
|
114870
|
+
name: "Lena Schmidt",
|
|
114871
|
+
email: "lena_schmidt92@gmx.de",
|
|
114872
|
+
role: "Wholesale Contact",
|
|
114873
|
+
company: "Schmidt Imports",
|
|
114874
|
+
status: "Active",
|
|
114875
|
+
date_joined: "2021-12-01",
|
|
114876
|
+
last_activity: "2025-06-06T21:10:00Z"
|
|
114877
|
+
},
|
|
114878
|
+
{
|
|
114879
|
+
photo: "https://cdn.superblocks.com/sample-data/devon_price",
|
|
114880
|
+
name: "Devon Price",
|
|
114881
|
+
email: "devon.price22@aol.com",
|
|
114882
|
+
role: "Fulfillment Liaison",
|
|
114883
|
+
company: "DepotLink",
|
|
114884
|
+
status: "Active",
|
|
114885
|
+
date_joined: "2024-05-17",
|
|
114886
|
+
last_activity: "2025-06-08T10:42:00Z"
|
|
114887
|
+
},
|
|
114888
|
+
{
|
|
114889
|
+
photo: "https://cdn.superblocks.com/sample-data/isabella_rossi",
|
|
114890
|
+
name: "Isabella Rossi",
|
|
114891
|
+
email: "bella.rossi@gmail.com",
|
|
114892
|
+
role: "Procurement Agent",
|
|
114893
|
+
company: "Rossi Global Sourcing",
|
|
114894
|
+
status: "Pending",
|
|
114895
|
+
date_joined: "2023-07-19",
|
|
114896
|
+
last_activity: "2025-05-29T14:05:00Z"
|
|
114897
|
+
},
|
|
114898
|
+
{
|
|
114899
|
+
photo: "https://cdn.superblocks.com/sample-data/tariq_khan",
|
|
114900
|
+
name: "Tariq Khan",
|
|
114901
|
+
email: "tariq.khan92@protonmail.com",
|
|
114902
|
+
role: "International Ops Lead",
|
|
114903
|
+
company: "CrossPort Trade Inc.",
|
|
114904
|
+
status: "Active",
|
|
114905
|
+
date_joined: "2022-11-08",
|
|
114906
|
+
last_activity: "2025-06-08T16:11:00Z"
|
|
114907
|
+
},
|
|
114908
|
+
{
|
|
114909
|
+
photo: "https://cdn.superblocks.com/sample-data/emily_zhang",
|
|
114910
|
+
name: "Emily Zhang",
|
|
114911
|
+
email: "emilyzhang.home@gmail.com",
|
|
114912
|
+
role: "Logistics Coordinator",
|
|
114913
|
+
company: "Zhang Export Ltd.",
|
|
114914
|
+
status: "Active",
|
|
114915
|
+
date_joined: "2023-03-12",
|
|
114916
|
+
last_activity: "2025-06-08T19:02:00Z"
|
|
114917
|
+
}
|
|
114918
|
+
];
|
|
114919
|
+
const DEFAULT_TABLE_COLUMNS = {
|
|
114920
|
+
name: {
|
|
114921
|
+
columnType: "text",
|
|
114922
|
+
label: "Name"
|
|
114923
|
+
},
|
|
114924
|
+
email: {
|
|
114925
|
+
columnType: "email",
|
|
114926
|
+
label: "Email"
|
|
114927
|
+
},
|
|
114928
|
+
role: {
|
|
114929
|
+
columnType: "text",
|
|
114930
|
+
label: "Role"
|
|
114931
|
+
},
|
|
114932
|
+
company: {
|
|
114933
|
+
columnType: "text",
|
|
114934
|
+
label: "Company"
|
|
114935
|
+
},
|
|
114936
|
+
status: {
|
|
114937
|
+
columnType: "tags",
|
|
114938
|
+
tagDisplayConfig: {
|
|
114939
|
+
Active: {
|
|
114940
|
+
color: "#14CDB733"
|
|
114941
|
+
},
|
|
114942
|
+
Pending: {
|
|
114943
|
+
color: "#FF9F3533"
|
|
114944
|
+
},
|
|
114945
|
+
Inactive: {
|
|
114946
|
+
color: "#a6a0a033"
|
|
114947
|
+
},
|
|
114948
|
+
Suspended: {
|
|
114949
|
+
color: "#FF62A433"
|
|
114950
|
+
}
|
|
114951
|
+
},
|
|
114952
|
+
label: "Status"
|
|
114953
|
+
},
|
|
114954
|
+
date_joined: {
|
|
114955
|
+
columnType: "date",
|
|
114956
|
+
inputFormat: "YYYY-MM-DD",
|
|
114957
|
+
outputFormat: "MM-DD-YYYY",
|
|
114958
|
+
label: "Date joined"
|
|
114959
|
+
},
|
|
114960
|
+
last_activity: {
|
|
114961
|
+
columnType: "date",
|
|
114962
|
+
inputFormat: "YYYY-MM-DDTHH:mm:ssZ",
|
|
114963
|
+
outputFormat: "MM-DD-YYYY",
|
|
114964
|
+
label: "Last activity"
|
|
114965
|
+
},
|
|
114966
|
+
photo: {
|
|
114967
|
+
columnType: "image",
|
|
114968
|
+
label: "Photo"
|
|
114969
|
+
}
|
|
114970
|
+
};
|
|
114971
|
+
const DEFAULT_TABLE_KEYS = Object.keys(DEFAULT_TABLE_COLUMNS);
|
|
114972
|
+
const CLEARED_TABLE_COLUMNS = DEFAULT_TABLE_KEYS.reduce(
|
|
114973
|
+
(acc, key2) => {
|
|
114974
|
+
acc[key2] = void 0;
|
|
114975
|
+
return acc;
|
|
114976
|
+
},
|
|
114977
|
+
{}
|
|
114978
|
+
);
|
|
114808
114979
|
function getParentInfo(parent) {
|
|
114809
114980
|
const parentComponentMeta = getEditStore().runtimeEntitiesManager.getAnyEditorWidgetMeta(parent.id);
|
|
114810
114981
|
const isParentGridLike = isWidgetGrid(parentComponentMeta);
|
|
@@ -115050,6 +115221,12 @@ function getComponentBaseProperties(componentType, parentInfo) {
|
|
|
115050
115221
|
case "SbSection":
|
|
115051
115222
|
children = getSectionChildren();
|
|
115052
115223
|
break;
|
|
115224
|
+
case "SbTable":
|
|
115225
|
+
properties2.tableData = Property.Static(DEFAULT_TABLE_DATA);
|
|
115226
|
+
properties2.columns = Property.Static(DEFAULT_TABLE_COLUMNS);
|
|
115227
|
+
properties2.header = Property.Static("Customers");
|
|
115228
|
+
properties2.searchPlaceholder = Property.Static("Search...");
|
|
115229
|
+
break;
|
|
115053
115230
|
}
|
|
115054
115231
|
return {
|
|
115055
115232
|
properties: properties2,
|
|
@@ -116990,7 +117167,6 @@ const registerSbComponent = (type5, config2, Component3) => {
|
|
|
116990
117167
|
const identifier2 = useRef();
|
|
116991
117168
|
const { name: passedName, scopeId } = getNormalizedIdInfo({
|
|
116992
117169
|
bind: getBindingIdentifier(props.bind),
|
|
116993
|
-
propsName: props.name,
|
|
116994
117170
|
fallbackScopeId
|
|
116995
117171
|
});
|
|
116996
117172
|
if (!identifier2.current) {
|
|
@@ -136646,10 +136822,6 @@ const HeaderCellContentWrapper = qe$1.div`
|
|
|
136646
136822
|
var _a2, _b2;
|
|
136647
136823
|
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];
|
|
136648
136824
|
}};
|
|
136649
|
-
|
|
136650
|
-
span {
|
|
136651
|
-
${({ shouldCapitalize }) => shouldCapitalize && `text-transform: capitalize;`}
|
|
136652
|
-
}
|
|
136653
136825
|
`;
|
|
136654
136826
|
const TableIconWrapper = qe$1.div`
|
|
136655
136827
|
width: ${(props) => props.tableSizes.TABLE_FOOTER_HEIGHT}px;
|
|
@@ -143844,14 +144016,14 @@ function getLoaderFn(options) {
|
|
|
143844
144016
|
if (!(loader === "all")) return [3, 3];
|
|
143845
144017
|
return [4, import(
|
|
143846
144018
|
/* webpackChunkName: "blueprint-icons-all-paths-loader" */
|
|
143847
|
-
"./allPathsLoader-
|
|
144019
|
+
"./allPathsLoader-CwKpLPZa.js"
|
|
143848
144020
|
)];
|
|
143849
144021
|
case 2:
|
|
143850
144022
|
return [2, _b2.sent().allPathsLoader];
|
|
143851
144023
|
case 3:
|
|
143852
144024
|
return [4, import(
|
|
143853
144025
|
/* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
|
|
143854
|
-
"./splitPathsBySizeLoader-
|
|
144026
|
+
"./splitPathsBySizeLoader-BcyuYAqD.js"
|
|
143855
144027
|
)];
|
|
143856
144028
|
case 4:
|
|
143857
144029
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -154824,7 +154996,7 @@ function getPageSize(props) {
|
|
|
154824
154996
|
const compactMode = getCompactMode(props.compactMode);
|
|
154825
154997
|
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;
|
|
154826
154998
|
const tableSizes = TABLE_SIZES[compactMode];
|
|
154827
|
-
const headerHeight = props.isSearchable || props.
|
|
154999
|
+
const headerHeight = props.isSearchable || props.header || ((_d2 = props.hiddenColumns) == null ? void 0 : _d2.length) > 0 ? tableSizes.TABLE_HEADER_HEIGHT : 0;
|
|
154828
155000
|
const scrollbarSize = 8;
|
|
154829
155001
|
const mainHeight = (componentHeight ?? 100) - headerHeight - scrollbarSize - tableSizes.TABLE_FOOTER_HEIGHT - tableSizes.COLUMN_HEADER_HEIGHT;
|
|
154830
155002
|
const pageSize = Math.floor(mainHeight / (tableSizes.ROW_HEIGHT + 1));
|
|
@@ -155026,20 +155198,22 @@ function getFilteredTableData(props) {
|
|
|
155026
155198
|
});
|
|
155027
155199
|
}
|
|
155028
155200
|
};
|
|
155201
|
+
const searchText = props.searchText ?? "";
|
|
155029
155202
|
const getSearchKey = () => {
|
|
155030
|
-
if (
|
|
155031
|
-
return
|
|
155203
|
+
if (searchText && props.enableClientSideSearch !== false) {
|
|
155204
|
+
return searchText.toLowerCase();
|
|
155032
155205
|
}
|
|
155033
155206
|
return "";
|
|
155034
155207
|
};
|
|
155208
|
+
const filters = props.filters;
|
|
155035
155209
|
const finalTableData = sortedTableData.filter((item) => {
|
|
155036
155210
|
var _a3;
|
|
155037
155211
|
const searchFound = getSearchKey() ? Object.values(item).join(", ").toLowerCase().includes(getSearchKey()) : true;
|
|
155038
155212
|
if (!searchFound) return false;
|
|
155039
155213
|
for (const [columnName, { byValue, condition }] of Object.entries(
|
|
155040
|
-
(
|
|
155214
|
+
(filters == null ? void 0 : filters.byColumn) ?? {}
|
|
155041
155215
|
)) {
|
|
155042
|
-
const column2 = props.columns[columnName];
|
|
155216
|
+
const column2 = ((_a3 = props.columns) == null ? void 0 : _a3[columnName]) ?? {};
|
|
155043
155217
|
const value = item[columnName];
|
|
155044
155218
|
if (byValue) {
|
|
155045
155219
|
const columnType = column2 && column2.columnType ? column2.columnType : "text";
|
|
@@ -155147,12 +155321,53 @@ function getFilteredTableData(props) {
|
|
|
155147
155321
|
}
|
|
155148
155322
|
const propertiesDefinition$9 = {
|
|
155149
155323
|
general: Section.category(PropsPanelCategory.Content).children({
|
|
155150
|
-
|
|
155324
|
+
header: Prop.string().readAndWrite().default("").propertiesPanel({
|
|
155151
155325
|
label: "Header",
|
|
155152
155326
|
placeholder: "Table name",
|
|
155153
155327
|
helpText: "A header displayed at the top of the table"
|
|
155154
155328
|
}),
|
|
155155
|
-
tableData: Prop.array().
|
|
155329
|
+
tableData: Prop.array().onEdit(({ sourceId, updates, widgetMeta }) => {
|
|
155330
|
+
try {
|
|
155331
|
+
const [previousWidget, newWidget] = getPreviousAndCurrentWidgetProps(updates, widgetMeta);
|
|
155332
|
+
if (lodashExports.isEqual(previousWidget == null ? void 0 : previousWidget.tableData, DEFAULT_TABLE_DATA)) {
|
|
155333
|
+
let updatedTableData = newWidget == null ? void 0 : newWidget.tableData;
|
|
155334
|
+
if (typeof updatedTableData === "string") {
|
|
155335
|
+
updatedTableData = JSON.parse(updatedTableData);
|
|
155336
|
+
}
|
|
155337
|
+
if (!Array.isArray(updatedTableData) || typeof updatedTableData[0] !== "object") {
|
|
155338
|
+
return {
|
|
155339
|
+
[sourceId]: {
|
|
155340
|
+
props: {
|
|
155341
|
+
columns: Property.Static({})
|
|
155342
|
+
},
|
|
155343
|
+
meta: {}
|
|
155344
|
+
}
|
|
155345
|
+
};
|
|
155346
|
+
}
|
|
155347
|
+
const colKeys = Object.keys(updatedTableData[0] ?? {});
|
|
155348
|
+
if (!lodashExports.isEqual(colKeys, DEFAULT_TABLE_KEYS)) {
|
|
155349
|
+
return {
|
|
155350
|
+
[sourceId]: {
|
|
155351
|
+
props: {
|
|
155352
|
+
columns: Property.Static(CLEARED_TABLE_COLUMNS)
|
|
155353
|
+
},
|
|
155354
|
+
meta: {}
|
|
155355
|
+
}
|
|
155356
|
+
};
|
|
155357
|
+
}
|
|
155358
|
+
}
|
|
155359
|
+
return {};
|
|
155360
|
+
} catch (_e2) {
|
|
155361
|
+
return {
|
|
155362
|
+
[sourceId]: {
|
|
155363
|
+
props: {
|
|
155364
|
+
columns: Property.Static(CLEARED_TABLE_COLUMNS)
|
|
155365
|
+
},
|
|
155366
|
+
meta: {}
|
|
155367
|
+
}
|
|
155368
|
+
};
|
|
155369
|
+
}
|
|
155370
|
+
}).readable().propertiesPanel({
|
|
155156
155371
|
label: "Data",
|
|
155157
155372
|
placeholder: '[{ "col1": "val1" }]',
|
|
155158
155373
|
isJSConvertible: false,
|
|
@@ -155185,8 +155400,15 @@ const propertiesDefinition$9 = {
|
|
|
155185
155400
|
helpText: "Enable per column filtering"
|
|
155186
155401
|
}),
|
|
155187
155402
|
defaultFilters: Prop.any().readAndWrite().propertiesPanel({
|
|
155188
|
-
|
|
155189
|
-
|
|
155403
|
+
controlType: "COMPUTED_CODE_EDITOR",
|
|
155404
|
+
label: "Default filters",
|
|
155405
|
+
visibility: "SHOW_NAME",
|
|
155406
|
+
isJSConvertible: false,
|
|
155407
|
+
isRemovable: true,
|
|
155408
|
+
helpText: "Allows specifying the filters that will be used on page load",
|
|
155409
|
+
isVisible: function() {
|
|
155410
|
+
return this.isFilterable && this.pageType !== PaginationTypes.SERVER_SIDE;
|
|
155411
|
+
}
|
|
155190
155412
|
}),
|
|
155191
155413
|
// enableRowInsertion: Prop.boolean()
|
|
155192
155414
|
// .readAndWrite()
|
|
@@ -155237,14 +155459,17 @@ const propertiesDefinition$9 = {
|
|
|
155237
155459
|
]
|
|
155238
155460
|
}),
|
|
155239
155461
|
defaultSort: Prop.composite({
|
|
155240
|
-
|
|
155241
|
-
column: Prop.string().default("name").propertiesPanel({
|
|
155462
|
+
column: Prop.string().propertiesPanel({
|
|
155242
155463
|
label: "Column",
|
|
155243
155464
|
controlType: "SELECT_TABLE_COLUMN"
|
|
155244
155465
|
}),
|
|
155245
155466
|
asc: Prop.boolean().default(true).propertiesPanel({
|
|
155246
155467
|
label: "Order",
|
|
155247
|
-
controlType: "RADIO_BUTTON_GROUP"
|
|
155468
|
+
controlType: "RADIO_BUTTON_GROUP",
|
|
155469
|
+
options: [
|
|
155470
|
+
{ label: "Ascending", value: true },
|
|
155471
|
+
{ label: "Descending", value: false }
|
|
155472
|
+
]
|
|
155248
155473
|
})
|
|
155249
155474
|
}).propertiesPanel({
|
|
155250
155475
|
label: "Default sort",
|
|
@@ -155257,7 +155482,10 @@ const propertiesDefinition$9 = {
|
|
|
155257
155482
|
}),
|
|
155258
155483
|
defaultSearchText: Prop.string().readAndWrite().propertiesPanel({
|
|
155259
155484
|
label: "Default search",
|
|
155260
|
-
helpText: "Sets the default search text"
|
|
155485
|
+
helpText: "Sets the default search text",
|
|
155486
|
+
isVisible: function() {
|
|
155487
|
+
return this.enableClientSideSearch !== false;
|
|
155488
|
+
}
|
|
155261
155489
|
}),
|
|
155262
155490
|
searchPlaceholder: Prop.string().readAndWrite().propertiesPanel({
|
|
155263
155491
|
label: "Search placeholder",
|
|
@@ -155412,12 +155640,20 @@ const propertiesDefinition$9 = {
|
|
|
155412
155640
|
// editedRowIndices: Prop.any().readable().default(getEditedRowIndices),
|
|
155413
155641
|
}),
|
|
155414
155642
|
meta: Section.category(PropsPanelCategory.Meta).children({
|
|
155415
|
-
selectedRowIndex: Prop.number().readable()
|
|
155643
|
+
selectedRowIndex: Prop.number().readable().default(function() {
|
|
155644
|
+
return this.defaultSelectedRow;
|
|
155645
|
+
}),
|
|
155416
155646
|
selectedRowIndices: Prop.any().readable(),
|
|
155417
155647
|
pageNo: Prop.number().readable().default(() => 1),
|
|
155418
|
-
sortedColumn: Prop.any().readable()
|
|
155419
|
-
|
|
155420
|
-
|
|
155648
|
+
sortedColumn: Prop.any().readable().default(function() {
|
|
155649
|
+
return this.defaultSort;
|
|
155650
|
+
}),
|
|
155651
|
+
searchText: Prop.string().readable().default(function() {
|
|
155652
|
+
return this.defaultSearchText ?? "";
|
|
155653
|
+
}),
|
|
155654
|
+
filters: Prop.any().readable().default(function() {
|
|
155655
|
+
return this.defaultFilters;
|
|
155656
|
+
}),
|
|
155421
155657
|
hiddenColumns: Prop.any().readable(),
|
|
155422
155658
|
columnFreezes: Prop.any().readable(),
|
|
155423
155659
|
tagsColorAssignment: Prop.any().readable()
|
|
@@ -164889,11 +165125,11 @@ const TableDataDownload = ({
|
|
|
164889
165125
|
columns,
|
|
164890
165126
|
tableSizes,
|
|
164891
165127
|
widgetName,
|
|
164892
|
-
|
|
165128
|
+
header,
|
|
164893
165129
|
tableCellTextStyle
|
|
164894
165130
|
}) => {
|
|
164895
165131
|
const [selected, setSelected] = React__default.useState(false);
|
|
164896
|
-
const tableName =
|
|
165132
|
+
const tableName = header ? header : widgetName;
|
|
164897
165133
|
const fileName = tableName;
|
|
164898
165134
|
const handleSelectMenu = useCallback(() => {
|
|
164899
165135
|
setSelected(true);
|
|
@@ -165230,7 +165466,7 @@ const TableFooter = ({
|
|
|
165230
165466
|
tableColumns,
|
|
165231
165467
|
tableData,
|
|
165232
165468
|
filteredOrderMap,
|
|
165233
|
-
|
|
165469
|
+
header,
|
|
165234
165470
|
tableSizes,
|
|
165235
165471
|
borderColor,
|
|
165236
165472
|
updatePageNo,
|
|
@@ -165394,7 +165630,7 @@ const TableFooter = ({
|
|
|
165394
165630
|
columns: tableColumns,
|
|
165395
165631
|
widgetName,
|
|
165396
165632
|
tableSizes,
|
|
165397
|
-
|
|
165633
|
+
header,
|
|
165398
165634
|
tableCellTextStyle
|
|
165399
165635
|
}
|
|
165400
165636
|
),
|
|
@@ -167495,7 +167731,7 @@ const DescendingIcon = qe$1(SvgSort)`
|
|
|
167495
167731
|
}
|
|
167496
167732
|
`;
|
|
167497
167733
|
const TableHeaderCell = (props) => {
|
|
167498
|
-
var _a2
|
|
167734
|
+
var _a2;
|
|
167499
167735
|
const { column: column2, selectRows } = props;
|
|
167500
167736
|
const resizingColumnId = useRef("");
|
|
167501
167737
|
const handleSortColumn = () => {
|
|
@@ -167512,7 +167748,6 @@ const TableHeaderCell = (props) => {
|
|
|
167512
167748
|
defaultTextStyleVariant: TABLE_COLUMN_HEADER_DEFAULT_TYPOGRAPHY,
|
|
167513
167749
|
textStyle: props.columnHeaderProps
|
|
167514
167750
|
});
|
|
167515
|
-
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";
|
|
167516
167751
|
const { setColumnFilter } = props;
|
|
167517
167752
|
const setFilter = useCallback(
|
|
167518
167753
|
(filter2) => {
|
|
@@ -167574,7 +167809,6 @@ const TableHeaderCell = (props) => {
|
|
|
167574
167809
|
HeaderCellContentWrapper,
|
|
167575
167810
|
{
|
|
167576
167811
|
columnProperties: props.columnProperties,
|
|
167577
|
-
shouldCapitalize: !columnHeaderTextStyleHasTextTransform && props.columnName === column2.id,
|
|
167578
167812
|
style: columnHeaderStyleProps.style,
|
|
167579
167813
|
className: `${getTextCssClassFromVariant(
|
|
167580
167814
|
columnHeaderStyleProps.textStyleVariant
|
|
@@ -167600,23 +167834,23 @@ const TableHeaderCell = (props) => {
|
|
|
167600
167834
|
e3.stopPropagation();
|
|
167601
167835
|
},
|
|
167602
167836
|
onDragOver: (e3) => {
|
|
167603
|
-
var _a3,
|
|
167837
|
+
var _a3, _b2;
|
|
167604
167838
|
if (props.columnIndex !== props.mutableHeaderDragRef.current && props.mutableHeaderDragRef.current !== -1) {
|
|
167605
167839
|
if (props.mutableHeaderDragRef.current > props.columnIndex) {
|
|
167606
167840
|
(_a3 = parentRef.current) == null ? void 0 : _a3.classList.add("highlight-left");
|
|
167607
167841
|
} else if (props.mutableHeaderDragRef.current < props.columnIndex) {
|
|
167608
|
-
(
|
|
167842
|
+
(_b2 = parentRef.current) == null ? void 0 : _b2.classList.add("highlight-right");
|
|
167609
167843
|
}
|
|
167610
167844
|
}
|
|
167611
167845
|
e3.preventDefault();
|
|
167612
167846
|
},
|
|
167613
167847
|
onDragEnter: (e3) => {
|
|
167614
|
-
var _a3,
|
|
167848
|
+
var _a3, _b2;
|
|
167615
167849
|
if (props.columnIndex !== props.mutableHeaderDragRef.current && props.mutableHeaderDragRef.current !== -1) {
|
|
167616
167850
|
if (props.mutableHeaderDragRef.current > props.columnIndex) {
|
|
167617
167851
|
(_a3 = parentRef.current) == null ? void 0 : _a3.classList.add("highlight-left");
|
|
167618
167852
|
} else if (props.mutableHeaderDragRef.current < props.columnIndex) {
|
|
167619
|
-
(
|
|
167853
|
+
(_b2 = parentRef.current) == null ? void 0 : _b2.classList.add("highlight-right");
|
|
167620
167854
|
}
|
|
167621
167855
|
}
|
|
167622
167856
|
e3.preventDefault();
|
|
@@ -167668,7 +167902,7 @@ const TableHeaderCell = (props) => {
|
|
|
167668
167902
|
isFrozen: getIsColumnFrozen(
|
|
167669
167903
|
props.column.id,
|
|
167670
167904
|
props.columnFreezes,
|
|
167671
|
-
(
|
|
167905
|
+
(_a2 = props.columnProperties) == null ? void 0 : _a2.isFrozen
|
|
167672
167906
|
),
|
|
167673
167907
|
theme: props.theme,
|
|
167674
167908
|
updateProperty: props.updateProperty
|
|
@@ -168283,7 +168517,7 @@ const Table = (props) => {
|
|
|
168283
168517
|
const selectedRowIndices = props.selectedRowIndices || [];
|
|
168284
168518
|
const canDelete = props.isDeletionEnabled && (selectedRowIndices.length > 0 || selectedRowIndex != null && selectedRowIndex >= 0);
|
|
168285
168519
|
const hasFooter = props.pageType !== PaginationTypes.NONE || props.isDownloadable || props.numEdits != null && props.numEdits > 0 || props.isInsertionEnabled || canDelete;
|
|
168286
|
-
const hasHeader = props.isSearchable || !lodashExports.isEmpty(props.
|
|
168520
|
+
const hasHeader = props.isSearchable || !lodashExports.isEmpty(props.header) || props.hiddenColumns && ((_a2 = props.hiddenColumns) == null ? void 0 : _a2.length) > 0;
|
|
168287
168521
|
const pageSize = props.pageType === PaginationTypes.NONE ? props.tableData.length : props.pageSize;
|
|
168288
168522
|
const pageCount = Math.ceil(props.tableData.length / pageSize) || 1;
|
|
168289
168523
|
const currentPageIndex = props.pageNo < pageCount ? props.pageNo : 0;
|
|
@@ -168881,7 +169115,7 @@ const Table = (props) => {
|
|
|
168881
169115
|
searchKey: props.searchKey,
|
|
168882
169116
|
tableSizes,
|
|
168883
169117
|
compactMode: getCompactMode(props.compactMode),
|
|
168884
|
-
title: props.
|
|
169118
|
+
title: props.header,
|
|
168885
169119
|
columns: props.columns,
|
|
168886
169120
|
hiddenColumns: props.hiddenColumns,
|
|
168887
169121
|
searchPlaceholder: props.searchPlaceholder,
|
|
@@ -169034,7 +169268,7 @@ const Table = (props) => {
|
|
|
169034
169268
|
tableColumns: props.columns,
|
|
169035
169269
|
tableData: props.tableData,
|
|
169036
169270
|
filteredOrderMap: props.filteredOrderMap,
|
|
169037
|
-
|
|
169271
|
+
header: props.header,
|
|
169038
169272
|
tableSizes,
|
|
169039
169273
|
updatePageNo: props.updatePageNo,
|
|
169040
169274
|
widgetName: props.widgetName,
|
|
@@ -170659,7 +170893,7 @@ const _TableWidget = class _TableWidget extends React__default.Component {
|
|
|
170659
170893
|
isSearchable: this.props.isSearchable,
|
|
170660
170894
|
isDownloadable: this.props.isDownloadable,
|
|
170661
170895
|
isFilterable: this.props.isFilterable,
|
|
170662
|
-
|
|
170896
|
+
header: this.props.header,
|
|
170663
170897
|
hiddenColumns: this.props.hiddenColumns ?? [],
|
|
170664
170898
|
columnFreezes: this.props.columnFreezes ?? {},
|
|
170665
170899
|
numEdits,
|
|
@@ -170953,13 +171187,12 @@ const SbTable = registerSbComponent(
|
|
|
170953
171187
|
...props,
|
|
170954
171188
|
enableRowInsertion: false,
|
|
170955
171189
|
enableRowDeletion: false,
|
|
170956
|
-
defaultSearchText: props.defaultSearchText ?? "",
|
|
170957
171190
|
searchPlaceholder: props.searchPlaceholder ?? "",
|
|
170958
171191
|
searchText: props.searchText ?? "",
|
|
170959
171192
|
pageType: props.pageType,
|
|
170960
171193
|
columns: transformedColumns,
|
|
170961
|
-
|
|
170962
|
-
|
|
171194
|
+
filters: props.filters ?? EMPTY_OBJ,
|
|
171195
|
+
header: props.header ?? "",
|
|
170963
171196
|
tableData: props.tableData ?? EMPTY_ARRAY,
|
|
170964
171197
|
currentEditDropdownSearchText: props.currentEditDropdownSearchText,
|
|
170965
171198
|
selectedRowIndices: props.selectedRowIndices ?? EMPTY_ARRAY,
|
|
@@ -190294,4 +190527,4 @@ export {
|
|
|
190294
190527
|
copyToClipboard as y,
|
|
190295
190528
|
navigateTo as z
|
|
190296
190529
|
};
|
|
190297
|
-
//# sourceMappingURL=index-
|
|
190530
|
+
//# sourceMappingURL=index-BrVR4QxR.js.map
|