diff --git a/content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/pluggable-widgets/pluggable-widgets-client-apis/_index.md b/content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/pluggable-widgets/pluggable-widgets-client-apis/_index.md index c6ace502a26..a8dc7434f0f 100644 --- a/content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/pluggable-widgets/pluggable-widgets-client-apis/_index.md +++ b/content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/pluggable-widgets/pluggable-widgets-client-apis/_index.md @@ -489,6 +489,39 @@ if (selection.type === "Single") { ## Exposed Modules + ### Session {#session} + +The Mendix Platform exposes a `mendix/session` module for inspecting the current user session. It is available in both web and native. + +For instance, `getUserId` returns the current user's GUID as a `string`. + +```ts +function getUserId(): GUID; +``` + +--- + +### Parser {#parser} + +The Mendix Platform exposes a `mendix/parser` module that provides locale-aware formatting and parsing of attribute values. These functions use the same locale and formatting settings of the built-in Mendix widgets. It is available in both web and native. + +```ts +import { formatValue, parseValue } from "mendix/parser"; +``` + +Both functions accept an optional configuration object: + +```ts +interface FormatValueConfig { + selector?: "date" | "time" | "datetime"; + datePattern?: string; + places?: number; + groups?: boolean; +} +``` + +For the reference of the API, you can refer to the [API documentation](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis-parser/). + ### Icon {#icon} Mendix Platform exposes two versions of an `Icon` react component: `mendix/components/web/Icon` and `mendix/components/native/Icon`. Both components are useful helpers to render `WebIcon` and `NativeIcon` values respectively. They should be passed through an `icon` prop. The native `Icon` component additionally accepts `color` (`string`) and `size` (`number`) props. diff --git a/content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/pluggable-widgets/pluggable-widgets-client-apis/pluggable-widgets-client-apis-list-values.md b/content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/pluggable-widgets/pluggable-widgets-client-apis/pluggable-widgets-client-apis-list-values.md index 149bcaccd74..a30ecfd8fe6 100644 --- a/content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/pluggable-widgets/pluggable-widgets-client-apis/pluggable-widgets-client-apis-list-values.md +++ b/content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/pluggable-widgets/pluggable-widgets-client-apis/pluggable-widgets-client-apis-list-values.md @@ -197,6 +197,12 @@ It is possible to set filtering conditions for items of a datasource. `setFilter Some examples of builder functions are `equals`, `greaterThan`, `lessThanOrEqual` for filtering on `DateTime` or `Decimal` attributes. Functions like `startsWith`, `contains` are useful for filtering on `String` attributes. Filtering based on associations is also possible. For example, you can use `equals` with references and `contains` with reference sets. +To use the filter builders in a pluggable widget, import the individual builder functions you need directly from the "mendix/filters/builders" module path: + +```ts +import { attribute, literal, equals, startsWith, and, or } from "mendix/filters/builders"; +``` + The following code samples show how to use filter builders and apply filtering to a data source property with three linked attributes and two linked associations: ```ts