@capillarytech/blaze-ui 0.1.6-alpha.28 → 0.1.6-alpha.3
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/CapHeading/CapHeading.js +71 -0
- package/CapHeading/index.js +1 -0
- package/CapHeading/styles.js +125 -0
- package/CapInfoNote/CapInfoNote.js +54 -0
- package/CapInfoNote/index.js +1 -0
- package/CapInfoNote/styles.js +63 -0
- package/CapInput/loadable.js +9 -0
- package/CapLabel/CapLabel.js +106 -0
- package/CapLabel/index.js +1 -0
- package/CapLabel/styles.js +221 -0
- package/CapRow/CapRow.js +22 -0
- package/CapRow/index.js +1 -0
- package/CapRow/styles.js +9 -0
- package/CapTable/loadable.js +4 -4
- package/CapTooltip/CapTooltip.js +36 -0
- package/CapTooltip/index.js +1 -0
- package/CapTooltip/styles.js +42 -0
- package/CapUnifiedSelect/CapUnifiedSelect.js +51 -304
- package/CapUnifiedSelect/index.js +4 -1
- package/CapUnifiedSelect/loadable.js +3 -0
- package/CapUnifiedSelect/styles.js +174 -62
- package/dist/235.index.js +2 -0
- package/dist/235.index.js.LICENSE.txt +29 -0
- package/dist/603.index.js +1 -0
- package/dist/CapTable/loadable.js +4 -4
- package/dist/esm/CapHeading/CapHeading.js +41 -0
- package/dist/esm/CapHeading/index.js +1 -0
- package/dist/esm/CapHeading/styles.js +123 -0
- package/dist/esm/CapInfoNote/CapInfoNote.js +62 -0
- package/dist/esm/CapInfoNote/index.js +1 -0
- package/dist/esm/CapInfoNote/styles.js +6 -0
- package/dist/esm/CapInput/loadable.js +9 -0
- package/dist/esm/CapLabel/CapLabel.js +50 -0
- package/dist/esm/CapLabel/index.js +1 -0
- package/dist/esm/CapLabel/styles.js +219 -0
- package/dist/esm/{CapSkeleton/CapSkeleton.js → CapRow/CapRow.js} +12 -12
- package/dist/esm/CapRow/index.js +1 -0
- package/dist/esm/CapRow/styles.js +5 -0
- package/dist/esm/CapTable/loadable.js +4 -4
- package/dist/esm/CapTooltip/CapTooltip.js +34 -0
- package/dist/esm/CapTooltip/index.js +1 -0
- package/dist/esm/CapTooltip/styles.js +6 -0
- package/dist/esm/CapUnifiedSelect/CapUnifiedSelect.js +38 -335
- package/dist/esm/CapUnifiedSelect/index.js +3 -1
- package/dist/esm/CapUnifiedSelect/loadable.js +4 -0
- package/dist/esm/CapUnifiedSelect/styles.js +3 -19
- package/dist/esm/index.js +1 -5
- package/dist/index.js +0 -27
- package/dist/index.js.LICENSE.txt +7 -0
- package/index.js +1 -5
- package/package.json +10 -8
- package/CapSkeleton/CapSkeleton.js +0 -17
- package/CapSkeleton/index.js +0 -1
- package/CapSpin/CapSpin.js +0 -23
- package/CapSpin/index.js +0 -1
- package/CapTestSelect/CapTestSelect.js +0 -47
- package/CapTestSelect/index.js +0 -1
- package/components/CapInput/CapInput.js +0 -67
- package/components/CapInput/Number.js +0 -38
- package/components/CapInput/Search.js +0 -32
- package/components/CapInput/TextArea.js +0 -45
- package/components/CapInput/index.js +0 -10
- package/components/CapInput/messages.js +0 -27
- package/components/CapInput/styles.js +0 -81
- package/components/CapSkeleton/CapSkeleton.js +0 -17
- package/components/CapSkeleton/index.js +0 -1
- package/components/CapSpin/CapSpin.js +0 -23
- package/components/CapSpin/index.js +0 -1
- package/components/CapTable/CapTable.js +0 -146
- package/components/CapTable/index.js +0 -3
- package/components/CapTable/loadable.js +0 -13
- package/components/CapTable/styles.js +0 -134
- package/components/CapTestSelect/CapTestSelect.js +0 -47
- package/components/CapTestSelect/index.js +0 -1
- package/components/CapUnifiedSelect/CapUnifiedSelect.js +0 -374
- package/components/CapUnifiedSelect/index.js +0 -1
- package/components/CapUnifiedSelect/messages.js +0 -24
- package/components/CapUnifiedSelect/styles.js +0 -111
- package/components/LocaleHoc/index.js +0 -38
- package/components/index.js +0 -14
- package/components/styled/index.js +0 -6
- package/components/styled/variables.js +0 -89
- package/components/translations/en.js +0 -331
- package/dist/CapSkeleton/CapSkeleton.js +0 -29
- package/dist/CapSkeleton/index.js +0 -13
- package/dist/CapSpin/CapSpin.js +0 -35
- package/dist/CapSpin/index.js +0 -13
- package/dist/CapTestSelect/CapTestSelect.js +0 -40
- package/dist/CapTestSelect/index.js +0 -13
- package/dist/CapUnifiedSelect/CapUnifiedSelect.js +0 -405
- package/dist/CapUnifiedSelect/index.js +0 -13
- package/dist/CapUnifiedSelect/messages.js +0 -29
- package/dist/CapUnifiedSelect/styles.js +0 -39
- package/dist/components/CapInput/CapInput.js +0 -66
- package/dist/components/CapInput/Number.js +0 -42
- package/dist/components/CapInput/Search.js +0 -35
- package/dist/components/CapInput/TextArea.js +0 -42
- package/dist/components/CapInput/index.js +0 -15
- package/dist/components/CapInput/messages.js +0 -32
- package/dist/components/CapInput/styles.js +0 -11
- package/dist/components/CapSkeleton/CapSkeleton.js +0 -29
- package/dist/components/CapSkeleton/index.js +0 -13
- package/dist/components/CapSpin/CapSpin.js +0 -35
- package/dist/components/CapSpin/index.js +0 -13
- package/dist/components/CapTable/CapTable.js +0 -148
- package/dist/components/CapTable/index.js +0 -9
- package/dist/components/CapTable/loadable.js +0 -23
- package/dist/components/CapTable/styles.js +0 -26
- package/dist/components/CapTestSelect/CapTestSelect.js +0 -40
- package/dist/components/CapTestSelect/index.js +0 -13
- package/dist/components/CapUnifiedSelect/CapUnifiedSelect.js +0 -406
- package/dist/components/CapUnifiedSelect/index.js +0 -13
- package/dist/components/CapUnifiedSelect/messages.js +0 -29
- package/dist/components/CapUnifiedSelect/styles.js +0 -39
- package/dist/components/LocaleHoc/index.js +0 -40
- package/dist/components/index.js +0 -66
- package/dist/components/styled/index.js +0 -22
- package/dist/components/styled/variables.js +0 -94
- package/dist/components/translations/en.js +0 -335
- package/dist/esm/CapSkeleton/index.js +0 -1
- package/dist/esm/CapSpin/CapSpin.js +0 -28
- package/dist/esm/CapSpin/index.js +0 -1
- package/dist/esm/CapTestSelect/CapTestSelect.js +0 -34
- package/dist/esm/CapTestSelect/index.js +0 -1
- package/dist/esm/components/CapInput/CapInput.js +0 -57
- package/dist/esm/components/CapInput/Number.js +0 -35
- package/dist/esm/components/CapInput/Search.js +0 -28
- package/dist/esm/components/CapInput/TextArea.js +0 -35
- package/dist/esm/components/CapInput/index.js +0 -8
- package/dist/esm/components/CapInput/messages.js +0 -25
- package/dist/esm/components/CapInput/styles.js +0 -3
- package/dist/esm/components/CapSkeleton/CapSkeleton.js +0 -22
- package/dist/esm/components/CapSkeleton/index.js +0 -1
- package/dist/esm/components/CapSpin/CapSpin.js +0 -28
- package/dist/esm/components/CapSpin/index.js +0 -1
- package/dist/esm/components/CapTable/CapTable.js +0 -140
- package/dist/esm/components/CapTable/index.js +0 -2
- package/dist/esm/components/CapTable/loadable.js +0 -12
- package/dist/esm/components/CapTable/styles.js +0 -17
- package/dist/esm/components/CapTestSelect/CapTestSelect.js +0 -34
- package/dist/esm/components/CapTestSelect/index.js +0 -1
- package/dist/esm/components/CapUnifiedSelect/CapUnifiedSelect.js +0 -398
- package/dist/esm/components/CapUnifiedSelect/index.js +0 -1
- package/dist/esm/components/CapUnifiedSelect/messages.js +0 -23
- package/dist/esm/components/CapUnifiedSelect/styles.js +0 -31
- package/dist/esm/components/LocaleHoc/index.js +0 -31
- package/dist/esm/components/index.js +0 -15
- package/dist/esm/components/styled/index.js +0 -5
- package/dist/esm/components/styled/variables.js +0 -88
- package/dist/esm/components/translations/en.js +0 -329
- package/dist/esm/utils/index.js +0 -1
- package/dist/esm/utils/withStyles.js +0 -23
- package/dist/esm/withStyles.js +0 -23
- package/dist/utils/index.js +0 -13
- package/dist/utils/withStyles.js +0 -29
- package/dist/withStyles.js +0 -29
- package/utils/index.js +0 -1
- package/utils/withStyles.js +0 -24
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* CapInput Messages
|
|
3
|
-
*
|
|
4
|
-
* This contains all the text for the CapInput component.
|
|
5
|
-
*/
|
|
6
|
-
import { defineMessages } from 'react-intl';
|
|
7
|
-
var scope = 'blaze.components.CapInput';
|
|
8
|
-
export default defineMessages({
|
|
9
|
-
placeholder: {
|
|
10
|
-
id: "".concat(scope, ".placeholder"),
|
|
11
|
-
defaultMessage: 'Enter text...'
|
|
12
|
-
},
|
|
13
|
-
searchPlaceholder: {
|
|
14
|
-
id: "".concat(scope, ".searchPlaceholder"),
|
|
15
|
-
defaultMessage: 'Search...'
|
|
16
|
-
},
|
|
17
|
-
textAreaPlaceholder: {
|
|
18
|
-
id: "".concat(scope, ".textAreaPlaceholder"),
|
|
19
|
-
defaultMessage: 'Enter your text here...'
|
|
20
|
-
},
|
|
21
|
-
numberPlaceholder: {
|
|
22
|
-
id: "".concat(scope, ".numberPlaceholder"),
|
|
23
|
-
defaultMessage: 'Enter number...'
|
|
24
|
-
}
|
|
25
|
-
});
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { css } from 'styled-components';
|
|
2
|
-
import * as styledVars from '../styled/variables';
|
|
3
|
-
export var inputStyles = css(["&.ant-input,&.ant-input-affix-wrapper,&.ant-input-number,&.ant-input-textarea{font-family:", ";border-radius:", ";transition:", ";&:hover{border-color:", ";}&:focus,&.ant-input-affix-wrapper-focused{border-color:", ";box-shadow:none;}&.ant-input-status-error,&.ant-input-affix-wrapper-status-error,&.ant-input-number-status-error{border-color:", ";&:hover{border-color:", ";}&:focus,&.ant-input-affix-wrapper-focused{border-color:", ";box-shadow:none;}}&.ant-input-disabled,&.ant-input-affix-wrapper-disabled{background-color:", ";cursor:not-allowed;}}&.ant-input-lg,&.ant-input-affix-wrapper-lg{font-size:14px;padding:10px 12px;}&.ant-input-textarea{.ant-input{font-family:", ";}}&.ant-input-number{width:100%;.ant-input-number-handler-wrap{opacity:1;}}&.ant-input-search{.ant-input-search-button{background-color:", ";border-color:", ";&:hover{background-color:", ";border-color:", ";}}}"], styledVars.FONT_FAMILY, styledVars.RADIUS_04, styledVars.TRANSITION_ALL, styledVars.CAP_G11, styledVars.CAP_G01, styledVars.CAP_RED, styledVars.CAP_RED, styledVars.CAP_RED, styledVars.CAP_G08, styledVars.FONT_FAMILY, styledVars.CAP_PRIMARY.base, styledVars.CAP_PRIMARY.base, styledVars.CAP_PRIMARY.hover, styledVars.CAP_PRIMARY.hover);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var _excluded = ["className"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
/**
|
|
6
|
-
* CapSkeleton - Migrated to Ant Design v5
|
|
7
|
-
*/
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import PropTypes from 'prop-types';
|
|
10
|
-
import { Skeleton } from 'antd';
|
|
11
|
-
var CapSkeleton = function CapSkeleton(_ref) {
|
|
12
|
-
var className = _ref.className,
|
|
13
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
-
var combinedClassName = "cap-skeleton-v2 ".concat(className || '').trim();
|
|
15
|
-
return /*#__PURE__*/React.createElement(Skeleton, _extends({
|
|
16
|
-
className: combinedClassName
|
|
17
|
-
}, rest));
|
|
18
|
-
};
|
|
19
|
-
CapSkeleton.propTypes = {
|
|
20
|
-
className: PropTypes.string
|
|
21
|
-
};
|
|
22
|
-
export default CapSkeleton;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './CapSkeleton';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var _excluded = ["className"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
/**
|
|
6
|
-
* CapSpin - Migrated to Ant Design v5
|
|
7
|
-
*/
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import PropTypes from 'prop-types';
|
|
10
|
-
import { Spin } from 'antd';
|
|
11
|
-
var CapSpin = function CapSpin(_ref) {
|
|
12
|
-
var className = _ref.className,
|
|
13
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/React.createElement(Spin, _extends({
|
|
15
|
-
className: className
|
|
16
|
-
}, rest));
|
|
17
|
-
};
|
|
18
|
-
CapSpin.propTypes = {
|
|
19
|
-
className: PropTypes.string,
|
|
20
|
-
size: PropTypes.oneOf(['small', 'default', 'large']),
|
|
21
|
-
spinning: PropTypes.bool,
|
|
22
|
-
tip: PropTypes.string,
|
|
23
|
-
delay: PropTypes.number,
|
|
24
|
-
indicator: PropTypes.node,
|
|
25
|
-
fullscreen: PropTypes.bool,
|
|
26
|
-
wrapperClassName: PropTypes.string
|
|
27
|
-
};
|
|
28
|
-
export default CapSpin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './CapSpin';
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["id", "className", "children", "infiniteScroll", "pagination", "dataSource", "offset_limit", "setPagination", "scroll", "showLoader"];
|
|
3
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
10
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
14
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
15
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
16
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
17
|
-
/**
|
|
18
|
-
* CapTable - Migrated to Ant Design v5
|
|
19
|
-
* A table component that supports:
|
|
20
|
-
* - Infinite scrolling with virtualization
|
|
21
|
-
* - Sequential data loading
|
|
22
|
-
* - Optimized scroll performance
|
|
23
|
-
*/
|
|
24
|
-
import React, { useEffect, useCallback, useState, useRef } from 'react';
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
import { debounce } from 'lodash';
|
|
27
|
-
import classNames from 'classnames';
|
|
28
|
-
import { StyledTable } from './styles';
|
|
29
|
-
import LocaleHoc from '../LocaleHoc';
|
|
30
|
-
var SCROLL_THRESHOLD = 80; // Percentage of scroll to trigger load
|
|
31
|
-
var DEBOUNCE_DELAY = 250; // ms to wait between scroll events
|
|
32
|
-
var DEFAULT_ROW_HEIGHT = 54;
|
|
33
|
-
var DEFAULT_SCROLL_HEIGHT = 400;
|
|
34
|
-
var CapTable = function CapTable(_ref) {
|
|
35
|
-
var id = _ref.id,
|
|
36
|
-
className = _ref.className,
|
|
37
|
-
children = _ref.children,
|
|
38
|
-
infiniteScroll = _ref.infiniteScroll,
|
|
39
|
-
pagination = _ref.pagination,
|
|
40
|
-
dataSource = _ref.dataSource,
|
|
41
|
-
offset_limit = _ref.offset_limit,
|
|
42
|
-
setPagination = _ref.setPagination,
|
|
43
|
-
scroll = _ref.scroll,
|
|
44
|
-
showLoader = _ref.showLoader,
|
|
45
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
46
|
-
var scrollRef = useRef(null);
|
|
47
|
-
var _useState = useState(true),
|
|
48
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
-
hasMore = _useState2[0],
|
|
50
|
-
setHasMore = _useState2[1];
|
|
51
|
-
var currentOffsetRef = useRef(0);
|
|
52
|
-
var loadMore = useCallback(function () {
|
|
53
|
-
if (!showLoader && hasMore) {
|
|
54
|
-
var nextOffset = currentOffsetRef.current + 1;
|
|
55
|
-
var newOffsetLimit = _objectSpread(_objectSpread({}, offset_limit), {}, {
|
|
56
|
-
offset: nextOffset
|
|
57
|
-
});
|
|
58
|
-
currentOffsetRef.current = nextOffset;
|
|
59
|
-
setPagination(newOffsetLimit);
|
|
60
|
-
}
|
|
61
|
-
}, [showLoader, hasMore, setPagination, offset_limit]);
|
|
62
|
-
var handleScroll = useCallback(debounce(function (event) {
|
|
63
|
-
var target = event.target;
|
|
64
|
-
if (!target || !infiniteScroll || !hasMore || showLoader) return;
|
|
65
|
-
var scrollTop = Math.ceil(target.scrollTop);
|
|
66
|
-
var visibleHeight = target.clientHeight;
|
|
67
|
-
var totalHeight = target.scrollHeight;
|
|
68
|
-
var scrolledPercentage = (scrollTop + visibleHeight) / totalHeight * 100;
|
|
69
|
-
if (scrolledPercentage >= SCROLL_THRESHOLD) {
|
|
70
|
-
loadMore();
|
|
71
|
-
}
|
|
72
|
-
}, DEBOUNCE_DELAY), [infiniteScroll, showLoader, hasMore, loadMore]);
|
|
73
|
-
|
|
74
|
-
// Setup scroll listener and handle initial load
|
|
75
|
-
useEffect(function () {
|
|
76
|
-
var tableBody = document.querySelector("#".concat(id, " .ant-table-body"));
|
|
77
|
-
if (!tableBody) return;
|
|
78
|
-
scrollRef.current = tableBody;
|
|
79
|
-
tableBody.addEventListener('scroll', handleScroll, {
|
|
80
|
-
passive: true
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
// Check if initial load needed
|
|
84
|
-
var shouldLoadInitially = tableBody.scrollHeight <= tableBody.clientHeight && !showLoader && hasMore;
|
|
85
|
-
if (shouldLoadInitially) {
|
|
86
|
-
currentOffsetRef.current = 0;
|
|
87
|
-
loadMore();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Cleanup
|
|
91
|
-
return function () {
|
|
92
|
-
var _scrollRef$current;
|
|
93
|
-
(_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.removeEventListener('scroll', handleScroll);
|
|
94
|
-
handleScroll.cancel();
|
|
95
|
-
};
|
|
96
|
-
}, [id, handleScroll, showLoader, hasMore, loadMore]);
|
|
97
|
-
|
|
98
|
-
// Handle data changes
|
|
99
|
-
useEffect(function () {
|
|
100
|
-
if (!(dataSource !== null && dataSource !== void 0 && dataSource.length)) {
|
|
101
|
-
currentOffsetRef.current = 0;
|
|
102
|
-
setHasMore(true);
|
|
103
|
-
} else {
|
|
104
|
-
setHasMore(true);
|
|
105
|
-
}
|
|
106
|
-
}, [dataSource]);
|
|
107
|
-
var tableClassName = classNames('cap-table-v2', className, {
|
|
108
|
-
'show-loader': showLoader,
|
|
109
|
-
'infinite-scroll': infiniteScroll,
|
|
110
|
-
'has-more': hasMore
|
|
111
|
-
});
|
|
112
|
-
return /*#__PURE__*/React.createElement(StyledTable, _extends({
|
|
113
|
-
id: id,
|
|
114
|
-
className: tableClassName,
|
|
115
|
-
dataSource: dataSource,
|
|
116
|
-
pagination: false,
|
|
117
|
-
scroll: {
|
|
118
|
-
x: scroll === null || scroll === void 0 ? void 0 : scroll.x,
|
|
119
|
-
y: (scroll === null || scroll === void 0 ? void 0 : scroll.y) || DEFAULT_SCROLL_HEIGHT,
|
|
120
|
-
scrollToFirstRowOnChange: false
|
|
121
|
-
},
|
|
122
|
-
virtual: infiniteScroll,
|
|
123
|
-
rowHeight: DEFAULT_ROW_HEIGHT
|
|
124
|
-
}, rest), children);
|
|
125
|
-
};
|
|
126
|
-
CapTable.propTypes = {
|
|
127
|
-
id: PropTypes.string.isRequired,
|
|
128
|
-
className: PropTypes.string,
|
|
129
|
-
children: PropTypes.node,
|
|
130
|
-
infiniteScroll: PropTypes.bool,
|
|
131
|
-
pagination: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
|
|
132
|
-
dataSource: PropTypes.array,
|
|
133
|
-
offset_limit: PropTypes.object,
|
|
134
|
-
setPagination: PropTypes.func,
|
|
135
|
-
scroll: PropTypes.object,
|
|
136
|
-
showLoader: PropTypes.bool
|
|
137
|
-
};
|
|
138
|
-
export default LocaleHoc(CapTable, {
|
|
139
|
-
key: 'CapTable'
|
|
140
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import CapSkeleton from '../CapSkeleton';
|
|
2
|
-
import { loadable } from '@capillarytech/cap-ui-utils';
|
|
3
|
-
import React, { Suspense } from 'react';
|
|
4
|
-
var LoadableComponent = loadable(function () {
|
|
5
|
-
return import('./CapTable');
|
|
6
|
-
});
|
|
7
|
-
var CapTableLoadable = function CapTableLoadable(props) {
|
|
8
|
-
return /*#__PURE__*/React.createElement(Suspense, {
|
|
9
|
-
fallback: /*#__PURE__*/React.createElement(CapSkeleton, null)
|
|
10
|
-
}, /*#__PURE__*/React.createElement(LoadableComponent, props));
|
|
11
|
-
};
|
|
12
|
-
export default CapTableLoadable;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Table } from 'antd';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import * as styledVars from '../styled/variables';
|
|
4
|
-
var CAP_G09 = styledVars.CAP_G09,
|
|
5
|
-
CAP_G01 = styledVars.CAP_G01,
|
|
6
|
-
CAP_G06 = styledVars.CAP_G06,
|
|
7
|
-
CAP_G07 = styledVars.CAP_G07,
|
|
8
|
-
CAP_G10 = styledVars.CAP_G10,
|
|
9
|
-
SPACING_16 = styledVars.SPACING_16,
|
|
10
|
-
SPACING_24 = styledVars.SPACING_24,
|
|
11
|
-
FONT_SIZE_S = styledVars.FONT_SIZE_S;
|
|
12
|
-
export var StyledTable = styled(Table).withConfig({
|
|
13
|
-
displayName: "StyledTable",
|
|
14
|
-
componentId: "sc-1ldu1k4-0"
|
|
15
|
-
})(["&.cap-table-v2{.ant-table{border:1px solid ", ";}}&.show-loader{.ant-table-body > table > tbody::after{content:'", "';display:flex;justify-content:center;position:absolute;width:100%;align-items:center;height:60px;text-align:center;font-size:16px;color:gray;border-top:1px solid ", ";}}.ant-table{border:1px solid ", ";.ant-table-thead > tr > th{color:", ";font-size:", ";line-height:", ";background-color:", ";text-align:left;}.ant-table-thead > tr > th,.ant-table-tbody > tr > td{padding:", " ", ";}.ant-table-tbody > tr > td{border-bottom:1px solid ", ";}.ant-table-tbody > tr:last-child > td{border-bottom:none;}.ant-table-thead > tr.ant-table-row-hover:not(.ant-table-expanded-row) > td,.ant-table-tbody > tr.ant-table-row-hover:not(.ant-table-expanded-row) > td,.ant-table-thead > tr:hover:not(.ant-table-expanded-row) > td,.ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td{background-color:", ";}.ant-table-thead > tr > th .ant-table-column-sorter-up,.ant-table-thead > tr > th .ant-table-column-sorter-down{&.active{color:", ";}&:not(.active){color:", ";}}.ant-table-thead{.table-children{padding:6px ", " 16px;position:relative;}.table-parent{padding-bottom:0;padding-left:", ";}.table-children.show-separator:not(:last-child)::after{content:'';height:8px;width:1px;right:0;top:30%;background-color:", ";position:absolute;}}.ant-table-thead > tr > th .ant-table-column-sorter{vertical-align:unset;}.ant-table-body table{table-layout:fixed;width:100%;}}&.no-pagination-loader{.ant-table-body > table > tbody::after{content:'';height:unset;display:none;}}&.hide-hover{.ant-table{.ant-table-thead > tr.ant-table-row-hover:not(.ant-table-expanded-row) > td,.ant-table-tbody > tr.ant-table-row-hover:not(.ant-table-expanded-row) > td,.ant-table-thead > tr:hover:not(.ant-table-expanded-row) > td,.ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td{background:none;}}}a{color:", ";}"], CAP_G07, function (props) {
|
|
16
|
-
return props.loadMoreData;
|
|
17
|
-
}, CAP_G07, CAP_G07, CAP_G01, FONT_SIZE_S, SPACING_16, CAP_G10, SPACING_16, SPACING_24, CAP_G07, CAP_G09, CAP_G01, CAP_G06, SPACING_24, SPACING_24, CAP_G07, CAP_G01);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { Select } from 'antd';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Test component to verify Ant Design v5 Select integration
|
|
7
|
-
* This is a simple wrapper for testing purposes only
|
|
8
|
-
*/
|
|
9
|
-
var CapTestSelect = function CapTestSelect(props) {
|
|
10
|
-
return /*#__PURE__*/React.createElement(Select, props);
|
|
11
|
-
};
|
|
12
|
-
CapTestSelect.propTypes = {
|
|
13
|
-
// Common Select props from antd
|
|
14
|
-
allowClear: PropTypes.bool,
|
|
15
|
-
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))]),
|
|
16
|
-
disabled: PropTypes.bool,
|
|
17
|
-
loading: PropTypes.bool,
|
|
18
|
-
mode: PropTypes.oneOf(['multiple', 'tags']),
|
|
19
|
-
placeholder: PropTypes.string,
|
|
20
|
-
showSearch: PropTypes.bool,
|
|
21
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))]),
|
|
22
|
-
options: PropTypes.arrayOf(PropTypes.shape({
|
|
23
|
-
label: PropTypes.node,
|
|
24
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
25
|
-
disabled: PropTypes.bool
|
|
26
|
-
}))
|
|
27
|
-
};
|
|
28
|
-
CapTestSelect.defaultProps = {
|
|
29
|
-
allowClear: false,
|
|
30
|
-
disabled: false,
|
|
31
|
-
loading: false,
|
|
32
|
-
showSearch: false
|
|
33
|
-
};
|
|
34
|
-
export default CapTestSelect;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './CapTestSelect';
|