@comet/admin 9.0.0-canary-20251211112608 → 9.0.0-canary-20251215091807
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/form/Autocomplete.d.ts +4 -2
- package/lib/form/Autocomplete.d.ts.map +1 -1
- package/lib/form/Autocomplete.js +10 -3
- package/lib/form/FinalFormInput.d.ts +1 -2
- package/lib/form/FinalFormInput.d.ts.map +1 -1
- package/lib/form/FinalFormInput.js +8 -2
- package/lib/form/FinalFormNumberInput.d.ts +1 -2
- package/lib/form/FinalFormNumberInput.d.ts.map +1 -1
- package/lib/form/FinalFormNumberInput.js +8 -2
- package/lib/form/FinalFormSearchTextField.d.ts +0 -1
- package/lib/form/FinalFormSearchTextField.d.ts.map +1 -1
- package/lib/form/FinalFormSearchTextField.js +1 -13
- package/package.json +5 -5
|
@@ -3,8 +3,10 @@ import type { ReactNode } from "react";
|
|
|
3
3
|
import { type FieldRenderProps } from "react-final-form";
|
|
4
4
|
import { type AsyncAutocompleteOptionsProps } from "./useAsyncAutocompleteOptionsProps";
|
|
5
5
|
export type FinalFormAutocompleteProps<T extends Record<string, any>, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined> = Partial<AsyncAutocompleteOptionsProps<T>> & Omit<AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>, "renderInput"> & {
|
|
6
|
-
clearable?: boolean;
|
|
7
6
|
errorText?: ReactNode;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
readOnly?: boolean;
|
|
8
10
|
};
|
|
9
11
|
type FinalFormAutocompleteInternalProps<T extends Record<string, any>> = FieldRenderProps<T, HTMLInputElement | HTMLTextAreaElement>;
|
|
10
12
|
/**
|
|
@@ -12,6 +14,6 @@ type FinalFormAutocompleteInternalProps<T extends Record<string, any>> = FieldRe
|
|
|
12
14
|
*
|
|
13
15
|
* @see {@link AutocompleteField} – preferred for typical form use. Use this only if no Field wrapper is needed.
|
|
14
16
|
*/
|
|
15
|
-
export declare const FinalFormAutocomplete: <T extends Record<string, any>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false>({ input: { onChange, value: incomingValue, multiple, ...restInput }, loading, loadingError, isAsync,
|
|
17
|
+
export declare const FinalFormAutocomplete: <T extends Record<string, any>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false>({ input: { onChange, value: incomingValue, multiple, ...restInput }, loading, loadingError, isAsync, required, disabled, readOnly, loadingText, popupIcon, noOptionsText, errorText, ...rest }: FinalFormAutocompleteProps<T, Multiple, DisableClearable, FreeSolo> & FinalFormAutocompleteInternalProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
16
18
|
export {};
|
|
17
19
|
//# sourceMappingURL=Autocomplete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../src/form/Autocomplete.tsx"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,iBAAiB,EAMzB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIzD,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAExF,MAAM,MAAM,0BAA0B,CAClC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,QAAQ,SAAS,OAAO,GAAG,SAAS,EACpC,gBAAgB,SAAS,OAAO,GAAG,SAAS,EAC5C,QAAQ,SAAS,OAAO,GAAG,SAAS,IACpC,OAAO,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC,GACzC,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,CAAC,EAAE,aAAa,CAAC,GAAG;IAC9E,SAAS,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../src/form/Autocomplete.tsx"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,iBAAiB,EAMzB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIzD,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAExF,MAAM,MAAM,0BAA0B,CAClC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,QAAQ,SAAS,OAAO,GAAG,SAAS,EACpC,gBAAgB,SAAS,OAAO,GAAG,SAAS,EAC5C,QAAQ,SAAS,OAAO,GAAG,SAAS,IACpC,OAAO,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC,GACzC,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,CAAC,EAAE,aAAa,CAAC,GAAG;IAC9E,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEN,KAAK,kCAAkC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,gBAAgB,CAAC,CAAC,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;AAErI;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAC9B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,KAAK,EAC5C,gBAAgB,SAAS,OAAO,GAAG,SAAS,GAAG,KAAK,EACpD,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,KAAK,EAC9C,gMAaC,0BAA0B,CAAC,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,CAAC,GAAG,kCAAkC,CAAC,CAAC,CAAC,4CAuD7G,CAAC"}
|
package/lib/form/Autocomplete.js
CHANGED
|
@@ -11,7 +11,7 @@ var _reactIntl = require("react-intl");
|
|
|
11
11
|
var _ClearInputAdornment = require("../common/ClearInputAdornment");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
var _excluded = ["onChange", "value", "multiple"],
|
|
14
|
-
_excluded2 = ["input", "loading", "loadingError", "isAsync", "
|
|
14
|
+
_excluded2 = ["input", "loading", "loadingError", "isAsync", "required", "disabled", "readOnly", "loadingText", "popupIcon", "noOptionsText", "errorText"];
|
|
15
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
17
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -35,7 +35,9 @@ var FinalFormAutocomplete = exports.FinalFormAutocomplete = function FinalFormAu
|
|
|
35
35
|
loadingError = _ref.loadingError,
|
|
36
36
|
_ref$isAsync = _ref.isAsync,
|
|
37
37
|
isAsync = _ref$isAsync === void 0 ? false : _ref$isAsync,
|
|
38
|
-
|
|
38
|
+
required = _ref.required,
|
|
39
|
+
disabled = _ref.disabled,
|
|
40
|
+
readOnly = _ref.readOnly,
|
|
39
41
|
_ref$loadingText = _ref.loadingText,
|
|
40
42
|
loadingText = _ref$loadingText === void 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
41
43
|
id: "common.loading",
|
|
@@ -55,6 +57,7 @@ var FinalFormAutocomplete = exports.FinalFormAutocomplete = function FinalFormAu
|
|
|
55
57
|
}) : _ref$errorText,
|
|
56
58
|
rest = _objectWithoutProperties(_ref, _excluded2);
|
|
57
59
|
var value = multiple ? Array.isArray(incomingValue) ? incomingValue : [] : incomingValue;
|
|
60
|
+
var clearable = !required && !disabled && !readOnly;
|
|
58
61
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Autocomplete, _objectSpread(_objectSpread({
|
|
59
62
|
popupIcon: popupIcon,
|
|
60
63
|
disableClearable: true,
|
|
@@ -82,9 +85,13 @@ var FinalFormAutocomplete = exports.FinalFormAutocomplete = function FinalFormAu
|
|
|
82
85
|
},
|
|
83
86
|
value: value ? value : null
|
|
84
87
|
}, rest), {}, {
|
|
88
|
+
disabled: disabled,
|
|
89
|
+
readOnly: readOnly,
|
|
85
90
|
multiple: multiple,
|
|
86
91
|
renderInput: function renderInput(params) {
|
|
87
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.InputBase, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
92
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.InputBase, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
93
|
+
required: required
|
|
94
|
+
}, restInput), params), params.InputProps), {}, {
|
|
88
95
|
endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.InputAdornment, {
|
|
89
96
|
position: "end",
|
|
90
97
|
children: [loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.CircularProgress, {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { type InputBaseProps } from "@mui/material";
|
|
2
2
|
import { type FieldRenderProps } from "react-final-form";
|
|
3
3
|
export type FinalFormInputProps = InputBaseProps & {
|
|
4
|
-
clearable?: boolean;
|
|
5
4
|
disableContentTranslation?: boolean;
|
|
6
5
|
};
|
|
7
6
|
type FinalFormInputInternalProps = FieldRenderProps<string, HTMLInputElement | HTMLTextAreaElement>;
|
|
8
|
-
export declare function FinalFormInput({ meta, input, innerRef, endAdornment,
|
|
7
|
+
export declare function FinalFormInput({ meta, input, innerRef, endAdornment, disableContentTranslation, required, disabled, readOnly, ...props }: FinalFormInputProps & FinalFormInputInternalProps): import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export {};
|
|
10
9
|
//# sourceMappingURL=FinalFormInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FinalFormInput.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQzD,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAC/C,
|
|
1
|
+
{"version":3,"file":"FinalFormInput.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQzD,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAC/C,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEF,KAAK,2BAA2B,GAAG,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;AAEpG,wBAAgB,cAAc,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,yBAAyB,EACzB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,mBAAmB,GAAG,2BAA2B,2CAwDnD"}
|
|
@@ -14,7 +14,7 @@ var _Tooltip = require("../common/Tooltip");
|
|
|
14
14
|
var _PlainTextTranslationDialog = require("../translator/PlainTextTranslationDialog");
|
|
15
15
|
var _useContentTranslationService = require("../translator/useContentTranslationService");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
var _excluded = ["meta", "input", "innerRef", "endAdornment", "
|
|
17
|
+
var _excluded = ["meta", "input", "innerRef", "endAdornment", "disableContentTranslation", "required", "disabled", "readOnly"];
|
|
18
18
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
19
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
20
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -38,8 +38,10 @@ function FinalFormInput(_ref) {
|
|
|
38
38
|
input = _ref.input,
|
|
39
39
|
innerRef = _ref.innerRef,
|
|
40
40
|
endAdornment = _ref.endAdornment,
|
|
41
|
-
clearable = _ref.clearable,
|
|
42
41
|
disableContentTranslation = _ref.disableContentTranslation,
|
|
42
|
+
required = _ref.required,
|
|
43
|
+
disabled = _ref.disabled,
|
|
44
|
+
readOnly = _ref.readOnly,
|
|
43
45
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
44
46
|
var type = (_ref2 = (_props$type = props.type) !== null && _props$type !== void 0 ? _props$type : input.type) !== null && _ref2 !== void 0 ? _ref2 : "text";
|
|
45
47
|
var _useContentTranslatio = (0, _useContentTranslationService.useContentTranslationService)(),
|
|
@@ -55,8 +57,12 @@ function FinalFormInput(_ref) {
|
|
|
55
57
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
56
58
|
pendingTranslation = _useState4[0],
|
|
57
59
|
setPendingTranslation = _useState4[1];
|
|
60
|
+
var clearable = !required && !disabled && !readOnly;
|
|
58
61
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
59
62
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.InputBase, _objectSpread(_objectSpread(_objectSpread({}, input), props), {}, {
|
|
63
|
+
required: required,
|
|
64
|
+
disabled: disabled,
|
|
65
|
+
readOnly: readOnly,
|
|
60
66
|
endAdornment: (endAdornment || clearable || isTranslatable) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
61
67
|
children: [clearable && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClearInputAdornment.ClearInputAdornment, {
|
|
62
68
|
position: "end",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type InputBaseProps } from "@mui/material";
|
|
2
2
|
import { type FieldRenderProps } from "react-final-form";
|
|
3
3
|
export type FinalFormNumberInputProps = InputBaseProps & {
|
|
4
|
-
clearable?: boolean;
|
|
5
4
|
decimals?: number;
|
|
6
5
|
};
|
|
7
6
|
type FinalFormNumberInputInternalProps = FieldRenderProps<number>;
|
|
@@ -10,6 +9,6 @@ type FinalFormNumberInputInternalProps = FieldRenderProps<number>;
|
|
|
10
9
|
*
|
|
11
10
|
* @see {@link NumberField} – preferred for typical form use. Use this only if no Field wrapper is needed.
|
|
12
11
|
*/
|
|
13
|
-
export declare function FinalFormNumberInput({ meta, input, innerRef,
|
|
12
|
+
export declare function FinalFormNumberInput({ meta, input, innerRef, endAdornment, required, disabled, readOnly, decimals, ...props }: FinalFormNumberInputProps & FinalFormNumberInputInternalProps): import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
export {};
|
|
15
14
|
//# sourceMappingURL=FinalFormNumberInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FinalFormNumberInput.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormNumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAKzD,MAAM,MAAM,yBAAyB,GAAG,cAAc,GAAG;IACrD,
|
|
1
|
+
{"version":3,"file":"FinalFormNumberInput.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormNumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAKzD,MAAM,MAAM,yBAAyB,GAAG,cAAc,GAAG;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,iCAAiC,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACjC,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAY,EACZ,GAAG,KAAK,EACX,EAAE,yBAAyB,GAAG,iCAAiC,2CA2F/D"}
|
|
@@ -10,7 +10,7 @@ var _react = require("react");
|
|
|
10
10
|
var _reactIntl = require("react-intl");
|
|
11
11
|
var _ClearInputAdornment = require("../common/ClearInputAdornment");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
var _excluded = ["meta", "input", "innerRef", "
|
|
13
|
+
var _excluded = ["meta", "input", "innerRef", "endAdornment", "required", "disabled", "readOnly", "decimals"];
|
|
14
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
16
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -33,8 +33,10 @@ function FinalFormNumberInput(_ref) {
|
|
|
33
33
|
var meta = _ref.meta,
|
|
34
34
|
input = _ref.input,
|
|
35
35
|
innerRef = _ref.innerRef,
|
|
36
|
-
clearable = _ref.clearable,
|
|
37
36
|
endAdornment = _ref.endAdornment,
|
|
37
|
+
required = _ref.required,
|
|
38
|
+
disabled = _ref.disabled,
|
|
39
|
+
readOnly = _ref.readOnly,
|
|
38
40
|
_ref$decimals = _ref.decimals,
|
|
39
41
|
decimals = _ref$decimals === void 0 ? 0 : _ref$decimals,
|
|
40
42
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -89,7 +91,11 @@ function FinalFormNumberInput(_ref) {
|
|
|
89
91
|
(0, _react.useEffect)(function () {
|
|
90
92
|
updateFormattedNumberValue(input.value);
|
|
91
93
|
}, [updateFormattedNumberValue, input]);
|
|
94
|
+
var clearable = !required && !disabled && !readOnly;
|
|
92
95
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.InputBase, _objectSpread(_objectSpread(_objectSpread({}, input), props), {}, {
|
|
96
|
+
required: required,
|
|
97
|
+
disabled: disabled,
|
|
98
|
+
readOnly: readOnly,
|
|
93
99
|
value: formattedNumberValue,
|
|
94
100
|
onChange: handleChange,
|
|
95
101
|
onBlur: handleBlur,
|
|
@@ -3,7 +3,6 @@ import type { FieldRenderProps } from "react-final-form";
|
|
|
3
3
|
import { type FinalFormInputProps } from "./FinalFormInput";
|
|
4
4
|
export interface FinalFormSearchTextFieldProps extends FinalFormInputProps {
|
|
5
5
|
icon?: ReactNode;
|
|
6
|
-
clearable?: boolean;
|
|
7
6
|
}
|
|
8
7
|
type FinalFormSearchTextFieldInternalProps = FieldRenderProps<string, HTMLInputElement | HTMLTextAreaElement>;
|
|
9
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FinalFormSearchTextField.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormSearchTextField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"FinalFormSearchTextField.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormSearchTextField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5E,MAAM,WAAW,6BAA8B,SAAQ,mBAAmB;IACtE,IAAI,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,KAAK,qCAAqC,GAAG,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;AAE9G;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,6BAA6B,GAAG,qCAAqC,2CAgBtH;AAED,OAAO,QAAQ,sBAAsB,CAAC;IAClC,UAAU,mBAAmB;QACzB,kCAAkC,EAAE,6BAA6B,CAAC;KACrE;IAED,UAAU,UAAU;QAChB,kCAAkC,CAAC,EAAE;YACjC,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,oCAAoC,CAAC,CAAC,CAAC;SACrF,CAAC;KACL;CACJ"}
|
|
@@ -9,10 +9,9 @@ var _adminIcons = require("@comet/admin-icons");
|
|
|
9
9
|
var _material = require("@mui/material");
|
|
10
10
|
var _styles = require("@mui/material/styles");
|
|
11
11
|
var _reactIntl = require("react-intl");
|
|
12
|
-
var _ClearInputAdornment = require("../common/ClearInputAdornment");
|
|
13
12
|
var _FinalFormInput = require("./FinalFormInput");
|
|
14
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
var _excluded = ["icon", "placeholder"
|
|
14
|
+
var _excluded = ["icon", "placeholder"];
|
|
16
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
17
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -33,8 +32,6 @@ function FinalFormSearchTextField(inProps) {
|
|
|
33
32
|
_useThemeProps$icon = _useThemeProps.icon,
|
|
34
33
|
icon = _useThemeProps$icon === void 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_adminIcons.Search, {}) : _useThemeProps$icon,
|
|
35
34
|
placeholder = _useThemeProps.placeholder,
|
|
36
|
-
endAdornment = _useThemeProps.endAdornment,
|
|
37
|
-
clearable = _useThemeProps.clearable,
|
|
38
35
|
restProps = _objectWithoutProperties(_useThemeProps, _excluded);
|
|
39
36
|
var intl = (0, _reactIntl.useIntl)();
|
|
40
37
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FinalFormInput.FinalFormInput, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
@@ -47,15 +44,6 @@ function FinalFormSearchTextField(inProps) {
|
|
|
47
44
|
disablePointerEvents: true,
|
|
48
45
|
children: icon
|
|
49
46
|
}),
|
|
50
|
-
endAdornment: clearable ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
51
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ClearInputAdornment.ClearInputAdornment, {
|
|
52
|
-
position: "end",
|
|
53
|
-
hasClearableContent: Boolean(restProps.input.value),
|
|
54
|
-
onClick: function onClick() {
|
|
55
|
-
return restProps.input.onChange("");
|
|
56
|
-
}
|
|
57
|
-
}), endAdornment]
|
|
58
|
-
}) : endAdornment,
|
|
59
47
|
disableContentTranslation: true
|
|
60
48
|
}));
|
|
61
49
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comet/admin",
|
|
3
|
-
"version": "9.0.0-canary-
|
|
3
|
+
"version": "9.0.0-canary-20251215091807",
|
|
4
4
|
"description": "Comet Admin package",
|
|
5
5
|
"repository": {
|
|
6
6
|
"directory": "packages/admin/admin",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"react-dropzone": "^14.3.8",
|
|
29
29
|
"use-constant": "^2.0.0",
|
|
30
30
|
"uuid": "^11.1.0",
|
|
31
|
-
"@comet/admin-icons": "9.0.0-canary-
|
|
31
|
+
"@comet/admin-icons": "9.0.0-canary-20251215091807"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@apollo/client": "^3.14.0",
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
"storybook-addon-tag-badges": "^2.0.1",
|
|
84
84
|
"ts-jest": "^29.4.0",
|
|
85
85
|
"typescript": "5.9.3",
|
|
86
|
-
"@comet/admin-babel-preset": "9.0.0-canary-
|
|
87
|
-
"@comet/eslint-config": "9.0.0-canary-
|
|
88
|
-
"@comet/eslint-plugin": "9.0.0-canary-
|
|
86
|
+
"@comet/admin-babel-preset": "9.0.0-canary-20251215091807",
|
|
87
|
+
"@comet/eslint-config": "9.0.0-canary-20251215091807",
|
|
88
|
+
"@comet/eslint-plugin": "9.0.0-canary-20251215091807"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"@apollo/client": "^3.7.0",
|