@vkontakte/vkui 8.1.1 → 8.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Flex/FlexItem/FlexItem.d.ts +1 -1
- package/dist/components/Flex/FlexItem/FlexItem.d.ts.map +1 -1
- package/dist/components/Flex/FlexItem/FlexItem.js +39 -8
- package/dist/components/Flex/FlexItem/FlexItem.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/components.css.map +1 -1
- package/dist/cssm/components/Flex/FlexItem/FlexItem.js +39 -9
- package/dist/cssm/components/Flex/FlexItem/FlexItem.js.map +1 -1
- package/dist/vkui.css +1 -1
- package/dist/vkui.css.map +1 -1
- package/package.json +1 -1
- package/src/components/Flex/FlexItem/FlexItem.tsx +38 -11
- package/dist/cssm/components/Flex/FlexItem/FlexItem.module.css +0 -17
- package/src/components/Flex/FlexItem/FlexItem.module.css +0 -17
- package/src/components/Flex/FlexItem/FlexItem.module.css.d.ts.map +0 -1
|
@@ -11,5 +11,5 @@ export type FlexItemProps = RootComponentProps<HTMLElement> & Pick<LayoutProps,
|
|
|
11
11
|
*/
|
|
12
12
|
flex?: 'grow' | 'shrink' | 'content' | 'fixed' | undefined;
|
|
13
13
|
};
|
|
14
|
-
export declare const FlexItem: ({ flex, ...restProps }: FlexItemProps) => React.ReactNode;
|
|
14
|
+
export declare const FlexItem: ({ flex, flexBasis, ...restProps }: FlexItemProps) => React.ReactNode;
|
|
15
15
|
//# sourceMappingURL=FlexItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlexItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Flex/FlexItem/FlexItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FlexItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Flex/FlexItem/FlexItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,sBAAsB,CAAC;AAG5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,MAAM,MAAM,aAAa,GAAG,kBAAkB,CAAC,WAAW,CAAC,GACzD,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,aAAa,GAAG,WAAW,CAAC,GAAG;IAC7D;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;CAC5D,CAAC;AAoCJ,eAAO,MAAM,QAAQ,GAAI,mCAAmC,aAAa,KAAG,KAAK,CAAC,SAUjF,CAAC"}
|
|
@@ -1,21 +1,52 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getRequiredValueByKey } from "../../../helpers/getValueByKey.js";
|
|
2
3
|
import { resolveLayoutProps } from "../../../lib/layouts/index.js";
|
|
3
4
|
import { warnOnce } from "../../../lib/warnOnce.js";
|
|
4
5
|
import { RootComponent } from "../../RootComponent/RootComponent.js";
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const resolveFlexProps = (flex, flexBasis)=>{
|
|
7
|
+
const overrideProps = flexBasis !== undefined ? {
|
|
8
|
+
flexBasis
|
|
9
|
+
} : {};
|
|
10
|
+
if (!flex) {
|
|
11
|
+
return overrideProps;
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
...getRequiredValueByKey(flex, {
|
|
15
|
+
grow: {
|
|
16
|
+
flexGrow: 1,
|
|
17
|
+
flexShrink: 0,
|
|
18
|
+
flexBasis: 'auto'
|
|
19
|
+
},
|
|
20
|
+
shrink: {
|
|
21
|
+
flexGrow: 0,
|
|
22
|
+
flexShrink: 1,
|
|
23
|
+
flexBasis: 'auto'
|
|
24
|
+
},
|
|
25
|
+
content: {
|
|
26
|
+
flexGrow: 1,
|
|
27
|
+
flexShrink: 1,
|
|
28
|
+
flexBasis: 'auto'
|
|
29
|
+
},
|
|
30
|
+
fixed: {
|
|
31
|
+
flexGrow: 0,
|
|
32
|
+
flexShrink: 0,
|
|
33
|
+
flexBasis: 'auto'
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
36
|
+
...overrideProps
|
|
37
|
+
};
|
|
10
38
|
};
|
|
11
39
|
const warn = warnOnce('Flex.Item');
|
|
12
|
-
export const FlexItem = ({ flex, ...restProps })=>{
|
|
40
|
+
export const FlexItem = ({ flex, flexBasis, ...restProps })=>{
|
|
13
41
|
if (process.env.NODE_ENV === 'development') {
|
|
14
42
|
warn('Компонент Flex.Item устарел, используйте компонент Box в качестве альтернативы.');
|
|
15
43
|
}
|
|
16
|
-
const
|
|
44
|
+
const flexProps = resolveFlexProps(flex, flexBasis);
|
|
45
|
+
const resolvedProps = resolveLayoutProps({
|
|
46
|
+
...restProps,
|
|
47
|
+
...flexProps
|
|
48
|
+
});
|
|
17
49
|
return /*#__PURE__*/ _jsx(RootComponent, {
|
|
18
|
-
baseClassName: flex && flexClassNames[flex],
|
|
19
50
|
...resolvedProps
|
|
20
51
|
});
|
|
21
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Flex/FlexItem/FlexItem.tsx"],"sourcesContent":["import { type LayoutProps, resolveLayoutProps } from '../../../lib/layouts';\nimport { warnOnce } from '../../../lib/warnOnce';\nimport { RootComponent } from '../../RootComponent/RootComponent';\nimport type { RootComponentProps } from '../../RootComponent/RootComponent';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Flex/FlexItem/FlexItem.tsx"],"sourcesContent":["import { getRequiredValueByKey } from '../../../helpers/getValueByKey';\nimport { type LayoutProps, resolveLayoutProps } from '../../../lib/layouts';\nimport { warnOnce } from '../../../lib/warnOnce';\nimport { RootComponent } from '../../RootComponent/RootComponent';\nimport type { RootComponentProps } from '../../RootComponent/RootComponent';\n\nexport type FlexItemProps = RootComponentProps<HTMLElement> &\n Pick<LayoutProps, 'alignSelf' | 'justifySelf' | 'flexBasis'> & {\n /**\n * Позволяет задать предопределенные значения свойства `flex`:\n *\n * - `grow` соответствует значению `1 0 auto`\n * - `shrink` соответствует значению `0 1 auto`\n * - `content` соответствует значению `1 1 auto`\n * - `fixed` соответствует значению `0 0 auto`.\n */\n flex?: 'grow' | 'shrink' | 'content' | 'fixed' | undefined;\n };\n\nconst resolveFlexProps = (flex: FlexItemProps['flex'], flexBasis: FlexItemProps['flexBasis']) => {\n const overrideProps = flexBasis !== undefined ? { flexBasis } : {};\n if (!flex) {\n return overrideProps;\n }\n return {\n ...getRequiredValueByKey<Pick<LayoutProps, 'flexGrow' | 'flexShrink' | 'flexBasis'>>(flex, {\n grow: {\n flexGrow: 1,\n flexShrink: 0,\n flexBasis: 'auto',\n },\n shrink: {\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n },\n content: {\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: 'auto',\n },\n fixed: {\n flexGrow: 0,\n flexShrink: 0,\n flexBasis: 'auto',\n },\n }),\n ...overrideProps,\n };\n};\n\nconst warn = warnOnce('Flex.Item');\n\nexport const FlexItem = ({ flex, flexBasis, ...restProps }: FlexItemProps): React.ReactNode => {\n if (process.env.NODE_ENV === 'development') {\n warn('Компонент Flex.Item устарел, используйте компонент Box в качестве альтернативы.');\n }\n\n const flexProps = resolveFlexProps(flex, flexBasis);\n\n const resolvedProps = resolveLayoutProps({ ...restProps, ...flexProps });\n\n return <RootComponent {...resolvedProps} />;\n};\n"],"names":["getRequiredValueByKey","resolveLayoutProps","warnOnce","RootComponent","resolveFlexProps","flex","flexBasis","overrideProps","undefined","grow","flexGrow","flexShrink","shrink","content","fixed","warn","FlexItem","restProps","process","env","NODE_ENV","flexProps","resolvedProps"],"mappings":";AAAA,SAASA,qBAAqB,QAAQ,oCAAiC;AACvE,SAA2BC,kBAAkB,QAAQ,gCAAuB;AAC5E,SAASC,QAAQ,QAAQ,2BAAwB;AACjD,SAASC,aAAa,QAAQ,uCAAoC;AAgBlE,MAAMC,mBAAmB,CAACC,MAA6BC;IACrD,MAAMC,gBAAgBD,cAAcE,YAAY;QAAEF;IAAU,IAAI,CAAC;IACjE,IAAI,CAACD,MAAM;QACT,OAAOE;IACT;IACA,OAAO;QACL,GAAGP,sBAAkFK,MAAM;YACzFI,MAAM;gBACJC,UAAU;gBACVC,YAAY;gBACZL,WAAW;YACb;YACAM,QAAQ;gBACNF,UAAU;gBACVC,YAAY;gBACZL,WAAW;YACb;YACAO,SAAS;gBACPH,UAAU;gBACVC,YAAY;gBACZL,WAAW;YACb;YACAQ,OAAO;gBACLJ,UAAU;gBACVC,YAAY;gBACZL,WAAW;YACb;QACF,EAAE;QACF,GAAGC,aAAa;IAClB;AACF;AAEA,MAAMQ,OAAOb,SAAS;AAEtB,OAAO,MAAMc,WAAW,CAAC,EAAEX,IAAI,EAAEC,SAAS,EAAE,GAAGW,WAA0B;IACvE,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;QAC1CL,KAAK;IACP;IAEA,MAAMM,YAAYjB,iBAAiBC,MAAMC;IAEzC,MAAMgB,gBAAgBrB,mBAAmB;QAAE,GAAGgB,SAAS;QAAE,GAAGI,SAAS;IAAC;IAEtE,qBAAO,KAAClB;QAAe,GAAGmB,aAAa;;AACzC,EAAE"}
|