mig-schema-table 3.0.120 → 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) {
@@ -84,7 +84,7 @@ const Th = ({ columnFilterStatus, isAllChecked, isSortable, numberOfSelectedRows
84
84
  e.dataTransfer.dropEffect = "move";
85
85
  e.dataTransfer.setData("text/plain", propName);
86
86
  }, [onColumnPositionChange, propName]);
87
- const onDragEnd = React.useCallback((e) => {
87
+ const onDragEnd = React.useCallback(() => {
88
88
  if (!onColumnPositionChange) {
89
89
  return;
90
90
  }
@@ -108,7 +108,7 @@ const Th = ({ columnFilterStatus, isAllChecked, isSortable, numberOfSelectedRows
108
108
  return;
109
109
  }
110
110
  const sourcePropName = e.dataTransfer.getData("text/plain");
111
- if (!sourcePropName) {
111
+ if (!sourcePropName || sourcePropName === propName) {
112
112
  return;
113
113
  }
114
114
  onColumnPositionChange(sourcePropName, propName);
@@ -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 }, { children: [_jsxs("div", Object.assign({ className: "schema-table__th__label-body", style: { lineHeight: "44px" }, onClick: onLabelClick, draggable: true, onDragStart: onDragStart, onDragEnd: onDragEnd, onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop }, { 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,57 +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
+ margin-left: 8px;
48
49
  font-size: 0.835rem;
49
50
  }
50
- .schema-table__column_resize_container {
51
+ .mig-schema-table__column_resize_container {
51
52
  position: relative;
52
53
  }
53
54
 
54
- .schema-table__th {
55
+ .mig-schema-table__th {
55
56
  background-color: #fcfcfc;
56
57
  border-right: 1px solid #ddd;
57
58
  border-top: 1px solid #ddd;
@@ -63,45 +64,45 @@
63
64
  padding-right: 8px;
64
65
  user-select: none;
65
66
  }
66
- .schema-table__th:first-child {
67
+ .mig-schema-table__th:first-child {
67
68
  border-left: 1px solid #ddd;
68
69
  }
69
- .schema-table__th div {
70
+ .mig-schema-table__th div {
70
71
  overflow: hidden;
71
72
  white-space: nowrap;
72
73
  text-overflow: ellipsis;
73
74
  }
74
- .schema-table__th--sorted {
75
+ .mig-schema-table__th--sorted {
75
76
  background-color: #eff6fb;
76
77
  }
77
- .schema-table__th--dragging {
78
+ .mig-schema-table__th--dragging {
78
79
  opacity: 0.5;
79
80
  }
80
- .schema-table__th--dragging .schema-table__th__trigger-el {
81
+ .mig-schema-table__th--dragging .mig-schema-table__th__trigger-el {
81
82
  display: none !important;
82
83
  }
83
- .schema-table__th--drop-target {
84
+ .mig-schema-table__th--drop-target {
84
85
  border-right: 3px dashed green;
85
86
  }
86
- .schema-table__th--drop-target .schema-table__th__trigger-el {
87
+ .mig-schema-table__th--drop-target .mig-schema-table__th__trigger-el {
87
88
  display: none !important;
88
89
  }
89
- .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 {
90
91
  text-decoration: underline;
91
92
  font-style: italic;
92
93
  }
93
- .schema-table__th__label-body {
94
+ .mig-schema-table__th__label-body {
94
95
  display: flex;
95
96
  flex: 1;
96
97
  font-size: 14px;
97
98
  align-items: center;
98
99
  }
99
- .schema-table__th__label-body-text {
100
+ .mig-schema-table__th__label-body-text {
100
101
  overflow: hidden;
101
102
  white-space: nowrap;
102
103
  text-overflow: ellipsis;
103
104
  }
104
- .schema-table__th__trigger-el {
105
+ .mig-schema-table__th__trigger-el {
105
106
  display: none;
106
107
  position: absolute;
107
108
  border: 1px solid #ddd;
@@ -116,66 +117,66 @@
116
117
  text-align: center;
117
118
  padding: 5px 0 0 !important;
118
119
  }
119
- .schema-table__th__sort-icon {
120
+ .mig-schema-table__th__sort-icon {
120
121
  font-size: 24px;
121
122
  width: 32px;
122
123
  display: block;
123
124
  text-align: center;
124
125
  }
125
- .schema-table__th:hover {
126
+ .mig-schema-table__th:hover {
126
127
  background-color: #eff6fb;
127
128
  }
128
- .schema-table__th:hover .schema-table__th__trigger-el {
129
+ .mig-schema-table__th:hover .mig-schema-table__th__trigger-el {
129
130
  display: block !important;
130
131
  }
131
- .schema-table__th svg {
132
+ .mig-schema-table__th svg {
132
133
  vertical-align: baseline;
133
134
  }
134
135
 
135
- .schema-table__th-menu {
136
+ .mig-schema-table__th-menu {
136
137
  background-color: white;
137
138
  z-index: 99999;
138
139
  }
139
- .schema-table__th-menu label {
140
+ .mig-schema-table__th-menu label {
140
141
  flex: 1;
141
142
  }
142
- .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 {
143
144
  padding-left: 8px;
144
145
  margin-left: 8px;
145
146
  }
146
- .schema-table__th-menu__icon {
147
+ .mig-schema-table__th-menu__icon {
147
148
  display: block;
148
149
  width: 24px;
149
150
  overflow: hidden;
150
151
  text-align: center;
151
152
  }
152
153
 
153
- .schema-table__th-menu__sub-menu {
154
+ .mig-schema-table__th-menu__sub-menu {
154
155
  background-color: white;
155
156
  border: 1px solid #ddd;
156
157
  z-index: 99999;
157
158
  }
158
159
 
159
- .schema-table-menu {
160
+ .mig-schema-table-menu {
160
161
  font-size: 14px;
161
162
  list-style: none outside;
162
163
  padding: 0;
163
164
  margin: 0;
164
165
  }
165
- .schema-table-menu li {
166
+ .mig-schema-table-menu li {
166
167
  display: flex;
167
168
  border: 1px solid #ddd;
168
169
  align-items: center;
169
170
  cursor: pointer;
170
171
  }
171
- .schema-table-menu li .react-datepicker {
172
+ .mig-schema-table-menu li .react-datepicker {
172
173
  width: 20.5rem;
173
174
  }
174
- .schema-table-menu li:hover {
175
+ .mig-schema-table-menu li:hover {
175
176
  background-color: #eff6fb;
176
177
  }
177
178
 
178
- .schema-table__td {
179
+ .mig-schema-table__td {
179
180
  overflow: hidden;
180
181
  white-space: nowrap;
181
182
  text-overflow: ellipsis;
@@ -183,17 +184,17 @@
183
184
  padding-right: 8px;
184
185
  align-content: center;
185
186
  }
186
- .schema-table__td--odd {
187
+ .mig-schema-table__td--odd {
187
188
  background-color: var(--bs-gray-100, #f8f9fa);
188
189
  }
189
- .schema-table__td--even {
190
+ .mig-schema-table__td--even {
190
191
  background-color: var(--bs-white, #fff);
191
192
  }
192
- .schema-table__td--selected {
193
+ .mig-schema-table__td--selected {
193
194
  background-color: var(--bs-gray-300, #dee2e6);
194
195
  }
195
196
 
196
- .schema-table__column_resizer {
197
+ .mig-schema-table__column_resizer {
197
198
  position: absolute;
198
199
  top: 0;
199
200
  user-select: none;
@@ -201,7 +202,7 @@
201
202
  cursor: e-resize;
202
203
  width: 3px;
203
204
  }
204
- .schema-table__column_resizer--dragged, .schema-table__column_resizer:hover {
205
+ .mig-schema-table__column_resizer--dragged, .mig-schema-table__column_resizer:hover {
205
206
  background-color: #bbb;
206
207
  bottom: 0 !important;
207
208
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mig-schema-table",
3
- "version": "3.0.120",
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
  }