tntd 2.7.32 → 2.8.0-beta.1
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/es/form/form.js +2 -2
- package/es/form/form.js.map +1 -1
- package/es/icon/IconFont.js +52 -0
- package/es/icon/IconFont.js.map +1 -0
- package/es/icon/components/Icon.js +106 -0
- package/es/icon/components/Icon.js.map +1 -0
- package/es/icon/components/index.js +1 -0
- package/es/icon/components/index.js.map +1 -0
- package/es/icon/components/utils.js +79 -0
- package/es/icon/components/utils.js.map +1 -0
- package/es/icon/index.js +114 -3
- package/es/icon/index.js.map +1 -1
- package/es/icon/twoTonePrimaryColor.js +10 -0
- package/es/icon/twoTonePrimaryColor.js.map +1 -0
- package/es/icon/utils.js +64 -0
- package/es/icon/utils.js.map +1 -0
- package/lib/form/form.js +2 -2
- package/lib/form/form.js.map +1 -1
- package/lib/icon/IconFont.d.ts +10 -0
- package/lib/icon/IconFont.d.ts.map +1 -0
- package/lib/icon/IconFont.js +62 -0
- package/lib/icon/IconFont.js.map +1 -0
- package/lib/icon/components/Icon.d.ts +31 -0
- package/lib/icon/components/Icon.d.ts.map +1 -0
- package/lib/icon/components/Icon.js +149 -0
- package/lib/icon/components/Icon.js.map +1 -0
- package/lib/icon/components/index.d.ts +2 -0
- package/lib/icon/components/index.d.ts.map +1 -0
- package/lib/icon/components/index.js +13 -0
- package/lib/icon/components/index.js.map +1 -0
- package/lib/icon/components/utils.d.ts +22 -0
- package/lib/icon/components/utils.d.ts.map +1 -0
- package/lib/icon/components/utils.js +120 -0
- package/lib/icon/components/utils.js.map +1 -0
- package/lib/icon/index.d.ts +45 -3
- package/lib/icon/index.d.ts.map +1 -1
- package/lib/icon/index.js +121 -15
- package/lib/icon/index.js.map +1 -1
- package/lib/icon/twoTonePrimaryColor.d.ts +3 -0
- package/lib/icon/twoTonePrimaryColor.d.ts.map +1 -0
- package/lib/icon/twoTonePrimaryColor.js +18 -0
- package/lib/icon/twoTonePrimaryColor.js.map +1 -0
- package/lib/icon/utils.d.ts +13 -0
- package/lib/icon/utils.d.ts.map +1 -0
- package/lib/icon/utils.js +76 -0
- package/lib/icon/utils.js.map +1 -0
- package/lib/segmented/index.d.ts +1 -1
- package/lib/svg-components/illustration-403.d.ts +1 -1
- package/lib/svg-components/illustration-404.d.ts +1 -1
- package/lib/svg-components/illustration-500.d.ts +1 -1
- package/lib/svg-components/illustration-empty.d.ts +1 -1
- package/lib/svg-components/illustration-failure.d.ts +1 -1
- package/lib/svg-components/illustration-no-access.d.ts +1 -1
- package/lib/svg-components/illustration-no-chart.d.ts +1 -1
- package/lib/svg-components/illustration-no-result.d.ts +1 -1
- package/lib/svg-components/illustration-offline.d.ts +1 -1
- package/lib/svg-components/illustration-success.d.ts +1 -1
- package/lib/table/assets/image-loading-background.d.ts +1 -1
- package/lib/table/assets/image-loading.d.ts +1 -1
- package/package.json +106 -105
- package/es/tntd-form/_util/context.js +0 -12
- package/es/tntd-form/_util/context.js.map +0 -1
- package/es/tntd-form/_util/defaultRenderEmpty.js +0 -31
- package/es/tntd-form/_util/defaultRenderEmpty.js.map +0 -1
- package/es/tntd-form/_util/hooks/useFlexGapSupport.js +0 -9
- package/es/tntd-form/_util/hooks/useFlexGapSupport.js.map +0 -1
- package/es/tntd-form/_util/hooks/useForceUpdate.js +0 -5
- package/es/tntd-form/_util/hooks/useForceUpdate.js.map +0 -1
- package/es/tntd-form/_util/motion.js +0 -47
- package/es/tntd-form/_util/motion.js.map +0 -1
- package/es/tntd-form/_util/reactNode.js +0 -16
- package/es/tntd-form/_util/reactNode.js.map +0 -1
- package/es/tntd-form/_util/responsiveObserve.js +0 -59
- package/es/tntd-form/_util/responsiveObserve.js.map +0 -1
- package/es/tntd-form/_util/scrollTo.js +0 -35
- package/es/tntd-form/_util/scrollTo.js.map +0 -1
- package/es/tntd-form/_util/styleChecker.js +0 -26
- package/es/tntd-form/_util/styleChecker.js.map +0 -1
- package/es/tntd-form/_util/type.js +0 -3
- package/es/tntd-form/_util/type.js.map +0 -1
- package/es/tntd-form/_util/warning.js +0 -5
- package/es/tntd-form/_util/warning.js.map +0 -1
- package/es/tntd-form/_util/wave.js +0 -168
- package/es/tntd-form/_util/wave.js.map +0 -1
- package/es/tntd-form/grid/RowContext.js +0 -3
- package/es/tntd-form/grid/RowContext.js.map +0 -1
- package/es/tntd-form/grid/col.js +0 -104
- package/es/tntd-form/grid/col.js.map +0 -1
- package/es/tntd-form/grid/hooks/useBreakpoint.js +0 -18
- package/es/tntd-form/grid/hooks/useBreakpoint.js.map +0 -1
- package/es/tntd-form/grid/index.js +0 -14
- package/es/tntd-form/grid/index.js.map +0 -1
- package/es/tntd-form/grid/row.js +0 -153
- package/es/tntd-form/grid/row.js.map +0 -1
- package/es/tntd-form/grid/style/index.js +0 -2
- package/es/tntd-form/grid/style/index.js.map +0 -1
- package/es/tntd-form/tntd-form.stories.js +0 -836
- package/es/tntd-form/tntd-form.stories.js.map +0 -1
- package/lib/tntd-form/_util/context.d.ts +0 -42
- package/lib/tntd-form/_util/context.d.ts.map +0 -1
- package/lib/tntd-form/_util/context.js +0 -22
- package/lib/tntd-form/_util/context.js.map +0 -1
- package/lib/tntd-form/_util/defaultRenderEmpty.d.ts +0 -5
- package/lib/tntd-form/_util/defaultRenderEmpty.d.ts.map +0 -1
- package/lib/tntd-form/_util/defaultRenderEmpty.js +0 -44
- package/lib/tntd-form/_util/defaultRenderEmpty.js.map +0 -1
- package/lib/tntd-form/_util/hooks/useFlexGapSupport.d.ts +0 -3
- package/lib/tntd-form/_util/hooks/useFlexGapSupport.d.ts.map +0 -1
- package/lib/tntd-form/_util/hooks/useFlexGapSupport.js +0 -28
- package/lib/tntd-form/_util/hooks/useFlexGapSupport.js.map +0 -1
- package/lib/tntd-form/_util/hooks/useForceUpdate.d.ts +0 -3
- package/lib/tntd-form/_util/hooks/useForceUpdate.d.ts.map +0 -1
- package/lib/tntd-form/_util/hooks/useForceUpdate.js +0 -24
- package/lib/tntd-form/_util/hooks/useForceUpdate.js.map +0 -1
- package/lib/tntd-form/_util/motion.d.ts +0 -9
- package/lib/tntd-form/_util/motion.d.ts.map +0 -1
- package/lib/tntd-form/_util/motion.js +0 -59
- package/lib/tntd-form/_util/motion.js.map +0 -1
- package/lib/tntd-form/_util/reactNode.d.ts +0 -9
- package/lib/tntd-form/_util/reactNode.d.ts.map +0 -1
- package/lib/tntd-form/_util/reactNode.js +0 -27
- package/lib/tntd-form/_util/reactNode.js.map +0 -1
- package/lib/tntd-form/_util/responsiveObserve.d.ts +0 -22
- package/lib/tntd-form/_util/responsiveObserve.d.ts.map +0 -1
- package/lib/tntd-form/_util/responsiveObserve.js +0 -73
- package/lib/tntd-form/_util/responsiveObserve.js.map +0 -1
- package/lib/tntd-form/_util/scrollTo.d.ts +0 -1
- package/lib/tntd-form/_util/scrollTo.d.ts.map +0 -1
- package/lib/tntd-form/_util/scrollTo.js +0 -35
- package/lib/tntd-form/_util/scrollTo.js.map +0 -1
- package/lib/tntd-form/_util/styleChecker.d.ts +0 -5
- package/lib/tntd-form/_util/styleChecker.d.ts.map +0 -1
- package/lib/tntd-form/_util/styleChecker.js +0 -42
- package/lib/tntd-form/_util/styleChecker.js.map +0 -1
- package/lib/tntd-form/_util/type.d.ts +0 -4
- package/lib/tntd-form/_util/type.d.ts.map +0 -1
- package/lib/tntd-form/_util/type.js +0 -21
- package/lib/tntd-form/_util/type.js.map +0 -1
- package/lib/tntd-form/_util/warning.d.ts +0 -5
- package/lib/tntd-form/_util/warning.d.ts.map +0 -1
- package/lib/tntd-form/_util/warning.js +0 -20
- package/lib/tntd-form/_util/warning.js.map +0 -1
- package/lib/tntd-form/_util/wave.d.ts +0 -1
- package/lib/tntd-form/_util/wave.d.ts.map +0 -1
- package/lib/tntd-form/_util/wave.js +0 -168
- package/lib/tntd-form/_util/wave.js.map +0 -1
- package/lib/tntd-form/grid/RowContext.d.ts +0 -9
- package/lib/tntd-form/grid/RowContext.d.ts.map +0 -1
- package/lib/tntd-form/grid/RowContext.js +0 -10
- package/lib/tntd-form/grid/RowContext.js.map +0 -1
- package/lib/tntd-form/grid/col.d.ts +0 -29
- package/lib/tntd-form/grid/col.d.ts.map +0 -1
- package/lib/tntd-form/grid/col.js +0 -105
- package/lib/tntd-form/grid/col.js.map +0 -1
- package/lib/tntd-form/grid/hooks/useBreakpoint.d.ts +0 -4
- package/lib/tntd-form/grid/hooks/useBreakpoint.d.ts.map +0 -1
- package/lib/tntd-form/grid/hooks/useBreakpoint.js +0 -29
- package/lib/tntd-form/grid/hooks/useBreakpoint.js.map +0 -1
- package/lib/tntd-form/grid/index.d.ts +0 -12
- package/lib/tntd-form/grid/index.d.ts.map +0 -1
- package/lib/tntd-form/grid/index.js +0 -31
- package/lib/tntd-form/grid/index.js.map +0 -1
- package/lib/tntd-form/grid/row.d.ts +0 -21
- package/lib/tntd-form/grid/row.d.ts.map +0 -1
- package/lib/tntd-form/grid/row.js +0 -186
- package/lib/tntd-form/grid/row.js.map +0 -1
- package/lib/tntd-form/grid/style/index.d.ts +0 -3
- package/lib/tntd-form/grid/style/index.d.ts.map +0 -1
- package/lib/tntd-form/grid/style/index.js +0 -4
- package/lib/tntd-form/grid/style/index.js.map +0 -1
- package/lib/tntd-form/tntd-form.stories.d.ts +0 -33
- package/lib/tntd-form/tntd-form.stories.d.ts.map +0 -1
- package/lib/tntd-form/tntd-form.stories.js +0 -943
- package/lib/tntd-form/tntd-form.stories.js.map +0 -1
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// import raf from 'raf';
|
|
4
|
-
// import getScroll from './getScroll';
|
|
5
|
-
// import { easeInOutCubic } from './easings';
|
|
6
|
-
// interface ScrollToOptions {
|
|
7
|
-
// /** Scroll container, default as window */
|
|
8
|
-
// getContainer?: () => HTMLElement | Window;
|
|
9
|
-
// /** Scroll end callback */
|
|
10
|
-
// callback?: () => any;
|
|
11
|
-
// /** Animation duration, default as 450 */
|
|
12
|
-
// duration?: number;
|
|
13
|
-
// }
|
|
14
|
-
// export default function scrollTo(y: number, options: ScrollToOptions = {}) {
|
|
15
|
-
// const { getContainer = () => window, callback, duration = 450 } = options;
|
|
16
|
-
// const container = getContainer();
|
|
17
|
-
// const scrollTop = getScroll(container, true);
|
|
18
|
-
// const startTime = Date.now();
|
|
19
|
-
// const frameFunc = () => {
|
|
20
|
-
// const timestamp = Date.now();
|
|
21
|
-
// const time = timestamp - startTime;
|
|
22
|
-
// const nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
|
|
23
|
-
// if (container === window) {
|
|
24
|
-
// window.scrollTo(window.pageXOffset, nextScrollTop);
|
|
25
|
-
// } else {
|
|
26
|
-
// (container as HTMLElement).scrollTop = nextScrollTop;
|
|
27
|
-
// }
|
|
28
|
-
// if (time < duration) {
|
|
29
|
-
// raf(frameFunc);
|
|
30
|
-
// } else if (typeof callback === 'function') {
|
|
31
|
-
// callback();
|
|
32
|
-
// }
|
|
33
|
-
// };
|
|
34
|
-
// raf(frameFunc);
|
|
35
|
-
// }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scrollTo.js","sourceRoot":"","sources":["../../../src/tntd-form/_util/scrollTo.ts"],"names":[],"mappings":";AAAA,yBAAyB;AACzB,uCAAuC;AACvC,8CAA8C;AAE9C,8BAA8B;AAC9B,+CAA+C;AAC/C,+CAA+C;AAC/C,+BAA+B;AAC/B,0BAA0B;AAC1B,8CAA8C;AAC9C,uBAAuB;AACvB,IAAI;AAEJ,+EAA+E;AAC/E,+EAA+E;AAE/E,sCAAsC;AACtC,kDAAkD;AAClD,kCAAkC;AAElC,8BAA8B;AAC9B,oCAAoC;AACpC,0CAA0C;AAC1C,uGAAuG;AACvG,kCAAkC;AAClC,4DAA4D;AAC5D,eAAe;AACf,8DAA8D;AAC9D,QAAQ;AACR,6BAA6B;AAC7B,wBAAwB;AACxB,mDAAmD;AACnD,oBAAoB;AACpB,QAAQ;AACR,OAAO;AACP,oBAAoB;AACpB,IAAI","sourcesContent":["// import raf from 'raf';\n// import getScroll from './getScroll';\n// import { easeInOutCubic } from './easings';\n\n// interface ScrollToOptions {\n// /** Scroll container, default as window */\n// getContainer?: () => HTMLElement | Window;\n// /** Scroll end callback */\n// callback?: () => any;\n// /** Animation duration, default as 450 */\n// duration?: number;\n// }\n\n// export default function scrollTo(y: number, options: ScrollToOptions = {}) {\n// const { getContainer = () => window, callback, duration = 450 } = options;\n\n// const container = getContainer();\n// const scrollTop = getScroll(container, true);\n// const startTime = Date.now();\n\n// const frameFunc = () => {\n// const timestamp = Date.now();\n// const time = timestamp - startTime;\n// const nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);\n// if (container === window) {\n// window.scrollTo(window.pageXOffset, nextScrollTop);\n// } else {\n// (container as HTMLElement).scrollTop = nextScrollTop;\n// }\n// if (time < duration) {\n// raf(frameFunc);\n// } else if (typeof callback === 'function') {\n// callback();\n// }\n// };\n// raf(frameFunc);\n// }\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styleChecker.d.ts","sourceRoot":"","sources":["../../../src/tntd-form/_util/styleChecker.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,eAAO,MAAM,gBAAgB,2BAAuD,CAAC;AAErF,OAAO,EAAE,cAAc,EAAE,CAAC;AAG1B,eAAO,MAAM,sBAAsB,eAyBlC,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.detectFlexGapSupported = exports.canUseDocElement = void 0;
|
|
7
|
-
Object.defineProperty(exports, "isStyleSupport", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function get() {
|
|
10
|
-
return _styleChecker.isStyleSupport;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
var _canUseDom = _interopRequireDefault(require("rc-util/lib/Dom/canUseDom"));
|
|
14
|
-
var _styleChecker = require("rc-util/lib/Dom/styleChecker");
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
|
-
var canUseDocElement = function canUseDocElement() {
|
|
17
|
-
return (0, _canUseDom["default"])() && window.document.documentElement;
|
|
18
|
-
};
|
|
19
|
-
exports.canUseDocElement = canUseDocElement;
|
|
20
|
-
var flexGapSupported;
|
|
21
|
-
var detectFlexGapSupported = function detectFlexGapSupported() {
|
|
22
|
-
if (!canUseDocElement()) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
if (flexGapSupported !== undefined) {
|
|
26
|
-
return flexGapSupported;
|
|
27
|
-
}
|
|
28
|
-
// create flex container with row-gap set
|
|
29
|
-
var flex = document.createElement('div');
|
|
30
|
-
flex.style.display = 'flex';
|
|
31
|
-
flex.style.flexDirection = 'column';
|
|
32
|
-
flex.style.rowGap = '1px';
|
|
33
|
-
// create two, elements inside it
|
|
34
|
-
flex.appendChild(document.createElement('div'));
|
|
35
|
-
flex.appendChild(document.createElement('div'));
|
|
36
|
-
// append to the DOM (needed to obtain scrollHeight)
|
|
37
|
-
document.body.appendChild(flex);
|
|
38
|
-
flexGapSupported = flex.scrollHeight === 1; // flex container should be 1px high from the row-gap
|
|
39
|
-
document.body.removeChild(flex);
|
|
40
|
-
return flexGapSupported;
|
|
41
|
-
};
|
|
42
|
-
exports.detectFlexGapSupported = detectFlexGapSupported;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styleChecker.js","sourceRoot":"","sources":["../../../src/tntd-form/_util/styleChecker.tsx"],"names":[],"mappings":";;;;;;AAAA,0EAAkD;AAClD,+DAA8D;AAIrD,+FAJA,6BAAc,OAIA;AAFhB,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,IAAA,mBAAS,GAAE,IAAI,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC;AAAxE,QAAA,gBAAgB,oBAAwD;AAIrF,IAAI,gBAAqC,CAAC;AACnC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,IAAI,CAAC,IAAA,wBAAgB,GAAE,EAAE;QACvB,OAAO,KAAK,CAAC;KACd;IAED,IAAI,gBAAgB,KAAK,SAAS,EAAE;QAClC,OAAO,gBAAgB,CAAC;KACzB;IAED,yCAAyC;IACzC,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;IAC5B,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,QAAQ,CAAC;IACpC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;IAE1B,iCAAiC;IACjC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IAChD,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IAEhD,oDAAoD;IACpD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,gBAAgB,GAAG,IAAI,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,qDAAqD;IACjG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAEhC,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAzBW,QAAA,sBAAsB,0BAyBjC","sourcesContent":["import canUseDom from 'rc-util/lib/Dom/canUseDom';\nimport { isStyleSupport } from 'rc-util/lib/Dom/styleChecker';\n\nexport const canUseDocElement = () => canUseDom() && window.document.documentElement;\n\nexport { isStyleSupport };\n\nlet flexGapSupported: boolean | undefined;\nexport const detectFlexGapSupported = () => {\n if (!canUseDocElement()) {\n return false;\n }\n\n if (flexGapSupported !== undefined) {\n return flexGapSupported;\n }\n\n // create flex container with row-gap set\n const flex = document.createElement('div');\n flex.style.display = 'flex';\n flex.style.flexDirection = 'column';\n flex.style.rowGap = '1px';\n\n // create two, elements inside it\n flex.appendChild(document.createElement('div'));\n flex.appendChild(document.createElement('div'));\n\n // append to the DOM (needed to obtain scrollHeight)\n document.body.appendChild(flex);\n flexGapSupported = flex.scrollHeight === 1; // flex container should be 1px high from the row-gap\n document.body.removeChild(flex);\n\n return flexGapSupported;\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/tntd-form/_util/type.ts"],"names":[],"mappings":"AAAA,oBAAY,IAAI,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAErE,eAAO,MAAM,KAAK,uCAA2C,CAAA;AAE7D,eAAO,MAAM,QAAQ,uCAA2C,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.tupleNum = exports.tuple = void 0;
|
|
7
|
-
// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead
|
|
8
|
-
var tuple = function tuple() {
|
|
9
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10
|
-
args[_key] = arguments[_key];
|
|
11
|
-
}
|
|
12
|
-
return args;
|
|
13
|
-
};
|
|
14
|
-
exports.tuple = tuple;
|
|
15
|
-
var tupleNum = function tupleNum() {
|
|
16
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
17
|
-
args[_key2] = arguments[_key2];
|
|
18
|
-
}
|
|
19
|
-
return args;
|
|
20
|
-
};
|
|
21
|
-
exports.tupleNum = tupleNum;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/tntd-form/_util/type.ts"],"names":[],"mappings":";;;AACA,qHAAqH;AAC9G,MAAM,KAAK,GAAG,CAAqB,GAAG,IAAO,EAAE,EAAE,CAAC,IAAI,CAAA;AAAhD,QAAA,KAAK,SAA2C;AAEtD,MAAM,QAAQ,GAAG,CAAqB,GAAG,IAAO,EAAE,EAAE,CAAC,IAAI,CAAA;AAAnD,QAAA,QAAQ,YAA2C","sourcesContent":["export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>\n// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead\nexport const tuple = <T extends string[]>(...args: T) => args\n\nexport const tupleNum = <T extends number[]>(...args: T) => args\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"warning.d.ts","sourceRoot":"","sources":["../../../src/tntd-form/_util/warning.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAE1D,OAAO,EAAE,WAAW,EAAE,CAAA;gCAEC,OAAO,aAAa,MAAM,WAAW,MAAM,KAAG,IAAI;AAAzE,wBAEC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
Object.defineProperty(exports, "resetWarned", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _warning.resetWarned;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
var _warning = _interopRequireWildcard(require("rc-util/lib/warning"));
|
|
15
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
var _default = function _default(valid, component, message) {
|
|
18
|
-
(0, _warning["default"])(valid, "[antd: ".concat(component, "] ").concat(message));
|
|
19
|
-
};
|
|
20
|
-
exports["default"] = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"warning.js","sourceRoot":"","sources":["../../../src/tntd-form/_util/warning.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAA0D;AAEjD,4FAFS,qBAAW,OAET;AAEpB,kBAAe,CAAC,KAAc,EAAE,SAAiB,EAAE,OAAe,EAAQ,EAAE;IAC1E,IAAA,iBAAO,EAAC,KAAK,EAAE,UAAU,SAAS,KAAK,OAAO,EAAE,CAAC,CAAA;AACnD,CAAC,CAAA","sourcesContent":["import warning, { resetWarned } from 'rc-util/lib/warning'\n\nexport { resetWarned }\n\nexport default (valid: boolean, component: string, message: string): void => {\n warning(valid, `[antd: ${component}] ${message}`)\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=wave.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wave.d.ts","sourceRoot":"","sources":["../../../src/tntd-form/_util/wave.tsx"],"names":[],"mappings":""}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// import * as React from 'react'
|
|
4
|
-
// import { findDOMNode } from 'react-dom'
|
|
5
|
-
// import TransitionEvents from 'css-animation/lib/Event'
|
|
6
|
-
// import raf from './raf'
|
|
7
|
-
// import { ConfigConsumer, ConfigConsumerProps, CSPConfig } from '../../config-provider'
|
|
8
|
-
// let styleForPesudo: HTMLStyleElement | null
|
|
9
|
-
// // Where el is the DOM element you'd like to test for visibility
|
|
10
|
-
// function isHidden(element: HTMLElement) {
|
|
11
|
-
// if (process.env.NODE_ENV === 'test') {
|
|
12
|
-
// return false
|
|
13
|
-
// }
|
|
14
|
-
// return !element || element.offsetParent === null
|
|
15
|
-
// }
|
|
16
|
-
// function isNotGrey(color: string) {
|
|
17
|
-
// // eslint-disable-next-line no-useless-escape
|
|
18
|
-
// const match = (color || '').match(/rgba?\((\d*), (\d*), (\d*)(, [\.\d]*)?\)/)
|
|
19
|
-
// if (match && match[1] && match[2] && match[3]) {
|
|
20
|
-
// return !(match[1] === match[2] && match[2] === match[3])
|
|
21
|
-
// }
|
|
22
|
-
// return true
|
|
23
|
-
// }
|
|
24
|
-
// export default class Wave extends React.Component<{ insertExtraNode?: boolean }> {
|
|
25
|
-
// private instance?: {
|
|
26
|
-
// cancel: () => void
|
|
27
|
-
// }
|
|
28
|
-
// private extraNode: HTMLDivElement
|
|
29
|
-
// private clickWaveTimeoutId: number
|
|
30
|
-
// private animationStartId: number
|
|
31
|
-
// private animationStart: boolean = false
|
|
32
|
-
// private destroy: boolean = false
|
|
33
|
-
// private csp?: CSPConfig
|
|
34
|
-
// componentDidMount() {
|
|
35
|
-
// const node = findDOMNode(this) as HTMLElement
|
|
36
|
-
// if (!node || node.nodeType !== 1) {
|
|
37
|
-
// return
|
|
38
|
-
// }
|
|
39
|
-
// this.instance = this.bindAnimationEvent(node)
|
|
40
|
-
// }
|
|
41
|
-
// componentWillUnmount() {
|
|
42
|
-
// if (this.instance) {
|
|
43
|
-
// this.instance.cancel()
|
|
44
|
-
// }
|
|
45
|
-
// if (this.clickWaveTimeoutId) {
|
|
46
|
-
// clearTimeout(this.clickWaveTimeoutId)
|
|
47
|
-
// }
|
|
48
|
-
// this.destroy = true
|
|
49
|
-
// }
|
|
50
|
-
// onClick = (node: HTMLElement, waveColor: string) => {
|
|
51
|
-
// if (!node || isHidden(node) || node.className.indexOf('-leave') >= 0) {
|
|
52
|
-
// return
|
|
53
|
-
// }
|
|
54
|
-
// const { insertExtraNode } = this.props
|
|
55
|
-
// this.extraNode = document.createElement('div')
|
|
56
|
-
// const { extraNode } = this
|
|
57
|
-
// extraNode.className = 'ant-click-animating-node'
|
|
58
|
-
// const attributeName = this.getAttributeName()
|
|
59
|
-
// node.setAttribute(attributeName, 'true')
|
|
60
|
-
// // Not white or transparnt or grey
|
|
61
|
-
// styleForPesudo = styleForPesudo || document.createElement('style')
|
|
62
|
-
// if (
|
|
63
|
-
// waveColor &&
|
|
64
|
-
// waveColor !== '#ffffff' &&
|
|
65
|
-
// waveColor !== 'rgb(255, 255, 255)' &&
|
|
66
|
-
// isNotGrey(waveColor) &&
|
|
67
|
-
// !/rgba\(\d*, \d*, \d*, 0\)/.test(waveColor) && // any transparent rgba color
|
|
68
|
-
// waveColor !== 'transparent'
|
|
69
|
-
// ) {
|
|
70
|
-
// // Add nonce if CSP exist
|
|
71
|
-
// if (this.csp && this.csp.nonce) {
|
|
72
|
-
// styleForPesudo.nonce = this.csp.nonce
|
|
73
|
-
// }
|
|
74
|
-
// extraNode.style.borderColor = waveColor
|
|
75
|
-
// styleForPesudo.innerHTML = `
|
|
76
|
-
// [ant-click-animating-without-extra-node='true']::after, .ant-click-animating-node {
|
|
77
|
-
// --antd-wave-shadow-color: ${waveColor};
|
|
78
|
-
// }`
|
|
79
|
-
// if (!document.body.contains(styleForPesudo)) {
|
|
80
|
-
// document.body.appendChild(styleForPesudo)
|
|
81
|
-
// }
|
|
82
|
-
// }
|
|
83
|
-
// if (insertExtraNode) {
|
|
84
|
-
// node.appendChild(extraNode)
|
|
85
|
-
// }
|
|
86
|
-
// TransitionEvents.addStartEventListener(node, this.onTransitionStart)
|
|
87
|
-
// TransitionEvents.addEndEventListener(node, this.onTransitionEnd)
|
|
88
|
-
// }
|
|
89
|
-
// onTransitionStart = (e: AnimationEvent) => {
|
|
90
|
-
// if (this.destroy) return
|
|
91
|
-
// const node = findDOMNode(this) as HTMLElement
|
|
92
|
-
// if (!e || e.target !== node) {
|
|
93
|
-
// return
|
|
94
|
-
// }
|
|
95
|
-
// if (!this.animationStart) {
|
|
96
|
-
// this.resetEffect(node)
|
|
97
|
-
// }
|
|
98
|
-
// }
|
|
99
|
-
// onTransitionEnd = (e: AnimationEvent) => {
|
|
100
|
-
// if (!e || e.animationName !== 'fadeEffect') {
|
|
101
|
-
// return
|
|
102
|
-
// }
|
|
103
|
-
// this.resetEffect(e.target as HTMLElement)
|
|
104
|
-
// }
|
|
105
|
-
// getAttributeName() {
|
|
106
|
-
// const { insertExtraNode } = this.props
|
|
107
|
-
// return insertExtraNode ? 'ant-click-animating' : 'ant-click-animating-without-extra-node'
|
|
108
|
-
// }
|
|
109
|
-
// bindAnimationEvent = (node: HTMLElement) => {
|
|
110
|
-
// if (
|
|
111
|
-
// !node ||
|
|
112
|
-
// !node.getAttribute ||
|
|
113
|
-
// node.getAttribute('disabled') ||
|
|
114
|
-
// node.className.indexOf('disabled') >= 0
|
|
115
|
-
// ) {
|
|
116
|
-
// return
|
|
117
|
-
// }
|
|
118
|
-
// const onClick = (e: MouseEvent) => {
|
|
119
|
-
// // Fix radio button click twice
|
|
120
|
-
// if ((e.target as HTMLElement).tagName === 'INPUT' || isHidden(e.target as HTMLElement)) {
|
|
121
|
-
// return
|
|
122
|
-
// }
|
|
123
|
-
// this.resetEffect(node)
|
|
124
|
-
// // Get wave color from target
|
|
125
|
-
// const waveColor =
|
|
126
|
-
// getComputedStyle(node).getPropertyValue('border-top-color') || // Firefox Compatible
|
|
127
|
-
// getComputedStyle(node).getPropertyValue('border-color') ||
|
|
128
|
-
// getComputedStyle(node).getPropertyValue('background-color')
|
|
129
|
-
// this.clickWaveTimeoutId = window.setTimeout(() => this.onClick(node, waveColor), 0)
|
|
130
|
-
// raf.cancel(this.animationStartId)
|
|
131
|
-
// this.animationStart = true
|
|
132
|
-
// // Render to trigger transition event cost 3 frames. Let's delay 10 frames to reset this.
|
|
133
|
-
// this.animationStartId = raf(() => {
|
|
134
|
-
// this.animationStart = false
|
|
135
|
-
// }, 10)
|
|
136
|
-
// }
|
|
137
|
-
// node.addEventListener('click', onClick, true)
|
|
138
|
-
// return {
|
|
139
|
-
// cancel: () => {
|
|
140
|
-
// node.removeEventListener('click', onClick, true)
|
|
141
|
-
// },
|
|
142
|
-
// }
|
|
143
|
-
// }
|
|
144
|
-
// resetEffect(node: HTMLElement) {
|
|
145
|
-
// if (!node || node === this.extraNode || !(node instanceof Element)) {
|
|
146
|
-
// return
|
|
147
|
-
// }
|
|
148
|
-
// const { insertExtraNode } = this.props
|
|
149
|
-
// const attributeName = this.getAttributeName()
|
|
150
|
-
// node.setAttribute(attributeName, 'false') // edge has bug on `removeAttribute` #14466
|
|
151
|
-
// if (styleForPesudo) {
|
|
152
|
-
// styleForPesudo.innerHTML = ''
|
|
153
|
-
// }
|
|
154
|
-
// if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) {
|
|
155
|
-
// node.removeChild(this.extraNode)
|
|
156
|
-
// }
|
|
157
|
-
// TransitionEvents.removeStartEventListener(node, this.onTransitionStart)
|
|
158
|
-
// TransitionEvents.removeEndEventListener(node, this.onTransitionEnd)
|
|
159
|
-
// }
|
|
160
|
-
// renderWave = ({ csp }: ConfigConsumerProps) => {
|
|
161
|
-
// const { children } = this.props
|
|
162
|
-
// this.csp = csp
|
|
163
|
-
// return children
|
|
164
|
-
// }
|
|
165
|
-
// render() {
|
|
166
|
-
// return <ConfigConsumer>{this.renderWave}</ConfigConsumer>
|
|
167
|
-
// }
|
|
168
|
-
// }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wave.js","sourceRoot":"","sources":["../../../src/tntd-form/_util/wave.tsx"],"names":[],"mappings":"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","sourcesContent":["// import * as React from 'react'\n// import { findDOMNode } from 'react-dom'\n// import TransitionEvents from 'css-animation/lib/Event'\n// import raf from './raf'\n// import { ConfigConsumer, ConfigConsumerProps, CSPConfig } from '../../config-provider'\n\n// let styleForPesudo: HTMLStyleElement | null\n\n// // Where el is the DOM element you'd like to test for visibility\n// function isHidden(element: HTMLElement) {\n// if (process.env.NODE_ENV === 'test') {\n// return false\n// }\n// return !element || element.offsetParent === null\n// }\n\n// function isNotGrey(color: string) {\n// // eslint-disable-next-line no-useless-escape\n// const match = (color || '').match(/rgba?\\((\\d*), (\\d*), (\\d*)(, [\\.\\d]*)?\\)/)\n// if (match && match[1] && match[2] && match[3]) {\n// return !(match[1] === match[2] && match[2] === match[3])\n// }\n// return true\n// }\n\n// export default class Wave extends React.Component<{ insertExtraNode?: boolean }> {\n// private instance?: {\n// cancel: () => void\n// }\n\n// private extraNode: HTMLDivElement\n\n// private clickWaveTimeoutId: number\n\n// private animationStartId: number\n\n// private animationStart: boolean = false\n\n// private destroy: boolean = false\n\n// private csp?: CSPConfig\n\n// componentDidMount() {\n// const node = findDOMNode(this) as HTMLElement\n// if (!node || node.nodeType !== 1) {\n// return\n// }\n// this.instance = this.bindAnimationEvent(node)\n// }\n\n// componentWillUnmount() {\n// if (this.instance) {\n// this.instance.cancel()\n// }\n// if (this.clickWaveTimeoutId) {\n// clearTimeout(this.clickWaveTimeoutId)\n// }\n\n// this.destroy = true\n// }\n\n// onClick = (node: HTMLElement, waveColor: string) => {\n// if (!node || isHidden(node) || node.className.indexOf('-leave') >= 0) {\n// return\n// }\n// const { insertExtraNode } = this.props\n// this.extraNode = document.createElement('div')\n// const { extraNode } = this\n// extraNode.className = 'ant-click-animating-node'\n// const attributeName = this.getAttributeName()\n// node.setAttribute(attributeName, 'true')\n// // Not white or transparnt or grey\n// styleForPesudo = styleForPesudo || document.createElement('style')\n// if (\n// waveColor &&\n// waveColor !== '#ffffff' &&\n// waveColor !== 'rgb(255, 255, 255)' &&\n// isNotGrey(waveColor) &&\n// !/rgba\\(\\d*, \\d*, \\d*, 0\\)/.test(waveColor) && // any transparent rgba color\n// waveColor !== 'transparent'\n// ) {\n// // Add nonce if CSP exist\n// if (this.csp && this.csp.nonce) {\n// styleForPesudo.nonce = this.csp.nonce\n// }\n\n// extraNode.style.borderColor = waveColor\n// styleForPesudo.innerHTML = `\n// [ant-click-animating-without-extra-node='true']::after, .ant-click-animating-node {\n// --antd-wave-shadow-color: ${waveColor};\n// }`\n// if (!document.body.contains(styleForPesudo)) {\n// document.body.appendChild(styleForPesudo)\n// }\n// }\n// if (insertExtraNode) {\n// node.appendChild(extraNode)\n// }\n// TransitionEvents.addStartEventListener(node, this.onTransitionStart)\n// TransitionEvents.addEndEventListener(node, this.onTransitionEnd)\n// }\n\n// onTransitionStart = (e: AnimationEvent) => {\n// if (this.destroy) return\n\n// const node = findDOMNode(this) as HTMLElement\n// if (!e || e.target !== node) {\n// return\n// }\n\n// if (!this.animationStart) {\n// this.resetEffect(node)\n// }\n// }\n\n// onTransitionEnd = (e: AnimationEvent) => {\n// if (!e || e.animationName !== 'fadeEffect') {\n// return\n// }\n// this.resetEffect(e.target as HTMLElement)\n// }\n\n// getAttributeName() {\n// const { insertExtraNode } = this.props\n// return insertExtraNode ? 'ant-click-animating' : 'ant-click-animating-without-extra-node'\n// }\n\n// bindAnimationEvent = (node: HTMLElement) => {\n// if (\n// !node ||\n// !node.getAttribute ||\n// node.getAttribute('disabled') ||\n// node.className.indexOf('disabled') >= 0\n// ) {\n// return\n// }\n// const onClick = (e: MouseEvent) => {\n// // Fix radio button click twice\n// if ((e.target as HTMLElement).tagName === 'INPUT' || isHidden(e.target as HTMLElement)) {\n// return\n// }\n// this.resetEffect(node)\n// // Get wave color from target\n// const waveColor =\n// getComputedStyle(node).getPropertyValue('border-top-color') || // Firefox Compatible\n// getComputedStyle(node).getPropertyValue('border-color') ||\n// getComputedStyle(node).getPropertyValue('background-color')\n// this.clickWaveTimeoutId = window.setTimeout(() => this.onClick(node, waveColor), 0)\n\n// raf.cancel(this.animationStartId)\n// this.animationStart = true\n\n// // Render to trigger transition event cost 3 frames. Let's delay 10 frames to reset this.\n// this.animationStartId = raf(() => {\n// this.animationStart = false\n// }, 10)\n// }\n// node.addEventListener('click', onClick, true)\n// return {\n// cancel: () => {\n// node.removeEventListener('click', onClick, true)\n// },\n// }\n// }\n\n// resetEffect(node: HTMLElement) {\n// if (!node || node === this.extraNode || !(node instanceof Element)) {\n// return\n// }\n// const { insertExtraNode } = this.props\n// const attributeName = this.getAttributeName()\n// node.setAttribute(attributeName, 'false') // edge has bug on `removeAttribute` #14466\n\n// if (styleForPesudo) {\n// styleForPesudo.innerHTML = ''\n// }\n\n// if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) {\n// node.removeChild(this.extraNode)\n// }\n// TransitionEvents.removeStartEventListener(node, this.onTransitionStart)\n// TransitionEvents.removeEndEventListener(node, this.onTransitionEnd)\n// }\n\n// renderWave = ({ csp }: ConfigConsumerProps) => {\n// const { children } = this.props\n// this.csp = csp\n\n// return children\n// }\n\n// render() {\n// return <ConfigConsumer>{this.renderWave}</ConfigConsumer>\n// }\n// }\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Context } from 'react';
|
|
2
|
-
export interface RowContextState {
|
|
3
|
-
gutter?: [number, number];
|
|
4
|
-
wrap?: boolean;
|
|
5
|
-
supportFlexGap?: boolean;
|
|
6
|
-
}
|
|
7
|
-
declare const RowContext: Context<RowContextState>;
|
|
8
|
-
export default RowContext;
|
|
9
|
-
//# sourceMappingURL=RowContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RowContext.d.ts","sourceRoot":"","sources":["../../../src/tntd-form/grid/RowContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGrC,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,UAAU,EAAE,OAAO,CAAC,eAAe,CAAqB,CAAC;AAE/D,eAAe,UAAU,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var RowContext = (0, _react.createContext)({});
|
|
9
|
-
var _default = RowContext;
|
|
10
|
-
exports["default"] = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RowContext.js","sourceRoot":"","sources":["../../../src/tntd-form/grid/RowContext.tsx"],"names":[],"mappings":";;AACA,iCAAsC;AAQtC,MAAM,UAAU,GAA6B,IAAA,qBAAa,EAAC,EAAE,CAAC,CAAC;AAE/D,kBAAe,UAAU,CAAC","sourcesContent":["import type { Context } from 'react';\nimport { createContext } from 'react';\n\nexport interface RowContextState {\n gutter?: [number, number];\n wrap?: boolean;\n supportFlexGap?: boolean;\n}\n\nconst RowContext: Context<RowContextState> = createContext({});\n\nexport default RowContext;\n"]}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
declare type ColSpanType = number | string;
|
|
3
|
-
declare type FlexType = number | 'none' | 'auto' | string;
|
|
4
|
-
export interface ColSize {
|
|
5
|
-
flex?: FlexType;
|
|
6
|
-
span?: ColSpanType;
|
|
7
|
-
order?: ColSpanType;
|
|
8
|
-
offset?: ColSpanType;
|
|
9
|
-
push?: ColSpanType;
|
|
10
|
-
pull?: ColSpanType;
|
|
11
|
-
}
|
|
12
|
-
export interface ColProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
|
-
flex?: FlexType;
|
|
14
|
-
span?: ColSpanType;
|
|
15
|
-
order?: ColSpanType;
|
|
16
|
-
offset?: ColSpanType;
|
|
17
|
-
push?: ColSpanType;
|
|
18
|
-
pull?: ColSpanType;
|
|
19
|
-
xs?: ColSpanType | ColSize;
|
|
20
|
-
sm?: ColSpanType | ColSize;
|
|
21
|
-
md?: ColSpanType | ColSize;
|
|
22
|
-
lg?: ColSpanType | ColSize;
|
|
23
|
-
xl?: ColSpanType | ColSize;
|
|
24
|
-
xxl?: ColSpanType | ColSize;
|
|
25
|
-
prefixCls?: string;
|
|
26
|
-
}
|
|
27
|
-
declare const Col: React.ForwardRefExoticComponent<ColProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
-
export default Col;
|
|
29
|
-
//# sourceMappingURL=col.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"col.d.ts","sourceRoot":"","sources":["../../../src/tntd-form/grid/col.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,aAAK,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnC,aAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAElD,MAAM,WAAW,OAAO;IACtB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,MAAM,WAAW,QAAS,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpE,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IAC3B,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IAC3B,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IAC3B,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IAC3B,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IAC3B,GAAG,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAcD,QAAA,MAAM,GAAG,iFAuFP,CAAC;AAMH,eAAe,GAAG,CAAC"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _context = require("../_util/context");
|
|
10
|
-
var _RowContext = _interopRequireDefault(require("./RowContext"));
|
|
11
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
17
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
18
|
-
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
19
|
-
var t = {};
|
|
20
|
-
for (var p in s) {
|
|
21
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
24
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
25
|
-
}
|
|
26
|
-
return t;
|
|
27
|
-
};
|
|
28
|
-
function parseFlex(flex) {
|
|
29
|
-
if (typeof flex === 'number') {
|
|
30
|
-
return "".concat(flex, " ").concat(flex, " auto");
|
|
31
|
-
}
|
|
32
|
-
if (/^\d+(\.\d+)?(px|em|rem|%)$/.test(flex)) {
|
|
33
|
-
return "0 0 ".concat(flex);
|
|
34
|
-
}
|
|
35
|
-
return flex;
|
|
36
|
-
}
|
|
37
|
-
var sizes = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
|
|
38
|
-
var Col = React.forwardRef(function (props, ref) {
|
|
39
|
-
var _classNames;
|
|
40
|
-
var _React$useContext = React.useContext(_context.ConfigContext),
|
|
41
|
-
getPrefixCls = _React$useContext.getPrefixCls,
|
|
42
|
-
direction = _React$useContext.direction;
|
|
43
|
-
var _React$useContext2 = React.useContext(_RowContext["default"]),
|
|
44
|
-
gutter = _React$useContext2.gutter,
|
|
45
|
-
wrap = _React$useContext2.wrap,
|
|
46
|
-
supportFlexGap = _React$useContext2.supportFlexGap;
|
|
47
|
-
var _props$prefixCls = props.prefixCls,
|
|
48
|
-
customizePrefixCls = _props$prefixCls === void 0 ? 'tnt-col' : _props$prefixCls,
|
|
49
|
-
span = props.span,
|
|
50
|
-
order = props.order,
|
|
51
|
-
offset = props.offset,
|
|
52
|
-
push = props.push,
|
|
53
|
-
pull = props.pull,
|
|
54
|
-
className = props.className,
|
|
55
|
-
children = props.children,
|
|
56
|
-
flex = props.flex,
|
|
57
|
-
style = props.style,
|
|
58
|
-
others = __rest(props, ["prefixCls", "span", "order", "offset", "push", "pull", "className", "children", "flex", "style"]);
|
|
59
|
-
var prefixCls = getPrefixCls('col', customizePrefixCls);
|
|
60
|
-
var sizeClassObj = {};
|
|
61
|
-
sizes.forEach(function (size) {
|
|
62
|
-
var _Object$assign;
|
|
63
|
-
var sizeProps = {};
|
|
64
|
-
var propSize = props[size];
|
|
65
|
-
if (typeof propSize === 'number') {
|
|
66
|
-
sizeProps.span = propSize;
|
|
67
|
-
} else if (_typeof(propSize) === 'object') {
|
|
68
|
-
sizeProps = propSize || {};
|
|
69
|
-
}
|
|
70
|
-
delete others[size];
|
|
71
|
-
sizeClassObj = Object.assign(Object.assign({}, sizeClassObj), (_Object$assign = {}, _defineProperty(_Object$assign, "".concat(prefixCls, "-").concat(size, "-").concat(sizeProps.span), sizeProps.span !== undefined), _defineProperty(_Object$assign, "".concat(prefixCls, "-").concat(size, "-order-").concat(sizeProps.order), sizeProps.order || sizeProps.order === 0), _defineProperty(_Object$assign, "".concat(prefixCls, "-").concat(size, "-offset-").concat(sizeProps.offset), sizeProps.offset || sizeProps.offset === 0), _defineProperty(_Object$assign, "".concat(prefixCls, "-").concat(size, "-push-").concat(sizeProps.push), sizeProps.push || sizeProps.push === 0), _defineProperty(_Object$assign, "".concat(prefixCls, "-").concat(size, "-pull-").concat(sizeProps.pull), sizeProps.pull || sizeProps.pull === 0), _defineProperty(_Object$assign, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _Object$assign));
|
|
72
|
-
});
|
|
73
|
-
var classes = (0, _classnames["default"])(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(span), span !== undefined), _defineProperty(_classNames, "".concat(prefixCls, "-order-").concat(order), order), _defineProperty(_classNames, "".concat(prefixCls, "-offset-").concat(offset), offset), _defineProperty(_classNames, "".concat(prefixCls, "-push-").concat(push), push), _defineProperty(_classNames, "".concat(prefixCls, "-pull-").concat(pull), pull), _classNames), className, sizeClassObj);
|
|
74
|
-
var mergedStyle = {};
|
|
75
|
-
// Horizontal gutter use padding
|
|
76
|
-
if (gutter && gutter[0] > 0) {
|
|
77
|
-
var horizontalGutter = gutter[0] / 2;
|
|
78
|
-
mergedStyle.paddingLeft = horizontalGutter;
|
|
79
|
-
mergedStyle.paddingRight = horizontalGutter;
|
|
80
|
-
}
|
|
81
|
-
// Vertical gutter use padding when gap not support
|
|
82
|
-
if (gutter && gutter[1] > 0 && !supportFlexGap) {
|
|
83
|
-
var verticalGutter = gutter[1] / 2;
|
|
84
|
-
mergedStyle.paddingTop = verticalGutter;
|
|
85
|
-
mergedStyle.paddingBottom = verticalGutter;
|
|
86
|
-
}
|
|
87
|
-
if (flex) {
|
|
88
|
-
mergedStyle.flex = parseFlex(flex);
|
|
89
|
-
// Hack for Firefox to avoid size issue
|
|
90
|
-
// https://github.com/ant-design/ant-design/pull/20023#issuecomment-564389553
|
|
91
|
-
if (wrap === false && !mergedStyle.minWidth) {
|
|
92
|
-
mergedStyle.minWidth = 0;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return React.createElement("div", Object.assign({}, others, {
|
|
96
|
-
style: Object.assign(Object.assign({}, mergedStyle), style),
|
|
97
|
-
className: classes,
|
|
98
|
-
ref: ref
|
|
99
|
-
}), children);
|
|
100
|
-
});
|
|
101
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
102
|
-
Col.displayName = 'Col';
|
|
103
|
-
}
|
|
104
|
-
var _default = Col;
|
|
105
|
-
exports["default"] = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"col.js","sourceRoot":"","sources":["../../../src/tntd-form/grid/col.tsx"],"names":[],"mappings":"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","sourcesContent":["import classNames from 'classnames';\nimport * as React from 'react';\n// import { ConfigContext } from '../../config-provider';\nimport { ConfigContext } from '../_util/context'\nimport RowContext from './RowContext';\n\n// https://github.com/ant-design/ant-design/issues/14324\ntype ColSpanType = number | string;\n\ntype FlexType = number | 'none' | 'auto' | string;\n\nexport interface ColSize {\n flex?: FlexType;\n span?: ColSpanType;\n order?: ColSpanType;\n offset?: ColSpanType;\n push?: ColSpanType;\n pull?: ColSpanType;\n}\n\nexport interface ColProps extends React.HTMLAttributes<HTMLDivElement> {\n flex?: FlexType;\n span?: ColSpanType;\n order?: ColSpanType;\n offset?: ColSpanType;\n push?: ColSpanType;\n pull?: ColSpanType;\n xs?: ColSpanType | ColSize;\n sm?: ColSpanType | ColSize;\n md?: ColSpanType | ColSize;\n lg?: ColSpanType | ColSize;\n xl?: ColSpanType | ColSize;\n xxl?: ColSpanType | ColSize;\n prefixCls?: string;\n}\n\nfunction parseFlex(flex: FlexType): string {\n if (typeof flex === 'number') {\n return `${flex} ${flex} auto`;\n }\n\n if (/^\\d+(\\.\\d+)?(px|em|rem|%)$/.test(flex)) {\n return `0 0 ${flex}`;\n }\n\n return flex;\n}\nconst sizes = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'] as const;\nconst Col = React.forwardRef<HTMLDivElement, ColProps>((props, ref) => {\n const { getPrefixCls, direction } = React.useContext(ConfigContext);\n const { gutter, wrap, supportFlexGap } = React.useContext(RowContext);\n\n const {\n prefixCls: customizePrefixCls='tnt-col',\n span,\n order,\n offset,\n push,\n pull,\n className,\n children,\n flex,\n style,\n ...others\n } = props;\n\n const prefixCls = getPrefixCls('col', customizePrefixCls);\n\n let sizeClassObj = {};\n sizes.forEach(size => {\n let sizeProps: ColSize = {};\n const propSize = props[size];\n if (typeof propSize === 'number') {\n sizeProps.span = propSize;\n } else if (typeof propSize === 'object') {\n sizeProps = propSize || {};\n }\n\n delete others[size];\n\n sizeClassObj = {\n ...sizeClassObj,\n [`${prefixCls}-${size}-${sizeProps.span}`]: sizeProps.span !== undefined,\n [`${prefixCls}-${size}-order-${sizeProps.order}`]: sizeProps.order || sizeProps.order === 0,\n [`${prefixCls}-${size}-offset-${sizeProps.offset}`]:\n sizeProps.offset || sizeProps.offset === 0,\n [`${prefixCls}-${size}-push-${sizeProps.push}`]: sizeProps.push || sizeProps.push === 0,\n [`${prefixCls}-${size}-pull-${sizeProps.pull}`]: sizeProps.pull || sizeProps.pull === 0,\n [`${prefixCls}-rtl`]: direction === 'rtl',\n };\n });\n\n const classes = classNames(\n prefixCls,\n {\n [`${prefixCls}-${span}`]: span !== undefined,\n [`${prefixCls}-order-${order}`]: order,\n [`${prefixCls}-offset-${offset}`]: offset,\n [`${prefixCls}-push-${push}`]: push,\n [`${prefixCls}-pull-${pull}`]: pull,\n },\n className,\n sizeClassObj,\n );\n\n const mergedStyle: React.CSSProperties = {};\n // Horizontal gutter use padding\n if (gutter && gutter[0] > 0) {\n const horizontalGutter = gutter[0] / 2;\n mergedStyle.paddingLeft = horizontalGutter;\n mergedStyle.paddingRight = horizontalGutter;\n }\n\n // Vertical gutter use padding when gap not support\n if (gutter && gutter[1] > 0 && !supportFlexGap) {\n const verticalGutter = gutter[1] / 2;\n mergedStyle.paddingTop = verticalGutter;\n mergedStyle.paddingBottom = verticalGutter;\n }\n\n if (flex) {\n mergedStyle.flex = parseFlex(flex);\n\n // Hack for Firefox to avoid size issue\n // https://github.com/ant-design/ant-design/pull/20023#issuecomment-564389553\n if (wrap === false && !mergedStyle.minWidth) {\n mergedStyle.minWidth = 0;\n }\n }\n\n return (\n <div {...others} style={{ ...mergedStyle, ...style }} className={classes} ref={ref}>\n {children}\n </div>\n );\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Col.displayName = 'Col';\n}\n\nexport default Col;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBreakpoint.d.ts","sourceRoot":"","sources":["../../../../src/tntd-form/grid/hooks/useBreakpoint.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAG/D,iBAAS,aAAa,CAAC,eAAe,GAAE,OAAc,GAAG,SAAS,CAgBjE;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _useForceUpdate = _interopRequireDefault(require("../../_util/hooks/useForceUpdate"));
|
|
9
|
-
var _responsiveObserve = _interopRequireDefault(require("../../_util/responsiveObserve"));
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
function useBreakpoint() {
|
|
12
|
-
var refreshOnChange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
13
|
-
var screensRef = (0, _react.useRef)({});
|
|
14
|
-
var forceUpdate = (0, _useForceUpdate["default"])();
|
|
15
|
-
(0, _react.useEffect)(function () {
|
|
16
|
-
var token = _responsiveObserve["default"].subscribe(function (supportScreens) {
|
|
17
|
-
screensRef.current = supportScreens;
|
|
18
|
-
if (refreshOnChange) {
|
|
19
|
-
forceUpdate();
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
return function () {
|
|
23
|
-
return _responsiveObserve["default"].unsubscribe(token);
|
|
24
|
-
};
|
|
25
|
-
}, []);
|
|
26
|
-
return screensRef.current;
|
|
27
|
-
}
|
|
28
|
-
var _default = useBreakpoint;
|
|
29
|
-
exports["default"] = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBreakpoint.js","sourceRoot":"","sources":["../../../../src/tntd-form/grid/hooks/useBreakpoint.tsx"],"names":[],"mappings":";;;;;AAAA,iCAA0C;AAC1C,sFAA8D;AAE9D,sFAA8D;AAE9D,SAAS,aAAa,CAAC,kBAA2B,IAAI;IACpD,MAAM,UAAU,GAAG,IAAA,cAAM,EAAY,EAAE,CAAC,CAAC;IACzC,MAAM,WAAW,GAAG,IAAA,wBAAc,GAAE,CAAC;IAErC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,2BAAiB,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE;YACzD,UAAU,CAAC,OAAO,GAAG,cAAc,CAAC;YACpC,IAAI,eAAe,EAAE;gBACnB,WAAW,EAAE,CAAC;aACf;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE,CAAC,2BAAiB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,UAAU,CAAC,OAAO,CAAC;AAC5B,CAAC;AAED,kBAAe,aAAa,CAAC","sourcesContent":["import { useEffect, useRef } from 'react';\nimport useForceUpdate from '../../_util/hooks/useForceUpdate';\nimport type { ScreenMap } from '../../_util/responsiveObserve';\nimport ResponsiveObserve from '../../_util/responsiveObserve';\n\nfunction useBreakpoint(refreshOnChange: boolean = true): ScreenMap {\n const screensRef = useRef<ScreenMap>({});\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n const token = ResponsiveObserve.subscribe(supportScreens => {\n screensRef.current = supportScreens;\n if (refreshOnChange) {\n forceUpdate();\n }\n });\n\n return () => ResponsiveObserve.unsubscribe(token);\n }, []);\n\n return screensRef.current;\n}\n\nexport default useBreakpoint;\n"]}
|