mig-schema-table 3.0.121 → 3.0.122

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.
@@ -24,9 +24,9 @@ const ColumnResizers = ({ columnWidths, onColumnWidthsChange, resizeColumnIndex,
24
24
  }, [dragStartX, setColumnDelta, setResizeColumnIndex]);
25
25
  return (_jsx("div", { children: columnWidths.map((columnWidth, columnIndex) => {
26
26
  pointer += columnWidth;
27
- const classNames = ["schema-table__column_resizer"];
27
+ const classNames = ["mig-schema-table__column_resizer"];
28
28
  if (columnIndex === resizeColumnIndex) {
29
- classNames.push("schema-table__column_resizer--dragged");
29
+ classNames.push("mig-schema-table__column_resizer--dragged");
30
30
  }
31
31
  return (_jsx("div", { style: { left: pointer, bottom: tableBodyHeight }, className: classNames.join(" "), draggable: "true", "data-column-index": columnIndex, onDragStart: onDragStart, onDragEnd: onDragEnd }, columnIndex));
32
32
  }) }));
@@ -46,12 +46,12 @@ function Td({ checkedIndexes, disabledCheckedIndexes, columnIndex, data, getRowC
46
46
  }
47
47
  }
48
48
  const classNames = [
49
- "schema-table__td",
50
- `schema-table__td--${rowIndex % 2 ? "odd" : "even"}`,
51
- `schema-table__td--prop-${propName}`,
49
+ "mig-schema-table__td",
50
+ `mig-schema-table__td--${rowIndex % 2 ? "odd" : "even"}`,
51
+ `mig-schema-table__td--prop-${propName}`,
52
52
  ];
53
53
  if (getRowSelected && getRowSelected(data[row._index], row._index)) {
54
- classNames.push("schema-table__td--selected");
54
+ classNames.push("mig-schema-table__td--selected");
55
55
  }
56
56
  if (getRowClassName) {
57
57
  classNames.push(getRowClassName(data[row._index], row._index, sortedRenderData));
@@ -12,19 +12,19 @@ const Th = ({ columnFilterStatus, isAllChecked, isSortable, numberOfSelectedRows
12
12
  const [isDragging, setIsDragging] = React.useState(false);
13
13
  const [isDropTarget, setIsDropTarget] = React.useState(false);
14
14
  const classNames = [
15
- `schema-table__th`,
16
- `schema-table__th--filter-${columnFilterStatus}`,
17
- `schema-table__th--prop-${propName}`,
15
+ `mig-schema-table__th`,
16
+ `mig-schema-table__th--filter-${columnFilterStatus}`,
17
+ `mig-schema-table__th--prop-${propName}`,
18
18
  ];
19
- classNames.push(isSortable ? "schema-table__th--sortable" : "schema-table__th--unsortable");
19
+ classNames.push(isSortable ? "mig-schema-table__th--sortable" : "mig-schema-table__th--unsortable");
20
20
  if (sortAsc !== undefined) {
21
- classNames.push("schema-table__th--sorted");
21
+ classNames.push("mig-schema-table__th--sorted");
22
22
  }
23
23
  if (isDragging) {
24
- classNames.push(`schema-table__th--dragging`);
24
+ classNames.push(`mig-schema-table__th--dragging`);
25
25
  }
26
26
  if (isDropTarget) {
27
- classNames.push(`schema-table__th--drop-target`);
27
+ classNames.push(`mig-schema-table__th--drop-target`);
28
28
  }
29
29
  const onLabelClick = React.useCallback(() => {
30
30
  if (!isSortable) {
@@ -136,6 +136,6 @@ const Th = ({ columnFilterStatus, isAllChecked, isSortable, numberOfSelectedRows
136
136
  classNames.push(`text-${propConfig.align}`);
137
137
  }
138
138
  }
139
- return (_jsxs("div", Object.assign({ style: style, className: classNames.join(" "), title: title, draggable: true, onDragStart: onDragStart, onDragEnd: onDragEnd, onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop }, { children: [_jsxs("div", Object.assign({ className: "schema-table__th__label-body", style: { lineHeight: "44px" }, onClick: onLabelClick }, { children: [_jsx("span", Object.assign({ className: "schema-table__th__label-body-text" }, { children: labelBody })), sortAsc === undefined ? null : (_jsx("span", Object.assign({ className: "schema-table__th__sort-icon" }, { children: sortAsc ? "↓" : "↑" })))] })), isSortable || columnFilterStatus !== EColumnFilterStatus.UNAVAILABLE ? (_jsx("button", Object.assign({ className: "schema-table__th__trigger-el", onClick: onTriggerClick }, { children: _jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#404040", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, { children: _jsx("polyline", { points: "6 9 12 15 18 9" }) })) }))) : null] })));
139
+ return (_jsxs("div", Object.assign({ style: style, className: classNames.join(" "), title: title, draggable: true, onDragStart: onDragStart, onDragEnd: onDragEnd, onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop }, { children: [_jsxs("div", Object.assign({ className: "mig-schema-table__th__label-body", style: { lineHeight: "44px" }, onClick: onLabelClick }, { children: [_jsx("span", Object.assign({ className: "mig-schema-table__th__label-body-text" }, { children: labelBody })), sortAsc === undefined ? null : (_jsx("span", Object.assign({ className: "mig-schema-table__th__sort-icon" }, { children: sortAsc ? "↓" : "↑" })))] })), isSortable || columnFilterStatus !== EColumnFilterStatus.UNAVAILABLE ? (_jsx("button", Object.assign({ className: "mig-schema-table__th__trigger-el", onClick: onTriggerClick }, { children: _jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#404040", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, { children: _jsx("polyline", { points: "6 9 12 15 18 9" }) })) }))) : null] })));
140
140
  };
141
141
  export default React.memo(Th);
@@ -36,7 +36,7 @@ const FilterMenuComponent = ({ columnFilterValue, onChange, onInputKeyDown, prop
36
36
  ? newValue
37
37
  : undefined, persistState);
38
38
  };
39
- return (_jsxs("ol", Object.assign({ className: "schema-table-menu schema-table__th-menu__filter-menu-component" }, { children: [propIsRequired ? null : (_jsxs("li", Object.assign({ style: { padding: 8 } }, { children: [_jsxs("label", Object.assign({ className: "d-flex" }, { children: [_jsx("input", { type: "checkbox", style: { marginRight: 14 }, checked: !!numberColumnFilterValue.filterEmpty, onChange: () => {
39
+ return (_jsxs("ol", Object.assign({ className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component" }, { children: [propIsRequired ? null : (_jsxs("li", Object.assign({ style: { padding: 8 } }, { children: [_jsxs("label", Object.assign({ className: "d-flex" }, { children: [_jsx("input", { type: "checkbox", style: { marginRight: 14 }, checked: !!numberColumnFilterValue.filterEmpty, onChange: () => {
40
40
  const { filterEmpty } = numberColumnFilterValue, newNumberColumnFilterValue = __rest(numberColumnFilterValue, ["filterEmpty"]);
41
41
  if (!filterEmpty) {
42
42
  newNumberColumnFilterValue.filterEmpty = true;
@@ -57,7 +57,7 @@ const FilterMenuComponent = ({ columnFilterValue, onChange, onInputKeyDown, prop
57
57
  if (value === undefined) {
58
58
  selectValue = "";
59
59
  }
60
- return (_jsx("ol", Object.assign({ className: "schema-table-menu schema-table__th-menu__filter-menu-component" }, { children: _jsx("li", { children: _jsxs("select", Object.assign({ autoFocus: true, className: "form-select", value: selectValue, "data-prop-name": propName, onChange: (e) => {
60
+ return (_jsx("ol", Object.assign({ className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component" }, { children: _jsx("li", { children: _jsxs("select", Object.assign({ autoFocus: true, className: "form-select", value: selectValue, "data-prop-name": propName, onChange: (e) => {
61
61
  switch (e.currentTarget.value) {
62
62
  case "✓":
63
63
  onChange(true, true);
@@ -72,7 +72,7 @@ const FilterMenuComponent = ({ columnFilterValue, onChange, onInputKeyDown, prop
72
72
  // @ts-ignore
73
73
  case "string":
74
74
  if (propSchema === null || propSchema === void 0 ? void 0 : propSchema.enum) {
75
- return (_jsx("ol", Object.assign({ className: "schema-table-menu schema-table__th-menu__filter-menu-component" }, { children: _jsx("li", { children: _jsxs("select", Object.assign({ autoFocus: true, className: "form-select", value: value, "data-prop-name": propName, onChange: (e) => {
75
+ return (_jsx("ol", Object.assign({ className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component" }, { children: _jsx("li", { children: _jsxs("select", Object.assign({ autoFocus: true, className: "form-select", value: value, "data-prop-name": propName, onChange: (e) => {
76
76
  onChange(e.currentTarget.value || undefined, true);
77
77
  } }, { children: [_jsx("option", Object.assign({ value: "" }, { children: "All" }), "all"), propSchema.enum.map((value) => {
78
78
  return (_jsx("option", Object.assign({ value: value }, { children: translate(value) }), `column-filter-select-${value}`));
@@ -87,7 +87,7 @@ const FilterMenuComponent = ({ columnFilterValue, onChange, onInputKeyDown, prop
87
87
  to: undefined,
88
88
  filterEmpty: undefined,
89
89
  });
90
- return (_jsxs("ol", Object.assign({ className: "schema-table-menu schema-table__th-menu__filter-menu-component" }, { children: [propIsRequired ? null : (_jsxs("li", Object.assign({ style: { padding: 8 } }, { children: [_jsxs("label", Object.assign({ className: "d-flex" }, { children: [_jsx("input", { type: "checkbox", checked: !!dateRangeValue.filterEmpty, onChange: () => {
90
+ return (_jsxs("ol", Object.assign({ className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component" }, { children: [propIsRequired ? null : (_jsxs("li", Object.assign({ style: { padding: 8 } }, { children: [_jsxs("label", Object.assign({ className: "d-flex" }, { children: [_jsx("input", { type: "checkbox", checked: !!dateRangeValue.filterEmpty, onChange: () => {
91
91
  const { filterEmpty } = dateRangeValue, newDateRangeValue = __rest(dateRangeValue, ["filterEmpty"]);
92
92
  if (!filterEmpty) {
93
93
  newDateRangeValue.filterEmpty = true;
@@ -122,7 +122,7 @@ const FilterMenuComponent = ({ columnFilterValue, onChange, onInputKeyDown, prop
122
122
  }
123
123
  // falls through
124
124
  default:
125
- return (_jsx("ol", Object.assign({ className: "schema-table-menu schema-table__th-menu__filter-menu-component" }, { children: _jsx("li", { children: _jsx("input", { autoFocus: true, type: "text", className: "form-control", placeholder: `Search ${propName}`, "aria-label": `Search ${propName}`, value: (value || ""), "data-prop-name": propName, onChange: (e) => {
125
+ return (_jsx("ol", Object.assign({ className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component" }, { children: _jsx("li", { children: _jsx("input", { autoFocus: true, type: "text", className: "form-control", placeholder: `Search ${propName}`, "aria-label": `Search ${propName}`, value: (value || ""), "data-prop-name": propName, onChange: (e) => {
126
126
  onChange(e.currentTarget.value || undefined, false);
127
127
  }, onKeyDown: onInputKeyDown, onBlur: (e) => {
128
128
  onChange(e.currentTarget.value || undefined, true);
@@ -49,8 +49,8 @@ const ThMenu = ({ isSortable, isFilterable, onChange, onClose, onInputKeyDown, p
49
49
  if (!isSortable && !isFilterable) {
50
50
  return null;
51
51
  }
52
- return (_jsxs(_Fragment, { children: [_jsx("div", Object.assign({ className: "schema-table__th-menu", ref: setMenu, style: menuPopper.styles.popper }, menuPopper.attributes.popper, { children: _jsxs("ol", Object.assign({ className: "schema-table-menu" }, { children: [isSortable ? (_jsxs("li", Object.assign({ onClick: onSortAscendingClick, style: { padding: 8 } }, { children: [_jsx("span", Object.assign({ className: "schema-table__th-menu__icon" }, { children: "\u2193" })), " Sort ascending"] }))) : null, isSortable ? (_jsxs("li", Object.assign({ onClick: onSortDescendingClick, style: { padding: 8 } }, { children: [_jsx("span", Object.assign({ className: "schema-table__th-menu__icon" }, { children: "\u2191" })), " Sort descending"] }))) : null, isFilterable ? (_jsxs("li", Object.assign({ style: { padding: 8 }, onMouseOver: (e) => {
52
+ return (_jsxs(_Fragment, { children: [_jsx("div", Object.assign({ className: "mig-schema-table__th-menu", ref: setMenu, style: menuPopper.styles.popper }, menuPopper.attributes.popper, { children: _jsxs("ol", Object.assign({ className: "mig-schema-table-menu" }, { children: [isSortable ? (_jsxs("li", Object.assign({ onClick: onSortAscendingClick, style: { padding: 8 } }, { children: [_jsx("span", Object.assign({ className: "mig-schema-table__th-menu__icon" }, { children: "\u2193" })), " Sort ascending"] }))) : null, isSortable ? (_jsxs("li", Object.assign({ onClick: onSortDescendingClick, style: { padding: 8 } }, { children: [_jsx("span", Object.assign({ className: "mig-schema-table__th-menu__icon" }, { children: "\u2191" })), " Sort descending"] }))) : null, isFilterable ? (_jsxs("li", Object.assign({ style: { padding: 8 }, onMouseOver: (e) => {
53
53
  setSubMenuReferenceElement(e.currentTarget);
54
- } }, { children: [_jsx("span", Object.assign({ className: "schema-table__th-menu__icon" }, { children: _jsx("input", { type: "checkbox", id: "schema-table__th-menu__filters", checked: value !== undefined, disabled: value === undefined, onChange: onFilterCheckboxChange }) })), _jsx("label", Object.assign({ htmlFor: "schema-table__th-menu__filters" }, { children: "Filters" })), _jsx("div", Object.assign({ className: "schema-table__th-menu__sub-menu-indicator" }, { children: ">" }))] }))) : null] })) })), subMenuReferenceElement ? (_jsx("div", Object.assign({ className: "schema-table__th-menu__sub-menu", ref: setSubMenu, style: subMenuPopper.styles.popper }, subMenuPopper.attributes.popper, { children: _jsx(FilterMenu, { columnFilterValue: value, onChange: onChange, onInputKeyDown: onInputKeyDown, propIsRequired: propIsRequired, propName: propName, propSchema: propSchema, translate: translate }) }))) : null] }));
54
+ } }, { children: [_jsx("span", Object.assign({ className: "mig-schema-table__th-menu__icon" }, { children: _jsx("input", { type: "checkbox", id: "mig-schema-table__th-menu__filters", checked: value !== undefined, disabled: value === undefined, onChange: onFilterCheckboxChange }) })), _jsx("label", Object.assign({ htmlFor: "mig-schema-table__th-menu__filters" }, { children: "Filters" })), _jsx("div", { className: "mig-schema-table__th-menu__sub-menu-indicator" })] }))) : null] })) })), subMenuReferenceElement ? (_jsx("div", Object.assign({ className: "mig-schema-table__th-menu__sub-menu", ref: setSubMenu, style: subMenuPopper.styles.popper }, subMenuPopper.attributes.popper, { children: _jsx(FilterMenu, { columnFilterValue: value, onChange: onChange, onInputKeyDown: onInputKeyDown, propIsRequired: propIsRequired, propName: propName, propSchema: propSchema, translate: translate }) }))) : null] }));
55
55
  };
56
56
  export default React.memo(ThMenu);
@@ -577,7 +577,7 @@ function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, custo
577
577
  refreshData();
578
578
  }
579
579
  if (onSearchEnter &&
580
- e.currentTarget.className === "schema-table__search") {
580
+ e.currentTarget.className === "mig-schema-table__search") {
581
581
  onSearchEnter(searchQuery);
582
582
  }
583
583
  }
@@ -701,7 +701,7 @@ function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, custo
701
701
  localStorage.removeItem(`${settingsStorageKey}.columnWidths`);
702
702
  setColumnWidths(undefined);
703
703
  }, [settingsStorageKey]);
704
- return (_jsxs("div", Object.assign({ className: `schema-table${onRowClick ? " schema-table--clickable-rows" : ""}`, style: Object.assign(Object.assign({}, style), { width: Math.min(rowWidth, width) }), role: "table" }, { children: [_jsxs("div", Object.assign({ className: "schema-table__action-container" }, { children: [_jsx("div", { children: isSearchable ? (_jsx("input", { className: "schema-table__search", type: "text", name: "search", autoComplete: "off", placeholder: searchPlaceholder || "Search...", value: searchQuery, onChange: onSearchChange, onKeyDown: onInputKeyDown, autoFocus: enableAutoFocus, onBlur: onSearchBlur })) : null }), customElement || (_jsx("div", { className: "schema-table__custom_element_placeholder" })), enableRowCounter ? (_jsx("span", Object.assign({ className: "schema-table__row_counter" }, { children: translate("showingFilteredCountOfTotalCount", (sortedRenderData === null || sortedRenderData === void 0 ? void 0 : sortedRenderData.length) || 0, data.length) }))) : null, isExportable ? (_jsx("button", Object.assign({ onClick: onExportDataClick, style: { marginLeft: 8 }, disabled: !(sortedRenderData === null || sortedRenderData === void 0 ? void 0 : sortedRenderData.length) }, { children: translate("exportData") }))) : null, isSearchable || isColumnFilterable ? (_jsx("button", Object.assign({ onClick: onClearFiltersButtonClick, style: { marginLeft: 8 }, disabled: Object.keys(columnFilterMap).length + searchQuery.length === 0 }, { children: translate("clearFilters") }))) : null, settingsStorageKey ? (_jsx("button", Object.assign({ onClick: onClearSettingsButtonClick, style: { marginLeft: 8 }, disabled: !serializedStoredColumnNames && !serializedStoredColumnWidths }, { children: translate("clearSettings") }))) : null] })), columnNames && columnWidths ? (_jsxs("div", Object.assign({ className: "schema-table__column_resize_container" }, { children: [_jsx(Heading, Object.assign({ height: 50, itemCount: columnCount, itemSize: getColumnWidth, layout: "horizontal", width: rowWidth, sortAsc: sortAsc, setSortAsc: onSetSortAsc, setSortColumn: onSetSortColumn, sortColumn: sortColumn, sortedRenderData: sortedRenderData, className: "schema-table__th-row" }, { children: ConfiguredTh }), `thead_${rowWidth}_${sortColumn}_${sortAsc}_${searchQuery}_${columnWidths.join(" ")}`), sourceData && !isDirty ? (_jsx(VariableSizeGrid, Object.assign({ className: "schema-table__tbody", height: tableBodyHeight, width: rowWidth, columnWidth: getColumnWidth, rowHeight: getRowHeight, columnCount: columnCount, rowCount: rowCount, ref: tableRef }, { children: SchemaTableTd }), `tbody_${tableBodyHeight}_${rowWidth}_${sortColumn}_${sortAsc}_${searchQuery}_${columnCount}_${columnWidths.join(" ")}`)) : (_jsx("div", Object.assign({ style: {
704
+ return (_jsxs("div", Object.assign({ className: `mig-schema-table${onRowClick ? " mig-schema-table--clickable-rows" : ""}`, style: Object.assign(Object.assign({}, style), { width: Math.min(rowWidth, width) }), role: "table" }, { children: [_jsxs("div", Object.assign({ className: "mig-schema-table__action-container" }, { children: [_jsx("div", { children: isSearchable ? (_jsx("input", { className: "mig-schema-table__search", type: "text", name: "search", autoComplete: "off", placeholder: searchPlaceholder || "Search...", value: searchQuery, onChange: onSearchChange, onKeyDown: onInputKeyDown, autoFocus: enableAutoFocus, onBlur: onSearchBlur })) : null }), customElement || (_jsx("div", { className: "mig-schema-table__custom_element_placeholder" })), enableRowCounter ? (_jsx("span", Object.assign({ className: "mig-schema-table__row_counter" }, { children: translate("showingFilteredCountOfTotalCount", (sortedRenderData === null || sortedRenderData === void 0 ? void 0 : sortedRenderData.length) || 0, data.length) }))) : null, isExportable ? (_jsx("button", Object.assign({ onClick: onExportDataClick, style: { marginLeft: 8 }, disabled: !(sortedRenderData === null || sortedRenderData === void 0 ? void 0 : sortedRenderData.length) }, { children: translate("exportData") }))) : null, isSearchable || isColumnFilterable ? (_jsx("button", Object.assign({ onClick: onClearFiltersButtonClick, style: { marginLeft: 8 }, disabled: Object.keys(columnFilterMap).length + searchQuery.length === 0 }, { children: translate("clearFilters") }))) : null, settingsStorageKey ? (_jsx("button", Object.assign({ onClick: onClearSettingsButtonClick, style: { marginLeft: 8 }, disabled: !serializedStoredColumnNames && !serializedStoredColumnWidths }, { children: translate("clearSettings") }))) : null] })), columnNames && columnWidths ? (_jsxs("div", Object.assign({ className: "mig-schema-table__column_resize_container" }, { children: [_jsx(Heading, Object.assign({ height: 50, itemCount: columnCount, itemSize: getColumnWidth, layout: "horizontal", width: rowWidth, sortAsc: sortAsc, setSortAsc: onSetSortAsc, setSortColumn: onSetSortColumn, sortColumn: sortColumn, sortedRenderData: sortedRenderData, className: "mig-schema-table__th-row" }, { children: ConfiguredTh }), `thead_${rowWidth}_${sortColumn}_${sortAsc}_${searchQuery}_${columnWidths.join(" ")}`), sourceData && !isDirty ? (_jsx(VariableSizeGrid, Object.assign({ className: "mig-schema-table__tbody", height: tableBodyHeight, width: rowWidth, columnWidth: getColumnWidth, rowHeight: getRowHeight, columnCount: columnCount, rowCount: rowCount, ref: tableRef }, { children: SchemaTableTd }), `tbody_${tableBodyHeight}_${rowWidth}_${sortColumn}_${sortAsc}_${searchQuery}_${columnCount}_${columnWidths.join(" ")}`)) : (_jsx("div", Object.assign({ style: {
705
705
  width: rowWidth,
706
706
  height: Math.max(50, tableBodyHeight),
707
707
  border: "1px solid #BBB",
package/dist/index.css CHANGED
@@ -1,58 +1,58 @@
1
- .schema-table,
2
- .schema-table * {
1
+ .mig-schema-table,
2
+ .mig-schema-table * {
3
3
  box-sizing: border-box;
4
4
  }
5
- .schema-table button {
5
+ .mig-schema-table button {
6
6
  border: 1px solid #e4e4e4;
7
7
  padding: 8px;
8
8
  }
9
- .schema-table button:enabled {
9
+ .mig-schema-table button:enabled {
10
10
  background-color: #f6f6f6;
11
11
  color: #404040;
12
12
  }
13
- .schema-table button:enabled:hover {
13
+ .mig-schema-table button:enabled:hover {
14
14
  border-color: #dbdbdb;
15
15
  background-color: #ececec;
16
16
  }
17
- .schema-table input {
17
+ .mig-schema-table input {
18
18
  padding: 8px;
19
19
  border: 1px solid #888;
20
20
  }
21
- .schema-table input:hover {
21
+ .mig-schema-table input:hover {
22
22
  border-color: lightblue;
23
23
  }
24
- .schema-table select {
24
+ .mig-schema-table select {
25
25
  height: 33px;
26
26
  }
27
- .schema-table__custom_element_placeholder {
27
+ .mig-schema-table__custom_element_placeholder {
28
28
  flex: 1;
29
29
  }
30
- .schema-table__tbody {
30
+ .mig-schema-table__tbody {
31
31
  overflow-x: hidden !important;
32
32
  border-collapse: collapse;
33
33
  width: 100%;
34
34
  }
35
- .schema-table__th-row {
35
+ .mig-schema-table__th-row {
36
36
  overflow: hidden !important;
37
37
  }
38
- .schema-table--clickable-rows .schema-table__td {
38
+ .mig-schema-table--clickable-rows .mig-schema-table__td {
39
39
  cursor: pointer;
40
40
  }
41
- .schema-table__action-container {
41
+ .mig-schema-table__action-container {
42
42
  display: flex;
43
43
  flex-direction: row;
44
44
  padding-bottom: 1rem;
45
45
  align-items: center;
46
46
  }
47
- .schema-table__row_counter {
47
+ .mig-schema-table__row_counter {
48
48
  margin-left: 8px;
49
49
  font-size: 0.835rem;
50
50
  }
51
- .schema-table__column_resize_container {
51
+ .mig-schema-table__column_resize_container {
52
52
  position: relative;
53
53
  }
54
54
 
55
- .schema-table__th {
55
+ .mig-schema-table__th {
56
56
  background-color: #fcfcfc;
57
57
  border-right: 1px solid #ddd;
58
58
  border-top: 1px solid #ddd;
@@ -64,45 +64,45 @@
64
64
  padding-right: 8px;
65
65
  user-select: none;
66
66
  }
67
- .schema-table__th:first-child {
67
+ .mig-schema-table__th:first-child {
68
68
  border-left: 1px solid #ddd;
69
69
  }
70
- .schema-table__th div {
70
+ .mig-schema-table__th div {
71
71
  overflow: hidden;
72
72
  white-space: nowrap;
73
73
  text-overflow: ellipsis;
74
74
  }
75
- .schema-table__th--sorted {
75
+ .mig-schema-table__th--sorted {
76
76
  background-color: #eff6fb;
77
77
  }
78
- .schema-table__th--dragging {
78
+ .mig-schema-table__th--dragging {
79
79
  opacity: 0.5;
80
80
  }
81
- .schema-table__th--dragging .schema-table__th__trigger-el {
81
+ .mig-schema-table__th--dragging .mig-schema-table__th__trigger-el {
82
82
  display: none !important;
83
83
  }
84
- .schema-table__th--drop-target {
84
+ .mig-schema-table__th--drop-target {
85
85
  border-right: 3px dashed green;
86
86
  }
87
- .schema-table__th--drop-target .schema-table__th__trigger-el {
87
+ .mig-schema-table__th--drop-target .mig-schema-table__th__trigger-el {
88
88
  display: none !important;
89
89
  }
90
- .schema-table__th--filter-ACTIVE .schema-table__th__label-body-text {
90
+ .mig-schema-table__th--filter-ACTIVE .mig-schema-table__th__label-body-text {
91
91
  text-decoration: underline;
92
92
  font-style: italic;
93
93
  }
94
- .schema-table__th__label-body {
94
+ .mig-schema-table__th__label-body {
95
95
  display: flex;
96
96
  flex: 1;
97
97
  font-size: 14px;
98
98
  align-items: center;
99
99
  }
100
- .schema-table__th__label-body-text {
100
+ .mig-schema-table__th__label-body-text {
101
101
  overflow: hidden;
102
102
  white-space: nowrap;
103
103
  text-overflow: ellipsis;
104
104
  }
105
- .schema-table__th__trigger-el {
105
+ .mig-schema-table__th__trigger-el {
106
106
  display: none;
107
107
  position: absolute;
108
108
  border: 1px solid #ddd;
@@ -117,66 +117,66 @@
117
117
  text-align: center;
118
118
  padding: 5px 0 0 !important;
119
119
  }
120
- .schema-table__th__sort-icon {
120
+ .mig-schema-table__th__sort-icon {
121
121
  font-size: 24px;
122
122
  width: 32px;
123
123
  display: block;
124
124
  text-align: center;
125
125
  }
126
- .schema-table__th:hover {
126
+ .mig-schema-table__th:hover {
127
127
  background-color: #eff6fb;
128
128
  }
129
- .schema-table__th:hover .schema-table__th__trigger-el {
129
+ .mig-schema-table__th:hover .mig-schema-table__th__trigger-el {
130
130
  display: block !important;
131
131
  }
132
- .schema-table__th svg {
132
+ .mig-schema-table__th svg {
133
133
  vertical-align: baseline;
134
134
  }
135
135
 
136
- .schema-table__th-menu {
136
+ .mig-schema-table__th-menu {
137
137
  background-color: white;
138
138
  z-index: 99999;
139
139
  }
140
- .schema-table__th-menu label {
140
+ .mig-schema-table__th-menu label {
141
141
  flex: 1;
142
142
  }
143
- .schema-table__th-menu .schema-table__th-menu__sub-menu-indicator {
143
+ .mig-schema-table__th-menu .mig-schema-table__th-menu__sub-menu-indicator {
144
144
  padding-left: 8px;
145
145
  margin-left: 8px;
146
146
  }
147
- .schema-table__th-menu__icon {
147
+ .mig-schema-table__th-menu__icon {
148
148
  display: block;
149
149
  width: 24px;
150
150
  overflow: hidden;
151
151
  text-align: center;
152
152
  }
153
153
 
154
- .schema-table__th-menu__sub-menu {
154
+ .mig-schema-table__th-menu__sub-menu {
155
155
  background-color: white;
156
156
  border: 1px solid #ddd;
157
157
  z-index: 99999;
158
158
  }
159
159
 
160
- .schema-table-menu {
160
+ .mig-schema-table-menu {
161
161
  font-size: 14px;
162
162
  list-style: none outside;
163
163
  padding: 0;
164
164
  margin: 0;
165
165
  }
166
- .schema-table-menu li {
166
+ .mig-schema-table-menu li {
167
167
  display: flex;
168
168
  border: 1px solid #ddd;
169
169
  align-items: center;
170
170
  cursor: pointer;
171
171
  }
172
- .schema-table-menu li .react-datepicker {
172
+ .mig-schema-table-menu li .react-datepicker {
173
173
  width: 20.5rem;
174
174
  }
175
- .schema-table-menu li:hover {
175
+ .mig-schema-table-menu li:hover {
176
176
  background-color: #eff6fb;
177
177
  }
178
178
 
179
- .schema-table__td {
179
+ .mig-schema-table__td {
180
180
  overflow: hidden;
181
181
  white-space: nowrap;
182
182
  text-overflow: ellipsis;
@@ -184,17 +184,17 @@
184
184
  padding-right: 8px;
185
185
  align-content: center;
186
186
  }
187
- .schema-table__td--odd {
187
+ .mig-schema-table__td--odd {
188
188
  background-color: var(--bs-gray-100, #f8f9fa);
189
189
  }
190
- .schema-table__td--even {
190
+ .mig-schema-table__td--even {
191
191
  background-color: var(--bs-white, #fff);
192
192
  }
193
- .schema-table__td--selected {
193
+ .mig-schema-table__td--selected {
194
194
  background-color: var(--bs-gray-300, #dee2e6);
195
195
  }
196
196
 
197
- .schema-table__column_resizer {
197
+ .mig-schema-table__column_resizer {
198
198
  position: absolute;
199
199
  top: 0;
200
200
  user-select: none;
@@ -202,7 +202,7 @@
202
202
  cursor: e-resize;
203
203
  width: 3px;
204
204
  }
205
- .schema-table__column_resizer--dragged, .schema-table__column_resizer:hover {
205
+ .mig-schema-table__column_resizer--dragged, .mig-schema-table__column_resizer:hover {
206
206
  background-color: #bbb;
207
207
  bottom: 0 !important;
208
208
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mig-schema-table",
3
- "version": "3.0.121",
3
+ "version": "3.0.122",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/"
@@ -30,12 +30,15 @@
30
30
  "build": "rm -rf dist; tsc -p tsconfig.json; sass --no-source-map src/component/index.scss dist/index.css",
31
31
  "prepublishOnly": "npm run build",
32
32
  "start": "react-scripts start",
33
- "test": "react-scripts test"
33
+ "test": "react-scripts test",
34
+ "storybook": "storybook dev -p 6006",
35
+ "build-storybook": "storybook build"
34
36
  },
35
37
  "eslintConfig": {
36
38
  "extends": [
37
39
  "react-app",
38
- "react-app/jest"
40
+ "react-app/jest",
41
+ "plugin:storybook/recommended"
39
42
  ]
40
43
  },
41
44
  "browserslist": {
@@ -51,6 +54,16 @@
51
54
  ]
52
55
  },
53
56
  "devDependencies": {
57
+ "@chromatic-com/storybook": "^1.3.3",
58
+ "@storybook/addon-essentials": "^8.0.8",
59
+ "@storybook/addon-interactions": "^8.0.8",
60
+ "@storybook/addon-links": "^8.0.8",
61
+ "@storybook/addon-onboarding": "^8.0.8",
62
+ "@storybook/blocks": "^8.0.8",
63
+ "@storybook/preset-create-react-app": "^8.0.8",
64
+ "@storybook/react": "^8.0.8",
65
+ "@storybook/react-webpack5": "^8.0.8",
66
+ "@storybook/test": "^8.0.8",
54
67
  "@testing-library/jest-dom": "^5.16.5",
55
68
  "@testing-library/react": "^13.4.0",
56
69
  "@types/date-fns": "^2.6.0",
@@ -58,9 +71,13 @@
58
71
  "@types/node": "^20.12.5",
59
72
  "@types/react-window": "^1.8.5",
60
73
  "axios": "^1.4.0",
74
+ "eslint-plugin-storybook": "^0.8.0",
61
75
  "prettier": "^2.8.8",
76
+ "prop-types": "^15.8.1",
62
77
  "react-router-dom": "^6.11.2",
63
78
  "sass": "^1.62.1",
64
- "typescript": "^4.9.5"
79
+ "storybook": "^8.0.8",
80
+ "typescript": "^4.9.5",
81
+ "webpack": "^5.91.0"
65
82
  }
66
83
  }