@pega/cosmos-react-build 9.0.0-build.6.14 → 9.0.0-build.6.15
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/lib/components/DynamicInput/BooleanControl.d.ts +1 -1
- package/lib/components/DynamicInput/BooleanControl.d.ts.map +1 -1
- package/lib/components/DynamicInput/BooleanControl.js.map +1 -1
- package/lib/components/DynamicInput/ConstantControl.d.ts +2 -2
- package/lib/components/DynamicInput/ConstantControl.d.ts.map +1 -1
- package/lib/components/DynamicInput/ConstantControl.js.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.styles.d.ts +0 -1
- package/lib/components/DynamicInput/DynamicInput.styles.d.ts.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.styles.js +49 -43
- package/lib/components/DynamicInput/DynamicInput.styles.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import type { ComboBoxProps } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { ConstantBooleanConfig } from './ConstantControl';
|
|
4
|
-
type BooleanControlProps = ConstantBooleanConfig['props'] & Pick<ComboBoxProps, 'required'>;
|
|
4
|
+
type BooleanControlProps = ConstantBooleanConfig['props'] & Pick<ComboBoxProps, 'required' | 'disabled' | 'status' | 'readOnly'>;
|
|
5
5
|
declare const BooleanControl: FC<BooleanControlProps>;
|
|
6
6
|
export default BooleanControl;
|
|
7
7
|
//# sourceMappingURL=BooleanControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanControl.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/BooleanControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,KAAK,mBAAmB,GAAG,qBAAqB,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"BooleanControl.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/BooleanControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,KAAK,mBAAmB,GAAG,qBAAqB,CAAC,OAAO,CAAC,GACvD,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC,CAAC;AAEvE,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAqC3C,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanControl.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/BooleanControl.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"BooleanControl.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/BooleanControl.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAO5D,MAAM,cAAc,GAA4B,CAAC,EAC/C,aAAa,EACb,KAAK,EACL,QAAQ,EACR,EAAE,EACF,QAAQ,EACR,GAAG,SAAS,EACQ,EAAE,EAAE;IACxB,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,SAAS,GACb,aAAa,KAAK,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAEzF,MAAM,KAAK,GAAG;QACZ,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,KAAK,IAAI,EAAE;QAC/D,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE;KACzD,CAAC;IAEF,OAAO,CACL,KAAC,QAAQ,OACH,SAAS,EACb,QAAQ,EAAE;YACR,KAAK,EAAE;gBACL,EAAE,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;gBAC9C,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO;aAC3D;SACF,EACD,IAAI,EAAE;YACJ,IAAI,EAAE,eAAe;YACrB,KAAK;YACL,WAAW,EAAE,MAAM,CAAC,EAAE;gBACpB,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;YAC9B,CAAC;SACF,EACD,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import type { FC } from 'react';\n\nimport type { ComboBoxProps } from '@pega/cosmos-react-core';\nimport { ComboBox, useI18n } from '@pega/cosmos-react-core';\n\nimport type { ConstantBooleanConfig } from './ConstantControl';\n\ntype BooleanControlProps = ConstantBooleanConfig['props'] &\n Pick<ComboBoxProps, 'required' | 'disabled' | 'status' | 'readOnly'>;\n\nconst BooleanControl: FC<BooleanControlProps> = ({\n booleanLabels,\n value,\n onChange,\n id,\n required,\n ...restProps\n}: BooleanControlProps) => {\n const t = useI18n();\n const primaries =\n booleanLabels === 'always|never' ? [t('always'), t('never')] : [t('true'), t('false')];\n\n const items = [\n { id: 'true', primary: primaries[0], selected: value === true },\n { id: 'false', primary: primaries[1], selected: !value }\n ];\n\n return (\n <ComboBox\n {...restProps}\n selected={{\n items: {\n id: value === true ? items[0].id : items[1].id,\n text: value === true ? items[0].primary : items[1].primary\n }\n }}\n menu={{\n mode: 'single-select',\n items,\n onItemClick: itemId => {\n onChange(itemId === 'true');\n }\n }}\n id={id}\n required={required}\n />\n );\n};\n\nexport default BooleanControl;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComboBoxProps, CurrencyInputProps, DateInputProps, DateTimeInputProps, FormControlProps, InputProps, NumberInputProps, OmitStrict, PhoneInputProps, TextAreaProps, TimeInputProps } from '@pega/cosmos-react-core';
|
|
2
|
-
export type FormControlPropsToOmit = keyof Pick<FormControlProps, 'label' | 'labelHidden' | 'additionalInfo' | 'info' | 'required'
|
|
2
|
+
export type FormControlPropsToOmit = keyof Pick<FormControlProps, 'label' | 'labelHidden' | 'additionalInfo' | 'info' | 'required'>;
|
|
3
3
|
type ConstantTextConfig = {
|
|
4
4
|
format: 'Text';
|
|
5
5
|
props: OmitStrict<InputProps, FormControlPropsToOmit | 'onChange'> & {
|
|
@@ -54,7 +54,7 @@ type ConstantPhoneConfig = {
|
|
|
54
54
|
props: OmitStrict<PhoneInputProps, FormControlPropsToOmit | 'showCountryCode'>;
|
|
55
55
|
};
|
|
56
56
|
export type ConstantControlConfig = ConstantTextConfig | ConstantDecimalConfig | ConstantIntegerConfig | ConstantPercentageConfig | ConstantTextAreaConfig | ConstantDateConfig | ConstantDateTimeConfig | ConstantTimeConfig | ConstantBooleanConfig | ConstantCurrencyConfig | ConstantPhoneConfig;
|
|
57
|
-
declare const ConstantControl: ({ format, props, required, "data-testid": testId, id: inputUid }: Pick<FormControlProps, "id" | "required"> & {
|
|
57
|
+
declare const ConstantControl: ({ format, props, required, "data-testid": testId, id: inputUid }: Pick<FormControlProps, "id" | "required" | "disabled" | "status" | "readOnly"> & {
|
|
58
58
|
"data-testid"?: string;
|
|
59
59
|
} & ConstantControlConfig) => JSX.Element | null;
|
|
60
60
|
export default ConstantControl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConstantControl.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/ConstantControl.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,aAAa,EACb,cAAc,EACf,MAAM,yBAAyB,CAAC;AAIjC,MAAM,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAC7C,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ConstantControl.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/ConstantControl.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,aAAa,EACb,cAAc,EACf,MAAM,yBAAyB,CAAC;AAIjC,MAAM,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAC7C,gBAAgB,EAChB,OAAO,GAAG,aAAa,GAAG,gBAAgB,GAAG,MAAM,GAAG,UAAU,CACjE,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,UAAU,CAAC,UAAU,EAAE,sBAAsB,GAAG,UAAU,CAAC,GAAG;QACnE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;KAC/C,CAAC;CACH,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,M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sB,GAAG,OAAO,GAAG,UAAU,CAAC,GAAG;QAChF,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;QACnC,aAAa,CAAC,EAAE,aAAa,CAAC;KAC/B,CAAC;CACH,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,CAAC;CAC/D,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,UAAU,CAAC,eAAe,EAAE,sBAAsB,GAAG,iBAAiB,CAAC,CAAC;CAChF,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAC7B,kBAAkB,GAClB,qBAAqB,GACrB,qBAAqB,GACrB,wBAAwB,GACxB,sBAAsB,GACtB,kBAAkB,GAClB,sBAAsB,GACtB,kBAAkB,GAClB,qBAAqB,GACrB,sBAAsB,GACtB,mBAAmB,CAAC;AAExB,QAAA,MAAM,eAAe,GAAI,kEAMtB,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC,GAAG;IAClF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,qBAAqB,uBA2GxB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConstantControl.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/ConstantControl.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,aAAa,EACb,SAAS,EACT,aAAa,EACb,KAAK,EACL,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACV,MAAM,yBAAyB,CAAC;AAejC,OAAO,cAAc,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConstantControl.js","sourceRoot":"","sources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K,YAAY,IAAI;QACrB,KAAK,KAAK,SAAS,EACnB,CAAC;QACD,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;YAC1B,OAAO,GAAG,KAAC,aAAa,OAAK,KAAK,iBAAe,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;QAChG,CAAC;QAED,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACtB,OAAO,GAAG,KAAC,SAAS,OAAK,KAAK,iBAAe,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;QAC5F,CAAC;QAED,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACtB,OAAO,GAAG,KAAC,SAAS,OAAK,KAAK,iBAAe,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;QAC5F,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import type { ChangeEvent } from 'react';\n\nimport {\n CurrencyInput,\n DateInput,\n DateTimeInput,\n Input,\n NumberInput,\n PhoneInput,\n TextArea,\n TimeInput\n} from '@pega/cosmos-react-core';\nimport type {\n ComboBoxProps,\n CurrencyInputProps,\n DateInputProps,\n DateTimeInputProps,\n FormControlProps,\n InputProps,\n NumberInputProps,\n OmitStrict,\n PhoneInputProps,\n TextAreaProps,\n TimeInputProps\n} from '@pega/cosmos-react-core';\n\nimport BooleanControl from './BooleanControl';\n\nexport type FormControlPropsToOmit = keyof Pick<\n FormControlProps,\n 'label' | 'labelHidden' | 'additionalInfo' | 'info' | 'required'\n>;\n\ntype ConstantTextConfig = {\n format: 'Text';\n props: OmitStrict<InputProps, FormControlPropsToOmit | 'onChange'> & {\n onChange: (value: string | undefined) => void;\n };\n};\n\ntype ConstantDecimalConfig = {\n format: 'Decimal';\n props: OmitStrict<NumberInputProps, FormControlPropsToOmit>;\n};\n\ntype ConstantIntegerConfig = {\n format: 'Integer';\n props: OmitStrict<\n NumberInputProps,\n FormControlPropsToOmit | 'showGroupSeparators' | 'showDecimal'\n >;\n};\n\ntype ConstantPercentageConfig = {\n format: 'Percentage';\n props: OmitStrict<\n NumberInputProps,\n FormControlPropsToOmit | 'showGroupSeparators' | 'numberOfDecimals' | 'unit'\n >;\n};\n\ntype ConstantTextAreaConfig = {\n format: 'Text (paragraph)';\n props: OmitStrict<TextAreaProps, FormControlPropsToOmit | 'onChange'> & {\n onChange: (value: string | undefined) => void;\n };\n};\n\ntype ConstantDateConfig = {\n format: 'Date';\n props: OmitStrict<DateInputProps, FormControlPropsToOmit>;\n};\n\ntype ConstantDateTimeConfig = {\n format: 'DateTime';\n props: OmitStrict<DateTimeInputProps, FormControlPropsToOmit>;\n};\n\ntype ConstantTimeConfig = {\n format: 'Time';\n props: OmitStrict<TimeInputProps, FormControlPropsToOmit>;\n};\n\nexport type BooleanLabels = 'true|false' | 'always|never';\n\nexport type ConstantBooleanConfig = {\n format: 'Boolean';\n props: OmitStrict<ComboBoxProps, FormControlPropsToOmit | 'value' | 'onChange'> & {\n value?: boolean;\n onChange: (value: boolean) => void;\n booleanLabels?: BooleanLabels;\n };\n};\n\ntype ConstantCurrencyConfig = {\n format: 'Currency';\n props: OmitStrict<CurrencyInputProps, FormControlPropsToOmit>;\n};\n\ntype ConstantPhoneConfig = {\n format: 'Phone';\n props: OmitStrict<PhoneInputProps, FormControlPropsToOmit | 'showCountryCode'>;\n};\n\nexport type ConstantControlConfig =\n | ConstantTextConfig\n | ConstantDecimalConfig\n | ConstantIntegerConfig\n | ConstantPercentageConfig\n | ConstantTextAreaConfig\n | ConstantDateConfig\n | ConstantDateTimeConfig\n | ConstantTimeConfig\n | ConstantBooleanConfig\n | ConstantCurrencyConfig\n | ConstantPhoneConfig;\n\nconst ConstantControl = ({\n format,\n props,\n required,\n 'data-testid': testId,\n id: inputUid\n}: Pick<FormControlProps, 'id' | 'required' | 'disabled' | 'status' | 'readOnly'> & {\n 'data-testid'?: string;\n} & ConstantControlConfig) => {\n let control: JSX.Element | null = null;\n\n const { value } = props;\n // Note: This is just a typeguard for the value prop.\n if (typeof value === 'string' || value === undefined) {\n if (format === 'Text') {\n control = (\n <Input\n {...props}\n data-testid={testId}\n id={inputUid}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n props.onChange(e.target.value);\n }}\n required={required}\n />\n );\n }\n\n if (format === 'Text (paragraph)') {\n control = (\n <TextArea\n {...props}\n data-testid={testId}\n id={inputUid}\n onChange={(e: ChangeEvent<HTMLTextAreaElement>) => {\n props.onChange(e.target.value);\n }}\n required={required}\n />\n );\n }\n\n if (format === 'Currency') {\n control = <CurrencyInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n if (format === 'Percentage') {\n control = (\n <NumberInput\n {...props}\n data-testid={testId}\n id={inputUid}\n showGroupSeparators={false}\n numberOfDecimals={undefined}\n unit='percent'\n required={required}\n />\n );\n }\n\n if (format === 'Integer') {\n control = (\n <NumberInput\n {...props}\n data-testid={testId}\n id={inputUid}\n showGroupSeparators={false}\n // Note: Getting single occurrence of callback when '.' is entered w/o showDecimal = false.\n showDecimal={false}\n required={required}\n />\n );\n }\n\n if (format === 'Decimal') {\n control = <NumberInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n if (format === 'Phone') {\n control = (\n <PhoneInput\n {...props}\n data-testid={testId}\n id={inputUid}\n required={required}\n showCountryCode\n />\n );\n }\n }\n\n if (format === 'Boolean') {\n control = <BooleanControl {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n // Note: This is just a typeguard for the value prop.\n if (\n typeof value === 'string' ||\n typeof value === 'number' ||\n value instanceof Date ||\n value === undefined\n ) {\n if (format === 'DateTime') {\n control = <DateTimeInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n if (format === 'Date') {\n control = <DateInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n\n if (format === 'Time') {\n control = <TimeInput {...props} data-testid={testId} id={inputUid} required={required} />;\n }\n }\n return control;\n};\n\nexport default ConstantControl;\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const StyledExpressionBuilderButton: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").ButtonProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
2
1
|
export declare const StyledExpressionControl: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").FlexProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
3
2
|
export declare const StyledDynamicInput: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
3
|
//# sourceMappingURL=DynamicInput.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicInput.styles.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/DynamicInput.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DynamicInput.styles.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/DynamicInput.styles.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,uBAAuB,kNAAiB,CAAC;AAEtD,eAAO,MAAM,kBAAkB,yGAsE9B,CAAC"}
|
|
@@ -1,61 +1,67 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import {
|
|
2
|
+
import { Flex, StyledFormControl, StyledGrid, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
3
3
|
import { StyledMenuButton } from '@pega/cosmos-react-core/lib/components/MenuButton/MenuButton';
|
|
4
|
-
|
|
4
|
+
import { StyledContentWrapper, StyledInputTree } from '../ObjectSelect/InputTree/InputTree.styles';
|
|
5
|
+
import { StyledFieldReferenceInput, StyledFieldReferencePicker } from '../FieldReference/FieldReference.styles';
|
|
5
6
|
export const StyledExpressionControl = styled(Flex) ``;
|
|
6
|
-
export const StyledDynamicInput = styled.div(({ theme }) => {
|
|
7
|
+
export const StyledDynamicInput = styled.div(({ theme: { base: { palette: { 'foreground-color': foregroundColor }, 'content-width': contentWidth }, components: { 'form-control': { 'border-color': formControlBorderColor } } } }) => {
|
|
7
8
|
return css `
|
|
8
|
-
|
|
9
|
+
display: flex;
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
width: 100%;
|
|
14
|
-
}
|
|
11
|
+
${StyledInputTree} {
|
|
12
|
+
margin-inline-start: -2.5rem;
|
|
13
|
+
}
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
${StyledFieldReferencePicker} > ${StyledFieldReferenceInput} > ${StyledGrid} {
|
|
16
|
+
padding: 0;
|
|
17
|
+
}
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
${StyledContentWrapper} {
|
|
20
|
+
padding-block-start: 0;
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
.CodeMirror-wrap {
|
|
26
|
-
border-color: ${theme.components['form-control']['border-color']};
|
|
23
|
+
${StyledFormControl} {
|
|
27
24
|
border-start-start-radius: 0;
|
|
28
25
|
border-end-start-radius: 0;
|
|
26
|
+
width: 100%;
|
|
29
27
|
}
|
|
30
28
|
|
|
31
|
-
${
|
|
32
|
-
position:
|
|
33
|
-
z-index:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
${StyledExpressionControl} {
|
|
30
|
+
position: relative;
|
|
31
|
+
z-index: 1;
|
|
32
|
+
|
|
33
|
+
.react-codemirror2 {
|
|
34
|
+
min-height: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.CodeMirror,
|
|
38
|
+
.CodeMirror-wrap {
|
|
39
|
+
border-color: ${formControlBorderColor};
|
|
40
|
+
border-start-start-radius: 0;
|
|
41
|
+
border-end-start-radius: 0;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
${StyledMenuButton} {
|
|
46
|
+
z-index: 0;
|
|
47
|
+
border-inline-end: 0;
|
|
48
|
+
border-color: ${formControlBorderColor};
|
|
49
|
+
border-start-end-radius: 0;
|
|
50
|
+
border-end-end-radius: 0;
|
|
51
|
+
align-self: flex-start;
|
|
52
|
+
color: ${foregroundColor};
|
|
53
|
+
&:focus {
|
|
54
|
+
z-index: 2;
|
|
55
|
+
}
|
|
38
56
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
border-start-end-radius: 0;
|
|
46
|
-
border-end-end-radius: 0;
|
|
47
|
-
color: ${theme.base.palette['foreground-color']};
|
|
48
|
-
&:focus {
|
|
49
|
-
z-index: 2;
|
|
57
|
+
|
|
58
|
+
${StyledMenuButton} + * {
|
|
59
|
+
flex-grow: 1;
|
|
60
|
+
z-index: 1;
|
|
61
|
+
width: 100%;
|
|
62
|
+
min-width: ${contentWidth.xs};
|
|
50
63
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
${StyledMenuButton} + * {
|
|
54
|
-
flex-grow: 1;
|
|
55
|
-
z-index: 1;
|
|
56
|
-
min-width: ${theme.base['content-width'].xs};
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
64
|
+
`;
|
|
59
65
|
});
|
|
60
66
|
StyledDynamicInput.defaultProps = defaultThemeProp;
|
|
61
67
|
//# sourceMappingURL=DynamicInput.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicInput.styles.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/DynamicInput.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"DynamicInput.styles.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/DynamicInput.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAEhG,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AACnG,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,yCAAyC,CAAC;AAEjD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA,EAAE,CAAC;AAEtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAC1C,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,OAAO,EAAE,EAAE,kBAAkB,EAAE,eAAe,EAAE,EAChD,eAAe,EAAE,YAAY,EAC9B,EACD,UAAU,EAAE,EACV,cAAc,EAAE,EAAE,cAAc,EAAE,sBAAsB,EAAE,EAC3D,EACF,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;;;QAGN,eAAe;;;;QAIf,0BAA0B,MAAM,yBAAyB,MAAM,UAAU;;;;QAIzE,oBAAoB;;;;QAIpB,iBAAiB;;;;;;QAMjB,uBAAuB;;;;;;;;;;0BAUL,sBAAsB;;;;;;QAMxC,gBAAgB;;;wBAGA,sBAAsB;;;;iBAI7B,eAAe;;;;;;QAMxB,gBAAgB;;;;qBAIH,YAAY,CAAC,EAAE;;KAE/B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { Flex, StyledFormControl, StyledGrid, defaultThemeProp } from '@pega/cosmos-react-core';\nimport { StyledMenuButton } from '@pega/cosmos-react-core/lib/components/MenuButton/MenuButton';\n\nimport { StyledContentWrapper, StyledInputTree } from '../ObjectSelect/InputTree/InputTree.styles';\nimport {\n StyledFieldReferenceInput,\n StyledFieldReferencePicker\n} from '../FieldReference/FieldReference.styles';\n\nexport const StyledExpressionControl = styled(Flex)``;\n\nexport const StyledDynamicInput = styled.div(\n ({\n theme: {\n base: {\n palette: { 'foreground-color': foregroundColor },\n 'content-width': contentWidth\n },\n components: {\n 'form-control': { 'border-color': formControlBorderColor }\n }\n }\n }) => {\n return css`\n display: flex;\n\n ${StyledInputTree} {\n margin-inline-start: -2.5rem;\n }\n\n ${StyledFieldReferencePicker} > ${StyledFieldReferenceInput} > ${StyledGrid} {\n padding: 0;\n }\n\n ${StyledContentWrapper} {\n padding-block-start: 0;\n }\n\n ${StyledFormControl} {\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n width: 100%;\n }\n\n ${StyledExpressionControl} {\n position: relative;\n z-index: 1;\n\n .react-codemirror2 {\n min-height: 0;\n }\n\n .CodeMirror,\n .CodeMirror-wrap {\n border-color: ${formControlBorderColor};\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n }\n\n ${StyledMenuButton} {\n z-index: 0;\n border-inline-end: 0;\n border-color: ${formControlBorderColor};\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n align-self: flex-start;\n color: ${foregroundColor};\n &:focus {\n z-index: 2;\n }\n }\n\n ${StyledMenuButton} + * {\n flex-grow: 1;\n z-index: 1;\n width: 100%;\n min-width: ${contentWidth.xs};\n }\n `;\n }\n);\n\nStyledDynamicInput.defaultProps = defaultThemeProp;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-build",
|
|
3
|
-
"version": "9.0.0-build.6.
|
|
3
|
+
"version": "9.0.0-build.6.15",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"author": "Pegasystems",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-core": "9.0.0-build.6.
|
|
18
|
-
"@pega/cosmos-react-dnd": "9.0.0-build.6.
|
|
19
|
-
"@pega/cosmos-react-rte": "9.0.0-build.6.
|
|
17
|
+
"@pega/cosmos-react-core": "9.0.0-build.6.15",
|
|
18
|
+
"@pega/cosmos-react-dnd": "9.0.0-build.6.15",
|
|
19
|
+
"@pega/cosmos-react-rte": "9.0.0-build.6.15",
|
|
20
20
|
"@types/codemirror": "^5.60.15",
|
|
21
21
|
"@types/dagre": "^0.7.46",
|
|
22
22
|
"@types/react": "^17.0.62 || ^18.3.3",
|