@helpdice/ui 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +182 -184
- package/dist/table/index.js +834 -1965
- package/esm/table/table-head.js +2 -82
- package/esm/table/table.js +77 -3
- package/package.json +1 -1
package/dist/table/index.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
+
var Select = require('components/select');
|
|
7
|
+
var Input = require('components/input');
|
|
6
8
|
var reactDom = require('react-dom');
|
|
7
9
|
|
|
8
10
|
function _interopNamespaceDefault(e) {
|
|
@@ -989,47 +991,112 @@ var useTheme = function useTheme() {
|
|
|
989
991
|
return React.useContext(ThemeContext);
|
|
990
992
|
};
|
|
991
993
|
|
|
992
|
-
var
|
|
993
|
-
var
|
|
994
|
-
|
|
994
|
+
var makeColgroup = function makeColgroup(width, columns) {
|
|
995
|
+
var unsetWidthCount = columns.filter(function (c) {
|
|
996
|
+
return !c.width;
|
|
997
|
+
}).length;
|
|
998
|
+
var customWidthTotal = columns.reduce(function (pre, current) {
|
|
999
|
+
return current.width ? pre + current.width : pre;
|
|
1000
|
+
}, 0);
|
|
1001
|
+
var averageWidth = (width - customWidthTotal) / unsetWidthCount;
|
|
1002
|
+
if (averageWidth <= 0) return /*#__PURE__*/React.createElement("colgroup", null);
|
|
1003
|
+
return /*#__PURE__*/React.createElement("colgroup", null, columns.map(function (column, index) {
|
|
1004
|
+
return /*#__PURE__*/React.createElement("col", {
|
|
1005
|
+
key: "colgroup-".concat(index),
|
|
1006
|
+
width: column.width || averageWidth
|
|
1007
|
+
});
|
|
1008
|
+
}));
|
|
1009
|
+
};
|
|
1010
|
+
var TableHead = function TableHead(props) {
|
|
995
1011
|
var theme = useTheme();
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1012
|
+
var _ref = props,
|
|
1013
|
+
columns = _ref.columns,
|
|
1014
|
+
width = _ref.width;
|
|
1015
|
+
var isScalableWidth = React.useMemo(function () {
|
|
1016
|
+
return columns.find(function (item) {
|
|
1017
|
+
return !!item.width;
|
|
1018
|
+
});
|
|
1019
|
+
}, [columns]);
|
|
1020
|
+
var colgroup = React.useMemo(function () {
|
|
1021
|
+
if (!isScalableWidth) return /*#__PURE__*/React.createElement("colgroup", null);
|
|
1022
|
+
return makeColgroup(width, columns);
|
|
1023
|
+
}, [isScalableWidth, width]);
|
|
1024
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
|
|
1025
|
+
className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
1026
|
+
}, /*#__PURE__*/React.createElement("tr", {
|
|
1027
|
+
className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
1028
|
+
}, columns.map(function (column, index) {
|
|
1029
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
1030
|
+
style: {
|
|
1031
|
+
// textAlign: `${column?.align} !important`,
|
|
1032
|
+
// paddingLeft: '0.3rem',
|
|
1033
|
+
// paddingRight: '0.3rem',
|
|
1034
|
+
// color: `${column?.color}`,
|
|
1035
|
+
whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
|
|
1036
|
+
},
|
|
1037
|
+
key: "table-th-".concat(column.prop.toString(), "-").concat(index),
|
|
1038
|
+
"data-column": column.label,
|
|
1039
|
+
className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + (column.className || "")
|
|
1040
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1041
|
+
className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + "thead-box"
|
|
1042
|
+
}, column.label, /*#__PURE__*/React.createElement("br", {
|
|
1043
|
+
className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
1044
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
1045
|
+
style: {
|
|
1046
|
+
textAlign: 'center'
|
|
1047
|
+
},
|
|
1048
|
+
className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
1049
|
+
}, column.text)));
|
|
1050
|
+
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1051
|
+
id: "134865897",
|
|
1052
|
+
dynamic: [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]
|
|
1053
|
+
}, "thead.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;font-size:inherit;}th.__jsx-style-dynamic-selector{padding:0 0.5em;font-size:calc(0.75 * var(--table-font-size));font-weight:normal;text-align:left;-webkit-letter-spacing:0;-moz-letter-spacing:0;-ms-letter-spacing:0;letter-spacing:0;vertical-align:middle;min-height:calc(2.5 * var(--table-font-size));color:".concat(theme.palette.accents_5, ";background:").concat(theme.palette.accents_1, ";border-bottom:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-radius:0;}th.__jsx-style-dynamic-selector:nth-child(1){border-bottom:1px solid ").concat(theme.palette.border, ";border-left:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-left-radius:").concat(theme.layout.radius, ";border-bottom-left-radius:").concat(theme.layout.radius, ";}th.__jsx-style-dynamic-selector:last-child{border-bottom:1px solid ").concat(theme.palette.border, ";border-right:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-right-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";}.thead-box.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-align:center;min-height:calc(2.5 * var(--table-font-size));text-transform:uppercase;}")));
|
|
1002
1054
|
};
|
|
1003
|
-
|
|
1055
|
+
TableHead.displayName = 'TableHead';
|
|
1004
1056
|
|
|
1005
|
-
var
|
|
1006
|
-
var
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1057
|
+
var TableCell = function TableCell(_ref) {
|
|
1058
|
+
var columns = _ref.columns,
|
|
1059
|
+
row = _ref.row,
|
|
1060
|
+
rowIndex = _ref.rowIndex,
|
|
1061
|
+
emptyText = _ref.emptyText,
|
|
1062
|
+
onCellClick = _ref.onCellClick;
|
|
1063
|
+
/* eslint-disable react/jsx-no-useless-fragment */
|
|
1064
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, columns.map(function (column, index) {
|
|
1065
|
+
var currentRowValue = row[column.prop];
|
|
1066
|
+
var cellValue = currentRowValue || emptyText;
|
|
1067
|
+
var shouldBeRenderElement = column.renderHandler(currentRowValue, row, rowIndex);
|
|
1068
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
1069
|
+
style: _objectSpread2({
|
|
1070
|
+
fontSize: "".concat(column === null || column === undefined ? undefined : column.fontSize),
|
|
1071
|
+
textAlign: "".concat(column === null || column === undefined ? undefined : column.align, " !important"),
|
|
1072
|
+
paddingLeft: '0.3rem',
|
|
1073
|
+
paddingRight: '0.3rem',
|
|
1074
|
+
color: "".concat(column === null || column === undefined ? undefined : column.color),
|
|
1075
|
+
whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
|
|
1076
|
+
}, currentRowValue === null || currentRowValue === undefined ? undefined : currentRowValue.style),
|
|
1077
|
+
"data-column": column.label,
|
|
1078
|
+
key: "row-td-".concat(index, "-").concat(column.prop.toString()),
|
|
1079
|
+
onClick: function onClick() {
|
|
1080
|
+
return onCellClick && onCellClick(currentRowValue, rowIndex, index);
|
|
1081
|
+
},
|
|
1082
|
+
className: column.className
|
|
1083
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1084
|
+
className: "cell"
|
|
1085
|
+
}, shouldBeRenderElement ? shouldBeRenderElement : cellValue));
|
|
1086
|
+
}));
|
|
1087
|
+
/* eslint-enable */
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
/* "use client" */
|
|
1091
|
+
|
|
1092
|
+
var defaultContext$2 = {
|
|
1093
|
+
columns: [],
|
|
1094
|
+
updateColumn: function updateColumn() {}
|
|
1095
|
+
};
|
|
1096
|
+
var TableContext = /*#__PURE__*/React.createContext(defaultContext$2);
|
|
1097
|
+
var useTableContext = function useTableContext() {
|
|
1098
|
+
return React.useContext(TableContext);
|
|
1030
1099
|
};
|
|
1031
|
-
InputIconComponent.displayName = 'GeistInputIcon';
|
|
1032
|
-
var InputIcon = /*#__PURE__*/React.memo(InputIconComponent);
|
|
1033
1100
|
|
|
1034
1101
|
/* "use client" */
|
|
1035
1102
|
|
|
@@ -1064,666 +1131,34 @@ var useClasses = function useClasses() {
|
|
|
1064
1131
|
return classes.trim();
|
|
1065
1132
|
};
|
|
1066
1133
|
|
|
1067
|
-
var
|
|
1068
|
-
var onClick = _ref.onClick,
|
|
1069
|
-
disabled = _ref.disabled,
|
|
1070
|
-
visible = _ref.visible;
|
|
1071
|
-
var theme = useTheme();
|
|
1072
|
-
var classes = useClasses('clear-icon', {
|
|
1073
|
-
visible: visible
|
|
1074
|
-
});
|
|
1075
|
-
var clickHandler = function clickHandler(event) {
|
|
1076
|
-
event.preventDefault();
|
|
1077
|
-
event.stopPropagation();
|
|
1078
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
1079
|
-
onClick && onClick(event);
|
|
1080
|
-
};
|
|
1081
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1082
|
-
onClick: clickHandler,
|
|
1083
|
-
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]]) + " " + (classes || "")
|
|
1084
|
-
}, /*#__PURE__*/React.createElement("svg", {
|
|
1085
|
-
viewBox: "0 0 24 24",
|
|
1086
|
-
stroke: "currentColor",
|
|
1087
|
-
strokeWidth: "1.5",
|
|
1088
|
-
strokeLinecap: "round",
|
|
1089
|
-
strokeLinejoin: "round",
|
|
1090
|
-
fill: "none",
|
|
1091
|
-
shapeRendering: "geometricPrecision",
|
|
1092
|
-
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]])
|
|
1093
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
1094
|
-
d: "M18 6L6 18",
|
|
1095
|
-
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]])
|
|
1096
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
1097
|
-
d: "M6 6l12 12",
|
|
1098
|
-
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]]])
|
|
1099
|
-
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1100
|
-
id: "1567030211",
|
|
1101
|
-
dynamic: [disabled ? 'not-allowed' : 'pointer', theme.palette.accents_3, disabled ? theme.palette.accents_3 : theme.palette.foreground]
|
|
1102
|
-
}, ".clear-icon.__jsx-style-dynamic-selector{box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:calc(var(--input-height) - 2px);-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;cursor:".concat(disabled ? 'not-allowed' : 'pointer', ";-webkit-transition:color 150ms ease 0s;transition:color 150ms ease 0s;margin:0;padding:0;color:").concat(theme.palette.accents_3, ";visibility:hidden;opacity:0;}.visible.__jsx-style-dynamic-selector{visibility:visible;opacity:1;}.clear-icon.__jsx-style-dynamic-selector:hover{color:").concat(disabled ? theme.palette.accents_3 : theme.palette.foreground, ";}svg.__jsx-style-dynamic-selector{color:currentColor;width:calc(var(--input-height) - 2px);height:calc(var(--input-height) - 2px);-webkit-transform:scale(0.44);-ms-transform:scale(0.44);transform:scale(0.44);}")));
|
|
1103
|
-
};
|
|
1104
|
-
var MemoInputIconClear = /*#__PURE__*/React.memo(InputIconClear);
|
|
1134
|
+
var lodash$1 = {exports: {}};
|
|
1105
1135
|
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
borderColor: palette.secondary,
|
|
1116
|
-
hoverBorder: palette.secondary
|
|
1117
|
-
},
|
|
1118
|
-
success: {
|
|
1119
|
-
color: palette.foreground,
|
|
1120
|
-
borderColor: palette.successLight,
|
|
1121
|
-
hoverBorder: palette.success
|
|
1122
|
-
},
|
|
1123
|
-
warning: {
|
|
1124
|
-
color: palette.foreground,
|
|
1125
|
-
borderColor: palette.warningLight,
|
|
1126
|
-
hoverBorder: palette.warning
|
|
1127
|
-
},
|
|
1128
|
-
error: {
|
|
1129
|
-
color: palette.error,
|
|
1130
|
-
borderColor: palette.error,
|
|
1131
|
-
hoverBorder: palette.errorDark
|
|
1132
|
-
}
|
|
1133
|
-
};
|
|
1134
|
-
if (!status) return colors["default"];
|
|
1135
|
-
return colors[status];
|
|
1136
|
-
};
|
|
1136
|
+
/**
|
|
1137
|
+
* @license
|
|
1138
|
+
* Lodash <https://lodash.com/>
|
|
1139
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
1140
|
+
* Released under MIT license <https://lodash.com/license>
|
|
1141
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
1142
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
1143
|
+
*/
|
|
1144
|
+
var lodash = lodash$1.exports;
|
|
1137
1145
|
|
|
1138
|
-
|
|
1146
|
+
var hasRequiredLodash;
|
|
1139
1147
|
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
getScaleProps: function getScaleProps() {
|
|
1146
|
-
return undefined;
|
|
1147
|
-
},
|
|
1148
|
-
getAllScaleProps: function getAllScaleProps() {
|
|
1149
|
-
return {};
|
|
1150
|
-
},
|
|
1151
|
-
SCALES: {
|
|
1152
|
-
pl: defaultDynamicLayoutPipe,
|
|
1153
|
-
pr: defaultDynamicLayoutPipe,
|
|
1154
|
-
pb: defaultDynamicLayoutPipe,
|
|
1155
|
-
pt: defaultDynamicLayoutPipe,
|
|
1156
|
-
px: defaultDynamicLayoutPipe,
|
|
1157
|
-
py: defaultDynamicLayoutPipe,
|
|
1158
|
-
mb: defaultDynamicLayoutPipe,
|
|
1159
|
-
ml: defaultDynamicLayoutPipe,
|
|
1160
|
-
mr: defaultDynamicLayoutPipe,
|
|
1161
|
-
mt: defaultDynamicLayoutPipe,
|
|
1162
|
-
mx: defaultDynamicLayoutPipe,
|
|
1163
|
-
my: defaultDynamicLayoutPipe,
|
|
1164
|
-
width: defaultDynamicLayoutPipe,
|
|
1165
|
-
height: defaultDynamicLayoutPipe,
|
|
1166
|
-
font: defaultDynamicLayoutPipe
|
|
1167
|
-
},
|
|
1168
|
-
unit: '16px'
|
|
1169
|
-
};
|
|
1170
|
-
var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$3);
|
|
1171
|
-
var useScale = function useScale() {
|
|
1172
|
-
return React.useContext(ScaleContext);
|
|
1173
|
-
};
|
|
1148
|
+
function requireLodash () {
|
|
1149
|
+
if (hasRequiredLodash) return lodash$1.exports;
|
|
1150
|
+
hasRequiredLodash = 1;
|
|
1151
|
+
(function (module, exports) {
|
|
1152
|
+
(function() {
|
|
1174
1153
|
|
|
1175
|
-
|
|
1154
|
+
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
|
1155
|
+
var undefined$1;
|
|
1176
1156
|
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
};
|
|
1180
|
-
var pickChildByProps = function pickChildByProps(children, key, value) {
|
|
1181
|
-
var target = [];
|
|
1182
|
-
var isArray = Array.isArray(value);
|
|
1183
|
-
var withoutPropChildren = React.Children.map(children, function (item) {
|
|
1184
|
-
if (! /*#__PURE__*/React.isValidElement(item)) return null;
|
|
1185
|
-
if (!item.props) return item;
|
|
1186
|
-
if (isArray) {
|
|
1187
|
-
if (value.includes(item.props[key])) {
|
|
1188
|
-
target.push(item);
|
|
1189
|
-
return null;
|
|
1190
|
-
}
|
|
1191
|
-
return item;
|
|
1192
|
-
}
|
|
1193
|
-
if (item.props[key] === value) {
|
|
1194
|
-
target.push(item);
|
|
1195
|
-
return null;
|
|
1196
|
-
}
|
|
1197
|
-
return item;
|
|
1198
|
-
});
|
|
1199
|
-
var targetChildren = target.length >= 0 ? target : undefined;
|
|
1200
|
-
return [withoutPropChildren, targetChildren];
|
|
1201
|
-
};
|
|
1202
|
-
var isBrowser = function isBrowser() {
|
|
1203
|
-
return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
1204
|
-
};
|
|
1205
|
-
var isCSSNumberValue = function isCSSNumberValue(value) {
|
|
1206
|
-
return value !== undefined && !Number.isNaN(+value);
|
|
1207
|
-
};
|
|
1157
|
+
/** Used as the semantic version number. */
|
|
1158
|
+
var VERSION = '4.17.21';
|
|
1208
1159
|
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
if (!Array.isArray(keyOrKeys)) return props[keyOrKeys];
|
|
1212
|
-
var value = undefined;
|
|
1213
|
-
var _iterator = _createForOfIteratorHelper(keyOrKeys),
|
|
1214
|
-
_step;
|
|
1215
|
-
try {
|
|
1216
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
1217
|
-
var key = _step.value;
|
|
1218
|
-
var currentValue = props[key];
|
|
1219
|
-
if (typeof currentValue !== 'undefined') {
|
|
1220
|
-
value = currentValue;
|
|
1221
|
-
}
|
|
1222
|
-
}
|
|
1223
|
-
} catch (err) {
|
|
1224
|
-
_iterator.e(err);
|
|
1225
|
-
} finally {
|
|
1226
|
-
_iterator.f();
|
|
1227
|
-
}
|
|
1228
|
-
return value;
|
|
1229
|
-
};
|
|
1230
|
-
return getScaleProps;
|
|
1231
|
-
};
|
|
1232
|
-
var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
|
|
1233
|
-
var getAllScaleProps = function getAllScaleProps() {
|
|
1234
|
-
var scaleProps = {};
|
|
1235
|
-
var _iterator2 = _createForOfIteratorHelper(ScalePropKeys),
|
|
1236
|
-
_step2;
|
|
1237
|
-
try {
|
|
1238
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
1239
|
-
var key = _step2.value;
|
|
1240
|
-
var value = props[key];
|
|
1241
|
-
if (typeof value !== 'undefined') {
|
|
1242
|
-
scaleProps[key] = value;
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
} catch (err) {
|
|
1246
|
-
_iterator2.e(err);
|
|
1247
|
-
} finally {
|
|
1248
|
-
_iterator2.f();
|
|
1249
|
-
}
|
|
1250
|
-
return scaleProps;
|
|
1251
|
-
};
|
|
1252
|
-
return getAllScaleProps;
|
|
1253
|
-
};
|
|
1254
|
-
|
|
1255
|
-
var _excluded$e = ["children"];
|
|
1256
|
-
var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
|
|
1257
|
-
if (scale === 1) return scale;
|
|
1258
|
-
var diff = Math.abs((scale - 1) / 2);
|
|
1259
|
-
return scale > 1 ? 1 + diff : 1 - diff;
|
|
1260
|
-
};
|
|
1261
|
-
var withScale = function withScale(Render) {
|
|
1262
|
-
var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1263
|
-
var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31, _ref32, _ref33;
|
|
1264
|
-
var children = _ref.children,
|
|
1265
|
-
props = _objectWithoutProperties(_ref, _excluded$e);
|
|
1266
|
-
var _useTheme = useTheme(),
|
|
1267
|
-
layout = _useTheme.layout;
|
|
1268
|
-
var paddingLeft = props.paddingLeft,
|
|
1269
|
-
pl = props.pl,
|
|
1270
|
-
paddingRight = props.paddingRight,
|
|
1271
|
-
pr = props.pr,
|
|
1272
|
-
paddingTop = props.paddingTop,
|
|
1273
|
-
pt = props.pt,
|
|
1274
|
-
paddingBottom = props.paddingBottom,
|
|
1275
|
-
pb = props.pb,
|
|
1276
|
-
marginTop = props.marginTop,
|
|
1277
|
-
mt = props.mt,
|
|
1278
|
-
marginRight = props.marginRight,
|
|
1279
|
-
mr = props.mr,
|
|
1280
|
-
marginBottom = props.marginBottom,
|
|
1281
|
-
mb = props.mb,
|
|
1282
|
-
marginLeft = props.marginLeft,
|
|
1283
|
-
ml = props.ml,
|
|
1284
|
-
px = props.px,
|
|
1285
|
-
py = props.py,
|
|
1286
|
-
mx = props.mx,
|
|
1287
|
-
my = props.my,
|
|
1288
|
-
width = props.width,
|
|
1289
|
-
height = props.height,
|
|
1290
|
-
font = props.font,
|
|
1291
|
-
w = props.w,
|
|
1292
|
-
h = props.h,
|
|
1293
|
-
margin = props.margin,
|
|
1294
|
-
padding = props.padding,
|
|
1295
|
-
_props$unit = props.unit,
|
|
1296
|
-
unit = _props$unit === undefined ? layout.unit : _props$unit,
|
|
1297
|
-
_props$scale = props.scale,
|
|
1298
|
-
scale = _props$scale === undefined ? 1 : _props$scale;
|
|
1299
|
-
var makeScaleHandler = function makeScaleHandler(attrValue) {
|
|
1300
|
-
return function (scale1x, defaultValue) {
|
|
1301
|
-
// 0 means disable scale and the default value is 0
|
|
1302
|
-
if (scale1x === 0) {
|
|
1303
|
-
scale1x = 1;
|
|
1304
|
-
defaultValue = defaultValue || 0;
|
|
1305
|
-
}
|
|
1306
|
-
var factor = reduceScaleCoefficient(scale) * scale1x;
|
|
1307
|
-
if (typeof attrValue === 'undefined') {
|
|
1308
|
-
if (typeof defaultValue !== 'undefined') return "".concat(defaultValue);
|
|
1309
|
-
return "calc(".concat(factor, " * ").concat(unit, ")");
|
|
1310
|
-
}
|
|
1311
|
-
if (!isCSSNumberValue(attrValue)) return "".concat(attrValue);
|
|
1312
|
-
var customFactor = factor * Number(attrValue);
|
|
1313
|
-
return "calc(".concat(customFactor, " * ").concat(unit, ")");
|
|
1314
|
-
};
|
|
1315
|
-
};
|
|
1316
|
-
var value = {
|
|
1317
|
-
unit: unit,
|
|
1318
|
-
SCALES: {
|
|
1319
|
-
pt: makeScaleHandler((_ref2 = (_ref3 = paddingTop !== null && paddingTop !== undefined ? paddingTop : pt) !== null && _ref3 !== undefined ? _ref3 : py) !== null && _ref2 !== undefined ? _ref2 : padding),
|
|
1320
|
-
pr: makeScaleHandler((_ref4 = (_ref5 = paddingRight !== null && paddingRight !== undefined ? paddingRight : pr) !== null && _ref5 !== undefined ? _ref5 : px) !== null && _ref4 !== undefined ? _ref4 : padding),
|
|
1321
|
-
pb: makeScaleHandler((_ref6 = (_ref7 = paddingBottom !== null && paddingBottom !== undefined ? paddingBottom : pb) !== null && _ref7 !== undefined ? _ref7 : py) !== null && _ref6 !== undefined ? _ref6 : padding),
|
|
1322
|
-
pl: makeScaleHandler((_ref8 = (_ref9 = paddingLeft !== null && paddingLeft !== undefined ? paddingLeft : pl) !== null && _ref9 !== undefined ? _ref9 : px) !== null && _ref8 !== undefined ? _ref8 : padding),
|
|
1323
|
-
px: makeScaleHandler((_ref10 = (_ref11 = (_ref12 = (_ref13 = px !== null && px !== undefined ? px : paddingLeft) !== null && _ref13 !== undefined ? _ref13 : paddingRight) !== null && _ref12 !== undefined ? _ref12 : pl) !== null && _ref11 !== undefined ? _ref11 : pr) !== null && _ref10 !== undefined ? _ref10 : padding),
|
|
1324
|
-
py: makeScaleHandler((_ref14 = (_ref15 = (_ref16 = (_ref17 = py !== null && py !== undefined ? py : paddingTop) !== null && _ref17 !== undefined ? _ref17 : paddingBottom) !== null && _ref16 !== undefined ? _ref16 : pt) !== null && _ref15 !== undefined ? _ref15 : pb) !== null && _ref14 !== undefined ? _ref14 : padding),
|
|
1325
|
-
mt: makeScaleHandler((_ref18 = (_ref19 = marginTop !== null && marginTop !== undefined ? marginTop : mt) !== null && _ref19 !== undefined ? _ref19 : my) !== null && _ref18 !== undefined ? _ref18 : margin),
|
|
1326
|
-
mr: makeScaleHandler((_ref20 = (_ref21 = marginRight !== null && marginRight !== undefined ? marginRight : mr) !== null && _ref21 !== undefined ? _ref21 : mx) !== null && _ref20 !== undefined ? _ref20 : margin),
|
|
1327
|
-
mb: makeScaleHandler((_ref22 = (_ref23 = marginBottom !== null && marginBottom !== undefined ? marginBottom : mb) !== null && _ref23 !== undefined ? _ref23 : my) !== null && _ref22 !== undefined ? _ref22 : margin),
|
|
1328
|
-
ml: makeScaleHandler((_ref24 = (_ref25 = marginLeft !== null && marginLeft !== undefined ? marginLeft : ml) !== null && _ref25 !== undefined ? _ref25 : mx) !== null && _ref24 !== undefined ? _ref24 : margin),
|
|
1329
|
-
mx: makeScaleHandler((_ref26 = (_ref27 = (_ref28 = (_ref29 = mx !== null && mx !== undefined ? mx : marginLeft) !== null && _ref29 !== undefined ? _ref29 : marginRight) !== null && _ref28 !== undefined ? _ref28 : ml) !== null && _ref27 !== undefined ? _ref27 : mr) !== null && _ref26 !== undefined ? _ref26 : margin),
|
|
1330
|
-
my: makeScaleHandler((_ref30 = (_ref31 = (_ref32 = (_ref33 = my !== null && my !== undefined ? my : marginTop) !== null && _ref33 !== undefined ? _ref33 : marginBottom) !== null && _ref32 !== undefined ? _ref32 : mt) !== null && _ref31 !== undefined ? _ref31 : mb) !== null && _ref30 !== undefined ? _ref30 : margin),
|
|
1331
|
-
width: makeScaleHandler(width !== null && width !== undefined ? width : w),
|
|
1332
|
-
height: makeScaleHandler(height !== null && height !== undefined ? height : h),
|
|
1333
|
-
font: makeScaleHandler(font)
|
|
1334
|
-
},
|
|
1335
|
-
getScaleProps: generateGetScaleProps(props),
|
|
1336
|
-
getAllScaleProps: generateGetAllScaleProps(props)
|
|
1337
|
-
};
|
|
1338
|
-
return /*#__PURE__*/React.createElement(ScaleContext.Provider, {
|
|
1339
|
-
value: value
|
|
1340
|
-
}, /*#__PURE__*/React.createElement(Render, _extends({}, props, {
|
|
1341
|
-
ref: ref
|
|
1342
|
-
}), children));
|
|
1343
|
-
});
|
|
1344
|
-
ScaleFC.displayName = "Scale".concat(Render.displayName || 'Wrapper');
|
|
1345
|
-
return ScaleFC;
|
|
1346
|
-
};
|
|
1347
|
-
|
|
1348
|
-
var _excluded$d = ["label", "labelRight", "type", "error", "htmlType", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled"];
|
|
1349
|
-
var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
1350
|
-
return _objectSpread2(_objectSpread2({}, event), {}, {
|
|
1351
|
-
target: el,
|
|
1352
|
-
currentTarget: el
|
|
1353
|
-
});
|
|
1354
|
-
};
|
|
1355
|
-
var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1356
|
-
var label = _ref.label,
|
|
1357
|
-
labelRight = _ref.labelRight,
|
|
1358
|
-
_ref$type = _ref.type,
|
|
1359
|
-
type = _ref$type === undefined ? 'default' : _ref$type,
|
|
1360
|
-
error = _ref.error,
|
|
1361
|
-
_ref$htmlType = _ref.htmlType,
|
|
1362
|
-
htmlType = _ref$htmlType === undefined ? 'text' : _ref$htmlType,
|
|
1363
|
-
icon = _ref.icon,
|
|
1364
|
-
iconRight = _ref.iconRight,
|
|
1365
|
-
_ref$iconClickable = _ref.iconClickable,
|
|
1366
|
-
iconClickable = _ref$iconClickable === undefined ? false : _ref$iconClickable,
|
|
1367
|
-
onIconClick = _ref.onIconClick,
|
|
1368
|
-
_ref$initialValue = _ref.initialValue,
|
|
1369
|
-
initialValue = _ref$initialValue === undefined ? '' : _ref$initialValue,
|
|
1370
|
-
onChange = _ref.onChange,
|
|
1371
|
-
_ref$readOnly = _ref.readOnly,
|
|
1372
|
-
readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
|
|
1373
|
-
value = _ref.value,
|
|
1374
|
-
onClearClick = _ref.onClearClick,
|
|
1375
|
-
_ref$clearable = _ref.clearable,
|
|
1376
|
-
clearable = _ref$clearable === undefined ? false : _ref$clearable,
|
|
1377
|
-
_ref$className = _ref.className,
|
|
1378
|
-
className = _ref$className === undefined ? '' : _ref$className,
|
|
1379
|
-
onBlur = _ref.onBlur,
|
|
1380
|
-
onFocus = _ref.onFocus,
|
|
1381
|
-
_ref$autoComplete = _ref.autoComplete,
|
|
1382
|
-
autoComplete = _ref$autoComplete === undefined ? 'off' : _ref$autoComplete,
|
|
1383
|
-
_ref$placeholder = _ref.placeholder,
|
|
1384
|
-
placeholder = _ref$placeholder === undefined ? '' : _ref$placeholder,
|
|
1385
|
-
children = _ref.children,
|
|
1386
|
-
_ref$disabled = _ref.disabled,
|
|
1387
|
-
disabled = _ref$disabled === undefined ? false : _ref$disabled,
|
|
1388
|
-
props = _objectWithoutProperties(_ref, _excluded$d);
|
|
1389
|
-
var theme = useTheme();
|
|
1390
|
-
var _useScale = useScale(),
|
|
1391
|
-
SCALES = _useScale.SCALES;
|
|
1392
|
-
var inputRef = React.useRef(null);
|
|
1393
|
-
React.useImperativeHandle(ref, function () {
|
|
1394
|
-
return inputRef.current;
|
|
1395
|
-
});
|
|
1396
|
-
var _useState = React.useState(initialValue),
|
|
1397
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1398
|
-
selfValue = _useState2[0],
|
|
1399
|
-
setSelfValue = _useState2[1];
|
|
1400
|
-
var _useState3 = React.useState(false),
|
|
1401
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
1402
|
-
hover = _useState4[0],
|
|
1403
|
-
setHover = _useState4[1];
|
|
1404
|
-
var isControlledComponent = React.useMemo(function () {
|
|
1405
|
-
return value !== undefined;
|
|
1406
|
-
}, [value]);
|
|
1407
|
-
var labelClasses = React.useMemo(function () {
|
|
1408
|
-
return labelRight ? 'right-label' : label ? 'left-label' : '';
|
|
1409
|
-
}, [label, labelRight]);
|
|
1410
|
-
var iconClasses = React.useMemo(function () {
|
|
1411
|
-
return iconRight ? 'right-icon' : icon ? 'left-icon' : '';
|
|
1412
|
-
}, [icon, iconRight]);
|
|
1413
|
-
var _useMemo = React.useMemo(function () {
|
|
1414
|
-
return getColors$2(theme.palette, type);
|
|
1415
|
-
}, [theme.palette, type]),
|
|
1416
|
-
color = _useMemo.color,
|
|
1417
|
-
borderColor = _useMemo.borderColor,
|
|
1418
|
-
hoverBorder = _useMemo.hoverBorder;
|
|
1419
|
-
var changeHandler = function changeHandler(event) {
|
|
1420
|
-
if (disabled || readOnly) return;
|
|
1421
|
-
setSelfValue(event.target.value);
|
|
1422
|
-
onChange && onChange(event);
|
|
1423
|
-
};
|
|
1424
|
-
var clearHandler = function clearHandler(event) {
|
|
1425
|
-
setSelfValue('');
|
|
1426
|
-
onClearClick && onClearClick(event);
|
|
1427
|
-
/* istanbul ignore next */
|
|
1428
|
-
if (!inputRef.current) return;
|
|
1429
|
-
var changeEvent = simulateChangeEvent(inputRef.current, event);
|
|
1430
|
-
changeEvent.target.value = '';
|
|
1431
|
-
onChange && onChange(changeEvent);
|
|
1432
|
-
inputRef.current.focus();
|
|
1433
|
-
};
|
|
1434
|
-
var focusHandler = function focusHandler(e) {
|
|
1435
|
-
setHover(true);
|
|
1436
|
-
onFocus && onFocus(e);
|
|
1437
|
-
};
|
|
1438
|
-
var blurHandler = function blurHandler(e) {
|
|
1439
|
-
setHover(false);
|
|
1440
|
-
onBlur && onBlur(e);
|
|
1441
|
-
};
|
|
1442
|
-
var iconClickHandler = function iconClickHandler(e) {
|
|
1443
|
-
if (disabled) return;
|
|
1444
|
-
onIconClick && onIconClick(e);
|
|
1445
|
-
};
|
|
1446
|
-
var iconProps = React.useMemo(function () {
|
|
1447
|
-
return {
|
|
1448
|
-
clickable: iconClickable,
|
|
1449
|
-
onClick: iconClickHandler
|
|
1450
|
-
};
|
|
1451
|
-
}, [iconClickable, iconClickHandler]);
|
|
1452
|
-
React.useEffect(function () {
|
|
1453
|
-
if (isControlledComponent) {
|
|
1454
|
-
setSelfValue(value);
|
|
1455
|
-
}
|
|
1456
|
-
});
|
|
1457
|
-
var controlledValue = isControlledComponent ? {
|
|
1458
|
-
value: selfValue
|
|
1459
|
-
} : {
|
|
1460
|
-
defaultValue: initialValue
|
|
1461
|
-
};
|
|
1462
|
-
var inputProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
|
|
1463
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1464
|
-
className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + "with-label"
|
|
1465
|
-
}, children && /*#__PURE__*/React.createElement(InputBlockLabel, null, children), /*#__PURE__*/React.createElement("div", {
|
|
1466
|
-
className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (useClasses('input-container', className) || "")
|
|
1467
|
-
}, label && /*#__PURE__*/React.createElement(MemoInputLabel, null, label), /*#__PURE__*/React.createElement("div", {
|
|
1468
|
-
className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (useClasses('input-wrapper', {
|
|
1469
|
-
hover: hover,
|
|
1470
|
-
disabled: disabled
|
|
1471
|
-
}, labelClasses) || "")
|
|
1472
|
-
}, icon && /*#__PURE__*/React.createElement(InputIcon, _extends({
|
|
1473
|
-
icon: icon
|
|
1474
|
-
}, iconProps)), /*#__PURE__*/React.createElement("input", _extends({
|
|
1475
|
-
type: htmlType,
|
|
1476
|
-
ref: inputRef,
|
|
1477
|
-
placeholder: placeholder,
|
|
1478
|
-
disabled: disabled,
|
|
1479
|
-
readOnly: readOnly,
|
|
1480
|
-
onFocus: focusHandler,
|
|
1481
|
-
onBlur: blurHandler,
|
|
1482
|
-
onChange: changeHandler,
|
|
1483
|
-
autoComplete: autoComplete
|
|
1484
|
-
}, inputProps, {
|
|
1485
|
-
className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || useClasses({
|
|
1486
|
-
disabled: disabled
|
|
1487
|
-
}, iconClasses) || "")
|
|
1488
|
-
})), clearable && /*#__PURE__*/React.createElement(MemoInputIconClear, {
|
|
1489
|
-
visible: Boolean(inputRef.current && inputRef.current.value !== ''),
|
|
1490
|
-
disabled: disabled || readOnly,
|
|
1491
|
-
onClick: clearHandler
|
|
1492
|
-
}), iconRight && /*#__PURE__*/React.createElement(InputIcon, _extends({
|
|
1493
|
-
icon: iconRight
|
|
1494
|
-
}, iconProps))), labelRight && /*#__PURE__*/React.createElement(MemoInputLabel, {
|
|
1495
|
-
isRight: true
|
|
1496
|
-
}, labelRight), /*#__PURE__*/React.createElement("br", {
|
|
1497
|
-
className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]])
|
|
1498
|
-
})), error && /*#__PURE__*/React.createElement("p", {
|
|
1499
|
-
style: {
|
|
1500
|
-
marginTop: 0.4,
|
|
1501
|
-
marginRight: 0,
|
|
1502
|
-
marginLeft: 0,
|
|
1503
|
-
marginBottom: '0.4rem',
|
|
1504
|
-
textAlign: 'left'
|
|
1505
|
-
},
|
|
1506
|
-
className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + "input-error"
|
|
1507
|
-
}, error), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1508
|
-
id: "1424341926",
|
|
1509
|
-
dynamic: [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]
|
|
1510
|
-
}, ".with-label.__jsx-style-dynamic-selector{display:inline-block;box-sizing:border-box;-webkit-box-align:center;--input-height:".concat(SCALES.height(2.25), ";font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, 'initial'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.input-error.__jsx-style-dynamic-selector{color:#aa4a44;}.input-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:").concat(SCALES.width(1, 'initial'), ";height:var(--input-height);}.input-wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-flex:1;-ms-flex:1;flex:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:").concat(theme.layout.radius, ";border:1px solid ").concat(borderColor, ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;}.input-wrapper.left-label.__jsx-style-dynamic-selector{border-top-left-radius:0;border-bottom-left-radius:0;}.input-wrapper.right-label.__jsx-style-dynamic-selector{border-top-right-radius:0;border-bottom-right-radius:0;}.input-wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme.palette.accents_1, ";border-color:").concat(theme.palette.accents_2, ";cursor:not-allowed;}input.disabled.__jsx-style-dynamic-selector{cursor:not-allowed;}.input-wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}input.__jsx-style-dynamic-selector{margin:0.25em 0.625em;padding:0;box-shadow:none;font-size:").concat(SCALES.font(0.875), ";background-color:transparent;border:none;color:").concat(color, ";outline:none;border-radius:0;width:100%;min-width:0;-webkit-appearance:none;}input.left-icon.__jsx-style-dynamic-selector{margin-left:0;}input.right-icon.__jsx-style-dynamic-selector{margin-right:0;}.__jsx-style-dynamic-selector::-webkit-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::-ms-reveal{display:none !important;}input.__jsx-style-dynamic-selector:-webkit-autofill,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme.palette.background, " inset !important;-webkit-text-fill-color:").concat(color, " !important;}")));
|
|
1511
|
-
});
|
|
1512
|
-
InputComponent.displayName = 'Input';
|
|
1513
|
-
var Input = withScale(InputComponent);
|
|
1514
|
-
|
|
1515
|
-
var tuple = function tuple() {
|
|
1516
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1517
|
-
args[_key] = arguments[_key];
|
|
1518
|
-
}
|
|
1519
|
-
return args;
|
|
1520
|
-
};
|
|
1521
|
-
tuple('default', 'secondary', 'success', 'warning', 'error', 'abort', 'secondary-light', 'success-light', 'warning-light', 'error-light');
|
|
1522
|
-
tuple('default', 'secondary', 'success', 'warning', 'error');
|
|
1523
|
-
tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite');
|
|
1524
|
-
tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite', 'alert', 'purple', 'violet', 'cyan');
|
|
1525
|
-
tuple('default', 'silent', 'prevent');
|
|
1526
|
-
tuple('hover', 'click');
|
|
1527
|
-
tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
|
|
1528
|
-
tuple('start', 'center', 'end', 'left', 'right');
|
|
1529
|
-
|
|
1530
|
-
var _excluded$c = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
|
|
1531
|
-
tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
|
|
1532
|
-
var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1533
|
-
var _ref$type = _ref.type,
|
|
1534
|
-
type = _ref$type === undefined ? 'default' : _ref$type,
|
|
1535
|
-
_ref$disabled = _ref.disabled,
|
|
1536
|
-
disabled = _ref$disabled === undefined ? false : _ref$disabled,
|
|
1537
|
-
_ref$readOnly = _ref.readOnly,
|
|
1538
|
-
readOnly = _ref$readOnly === undefined ? false : _ref$readOnly,
|
|
1539
|
-
onFocus = _ref.onFocus,
|
|
1540
|
-
onBlur = _ref.onBlur,
|
|
1541
|
-
_ref$className = _ref.className,
|
|
1542
|
-
className = _ref$className === undefined ? '' : _ref$className,
|
|
1543
|
-
_ref$initialValue = _ref.initialValue,
|
|
1544
|
-
initialValue = _ref$initialValue === undefined ? '' : _ref$initialValue,
|
|
1545
|
-
onChange = _ref.onChange,
|
|
1546
|
-
value = _ref.value,
|
|
1547
|
-
placeholder = _ref.placeholder,
|
|
1548
|
-
_ref$resize = _ref.resize,
|
|
1549
|
-
resize = _ref$resize === undefined ? 'none' : _ref$resize,
|
|
1550
|
-
props = _objectWithoutProperties(_ref, _excluded$c);
|
|
1551
|
-
var theme = useTheme();
|
|
1552
|
-
var _useScale = useScale(),
|
|
1553
|
-
SCALES = _useScale.SCALES;
|
|
1554
|
-
var textareaRef = React.useRef(null);
|
|
1555
|
-
React.useImperativeHandle(ref, function () {
|
|
1556
|
-
return textareaRef.current;
|
|
1557
|
-
});
|
|
1558
|
-
var isControlledComponent = React.useMemo(function () {
|
|
1559
|
-
return value !== undefined;
|
|
1560
|
-
}, [value]);
|
|
1561
|
-
var _useState = React.useState(initialValue),
|
|
1562
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1563
|
-
selfValue = _useState2[0],
|
|
1564
|
-
setSelfValue = _useState2[1];
|
|
1565
|
-
var _useState3 = React.useState(false),
|
|
1566
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
1567
|
-
hover = _useState4[0],
|
|
1568
|
-
setHover = _useState4[1];
|
|
1569
|
-
var _useMemo = React.useMemo(function () {
|
|
1570
|
-
return getColors$2(theme.palette, type);
|
|
1571
|
-
}, [theme.palette, type]),
|
|
1572
|
-
color = _useMemo.color,
|
|
1573
|
-
borderColor = _useMemo.borderColor,
|
|
1574
|
-
hoverBorder = _useMemo.hoverBorder;
|
|
1575
|
-
var classes = useClasses('wrapper', {
|
|
1576
|
-
hover: hover,
|
|
1577
|
-
disabled: disabled
|
|
1578
|
-
}, className);
|
|
1579
|
-
var changeHandler = function changeHandler(event) {
|
|
1580
|
-
if (disabled || readOnly) return;
|
|
1581
|
-
setSelfValue(event.target.value);
|
|
1582
|
-
onChange && onChange(event);
|
|
1583
|
-
};
|
|
1584
|
-
var focusHandler = function focusHandler(e) {
|
|
1585
|
-
setHover(true);
|
|
1586
|
-
onFocus && onFocus(e);
|
|
1587
|
-
};
|
|
1588
|
-
var blurHandler = function blurHandler(e) {
|
|
1589
|
-
setHover(false);
|
|
1590
|
-
onBlur && onBlur(e);
|
|
1591
|
-
};
|
|
1592
|
-
React.useEffect(function () {
|
|
1593
|
-
if (isControlledComponent) {
|
|
1594
|
-
setSelfValue(value);
|
|
1595
|
-
}
|
|
1596
|
-
});
|
|
1597
|
-
var controlledValue = isControlledComponent ? {
|
|
1598
|
-
value: selfValue
|
|
1599
|
-
} : {
|
|
1600
|
-
defaultValue: initialValue
|
|
1601
|
-
};
|
|
1602
|
-
var textareaProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
|
|
1603
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1604
|
-
className: _JSXStyle.dynamic([["12276481", [theme.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme.palette.accents_1, theme.palette.accents_2, theme.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme.palette.background]]]) + " " + (classes || "")
|
|
1605
|
-
}, /*#__PURE__*/React.createElement("textarea", _extends({
|
|
1606
|
-
ref: textareaRef,
|
|
1607
|
-
disabled: disabled,
|
|
1608
|
-
placeholder: placeholder,
|
|
1609
|
-
readOnly: readOnly,
|
|
1610
|
-
onFocus: focusHandler,
|
|
1611
|
-
onBlur: blurHandler,
|
|
1612
|
-
onChange: changeHandler
|
|
1613
|
-
}, textareaProps, {
|
|
1614
|
-
className: _JSXStyle.dynamic([["12276481", [theme.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme.palette.accents_1, theme.palette.accents_2, theme.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme.palette.background]]]) + " " + (textareaProps && textareaProps.className != null && textareaProps.className || "")
|
|
1615
|
-
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1616
|
-
id: "12276481",
|
|
1617
|
-
dynamic: [theme.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme.palette.accents_1, theme.palette.accents_2, theme.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme.palette.background]
|
|
1618
|
-
}, ".wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:".concat(theme.layout.radius, ";border:1px solid ").concat(borderColor, ";color:").concat(color, ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;min-width:12.5rem;max-width:95vw;--textarea-font-size:").concat(SCALES.font(0.875), ";--textarea-height:").concat(SCALES.height(1, 'auto'), ";width:").concat(SCALES.width(1, 'initial'), ";height:var(--textarea-height);margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}.wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme.palette.accents_1, ";border-color:").concat(theme.palette.accents_2, ";cursor:not-allowed;}textarea.__jsx-style-dynamic-selector{background-color:transparent;box-shadow:none;display:block;font-family:").concat(theme.font.sans, ";font-size:var(--textarea-font-size);width:100%;height:var(--textarea-height);border:none;outline:none;padding:").concat(SCALES.pt(0.5), " ").concat(SCALES.pr(0.5), " ").concat(SCALES.pb(0.5), " ").concat(SCALES.pl(0.5), ";resize:").concat(resize, ";}.disabled.__jsx-style-dynamic-selector>textarea.__jsx-style-dynamic-selector{cursor:not-allowed;}textarea.__jsx-style-dynamic-selector:-webkit-autofill,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme.palette.background, " inset !important;}")));
|
|
1619
|
-
});
|
|
1620
|
-
TextareaComponent.displayName = 'Textarea';
|
|
1621
|
-
var Textarea = withScale(TextareaComponent);
|
|
1622
|
-
|
|
1623
|
-
var PasswordIcon = function PasswordIcon(_ref) {
|
|
1624
|
-
var visible = _ref.visible;
|
|
1625
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
1626
|
-
viewBox: "0 0 24 24",
|
|
1627
|
-
stroke: "currentColor",
|
|
1628
|
-
strokeWidth: "1.5",
|
|
1629
|
-
strokeLinecap: "round",
|
|
1630
|
-
strokeLinejoin: "round",
|
|
1631
|
-
fill: "none",
|
|
1632
|
-
shapeRendering: "geometricPrecision",
|
|
1633
|
-
style: {
|
|
1634
|
-
color: 'currentColor'
|
|
1635
|
-
}
|
|
1636
|
-
}, !visible ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("path", {
|
|
1637
|
-
d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"
|
|
1638
|
-
}), /*#__PURE__*/React.createElement("circle", {
|
|
1639
|
-
cx: "12",
|
|
1640
|
-
cy: "12",
|
|
1641
|
-
r: "3"
|
|
1642
|
-
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("path", {
|
|
1643
|
-
d: "M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"
|
|
1644
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
1645
|
-
d: "M1 1l22 22"
|
|
1646
|
-
})));
|
|
1647
|
-
};
|
|
1648
|
-
var MemoPasswordIcon = /*#__PURE__*/React.memo(PasswordIcon);
|
|
1649
|
-
|
|
1650
|
-
var _excluded$b = ["hideToggle", "children"];
|
|
1651
|
-
var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1652
|
-
var hideToggle = _ref.hideToggle,
|
|
1653
|
-
children = _ref.children,
|
|
1654
|
-
props = _objectWithoutProperties(_ref, _excluded$b);
|
|
1655
|
-
var _useScale = useScale(),
|
|
1656
|
-
getAllScaleProps = _useScale.getAllScaleProps;
|
|
1657
|
-
var inputRef = React.useRef(null);
|
|
1658
|
-
var _useState = React.useState(false),
|
|
1659
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1660
|
-
visible = _useState2[0],
|
|
1661
|
-
setVisible = _useState2[1];
|
|
1662
|
-
React.useImperativeHandle(ref, function () {
|
|
1663
|
-
return inputRef.current;
|
|
1664
|
-
});
|
|
1665
|
-
var iconClickHandler = function iconClickHandler() {
|
|
1666
|
-
setVisible(function (v) {
|
|
1667
|
-
return !v;
|
|
1668
|
-
});
|
|
1669
|
-
/* istanbul ignore next */
|
|
1670
|
-
if (inputRef && inputRef.current) {
|
|
1671
|
-
inputRef.current.focus();
|
|
1672
|
-
}
|
|
1673
|
-
};
|
|
1674
|
-
var inputProps = React.useMemo(function () {
|
|
1675
|
-
return _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1676
|
-
ref: inputRef,
|
|
1677
|
-
iconClickable: true,
|
|
1678
|
-
onIconClick: iconClickHandler,
|
|
1679
|
-
htmlType: visible ? 'text' : 'password'
|
|
1680
|
-
});
|
|
1681
|
-
}, [props, iconClickHandler, visible, inputRef]);
|
|
1682
|
-
var icon = React.useMemo(function () {
|
|
1683
|
-
if (hideToggle) return null;
|
|
1684
|
-
return /*#__PURE__*/React.createElement(MemoPasswordIcon, {
|
|
1685
|
-
visible: visible
|
|
1686
|
-
});
|
|
1687
|
-
}, [hideToggle, visible]);
|
|
1688
|
-
return /*#__PURE__*/React.createElement(Input, _extends({
|
|
1689
|
-
iconRight: icon
|
|
1690
|
-
}, getAllScaleProps(), inputProps), children);
|
|
1691
|
-
});
|
|
1692
|
-
InputPasswordComponent.displayName = 'InputPassword';
|
|
1693
|
-
var InputPassword = withScale(InputPasswordComponent);
|
|
1694
|
-
|
|
1695
|
-
/* "use client" */
|
|
1696
|
-
Input.Textarea = Textarea;
|
|
1697
|
-
Input.Password = InputPassword;
|
|
1698
|
-
|
|
1699
|
-
var lodash$1 = {exports: {}};
|
|
1700
|
-
|
|
1701
|
-
/**
|
|
1702
|
-
* @license
|
|
1703
|
-
* Lodash <https://lodash.com/>
|
|
1704
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
1705
|
-
* Released under MIT license <https://lodash.com/license>
|
|
1706
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
1707
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
1708
|
-
*/
|
|
1709
|
-
var lodash = lodash$1.exports;
|
|
1710
|
-
|
|
1711
|
-
var hasRequiredLodash;
|
|
1712
|
-
|
|
1713
|
-
function requireLodash () {
|
|
1714
|
-
if (hasRequiredLodash) return lodash$1.exports;
|
|
1715
|
-
hasRequiredLodash = 1;
|
|
1716
|
-
(function (module, exports) {
|
|
1717
|
-
(function() {
|
|
1718
|
-
|
|
1719
|
-
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
|
1720
|
-
var undefined$1;
|
|
1721
|
-
|
|
1722
|
-
/** Used as the semantic version number. */
|
|
1723
|
-
var VERSION = '4.17.21';
|
|
1724
|
-
|
|
1725
|
-
/** Used as the size to enable large array optimizations. */
|
|
1726
|
-
var LARGE_ARRAY_SIZE = 200;
|
|
1160
|
+
/** Used as the size to enable large array optimizations. */
|
|
1161
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
1727
1162
|
|
|
1728
1163
|
/** Error message constants. */
|
|
1729
1164
|
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
|
|
@@ -18788,1233 +18223,125 @@ function requireLodash () {
|
|
|
18788
18223
|
lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
|
|
18789
18224
|
retUnwrapped = isTaker || /^find/.test(methodName);
|
|
18790
18225
|
|
|
18791
|
-
if (!lodashFunc) {
|
|
18792
|
-
return;
|
|
18793
|
-
}
|
|
18794
|
-
lodash.prototype[methodName] = function() {
|
|
18795
|
-
var value = this.__wrapped__,
|
|
18796
|
-
args = isTaker ? [1] : arguments,
|
|
18797
|
-
isLazy = value instanceof LazyWrapper,
|
|
18798
|
-
iteratee = args[0],
|
|
18799
|
-
useLazy = isLazy || isArray(value);
|
|
18800
|
-
|
|
18801
|
-
var interceptor = function(value) {
|
|
18802
|
-
var result = lodashFunc.apply(lodash, arrayPush([value], args));
|
|
18803
|
-
return (isTaker && chainAll) ? result[0] : result;
|
|
18804
|
-
};
|
|
18805
|
-
|
|
18806
|
-
if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
|
|
18807
|
-
// Avoid lazy use if the iteratee has a "length" value other than `1`.
|
|
18808
|
-
isLazy = useLazy = false;
|
|
18809
|
-
}
|
|
18810
|
-
var chainAll = this.__chain__,
|
|
18811
|
-
isHybrid = !!this.__actions__.length,
|
|
18812
|
-
isUnwrapped = retUnwrapped && !chainAll,
|
|
18813
|
-
onlyLazy = isLazy && !isHybrid;
|
|
18814
|
-
|
|
18815
|
-
if (!retUnwrapped && useLazy) {
|
|
18816
|
-
value = onlyLazy ? value : new LazyWrapper(this);
|
|
18817
|
-
var result = func.apply(value, args);
|
|
18818
|
-
result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined$1 });
|
|
18819
|
-
return new LodashWrapper(result, chainAll);
|
|
18820
|
-
}
|
|
18821
|
-
if (isUnwrapped && onlyLazy) {
|
|
18822
|
-
return func.apply(this, args);
|
|
18823
|
-
}
|
|
18824
|
-
result = this.thru(interceptor);
|
|
18825
|
-
return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
|
|
18826
|
-
};
|
|
18827
|
-
});
|
|
18828
|
-
|
|
18829
|
-
// Add `Array` methods to `lodash.prototype`.
|
|
18830
|
-
arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
|
|
18831
|
-
var func = arrayProto[methodName],
|
|
18832
|
-
chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
|
|
18833
|
-
retUnwrapped = /^(?:pop|shift)$/.test(methodName);
|
|
18834
|
-
|
|
18835
|
-
lodash.prototype[methodName] = function() {
|
|
18836
|
-
var args = arguments;
|
|
18837
|
-
if (retUnwrapped && !this.__chain__) {
|
|
18838
|
-
var value = this.value();
|
|
18839
|
-
return func.apply(isArray(value) ? value : [], args);
|
|
18840
|
-
}
|
|
18841
|
-
return this[chainName](function(value) {
|
|
18842
|
-
return func.apply(isArray(value) ? value : [], args);
|
|
18843
|
-
});
|
|
18844
|
-
};
|
|
18845
|
-
});
|
|
18846
|
-
|
|
18847
|
-
// Map minified method names to their real names.
|
|
18848
|
-
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
|
18849
|
-
var lodashFunc = lodash[methodName];
|
|
18850
|
-
if (lodashFunc) {
|
|
18851
|
-
var key = lodashFunc.name + '';
|
|
18852
|
-
if (!hasOwnProperty.call(realNames, key)) {
|
|
18853
|
-
realNames[key] = [];
|
|
18854
|
-
}
|
|
18855
|
-
realNames[key].push({ 'name': methodName, 'func': lodashFunc });
|
|
18856
|
-
}
|
|
18857
|
-
});
|
|
18858
|
-
|
|
18859
|
-
realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
|
|
18860
|
-
'name': 'wrapper',
|
|
18861
|
-
'func': undefined$1
|
|
18862
|
-
}];
|
|
18863
|
-
|
|
18864
|
-
// Add methods to `LazyWrapper`.
|
|
18865
|
-
LazyWrapper.prototype.clone = lazyClone;
|
|
18866
|
-
LazyWrapper.prototype.reverse = lazyReverse;
|
|
18867
|
-
LazyWrapper.prototype.value = lazyValue;
|
|
18868
|
-
|
|
18869
|
-
// Add chain sequence methods to the `lodash` wrapper.
|
|
18870
|
-
lodash.prototype.at = wrapperAt;
|
|
18871
|
-
lodash.prototype.chain = wrapperChain;
|
|
18872
|
-
lodash.prototype.commit = wrapperCommit;
|
|
18873
|
-
lodash.prototype.next = wrapperNext;
|
|
18874
|
-
lodash.prototype.plant = wrapperPlant;
|
|
18875
|
-
lodash.prototype.reverse = wrapperReverse;
|
|
18876
|
-
lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
|
|
18877
|
-
|
|
18878
|
-
// Add lazy aliases.
|
|
18879
|
-
lodash.prototype.first = lodash.prototype.head;
|
|
18880
|
-
|
|
18881
|
-
if (symIterator) {
|
|
18882
|
-
lodash.prototype[symIterator] = wrapperToIterator;
|
|
18883
|
-
}
|
|
18884
|
-
return lodash;
|
|
18885
|
-
});
|
|
18886
|
-
|
|
18887
|
-
/*--------------------------------------------------------------------------*/
|
|
18888
|
-
|
|
18889
|
-
// Export lodash.
|
|
18890
|
-
var _ = runInContext();
|
|
18891
|
-
|
|
18892
|
-
// Some AMD build optimizers, like r.js, check for condition patterns like:
|
|
18893
|
-
if (freeModule) {
|
|
18894
|
-
// Export for Node.js.
|
|
18895
|
-
(freeModule.exports = _)._ = _;
|
|
18896
|
-
// Export for CommonJS support.
|
|
18897
|
-
freeExports._ = _;
|
|
18898
|
-
}
|
|
18899
|
-
else {
|
|
18900
|
-
// Export to the global object.
|
|
18901
|
-
root._ = _;
|
|
18902
|
-
}
|
|
18903
|
-
}.call(lodash));
|
|
18904
|
-
} (lodash$1, lodash$1.exports));
|
|
18905
|
-
return lodash$1.exports;
|
|
18906
|
-
}
|
|
18907
|
-
|
|
18908
|
-
var lodashExports = requireLodash();
|
|
18909
|
-
var _ = /*@__PURE__*/getDefaultExportFromCjs(lodashExports);
|
|
18910
|
-
|
|
18911
|
-
var useCurrentState = function useCurrentState(initialState) {
|
|
18912
|
-
var _useState = React.useState(function () {
|
|
18913
|
-
return typeof initialState === 'function' ? initialState() : initialState;
|
|
18914
|
-
}),
|
|
18915
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
18916
|
-
state = _useState2[0],
|
|
18917
|
-
setState = _useState2[1];
|
|
18918
|
-
var ref = React.useRef(initialState);
|
|
18919
|
-
React.useEffect(function () {
|
|
18920
|
-
ref.current = state;
|
|
18921
|
-
}, [state]);
|
|
18922
|
-
var setValue = function setValue(val) {
|
|
18923
|
-
var result = typeof val === 'function' ? val(ref.current) : val;
|
|
18924
|
-
ref.current = result;
|
|
18925
|
-
setState(result);
|
|
18926
|
-
};
|
|
18927
|
-
return [state, setValue, ref];
|
|
18928
|
-
};
|
|
18929
|
-
|
|
18930
|
-
var SelectIconComponent = function SelectIconComponent() {
|
|
18931
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
18932
|
-
viewBox: "0 0 24 24",
|
|
18933
|
-
strokeWidth: "1",
|
|
18934
|
-
strokeLinecap: "round",
|
|
18935
|
-
strokeLinejoin: "round",
|
|
18936
|
-
fill: "none",
|
|
18937
|
-
shapeRendering: "geometricPrecision",
|
|
18938
|
-
className: "jsx-2742933678"
|
|
18939
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
18940
|
-
d: "M6 9l6 6 6-6",
|
|
18941
|
-
className: "jsx-2742933678"
|
|
18942
|
-
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
18943
|
-
id: "2742933678"
|
|
18944
|
-
}, "svg.jsx-2742933678{color:inherit;stroke:currentColor;-webkit-transition:all 200ms ease;transition:all 200ms ease;width:1.214em;height:1.214em;}"));
|
|
18945
|
-
};
|
|
18946
|
-
SelectIconComponent.displayName = 'GeistSelectIcon';
|
|
18947
|
-
var SelectIcon = /*#__PURE__*/React.memo(SelectIconComponent);
|
|
18948
|
-
|
|
18949
|
-
/* "use client" */
|
|
18950
|
-
|
|
18951
|
-
var defaultContext$2 = {
|
|
18952
|
-
visible: false,
|
|
18953
|
-
disableAll: false
|
|
18954
|
-
};
|
|
18955
|
-
var SelectContext = /*#__PURE__*/React.createContext(defaultContext$2);
|
|
18956
|
-
var useSelectContext = function useSelectContext() {
|
|
18957
|
-
return React.useContext(SelectContext);
|
|
18958
|
-
};
|
|
18959
|
-
|
|
18960
|
-
var useSSR = function useSSR() {
|
|
18961
|
-
var _useState = React.useState(false),
|
|
18962
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
18963
|
-
browser = _useState2[0],
|
|
18964
|
-
setBrowser = _useState2[1];
|
|
18965
|
-
React.useEffect(function () {
|
|
18966
|
-
setBrowser(isBrowser());
|
|
18967
|
-
}, []);
|
|
18968
|
-
return {
|
|
18969
|
-
isBrowser: browser,
|
|
18970
|
-
isServer: !browser
|
|
18971
|
-
};
|
|
18972
|
-
};
|
|
18973
|
-
|
|
18974
|
-
var createElement = function createElement(id) {
|
|
18975
|
-
var el = document.createElement('div');
|
|
18976
|
-
el.setAttribute('id', id);
|
|
18977
|
-
return el;
|
|
18978
|
-
};
|
|
18979
|
-
var usePortal = function usePortal() {
|
|
18980
|
-
var selectId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getId();
|
|
18981
|
-
var getContainer = arguments.length > 1 ? arguments[1] : undefined;
|
|
18982
|
-
var id = "helpdice-ui-".concat(selectId);
|
|
18983
|
-
var _useSSR = useSSR(),
|
|
18984
|
-
isBrowser = _useSSR.isBrowser;
|
|
18985
|
-
var _useState = React.useState(isBrowser ? createElement(id) : null),
|
|
18986
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
18987
|
-
elSnapshot = _useState2[0],
|
|
18988
|
-
setElSnapshot = _useState2[1];
|
|
18989
|
-
React.useEffect(function () {
|
|
18990
|
-
var customContainer = getContainer ? getContainer() : null;
|
|
18991
|
-
var parentElement = customContainer || document.body;
|
|
18992
|
-
var hasElement = parentElement.querySelector("#".concat(id));
|
|
18993
|
-
var el = hasElement || createElement(id);
|
|
18994
|
-
if (!hasElement) {
|
|
18995
|
-
parentElement.appendChild(el);
|
|
18996
|
-
}
|
|
18997
|
-
setElSnapshot(el);
|
|
18998
|
-
}, []);
|
|
18999
|
-
return elSnapshot;
|
|
19000
|
-
};
|
|
19001
|
-
|
|
19002
|
-
/* "use client" */
|
|
19003
|
-
|
|
19004
|
-
var useResize = function useResize(callback) {
|
|
19005
|
-
var immediatelyInvoke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
19006
|
-
React.useEffect(function () {
|
|
19007
|
-
var fn = function fn() {
|
|
19008
|
-
return callback();
|
|
19009
|
-
};
|
|
19010
|
-
if (immediatelyInvoke) {
|
|
19011
|
-
fn();
|
|
19012
|
-
}
|
|
19013
|
-
window.addEventListener('resize', fn);
|
|
19014
|
-
return function () {
|
|
19015
|
-
return window.removeEventListener('resize', fn);
|
|
19016
|
-
};
|
|
19017
|
-
}, []);
|
|
19018
|
-
};
|
|
19019
|
-
|
|
19020
|
-
var _excluded$a = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
|
|
19021
|
-
var CssTransition = function CssTransition(_ref) {
|
|
19022
|
-
var children = _ref.children,
|
|
19023
|
-
_ref$className = _ref.className,
|
|
19024
|
-
className = _ref$className === undefined ? '' : _ref$className,
|
|
19025
|
-
_ref$visible = _ref.visible,
|
|
19026
|
-
visible = _ref$visible === undefined ? false : _ref$visible,
|
|
19027
|
-
_ref$enterTime = _ref.enterTime,
|
|
19028
|
-
enterTime = _ref$enterTime === undefined ? 60 : _ref$enterTime,
|
|
19029
|
-
_ref$leaveTime = _ref.leaveTime,
|
|
19030
|
-
leaveTime = _ref$leaveTime === undefined ? 60 : _ref$leaveTime,
|
|
19031
|
-
_ref$clearTime = _ref.clearTime,
|
|
19032
|
-
clearTime = _ref$clearTime === undefined ? 60 : _ref$clearTime,
|
|
19033
|
-
_ref$name = _ref.name,
|
|
19034
|
-
name = _ref$name === undefined ? 'transition' : _ref$name,
|
|
19035
|
-
props = _objectWithoutProperties(_ref, _excluded$a);
|
|
19036
|
-
var _useState = React.useState(''),
|
|
19037
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
19038
|
-
classes = _useState2[0],
|
|
19039
|
-
setClasses = _useState2[1];
|
|
19040
|
-
var _useState3 = React.useState(visible),
|
|
19041
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
19042
|
-
renderable = _useState4[0],
|
|
19043
|
-
setRenderable = _useState4[1];
|
|
19044
|
-
React.useEffect(function () {
|
|
19045
|
-
var statusClassName = visible ? 'enter' : 'leave';
|
|
19046
|
-
var time = visible ? enterTime : leaveTime;
|
|
19047
|
-
if (visible && !renderable) {
|
|
19048
|
-
setRenderable(true);
|
|
19049
|
-
}
|
|
19050
|
-
setClasses("".concat(name, "-").concat(statusClassName));
|
|
19051
|
-
|
|
19052
|
-
// set class to active
|
|
19053
|
-
var timer = setTimeout(function () {
|
|
19054
|
-
setClasses("".concat(name, "-").concat(statusClassName, " ").concat(name, "-").concat(statusClassName, "-active"));
|
|
19055
|
-
clearTimeout(timer);
|
|
19056
|
-
}, time);
|
|
19057
|
-
|
|
19058
|
-
// remove classess when animation over
|
|
19059
|
-
var clearClassesTimer = setTimeout(function () {
|
|
19060
|
-
if (!visible) {
|
|
19061
|
-
setClasses('');
|
|
19062
|
-
setRenderable(false);
|
|
19063
|
-
}
|
|
19064
|
-
clearTimeout(clearClassesTimer);
|
|
19065
|
-
}, time + clearTime);
|
|
19066
|
-
return function () {
|
|
19067
|
-
clearTimeout(timer);
|
|
19068
|
-
clearTimeout(clearClassesTimer);
|
|
19069
|
-
};
|
|
19070
|
-
}, [visible, renderable]);
|
|
19071
|
-
if (! /*#__PURE__*/React.isValidElement(children) || !renderable) return null;
|
|
19072
|
-
var propsTransition = _objectSpread2(_objectSpread2({}, props), {}, {
|
|
19073
|
-
className: "".concat(children.props.className, " ").concat(className, " ").concat(classes)
|
|
19074
|
-
});
|
|
19075
|
-
return /*#__PURE__*/React.cloneElement(children, propsTransition);
|
|
19076
|
-
};
|
|
19077
|
-
CssTransition.displayName = 'CssTransition';
|
|
19078
|
-
|
|
19079
|
-
/* "use client" */
|
|
19080
|
-
|
|
19081
|
-
var useClickAnyWhere = function useClickAnyWhere(handler) {
|
|
19082
|
-
React.useEffect(function () {
|
|
19083
|
-
var callback = function callback(event) {
|
|
19084
|
-
return handler(event);
|
|
19085
|
-
};
|
|
19086
|
-
document.addEventListener('click', callback);
|
|
19087
|
-
return function () {
|
|
19088
|
-
return document.removeEventListener('click', callback);
|
|
19089
|
-
};
|
|
19090
|
-
}, [handler]);
|
|
19091
|
-
};
|
|
19092
|
-
|
|
19093
|
-
/* "use client" */
|
|
19094
|
-
|
|
19095
|
-
var useDOMObserver = function useDOMObserver(ref) {
|
|
19096
|
-
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
|
|
19097
|
-
var config = {
|
|
19098
|
-
attributes: false,
|
|
19099
|
-
childList: true,
|
|
19100
|
-
subtree: true
|
|
19101
|
-
};
|
|
19102
|
-
React.useEffect(function () {
|
|
19103
|
-
if (!ref || !ref.current) return;
|
|
19104
|
-
var unmount = false;
|
|
19105
|
-
var done = function done() {
|
|
19106
|
-
if (unmount) return;
|
|
19107
|
-
callback.apply(undefined, arguments);
|
|
19108
|
-
};
|
|
19109
|
-
var observer = new MutationObserver(done);
|
|
19110
|
-
observer.observe(ref.current, config);
|
|
19111
|
-
return function () {
|
|
19112
|
-
unmount = true;
|
|
19113
|
-
observer.disconnect();
|
|
19114
|
-
};
|
|
19115
|
-
}, [ref]);
|
|
19116
|
-
};
|
|
19117
|
-
|
|
19118
|
-
var warningStack = {};
|
|
19119
|
-
var useWarning = function useWarning(message, component) {
|
|
19120
|
-
var tag = component ? " [".concat(component, "]") : ' ';
|
|
19121
|
-
var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
|
|
19122
|
-
if (typeof console === 'undefined') return;
|
|
19123
|
-
if (warningStack[log]) return;
|
|
19124
|
-
warningStack[log] = true;
|
|
19125
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
19126
|
-
return console.error(log);
|
|
19127
|
-
}
|
|
19128
|
-
console.warn(log);
|
|
19129
|
-
};
|
|
19130
|
-
|
|
19131
|
-
var getElementOffset = function getElementOffset(el) {
|
|
19132
|
-
if (!el) return {
|
|
19133
|
-
top: 0,
|
|
19134
|
-
left: 0
|
|
19135
|
-
};
|
|
19136
|
-
var _el$getBoundingClient = el.getBoundingClientRect(),
|
|
19137
|
-
top = _el$getBoundingClient.top,
|
|
19138
|
-
left = _el$getBoundingClient.left;
|
|
19139
|
-
return {
|
|
19140
|
-
top: top,
|
|
19141
|
-
left: left
|
|
19142
|
-
};
|
|
19143
|
-
};
|
|
19144
|
-
var defaultRect$2 = {
|
|
19145
|
-
top: -1e3,
|
|
19146
|
-
left: -1e3,
|
|
19147
|
-
right: -1e3,
|
|
19148
|
-
width: 0,
|
|
19149
|
-
height: 0,
|
|
19150
|
-
elementTop: -1e3
|
|
19151
|
-
};
|
|
19152
|
-
var getRectFromDOMWithContainer = function getRectFromDOMWithContainer(domRect, getContainer) {
|
|
19153
|
-
if (!domRect) return defaultRect$2;
|
|
19154
|
-
var container = getContainer ? getContainer() : null;
|
|
19155
|
-
var scrollElement = container || document.documentElement;
|
|
19156
|
-
var _getElementOffset = getElementOffset(container),
|
|
19157
|
-
offsetTop = _getElementOffset.top,
|
|
19158
|
-
offsetLeft = _getElementOffset.left;
|
|
19159
|
-
return _objectSpread2(_objectSpread2({}, domRect), {}, {
|
|
19160
|
-
width: domRect.width || domRect.right - domRect.left,
|
|
19161
|
-
height: domRect.height || domRect.top - domRect.bottom,
|
|
19162
|
-
top: domRect.bottom + scrollElement.scrollTop - offsetTop,
|
|
19163
|
-
left: domRect.left + scrollElement.scrollLeft - offsetLeft,
|
|
19164
|
-
elementTop: domRect.top + scrollElement.scrollTop - offsetTop
|
|
19165
|
-
});
|
|
19166
|
-
};
|
|
19167
|
-
var getRefRect = function getRefRect(ref, getContainer) {
|
|
19168
|
-
if (!ref || !ref.current) return defaultRect$2;
|
|
19169
|
-
var rect = ref.current.getBoundingClientRect();
|
|
19170
|
-
return getRectFromDOMWithContainer(rect, getContainer);
|
|
19171
|
-
};
|
|
19172
|
-
|
|
19173
|
-
var defaultRect$1 = {
|
|
19174
|
-
top: -1e3,
|
|
19175
|
-
left: -1e3,
|
|
19176
|
-
right: -1e3,
|
|
19177
|
-
width: 0
|
|
19178
|
-
};
|
|
19179
|
-
var Dropdown = /*#__PURE__*/React.memo(function (_ref) {
|
|
19180
|
-
var children = _ref.children,
|
|
19181
|
-
parent = _ref.parent,
|
|
19182
|
-
visible = _ref.visible,
|
|
19183
|
-
disableMatchWidth = _ref.disableMatchWidth,
|
|
19184
|
-
getPopupContainer = _ref.getPopupContainer;
|
|
19185
|
-
var el = usePortal('dropdown', getPopupContainer);
|
|
19186
|
-
var _useState = React.useState(defaultRect$1),
|
|
19187
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
19188
|
-
rect = _useState2[0],
|
|
19189
|
-
setRect = _useState2[1];
|
|
19190
|
-
var classes = useClasses('dropdown', disableMatchWidth ? 'disable-match' : 'width-match');
|
|
19191
|
-
if (!parent) return null;
|
|
19192
|
-
|
|
19193
|
-
/* istanbul ignore next */
|
|
19194
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
19195
|
-
if (getPopupContainer && getPopupContainer()) {
|
|
19196
|
-
var _el = getPopupContainer();
|
|
19197
|
-
var style = window.getComputedStyle(_el);
|
|
19198
|
-
if (style.position === 'static') {
|
|
19199
|
-
useWarning('The element specified by "getPopupContainer" must have "position" set.');
|
|
19200
|
-
}
|
|
19201
|
-
}
|
|
19202
|
-
}
|
|
19203
|
-
var updateRect = function updateRect() {
|
|
19204
|
-
var _getRefRect = getRefRect(parent, getPopupContainer),
|
|
19205
|
-
top = _getRefRect.top,
|
|
19206
|
-
left = _getRefRect.left,
|
|
19207
|
-
right = _getRefRect.right,
|
|
19208
|
-
nativeWidth = _getRefRect.width;
|
|
19209
|
-
setRect({
|
|
19210
|
-
top: top,
|
|
19211
|
-
left: left,
|
|
19212
|
-
right: right,
|
|
19213
|
-
width: nativeWidth
|
|
19214
|
-
});
|
|
19215
|
-
};
|
|
19216
|
-
useResize(updateRect);
|
|
19217
|
-
useClickAnyWhere(function () {
|
|
19218
|
-
var _getRefRect2 = getRefRect(parent, getPopupContainer),
|
|
19219
|
-
top = _getRefRect2.top,
|
|
19220
|
-
left = _getRefRect2.left;
|
|
19221
|
-
var shouldUpdatePosition = top !== rect.top || left !== rect.left;
|
|
19222
|
-
if (!shouldUpdatePosition) return;
|
|
19223
|
-
updateRect();
|
|
19224
|
-
});
|
|
19225
|
-
useDOMObserver(parent, function () {
|
|
19226
|
-
updateRect();
|
|
19227
|
-
});
|
|
19228
|
-
React.useEffect(function () {
|
|
19229
|
-
if (!parent || !parent.current) return;
|
|
19230
|
-
parent.current.addEventListener('mouseenter', updateRect);
|
|
19231
|
-
/* istanbul ignore next */
|
|
19232
|
-
return function () {
|
|
19233
|
-
if (!parent || !parent.current) return;
|
|
19234
|
-
parent.current.removeEventListener('mouseenter', updateRect);
|
|
19235
|
-
};
|
|
19236
|
-
}, [parent]);
|
|
19237
|
-
var clickHandler = function clickHandler(event) {
|
|
19238
|
-
event.stopPropagation();
|
|
19239
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
19240
|
-
event.preventDefault();
|
|
19241
|
-
};
|
|
19242
|
-
var mouseDownHandler = function mouseDownHandler(event) {
|
|
19243
|
-
event.preventDefault();
|
|
19244
|
-
};
|
|
19245
|
-
if (!el) return null;
|
|
19246
|
-
return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React.createElement(CssTransition, {
|
|
19247
|
-
visible: visible
|
|
19248
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
19249
|
-
onClick: clickHandler,
|
|
19250
|
-
onMouseDown: mouseDownHandler,
|
|
19251
|
-
className: _JSXStyle.dynamic([["1644673105", [rect.top + 2, rect.left, rect.width, rect.width]]]) + " " + (classes || "")
|
|
19252
|
-
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19253
|
-
id: "1644673105",
|
|
19254
|
-
dynamic: [rect.top + 2, rect.left, rect.width, rect.width]
|
|
19255
|
-
}, ".dropdown.__jsx-style-dynamic-selector{position:absolute;top:".concat(rect.top + 2, "px;left:").concat(rect.left, "px;z-index:1100;}.width-match.__jsx-style-dynamic-selector{width:").concat(rect.width, "px;}.disable-match.__jsx-style-dynamic-selector{min-width:").concat(rect.width, "px;}")))), el);
|
|
19256
|
-
});
|
|
19257
|
-
|
|
19258
|
-
var SelectDropdown = /*#__PURE__*/React.forwardRef(function (_ref, dropdownRef) {
|
|
19259
|
-
var visible = _ref.visible,
|
|
19260
|
-
children = _ref.children,
|
|
19261
|
-
_ref$className = _ref.className,
|
|
19262
|
-
className = _ref$className === undefined ? '' : _ref$className,
|
|
19263
|
-
_ref$dropdownStyle = _ref.dropdownStyle,
|
|
19264
|
-
dropdownStyle = _ref$dropdownStyle === undefined ? {} : _ref$dropdownStyle,
|
|
19265
|
-
disableMatchWidth = _ref.disableMatchWidth,
|
|
19266
|
-
getPopupContainer = _ref.getPopupContainer;
|
|
19267
|
-
var theme = useTheme();
|
|
19268
|
-
var internalDropdownRef = React.useRef(null);
|
|
19269
|
-
var _useSelectContext = useSelectContext(),
|
|
19270
|
-
ref = _useSelectContext.ref;
|
|
19271
|
-
var classes = useClasses('select-dropdown', className);
|
|
19272
|
-
React.useImperativeHandle(dropdownRef, function () {
|
|
19273
|
-
return internalDropdownRef.current;
|
|
19274
|
-
});
|
|
19275
|
-
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
19276
|
-
parent: ref,
|
|
19277
|
-
visible: visible,
|
|
19278
|
-
disableMatchWidth: disableMatchWidth,
|
|
19279
|
-
getPopupContainer: getPopupContainer
|
|
19280
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
19281
|
-
ref: internalDropdownRef,
|
|
19282
|
-
style: dropdownStyle,
|
|
19283
|
-
className: _JSXStyle.dynamic([["2782510679", [theme.layout.radius, theme.expressiveness.shadowLarge, theme.palette.background]]]) + " " + (classes || "")
|
|
19284
|
-
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19285
|
-
id: "2782510679",
|
|
19286
|
-
dynamic: [theme.layout.radius, theme.expressiveness.shadowLarge, theme.palette.background]
|
|
19287
|
-
}, ".select-dropdown.__jsx-style-dynamic-selector{border-radius:".concat(theme.layout.radius, ";box-shadow:").concat(theme.expressiveness.shadowLarge, ";background-color:").concat(theme.palette.background, ";max-height:17em;overflow-y:auto;overflow-anchor:none;padding:0.38em 0;-webkit-scroll-behavior:smooth;-moz-scroll-behavior:smooth;-ms-scroll-behavior:smooth;scroll-behavior:smooth;}"))));
|
|
19288
|
-
});
|
|
19289
|
-
SelectDropdown.displayName = 'SelectDropdown';
|
|
19290
|
-
|
|
19291
|
-
var _excluded$9 = ["xs", "sm", "md", "lg", "xl", "justify", "direction", "alignItems", "alignContent", "children", "className"];
|
|
19292
|
-
var getItemLayout = function getItemLayout(val) {
|
|
19293
|
-
var display = val === 0 ? 'display: none;' : 'display: inherit;';
|
|
19294
|
-
if (typeof val === 'number') {
|
|
19295
|
-
var width = 100 / 24 * val;
|
|
19296
|
-
var ratio = width > 100 ? '100%' : width < 0 ? '0' : "".concat(width, "%");
|
|
19297
|
-
return {
|
|
19298
|
-
grow: 0,
|
|
19299
|
-
display: display,
|
|
19300
|
-
width: ratio,
|
|
19301
|
-
basis: ratio
|
|
19302
|
-
};
|
|
19303
|
-
}
|
|
19304
|
-
return {
|
|
19305
|
-
grow: 1,
|
|
19306
|
-
display: display,
|
|
19307
|
-
width: '100%',
|
|
19308
|
-
basis: '0'
|
|
19309
|
-
};
|
|
19310
|
-
};
|
|
19311
|
-
var GridBasicItem = function GridBasicItem(_ref) {
|
|
19312
|
-
var _ref$xs = _ref.xs,
|
|
19313
|
-
xs = _ref$xs === undefined ? false : _ref$xs,
|
|
19314
|
-
_ref$sm = _ref.sm,
|
|
19315
|
-
sm = _ref$sm === undefined ? false : _ref$sm,
|
|
19316
|
-
_ref$md = _ref.md,
|
|
19317
|
-
md = _ref$md === undefined ? false : _ref$md,
|
|
19318
|
-
_ref$lg = _ref.lg,
|
|
19319
|
-
lg = _ref$lg === undefined ? false : _ref$lg,
|
|
19320
|
-
_ref$xl = _ref.xl,
|
|
19321
|
-
xl = _ref$xl === undefined ? false : _ref$xl,
|
|
19322
|
-
justify = _ref.justify,
|
|
19323
|
-
direction = _ref.direction,
|
|
19324
|
-
alignItems = _ref.alignItems,
|
|
19325
|
-
alignContent = _ref.alignContent,
|
|
19326
|
-
children = _ref.children,
|
|
19327
|
-
_ref$className = _ref.className,
|
|
19328
|
-
className = _ref$className === undefined ? '' : _ref$className,
|
|
19329
|
-
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
19330
|
-
var theme = useTheme();
|
|
19331
|
-
var _useScale = useScale(),
|
|
19332
|
-
SCALES = _useScale.SCALES;
|
|
19333
|
-
var classes = React.useMemo(function () {
|
|
19334
|
-
var aligns = {
|
|
19335
|
-
justify: justify,
|
|
19336
|
-
direction: direction,
|
|
19337
|
-
alignItems: alignItems,
|
|
19338
|
-
alignContent: alignContent,
|
|
19339
|
-
xs: xs,
|
|
19340
|
-
sm: sm,
|
|
19341
|
-
md: md,
|
|
19342
|
-
lg: lg,
|
|
19343
|
-
xl: xl
|
|
19344
|
-
};
|
|
19345
|
-
var classString = Object.keys(aligns).reduce(function (pre, name) {
|
|
19346
|
-
if (aligns[name] !== undefined && aligns[name] !== false) return "".concat(pre, " ").concat(name);
|
|
19347
|
-
return pre;
|
|
19348
|
-
}, '');
|
|
19349
|
-
return classString.trim();
|
|
19350
|
-
}, [justify, direction, alignItems, alignContent, xs, sm, md, lg, xl]);
|
|
19351
|
-
var layout = React.useMemo(function () {
|
|
19352
|
-
return {
|
|
19353
|
-
xs: getItemLayout(xs),
|
|
19354
|
-
sm: getItemLayout(sm),
|
|
19355
|
-
md: getItemLayout(md),
|
|
19356
|
-
lg: getItemLayout(lg),
|
|
19357
|
-
xl: getItemLayout(xl)
|
|
19358
|
-
};
|
|
19359
|
-
}, [xs, sm, md, lg, xl]);
|
|
19360
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
19361
|
-
className: _JSXStyle.dynamic([["568430467", [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]]]) + " " + (props && props.className != null && props.className || useClasses('item', classes, className) || "")
|
|
19362
|
-
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19363
|
-
id: "568430467",
|
|
19364
|
-
dynamic: [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]
|
|
19365
|
-
}, ".item.__jsx-style-dynamic-selector{font-size:".concat(SCALES.font(1, 'inherit'), ";height:").concat(SCALES.height(1, 'auto'), ";}.justify.__jsx-style-dynamic-selector{-webkit-box-pack:").concat(justify, ";-webkit-justify-content:").concat(justify, ";-ms-flex-pack:").concat(justify, ";justify-content:").concat(justify, ";}.direction.__jsx-style-dynamic-selector{-webkit-flex-direction:").concat(direction, ";-ms-flex-direction:").concat(direction, ";flex-direction:").concat(direction, ";}.alignContent.__jsx-style-dynamic-selector{-webkit-align-content:").concat(alignContent, ";-ms-flex-line-pack:").concat(alignContent, ";align-content:").concat(alignContent, ";}.alignItems.__jsx-style-dynamic-selector{-webkit-align-items:").concat(alignItems, ";-webkit-box-align:").concat(alignItems, ";-ms-flex-align:").concat(alignItems, ";align-items:").concat(alignItems, ";}.xs.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.xs.grow, ";-webkit-flex-grow:").concat(layout.xs.grow, ";-ms-flex-positive:").concat(layout.xs.grow, ";flex-grow:").concat(layout.xs.grow, ";max-width:").concat(layout.xs.width, ";-webkit-flex-basis:").concat(layout.xs.basis, ";-ms-flex-preferred-size:").concat(layout.xs.basis, ";flex-basis:").concat(layout.xs.basis, ";").concat(layout.xs.display, ";}@media only screen and (min-width:").concat(theme.breakpoints.sm.min, "){.sm.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.sm.grow, ";-webkit-flex-grow:").concat(layout.sm.grow, ";-ms-flex-positive:").concat(layout.sm.grow, ";flex-grow:").concat(layout.sm.grow, ";max-width:").concat(layout.sm.width, ";-webkit-flex-basis:").concat(layout.sm.basis, ";-ms-flex-preferred-size:").concat(layout.sm.basis, ";flex-basis:").concat(layout.sm.basis, ";").concat(layout.sm.display, ";}}@media only screen and (min-width:").concat(theme.breakpoints.md.min, "){.md.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.md.grow, ";-webkit-flex-grow:").concat(layout.md.grow, ";-ms-flex-positive:").concat(layout.md.grow, ";flex-grow:").concat(layout.md.grow, ";max-width:").concat(layout.md.width, ";-webkit-flex-basis:").concat(layout.md.basis, ";-ms-flex-preferred-size:").concat(layout.md.basis, ";flex-basis:").concat(layout.md.basis, ";").concat(layout.md.display, ";}}@media only screen and (min-width:").concat(theme.breakpoints.lg.min, "){.lg.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.lg.grow, ";-webkit-flex-grow:").concat(layout.lg.grow, ";-ms-flex-positive:").concat(layout.lg.grow, ";flex-grow:").concat(layout.lg.grow, ";max-width:").concat(layout.lg.width, ";-webkit-flex-basis:").concat(layout.lg.basis, ";-ms-flex-preferred-size:").concat(layout.lg.basis, ";flex-basis:").concat(layout.lg.basis, ";").concat(layout.lg.display, ";}}@media only screen and (min-width:").concat(theme.breakpoints.xl.min, "){.xl.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.xl.grow, ";-webkit-flex-grow:").concat(layout.xl.grow, ";-ms-flex-positive:").concat(layout.xl.grow, ";flex-grow:").concat(layout.xl.grow, ";max-width:").concat(layout.xl.width, ";-webkit-flex-basis:").concat(layout.xl.basis, ";-ms-flex-preferred-size:").concat(layout.xl.basis, ";flex-basis:").concat(layout.xl.basis, ";").concat(layout.xl.display, ";}}")));
|
|
19366
|
-
};
|
|
19367
|
-
GridBasicItem.displayName = 'GridBasicItem';
|
|
19368
|
-
|
|
19369
|
-
var _excluded$8 = ["children", "className"];
|
|
19370
|
-
var GridComponent = function GridComponent(_ref) {
|
|
19371
|
-
var children = _ref.children,
|
|
19372
|
-
_ref$className = _ref.className,
|
|
19373
|
-
className = _ref$className === undefined ? '' : _ref$className,
|
|
19374
|
-
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
19375
|
-
var _useScale = useScale(),
|
|
19376
|
-
SCALES = _useScale.SCALES;
|
|
19377
|
-
var _styles$className = {
|
|
19378
|
-
styles: /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19379
|
-
id: "1271839607",
|
|
19380
|
-
dynamic: [SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0, 'var(--grid-gap-unit)'), SCALES.pr(0, 'var(--grid-gap-unit)'), SCALES.pb(0, 'var(--grid-gap-unit)'), SCALES.pl(0, 'var(--grid-gap-unit)')]
|
|
19381
|
-
}, "div.__jsx-style-dynamic-selector{margin:".concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";box-sizing:border-box;padding:").concat(SCALES.pt(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pr(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pb(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pl(0, 'var(--grid-gap-unit)'), ";}")),
|
|
19382
|
-
className: _JSXStyle.dynamic([["1271839607", [SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0, 'var(--grid-gap-unit)'), SCALES.pr(0, 'var(--grid-gap-unit)'), SCALES.pb(0, 'var(--grid-gap-unit)'), SCALES.pl(0, 'var(--grid-gap-unit)')]]])
|
|
19383
|
-
},
|
|
19384
|
-
resolveClassName = _styles$className.className,
|
|
19385
|
-
styles = _styles$className.styles;
|
|
19386
|
-
var classes = useClasses(resolveClassName, className);
|
|
19387
|
-
return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
|
|
19388
|
-
className: classes
|
|
19389
|
-
}, props), children, styles);
|
|
19390
|
-
};
|
|
19391
|
-
GridComponent.displayName = 'Grid';
|
|
19392
|
-
var Grid = withScale(GridComponent);
|
|
19393
|
-
|
|
19394
|
-
var _excluded$7 = ["gap", "wrap", "children", "className"];
|
|
19395
|
-
var GridContainerComponent = function GridContainerComponent(_ref) {
|
|
19396
|
-
var _ref$gap = _ref.gap,
|
|
19397
|
-
gap = _ref$gap === undefined ? 0 : _ref$gap,
|
|
19398
|
-
_ref$wrap = _ref.wrap,
|
|
19399
|
-
wrap = _ref$wrap === undefined ? 'wrap' : _ref$wrap,
|
|
19400
|
-
children = _ref.children,
|
|
19401
|
-
_ref$className = _ref.className,
|
|
19402
|
-
className = _ref$className === undefined ? '' : _ref$className,
|
|
19403
|
-
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
19404
|
-
var _useScale = useScale(),
|
|
19405
|
-
unit = _useScale.unit,
|
|
19406
|
-
SCALES = _useScale.SCALES;
|
|
19407
|
-
var gapUnit = React.useMemo(function () {
|
|
19408
|
-
return "calc(".concat(gap, " * ").concat(unit, " * 1/3)");
|
|
19409
|
-
}, [gap, unit]);
|
|
19410
|
-
var _styles$className = {
|
|
19411
|
-
styles: /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19412
|
-
id: "3631618093",
|
|
19413
|
-
dynamic: [gapUnit, wrap, SCALES.width(1, 'var(--grid-container-width)'), SCALES.mt(0, 'var(--grid-container-margin)'), SCALES.mr(0, 'var(--grid-container-margin)'), SCALES.mb(0, 'var(--grid-container-margin)'), SCALES.ml(0, 'var(--grid-container-margin)')]
|
|
19414
|
-
}, "div.__jsx-style-dynamic-selector{--grid-gap-unit:".concat(gapUnit, ";--grid-container-margin:calc(-1 * var(--grid-gap-unit));--grid-container-width:calc(100% + var(--grid-gap-unit) * 2);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:").concat(wrap, ";-ms-flex-wrap:").concat(wrap, ";flex-wrap:").concat(wrap, ";box-sizing:border-box;width:").concat(SCALES.width(1, 'var(--grid-container-width)'), ";margin:").concat(SCALES.mt(0, 'var(--grid-container-margin)'), " ").concat(SCALES.mr(0, 'var(--grid-container-margin)'), " ").concat(SCALES.mb(0, 'var(--grid-container-margin)'), " ").concat(SCALES.ml(0, 'var(--grid-container-margin)'), ";}")),
|
|
19415
|
-
className: _JSXStyle.dynamic([["3631618093", [gapUnit, wrap, SCALES.width(1, 'var(--grid-container-width)'), SCALES.mt(0, 'var(--grid-container-margin)'), SCALES.mr(0, 'var(--grid-container-margin)'), SCALES.mb(0, 'var(--grid-container-margin)'), SCALES.ml(0, 'var(--grid-container-margin)')]]])
|
|
19416
|
-
},
|
|
19417
|
-
resolveClassName = _styles$className.className,
|
|
19418
|
-
styles = _styles$className.styles;
|
|
19419
|
-
var classes = useClasses(resolveClassName, className);
|
|
19420
|
-
return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
|
|
19421
|
-
className: classes
|
|
19422
|
-
}, props), children, styles);
|
|
19423
|
-
};
|
|
19424
|
-
GridContainerComponent.displayName = 'GridContainer';
|
|
19425
|
-
var GridContainer = withScale(GridContainerComponent);
|
|
19426
|
-
|
|
19427
|
-
Grid.Container = GridContainer;
|
|
19428
|
-
|
|
19429
|
-
var SelectIconClear = function SelectIconClear(_ref) {
|
|
19430
|
-
var onClick = _ref.onClick;
|
|
19431
|
-
var theme = useTheme();
|
|
19432
|
-
var clickHandler = function clickHandler(event) {
|
|
19433
|
-
event.preventDefault();
|
|
19434
|
-
event.stopPropagation();
|
|
19435
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
19436
|
-
onClick && onClick(event);
|
|
19437
|
-
};
|
|
19438
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
19439
|
-
onClick: clickHandler,
|
|
19440
|
-
className: _JSXStyle.dynamic([["1984024521", [theme.palette.accents_3, theme.palette.foreground]]]) + " " + "clear-icon"
|
|
19441
|
-
}, /*#__PURE__*/React.createElement("svg", {
|
|
19442
|
-
viewBox: "0 0 24 24",
|
|
19443
|
-
stroke: "currentColor",
|
|
19444
|
-
strokeWidth: "1.5",
|
|
19445
|
-
strokeLinecap: "round",
|
|
19446
|
-
strokeLinejoin: "round",
|
|
19447
|
-
fill: "none",
|
|
19448
|
-
shapeRendering: "geometricPrecision",
|
|
19449
|
-
className: _JSXStyle.dynamic([["1984024521", [theme.palette.accents_3, theme.palette.foreground]]])
|
|
19450
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
19451
|
-
d: "M18 6L6 18",
|
|
19452
|
-
className: _JSXStyle.dynamic([["1984024521", [theme.palette.accents_3, theme.palette.foreground]]])
|
|
19453
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
19454
|
-
d: "M6 6l12 12",
|
|
19455
|
-
className: _JSXStyle.dynamic([["1984024521", [theme.palette.accents_3, theme.palette.foreground]]])
|
|
19456
|
-
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19457
|
-
id: "1984024521",
|
|
19458
|
-
dynamic: [theme.palette.accents_3, theme.palette.foreground]
|
|
19459
|
-
}, ".clear-icon.__jsx-style-dynamic-selector{padding:0 0 0 0.5em;margin:0;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;cursor:pointer;box-sizing:border-box;-webkit-transition:color 150ms ease 0s;transition:color 150ms ease 0s;color:".concat(theme.palette.accents_3, ";visibility:visible;opacity:1;}.clear-icon.__jsx-style-dynamic-selector:hover{color:").concat(theme.palette.foreground, ";}svg.__jsx-style-dynamic-selector{color:currentColor;width:1em;height:1em;}")));
|
|
19460
|
-
};
|
|
19461
|
-
var MemoSelectIconClear = /*#__PURE__*/React.memo(SelectIconClear);
|
|
19462
|
-
|
|
19463
|
-
var SelectMultipleValue = function SelectMultipleValue(_ref) {
|
|
19464
|
-
var disabled = _ref.disabled,
|
|
19465
|
-
onClear = _ref.onClear,
|
|
19466
|
-
children = _ref.children;
|
|
19467
|
-
var theme = useTheme();
|
|
19468
|
-
return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement("div", {
|
|
19469
|
-
className: _JSXStyle.dynamic([["3357578496", [theme.layout.radius, theme.palette.accents_2, disabled ? theme.palette.accents_4 : theme.palette.accents_6]]]) + " " + "item"
|
|
19470
|
-
}, children, !!onClear && /*#__PURE__*/React.createElement(MemoSelectIconClear, {
|
|
19471
|
-
onClick: onClear
|
|
19472
|
-
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19473
|
-
id: "3357578496",
|
|
19474
|
-
dynamic: [theme.layout.radius, theme.palette.accents_2, disabled ? theme.palette.accents_4 : theme.palette.accents_6]
|
|
19475
|
-
}, ".item.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;justify-items:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1;padding:0 0.5em;font-size:var(--select-font-size);height:calc(var(--select-font-size) * 2);border-radius:".concat(theme.layout.radius, ";background-color:").concat(theme.palette.accents_2, ";color:").concat(disabled ? theme.palette.accents_4 : theme.palette.accents_6, ";}.item.__jsx-style-dynamic-selector>div:not(.clear-icon),.item.__jsx-style-dynamic-selector>div:not(.clear-icon):hover{border-radius:0;background-color:transparent;padding:0;margin:0;color:inherit;}")));
|
|
19476
|
-
};
|
|
19477
|
-
SelectMultipleValue.displayName = 'GeistSelectMultipleValue';
|
|
19478
|
-
|
|
19479
|
-
var getColors$1 = function getColors(palette, status) {
|
|
19480
|
-
var colors = {
|
|
19481
|
-
"default": {
|
|
19482
|
-
border: palette.border,
|
|
19483
|
-
borderActive: palette.foreground,
|
|
19484
|
-
iconBorder: palette.accents_5,
|
|
19485
|
-
placeholderColor: palette.accents_3
|
|
19486
|
-
},
|
|
19487
|
-
secondary: {
|
|
19488
|
-
border: palette.border,
|
|
19489
|
-
borderActive: palette.foreground,
|
|
19490
|
-
iconBorder: palette.accents_5,
|
|
19491
|
-
placeholderColor: palette.accents_3
|
|
19492
|
-
},
|
|
19493
|
-
success: {
|
|
19494
|
-
border: palette.successLight,
|
|
19495
|
-
borderActive: palette.successDark,
|
|
19496
|
-
iconBorder: palette.success,
|
|
19497
|
-
placeholderColor: palette.accents_3
|
|
19498
|
-
},
|
|
19499
|
-
warning: {
|
|
19500
|
-
border: palette.warningLight,
|
|
19501
|
-
borderActive: palette.warningDark,
|
|
19502
|
-
iconBorder: palette.warning,
|
|
19503
|
-
placeholderColor: palette.accents_3
|
|
19504
|
-
},
|
|
19505
|
-
error: {
|
|
19506
|
-
border: palette.errorLight,
|
|
19507
|
-
borderActive: palette.errorDark,
|
|
19508
|
-
iconBorder: palette.error,
|
|
19509
|
-
placeholderColor: palette.error
|
|
19510
|
-
}
|
|
19511
|
-
};
|
|
19512
|
-
if (!status) return colors["default"];
|
|
19513
|
-
return colors[status];
|
|
19514
|
-
};
|
|
19515
|
-
|
|
19516
|
-
var Ellipsis = function Ellipsis(_ref) {
|
|
19517
|
-
var children = _ref.children,
|
|
19518
|
-
height = _ref.height;
|
|
19519
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
19520
|
-
className: _JSXStyle.dynamic([["822089635", [height]]])
|
|
19521
|
-
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19522
|
-
id: "822089635",
|
|
19523
|
-
dynamic: [height]
|
|
19524
|
-
}, "span.__jsx-style-dynamic-selector{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:".concat(height, ";min-width:0;}")));
|
|
19525
|
-
};
|
|
19526
|
-
var Ellipsis$1 = /*#__PURE__*/React.memo(Ellipsis);
|
|
19527
|
-
|
|
19528
|
-
var SelectInput = /*#__PURE__*/React.forwardRef(function (_ref, inputRef) {
|
|
19529
|
-
var visible = _ref.visible,
|
|
19530
|
-
onBlur = _ref.onBlur,
|
|
19531
|
-
onFocus = _ref.onFocus;
|
|
19532
|
-
var ref = React.useRef(null);
|
|
19533
|
-
React.useImperativeHandle(inputRef, function () {
|
|
19534
|
-
return ref.current;
|
|
19535
|
-
});
|
|
19536
|
-
React.useEffect(function () {
|
|
19537
|
-
if (visible) {
|
|
19538
|
-
var _ref$current;
|
|
19539
|
-
(_ref$current = ref.current) === null || _ref$current === undefined || _ref$current.focus();
|
|
19540
|
-
}
|
|
19541
|
-
}, [visible]);
|
|
19542
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", {
|
|
19543
|
-
ref: ref,
|
|
19544
|
-
type: "search",
|
|
19545
|
-
role: "combobox",
|
|
19546
|
-
"aria-haspopup": "listbox",
|
|
19547
|
-
readOnly: true,
|
|
19548
|
-
unselectable: "on",
|
|
19549
|
-
"aria-expanded": visible,
|
|
19550
|
-
onBlur: onBlur,
|
|
19551
|
-
onFocus: onFocus,
|
|
19552
|
-
className: "jsx-2813108835"
|
|
19553
|
-
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19554
|
-
id: "2813108835"
|
|
19555
|
-
}, "input.jsx-2813108835{position:fixed;top:-10000px;left:-10000px;opacity:0;z-index:-1;width:0;height:0;padding:0;font-size:0;border:none;}"));
|
|
19556
|
-
});
|
|
19557
|
-
SelectInput.displayName = 'GeistSelectInput';
|
|
19558
|
-
|
|
19559
|
-
var _excluded$6 = ["children", "label", "type", "disabled", "initialValue", "value", "icon", "onChange", "pure", "multiple", "clearable", "placeholder", "className", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "getPopupContainer", "onDropdownVisibleChange"];
|
|
19560
|
-
var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
|
|
19561
|
-
var children = _ref.children,
|
|
19562
|
-
label = _ref.label,
|
|
19563
|
-
_ref$type = _ref.type,
|
|
19564
|
-
type = _ref$type === undefined ? 'default' : _ref$type,
|
|
19565
|
-
_ref$disabled = _ref.disabled,
|
|
19566
|
-
disabled = _ref$disabled === undefined ? false : _ref$disabled,
|
|
19567
|
-
init = _ref.initialValue,
|
|
19568
|
-
customValue = _ref.value,
|
|
19569
|
-
_ref$icon = _ref.icon,
|
|
19570
|
-
Icon = _ref$icon === undefined ? SelectIcon : _ref$icon,
|
|
19571
|
-
onChange = _ref.onChange,
|
|
19572
|
-
_ref$pure = _ref.pure,
|
|
19573
|
-
pure = _ref$pure === undefined ? false : _ref$pure,
|
|
19574
|
-
_ref$multiple = _ref.multiple,
|
|
19575
|
-
multiple = _ref$multiple === undefined ? false : _ref$multiple,
|
|
19576
|
-
_ref$clearable = _ref.clearable,
|
|
19577
|
-
clearable = _ref$clearable === undefined ? true : _ref$clearable,
|
|
19578
|
-
placeholder = _ref.placeholder,
|
|
19579
|
-
_ref$className = _ref.className,
|
|
19580
|
-
className = _ref$className === undefined ? '' : _ref$className,
|
|
19581
|
-
dropdownClassName = _ref.dropdownClassName,
|
|
19582
|
-
dropdownStyle = _ref.dropdownStyle,
|
|
19583
|
-
_ref$disableMatchWidt = _ref.disableMatchWidth,
|
|
19584
|
-
disableMatchWidth = _ref$disableMatchWidt === undefined ? false : _ref$disableMatchWidt,
|
|
19585
|
-
getPopupContainer = _ref.getPopupContainer,
|
|
19586
|
-
_ref$onDropdownVisibl = _ref.onDropdownVisibleChange,
|
|
19587
|
-
onDropdownVisibleChange = _ref$onDropdownVisibl === undefined ? function () {} : _ref$onDropdownVisibl,
|
|
19588
|
-
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
19589
|
-
var theme = useTheme();
|
|
19590
|
-
var _useScale = useScale(),
|
|
19591
|
-
SCALES = _useScale.SCALES;
|
|
19592
|
-
var ref = React.useRef(null);
|
|
19593
|
-
var inputRef = React.useRef(null);
|
|
19594
|
-
var dropdownRef = React.useRef(null);
|
|
19595
|
-
var _useState = React.useState(false),
|
|
19596
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
19597
|
-
visible = _useState2[0],
|
|
19598
|
-
setVisible = _useState2[1];
|
|
19599
|
-
var _useState3 = React.useState(false),
|
|
19600
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
19601
|
-
selectFocus = _useState4[0],
|
|
19602
|
-
setSelectFocus = _useState4[1];
|
|
19603
|
-
var _useCurrentState = useCurrentState(function () {
|
|
19604
|
-
if (!multiple) return init;
|
|
19605
|
-
if (Array.isArray(init)) return init;
|
|
19606
|
-
return typeof init === 'undefined' ? [] : [init];
|
|
19607
|
-
}),
|
|
19608
|
-
_useCurrentState2 = _slicedToArray(_useCurrentState, 3),
|
|
19609
|
-
value = _useCurrentState2[0],
|
|
19610
|
-
setValue = _useCurrentState2[1],
|
|
19611
|
-
valueRef = _useCurrentState2[2];
|
|
19612
|
-
var isEmpty = React.useMemo(function () {
|
|
19613
|
-
if (!Array.isArray(value)) return !value;
|
|
19614
|
-
return value.length === 0;
|
|
19615
|
-
}, [value]);
|
|
19616
|
-
var _useMemo = React.useMemo(function () {
|
|
19617
|
-
return getColors$1(theme.palette, type);
|
|
19618
|
-
}, [theme.palette, type]),
|
|
19619
|
-
border = _useMemo.border,
|
|
19620
|
-
borderActive = _useMemo.borderActive,
|
|
19621
|
-
iconBorder = _useMemo.iconBorder,
|
|
19622
|
-
placeholderColor = _useMemo.placeholderColor;
|
|
19623
|
-
var updateVisible = function updateVisible(next) {
|
|
19624
|
-
onDropdownVisibleChange(next);
|
|
19625
|
-
setVisible(next);
|
|
19626
|
-
};
|
|
19627
|
-
var updateValue = function updateValue(next) {
|
|
19628
|
-
setValue(function (last) {
|
|
19629
|
-
if (!Array.isArray(last)) return next;
|
|
19630
|
-
if (!last.includes(next)) return [].concat(_toConsumableArray(last), [next]);
|
|
19631
|
-
return last.filter(function (item) {
|
|
19632
|
-
return item !== next;
|
|
19633
|
-
});
|
|
19634
|
-
});
|
|
19635
|
-
onChange && onChange(valueRef.current);
|
|
19636
|
-
if (!multiple) {
|
|
19637
|
-
updateVisible(false);
|
|
19638
|
-
}
|
|
19639
|
-
};
|
|
19640
|
-
var initialValue = React.useMemo(function () {
|
|
19641
|
-
return {
|
|
19642
|
-
value: value,
|
|
19643
|
-
visible: visible,
|
|
19644
|
-
updateValue: updateValue,
|
|
19645
|
-
updateVisible: updateVisible,
|
|
19646
|
-
ref: ref,
|
|
19647
|
-
disableAll: disabled
|
|
19648
|
-
};
|
|
19649
|
-
}, [visible, disabled, ref, value, multiple]);
|
|
19650
|
-
var clickHandler = function clickHandler(event) {
|
|
19651
|
-
event.stopPropagation();
|
|
19652
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
19653
|
-
event.preventDefault();
|
|
19654
|
-
if (disabled) return;
|
|
19655
|
-
updateVisible(!visible);
|
|
19656
|
-
event.preventDefault();
|
|
19657
|
-
};
|
|
19658
|
-
var mouseDownHandler = function mouseDownHandler(event) {
|
|
19659
|
-
/* istanbul ignore next */
|
|
19660
|
-
if (visible) {
|
|
19661
|
-
event.preventDefault();
|
|
19662
|
-
}
|
|
19663
|
-
};
|
|
19664
|
-
React.useEffect(function () {
|
|
19665
|
-
if (customValue === undefined) return;
|
|
19666
|
-
setValue(customValue);
|
|
19667
|
-
}, [customValue]);
|
|
19668
|
-
React.useImperativeHandle(selectRef, function () {
|
|
19669
|
-
return {
|
|
19670
|
-
focus: function focus() {
|
|
19671
|
-
var _inputRef$current;
|
|
19672
|
-
return (_inputRef$current = inputRef.current) === null || _inputRef$current === undefined ? undefined : _inputRef$current.focus();
|
|
19673
|
-
},
|
|
19674
|
-
blur: function blur() {
|
|
19675
|
-
var _inputRef$current2;
|
|
19676
|
-
return (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === undefined ? undefined : _inputRef$current2.blur();
|
|
19677
|
-
},
|
|
19678
|
-
scrollTo: function scrollTo(options) {
|
|
19679
|
-
var _dropdownRef$current;
|
|
19680
|
-
return (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === undefined ? undefined : _dropdownRef$current.scrollTo(options);
|
|
19681
|
-
}
|
|
19682
|
-
};
|
|
19683
|
-
}, [inputRef, dropdownRef]);
|
|
19684
|
-
var selectedChild = React.useMemo(function () {
|
|
19685
|
-
var _pickChildByProps = pickChildByProps(children, 'value', value),
|
|
19686
|
-
_pickChildByProps2 = _slicedToArray(_pickChildByProps, 2),
|
|
19687
|
-
optionChildren = _pickChildByProps2[1];
|
|
19688
|
-
return React.Children.map(optionChildren, function (child) {
|
|
19689
|
-
if (! /*#__PURE__*/React.isValidElement(child)) return null;
|
|
19690
|
-
var el = /*#__PURE__*/React.cloneElement(child); // { preventAllEvents: true }
|
|
19691
|
-
if (!multiple) return el;
|
|
19692
|
-
return /*#__PURE__*/React.createElement(SelectMultipleValue, {
|
|
19693
|
-
disabled: disabled,
|
|
19694
|
-
onClear: clearable ? function () {
|
|
19695
|
-
return updateValue(child.props.value);
|
|
19696
|
-
} : null
|
|
19697
|
-
}, el);
|
|
19698
|
-
});
|
|
19699
|
-
}, [value, children, multiple]);
|
|
19700
|
-
var onInputBlur = function onInputBlur() {
|
|
19701
|
-
updateVisible(false);
|
|
19702
|
-
setSelectFocus(false);
|
|
19703
|
-
};
|
|
19704
|
-
var classes = useClasses('select', {
|
|
19705
|
-
active: selectFocus || visible,
|
|
19706
|
-
multiple: multiple
|
|
19707
|
-
}, className);
|
|
19708
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
19709
|
-
className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
|
|
19710
|
-
}, label && /*#__PURE__*/React.createElement("label", {
|
|
19711
|
-
style: {
|
|
19712
|
-
display: 'block',
|
|
19713
|
-
marginBottom: '0.4rem',
|
|
19714
|
-
fontSize: '14px',
|
|
19715
|
-
fontWeight: 'light'
|
|
19716
|
-
},
|
|
19717
|
-
className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
|
|
19718
|
-
}, label), /*#__PURE__*/React.createElement(SelectContext.Provider, {
|
|
19719
|
-
value: initialValue
|
|
19720
|
-
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
19721
|
-
ref: ref,
|
|
19722
|
-
onClick: clickHandler,
|
|
19723
|
-
onMouseDown: mouseDownHandler
|
|
19724
|
-
}, props, {
|
|
19725
|
-
className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
19726
|
-
}), /*#__PURE__*/React.createElement(SelectInput, {
|
|
19727
|
-
ref: inputRef,
|
|
19728
|
-
visible: visible,
|
|
19729
|
-
onBlur: onInputBlur,
|
|
19730
|
-
onFocus: function onFocus() {
|
|
19731
|
-
return setSelectFocus(true);
|
|
19732
|
-
}
|
|
19733
|
-
}), isEmpty && /*#__PURE__*/React.createElement("span", {
|
|
19734
|
-
className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value placeholder"
|
|
19735
|
-
}, /*#__PURE__*/React.createElement(Ellipsis$1, {
|
|
19736
|
-
height: "var(--select-height)"
|
|
19737
|
-
}, placeholder)), value && !multiple && /*#__PURE__*/React.createElement("span", {
|
|
19738
|
-
className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value"
|
|
19739
|
-
}, selectedChild), value && multiple && /*#__PURE__*/React.createElement(Grid.Container, {
|
|
19740
|
-
gap: 0.5
|
|
19741
|
-
}, selectedChild), /*#__PURE__*/React.createElement(SelectDropdown, {
|
|
19742
|
-
ref: dropdownRef,
|
|
19743
|
-
visible: visible,
|
|
19744
|
-
className: dropdownClassName,
|
|
19745
|
-
dropdownStyle: dropdownStyle,
|
|
19746
|
-
disableMatchWidth: disableMatchWidth,
|
|
19747
|
-
getPopupContainer: getPopupContainer
|
|
19748
|
-
}, children), !pure && /*#__PURE__*/React.createElement("div", {
|
|
19749
|
-
className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "icon"
|
|
19750
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
19751
|
-
className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
|
|
19752
|
-
})))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19753
|
-
id: "3282295248",
|
|
19754
|
-
dynamic: [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]
|
|
19755
|
-
}, ".select.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;position:relative;cursor:".concat(disabled ? 'not-allowed' : 'pointer', ";max-width:90vw;overflow:hidden;-webkit-transition:border 150ms ease-in 0s,color 200ms ease-out 0s, box-shadow 200ms ease 0s;transition:border 150ms ease-in 0s,color 200ms ease-out 0s, box-shadow 200ms ease 0s;border:1px solid ").concat(border, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(disabled ? theme.palette.accents_1 : theme.palette.background, ";--select-font-size:").concat(SCALES.font(0.875), ";--select-height:").concat(SCALES.height(2.25), ";min-width:11.5em;width:").concat(SCALES.width(1, 'initial'), ";height:var(--select-height);padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0.334), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0.667), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.multiple.__jsx-style-dynamic-selector{height:auto;min-height:var(--select-height);padding:").concat(SCALES.pt(0.334), " ").concat(SCALES.pr(0.334), " ").concat(SCALES.pb(0.334), " ").concat(SCALES.pl(0.667), ";}.select.active.__jsx-style-dynamic-selector,.select.__jsx-style-dynamic-selector:hover{border-color:").concat(disabled ? theme.palette.border : borderActive, ";}.select.active.icon.__jsx-style-dynamic-selector,.select.__jsx-style-dynamic-selector:hover .icon.__jsx-style-dynamic-selector{color:").concat(disabled ? theme.palette.accents_5 : borderActive, ";}.value.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex:1;-ms-flex:1;flex:1;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1;padding:0;margin-right:1.25em;font-size:var(--select-font-size);color:").concat(disabled ? theme.palette.accents_4 : theme.palette.foreground, ";width:calc(100% - 1.25em);}.value.__jsx-style-dynamic-selector>div,.value.__jsx-style-dynamic-selector>div:hover{border-radius:0;background-color:transparent;padding:0;margin:0;color:inherit;}.placeholder.__jsx-style-dynamic-selector{color:").concat(placeholderColor, ";}.icon.__jsx-style-dynamic-selector{position:absolute;right:").concat(theme.layout.gapQuarter, ";font-size:var(--select-font-size);top:50%;bottom:0;-webkit-transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);-ms-transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);pointer-events:none;-webkit-transition:-webkit-transform 200ms ease;-webkit-transition:transform 200ms ease;transition:transform 200ms ease;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:").concat(iconBorder, ";}")));
|
|
19756
|
-
});
|
|
19757
|
-
SelectComponent.displayName = 'Select';
|
|
19758
|
-
var Select = withScale(SelectComponent);
|
|
19759
|
-
|
|
19760
|
-
var _excluded$5 = ["value", "className", "children", "disabled", "divider", "label", "preventAllEvents"];
|
|
19761
|
-
var SelectOptionComponent = function SelectOptionComponent(_ref) {
|
|
19762
|
-
var identValue = _ref.value,
|
|
19763
|
-
_ref$className = _ref.className,
|
|
19764
|
-
className = _ref$className === undefined ? '' : _ref$className,
|
|
19765
|
-
children = _ref.children,
|
|
19766
|
-
_ref$disabled = _ref.disabled,
|
|
19767
|
-
disabled = _ref$disabled === undefined ? false : _ref$disabled,
|
|
19768
|
-
_ref$divider = _ref.divider,
|
|
19769
|
-
divider = _ref$divider === undefined ? false : _ref$divider,
|
|
19770
|
-
_ref$label = _ref.label,
|
|
19771
|
-
label = _ref$label === undefined ? false : _ref$label,
|
|
19772
|
-
_ref$preventAllEvents = _ref.preventAllEvents,
|
|
19773
|
-
preventAllEvents = _ref$preventAllEvents === undefined ? false : _ref$preventAllEvents,
|
|
19774
|
-
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
19775
|
-
var theme = useTheme();
|
|
19776
|
-
var _useScale = useScale(),
|
|
19777
|
-
SCALES = _useScale.SCALES;
|
|
19778
|
-
var _useSelectContext = useSelectContext(),
|
|
19779
|
-
updateValue = _useSelectContext.updateValue,
|
|
19780
|
-
value = _useSelectContext.value,
|
|
19781
|
-
disableAll = _useSelectContext.disableAll;
|
|
19782
|
-
var isDisabled = React.useMemo(function () {
|
|
19783
|
-
return disabled || disableAll;
|
|
19784
|
-
}, [disabled, disableAll]);
|
|
19785
|
-
var isLabel = React.useMemo(function () {
|
|
19786
|
-
return label || divider;
|
|
19787
|
-
}, [label, divider]);
|
|
19788
|
-
var classes = useClasses('option', {
|
|
19789
|
-
divider: divider,
|
|
19790
|
-
label: label
|
|
19791
|
-
}, className);
|
|
19792
|
-
if (!isLabel && identValue === undefined) {
|
|
19793
|
-
useWarning('The props "value" is required.', 'Select Option');
|
|
19794
|
-
}
|
|
19795
|
-
var selected = React.useMemo(function () {
|
|
19796
|
-
if (!value) return false;
|
|
19797
|
-
if (typeof value === 'string') {
|
|
19798
|
-
return identValue === value;
|
|
19799
|
-
}
|
|
19800
|
-
return value.includes("".concat(identValue));
|
|
19801
|
-
}, [identValue, value]);
|
|
19802
|
-
var bgColor = React.useMemo(function () {
|
|
19803
|
-
if (isDisabled) return theme.palette.accents_1;
|
|
19804
|
-
return selected ? theme.palette.accents_2 : theme.palette.background;
|
|
19805
|
-
}, [selected, isDisabled, theme.palette]);
|
|
19806
|
-
var hoverBgColor = React.useMemo(function () {
|
|
19807
|
-
if (isDisabled || isLabel || selected) return bgColor;
|
|
19808
|
-
return theme.palette.accents_1;
|
|
19809
|
-
}, [selected, isDisabled, theme.palette, isLabel, bgColor]);
|
|
19810
|
-
var color = React.useMemo(function () {
|
|
19811
|
-
if (isDisabled) return theme.palette.accents_4;
|
|
19812
|
-
return selected ? theme.palette.foreground : theme.palette.accents_5;
|
|
19813
|
-
}, [selected, isDisabled, theme.palette]);
|
|
19814
|
-
var clickHandler = function clickHandler(event) {
|
|
19815
|
-
if (preventAllEvents) return;
|
|
19816
|
-
event.stopPropagation();
|
|
19817
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
19818
|
-
event.preventDefault();
|
|
19819
|
-
if (isDisabled || isLabel) return;
|
|
19820
|
-
updateValue && updateValue(identValue);
|
|
19821
|
-
};
|
|
19822
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
19823
|
-
onClick: clickHandler
|
|
19824
|
-
}, props, {
|
|
19825
|
-
className: _JSXStyle.dynamic([["199367556", [bgColor, color, isDisabled ? 'not-allowed' : 'pointer', SCALES.font(0.75), SCALES.width(1, '100%'), SCALES.height(2.25), SCALES.pt(0), SCALES.pr(0.667), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBgColor, theme.palette.accents_7, theme.palette.border, SCALES.width(1, '100%'), SCALES.height(1, 0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0.5), SCALES.mr(0), SCALES.mb(0.5), SCALES.ml(0), theme.palette.accents_7, theme.palette.border, SCALES.font(0.875), SCALES.width(1, '100%')]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
19826
|
-
}), /*#__PURE__*/React.createElement(Ellipsis$1, {
|
|
19827
|
-
height: SCALES.height(2.25)
|
|
19828
|
-
}, children), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19829
|
-
id: "199367556",
|
|
19830
|
-
dynamic: [bgColor, color, isDisabled ? 'not-allowed' : 'pointer', SCALES.font(0.75), SCALES.width(1, '100%'), SCALES.height(2.25), SCALES.pt(0), SCALES.pr(0.667), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBgColor, theme.palette.accents_7, theme.palette.border, SCALES.width(1, '100%'), SCALES.height(1, 0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0.5), SCALES.mr(0), SCALES.mb(0.5), SCALES.ml(0), theme.palette.accents_7, theme.palette.border, SCALES.font(0.875), SCALES.width(1, '100%')]
|
|
19831
|
-
}, ".option.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;max-width:100%;box-sizing:border-box;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-weight:normal;background-color:".concat(bgColor, ";color:").concat(color, ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:0;cursor:").concat(isDisabled ? 'not-allowed' : 'pointer', ";-webkit-transition:background 0.2s ease 0s,border-color 0.2s ease 0s;transition:background 0.2s ease 0s,border-color 0.2s ease 0s;--select-font-size:").concat(SCALES.font(0.75), ";font-size:var(--select-font-size);width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(2.25), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0.667), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0.667), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.option.__jsx-style-dynamic-selector:hover{background-color:").concat(hoverBgColor, ";color:").concat(theme.palette.accents_7, ";}.divider.__jsx-style-dynamic-selector{line-height:0;overflow:hidden;border-top:1px solid ").concat(theme.palette.border, ";width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0.5), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0.5), " ").concat(SCALES.ml(0), ";}.label.__jsx-style-dynamic-selector{color:").concat(theme.palette.accents_7, ";border-bottom:1px solid ").concat(theme.palette.border, ";text-transform:capitalize;cursor:default;font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, '100%'), ";font-weight:500;}")));
|
|
19832
|
-
};
|
|
19833
|
-
SelectOptionComponent.displayName = 'SelectOption';
|
|
19834
|
-
var SelectOption = withScale(SelectOptionComponent);
|
|
19835
|
-
|
|
19836
|
-
Select.Option = SelectOption;
|
|
19837
|
-
|
|
19838
|
-
var makeColgroup = function makeColgroup(width, columns) {
|
|
19839
|
-
var unsetWidthCount = columns.filter(function (c) {
|
|
19840
|
-
return !c.width;
|
|
19841
|
-
}).length;
|
|
19842
|
-
var customWidthTotal = columns.reduce(function (pre, current) {
|
|
19843
|
-
return current.width ? pre + current.width : pre;
|
|
19844
|
-
}, 0);
|
|
19845
|
-
var averageWidth = (width - customWidthTotal) / unsetWidthCount;
|
|
19846
|
-
if (averageWidth <= 0) return /*#__PURE__*/React.createElement("colgroup", null);
|
|
19847
|
-
return /*#__PURE__*/React.createElement("colgroup", null, columns.map(function (column, index) {
|
|
19848
|
-
return /*#__PURE__*/React.createElement("col", {
|
|
19849
|
-
key: "colgroup-".concat(index),
|
|
19850
|
-
width: column.width || averageWidth
|
|
19851
|
-
});
|
|
19852
|
-
}));
|
|
19853
|
-
};
|
|
19854
|
-
var TableHead = function TableHead(props) {
|
|
19855
|
-
var theme = useTheme();
|
|
19856
|
-
var _React$useState = React.useState({}),
|
|
19857
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
19858
|
-
filters = _React$useState2[0],
|
|
19859
|
-
setFilters = _React$useState2[1];
|
|
19860
|
-
var _ref = props,
|
|
19861
|
-
columns = _ref.columns,
|
|
19862
|
-
width = _ref.width,
|
|
19863
|
-
onFilters = _ref.onFilters,
|
|
19864
|
-
showFilters = _ref.showFilters;
|
|
19865
|
-
var isScalableWidth = React.useMemo(function () {
|
|
19866
|
-
return columns.find(function (item) {
|
|
19867
|
-
return !!item.width;
|
|
19868
|
-
});
|
|
19869
|
-
}, [columns]);
|
|
19870
|
-
var colgroup = React.useMemo(function () {
|
|
19871
|
-
if (!isScalableWidth) return /*#__PURE__*/React.createElement("colgroup", null);
|
|
19872
|
-
return makeColgroup(width, columns);
|
|
19873
|
-
}, [isScalableWidth, width]);
|
|
19874
|
-
var handleFilterChange = function handleFilterChange(name, value) {
|
|
19875
|
-
setFilters(function (prevFilters) {
|
|
19876
|
-
var updatedFilters = _objectSpread2(_objectSpread2({}, prevFilters), {}, _defineProperty({}, name, value));
|
|
19877
|
-
// Call onFiltersChange to propagate filter changes to the parent
|
|
19878
|
-
if (onFilters) {
|
|
19879
|
-
onFilters(updatedFilters);
|
|
19880
|
-
}
|
|
19881
|
-
return updatedFilters;
|
|
19882
|
-
});
|
|
19883
|
-
};
|
|
19884
|
-
var generateFilterInputs = function generateFilterInputs() {
|
|
19885
|
-
return columns.map(function (col) {
|
|
19886
|
-
var _String, _filters$filterName;
|
|
19887
|
-
var Header = col.label,
|
|
19888
|
-
accessor = col.filter,
|
|
19889
|
-
options = col.options;
|
|
19890
|
-
var filterName = (_String = String(col === null || col === undefined ? undefined : col.label)) === null || _String === undefined ? undefined : _String.replace(' ', '_').toLowerCase();
|
|
19891
|
-
var unq_accessor = _.uniqueId(filterName);
|
|
19892
|
-
return /*#__PURE__*/React.createElement("th", {
|
|
19893
|
-
style: {
|
|
19894
|
-
margin: '3px'
|
|
19895
|
-
},
|
|
19896
|
-
"data-column": Header,
|
|
19897
|
-
key: unq_accessor
|
|
19898
|
-
}, accessor === 'fixed' && /*#__PURE__*/React.createElement(Select, {
|
|
19899
|
-
key: unq_accessor,
|
|
19900
|
-
name: filterName,
|
|
19901
|
-
value: (_filters$filterName = filters[filterName]) !== null && _filters$filterName !== undefined ? _filters$filterName : 'All',
|
|
19902
|
-
onChange: function onChange(newValue) {
|
|
19903
|
-
return handleFilterChange(filterName, newValue);
|
|
19904
|
-
}
|
|
19905
|
-
}, /*#__PURE__*/React.createElement(Select.Option, {
|
|
19906
|
-
value: "All"
|
|
19907
|
-
}, "All ", Header), options ? options.map(function (option) {
|
|
19908
|
-
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
19909
|
-
value: option.value
|
|
19910
|
-
}, option.name);
|
|
19911
|
-
}) : null), accessor === 'date' && /*#__PURE__*/React.createElement(Input, {
|
|
19912
|
-
id: "filter-date-".concat(filterName),
|
|
19913
|
-
htmlType: "date",
|
|
19914
|
-
name: filterName,
|
|
19915
|
-
value: filters[filterName],
|
|
19916
|
-
onChange: function onChange(e) {
|
|
19917
|
-
return handleFilterChange(filterName, e.target.value);
|
|
19918
|
-
}
|
|
19919
|
-
}), accessor === 'search' && /*#__PURE__*/React.createElement("th", {
|
|
19920
|
-
"data-column": Header
|
|
19921
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
19922
|
-
id: "filter-search-".concat(filterName),
|
|
19923
|
-
htmlType: "text"
|
|
19924
|
-
// ref={filterRefs.current[filterName]} // Dynamically set ref}
|
|
19925
|
-
,
|
|
19926
|
-
name: filterName,
|
|
19927
|
-
style: {
|
|
19928
|
-
height: 30,
|
|
19929
|
-
minWidth: 160
|
|
19930
|
-
},
|
|
19931
|
-
value: filters[filterName],
|
|
19932
|
-
onChange: function onChange(e) {
|
|
19933
|
-
return handleFilterChange(filterName, e.target.value);
|
|
19934
|
-
},
|
|
19935
|
-
placeholder: "Search...",
|
|
19936
|
-
fullWidth: true
|
|
19937
|
-
})));
|
|
19938
|
-
});
|
|
19939
|
-
};
|
|
19940
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
|
|
19941
|
-
className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
19942
|
-
}, /*#__PURE__*/React.createElement("tr", {
|
|
19943
|
-
className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
19944
|
-
}, columns.map(function (column, index) {
|
|
19945
|
-
return /*#__PURE__*/React.createElement("th", {
|
|
19946
|
-
style: {
|
|
19947
|
-
// textAlign: `${column?.align} !important`,
|
|
19948
|
-
// paddingLeft: '0.3rem',
|
|
19949
|
-
// paddingRight: '0.3rem',
|
|
19950
|
-
// color: `${column?.color}`,
|
|
19951
|
-
whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
|
|
19952
|
-
},
|
|
19953
|
-
key: "table-th-".concat(column.prop.toString(), "-").concat(index),
|
|
19954
|
-
"data-column": column.label,
|
|
19955
|
-
className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + (column.className || "")
|
|
19956
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
19957
|
-
className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]]) + " " + "thead-box"
|
|
19958
|
-
}, column.label, /*#__PURE__*/React.createElement("br", {
|
|
19959
|
-
className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
19960
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
19961
|
-
style: {
|
|
19962
|
-
textAlign: 'center'
|
|
19963
|
-
},
|
|
19964
|
-
className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
19965
|
-
}, column.text)));
|
|
19966
|
-
})), showFilters && /*#__PURE__*/React.createElement("tr", {
|
|
19967
|
-
className: _JSXStyle.dynamic([["134865897", [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]]])
|
|
19968
|
-
}, generateFilterInputs())), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19969
|
-
id: "134865897",
|
|
19970
|
-
dynamic: [theme.palette.accents_5, theme.palette.accents_1, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius]
|
|
19971
|
-
}, "thead.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;font-size:inherit;}th.__jsx-style-dynamic-selector{padding:0 0.5em;font-size:calc(0.75 * var(--table-font-size));font-weight:normal;text-align:left;-webkit-letter-spacing:0;-moz-letter-spacing:0;-ms-letter-spacing:0;letter-spacing:0;vertical-align:middle;min-height:calc(2.5 * var(--table-font-size));color:".concat(theme.palette.accents_5, ";background:").concat(theme.palette.accents_1, ";border-bottom:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-radius:0;}th.__jsx-style-dynamic-selector:nth-child(1){border-bottom:1px solid ").concat(theme.palette.border, ";border-left:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-left-radius:").concat(theme.layout.radius, ";border-bottom-left-radius:").concat(theme.layout.radius, ";}th.__jsx-style-dynamic-selector:last-child{border-bottom:1px solid ").concat(theme.palette.border, ";border-right:1px solid ").concat(theme.palette.border, ";border-top:1px solid ").concat(theme.palette.border, ";border-top-right-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";}.thead-box.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-align:center;min-height:calc(2.5 * var(--table-font-size));text-transform:uppercase;}")));
|
|
19972
|
-
};
|
|
19973
|
-
TableHead.displayName = 'TableHead';
|
|
18226
|
+
if (!lodashFunc) {
|
|
18227
|
+
return;
|
|
18228
|
+
}
|
|
18229
|
+
lodash.prototype[methodName] = function() {
|
|
18230
|
+
var value = this.__wrapped__,
|
|
18231
|
+
args = isTaker ? [1] : arguments,
|
|
18232
|
+
isLazy = value instanceof LazyWrapper,
|
|
18233
|
+
iteratee = args[0],
|
|
18234
|
+
useLazy = isLazy || isArray(value);
|
|
19974
18235
|
|
|
19975
|
-
var
|
|
19976
|
-
|
|
19977
|
-
|
|
19978
|
-
|
|
19979
|
-
emptyText = _ref.emptyText,
|
|
19980
|
-
onCellClick = _ref.onCellClick;
|
|
19981
|
-
/* eslint-disable react/jsx-no-useless-fragment */
|
|
19982
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, columns.map(function (column, index) {
|
|
19983
|
-
var currentRowValue = row[column.prop];
|
|
19984
|
-
var cellValue = currentRowValue || emptyText;
|
|
19985
|
-
var shouldBeRenderElement = column.renderHandler(currentRowValue, row, rowIndex);
|
|
19986
|
-
return /*#__PURE__*/React.createElement("td", {
|
|
19987
|
-
style: _objectSpread2({
|
|
19988
|
-
fontSize: "".concat(column === null || column === undefined ? undefined : column.fontSize),
|
|
19989
|
-
textAlign: "".concat(column === null || column === undefined ? undefined : column.align, " !important"),
|
|
19990
|
-
paddingLeft: '0.3rem',
|
|
19991
|
-
paddingRight: '0.3rem',
|
|
19992
|
-
color: "".concat(column === null || column === undefined ? undefined : column.color),
|
|
19993
|
-
whiteSpace: column !== null && column !== undefined && column.noWrap ? 'nowrap' : 'normal'
|
|
19994
|
-
}, currentRowValue === null || currentRowValue === undefined ? undefined : currentRowValue.style),
|
|
19995
|
-
"data-column": column.label,
|
|
19996
|
-
key: "row-td-".concat(index, "-").concat(column.prop.toString()),
|
|
19997
|
-
onClick: function onClick() {
|
|
19998
|
-
return onCellClick && onCellClick(currentRowValue, rowIndex, index);
|
|
19999
|
-
},
|
|
20000
|
-
className: column.className
|
|
20001
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
20002
|
-
className: "cell"
|
|
20003
|
-
}, shouldBeRenderElement ? shouldBeRenderElement : cellValue));
|
|
20004
|
-
}));
|
|
20005
|
-
/* eslint-enable */
|
|
20006
|
-
};
|
|
18236
|
+
var interceptor = function(value) {
|
|
18237
|
+
var result = lodashFunc.apply(lodash, arrayPush([value], args));
|
|
18238
|
+
return (isTaker && chainAll) ? result[0] : result;
|
|
18239
|
+
};
|
|
20007
18240
|
|
|
20008
|
-
|
|
18241
|
+
if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
|
|
18242
|
+
// Avoid lazy use if the iteratee has a "length" value other than `1`.
|
|
18243
|
+
isLazy = useLazy = false;
|
|
18244
|
+
}
|
|
18245
|
+
var chainAll = this.__chain__,
|
|
18246
|
+
isHybrid = !!this.__actions__.length,
|
|
18247
|
+
isUnwrapped = retUnwrapped && !chainAll,
|
|
18248
|
+
onlyLazy = isLazy && !isHybrid;
|
|
20009
18249
|
|
|
20010
|
-
|
|
20011
|
-
|
|
20012
|
-
|
|
20013
|
-
};
|
|
20014
|
-
|
|
20015
|
-
|
|
20016
|
-
|
|
20017
|
-
|
|
18250
|
+
if (!retUnwrapped && useLazy) {
|
|
18251
|
+
value = onlyLazy ? value : new LazyWrapper(this);
|
|
18252
|
+
var result = func.apply(value, args);
|
|
18253
|
+
result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined$1 });
|
|
18254
|
+
return new LodashWrapper(result, chainAll);
|
|
18255
|
+
}
|
|
18256
|
+
if (isUnwrapped && onlyLazy) {
|
|
18257
|
+
return func.apply(this, args);
|
|
18258
|
+
}
|
|
18259
|
+
result = this.thru(interceptor);
|
|
18260
|
+
return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
|
|
18261
|
+
};
|
|
18262
|
+
});
|
|
18263
|
+
|
|
18264
|
+
// Add `Array` methods to `lodash.prototype`.
|
|
18265
|
+
arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
|
|
18266
|
+
var func = arrayProto[methodName],
|
|
18267
|
+
chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
|
|
18268
|
+
retUnwrapped = /^(?:pop|shift)$/.test(methodName);
|
|
18269
|
+
|
|
18270
|
+
lodash.prototype[methodName] = function() {
|
|
18271
|
+
var args = arguments;
|
|
18272
|
+
if (retUnwrapped && !this.__chain__) {
|
|
18273
|
+
var value = this.value();
|
|
18274
|
+
return func.apply(isArray(value) ? value : [], args);
|
|
18275
|
+
}
|
|
18276
|
+
return this[chainName](function(value) {
|
|
18277
|
+
return func.apply(isArray(value) ? value : [], args);
|
|
18278
|
+
});
|
|
18279
|
+
};
|
|
18280
|
+
});
|
|
18281
|
+
|
|
18282
|
+
// Map minified method names to their real names.
|
|
18283
|
+
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
|
18284
|
+
var lodashFunc = lodash[methodName];
|
|
18285
|
+
if (lodashFunc) {
|
|
18286
|
+
var key = lodashFunc.name + '';
|
|
18287
|
+
if (!hasOwnProperty.call(realNames, key)) {
|
|
18288
|
+
realNames[key] = [];
|
|
18289
|
+
}
|
|
18290
|
+
realNames[key].push({ 'name': methodName, 'func': lodashFunc });
|
|
18291
|
+
}
|
|
18292
|
+
});
|
|
18293
|
+
|
|
18294
|
+
realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
|
|
18295
|
+
'name': 'wrapper',
|
|
18296
|
+
'func': undefined$1
|
|
18297
|
+
}];
|
|
18298
|
+
|
|
18299
|
+
// Add methods to `LazyWrapper`.
|
|
18300
|
+
LazyWrapper.prototype.clone = lazyClone;
|
|
18301
|
+
LazyWrapper.prototype.reverse = lazyReverse;
|
|
18302
|
+
LazyWrapper.prototype.value = lazyValue;
|
|
18303
|
+
|
|
18304
|
+
// Add chain sequence methods to the `lodash` wrapper.
|
|
18305
|
+
lodash.prototype.at = wrapperAt;
|
|
18306
|
+
lodash.prototype.chain = wrapperChain;
|
|
18307
|
+
lodash.prototype.commit = wrapperCommit;
|
|
18308
|
+
lodash.prototype.next = wrapperNext;
|
|
18309
|
+
lodash.prototype.plant = wrapperPlant;
|
|
18310
|
+
lodash.prototype.reverse = wrapperReverse;
|
|
18311
|
+
lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
|
|
18312
|
+
|
|
18313
|
+
// Add lazy aliases.
|
|
18314
|
+
lodash.prototype.first = lodash.prototype.head;
|
|
18315
|
+
|
|
18316
|
+
if (symIterator) {
|
|
18317
|
+
lodash.prototype[symIterator] = wrapperToIterator;
|
|
18318
|
+
}
|
|
18319
|
+
return lodash;
|
|
18320
|
+
});
|
|
18321
|
+
|
|
18322
|
+
/*--------------------------------------------------------------------------*/
|
|
18323
|
+
|
|
18324
|
+
// Export lodash.
|
|
18325
|
+
var _ = runInContext();
|
|
18326
|
+
|
|
18327
|
+
// Some AMD build optimizers, like r.js, check for condition patterns like:
|
|
18328
|
+
if (freeModule) {
|
|
18329
|
+
// Export for Node.js.
|
|
18330
|
+
(freeModule.exports = _)._ = _;
|
|
18331
|
+
// Export for CommonJS support.
|
|
18332
|
+
freeExports._ = _;
|
|
18333
|
+
}
|
|
18334
|
+
else {
|
|
18335
|
+
// Export to the global object.
|
|
18336
|
+
root._ = _;
|
|
18337
|
+
}
|
|
18338
|
+
}.call(lodash));
|
|
18339
|
+
} (lodash$1, lodash$1.exports));
|
|
18340
|
+
return lodash$1.exports;
|
|
18341
|
+
}
|
|
18342
|
+
|
|
18343
|
+
var lodashExports = requireLodash();
|
|
18344
|
+
var _ = /*@__PURE__*/getDefaultExportFromCjs(lodashExports);
|
|
20018
18345
|
|
|
20019
18346
|
var TableBody = function TableBody(_ref) {
|
|
20020
18347
|
var data = _ref.data,
|
|
@@ -20163,49 +18490,268 @@ var TableBody = function TableBody(_ref) {
|
|
|
20163
18490
|
dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
|
|
20164
18491
|
}, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(3.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
|
|
20165
18492
|
};
|
|
20166
|
-
TableBody.displayName = 'TableBody';
|
|
18493
|
+
TableBody.displayName = 'TableBody';
|
|
18494
|
+
|
|
18495
|
+
var getRealShape = function getRealShape(el) {
|
|
18496
|
+
var defaultShape = {
|
|
18497
|
+
width: 0,
|
|
18498
|
+
height: 0
|
|
18499
|
+
};
|
|
18500
|
+
if (!el || typeof window === 'undefined') return defaultShape;
|
|
18501
|
+
var rect = el.getBoundingClientRect();
|
|
18502
|
+
var _window$getComputedSt = window.getComputedStyle(el),
|
|
18503
|
+
width = _window$getComputedSt.width,
|
|
18504
|
+
height = _window$getComputedSt.height;
|
|
18505
|
+
var getCSSStyleVal = function getCSSStyleVal(str, parentNum) {
|
|
18506
|
+
if (!str) return 0;
|
|
18507
|
+
var strVal = str.includes('px') ? +str.split('px')[0] : str.includes('%') ? +str.split('%')[0] * parentNum * 0.01 : str;
|
|
18508
|
+
return Number.isNaN(+strVal) ? 0 : +strVal;
|
|
18509
|
+
};
|
|
18510
|
+
return {
|
|
18511
|
+
width: getCSSStyleVal("".concat(width), rect.width),
|
|
18512
|
+
height: getCSSStyleVal("".concat(height), rect.height)
|
|
18513
|
+
};
|
|
18514
|
+
};
|
|
18515
|
+
var useRealShape = function useRealShape(ref) {
|
|
18516
|
+
var _useState = React.useState({
|
|
18517
|
+
width: 0,
|
|
18518
|
+
height: 0
|
|
18519
|
+
}),
|
|
18520
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18521
|
+
state = _useState2[0],
|
|
18522
|
+
setState = _useState2[1];
|
|
18523
|
+
var update = function update() {
|
|
18524
|
+
var _getRealShape = getRealShape(ref.current),
|
|
18525
|
+
width = _getRealShape.width,
|
|
18526
|
+
height = _getRealShape.height;
|
|
18527
|
+
setState({
|
|
18528
|
+
width: width,
|
|
18529
|
+
height: height
|
|
18530
|
+
});
|
|
18531
|
+
};
|
|
18532
|
+
React.useEffect(function () {
|
|
18533
|
+
return update();
|
|
18534
|
+
}, [ref.current]);
|
|
18535
|
+
return [state, update];
|
|
18536
|
+
};
|
|
18537
|
+
|
|
18538
|
+
/* "use client" */
|
|
18539
|
+
|
|
18540
|
+
var useResize = function useResize(callback) {
|
|
18541
|
+
var immediatelyInvoke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
18542
|
+
React.useEffect(function () {
|
|
18543
|
+
var fn = function fn() {
|
|
18544
|
+
return callback();
|
|
18545
|
+
};
|
|
18546
|
+
if (immediatelyInvoke) {
|
|
18547
|
+
fn();
|
|
18548
|
+
}
|
|
18549
|
+
window.addEventListener('resize', fn);
|
|
18550
|
+
return function () {
|
|
18551
|
+
return window.removeEventListener('resize', fn);
|
|
18552
|
+
};
|
|
18553
|
+
}, []);
|
|
18554
|
+
};
|
|
18555
|
+
|
|
18556
|
+
/* "use client" */
|
|
18557
|
+
|
|
18558
|
+
var ScalePropKeys = ['width', 'height', 'padding', 'margin', 'w', 'h', 'paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom', 'pl', 'pr', 'pt', 'pb', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom', 'ml', 'mr', 'mt', 'mb', 'px', 'py', 'mx', 'my', 'font', 'unit', 'scale'];
|
|
18559
|
+
var defaultDynamicLayoutPipe = function defaultDynamicLayoutPipe(scale1x) {
|
|
18560
|
+
return "".concat(scale1x);
|
|
18561
|
+
};
|
|
18562
|
+
var defaultContext$1 = {
|
|
18563
|
+
getScaleProps: function getScaleProps() {
|
|
18564
|
+
return undefined;
|
|
18565
|
+
},
|
|
18566
|
+
getAllScaleProps: function getAllScaleProps() {
|
|
18567
|
+
return {};
|
|
18568
|
+
},
|
|
18569
|
+
SCALES: {
|
|
18570
|
+
pl: defaultDynamicLayoutPipe,
|
|
18571
|
+
pr: defaultDynamicLayoutPipe,
|
|
18572
|
+
pb: defaultDynamicLayoutPipe,
|
|
18573
|
+
pt: defaultDynamicLayoutPipe,
|
|
18574
|
+
px: defaultDynamicLayoutPipe,
|
|
18575
|
+
py: defaultDynamicLayoutPipe,
|
|
18576
|
+
mb: defaultDynamicLayoutPipe,
|
|
18577
|
+
ml: defaultDynamicLayoutPipe,
|
|
18578
|
+
mr: defaultDynamicLayoutPipe,
|
|
18579
|
+
mt: defaultDynamicLayoutPipe,
|
|
18580
|
+
mx: defaultDynamicLayoutPipe,
|
|
18581
|
+
my: defaultDynamicLayoutPipe,
|
|
18582
|
+
width: defaultDynamicLayoutPipe,
|
|
18583
|
+
height: defaultDynamicLayoutPipe,
|
|
18584
|
+
font: defaultDynamicLayoutPipe
|
|
18585
|
+
},
|
|
18586
|
+
unit: '16px'
|
|
18587
|
+
};
|
|
18588
|
+
var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$1);
|
|
18589
|
+
var useScale = function useScale() {
|
|
18590
|
+
return React.useContext(ScaleContext);
|
|
18591
|
+
};
|
|
18592
|
+
|
|
18593
|
+
/* "use client" */
|
|
18594
|
+
|
|
18595
|
+
var getId = function getId() {
|
|
18596
|
+
return Math.random().toString(32).slice(2, 10);
|
|
18597
|
+
};
|
|
18598
|
+
var isBrowser = function isBrowser() {
|
|
18599
|
+
return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
18600
|
+
};
|
|
18601
|
+
var isCSSNumberValue = function isCSSNumberValue(value) {
|
|
18602
|
+
return value !== undefined && !Number.isNaN(+value);
|
|
18603
|
+
};
|
|
20167
18604
|
|
|
20168
|
-
var
|
|
20169
|
-
var
|
|
20170
|
-
|
|
20171
|
-
|
|
20172
|
-
|
|
20173
|
-
|
|
20174
|
-
|
|
20175
|
-
|
|
20176
|
-
|
|
20177
|
-
|
|
20178
|
-
|
|
20179
|
-
|
|
20180
|
-
|
|
20181
|
-
|
|
20182
|
-
|
|
20183
|
-
|
|
20184
|
-
|
|
20185
|
-
|
|
18605
|
+
var generateGetScaleProps = function generateGetScaleProps(props) {
|
|
18606
|
+
var getScaleProps = function getScaleProps(keyOrKeys) {
|
|
18607
|
+
if (!Array.isArray(keyOrKeys)) return props[keyOrKeys];
|
|
18608
|
+
var value = undefined;
|
|
18609
|
+
var _iterator = _createForOfIteratorHelper(keyOrKeys),
|
|
18610
|
+
_step;
|
|
18611
|
+
try {
|
|
18612
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
18613
|
+
var key = _step.value;
|
|
18614
|
+
var currentValue = props[key];
|
|
18615
|
+
if (typeof currentValue !== 'undefined') {
|
|
18616
|
+
value = currentValue;
|
|
18617
|
+
}
|
|
18618
|
+
}
|
|
18619
|
+
} catch (err) {
|
|
18620
|
+
_iterator.e(err);
|
|
18621
|
+
} finally {
|
|
18622
|
+
_iterator.f();
|
|
18623
|
+
}
|
|
18624
|
+
return value;
|
|
20186
18625
|
};
|
|
18626
|
+
return getScaleProps;
|
|
20187
18627
|
};
|
|
20188
|
-
var
|
|
20189
|
-
var
|
|
20190
|
-
|
|
20191
|
-
|
|
20192
|
-
|
|
20193
|
-
|
|
20194
|
-
|
|
20195
|
-
|
|
20196
|
-
|
|
20197
|
-
|
|
20198
|
-
|
|
20199
|
-
|
|
20200
|
-
|
|
20201
|
-
|
|
20202
|
-
|
|
20203
|
-
}
|
|
18628
|
+
var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
|
|
18629
|
+
var getAllScaleProps = function getAllScaleProps() {
|
|
18630
|
+
var scaleProps = {};
|
|
18631
|
+
var _iterator2 = _createForOfIteratorHelper(ScalePropKeys),
|
|
18632
|
+
_step2;
|
|
18633
|
+
try {
|
|
18634
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
18635
|
+
var key = _step2.value;
|
|
18636
|
+
var value = props[key];
|
|
18637
|
+
if (typeof value !== 'undefined') {
|
|
18638
|
+
scaleProps[key] = value;
|
|
18639
|
+
}
|
|
18640
|
+
}
|
|
18641
|
+
} catch (err) {
|
|
18642
|
+
_iterator2.e(err);
|
|
18643
|
+
} finally {
|
|
18644
|
+
_iterator2.f();
|
|
18645
|
+
}
|
|
18646
|
+
return scaleProps;
|
|
20204
18647
|
};
|
|
20205
|
-
|
|
20206
|
-
|
|
20207
|
-
|
|
20208
|
-
|
|
18648
|
+
return getAllScaleProps;
|
|
18649
|
+
};
|
|
18650
|
+
|
|
18651
|
+
var _excluded$9 = ["children"];
|
|
18652
|
+
var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
|
|
18653
|
+
if (scale === 1) return scale;
|
|
18654
|
+
var diff = Math.abs((scale - 1) / 2);
|
|
18655
|
+
return scale > 1 ? 1 + diff : 1 - diff;
|
|
18656
|
+
};
|
|
18657
|
+
var withScale = function withScale(Render) {
|
|
18658
|
+
var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
18659
|
+
var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31, _ref32, _ref33;
|
|
18660
|
+
var children = _ref.children,
|
|
18661
|
+
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
18662
|
+
var _useTheme = useTheme(),
|
|
18663
|
+
layout = _useTheme.layout;
|
|
18664
|
+
var paddingLeft = props.paddingLeft,
|
|
18665
|
+
pl = props.pl,
|
|
18666
|
+
paddingRight = props.paddingRight,
|
|
18667
|
+
pr = props.pr,
|
|
18668
|
+
paddingTop = props.paddingTop,
|
|
18669
|
+
pt = props.pt,
|
|
18670
|
+
paddingBottom = props.paddingBottom,
|
|
18671
|
+
pb = props.pb,
|
|
18672
|
+
marginTop = props.marginTop,
|
|
18673
|
+
mt = props.mt,
|
|
18674
|
+
marginRight = props.marginRight,
|
|
18675
|
+
mr = props.mr,
|
|
18676
|
+
marginBottom = props.marginBottom,
|
|
18677
|
+
mb = props.mb,
|
|
18678
|
+
marginLeft = props.marginLeft,
|
|
18679
|
+
ml = props.ml,
|
|
18680
|
+
px = props.px,
|
|
18681
|
+
py = props.py,
|
|
18682
|
+
mx = props.mx,
|
|
18683
|
+
my = props.my,
|
|
18684
|
+
width = props.width,
|
|
18685
|
+
height = props.height,
|
|
18686
|
+
font = props.font,
|
|
18687
|
+
w = props.w,
|
|
18688
|
+
h = props.h,
|
|
18689
|
+
margin = props.margin,
|
|
18690
|
+
padding = props.padding,
|
|
18691
|
+
_props$unit = props.unit,
|
|
18692
|
+
unit = _props$unit === undefined ? layout.unit : _props$unit,
|
|
18693
|
+
_props$scale = props.scale,
|
|
18694
|
+
scale = _props$scale === undefined ? 1 : _props$scale;
|
|
18695
|
+
var makeScaleHandler = function makeScaleHandler(attrValue) {
|
|
18696
|
+
return function (scale1x, defaultValue) {
|
|
18697
|
+
// 0 means disable scale and the default value is 0
|
|
18698
|
+
if (scale1x === 0) {
|
|
18699
|
+
scale1x = 1;
|
|
18700
|
+
defaultValue = defaultValue || 0;
|
|
18701
|
+
}
|
|
18702
|
+
var factor = reduceScaleCoefficient(scale) * scale1x;
|
|
18703
|
+
if (typeof attrValue === 'undefined') {
|
|
18704
|
+
if (typeof defaultValue !== 'undefined') return "".concat(defaultValue);
|
|
18705
|
+
return "calc(".concat(factor, " * ").concat(unit, ")");
|
|
18706
|
+
}
|
|
18707
|
+
if (!isCSSNumberValue(attrValue)) return "".concat(attrValue);
|
|
18708
|
+
var customFactor = factor * Number(attrValue);
|
|
18709
|
+
return "calc(".concat(customFactor, " * ").concat(unit, ")");
|
|
18710
|
+
};
|
|
18711
|
+
};
|
|
18712
|
+
var value = {
|
|
18713
|
+
unit: unit,
|
|
18714
|
+
SCALES: {
|
|
18715
|
+
pt: makeScaleHandler((_ref2 = (_ref3 = paddingTop !== null && paddingTop !== undefined ? paddingTop : pt) !== null && _ref3 !== undefined ? _ref3 : py) !== null && _ref2 !== undefined ? _ref2 : padding),
|
|
18716
|
+
pr: makeScaleHandler((_ref4 = (_ref5 = paddingRight !== null && paddingRight !== undefined ? paddingRight : pr) !== null && _ref5 !== undefined ? _ref5 : px) !== null && _ref4 !== undefined ? _ref4 : padding),
|
|
18717
|
+
pb: makeScaleHandler((_ref6 = (_ref7 = paddingBottom !== null && paddingBottom !== undefined ? paddingBottom : pb) !== null && _ref7 !== undefined ? _ref7 : py) !== null && _ref6 !== undefined ? _ref6 : padding),
|
|
18718
|
+
pl: makeScaleHandler((_ref8 = (_ref9 = paddingLeft !== null && paddingLeft !== undefined ? paddingLeft : pl) !== null && _ref9 !== undefined ? _ref9 : px) !== null && _ref8 !== undefined ? _ref8 : padding),
|
|
18719
|
+
px: makeScaleHandler((_ref10 = (_ref11 = (_ref12 = (_ref13 = px !== null && px !== undefined ? px : paddingLeft) !== null && _ref13 !== undefined ? _ref13 : paddingRight) !== null && _ref12 !== undefined ? _ref12 : pl) !== null && _ref11 !== undefined ? _ref11 : pr) !== null && _ref10 !== undefined ? _ref10 : padding),
|
|
18720
|
+
py: makeScaleHandler((_ref14 = (_ref15 = (_ref16 = (_ref17 = py !== null && py !== undefined ? py : paddingTop) !== null && _ref17 !== undefined ? _ref17 : paddingBottom) !== null && _ref16 !== undefined ? _ref16 : pt) !== null && _ref15 !== undefined ? _ref15 : pb) !== null && _ref14 !== undefined ? _ref14 : padding),
|
|
18721
|
+
mt: makeScaleHandler((_ref18 = (_ref19 = marginTop !== null && marginTop !== undefined ? marginTop : mt) !== null && _ref19 !== undefined ? _ref19 : my) !== null && _ref18 !== undefined ? _ref18 : margin),
|
|
18722
|
+
mr: makeScaleHandler((_ref20 = (_ref21 = marginRight !== null && marginRight !== undefined ? marginRight : mr) !== null && _ref21 !== undefined ? _ref21 : mx) !== null && _ref20 !== undefined ? _ref20 : margin),
|
|
18723
|
+
mb: makeScaleHandler((_ref22 = (_ref23 = marginBottom !== null && marginBottom !== undefined ? marginBottom : mb) !== null && _ref23 !== undefined ? _ref23 : my) !== null && _ref22 !== undefined ? _ref22 : margin),
|
|
18724
|
+
ml: makeScaleHandler((_ref24 = (_ref25 = marginLeft !== null && marginLeft !== undefined ? marginLeft : ml) !== null && _ref25 !== undefined ? _ref25 : mx) !== null && _ref24 !== undefined ? _ref24 : margin),
|
|
18725
|
+
mx: makeScaleHandler((_ref26 = (_ref27 = (_ref28 = (_ref29 = mx !== null && mx !== undefined ? mx : marginLeft) !== null && _ref29 !== undefined ? _ref29 : marginRight) !== null && _ref28 !== undefined ? _ref28 : ml) !== null && _ref27 !== undefined ? _ref27 : mr) !== null && _ref26 !== undefined ? _ref26 : margin),
|
|
18726
|
+
my: makeScaleHandler((_ref30 = (_ref31 = (_ref32 = (_ref33 = my !== null && my !== undefined ? my : marginTop) !== null && _ref33 !== undefined ? _ref33 : marginBottom) !== null && _ref32 !== undefined ? _ref32 : mt) !== null && _ref31 !== undefined ? _ref31 : mb) !== null && _ref30 !== undefined ? _ref30 : margin),
|
|
18727
|
+
width: makeScaleHandler(width !== null && width !== undefined ? width : w),
|
|
18728
|
+
height: makeScaleHandler(height !== null && height !== undefined ? height : h),
|
|
18729
|
+
font: makeScaleHandler(font)
|
|
18730
|
+
},
|
|
18731
|
+
getScaleProps: generateGetScaleProps(props),
|
|
18732
|
+
getAllScaleProps: generateGetAllScaleProps(props)
|
|
18733
|
+
};
|
|
18734
|
+
return /*#__PURE__*/React.createElement(ScaleContext.Provider, {
|
|
18735
|
+
value: value
|
|
18736
|
+
}, /*#__PURE__*/React.createElement(Render, _extends({}, props, {
|
|
18737
|
+
ref: ref
|
|
18738
|
+
}), children));
|
|
18739
|
+
});
|
|
18740
|
+
ScaleFC.displayName = "Scale".concat(Render.displayName || 'Wrapper');
|
|
18741
|
+
return ScaleFC;
|
|
18742
|
+
};
|
|
18743
|
+
|
|
18744
|
+
var warningStack = {};
|
|
18745
|
+
var useWarning = function useWarning(message, component) {
|
|
18746
|
+
var tag = " [".concat(component, "]") ;
|
|
18747
|
+
var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
|
|
18748
|
+
if (typeof console === 'undefined') return;
|
|
18749
|
+
if (warningStack[log]) return;
|
|
18750
|
+
warningStack[log] = true;
|
|
18751
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
18752
|
+
return console.error(log);
|
|
18753
|
+
}
|
|
18754
|
+
console.warn(log);
|
|
20209
18755
|
};
|
|
20210
18756
|
|
|
20211
18757
|
/* "use client" */
|
|
@@ -20249,7 +18795,7 @@ var TableColumn = function TableColumn(columnProps) {
|
|
|
20249
18795
|
};
|
|
20250
18796
|
TableColumn.displayName = 'TableColumn';
|
|
20251
18797
|
|
|
20252
|
-
var _excluded$
|
|
18798
|
+
var _excluded$8 = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "onRow", "onCell", "onChange", "onFilters", "showFilters", "onSelected", "className", "rowClassName"];
|
|
20253
18799
|
function TableComponent(tableProps) {
|
|
20254
18800
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
20255
18801
|
var _ref = tableProps,
|
|
@@ -20278,7 +18824,7 @@ function TableComponent(tableProps) {
|
|
|
20278
18824
|
rowClassName = _ref$rowClassName === undefined ? function () {
|
|
20279
18825
|
return '';
|
|
20280
18826
|
} : _ref$rowClassName,
|
|
20281
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18827
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
20282
18828
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
20283
18829
|
var _useScale = useScale(),
|
|
20284
18830
|
SCALES = _useScale.SCALES;
|
|
@@ -20313,6 +18859,10 @@ function TableComponent(tableProps) {
|
|
|
20313
18859
|
updateColumn: updateColumn
|
|
20314
18860
|
};
|
|
20315
18861
|
}, [columns]);
|
|
18862
|
+
var _React$useState = React.useState({}),
|
|
18863
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
18864
|
+
filters = _React$useState2[0],
|
|
18865
|
+
setFilters = _React$useState2[1];
|
|
20316
18866
|
React.useEffect(function () {
|
|
20317
18867
|
if (typeof customData === 'undefined') return;
|
|
20318
18868
|
setData(customData);
|
|
@@ -20320,16 +18870,82 @@ function TableComponent(tableProps) {
|
|
|
20320
18870
|
useResize(function () {
|
|
20321
18871
|
return updateShape();
|
|
20322
18872
|
});
|
|
18873
|
+
var handleFilterChange = function handleFilterChange(name, value) {
|
|
18874
|
+
setFilters(function (prevFilters) {
|
|
18875
|
+
var updatedFilters = _objectSpread2(_objectSpread2({}, prevFilters), {}, _defineProperty({}, name, value));
|
|
18876
|
+
// Call onFiltersChange to propagate filter changes to the parent
|
|
18877
|
+
if (onFilters) {
|
|
18878
|
+
onFilters(updatedFilters);
|
|
18879
|
+
}
|
|
18880
|
+
return updatedFilters;
|
|
18881
|
+
});
|
|
18882
|
+
};
|
|
18883
|
+
var generateFilterInputs = function generateFilterInputs() {
|
|
18884
|
+
return columns.map(function (col) {
|
|
18885
|
+
var _String, _filters$filterName;
|
|
18886
|
+
var Header = col.label,
|
|
18887
|
+
accessor = col.filter,
|
|
18888
|
+
options = col.options;
|
|
18889
|
+
var filterName = (_String = String(col === null || col === undefined ? undefined : col.label)) === null || _String === undefined ? undefined : _String.replace(' ', '_').toLowerCase();
|
|
18890
|
+
var unq_accessor = _.uniqueId(filterName);
|
|
18891
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
18892
|
+
style: {
|
|
18893
|
+
margin: '3px'
|
|
18894
|
+
},
|
|
18895
|
+
"data-column": Header,
|
|
18896
|
+
key: unq_accessor
|
|
18897
|
+
}, accessor === 'fixed' && /*#__PURE__*/React.createElement(Select, {
|
|
18898
|
+
key: unq_accessor,
|
|
18899
|
+
name: filterName,
|
|
18900
|
+
value: (_filters$filterName = filters[filterName]) !== null && _filters$filterName !== undefined ? _filters$filterName : 'All',
|
|
18901
|
+
onChange: function onChange(newValue) {
|
|
18902
|
+
return handleFilterChange(filterName, newValue);
|
|
18903
|
+
}
|
|
18904
|
+
}, /*#__PURE__*/React.createElement(Select.Option, {
|
|
18905
|
+
value: "All"
|
|
18906
|
+
}, "All ", Header), options ? options.map(function (option) {
|
|
18907
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
18908
|
+
value: option.value
|
|
18909
|
+
}, option.name);
|
|
18910
|
+
}) : null), accessor === 'date' && /*#__PURE__*/React.createElement(Input, {
|
|
18911
|
+
id: "filter-date-".concat(filterName),
|
|
18912
|
+
htmlType: "date",
|
|
18913
|
+
name: filterName,
|
|
18914
|
+
value: filters[filterName],
|
|
18915
|
+
onChange: function onChange(e) {
|
|
18916
|
+
return handleFilterChange(filterName, e.target.value);
|
|
18917
|
+
}
|
|
18918
|
+
}), accessor === 'search' && /*#__PURE__*/React.createElement(Input, {
|
|
18919
|
+
id: "filter-search-".concat(filterName),
|
|
18920
|
+
htmlType: "text",
|
|
18921
|
+
autoComplete: "off",
|
|
18922
|
+
name: filterName,
|
|
18923
|
+
style: {
|
|
18924
|
+
height: 30,
|
|
18925
|
+
minWidth: 160
|
|
18926
|
+
},
|
|
18927
|
+
value: filters[filterName],
|
|
18928
|
+
onChange: function onChange(e) {
|
|
18929
|
+
return handleFilterChange(filterName, e.target.value);
|
|
18930
|
+
},
|
|
18931
|
+
placeholder: "Search...",
|
|
18932
|
+
fullWidth: true
|
|
18933
|
+
}));
|
|
18934
|
+
});
|
|
18935
|
+
};
|
|
20323
18936
|
return /*#__PURE__*/React.createElement(TableContext.Provider, {
|
|
20324
18937
|
value: contextValue
|
|
20325
|
-
}, /*#__PURE__*/React.createElement("
|
|
18938
|
+
}, showFilters && /*#__PURE__*/React.createElement("div", {
|
|
18939
|
+
style: {
|
|
18940
|
+
display: 'flex',
|
|
18941
|
+
gap: 6
|
|
18942
|
+
}
|
|
18943
|
+
}, generateFilterInputs()), /*#__PURE__*/React.createElement("table", _extends({
|
|
20326
18944
|
ref: ref
|
|
20327
18945
|
}, props, {
|
|
20328
18946
|
className: _JSXStyle.dynamic([["2132340556", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || "")
|
|
20329
18947
|
}), /*#__PURE__*/React.createElement(TableHead, {
|
|
20330
18948
|
columns: columns,
|
|
20331
|
-
onFilters: onFilters,
|
|
20332
|
-
showFilters: showFilters,
|
|
20333
18949
|
width: width
|
|
20334
18950
|
}), /*#__PURE__*/React.createElement(TableBody, {
|
|
20335
18951
|
data: data,
|
|
@@ -30227,6 +28843,144 @@ const HelpCircle = ({ color, strokeWidth, set }) => {
|
|
|
30227
28843
|
HelpCircle.displayName = "HelpCircle";
|
|
30228
28844
|
createIcon(HelpCircle);
|
|
30229
28845
|
|
|
28846
|
+
var _excluded$7 = ["xs", "sm", "md", "lg", "xl", "justify", "direction", "alignItems", "alignContent", "children", "className"];
|
|
28847
|
+
var getItemLayout = function getItemLayout(val) {
|
|
28848
|
+
var display = val === 0 ? 'display: none;' : 'display: inherit;';
|
|
28849
|
+
if (typeof val === 'number') {
|
|
28850
|
+
var width = 100 / 24 * val;
|
|
28851
|
+
var ratio = width > 100 ? '100%' : width < 0 ? '0' : "".concat(width, "%");
|
|
28852
|
+
return {
|
|
28853
|
+
grow: 0,
|
|
28854
|
+
display: display,
|
|
28855
|
+
width: ratio,
|
|
28856
|
+
basis: ratio
|
|
28857
|
+
};
|
|
28858
|
+
}
|
|
28859
|
+
return {
|
|
28860
|
+
grow: 1,
|
|
28861
|
+
display: display,
|
|
28862
|
+
width: '100%',
|
|
28863
|
+
basis: '0'
|
|
28864
|
+
};
|
|
28865
|
+
};
|
|
28866
|
+
var GridBasicItem = function GridBasicItem(_ref) {
|
|
28867
|
+
var _ref$xs = _ref.xs,
|
|
28868
|
+
xs = _ref$xs === undefined ? false : _ref$xs,
|
|
28869
|
+
_ref$sm = _ref.sm,
|
|
28870
|
+
sm = _ref$sm === undefined ? false : _ref$sm,
|
|
28871
|
+
_ref$md = _ref.md,
|
|
28872
|
+
md = _ref$md === undefined ? false : _ref$md,
|
|
28873
|
+
_ref$lg = _ref.lg,
|
|
28874
|
+
lg = _ref$lg === undefined ? false : _ref$lg,
|
|
28875
|
+
_ref$xl = _ref.xl,
|
|
28876
|
+
xl = _ref$xl === undefined ? false : _ref$xl,
|
|
28877
|
+
justify = _ref.justify,
|
|
28878
|
+
direction = _ref.direction,
|
|
28879
|
+
alignItems = _ref.alignItems,
|
|
28880
|
+
alignContent = _ref.alignContent,
|
|
28881
|
+
children = _ref.children,
|
|
28882
|
+
_ref$className = _ref.className,
|
|
28883
|
+
className = _ref$className === undefined ? '' : _ref$className,
|
|
28884
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
28885
|
+
var theme = useTheme();
|
|
28886
|
+
var _useScale = useScale(),
|
|
28887
|
+
SCALES = _useScale.SCALES;
|
|
28888
|
+
var classes = React.useMemo(function () {
|
|
28889
|
+
var aligns = {
|
|
28890
|
+
justify: justify,
|
|
28891
|
+
direction: direction,
|
|
28892
|
+
alignItems: alignItems,
|
|
28893
|
+
alignContent: alignContent,
|
|
28894
|
+
xs: xs,
|
|
28895
|
+
sm: sm,
|
|
28896
|
+
md: md,
|
|
28897
|
+
lg: lg,
|
|
28898
|
+
xl: xl
|
|
28899
|
+
};
|
|
28900
|
+
var classString = Object.keys(aligns).reduce(function (pre, name) {
|
|
28901
|
+
if (aligns[name] !== undefined && aligns[name] !== false) return "".concat(pre, " ").concat(name);
|
|
28902
|
+
return pre;
|
|
28903
|
+
}, '');
|
|
28904
|
+
return classString.trim();
|
|
28905
|
+
}, [justify, direction, alignItems, alignContent, xs, sm, md, lg, xl]);
|
|
28906
|
+
var layout = React.useMemo(function () {
|
|
28907
|
+
return {
|
|
28908
|
+
xs: getItemLayout(xs),
|
|
28909
|
+
sm: getItemLayout(sm),
|
|
28910
|
+
md: getItemLayout(md),
|
|
28911
|
+
lg: getItemLayout(lg),
|
|
28912
|
+
xl: getItemLayout(xl)
|
|
28913
|
+
};
|
|
28914
|
+
}, [xs, sm, md, lg, xl]);
|
|
28915
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
28916
|
+
className: _JSXStyle.dynamic([["568430467", [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]]]) + " " + (props && props.className != null && props.className || useClasses('item', classes, className) || "")
|
|
28917
|
+
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
28918
|
+
id: "568430467",
|
|
28919
|
+
dynamic: [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]
|
|
28920
|
+
}, ".item.__jsx-style-dynamic-selector{font-size:".concat(SCALES.font(1, 'inherit'), ";height:").concat(SCALES.height(1, 'auto'), ";}.justify.__jsx-style-dynamic-selector{-webkit-box-pack:").concat(justify, ";-webkit-justify-content:").concat(justify, ";-ms-flex-pack:").concat(justify, ";justify-content:").concat(justify, ";}.direction.__jsx-style-dynamic-selector{-webkit-flex-direction:").concat(direction, ";-ms-flex-direction:").concat(direction, ";flex-direction:").concat(direction, ";}.alignContent.__jsx-style-dynamic-selector{-webkit-align-content:").concat(alignContent, ";-ms-flex-line-pack:").concat(alignContent, ";align-content:").concat(alignContent, ";}.alignItems.__jsx-style-dynamic-selector{-webkit-align-items:").concat(alignItems, ";-webkit-box-align:").concat(alignItems, ";-ms-flex-align:").concat(alignItems, ";align-items:").concat(alignItems, ";}.xs.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.xs.grow, ";-webkit-flex-grow:").concat(layout.xs.grow, ";-ms-flex-positive:").concat(layout.xs.grow, ";flex-grow:").concat(layout.xs.grow, ";max-width:").concat(layout.xs.width, ";-webkit-flex-basis:").concat(layout.xs.basis, ";-ms-flex-preferred-size:").concat(layout.xs.basis, ";flex-basis:").concat(layout.xs.basis, ";").concat(layout.xs.display, ";}@media only screen and (min-width:").concat(theme.breakpoints.sm.min, "){.sm.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.sm.grow, ";-webkit-flex-grow:").concat(layout.sm.grow, ";-ms-flex-positive:").concat(layout.sm.grow, ";flex-grow:").concat(layout.sm.grow, ";max-width:").concat(layout.sm.width, ";-webkit-flex-basis:").concat(layout.sm.basis, ";-ms-flex-preferred-size:").concat(layout.sm.basis, ";flex-basis:").concat(layout.sm.basis, ";").concat(layout.sm.display, ";}}@media only screen and (min-width:").concat(theme.breakpoints.md.min, "){.md.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.md.grow, ";-webkit-flex-grow:").concat(layout.md.grow, ";-ms-flex-positive:").concat(layout.md.grow, ";flex-grow:").concat(layout.md.grow, ";max-width:").concat(layout.md.width, ";-webkit-flex-basis:").concat(layout.md.basis, ";-ms-flex-preferred-size:").concat(layout.md.basis, ";flex-basis:").concat(layout.md.basis, ";").concat(layout.md.display, ";}}@media only screen and (min-width:").concat(theme.breakpoints.lg.min, "){.lg.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.lg.grow, ";-webkit-flex-grow:").concat(layout.lg.grow, ";-ms-flex-positive:").concat(layout.lg.grow, ";flex-grow:").concat(layout.lg.grow, ";max-width:").concat(layout.lg.width, ";-webkit-flex-basis:").concat(layout.lg.basis, ";-ms-flex-preferred-size:").concat(layout.lg.basis, ";flex-basis:").concat(layout.lg.basis, ";").concat(layout.lg.display, ";}}@media only screen and (min-width:").concat(theme.breakpoints.xl.min, "){.xl.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.xl.grow, ";-webkit-flex-grow:").concat(layout.xl.grow, ";-ms-flex-positive:").concat(layout.xl.grow, ";flex-grow:").concat(layout.xl.grow, ";max-width:").concat(layout.xl.width, ";-webkit-flex-basis:").concat(layout.xl.basis, ";-ms-flex-preferred-size:").concat(layout.xl.basis, ";flex-basis:").concat(layout.xl.basis, ";").concat(layout.xl.display, ";}}")));
|
|
28921
|
+
};
|
|
28922
|
+
GridBasicItem.displayName = 'GridBasicItem';
|
|
28923
|
+
|
|
28924
|
+
var _excluded$6 = ["gap", "wrap", "children", "className"];
|
|
28925
|
+
var GridContainerComponent = function GridContainerComponent(_ref) {
|
|
28926
|
+
var _ref$gap = _ref.gap,
|
|
28927
|
+
gap = _ref$gap === undefined ? 0 : _ref$gap,
|
|
28928
|
+
_ref$wrap = _ref.wrap,
|
|
28929
|
+
wrap = _ref$wrap === undefined ? 'wrap' : _ref$wrap,
|
|
28930
|
+
children = _ref.children,
|
|
28931
|
+
_ref$className = _ref.className,
|
|
28932
|
+
className = _ref$className === undefined ? '' : _ref$className,
|
|
28933
|
+
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
28934
|
+
var _useScale = useScale(),
|
|
28935
|
+
unit = _useScale.unit,
|
|
28936
|
+
SCALES = _useScale.SCALES;
|
|
28937
|
+
var gapUnit = React.useMemo(function () {
|
|
28938
|
+
return "calc(".concat(gap, " * ").concat(unit, " * 1/3)");
|
|
28939
|
+
}, [gap, unit]);
|
|
28940
|
+
var _styles$className = {
|
|
28941
|
+
styles: /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
28942
|
+
id: "3631618093",
|
|
28943
|
+
dynamic: [gapUnit, wrap, SCALES.width(1, 'var(--grid-container-width)'), SCALES.mt(0, 'var(--grid-container-margin)'), SCALES.mr(0, 'var(--grid-container-margin)'), SCALES.mb(0, 'var(--grid-container-margin)'), SCALES.ml(0, 'var(--grid-container-margin)')]
|
|
28944
|
+
}, "div.__jsx-style-dynamic-selector{--grid-gap-unit:".concat(gapUnit, ";--grid-container-margin:calc(-1 * var(--grid-gap-unit));--grid-container-width:calc(100% + var(--grid-gap-unit) * 2);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:").concat(wrap, ";-ms-flex-wrap:").concat(wrap, ";flex-wrap:").concat(wrap, ";box-sizing:border-box;width:").concat(SCALES.width(1, 'var(--grid-container-width)'), ";margin:").concat(SCALES.mt(0, 'var(--grid-container-margin)'), " ").concat(SCALES.mr(0, 'var(--grid-container-margin)'), " ").concat(SCALES.mb(0, 'var(--grid-container-margin)'), " ").concat(SCALES.ml(0, 'var(--grid-container-margin)'), ";}")),
|
|
28945
|
+
className: _JSXStyle.dynamic([["3631618093", [gapUnit, wrap, SCALES.width(1, 'var(--grid-container-width)'), SCALES.mt(0, 'var(--grid-container-margin)'), SCALES.mr(0, 'var(--grid-container-margin)'), SCALES.mb(0, 'var(--grid-container-margin)'), SCALES.ml(0, 'var(--grid-container-margin)')]]])
|
|
28946
|
+
},
|
|
28947
|
+
resolveClassName = _styles$className.className,
|
|
28948
|
+
styles = _styles$className.styles;
|
|
28949
|
+
var classes = useClasses(resolveClassName, className);
|
|
28950
|
+
return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
|
|
28951
|
+
className: classes
|
|
28952
|
+
}, props), children, styles);
|
|
28953
|
+
};
|
|
28954
|
+
GridContainerComponent.displayName = 'GridContainer';
|
|
28955
|
+
var GridContainer = withScale(GridContainerComponent);
|
|
28956
|
+
|
|
28957
|
+
var _excluded$5 = ["children", "className"];
|
|
28958
|
+
var GridComponent = function GridComponent(_ref) {
|
|
28959
|
+
var children = _ref.children,
|
|
28960
|
+
_ref$className = _ref.className,
|
|
28961
|
+
className = _ref$className === undefined ? '' : _ref$className,
|
|
28962
|
+
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
28963
|
+
var _useScale = useScale(),
|
|
28964
|
+
SCALES = _useScale.SCALES;
|
|
28965
|
+
var _styles$className = {
|
|
28966
|
+
styles: /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
28967
|
+
id: "1271839607",
|
|
28968
|
+
dynamic: [SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0, 'var(--grid-gap-unit)'), SCALES.pr(0, 'var(--grid-gap-unit)'), SCALES.pb(0, 'var(--grid-gap-unit)'), SCALES.pl(0, 'var(--grid-gap-unit)')]
|
|
28969
|
+
}, "div.__jsx-style-dynamic-selector{margin:".concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";box-sizing:border-box;padding:").concat(SCALES.pt(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pr(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pb(0, 'var(--grid-gap-unit)'), " ").concat(SCALES.pl(0, 'var(--grid-gap-unit)'), ";}")),
|
|
28970
|
+
className: _JSXStyle.dynamic([["1271839607", [SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0, 'var(--grid-gap-unit)'), SCALES.pr(0, 'var(--grid-gap-unit)'), SCALES.pb(0, 'var(--grid-gap-unit)'), SCALES.pl(0, 'var(--grid-gap-unit)')]]])
|
|
28971
|
+
},
|
|
28972
|
+
resolveClassName = _styles$className.className,
|
|
28973
|
+
styles = _styles$className.styles;
|
|
28974
|
+
var classes = useClasses(resolveClassName, className);
|
|
28975
|
+
return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
|
|
28976
|
+
className: classes
|
|
28977
|
+
}, props), children, styles);
|
|
28978
|
+
};
|
|
28979
|
+
GridComponent.displayName = 'Grid';
|
|
28980
|
+
var Grid = withScale(GridComponent);
|
|
28981
|
+
|
|
28982
|
+
Grid.Container = GridContainer;
|
|
28983
|
+
|
|
30230
28984
|
var ButtonDrip = function ButtonDrip(_ref) {
|
|
30231
28985
|
var _ref$x = _ref.x,
|
|
30232
28986
|
x = _ref$x === undefined ? 0 : _ref$x,
|
|
@@ -30281,7 +29035,7 @@ var ButtonDrip = function ButtonDrip(_ref) {
|
|
|
30281
29035
|
};
|
|
30282
29036
|
ButtonDrip.displayName = 'ButtonDrip';
|
|
30283
29037
|
|
|
30284
|
-
var _excluded$
|
|
29038
|
+
var _excluded$4 = ["children", "type", "color", "className", "spaceRatio"];
|
|
30285
29039
|
var getIconBgColor = function getIconBgColor(type, palette, color) {
|
|
30286
29040
|
var colors = {
|
|
30287
29041
|
"default": palette.accents_6,
|
|
@@ -30301,7 +29055,7 @@ var LoadingComponent = function LoadingComponent(_ref) {
|
|
|
30301
29055
|
className = _ref$className === undefined ? '' : _ref$className,
|
|
30302
29056
|
_ref$spaceRatio = _ref.spaceRatio,
|
|
30303
29057
|
spaceRatio = _ref$spaceRatio === undefined ? 1 : _ref$spaceRatio,
|
|
30304
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
29058
|
+
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
30305
29059
|
var theme = useTheme();
|
|
30306
29060
|
var _useScale = useScale(),
|
|
30307
29061
|
SCALES = _useScale.SCALES;
|
|
@@ -30341,7 +29095,7 @@ var ButtonLoading = function ButtonLoading(_ref) {
|
|
|
30341
29095
|
};
|
|
30342
29096
|
ButtonLoading.displayName = 'GeistButtonLoading';
|
|
30343
29097
|
|
|
30344
|
-
var _excluded$
|
|
29098
|
+
var _excluded$3 = ["isRight", "isSingle", "children", "className"];
|
|
30345
29099
|
var ButtonIcon = function ButtonIcon(_ref) {
|
|
30346
29100
|
var _ref$isRight = _ref.isRight,
|
|
30347
29101
|
isRight = _ref$isRight === undefined ? false : _ref$isRight,
|
|
@@ -30349,7 +29103,7 @@ var ButtonIcon = function ButtonIcon(_ref) {
|
|
|
30349
29103
|
children = _ref.children,
|
|
30350
29104
|
_ref$className = _ref.className,
|
|
30351
29105
|
className = _ref$className === undefined ? '' : _ref$className,
|
|
30352
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
29106
|
+
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
30353
29107
|
var classes = useClasses('icon', {
|
|
30354
29108
|
right: isRight,
|
|
30355
29109
|
single: isSingle
|
|
@@ -30631,7 +29385,7 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
|
|
|
30631
29385
|
return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
|
|
30632
29386
|
};
|
|
30633
29387
|
|
|
30634
|
-
var _excluded$
|
|
29388
|
+
var _excluded$2 = ["children", "disabled", "type", "loading", "shadow", "ghost", "effect", "onClick", "auto", "icon", "htmlType", "iconRight", "className", "crossOrigin"];
|
|
30635
29389
|
var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
30636
29390
|
var theme = useTheme();
|
|
30637
29391
|
var _useScale = useScale(),
|
|
@@ -30677,7 +29431,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
30677
29431
|
_filteredProps$classN = filteredProps.className,
|
|
30678
29432
|
className = _filteredProps$classN === undefined ? '' : _filteredProps$classN;
|
|
30679
29433
|
filteredProps.crossOrigin;
|
|
30680
|
-
var props = _objectWithoutProperties(filteredProps, _excluded$
|
|
29434
|
+
var props = _objectWithoutProperties(filteredProps, _excluded$2);
|
|
30681
29435
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
30682
29436
|
|
|
30683
29437
|
var _useMemo = React.useMemo(function () {
|
|
@@ -30746,6 +29500,121 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
30746
29500
|
ButtonComponent.displayName = 'Button';
|
|
30747
29501
|
var Button = withScale(ButtonComponent);
|
|
30748
29502
|
|
|
29503
|
+
var useSSR = function useSSR() {
|
|
29504
|
+
var _useState = React.useState(false),
|
|
29505
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29506
|
+
browser = _useState2[0],
|
|
29507
|
+
setBrowser = _useState2[1];
|
|
29508
|
+
React.useEffect(function () {
|
|
29509
|
+
setBrowser(isBrowser());
|
|
29510
|
+
}, []);
|
|
29511
|
+
return {
|
|
29512
|
+
isBrowser: browser,
|
|
29513
|
+
isServer: !browser
|
|
29514
|
+
};
|
|
29515
|
+
};
|
|
29516
|
+
|
|
29517
|
+
var createElement = function createElement(id) {
|
|
29518
|
+
var el = document.createElement('div');
|
|
29519
|
+
el.setAttribute('id', id);
|
|
29520
|
+
return el;
|
|
29521
|
+
};
|
|
29522
|
+
var usePortal = function usePortal() {
|
|
29523
|
+
var selectId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getId();
|
|
29524
|
+
var getContainer = arguments.length > 1 ? arguments[1] : undefined;
|
|
29525
|
+
var id = "helpdice-ui-".concat(selectId);
|
|
29526
|
+
var _useSSR = useSSR(),
|
|
29527
|
+
isBrowser = _useSSR.isBrowser;
|
|
29528
|
+
var _useState = React.useState(isBrowser ? createElement(id) : null),
|
|
29529
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29530
|
+
elSnapshot = _useState2[0],
|
|
29531
|
+
setElSnapshot = _useState2[1];
|
|
29532
|
+
React.useEffect(function () {
|
|
29533
|
+
var customContainer = getContainer ? getContainer() : null;
|
|
29534
|
+
var parentElement = customContainer || document.body;
|
|
29535
|
+
var hasElement = parentElement.querySelector("#".concat(id));
|
|
29536
|
+
var el = hasElement || createElement(id);
|
|
29537
|
+
if (!hasElement) {
|
|
29538
|
+
parentElement.appendChild(el);
|
|
29539
|
+
}
|
|
29540
|
+
setElSnapshot(el);
|
|
29541
|
+
}, []);
|
|
29542
|
+
return elSnapshot;
|
|
29543
|
+
};
|
|
29544
|
+
|
|
29545
|
+
var _excluded$1 = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
|
|
29546
|
+
var CssTransition = function CssTransition(_ref) {
|
|
29547
|
+
var children = _ref.children,
|
|
29548
|
+
_ref$className = _ref.className,
|
|
29549
|
+
className = _ref$className === undefined ? '' : _ref$className,
|
|
29550
|
+
_ref$visible = _ref.visible,
|
|
29551
|
+
visible = _ref$visible === undefined ? false : _ref$visible,
|
|
29552
|
+
_ref$enterTime = _ref.enterTime,
|
|
29553
|
+
enterTime = _ref$enterTime === undefined ? 60 : _ref$enterTime,
|
|
29554
|
+
_ref$leaveTime = _ref.leaveTime,
|
|
29555
|
+
leaveTime = _ref$leaveTime === undefined ? 60 : _ref$leaveTime,
|
|
29556
|
+
_ref$clearTime = _ref.clearTime,
|
|
29557
|
+
clearTime = _ref$clearTime === undefined ? 60 : _ref$clearTime,
|
|
29558
|
+
_ref$name = _ref.name,
|
|
29559
|
+
name = _ref$name === undefined ? 'transition' : _ref$name,
|
|
29560
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
29561
|
+
var _useState = React.useState(''),
|
|
29562
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29563
|
+
classes = _useState2[0],
|
|
29564
|
+
setClasses = _useState2[1];
|
|
29565
|
+
var _useState3 = React.useState(visible),
|
|
29566
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29567
|
+
renderable = _useState4[0],
|
|
29568
|
+
setRenderable = _useState4[1];
|
|
29569
|
+
React.useEffect(function () {
|
|
29570
|
+
var statusClassName = visible ? 'enter' : 'leave';
|
|
29571
|
+
var time = visible ? enterTime : leaveTime;
|
|
29572
|
+
if (visible && !renderable) {
|
|
29573
|
+
setRenderable(true);
|
|
29574
|
+
}
|
|
29575
|
+
setClasses("".concat(name, "-").concat(statusClassName));
|
|
29576
|
+
|
|
29577
|
+
// set class to active
|
|
29578
|
+
var timer = setTimeout(function () {
|
|
29579
|
+
setClasses("".concat(name, "-").concat(statusClassName, " ").concat(name, "-").concat(statusClassName, "-active"));
|
|
29580
|
+
clearTimeout(timer);
|
|
29581
|
+
}, time);
|
|
29582
|
+
|
|
29583
|
+
// remove classess when animation over
|
|
29584
|
+
var clearClassesTimer = setTimeout(function () {
|
|
29585
|
+
if (!visible) {
|
|
29586
|
+
setClasses('');
|
|
29587
|
+
setRenderable(false);
|
|
29588
|
+
}
|
|
29589
|
+
clearTimeout(clearClassesTimer);
|
|
29590
|
+
}, time + clearTime);
|
|
29591
|
+
return function () {
|
|
29592
|
+
clearTimeout(timer);
|
|
29593
|
+
clearTimeout(clearClassesTimer);
|
|
29594
|
+
};
|
|
29595
|
+
}, [visible, renderable]);
|
|
29596
|
+
if (! /*#__PURE__*/React.isValidElement(children) || !renderable) return null;
|
|
29597
|
+
var propsTransition = _objectSpread2(_objectSpread2({}, props), {}, {
|
|
29598
|
+
className: "".concat(children.props.className, " ").concat(className, " ").concat(classes)
|
|
29599
|
+
});
|
|
29600
|
+
return /*#__PURE__*/React.cloneElement(children, propsTransition);
|
|
29601
|
+
};
|
|
29602
|
+
CssTransition.displayName = 'CssTransition';
|
|
29603
|
+
|
|
29604
|
+
/* "use client" */
|
|
29605
|
+
|
|
29606
|
+
var useClickAnyWhere = function useClickAnyWhere(handler) {
|
|
29607
|
+
React.useEffect(function () {
|
|
29608
|
+
var callback = function callback(event) {
|
|
29609
|
+
return handler(event);
|
|
29610
|
+
};
|
|
29611
|
+
document.addEventListener('click', callback);
|
|
29612
|
+
return function () {
|
|
29613
|
+
return document.removeEventListener('click', callback);
|
|
29614
|
+
};
|
|
29615
|
+
}, [handler]);
|
|
29616
|
+
};
|
|
29617
|
+
|
|
30749
29618
|
var getColors = function getColors(type, palette) {
|
|
30750
29619
|
var colors = {
|
|
30751
29620
|
"default": palette.background,
|