@pega/lists-core 9.0.0-build.1.0 → 9.0.0-build.2.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.
@@ -1,3 +1,4 @@
1
+ import type defaultTranslations from '../src/core/defaultTranslations';
1
2
  import type { RowData } from '../src/core/generators/RowGenerator.types';
2
3
  import type { ApiContext } from './ApiContext.types';
3
4
  import type { FieldDef, StyleFormat, Meta } from './Meta.types';
@@ -22,8 +23,6 @@ export interface FormatterOption {
22
23
  rowData: RowData[];
23
24
  /** Field definition of the column */
24
25
  fieldDef: FieldDef;
25
- /** Translate function to translate strings */
26
- translate: (label: string) => string;
27
26
  }
28
27
  export interface Formatters {
29
28
  /** Formatter function mapping for different data types */
@@ -99,5 +98,7 @@ export default interface RsCoreBootArgs {
99
98
  * @returns {void} void
100
99
  */
101
100
  onRowClickAction?: OnRowClickAction;
101
+ /** Used to provide localized strings, typically overriding default translations. */
102
+ translations?: Partial<typeof defaultTranslations>;
102
103
  }
103
104
  //# sourceMappingURL=RsCoreBootArgs.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RsCoreBootArgs.types.d.ts","sourceRoot":"","sources":["../../types/RsCoreBootArgs.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AAEzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG;IAC1B,0GAA0G;IAC1G,QAAQ,EAAE,CAAC,OAAO,EAAE,KAAK,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,G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gs.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { RowData } from '../src/core/generators/RowGenerator.types';\n\nimport type { ApiContext } from './ApiContext.types';\nimport type { FieldDef, StyleFormat, Meta } from './Meta.types';\nimport type { State } from './State.types';\n\nexport type ExternalStore = {\n /** A state communication api to communicate latest state of repeating structure core to it's consumer. */\n dispatch: (rsState: State) => void;\n};\n\nexport type RenderFactoryWithProps = {\n props: { [key: string]: string | boolean | number | Date | Function | object } | null | undefined;\n component: Function | null | undefined;\n};\n\n/** Options passed to formatter to convey locale, timezone, translate etc */\nexport interface FormatterOption {\n /** Locale to be used for the formatter - jp_JP, fr_FR, en_US etc */\n locale: string;\n\n /** Current timezone to be considered for formatting values */\n timezone: string;\n\n /** Row data */\n rowData: RowData[];\n\n /** Field definition of the column */\n fieldDef: FieldDef;\n\n /** Translate function to translate strings */\n translate: (label: string) => string;\n}\n\nexport interface Formatters {\n /** Formatter function mapping for different data types */\n [key: string]: (inputValue: string, options: FormatterOption) => string;\n}\n\n/** Interface denoting render formatter structure */\nexport interface RenderFormatterType {\n /** Label of the render formatter */\n label: string;\n\n /** Value of the render formatter */\n value: string;\n}\n/** Map of the render formatters */\nexport interface RenderFormatterTypeMap {\n [key: string]: RenderFormatterType[];\n}\n\n/** This property extends options provided in toolbar */\nexport interface ToolBarOptions {\n /** Unique identifier for a toolbar action */\n id: string;\n\n /** Icon for the visual representation of the toolbar action */\n icon?: any;\n\n /** Label association with the action */\n label: string;\n\n /** Boolean to toggle the visibility */\n show?: boolean;\n\n /** Function to be executed upon clicking of the action */\n onClick?: (e: Event) => void;\n}\n\n/**\n * This function is invoked when an item/entry is clicked.\n * The corresponding item data is passed into the function on invocation\n * @param data : RowData\n * @returns void\n */\nexport type OnRowClickAction = (data: RowData) => void;\n\nexport default interface RsCoreBootArgs {\n /** A meta data object to provide definition of repeating structure */\n meta: Meta;\n /** A set of api's provided to repeating structure core to establish communication b/w repeating structure and its consumer (e.g. providing data to repeating structure) */\n apiContext: ApiContext;\n /** A state communication api to communicate latest state of repeating structure core to it's consumer. */\n dispatch: (rsState: State) => Promise<void>;\n /** To provide multiple variants of metadata of repeating structures. If multiple variations is provided make sure the first variation should be part of {@link meta} key and rest all should be fed to presets. */\n presets: Meta[];\n /**\n * An initial state that can be provided to repeating structure to load repeating structure instance with that state.\n * **Note**: If {@link Meta.personalization personalization} in meta is set to true then persistedInfo will be ignored.\n */\n persistedInfo?: State;\n /** A debug mode will print logs in console for the action dispatched by RsCore and the state derived after consumption of it. */\n mode?: 'info' | 'debug' | 'normal';\n /**\n * This should be a factory function that returns component or component definition for specified type.\n * @param type It is equal to value of {@link FieldDef.cellRenderer cellRenderer}(if added in fieldDefs of that column).\n * @param field It is metadata which contains info configured for that column.\n * @returns It should return a component definition (or an object that contains component definition).\n * This component definition will be used by RepeatingStructures to render a cell with the component provided by renderFactory.\n * If component definition is not provided from render factory or renderFactory is not provided to Repeating structures then cell will be rendered directly with value derived for the cell or the formatted value(if {@link formatters} are provided for that column)\n */\n renderFactory?: (\n type: string,\n field?: FieldDef\n ) => Pick<RenderFactoryWithProps, 'component'> | RenderFactoryWithProps;\n /** A map of formatters that will be displayed to consumer to format a fieldDef in repeating structure */\n renderFormatterTypeMap?: RenderFormatterTypeMap;\n /** An object of formatter functions which formats the raw value. */\n formatters?: Formatters;\n /** A collection of style formats that can be applied for styling the data. */\n styleFormats?: StyleFormat[];\n /** A list of all the toolbar actions to be displayed at the top of a repeating structure */\n toolBarOptions?: ToolBarOptions[];\n /**\n * This function is provided as ui props in row generator to attach it as click handler to a row in repeating structure\n * @param {RowData} data - current row data\n * @returns {void} void\n */\n onRowClickAction?: OnRowClickAction;\n}\n"]}
1
+ {"version":3,"file":"RsCoreBootArgs.types.js","sourceRoot":"","sources":["../../types/RsCoreBootArgs.types.ts"],"names":[],"mappings":"","sourcesContent":["import type defaultTranslations from '../src/core/defaultTranslations';\nimport type { RowData } from '../src/core/generators/RowGenerator.types';\n\nimport type { ApiContext } from './ApiContext.types';\nimport type { FieldDef, StyleFormat, Meta } from './Meta.types';\nimport type { State } from './State.types';\n\nexport type ExternalStore = {\n /** A state communication api to communicate latest state of repeating structure core to it's consumer. */\n dispatch: (rsState: State) => void;\n};\n\nexport type RenderFactoryWithProps = {\n props: { [key: string]: string | boolean | number | Date | Function | object } | null | undefined;\n component: Function | null | undefined;\n};\n\n/** Options passed to formatter to convey locale, timezone, translate etc */\nexport interface FormatterOption {\n /** Locale to be used for the formatter - jp_JP, fr_FR, en_US etc */\n locale: string;\n\n /** Current timezone to be considered for formatting values */\n timezone: string;\n\n /** Row data */\n rowData: RowData[];\n\n /** Field definition of the column */\n fieldDef: FieldDef;\n}\n\nexport interface Formatters {\n /** Formatter function mapping for different data types */\n [key: string]: (inputValue: string, options: FormatterOption) => string;\n}\n\n/** Interface denoting render formatter structure */\nexport interface RenderFormatterType {\n /** Label of the render formatter */\n label: string;\n\n /** Value of the render formatter */\n value: string;\n}\n/** Map of the render formatters */\nexport interface RenderFormatterTypeMap {\n [key: string]: RenderFormatterType[];\n}\n\n/** This property extends options provided in toolbar */\nexport interface ToolBarOptions {\n /** Unique identifier for a toolbar action */\n id: string;\n\n /** Icon for the visual representation of the toolbar action */\n icon?: any;\n\n /** Label association with the action */\n label: string;\n\n /** Boolean to toggle the visibility */\n show?: boolean;\n\n /** Function to be executed upon clicking of the action */\n onClick?: (e: Event) => void;\n}\n\n/**\n * This function is invoked when an item/entry is clicked.\n * The corresponding item data is passed into the function on invocation\n * @param data : RowData\n * @returns void\n */\nexport type OnRowClickAction = (data: RowData) => void;\n\nexport default interface RsCoreBootArgs {\n /** A meta data object to provide definition of repeating structure */\n meta: Meta;\n /** A set of api's provided to repeating structure core to establish communication b/w repeating structure and its consumer (e.g. providing data to repeating structure) */\n apiContext: ApiContext;\n /** A state communication api to communicate latest state of repeating structure core to it's consumer. */\n dispatch: (rsState: State) => Promise<void>;\n /** To provide multiple variants of metadata of repeating structures. If multiple variations is provided make sure the first variation should be part of {@link meta} key and rest all should be fed to presets. */\n presets: Meta[];\n /**\n * An initial state that can be provided to repeating structure to load repeating structure instance with that state.\n * **Note**: If {@link Meta.personalization personalization} in meta is set to true then persistedInfo will be ignored.\n */\n persistedInfo?: State;\n /** A debug mode will print logs in console for the action dispatched by RsCore and the state derived after consumption of it. */\n mode?: 'info' | 'debug' | 'normal';\n /**\n * This should be a factory function that returns component or component definition for specified type.\n * @param type It is equal to value of {@link FieldDef.cellRenderer cellRenderer}(if added in fieldDefs of that column).\n * @param field It is metadata which contains info configured for that column.\n * @returns It should return a component definition (or an object that contains component definition).\n * This component definition will be used by RepeatingStructures to render a cell with the component provided by renderFactory.\n * If component definition is not provided from render factory or renderFactory is not provided to Repeating structures then cell will be rendered directly with value derived for the cell or the formatted value(if {@link formatters} are provided for that column)\n */\n renderFactory?: (\n type: string,\n field?: FieldDef\n ) => Pick<RenderFactoryWithProps, 'component'> | RenderFactoryWithProps;\n /** A map of formatters that will be displayed to consumer to format a fieldDef in repeating structure */\n renderFormatterTypeMap?: RenderFormatterTypeMap;\n /** An object of formatter functions which formats the raw value. */\n formatters?: Formatters;\n /** A collection of style formats that can be applied for styling the data. */\n styleFormats?: StyleFormat[];\n /** A list of all the toolbar actions to be displayed at the top of a repeating structure */\n toolBarOptions?: ToolBarOptions[];\n /**\n * This function is provided as ui props in row generator to attach it as click handler to a row in repeating structure\n * @param {RowData} data - current row data\n * @returns {void} void\n */\n onRowClickAction?: OnRowClickAction;\n /** Used to provide localized strings, typically overriding default translations. */\n translations?: Partial<typeof defaultTranslations>;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/lists-core",
3
- "version": "9.0.0-build.1.0",
3
+ "version": "9.0.0-build.2.1",
4
4
  "description": "Core headless UI library that the users can use to write their own UI and create repeating structures like table, gallery, timeline etc.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Pegasystems",
@@ -14,9 +14,9 @@
14
14
  "build": "tsc -b tsconfig.build.json"
15
15
  },
16
16
  "dependencies": {
17
- "@pega/cosmos-react-condition-builder": "9.0.0-build.1.0",
18
- "@pega/cosmos-react-core": "9.0.0-build.1.0",
19
- "@pega/cosmos-react-work": "9.0.0-build.1.0",
17
+ "@pega/cosmos-react-condition-builder": "9.0.0-build.2.1",
18
+ "@pega/cosmos-react-core": "9.0.0-build.2.1",
19
+ "@pega/cosmos-react-work": "9.0.0-build.2.1",
20
20
  "@types/lodash.get": "^4.4.9",
21
21
  "@types/uuid": "^9.0.0",
22
22
  "dayjs": "^1.11.13",