@unbxd-ui/unbxd-react-components 0.2.145-beta.7 → 0.2.145-beta.9

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.
@@ -4,12 +4,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports["default"] = exports.ServerSidePagination = exports.SelectableRows = exports.RefreshTable = exports.NoPagination = exports.NoDataDefault = exports.Default = exports.CustomStyling = exports.CustomNoDataComponent = exports.CustomColumnFormatting = exports.BottomPagination = void 0;
7
+ exports["default"] = exports.StickyLastColumn = exports.StickyFirstColumn = exports.StickyBothColumns = exports.SimpleExpandableRows = exports.ServerSidePaginationWithCustomStyling = exports.ServerSidePagination = exports.SelectableRows = exports.RefreshTable = exports.PaginationOptionsShowcase = exports.NoStickyColumn = exports.NoPagination = exports.NoDataDefault = exports.ExpandableRows = exports.Default = exports.CustomStyling = exports.CustomPaginationStyling = exports.CustomNoDataComponent = exports.CustomColumnFormatting = exports.ConditionalExpandableRows = exports.BottomPagination = exports.AdvancedPaginationStyling = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _Table = _interopRequireDefault(require("./Table"));
10
10
  var _dataLoader = _interopRequireDefault(require("../../core/dataLoader"));
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
12
12
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
13
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
15
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
18
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
14
19
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
20
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
@@ -320,6 +325,130 @@ var postsColumnConfigs = [{
320
325
  }, "User ", row.userId);
321
326
  }
322
327
  }];
328
+
329
+ // Expandable content component for detailed row information
330
+ var ExpandableRowContent = function ExpandableRowContent(_ref2) {
331
+ var data = _ref2.data;
332
+ return /*#__PURE__*/_react["default"].createElement("div", {
333
+ style: {
334
+ padding: '20px',
335
+ backgroundColor: '#f4f8ff',
336
+ borderLeft: '4px solid #007bff',
337
+ margin: '0'
338
+ }
339
+ }, /*#__PURE__*/_react["default"].createElement("div", {
340
+ style: {
341
+ display: 'grid',
342
+ gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))',
343
+ gap: '16px'
344
+ }
345
+ }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("h4", {
346
+ style: {
347
+ margin: '0 0 8px 0',
348
+ color: '#495057',
349
+ fontSize: '14px'
350
+ }
351
+ }, "Contact Information"), /*#__PURE__*/_react["default"].createElement("p", {
352
+ style: {
353
+ margin: '4px 0',
354
+ fontSize: '13px',
355
+ color: '#666'
356
+ }
357
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Email:"), " ", data.email), /*#__PURE__*/_react["default"].createElement("p", {
358
+ style: {
359
+ margin: '4px 0',
360
+ fontSize: '13px',
361
+ color: '#666'
362
+ }
363
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Phone:"), " ", data.phone || '+1 (555) 123-4567'), /*#__PURE__*/_react["default"].createElement("p", {
364
+ style: {
365
+ margin: '4px 0',
366
+ fontSize: '13px',
367
+ color: '#666'
368
+ }
369
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Address:"), " ", data.address || '123 Main St, City, State 12345')), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("h4", {
370
+ style: {
371
+ margin: '0 0 8px 0',
372
+ color: '#495057',
373
+ fontSize: '14px'
374
+ }
375
+ }, "Employment Details"), /*#__PURE__*/_react["default"].createElement("p", {
376
+ style: {
377
+ margin: '4px 0',
378
+ fontSize: '13px',
379
+ color: '#666'
380
+ }
381
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Start Date:"), " ", data.startDate || 'Jan 15, 2020'), /*#__PURE__*/_react["default"].createElement("p", {
382
+ style: {
383
+ margin: '4px 0',
384
+ fontSize: '13px',
385
+ color: '#666'
386
+ }
387
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Manager:"), " ", data.manager || 'Sarah Johnson'), /*#__PURE__*/_react["default"].createElement("p", {
388
+ style: {
389
+ margin: '4px 0',
390
+ fontSize: '13px',
391
+ color: '#666'
392
+ }
393
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Employee ID:"), " EMP-", data.id.toString().padStart(4, '0'))), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("h4", {
394
+ style: {
395
+ margin: '0 0 8px 0',
396
+ color: '#495057',
397
+ fontSize: '14px'
398
+ }
399
+ }, "Performance"), /*#__PURE__*/_react["default"].createElement("p", {
400
+ style: {
401
+ margin: '4px 0',
402
+ fontSize: '13px',
403
+ color: '#666'
404
+ }
405
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Rating:"), " ", data.rating || '4.2/5.0'), /*#__PURE__*/_react["default"].createElement("p", {
406
+ style: {
407
+ margin: '4px 0',
408
+ fontSize: '13px',
409
+ color: '#666'
410
+ }
411
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Projects:"), " ", data.projects || '12 completed'), /*#__PURE__*/_react["default"].createElement("p", {
412
+ style: {
413
+ margin: '4px 0',
414
+ fontSize: '13px',
415
+ color: '#666'
416
+ }
417
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Last Review:"), " ", data.lastReview || 'March 2024'))), /*#__PURE__*/_react["default"].createElement("div", {
418
+ style: {
419
+ marginTop: '16px',
420
+ paddingTop: '16px',
421
+ borderTop: '1px solid #dee2e6'
422
+ }
423
+ }, /*#__PURE__*/_react["default"].createElement("h4", {
424
+ style: {
425
+ margin: '0 0 8px 0',
426
+ color: '#495057',
427
+ fontSize: '14px'
428
+ }
429
+ }, "Recent Activities"), /*#__PURE__*/_react["default"].createElement("div", {
430
+ style: {
431
+ fontSize: '13px',
432
+ color: '#666'
433
+ }
434
+ }, /*#__PURE__*/_react["default"].createElement("p", {
435
+ style: {
436
+ margin: '4px 0'
437
+ }
438
+ }, "\u2022 Completed Q1 Performance Review"), /*#__PURE__*/_react["default"].createElement("p", {
439
+ style: {
440
+ margin: '4px 0'
441
+ }
442
+ }, "\u2022 Attended React Training Workshop"), /*#__PURE__*/_react["default"].createElement("p", {
443
+ style: {
444
+ margin: '4px 0'
445
+ }
446
+ }, "\u2022 Led Project Alpha implementation"), /*#__PURE__*/_react["default"].createElement("p", {
447
+ style: {
448
+ margin: '4px 0'
449
+ }
450
+ }, "\u2022 Mentored 2 junior developers"))));
451
+ };
323
452
  var _default = exports["default"] = {
324
453
  title: 'Components/Table',
325
454
  component: _Table["default"],
@@ -341,6 +470,10 @@ var _default = exports["default"] = {
341
470
  control: 'object',
342
471
  description: 'Array of column configurations defining table structure'
343
472
  },
473
+ stickyColumn: {
474
+ control: 'boolean',
475
+ description: 'Whether to make the first and last column sticky'
476
+ },
344
477
  paginationType: {
345
478
  control: 'select',
346
479
  options: ['', 'CLIENT', 'SERVER'],
@@ -350,6 +483,10 @@ var _default = exports["default"] = {
350
483
  control: 'boolean',
351
484
  description: 'Whether to show pagination controls'
352
485
  },
486
+ paginationComponentOptions: {
487
+ control: 'object',
488
+ description: 'Options to customize pagination component styling and behavior'
489
+ },
353
490
  expandableRows: {
354
491
  control: 'boolean',
355
492
  description: 'Whether rows can be expanded to show additional content'
@@ -387,7 +524,10 @@ Default.args = {
387
524
  columnConfigs: basicColumnConfigs,
388
525
  paginationType: 'CLIENT',
389
526
  pagination: true,
390
- customClassName: 'custom-table'
527
+ customClassName: 'custom-table',
528
+ paginationComponentOptions: {
529
+ className: 'default-pagination-styling'
530
+ }
391
531
  };
392
532
 
393
533
  // Table without pagination
@@ -425,9 +565,9 @@ var CustomNoDataComponent = exports.CustomNoDataComponent = function CustomNoDat
425
565
  _useState2 = _slicedToArray(_useState, 2),
426
566
  hasData = _useState2[0],
427
567
  setHasData = _useState2[1];
428
- var CustomNoData = function CustomNoData(_ref2) {
429
- var description = _ref2.description,
430
- heading = _ref2.heading;
568
+ var CustomNoData = function CustomNoData(_ref3) {
569
+ var description = _ref3.description,
570
+ heading = _ref3.heading;
431
571
  return /*#__PURE__*/_react["default"].createElement("div", {
432
572
  style: {
433
573
  padding: '40px 20px',
@@ -466,9 +606,9 @@ var CustomNoDataComponent = exports.CustomNoDataComponent = function CustomNoDat
466
606
  }
467
607
  }));
468
608
  };
469
- var CustomNoDataWithIcon = function CustomNoDataWithIcon(_ref3) {
470
- var description = _ref3.description,
471
- heading = _ref3.heading;
609
+ var CustomNoDataWithIcon = function CustomNoDataWithIcon(_ref4) {
610
+ var description = _ref4.description,
611
+ heading = _ref4.heading;
472
612
  return /*#__PURE__*/_react["default"].createElement("div", {
473
613
  style: {
474
614
  padding: '60px 20px',
@@ -549,9 +689,9 @@ var CustomNoDataComponent = exports.CustomNoDataComponent = function CustomNoDat
549
689
  }
550
690
  }, "Clear")));
551
691
  };
552
- var CustomNoDataMinimal = function CustomNoDataMinimal(_ref4) {
553
- var description = _ref4.description,
554
- heading = _ref4.heading;
692
+ var CustomNoDataMinimal = function CustomNoDataMinimal(_ref5) {
693
+ var description = _ref5.description,
694
+ heading = _ref5.heading;
555
695
  return /*#__PURE__*/_react["default"].createElement("div", {
556
696
  style: {
557
697
  padding: '80px 20px',
@@ -895,4 +1035,1123 @@ var RefreshTable = exports.RefreshTable = function RefreshTable() {
895
1035
  refreshData: refreshCount,
896
1036
  customClassName: "custom-table"
897
1037
  }));
1038
+ };
1039
+
1040
+ // Expandable rows story
1041
+ var ExpandableRows = exports.ExpandableRows = function ExpandableRows() {
1042
+ var expandableColumnConfigs = [{
1043
+ name: 'Name',
1044
+ selector: function selector(row) {
1045
+ return row.name;
1046
+ },
1047
+ sortable: true,
1048
+ cell: function cell(row) {
1049
+ return /*#__PURE__*/_react["default"].createElement("div", {
1050
+ className: "tbl-content",
1051
+ style: {
1052
+ display: 'flex',
1053
+ alignItems: 'center',
1054
+ gap: '8px'
1055
+ }
1056
+ }, /*#__PURE__*/_react["default"].createElement("div", {
1057
+ style: {
1058
+ width: '32px',
1059
+ height: '32px',
1060
+ borderRadius: '50%',
1061
+ backgroundColor: '#007bff',
1062
+ display: 'flex',
1063
+ alignItems: 'center',
1064
+ justifyContent: 'center',
1065
+ color: 'white',
1066
+ fontSize: '14px',
1067
+ fontWeight: 'bold'
1068
+ }
1069
+ }, row.name.charAt(0)), /*#__PURE__*/_react["default"].createElement("span", null, row.name));
1070
+ },
1071
+ width: '200px'
1072
+ }, {
1073
+ name: 'Department',
1074
+ selector: function selector(row) {
1075
+ return row.department;
1076
+ },
1077
+ sortable: true,
1078
+ cell: function cell(row) {
1079
+ return /*#__PURE__*/_react["default"].createElement("span", {
1080
+ style: {
1081
+ padding: '4px 8px',
1082
+ borderRadius: '12px',
1083
+ fontSize: '12px',
1084
+ fontWeight: '500',
1085
+ backgroundColor: row.department === 'Engineering' ? '#e3f2fd' : row.department === 'Marketing' ? '#f3e5f5' : row.department === 'Sales' ? '#e8f5e8' : '#fff3e0',
1086
+ color: row.department === 'Engineering' ? '#1976d2' : row.department === 'Marketing' ? '#7b1fa2' : row.department === 'Sales' ? '#388e3c' : '#f57c00'
1087
+ },
1088
+ className: "tbl-content"
1089
+ }, row.department);
1090
+ },
1091
+ width: '150px'
1092
+ }, {
1093
+ name: 'Position',
1094
+ selector: function selector(row) {
1095
+ return row.position;
1096
+ },
1097
+ sortable: true,
1098
+ cell: function cell(row) {
1099
+ return /*#__PURE__*/_react["default"].createElement("div", {
1100
+ className: "tbl-content"
1101
+ }, row.position);
1102
+ },
1103
+ width: '180px'
1104
+ }, {
1105
+ name: 'Salary',
1106
+ selector: function selector(row) {
1107
+ return row.salary;
1108
+ },
1109
+ sortable: true,
1110
+ cell: function cell(row) {
1111
+ return /*#__PURE__*/_react["default"].createElement("span", {
1112
+ style: {
1113
+ fontWeight: 'bold',
1114
+ color: row.salary > 75000 ? '#4caf50' : '#ff9800'
1115
+ },
1116
+ className: "tbl-content"
1117
+ }, "$", row.salary.toLocaleString());
1118
+ },
1119
+ width: '120px'
1120
+ }, {
1121
+ name: 'Status',
1122
+ selector: function selector(row) {
1123
+ return row.status || 'Active';
1124
+ },
1125
+ sortable: true,
1126
+ cell: function cell(row) {
1127
+ return /*#__PURE__*/_react["default"].createElement("div", {
1128
+ className: "tbl-content"
1129
+ }, /*#__PURE__*/_react["default"].createElement("span", {
1130
+ style: {
1131
+ padding: '4px 8px',
1132
+ borderRadius: '12px',
1133
+ fontSize: '12px',
1134
+ fontWeight: 'bold',
1135
+ backgroundColor: '#e8f5e8',
1136
+ color: '#28a745'
1137
+ }
1138
+ }, "Active"));
1139
+ },
1140
+ width: '100px'
1141
+ }];
1142
+
1143
+ // Enhanced sample data with positions
1144
+ var expandableRowsData = [{
1145
+ id: 1,
1146
+ name: 'John Doe',
1147
+ department: 'Engineering',
1148
+ position: 'Senior Software Engineer',
1149
+ salary: 85000
1150
+ }, {
1151
+ id: 2,
1152
+ name: 'Jane Smith',
1153
+ department: 'Marketing',
1154
+ position: 'Marketing Manager',
1155
+ salary: 70000
1156
+ }, {
1157
+ id: 3,
1158
+ name: 'Bob Johnson',
1159
+ department: 'Sales',
1160
+ position: 'Sales Director',
1161
+ salary: 95000
1162
+ }, {
1163
+ id: 4,
1164
+ name: 'Alice Brown',
1165
+ department: 'Engineering',
1166
+ position: 'Tech Lead',
1167
+ salary: 92000
1168
+ }, {
1169
+ id: 5,
1170
+ name: 'Charlie Wilson',
1171
+ department: 'HR',
1172
+ position: 'HR Business Partner',
1173
+ salary: 65000
1174
+ }, {
1175
+ id: 6,
1176
+ name: 'Diana Davis',
1177
+ department: 'Marketing',
1178
+ position: 'Content Strategist',
1179
+ salary: 60000
1180
+ }, {
1181
+ id: 7,
1182
+ name: 'Edward Miller',
1183
+ department: 'Sales',
1184
+ position: 'Account Executive',
1185
+ salary: 75000
1186
+ }, {
1187
+ id: 8,
1188
+ name: 'Fiona Garcia',
1189
+ department: 'Engineering',
1190
+ position: 'Frontend Developer',
1191
+ salary: 78000
1192
+ }, {
1193
+ id: 9,
1194
+ name: 'George Martinez',
1195
+ department: 'HR',
1196
+ position: 'Talent Acquisition',
1197
+ salary: 62000
1198
+ }, {
1199
+ id: 10,
1200
+ name: 'Helen Taylor',
1201
+ department: 'Marketing',
1202
+ position: 'Digital Marketing Specialist',
1203
+ salary: 58000
1204
+ }];
1205
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
1206
+ style: {
1207
+ marginBottom: '1rem'
1208
+ }
1209
+ }, /*#__PURE__*/_react["default"].createElement("h3", null, "Table with Expandable Rows"), /*#__PURE__*/_react["default"].createElement("p", null, "Click on any row to expand it and see additional details about the employee."), /*#__PURE__*/_react["default"].createElement("div", {
1210
+ style: {
1211
+ backgroundColor: '#e3f2fd',
1212
+ padding: '12px',
1213
+ borderRadius: '6px',
1214
+ marginTop: '12px',
1215
+ fontSize: '14px',
1216
+ color: '#1565c0'
1217
+ }
1218
+ }, "\uD83D\uDCA1 ", /*#__PURE__*/_react["default"].createElement("strong", null, "Feature:"), " Each row can be expanded to show detailed information including contact details, employment history, and performance metrics.")), /*#__PURE__*/_react["default"].createElement(_Table["default"], {
1219
+ records: expandableRowsData,
1220
+ columnConfigs: expandableColumnConfigs,
1221
+ paginationType: "CLIENT",
1222
+ pagination: true,
1223
+ expandableRows: true,
1224
+ expandableRowsComponent: ExpandableRowContent,
1225
+ customClassName: "custom-table expandable-table"
1226
+ }));
1227
+ };
1228
+
1229
+ // Simple expandable rows example
1230
+ var SimpleExpandableRows = exports.SimpleExpandableRows = function SimpleExpandableRows() {
1231
+ var SimpleExpandableContent = function SimpleExpandableContent(_ref6) {
1232
+ var data = _ref6.data;
1233
+ return /*#__PURE__*/_react["default"].createElement("div", {
1234
+ style: {
1235
+ padding: '16px',
1236
+ backgroundColor: '#f4f8ff',
1237
+ borderRadius: '4px',
1238
+ margin: '0'
1239
+ }
1240
+ }, /*#__PURE__*/_react["default"].createElement("h4", {
1241
+ style: {
1242
+ margin: '0 0 8px 0',
1243
+ fontSize: '16px',
1244
+ color: '#333'
1245
+ }
1246
+ }, "Additional Information for ", data.name), /*#__PURE__*/_react["default"].createElement("p", {
1247
+ style: {
1248
+ margin: '4px 0',
1249
+ color: '#666'
1250
+ }
1251
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Employee ID:"), " EMP-", data.id.toString().padStart(4, '0')), /*#__PURE__*/_react["default"].createElement("p", {
1252
+ style: {
1253
+ margin: '4px 0',
1254
+ color: '#666'
1255
+ }
1256
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Email:"), " ", data.email), /*#__PURE__*/_react["default"].createElement("p", {
1257
+ style: {
1258
+ margin: '4px 0',
1259
+ color: '#666'
1260
+ }
1261
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Full Department:"), " ", data.department, " Department"), /*#__PURE__*/_react["default"].createElement("p", {
1262
+ style: {
1263
+ margin: '4px 0',
1264
+ color: '#666'
1265
+ }
1266
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Annual Salary:"), " $", data.salary.toLocaleString()), /*#__PURE__*/_react["default"].createElement("p", {
1267
+ style: {
1268
+ margin: '4px 0',
1269
+ color: '#666'
1270
+ }
1271
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Age:"), " ", data.age, " years old"));
1272
+ };
1273
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
1274
+ style: {
1275
+ marginBottom: '1rem'
1276
+ }
1277
+ }, /*#__PURE__*/_react["default"].createElement("h3", null, "Simple Expandable Rows"), /*#__PURE__*/_react["default"].createElement("p", null, "A simpler example of expandable rows with basic additional information.")), /*#__PURE__*/_react["default"].createElement(_Table["default"], {
1278
+ records: sampleRecords.slice(0, 8),
1279
+ columnConfigs: basicColumnConfigs,
1280
+ paginationType: "CLIENT",
1281
+ pagination: true,
1282
+ expandableRows: true,
1283
+ expandableRowsComponent: SimpleExpandableContent,
1284
+ customClassName: "custom-table"
1285
+ }));
1286
+ };
1287
+
1288
+ // Expandable rows with conditional expansion
1289
+ var ConditionalExpandableRows = exports.ConditionalExpandableRows = function ConditionalExpandableRows() {
1290
+ var ConditionalExpandableContent = function ConditionalExpandableContent(_ref7) {
1291
+ var data = _ref7.data;
1292
+ // Only show expansion for certain departments
1293
+ if (!['Engineering', 'Sales'].includes(data.department)) {
1294
+ return /*#__PURE__*/_react["default"].createElement("div", {
1295
+ style: {
1296
+ padding: '16px',
1297
+ backgroundColor: '#f4f8ff',
1298
+ border: '1px solid #ffeaa7',
1299
+ borderRadius: '4px',
1300
+ margin: '0',
1301
+ textAlign: 'center'
1302
+ }
1303
+ }, /*#__PURE__*/_react["default"].createElement("p", {
1304
+ style: {
1305
+ margin: 0,
1306
+ color: '#856404'
1307
+ }
1308
+ }, "\uD83D\uDCCB No additional details available for ", data.department, " department."));
1309
+ }
1310
+ return /*#__PURE__*/_react["default"].createElement("div", {
1311
+ style: {
1312
+ padding: '20px',
1313
+ backgroundColor: '#f8f9fa',
1314
+ border: '1px solid #dee2e6',
1315
+ borderRadius: '6px',
1316
+ margin: '8px 0'
1317
+ }
1318
+ }, /*#__PURE__*/_react["default"].createElement("h4", {
1319
+ style: {
1320
+ margin: '0 0 12px 0',
1321
+ color: '#495057'
1322
+ }
1323
+ }, data.department, " Department Details"), data.department === 'Engineering' && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
1324
+ style: {
1325
+ margin: '4px 0',
1326
+ color: '#666'
1327
+ }
1328
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Programming Languages:"), " JavaScript, Python, Java"), /*#__PURE__*/_react["default"].createElement("p", {
1329
+ style: {
1330
+ margin: '4px 0',
1331
+ color: '#666'
1332
+ }
1333
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Current Project:"), " React Dashboard Redesign"), /*#__PURE__*/_react["default"].createElement("p", {
1334
+ style: {
1335
+ margin: '4px 0',
1336
+ color: '#666'
1337
+ }
1338
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Certifications:"), " AWS Solutions Architect, React Professional"), /*#__PURE__*/_react["default"].createElement("p", {
1339
+ style: {
1340
+ margin: '4px 0',
1341
+ color: '#666'
1342
+ }
1343
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Code Reviews:"), " 45 completed this quarter")), data.department === 'Sales' && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
1344
+ style: {
1345
+ margin: '4px 0',
1346
+ color: '#666'
1347
+ }
1348
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Territory:"), " West Coast Region"), /*#__PURE__*/_react["default"].createElement("p", {
1349
+ style: {
1350
+ margin: '4px 0',
1351
+ color: '#666'
1352
+ }
1353
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Q1 Sales:"), " $125,000 (120% of target)"), /*#__PURE__*/_react["default"].createElement("p", {
1354
+ style: {
1355
+ margin: '4px 0',
1356
+ color: '#666'
1357
+ }
1358
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Active Deals:"), " 12 opportunities in pipeline"), /*#__PURE__*/_react["default"].createElement("p", {
1359
+ style: {
1360
+ margin: '4px 0',
1361
+ color: '#666'
1362
+ }
1363
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Client Satisfaction:"), " 4.8/5.0 average rating")));
1364
+ };
1365
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
1366
+ style: {
1367
+ marginBottom: '1rem'
1368
+ }
1369
+ }, /*#__PURE__*/_react["default"].createElement("h3", null, "Conditional Expandable Rows"), /*#__PURE__*/_react["default"].createElement("p", null, "This example shows different content based on the row data. Engineering and Sales show detailed info, others show a simple message."), /*#__PURE__*/_react["default"].createElement("div", {
1370
+ style: {
1371
+ backgroundColor: '#fff3cd',
1372
+ padding: '8px 12px',
1373
+ borderRadius: '4px',
1374
+ fontSize: '13px',
1375
+ color: '#856404',
1376
+ marginTop: '8px'
1377
+ }
1378
+ }, "\uD83D\uDCA1 Try expanding rows from different departments to see the conditional content.")), /*#__PURE__*/_react["default"].createElement(_Table["default"], {
1379
+ records: sampleRecords.slice(0, 10),
1380
+ columnConfigs: basicColumnConfigs,
1381
+ paginationType: "CLIENT",
1382
+ pagination: true,
1383
+ expandableRows: true,
1384
+ expandableRowsComponent: ConditionalExpandableContent,
1385
+ customClassName: "custom-table"
1386
+ }));
1387
+ };
1388
+
1389
+ // Sample data with more columns for sticky testing
1390
+ var stickyTestRecords = [{
1391
+ id: 1,
1392
+ name: 'John Doe',
1393
+ email: 'john.doe@example.com',
1394
+ age: 30,
1395
+ department: 'Engineering',
1396
+ salary: 75000,
1397
+ location: 'New York',
1398
+ status: 'Active'
1399
+ }, {
1400
+ id: 2,
1401
+ name: 'Jane Smith',
1402
+ email: 'jane.smith@example.com',
1403
+ age: 28,
1404
+ department: 'Marketing',
1405
+ salary: 65000,
1406
+ location: 'Los Angeles',
1407
+ status: 'Active'
1408
+ }, {
1409
+ id: 3,
1410
+ name: 'Bob Johnson',
1411
+ email: 'bob.johnson@example.com',
1412
+ age: 35,
1413
+ department: 'Sales',
1414
+ salary: 80000,
1415
+ location: 'Chicago',
1416
+ status: 'Inactive'
1417
+ }, {
1418
+ id: 4,
1419
+ name: 'Alice Brown',
1420
+ email: 'alice.brown@example.com',
1421
+ age: 32,
1422
+ department: 'Engineering',
1423
+ salary: 78000,
1424
+ location: 'Seattle',
1425
+ status: 'Active'
1426
+ }, {
1427
+ id: 5,
1428
+ name: 'Charlie Wilson',
1429
+ email: 'charlie.wilson@example.com',
1430
+ age: 29,
1431
+ department: 'HR',
1432
+ salary: 60000,
1433
+ location: 'Austin',
1434
+ status: 'Active'
1435
+ }, {
1436
+ id: 6,
1437
+ name: 'Diana Davis',
1438
+ email: 'diana.davis@example.com',
1439
+ age: 31,
1440
+ department: 'Marketing',
1441
+ salary: 67000,
1442
+ location: 'Miami',
1443
+ status: 'Active'
1444
+ }, {
1445
+ id: 7,
1446
+ name: 'Edward Miller',
1447
+ email: 'edward.miller@example.com',
1448
+ age: 33,
1449
+ department: 'Sales',
1450
+ salary: 82000,
1451
+ location: 'Denver',
1452
+ status: 'Inactive'
1453
+ }, {
1454
+ id: 8,
1455
+ name: 'Fiona Garcia',
1456
+ email: 'fiona.garcia@example.com',
1457
+ age: 27,
1458
+ department: 'Engineering',
1459
+ salary: 72000,
1460
+ location: 'Portland',
1461
+ status: 'Active'
1462
+ }];
1463
+
1464
+ // Column configs with sticky first column
1465
+ var stickyFirstColumnConfigs = [{
1466
+ name: 'ID',
1467
+ selector: function selector(row) {
1468
+ return row.id;
1469
+ },
1470
+ sortable: true,
1471
+ cell: function cell(row) {
1472
+ return /*#__PURE__*/_react["default"].createElement("div", {
1473
+ className: "tbl-content",
1474
+ style: {
1475
+ fontWeight: 'bold',
1476
+ color: '#007bff'
1477
+ }
1478
+ }, row.id);
1479
+ },
1480
+ width: '80px',
1481
+ stickyColumn: true // First column sticky
1482
+ }, {
1483
+ name: 'Name',
1484
+ selector: function selector(row) {
1485
+ return row.name;
1486
+ },
1487
+ sortable: true,
1488
+ cell: function cell(row) {
1489
+ return /*#__PURE__*/_react["default"].createElement("div", {
1490
+ className: "tbl-content"
1491
+ }, row.name);
1492
+ },
1493
+ width: '150px'
1494
+ }, {
1495
+ name: 'Email',
1496
+ selector: function selector(row) {
1497
+ return row.email;
1498
+ },
1499
+ sortable: true,
1500
+ cell: function cell(row) {
1501
+ return /*#__PURE__*/_react["default"].createElement("div", {
1502
+ className: "tbl-content"
1503
+ }, row.email);
1504
+ },
1505
+ width: '200px'
1506
+ }, {
1507
+ name: 'Age',
1508
+ selector: function selector(row) {
1509
+ return row.age;
1510
+ },
1511
+ sortable: true,
1512
+ cell: function cell(row) {
1513
+ return /*#__PURE__*/_react["default"].createElement("div", {
1514
+ className: "tbl-content"
1515
+ }, row.age);
1516
+ },
1517
+ width: '80px'
1518
+ }, {
1519
+ name: 'Department',
1520
+ selector: function selector(row) {
1521
+ return row.department;
1522
+ },
1523
+ sortable: true,
1524
+ cell: function cell(row) {
1525
+ return /*#__PURE__*/_react["default"].createElement("div", {
1526
+ className: "tbl-content"
1527
+ }, row.department);
1528
+ },
1529
+ width: '130px'
1530
+ }, {
1531
+ name: 'Salary',
1532
+ selector: function selector(row) {
1533
+ return "$".concat(row.salary.toLocaleString());
1534
+ },
1535
+ sortable: true,
1536
+ cell: function cell(row) {
1537
+ return /*#__PURE__*/_react["default"].createElement("div", {
1538
+ className: "tbl-content"
1539
+ }, "$", row.salary.toLocaleString());
1540
+ },
1541
+ width: '100px'
1542
+ }, {
1543
+ name: 'Location',
1544
+ selector: function selector(row) {
1545
+ return row.location;
1546
+ },
1547
+ sortable: true,
1548
+ cell: function cell(row) {
1549
+ return /*#__PURE__*/_react["default"].createElement("div", {
1550
+ className: "tbl-content"
1551
+ }, row.location);
1552
+ },
1553
+ width: '120px'
1554
+ }, {
1555
+ name: 'Status',
1556
+ selector: function selector(row) {
1557
+ return row.status;
1558
+ },
1559
+ sortable: true,
1560
+ cell: function cell(row) {
1561
+ return /*#__PURE__*/_react["default"].createElement("div", {
1562
+ className: "tbl-content"
1563
+ }, /*#__PURE__*/_react["default"].createElement("span", {
1564
+ style: {
1565
+ padding: '4px 8px',
1566
+ borderRadius: '12px',
1567
+ fontSize: '12px',
1568
+ fontWeight: 'bold',
1569
+ backgroundColor: row.status === 'Active' ? '#e8f5e8' : '#ffe6e6',
1570
+ color: row.status === 'Active' ? '#28a745' : '#dc3545'
1571
+ }
1572
+ }, row.status));
1573
+ },
1574
+ width: '100px'
1575
+ }];
1576
+
1577
+ // Column configs with sticky last column
1578
+ var stickyLastColumnConfigs = [{
1579
+ name: 'ID',
1580
+ selector: function selector(row) {
1581
+ return row.id;
1582
+ },
1583
+ sortable: true,
1584
+ cell: function cell(row) {
1585
+ return /*#__PURE__*/_react["default"].createElement("div", {
1586
+ className: "tbl-content"
1587
+ }, row.id);
1588
+ },
1589
+ width: '80px'
1590
+ }, {
1591
+ name: 'Name',
1592
+ selector: function selector(row) {
1593
+ return row.name;
1594
+ },
1595
+ sortable: true,
1596
+ cell: function cell(row) {
1597
+ return /*#__PURE__*/_react["default"].createElement("div", {
1598
+ className: "tbl-content"
1599
+ }, row.name);
1600
+ },
1601
+ width: '150px'
1602
+ }, {
1603
+ name: 'Email',
1604
+ selector: function selector(row) {
1605
+ return row.email;
1606
+ },
1607
+ sortable: true,
1608
+ cell: function cell(row) {
1609
+ return /*#__PURE__*/_react["default"].createElement("div", {
1610
+ className: "tbl-content"
1611
+ }, row.email);
1612
+ },
1613
+ width: '200px'
1614
+ }, {
1615
+ name: 'Age',
1616
+ selector: function selector(row) {
1617
+ return row.age;
1618
+ },
1619
+ sortable: true,
1620
+ cell: function cell(row) {
1621
+ return /*#__PURE__*/_react["default"].createElement("div", {
1622
+ className: "tbl-content"
1623
+ }, row.age);
1624
+ },
1625
+ width: '80px'
1626
+ }, {
1627
+ name: 'Department',
1628
+ selector: function selector(row) {
1629
+ return row.department;
1630
+ },
1631
+ sortable: true,
1632
+ cell: function cell(row) {
1633
+ return /*#__PURE__*/_react["default"].createElement("div", {
1634
+ className: "tbl-content"
1635
+ }, row.department);
1636
+ },
1637
+ width: '130px'
1638
+ }, {
1639
+ name: 'Salary',
1640
+ selector: function selector(row) {
1641
+ return "$".concat(row.salary.toLocaleString());
1642
+ },
1643
+ sortable: true,
1644
+ cell: function cell(row) {
1645
+ return /*#__PURE__*/_react["default"].createElement("div", {
1646
+ className: "tbl-content"
1647
+ }, "$", row.salary.toLocaleString());
1648
+ },
1649
+ width: '100px'
1650
+ }, {
1651
+ name: 'Location',
1652
+ selector: function selector(row) {
1653
+ return row.location;
1654
+ },
1655
+ sortable: true,
1656
+ cell: function cell(row) {
1657
+ return /*#__PURE__*/_react["default"].createElement("div", {
1658
+ className: "tbl-content"
1659
+ }, row.location);
1660
+ },
1661
+ width: '120px'
1662
+ }, {
1663
+ name: 'Actions',
1664
+ selector: function selector(row) {
1665
+ return 'actions';
1666
+ },
1667
+ sortable: false,
1668
+ cell: function cell(row) {
1669
+ return /*#__PURE__*/_react["default"].createElement("div", {
1670
+ className: "tbl-content"
1671
+ }, /*#__PURE__*/_react["default"].createElement("button", {
1672
+ style: {
1673
+ padding: '4px 8px',
1674
+ marginRight: '4px',
1675
+ backgroundColor: '#007bff',
1676
+ color: 'white',
1677
+ border: 'none',
1678
+ borderRadius: '4px',
1679
+ cursor: 'pointer',
1680
+ fontSize: '12px'
1681
+ },
1682
+ onClick: function onClick() {
1683
+ return alert("Edit ".concat(row.name));
1684
+ }
1685
+ }, "Edit"), /*#__PURE__*/_react["default"].createElement("button", {
1686
+ style: {
1687
+ padding: '4px 8px',
1688
+ backgroundColor: '#dc3545',
1689
+ color: 'white',
1690
+ border: 'none',
1691
+ borderRadius: '4px',
1692
+ cursor: 'pointer',
1693
+ fontSize: '12px'
1694
+ },
1695
+ onClick: function onClick() {
1696
+ return alert("Delete ".concat(row.name));
1697
+ }
1698
+ }, "Delete"));
1699
+ },
1700
+ width: '120px',
1701
+ stickyColumn: true // Last column sticky
1702
+ }];
1703
+
1704
+ // Table with sticky first column
1705
+ var StickyFirstColumn = exports.StickyFirstColumn = function StickyFirstColumn() {
1706
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
1707
+ style: {
1708
+ marginBottom: '1rem'
1709
+ }
1710
+ }, /*#__PURE__*/_react["default"].createElement("h3", null, "Sticky First Column Table"), /*#__PURE__*/_react["default"].createElement("p", null, "The first column (ID) is sticky and will remain visible when scrolling horizontally."), /*#__PURE__*/_react["default"].createElement("p", {
1711
+ style: {
1712
+ color: '#666',
1713
+ fontSize: '14px'
1714
+ }
1715
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Class applied:"), " ", /*#__PURE__*/_react["default"].createElement("code", null, "first-clm-sticky"))), /*#__PURE__*/_react["default"].createElement("div", {
1716
+ style: {
1717
+ width: '800px',
1718
+ overflowX: 'auto',
1719
+ borderRight: '1px solid #ddd'
1720
+ }
1721
+ }, /*#__PURE__*/_react["default"].createElement(_Table["default"], {
1722
+ records: stickyTestRecords,
1723
+ columnConfigs: stickyFirstColumnConfigs,
1724
+ paginationType: "CLIENT",
1725
+ pagination: true,
1726
+ customClassName: "custom-table"
1727
+ })));
1728
+ };
1729
+
1730
+ // Table with sticky last column
1731
+ var StickyLastColumn = exports.StickyLastColumn = function StickyLastColumn() {
1732
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
1733
+ style: {
1734
+ marginBottom: '1rem'
1735
+ }
1736
+ }, /*#__PURE__*/_react["default"].createElement("h3", null, "Sticky Last Column Table"), /*#__PURE__*/_react["default"].createElement("p", null, "The last column (Actions) is sticky and will remain visible when scrolling horizontally."), /*#__PURE__*/_react["default"].createElement("p", {
1737
+ style: {
1738
+ color: '#666',
1739
+ fontSize: '14px'
1740
+ }
1741
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Class applied:"), " ", /*#__PURE__*/_react["default"].createElement("code", null, "last-clm-sticky"))), /*#__PURE__*/_react["default"].createElement("div", {
1742
+ style: {
1743
+ width: '800px',
1744
+ overflowX: 'auto',
1745
+ border: '1px solid #ddd'
1746
+ }
1747
+ }, /*#__PURE__*/_react["default"].createElement(_Table["default"], {
1748
+ records: stickyTestRecords,
1749
+ columnConfigs: stickyLastColumnConfigs,
1750
+ paginationType: "CLIENT",
1751
+ pagination: true,
1752
+ customClassName: "custom-table"
1753
+ })));
1754
+ };
1755
+
1756
+ // Table without sticky columns (for comparison)
1757
+ var NoStickyColumn = exports.NoStickyColumn = function NoStickyColumn() {
1758
+ var regularColumnConfigs = stickyFirstColumnConfigs.map(function (col) {
1759
+ return _objectSpread(_objectSpread({}, col), {}, {
1760
+ stickyColumn: false // Ensure no sticky columns
1761
+ });
1762
+ });
1763
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
1764
+ style: {
1765
+ marginBottom: '1rem'
1766
+ }
1767
+ }, /*#__PURE__*/_react["default"].createElement("h3", null, "Regular Table (No Sticky Columns)"), /*#__PURE__*/_react["default"].createElement("p", null, "This table has no sticky columns for comparison purposes."), /*#__PURE__*/_react["default"].createElement("p", {
1768
+ style: {
1769
+ color: '#666',
1770
+ fontSize: '14px'
1771
+ }
1772
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Classes applied:"), " Only ", /*#__PURE__*/_react["default"].createElement("code", null, "nutana-table"))), /*#__PURE__*/_react["default"].createElement("div", {
1773
+ style: {
1774
+ width: '800px',
1775
+ overflowX: 'auto',
1776
+ border: '1px solid #ddd'
1777
+ }
1778
+ }, /*#__PURE__*/_react["default"].createElement(_Table["default"], {
1779
+ records: stickyTestRecords,
1780
+ columnConfigs: regularColumnConfigs,
1781
+ paginationType: "CLIENT",
1782
+ pagination: true,
1783
+ customClassName: "custom-table"
1784
+ })));
1785
+ };
1786
+
1787
+ // Column configs with both first and last columns sticky
1788
+ var stickyBothColumnConfigs = [{
1789
+ name: 'ID',
1790
+ selector: function selector(row) {
1791
+ return row.id;
1792
+ },
1793
+ sortable: true,
1794
+ cell: function cell(row) {
1795
+ return /*#__PURE__*/_react["default"].createElement("div", {
1796
+ className: "tbl-content",
1797
+ style: {
1798
+ fontWeight: 'bold',
1799
+ color: '#007bff'
1800
+ }
1801
+ }, row.id);
1802
+ },
1803
+ width: '80px',
1804
+ stickyColumn: true // First column sticky
1805
+ }, {
1806
+ name: 'Name',
1807
+ selector: function selector(row) {
1808
+ return row.name;
1809
+ },
1810
+ sortable: true,
1811
+ cell: function cell(row) {
1812
+ return /*#__PURE__*/_react["default"].createElement("div", {
1813
+ className: "tbl-content"
1814
+ }, row.name);
1815
+ },
1816
+ width: '150px'
1817
+ }, {
1818
+ name: 'Email',
1819
+ selector: function selector(row) {
1820
+ return row.email;
1821
+ },
1822
+ sortable: true,
1823
+ cell: function cell(row) {
1824
+ return /*#__PURE__*/_react["default"].createElement("div", {
1825
+ className: "tbl-content"
1826
+ }, row.email);
1827
+ },
1828
+ width: '200px'
1829
+ }, {
1830
+ name: 'Age',
1831
+ selector: function selector(row) {
1832
+ return row.age;
1833
+ },
1834
+ sortable: true,
1835
+ cell: function cell(row) {
1836
+ return /*#__PURE__*/_react["default"].createElement("div", {
1837
+ className: "tbl-content"
1838
+ }, row.age);
1839
+ },
1840
+ width: '80px'
1841
+ }, {
1842
+ name: 'Department',
1843
+ selector: function selector(row) {
1844
+ return row.department;
1845
+ },
1846
+ sortable: true,
1847
+ cell: function cell(row) {
1848
+ return /*#__PURE__*/_react["default"].createElement("div", {
1849
+ className: "tbl-content"
1850
+ }, row.department);
1851
+ },
1852
+ width: '130px'
1853
+ }, {
1854
+ name: 'Salary',
1855
+ selector: function selector(row) {
1856
+ return "$".concat(row.salary.toLocaleString());
1857
+ },
1858
+ sortable: true,
1859
+ cell: function cell(row) {
1860
+ return /*#__PURE__*/_react["default"].createElement("div", {
1861
+ className: "tbl-content"
1862
+ }, "$", row.salary.toLocaleString());
1863
+ },
1864
+ width: '100px'
1865
+ }, {
1866
+ name: 'Location',
1867
+ selector: function selector(row) {
1868
+ return row.location;
1869
+ },
1870
+ sortable: true,
1871
+ cell: function cell(row) {
1872
+ return /*#__PURE__*/_react["default"].createElement("div", {
1873
+ className: "tbl-content"
1874
+ }, row.location);
1875
+ },
1876
+ width: '120px'
1877
+ }, {
1878
+ name: 'Actions',
1879
+ selector: function selector(row) {
1880
+ return 'actions';
1881
+ },
1882
+ sortable: false,
1883
+ cell: function cell(row) {
1884
+ return /*#__PURE__*/_react["default"].createElement("div", {
1885
+ className: "tbl-content"
1886
+ }, /*#__PURE__*/_react["default"].createElement("button", {
1887
+ style: {
1888
+ padding: '4px 8px',
1889
+ marginRight: '4px',
1890
+ backgroundColor: '#28a745',
1891
+ color: 'white',
1892
+ border: 'none',
1893
+ borderRadius: '4px',
1894
+ cursor: 'pointer',
1895
+ fontSize: '12px'
1896
+ },
1897
+ onClick: function onClick() {
1898
+ return alert("View ".concat(row.name));
1899
+ }
1900
+ }, "View"), /*#__PURE__*/_react["default"].createElement("button", {
1901
+ style: {
1902
+ padding: '4px 8px',
1903
+ marginRight: '4px',
1904
+ backgroundColor: '#007bff',
1905
+ color: 'white',
1906
+ border: 'none',
1907
+ borderRadius: '4px',
1908
+ cursor: 'pointer',
1909
+ fontSize: '12px'
1910
+ },
1911
+ onClick: function onClick() {
1912
+ return alert("Edit ".concat(row.name));
1913
+ }
1914
+ }, "Edit"), /*#__PURE__*/_react["default"].createElement("button", {
1915
+ style: {
1916
+ padding: '4px 8px',
1917
+ backgroundColor: '#dc3545',
1918
+ color: 'white',
1919
+ border: 'none',
1920
+ borderRadius: '4px',
1921
+ cursor: 'pointer',
1922
+ fontSize: '12px'
1923
+ },
1924
+ onClick: function onClick() {
1925
+ return alert("Delete ".concat(row.name));
1926
+ }
1927
+ }, "Delete"));
1928
+ },
1929
+ width: '180px',
1930
+ stickyColumn: true // Last column sticky
1931
+ }];
1932
+
1933
+ // Table with both first and last columns sticky
1934
+ var StickyBothColumns = exports.StickyBothColumns = function StickyBothColumns() {
1935
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
1936
+ style: {
1937
+ marginBottom: '1rem'
1938
+ }
1939
+ }, /*#__PURE__*/_react["default"].createElement("h3", null, "Sticky First & Last Columns Table"), /*#__PURE__*/_react["default"].createElement("p", null, "Both the first column (ID) and last column (Actions) are sticky and will remain visible when scrolling horizontally."), /*#__PURE__*/_react["default"].createElement("p", {
1940
+ style: {
1941
+ color: '#666',
1942
+ fontSize: '14px'
1943
+ }
1944
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Classes applied:"), " ", /*#__PURE__*/_react["default"].createElement("code", null, "first-clm-sticky"), " and ", /*#__PURE__*/_react["default"].createElement("code", null, "last-clm-sticky")), /*#__PURE__*/_react["default"].createElement("div", {
1945
+ style: {
1946
+ backgroundColor: '#f8f9fa',
1947
+ padding: '8px 12px',
1948
+ borderRadius: '4px',
1949
+ marginTop: '8px',
1950
+ fontSize: '13px',
1951
+ color: '#495057'
1952
+ }
1953
+ }, "\uD83D\uDCA1 ", /*#__PURE__*/_react["default"].createElement("strong", null, "Testing tip:"), " Scroll horizontally to see both ID and Actions columns remain fixed while middle columns scroll.")), /*#__PURE__*/_react["default"].createElement("div", {
1954
+ style: {
1955
+ width: '800px',
1956
+ overflowX: 'auto',
1957
+ border: '1px solid #ddd'
1958
+ }
1959
+ }, /*#__PURE__*/_react["default"].createElement(_Table["default"], {
1960
+ records: stickyTestRecords,
1961
+ columnConfigs: stickyBothColumnConfigs,
1962
+ paginationType: "CLIENT",
1963
+ pagination: true,
1964
+ customClassName: "custom-table"
1965
+ })));
1966
+ };
1967
+
1968
+ // Custom pagination styling example
1969
+ var CustomPaginationStyling = exports.CustomPaginationStyling = Template.bind({});
1970
+ CustomPaginationStyling.args = {
1971
+ records: sampleRecords,
1972
+ columnConfigs: basicColumnConfigs,
1973
+ paginationType: 'CLIENT',
1974
+ pagination: true,
1975
+ customClassName: 'custom-table',
1976
+ paginationComponentOptions: {
1977
+ className: 'my-custom-pagination-class',
1978
+ // This will be applied to the 'rdt_Pagination' div
1979
+ rowsPerPageText: 'Records per page:',
1980
+ rangeSeparatorText: 'of',
1981
+ selectAllRowsItem: true,
1982
+ selectAllRowsItemText: 'All'
1983
+ }
1984
+ };
1985
+
1986
+ // Server-side pagination with custom styling
1987
+ var ServerSidePaginationWithCustomStyling = exports.ServerSidePaginationWithCustomStyling = function ServerSidePaginationWithCustomStyling() {
1988
+ var _useState11 = (0, _react.useState)([]),
1989
+ _useState12 = _slicedToArray(_useState11, 2),
1990
+ selectedRows = _useState12[0],
1991
+ setSelectedRows = _useState12[1];
1992
+ var responseFormatter = function responseFormatter(response) {
1993
+ return {
1994
+ entries: response || [],
1995
+ total: response ? 30 : 0
1996
+ };
1997
+ };
1998
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
1999
+ style: {
2000
+ marginBottom: '1rem'
2001
+ }
2002
+ }, /*#__PURE__*/_react["default"].createElement("h3", null, "Server-Side Pagination with Custom Styling"), /*#__PURE__*/_react["default"].createElement("p", null, "This example shows custom pagination styling with server-side data fetching."), /*#__PURE__*/_react["default"].createElement("div", {
2003
+ style: {
2004
+ backgroundColor: '#e3f2fd',
2005
+ padding: '12px',
2006
+ borderRadius: '6px',
2007
+ marginTop: '12px',
2008
+ fontSize: '14px',
2009
+ color: '#1565c0'
2010
+ }
2011
+ }, "\uD83D\uDCA1 ", /*#__PURE__*/_react["default"].createElement("strong", null, "Custom Classes:"), " The pagination component has custom styling applied via ", /*#__PURE__*/_react["default"].createElement("code", null, "paginationComponentOptions"))), /*#__PURE__*/_react["default"].createElement(_Table["default"], {
2012
+ columnConfigs: postsColumnConfigs,
2013
+ paginationType: "SERVER",
2014
+ pagination: true,
2015
+ showSelectableRows: true,
2016
+ setSelectedRow: setSelectedRows,
2017
+ CheckBoxRow: CustomCheckBoxRow,
2018
+ customClassName: "custom-table",
2019
+ paginationComponentOptions: {
2020
+ className: 'server-pagination-custom',
2021
+ rowsPerPageText: 'Posts per page:',
2022
+ rangeSeparatorText: 'out of',
2023
+ selectAllRowsItem: true,
2024
+ selectAllRowsItemText: 'Show All'
2025
+ },
2026
+ apiInfo: {
2027
+ pageNoKey: '_page',
2028
+ perPageKey: '_limit',
2029
+ searchBy: 'q',
2030
+ requestId: 'getPosts',
2031
+ responseFormatter: responseFormatter
2032
+ },
2033
+ onApiError: function onApiError(error) {
2034
+ return console.error('API Error:', error);
2035
+ }
2036
+ }));
2037
+ };
2038
+
2039
+ // Pagination options showcase
2040
+ var PaginationOptionsShowcase = exports.PaginationOptionsShowcase = function PaginationOptionsShowcase() {
2041
+ var _useState13 = (0, _react.useState)({
2042
+ className: 'showcase-pagination',
2043
+ rowsPerPageText: 'Items per page:',
2044
+ rangeSeparatorText: 'of',
2045
+ selectAllRowsItem: true,
2046
+ selectAllRowsItemText: 'All Records'
2047
+ }),
2048
+ _useState14 = _slicedToArray(_useState13, 2),
2049
+ currentOptions = _useState14[0],
2050
+ setCurrentOptions = _useState14[1];
2051
+ var optionSets = [{
2052
+ name: 'Default Style',
2053
+ options: {
2054
+ className: 'default-pagination',
2055
+ rowsPerPageText: 'Rows per page:',
2056
+ rangeSeparatorText: 'of',
2057
+ selectAllRowsItem: false
2058
+ }
2059
+ }, {
2060
+ name: 'Compact Style',
2061
+ options: {
2062
+ className: 'compact-pagination',
2063
+ rowsPerPageText: 'Per page:',
2064
+ rangeSeparatorText: '/',
2065
+ selectAllRowsItem: true,
2066
+ selectAllRowsItemText: 'All'
2067
+ }
2068
+ }, {
2069
+ name: 'Verbose Style',
2070
+ options: {
2071
+ className: 'verbose-pagination',
2072
+ rowsPerPageText: 'Number of records per page:',
2073
+ rangeSeparatorText: 'out of total',
2074
+ selectAllRowsItem: true,
2075
+ selectAllRowsItemText: 'Show All Records'
2076
+ }
2077
+ }, {
2078
+ name: 'Custom Brand Style',
2079
+ options: {
2080
+ className: 'brand-pagination',
2081
+ rowsPerPageText: 'Display:',
2082
+ rangeSeparatorText: 'from',
2083
+ selectAllRowsItem: true,
2084
+ selectAllRowsItemText: 'Everything'
2085
+ }
2086
+ }];
2087
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
2088
+ style: {
2089
+ marginBottom: '1rem'
2090
+ }
2091
+ }, /*#__PURE__*/_react["default"].createElement("h3", null, "Pagination Options Showcase"), /*#__PURE__*/_react["default"].createElement("p", null, "Try different pagination styling options to see how they affect the appearance and text."), /*#__PURE__*/_react["default"].createElement("div", {
2092
+ style: {
2093
+ marginBottom: '16px'
2094
+ }
2095
+ }, /*#__PURE__*/_react["default"].createElement("label", {
2096
+ style: {
2097
+ marginRight: '8px',
2098
+ fontWeight: 'bold'
2099
+ }
2100
+ }, "Choose Style:"), /*#__PURE__*/_react["default"].createElement("select", {
2101
+ onChange: function onChange(e) {
2102
+ return setCurrentOptions(optionSets[e.target.value].options);
2103
+ },
2104
+ style: {
2105
+ padding: '4px 8px',
2106
+ borderRadius: '4px',
2107
+ border: '1px solid #ccc'
2108
+ }
2109
+ }, optionSets.map(function (set, index) {
2110
+ return /*#__PURE__*/_react["default"].createElement("option", {
2111
+ key: index,
2112
+ value: index
2113
+ }, set.name);
2114
+ }))), /*#__PURE__*/_react["default"].createElement("div", {
2115
+ style: {
2116
+ backgroundColor: '#f8f9fa',
2117
+ padding: '12px',
2118
+ borderRadius: '6px',
2119
+ fontSize: '13px',
2120
+ marginBottom: '16px'
2121
+ }
2122
+ }, /*#__PURE__*/_react["default"].createElement("strong", null, "Current Options:"), /*#__PURE__*/_react["default"].createElement("pre", {
2123
+ style: {
2124
+ margin: '8px 0 0 0',
2125
+ fontSize: '12px'
2126
+ }
2127
+ }, JSON.stringify(currentOptions, null, 2)))), /*#__PURE__*/_react["default"].createElement(_Table["default"], {
2128
+ records: sampleRecords,
2129
+ columnConfigs: basicColumnConfigs,
2130
+ paginationType: "CLIENT",
2131
+ pagination: true,
2132
+ customClassName: "custom-table",
2133
+ paginationComponentOptions: currentOptions
2134
+ }));
2135
+ };
2136
+
2137
+ // Advanced pagination styling with CSS
2138
+ var AdvancedPaginationStyling = exports.AdvancedPaginationStyling = function AdvancedPaginationStyling() {
2139
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("style", null, "\n .advanced-pagination {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n padding: 16px;\n border-radius: 12px;\n box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);\n }\n\n .advanced-pagination .rdt_TableFooter {\n color: white;\n font-weight: 500;\n }\n\n .advanced-pagination select {\n background: rgba(255, 255, 255, 0.2);\n color: white;\n border: 1px solid rgba(255, 255, 255, 0.3);\n border-radius: 6px;\n padding: 4px 8px;\n }\n\n .advanced-pagination button {\n background: rgba(255, 255, 255, 0.2);\n color: white;\n border: 1px solid rgba(255, 255, 255, 0.3);\n border-radius: 6px;\n padding: 8px 12px;\n margin: 0 2px;\n cursor: pointer;\n transition: all 0.3s ease;\n }\n\n .advanced-pagination button:hover:not(:disabled) {\n background: rgba(255, 255, 255, 0.3);\n transform: translateY(-1px);\n }\n\n .advanced-pagination button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n "), /*#__PURE__*/_react["default"].createElement("div", {
2140
+ style: {
2141
+ marginBottom: '1rem'
2142
+ }
2143
+ }, /*#__PURE__*/_react["default"].createElement("h3", null, "Advanced Pagination Styling"), /*#__PURE__*/_react["default"].createElement("p", null, "This example shows how custom CSS can be applied through the className option.")), /*#__PURE__*/_react["default"].createElement(_Table["default"], {
2144
+ records: sampleRecords,
2145
+ columnConfigs: basicColumnConfigs,
2146
+ paginationType: "CLIENT",
2147
+ pagination: true,
2148
+ customClassName: "custom-table",
2149
+ paginationComponentOptions: {
2150
+ className: 'advanced-pagination',
2151
+ rowsPerPageText: '🔢 Show:',
2152
+ rangeSeparatorText: '📊 of',
2153
+ selectAllRowsItem: true,
2154
+ selectAllRowsItemText: '🌟 All'
2155
+ }
2156
+ }));
898
2157
  };