@pdg/react-form 1.0.10 → 1.0.11

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.
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { SearchGroupRowProps as Props } from './SearchGroupRow.types';
3
+ declare const SearchGroupRow: React.FC<Props>;
4
+ export default SearchGroupRow;
@@ -0,0 +1,4 @@
1
+ import { CommonSxProps } from '../../@types';
2
+ export interface SearchGroupRowProps extends CommonSxProps {
3
+ }
4
+ export declare const SearchGroupRowDefaultProps: {};
@@ -0,0 +1,4 @@
1
+ import SearchGroupRow from './SearchGroupRow';
2
+ export default SearchGroupRow;
3
+ export { SearchGroupRow };
4
+ export * from './SearchGroupRow.types';
@@ -1,3 +1,4 @@
1
1
  export * from './Search';
2
2
  export * from './SearchGroup';
3
3
  export * from './SearchButton';
4
+ export * from './SearchGroupRow';
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import*as React from'react';import React__default,{useRef,useEffect,useState,useCallback,useLayoutEffect,createContext,useContext,cloneElement,isValidElement,createRef,PureComponent,useId}from'react';import {Box,Grid,Icon as Icon$1,Button,InputLabel,styled,FormHelperText,InputAdornment,IconButton,TextField,Chip,Autocomplete,CircularProgress,MenuItem,Checkbox,FormControl,Input,OutlinedInput,FilledInput,FormControlLabel,Typography,useTheme,RadioGroup,Radio,ToggleButtonGroup,ToggleButton,Rating,Skeleton,darken,Tooltip,tooltipClasses,ClickAwayListener,Dialog,DialogTitle,DialogContent,DialogActions,Paper}from'@mui/material';import dayjs from'dayjs';import {findDOMNode}from'react-dom';import {CheckBox,CheckBoxOutlineBlank,RadioButtonUnchecked,RadioButtonChecked}from'@mui/icons-material';import CircularProgress$1 from'@mui/material/CircularProgress';import {AdapterDayjs}from'@mui/x-date-pickers/AdapterDayjs';import {PickersDay,StaticDatePicker,LocalizationProvider,DesktopDatePicker}from'@mui/x-date-pickers';import dayjsLocale from'dayjs/locale/ko';import dayjsIsSameOrAfter from'dayjs/plugin/isSameOrAfter';import dayjsIsSameOrBefore from'dayjs/plugin/isSameOrBefore';import dayjsIsBetween from'dayjs/plugin/isBetween';/******************************************************************************
1
+ import*as React from'react';import React__default,{useRef,useEffect,useState,useCallback,useLayoutEffect,createContext,useContext,cloneElement,isValidElement,createRef,PureComponent,useId,useMemo}from'react';import {Box,Grid,Icon as Icon$1,Button,InputLabel,styled,FormHelperText,InputAdornment,IconButton,TextField,Chip,Autocomplete,CircularProgress,MenuItem,Checkbox,FormControl,Input,OutlinedInput,FilledInput,FormControlLabel,Typography,useTheme,RadioGroup,Radio,ToggleButtonGroup,ToggleButton,Rating,Skeleton,darken,Tooltip,tooltipClasses,ClickAwayListener,Dialog,DialogTitle,DialogContent,DialogActions,Paper}from'@mui/material';import dayjs from'dayjs';import {findDOMNode}from'react-dom';import {CheckBox,CheckBoxOutlineBlank,RadioButtonUnchecked,RadioButtonChecked}from'@mui/icons-material';import CircularProgress$1 from'@mui/material/CircularProgress';import {AdapterDayjs}from'@mui/x-date-pickers/AdapterDayjs';import {PickersDay,StaticDatePicker,LocalizationProvider,DesktopDatePicker}from'@mui/x-date-pickers';import dayjsLocale from'dayjs/locale/ko';import dayjsIsSameOrAfter from'dayjs/plugin/isSameOrAfter';import dayjsIsSameOrBefore from'dayjs/plugin/isSameOrBefore';import dayjsIsBetween from'dayjs/plugin/isBetween';/******************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -16376,7 +16376,14 @@ styleInject(css_248z);var FormImageFile = React__default.forwardRef(function (_a
16376
16376
  FormImageFile.displayName = 'FormImageFile';
16377
16377
  FormImageFile.defaultProps = FormImageFileDefaultProps;var SearchDefaultProps = {
16378
16378
  color: 'primary',
16379
- };var Search = React__default.forwardRef(function (_a, ref) {
16379
+ };var SearchGroupRowDefaultProps = {};var SearchGroupRow = function (_a) {
16380
+ var children = _a.children;
16381
+ return (React__default.createElement(FormRow, null,
16382
+ React__default.createElement(FormCol, null,
16383
+ React__default.createElement(Grid, { container: true, spacing: 1, alignItems: 'center' }, children))));
16384
+ };
16385
+ SearchGroupRow.displayName = 'SearchGroupRow';
16386
+ SearchGroupRow.defaultProps = SearchGroupRowDefaultProps;var Search = React__default.forwardRef(function (_a, ref) {
16380
16387
  // Ref -------------------------------------------------------------------------------------------------------------
16381
16388
  var children = _a.children, className = _a.className, style = _a.style, sx = _a.sx,
16382
16389
  //----------------------------------------------------------------------------------------------------------------
@@ -16389,6 +16396,27 @@ FormImageFile.defaultProps = FormImageFileDefaultProps;var SearchDefaultProps =
16389
16396
  (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.submit();
16390
16397
  }
16391
16398
  }, []);
16399
+ // Memo --------------------------------------------------------------------------------------------------------------
16400
+ var renderChildren = useMemo(function () {
16401
+ var rowItems = [];
16402
+ var basicRowItems = [];
16403
+ React__default.Children.forEach(children, function (child) {
16404
+ if (React__default.isValidElement(child)) {
16405
+ if (child.type.toString() === SearchGroupRow.toString()) {
16406
+ rowItems.push(child);
16407
+ }
16408
+ else {
16409
+ basicRowItems.push(child);
16410
+ }
16411
+ }
16412
+ });
16413
+ if (basicRowItems.length > 0) {
16414
+ return __spreadArray([React__default.createElement(SearchGroupRow, null, basicRowItems)], rowItems, true);
16415
+ }
16416
+ else {
16417
+ return rowItems;
16418
+ }
16419
+ }, [children]);
16392
16420
  // Render ----------------------------------------------------------------------------------------------------------
16393
16421
  return (React__default.createElement(FormContextProvider, { value: {
16394
16422
  id: 'search',
@@ -16425,10 +16453,7 @@ FormImageFile.defaultProps = FormImageFileDefaultProps;var SearchDefaultProps =
16425
16453
  }
16426
16454
  }
16427
16455
  formRef.current = commands || undefined;
16428
- }, className: 'Search', variant: 'outlined', size: 'small', color: color, spacing: spacing, focused: focused, labelShrink: labelShrink, fullWidth: false }, otherProps),
16429
- React__default.createElement(FormRow, null,
16430
- React__default.createElement(FormCol, null,
16431
- React__default.createElement(Grid, { container: true, spacing: 1, alignItems: 'center' }, children)))))));
16456
+ }, className: 'Search', variant: 'outlined', size: 'small', color: color, spacing: spacing, focused: focused, labelShrink: labelShrink, fullWidth: false }, otherProps), renderChildren))));
16432
16457
  });
16433
16458
  Search.displayName = 'Search';
16434
16459
  Search.defaultProps = SearchDefaultProps;var SearchGroupDefaultProps = {
@@ -16505,4 +16530,4 @@ SearchGroup.defaultProps = SearchGroupDefaultProps;var SearchButtonDefaultProps
16505
16530
  };
16506
16531
  SearchButton.defaultProps = SearchButtonDefaultProps;dayjs.extend(dayjsIsSameOrAfter);
16507
16532
  dayjs.extend(dayjsIsSameOrBefore);
16508
- dayjs.extend(dayjsIsBetween);export{Form,FormAutocomplete,FormAutocompleteDefaultProps,FormBlock,FormBlockDefaultProps,FormButton,FormButtonDefaultProps,FormCheckbox,FormCheckboxDefaultProps,FormCol,FormColDefaultProps,FormContext,FormContextDefaultValue,FormContextProvider,FormDatePicker,FormDatePickerDefaultProps,FormDateRangePicker,FormDateRangePickerDefaultProps,FormDateTimePicker,FormDateTimePickerDefaultProps,FormDefaultProps,FormDivider,FormDividerDefaultProps,FormEmail,FormEmailDefaultProps,FormFile,FormFileDefaultProps,FormHidden,FormHiddenDefaultProps,FormIcon,FormIconDefaultProps,FormImageFile,FormImageFileDefaultProps,FormLabel,FormLabelDefaultProps,FormMobile,FormMobileDefaultProps,FormNumber,FormNumberDefaultProps,FormPassword,FormPasswordDefaultProps,FormRadioGroup,FormRadioGroupDefaultProps,FormRating,FormRatingDefaultProps,FormRow,FormRowDefaultProps,FormSearch,FormSearchDefaultProps,FormSelect,FormSelectDefaultProps,FormTag,FormTagDefaultProps,FormTel,FormTelDefaultProps,FormText,FormTextDefaultProps,FormTextEditor,FormTextEditorDefaultProps,FormTextField,FormTextFieldDefaultProps,FormTextarea,FormTextareaDefaultProps,FormTimePicker,FormTimePickerDefaultProps,FormToggleButtonGroup,FormToggleButtonGroupDefaultProps,FormUrl,FormUrlDefaultProps,Search,SearchButton,SearchButtonDefaultProps,SearchDefaultProps,SearchGroup,SearchGroupDefaultProps,useFormState};//# sourceMappingURL=index.esm.js.map
16533
+ dayjs.extend(dayjsIsBetween);export{Form,FormAutocomplete,FormAutocompleteDefaultProps,FormBlock,FormBlockDefaultProps,FormButton,FormButtonDefaultProps,FormCheckbox,FormCheckboxDefaultProps,FormCol,FormColDefaultProps,FormContext,FormContextDefaultValue,FormContextProvider,FormDatePicker,FormDatePickerDefaultProps,FormDateRangePicker,FormDateRangePickerDefaultProps,FormDateTimePicker,FormDateTimePickerDefaultProps,FormDefaultProps,FormDivider,FormDividerDefaultProps,FormEmail,FormEmailDefaultProps,FormFile,FormFileDefaultProps,FormHidden,FormHiddenDefaultProps,FormIcon,FormIconDefaultProps,FormImageFile,FormImageFileDefaultProps,FormLabel,FormLabelDefaultProps,FormMobile,FormMobileDefaultProps,FormNumber,FormNumberDefaultProps,FormPassword,FormPasswordDefaultProps,FormRadioGroup,FormRadioGroupDefaultProps,FormRating,FormRatingDefaultProps,FormRow,FormRowDefaultProps,FormSearch,FormSearchDefaultProps,FormSelect,FormSelectDefaultProps,FormTag,FormTagDefaultProps,FormTel,FormTelDefaultProps,FormText,FormTextDefaultProps,FormTextEditor,FormTextEditorDefaultProps,FormTextField,FormTextFieldDefaultProps,FormTextarea,FormTextareaDefaultProps,FormTimePicker,FormTimePickerDefaultProps,FormToggleButtonGroup,FormToggleButtonGroupDefaultProps,FormUrl,FormUrlDefaultProps,Search,SearchButton,SearchButtonDefaultProps,SearchDefaultProps,SearchGroup,SearchGroupDefaultProps,SearchGroupRow,SearchGroupRowDefaultProps,useFormState};//# sourceMappingURL=index.esm.js.map