@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/index.js
CHANGED
|
@@ -1365,7 +1365,7 @@ var withScale = function withScale(Render) {
|
|
|
1365
1365
|
return ScaleFC;
|
|
1366
1366
|
};
|
|
1367
1367
|
|
|
1368
|
-
var _excluded$1o = ["label", "labelRight", "color", "error", "type", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1368
|
+
var _excluded$1o = ["label", "labelRight", "color", "error", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1369
1369
|
var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
1370
1370
|
return _objectSpread2(_objectSpread2({}, event), {}, {
|
|
1371
1371
|
target: el,
|
|
@@ -1381,6 +1381,8 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1381
1381
|
_ref$type = _ref.type,
|
|
1382
1382
|
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1383
1383
|
icon = _ref.icon,
|
|
1384
|
+
_ref$variant = _ref.variant,
|
|
1385
|
+
variant = _ref$variant === void 0 ? 'normal' : _ref$variant,
|
|
1384
1386
|
iconRight = _ref.iconRight,
|
|
1385
1387
|
_ref$iconClickable = _ref.iconClickable,
|
|
1386
1388
|
iconClickable = _ref$iconClickable === void 0 ? false : _ref$iconClickable,
|
|
@@ -1485,11 +1487,11 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1485
1487
|
var inputProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
|
|
1486
1488
|
var defaultWidth = fullWidth ? '100%' : 'initial';
|
|
1487
1489
|
return /*#__PURE__*/React.createElement("div", {
|
|
1488
|
-
className: _JSXStyle.dynamic([["
|
|
1490
|
+
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"
|
|
1489
1491
|
}, children && /*#__PURE__*/React.createElement(InputBlockLabel, null, children), /*#__PURE__*/React.createElement("div", {
|
|
1490
|
-
className: _JSXStyle.dynamic([["
|
|
1492
|
+
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) || "")
|
|
1491
1493
|
}, label && /*#__PURE__*/React.createElement(MemoInputLabel, null, label), /*#__PURE__*/React.createElement("div", {
|
|
1492
|
-
className: _JSXStyle.dynamic([["
|
|
1494
|
+
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', {
|
|
1493
1495
|
hover: hover,
|
|
1494
1496
|
disabled: disabled
|
|
1495
1497
|
}, labelClasses) || "")
|
|
@@ -1506,7 +1508,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1506
1508
|
onChange: changeHandler,
|
|
1507
1509
|
autoComplete: autoComplete
|
|
1508
1510
|
}, inputProps, {
|
|
1509
|
-
className: _JSXStyle.dynamic([["
|
|
1511
|
+
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({
|
|
1510
1512
|
disabled: disabled
|
|
1511
1513
|
}, iconClasses) || "")
|
|
1512
1514
|
})), clearable && /*#__PURE__*/React.createElement(MemoInputIconClear, {
|
|
@@ -1518,7 +1520,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1518
1520
|
}, iconProps))), labelRight && /*#__PURE__*/React.createElement(MemoInputLabel, {
|
|
1519
1521
|
isRight: true
|
|
1520
1522
|
}, labelRight), /*#__PURE__*/React.createElement("br", {
|
|
1521
|
-
className: _JSXStyle.dynamic([["
|
|
1523
|
+
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]]])
|
|
1522
1524
|
})), error && /*#__PURE__*/React.createElement("p", {
|
|
1523
1525
|
style: {
|
|
1524
1526
|
marginTop: 0.4,
|
|
@@ -1527,11 +1529,11 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1527
1529
|
marginBottom: '0.4rem',
|
|
1528
1530
|
textAlign: 'left'
|
|
1529
1531
|
},
|
|
1530
|
-
className: _JSXStyle.dynamic([["
|
|
1532
|
+
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"
|
|
1531
1533
|
}, error), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1532
|
-
id: "
|
|
1533
|
-
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]
|
|
1534
|
-
}, ".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;}")));
|
|
1534
|
+
id: "3970712841",
|
|
1535
|
+
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]
|
|
1536
|
+
}, ".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;}")));
|
|
1535
1537
|
});
|
|
1536
1538
|
InputComponent.displayName = 'Input';
|
|
1537
1539
|
var Input = withScale(InputComponent);
|
|
@@ -2596,22 +2598,26 @@ var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
|
|
|
2596
2598
|
secondary: {
|
|
2597
2599
|
bg: palette.background,
|
|
2598
2600
|
border: palette.foreground,
|
|
2599
|
-
color: palette.foreground
|
|
2601
|
+
color: palette.foreground,
|
|
2602
|
+
ripple: ''
|
|
2600
2603
|
},
|
|
2601
2604
|
success: {
|
|
2602
2605
|
bg: palette.background,
|
|
2603
2606
|
border: palette.success,
|
|
2604
|
-
color: palette.success
|
|
2607
|
+
color: palette.success,
|
|
2608
|
+
ripple: ''
|
|
2605
2609
|
},
|
|
2606
2610
|
warning: {
|
|
2607
2611
|
bg: palette.background,
|
|
2608
2612
|
border: palette.warning,
|
|
2609
|
-
color: palette.warning
|
|
2613
|
+
color: palette.warning,
|
|
2614
|
+
ripple: ''
|
|
2610
2615
|
},
|
|
2611
2616
|
error: {
|
|
2612
2617
|
bg: palette.background,
|
|
2613
2618
|
border: palette.error,
|
|
2614
|
-
color: palette.error
|
|
2619
|
+
color: palette.error,
|
|
2620
|
+
ripple: ''
|
|
2615
2621
|
}
|
|
2616
2622
|
};
|
|
2617
2623
|
return colors[_color] || null;
|
|
@@ -2624,38 +2630,45 @@ var getButtonColors = function getButtonColors(palette, props) {
|
|
|
2624
2630
|
"default": {
|
|
2625
2631
|
bg: palette.background,
|
|
2626
2632
|
border: palette.border,
|
|
2627
|
-
color: palette.accents_5
|
|
2633
|
+
color: palette.accents_5,
|
|
2634
|
+
ripple: palette.accents_1
|
|
2628
2635
|
},
|
|
2629
2636
|
secondary: {
|
|
2630
2637
|
bg: palette.foreground,
|
|
2631
2638
|
border: palette.foreground,
|
|
2632
|
-
color: palette.background
|
|
2639
|
+
color: palette.background,
|
|
2640
|
+
ripple: palette.accents_1
|
|
2633
2641
|
},
|
|
2634
2642
|
success: {
|
|
2635
2643
|
bg: palette.success,
|
|
2636
2644
|
border: palette.success,
|
|
2637
|
-
color: '#fff'
|
|
2645
|
+
color: '#fff',
|
|
2646
|
+
ripple: '#1f93ffff'
|
|
2638
2647
|
},
|
|
2639
2648
|
warning: {
|
|
2640
2649
|
bg: palette.warning,
|
|
2641
2650
|
border: palette.warning,
|
|
2642
|
-
color: '#fff'
|
|
2651
|
+
color: '#fff',
|
|
2652
|
+
ripple: '#ffca29ff'
|
|
2643
2653
|
},
|
|
2644
2654
|
error: {
|
|
2645
2655
|
bg: palette.error,
|
|
2646
2656
|
border: palette.error,
|
|
2647
|
-
color: '#fff'
|
|
2657
|
+
color: '#fff',
|
|
2658
|
+
ripple: '#ff5a55ff'
|
|
2648
2659
|
},
|
|
2649
2660
|
abort: {
|
|
2650
2661
|
bg: 'transparent',
|
|
2651
2662
|
border: 'transparent',
|
|
2652
|
-
color: palette.accents_5
|
|
2663
|
+
color: palette.accents_5,
|
|
2664
|
+
ripple: palette.accents_1
|
|
2653
2665
|
}
|
|
2654
2666
|
};
|
|
2655
2667
|
if (disabled) return {
|
|
2656
2668
|
bg: palette.accents_1,
|
|
2657
2669
|
border: palette.accents_2,
|
|
2658
|
-
color: '#ccc'
|
|
2670
|
+
color: '#ccc',
|
|
2671
|
+
ripple: ''
|
|
2659
2672
|
};
|
|
2660
2673
|
|
|
2661
2674
|
/**
|
|
@@ -2835,7 +2848,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
2835
2848
|
}, [theme$1.palette, filteredProps]),
|
|
2836
2849
|
bg = _useMemo.bg,
|
|
2837
2850
|
border = _useMemo.border,
|
|
2838
|
-
color = _useMemo.color
|
|
2851
|
+
color = _useMemo.color,
|
|
2852
|
+
rippleColor = _useMemo.ripple;
|
|
2839
2853
|
var hover = React.useMemo(function () {
|
|
2840
2854
|
return getButtonHoverColors(theme$1.palette, filteredProps);
|
|
2841
2855
|
}, [theme$1.palette, filteredProps]);
|
|
@@ -2854,6 +2868,45 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
2854
2868
|
setDripX(0);
|
|
2855
2869
|
setDripY(0);
|
|
2856
2870
|
};
|
|
2871
|
+
var createRipple = function createRipple(event) {
|
|
2872
|
+
var button = buttonRef.current;
|
|
2873
|
+
if (!button) return;
|
|
2874
|
+
var rect = button.getBoundingClientRect();
|
|
2875
|
+
var size = Math.max(rect.width, rect.height);
|
|
2876
|
+
var x = event.clientX - rect.left - size / 2;
|
|
2877
|
+
var y = event.clientY - rect.top - size / 2;
|
|
2878
|
+
var rippleCount = 1; // number of rings
|
|
2879
|
+
var rippleDelay = 500; // ms between each ripple
|
|
2880
|
+
var _loop = function _loop() {
|
|
2881
|
+
var ripple = document.createElement('span');
|
|
2882
|
+
Object.assign(ripple.style, {
|
|
2883
|
+
position: 'absolute',
|
|
2884
|
+
borderRadius: '50%',
|
|
2885
|
+
backgroundColor: rippleColor,
|
|
2886
|
+
width: "".concat(size, "px"),
|
|
2887
|
+
height: "".concat(size, "px"),
|
|
2888
|
+
left: "".concat(x, "px"),
|
|
2889
|
+
top: "".concat(y, "px"),
|
|
2890
|
+
pointerEvents: 'none',
|
|
2891
|
+
transform: 'scale(0)',
|
|
2892
|
+
opacity: '1',
|
|
2893
|
+
transition: "transform 600ms ease-out ".concat(i * rippleDelay, "ms, opacity 600ms ease-out ").concat(i * rippleDelay, "ms"),
|
|
2894
|
+
zIndex: 1
|
|
2895
|
+
});
|
|
2896
|
+
button.appendChild(ripple);
|
|
2897
|
+
|
|
2898
|
+
// Force reflow to start transition
|
|
2899
|
+
window.getComputedStyle(ripple).opacity;
|
|
2900
|
+
ripple.style.transform = 'scale(2.5)';
|
|
2901
|
+
ripple.style.opacity = '0';
|
|
2902
|
+
ripple.addEventListener('transitionend', function () {
|
|
2903
|
+
ripple.remove();
|
|
2904
|
+
});
|
|
2905
|
+
};
|
|
2906
|
+
for (var i = 0; i < rippleCount; i++) {
|
|
2907
|
+
_loop();
|
|
2908
|
+
}
|
|
2909
|
+
};
|
|
2857
2910
|
var clickHandler = function clickHandler(event) {
|
|
2858
2911
|
if (disabled || loading) return;
|
|
2859
2912
|
var showDrip = !shadow && !ghost && effect;
|
|
@@ -2864,6 +2917,9 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
2864
2917
|
setDripX(event.clientX - rect.left);
|
|
2865
2918
|
setDripY(event.clientY - rect.top);
|
|
2866
2919
|
}
|
|
2920
|
+
if (shadow) {
|
|
2921
|
+
createRipple(event);
|
|
2922
|
+
}
|
|
2867
2923
|
onClick && onClick(event);
|
|
2868
2924
|
};
|
|
2869
2925
|
var childrenWithIcon = React.useMemo(function () {
|
|
@@ -2874,13 +2930,16 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
2874
2930
|
}, [auto, children, icon, iconRight]);
|
|
2875
2931
|
var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
|
|
2876
2932
|
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
2933
|
+
|
|
2934
|
+
// If shadow provided is string then value other default
|
|
2935
|
+
var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme$1.shadows.level.z2 : 'none';
|
|
2877
2936
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
2878
2937
|
ref: buttonRef,
|
|
2879
2938
|
type: type,
|
|
2880
2939
|
disabled: disabled,
|
|
2881
2940
|
onClick: clickHandler
|
|
2882
2941
|
}, props, {
|
|
2883
|
-
className: _JSXStyle.dynamic([["
|
|
2942
|
+
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) || "")
|
|
2884
2943
|
}), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
|
|
2885
2944
|
color: color
|
|
2886
2945
|
}), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
|
|
@@ -2889,9 +2948,9 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
2889
2948
|
color: dripColor,
|
|
2890
2949
|
onCompleted: dripCompletedHandle
|
|
2891
2950
|
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
2892
|
-
id: "
|
|
2893
|
-
dynamic: [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ?
|
|
2894
|
-
}, ".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 ?
|
|
2951
|
+
id: "960361315",
|
|
2952
|
+
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']
|
|
2953
|
+
}, ".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;}}")));
|
|
2895
2954
|
});
|
|
2896
2955
|
ButtonComponent.displayName = 'Button';
|
|
2897
2956
|
var Button = withScale(ButtonComponent);
|
|
@@ -11080,7 +11139,7 @@ var GridContainer = withScale(GridContainerComponent);
|
|
|
11080
11139
|
|
|
11081
11140
|
Grid.Container = GridContainer;
|
|
11082
11141
|
|
|
11083
|
-
/*! @license DOMPurify 3.
|
|
11142
|
+
/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */
|
|
11084
11143
|
|
|
11085
11144
|
const {
|
|
11086
11145
|
entries,
|
|
@@ -11266,7 +11325,7 @@ function lookupGetter(object, prop) {
|
|
|
11266
11325
|
}
|
|
11267
11326
|
|
|
11268
11327
|
const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
|
11269
|
-
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', '
|
|
11328
|
+
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
|
11270
11329
|
const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
|
|
11271
11330
|
// List of SVG elements that are disallowed by default.
|
|
11272
11331
|
// We still need to know them so that we can do namespace
|
|
@@ -11280,7 +11339,7 @@ const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongd
|
|
|
11280
11339
|
const text = freeze(['#text']);
|
|
11281
11340
|
|
|
11282
11341
|
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
|
|
11283
|
-
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
11342
|
+
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
11284
11343
|
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
|
11285
11344
|
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
11286
11345
|
|
|
@@ -11378,7 +11437,7 @@ const _createHooksMap = function _createHooksMap() {
|
|
|
11378
11437
|
function createDOMPurify() {
|
|
11379
11438
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
11380
11439
|
const DOMPurify = root => createDOMPurify(root);
|
|
11381
|
-
DOMPurify.version = '3.
|
|
11440
|
+
DOMPurify.version = '3.3.0';
|
|
11382
11441
|
DOMPurify.removed = [];
|
|
11383
11442
|
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
11384
11443
|
// Not running in a browser, provide a factory function
|
|
@@ -11489,6 +11548,21 @@ function createDOMPurify() {
|
|
|
11489
11548
|
let FORBID_TAGS = null;
|
|
11490
11549
|
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
|
11491
11550
|
let FORBID_ATTR = null;
|
|
11551
|
+
/* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */
|
|
11552
|
+
const EXTRA_ELEMENT_HANDLING = Object.seal(create$1(null, {
|
|
11553
|
+
tagCheck: {
|
|
11554
|
+
writable: true,
|
|
11555
|
+
configurable: false,
|
|
11556
|
+
enumerable: true,
|
|
11557
|
+
value: null
|
|
11558
|
+
},
|
|
11559
|
+
attributeCheck: {
|
|
11560
|
+
writable: true,
|
|
11561
|
+
configurable: false,
|
|
11562
|
+
enumerable: true,
|
|
11563
|
+
value: null
|
|
11564
|
+
}
|
|
11565
|
+
}));
|
|
11492
11566
|
/* Decide if ARIA attributes are okay */
|
|
11493
11567
|
let ALLOW_ARIA_ATTR = true;
|
|
11494
11568
|
/* Decide if custom data attributes are okay */
|
|
@@ -11681,16 +11755,24 @@ function createDOMPurify() {
|
|
|
11681
11755
|
}
|
|
11682
11756
|
/* Merge configuration parameters */
|
|
11683
11757
|
if (cfg.ADD_TAGS) {
|
|
11684
|
-
if (
|
|
11685
|
-
|
|
11758
|
+
if (typeof cfg.ADD_TAGS === 'function') {
|
|
11759
|
+
EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
|
|
11760
|
+
} else {
|
|
11761
|
+
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
11762
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
11763
|
+
}
|
|
11764
|
+
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
11686
11765
|
}
|
|
11687
|
-
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
11688
11766
|
}
|
|
11689
11767
|
if (cfg.ADD_ATTR) {
|
|
11690
|
-
if (
|
|
11691
|
-
|
|
11768
|
+
if (typeof cfg.ADD_ATTR === 'function') {
|
|
11769
|
+
EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
|
|
11770
|
+
} else {
|
|
11771
|
+
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
|
11772
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
11773
|
+
}
|
|
11774
|
+
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
11692
11775
|
}
|
|
11693
|
-
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
11694
11776
|
}
|
|
11695
11777
|
if (cfg.ADD_URI_SAFE_ATTR) {
|
|
11696
11778
|
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
|
|
@@ -11998,7 +12080,7 @@ function createDOMPurify() {
|
|
|
11998
12080
|
return true;
|
|
11999
12081
|
}
|
|
12000
12082
|
/* Remove element if anything forbids its presence */
|
|
12001
|
-
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
12083
|
+
if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) {
|
|
12002
12084
|
/* Check if we have a custom element to handle */
|
|
12003
12085
|
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
|
12004
12086
|
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
|
@@ -12070,7 +12152,7 @@ function createDOMPurify() {
|
|
|
12070
12152
|
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
12071
12153
|
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
12072
12154
|
We don't need to check the value; it's always URI safe. */
|
|
12073
|
-
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
|
12155
|
+
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
|
12074
12156
|
if (
|
|
12075
12157
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
12076
12158
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
@@ -13625,7 +13707,7 @@ var TooltipComponent = function TooltipComponent(_ref) {
|
|
|
13625
13707
|
}, ".tooltip.jsx-418573366{width:-webkit-max-content;width:-moz-max-content;width:max-content;display:inline-block;}"));
|
|
13626
13708
|
};
|
|
13627
13709
|
TooltipComponent.displayName = 'Tooltip';
|
|
13628
|
-
var Tooltip
|
|
13710
|
+
var Tooltip = withScale(TooltipComponent);
|
|
13629
13711
|
|
|
13630
13712
|
/* "use client" */
|
|
13631
13713
|
|
|
@@ -13693,7 +13775,7 @@ var PopoverComponent = function PopoverComponent(_ref) {
|
|
|
13693
13775
|
}, [customVisible]);
|
|
13694
13776
|
return /*#__PURE__*/React.createElement(PopoverContext.Provider, {
|
|
13695
13777
|
value: value
|
|
13696
|
-
}, /*#__PURE__*/React.createElement(Tooltip
|
|
13778
|
+
}, /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
13697
13779
|
type: type,
|
|
13698
13780
|
enterDelay: enterDelay,
|
|
13699
13781
|
leaveDelay: leaveDelay,
|
|
@@ -16706,172 +16788,6 @@ var SpinnerComponent = function SpinnerComponent(_ref) {
|
|
|
16706
16788
|
SpinnerComponent.displayName = 'Spinner';
|
|
16707
16789
|
var Spinner = withScale(SpinnerComponent);
|
|
16708
16790
|
|
|
16709
|
-
// import Button from '../button'
|
|
16710
|
-
|
|
16711
|
-
var makeColgroup = function makeColgroup(width, columns) {
|
|
16712
|
-
var unsetWidthCount = columns.filter(function (c) {
|
|
16713
|
-
return !c.width;
|
|
16714
|
-
}).length;
|
|
16715
|
-
var customWidthTotal = columns.reduce(function (pre, current) {
|
|
16716
|
-
return current.width ? pre + current.width : pre;
|
|
16717
|
-
}, 0);
|
|
16718
|
-
var averageWidth = (width - customWidthTotal) / unsetWidthCount;
|
|
16719
|
-
if (averageWidth <= 0) return /*#__PURE__*/React.createElement("colgroup", null);
|
|
16720
|
-
return /*#__PURE__*/React.createElement("colgroup", null, columns.map(function (column, index) {
|
|
16721
|
-
return /*#__PURE__*/React.createElement("col", {
|
|
16722
|
-
key: "colgroup-".concat(index),
|
|
16723
|
-
width: column.width || averageWidth
|
|
16724
|
-
});
|
|
16725
|
-
}));
|
|
16726
|
-
};
|
|
16727
|
-
var TableHead = function TableHead(props) {
|
|
16728
|
-
var theme$1 = theme.useTheme();
|
|
16729
|
-
var _ref = props,
|
|
16730
|
-
columns = _ref.columns,
|
|
16731
|
-
width = _ref.width,
|
|
16732
|
-
onFilters = _ref.onFilters,
|
|
16733
|
-
showFilters = _ref.showFilters,
|
|
16734
|
-
stickyHeader = _ref.stickyHeader;
|
|
16735
|
-
var isScalableWidth = React.useMemo(function () {
|
|
16736
|
-
return columns.find(function (item) {
|
|
16737
|
-
return !!item.width;
|
|
16738
|
-
});
|
|
16739
|
-
}, [columns]);
|
|
16740
|
-
var colgroup = React.useMemo(function () {
|
|
16741
|
-
if (!isScalableWidth) return /*#__PURE__*/React.createElement("colgroup", null);
|
|
16742
|
-
return makeColgroup(width, columns);
|
|
16743
|
-
}, [isScalableWidth, width]);
|
|
16744
|
-
var _React$useState = React.useState(columns.reduce(function (acc, col) {
|
|
16745
|
-
if (col.filter) {
|
|
16746
|
-
acc["".concat(col.filter)] = col.filter === 'date' ? null : '';
|
|
16747
|
-
}
|
|
16748
|
-
return acc;
|
|
16749
|
-
}, {})),
|
|
16750
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
16751
|
-
filters = _React$useState2[0],
|
|
16752
|
-
setFilters = _React$useState2[1];
|
|
16753
|
-
|
|
16754
|
-
// const applyFilters = () => {
|
|
16755
|
-
// if (onFilters) {
|
|
16756
|
-
// onFilters(filters);
|
|
16757
|
-
// }
|
|
16758
|
-
// }
|
|
16759
|
-
|
|
16760
|
-
var handleFilterChange = function handleFilterChange(name, value) {
|
|
16761
|
-
setFilters(function (prevFilters) {
|
|
16762
|
-
var updatedFilters = _objectSpread2(_objectSpread2({}, prevFilters), {}, _defineProperty$1({}, name, value));
|
|
16763
|
-
if (onFilters) {
|
|
16764
|
-
onFilters(filters);
|
|
16765
|
-
}
|
|
16766
|
-
return updatedFilters;
|
|
16767
|
-
});
|
|
16768
|
-
};
|
|
16769
|
-
var generateFilterInputs = function generateFilterInputs() {
|
|
16770
|
-
return columns.map(function (col) {
|
|
16771
|
-
var _String, _filters$filterName;
|
|
16772
|
-
var Header = col.label,
|
|
16773
|
-
accessor = col.filter,
|
|
16774
|
-
options = col.options;
|
|
16775
|
-
var filterName = (_String = String(col === null || col === void 0 ? void 0 : col.label)) === null || _String === void 0 ? void 0 : _String.replace(' ', '_').toLowerCase();
|
|
16776
|
-
// const unq_accessor = _.uniqueId(filterName);
|
|
16777
|
-
// if (Header === 'actions') {
|
|
16778
|
-
// return (
|
|
16779
|
-
// <th style={{ margin: '3px' }} data-column={Header} key={unq_accessor}>
|
|
16780
|
-
// <Button onClick={applyFilters} auto px={0.6} scale={2 / 3}>Apply</Button>
|
|
16781
|
-
// </th>
|
|
16782
|
-
// )
|
|
16783
|
-
// }
|
|
16784
|
-
return /*#__PURE__*/React.createElement("th", {
|
|
16785
|
-
style: {
|
|
16786
|
-
padding: '3px',
|
|
16787
|
-
textAlign: 'left'
|
|
16788
|
-
},
|
|
16789
|
-
"data-column": Header
|
|
16790
|
-
}, accessor === 'fixed' && /*#__PURE__*/React.createElement(Select
|
|
16791
|
-
// key={unq_accessor}
|
|
16792
|
-
// name={filterName}
|
|
16793
|
-
, {
|
|
16794
|
-
value: (_filters$filterName = filters[filterName]) !== null && _filters$filterName !== void 0 ? _filters$filterName : 'All',
|
|
16795
|
-
onChange: function onChange(newValue) {
|
|
16796
|
-
return handleFilterChange(filterName, newValue);
|
|
16797
|
-
}
|
|
16798
|
-
}, /*#__PURE__*/React.createElement(Select.Option, {
|
|
16799
|
-
value: "All"
|
|
16800
|
-
}, "All ", Header), options ? options.map(function (option) {
|
|
16801
|
-
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
16802
|
-
value: option.value
|
|
16803
|
-
}, option.name);
|
|
16804
|
-
}) : null), accessor === 'date' && /*#__PURE__*/React.createElement(Input
|
|
16805
|
-
// id={`filter-date-${filterName}`}
|
|
16806
|
-
, {
|
|
16807
|
-
type: "date"
|
|
16808
|
-
// name={filterName}
|
|
16809
|
-
,
|
|
16810
|
-
value: filters[filterName],
|
|
16811
|
-
onChange: function onChange(e) {
|
|
16812
|
-
return handleFilterChange(filterName, e.target.value);
|
|
16813
|
-
}
|
|
16814
|
-
}), accessor === 'search' && /*#__PURE__*/React.createElement(Input
|
|
16815
|
-
// id={`filter-search-${filterName}`}
|
|
16816
|
-
, {
|
|
16817
|
-
type: "text",
|
|
16818
|
-
autoComplete: "off"
|
|
16819
|
-
// ref={filterRefs.current[filterName]} // Dynamically set ref}
|
|
16820
|
-
// name={filterName}
|
|
16821
|
-
,
|
|
16822
|
-
style: {
|
|
16823
|
-
height: 30,
|
|
16824
|
-
minWidth: 160
|
|
16825
|
-
},
|
|
16826
|
-
value: filters[filterName],
|
|
16827
|
-
onChange: function onChange(e) {
|
|
16828
|
-
return handleFilterChange(filterName, e.target.value);
|
|
16829
|
-
},
|
|
16830
|
-
placeholder: "Search...",
|
|
16831
|
-
fullWidth: true
|
|
16832
|
-
}));
|
|
16833
|
-
});
|
|
16834
|
-
};
|
|
16835
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
|
|
16836
|
-
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]]])
|
|
16837
|
-
}, /*#__PURE__*/React.createElement("tr", {
|
|
16838
|
-
style: {
|
|
16839
|
-
backgroundColor: theme$1.palette.background
|
|
16840
|
-
},
|
|
16841
|
-
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]]])
|
|
16842
|
-
}, columns.map(function (column, _index) {
|
|
16843
|
-
var _String2;
|
|
16844
|
-
var dataName = (_String2 = String(column === null || column === void 0 ? void 0 : column.label)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
|
|
16845
|
-
return /*#__PURE__*/React.createElement("th", {
|
|
16846
|
-
style: _objectSpread2({
|
|
16847
|
-
// textAlign: `${column?.align} !important`,
|
|
16848
|
-
// paddingLeft: '0.3rem',
|
|
16849
|
-
// paddingRight: '0.3rem',
|
|
16850
|
-
backgroundColor: theme$1.type == 'dark' ? theme$1.palette.accents_1 : theme$1.palette.background,
|
|
16851
|
-
color: "".concat(column !== null && column !== void 0 && column.color ? column === null || column === void 0 ? void 0 : column.color : '#333'),
|
|
16852
|
-
whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
|
|
16853
|
-
}, column === null || column === void 0 ? void 0 : column.style),
|
|
16854
|
-
"data-column": dataName,
|
|
16855
|
-
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 || "")
|
|
16856
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
16857
|
-
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"
|
|
16858
|
-
}, column.label, /*#__PURE__*/React.createElement("br", {
|
|
16859
|
-
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]]])
|
|
16860
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
16861
|
-
style: {
|
|
16862
|
-
textAlign: 'center'
|
|
16863
|
-
},
|
|
16864
|
-
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]]])
|
|
16865
|
-
}, column.text)));
|
|
16866
|
-
})), showFilters && /*#__PURE__*/React.createElement("tr", {
|
|
16867
|
-
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]]])
|
|
16868
|
-
}, generateFilterInputs())), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
16869
|
-
id: "4089411751",
|
|
16870
|
-
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]
|
|
16871
|
-
}, "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;}")));
|
|
16872
|
-
};
|
|
16873
|
-
TableHead.displayName = 'TableHead';
|
|
16874
|
-
|
|
16875
16791
|
var lodash$1 = {exports: {}};
|
|
16876
16792
|
|
|
16877
16793
|
/**
|
|
@@ -34084,6 +34000,173 @@ function requireLodash () {
|
|
|
34084
34000
|
var lodashExports = requireLodash();
|
|
34085
34001
|
var _ = /*@__PURE__*/getDefaultExportFromCjs(lodashExports);
|
|
34086
34002
|
|
|
34003
|
+
// import Button from '../button'
|
|
34004
|
+
|
|
34005
|
+
var makeColgroup = function makeColgroup(width, columns) {
|
|
34006
|
+
var colId = lodashExports.uniqueId('col');
|
|
34007
|
+
var unsetWidthCount = columns.filter(function (c) {
|
|
34008
|
+
return !c.width;
|
|
34009
|
+
}).length;
|
|
34010
|
+
var customWidthTotal = columns.reduce(function (pre, current) {
|
|
34011
|
+
return current.width ? pre + current.width : pre;
|
|
34012
|
+
}, 0);
|
|
34013
|
+
var averageWidth = (width - customWidthTotal) / unsetWidthCount;
|
|
34014
|
+
if (averageWidth <= 0) return /*#__PURE__*/React.createElement("colgroup", null);
|
|
34015
|
+
return /*#__PURE__*/React.createElement("colgroup", null, columns.map(function (column) {
|
|
34016
|
+
return /*#__PURE__*/React.createElement("col", {
|
|
34017
|
+
key: "colgroup-".concat(colId),
|
|
34018
|
+
width: column.width || averageWidth
|
|
34019
|
+
});
|
|
34020
|
+
}));
|
|
34021
|
+
};
|
|
34022
|
+
var TableHead = function TableHead(props) {
|
|
34023
|
+
var theme$1 = theme.useTheme();
|
|
34024
|
+
var _ref = props,
|
|
34025
|
+
columns = _ref.columns,
|
|
34026
|
+
width = _ref.width,
|
|
34027
|
+
onFilters = _ref.onFilters,
|
|
34028
|
+
showFilters = _ref.showFilters,
|
|
34029
|
+
stickyHeader = _ref.stickyHeader;
|
|
34030
|
+
var isScalableWidth = React.useMemo(function () {
|
|
34031
|
+
return columns.find(function (item) {
|
|
34032
|
+
return !!item.width;
|
|
34033
|
+
});
|
|
34034
|
+
}, [columns]);
|
|
34035
|
+
var colgroup = React.useMemo(function () {
|
|
34036
|
+
if (!isScalableWidth) return /*#__PURE__*/React.createElement("colgroup", null);
|
|
34037
|
+
return makeColgroup(width, columns);
|
|
34038
|
+
}, [isScalableWidth, width]);
|
|
34039
|
+
var _React$useState = React.useState(columns.reduce(function (acc, col) {
|
|
34040
|
+
if (col.filter) {
|
|
34041
|
+
acc["".concat(col.filter)] = col.filter === 'date' ? null : '';
|
|
34042
|
+
}
|
|
34043
|
+
return acc;
|
|
34044
|
+
}, {})),
|
|
34045
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
34046
|
+
filters = _React$useState2[0],
|
|
34047
|
+
setFilters = _React$useState2[1];
|
|
34048
|
+
|
|
34049
|
+
// const applyFilters = () => {
|
|
34050
|
+
// if (onFilters) {
|
|
34051
|
+
// onFilters(filters);
|
|
34052
|
+
// }
|
|
34053
|
+
// }
|
|
34054
|
+
|
|
34055
|
+
var handleFilterChange = function handleFilterChange(name, value) {
|
|
34056
|
+
setFilters(function (prevFilters) {
|
|
34057
|
+
var updatedFilters = _objectSpread2(_objectSpread2({}, prevFilters), {}, _defineProperty$1({}, name, value));
|
|
34058
|
+
if (onFilters) {
|
|
34059
|
+
onFilters(filters);
|
|
34060
|
+
}
|
|
34061
|
+
return updatedFilters;
|
|
34062
|
+
});
|
|
34063
|
+
};
|
|
34064
|
+
var generateFilterInputs = function generateFilterInputs() {
|
|
34065
|
+
return columns.map(function (col) {
|
|
34066
|
+
var _String, _filters$filterName;
|
|
34067
|
+
var Header = col.label,
|
|
34068
|
+
accessor = col.filter,
|
|
34069
|
+
options = col.options;
|
|
34070
|
+
var filterName = (_String = String(col === null || col === void 0 ? void 0 : col.label)) === null || _String === void 0 ? void 0 : _String.replace(' ', '_').toLowerCase();
|
|
34071
|
+
// const unq_accessor = _.uniqueId(filterName);
|
|
34072
|
+
// if (Header === 'actions') {
|
|
34073
|
+
// return (
|
|
34074
|
+
// <th style={{ margin: '3px' }} data-column={Header} key={unq_accessor}>
|
|
34075
|
+
// <Button onClick={applyFilters} auto px={0.6} scale={2 / 3}>Apply</Button>
|
|
34076
|
+
// </th>
|
|
34077
|
+
// )
|
|
34078
|
+
// }
|
|
34079
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
34080
|
+
style: {
|
|
34081
|
+
padding: '3px',
|
|
34082
|
+
textAlign: 'left'
|
|
34083
|
+
},
|
|
34084
|
+
"data-column": Header
|
|
34085
|
+
}, accessor === 'fixed' && /*#__PURE__*/React.createElement(Select
|
|
34086
|
+
// key={unq_accessor}
|
|
34087
|
+
// name={filterName}
|
|
34088
|
+
, {
|
|
34089
|
+
value: (_filters$filterName = filters[filterName]) !== null && _filters$filterName !== void 0 ? _filters$filterName : 'All',
|
|
34090
|
+
onChange: function onChange(newValue) {
|
|
34091
|
+
return handleFilterChange(filterName, newValue);
|
|
34092
|
+
}
|
|
34093
|
+
}, /*#__PURE__*/React.createElement(Select.Option, {
|
|
34094
|
+
value: "All"
|
|
34095
|
+
}, "All ", Header), options ? options.map(function (option) {
|
|
34096
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
34097
|
+
value: option.value
|
|
34098
|
+
}, option.name);
|
|
34099
|
+
}) : null), accessor === 'date' && /*#__PURE__*/React.createElement(Input
|
|
34100
|
+
// id={`filter-date-${filterName}`}
|
|
34101
|
+
, {
|
|
34102
|
+
type: "date"
|
|
34103
|
+
// name={filterName}
|
|
34104
|
+
,
|
|
34105
|
+
value: filters[filterName],
|
|
34106
|
+
onChange: function onChange(e) {
|
|
34107
|
+
return handleFilterChange(filterName, e.target.value);
|
|
34108
|
+
}
|
|
34109
|
+
}), accessor === 'search' && /*#__PURE__*/React.createElement(Input
|
|
34110
|
+
// id={`filter-search-${filterName}`}
|
|
34111
|
+
, {
|
|
34112
|
+
type: "text",
|
|
34113
|
+
autoComplete: "off"
|
|
34114
|
+
// ref={filterRefs.current[filterName]} // Dynamically set ref}
|
|
34115
|
+
// name={filterName}
|
|
34116
|
+
,
|
|
34117
|
+
style: {
|
|
34118
|
+
height: 30,
|
|
34119
|
+
minWidth: 160
|
|
34120
|
+
},
|
|
34121
|
+
value: filters[filterName],
|
|
34122
|
+
onChange: function onChange(e) {
|
|
34123
|
+
return handleFilterChange(filterName, e.target.value);
|
|
34124
|
+
},
|
|
34125
|
+
placeholder: "Search...",
|
|
34126
|
+
fullWidth: true
|
|
34127
|
+
}));
|
|
34128
|
+
});
|
|
34129
|
+
};
|
|
34130
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, colgroup, /*#__PURE__*/React.createElement("thead", {
|
|
34131
|
+
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]]])
|
|
34132
|
+
}, /*#__PURE__*/React.createElement("tr", {
|
|
34133
|
+
style: {
|
|
34134
|
+
backgroundColor: theme$1.palette.background
|
|
34135
|
+
},
|
|
34136
|
+
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]]])
|
|
34137
|
+
}, columns.map(function (column, _index) {
|
|
34138
|
+
var _String2;
|
|
34139
|
+
var dataName = (_String2 = String(column === null || column === void 0 ? void 0 : column.label)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
|
|
34140
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
34141
|
+
style: _objectSpread2({
|
|
34142
|
+
// textAlign: `${column?.align} !important`,
|
|
34143
|
+
// paddingLeft: '0.3rem',
|
|
34144
|
+
// paddingRight: '0.3rem',
|
|
34145
|
+
backgroundColor: theme$1.type == 'dark' ? theme$1.palette.accents_1 : theme$1.palette.background,
|
|
34146
|
+
color: "".concat(column !== null && column !== void 0 && column.color ? column === null || column === void 0 ? void 0 : column.color : '#333'),
|
|
34147
|
+
whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
|
|
34148
|
+
}, column === null || column === void 0 ? void 0 : column.style),
|
|
34149
|
+
"data-column": dataName,
|
|
34150
|
+
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 || "")
|
|
34151
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
34152
|
+
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"
|
|
34153
|
+
}, column.label, /*#__PURE__*/React.createElement("br", {
|
|
34154
|
+
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]]])
|
|
34155
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
34156
|
+
style: {
|
|
34157
|
+
textAlign: 'center'
|
|
34158
|
+
},
|
|
34159
|
+
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]]])
|
|
34160
|
+
}, column.text)));
|
|
34161
|
+
})), showFilters && /*#__PURE__*/React.createElement("tr", {
|
|
34162
|
+
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]]])
|
|
34163
|
+
}, generateFilterInputs())), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
34164
|
+
id: "4089411751",
|
|
34165
|
+
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]
|
|
34166
|
+
}, "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;}")));
|
|
34167
|
+
};
|
|
34168
|
+
TableHead.displayName = 'TableHead';
|
|
34169
|
+
|
|
34087
34170
|
function Empty() {
|
|
34088
34171
|
return /*#__PURE__*/React.createElement("svg", {
|
|
34089
34172
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -34660,7 +34743,7 @@ var TableCell = function TableCell(_ref) {
|
|
|
34660
34743
|
whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
|
|
34661
34744
|
}, currentRowValue === null || currentRowValue === void 0 ? void 0 : currentRowValue.style),
|
|
34662
34745
|
"data-column": column.prop,
|
|
34663
|
-
key: "row-td-".concat(
|
|
34746
|
+
key: "row-td-".concat(currentRowValue.id, "-").concat(column.prop.toString()),
|
|
34664
34747
|
onClick: function onClick() {
|
|
34665
34748
|
return onCellClick && onCellClick(currentRowValue, rowIndex, index);
|
|
34666
34749
|
},
|
|
@@ -34748,7 +34831,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
34748
34831
|
|
|
34749
34832
|
function renderRow(cols, row, index) {
|
|
34750
34833
|
var _row$style;
|
|
34751
|
-
|
|
34834
|
+
// const urid = _.uniqueId();
|
|
34752
34835
|
var className = rowClassName(row, index);
|
|
34753
34836
|
var rw = _objectSpread2({}, row);
|
|
34754
34837
|
var rowStyle = (_row$style = row === null || row === void 0 ? void 0 : row.style) !== null && _row$style !== void 0 ? _row$style : {};
|
|
@@ -34769,7 +34852,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
34769
34852
|
onDragStart: onDragStart,
|
|
34770
34853
|
"aria-checked": selected.indexOf(row) !== -1,
|
|
34771
34854
|
tabIndex: -1,
|
|
34772
|
-
key:
|
|
34855
|
+
key: "table-row-".concat(rw.id),
|
|
34773
34856
|
style: _objectSpread2({
|
|
34774
34857
|
cursor: 'pointer',
|
|
34775
34858
|
backgroundColor: isRowSelected ? hoverColor : ''
|
|
@@ -35068,7 +35151,7 @@ function TableComponent(tableProps) {
|
|
|
35068
35151
|
margin: '10px'
|
|
35069
35152
|
},
|
|
35070
35153
|
className: _JSXStyle.dynamic([["2040515329", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
35071
|
-
}, /*#__PURE__*/React.createElement(Tooltip
|
|
35154
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
35072
35155
|
text: "Previous"
|
|
35073
35156
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
35074
35157
|
disabled: !previousCursor,
|
|
@@ -35079,7 +35162,7 @@ function TableComponent(tableProps) {
|
|
|
35079
35162
|
px: 0.6,
|
|
35080
35163
|
scale: 2 / 3,
|
|
35081
35164
|
iconRight: /*#__PURE__*/React.createElement(icons.ChevronLeft, null)
|
|
35082
|
-
})), /*#__PURE__*/React.createElement(Tooltip
|
|
35165
|
+
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
35083
35166
|
text: "Next"
|
|
35084
35167
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
35085
35168
|
disabled: !nextCursor,
|
|
@@ -35782,7 +35865,7 @@ var ToggleComponent = function ToggleComponent(_ref) {
|
|
|
35782
35865
|
ToggleComponent.displayName = 'Toggle';
|
|
35783
35866
|
var Toggle = withScale(ToggleComponent);
|
|
35784
35867
|
|
|
35785
|
-
var
|
|
35868
|
+
var Notetip = function Notetip(_ref) {
|
|
35786
35869
|
var children = _ref.children,
|
|
35787
35870
|
text = _ref.text,
|
|
35788
35871
|
_ref$placement = _ref.placement,
|
|
@@ -35853,8 +35936,8 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
35853
35936
|
onMouseEnter: handleMouseEnter,
|
|
35854
35937
|
onMouseLeave: handleMouseLeave,
|
|
35855
35938
|
onTouchStart: handleTouchStart,
|
|
35856
|
-
className: _JSXStyle.dynamic([["
|
|
35857
|
-
}, children), show && x != null && y != null ? /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React.createElement("div", {
|
|
35939
|
+
className: _JSXStyle.dynamic([["4210526695", [theme$1.palette.accents_1, duration, duration, duration]]]) + " " + "tooltip-reference"
|
|
35940
|
+
}, children), show && x != null && y != null && text != null ? /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React.createElement("div", {
|
|
35858
35941
|
ref: refs.setFloating,
|
|
35859
35942
|
style: {
|
|
35860
35943
|
position: strategy,
|
|
@@ -35866,11 +35949,11 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
35866
35949
|
transitionProperty: 'opacity, transform',
|
|
35867
35950
|
transitionDuration: "".concat(duration, "ms")
|
|
35868
35951
|
},
|
|
35869
|
-
className: _JSXStyle.dynamic([["
|
|
35952
|
+
className: _JSXStyle.dynamic([["4210526695", [theme$1.palette.accents_1, duration, duration, duration]]]) + " " + "tooltip-box ".concat(animation)
|
|
35870
35953
|
}, text), document.body) : null, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
35871
|
-
id: "
|
|
35872
|
-
dynamic: [theme$1.palette.
|
|
35873
|
-
}, ".tooltip-box.__jsx-style-dynamic-selector{background:".concat(theme$1.palette.
|
|
35954
|
+
id: "4210526695",
|
|
35955
|
+
dynamic: [theme$1.palette.accents_1, duration, duration, duration]
|
|
35956
|
+
}, ".tooltip-box.__jsx-style-dynamic-selector{background:".concat(theme$1.palette.accents_1, ";padding:4px 10px;border-radius:4px;font-size:12px;white-space:nowrap;z-index:9999;opacity:0;}.fade.__jsx-style-dynamic-selector{-webkit-animation:fadeIn-__jsx-style-dynamic-selector ").concat(duration, "ms ease forwards;animation:fadeIn-__jsx-style-dynamic-selector ").concat(duration, "ms ease forwards;}@-webkit-keyframes fadeIn-__jsx-style-dynamic-selector{from{opacity:0;}to{opacity:1;}}@keyframes fadeIn-__jsx-style-dynamic-selector{from{opacity:0;}to{opacity:1;}}.scale.__jsx-style-dynamic-selector{-webkit-animation:scaleIn-__jsx-style-dynamic-selector ").concat(duration, "ms ease forwards;animation:scaleIn-__jsx-style-dynamic-selector ").concat(duration, "ms ease forwards;}@-webkit-keyframes scaleIn-__jsx-style-dynamic-selector{from{opacity:0;-webkit-transform:scale(0.95);-ms-transform:scale(0.95);transform:scale(0.95);}to{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);}}@keyframes scaleIn-__jsx-style-dynamic-selector{from{opacity:0;-webkit-transform:scale(0.95);-ms-transform:scale(0.95);transform:scale(0.95);}to{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);}}.slide.__jsx-style-dynamic-selector{-webkit-animation:slideIn-__jsx-style-dynamic-selector ").concat(duration, "ms ease forwards;animation:slideIn-__jsx-style-dynamic-selector ").concat(duration, "ms ease forwards;}@-webkit-keyframes slideIn-__jsx-style-dynamic-selector{from{opacity:0;-webkit-transform:translateY(5px);-ms-transform:translateY(5px);transform:translateY(5px);}to{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}}@keyframes slideIn-__jsx-style-dynamic-selector{from{opacity:0;-webkit-transform:translateY(5px);-ms-transform:translateY(5px);transform:translateY(5px);}to{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}}")));
|
|
35874
35957
|
};
|
|
35875
35958
|
|
|
35876
35959
|
var TreeFileIcon = function TreeFileIcon(_ref) {
|
|
@@ -41632,6 +41715,241 @@ var useToasts = function useToasts(layout) {
|
|
|
41632
41715
|
};
|
|
41633
41716
|
};
|
|
41634
41717
|
|
|
41718
|
+
function deselectCurrent () {
|
|
41719
|
+
var selection = document.getSelection();
|
|
41720
|
+
if (!selection.rangeCount) {
|
|
41721
|
+
return function () {};
|
|
41722
|
+
}
|
|
41723
|
+
var active = document.activeElement;
|
|
41724
|
+
var ranges = [];
|
|
41725
|
+
for (var i = 0; i < selection.rangeCount; i++) {
|
|
41726
|
+
ranges.push(selection.getRangeAt(i));
|
|
41727
|
+
}
|
|
41728
|
+
switch (active.tagName.toUpperCase() // .toUpperCase handles XHTML
|
|
41729
|
+
) {
|
|
41730
|
+
case 'INPUT':
|
|
41731
|
+
case 'TEXTAREA':
|
|
41732
|
+
active.blur();
|
|
41733
|
+
break;
|
|
41734
|
+
default:
|
|
41735
|
+
active = null;
|
|
41736
|
+
break;
|
|
41737
|
+
}
|
|
41738
|
+
selection.removeAllRanges();
|
|
41739
|
+
return function () {
|
|
41740
|
+
selection.type === 'Caret' && selection.removeAllRanges();
|
|
41741
|
+
if (!selection.rangeCount) {
|
|
41742
|
+
ranges.forEach(function (range) {
|
|
41743
|
+
selection.addRange(range);
|
|
41744
|
+
});
|
|
41745
|
+
}
|
|
41746
|
+
active && active.focus();
|
|
41747
|
+
};
|
|
41748
|
+
}
|
|
41749
|
+
|
|
41750
|
+
var clipboardToIE11Formatting = {
|
|
41751
|
+
'text/plain': 'Text',
|
|
41752
|
+
'text/html': 'Url',
|
|
41753
|
+
"default": 'Text'
|
|
41754
|
+
};
|
|
41755
|
+
var defaultMessage = 'Copy to clipboard: #{key}, Enter';
|
|
41756
|
+
function format(message) {
|
|
41757
|
+
var copyKey = (/mac os x/i.test(navigator.userAgent) ? '⌘' : 'Ctrl') + '+C';
|
|
41758
|
+
return message.replace(/#{\s*key\s*}/g, copyKey);
|
|
41759
|
+
}
|
|
41760
|
+
function copy(text, options) {
|
|
41761
|
+
var debug,
|
|
41762
|
+
message,
|
|
41763
|
+
reselectPrevious,
|
|
41764
|
+
range,
|
|
41765
|
+
selection,
|
|
41766
|
+
mark,
|
|
41767
|
+
success = false;
|
|
41768
|
+
if (!options) {
|
|
41769
|
+
options = {};
|
|
41770
|
+
}
|
|
41771
|
+
debug = options.debug || false;
|
|
41772
|
+
try {
|
|
41773
|
+
reselectPrevious = deselectCurrent();
|
|
41774
|
+
range = document.createRange();
|
|
41775
|
+
selection = document.getSelection();
|
|
41776
|
+
mark = document.createElement('span');
|
|
41777
|
+
mark.textContent = text;
|
|
41778
|
+
// avoid screen readers from reading out loud the text
|
|
41779
|
+
mark.ariaHidden = 'true';
|
|
41780
|
+
// reset user styles for span element
|
|
41781
|
+
mark.style.all = 'unset';
|
|
41782
|
+
// prevents scrolling to the end of the page
|
|
41783
|
+
mark.style.position = 'fixed';
|
|
41784
|
+
mark.style.top = 0;
|
|
41785
|
+
mark.style.clip = 'rect(0, 0, 0, 0)';
|
|
41786
|
+
// used to preserve spaces and line breaks
|
|
41787
|
+
mark.style.whiteSpace = 'pre';
|
|
41788
|
+
// do not inherit user-select (it may be `none`)
|
|
41789
|
+
mark.style.webkitUserSelect = 'text';
|
|
41790
|
+
mark.style.MozUserSelect = 'text';
|
|
41791
|
+
mark.style.msUserSelect = 'text';
|
|
41792
|
+
mark.style.userSelect = 'text';
|
|
41793
|
+
mark.addEventListener('copy', function (e) {
|
|
41794
|
+
e.stopPropagation();
|
|
41795
|
+
if (options.format) {
|
|
41796
|
+
e.preventDefault();
|
|
41797
|
+
if (typeof e.clipboardData === 'undefined') {
|
|
41798
|
+
// IE 11
|
|
41799
|
+
debug && console.warn('unable to use e.clipboardData');
|
|
41800
|
+
debug && console.warn('trying IE specific stuff');
|
|
41801
|
+
window.clipboardData.clearData();
|
|
41802
|
+
var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting['default'];
|
|
41803
|
+
window.clipboardData.setData(format, text);
|
|
41804
|
+
} else {
|
|
41805
|
+
// all other browsers
|
|
41806
|
+
e.clipboardData.clearData();
|
|
41807
|
+
e.clipboardData.setData(options.format, text);
|
|
41808
|
+
}
|
|
41809
|
+
}
|
|
41810
|
+
if (options.onCopy) {
|
|
41811
|
+
e.preventDefault();
|
|
41812
|
+
options.onCopy(e.clipboardData);
|
|
41813
|
+
}
|
|
41814
|
+
});
|
|
41815
|
+
document.body.appendChild(mark);
|
|
41816
|
+
range.selectNodeContents(mark);
|
|
41817
|
+
selection.addRange(range);
|
|
41818
|
+
var successful = document.execCommand('copy');
|
|
41819
|
+
if (!successful) {
|
|
41820
|
+
throw new Error('copy command was unsuccessful');
|
|
41821
|
+
}
|
|
41822
|
+
success = true;
|
|
41823
|
+
} catch (err) {
|
|
41824
|
+
debug && console.error('unable to copy using execCommand: ', err);
|
|
41825
|
+
debug && console.warn('trying IE specific stuff');
|
|
41826
|
+
try {
|
|
41827
|
+
window.clipboardData.setData(options.format || 'text', text);
|
|
41828
|
+
options.onCopy && options.onCopy(window.clipboardData);
|
|
41829
|
+
success = true;
|
|
41830
|
+
} catch (err) {
|
|
41831
|
+
debug && console.error('unable to copy using clipboardData: ', err);
|
|
41832
|
+
debug && console.error('falling back to prompt');
|
|
41833
|
+
message = format('message' in options ? options.message : defaultMessage);
|
|
41834
|
+
window.prompt(message, text);
|
|
41835
|
+
}
|
|
41836
|
+
} finally {
|
|
41837
|
+
if (selection) {
|
|
41838
|
+
if (typeof selection.removeRange == 'function') {
|
|
41839
|
+
selection.removeRange(range);
|
|
41840
|
+
} else {
|
|
41841
|
+
selection.removeAllRanges();
|
|
41842
|
+
}
|
|
41843
|
+
}
|
|
41844
|
+
if (mark) {
|
|
41845
|
+
document.body.removeChild(mark);
|
|
41846
|
+
}
|
|
41847
|
+
reselectPrevious();
|
|
41848
|
+
}
|
|
41849
|
+
return success;
|
|
41850
|
+
}
|
|
41851
|
+
|
|
41852
|
+
// type ClipboardProps = {
|
|
41853
|
+
// showIcon: boolean,
|
|
41854
|
+
// text: string,
|
|
41855
|
+
// children: React.ReactNode,
|
|
41856
|
+
// onCopy: (text: string, result: any) => void,
|
|
41857
|
+
// options: {
|
|
41858
|
+
// debug: boolean,
|
|
41859
|
+
// message: string,
|
|
41860
|
+
// format: string
|
|
41861
|
+
// }
|
|
41862
|
+
// }
|
|
41863
|
+
|
|
41864
|
+
// export function Clipboard(props: ClipboardProps) {
|
|
41865
|
+
// const { setToast } = useToasts();
|
|
41866
|
+
// const { showIcon, text, onCopy, options: options, children, } = props;
|
|
41867
|
+
// const elem: ReactNode = React.Children.only(children) as ReactNode;
|
|
41868
|
+
// const onClick = (event: MouseEventHandler<HTMLButtonElement | MouseEvent>) => {
|
|
41869
|
+
// const result = copy(text, options);
|
|
41870
|
+
|
|
41871
|
+
// if (result) {
|
|
41872
|
+
// setToast({
|
|
41873
|
+
// text: 'Text Copied'
|
|
41874
|
+
// });
|
|
41875
|
+
// }
|
|
41876
|
+
|
|
41877
|
+
// if (onCopy) {
|
|
41878
|
+
// onCopy(text, result);
|
|
41879
|
+
// }
|
|
41880
|
+
|
|
41881
|
+
// // Bypass onClick if it was present
|
|
41882
|
+
// if (elem && elem.props && typeof elem.props.onClick === 'function') {
|
|
41883
|
+
// elem.props.onClick(event);
|
|
41884
|
+
// }
|
|
41885
|
+
// };
|
|
41886
|
+
|
|
41887
|
+
// if (showIcon) {
|
|
41888
|
+
// return React.cloneElement(
|
|
41889
|
+
// <div>
|
|
41890
|
+
// {elem}
|
|
41891
|
+
// <Button auto scale={0.1} px={0.6} onClick={onClick} icon={<Copy />} />
|
|
41892
|
+
// </div>,
|
|
41893
|
+
// { ...props }
|
|
41894
|
+
// );
|
|
41895
|
+
// }
|
|
41896
|
+
|
|
41897
|
+
// return React.cloneElement(
|
|
41898
|
+
// <div onClick={onClick}>
|
|
41899
|
+
// {elem}
|
|
41900
|
+
// </div>,
|
|
41901
|
+
// { ...props }
|
|
41902
|
+
// );
|
|
41903
|
+
// }
|
|
41904
|
+
|
|
41905
|
+
function Clipboard(props) {
|
|
41906
|
+
var _useToasts = theme.useToasts(),
|
|
41907
|
+
setToast = _useToasts.setToast;
|
|
41908
|
+
var showIcon = props.showIcon,
|
|
41909
|
+
text = props.text,
|
|
41910
|
+
onCopy = props.onCopy,
|
|
41911
|
+
options = props.options,
|
|
41912
|
+
children = props.children;
|
|
41913
|
+
var elem = React.Children.only(children);
|
|
41914
|
+
var _onClick = function onClick() {
|
|
41915
|
+
var _elem$props;
|
|
41916
|
+
var result = copy(text, options);
|
|
41917
|
+
if (result) {
|
|
41918
|
+
setToast({
|
|
41919
|
+
text: 'Text Copied'
|
|
41920
|
+
});
|
|
41921
|
+
}
|
|
41922
|
+
if (onCopy) {
|
|
41923
|
+
onCopy(text, result);
|
|
41924
|
+
}
|
|
41925
|
+
|
|
41926
|
+
// ✅ Safely invoke child's onClick if it exists
|
|
41927
|
+
if (/*#__PURE__*/React.isValidElement(elem) && typeof (elem === null || elem === void 0 || (_elem$props = elem.props) === null || _elem$props === void 0 ? void 0 : _elem$props.onClick) === 'function') {
|
|
41928
|
+
elem.props.onClick();
|
|
41929
|
+
}
|
|
41930
|
+
};
|
|
41931
|
+
|
|
41932
|
+
// If showIcon is true, render the child + a copy icon button
|
|
41933
|
+
if (showIcon) {
|
|
41934
|
+
return /*#__PURE__*/React.createElement("div", null, elem, /*#__PURE__*/React.createElement(Button, {
|
|
41935
|
+
auto: true,
|
|
41936
|
+
scale: 0.1,
|
|
41937
|
+
px: 0.6,
|
|
41938
|
+
onClick: function onClick() {
|
|
41939
|
+
return _onClick;
|
|
41940
|
+
},
|
|
41941
|
+
icon: /*#__PURE__*/React.createElement(icons.Copy, null)
|
|
41942
|
+
}));
|
|
41943
|
+
}
|
|
41944
|
+
|
|
41945
|
+
// Otherwise, make the entire div clickable for copy
|
|
41946
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
41947
|
+
onClick: function onClick() {
|
|
41948
|
+
return _onClick;
|
|
41949
|
+
}
|
|
41950
|
+
}, elem);
|
|
41951
|
+
}
|
|
41952
|
+
|
|
41635
41953
|
exports.AutoComplete = AutoComplete;
|
|
41636
41954
|
exports.Avatar = Avatar;
|
|
41637
41955
|
exports.Badge = Badge;
|
|
@@ -41645,6 +41963,7 @@ exports.Carousel = Carousel;
|
|
|
41645
41963
|
exports.Checkbox = Checkbox;
|
|
41646
41964
|
exports.CircularProgress = CircularProgressbarWithChildren;
|
|
41647
41965
|
exports.CircularProgressBar = CircularProgressbar;
|
|
41966
|
+
exports.Clipboard = Clipboard;
|
|
41648
41967
|
exports.Code = Code;
|
|
41649
41968
|
exports.CodeBlock = CodeBlock;
|
|
41650
41969
|
exports.Collapse = Collapse;
|
|
@@ -41686,7 +42005,7 @@ exports.LoginWithTwitter = index$2;
|
|
|
41686
42005
|
exports.Menu = Menu;
|
|
41687
42006
|
exports.Modal = Modal;
|
|
41688
42007
|
exports.Note = Note;
|
|
41689
|
-
exports.Notetip =
|
|
42008
|
+
exports.Notetip = Notetip;
|
|
41690
42009
|
exports.Page = Page;
|
|
41691
42010
|
exports.Pagination = Pagination;
|
|
41692
42011
|
exports.PhoneInput = PhoneInput;
|
|
@@ -41710,7 +42029,7 @@ exports.Text = Text;
|
|
|
41710
42029
|
exports.Textarea = Textarea;
|
|
41711
42030
|
exports.Themes = Themes;
|
|
41712
42031
|
exports.Toggle = Toggle;
|
|
41713
|
-
exports.Tooltip = Tooltip
|
|
42032
|
+
exports.Tooltip = Tooltip;
|
|
41714
42033
|
exports.Tree = Tree;
|
|
41715
42034
|
exports.User = User;
|
|
41716
42035
|
exports.buildStyles = buildStyles;
|