oolib 2.131.5 → 2.132.0

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.
@@ -6,6 +6,10 @@ export function SimpleTable({ id, readOnly, config, value: _value, onChange, def
6
6
  noOfRows: number;
7
7
  colHeaderData: any;
8
8
  rowHeaderData: any;
9
+ blockConfig: {
10
+ comp: string;
11
+ props: {};
12
+ }[];
9
13
  };
10
14
  value: any;
11
15
  onChange: any;
@@ -81,6 +81,7 @@ function SimpleTable(_a) {
81
81
  noOfRows: 3,
82
82
  colHeaderData: undefined,
83
83
  rowHeaderData: undefined,
84
+ blockConfig: [undefined, { comp: 'DropdownSingle', props: {} }, { comp: 'DropdownSingle', props: {} }]
84
85
  } : _b, _value = _a.value, onChange = _a.onChange, _c = _a.defaultColWidth, defaultColWidth = _c === void 0 ? 200 : _c;
85
86
  var props = arguments[0];
86
87
  var theme = (0, styled_components_1.useTheme)();
@@ -139,6 +140,9 @@ function SimpleTable(_a) {
139
140
  padding: "0.9rem 1rem",
140
141
  },
141
142
  },
143
+ DropdownSingle: {
144
+ S: true
145
+ }
142
146
  // KPDropdown: {
143
147
  // size: 'small',
144
148
  // },
@@ -175,9 +179,9 @@ function SimpleTable(_a) {
175
179
  , enableColResizeActions = _b === void 0 ? true : _b // cuz in the case of pre fixed column (via config.rowHeaderData), enableResize will be set to false
176
180
  ;
177
181
  var CellComp = RichTextEditor //cuz in oolib, richtexteditor will not be there for now
178
- ? CellContentBlocks["RichTextEditor"]
182
+ ? CellContentBlocks[cell.comp] || CellContentBlocks["RichTextEditor"]
179
183
  : function () { return react_1.default.createElement("div", null, "RTE Doesnt Exist"); };
180
- var cellProps = __assign({}, CellContentBlockDefaultProps["RichTextEditor"]);
184
+ var cellProps = __assign({}, (cell.comp ? (CellContentBlockDefaultProps[cell.comp] ? __assign(__assign({}, CellContentBlockDefaultProps[cell.comp]), (cell.props || {})) : {}) : CellContentBlockDefaultProps["RichTextEditor"]));
181
185
  var cellValue = CellValueGetters["RichTextEditor"](cell.value);
182
186
  var cellWidth = value.colWidthConfig["col_".concat(cellIdx)] || defaultColWidth + 'px'; //cuz when pre-fixed column is applied via config.rowHeaderData, no colWidthConfig will be there for it in value.colWidthConfig
183
187
  //(100% - totalExplicitWidths)/(totalColumns - noOfColsWithExplicitWidths)
@@ -40,9 +40,10 @@ var prepInitValueFromConfigIfNoValue = function (_a) {
40
40
  }),
41
41
  } //backwards compat
42
42
  : {
43
- data: __spreadArray([], insertRowAndCellIds({
43
+ data: __spreadArray([], insertRowCellIdsAndComp({
44
44
  noOfRows: noOfRows,
45
45
  noOfCols: noOfCols,
46
+ blockConfig: config.blockConfig
46
47
  }), true),
47
48
  colWidthConfig: getInitColWidthConfigs({ noOfCols: noOfCols, defaultColWidth: defaultColWidth }),
48
49
  };
@@ -66,12 +67,13 @@ var getInitColWidthConfigs = function (_a) {
66
67
  return (__assign(__assign({}, a), (_a = {}, _a[b.colId] = b.width, _a)));
67
68
  }, {});
68
69
  };
69
- var insertRowAndCellIds = function (_a) {
70
- var noOfRows = _a.noOfRows, noOfCols = _a.noOfCols;
70
+ var insertRowCellIdsAndComp = function (_a) {
71
+ var noOfRows = _a.noOfRows, noOfCols = _a.noOfCols, _b = _a.blockConfig, blockConfig = _b === void 0 ? [] : _b;
71
72
  return (0, makeArrayFromLength_1.makeArrayFromLength)(noOfRows).map(function () { return ({
72
73
  id: "row_".concat((0, genHash_1.genHash)(8)),
73
- cellData: (0, makeArrayFromLength_1.makeArrayFromLength)(noOfCols).map(function () { return ({
74
- id: "cell_".concat((0, genHash_1.genHash)(8)),
75
- }); }),
74
+ cellData: (0, makeArrayFromLength_1.makeArrayFromLength)(noOfCols).map(function (d, i) {
75
+ var _a;
76
+ return (__assign({ id: "cell_".concat((0, genHash_1.genHash)(8)) }, (((_a = blockConfig[i]) === null || _a === void 0 ? void 0 : _a.comp) ? { comp: blockConfig[i].comp, props: blockConfig[i].props || {} } : {})));
77
+ }),
76
78
  }); });
77
79
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.131.5",
3
+ "version": "2.132.0",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",