@gooddata/sdk-ui-kit 11.45.0-alpha.2 → 11.46.0-alpha.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParameterControlDropdown.d.ts","sourceRoot":"","sources":["../../src/ParameterControl/ParameterControlDropdown.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAoB,KAAK,iBAAiB,EAA2B,MAAM,YAAY,CAAC;AAE/F,OAAO,EAAE,KAAK,2BAA2B,EAA+B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ParameterControlDropdown.d.ts","sourceRoot":"","sources":["../../src/ParameterControl/ParameterControlDropdown.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAoB,KAAK,iBAAiB,EAA2B,MAAM,YAAY,CAAC;AAE/F,OAAO,EAAE,KAAK,2BAA2B,EAA+B,MAAM,qBAAqB,CAAC;AAoBpG;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,2BAA2B,CAAC;IAC1C,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,EACrC,IAAI,EACJ,KAAK,EACL,UAAU,EACV,WAAW,EACX,OAAO,EACP,QAAQ,EACX,EAAE,8BAA8B,2CA4FhC;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,KAAK,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,2BAA2B,GAC1C,iBAAiB,GAAG,SAAS,CAgB/B"}
|
|
@@ -6,6 +6,7 @@ import { FormattedMessage, defineMessages, useIntl } from "react-intl";
|
|
|
6
6
|
import { isValidNumberParameterValue } from "@gooddata/sdk-model";
|
|
7
7
|
import { bem } from "../@ui/@utils/bem.js";
|
|
8
8
|
import { UiButton } from "../@ui/UiButton/UiButton.js";
|
|
9
|
+
import { useId } from "../utils/useId.js";
|
|
9
10
|
const { b, e } = bem("gd-ui-kit-parameter-control");
|
|
10
11
|
const messages = defineMessages({
|
|
11
12
|
valueLabel: { id: "parameter_filter.dropdown.value_label" },
|
|
@@ -29,6 +30,7 @@ const messages = defineMessages({
|
|
|
29
30
|
*/
|
|
30
31
|
export function ParameterControlDropdown({ name, value, resetValue, constraints, onApply, onCancel, }) {
|
|
31
32
|
const intl = useIntl();
|
|
33
|
+
const inputId = useId();
|
|
32
34
|
const [draft, setDraft] = useState(String(value));
|
|
33
35
|
const error = getDraftValidationError(draft, constraints);
|
|
34
36
|
const effectiveValue = error ? value : parseDraft(draft);
|
|
@@ -42,7 +44,7 @@ export function ParameterControlDropdown({ name, value, resetValue, constraints,
|
|
|
42
44
|
return (_jsxs("div", { className: `${b({ dropdown: true })} overlay gd-dialog gd-dropdown`, "data-testid": "parameter-control-dropdown", children: [
|
|
43
45
|
_jsxs("div", { className: cx(e("dropdown-field"), { "has-error": !!error }), children: [
|
|
44
46
|
_jsxs("div", { className: e("dropdown-field-header"), children: [
|
|
45
|
-
_jsx("label", { className: e("dropdown-label"), children: intl.formatMessage(messages.valueLabel) }), showReset ? (_jsx("button", { type: "button", className: e("dropdown-reset"), "data-testid": "parameter-control-dropdown-reset", onClick: () => setDraft(String(resetValue)), children: intl.formatMessage(messages.reset) })) : null] }), _jsx("input", { type: "number", className: `${e("dropdown-input")} gd-input-field`, "data-testid": "parameter-control-dropdown-input", value: draft, min: constraints?.min, max: constraints?.max, onChange: (event) => setDraft(event.target.value) }), error ? (_jsx("div", { className: e("dropdown-error"), "data-testid": "parameter-control-dropdown-error", children: _jsx(FormattedMessage, { ...error, values: { min: constraints?.min, max: constraints?.max } }) })) : null] }), _jsx("div", { className: e("dropdown-divider") }), _jsxs("div", { className: e("dropdown-preview"), "data-testid": "parameter-control-dropdown-preview", children: [
|
|
47
|
+
_jsx("label", { htmlFor: inputId, className: e("dropdown-label"), children: intl.formatMessage(messages.valueLabel) }), showReset ? (_jsx("button", { type: "button", className: e("dropdown-reset"), "data-testid": "parameter-control-dropdown-reset", onClick: () => setDraft(String(resetValue)), children: intl.formatMessage(messages.reset) })) : null] }), _jsx("input", { id: inputId, type: "number", className: `${e("dropdown-input")} gd-input-field`, "data-testid": "parameter-control-dropdown-input", value: draft, min: constraints?.min, max: constraints?.max, onChange: (event) => setDraft(event.target.value) }), error ? (_jsx("div", { className: e("dropdown-error"), "data-testid": "parameter-control-dropdown-error", children: _jsx(FormattedMessage, { ...error, values: { min: constraints?.min, max: constraints?.max } }) })) : null] }), _jsx("div", { className: e("dropdown-divider") }), _jsxs("div", { className: e("dropdown-preview"), "data-testid": "parameter-control-dropdown-preview", children: [
|
|
46
48
|
_jsx("span", { className: e("dropdown-preview-label"), children: intl.formatMessage(messages.previewLabel) }), _jsx("span", { className: e("dropdown-preview-text"), children: _jsx(FormattedMessage, { id: "parameter_filter.dropdown.preview", values: {
|
|
47
49
|
name,
|
|
48
50
|
value: effectiveValue,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-kit",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.46.0-alpha.0",
|
|
4
4
|
"description": "GoodData SDK - UI Building Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
"tslib": "2.8.1",
|
|
75
75
|
"unified": "^11.0.5",
|
|
76
76
|
"uuid": "11.1.1",
|
|
77
|
-
"@gooddata/sdk-backend-spi": "11.
|
|
78
|
-
"@gooddata/sdk-model": "11.
|
|
79
|
-
"@gooddata/sdk-ui": "11.
|
|
80
|
-
"@gooddata/sdk-ui-theme-provider": "11.
|
|
81
|
-
"@gooddata/util": "11.
|
|
77
|
+
"@gooddata/sdk-backend-spi": "11.46.0-alpha.0",
|
|
78
|
+
"@gooddata/sdk-model": "11.46.0-alpha.0",
|
|
79
|
+
"@gooddata/sdk-ui": "11.46.0-alpha.0",
|
|
80
|
+
"@gooddata/sdk-ui-theme-provider": "11.46.0-alpha.0",
|
|
81
|
+
"@gooddata/util": "11.46.0-alpha.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -127,11 +127,11 @@
|
|
|
127
127
|
"typescript": "5.9.3",
|
|
128
128
|
"vitest": "4.1.8",
|
|
129
129
|
"vitest-dom": "0.1.1",
|
|
130
|
-
"@gooddata/eslint-config": "11.
|
|
131
|
-
"@gooddata/oxlint-config": "11.
|
|
132
|
-
"@gooddata/reference-workspace": "11.
|
|
133
|
-
"@gooddata/
|
|
134
|
-
"@gooddata/
|
|
130
|
+
"@gooddata/eslint-config": "11.46.0-alpha.0",
|
|
131
|
+
"@gooddata/oxlint-config": "11.46.0-alpha.0",
|
|
132
|
+
"@gooddata/reference-workspace": "11.46.0-alpha.0",
|
|
133
|
+
"@gooddata/sdk-backend-mockingbird": "11.46.0-alpha.0",
|
|
134
|
+
"@gooddata/stylelint-config": "11.46.0-alpha.0"
|
|
135
135
|
},
|
|
136
136
|
"peerDependencies": {
|
|
137
137
|
"react": "^18.0.0 || ^19.0.0",
|