@pdg/react-form 1.1.11 → 1.1.13
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.
|
@@ -28,6 +28,7 @@ export interface PFormAutocompleteProps<T extends PFormAutocompleteSingleValue,
|
|
|
28
28
|
openOnFocus?: boolean;
|
|
29
29
|
disableClearable?: boolean;
|
|
30
30
|
async?: boolean;
|
|
31
|
+
autoFocus?: boolean;
|
|
31
32
|
onLoadItems?: (inputValue?: string) => Promise<PFormAutocompleteItems<T>>;
|
|
32
33
|
onAsyncLoadValueItem?: (value: PFormAutocompleteValue<T, Multiple>) => Promise<PFormAutocompleteComponentValue<T, Multiple>>;
|
|
33
34
|
onRenderItem?: (item: PFormAutocompleteItem<T>) => ReactNode;
|
package/dist/index.esm.js
CHANGED
|
@@ -3914,7 +3914,7 @@ PFormTextEditor.apiKey = '';var PFormAutocomplete = ToForwardRefExoticComponent(
|
|
|
3914
3914
|
* ******************************************************************************************************************/
|
|
3915
3915
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
3916
3916
|
//----------------------------------------------------------------------------------------------------------------
|
|
3917
|
-
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initData = _a.data, initError = _a.error, helperText = _a.helperText, initDisabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, exceptValue = _a.exceptValue, width = _a.width, placeholder = _a.placeholder, multiple = _a.multiple, _b = _a.formValueSeparator, formValueSeparator = _b === void 0 ? ',' : _b, formValueSort = _a.formValueSort, disablePortal = _a.disablePortal, _c = _a.noOptionsText, noOptionsText = _c === void 0 ? '항목이 없습니다' : _c, loadingText = _a.loadingText, limitTags = _a.limitTags, getLimitTagsText = _a.getLimitTagsText, openOnFocus = _a.openOnFocus, disableClearable = _a.disableClearable, async = _a.async, initHidden = _a.hidden, onLoadItems = _a.onLoadItems, onAsyncLoadValueItem = _a.onAsyncLoadValueItem, onRenderItem = _a.onRenderItem, onRenderTag = _a.onRenderTag, onAddItem = _a.onAddItem, getOptionDisabled = _a.getOptionDisabled,
|
|
3917
|
+
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initData = _a.data, initError = _a.error, helperText = _a.helperText, initDisabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, exceptValue = _a.exceptValue, width = _a.width, placeholder = _a.placeholder, multiple = _a.multiple, _b = _a.formValueSeparator, formValueSeparator = _b === void 0 ? ',' : _b, formValueSort = _a.formValueSort, disablePortal = _a.disablePortal, _c = _a.noOptionsText, noOptionsText = _c === void 0 ? '항목이 없습니다' : _c, loadingText = _a.loadingText, limitTags = _a.limitTags, getLimitTagsText = _a.getLimitTagsText, openOnFocus = _a.openOnFocus, disableClearable = _a.disableClearable, async = _a.async, autoFocus = _a.autoFocus, initHidden = _a.hidden, onLoadItems = _a.onLoadItems, onAsyncLoadValueItem = _a.onAsyncLoadValueItem, onRenderItem = _a.onRenderItem, onRenderTag = _a.onRenderTag, onAddItem = _a.onAddItem, getOptionDisabled = _a.getOptionDisabled,
|
|
3918
3918
|
//----------------------------------------------------------------------------------------------------------------
|
|
3919
3919
|
onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate, onFocus = _a.onFocus, onBlur = _a.onBlur,
|
|
3920
3920
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -4012,7 +4012,7 @@ PFormTextEditor.apiKey = '';var PFormAutocomplete = ToForwardRefExoticComponent(
|
|
|
4012
4012
|
var finalValue = value;
|
|
4013
4013
|
if (multiple) {
|
|
4014
4014
|
if (!Array.isArray(finalValue)) {
|
|
4015
|
-
if (finalValue != null
|
|
4015
|
+
if (finalValue != null) {
|
|
4016
4016
|
if (typeof finalValue === 'string') {
|
|
4017
4017
|
finalValue = Array.from(new Set(finalValue.split(formValueSeparator || ',')));
|
|
4018
4018
|
}
|
|
@@ -4091,7 +4091,7 @@ PFormTextEditor.apiKey = '';var PFormAutocomplete = ToForwardRefExoticComponent(
|
|
|
4091
4091
|
finalValue = (multiple ? [] : undefined);
|
|
4092
4092
|
}
|
|
4093
4093
|
var newComponentValue = (multiple ? [] : null);
|
|
4094
|
-
if (
|
|
4094
|
+
if (finalValue != null) {
|
|
4095
4095
|
if (items) {
|
|
4096
4096
|
if (Array.isArray(finalValue)) {
|
|
4097
4097
|
finalValue.forEach(function (v) {
|
|
@@ -4369,7 +4369,7 @@ PFormTextEditor.apiKey = '';var PFormAutocomplete = ToForwardRefExoticComponent(
|
|
|
4369
4369
|
/********************************************************************************************************************
|
|
4370
4370
|
* Render
|
|
4371
4371
|
* ******************************************************************************************************************/
|
|
4372
|
-
return (React.createElement(Autocomplete, { options: items || [], className: classNames(className, 'PFormValueItem', 'PFormAutocomplete'), sx: sx, multiple: multiple, fullWidth: !width && fullWidth, openOnFocus: openOnFocus, disableClearable: disableClearable, disablePortal: disablePortal, noOptionsText: noOptionsText, value: componentValue, style: style, isOptionEqualToValue: function (option, value) { return option.value === value.value; }, getOptionDisabled: handleGetOptionDisabled, disabled: disabled, readOnly: readOnly, loading: loading || isOnGetItemLoading, loadingText: loadingText, limitTags: limitTags, getLimitTagsText: getLimitTagsText, onChange: function (e, value, reason, details) { return handleChange(value, reason, details); }, renderOption: function (props, option) { return (React.createElement("li", __assign({}, props, { key: "".concat(option.value) }), onRenderItem ? onRenderItem(option) : option.label)); }, onInputChange: function (event, newInputValue, reason) {
|
|
4372
|
+
return (React.createElement(Autocomplete, { options: items || [], className: classNames(className, 'PFormValueItem', 'PFormAutocomplete'), sx: sx, multiple: multiple, fullWidth: !width && fullWidth, openOnFocus: openOnFocus, disableClearable: disableClearable, disablePortal: disablePortal, noOptionsText: noOptionsText, autoFocus: autoFocus, value: componentValue, style: style, isOptionEqualToValue: function (option, value) { return option.value === value.value; }, getOptionDisabled: handleGetOptionDisabled, disabled: disabled, readOnly: readOnly, loading: loading || isOnGetItemLoading, loadingText: loadingText, limitTags: limitTags, getLimitTagsText: getLimitTagsText, onChange: function (e, value, reason, details) { return handleChange(value, reason, details); }, renderOption: function (props, option) { return (React.createElement("li", __assign({}, props, { key: "".concat(option.value) }), onRenderItem ? onRenderItem(option) : option.label)); }, onInputChange: function (event, newInputValue, reason) {
|
|
4373
4373
|
if (reason === 'input') {
|
|
4374
4374
|
setInputValue(newInputValue);
|
|
4375
4375
|
}
|
package/dist/index.js
CHANGED
|
@@ -3914,7 +3914,7 @@ PFormTextEditor.apiKey = '';var PFormAutocomplete = ToForwardRefExoticComponent(
|
|
|
3914
3914
|
* ******************************************************************************************************************/
|
|
3915
3915
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
3916
3916
|
//----------------------------------------------------------------------------------------------------------------
|
|
3917
|
-
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initData = _a.data, initError = _a.error, helperText = _a.helperText, initDisabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, exceptValue = _a.exceptValue, width = _a.width, placeholder = _a.placeholder, multiple = _a.multiple, _b = _a.formValueSeparator, formValueSeparator = _b === void 0 ? ',' : _b, formValueSort = _a.formValueSort, disablePortal = _a.disablePortal, _c = _a.noOptionsText, noOptionsText = _c === void 0 ? '항목이 없습니다' : _c, loadingText = _a.loadingText, limitTags = _a.limitTags, getLimitTagsText = _a.getLimitTagsText, openOnFocus = _a.openOnFocus, disableClearable = _a.disableClearable, async = _a.async, initHidden = _a.hidden, onLoadItems = _a.onLoadItems, onAsyncLoadValueItem = _a.onAsyncLoadValueItem, onRenderItem = _a.onRenderItem, onRenderTag = _a.onRenderTag, onAddItem = _a.onAddItem, getOptionDisabled = _a.getOptionDisabled,
|
|
3917
|
+
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initData = _a.data, initError = _a.error, helperText = _a.helperText, initDisabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, exceptValue = _a.exceptValue, width = _a.width, placeholder = _a.placeholder, multiple = _a.multiple, _b = _a.formValueSeparator, formValueSeparator = _b === void 0 ? ',' : _b, formValueSort = _a.formValueSort, disablePortal = _a.disablePortal, _c = _a.noOptionsText, noOptionsText = _c === void 0 ? '항목이 없습니다' : _c, loadingText = _a.loadingText, limitTags = _a.limitTags, getLimitTagsText = _a.getLimitTagsText, openOnFocus = _a.openOnFocus, disableClearable = _a.disableClearable, async = _a.async, autoFocus = _a.autoFocus, initHidden = _a.hidden, onLoadItems = _a.onLoadItems, onAsyncLoadValueItem = _a.onAsyncLoadValueItem, onRenderItem = _a.onRenderItem, onRenderTag = _a.onRenderTag, onAddItem = _a.onAddItem, getOptionDisabled = _a.getOptionDisabled,
|
|
3918
3918
|
//----------------------------------------------------------------------------------------------------------------
|
|
3919
3919
|
onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate, onFocus = _a.onFocus, onBlur = _a.onBlur,
|
|
3920
3920
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -4012,7 +4012,7 @@ PFormTextEditor.apiKey = '';var PFormAutocomplete = ToForwardRefExoticComponent(
|
|
|
4012
4012
|
var finalValue = value;
|
|
4013
4013
|
if (multiple) {
|
|
4014
4014
|
if (!Array.isArray(finalValue)) {
|
|
4015
|
-
if (finalValue != null
|
|
4015
|
+
if (finalValue != null) {
|
|
4016
4016
|
if (typeof finalValue === 'string') {
|
|
4017
4017
|
finalValue = Array.from(new Set(finalValue.split(formValueSeparator || ',')));
|
|
4018
4018
|
}
|
|
@@ -4091,7 +4091,7 @@ PFormTextEditor.apiKey = '';var PFormAutocomplete = ToForwardRefExoticComponent(
|
|
|
4091
4091
|
finalValue = (multiple ? [] : undefined);
|
|
4092
4092
|
}
|
|
4093
4093
|
var newComponentValue = (multiple ? [] : null);
|
|
4094
|
-
if (
|
|
4094
|
+
if (finalValue != null) {
|
|
4095
4095
|
if (items) {
|
|
4096
4096
|
if (Array.isArray(finalValue)) {
|
|
4097
4097
|
finalValue.forEach(function (v) {
|
|
@@ -4369,7 +4369,7 @@ PFormTextEditor.apiKey = '';var PFormAutocomplete = ToForwardRefExoticComponent(
|
|
|
4369
4369
|
/********************************************************************************************************************
|
|
4370
4370
|
* Render
|
|
4371
4371
|
* ******************************************************************************************************************/
|
|
4372
|
-
return (React.createElement(material.Autocomplete, { options: items || [], className: classNames(className, 'PFormValueItem', 'PFormAutocomplete'), sx: sx, multiple: multiple, fullWidth: !width && fullWidth, openOnFocus: openOnFocus, disableClearable: disableClearable, disablePortal: disablePortal, noOptionsText: noOptionsText, value: componentValue, style: style, isOptionEqualToValue: function (option, value) { return option.value === value.value; }, getOptionDisabled: handleGetOptionDisabled, disabled: disabled, readOnly: readOnly, loading: loading || isOnGetItemLoading, loadingText: loadingText, limitTags: limitTags, getLimitTagsText: getLimitTagsText, onChange: function (e, value, reason, details) { return handleChange(value, reason, details); }, renderOption: function (props, option) { return (React.createElement("li", __assign({}, props, { key: "".concat(option.value) }), onRenderItem ? onRenderItem(option) : option.label)); }, onInputChange: function (event, newInputValue, reason) {
|
|
4372
|
+
return (React.createElement(material.Autocomplete, { options: items || [], className: classNames(className, 'PFormValueItem', 'PFormAutocomplete'), sx: sx, multiple: multiple, fullWidth: !width && fullWidth, openOnFocus: openOnFocus, disableClearable: disableClearable, disablePortal: disablePortal, noOptionsText: noOptionsText, autoFocus: autoFocus, value: componentValue, style: style, isOptionEqualToValue: function (option, value) { return option.value === value.value; }, getOptionDisabled: handleGetOptionDisabled, disabled: disabled, readOnly: readOnly, loading: loading || isOnGetItemLoading, loadingText: loadingText, limitTags: limitTags, getLimitTagsText: getLimitTagsText, onChange: function (e, value, reason, details) { return handleChange(value, reason, details); }, renderOption: function (props, option) { return (React.createElement("li", __assign({}, props, { key: "".concat(option.value) }), onRenderItem ? onRenderItem(option) : option.label)); }, onInputChange: function (event, newInputValue, reason) {
|
|
4373
4373
|
if (reason === 'input') {
|
|
4374
4374
|
setInputValue(newInputValue);
|
|
4375
4375
|
}
|