tntd 2.7.28 → 2.7.29-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.
Files changed (167) hide show
  1. package/es/_util/context.js +14 -0
  2. package/es/_util/context.js.map +1 -0
  3. package/es/_util/defaultRenderEmpty.js +20 -0
  4. package/es/_util/defaultRenderEmpty.js.map +1 -0
  5. package/es/_util/hooks/useFlexGapSupport.js +10 -0
  6. package/es/_util/hooks/useFlexGapSupport.js.map +1 -0
  7. package/es/_util/hooks/useForceUpdate.js +6 -0
  8. package/es/_util/hooks/useForceUpdate.js.map +1 -0
  9. package/es/_util/motion.js +22 -0
  10. package/es/_util/motion.js.map +1 -1
  11. package/es/_util/reactNode.js +15 -0
  12. package/es/_util/reactNode.js.map +1 -0
  13. package/es/_util/responsiveObserve.js +58 -0
  14. package/es/_util/responsiveObserve.js.map +1 -0
  15. package/es/_util/styleChecker.js +27 -0
  16. package/es/_util/styleChecker.js.map +1 -0
  17. package/es/_util/type.js.map +1 -1
  18. package/es/_util/warning.js.map +1 -1
  19. package/es/grid/RowContext.js +4 -0
  20. package/es/grid/RowContext.js.map +1 -0
  21. package/es/grid/col.js +78 -0
  22. package/es/grid/col.js.map +1 -0
  23. package/es/grid/hooks/useBreakpoint.js +19 -0
  24. package/es/grid/hooks/useBreakpoint.js.map +1 -0
  25. package/es/grid/index.js +13 -0
  26. package/es/grid/index.js.map +1 -0
  27. package/es/grid/row.js +141 -0
  28. package/es/grid/row.js.map +1 -0
  29. package/es/grid/style/index.js +3 -0
  30. package/es/grid/style/index.js.map +1 -0
  31. package/es/grid/style/index.less +124 -0
  32. package/es/grid/style/mixin.less +57 -0
  33. package/es/grid/style/rtl.less +69 -0
  34. package/es/index.js +2 -0
  35. package/es/index.js.map +1 -1
  36. package/es/tntd-form/ErrorList.js +1 -1
  37. package/es/tntd-form/ErrorList.js.map +1 -1
  38. package/es/tntd-form/FormItem/ItemHolder.js +1 -1
  39. package/es/tntd-form/FormItem/ItemHolder.js.map +1 -1
  40. package/es/tntd-form/FormItem/index.js +3 -3
  41. package/es/tntd-form/FormItem/index.js.map +1 -1
  42. package/es/tntd-form/FormItemInput.js +1 -1
  43. package/es/tntd-form/FormItemInput.js.map +1 -1
  44. package/es/tntd-form/FormItemLabel.js +1 -1
  45. package/es/tntd-form/FormItemLabel.js.map +1 -1
  46. package/es/tntd-form/FormList.js +1 -1
  47. package/es/tntd-form/FormList.js.map +1 -1
  48. package/es/tntd-form/hooks/useFormItemStatus.js +1 -1
  49. package/es/tntd-form/hooks/useFormItemStatus.js.map +1 -1
  50. package/es/tntd-form/index.js +0 -1
  51. package/es/tntd-form/index.js.map +1 -1
  52. package/lib/_util/context.d.ts +42 -0
  53. package/lib/_util/context.d.ts.map +1 -0
  54. package/lib/_util/context.js +20 -0
  55. package/lib/_util/context.js.map +1 -0
  56. package/lib/_util/defaultRenderEmpty.d.ts +5 -0
  57. package/lib/_util/defaultRenderEmpty.d.ts.map +1 -0
  58. package/lib/_util/defaultRenderEmpty.js +48 -0
  59. package/lib/_util/defaultRenderEmpty.js.map +1 -0
  60. package/lib/_util/hooks/useFlexGapSupport.d.ts +3 -0
  61. package/lib/_util/hooks/useFlexGapSupport.d.ts.map +1 -0
  62. package/lib/_util/hooks/useFlexGapSupport.js +35 -0
  63. package/lib/_util/hooks/useFlexGapSupport.js.map +1 -0
  64. package/lib/_util/hooks/useForceUpdate.d.ts +3 -0
  65. package/lib/_util/hooks/useForceUpdate.d.ts.map +1 -0
  66. package/lib/_util/hooks/useForceUpdate.js +32 -0
  67. package/lib/_util/hooks/useForceUpdate.js.map +1 -0
  68. package/lib/_util/motion.d.ts +3 -0
  69. package/lib/_util/motion.d.ts.map +1 -1
  70. package/lib/_util/motion.js +22 -0
  71. package/lib/_util/motion.js.map +1 -1
  72. package/lib/_util/reactNode.d.ts +9 -0
  73. package/lib/_util/reactNode.d.ts.map +1 -0
  74. package/lib/_util/reactNode.js +44 -0
  75. package/lib/_util/reactNode.js.map +1 -0
  76. package/lib/_util/responsiveObserve.d.ts +22 -0
  77. package/lib/_util/responsiveObserve.d.ts.map +1 -0
  78. package/lib/_util/responsiveObserve.js +61 -0
  79. package/lib/_util/responsiveObserve.js.map +1 -0
  80. package/lib/_util/styleChecker.d.ts +5 -0
  81. package/lib/_util/styleChecker.d.ts.map +1 -0
  82. package/lib/_util/styleChecker.js +35 -0
  83. package/lib/_util/styleChecker.js.map +1 -0
  84. package/lib/_util/type.d.ts.map +1 -1
  85. package/lib/_util/type.js.map +1 -1
  86. package/lib/_util/warning.d.ts.map +1 -1
  87. package/lib/_util/warning.js.map +1 -1
  88. package/lib/checkbox/checkbox-group.d.ts +1 -1
  89. package/lib/descriptions/descriptions.d.ts +1 -1
  90. package/lib/descriptions/descriptions.d.ts.map +1 -1
  91. package/lib/grid/RowContext.d.ts +9 -0
  92. package/lib/grid/RowContext.d.ts.map +1 -0
  93. package/lib/grid/RowContext.js +6 -0
  94. package/lib/grid/RowContext.js.map +1 -0
  95. package/lib/grid/col.d.ts +29 -0
  96. package/lib/grid/col.d.ts.map +1 -0
  97. package/lib/grid/col.js +106 -0
  98. package/lib/grid/col.js.map +1 -0
  99. package/lib/grid/hooks/useBreakpoint.d.ts +4 -0
  100. package/lib/grid/hooks/useBreakpoint.d.ts.map +1 -0
  101. package/lib/grid/hooks/useBreakpoint.js +24 -0
  102. package/lib/grid/hooks/useBreakpoint.js.map +1 -0
  103. package/lib/grid/index.d.ts +12 -0
  104. package/lib/grid/index.d.ts.map +1 -0
  105. package/lib/grid/index.js +20 -0
  106. package/lib/grid/index.js.map +1 -0
  107. package/lib/grid/row.d.ts +21 -0
  108. package/lib/grid/row.d.ts.map +1 -0
  109. package/lib/grid/row.js +169 -0
  110. package/lib/grid/row.js.map +1 -0
  111. package/lib/grid/style/index.d.ts +2 -0
  112. package/lib/grid/style/index.d.ts.map +1 -0
  113. package/lib/grid/style/index.js +5 -0
  114. package/lib/grid/style/index.js.map +1 -0
  115. package/lib/grid/style/index.less +124 -0
  116. package/lib/grid/style/mixin.less +57 -0
  117. package/lib/grid/style/rtl.less +69 -0
  118. package/lib/index.d.ts +2 -0
  119. package/lib/index.d.ts.map +1 -1
  120. package/lib/index.js +5 -1
  121. package/lib/index.js.map +1 -1
  122. package/lib/input/input.d.ts +4 -4
  123. package/lib/input/input.d.ts.map +1 -1
  124. package/lib/input-number/index.d.ts +1 -1
  125. package/lib/query-form/Field/fieldsMap.d.ts +3 -3
  126. package/lib/radio/radio-group.d.ts +1 -1
  127. package/lib/segmented/index.d.ts +1 -1
  128. package/lib/segmented/index.d.ts.map +1 -1
  129. package/lib/svg-components/illustration-403.d.ts +1 -1
  130. package/lib/svg-components/illustration-404.d.ts +1 -1
  131. package/lib/svg-components/illustration-500.d.ts +1 -1
  132. package/lib/svg-components/illustration-empty.d.ts +1 -1
  133. package/lib/svg-components/illustration-failure.d.ts +1 -1
  134. package/lib/svg-components/illustration-no-access.d.ts +1 -1
  135. package/lib/svg-components/illustration-no-chart.d.ts +1 -1
  136. package/lib/svg-components/illustration-no-result.d.ts +1 -1
  137. package/lib/svg-components/illustration-offline.d.ts +1 -1
  138. package/lib/svg-components/illustration-success.d.ts +1 -1
  139. package/lib/table/assets/image-loading-background.d.ts +1 -1
  140. package/lib/table/assets/image-loading.d.ts +1 -1
  141. package/lib/time-picker/index.d.ts +1 -1
  142. package/lib/tntd-cascader/AntdCascader/config/utils.d.ts +1 -1
  143. package/lib/tntd-form/ErrorList.js +1 -1
  144. package/lib/tntd-form/ErrorList.js.map +1 -1
  145. package/lib/tntd-form/FormItem/ItemHolder.js +2 -2
  146. package/lib/tntd-form/FormItem/ItemHolder.js.map +1 -1
  147. package/lib/tntd-form/FormItem/index.js +3 -3
  148. package/lib/tntd-form/FormItem/index.js.map +1 -1
  149. package/lib/tntd-form/FormItemInput.d.ts +1 -1
  150. package/lib/tntd-form/FormItemInput.d.ts.map +1 -1
  151. package/lib/tntd-form/FormItemInput.js +1 -1
  152. package/lib/tntd-form/FormItemInput.js.map +1 -1
  153. package/lib/tntd-form/FormItemLabel.d.ts +1 -1
  154. package/lib/tntd-form/FormItemLabel.d.ts.map +1 -1
  155. package/lib/tntd-form/FormItemLabel.js +1 -1
  156. package/lib/tntd-form/FormItemLabel.js.map +1 -1
  157. package/lib/tntd-form/FormList.js +1 -1
  158. package/lib/tntd-form/FormList.js.map +1 -1
  159. package/lib/tntd-form/hooks/useFormItemStatus.js +1 -1
  160. package/lib/tntd-form/hooks/useFormItemStatus.js.map +1 -1
  161. package/lib/tntd-form/index.d.ts.map +1 -1
  162. package/lib/tntd-form/index.js +0 -1
  163. package/lib/tntd-form/index.js.map +1 -1
  164. package/lib/tntd-form/tntd-form.stories.d.ts +1 -1
  165. package/package.json +104 -105
  166. package/themes/default/variables.less +124 -7
  167. package/themes/utils/colorPalette.less +12 -0
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ const defaultGetPrefixCls = (suffixCls, customizePrefixCls) => {
3
+ if (customizePrefixCls)
4
+ return customizePrefixCls;
5
+ return `tnt-${suffixCls}`;
6
+ };
7
+ export const defaultIconPrefixCls = 'anticon';
8
+ // zombieJ: 🚨 Do not pass `defaultRenderEmpty` here since it will case circular dependency.
9
+ export const ConfigContext = React.createContext({
10
+ // We provide a default function for Context without provider
11
+ getPrefixCls: defaultGetPrefixCls,
12
+ });
13
+ export const ConfigConsumer = ConfigContext.Consumer;
14
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/_util/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,MAAM,mBAAmB,GAAG,CAAC,SAAkB,EAAE,kBAA2B,EAAE,EAAE;IAC9E,IAAI,kBAAkB;QAAE,OAAO,kBAAkB,CAAA;IAEjD,OAAO,OAAO,SAAS,EAAE,CAAA;AAC3B,CAAC,CAAA;AAQD,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAA;AAiC7C,4FAA4F;AAC5F,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAsB;IACpE,6DAA6D;IAC7D,YAAY,EAAE,mBAAmB;CAClC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC,QAAQ,CAAA","sourcesContent":["import React from 'react'\nimport type { RenderEmptyHandler } from './defaultRenderEmpty'\n\nexport interface CSPConfig {\n nonce?: string\n}\n\nconst defaultGetPrefixCls = (suffixCls?: string, customizePrefixCls?: string) => {\n if (customizePrefixCls) return customizePrefixCls\n\n return `tnt-${suffixCls}`\n}\n\nexport type DirectionType = 'ltr' | 'rtl' | undefined\n\nexport type SizeType = 'small' | 'middle' | 'large' | undefined\n\nexport type RequiredMark = boolean | 'optional'\n\nexport const defaultIconPrefixCls = 'anticon'\n\nexport interface ConfigConsumerProps {\n getTargetContainer?: () => HTMLElement\n getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement\n rootPrefixCls?: string\n iconPrefixCls?: string\n getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string\n renderEmpty?: RenderEmptyHandler\n csp?: CSPConfig\n autoInsertSpaceInButton?: boolean\n input?: {\n autoComplete?: string\n }\n pagination?: {\n showSizeChanger?: boolean\n }\n locale?: object\n pageHeader?: {\n ghost: boolean\n }\n direction?: DirectionType\n space?: {\n size?: SizeType | number\n }\n virtual?: boolean\n dropdownMatchSelectWidth?: boolean\n form?: {\n requiredMark?: RequiredMark\n colon?: boolean\n }\n}\n\n// zombieJ: 🚨 Do not pass `defaultRenderEmpty` here since it will case circular dependency.\nexport const ConfigContext = React.createContext<ConfigConsumerProps>({\n // We provide a default function for Context without provider\n getPrefixCls: defaultGetPrefixCls,\n})\n\nexport const ConfigConsumer = ConfigContext.Consumer\n"]}
@@ -0,0 +1,20 @@
1
+ /*
2
+ * @Descripttion: 空状态
3
+ * @Author: 郑泳健
4
+ * @Date: 2022-12-19 16:45:16
5
+ * @LastEditors: 郑泳健
6
+ * @LastEditTime: 2023-02-07 11:47:03
7
+ */
8
+ import * as React from 'react';
9
+ import { ConfigConsumer } from './context';
10
+ import LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver';
11
+ const defaultRenderEmpty = (componentName) => (React.createElement(ConfigConsumer, null, ({ getPrefixCls }) => {
12
+ const prefix = getPrefixCls('empty');
13
+ return (React.createElement(LocaleReceiver, { componentName: "TntdSelect" }, (locale) => {
14
+ return (React.createElement("div", { className: `tntd-select-no-data-wrapper ${prefix}` },
15
+ React.createElement("img", { style: { width: 80, height: 50 }, src: require('../img/no-data-s.png').default }),
16
+ React.createElement("div", { className: "tntd-select-no-data-content" }, locale.noData)));
17
+ }));
18
+ }));
19
+ export default defaultRenderEmpty;
20
+ //# sourceMappingURL=defaultRenderEmpty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultRenderEmpty.js","sourceRoot":"","sources":["../../src/_util/defaultRenderEmpty.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,cAAc,MAAM,wCAAwC,CAAA;AAEnE,MAAM,kBAAkB,GAAG,CAAC,aAAqB,EAAE,EAAE,CAAC,CACpD,oBAAC,cAAc,QACZ,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;IACpB,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;IAEpC,OAAO,CACL,oBAAC,cAAc,IAAC,aAAa,EAAC,YAAY,IACvC,CAAC,MAAM,EAAE,EAAE;QACV,OAAO,CACL,6BAAK,SAAS,EAAE,+BAA+B,MAAM,EAAE;YACrD,6BACE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAChC,GAAG,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC,OAAO,GAC5C;YACF,6BAAK,SAAS,EAAC,6BAA6B,IACxC,MAAmC,CAAC,MAAM,CACxC,CACF,CACP,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CACc,CAClB,CAAA;AAID,eAAe,kBAAkB,CAAA","sourcesContent":["/*\n * @Descripttion: 空状态\n * @Author: 郑泳健\n * @Date: 2022-12-19 16:45:16\n * @LastEditors: 郑泳健\n * @LastEditTime: 2023-02-07 11:47:03\n */\nimport * as React from 'react'\nimport { ConfigConsumer } from './context'\nimport LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver'\n\nconst defaultRenderEmpty = (componentName: string) => (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefix = getPrefixCls('empty')\n\n return (\n <LocaleReceiver componentName=\"TntdSelect\">\n {(locale) => {\n return (\n <div className={`tntd-select-no-data-wrapper ${prefix}`}>\n <img\n style={{ width: 80, height: 50 }}\n src={require('../img/no-data-s.png').default}\n />\n <div className=\"tntd-select-no-data-content\">\n {(locale as Record<'noData', object>).noData}\n </div>\n </div>\n )\n }}\n </LocaleReceiver>\n )\n }}\n </ConfigConsumer>\n)\n\nexport type RenderEmptyHandler = typeof defaultRenderEmpty\n\nexport default defaultRenderEmpty\n"]}
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { detectFlexGapSupported } from '../styleChecker';
3
+ export default () => {
4
+ const [flexible, setFlexible] = React.useState(false);
5
+ React.useEffect(() => {
6
+ setFlexible(detectFlexGapSupported());
7
+ }, []);
8
+ return flexible;
9
+ };
10
+ //# sourceMappingURL=useFlexGapSupport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFlexGapSupport.js","sourceRoot":"","sources":["../../../src/_util/hooks/useFlexGapSupport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAExD,eAAe,GAAG,EAAE;IAClB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IACrD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,WAAW,CAAC,sBAAsB,EAAE,CAAC,CAAA;IACvC,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport { detectFlexGapSupported } from '../styleChecker'\n\nexport default () => {\n const [flexible, setFlexible] = React.useState(false)\n React.useEffect(() => {\n setFlexible(detectFlexGapSupported())\n }, [])\n\n return flexible\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export default function useForceUpdate() {
3
+ const [, forceUpdate] = React.useReducer((x) => x + 1, 0);
4
+ return forceUpdate;
5
+ }
6
+ //# sourceMappingURL=useForceUpdate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useForceUpdate.js","sourceRoot":"","sources":["../../../src/_util/hooks/useForceUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,CAAC,OAAO,UAAU,cAAc;IACpC,MAAM,CAAC,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;IACzD,OAAO,WAAW,CAAA;AACpB,CAAC","sourcesContent":["import * as React from 'react'\n\nexport default function useForceUpdate() {\n const [, forceUpdate] = React.useReducer((x) => x + 1, 0)\n return forceUpdate\n}\n"]}
@@ -1,4 +1,25 @@
1
1
  import { tuple } from './type';
2
+ // ================== Collapse Motion ==================
3
+ const getCollapsedHeight = () => ({ height: 0, opacity: 0 });
4
+ const getRealHeight = (node) => {
5
+ const { scrollHeight } = node;
6
+ return { height: scrollHeight, opacity: 1 };
7
+ };
8
+ const getCurrentHeight = (node) => ({ height: node ? node.offsetHeight : 0 });
9
+ const skipOpacityTransition = (_, event) => (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height';
10
+ const collapseMotion = {
11
+ motionName: 'ant-motion-collapse',
12
+ onAppearStart: getCollapsedHeight,
13
+ onEnterStart: getCollapsedHeight,
14
+ onAppearActive: getRealHeight,
15
+ onEnterActive: getRealHeight,
16
+ onLeaveStart: getCurrentHeight,
17
+ onLeaveActive: getCollapsedHeight,
18
+ onAppearEnd: skipOpacityTransition,
19
+ onEnterEnd: skipOpacityTransition,
20
+ onLeaveEnd: skipOpacityTransition,
21
+ motionDeadline: 500,
22
+ };
2
23
  const SelectPlacements = tuple('bottomLeft', 'bottomRight', 'topLeft', 'topRight');
3
24
  const getTransitionDirection = (placement) => {
4
25
  if (placement !== undefined && (placement === 'topLeft' || placement === 'topRight')) {
@@ -13,4 +34,5 @@ const getTransitionName = (rootPrefixCls, motion, transitionName) => {
13
34
  return `${rootPrefixCls}-${motion}`;
14
35
  };
15
36
  export { getTransitionName, getTransitionDirection };
37
+ export default collapseMotion;
16
38
  //# sourceMappingURL=motion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"motion.js","sourceRoot":"","sources":["../../src/_util/motion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,MAAM,gBAAgB,GAAG,KAAK,CAAC,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAGnF,MAAM,sBAAsB,GAAG,CAAC,SAA4C,EAAE,EAAE;IAC9E,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,UAAU,CAAC,EAAE;QACpF,OAAO,YAAY,CAAC;KACrB;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,aAAqB,EAAE,MAAc,EAAE,cAAuB,EAAE,EAAE;IAC3F,IAAI,cAAc,KAAK,SAAS,EAAE;QAChC,OAAO,cAAc,CAAC;KACvB;IACD,OAAO,GAAG,aAAa,IAAI,MAAM,EAAE,CAAC;AACtC,CAAC,CAAC;AACF,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,CAAC","sourcesContent":["import { tuple } from './type';\n\nconst SelectPlacements = tuple('bottomLeft', 'bottomRight', 'topLeft', 'topRight');\nexport type SelectCommonPlacement = typeof SelectPlacements[number];\n\nconst getTransitionDirection = (placement: SelectCommonPlacement | undefined) => {\n if (placement !== undefined && (placement === 'topLeft' || placement === 'topRight')) {\n return `slide-down`;\n }\n return `slide-up`;\n};\n\nconst getTransitionName = (rootPrefixCls: string, motion: string, transitionName?: string) => {\n if (transitionName !== undefined) {\n return transitionName;\n }\n return `${rootPrefixCls}-${motion}`;\n};\nexport { getTransitionName, getTransitionDirection };"]}
1
+ {"version":3,"file":"motion.js","sourceRoot":"","sources":["../../src/_util/motion.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE9B,wDAAwD;AACxD,MAAM,kBAAkB,GAAuB,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAA;AAChF,MAAM,aAAa,GAAuB,CAAC,IAAI,EAAE,EAAE;IACjD,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAA;IAC7B,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,EAAE,CAAA;AAC7C,CAAC,CAAA;AACD,MAAM,gBAAgB,GAAuB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AACjG,MAAM,qBAAqB,GAA0B,CAAC,CAAC,EAAE,KAAkB,EAAE,EAAE,CAC7E,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,MAAK,IAAI,IAAK,KAAyB,CAAC,YAAY,KAAK,QAAQ,CAAA;AAElF,MAAM,cAAc,GAAmB;IACrC,UAAU,EAAE,qBAAqB;IACjC,aAAa,EAAE,kBAAkB;IACjC,YAAY,EAAE,kBAAkB;IAChC,cAAc,EAAE,aAAa;IAC7B,aAAa,EAAE,aAAa;IAC5B,YAAY,EAAE,gBAAgB;IAC9B,aAAa,EAAE,kBAAkB;IACjC,WAAW,EAAE,qBAAqB;IAClC,UAAU,EAAE,qBAAqB;IACjC,UAAU,EAAE,qBAAqB;IACjC,cAAc,EAAE,GAAG;CACpB,CAAA;AAED,MAAM,gBAAgB,GAAG,KAAK,CAAC,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;AAGlF,MAAM,sBAAsB,GAAG,CAAC,SAA4C,EAAE,EAAE;IAC9E,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,UAAU,CAAC,EAAE;QACpF,OAAO,YAAY,CAAA;KACpB;IACD,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,CAAC,aAAqB,EAAE,MAAc,EAAE,cAAuB,EAAE,EAAE;IAC3F,IAAI,cAAc,KAAK,SAAS,EAAE;QAChC,OAAO,cAAc,CAAA;KACtB;IACD,OAAO,GAAG,aAAa,IAAI,MAAM,EAAE,CAAA;AACrC,CAAC,CAAA;AACD,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,CAAA;AACpD,eAAe,cAAc,CAAA","sourcesContent":["import type { CSSMotionProps, MotionEndEventHandler, MotionEventHandler } from 'rc-motion'\nimport type { MotionEvent } from 'rc-motion/lib/interface'\nimport { tuple } from './type'\n\n// ================== Collapse Motion ==================\nconst getCollapsedHeight: MotionEventHandler = () => ({ height: 0, opacity: 0 })\nconst getRealHeight: MotionEventHandler = (node) => {\n const { scrollHeight } = node\n return { height: scrollHeight, opacity: 1 }\n}\nconst getCurrentHeight: MotionEventHandler = (node) => ({ height: node ? node.offsetHeight : 0 })\nconst skipOpacityTransition: MotionEndEventHandler = (_, event: MotionEvent) =>\n event?.deadline === true || (event as TransitionEvent).propertyName === 'height'\n\nconst collapseMotion: CSSMotionProps = {\n motionName: 'ant-motion-collapse',\n onAppearStart: getCollapsedHeight,\n onEnterStart: getCollapsedHeight,\n onAppearActive: getRealHeight,\n onEnterActive: getRealHeight,\n onLeaveStart: getCurrentHeight,\n onLeaveActive: getCollapsedHeight,\n onAppearEnd: skipOpacityTransition,\n onEnterEnd: skipOpacityTransition,\n onLeaveEnd: skipOpacityTransition,\n motionDeadline: 500,\n}\n\nconst SelectPlacements = tuple('bottomLeft', 'bottomRight', 'topLeft', 'topRight')\nexport type SelectCommonPlacement = typeof SelectPlacements[number]\n\nconst getTransitionDirection = (placement: SelectCommonPlacement | undefined) => {\n if (placement !== undefined && (placement === 'topLeft' || placement === 'topRight')) {\n return `slide-down`\n }\n return `slide-up`\n}\n\nconst getTransitionName = (rootPrefixCls: string, motion: string, transitionName?: string) => {\n if (transitionName !== undefined) {\n return transitionName\n }\n return `${rootPrefixCls}-${motion}`\n}\nexport { getTransitionName, getTransitionDirection }\nexport default collapseMotion\n"]}
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ export const { isValidElement } = React;
3
+ export function isFragment(child) {
4
+ return child && isValidElement(child) && child.type === React.Fragment;
5
+ }
6
+ export function replaceElement(element, replacement, props) {
7
+ if (!isValidElement(element)) {
8
+ return replacement;
9
+ }
10
+ return React.cloneElement(element, typeof props === 'function' ? props(element.props || {}) : props);
11
+ }
12
+ export function cloneElement(element, props) {
13
+ return replaceElement(element, element, props);
14
+ }
15
+ //# sourceMappingURL=reactNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactNode.js","sourceRoot":"","sources":["../../src/_util/reactNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,KAAK,CAAA;AAEvC,MAAM,UAAU,UAAU,CAAC,KAAU;IACnC,OAAO,KAAK,IAAI,cAAc,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,QAAQ,CAAA;AACxE,CAAC;AAMD,MAAM,UAAU,cAAc,CAC5B,OAAwB,EACxB,WAA4B,EAC5B,KAAmB;IAEnB,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;QAC5B,OAAO,WAAW,CAAA;KACnB;IACD,OAAO,KAAK,CAAC,YAAY,CACvB,OAAO,EACP,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CACjE,CAAA;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAwB,EAAE,KAAmB;IACxE,OAAO,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAuB,CAAA;AACtE,CAAC","sourcesContent":["import * as React from 'react'\n\nexport const { isValidElement } = React\n\nexport function isFragment(child: any): boolean {\n return child && isValidElement(child) && child.type === React.Fragment\n}\n\ntype AnyObject = Record<PropertyKey, any>\n\ntype RenderProps = AnyObject | ((originProps: AnyObject) => AnyObject | void)\n\nexport function replaceElement(\n element: React.ReactNode,\n replacement: React.ReactNode,\n props?: RenderProps\n): React.ReactNode {\n if (!isValidElement(element)) {\n return replacement\n }\n return React.cloneElement(\n element,\n typeof props === 'function' ? props(element.props || {}) : props\n )\n}\n\nexport function cloneElement(element: React.ReactNode, props?: RenderProps): React.ReactElement {\n return replaceElement(element, element, props) as React.ReactElement\n}\n"]}
@@ -0,0 +1,58 @@
1
+ export const responsiveArray = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
2
+ export const responsiveMap = {
3
+ xs: '(max-width: 575px)',
4
+ sm: '(min-width: 576px)',
5
+ md: '(min-width: 768px)',
6
+ lg: '(min-width: 992px)',
7
+ xl: '(min-width: 1200px)',
8
+ xxl: '(min-width: 1600px)',
9
+ };
10
+ const subscribers = new Map();
11
+ let subUid = -1;
12
+ let screens = {};
13
+ const responsiveObserve = {
14
+ matchHandlers: {},
15
+ dispatch(pointMap) {
16
+ screens = pointMap;
17
+ subscribers.forEach((func) => func(screens));
18
+ return subscribers.size >= 1;
19
+ },
20
+ subscribe(func) {
21
+ if (!subscribers.size)
22
+ this.register();
23
+ subUid += 1;
24
+ subscribers.set(subUid, func);
25
+ func(screens);
26
+ return subUid;
27
+ },
28
+ unsubscribe(token) {
29
+ subscribers.delete(token);
30
+ if (!subscribers.size)
31
+ this.unregister();
32
+ },
33
+ unregister() {
34
+ Object.keys(responsiveMap).forEach((screen) => {
35
+ const matchMediaQuery = responsiveMap[screen];
36
+ const handler = this.matchHandlers[matchMediaQuery];
37
+ handler === null || handler === void 0 ? void 0 : handler.mql.removeListener(handler === null || handler === void 0 ? void 0 : handler.listener);
38
+ });
39
+ subscribers.clear();
40
+ },
41
+ register() {
42
+ Object.keys(responsiveMap).forEach((screen) => {
43
+ const matchMediaQuery = responsiveMap[screen];
44
+ const listener = ({ matches }) => {
45
+ this.dispatch(Object.assign(Object.assign({}, screens), { [screen]: matches }));
46
+ };
47
+ const mql = window.matchMedia(matchMediaQuery);
48
+ mql.addListener(listener);
49
+ this.matchHandlers[matchMediaQuery] = {
50
+ mql,
51
+ listener,
52
+ };
53
+ listener(mql);
54
+ });
55
+ },
56
+ };
57
+ export default responsiveObserve;
58
+ //# sourceMappingURL=responsiveObserve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responsiveObserve.js","sourceRoot":"","sources":["../../src/_util/responsiveObserve.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,eAAe,GAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAElF,MAAM,CAAC,MAAM,aAAa,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BAAP,OAAO,CAAE,GAAG,CAAC,cAAc,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,CAAC,CAAA;QAChD,CAAC,CAAC,CAAA;QACF,WAAW,CAAC,KAAK,EAAE,CAAA;IACrB,CAAC;IACD,QAAQ;QACN,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,MAAc,EAAE,EAAE;YACpD,MAAM,eAAe,GAAG,aAAa,CAAC,MAAoB,CAAC,CAAA;YAC3D,MAAM,QAAQ,GAAG,CAAC,EAAE,OAAO,EAAwB,EAAE,EAAE;gBACrD,IAAI,CAAC,QAAQ,iCACR,OAAO,KACV,CAAC,MAAM,CAAC,EAAE,OAAO,IACjB,CAAA;YACJ,CAAC,CAAA;YACD,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;YAC9C,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;YACzB,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,GAAG;gBACpC,GAAG;gBACH,QAAQ;aACT,CAAA;YAED,QAAQ,CAAC,GAAG,CAAC,CAAA;QACf,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,eAAe,iBAAiB,CAAA","sourcesContent":["export type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs'\nexport type BreakpointMap = Record<Breakpoint, string>\nexport type ScreenMap = Partial<Record<Breakpoint, boolean>>\nexport type ScreenSizeMap = Partial<Record<Breakpoint, number>>\n\nexport const responsiveArray: Breakpoint[] = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs']\n\nexport const responsiveMap: BreakpointMap = {\n xs: '(max-width: 575px)',\n sm: '(min-width: 576px)',\n md: '(min-width: 768px)',\n lg: '(min-width: 992px)',\n xl: '(min-width: 1200px)',\n xxl: '(min-width: 1600px)',\n}\n\ntype SubscribeFunc = (screens: ScreenMap) => void\nconst subscribers = new Map<number, SubscribeFunc>()\nlet subUid = -1\nlet screens = {}\n\nconst responsiveObserve = {\n matchHandlers: {} as {\n [prop: string]: {\n mql: MediaQueryList\n listener: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null\n }\n },\n dispatch(pointMap: ScreenMap) {\n screens = pointMap\n subscribers.forEach((func) => func(screens))\n return subscribers.size >= 1\n },\n subscribe(func: SubscribeFunc): number {\n if (!subscribers.size) this.register()\n subUid += 1\n subscribers.set(subUid, func)\n func(screens)\n return subUid\n },\n unsubscribe(token: number) {\n subscribers.delete(token)\n if (!subscribers.size) this.unregister()\n },\n unregister() {\n Object.keys(responsiveMap).forEach((screen: string) => {\n const matchMediaQuery = responsiveMap[screen as Breakpoint]\n const handler = this.matchHandlers[matchMediaQuery]\n handler?.mql.removeListener(handler?.listener)\n })\n subscribers.clear()\n },\n register() {\n Object.keys(responsiveMap).forEach((screen: string) => {\n const matchMediaQuery = responsiveMap[screen as Breakpoint]\n const listener = ({ matches }: { matches: boolean }) => {\n this.dispatch({\n ...screens,\n [screen]: matches,\n })\n }\n const mql = window.matchMedia(matchMediaQuery)\n mql.addListener(listener)\n this.matchHandlers[matchMediaQuery] = {\n mql,\n listener,\n }\n\n listener(mql)\n })\n },\n}\n\nexport default responsiveObserve\n"]}
@@ -0,0 +1,27 @@
1
+ import canUseDom from 'rc-util/lib/Dom/canUseDom';
2
+ import { isStyleSupport } from 'rc-util/lib/Dom/styleChecker';
3
+ export const canUseDocElement = () => canUseDom() && window.document.documentElement;
4
+ export { isStyleSupport };
5
+ let flexGapSupported;
6
+ export const detectFlexGapSupported = () => {
7
+ if (!canUseDocElement()) {
8
+ return false;
9
+ }
10
+ if (flexGapSupported !== undefined) {
11
+ return flexGapSupported;
12
+ }
13
+ // create flex container with row-gap set
14
+ const flex = document.createElement('div');
15
+ flex.style.display = 'flex';
16
+ flex.style.flexDirection = 'column';
17
+ flex.style.rowGap = '1px';
18
+ // create two, elements inside it
19
+ flex.appendChild(document.createElement('div'));
20
+ flex.appendChild(document.createElement('div'));
21
+ // append to the DOM (needed to obtain scrollHeight)
22
+ document.body.appendChild(flex);
23
+ flexGapSupported = flex.scrollHeight === 1; // flex container should be 1px high from the row-gap
24
+ document.body.removeChild(flex);
25
+ return flexGapSupported;
26
+ };
27
+ //# sourceMappingURL=styleChecker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styleChecker.js","sourceRoot":"","sources":["../../src/_util/styleChecker.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,2BAA2B,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAE7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,SAAS,EAAE,IAAI,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAA;AAEpF,OAAO,EAAE,cAAc,EAAE,CAAA;AAEzB,IAAI,gBAAqC,CAAA;AACzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,IAAI,CAAC,gBAAgB,EAAE,EAAE;QACvB,OAAO,KAAK,CAAA;KACb;IAED,IAAI,gBAAgB,KAAK,SAAS,EAAE;QAClC,OAAO,gBAAgB,CAAA;KACxB;IAED,yCAAyC;IACzC,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAC1C,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAA;IAC3B,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,QAAQ,CAAA;IACnC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAA;IAEzB,iCAAiC;IACjC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;IAC/C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;IAE/C,oDAAoD;IACpD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAC/B,gBAAgB,GAAG,IAAI,CAAC,YAAY,KAAK,CAAC,CAAA,CAAC,qDAAqD;IAChG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAE/B,OAAO,gBAAgB,CAAA;AACzB,CAAC,CAAA","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 +1 @@
1
- {"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/_util/type.ts"],"names":[],"mappings":"AACA,qHAAqH;AACrH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAqB,GAAG,IAAO,EAAE,EAAE,CAAC,IAAI,CAAC;AAE9D,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAqB,GAAG,IAAO,EAAE,EAAE,CAAC,IAAI,CAAC","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;"]}
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/_util/type.ts"],"names":[],"mappings":"AACA,qHAAqH;AACrH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAqB,GAAG,IAAO,EAAE,EAAE,CAAC,IAAI,CAAA;AAE7D,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAqB,GAAG,IAAO,EAAE,EAAE,CAAC,IAAI,CAAA","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 +1 @@
1
- {"version":3,"file":"warning.js","sourceRoot":"","sources":["../../src/_util/warning.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,eAAe,CAAC,KAAc,EAAE,SAAiB,EAAE,OAAe,EAAQ,EAAE;IAC1E,OAAO,CAAC,KAAK,EAAE,UAAU,SAAS,KAAK,OAAO,EAAE,CAAC,CAAC;AACpD,CAAC,CAAC","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
+ {"version":3,"file":"warning.js","sourceRoot":"","sources":["../../src/_util/warning.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAE1D,OAAO,EAAE,WAAW,EAAE,CAAA;AAEtB,eAAe,CAAC,KAAc,EAAE,SAAiB,EAAE,OAAe,EAAQ,EAAE;IAC1E,OAAO,CAAC,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"]}
@@ -0,0 +1,4 @@
1
+ import { createContext } from 'react';
2
+ const RowContext = createContext({});
3
+ export default RowContext;
4
+ //# sourceMappingURL=RowContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RowContext.js","sourceRoot":"","sources":["../../src/grid/RowContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAQrC,MAAM,UAAU,GAA6B,aAAa,CAAC,EAAE,CAAC,CAAA;AAE9D,eAAe,UAAU,CAAA","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"]}
package/es/grid/col.js ADDED
@@ -0,0 +1,78 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import classNames from 'classnames';
13
+ import * as React from 'react';
14
+ import { ConfigContext } from '../_util/context';
15
+ import RowContext from './RowContext';
16
+ function parseFlex(flex) {
17
+ if (typeof flex === 'number') {
18
+ return `${flex} ${flex} auto`;
19
+ }
20
+ if (/^\d+(\.\d+)?(px|em|rem|%)$/.test(flex)) {
21
+ return `0 0 ${flex}`;
22
+ }
23
+ return flex;
24
+ }
25
+ const sizes = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
26
+ const Col = React.forwardRef((props, ref) => {
27
+ const { getPrefixCls, direction } = React.useContext(ConfigContext);
28
+ const { gutter, wrap, supportFlexGap } = React.useContext(RowContext);
29
+ const { prefixCls: customizePrefixCls = 'tnt-col', span, order, offset, push, pull, className, children, flex, style } = props, others = __rest(props, ["prefixCls", "span", "order", "offset", "push", "pull", "className", "children", "flex", "style"]);
30
+ const prefixCls = getPrefixCls('col', customizePrefixCls);
31
+ let sizeClassObj = {};
32
+ sizes.forEach((size) => {
33
+ let sizeProps = {};
34
+ const propSize = props[size];
35
+ if (typeof propSize === 'number') {
36
+ sizeProps.span = propSize;
37
+ }
38
+ else if (typeof propSize === 'object') {
39
+ sizeProps = propSize || {};
40
+ }
41
+ delete others[size];
42
+ sizeClassObj = Object.assign(Object.assign({}, sizeClassObj), { [`${prefixCls}-${size}-${sizeProps.span}`]: sizeProps.span !== undefined, [`${prefixCls}-${size}-order-${sizeProps.order}`]: sizeProps.order || sizeProps.order === 0, [`${prefixCls}-${size}-offset-${sizeProps.offset}`]: sizeProps.offset || sizeProps.offset === 0, [`${prefixCls}-${size}-push-${sizeProps.push}`]: sizeProps.push || sizeProps.push === 0, [`${prefixCls}-${size}-pull-${sizeProps.pull}`]: sizeProps.pull || sizeProps.pull === 0, [`${prefixCls}-rtl`]: direction === 'rtl' });
43
+ });
44
+ const classes = classNames(prefixCls, {
45
+ [`${prefixCls}-${span}`]: span !== undefined,
46
+ [`${prefixCls}-order-${order}`]: order,
47
+ [`${prefixCls}-offset-${offset}`]: offset,
48
+ [`${prefixCls}-push-${push}`]: push,
49
+ [`${prefixCls}-pull-${pull}`]: pull,
50
+ }, className, sizeClassObj);
51
+ const mergedStyle = {};
52
+ // Horizontal gutter use padding
53
+ if (gutter && gutter[0] > 0) {
54
+ const horizontalGutter = gutter[0] / 2;
55
+ mergedStyle.paddingLeft = horizontalGutter;
56
+ mergedStyle.paddingRight = horizontalGutter;
57
+ }
58
+ // Vertical gutter use padding when gap not support
59
+ if (gutter && gutter[1] > 0 && !supportFlexGap) {
60
+ const verticalGutter = gutter[1] / 2;
61
+ mergedStyle.paddingTop = verticalGutter;
62
+ mergedStyle.paddingBottom = verticalGutter;
63
+ }
64
+ if (flex) {
65
+ mergedStyle.flex = parseFlex(flex);
66
+ // Hack for Firefox to avoid size issue
67
+ // https://github.com/ant-design/ant-design/pull/20023#issuecomment-564389553
68
+ if (wrap === false && !mergedStyle.minWidth) {
69
+ mergedStyle.minWidth = 0;
70
+ }
71
+ }
72
+ return (React.createElement("div", Object.assign({}, others, { style: Object.assign(Object.assign({}, mergedStyle), style), className: classes, ref: ref }), children));
73
+ });
74
+ if (process.env.NODE_ENV !== 'production') {
75
+ Col.displayName = 'Col';
76
+ }
77
+ export default Col;
78
+ //# sourceMappingURL=col.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"col.js","sourceRoot":"","sources":["../../src/grid/col.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,UAAU,MAAM,cAAc,CAAA;AAgCrC,SAAS,SAAS,CAAC,IAAc;IAC/B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,GAAG,IAAI,IAAI,IAAI,OAAO,CAAA;KAC9B;IAED,IAAI,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC3C,OAAO,OAAO,IAAI,EAAE,CAAA;KACrB;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AACD,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAU,CAAA;AAC5D,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAA2B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACpE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,KAAK,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,UAAU,GAAG,cAAc,CAAA;QACvC,WAAW,CAAC,aAAa,GAAG,cAAc,CAAA;KAC3C;IAED,IAAI,IAAI,EAAE;QACR,WAAW,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;QAElC,uCAAuC;QACvC,6EAA6E;QAC7E,IAAI,IAAI,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE;YAC3C,WAAW,CAAC,QAAQ,GAAG,CAAC,CAAA;SACzB;KACF;IAED,OAAO,CACL,6CAAS,MAAM,IAAE,KAAK,kCAAO,WAAW,GAAK,KAAK,GAAI,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,KAC/E,QAAQ,CACL,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;IACzC,GAAG,CAAC,WAAW,GAAG,KAAK,CAAA;CACxB;AAED,eAAe,GAAG,CAAA","sourcesContent":["import classNames from 'classnames'\nimport * as React from 'react'\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"]}
@@ -0,0 +1,19 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import useForceUpdate from '../../_util/hooks/useForceUpdate';
3
+ import ResponsiveObserve from '../../_util/responsiveObserve';
4
+ function useBreakpoint(refreshOnChange = true) {
5
+ const screensRef = useRef({});
6
+ const forceUpdate = useForceUpdate();
7
+ useEffect(() => {
8
+ const token = ResponsiveObserve.subscribe((supportScreens) => {
9
+ screensRef.current = supportScreens;
10
+ if (refreshOnChange) {
11
+ forceUpdate();
12
+ }
13
+ });
14
+ return () => ResponsiveObserve.unsubscribe(token);
15
+ }, []);
16
+ return screensRef.current;
17
+ }
18
+ export default useBreakpoint;
19
+ //# sourceMappingURL=useBreakpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBreakpoint.js","sourceRoot":"","sources":["../../../src/grid/hooks/useBreakpoint.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,cAAc,MAAM,kCAAkC,CAAA;AAE7D,OAAO,iBAAiB,MAAM,+BAA+B,CAAA;AAE7D,SAAS,aAAa,CAAC,kBAA2B,IAAI;IACpD,MAAM,UAAU,GAAG,MAAM,CAAY,EAAE,CAAC,CAAA;IACxC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IAEpC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC,cAAc,EAAE,EAAE;YAC3D,UAAU,CAAC,OAAO,GAAG,cAAc,CAAA;YACnC,IAAI,eAAe,EAAE;gBACnB,WAAW,EAAE,CAAA;aACd;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,GAAG,EAAE,CAAC,iBAAiB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;IACnD,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,UAAU,CAAC,OAAO,CAAA;AAC3B,CAAC;AAED,eAAe,aAAa,CAAA","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"]}
@@ -0,0 +1,13 @@
1
+ import Col from './col';
2
+ import useInternalBreakpoint from './hooks/useBreakpoint';
3
+ import Row from './row';
4
+ import './style';
5
+ // Do not export params
6
+ function useBreakpoint() {
7
+ return useInternalBreakpoint();
8
+ }
9
+ export {} from './col';
10
+ export {} from './row';
11
+ export { Row, Col };
12
+ export default { useBreakpoint };
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/grid/index.tsx"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,OAAO,CAAA;AACvB,OAAO,qBAAqB,MAAM,uBAAuB,CAAA;AACzD,OAAO,GAAG,MAAM,OAAO,CAAA;AAEvB,OAAO,SAAS,CAAA;AAEhB,uBAAuB;AACvB,SAAS,aAAa;IACpB,OAAO,qBAAqB,EAAE,CAAA;AAChC,CAAC;AAED,OAAO,EAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAY,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;AAEnB,eAAe,EAAE,aAAa,EAAE,CAAA","sourcesContent":["import Col from './col'\nimport useInternalBreakpoint from './hooks/useBreakpoint'\nimport Row from './row'\n\nimport './style'\n\n// Do not export params\nfunction useBreakpoint() {\n return useInternalBreakpoint()\n}\n\nexport { ColProps, ColSize } from './col'\nexport { RowProps } from './row'\nexport { Row, Col }\n\nexport default { useBreakpoint }\n"]}
package/es/grid/row.js ADDED
@@ -0,0 +1,141 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import classNames from 'classnames';
13
+ import * as React from 'react';
14
+ import { ConfigContext } from '../_util/context';
15
+ import useFlexGapSupport from '../_util/hooks/useFlexGapSupport';
16
+ import ResponsiveObserve, { responsiveArray } from '../_util/responsiveObserve';
17
+ import { tuple } from '../_util/type';
18
+ import RowContext from './RowContext';
19
+ const RowAligns = tuple('top', 'middle', 'bottom', 'stretch');
20
+ const RowJustify = tuple('start', 'end', 'center', 'space-around', 'space-between', 'space-evenly');
21
+ function useMergePropByScreen(oriProp, screen) {
22
+ const [prop, setProp] = React.useState(typeof oriProp === 'string' ? oriProp : '');
23
+ const clacMergeAlignOrJustify = () => {
24
+ if (typeof oriProp === 'string') {
25
+ setProp(oriProp);
26
+ }
27
+ if (typeof oriProp !== 'object') {
28
+ return;
29
+ }
30
+ for (let i = 0; i < responsiveArray.length; i++) {
31
+ const breakpoint = responsiveArray[i];
32
+ // if do not match, do nothing
33
+ if (!screen[breakpoint])
34
+ continue;
35
+ const curVal = oriProp[breakpoint];
36
+ if (curVal !== undefined) {
37
+ setProp(curVal);
38
+ return;
39
+ }
40
+ }
41
+ };
42
+ React.useEffect(() => {
43
+ clacMergeAlignOrJustify();
44
+ }, [JSON.stringify(oriProp), screen]);
45
+ return prop;
46
+ }
47
+ const Row = React.forwardRef((props, ref) => {
48
+ const { prefixCls: customizePrefixCls = 'tnt-row', justify, align, className, style, children, gutter = 0, wrap } = props, others = __rest(props, ["prefixCls", "justify", "align", "className", "style", "children", "gutter", "wrap"]);
49
+ const { getPrefixCls, direction } = React.useContext(ConfigContext);
50
+ const [screens, setScreens] = React.useState({
51
+ xs: true,
52
+ sm: true,
53
+ md: true,
54
+ lg: true,
55
+ xl: true,
56
+ xxl: true,
57
+ });
58
+ // to save screens info when responsiveObserve callback had been call
59
+ const [curScreens, setCurScreens] = React.useState({
60
+ xs: false,
61
+ sm: false,
62
+ md: false,
63
+ lg: false,
64
+ xl: false,
65
+ xxl: false,
66
+ });
67
+ // ================================== calc reponsive data ==================================
68
+ const mergeAlign = useMergePropByScreen(align, curScreens);
69
+ const mergeJustify = useMergePropByScreen(justify, curScreens);
70
+ const supportFlexGap = useFlexGapSupport();
71
+ const gutterRef = React.useRef(gutter);
72
+ // ================================== Effect ==================================
73
+ React.useEffect(() => {
74
+ const token = ResponsiveObserve.subscribe((screen) => {
75
+ setCurScreens(screen);
76
+ const currentGutter = gutterRef.current || 0;
77
+ if ((!Array.isArray(currentGutter) && typeof currentGutter === 'object') ||
78
+ (Array.isArray(currentGutter) &&
79
+ (typeof currentGutter[0] === 'object' || typeof currentGutter[1] === 'object'))) {
80
+ setScreens(screen);
81
+ }
82
+ });
83
+ return () => ResponsiveObserve.unsubscribe(token);
84
+ }, []);
85
+ // ================================== Render ==================================
86
+ const getGutter = () => {
87
+ const results = [undefined, undefined];
88
+ const normalizedGutter = Array.isArray(gutter) ? gutter : [gutter, undefined];
89
+ normalizedGutter.forEach((g, index) => {
90
+ if (typeof g === 'object') {
91
+ for (let i = 0; i < responsiveArray.length; i++) {
92
+ const breakpoint = responsiveArray[i];
93
+ if (screens[breakpoint] && g[breakpoint] !== undefined) {
94
+ results[index] = g[breakpoint];
95
+ break;
96
+ }
97
+ }
98
+ }
99
+ else {
100
+ results[index] = g;
101
+ }
102
+ });
103
+ return results;
104
+ };
105
+ const prefixCls = getPrefixCls('row', customizePrefixCls);
106
+ const gutters = getGutter();
107
+ const classes = classNames(prefixCls, {
108
+ [`${prefixCls}-no-wrap`]: wrap === false,
109
+ [`${prefixCls}-${mergeJustify}`]: mergeJustify,
110
+ [`${prefixCls}-${mergeAlign}`]: mergeAlign,
111
+ [`${prefixCls}-rtl`]: direction === 'rtl',
112
+ }, className);
113
+ // Add gutter related style
114
+ const rowStyle = {};
115
+ const horizontalGutter = gutters[0] != null && gutters[0] > 0 ? gutters[0] / -2 : undefined;
116
+ const verticalGutter = gutters[1] != null && gutters[1] > 0 ? gutters[1] / -2 : undefined;
117
+ if (horizontalGutter) {
118
+ rowStyle.marginLeft = horizontalGutter;
119
+ rowStyle.marginRight = horizontalGutter;
120
+ }
121
+ if (supportFlexGap) {
122
+ // Set gap direct if flex gap support
123
+ ;
124
+ [, rowStyle.rowGap] = gutters;
125
+ }
126
+ else if (verticalGutter) {
127
+ rowStyle.marginTop = verticalGutter;
128
+ rowStyle.marginBottom = verticalGutter;
129
+ }
130
+ // "gutters" is a new array in each rendering phase, it'll make 'React.useMemo' effectless.
131
+ // So we deconstruct "gutters" variable here.
132
+ const [gutterH, gutterV] = gutters;
133
+ const rowContext = React.useMemo(() => ({ gutter: [gutterH, gutterV], wrap, supportFlexGap }), [gutterH, gutterV, wrap, supportFlexGap]);
134
+ return (React.createElement(RowContext.Provider, { value: rowContext },
135
+ React.createElement("div", Object.assign({}, others, { className: classes, style: Object.assign(Object.assign({}, rowStyle), style), ref: ref }), children)));
136
+ });
137
+ if (process.env.NODE_ENV !== 'production') {
138
+ Row.displayName = 'Row';
139
+ }
140
+ export default Row;
141
+ //# sourceMappingURL=row.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"row.js","sourceRoot":"","sources":["../../src/grid/row.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,iBAAiB,MAAM,kCAAkC,CAAA;AAEhE,OAAO,iBAAiB,EAAE,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,UAAU,MAAM,cAAc,CAAA;AAErC,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;AAC7D,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,CAAC,CAAA;AAoBnG,SAAS,oBAAoB,CAAC,OAAgD,EAAE,MAAiB;IAC/F,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAElF,MAAM,uBAAuB,GAAG,GAAG,EAAE;QACnC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,OAAO,CAAC,OAAO,CAAC,CAAA;SACjB;QACD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,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E,GAAG,KAC5E,QAAQ,CACL,CACc,CACvB,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;IACzC,GAAG,CAAC,WAAW,GAAG,KAAK,CAAA;CACxB;AAED,eAAe,GAAG,CAAA","sourcesContent":["import classNames from 'classnames'\nimport * as React from 'react'\nimport { ConfigContext } from '../_util/context'\nimport useFlexGapSupport from '../_util/hooks/useFlexGapSupport'\nimport type { Breakpoint, ScreenMap } from '../_util/responsiveObserve'\nimport ResponsiveObserve, { responsiveArray } from '../_util/responsiveObserve'\nimport { tuple } from '../_util/type'\nimport RowContext from './RowContext'\n\nconst RowAligns = tuple('top', 'middle', 'bottom', 'stretch')\nconst RowJustify = tuple('start', 'end', 'center', 'space-around', 'space-between', 'space-evenly')\n\ntype Responsive = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs'\ntype ResponsiveLike<T> = {\n [key in Responsive]?: T\n}\n\ntype Gap = number | undefined\nexport type Gutter = number | undefined | Partial<Record<Breakpoint, number>>\n\ntype ResponsiveAligns = ResponsiveLike<typeof RowAligns[number]>\ntype ResponsiveJustify = ResponsiveLike<typeof RowJustify[number]>\nexport interface RowProps extends React.HTMLAttributes<HTMLDivElement> {\n gutter?: Gutter | [Gutter, Gutter]\n align?: typeof RowAligns[number] | ResponsiveAligns\n justify?: typeof RowJustify[number] | ResponsiveJustify\n prefixCls?: string\n wrap?: boolean\n}\n\nfunction useMergePropByScreen(oriProp: RowProps['align'] | RowProps['justify'], screen: ScreenMap) {\n const [prop, setProp] = React.useState(typeof oriProp === 'string' ? oriProp : '')\n\n const clacMergeAlignOrJustify = () => {\n if (typeof oriProp === 'string') {\n setProp(oriProp)\n }\n if (typeof oriProp !== 'object') {\n return\n }\n for (let i = 0; i < responsiveArray.length; i++) {\n const breakpoint: Breakpoint = responsiveArray[i]\n // if do not match, do nothing\n if (!screen[breakpoint]) continue\n const curVal = oriProp[breakpoint]\n if (curVal !== undefined) {\n setProp(curVal)\n return\n }\n }\n }\n\n React.useEffect(() => {\n clacMergeAlignOrJustify()\n }, [JSON.stringify(oriProp), screen])\n\n return prop\n}\n\nconst Row = React.forwardRef<HTMLDivElement, RowProps>((props, ref) => {\n const {\n prefixCls: customizePrefixCls = 'tnt-row',\n justify,\n align,\n className,\n style,\n children,\n gutter = 0,\n wrap,\n ...others\n } = props\n\n const { getPrefixCls, direction } = React.useContext(ConfigContext)\n\n const [screens, setScreens] = React.useState<ScreenMap>({\n xs: true,\n sm: true,\n md: true,\n lg: true,\n xl: true,\n xxl: true,\n })\n // to save screens info when responsiveObserve callback had been call\n const [curScreens, setCurScreens] = React.useState<ScreenMap>({\n xs: false,\n sm: false,\n md: false,\n lg: false,\n xl: false,\n xxl: false,\n })\n\n // ================================== calc reponsive data ==================================\n const mergeAlign = useMergePropByScreen(align, curScreens)\n\n const mergeJustify = useMergePropByScreen(justify, curScreens)\n\n const supportFlexGap = useFlexGapSupport()\n\n const gutterRef = React.useRef<Gutter | [Gutter, Gutter]>(gutter)\n\n // ================================== Effect ==================================\n React.useEffect(() => {\n const token = ResponsiveObserve.subscribe((screen) => {\n setCurScreens(screen)\n const currentGutter = gutterRef.current || 0\n if (\n (!Array.isArray(currentGutter) && typeof currentGutter === 'object') ||\n (Array.isArray(currentGutter) &&\n (typeof currentGutter[0] === 'object' || typeof currentGutter[1] === 'object'))\n ) {\n setScreens(screen)\n }\n })\n return () => ResponsiveObserve.unsubscribe(token)\n }, [])\n\n // ================================== Render ==================================\n const getGutter = (): [Gap, Gap] => {\n const results: [Gap, Gap] = [undefined, undefined]\n const normalizedGutter = Array.isArray(gutter) ? gutter : [gutter, undefined]\n normalizedGutter.forEach((g, index) => {\n if (typeof g === 'object') {\n for (let i = 0; i < responsiveArray.length; i++) {\n const breakpoint: Breakpoint = responsiveArray[i]\n if (screens[breakpoint] && g[breakpoint] !== undefined) {\n results[index] = g[breakpoint] as number\n break\n }\n }\n } else {\n results[index] = g\n }\n })\n return results\n }\n\n const prefixCls = getPrefixCls('row', customizePrefixCls)\n const gutters = getGutter()\n const classes = classNames(\n prefixCls,\n {\n [`${prefixCls}-no-wrap`]: wrap === false,\n [`${prefixCls}-${mergeJustify}`]: mergeJustify,\n [`${prefixCls}-${mergeAlign}`]: mergeAlign,\n [`${prefixCls}-rtl`]: direction === 'rtl',\n },\n className\n )\n\n // Add gutter related style\n const rowStyle: React.CSSProperties = {}\n const horizontalGutter = gutters[0] != null && gutters[0] > 0 ? gutters[0] / -2 : undefined\n const verticalGutter = gutters[1] != null && gutters[1] > 0 ? gutters[1] / -2 : undefined\n\n if (horizontalGutter) {\n rowStyle.marginLeft = horizontalGutter\n rowStyle.marginRight = horizontalGutter\n }\n\n if (supportFlexGap) {\n // Set gap direct if flex gap support\n ;[, rowStyle.rowGap] = gutters\n } else if (verticalGutter) {\n rowStyle.marginTop = verticalGutter\n rowStyle.marginBottom = verticalGutter\n }\n\n // \"gutters\" is a new array in each rendering phase, it'll make 'React.useMemo' effectless.\n // So we deconstruct \"gutters\" variable here.\n const [gutterH, gutterV] = gutters\n const rowContext = React.useMemo(\n () => ({ gutter: [gutterH, gutterV] as [number, number], wrap, supportFlexGap }),\n [gutterH, gutterV, wrap, supportFlexGap]\n )\n\n return (\n <RowContext.Provider value={rowContext}>\n <div {...others} className={classes} style={{ ...rowStyle, ...style }} ref={ref}>\n {children}\n </div>\n </RowContext.Provider>\n )\n})\n\nif (process.env.NODE_ENV !== 'production') {\n Row.displayName = 'Row'\n}\n\nexport default Row\n"]}
@@ -0,0 +1,3 @@
1
+ // import '../../style/index.less';
2
+ import './index.less';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grid/style/index.tsx"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,cAAc,CAAA","sourcesContent":["// import '../../style/index.less';\nimport './index.less'\n"]}