@pdg/react-form 1.0.127 → 1.0.128

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.esm.js CHANGED
@@ -10113,7 +10113,12 @@ FormYearRangePicker.displayName = 'FormYearRangePicker';var FormSwitch = React.f
10113
10113
  var switchControl = useMemo(function () { return (React.createElement(Switch, { size: size, name: name, checked: value, color: color, disabled: disabled, onChange: handleChange, onFocus: function () { return setFocused(initFocused || true); }, onBlur: function () { return setFocused(initFocused || false); } })); }, [color, disabled, handleChange, initFocused, name, setFocused, size, value]);
10114
10114
  return (React.createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames(className, 'FormValueItem', 'FormSwitch'), labelIcon: labelIcon, label: label, error: error, fullWidth: false, helperText: error ? errorHelperText : helperText, helperTextProps: { style: { marginLeft: 5 } }, style: style, sx: sx, hidden: hidden, autoSize: true, controlHeight: size === 'small' ? 24 : 38, controlVerticalCenter: true, control: switchLabel ? (React.createElement(FormControlLabel, { control: switchControl, label: switchLabel, disabled: disabled })) : (switchControl) }));
10115
10115
  });
10116
- FormSwitch.displayName = 'FormSwitch';var Search = React.forwardRef(function (_a, ref) {
10116
+ FormSwitch.displayName = 'FormSwitch';var SearchGroupRow = function (_a) {
10117
+ var children = _a.children, props = __rest(_a, ["children"]);
10118
+ return (React.createElement(FormRow, __assign({}, props),
10119
+ React.createElement(FormCol, null,
10120
+ React.createElement(Grid, { container: true, spacing: 1, alignItems: 'center' }, children))));
10121
+ };var Search = React.forwardRef(function (_a, ref) {
10117
10122
  /********************************************************************************************************************
10118
10123
  * Ref
10119
10124
  * ******************************************************************************************************************/
@@ -10133,31 +10138,29 @@ FormSwitch.displayName = 'FormSwitch';var Search = React.forwardRef(function (_a
10133
10138
  }
10134
10139
  // eslint-disable-next-line react-hooks/exhaustive-deps
10135
10140
  }, []);
10136
- // /********************************************************************************************************************
10137
- // * Memo
10138
- // * ******************************************************************************************************************/
10139
- //
10140
- // const renderChildren = useMemo(() => {
10141
- // ll('children changed');
10142
- // const rowItems: ReactNode[] = [];
10143
- // const basicRowItems: ReactNode[] = [];
10144
- //
10145
- // React.Children.forEach(children, (child) => {
10146
- // if (React.isValidElement(child)) {
10147
- // if (child.type.toString() === SearchGroupRow.toString()) {
10148
- // rowItems.push(child);
10149
- // } else {
10150
- // basicRowItems.push(child);
10151
- // }
10152
- // }
10153
- // });
10154
- //
10155
- // if (basicRowItems.length > 0) {
10156
- // return [<SearchGroupRow key='$basicRow$'>{basicRowItems}</SearchGroupRow>, ...rowItems];
10157
- // } else {
10158
- // return rowItems;
10159
- // }
10160
- // }, [children]);
10141
+ /********************************************************************************************************************
10142
+ * Memo
10143
+ * ******************************************************************************************************************/
10144
+ var renderChildren = useMemo(function () {
10145
+ var rowItems = [];
10146
+ var basicRowItems = [];
10147
+ React.Children.forEach(children, function (child) {
10148
+ if (React.isValidElement(child)) {
10149
+ if (child.type.toString() === SearchGroupRow.toString()) {
10150
+ rowItems.push(child);
10151
+ }
10152
+ else {
10153
+ basicRowItems.push(child);
10154
+ }
10155
+ }
10156
+ });
10157
+ if (basicRowItems.length > 0) {
10158
+ return __spreadArray([React.createElement(SearchGroupRow, { key: '$basicRow$' }, basicRowItems)], rowItems, true);
10159
+ }
10160
+ else {
10161
+ return rowItems;
10162
+ }
10163
+ }, [children]);
10161
10164
  /********************************************************************************************************************
10162
10165
  * FormContextValue
10163
10166
  * ******************************************************************************************************************/
@@ -10207,7 +10210,7 @@ FormSwitch.displayName = 'FormSwitch';var Search = React.forwardRef(function (_a
10207
10210
  return (React.createElement(FormContextProvider, { value: formContextValue },
10208
10211
  React.createElement(Paper, { variant: 'outlined', className: className, sx: __assign({ p: 1.5 }, sx), style: style },
10209
10212
  React.createElement(Form, __assign({ ref: handleRef, className: 'Search', variant: 'outlined', size: 'small', color: color, spacing: spacing, focused: focused, labelShrink: labelShrink, fullWidth: false }, otherProps),
10210
- React.createElement(FormBody, null, children)))));
10213
+ React.createElement(FormBody, null, renderChildren)))));
10211
10214
  });var StyledItem = styled(Grid)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:has(> [style*='display: none;']) {\n display: none;\n }\n"], ["\n &:has(> [style*='display: none;']) {\n display: none;\n }\n"])));
10212
10215
  var templateObject_1;var isReactFragment = function (child) {
10213
10216
  try {
@@ -10346,9 +10349,4 @@ var SearchButton$1 = React.memo(SearchButton);var SearchMenuButton = function (_
10346
10349
  return (React.createElement(React.Fragment, null,
10347
10350
  React.createElement(FormButton$1, __assign({ className: classNames(className, 'SearchMenuButton'), size: 'medium', sx: __assign({ minWidth: 0, px: "".concat(!children ? 9 : 13, "px !important") }, initSx), fullWidth: false }, props, { id: buttonId, "aria-controls": open ? menuId : undefined, "aria-haspopup": 'true', "aria-expanded": open ? 'true' : undefined, endIcon: endIcon, endIconProps: { style: { marginRight: -5 } }, onClick: handleClick }), children),
10348
10351
  React.createElement(Menu, { id: menuId, "aria-labelledby": buttonId, anchorEl: anchorEl, open: open, onClose: handleClose, onClick: handleClose, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin }, menuList)));
10349
- };var SearchGroupRow = function (_a) {
10350
- var children = _a.children, props = __rest(_a, ["children"]);
10351
- return (React.createElement(FormRow, __assign({}, props),
10352
- React.createElement(FormCol, null,
10353
- React.createElement(Grid, { container: true, spacing: 1, alignItems: 'center' }, children))));
10354
10352
  };export{Form,FormAutocomplete,FormBlock,FormBody,FormButton$1 as FormButton,FormCheckbox,FormCol,FormCompanyNo,FormContext,FormContextDefaultValue,FormContextProvider,FormDatePicker,FormDateRangePicker,FormDateTimePicker,FormDivider,FormEmail,FormFile,FormFooter,FormHidden,FormImageFile,FormLabel$1 as FormLabel,FormMobile,FormMonthPicker,FormMonthRangePicker,FormNumber,FormPassword,FormPersonalNo,FormRadioGroup,FormRating,FormRow,FormSearch,FormSelect,FormSwitch,FormTag,FormTel,FormText,FormTextEditor,FormTextField,FormTextarea,FormTimePicker,FormToggleButtonGroup,FormUrl,FormYearPicker,FormYearRangePicker,Search,SearchButton$1 as SearchButton,SearchGroup,SearchGroupRow,SearchMenuButton,useFormState};
package/dist/index.js CHANGED
@@ -10113,7 +10113,12 @@ FormYearRangePicker.displayName = 'FormYearRangePicker';var FormSwitch = React.f
10113
10113
  var switchControl = React.useMemo(function () { return (React.createElement(material.Switch, { size: size, name: name, checked: value, color: color, disabled: disabled, onChange: handleChange, onFocus: function () { return setFocused(initFocused || true); }, onBlur: function () { return setFocused(initFocused || false); } })); }, [color, disabled, handleChange, initFocused, name, setFocused, size, value]);
10114
10114
  return (React.createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames(className, 'FormValueItem', 'FormSwitch'), labelIcon: labelIcon, label: label, error: error, fullWidth: false, helperText: error ? errorHelperText : helperText, helperTextProps: { style: { marginLeft: 5 } }, style: style, sx: sx, hidden: hidden, autoSize: true, controlHeight: size === 'small' ? 24 : 38, controlVerticalCenter: true, control: switchLabel ? (React.createElement(material.FormControlLabel, { control: switchControl, label: switchLabel, disabled: disabled })) : (switchControl) }));
10115
10115
  });
10116
- FormSwitch.displayName = 'FormSwitch';var Search = React.forwardRef(function (_a, ref) {
10116
+ FormSwitch.displayName = 'FormSwitch';var SearchGroupRow = function (_a) {
10117
+ var children = _a.children, props = __rest(_a, ["children"]);
10118
+ return (React.createElement(FormRow, __assign({}, props),
10119
+ React.createElement(FormCol, null,
10120
+ React.createElement(material.Grid, { container: true, spacing: 1, alignItems: 'center' }, children))));
10121
+ };var Search = React.forwardRef(function (_a, ref) {
10117
10122
  /********************************************************************************************************************
10118
10123
  * Ref
10119
10124
  * ******************************************************************************************************************/
@@ -10133,31 +10138,29 @@ FormSwitch.displayName = 'FormSwitch';var Search = React.forwardRef(function (_a
10133
10138
  }
10134
10139
  // eslint-disable-next-line react-hooks/exhaustive-deps
10135
10140
  }, []);
10136
- // /********************************************************************************************************************
10137
- // * Memo
10138
- // * ******************************************************************************************************************/
10139
- //
10140
- // const renderChildren = useMemo(() => {
10141
- // ll('children changed');
10142
- // const rowItems: ReactNode[] = [];
10143
- // const basicRowItems: ReactNode[] = [];
10144
- //
10145
- // React.Children.forEach(children, (child) => {
10146
- // if (React.isValidElement(child)) {
10147
- // if (child.type.toString() === SearchGroupRow.toString()) {
10148
- // rowItems.push(child);
10149
- // } else {
10150
- // basicRowItems.push(child);
10151
- // }
10152
- // }
10153
- // });
10154
- //
10155
- // if (basicRowItems.length > 0) {
10156
- // return [<SearchGroupRow key='$basicRow$'>{basicRowItems}</SearchGroupRow>, ...rowItems];
10157
- // } else {
10158
- // return rowItems;
10159
- // }
10160
- // }, [children]);
10141
+ /********************************************************************************************************************
10142
+ * Memo
10143
+ * ******************************************************************************************************************/
10144
+ var renderChildren = React.useMemo(function () {
10145
+ var rowItems = [];
10146
+ var basicRowItems = [];
10147
+ React.Children.forEach(children, function (child) {
10148
+ if (React.isValidElement(child)) {
10149
+ if (child.type.toString() === SearchGroupRow.toString()) {
10150
+ rowItems.push(child);
10151
+ }
10152
+ else {
10153
+ basicRowItems.push(child);
10154
+ }
10155
+ }
10156
+ });
10157
+ if (basicRowItems.length > 0) {
10158
+ return __spreadArray([React.createElement(SearchGroupRow, { key: '$basicRow$' }, basicRowItems)], rowItems, true);
10159
+ }
10160
+ else {
10161
+ return rowItems;
10162
+ }
10163
+ }, [children]);
10161
10164
  /********************************************************************************************************************
10162
10165
  * FormContextValue
10163
10166
  * ******************************************************************************************************************/
@@ -10207,7 +10210,7 @@ FormSwitch.displayName = 'FormSwitch';var Search = React.forwardRef(function (_a
10207
10210
  return (React.createElement(FormContextProvider, { value: formContextValue },
10208
10211
  React.createElement(material.Paper, { variant: 'outlined', className: className, sx: __assign({ p: 1.5 }, sx), style: style },
10209
10212
  React.createElement(Form, __assign({ ref: handleRef, className: 'Search', variant: 'outlined', size: 'small', color: color, spacing: spacing, focused: focused, labelShrink: labelShrink, fullWidth: false }, otherProps),
10210
- React.createElement(FormBody, null, children)))));
10213
+ React.createElement(FormBody, null, renderChildren)))));
10211
10214
  });var StyledItem = material.styled(material.Grid)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:has(> [style*='display: none;']) {\n display: none;\n }\n"], ["\n &:has(> [style*='display: none;']) {\n display: none;\n }\n"])));
10212
10215
  var templateObject_1;var isReactFragment = function (child) {
10213
10216
  try {
@@ -10346,9 +10349,4 @@ var SearchButton$1 = React.memo(SearchButton);var SearchMenuButton = function (_
10346
10349
  return (React.createElement(React.Fragment, null,
10347
10350
  React.createElement(FormButton$1, __assign({ className: classNames(className, 'SearchMenuButton'), size: 'medium', sx: __assign({ minWidth: 0, px: "".concat(!children ? 9 : 13, "px !important") }, initSx), fullWidth: false }, props, { id: buttonId, "aria-controls": open ? menuId : undefined, "aria-haspopup": 'true', "aria-expanded": open ? 'true' : undefined, endIcon: endIcon, endIconProps: { style: { marginRight: -5 } }, onClick: handleClick }), children),
10348
10351
  React.createElement(material.Menu, { id: menuId, "aria-labelledby": buttonId, anchorEl: anchorEl, open: open, onClose: handleClose, onClick: handleClose, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin }, menuList)));
10349
- };var SearchGroupRow = function (_a) {
10350
- var children = _a.children, props = __rest(_a, ["children"]);
10351
- return (React.createElement(FormRow, __assign({}, props),
10352
- React.createElement(FormCol, null,
10353
- React.createElement(material.Grid, { container: true, spacing: 1, alignItems: 'center' }, children))));
10354
10352
  };exports.Form=Form;exports.FormAutocomplete=FormAutocomplete;exports.FormBlock=FormBlock;exports.FormBody=FormBody;exports.FormButton=FormButton$1;exports.FormCheckbox=FormCheckbox;exports.FormCol=FormCol;exports.FormCompanyNo=FormCompanyNo;exports.FormContext=FormContext;exports.FormContextDefaultValue=FormContextDefaultValue;exports.FormContextProvider=FormContextProvider;exports.FormDatePicker=FormDatePicker;exports.FormDateRangePicker=FormDateRangePicker;exports.FormDateTimePicker=FormDateTimePicker;exports.FormDivider=FormDivider;exports.FormEmail=FormEmail;exports.FormFile=FormFile;exports.FormFooter=FormFooter;exports.FormHidden=FormHidden;exports.FormImageFile=FormImageFile;exports.FormLabel=FormLabel$1;exports.FormMobile=FormMobile;exports.FormMonthPicker=FormMonthPicker;exports.FormMonthRangePicker=FormMonthRangePicker;exports.FormNumber=FormNumber;exports.FormPassword=FormPassword;exports.FormPersonalNo=FormPersonalNo;exports.FormRadioGroup=FormRadioGroup;exports.FormRating=FormRating;exports.FormRow=FormRow;exports.FormSearch=FormSearch;exports.FormSelect=FormSelect;exports.FormSwitch=FormSwitch;exports.FormTag=FormTag;exports.FormTel=FormTel;exports.FormText=FormText;exports.FormTextEditor=FormTextEditor;exports.FormTextField=FormTextField;exports.FormTextarea=FormTextarea;exports.FormTimePicker=FormTimePicker;exports.FormToggleButtonGroup=FormToggleButtonGroup;exports.FormUrl=FormUrl;exports.FormYearPicker=FormYearPicker;exports.FormYearRangePicker=FormYearRangePicker;exports.Search=Search;exports.SearchButton=SearchButton$1;exports.SearchGroup=SearchGroup;exports.SearchGroupRow=SearchGroupRow;exports.SearchMenuButton=SearchMenuButton;exports.useFormState=useFormState;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pdg/react-form",
3
3
  "title": "React Form",
4
- "version": "1.0.127",
4
+ "version": "1.0.128",
5
5
  "description": "React Form",
6
6
  "type": "module",
7
7
  "types": "dist/index.d.ts",