@elementor/editor-controls 3.33.0-177 → 3.33.0-179
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/dist/index.d.mts +10 -4
- package/dist/index.d.ts +10 -4
- package/dist/index.js +51 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +51 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/autocomplete.tsx +8 -1
- package/src/controls/link-control.tsx +3 -0
- package/src/controls/query-control.tsx +6 -0
- package/src/controls/select-control.tsx +3 -1
- package/src/controls/text-area-control.tsx +5 -1
- package/src/controls/text-control.tsx +5 -0
- package/src/controls/url-control.tsx +21 -16
package/dist/index.d.mts
CHANGED
|
@@ -14,19 +14,21 @@ type ImageControlProps = {
|
|
|
14
14
|
};
|
|
15
15
|
declare const ImageControl: ControlComponent<({ sizes, showMode }: ImageControlProps) => React$1.JSX.Element>;
|
|
16
16
|
|
|
17
|
-
declare const TextControl: ControlComponent<({ placeholder, error, inputValue, inputDisabled, helperText, sx, }: {
|
|
17
|
+
declare const TextControl: ControlComponent<({ placeholder, error, inputValue, inputDisabled, helperText, sx, ariaLabel, }: {
|
|
18
18
|
placeholder?: string;
|
|
19
19
|
error?: boolean;
|
|
20
20
|
inputValue?: string;
|
|
21
21
|
inputDisabled?: boolean;
|
|
22
22
|
helperText?: string;
|
|
23
23
|
sx?: SxProps;
|
|
24
|
+
ariaLabel?: string;
|
|
24
25
|
}) => React$1.JSX.Element>;
|
|
25
26
|
|
|
26
27
|
type Props$7 = {
|
|
27
28
|
placeholder?: string;
|
|
29
|
+
ariaLabel?: string;
|
|
28
30
|
};
|
|
29
|
-
declare const TextAreaControl: ControlComponent<({ placeholder }: Props$7) => React$1.JSX.Element>;
|
|
31
|
+
declare const TextAreaControl: ControlComponent<({ placeholder, ariaLabel }: Props$7) => React$1.JSX.Element>;
|
|
30
32
|
|
|
31
33
|
declare const lengthUnits: readonly ["px", "%", "em", "rem", "vw", "vh"];
|
|
32
34
|
declare const angleUnits: readonly ["deg", "rad", "grad", "turn"];
|
|
@@ -85,8 +87,9 @@ type SelectControlProps = {
|
|
|
85
87
|
options: SelectOption$1[];
|
|
86
88
|
onChange?: (newValue: string | null, previousValue: string | null | undefined) => void;
|
|
87
89
|
MenuProps?: SelectProps['MenuProps'];
|
|
90
|
+
ariaLabel?: string;
|
|
88
91
|
};
|
|
89
|
-
declare const SelectControl: ControlComponent<({ options, onChange, MenuProps }: SelectControlProps) => React$1.JSX.Element>;
|
|
92
|
+
declare const SelectControl: ControlComponent<({ options, onChange, MenuProps, ariaLabel }: SelectControlProps) => React$1.JSX.Element>;
|
|
90
93
|
|
|
91
94
|
declare const collectionMethods: {
|
|
92
95
|
readonly 'off-canvas': () => SelectOption$1[];
|
|
@@ -214,8 +217,9 @@ type ItemSelectorProps = {
|
|
|
214
217
|
};
|
|
215
218
|
declare const ItemSelector: ({ itemsList, selectedItem, onItemChange, onClose, sectionWidth, title, itemStyle, onDebounce, icon, disabledItems, id, }: ItemSelectorProps) => React$1.JSX.Element;
|
|
216
219
|
|
|
217
|
-
declare const UrlControl: ControlComponent<({ placeholder }: {
|
|
220
|
+
declare const UrlControl: ControlComponent<({ placeholder, ariaLabel }: {
|
|
218
221
|
placeholder?: string;
|
|
222
|
+
ariaLabel?: string;
|
|
219
223
|
}) => React$1.JSX.Element>;
|
|
220
224
|
|
|
221
225
|
type ControlProps<TControlProps = unknown> = TControlProps & {
|
|
@@ -233,6 +237,7 @@ type Props$3 = ControlProps<{
|
|
|
233
237
|
minInputLength?: number;
|
|
234
238
|
placeholder?: string;
|
|
235
239
|
label?: string;
|
|
240
|
+
ariaLabel?: string;
|
|
236
241
|
}>;
|
|
237
242
|
type DestinationProp = LinkPropValue['value']['destination'];
|
|
238
243
|
declare const LinkControl: ControlComponent<(props: Props$3) => React$1.JSX.Element>;
|
|
@@ -258,6 +263,7 @@ type Props$1 = {
|
|
|
258
263
|
minInputLength?: number;
|
|
259
264
|
placeholder?: string;
|
|
260
265
|
onSetValue?: (value: DestinationProp | null) => void;
|
|
266
|
+
ariaLabel?: string;
|
|
261
267
|
};
|
|
262
268
|
declare const QueryControl: ControlComponent<(props: Props$1) => React$1.JSX.Element>;
|
|
263
269
|
|
package/dist/index.d.ts
CHANGED
|
@@ -14,19 +14,21 @@ type ImageControlProps = {
|
|
|
14
14
|
};
|
|
15
15
|
declare const ImageControl: ControlComponent<({ sizes, showMode }: ImageControlProps) => React$1.JSX.Element>;
|
|
16
16
|
|
|
17
|
-
declare const TextControl: ControlComponent<({ placeholder, error, inputValue, inputDisabled, helperText, sx, }: {
|
|
17
|
+
declare const TextControl: ControlComponent<({ placeholder, error, inputValue, inputDisabled, helperText, sx, ariaLabel, }: {
|
|
18
18
|
placeholder?: string;
|
|
19
19
|
error?: boolean;
|
|
20
20
|
inputValue?: string;
|
|
21
21
|
inputDisabled?: boolean;
|
|
22
22
|
helperText?: string;
|
|
23
23
|
sx?: SxProps;
|
|
24
|
+
ariaLabel?: string;
|
|
24
25
|
}) => React$1.JSX.Element>;
|
|
25
26
|
|
|
26
27
|
type Props$7 = {
|
|
27
28
|
placeholder?: string;
|
|
29
|
+
ariaLabel?: string;
|
|
28
30
|
};
|
|
29
|
-
declare const TextAreaControl: ControlComponent<({ placeholder }: Props$7) => React$1.JSX.Element>;
|
|
31
|
+
declare const TextAreaControl: ControlComponent<({ placeholder, ariaLabel }: Props$7) => React$1.JSX.Element>;
|
|
30
32
|
|
|
31
33
|
declare const lengthUnits: readonly ["px", "%", "em", "rem", "vw", "vh"];
|
|
32
34
|
declare const angleUnits: readonly ["deg", "rad", "grad", "turn"];
|
|
@@ -85,8 +87,9 @@ type SelectControlProps = {
|
|
|
85
87
|
options: SelectOption$1[];
|
|
86
88
|
onChange?: (newValue: string | null, previousValue: string | null | undefined) => void;
|
|
87
89
|
MenuProps?: SelectProps['MenuProps'];
|
|
90
|
+
ariaLabel?: string;
|
|
88
91
|
};
|
|
89
|
-
declare const SelectControl: ControlComponent<({ options, onChange, MenuProps }: SelectControlProps) => React$1.JSX.Element>;
|
|
92
|
+
declare const SelectControl: ControlComponent<({ options, onChange, MenuProps, ariaLabel }: SelectControlProps) => React$1.JSX.Element>;
|
|
90
93
|
|
|
91
94
|
declare const collectionMethods: {
|
|
92
95
|
readonly 'off-canvas': () => SelectOption$1[];
|
|
@@ -214,8 +217,9 @@ type ItemSelectorProps = {
|
|
|
214
217
|
};
|
|
215
218
|
declare const ItemSelector: ({ itemsList, selectedItem, onItemChange, onClose, sectionWidth, title, itemStyle, onDebounce, icon, disabledItems, id, }: ItemSelectorProps) => React$1.JSX.Element;
|
|
216
219
|
|
|
217
|
-
declare const UrlControl: ControlComponent<({ placeholder }: {
|
|
220
|
+
declare const UrlControl: ControlComponent<({ placeholder, ariaLabel }: {
|
|
218
221
|
placeholder?: string;
|
|
222
|
+
ariaLabel?: string;
|
|
219
223
|
}) => React$1.JSX.Element>;
|
|
220
224
|
|
|
221
225
|
type ControlProps<TControlProps = unknown> = TControlProps & {
|
|
@@ -233,6 +237,7 @@ type Props$3 = ControlProps<{
|
|
|
233
237
|
minInputLength?: number;
|
|
234
238
|
placeholder?: string;
|
|
235
239
|
label?: string;
|
|
240
|
+
ariaLabel?: string;
|
|
236
241
|
}>;
|
|
237
242
|
type DestinationProp = LinkPropValue['value']['destination'];
|
|
238
243
|
declare const LinkControl: ControlComponent<(props: Props$3) => React$1.JSX.Element>;
|
|
@@ -258,6 +263,7 @@ type Props$1 = {
|
|
|
258
263
|
minInputLength?: number;
|
|
259
264
|
placeholder?: string;
|
|
260
265
|
onSetValue?: (value: DestinationProp | null) => void;
|
|
266
|
+
ariaLabel?: string;
|
|
261
267
|
};
|
|
262
268
|
declare const QueryControl: ControlComponent<(props: Props$1) => React$1.JSX.Element>;
|
|
263
269
|
|
package/dist/index.js
CHANGED
|
@@ -476,7 +476,7 @@ var React10 = __toESM(require("react"));
|
|
|
476
476
|
var import_editor_props2 = require("@elementor/editor-props");
|
|
477
477
|
var import_editor_ui = require("@elementor/editor-ui");
|
|
478
478
|
var import_ui5 = require("@elementor/ui");
|
|
479
|
-
var SelectControl = createControl(({ options, onChange, MenuProps }) => {
|
|
479
|
+
var SelectControl = createControl(({ options, onChange, MenuProps, ariaLabel }) => {
|
|
480
480
|
const { value, setValue, disabled, placeholder } = useBoundProp(import_editor_props2.stringPropTypeUtil);
|
|
481
481
|
const handleChange = (event) => {
|
|
482
482
|
const newValue = event.target.value || null;
|
|
@@ -491,6 +491,7 @@ var SelectControl = createControl(({ options, onChange, MenuProps }) => {
|
|
|
491
491
|
displayEmpty: true,
|
|
492
492
|
size: "tiny",
|
|
493
493
|
MenuProps,
|
|
494
|
+
"aria-label": ariaLabel || placeholder,
|
|
494
495
|
renderValue: (selectedValue) => {
|
|
495
496
|
const findOptionByValue = (searchValue) => options.find((opt) => opt.value === searchValue);
|
|
496
497
|
if (!selectedValue || selectedValue === "") {
|
|
@@ -550,7 +551,8 @@ var TextControl = createControl(
|
|
|
550
551
|
inputValue,
|
|
551
552
|
inputDisabled,
|
|
552
553
|
helperText,
|
|
553
|
-
sx
|
|
554
|
+
sx,
|
|
555
|
+
ariaLabel
|
|
554
556
|
}) => {
|
|
555
557
|
const { value, setValue, disabled } = useBoundProp(import_editor_props4.stringPropTypeUtil);
|
|
556
558
|
const handleChange = (event) => setValue(event.target.value);
|
|
@@ -565,7 +567,10 @@ var TextControl = createControl(
|
|
|
565
567
|
placeholder,
|
|
566
568
|
error,
|
|
567
569
|
helperText,
|
|
568
|
-
sx
|
|
570
|
+
sx,
|
|
571
|
+
inputProps: {
|
|
572
|
+
...ariaLabel ? { "aria-label": ariaLabel } : {}
|
|
573
|
+
}
|
|
569
574
|
}
|
|
570
575
|
));
|
|
571
576
|
}
|
|
@@ -575,7 +580,7 @@ var TextControl = createControl(
|
|
|
575
580
|
var React13 = __toESM(require("react"));
|
|
576
581
|
var import_editor_props5 = require("@elementor/editor-props");
|
|
577
582
|
var import_ui8 = require("@elementor/ui");
|
|
578
|
-
var TextAreaControl = createControl(({ placeholder }) => {
|
|
583
|
+
var TextAreaControl = createControl(({ placeholder, ariaLabel }) => {
|
|
579
584
|
const { value, setValue, disabled } = useBoundProp(import_editor_props5.stringPropTypeUtil);
|
|
580
585
|
const handleChange = (event) => {
|
|
581
586
|
setValue(event.target.value);
|
|
@@ -590,7 +595,10 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
590
595
|
disabled,
|
|
591
596
|
value: value ?? "",
|
|
592
597
|
onChange: handleChange,
|
|
593
|
-
placeholder
|
|
598
|
+
placeholder,
|
|
599
|
+
inputProps: {
|
|
600
|
+
...ariaLabel ? { "aria-label": ariaLabel } : {}
|
|
601
|
+
}
|
|
594
602
|
}
|
|
595
603
|
));
|
|
596
604
|
});
|
|
@@ -3026,21 +3034,26 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
3026
3034
|
var React58 = __toESM(require("react"));
|
|
3027
3035
|
var import_editor_props21 = require("@elementor/editor-props");
|
|
3028
3036
|
var import_ui43 = require("@elementor/ui");
|
|
3029
|
-
var UrlControl = createControl(
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
}
|
|
3037
|
+
var UrlControl = createControl(
|
|
3038
|
+
({ placeholder, ariaLabel }) => {
|
|
3039
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props21.urlPropTypeUtil);
|
|
3040
|
+
const handleChange = (event) => setValue(event.target.value);
|
|
3041
|
+
return /* @__PURE__ */ React58.createElement(ControlActions, null, /* @__PURE__ */ React58.createElement(
|
|
3042
|
+
import_ui43.TextField,
|
|
3043
|
+
{
|
|
3044
|
+
size: "tiny",
|
|
3045
|
+
fullWidth: true,
|
|
3046
|
+
value: value ?? "",
|
|
3047
|
+
disabled,
|
|
3048
|
+
onChange: handleChange,
|
|
3049
|
+
placeholder,
|
|
3050
|
+
inputProps: {
|
|
3051
|
+
...ariaLabel ? { "aria-label": ariaLabel } : {}
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
));
|
|
3055
|
+
}
|
|
3056
|
+
);
|
|
3044
3057
|
|
|
3045
3058
|
// src/controls/link-control.tsx
|
|
3046
3059
|
var React63 = __toESM(require("react"));
|
|
@@ -3135,6 +3148,7 @@ var Autocomplete = (0, import_react28.forwardRef)((props, ref) => {
|
|
|
3135
3148
|
minInputLength = 2,
|
|
3136
3149
|
value = "",
|
|
3137
3150
|
startAdornment,
|
|
3151
|
+
disablePortal = true,
|
|
3138
3152
|
...restProps
|
|
3139
3153
|
} = props;
|
|
3140
3154
|
const optionKeys = factoryFilter(value, options, minInputLength).map(({ id }) => id);
|
|
@@ -3151,8 +3165,8 @@ var Autocomplete = (0, import_react28.forwardRef)((props, ref) => {
|
|
|
3151
3165
|
...restProps,
|
|
3152
3166
|
ref,
|
|
3153
3167
|
forcePopupIcon: false,
|
|
3168
|
+
disablePortal,
|
|
3154
3169
|
disableClearable: true,
|
|
3155
|
-
disablePortal: true,
|
|
3156
3170
|
freeSolo: allowCustomValues,
|
|
3157
3171
|
openOnFocus: false,
|
|
3158
3172
|
open: shouldOpen,
|
|
@@ -3175,7 +3189,8 @@ var Autocomplete = (0, import_react28.forwardRef)((props, ref) => {
|
|
|
3175
3189
|
allowClear,
|
|
3176
3190
|
placeholder,
|
|
3177
3191
|
hasSelectedValue: isValueFromOptions,
|
|
3178
|
-
startAdornment
|
|
3192
|
+
startAdornment,
|
|
3193
|
+
extraInputProps: restProps.inputProps
|
|
3179
3194
|
}
|
|
3180
3195
|
)
|
|
3181
3196
|
}
|
|
@@ -3187,7 +3202,8 @@ var TextInput = ({
|
|
|
3187
3202
|
placeholder,
|
|
3188
3203
|
handleChange,
|
|
3189
3204
|
hasSelectedValue,
|
|
3190
|
-
startAdornment
|
|
3205
|
+
startAdornment,
|
|
3206
|
+
extraInputProps
|
|
3191
3207
|
}) => {
|
|
3192
3208
|
const onChange = (event) => {
|
|
3193
3209
|
handleChange(event.target.value);
|
|
@@ -3198,6 +3214,7 @@ var TextInput = ({
|
|
|
3198
3214
|
...params,
|
|
3199
3215
|
placeholder,
|
|
3200
3216
|
onChange,
|
|
3217
|
+
inputProps: { ...params.inputProps ?? {}, ...extraInputProps ?? {} },
|
|
3201
3218
|
sx: {
|
|
3202
3219
|
"& .MuiInputBase-input": {
|
|
3203
3220
|
cursor: hasSelectedValue ? "default" : void 0
|
|
@@ -3248,7 +3265,8 @@ var QueryControl = createControl((props) => {
|
|
|
3248
3265
|
queryOptions: { url, params = {} },
|
|
3249
3266
|
placeholder,
|
|
3250
3267
|
minInputLength = 2,
|
|
3251
|
-
onSetValue
|
|
3268
|
+
onSetValue,
|
|
3269
|
+
ariaLabel
|
|
3252
3270
|
} = props || {};
|
|
3253
3271
|
const normalizedPlaceholder = placeholder || (0, import_i18n22.__)("Search", "elementor");
|
|
3254
3272
|
const [options, setOptions] = (0, import_react29.useState)(
|
|
@@ -3308,7 +3326,11 @@ var QueryControl = createControl((props) => {
|
|
|
3308
3326
|
value: value?.value?.id?.value || value?.value,
|
|
3309
3327
|
onOptionChange,
|
|
3310
3328
|
onTextChange,
|
|
3311
|
-
minInputLength
|
|
3329
|
+
minInputLength,
|
|
3330
|
+
disablePortal: false,
|
|
3331
|
+
inputProps: {
|
|
3332
|
+
...ariaLabel ? { "aria-label": ariaLabel } : {}
|
|
3333
|
+
}
|
|
3312
3334
|
}
|
|
3313
3335
|
));
|
|
3314
3336
|
});
|
|
@@ -3376,7 +3398,8 @@ var LinkControl = createControl((props) => {
|
|
|
3376
3398
|
placeholder,
|
|
3377
3399
|
minInputLength = 2,
|
|
3378
3400
|
context: { elementId },
|
|
3379
|
-
label = (0, import_i18n23.__)("Link", "elementor")
|
|
3401
|
+
label = (0, import_i18n23.__)("Link", "elementor"),
|
|
3402
|
+
ariaLabel
|
|
3380
3403
|
} = props || {};
|
|
3381
3404
|
const [linkInLinkRestriction, setLinkInLinkRestriction] = (0, import_react30.useState)((0, import_editor_elements2.getLinkInLinkRestriction)(elementId));
|
|
3382
3405
|
const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
|
|
@@ -3432,7 +3455,8 @@ var LinkControl = createControl((props) => {
|
|
|
3432
3455
|
allowCustomValues,
|
|
3433
3456
|
minInputLength,
|
|
3434
3457
|
placeholder,
|
|
3435
|
-
onSetValue: onSaveValueToSession
|
|
3458
|
+
onSetValue: onSaveValueToSession,
|
|
3459
|
+
ariaLabel: ariaLabel || label
|
|
3436
3460
|
}
|
|
3437
3461
|
)), /* @__PURE__ */ React63.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React63.createElement(import_ui47.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React63.createElement(import_ui47.Grid, { item: true }, /* @__PURE__ */ React63.createElement(ControlFormLabel, null, (0, import_i18n23.__)("Open in a new tab", "elementor"))), /* @__PURE__ */ React63.createElement(import_ui47.Grid, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React63.createElement(SwitchControl, null))))))));
|
|
3438
3462
|
});
|