@helpdice/ui 2.1.5 → 2.1.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/auto-complete/index.js +12 -10
- package/dist/button/button.d.ts +1 -1
- package/dist/button/index.js +73 -16
- package/dist/button/styles.d.ts +1 -0
- package/dist/carousal/index.js +73 -16
- package/dist/copy-to-clipboard/clipboard.d.ts +2 -0
- package/dist/copy-to-clipboard/copy.d.ts +2 -0
- package/dist/copy-to-clipboard/index.d.ts +2 -0
- package/dist/copy-to-clipboard/index.js +1717 -0
- package/dist/copy-to-clipboard/toggle-selection.d.ts +1 -0
- package/dist/html-renderer/index.js +35 -12
- package/dist/index.d.ts +3 -2
- package/dist/index.js +539 -220
- package/dist/input/index.js +12 -10
- package/dist/input/input-props.d.ts +1 -0
- package/dist/modal/index.js +73 -16
- package/dist/notetip/index.js +690 -0
- package/dist/notetip/{index.d.ts → note-tip.d.ts} +2 -2
- package/dist/table/index.js +990 -930
- package/esm/button/button.d.ts +1 -1
- package/esm/button/button.js +51 -5
- package/esm/button/styles.d.ts +1 -0
- package/esm/button/styles.js +22 -11
- package/esm/copy-to-clipboard/clipboard.d.ts +2 -0
- package/esm/copy-to-clipboard/copy.d.ts +2 -0
- package/esm/copy-to-clipboard/copy.js +105 -0
- package/esm/copy-to-clipboard/index.d.ts +2 -0
- package/esm/copy-to-clipboard/index.js +2 -0
- package/esm/copy-to-clipboard/toggle-selection.d.ts +1 -0
- package/esm/copy-to-clipboard/toggle-selection.js +31 -0
- package/esm/index.d.ts +3 -2
- package/esm/index.js +3 -2
- package/esm/input/input-field.js +12 -10
- package/esm/input/input-props.d.ts +1 -0
- package/esm/notetip/index.js +2 -97
- package/esm/notetip/{index.d.ts → note-tip.d.ts} +2 -2
- package/esm/notetip/note-tip.js +97 -0
- package/esm/table/table-body.js +2 -2
- package/esm/table/table-cell.js +1 -1
- package/esm/table/table-head.js +4 -2
- package/esm/table/table.js +0 -1
- package/package.json +14 -7
package/dist/table/index.js
CHANGED
|
@@ -1070,7 +1070,7 @@ var withScale = function withScale(Render) {
|
|
|
1070
1070
|
return ScaleFC;
|
|
1071
1071
|
};
|
|
1072
1072
|
|
|
1073
|
-
var _excluded$i = ["label", "labelRight", "color", "error", "type", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1073
|
+
var _excluded$i = ["label", "labelRight", "color", "error", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1074
1074
|
var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
1075
1075
|
return _objectSpread2(_objectSpread2({}, event), {}, {
|
|
1076
1076
|
target: el,
|
|
@@ -1086,6 +1086,8 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1086
1086
|
_ref$type = _ref.type,
|
|
1087
1087
|
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1088
1088
|
icon = _ref.icon,
|
|
1089
|
+
_ref$variant = _ref.variant,
|
|
1090
|
+
variant = _ref$variant === void 0 ? 'normal' : _ref$variant,
|
|
1089
1091
|
iconRight = _ref.iconRight,
|
|
1090
1092
|
_ref$iconClickable = _ref.iconClickable,
|
|
1091
1093
|
iconClickable = _ref$iconClickable === void 0 ? false : _ref$iconClickable,
|
|
@@ -1190,11 +1192,11 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1190
1192
|
var inputProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
|
|
1191
1193
|
var defaultWidth = fullWidth ? '100%' : 'initial';
|
|
1192
1194
|
return /*#__PURE__*/React.createElement("div", {
|
|
1193
|
-
className: _JSXStyle.dynamic([["
|
|
1195
|
+
className: _JSXStyle.dynamic([["3970712841", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + "with-label"
|
|
1194
1196
|
}, children && /*#__PURE__*/React.createElement(InputBlockLabel, null, children), /*#__PURE__*/React.createElement("div", {
|
|
1195
|
-
className: _JSXStyle.dynamic([["
|
|
1197
|
+
className: _JSXStyle.dynamic([["3970712841", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (theme.useClasses('input-container', className) || "")
|
|
1196
1198
|
}, label && /*#__PURE__*/React.createElement(MemoInputLabel, null, label), /*#__PURE__*/React.createElement("div", {
|
|
1197
|
-
className: _JSXStyle.dynamic([["
|
|
1199
|
+
className: _JSXStyle.dynamic([["3970712841", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (theme.useClasses('input-wrapper', {
|
|
1198
1200
|
hover: hover,
|
|
1199
1201
|
disabled: disabled
|
|
1200
1202
|
}, labelClasses) || "")
|
|
@@ -1211,7 +1213,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1211
1213
|
onChange: changeHandler,
|
|
1212
1214
|
autoComplete: autoComplete
|
|
1213
1215
|
}, inputProps, {
|
|
1214
|
-
className: _JSXStyle.dynamic([["
|
|
1216
|
+
className: _JSXStyle.dynamic([["3970712841", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || theme.useClasses({
|
|
1215
1217
|
disabled: disabled
|
|
1216
1218
|
}, iconClasses) || "")
|
|
1217
1219
|
})), clearable && /*#__PURE__*/React.createElement(MemoInputIconClear, {
|
|
@@ -1223,7 +1225,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1223
1225
|
}, iconProps))), labelRight && /*#__PURE__*/React.createElement(MemoInputLabel, {
|
|
1224
1226
|
isRight: true
|
|
1225
1227
|
}, labelRight), /*#__PURE__*/React.createElement("br", {
|
|
1226
|
-
className: _JSXStyle.dynamic([["
|
|
1228
|
+
className: _JSXStyle.dynamic([["3970712841", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]])
|
|
1227
1229
|
})), error && /*#__PURE__*/React.createElement("p", {
|
|
1228
1230
|
style: {
|
|
1229
1231
|
marginTop: 0.4,
|
|
@@ -1232,11 +1234,11 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1232
1234
|
marginBottom: '0.4rem',
|
|
1233
1235
|
textAlign: 'left'
|
|
1234
1236
|
},
|
|
1235
|
-
className: _JSXStyle.dynamic([["
|
|
1237
|
+
className: _JSXStyle.dynamic([["3970712841", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + "input-error"
|
|
1236
1238
|
}, error), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1237
|
-
id: "
|
|
1238
|
-
dynamic: [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), theme$1.layout.radius, borderColor, theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]
|
|
1239
|
-
}, ".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, defaultWidth), ";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, defaultWidth), ";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$1.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$1.palette.accents_1, ";border-color:").concat(theme$1.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$1.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$1.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$1.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$1.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$1.palette.background, " inset !important;-webkit-text-fill-color:").concat(color, " !important;}")));
|
|
1239
|
+
id: "3970712841",
|
|
1240
|
+
dynamic: [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), 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, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]
|
|
1241
|
+
}, ".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, defaultWidth), ";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, defaultWidth), ";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(variant === 'normal' ? theme$1.layout.radius : '', ";").concat(variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "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$1.palette.accents_1, ";border-color:").concat(theme$1.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$1.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$1.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$1.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$1.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$1.palette.background, " inset !important;-webkit-text-fill-color:").concat(color, " !important;}")));
|
|
1240
1242
|
});
|
|
1241
1243
|
InputComponent.displayName = 'Input';
|
|
1242
1244
|
var Input = withScale(InputComponent);
|
|
@@ -1426,820 +1428,42 @@ var InputPassword = withScale(InputPasswordComponent);
|
|
|
1426
1428
|
Input.Textarea = Textarea;
|
|
1427
1429
|
Input.Password = InputPassword;
|
|
1428
1430
|
|
|
1429
|
-
var
|
|
1430
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
1431
|
-
viewBox: "0 0 24 24",
|
|
1432
|
-
strokeWidth: "1",
|
|
1433
|
-
strokeLinecap: "round",
|
|
1434
|
-
strokeLinejoin: "round",
|
|
1435
|
-
fill: "none",
|
|
1436
|
-
shapeRendering: "geometricPrecision",
|
|
1437
|
-
className: "jsx-2742933678"
|
|
1438
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
1439
|
-
d: "M6 9l6 6 6-6",
|
|
1440
|
-
className: "jsx-2742933678"
|
|
1441
|
-
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1442
|
-
id: "2742933678"
|
|
1443
|
-
}, "svg.jsx-2742933678{color:inherit;stroke:currentColor;-webkit-transition:all 200ms ease;transition:all 200ms ease;width:1.214em;height:1.214em;}"));
|
|
1444
|
-
};
|
|
1445
|
-
SelectIconComponent.displayName = 'SelectIcon';
|
|
1446
|
-
var SelectIcon = /*#__PURE__*/React.memo(SelectIconComponent);
|
|
1431
|
+
var lodash$1 = {exports: {}};
|
|
1447
1432
|
|
|
1448
|
-
|
|
1433
|
+
/**
|
|
1434
|
+
* @license
|
|
1435
|
+
* Lodash <https://lodash.com/>
|
|
1436
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
1437
|
+
* Released under MIT license <https://lodash.com/license>
|
|
1438
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
1439
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
1440
|
+
*/
|
|
1441
|
+
var lodash = lodash$1.exports;
|
|
1449
1442
|
|
|
1450
|
-
var
|
|
1451
|
-
visible: false,
|
|
1452
|
-
disableAll: false
|
|
1453
|
-
};
|
|
1454
|
-
var SelectContext = /*#__PURE__*/React.createContext(defaultContext$3);
|
|
1455
|
-
var useSelectContext = function useSelectContext() {
|
|
1456
|
-
return React.useContext(SelectContext);
|
|
1457
|
-
};
|
|
1443
|
+
var hasRequiredLodash;
|
|
1458
1444
|
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
_ref$dropdownStyle = _ref.dropdownStyle,
|
|
1465
|
-
dropdownStyle = _ref$dropdownStyle === void 0 ? {} : _ref$dropdownStyle,
|
|
1466
|
-
disableMatchWidth = _ref.disableMatchWidth,
|
|
1467
|
-
getPopupContainer = _ref.getPopupContainer;
|
|
1468
|
-
var theme$1 = theme.useTheme();
|
|
1469
|
-
var internalDropdownRef = React.useRef(null);
|
|
1470
|
-
var _useSelectContext = useSelectContext(),
|
|
1471
|
-
ref = _useSelectContext.ref;
|
|
1472
|
-
var classes = theme.useClasses('select-dropdown', className);
|
|
1473
|
-
React.useImperativeHandle(dropdownRef, function () {
|
|
1474
|
-
return internalDropdownRef.current;
|
|
1475
|
-
});
|
|
1476
|
-
return /*#__PURE__*/React.createElement(theme.Dropdown, {
|
|
1477
|
-
parent: ref,
|
|
1478
|
-
visible: visible,
|
|
1479
|
-
disableMatchWidth: disableMatchWidth,
|
|
1480
|
-
getPopupContainer: getPopupContainer
|
|
1481
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1482
|
-
ref: internalDropdownRef,
|
|
1483
|
-
style: dropdownStyle,
|
|
1484
|
-
className: _JSXStyle.dynamic([["2782510679", [theme$1.layout.radius, theme$1.expressiveness.shadowLarge, theme$1.palette.background]]]) + " " + (classes || "")
|
|
1485
|
-
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1486
|
-
id: "2782510679",
|
|
1487
|
-
dynamic: [theme$1.layout.radius, theme$1.expressiveness.shadowLarge, theme$1.palette.background]
|
|
1488
|
-
}, ".select-dropdown.__jsx-style-dynamic-selector{border-radius:".concat(theme$1.layout.radius, ";box-shadow:").concat(theme$1.expressiveness.shadowLarge, ";background-color:").concat(theme$1.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;}"))));
|
|
1489
|
-
});
|
|
1490
|
-
SelectDropdown.displayName = 'SelectDropdown';
|
|
1445
|
+
function requireLodash () {
|
|
1446
|
+
if (hasRequiredLodash) return lodash$1.exports;
|
|
1447
|
+
hasRequiredLodash = 1;
|
|
1448
|
+
(function (module, exports) {
|
|
1449
|
+
(function() {
|
|
1491
1450
|
|
|
1492
|
-
|
|
1493
|
-
var
|
|
1494
|
-
var display = val === 0 ? 'display: none;' : 'display: inherit;';
|
|
1495
|
-
if (typeof val === 'number') {
|
|
1496
|
-
var width = 100 / 24 * val;
|
|
1497
|
-
var ratio = width > 100 ? '100%' : width < 0 ? '0' : "".concat(width, "%");
|
|
1498
|
-
return {
|
|
1499
|
-
grow: 0,
|
|
1500
|
-
display: display,
|
|
1501
|
-
width: ratio,
|
|
1502
|
-
basis: ratio
|
|
1503
|
-
};
|
|
1504
|
-
}
|
|
1505
|
-
return {
|
|
1506
|
-
grow: 1,
|
|
1507
|
-
display: display,
|
|
1508
|
-
width: '100%',
|
|
1509
|
-
basis: '0'
|
|
1510
|
-
};
|
|
1511
|
-
};
|
|
1512
|
-
var GridBasicItem = function GridBasicItem(_ref) {
|
|
1513
|
-
var _ref$xs = _ref.xs,
|
|
1514
|
-
xs = _ref$xs === void 0 ? false : _ref$xs,
|
|
1515
|
-
_ref$sm = _ref.sm,
|
|
1516
|
-
sm = _ref$sm === void 0 ? false : _ref$sm,
|
|
1517
|
-
_ref$md = _ref.md,
|
|
1518
|
-
md = _ref$md === void 0 ? false : _ref$md,
|
|
1519
|
-
_ref$lg = _ref.lg,
|
|
1520
|
-
lg = _ref$lg === void 0 ? false : _ref$lg,
|
|
1521
|
-
_ref$xl = _ref.xl,
|
|
1522
|
-
xl = _ref$xl === void 0 ? false : _ref$xl,
|
|
1523
|
-
justify = _ref.justify,
|
|
1524
|
-
direction = _ref.direction,
|
|
1525
|
-
alignItems = _ref.alignItems,
|
|
1526
|
-
alignContent = _ref.alignContent,
|
|
1527
|
-
children = _ref.children,
|
|
1528
|
-
_ref$className = _ref.className,
|
|
1529
|
-
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1530
|
-
props = _objectWithoutProperties(_ref, _excluded$f);
|
|
1531
|
-
var theme$1 = theme.useTheme();
|
|
1532
|
-
var _useScale = useScale(),
|
|
1533
|
-
SCALES = _useScale.SCALES;
|
|
1534
|
-
var classes = React.useMemo(function () {
|
|
1535
|
-
var aligns = {
|
|
1536
|
-
justify: justify,
|
|
1537
|
-
direction: direction,
|
|
1538
|
-
alignItems: alignItems,
|
|
1539
|
-
alignContent: alignContent,
|
|
1540
|
-
xs: xs,
|
|
1541
|
-
sm: sm,
|
|
1542
|
-
md: md,
|
|
1543
|
-
lg: lg,
|
|
1544
|
-
xl: xl
|
|
1545
|
-
};
|
|
1546
|
-
var classString = Object.keys(aligns).reduce(function (pre, name) {
|
|
1547
|
-
if (aligns[name] !== undefined && aligns[name] !== false) return "".concat(pre, " ").concat(name);
|
|
1548
|
-
return pre;
|
|
1549
|
-
}, '');
|
|
1550
|
-
return classString.trim();
|
|
1551
|
-
}, [justify, direction, alignItems, alignContent, xs, sm, md, lg, xl]);
|
|
1552
|
-
var layout = React.useMemo(function () {
|
|
1553
|
-
return {
|
|
1554
|
-
xs: getItemLayout(xs),
|
|
1555
|
-
sm: getItemLayout(sm),
|
|
1556
|
-
md: getItemLayout(md),
|
|
1557
|
-
lg: getItemLayout(lg),
|
|
1558
|
-
xl: getItemLayout(xl)
|
|
1559
|
-
};
|
|
1560
|
-
}, [xs, sm, md, lg, xl]);
|
|
1561
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
1562
|
-
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$1.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme$1.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme$1.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme$1.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]]]) + " " + (props && props.className != null && props.className || theme.useClasses('item', classes, className) || "")
|
|
1563
|
-
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1564
|
-
id: "568430467",
|
|
1565
|
-
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$1.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme$1.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme$1.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme$1.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]
|
|
1566
|
-
}, ".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$1.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$1.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$1.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$1.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, ";}}")));
|
|
1567
|
-
};
|
|
1568
|
-
GridBasicItem.displayName = 'GridBasicItem';
|
|
1451
|
+
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
|
1452
|
+
var undefined$1;
|
|
1569
1453
|
|
|
1570
|
-
|
|
1571
|
-
var
|
|
1572
|
-
var children = _ref.children,
|
|
1573
|
-
_ref$className = _ref.className,
|
|
1574
|
-
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1575
|
-
props = _objectWithoutProperties(_ref, _excluded$e);
|
|
1576
|
-
var _useScale = useScale(),
|
|
1577
|
-
SCALES = _useScale.SCALES;
|
|
1578
|
-
var _styles$className = {
|
|
1579
|
-
styles: /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1580
|
-
id: "1271839607",
|
|
1581
|
-
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)')]
|
|
1582
|
-
}, "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)'), ";}")),
|
|
1583
|
-
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)')]]])
|
|
1584
|
-
},
|
|
1585
|
-
resolveClassName = _styles$className.className,
|
|
1586
|
-
styles = _styles$className.styles;
|
|
1587
|
-
var classes = theme.useClasses(resolveClassName, className);
|
|
1588
|
-
return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
|
|
1589
|
-
className: classes
|
|
1590
|
-
}, props), children, styles);
|
|
1591
|
-
};
|
|
1592
|
-
GridComponent.displayName = 'Grid';
|
|
1593
|
-
var Grid = withScale(GridComponent);
|
|
1454
|
+
/** Used as the semantic version number. */
|
|
1455
|
+
var VERSION = '4.17.21';
|
|
1594
1456
|
|
|
1595
|
-
|
|
1596
|
-
var
|
|
1597
|
-
var _ref$gap = _ref.gap,
|
|
1598
|
-
gap = _ref$gap === void 0 ? 0 : _ref$gap,
|
|
1599
|
-
_ref$wrap = _ref.wrap,
|
|
1600
|
-
wrap = _ref$wrap === void 0 ? 'wrap' : _ref$wrap,
|
|
1601
|
-
children = _ref.children,
|
|
1602
|
-
_ref$className = _ref.className,
|
|
1603
|
-
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1604
|
-
props = _objectWithoutProperties(_ref, _excluded$d);
|
|
1605
|
-
var _useScale = useScale(),
|
|
1606
|
-
unit = _useScale.unit,
|
|
1607
|
-
SCALES = _useScale.SCALES;
|
|
1608
|
-
var gapUnit = React.useMemo(function () {
|
|
1609
|
-
return "calc(".concat(gap, " * ").concat(unit, " * 1/3)");
|
|
1610
|
-
}, [gap, unit]);
|
|
1611
|
-
var _styles$className = {
|
|
1612
|
-
styles: /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1613
|
-
id: "3631618093",
|
|
1614
|
-
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)')]
|
|
1615
|
-
}, "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)'), ";}")),
|
|
1616
|
-
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)')]]])
|
|
1617
|
-
},
|
|
1618
|
-
resolveClassName = _styles$className.className,
|
|
1619
|
-
styles = _styles$className.styles;
|
|
1620
|
-
var classes = theme.useClasses(resolveClassName, className);
|
|
1621
|
-
return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
|
|
1622
|
-
className: classes
|
|
1623
|
-
}, props), children, styles);
|
|
1624
|
-
};
|
|
1625
|
-
GridContainerComponent.displayName = 'GridContainer';
|
|
1626
|
-
var GridContainer = withScale(GridContainerComponent);
|
|
1457
|
+
/** Used as the size to enable large array optimizations. */
|
|
1458
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
1627
1459
|
|
|
1628
|
-
|
|
1460
|
+
/** Error message constants. */
|
|
1461
|
+
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
|
|
1462
|
+
FUNC_ERROR_TEXT = 'Expected a function',
|
|
1463
|
+
INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
|
|
1629
1464
|
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
var theme$1 = theme.useTheme();
|
|
1633
|
-
var clickHandler = function clickHandler(event) {
|
|
1634
|
-
event.preventDefault();
|
|
1635
|
-
event.stopPropagation();
|
|
1636
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
1637
|
-
onClick && onClick(event);
|
|
1638
|
-
};
|
|
1639
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1640
|
-
onClick: clickHandler,
|
|
1641
|
-
className: _JSXStyle.dynamic([["1984024521", [theme$1.palette.accents_3, theme$1.palette.foreground]]]) + " " + "clear-icon"
|
|
1642
|
-
}, /*#__PURE__*/React.createElement("svg", {
|
|
1643
|
-
viewBox: "0 0 24 24",
|
|
1644
|
-
stroke: "currentColor",
|
|
1645
|
-
strokeWidth: "1.5",
|
|
1646
|
-
strokeLinecap: "round",
|
|
1647
|
-
strokeLinejoin: "round",
|
|
1648
|
-
fill: "none",
|
|
1649
|
-
shapeRendering: "geometricPrecision",
|
|
1650
|
-
className: _JSXStyle.dynamic([["1984024521", [theme$1.palette.accents_3, theme$1.palette.foreground]]])
|
|
1651
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
1652
|
-
d: "M18 6L6 18",
|
|
1653
|
-
className: _JSXStyle.dynamic([["1984024521", [theme$1.palette.accents_3, theme$1.palette.foreground]]])
|
|
1654
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
1655
|
-
d: "M6 6l12 12",
|
|
1656
|
-
className: _JSXStyle.dynamic([["1984024521", [theme$1.palette.accents_3, theme$1.palette.foreground]]])
|
|
1657
|
-
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1658
|
-
id: "1984024521",
|
|
1659
|
-
dynamic: [theme$1.palette.accents_3, theme$1.palette.foreground]
|
|
1660
|
-
}, ".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$1.palette.accents_3, ";visibility:visible;opacity:1;}.clear-icon.__jsx-style-dynamic-selector:hover{color:").concat(theme$1.palette.foreground, ";}svg.__jsx-style-dynamic-selector{color:currentColor;width:1em;height:1em;}")));
|
|
1661
|
-
};
|
|
1662
|
-
var MemoSelectIconClear = /*#__PURE__*/React.memo(SelectIconClear);
|
|
1663
|
-
|
|
1664
|
-
var SelectMultipleValue = function SelectMultipleValue(_ref) {
|
|
1665
|
-
var disabled = _ref.disabled,
|
|
1666
|
-
onClear = _ref.onClear,
|
|
1667
|
-
children = _ref.children;
|
|
1668
|
-
var theme$1 = theme.useTheme();
|
|
1669
|
-
return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement("div", {
|
|
1670
|
-
className: _JSXStyle.dynamic([["3357578496", [theme$1.layout.radius, theme$1.palette.accents_2, disabled ? theme$1.palette.accents_4 : theme$1.palette.accents_6]]]) + " " + "item"
|
|
1671
|
-
}, children, !!onClear && /*#__PURE__*/React.createElement(MemoSelectIconClear, {
|
|
1672
|
-
onClick: onClear
|
|
1673
|
-
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1674
|
-
id: "3357578496",
|
|
1675
|
-
dynamic: [theme$1.layout.radius, theme$1.palette.accents_2, disabled ? theme$1.palette.accents_4 : theme$1.palette.accents_6]
|
|
1676
|
-
}, ".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$1.layout.radius, ";background-color:").concat(theme$1.palette.accents_2, ";color:").concat(disabled ? theme$1.palette.accents_4 : theme$1.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;}")));
|
|
1677
|
-
};
|
|
1678
|
-
SelectMultipleValue.displayName = 'SelectMultipleValue';
|
|
1679
|
-
|
|
1680
|
-
var getColors$1 = function getColors(palette, status) {
|
|
1681
|
-
var colors = {
|
|
1682
|
-
"default": {
|
|
1683
|
-
border: palette.border,
|
|
1684
|
-
borderActive: palette.foreground,
|
|
1685
|
-
iconBorder: palette.accents_5,
|
|
1686
|
-
placeholderColor: palette.accents_3
|
|
1687
|
-
},
|
|
1688
|
-
secondary: {
|
|
1689
|
-
border: palette.border,
|
|
1690
|
-
borderActive: palette.foreground,
|
|
1691
|
-
iconBorder: palette.accents_5,
|
|
1692
|
-
placeholderColor: palette.accents_3
|
|
1693
|
-
},
|
|
1694
|
-
success: {
|
|
1695
|
-
border: palette.successLight,
|
|
1696
|
-
borderActive: palette.successDark,
|
|
1697
|
-
iconBorder: palette.success,
|
|
1698
|
-
placeholderColor: palette.accents_3
|
|
1699
|
-
},
|
|
1700
|
-
warning: {
|
|
1701
|
-
border: palette.warningLight,
|
|
1702
|
-
borderActive: palette.warningDark,
|
|
1703
|
-
iconBorder: palette.warning,
|
|
1704
|
-
placeholderColor: palette.accents_3
|
|
1705
|
-
},
|
|
1706
|
-
error: {
|
|
1707
|
-
border: palette.errorLight,
|
|
1708
|
-
borderActive: palette.errorDark,
|
|
1709
|
-
iconBorder: palette.error,
|
|
1710
|
-
placeholderColor: palette.error
|
|
1711
|
-
}
|
|
1712
|
-
};
|
|
1713
|
-
if (!status) return colors["default"];
|
|
1714
|
-
return colors[status];
|
|
1715
|
-
};
|
|
1716
|
-
|
|
1717
|
-
var SelectInput = /*#__PURE__*/React.forwardRef(function (_ref, inputRef) {
|
|
1718
|
-
var visible = _ref.visible,
|
|
1719
|
-
onBlur = _ref.onBlur,
|
|
1720
|
-
onFocus = _ref.onFocus;
|
|
1721
|
-
var ref = React.useRef(null);
|
|
1722
|
-
React.useImperativeHandle(inputRef, function () {
|
|
1723
|
-
return ref.current;
|
|
1724
|
-
});
|
|
1725
|
-
React.useEffect(function () {
|
|
1726
|
-
if (visible) {
|
|
1727
|
-
var _ref$current;
|
|
1728
|
-
(_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.focus();
|
|
1729
|
-
}
|
|
1730
|
-
}, [visible]);
|
|
1731
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", {
|
|
1732
|
-
ref: ref,
|
|
1733
|
-
type: "search",
|
|
1734
|
-
role: "combobox",
|
|
1735
|
-
"aria-haspopup": "listbox",
|
|
1736
|
-
readOnly: true,
|
|
1737
|
-
unselectable: "on",
|
|
1738
|
-
"aria-expanded": visible,
|
|
1739
|
-
onBlur: onBlur,
|
|
1740
|
-
onFocus: onFocus,
|
|
1741
|
-
className: "jsx-2813108835"
|
|
1742
|
-
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1743
|
-
id: "2813108835"
|
|
1744
|
-
}, "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;}"));
|
|
1745
|
-
});
|
|
1746
|
-
SelectInput.displayName = 'SelectInput';
|
|
1747
|
-
|
|
1748
|
-
var _excluded$c = ["children", "label", "type", "disabled", "initialValue", "value", "icon", "onChange", "pure", "multiple", "clearable", "placeholder", "className", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "getPopupContainer", "onDropdownVisibleChange"];
|
|
1749
|
-
var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
|
|
1750
|
-
var children = _ref.children,
|
|
1751
|
-
label = _ref.label,
|
|
1752
|
-
_ref$type = _ref.type,
|
|
1753
|
-
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
1754
|
-
_ref$disabled = _ref.disabled,
|
|
1755
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
1756
|
-
init = _ref.initialValue,
|
|
1757
|
-
customValue = _ref.value,
|
|
1758
|
-
_ref$icon = _ref.icon,
|
|
1759
|
-
Icon = _ref$icon === void 0 ? SelectIcon : _ref$icon,
|
|
1760
|
-
onChange = _ref.onChange,
|
|
1761
|
-
_ref$pure = _ref.pure,
|
|
1762
|
-
pure = _ref$pure === void 0 ? false : _ref$pure,
|
|
1763
|
-
_ref$multiple = _ref.multiple,
|
|
1764
|
-
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
1765
|
-
_ref$clearable = _ref.clearable,
|
|
1766
|
-
clearable = _ref$clearable === void 0 ? true : _ref$clearable,
|
|
1767
|
-
placeholder = _ref.placeholder,
|
|
1768
|
-
_ref$className = _ref.className,
|
|
1769
|
-
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1770
|
-
dropdownClassName = _ref.dropdownClassName,
|
|
1771
|
-
dropdownStyle = _ref.dropdownStyle,
|
|
1772
|
-
_ref$disableMatchWidt = _ref.disableMatchWidth,
|
|
1773
|
-
disableMatchWidth = _ref$disableMatchWidt === void 0 ? false : _ref$disableMatchWidt,
|
|
1774
|
-
getPopupContainer = _ref.getPopupContainer,
|
|
1775
|
-
_ref$onDropdownVisibl = _ref.onDropdownVisibleChange,
|
|
1776
|
-
onDropdownVisibleChange = _ref$onDropdownVisibl === void 0 ? function () {} : _ref$onDropdownVisibl,
|
|
1777
|
-
props = _objectWithoutProperties(_ref, _excluded$c);
|
|
1778
|
-
var theme$1 = theme.useTheme();
|
|
1779
|
-
var _useScale = useScale(),
|
|
1780
|
-
SCALES = _useScale.SCALES;
|
|
1781
|
-
var ref = React.useRef(null);
|
|
1782
|
-
var inputRef = React.useRef(null);
|
|
1783
|
-
var dropdownRef = React.useRef(null);
|
|
1784
|
-
var _useState = React.useState(false),
|
|
1785
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1786
|
-
visible = _useState2[0],
|
|
1787
|
-
setVisible = _useState2[1];
|
|
1788
|
-
var _useState3 = React.useState(false),
|
|
1789
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
1790
|
-
selectFocus = _useState4[0],
|
|
1791
|
-
setSelectFocus = _useState4[1];
|
|
1792
|
-
var _useCurrentState = theme.useCurrentState(function () {
|
|
1793
|
-
if (!multiple) return init;
|
|
1794
|
-
if (Array.isArray(init)) return init;
|
|
1795
|
-
return typeof init === 'undefined' ? [] : [init];
|
|
1796
|
-
}),
|
|
1797
|
-
_useCurrentState2 = _slicedToArray(_useCurrentState, 3),
|
|
1798
|
-
value = _useCurrentState2[0],
|
|
1799
|
-
setValue = _useCurrentState2[1],
|
|
1800
|
-
valueRef = _useCurrentState2[2];
|
|
1801
|
-
var isEmpty = React.useMemo(function () {
|
|
1802
|
-
if (!Array.isArray(value)) return !value;
|
|
1803
|
-
return value.length === 0;
|
|
1804
|
-
}, [value]);
|
|
1805
|
-
var _useMemo = React.useMemo(function () {
|
|
1806
|
-
return getColors$1(theme$1.palette, type);
|
|
1807
|
-
}, [theme$1.palette, type]),
|
|
1808
|
-
border = _useMemo.border,
|
|
1809
|
-
borderActive = _useMemo.borderActive,
|
|
1810
|
-
iconBorder = _useMemo.iconBorder,
|
|
1811
|
-
placeholderColor = _useMemo.placeholderColor;
|
|
1812
|
-
var updateVisible = function updateVisible(next) {
|
|
1813
|
-
onDropdownVisibleChange(next);
|
|
1814
|
-
setVisible(next);
|
|
1815
|
-
};
|
|
1816
|
-
var updateValue = function updateValue(next) {
|
|
1817
|
-
setValue(function (last) {
|
|
1818
|
-
if (!Array.isArray(last)) return next;
|
|
1819
|
-
if (!last.includes(next)) return [].concat(_toConsumableArray(last), [next]);
|
|
1820
|
-
return last.filter(function (item) {
|
|
1821
|
-
return item !== next;
|
|
1822
|
-
});
|
|
1823
|
-
});
|
|
1824
|
-
onChange && onChange(valueRef.current);
|
|
1825
|
-
if (!multiple) {
|
|
1826
|
-
updateVisible(false);
|
|
1827
|
-
}
|
|
1828
|
-
};
|
|
1829
|
-
var initialValue = React.useMemo(function () {
|
|
1830
|
-
return {
|
|
1831
|
-
value: value,
|
|
1832
|
-
visible: visible,
|
|
1833
|
-
updateValue: updateValue,
|
|
1834
|
-
updateVisible: updateVisible,
|
|
1835
|
-
ref: ref,
|
|
1836
|
-
disableAll: disabled
|
|
1837
|
-
};
|
|
1838
|
-
}, [visible, disabled, ref, value, multiple]);
|
|
1839
|
-
var clickHandler = function clickHandler(event) {
|
|
1840
|
-
event.stopPropagation();
|
|
1841
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
1842
|
-
event.preventDefault();
|
|
1843
|
-
if (disabled) return;
|
|
1844
|
-
updateVisible(!visible);
|
|
1845
|
-
event.preventDefault();
|
|
1846
|
-
};
|
|
1847
|
-
var mouseDownHandler = function mouseDownHandler(event) {
|
|
1848
|
-
/* istanbul ignore next */
|
|
1849
|
-
if (visible) {
|
|
1850
|
-
event.preventDefault();
|
|
1851
|
-
}
|
|
1852
|
-
};
|
|
1853
|
-
React.useEffect(function () {
|
|
1854
|
-
if (customValue === undefined) return;
|
|
1855
|
-
setValue(customValue);
|
|
1856
|
-
}, [customValue]);
|
|
1857
|
-
React.useImperativeHandle(selectRef, function () {
|
|
1858
|
-
return {
|
|
1859
|
-
focus: function focus() {
|
|
1860
|
-
var _inputRef$current;
|
|
1861
|
-
return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
1862
|
-
},
|
|
1863
|
-
blur: function blur() {
|
|
1864
|
-
var _inputRef$current2;
|
|
1865
|
-
return (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.blur();
|
|
1866
|
-
},
|
|
1867
|
-
scrollTo: function scrollTo(options) {
|
|
1868
|
-
var _dropdownRef$current;
|
|
1869
|
-
return (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : _dropdownRef$current.scrollTo(options);
|
|
1870
|
-
}
|
|
1871
|
-
};
|
|
1872
|
-
}, [inputRef, dropdownRef]);
|
|
1873
|
-
var selectedChild = React.useMemo(function () {
|
|
1874
|
-
var _pickChildByProps = pickChildByProps(children, 'value', value),
|
|
1875
|
-
_pickChildByProps2 = _slicedToArray(_pickChildByProps, 2),
|
|
1876
|
-
optionChildren = _pickChildByProps2[1];
|
|
1877
|
-
return React.Children.map(optionChildren, function (child) {
|
|
1878
|
-
var _child = child;
|
|
1879
|
-
if (! /*#__PURE__*/React.isValidElement(_child)) return null;
|
|
1880
|
-
var el = /*#__PURE__*/React.cloneElement(_child); // { preventAllEvents: true }
|
|
1881
|
-
if (!multiple) return el;
|
|
1882
|
-
return /*#__PURE__*/React.createElement(SelectMultipleValue, {
|
|
1883
|
-
disabled: disabled,
|
|
1884
|
-
onClear: clearable ? function () {
|
|
1885
|
-
return updateValue(_child.props.value);
|
|
1886
|
-
} : null
|
|
1887
|
-
}, el);
|
|
1888
|
-
});
|
|
1889
|
-
}, [value, children, multiple]);
|
|
1890
|
-
var onInputBlur = function onInputBlur() {
|
|
1891
|
-
updateVisible(false);
|
|
1892
|
-
setSelectFocus(false);
|
|
1893
|
-
};
|
|
1894
|
-
var classes = theme.useClasses('select', {
|
|
1895
|
-
active: selectFocus || visible,
|
|
1896
|
-
multiple: multiple
|
|
1897
|
-
}, className);
|
|
1898
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1899
|
-
className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
|
|
1900
|
-
}, label && /*#__PURE__*/React.createElement("label", {
|
|
1901
|
-
style: {
|
|
1902
|
-
display: 'block',
|
|
1903
|
-
marginBottom: '0.4rem',
|
|
1904
|
-
fontSize: '14px',
|
|
1905
|
-
fontWeight: 'light'
|
|
1906
|
-
},
|
|
1907
|
-
className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
|
|
1908
|
-
}, label), /*#__PURE__*/React.createElement(SelectContext.Provider, {
|
|
1909
|
-
value: initialValue
|
|
1910
|
-
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
1911
|
-
ref: ref,
|
|
1912
|
-
onClick: clickHandler,
|
|
1913
|
-
onMouseDown: mouseDownHandler
|
|
1914
|
-
}, props, {
|
|
1915
|
-
className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
1916
|
-
}), /*#__PURE__*/React.createElement(SelectInput, {
|
|
1917
|
-
ref: inputRef,
|
|
1918
|
-
visible: visible,
|
|
1919
|
-
onBlur: onInputBlur,
|
|
1920
|
-
onFocus: function onFocus() {
|
|
1921
|
-
return setSelectFocus(true);
|
|
1922
|
-
}
|
|
1923
|
-
}), isEmpty && /*#__PURE__*/React.createElement("span", {
|
|
1924
|
-
className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value placeholder"
|
|
1925
|
-
}, /*#__PURE__*/React.createElement(theme.Ellipsis, {
|
|
1926
|
-
height: "var(--select-height)"
|
|
1927
|
-
}, placeholder)), value && !multiple && /*#__PURE__*/React.createElement("span", {
|
|
1928
|
-
className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value"
|
|
1929
|
-
}, selectedChild), value && multiple && /*#__PURE__*/React.createElement(Grid.Container, {
|
|
1930
|
-
gap: 0.5
|
|
1931
|
-
}, selectedChild), /*#__PURE__*/React.createElement(SelectDropdown, {
|
|
1932
|
-
ref: dropdownRef,
|
|
1933
|
-
visible: visible,
|
|
1934
|
-
className: dropdownClassName,
|
|
1935
|
-
dropdownStyle: dropdownStyle,
|
|
1936
|
-
disableMatchWidth: disableMatchWidth,
|
|
1937
|
-
getPopupContainer: getPopupContainer
|
|
1938
|
-
}, children), !pure && /*#__PURE__*/React.createElement("div", {
|
|
1939
|
-
className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "icon"
|
|
1940
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
1941
|
-
className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
|
|
1942
|
-
})))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1943
|
-
id: "2996243684",
|
|
1944
|
-
dynamic: [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]
|
|
1945
|
-
}, ".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$1.layout.radius, ";background-color:").concat(disabled ? theme$1.palette.accents_1 : theme$1.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$1.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$1.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$1.palette.accents_4 : theme$1.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$1.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, ";}")));
|
|
1946
|
-
});
|
|
1947
|
-
SelectComponent.displayName = 'Select';
|
|
1948
|
-
var Select = withScale(SelectComponent);
|
|
1949
|
-
|
|
1950
|
-
var warningStack = {};
|
|
1951
|
-
var useWarning = function useWarning(message, component) {
|
|
1952
|
-
var tag = component ? " [".concat(component, "]") : ' ';
|
|
1953
|
-
var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
|
|
1954
|
-
if (typeof console === 'undefined') return;
|
|
1955
|
-
if (warningStack[log]) return;
|
|
1956
|
-
warningStack[log] = true;
|
|
1957
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1958
|
-
return console.error(log);
|
|
1959
|
-
}
|
|
1960
|
-
console.warn(log);
|
|
1961
|
-
};
|
|
1962
|
-
|
|
1963
|
-
var _excluded$b = ["value", "className", "children", "disabled", "divider", "label", "preventAllEvents"];
|
|
1964
|
-
var SelectOptionComponent = function SelectOptionComponent(_ref) {
|
|
1965
|
-
var identValue = _ref.value,
|
|
1966
|
-
_ref$className = _ref.className,
|
|
1967
|
-
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1968
|
-
children = _ref.children,
|
|
1969
|
-
_ref$disabled = _ref.disabled,
|
|
1970
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
1971
|
-
_ref$divider = _ref.divider,
|
|
1972
|
-
divider = _ref$divider === void 0 ? false : _ref$divider,
|
|
1973
|
-
_ref$label = _ref.label,
|
|
1974
|
-
label = _ref$label === void 0 ? false : _ref$label,
|
|
1975
|
-
_ref$preventAllEvents = _ref.preventAllEvents,
|
|
1976
|
-
preventAllEvents = _ref$preventAllEvents === void 0 ? false : _ref$preventAllEvents,
|
|
1977
|
-
props = _objectWithoutProperties(_ref, _excluded$b);
|
|
1978
|
-
var theme$1 = theme.useTheme();
|
|
1979
|
-
var _useScale = useScale(),
|
|
1980
|
-
SCALES = _useScale.SCALES;
|
|
1981
|
-
var _useSelectContext = useSelectContext(),
|
|
1982
|
-
updateValue = _useSelectContext.updateValue,
|
|
1983
|
-
value = _useSelectContext.value,
|
|
1984
|
-
disableAll = _useSelectContext.disableAll;
|
|
1985
|
-
var isDisabled = React.useMemo(function () {
|
|
1986
|
-
return disabled || disableAll;
|
|
1987
|
-
}, [disabled, disableAll]);
|
|
1988
|
-
var isLabel = React.useMemo(function () {
|
|
1989
|
-
return label || divider;
|
|
1990
|
-
}, [label, divider]);
|
|
1991
|
-
var classes = theme.useClasses('option', {
|
|
1992
|
-
divider: divider,
|
|
1993
|
-
label: label
|
|
1994
|
-
}, className);
|
|
1995
|
-
if (!isLabel && identValue === undefined) {
|
|
1996
|
-
useWarning('The props "value" is required.', 'Select Option');
|
|
1997
|
-
}
|
|
1998
|
-
var selected = React.useMemo(function () {
|
|
1999
|
-
if (!value) return false;
|
|
2000
|
-
if (typeof value === 'string') {
|
|
2001
|
-
return identValue === value;
|
|
2002
|
-
}
|
|
2003
|
-
return value.includes("".concat(identValue));
|
|
2004
|
-
}, [identValue, value]);
|
|
2005
|
-
var bgColor = React.useMemo(function () {
|
|
2006
|
-
if (isDisabled) return theme$1.palette.accents_1;
|
|
2007
|
-
return selected ? theme$1.palette.accents_2 : theme$1.palette.background;
|
|
2008
|
-
}, [selected, isDisabled, theme$1.palette]);
|
|
2009
|
-
var hoverBgColor = React.useMemo(function () {
|
|
2010
|
-
if (isDisabled || isLabel || selected) return bgColor;
|
|
2011
|
-
return theme$1.palette.accents_1;
|
|
2012
|
-
}, [selected, isDisabled, theme$1.palette, isLabel, bgColor]);
|
|
2013
|
-
var color = React.useMemo(function () {
|
|
2014
|
-
if (isDisabled) return theme$1.palette.accents_4;
|
|
2015
|
-
return selected ? theme$1.palette.foreground : theme$1.palette.accents_5;
|
|
2016
|
-
}, [selected, isDisabled, theme$1.palette]);
|
|
2017
|
-
var clickHandler = function clickHandler(event) {
|
|
2018
|
-
if (preventAllEvents) return;
|
|
2019
|
-
event.stopPropagation();
|
|
2020
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
2021
|
-
event.preventDefault();
|
|
2022
|
-
if (isDisabled || isLabel) return;
|
|
2023
|
-
updateValue && updateValue(identValue);
|
|
2024
|
-
};
|
|
2025
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
2026
|
-
onClick: clickHandler
|
|
2027
|
-
}, props, {
|
|
2028
|
-
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$1.palette.accents_7, theme$1.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$1.palette.accents_7, theme$1.palette.border, SCALES.font(0.875), SCALES.width(1, '100%')]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
2029
|
-
}), /*#__PURE__*/React.createElement(theme.Ellipsis, {
|
|
2030
|
-
height: SCALES.height(2.25)
|
|
2031
|
-
}, children), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
2032
|
-
id: "199367556",
|
|
2033
|
-
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$1.palette.accents_7, theme$1.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$1.palette.accents_7, theme$1.palette.border, SCALES.font(0.875), SCALES.width(1, '100%')]
|
|
2034
|
-
}, ".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$1.palette.accents_7, ";}.divider.__jsx-style-dynamic-selector{line-height:0;overflow:hidden;border-top:1px solid ").concat(theme$1.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$1.palette.accents_7, ";border-bottom:1px solid ").concat(theme$1.palette.border, ";text-transform:capitalize;cursor:default;font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, '100%'), ";font-weight:500;}")));
|
|
2035
|
-
};
|
|
2036
|
-
SelectOptionComponent.displayName = 'SelectOption';
|
|
2037
|
-
var SelectOption = withScale(SelectOptionComponent);
|
|
2038
|
-
|
|
2039
|
-
Select.Option = SelectOption;
|
|
2040
|
-
|
|
2041
|
-
// import Button from '../button'
|
|
2042
|
-
|
|
2043
|
-
var makeColgroup = function makeColgroup(width, columns) {
|
|
2044
|
-
var unsetWidthCount = columns.filter(function (c) {
|
|
2045
|
-
return !c.width;
|
|
2046
|
-
}).length;
|
|
2047
|
-
var customWidthTotal = columns.reduce(function (pre, current) {
|
|
2048
|
-
return current.width ? pre + current.width : pre;
|
|
2049
|
-
}, 0);
|
|
2050
|
-
var averageWidth = (width - customWidthTotal) / unsetWidthCount;
|
|
2051
|
-
if (averageWidth <= 0) return /*#__PURE__*/React.createElement("colgroup", null);
|
|
2052
|
-
return /*#__PURE__*/React.createElement("colgroup", null, columns.map(function (column, index) {
|
|
2053
|
-
return /*#__PURE__*/React.createElement("col", {
|
|
2054
|
-
key: "colgroup-".concat(index),
|
|
2055
|
-
width: column.width || averageWidth
|
|
2056
|
-
});
|
|
2057
|
-
}));
|
|
2058
|
-
};
|
|
2059
|
-
var TableHead = function TableHead(props) {
|
|
2060
|
-
var theme$1 = theme.useTheme();
|
|
2061
|
-
var _ref = props,
|
|
2062
|
-
columns = _ref.columns,
|
|
2063
|
-
width = _ref.width,
|
|
2064
|
-
onFilters = _ref.onFilters,
|
|
2065
|
-
showFilters = _ref.showFilters,
|
|
2066
|
-
stickyHeader = _ref.stickyHeader;
|
|
2067
|
-
var isScalableWidth = React.useMemo(function () {
|
|
2068
|
-
return columns.find(function (item) {
|
|
2069
|
-
return !!item.width;
|
|
2070
|
-
});
|
|
2071
|
-
}, [columns]);
|
|
2072
|
-
var colgroup = React.useMemo(function () {
|
|
2073
|
-
if (!isScalableWidth) return /*#__PURE__*/React.createElement("colgroup", null);
|
|
2074
|
-
return makeColgroup(width, columns);
|
|
2075
|
-
}, [isScalableWidth, width]);
|
|
2076
|
-
var _React$useState = React.useState(columns.reduce(function (acc, col) {
|
|
2077
|
-
if (col.filter) {
|
|
2078
|
-
acc["".concat(col.filter)] = col.filter === 'date' ? null : '';
|
|
2079
|
-
}
|
|
2080
|
-
return acc;
|
|
2081
|
-
}, {})),
|
|
2082
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2083
|
-
filters = _React$useState2[0],
|
|
2084
|
-
setFilters = _React$useState2[1];
|
|
2085
|
-
|
|
2086
|
-
// const applyFilters = () => {
|
|
2087
|
-
// if (onFilters) {
|
|
2088
|
-
// onFilters(filters);
|
|
2089
|
-
// }
|
|
2090
|
-
// }
|
|
2091
|
-
|
|
2092
|
-
var handleFilterChange = function handleFilterChange(name, value) {
|
|
2093
|
-
setFilters(function (prevFilters) {
|
|
2094
|
-
var updatedFilters = _objectSpread2(_objectSpread2({}, prevFilters), {}, _defineProperty({}, name, value));
|
|
2095
|
-
if (onFilters) {
|
|
2096
|
-
onFilters(filters);
|
|
2097
|
-
}
|
|
2098
|
-
return updatedFilters;
|
|
2099
|
-
});
|
|
2100
|
-
};
|
|
2101
|
-
var generateFilterInputs = function generateFilterInputs() {
|
|
2102
|
-
return columns.map(function (col) {
|
|
2103
|
-
var _String, _filters$filterName;
|
|
2104
|
-
var Header = col.label,
|
|
2105
|
-
accessor = col.filter,
|
|
2106
|
-
options = col.options;
|
|
2107
|
-
var filterName = (_String = String(col === null || col === void 0 ? void 0 : col.label)) === null || _String === void 0 ? void 0 : _String.replace(' ', '_').toLowerCase();
|
|
2108
|
-
// const unq_accessor = _.uniqueId(filterName);
|
|
2109
|
-
// if (Header === 'actions') {
|
|
2110
|
-
// return (
|
|
2111
|
-
// <th style={{ margin: '3px' }} data-column={Header} key={unq_accessor}>
|
|
2112
|
-
// <Button onClick={applyFilters} auto px={0.6} scale={2 / 3}>Apply</Button>
|
|
2113
|
-
// </th>
|
|
2114
|
-
// )
|
|
2115
|
-
// }
|
|
2116
|
-
return /*#__PURE__*/React.createElement("th", {
|
|
2117
|
-
style: {
|
|
2118
|
-
padding: '3px',
|
|
2119
|
-
textAlign: 'left'
|
|
2120
|
-
},
|
|
2121
|
-
"data-column": Header
|
|
2122
|
-
}, accessor === 'fixed' && /*#__PURE__*/React.createElement(Select
|
|
2123
|
-
// key={unq_accessor}
|
|
2124
|
-
// name={filterName}
|
|
2125
|
-
, {
|
|
2126
|
-
value: (_filters$filterName = filters[filterName]) !== null && _filters$filterName !== void 0 ? _filters$filterName : 'All',
|
|
2127
|
-
onChange: function onChange(newValue) {
|
|
2128
|
-
return handleFilterChange(filterName, newValue);
|
|
2129
|
-
}
|
|
2130
|
-
}, /*#__PURE__*/React.createElement(Select.Option, {
|
|
2131
|
-
value: "All"
|
|
2132
|
-
}, "All ", Header), options ? options.map(function (option) {
|
|
2133
|
-
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
2134
|
-
value: option.value
|
|
2135
|
-
}, option.name);
|
|
2136
|
-
}) : null), accessor === 'date' && /*#__PURE__*/React.createElement(Input
|
|
2137
|
-
// id={`filter-date-${filterName}`}
|
|
2138
|
-
, {
|
|
2139
|
-
type: "date"
|
|
2140
|
-
// name={filterName}
|
|
2141
|
-
,
|
|
2142
|
-
value: filters[filterName],
|
|
2143
|
-
onChange: function onChange(e) {
|
|
2144
|
-
return handleFilterChange(filterName, e.target.value);
|
|
2145
|
-
}
|
|
2146
|
-
}), accessor === 'search' && /*#__PURE__*/React.createElement(Input
|
|
2147
|
-
// id={`filter-search-${filterName}`}
|
|
2148
|
-
, {
|
|
2149
|
-
type: "text",
|
|
2150
|
-
autoComplete: "off"
|
|
2151
|
-
// ref={filterRefs.current[filterName]} // Dynamically set ref}
|
|
2152
|
-
// name={filterName}
|
|
2153
|
-
,
|
|
2154
|
-
style: {
|
|
2155
|
-
height: 30,
|
|
2156
|
-
minWidth: 160
|
|
2157
|
-
},
|
|
2158
|
-
value: filters[filterName],
|
|
2159
|
-
onChange: function onChange(e) {
|
|
2160
|
-
return handleFilterChange(filterName, e.target.value);
|
|
2161
|
-
},
|
|
2162
|
-
placeholder: "Search...",
|
|
2163
|
-
fullWidth: true
|
|
2164
|
-
}));
|
|
2165
|
-
});
|
|
2166
|
-
};
|
|
2167
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
|
|
2168
|
-
className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]])
|
|
2169
|
-
}, /*#__PURE__*/React.createElement("tr", {
|
|
2170
|
-
style: {
|
|
2171
|
-
backgroundColor: theme$1.palette.background
|
|
2172
|
-
},
|
|
2173
|
-
className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]])
|
|
2174
|
-
}, columns.map(function (column, _index) {
|
|
2175
|
-
var _String2;
|
|
2176
|
-
var dataName = (_String2 = String(column === null || column === void 0 ? void 0 : column.label)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
|
|
2177
|
-
return /*#__PURE__*/React.createElement("th", {
|
|
2178
|
-
style: _objectSpread2({
|
|
2179
|
-
// textAlign: `${column?.align} !important`,
|
|
2180
|
-
// paddingLeft: '0.3rem',
|
|
2181
|
-
// paddingRight: '0.3rem',
|
|
2182
|
-
backgroundColor: theme$1.type == 'dark' ? theme$1.palette.accents_1 : theme$1.palette.background,
|
|
2183
|
-
color: "".concat(column !== null && column !== void 0 && column.color ? column === null || column === void 0 ? void 0 : column.color : '#333'),
|
|
2184
|
-
whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
|
|
2185
|
-
}, column === null || column === void 0 ? void 0 : column.style),
|
|
2186
|
-
"data-column": dataName,
|
|
2187
|
-
className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]]) + " " + (column.className || "")
|
|
2188
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
2189
|
-
className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]]) + " " + "thead-box"
|
|
2190
|
-
}, column.label, /*#__PURE__*/React.createElement("br", {
|
|
2191
|
-
className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]])
|
|
2192
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
2193
|
-
style: {
|
|
2194
|
-
textAlign: 'center'
|
|
2195
|
-
},
|
|
2196
|
-
className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]])
|
|
2197
|
-
}, column.text)));
|
|
2198
|
-
})), showFilters && /*#__PURE__*/React.createElement("tr", {
|
|
2199
|
-
className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]])
|
|
2200
|
-
}, generateFilterInputs())), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
2201
|
-
id: "4089411751",
|
|
2202
|
-
dynamic: [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]
|
|
2203
|
-
}, "thead.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;background-color:".concat(theme$1.palette.background, ";font-size:inherit;").concat(stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", ";}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$1.palette.accents_5, ";background:").concat(theme$1.palette.accents_1, ";border-bottom:1px solid ").concat(theme$1.palette.border, ";border-top:1px solid ").concat(theme$1.palette.border, ";border-radius:0;}th.__jsx-style-dynamic-selector:nth-child(1){border-bottom:1px solid ").concat(theme$1.palette.border, ";border-left:1px solid ").concat(theme$1.palette.border, ";border-top:1px solid ").concat(theme$1.palette.border, ";border-top-left-radius:").concat(theme$1.layout.radius, ";border-bottom-left-radius:").concat(theme$1.layout.radius, ";}th.__jsx-style-dynamic-selector:last-child{border-bottom:1px solid ").concat(theme$1.palette.border, ";border-right:1px solid ").concat(theme$1.palette.border, ";border-top:1px solid ").concat(theme$1.palette.border, ";border-top-right-radius:").concat(theme$1.layout.radius, ";border-bottom-right-radius:").concat(theme$1.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;}")));
|
|
2204
|
-
};
|
|
2205
|
-
TableHead.displayName = 'TableHead';
|
|
2206
|
-
|
|
2207
|
-
var lodash$1 = {exports: {}};
|
|
2208
|
-
|
|
2209
|
-
/**
|
|
2210
|
-
* @license
|
|
2211
|
-
* Lodash <https://lodash.com/>
|
|
2212
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
2213
|
-
* Released under MIT license <https://lodash.com/license>
|
|
2214
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
2215
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
2216
|
-
*/
|
|
2217
|
-
var lodash = lodash$1.exports;
|
|
2218
|
-
|
|
2219
|
-
var hasRequiredLodash;
|
|
2220
|
-
|
|
2221
|
-
function requireLodash () {
|
|
2222
|
-
if (hasRequiredLodash) return lodash$1.exports;
|
|
2223
|
-
hasRequiredLodash = 1;
|
|
2224
|
-
(function (module, exports) {
|
|
2225
|
-
(function() {
|
|
2226
|
-
|
|
2227
|
-
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
|
2228
|
-
var undefined$1;
|
|
2229
|
-
|
|
2230
|
-
/** Used as the semantic version number. */
|
|
2231
|
-
var VERSION = '4.17.21';
|
|
2232
|
-
|
|
2233
|
-
/** Used as the size to enable large array optimizations. */
|
|
2234
|
-
var LARGE_ARRAY_SIZE = 200;
|
|
2235
|
-
|
|
2236
|
-
/** Error message constants. */
|
|
2237
|
-
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
|
|
2238
|
-
FUNC_ERROR_TEXT = 'Expected a function',
|
|
2239
|
-
INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
|
|
2240
|
-
|
|
2241
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
2242
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
1465
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
1466
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
2243
1467
|
|
|
2244
1468
|
/** Used as the maximum memoize cache size. */
|
|
2245
1469
|
var MAX_MEMOIZE_SIZE = 500;
|
|
@@ -19306,115 +18530,894 @@ function requireLodash () {
|
|
|
19306
18530
|
iteratee = args[0],
|
|
19307
18531
|
useLazy = isLazy || isArray(value);
|
|
19308
18532
|
|
|
19309
|
-
var interceptor = function(value) {
|
|
19310
|
-
var result = lodashFunc.apply(lodash, arrayPush([value], args));
|
|
19311
|
-
return (isTaker && chainAll) ? result[0] : result;
|
|
19312
|
-
};
|
|
18533
|
+
var interceptor = function(value) {
|
|
18534
|
+
var result = lodashFunc.apply(lodash, arrayPush([value], args));
|
|
18535
|
+
return (isTaker && chainAll) ? result[0] : result;
|
|
18536
|
+
};
|
|
18537
|
+
|
|
18538
|
+
if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
|
|
18539
|
+
// Avoid lazy use if the iteratee has a "length" value other than `1`.
|
|
18540
|
+
isLazy = useLazy = false;
|
|
18541
|
+
}
|
|
18542
|
+
var chainAll = this.__chain__,
|
|
18543
|
+
isHybrid = !!this.__actions__.length,
|
|
18544
|
+
isUnwrapped = retUnwrapped && !chainAll,
|
|
18545
|
+
onlyLazy = isLazy && !isHybrid;
|
|
18546
|
+
|
|
18547
|
+
if (!retUnwrapped && useLazy) {
|
|
18548
|
+
value = onlyLazy ? value : new LazyWrapper(this);
|
|
18549
|
+
var result = func.apply(value, args);
|
|
18550
|
+
result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined$1 });
|
|
18551
|
+
return new LodashWrapper(result, chainAll);
|
|
18552
|
+
}
|
|
18553
|
+
if (isUnwrapped && onlyLazy) {
|
|
18554
|
+
return func.apply(this, args);
|
|
18555
|
+
}
|
|
18556
|
+
result = this.thru(interceptor);
|
|
18557
|
+
return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
|
|
18558
|
+
};
|
|
18559
|
+
});
|
|
18560
|
+
|
|
18561
|
+
// Add `Array` methods to `lodash.prototype`.
|
|
18562
|
+
arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
|
|
18563
|
+
var func = arrayProto[methodName],
|
|
18564
|
+
chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
|
|
18565
|
+
retUnwrapped = /^(?:pop|shift)$/.test(methodName);
|
|
18566
|
+
|
|
18567
|
+
lodash.prototype[methodName] = function() {
|
|
18568
|
+
var args = arguments;
|
|
18569
|
+
if (retUnwrapped && !this.__chain__) {
|
|
18570
|
+
var value = this.value();
|
|
18571
|
+
return func.apply(isArray(value) ? value : [], args);
|
|
18572
|
+
}
|
|
18573
|
+
return this[chainName](function(value) {
|
|
18574
|
+
return func.apply(isArray(value) ? value : [], args);
|
|
18575
|
+
});
|
|
18576
|
+
};
|
|
18577
|
+
});
|
|
18578
|
+
|
|
18579
|
+
// Map minified method names to their real names.
|
|
18580
|
+
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
|
18581
|
+
var lodashFunc = lodash[methodName];
|
|
18582
|
+
if (lodashFunc) {
|
|
18583
|
+
var key = lodashFunc.name + '';
|
|
18584
|
+
if (!hasOwnProperty.call(realNames, key)) {
|
|
18585
|
+
realNames[key] = [];
|
|
18586
|
+
}
|
|
18587
|
+
realNames[key].push({ 'name': methodName, 'func': lodashFunc });
|
|
18588
|
+
}
|
|
18589
|
+
});
|
|
18590
|
+
|
|
18591
|
+
realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
|
|
18592
|
+
'name': 'wrapper',
|
|
18593
|
+
'func': undefined$1
|
|
18594
|
+
}];
|
|
18595
|
+
|
|
18596
|
+
// Add methods to `LazyWrapper`.
|
|
18597
|
+
LazyWrapper.prototype.clone = lazyClone;
|
|
18598
|
+
LazyWrapper.prototype.reverse = lazyReverse;
|
|
18599
|
+
LazyWrapper.prototype.value = lazyValue;
|
|
18600
|
+
|
|
18601
|
+
// Add chain sequence methods to the `lodash` wrapper.
|
|
18602
|
+
lodash.prototype.at = wrapperAt;
|
|
18603
|
+
lodash.prototype.chain = wrapperChain;
|
|
18604
|
+
lodash.prototype.commit = wrapperCommit;
|
|
18605
|
+
lodash.prototype.next = wrapperNext;
|
|
18606
|
+
lodash.prototype.plant = wrapperPlant;
|
|
18607
|
+
lodash.prototype.reverse = wrapperReverse;
|
|
18608
|
+
lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
|
|
18609
|
+
|
|
18610
|
+
// Add lazy aliases.
|
|
18611
|
+
lodash.prototype.first = lodash.prototype.head;
|
|
18612
|
+
|
|
18613
|
+
if (symIterator) {
|
|
18614
|
+
lodash.prototype[symIterator] = wrapperToIterator;
|
|
18615
|
+
}
|
|
18616
|
+
return lodash;
|
|
18617
|
+
});
|
|
18618
|
+
|
|
18619
|
+
/*--------------------------------------------------------------------------*/
|
|
18620
|
+
|
|
18621
|
+
// Export lodash.
|
|
18622
|
+
var _ = runInContext();
|
|
18623
|
+
|
|
18624
|
+
// Some AMD build optimizers, like r.js, check for condition patterns like:
|
|
18625
|
+
if (freeModule) {
|
|
18626
|
+
// Export for Node.js.
|
|
18627
|
+
(freeModule.exports = _)._ = _;
|
|
18628
|
+
// Export for CommonJS support.
|
|
18629
|
+
freeExports._ = _;
|
|
18630
|
+
}
|
|
18631
|
+
else {
|
|
18632
|
+
// Export to the global object.
|
|
18633
|
+
root._ = _;
|
|
18634
|
+
}
|
|
18635
|
+
}.call(lodash));
|
|
18636
|
+
} (lodash$1, lodash$1.exports));
|
|
18637
|
+
return lodash$1.exports;
|
|
18638
|
+
}
|
|
18639
|
+
|
|
18640
|
+
var lodashExports = requireLodash();
|
|
18641
|
+
var _ = /*@__PURE__*/getDefaultExportFromCjs(lodashExports);
|
|
18642
|
+
|
|
18643
|
+
var SelectIconComponent = function SelectIconComponent() {
|
|
18644
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
18645
|
+
viewBox: "0 0 24 24",
|
|
18646
|
+
strokeWidth: "1",
|
|
18647
|
+
strokeLinecap: "round",
|
|
18648
|
+
strokeLinejoin: "round",
|
|
18649
|
+
fill: "none",
|
|
18650
|
+
shapeRendering: "geometricPrecision",
|
|
18651
|
+
className: "jsx-2742933678"
|
|
18652
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
18653
|
+
d: "M6 9l6 6 6-6",
|
|
18654
|
+
className: "jsx-2742933678"
|
|
18655
|
+
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
18656
|
+
id: "2742933678"
|
|
18657
|
+
}, "svg.jsx-2742933678{color:inherit;stroke:currentColor;-webkit-transition:all 200ms ease;transition:all 200ms ease;width:1.214em;height:1.214em;}"));
|
|
18658
|
+
};
|
|
18659
|
+
SelectIconComponent.displayName = 'SelectIcon';
|
|
18660
|
+
var SelectIcon = /*#__PURE__*/React.memo(SelectIconComponent);
|
|
18661
|
+
|
|
18662
|
+
/* "use client" */
|
|
18663
|
+
|
|
18664
|
+
var defaultContext$3 = {
|
|
18665
|
+
visible: false,
|
|
18666
|
+
disableAll: false
|
|
18667
|
+
};
|
|
18668
|
+
var SelectContext = /*#__PURE__*/React.createContext(defaultContext$3);
|
|
18669
|
+
var useSelectContext = function useSelectContext() {
|
|
18670
|
+
return React.useContext(SelectContext);
|
|
18671
|
+
};
|
|
18672
|
+
|
|
18673
|
+
var SelectDropdown = /*#__PURE__*/React.forwardRef(function (_ref, dropdownRef) {
|
|
18674
|
+
var visible = _ref.visible,
|
|
18675
|
+
children = _ref.children,
|
|
18676
|
+
_ref$className = _ref.className,
|
|
18677
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
18678
|
+
_ref$dropdownStyle = _ref.dropdownStyle,
|
|
18679
|
+
dropdownStyle = _ref$dropdownStyle === void 0 ? {} : _ref$dropdownStyle,
|
|
18680
|
+
disableMatchWidth = _ref.disableMatchWidth,
|
|
18681
|
+
getPopupContainer = _ref.getPopupContainer;
|
|
18682
|
+
var theme$1 = theme.useTheme();
|
|
18683
|
+
var internalDropdownRef = React.useRef(null);
|
|
18684
|
+
var _useSelectContext = useSelectContext(),
|
|
18685
|
+
ref = _useSelectContext.ref;
|
|
18686
|
+
var classes = theme.useClasses('select-dropdown', className);
|
|
18687
|
+
React.useImperativeHandle(dropdownRef, function () {
|
|
18688
|
+
return internalDropdownRef.current;
|
|
18689
|
+
});
|
|
18690
|
+
return /*#__PURE__*/React.createElement(theme.Dropdown, {
|
|
18691
|
+
parent: ref,
|
|
18692
|
+
visible: visible,
|
|
18693
|
+
disableMatchWidth: disableMatchWidth,
|
|
18694
|
+
getPopupContainer: getPopupContainer
|
|
18695
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
18696
|
+
ref: internalDropdownRef,
|
|
18697
|
+
style: dropdownStyle,
|
|
18698
|
+
className: _JSXStyle.dynamic([["2782510679", [theme$1.layout.radius, theme$1.expressiveness.shadowLarge, theme$1.palette.background]]]) + " " + (classes || "")
|
|
18699
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
18700
|
+
id: "2782510679",
|
|
18701
|
+
dynamic: [theme$1.layout.radius, theme$1.expressiveness.shadowLarge, theme$1.palette.background]
|
|
18702
|
+
}, ".select-dropdown.__jsx-style-dynamic-selector{border-radius:".concat(theme$1.layout.radius, ";box-shadow:").concat(theme$1.expressiveness.shadowLarge, ";background-color:").concat(theme$1.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;}"))));
|
|
18703
|
+
});
|
|
18704
|
+
SelectDropdown.displayName = 'SelectDropdown';
|
|
18705
|
+
|
|
18706
|
+
var _excluded$f = ["xs", "sm", "md", "lg", "xl", "justify", "direction", "alignItems", "alignContent", "children", "className"];
|
|
18707
|
+
var getItemLayout = function getItemLayout(val) {
|
|
18708
|
+
var display = val === 0 ? 'display: none;' : 'display: inherit;';
|
|
18709
|
+
if (typeof val === 'number') {
|
|
18710
|
+
var width = 100 / 24 * val;
|
|
18711
|
+
var ratio = width > 100 ? '100%' : width < 0 ? '0' : "".concat(width, "%");
|
|
18712
|
+
return {
|
|
18713
|
+
grow: 0,
|
|
18714
|
+
display: display,
|
|
18715
|
+
width: ratio,
|
|
18716
|
+
basis: ratio
|
|
18717
|
+
};
|
|
18718
|
+
}
|
|
18719
|
+
return {
|
|
18720
|
+
grow: 1,
|
|
18721
|
+
display: display,
|
|
18722
|
+
width: '100%',
|
|
18723
|
+
basis: '0'
|
|
18724
|
+
};
|
|
18725
|
+
};
|
|
18726
|
+
var GridBasicItem = function GridBasicItem(_ref) {
|
|
18727
|
+
var _ref$xs = _ref.xs,
|
|
18728
|
+
xs = _ref$xs === void 0 ? false : _ref$xs,
|
|
18729
|
+
_ref$sm = _ref.sm,
|
|
18730
|
+
sm = _ref$sm === void 0 ? false : _ref$sm,
|
|
18731
|
+
_ref$md = _ref.md,
|
|
18732
|
+
md = _ref$md === void 0 ? false : _ref$md,
|
|
18733
|
+
_ref$lg = _ref.lg,
|
|
18734
|
+
lg = _ref$lg === void 0 ? false : _ref$lg,
|
|
18735
|
+
_ref$xl = _ref.xl,
|
|
18736
|
+
xl = _ref$xl === void 0 ? false : _ref$xl,
|
|
18737
|
+
justify = _ref.justify,
|
|
18738
|
+
direction = _ref.direction,
|
|
18739
|
+
alignItems = _ref.alignItems,
|
|
18740
|
+
alignContent = _ref.alignContent,
|
|
18741
|
+
children = _ref.children,
|
|
18742
|
+
_ref$className = _ref.className,
|
|
18743
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
18744
|
+
props = _objectWithoutProperties(_ref, _excluded$f);
|
|
18745
|
+
var theme$1 = theme.useTheme();
|
|
18746
|
+
var _useScale = useScale(),
|
|
18747
|
+
SCALES = _useScale.SCALES;
|
|
18748
|
+
var classes = React.useMemo(function () {
|
|
18749
|
+
var aligns = {
|
|
18750
|
+
justify: justify,
|
|
18751
|
+
direction: direction,
|
|
18752
|
+
alignItems: alignItems,
|
|
18753
|
+
alignContent: alignContent,
|
|
18754
|
+
xs: xs,
|
|
18755
|
+
sm: sm,
|
|
18756
|
+
md: md,
|
|
18757
|
+
lg: lg,
|
|
18758
|
+
xl: xl
|
|
18759
|
+
};
|
|
18760
|
+
var classString = Object.keys(aligns).reduce(function (pre, name) {
|
|
18761
|
+
if (aligns[name] !== undefined && aligns[name] !== false) return "".concat(pre, " ").concat(name);
|
|
18762
|
+
return pre;
|
|
18763
|
+
}, '');
|
|
18764
|
+
return classString.trim();
|
|
18765
|
+
}, [justify, direction, alignItems, alignContent, xs, sm, md, lg, xl]);
|
|
18766
|
+
var layout = React.useMemo(function () {
|
|
18767
|
+
return {
|
|
18768
|
+
xs: getItemLayout(xs),
|
|
18769
|
+
sm: getItemLayout(sm),
|
|
18770
|
+
md: getItemLayout(md),
|
|
18771
|
+
lg: getItemLayout(lg),
|
|
18772
|
+
xl: getItemLayout(xl)
|
|
18773
|
+
};
|
|
18774
|
+
}, [xs, sm, md, lg, xl]);
|
|
18775
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
18776
|
+
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$1.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme$1.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme$1.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme$1.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]]]) + " " + (props && props.className != null && props.className || theme.useClasses('item', classes, className) || "")
|
|
18777
|
+
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
18778
|
+
id: "568430467",
|
|
18779
|
+
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$1.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme$1.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme$1.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme$1.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]
|
|
18780
|
+
}, ".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$1.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$1.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$1.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$1.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, ";}}")));
|
|
18781
|
+
};
|
|
18782
|
+
GridBasicItem.displayName = 'GridBasicItem';
|
|
18783
|
+
|
|
18784
|
+
var _excluded$e = ["children", "className"];
|
|
18785
|
+
var GridComponent = function GridComponent(_ref) {
|
|
18786
|
+
var children = _ref.children,
|
|
18787
|
+
_ref$className = _ref.className,
|
|
18788
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
18789
|
+
props = _objectWithoutProperties(_ref, _excluded$e);
|
|
18790
|
+
var _useScale = useScale(),
|
|
18791
|
+
SCALES = _useScale.SCALES;
|
|
18792
|
+
var _styles$className = {
|
|
18793
|
+
styles: /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
18794
|
+
id: "1271839607",
|
|
18795
|
+
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)')]
|
|
18796
|
+
}, "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)'), ";}")),
|
|
18797
|
+
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)')]]])
|
|
18798
|
+
},
|
|
18799
|
+
resolveClassName = _styles$className.className,
|
|
18800
|
+
styles = _styles$className.styles;
|
|
18801
|
+
var classes = theme.useClasses(resolveClassName, className);
|
|
18802
|
+
return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
|
|
18803
|
+
className: classes
|
|
18804
|
+
}, props), children, styles);
|
|
18805
|
+
};
|
|
18806
|
+
GridComponent.displayName = 'Grid';
|
|
18807
|
+
var Grid = withScale(GridComponent);
|
|
19313
18808
|
|
|
19314
|
-
|
|
19315
|
-
|
|
19316
|
-
|
|
19317
|
-
|
|
19318
|
-
|
|
19319
|
-
|
|
19320
|
-
|
|
19321
|
-
|
|
18809
|
+
var _excluded$d = ["gap", "wrap", "children", "className"];
|
|
18810
|
+
var GridContainerComponent = function GridContainerComponent(_ref) {
|
|
18811
|
+
var _ref$gap = _ref.gap,
|
|
18812
|
+
gap = _ref$gap === void 0 ? 0 : _ref$gap,
|
|
18813
|
+
_ref$wrap = _ref.wrap,
|
|
18814
|
+
wrap = _ref$wrap === void 0 ? 'wrap' : _ref$wrap,
|
|
18815
|
+
children = _ref.children,
|
|
18816
|
+
_ref$className = _ref.className,
|
|
18817
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
18818
|
+
props = _objectWithoutProperties(_ref, _excluded$d);
|
|
18819
|
+
var _useScale = useScale(),
|
|
18820
|
+
unit = _useScale.unit,
|
|
18821
|
+
SCALES = _useScale.SCALES;
|
|
18822
|
+
var gapUnit = React.useMemo(function () {
|
|
18823
|
+
return "calc(".concat(gap, " * ").concat(unit, " * 1/3)");
|
|
18824
|
+
}, [gap, unit]);
|
|
18825
|
+
var _styles$className = {
|
|
18826
|
+
styles: /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
18827
|
+
id: "3631618093",
|
|
18828
|
+
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)')]
|
|
18829
|
+
}, "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)'), ";}")),
|
|
18830
|
+
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)')]]])
|
|
18831
|
+
},
|
|
18832
|
+
resolveClassName = _styles$className.className,
|
|
18833
|
+
styles = _styles$className.styles;
|
|
18834
|
+
var classes = theme.useClasses(resolveClassName, className);
|
|
18835
|
+
return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
|
|
18836
|
+
className: classes
|
|
18837
|
+
}, props), children, styles);
|
|
18838
|
+
};
|
|
18839
|
+
GridContainerComponent.displayName = 'GridContainer';
|
|
18840
|
+
var GridContainer = withScale(GridContainerComponent);
|
|
19322
18841
|
|
|
19323
|
-
|
|
19324
|
-
value = onlyLazy ? value : new LazyWrapper(this);
|
|
19325
|
-
var result = func.apply(value, args);
|
|
19326
|
-
result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined$1 });
|
|
19327
|
-
return new LodashWrapper(result, chainAll);
|
|
19328
|
-
}
|
|
19329
|
-
if (isUnwrapped && onlyLazy) {
|
|
19330
|
-
return func.apply(this, args);
|
|
19331
|
-
}
|
|
19332
|
-
result = this.thru(interceptor);
|
|
19333
|
-
return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
|
|
19334
|
-
};
|
|
19335
|
-
});
|
|
18842
|
+
Grid.Container = GridContainer;
|
|
19336
18843
|
|
|
19337
|
-
|
|
19338
|
-
|
|
19339
|
-
|
|
19340
|
-
|
|
19341
|
-
|
|
18844
|
+
var SelectIconClear = function SelectIconClear(_ref) {
|
|
18845
|
+
var onClick = _ref.onClick;
|
|
18846
|
+
var theme$1 = theme.useTheme();
|
|
18847
|
+
var clickHandler = function clickHandler(event) {
|
|
18848
|
+
event.preventDefault();
|
|
18849
|
+
event.stopPropagation();
|
|
18850
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
18851
|
+
onClick && onClick(event);
|
|
18852
|
+
};
|
|
18853
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
18854
|
+
onClick: clickHandler,
|
|
18855
|
+
className: _JSXStyle.dynamic([["1984024521", [theme$1.palette.accents_3, theme$1.palette.foreground]]]) + " " + "clear-icon"
|
|
18856
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
18857
|
+
viewBox: "0 0 24 24",
|
|
18858
|
+
stroke: "currentColor",
|
|
18859
|
+
strokeWidth: "1.5",
|
|
18860
|
+
strokeLinecap: "round",
|
|
18861
|
+
strokeLinejoin: "round",
|
|
18862
|
+
fill: "none",
|
|
18863
|
+
shapeRendering: "geometricPrecision",
|
|
18864
|
+
className: _JSXStyle.dynamic([["1984024521", [theme$1.palette.accents_3, theme$1.palette.foreground]]])
|
|
18865
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
18866
|
+
d: "M18 6L6 18",
|
|
18867
|
+
className: _JSXStyle.dynamic([["1984024521", [theme$1.palette.accents_3, theme$1.palette.foreground]]])
|
|
18868
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
18869
|
+
d: "M6 6l12 12",
|
|
18870
|
+
className: _JSXStyle.dynamic([["1984024521", [theme$1.palette.accents_3, theme$1.palette.foreground]]])
|
|
18871
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
18872
|
+
id: "1984024521",
|
|
18873
|
+
dynamic: [theme$1.palette.accents_3, theme$1.palette.foreground]
|
|
18874
|
+
}, ".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$1.palette.accents_3, ";visibility:visible;opacity:1;}.clear-icon.__jsx-style-dynamic-selector:hover{color:").concat(theme$1.palette.foreground, ";}svg.__jsx-style-dynamic-selector{color:currentColor;width:1em;height:1em;}")));
|
|
18875
|
+
};
|
|
18876
|
+
var MemoSelectIconClear = /*#__PURE__*/React.memo(SelectIconClear);
|
|
19342
18877
|
|
|
19343
|
-
|
|
19344
|
-
|
|
19345
|
-
|
|
19346
|
-
|
|
19347
|
-
|
|
19348
|
-
|
|
19349
|
-
|
|
19350
|
-
|
|
19351
|
-
|
|
19352
|
-
|
|
19353
|
-
|
|
18878
|
+
var SelectMultipleValue = function SelectMultipleValue(_ref) {
|
|
18879
|
+
var disabled = _ref.disabled,
|
|
18880
|
+
onClear = _ref.onClear,
|
|
18881
|
+
children = _ref.children;
|
|
18882
|
+
var theme$1 = theme.useTheme();
|
|
18883
|
+
return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement("div", {
|
|
18884
|
+
className: _JSXStyle.dynamic([["3357578496", [theme$1.layout.radius, theme$1.palette.accents_2, disabled ? theme$1.palette.accents_4 : theme$1.palette.accents_6]]]) + " " + "item"
|
|
18885
|
+
}, children, !!onClear && /*#__PURE__*/React.createElement(MemoSelectIconClear, {
|
|
18886
|
+
onClick: onClear
|
|
18887
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
18888
|
+
id: "3357578496",
|
|
18889
|
+
dynamic: [theme$1.layout.radius, theme$1.palette.accents_2, disabled ? theme$1.palette.accents_4 : theme$1.palette.accents_6]
|
|
18890
|
+
}, ".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$1.layout.radius, ";background-color:").concat(theme$1.palette.accents_2, ";color:").concat(disabled ? theme$1.palette.accents_4 : theme$1.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;}")));
|
|
18891
|
+
};
|
|
18892
|
+
SelectMultipleValue.displayName = 'SelectMultipleValue';
|
|
19354
18893
|
|
|
19355
|
-
|
|
19356
|
-
|
|
19357
|
-
|
|
19358
|
-
|
|
19359
|
-
|
|
19360
|
-
|
|
19361
|
-
|
|
19362
|
-
|
|
19363
|
-
|
|
19364
|
-
|
|
19365
|
-
|
|
18894
|
+
var getColors$1 = function getColors(palette, status) {
|
|
18895
|
+
var colors = {
|
|
18896
|
+
"default": {
|
|
18897
|
+
border: palette.border,
|
|
18898
|
+
borderActive: palette.foreground,
|
|
18899
|
+
iconBorder: palette.accents_5,
|
|
18900
|
+
placeholderColor: palette.accents_3
|
|
18901
|
+
},
|
|
18902
|
+
secondary: {
|
|
18903
|
+
border: palette.border,
|
|
18904
|
+
borderActive: palette.foreground,
|
|
18905
|
+
iconBorder: palette.accents_5,
|
|
18906
|
+
placeholderColor: palette.accents_3
|
|
18907
|
+
},
|
|
18908
|
+
success: {
|
|
18909
|
+
border: palette.successLight,
|
|
18910
|
+
borderActive: palette.successDark,
|
|
18911
|
+
iconBorder: palette.success,
|
|
18912
|
+
placeholderColor: palette.accents_3
|
|
18913
|
+
},
|
|
18914
|
+
warning: {
|
|
18915
|
+
border: palette.warningLight,
|
|
18916
|
+
borderActive: palette.warningDark,
|
|
18917
|
+
iconBorder: palette.warning,
|
|
18918
|
+
placeholderColor: palette.accents_3
|
|
18919
|
+
},
|
|
18920
|
+
error: {
|
|
18921
|
+
border: palette.errorLight,
|
|
18922
|
+
borderActive: palette.errorDark,
|
|
18923
|
+
iconBorder: palette.error,
|
|
18924
|
+
placeholderColor: palette.error
|
|
18925
|
+
}
|
|
18926
|
+
};
|
|
18927
|
+
if (!status) return colors["default"];
|
|
18928
|
+
return colors[status];
|
|
18929
|
+
};
|
|
19366
18930
|
|
|
19367
|
-
|
|
19368
|
-
|
|
19369
|
-
|
|
19370
|
-
|
|
18931
|
+
var SelectInput = /*#__PURE__*/React.forwardRef(function (_ref, inputRef) {
|
|
18932
|
+
var visible = _ref.visible,
|
|
18933
|
+
onBlur = _ref.onBlur,
|
|
18934
|
+
onFocus = _ref.onFocus;
|
|
18935
|
+
var ref = React.useRef(null);
|
|
18936
|
+
React.useImperativeHandle(inputRef, function () {
|
|
18937
|
+
return ref.current;
|
|
18938
|
+
});
|
|
18939
|
+
React.useEffect(function () {
|
|
18940
|
+
if (visible) {
|
|
18941
|
+
var _ref$current;
|
|
18942
|
+
(_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.focus();
|
|
18943
|
+
}
|
|
18944
|
+
}, [visible]);
|
|
18945
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", {
|
|
18946
|
+
ref: ref,
|
|
18947
|
+
type: "search",
|
|
18948
|
+
role: "combobox",
|
|
18949
|
+
"aria-haspopup": "listbox",
|
|
18950
|
+
readOnly: true,
|
|
18951
|
+
unselectable: "on",
|
|
18952
|
+
"aria-expanded": visible,
|
|
18953
|
+
onBlur: onBlur,
|
|
18954
|
+
onFocus: onFocus,
|
|
18955
|
+
className: "jsx-2813108835"
|
|
18956
|
+
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
18957
|
+
id: "2813108835"
|
|
18958
|
+
}, "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;}"));
|
|
18959
|
+
});
|
|
18960
|
+
SelectInput.displayName = 'SelectInput';
|
|
19371
18961
|
|
|
19372
|
-
|
|
19373
|
-
|
|
19374
|
-
|
|
19375
|
-
|
|
18962
|
+
var _excluded$c = ["children", "label", "type", "disabled", "initialValue", "value", "icon", "onChange", "pure", "multiple", "clearable", "placeholder", "className", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "getPopupContainer", "onDropdownVisibleChange"];
|
|
18963
|
+
var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
|
|
18964
|
+
var children = _ref.children,
|
|
18965
|
+
label = _ref.label,
|
|
18966
|
+
_ref$type = _ref.type,
|
|
18967
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
18968
|
+
_ref$disabled = _ref.disabled,
|
|
18969
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
18970
|
+
init = _ref.initialValue,
|
|
18971
|
+
customValue = _ref.value,
|
|
18972
|
+
_ref$icon = _ref.icon,
|
|
18973
|
+
Icon = _ref$icon === void 0 ? SelectIcon : _ref$icon,
|
|
18974
|
+
onChange = _ref.onChange,
|
|
18975
|
+
_ref$pure = _ref.pure,
|
|
18976
|
+
pure = _ref$pure === void 0 ? false : _ref$pure,
|
|
18977
|
+
_ref$multiple = _ref.multiple,
|
|
18978
|
+
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
18979
|
+
_ref$clearable = _ref.clearable,
|
|
18980
|
+
clearable = _ref$clearable === void 0 ? true : _ref$clearable,
|
|
18981
|
+
placeholder = _ref.placeholder,
|
|
18982
|
+
_ref$className = _ref.className,
|
|
18983
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
18984
|
+
dropdownClassName = _ref.dropdownClassName,
|
|
18985
|
+
dropdownStyle = _ref.dropdownStyle,
|
|
18986
|
+
_ref$disableMatchWidt = _ref.disableMatchWidth,
|
|
18987
|
+
disableMatchWidth = _ref$disableMatchWidt === void 0 ? false : _ref$disableMatchWidt,
|
|
18988
|
+
getPopupContainer = _ref.getPopupContainer,
|
|
18989
|
+
_ref$onDropdownVisibl = _ref.onDropdownVisibleChange,
|
|
18990
|
+
onDropdownVisibleChange = _ref$onDropdownVisibl === void 0 ? function () {} : _ref$onDropdownVisibl,
|
|
18991
|
+
props = _objectWithoutProperties(_ref, _excluded$c);
|
|
18992
|
+
var theme$1 = theme.useTheme();
|
|
18993
|
+
var _useScale = useScale(),
|
|
18994
|
+
SCALES = _useScale.SCALES;
|
|
18995
|
+
var ref = React.useRef(null);
|
|
18996
|
+
var inputRef = React.useRef(null);
|
|
18997
|
+
var dropdownRef = React.useRef(null);
|
|
18998
|
+
var _useState = React.useState(false),
|
|
18999
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19000
|
+
visible = _useState2[0],
|
|
19001
|
+
setVisible = _useState2[1];
|
|
19002
|
+
var _useState3 = React.useState(false),
|
|
19003
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
19004
|
+
selectFocus = _useState4[0],
|
|
19005
|
+
setSelectFocus = _useState4[1];
|
|
19006
|
+
var _useCurrentState = theme.useCurrentState(function () {
|
|
19007
|
+
if (!multiple) return init;
|
|
19008
|
+
if (Array.isArray(init)) return init;
|
|
19009
|
+
return typeof init === 'undefined' ? [] : [init];
|
|
19010
|
+
}),
|
|
19011
|
+
_useCurrentState2 = _slicedToArray(_useCurrentState, 3),
|
|
19012
|
+
value = _useCurrentState2[0],
|
|
19013
|
+
setValue = _useCurrentState2[1],
|
|
19014
|
+
valueRef = _useCurrentState2[2];
|
|
19015
|
+
var isEmpty = React.useMemo(function () {
|
|
19016
|
+
if (!Array.isArray(value)) return !value;
|
|
19017
|
+
return value.length === 0;
|
|
19018
|
+
}, [value]);
|
|
19019
|
+
var _useMemo = React.useMemo(function () {
|
|
19020
|
+
return getColors$1(theme$1.palette, type);
|
|
19021
|
+
}, [theme$1.palette, type]),
|
|
19022
|
+
border = _useMemo.border,
|
|
19023
|
+
borderActive = _useMemo.borderActive,
|
|
19024
|
+
iconBorder = _useMemo.iconBorder,
|
|
19025
|
+
placeholderColor = _useMemo.placeholderColor;
|
|
19026
|
+
var updateVisible = function updateVisible(next) {
|
|
19027
|
+
onDropdownVisibleChange(next);
|
|
19028
|
+
setVisible(next);
|
|
19029
|
+
};
|
|
19030
|
+
var updateValue = function updateValue(next) {
|
|
19031
|
+
setValue(function (last) {
|
|
19032
|
+
if (!Array.isArray(last)) return next;
|
|
19033
|
+
if (!last.includes(next)) return [].concat(_toConsumableArray(last), [next]);
|
|
19034
|
+
return last.filter(function (item) {
|
|
19035
|
+
return item !== next;
|
|
19036
|
+
});
|
|
19037
|
+
});
|
|
19038
|
+
onChange && onChange(valueRef.current);
|
|
19039
|
+
if (!multiple) {
|
|
19040
|
+
updateVisible(false);
|
|
19041
|
+
}
|
|
19042
|
+
};
|
|
19043
|
+
var initialValue = React.useMemo(function () {
|
|
19044
|
+
return {
|
|
19045
|
+
value: value,
|
|
19046
|
+
visible: visible,
|
|
19047
|
+
updateValue: updateValue,
|
|
19048
|
+
updateVisible: updateVisible,
|
|
19049
|
+
ref: ref,
|
|
19050
|
+
disableAll: disabled
|
|
19051
|
+
};
|
|
19052
|
+
}, [visible, disabled, ref, value, multiple]);
|
|
19053
|
+
var clickHandler = function clickHandler(event) {
|
|
19054
|
+
event.stopPropagation();
|
|
19055
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
19056
|
+
event.preventDefault();
|
|
19057
|
+
if (disabled) return;
|
|
19058
|
+
updateVisible(!visible);
|
|
19059
|
+
event.preventDefault();
|
|
19060
|
+
};
|
|
19061
|
+
var mouseDownHandler = function mouseDownHandler(event) {
|
|
19062
|
+
/* istanbul ignore next */
|
|
19063
|
+
if (visible) {
|
|
19064
|
+
event.preventDefault();
|
|
19065
|
+
}
|
|
19066
|
+
};
|
|
19067
|
+
React.useEffect(function () {
|
|
19068
|
+
if (customValue === undefined) return;
|
|
19069
|
+
setValue(customValue);
|
|
19070
|
+
}, [customValue]);
|
|
19071
|
+
React.useImperativeHandle(selectRef, function () {
|
|
19072
|
+
return {
|
|
19073
|
+
focus: function focus() {
|
|
19074
|
+
var _inputRef$current;
|
|
19075
|
+
return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
19076
|
+
},
|
|
19077
|
+
blur: function blur() {
|
|
19078
|
+
var _inputRef$current2;
|
|
19079
|
+
return (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.blur();
|
|
19080
|
+
},
|
|
19081
|
+
scrollTo: function scrollTo(options) {
|
|
19082
|
+
var _dropdownRef$current;
|
|
19083
|
+
return (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : _dropdownRef$current.scrollTo(options);
|
|
19084
|
+
}
|
|
19085
|
+
};
|
|
19086
|
+
}, [inputRef, dropdownRef]);
|
|
19087
|
+
var selectedChild = React.useMemo(function () {
|
|
19088
|
+
var _pickChildByProps = pickChildByProps(children, 'value', value),
|
|
19089
|
+
_pickChildByProps2 = _slicedToArray(_pickChildByProps, 2),
|
|
19090
|
+
optionChildren = _pickChildByProps2[1];
|
|
19091
|
+
return React.Children.map(optionChildren, function (child) {
|
|
19092
|
+
var _child = child;
|
|
19093
|
+
if (! /*#__PURE__*/React.isValidElement(_child)) return null;
|
|
19094
|
+
var el = /*#__PURE__*/React.cloneElement(_child); // { preventAllEvents: true }
|
|
19095
|
+
if (!multiple) return el;
|
|
19096
|
+
return /*#__PURE__*/React.createElement(SelectMultipleValue, {
|
|
19097
|
+
disabled: disabled,
|
|
19098
|
+
onClear: clearable ? function () {
|
|
19099
|
+
return updateValue(_child.props.value);
|
|
19100
|
+
} : null
|
|
19101
|
+
}, el);
|
|
19102
|
+
});
|
|
19103
|
+
}, [value, children, multiple]);
|
|
19104
|
+
var onInputBlur = function onInputBlur() {
|
|
19105
|
+
updateVisible(false);
|
|
19106
|
+
setSelectFocus(false);
|
|
19107
|
+
};
|
|
19108
|
+
var classes = theme.useClasses('select', {
|
|
19109
|
+
active: selectFocus || visible,
|
|
19110
|
+
multiple: multiple
|
|
19111
|
+
}, className);
|
|
19112
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
19113
|
+
className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
|
|
19114
|
+
}, label && /*#__PURE__*/React.createElement("label", {
|
|
19115
|
+
style: {
|
|
19116
|
+
display: 'block',
|
|
19117
|
+
marginBottom: '0.4rem',
|
|
19118
|
+
fontSize: '14px',
|
|
19119
|
+
fontWeight: 'light'
|
|
19120
|
+
},
|
|
19121
|
+
className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
|
|
19122
|
+
}, label), /*#__PURE__*/React.createElement(SelectContext.Provider, {
|
|
19123
|
+
value: initialValue
|
|
19124
|
+
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
19125
|
+
ref: ref,
|
|
19126
|
+
onClick: clickHandler,
|
|
19127
|
+
onMouseDown: mouseDownHandler
|
|
19128
|
+
}, props, {
|
|
19129
|
+
className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
19130
|
+
}), /*#__PURE__*/React.createElement(SelectInput, {
|
|
19131
|
+
ref: inputRef,
|
|
19132
|
+
visible: visible,
|
|
19133
|
+
onBlur: onInputBlur,
|
|
19134
|
+
onFocus: function onFocus() {
|
|
19135
|
+
return setSelectFocus(true);
|
|
19136
|
+
}
|
|
19137
|
+
}), isEmpty && /*#__PURE__*/React.createElement("span", {
|
|
19138
|
+
className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value placeholder"
|
|
19139
|
+
}, /*#__PURE__*/React.createElement(theme.Ellipsis, {
|
|
19140
|
+
height: "var(--select-height)"
|
|
19141
|
+
}, placeholder)), value && !multiple && /*#__PURE__*/React.createElement("span", {
|
|
19142
|
+
className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value"
|
|
19143
|
+
}, selectedChild), value && multiple && /*#__PURE__*/React.createElement(Grid.Container, {
|
|
19144
|
+
gap: 0.5
|
|
19145
|
+
}, selectedChild), /*#__PURE__*/React.createElement(SelectDropdown, {
|
|
19146
|
+
ref: dropdownRef,
|
|
19147
|
+
visible: visible,
|
|
19148
|
+
className: dropdownClassName,
|
|
19149
|
+
dropdownStyle: dropdownStyle,
|
|
19150
|
+
disableMatchWidth: disableMatchWidth,
|
|
19151
|
+
getPopupContainer: getPopupContainer
|
|
19152
|
+
}, children), !pure && /*#__PURE__*/React.createElement("div", {
|
|
19153
|
+
className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "icon"
|
|
19154
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
19155
|
+
className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
|
|
19156
|
+
})))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19157
|
+
id: "2996243684",
|
|
19158
|
+
dynamic: [disabled ? 'not-allowed' : 'pointer', border, theme$1.layout.radius, disabled ? theme$1.palette.accents_1 : theme$1.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$1.palette.border : borderActive, disabled ? theme$1.palette.accents_5 : borderActive, disabled ? theme$1.palette.accents_4 : theme$1.palette.foreground, placeholderColor, theme$1.layout.gapQuarter, visible ? '180' : '0', iconBorder]
|
|
19159
|
+
}, ".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$1.layout.radius, ";background-color:").concat(disabled ? theme$1.palette.accents_1 : theme$1.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$1.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$1.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$1.palette.accents_4 : theme$1.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$1.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, ";}")));
|
|
19160
|
+
});
|
|
19161
|
+
SelectComponent.displayName = 'Select';
|
|
19162
|
+
var Select = withScale(SelectComponent);
|
|
19376
19163
|
|
|
19377
|
-
|
|
19378
|
-
|
|
19379
|
-
|
|
19380
|
-
|
|
19381
|
-
|
|
19382
|
-
|
|
19383
|
-
|
|
19384
|
-
|
|
19164
|
+
var warningStack = {};
|
|
19165
|
+
var useWarning = function useWarning(message, component) {
|
|
19166
|
+
var tag = component ? " [".concat(component, "]") : ' ';
|
|
19167
|
+
var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
|
|
19168
|
+
if (typeof console === 'undefined') return;
|
|
19169
|
+
if (warningStack[log]) return;
|
|
19170
|
+
warningStack[log] = true;
|
|
19171
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
19172
|
+
return console.error(log);
|
|
19173
|
+
}
|
|
19174
|
+
console.warn(log);
|
|
19175
|
+
};
|
|
19385
19176
|
|
|
19386
|
-
|
|
19387
|
-
|
|
19177
|
+
var _excluded$b = ["value", "className", "children", "disabled", "divider", "label", "preventAllEvents"];
|
|
19178
|
+
var SelectOptionComponent = function SelectOptionComponent(_ref) {
|
|
19179
|
+
var identValue = _ref.value,
|
|
19180
|
+
_ref$className = _ref.className,
|
|
19181
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
19182
|
+
children = _ref.children,
|
|
19183
|
+
_ref$disabled = _ref.disabled,
|
|
19184
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
19185
|
+
_ref$divider = _ref.divider,
|
|
19186
|
+
divider = _ref$divider === void 0 ? false : _ref$divider,
|
|
19187
|
+
_ref$label = _ref.label,
|
|
19188
|
+
label = _ref$label === void 0 ? false : _ref$label,
|
|
19189
|
+
_ref$preventAllEvents = _ref.preventAllEvents,
|
|
19190
|
+
preventAllEvents = _ref$preventAllEvents === void 0 ? false : _ref$preventAllEvents,
|
|
19191
|
+
props = _objectWithoutProperties(_ref, _excluded$b);
|
|
19192
|
+
var theme$1 = theme.useTheme();
|
|
19193
|
+
var _useScale = useScale(),
|
|
19194
|
+
SCALES = _useScale.SCALES;
|
|
19195
|
+
var _useSelectContext = useSelectContext(),
|
|
19196
|
+
updateValue = _useSelectContext.updateValue,
|
|
19197
|
+
value = _useSelectContext.value,
|
|
19198
|
+
disableAll = _useSelectContext.disableAll;
|
|
19199
|
+
var isDisabled = React.useMemo(function () {
|
|
19200
|
+
return disabled || disableAll;
|
|
19201
|
+
}, [disabled, disableAll]);
|
|
19202
|
+
var isLabel = React.useMemo(function () {
|
|
19203
|
+
return label || divider;
|
|
19204
|
+
}, [label, divider]);
|
|
19205
|
+
var classes = theme.useClasses('option', {
|
|
19206
|
+
divider: divider,
|
|
19207
|
+
label: label
|
|
19208
|
+
}, className);
|
|
19209
|
+
if (!isLabel && identValue === undefined) {
|
|
19210
|
+
useWarning('The props "value" is required.', 'Select Option');
|
|
19211
|
+
}
|
|
19212
|
+
var selected = React.useMemo(function () {
|
|
19213
|
+
if (!value) return false;
|
|
19214
|
+
if (typeof value === 'string') {
|
|
19215
|
+
return identValue === value;
|
|
19216
|
+
}
|
|
19217
|
+
return value.includes("".concat(identValue));
|
|
19218
|
+
}, [identValue, value]);
|
|
19219
|
+
var bgColor = React.useMemo(function () {
|
|
19220
|
+
if (isDisabled) return theme$1.palette.accents_1;
|
|
19221
|
+
return selected ? theme$1.palette.accents_2 : theme$1.palette.background;
|
|
19222
|
+
}, [selected, isDisabled, theme$1.palette]);
|
|
19223
|
+
var hoverBgColor = React.useMemo(function () {
|
|
19224
|
+
if (isDisabled || isLabel || selected) return bgColor;
|
|
19225
|
+
return theme$1.palette.accents_1;
|
|
19226
|
+
}, [selected, isDisabled, theme$1.palette, isLabel, bgColor]);
|
|
19227
|
+
var color = React.useMemo(function () {
|
|
19228
|
+
if (isDisabled) return theme$1.palette.accents_4;
|
|
19229
|
+
return selected ? theme$1.palette.foreground : theme$1.palette.accents_5;
|
|
19230
|
+
}, [selected, isDisabled, theme$1.palette]);
|
|
19231
|
+
var clickHandler = function clickHandler(event) {
|
|
19232
|
+
if (preventAllEvents) return;
|
|
19233
|
+
event.stopPropagation();
|
|
19234
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
19235
|
+
event.preventDefault();
|
|
19236
|
+
if (isDisabled || isLabel) return;
|
|
19237
|
+
updateValue && updateValue(identValue);
|
|
19238
|
+
};
|
|
19239
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
19240
|
+
onClick: clickHandler
|
|
19241
|
+
}, props, {
|
|
19242
|
+
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$1.palette.accents_7, theme$1.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$1.palette.accents_7, theme$1.palette.border, SCALES.font(0.875), SCALES.width(1, '100%')]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
19243
|
+
}), /*#__PURE__*/React.createElement(theme.Ellipsis, {
|
|
19244
|
+
height: SCALES.height(2.25)
|
|
19245
|
+
}, children), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19246
|
+
id: "199367556",
|
|
19247
|
+
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$1.palette.accents_7, theme$1.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$1.palette.accents_7, theme$1.palette.border, SCALES.font(0.875), SCALES.width(1, '100%')]
|
|
19248
|
+
}, ".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$1.palette.accents_7, ";}.divider.__jsx-style-dynamic-selector{line-height:0;overflow:hidden;border-top:1px solid ").concat(theme$1.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$1.palette.accents_7, ";border-bottom:1px solid ").concat(theme$1.palette.border, ";text-transform:capitalize;cursor:default;font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, '100%'), ";font-weight:500;}")));
|
|
19249
|
+
};
|
|
19250
|
+
SelectOptionComponent.displayName = 'SelectOption';
|
|
19251
|
+
var SelectOption = withScale(SelectOptionComponent);
|
|
19388
19252
|
|
|
19389
|
-
|
|
19390
|
-
lodash.prototype[symIterator] = wrapperToIterator;
|
|
19391
|
-
}
|
|
19392
|
-
return lodash;
|
|
19393
|
-
});
|
|
19253
|
+
Select.Option = SelectOption;
|
|
19394
19254
|
|
|
19395
|
-
|
|
19255
|
+
// import Button from '../button'
|
|
19396
19256
|
|
|
19397
|
-
|
|
19398
|
-
|
|
19257
|
+
var makeColgroup = function makeColgroup(width, columns) {
|
|
19258
|
+
var colId = lodashExports.uniqueId('col');
|
|
19259
|
+
var unsetWidthCount = columns.filter(function (c) {
|
|
19260
|
+
return !c.width;
|
|
19261
|
+
}).length;
|
|
19262
|
+
var customWidthTotal = columns.reduce(function (pre, current) {
|
|
19263
|
+
return current.width ? pre + current.width : pre;
|
|
19264
|
+
}, 0);
|
|
19265
|
+
var averageWidth = (width - customWidthTotal) / unsetWidthCount;
|
|
19266
|
+
if (averageWidth <= 0) return /*#__PURE__*/React.createElement("colgroup", null);
|
|
19267
|
+
return /*#__PURE__*/React.createElement("colgroup", null, columns.map(function (column) {
|
|
19268
|
+
return /*#__PURE__*/React.createElement("col", {
|
|
19269
|
+
key: "colgroup-".concat(colId),
|
|
19270
|
+
width: column.width || averageWidth
|
|
19271
|
+
});
|
|
19272
|
+
}));
|
|
19273
|
+
};
|
|
19274
|
+
var TableHead = function TableHead(props) {
|
|
19275
|
+
var theme$1 = theme.useTheme();
|
|
19276
|
+
var _ref = props,
|
|
19277
|
+
columns = _ref.columns,
|
|
19278
|
+
width = _ref.width,
|
|
19279
|
+
onFilters = _ref.onFilters,
|
|
19280
|
+
showFilters = _ref.showFilters,
|
|
19281
|
+
stickyHeader = _ref.stickyHeader;
|
|
19282
|
+
var isScalableWidth = React.useMemo(function () {
|
|
19283
|
+
return columns.find(function (item) {
|
|
19284
|
+
return !!item.width;
|
|
19285
|
+
});
|
|
19286
|
+
}, [columns]);
|
|
19287
|
+
var colgroup = React.useMemo(function () {
|
|
19288
|
+
if (!isScalableWidth) return /*#__PURE__*/React.createElement("colgroup", null);
|
|
19289
|
+
return makeColgroup(width, columns);
|
|
19290
|
+
}, [isScalableWidth, width]);
|
|
19291
|
+
var _React$useState = React.useState(columns.reduce(function (acc, col) {
|
|
19292
|
+
if (col.filter) {
|
|
19293
|
+
acc["".concat(col.filter)] = col.filter === 'date' ? null : '';
|
|
19294
|
+
}
|
|
19295
|
+
return acc;
|
|
19296
|
+
}, {})),
|
|
19297
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
19298
|
+
filters = _React$useState2[0],
|
|
19299
|
+
setFilters = _React$useState2[1];
|
|
19399
19300
|
|
|
19400
|
-
|
|
19401
|
-
|
|
19402
|
-
|
|
19403
|
-
|
|
19404
|
-
|
|
19405
|
-
freeExports._ = _;
|
|
19406
|
-
}
|
|
19407
|
-
else {
|
|
19408
|
-
// Export to the global object.
|
|
19409
|
-
root._ = _;
|
|
19410
|
-
}
|
|
19411
|
-
}.call(lodash));
|
|
19412
|
-
} (lodash$1, lodash$1.exports));
|
|
19413
|
-
return lodash$1.exports;
|
|
19414
|
-
}
|
|
19301
|
+
// const applyFilters = () => {
|
|
19302
|
+
// if (onFilters) {
|
|
19303
|
+
// onFilters(filters);
|
|
19304
|
+
// }
|
|
19305
|
+
// }
|
|
19415
19306
|
|
|
19416
|
-
var
|
|
19417
|
-
|
|
19307
|
+
var handleFilterChange = function handleFilterChange(name, value) {
|
|
19308
|
+
setFilters(function (prevFilters) {
|
|
19309
|
+
var updatedFilters = _objectSpread2(_objectSpread2({}, prevFilters), {}, _defineProperty({}, name, value));
|
|
19310
|
+
if (onFilters) {
|
|
19311
|
+
onFilters(filters);
|
|
19312
|
+
}
|
|
19313
|
+
return updatedFilters;
|
|
19314
|
+
});
|
|
19315
|
+
};
|
|
19316
|
+
var generateFilterInputs = function generateFilterInputs() {
|
|
19317
|
+
return columns.map(function (col) {
|
|
19318
|
+
var _String, _filters$filterName;
|
|
19319
|
+
var Header = col.label,
|
|
19320
|
+
accessor = col.filter,
|
|
19321
|
+
options = col.options;
|
|
19322
|
+
var filterName = (_String = String(col === null || col === void 0 ? void 0 : col.label)) === null || _String === void 0 ? void 0 : _String.replace(' ', '_').toLowerCase();
|
|
19323
|
+
// const unq_accessor = _.uniqueId(filterName);
|
|
19324
|
+
// if (Header === 'actions') {
|
|
19325
|
+
// return (
|
|
19326
|
+
// <th style={{ margin: '3px' }} data-column={Header} key={unq_accessor}>
|
|
19327
|
+
// <Button onClick={applyFilters} auto px={0.6} scale={2 / 3}>Apply</Button>
|
|
19328
|
+
// </th>
|
|
19329
|
+
// )
|
|
19330
|
+
// }
|
|
19331
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
19332
|
+
style: {
|
|
19333
|
+
padding: '3px',
|
|
19334
|
+
textAlign: 'left'
|
|
19335
|
+
},
|
|
19336
|
+
"data-column": Header
|
|
19337
|
+
}, accessor === 'fixed' && /*#__PURE__*/React.createElement(Select
|
|
19338
|
+
// key={unq_accessor}
|
|
19339
|
+
// name={filterName}
|
|
19340
|
+
, {
|
|
19341
|
+
value: (_filters$filterName = filters[filterName]) !== null && _filters$filterName !== void 0 ? _filters$filterName : 'All',
|
|
19342
|
+
onChange: function onChange(newValue) {
|
|
19343
|
+
return handleFilterChange(filterName, newValue);
|
|
19344
|
+
}
|
|
19345
|
+
}, /*#__PURE__*/React.createElement(Select.Option, {
|
|
19346
|
+
value: "All"
|
|
19347
|
+
}, "All ", Header), options ? options.map(function (option) {
|
|
19348
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
19349
|
+
value: option.value
|
|
19350
|
+
}, option.name);
|
|
19351
|
+
}) : null), accessor === 'date' && /*#__PURE__*/React.createElement(Input
|
|
19352
|
+
// id={`filter-date-${filterName}`}
|
|
19353
|
+
, {
|
|
19354
|
+
type: "date"
|
|
19355
|
+
// name={filterName}
|
|
19356
|
+
,
|
|
19357
|
+
value: filters[filterName],
|
|
19358
|
+
onChange: function onChange(e) {
|
|
19359
|
+
return handleFilterChange(filterName, e.target.value);
|
|
19360
|
+
}
|
|
19361
|
+
}), accessor === 'search' && /*#__PURE__*/React.createElement(Input
|
|
19362
|
+
// id={`filter-search-${filterName}`}
|
|
19363
|
+
, {
|
|
19364
|
+
type: "text",
|
|
19365
|
+
autoComplete: "off"
|
|
19366
|
+
// ref={filterRefs.current[filterName]} // Dynamically set ref}
|
|
19367
|
+
// name={filterName}
|
|
19368
|
+
,
|
|
19369
|
+
style: {
|
|
19370
|
+
height: 30,
|
|
19371
|
+
minWidth: 160
|
|
19372
|
+
},
|
|
19373
|
+
value: filters[filterName],
|
|
19374
|
+
onChange: function onChange(e) {
|
|
19375
|
+
return handleFilterChange(filterName, e.target.value);
|
|
19376
|
+
},
|
|
19377
|
+
placeholder: "Search...",
|
|
19378
|
+
fullWidth: true
|
|
19379
|
+
}));
|
|
19380
|
+
});
|
|
19381
|
+
};
|
|
19382
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
|
|
19383
|
+
className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]])
|
|
19384
|
+
}, /*#__PURE__*/React.createElement("tr", {
|
|
19385
|
+
style: {
|
|
19386
|
+
backgroundColor: theme$1.palette.background
|
|
19387
|
+
},
|
|
19388
|
+
className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]])
|
|
19389
|
+
}, columns.map(function (column, _index) {
|
|
19390
|
+
var _String2;
|
|
19391
|
+
var dataName = (_String2 = String(column === null || column === void 0 ? void 0 : column.label)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
|
|
19392
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
19393
|
+
style: _objectSpread2({
|
|
19394
|
+
// textAlign: `${column?.align} !important`,
|
|
19395
|
+
// paddingLeft: '0.3rem',
|
|
19396
|
+
// paddingRight: '0.3rem',
|
|
19397
|
+
backgroundColor: theme$1.type == 'dark' ? theme$1.palette.accents_1 : theme$1.palette.background,
|
|
19398
|
+
color: "".concat(column !== null && column !== void 0 && column.color ? column === null || column === void 0 ? void 0 : column.color : '#333'),
|
|
19399
|
+
whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
|
|
19400
|
+
}, column === null || column === void 0 ? void 0 : column.style),
|
|
19401
|
+
"data-column": dataName,
|
|
19402
|
+
className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]]) + " " + (column.className || "")
|
|
19403
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
19404
|
+
className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]]) + " " + "thead-box"
|
|
19405
|
+
}, column.label, /*#__PURE__*/React.createElement("br", {
|
|
19406
|
+
className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]])
|
|
19407
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
19408
|
+
style: {
|
|
19409
|
+
textAlign: 'center'
|
|
19410
|
+
},
|
|
19411
|
+
className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]])
|
|
19412
|
+
}, column.text)));
|
|
19413
|
+
})), showFilters && /*#__PURE__*/React.createElement("tr", {
|
|
19414
|
+
className: _JSXStyle.dynamic([["4089411751", [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]]])
|
|
19415
|
+
}, generateFilterInputs())), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19416
|
+
id: "4089411751",
|
|
19417
|
+
dynamic: [theme$1.palette.background, stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", theme$1.palette.accents_5, theme$1.palette.accents_1, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius]
|
|
19418
|
+
}, "thead.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;background-color:".concat(theme$1.palette.background, ";font-size:inherit;").concat(stickyHeader && "\n position: sticky;\n top: 0;\n z-index: 1;\n ", ";}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$1.palette.accents_5, ";background:").concat(theme$1.palette.accents_1, ";border-bottom:1px solid ").concat(theme$1.palette.border, ";border-top:1px solid ").concat(theme$1.palette.border, ";border-radius:0;}th.__jsx-style-dynamic-selector:nth-child(1){border-bottom:1px solid ").concat(theme$1.palette.border, ";border-left:1px solid ").concat(theme$1.palette.border, ";border-top:1px solid ").concat(theme$1.palette.border, ";border-top-left-radius:").concat(theme$1.layout.radius, ";border-bottom-left-radius:").concat(theme$1.layout.radius, ";}th.__jsx-style-dynamic-selector:last-child{border-bottom:1px solid ").concat(theme$1.palette.border, ";border-right:1px solid ").concat(theme$1.palette.border, ";border-top:1px solid ").concat(theme$1.palette.border, ";border-top-right-radius:").concat(theme$1.layout.radius, ";border-bottom-right-radius:").concat(theme$1.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;}")));
|
|
19419
|
+
};
|
|
19420
|
+
TableHead.displayName = 'TableHead';
|
|
19418
19421
|
|
|
19419
19422
|
function Empty() {
|
|
19420
19423
|
return /*#__PURE__*/React.createElement("svg", {
|
|
@@ -19992,7 +19995,7 @@ var TableCell = function TableCell(_ref) {
|
|
|
19992
19995
|
whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
|
|
19993
19996
|
}, currentRowValue === null || currentRowValue === void 0 ? void 0 : currentRowValue.style),
|
|
19994
19997
|
"data-column": column.prop,
|
|
19995
|
-
key: "row-td-".concat(
|
|
19998
|
+
key: "row-td-".concat(currentRowValue.id, "-").concat(column.prop.toString()),
|
|
19996
19999
|
onClick: function onClick() {
|
|
19997
20000
|
return onCellClick && onCellClick(currentRowValue, rowIndex, index);
|
|
19998
20001
|
},
|
|
@@ -20080,7 +20083,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
20080
20083
|
|
|
20081
20084
|
function renderRow(cols, row, index) {
|
|
20082
20085
|
var _row$style;
|
|
20083
|
-
|
|
20086
|
+
// const urid = _.uniqueId();
|
|
20084
20087
|
var className = rowClassName(row, index);
|
|
20085
20088
|
var rw = _objectSpread2({}, row);
|
|
20086
20089
|
var rowStyle = (_row$style = row === null || row === void 0 ? void 0 : row.style) !== null && _row$style !== void 0 ? _row$style : {};
|
|
@@ -20101,7 +20104,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
20101
20104
|
onDragStart: onDragStart,
|
|
20102
20105
|
"aria-checked": selected.indexOf(row) !== -1,
|
|
20103
20106
|
tabIndex: -1,
|
|
20104
|
-
key:
|
|
20107
|
+
key: "table-row-".concat(rw.id),
|
|
20105
20108
|
style: _objectSpread2({
|
|
20106
20109
|
cursor: 'pointer',
|
|
20107
20110
|
backgroundColor: isRowSelected ? hoverColor : ''
|
|
@@ -20817,22 +20820,26 @@ var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
|
|
|
20817
20820
|
secondary: {
|
|
20818
20821
|
bg: palette.background,
|
|
20819
20822
|
border: palette.foreground,
|
|
20820
|
-
color: palette.foreground
|
|
20823
|
+
color: palette.foreground,
|
|
20824
|
+
ripple: ''
|
|
20821
20825
|
},
|
|
20822
20826
|
success: {
|
|
20823
20827
|
bg: palette.background,
|
|
20824
20828
|
border: palette.success,
|
|
20825
|
-
color: palette.success
|
|
20829
|
+
color: palette.success,
|
|
20830
|
+
ripple: ''
|
|
20826
20831
|
},
|
|
20827
20832
|
warning: {
|
|
20828
20833
|
bg: palette.background,
|
|
20829
20834
|
border: palette.warning,
|
|
20830
|
-
color: palette.warning
|
|
20835
|
+
color: palette.warning,
|
|
20836
|
+
ripple: ''
|
|
20831
20837
|
},
|
|
20832
20838
|
error: {
|
|
20833
20839
|
bg: palette.background,
|
|
20834
20840
|
border: palette.error,
|
|
20835
|
-
color: palette.error
|
|
20841
|
+
color: palette.error,
|
|
20842
|
+
ripple: ''
|
|
20836
20843
|
}
|
|
20837
20844
|
};
|
|
20838
20845
|
return colors[_color] || null;
|
|
@@ -20845,38 +20852,45 @@ var getButtonColors = function getButtonColors(palette, props) {
|
|
|
20845
20852
|
"default": {
|
|
20846
20853
|
bg: palette.background,
|
|
20847
20854
|
border: palette.border,
|
|
20848
|
-
color: palette.accents_5
|
|
20855
|
+
color: palette.accents_5,
|
|
20856
|
+
ripple: palette.accents_1
|
|
20849
20857
|
},
|
|
20850
20858
|
secondary: {
|
|
20851
20859
|
bg: palette.foreground,
|
|
20852
20860
|
border: palette.foreground,
|
|
20853
|
-
color: palette.background
|
|
20861
|
+
color: palette.background,
|
|
20862
|
+
ripple: palette.accents_1
|
|
20854
20863
|
},
|
|
20855
20864
|
success: {
|
|
20856
20865
|
bg: palette.success,
|
|
20857
20866
|
border: palette.success,
|
|
20858
|
-
color: '#fff'
|
|
20867
|
+
color: '#fff',
|
|
20868
|
+
ripple: '#1f93ffff'
|
|
20859
20869
|
},
|
|
20860
20870
|
warning: {
|
|
20861
20871
|
bg: palette.warning,
|
|
20862
20872
|
border: palette.warning,
|
|
20863
|
-
color: '#fff'
|
|
20873
|
+
color: '#fff',
|
|
20874
|
+
ripple: '#ffca29ff'
|
|
20864
20875
|
},
|
|
20865
20876
|
error: {
|
|
20866
20877
|
bg: palette.error,
|
|
20867
20878
|
border: palette.error,
|
|
20868
|
-
color: '#fff'
|
|
20879
|
+
color: '#fff',
|
|
20880
|
+
ripple: '#ff5a55ff'
|
|
20869
20881
|
},
|
|
20870
20882
|
abort: {
|
|
20871
20883
|
bg: 'transparent',
|
|
20872
20884
|
border: 'transparent',
|
|
20873
|
-
color: palette.accents_5
|
|
20885
|
+
color: palette.accents_5,
|
|
20886
|
+
ripple: palette.accents_1
|
|
20874
20887
|
}
|
|
20875
20888
|
};
|
|
20876
20889
|
if (disabled) return {
|
|
20877
20890
|
bg: palette.accents_1,
|
|
20878
20891
|
border: palette.accents_2,
|
|
20879
|
-
color: '#ccc'
|
|
20892
|
+
color: '#ccc',
|
|
20893
|
+
ripple: ''
|
|
20880
20894
|
};
|
|
20881
20895
|
|
|
20882
20896
|
/**
|
|
@@ -21056,7 +21070,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
21056
21070
|
}, [theme$1.palette, filteredProps]),
|
|
21057
21071
|
bg = _useMemo.bg,
|
|
21058
21072
|
border = _useMemo.border,
|
|
21059
|
-
color = _useMemo.color
|
|
21073
|
+
color = _useMemo.color,
|
|
21074
|
+
rippleColor = _useMemo.ripple;
|
|
21060
21075
|
var hover = React.useMemo(function () {
|
|
21061
21076
|
return getButtonHoverColors(theme$1.palette, filteredProps);
|
|
21062
21077
|
}, [theme$1.palette, filteredProps]);
|
|
@@ -21075,6 +21090,45 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
21075
21090
|
setDripX(0);
|
|
21076
21091
|
setDripY(0);
|
|
21077
21092
|
};
|
|
21093
|
+
var createRipple = function createRipple(event) {
|
|
21094
|
+
var button = buttonRef.current;
|
|
21095
|
+
if (!button) return;
|
|
21096
|
+
var rect = button.getBoundingClientRect();
|
|
21097
|
+
var size = Math.max(rect.width, rect.height);
|
|
21098
|
+
var x = event.clientX - rect.left - size / 2;
|
|
21099
|
+
var y = event.clientY - rect.top - size / 2;
|
|
21100
|
+
var rippleCount = 1; // number of rings
|
|
21101
|
+
var rippleDelay = 500; // ms between each ripple
|
|
21102
|
+
var _loop = function _loop() {
|
|
21103
|
+
var ripple = document.createElement('span');
|
|
21104
|
+
Object.assign(ripple.style, {
|
|
21105
|
+
position: 'absolute',
|
|
21106
|
+
borderRadius: '50%',
|
|
21107
|
+
backgroundColor: rippleColor,
|
|
21108
|
+
width: "".concat(size, "px"),
|
|
21109
|
+
height: "".concat(size, "px"),
|
|
21110
|
+
left: "".concat(x, "px"),
|
|
21111
|
+
top: "".concat(y, "px"),
|
|
21112
|
+
pointerEvents: 'none',
|
|
21113
|
+
transform: 'scale(0)',
|
|
21114
|
+
opacity: '1',
|
|
21115
|
+
transition: "transform 600ms ease-out ".concat(i * rippleDelay, "ms, opacity 600ms ease-out ").concat(i * rippleDelay, "ms"),
|
|
21116
|
+
zIndex: 1
|
|
21117
|
+
});
|
|
21118
|
+
button.appendChild(ripple);
|
|
21119
|
+
|
|
21120
|
+
// Force reflow to start transition
|
|
21121
|
+
window.getComputedStyle(ripple).opacity;
|
|
21122
|
+
ripple.style.transform = 'scale(2.5)';
|
|
21123
|
+
ripple.style.opacity = '0';
|
|
21124
|
+
ripple.addEventListener('transitionend', function () {
|
|
21125
|
+
ripple.remove();
|
|
21126
|
+
});
|
|
21127
|
+
};
|
|
21128
|
+
for (var i = 0; i < rippleCount; i++) {
|
|
21129
|
+
_loop();
|
|
21130
|
+
}
|
|
21131
|
+
};
|
|
21078
21132
|
var clickHandler = function clickHandler(event) {
|
|
21079
21133
|
if (disabled || loading) return;
|
|
21080
21134
|
var showDrip = !shadow && !ghost && effect;
|
|
@@ -21085,6 +21139,9 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
21085
21139
|
setDripX(event.clientX - rect.left);
|
|
21086
21140
|
setDripY(event.clientY - rect.top);
|
|
21087
21141
|
}
|
|
21142
|
+
if (shadow) {
|
|
21143
|
+
createRipple(event);
|
|
21144
|
+
}
|
|
21088
21145
|
onClick && onClick(event);
|
|
21089
21146
|
};
|
|
21090
21147
|
var childrenWithIcon = React.useMemo(function () {
|
|
@@ -21095,13 +21152,16 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
21095
21152
|
}, [auto, children, icon, iconRight]);
|
|
21096
21153
|
var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
|
|
21097
21154
|
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
21155
|
+
|
|
21156
|
+
// If shadow provided is string then value other default
|
|
21157
|
+
var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme$1.shadows.level.z2 : 'none';
|
|
21098
21158
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
21099
21159
|
ref: buttonRef,
|
|
21100
21160
|
type: type,
|
|
21101
21161
|
disabled: disabled,
|
|
21102
21162
|
onClick: clickHandler
|
|
21103
21163
|
}, props, {
|
|
21104
|
-
className: _JSXStyle.dynamic([["
|
|
21164
|
+
className: _JSXStyle.dynamic([["960361315", [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor, events, shadow ? btnShadow : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, btnShadow, shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || theme.useClasses('btn', className) || "")
|
|
21105
21165
|
}), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
|
|
21106
21166
|
color: color
|
|
21107
21167
|
}), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
|
|
@@ -21110,9 +21170,9 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
21110
21170
|
color: dripColor,
|
|
21111
21171
|
onCompleted: dripCompletedHandle
|
|
21112
21172
|
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
21113
|
-
id: "
|
|
21114
|
-
dynamic: [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ?
|
|
21115
|
-
}, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(round ? '50%' : theme$1.layout.radius, ";font-weight:400;font-size:").concat(SCALES.font(0.875), ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;text-transform:capitalize;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;white-space:nowrap;-webkit-transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;position:relative;overflow:hidden;color:").concat(color, ";background-color:").concat(bg, ";border:1px solid ").concat(border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ?
|
|
21173
|
+
id: "960361315",
|
|
21174
|
+
dynamic: [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor, events, shadow ? btnShadow : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, btnShadow, shadow ? '-1px' : '0px']
|
|
21175
|
+
}, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(round ? '50%' : theme$1.layout.radius, ";font-weight:400;font-size:").concat(SCALES.font(0.875), ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;text-transform:capitalize;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;white-space:nowrap;-webkit-transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;position:relative;overflow:hidden;color:").concat(color, ";background-color:").concat(bg, ";border:1px solid ").concat(shadow ? 'transparent' : border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? btnShadow : 'none', ";--helpdice-ui-button-icon-padding:").concat(SCALES.pl(0.727), ";--helpdice-ui-button-height:").concat(SCALES.height(2.5), ";--helpdice-ui-button-color:").concat(color, ";--helpdice-ui-button-bg:").concat(bg, ";min-width:").concat(auto ? 'min-content' : SCALES.width(10.5), ";width:").concat(auto ? 'auto' : 'initial', ";height:").concat(SCALES.height(2.5), ";padding:").concat(SCALES.pt(0), " ").concat(paddingRight, " ").concat(SCALES.pb(0), " ").concat(paddingLeft, ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.btn.__jsx-style-dynamic-selector:hover,.btn.__jsx-style-dynamic-selector:focus{color:").concat(hover.color, ";--helpdice-ui-button-color:").concat(hover.color, ";background-color:").concat(hover.bg, ";border-color:").concat(hover.border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(btnShadow, ";}.btn.__jsx-style-dynamic-selector .text{position:relative;z-index:1;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;text-align:center;line-height:inherit;top:-1px;}.btn.__jsx-style-dynamic-selector .text p,.btn.__jsx-style-dynamic-selector .text pre,.btn.__jsx-style-dynamic-selector .text div{margin:0;}.ripple.__jsx-style-dynamic-selector{position:absolute;border-radius:50%;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-animation:ripple-animation-__jsx-style-dynamic-selector 600ms ease-out;animation:ripple-animation-__jsx-style-dynamic-selector 600ms ease-out;background-color:rgba(0,0,0,0.3);pointer-events:none;z-index:1;}@-webkit-keyframes ripple-animation-__jsx-style-dynamic-selector{to{-webkit-transform:scale(2.5);-ms-transform:scale(2.5);transform:scale(2.5);opacity:0;}}@keyframes ripple-animation-__jsx-style-dynamic-selector{to{-webkit-transform:scale(2.5);-ms-transform:scale(2.5);transform:scale(2.5);opacity:0;}}")));
|
|
21116
21176
|
});
|
|
21117
21177
|
ButtonComponent.displayName = 'Button';
|
|
21118
21178
|
var Button = withScale(ButtonComponent);
|