@salutejs/plasma-new-hope 0.335.1-canary.2202.17587528278.0 → 0.335.1-canary.2202.17607255003.0
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/cjs/engines/common.js +2 -2
- package/cjs/engines/common.js.map +1 -1
- package/emotion/cjs/engines/common.js +2 -2
- package/emotion/es/engines/common.js +2 -2
- package/emotion/es/examples/components/Combobox/Combobox.js +7 -0
- package/es/engines/common.js +2 -2
- package/es/engines/common.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/engines/common.js +2 -2
- package/styled-components/cjs/examples/components/Combobox/Combobox.js +15 -0
- package/styled-components/es/engines/common.js +2 -2
- package/styled-components/es/examples/components/Combobox/Combobox.js +7 -0
- package/types/components/NumberFormat/NumberFormat.d.ts.map +1 -1
- package/types/components/NumberFormat/NumberFormat.types.d.ts +1 -1
- package/types/components/TextField/TextField.types.d.ts +2 -2
- package/types/examples/components/NumberFormat/NumberFormat.d.ts.map +1 -1
package/cjs/engines/common.js
CHANGED
@@ -40,7 +40,7 @@ var mergeConfig = function mergeConfig(baseConfig, userConfig) {
|
|
40
40
|
|
41
41
|
// INFO: Метод, который проводит слияние двух объектов
|
42
42
|
// INFO: если значение явно указанно как undefined/null/пустая строка, то будет взято значение указанное в default
|
43
|
-
function
|
43
|
+
function mergeWithoutNullable(defaults, componentProps) {
|
44
44
|
var props = Object.keys(defaults).reduce(function (acc, key) {
|
45
45
|
return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, acc), {}, _rollupPluginBabelHelpers.defineProperty({}, key, [null, undefined, ''].includes(componentProps[key]) ? defaults[key] : componentProps[key]));
|
46
46
|
}, {});
|
@@ -49,7 +49,7 @@ function mergeWithoutUndefined(defaults, componentProps) {
|
|
49
49
|
function component(config) {
|
50
50
|
var Comp = config.layout(linaria._component(config));
|
51
51
|
return /*#__PURE__*/React__default.default.forwardRef(function (props, ref) {
|
52
|
-
var mergedProps =
|
52
|
+
var mergedProps = mergeWithoutNullable(config === null || config === void 0 ? void 0 : config.defaults, props);
|
53
53
|
return /*#__PURE__*/React__default.default.createElement(Comp, _rollupPluginBabelHelpers.extends({}, mergedProps, {
|
54
54
|
ref: ref
|
55
55
|
}));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.js","sources":["../../src/engines/common.tsx"],"sourcesContent":["import React from 'react';\n\nimport { _component } from './linaria';\nimport type {\n ComponentConfig,\n HTMLTagList,\n PropsType,\n Variants,\n HTMLAttributesWithoutOnChange,\n HTMLAttributesWithoutOnChangeAndDefaultValue,\n} from './types';\n\nexport const mergeConfig = <\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutPropsBase extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>,\n LayoutPropsUser extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>\n | undefined = undefined\n>(\n baseConfig: ComponentConfig<Tag, Variants, PropsType & LayoutPropsBase, LayoutPropsBase>,\n userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>>,\n) => {\n const res = { ...baseConfig, ...userConfig };\n\n if (res.variations) {\n // copy variations base css\n // eslint-disable-next-line guard-for-in\n for (const key in res.variations) {\n const variant = baseConfig.variations[key];\n\n res.variations[key].css = variant?.css;\n /* start of bad decision */\n if (!res.variations[key].true && variant?.true) {\n res.variations[key].true = variant.true;\n }\n /* end of bad decision */\n if (variant?.attrs) {\n res.variations[key].attrs = variant.attrs;\n }\n }\n }\n\n // eslint-disable-next-line guard-for-in\n for (const key in baseConfig.defaults || {}) {\n if (!(key in res.defaults)) {\n res.defaults[key] = baseConfig.defaults[key];\n }\n }\n\n return res as ComponentConfig<\n Tag,\n VariantList,\n PropsType<VariantList>,\n LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser\n >;\n};\n\n// INFO: Метод, который проводит слияние двух объектов\n// INFO: если значение явно указанно как undefined/null/пустая строка, то будет взято значение указанное в default\nfunction
|
1
|
+
{"version":3,"file":"common.js","sources":["../../src/engines/common.tsx"],"sourcesContent":["import React from 'react';\n\nimport { _component } from './linaria';\nimport type {\n ComponentConfig,\n HTMLTagList,\n PropsType,\n Variants,\n HTMLAttributesWithoutOnChange,\n HTMLAttributesWithoutOnChangeAndDefaultValue,\n} from './types';\n\nexport const mergeConfig = <\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutPropsBase extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>,\n LayoutPropsUser extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>\n | undefined = undefined\n>(\n baseConfig: ComponentConfig<Tag, Variants, PropsType & LayoutPropsBase, LayoutPropsBase>,\n userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>>,\n) => {\n const res = { ...baseConfig, ...userConfig };\n\n if (res.variations) {\n // copy variations base css\n // eslint-disable-next-line guard-for-in\n for (const key in res.variations) {\n const variant = baseConfig.variations[key];\n\n res.variations[key].css = variant?.css;\n /* start of bad decision */\n if (!res.variations[key].true && variant?.true) {\n res.variations[key].true = variant.true;\n }\n /* end of bad decision */\n if (variant?.attrs) {\n res.variations[key].attrs = variant.attrs;\n }\n }\n }\n\n // eslint-disable-next-line guard-for-in\n for (const key in baseConfig.defaults || {}) {\n if (!(key in res.defaults)) {\n res.defaults[key] = baseConfig.defaults[key];\n }\n }\n\n return res as ComponentConfig<\n Tag,\n VariantList,\n PropsType<VariantList>,\n LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser\n >;\n};\n\n// INFO: Метод, который проводит слияние двух объектов\n// INFO: если значение явно указанно как undefined/null/пустая строка, то будет взято значение указанное в default\nfunction mergeWithoutNullable(defaults: any, componentProps: any) {\n const props = Object.keys(defaults).reduce((acc, key) => {\n return {\n ...acc,\n [key]: [null, undefined, ''].includes(componentProps[key]) ? defaults[key] : componentProps[key],\n };\n }, {});\n\n return { ...componentProps, ...props };\n}\n\nexport function component<\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutProps extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>\n>(\n config: ComponentConfig<Tag, VariantList, VariantsProps, LayoutProps>,\n): React.FunctionComponent<VariantsProps & LayoutProps> {\n const Comp = config.layout(_component((config as unknown) as ComponentConfig));\n\n return React.forwardRef<VariantsProps & LayoutProps, any>((props, ref) => {\n const mergedProps = mergeWithoutNullable(config?.defaults, props);\n\n return <Comp {...mergedProps} ref={ref} />;\n });\n}\n"],"names":["mergeConfig","baseConfig","userConfig","res","_objectSpread","variations","key","variant","css","attrs","defaults","mergeWithoutNullable","componentProps","props","Object","keys","reduce","acc","_defineProperty","undefined","includes","component","config","Comp","layout","_component","React","forwardRef","ref","mergedProps","createElement","_extends"],"mappings":";;;;;;;;;;;;AAYO,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAcpBC,UAAwF,EACxFC,UAAuF,EACtF;EACD,IAAMC,GAAG,GAAAC,uCAAA,CAAAA,uCAAA,CAAQH,EAAAA,EAAAA,UAAU,CAAKC,EAAAA,UAAU,CAAE,CAAA;EAE5C,IAAIC,GAAG,CAACE,UAAU,EAAE;AAChB;AACA;AACA,IAAA,KAAK,IAAMC,GAAG,IAAIH,GAAG,CAACE,UAAU,EAAE;AAC9B,MAAA,IAAME,OAAO,GAAGN,UAAU,CAACI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,CAAAA,uCAAA,CAAA,EAAA,EACOa,GAAG,CAAAC,EAAAA,EAAAA,EAAAA,wCAAA,CACLZ,EAAAA,EAAAA,GAAG,EAAG,CAAC,IAAI,EAAEa,SAAS,EAAE,EAAE,CAAC,CAACC,QAAQ,CAACR,cAAc,CAACN,GAAG,CAAC,CAAC,GAAGI,QAAQ,CAACJ,GAAG,CAAC,GAAGM,cAAc,CAACN,GAAG,CAAC,CAAA,CAAA,CAAA;GAEvG,EAAE,EAAE,CAAC,CAAA;AAEN,EAAA,OAAAF,uCAAA,CAAAA,uCAAA,CAAYQ,EAAAA,EAAAA,cAAc,GAAKC,KAAK,CAAA,CAAA;AACxC,CAAA;AAEO,SAASQ,SAASA,CASrBC,MAAqE,EACjB;EACpD,IAAMC,IAAI,GAAGD,MAAM,CAACE,MAAM,CAACC,kBAAU,CAAEH,MAAqC,CAAC,CAAC,CAAA;EAE9E,oBAAOI,sBAAK,CAACC,UAAU,CAAmC,UAACd,KAAK,EAAEe,GAAG,EAAK;AACtE,IAAA,IAAMC,WAAW,GAAGlB,oBAAoB,CAACW,MAAM,KAAA,IAAA,IAANA,MAAM,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAANA,MAAM,CAAEZ,QAAQ,EAAEG,KAAK,CAAC,CAAA;IAEjE,oBAAOa,sBAAA,CAAAI,aAAA,CAACP,IAAI,EAAAQ,iCAAA,KAAKF,WAAW,EAAA;AAAED,MAAAA,GAAG,EAAEA,GAAAA;AAAI,KAAA,CAAE,CAAC,CAAA;AAC9C,GAAC,CAAC,CAAA;AACN;;;;;"}
|
@@ -101,7 +101,7 @@ var mergeConfig = function(baseConfig, userConfig) {
|
|
101
101
|
};
|
102
102
|
// INFO: Метод, который проводит слияние двух объектов
|
103
103
|
// INFO: если значение явно указанно как undefined/null/пустая строка, то будет взято значение указанное в default
|
104
|
-
function
|
104
|
+
function mergeWithoutNullable(defaults, componentProps) {
|
105
105
|
var props = Object.keys(defaults).reduce(function(acc, key) {
|
106
106
|
return _object_spread_props(_object_spread({}, acc), _define_property({}, key, [
|
107
107
|
null,
|
@@ -114,7 +114,7 @@ function mergeWithoutUndefined(defaults, componentProps) {
|
|
114
114
|
function component(config) {
|
115
115
|
var Comp = config.layout((0, _emotion._component)(config));
|
116
116
|
return /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
|
117
|
-
var mergedProps =
|
117
|
+
var mergedProps = mergeWithoutNullable(config === null || config === void 0 ? void 0 : config.defaults, props);
|
118
118
|
return /*#__PURE__*/ _react.default.createElement(Comp, _object_spread_props(_object_spread({}, mergedProps), {
|
119
119
|
ref: ref
|
120
120
|
}));
|
@@ -78,7 +78,7 @@ export var mergeConfig = function(baseConfig, userConfig) {
|
|
78
78
|
};
|
79
79
|
// INFO: Метод, который проводит слияние двух объектов
|
80
80
|
// INFO: если значение явно указанно как undefined/null/пустая строка, то будет взято значение указанное в default
|
81
|
-
function
|
81
|
+
function mergeWithoutNullable(defaults, componentProps) {
|
82
82
|
var props = Object.keys(defaults).reduce(function(acc, key) {
|
83
83
|
return _object_spread_props(_object_spread({}, acc), _define_property({}, key, [
|
84
84
|
null,
|
@@ -91,7 +91,7 @@ function mergeWithoutUndefined(defaults, componentProps) {
|
|
91
91
|
export function component(config) {
|
92
92
|
var Comp = config.layout(_component(config));
|
93
93
|
return /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
94
|
-
var mergedProps =
|
94
|
+
var mergedProps = mergeWithoutNullable(config === null || config === void 0 ? void 0 : config.defaults, props);
|
95
95
|
return /*#__PURE__*/ React.createElement(Comp, _object_spread_props(_object_spread({}, mergedProps), {
|
96
96
|
ref: ref
|
97
97
|
}));
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { component, mergeConfig } from "../../../engines";
|
2
|
+
import { comboboxNewConfig } from "../../..";
|
3
|
+
import { config } from "./Combobox.config";
|
4
|
+
var mergedConfig = mergeConfig(comboboxNewConfig, config);
|
5
|
+
var ComboboxComponent = component(mergedConfig);
|
6
|
+
var Combobox = ComboboxComponent;
|
7
|
+
export { Combobox };
|
package/es/engines/common.js
CHANGED
@@ -32,7 +32,7 @@ var mergeConfig = function mergeConfig(baseConfig, userConfig) {
|
|
32
32
|
|
33
33
|
// INFO: Метод, который проводит слияние двух объектов
|
34
34
|
// INFO: если значение явно указанно как undefined/null/пустая строка, то будет взято значение указанное в default
|
35
|
-
function
|
35
|
+
function mergeWithoutNullable(defaults, componentProps) {
|
36
36
|
var props = Object.keys(defaults).reduce(function (acc, key) {
|
37
37
|
return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, key, [null, undefined, ''].includes(componentProps[key]) ? defaults[key] : componentProps[key]));
|
38
38
|
}, {});
|
@@ -41,7 +41,7 @@ function mergeWithoutUndefined(defaults, componentProps) {
|
|
41
41
|
function component(config) {
|
42
42
|
var Comp = config.layout(_component(config));
|
43
43
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
44
|
-
var mergedProps =
|
44
|
+
var mergedProps = mergeWithoutNullable(config === null || config === void 0 ? void 0 : config.defaults, props);
|
45
45
|
return /*#__PURE__*/React.createElement(Comp, _extends({}, mergedProps, {
|
46
46
|
ref: ref
|
47
47
|
}));
|
package/es/engines/common.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.js","sources":["../../src/engines/common.tsx"],"sourcesContent":["import React from 'react';\n\nimport { _component } from './linaria';\nimport type {\n ComponentConfig,\n HTMLTagList,\n PropsType,\n Variants,\n HTMLAttributesWithoutOnChange,\n HTMLAttributesWithoutOnChangeAndDefaultValue,\n} from './types';\n\nexport const mergeConfig = <\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutPropsBase extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>,\n LayoutPropsUser extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>\n | undefined = undefined\n>(\n baseConfig: ComponentConfig<Tag, Variants, PropsType & LayoutPropsBase, LayoutPropsBase>,\n userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>>,\n) => {\n const res = { ...baseConfig, ...userConfig };\n\n if (res.variations) {\n // copy variations base css\n // eslint-disable-next-line guard-for-in\n for (const key in res.variations) {\n const variant = baseConfig.variations[key];\n\n res.variations[key].css = variant?.css;\n /* start of bad decision */\n if (!res.variations[key].true && variant?.true) {\n res.variations[key].true = variant.true;\n }\n /* end of bad decision */\n if (variant?.attrs) {\n res.variations[key].attrs = variant.attrs;\n }\n }\n }\n\n // eslint-disable-next-line guard-for-in\n for (const key in baseConfig.defaults || {}) {\n if (!(key in res.defaults)) {\n res.defaults[key] = baseConfig.defaults[key];\n }\n }\n\n return res as ComponentConfig<\n Tag,\n VariantList,\n PropsType<VariantList>,\n LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser\n >;\n};\n\n// INFO: Метод, который проводит слияние двух объектов\n// INFO: если значение явно указанно как undefined/null/пустая строка, то будет взято значение указанное в default\nfunction
|
1
|
+
{"version":3,"file":"common.js","sources":["../../src/engines/common.tsx"],"sourcesContent":["import React from 'react';\n\nimport { _component } from './linaria';\nimport type {\n ComponentConfig,\n HTMLTagList,\n PropsType,\n Variants,\n HTMLAttributesWithoutOnChange,\n HTMLAttributesWithoutOnChangeAndDefaultValue,\n} from './types';\n\nexport const mergeConfig = <\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutPropsBase extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>,\n LayoutPropsUser extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>\n | undefined = undefined\n>(\n baseConfig: ComponentConfig<Tag, Variants, PropsType & LayoutPropsBase, LayoutPropsBase>,\n userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>>,\n) => {\n const res = { ...baseConfig, ...userConfig };\n\n if (res.variations) {\n // copy variations base css\n // eslint-disable-next-line guard-for-in\n for (const key in res.variations) {\n const variant = baseConfig.variations[key];\n\n res.variations[key].css = variant?.css;\n /* start of bad decision */\n if (!res.variations[key].true && variant?.true) {\n res.variations[key].true = variant.true;\n }\n /* end of bad decision */\n if (variant?.attrs) {\n res.variations[key].attrs = variant.attrs;\n }\n }\n }\n\n // eslint-disable-next-line guard-for-in\n for (const key in baseConfig.defaults || {}) {\n if (!(key in res.defaults)) {\n res.defaults[key] = baseConfig.defaults[key];\n }\n }\n\n return res as ComponentConfig<\n Tag,\n VariantList,\n PropsType<VariantList>,\n LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser\n >;\n};\n\n// INFO: Метод, который проводит слияние двух объектов\n// INFO: если значение явно указанно как undefined/null/пустая строка, то будет взято значение указанное в default\nfunction mergeWithoutNullable(defaults: any, componentProps: any) {\n const props = Object.keys(defaults).reduce((acc, key) => {\n return {\n ...acc,\n [key]: [null, undefined, ''].includes(componentProps[key]) ? defaults[key] : componentProps[key],\n };\n }, {});\n\n return { ...componentProps, ...props };\n}\n\nexport function component<\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutProps extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>\n>(\n config: ComponentConfig<Tag, VariantList, VariantsProps, LayoutProps>,\n): React.FunctionComponent<VariantsProps & LayoutProps> {\n const Comp = config.layout(_component((config as unknown) as ComponentConfig));\n\n return React.forwardRef<VariantsProps & LayoutProps, any>((props, ref) => {\n const mergedProps = mergeWithoutNullable(config?.defaults, props);\n\n return <Comp {...mergedProps} ref={ref} />;\n });\n}\n"],"names":["mergeConfig","baseConfig","userConfig","res","_objectSpread","variations","key","variant","css","attrs","defaults","mergeWithoutNullable","componentProps","props","Object","keys","reduce","acc","_defineProperty","undefined","includes","component","config","Comp","layout","_component","React","forwardRef","ref","mergedProps","createElement","_extends"],"mappings":";;;;AAYO,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAcpBC,UAAwF,EACxFC,UAAuF,EACtF;EACD,IAAMC,GAAG,GAAAC,cAAA,CAAAA,cAAA,CAAQH,EAAAA,EAAAA,UAAU,CAAKC,EAAAA,UAAU,CAAE,CAAA;EAE5C,IAAIC,GAAG,CAACE,UAAU,EAAE;AAChB;AACA;AACA,IAAA,KAAK,IAAMC,GAAG,IAAIH,GAAG,CAACE,UAAU,EAAE;AAC9B,MAAA,IAAME,OAAO,GAAGN,UAAU,CAACI,UAAU,CAACC,GAAG,CAAC,CAAA;AAE1CH,MAAAA,GAAG,CAACE,UAAU,CAACC,GAAG,CAAC,CAACE,GAAG,GAAGD,OAAO,KAAPA,IAAAA,IAAAA,OAAO,KAAPA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,OAAO,CAAEC,GAAG,CAAA;AACtC;AACA,MAAA,IAAI,CAACL,GAAG,CAACE,UAAU,CAACC,GAAG,CAAC,CAAK,MAAA,CAAA,IAAIC,OAAO,KAAPA,IAAAA,IAAAA,OAAO,KAAPA,KAAAA,CAAAA,IAAAA,OAAO,QAAM,EAAE;QAC5CJ,GAAG,CAACE,UAAU,CAACC,GAAG,CAAC,CAAK,MAAA,CAAA,GAAGC,OAAO,CAAK,MAAA,CAAA,CAAA;AAC3C,OAAA;AACA;AACA,MAAA,IAAIA,OAAO,KAAPA,IAAAA,IAAAA,OAAO,eAAPA,OAAO,CAAEE,KAAK,EAAE;QAChBN,GAAG,CAACE,UAAU,CAACC,GAAG,CAAC,CAACG,KAAK,GAAGF,OAAO,CAACE,KAAK,CAAA;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KAAA,IAAA,IAANA,MAAM,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAANA,MAAM,CAAEZ,QAAQ,EAAEG,KAAK,CAAC,CAAA;IAEjE,oBAAOa,KAAA,CAAAI,aAAA,CAACP,IAAI,EAAAQ,QAAA,KAAKF,WAAW,EAAA;AAAED,MAAAA,GAAG,EAAEA,GAAAA;AAAI,KAAA,CAAE,CAAC,CAAA;AAC9C,GAAC,CAAC,CAAA;AACN;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.335.1-canary.2202.
|
3
|
+
"version": "0.335.1-canary.2202.17607255003.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -137,5 +137,5 @@
|
|
137
137
|
"sideEffects": [
|
138
138
|
"*.css"
|
139
139
|
],
|
140
|
-
"gitHead": "
|
140
|
+
"gitHead": "93f429406f702320866ab249a386a418f20d1807"
|
141
141
|
}
|
@@ -101,7 +101,7 @@ var mergeConfig = function(baseConfig, userConfig) {
|
|
101
101
|
};
|
102
102
|
// INFO: Метод, который проводит слияние двух объектов
|
103
103
|
// INFO: если значение явно указанно как undefined/null/пустая строка, то будет взято значение указанное в default
|
104
|
-
function
|
104
|
+
function mergeWithoutNullable(defaults, componentProps) {
|
105
105
|
var props = Object.keys(defaults).reduce(function(acc, key) {
|
106
106
|
return _object_spread_props(_object_spread({}, acc), _define_property({}, key, [
|
107
107
|
null,
|
@@ -114,7 +114,7 @@ function mergeWithoutUndefined(defaults, componentProps) {
|
|
114
114
|
function component(config) {
|
115
115
|
var Comp = config.layout((0, _styledcomponents._component)(config));
|
116
116
|
return /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
|
117
|
-
var mergedProps =
|
117
|
+
var mergedProps = mergeWithoutNullable(config === null || config === void 0 ? void 0 : config.defaults, props);
|
118
118
|
return /*#__PURE__*/ _react.default.createElement(Comp, _object_spread_props(_object_spread({}, mergedProps), {
|
119
119
|
ref: ref
|
120
120
|
}));
|
@@ -1 +1,16 @@
|
|
1
1
|
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "Combobox", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return Combobox;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
var _engines = require("../../../engines");
|
12
|
+
var _ = require("../../..");
|
13
|
+
var _Comboboxconfig = require("./Combobox.config");
|
14
|
+
var mergedConfig = (0, _engines.mergeConfig)(_.comboboxNewConfig, _Comboboxconfig.config);
|
15
|
+
var ComboboxComponent = (0, _engines.component)(mergedConfig);
|
16
|
+
var Combobox = ComboboxComponent;
|
@@ -78,7 +78,7 @@ export var mergeConfig = function(baseConfig, userConfig) {
|
|
78
78
|
};
|
79
79
|
// INFO: Метод, который проводит слияние двух объектов
|
80
80
|
// INFO: если значение явно указанно как undefined/null/пустая строка, то будет взято значение указанное в default
|
81
|
-
function
|
81
|
+
function mergeWithoutNullable(defaults, componentProps) {
|
82
82
|
var props = Object.keys(defaults).reduce(function(acc, key) {
|
83
83
|
return _object_spread_props(_object_spread({}, acc), _define_property({}, key, [
|
84
84
|
null,
|
@@ -91,7 +91,7 @@ function mergeWithoutUndefined(defaults, componentProps) {
|
|
91
91
|
export function component(config) {
|
92
92
|
var Comp = config.layout(_component(config));
|
93
93
|
return /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
94
|
-
var mergedProps =
|
94
|
+
var mergedProps = mergeWithoutNullable(config === null || config === void 0 ? void 0 : config.defaults, props);
|
95
95
|
return /*#__PURE__*/ React.createElement(Comp, _object_spread_props(_object_spread({}, mergedProps), {
|
96
96
|
ref: ref
|
97
97
|
}));
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { component, mergeConfig } from "../../../engines";
|
2
|
+
import { comboboxNewConfig } from "../../..";
|
3
|
+
import { config } from "./Combobox.config";
|
4
|
+
var mergedConfig = mergeConfig(comboboxNewConfig, config);
|
5
|
+
var ComboboxComponent = component(mergedConfig);
|
6
|
+
var Combobox = ComboboxComponent;
|
7
|
+
export { Combobox };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NumberFormat.d.ts","sourceRoot":"","sources":["../../../src/components/NumberFormat/NumberFormat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,EAAE,EAAkB,MAAM,OAAO,CAAC;AAE7D,OAAO,KAAK,EAAE,kBAAkB,EAAc,MAAM,qBAAqB,CAAC;AAG1E,OAAO,KAAK,EAER,wBAAwB,EACxB,0BAA0B,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,0BAA0B,kBAAkB,EAAE,CAAC,CAAC,CAAC;;;;;;;;;qBA+
|
1
|
+
{"version":3,"file":"NumberFormat.d.ts","sourceRoot":"","sources":["../../../src/components/NumberFormat/NumberFormat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,EAAE,EAAkB,MAAM,OAAO,CAAC;AAE7D,OAAO,KAAK,EAAE,kBAAkB,EAAc,MAAM,qBAAqB,CAAC;AAG1E,OAAO,KAAK,EAER,wBAAwB,EACxB,0BAA0B,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,0BAA0B,kBAAkB,EAAE,CAAC,CAAC,CAAC;;;;;;;;;qBA+C3D,CAAC,uCAEb,CAAhB;mGA+BP,CAAC"}
|
@@ -47,7 +47,7 @@ export type CustomNumberFormatProps = {
|
|
47
47
|
*/
|
48
48
|
isAllowed?: (values: NumberFormatValues) => boolean;
|
49
49
|
/**
|
50
|
-
*
|
50
|
+
* Callback, вызываемый при изменении значения в поле ввода.
|
51
51
|
* Принимает событие изменения (ChangeEvent) и объект NumberFormatValues:
|
52
52
|
* ```
|
53
53
|
* floatValue: number | undefined;
|
@@ -211,11 +211,11 @@ export type TextFieldPropsBase = {
|
|
211
211
|
*/
|
212
212
|
contentRight?: React.ReactElement;
|
213
213
|
/**
|
214
|
-
* Слот для вспомогательного текста
|
214
|
+
* Слот для вспомогательного текста слева.
|
215
215
|
*/
|
216
216
|
textBefore?: string;
|
217
217
|
/**
|
218
|
-
* Слот для вспомогательного текста
|
218
|
+
* Слот для вспомогательного текста справа.
|
219
219
|
*/
|
220
220
|
textAfter?: string;
|
221
221
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NumberFormat.d.ts","sourceRoot":"","sources":["../../../../src/examples/components/NumberFormat/NumberFormat.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBACqjL,MAAO,YAAY;mBAAqE,MAAO,YAAY;;;oCAAuQ,CAAC;;;;;;;;;;;;;;;;;;;;oCAA9lK,CAAC;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"NumberFormat.d.ts","sourceRoot":"","sources":["../../../../src/examples/components/NumberFormat/NumberFormat.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBACqjL,MAAO,YAAY;mBAAqE,MAAO,YAAY;;;oCAAuQ,CAAC;;;;;;;;;;;;;;;;;;;;oCAA9lK,CAAC;;;;;;;;;;;;;qBAAsxC,CAAC,uDAAuC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAAk7G,YAAY;yBAA4E,YAAY;;;oCAAuQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAv0H,CAAC,uDA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