react-asc 25.8.1 → 25.8.2

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/index.es.js CHANGED
@@ -5357,7 +5357,7 @@ var styles$B = {"formInput":"FormInput-module_formInput__VXZip","disabled":"Form
5357
5357
  styleInject(css_248z$B);
5358
5358
 
5359
5359
  const FormInput = (props) => {
5360
- const { value, name, type, placeholder, className, isValid = true, options = [], textareaOptions, selectOptions, autoCompleteOptions, autoFocus, label, disabled = false, readonly = false, onInput, onChange, onBlur, onKeyDown } = props;
5360
+ const { value, name, type, placeholder, className, isValid = true, options = [], textareaOptions, selectOptions, autoCompleteOptions, autoFocus, label, disabled = false, readonly = false, onInput, onChange, onBlur, onKeyDown, } = props;
5361
5361
  const getCssClasses = () => {
5362
5362
  const cssClasses = [];
5363
5363
  cssClasses.push(styles$B.formInput);
@@ -5380,15 +5380,7 @@ const FormInput = (props) => {
5380
5380
  type === 'number' ||
5381
5381
  type === 'password' ||
5382
5382
  type === 'color' ||
5383
- type === 'time')
5384
- &&
5385
- jsx("input", { id: name, name: name, type: type, className: getCssClasses(), value: value, autoFocus: autoFocus, onInput: (e) => handleOnInput(e.target.value, type, name), onChange: (e) => handleOnChange((e?.target).value, type, name), onBlur: onBlur, placeholder: placeholder, readOnly: readonly, disabled: disabled, onKeyDown: onKeyDown }), type === 'file' &&
5386
- jsx(FileInput, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, autoFocus: autoFocus, readOnly: readonly, disabled: disabled, onChange: (e) => handleOnChange(e.target.value, type, name), children: "choose a file" }), type === 'textarea' &&
5387
- jsx(Textarea, { id: name, name: name, className: className, error: !isValid, value: value, autoFocus: autoFocus, onInput: (e) => handleOnInput(e.target.value, type, name), onChange: (e) => handleOnChange(e.target.value, type, name), placeholder: placeholder, rows: textareaOptions?.rows, style: textareaOptions?.resize !== false ? undefined : { resize: 'none' } }), type === 'select' &&
5388
- jsx(Select, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, multiple: selectOptions?.multiple, onChange: (e) => handleOnChange(e, type, name), options: options }), type === 'autocomplete' &&
5389
- jsx(AutoComplete, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, openOnFocus: autoCompleteOptions?.openOnFocus, onChange: (e) => handleOnChange(e, type, name), onSelect: (e) => handleOnChange(e.value, type, name), options: options }), type === 'checkbox' &&
5390
- jsx(Checkbox, { id: name, name: name, label: label, className: (!isValid ? ' is-invalid' : ''), onChange: (e) => handleOnChange((e?.target).checked, type, name), checked: value }), type === 'radio' &&
5391
- jsx(Fragment$1, { children: options.map((option) => jsxs("div", { className: "form-check", children: [jsx("input", { id: option.id ? option.id : option.value, name: name, type: "radio", className: "form-check-input", onChange: (e) => handleOnChange((e?.target).value, type, name), value: option.value, checked: value === option.value, onKeyDown: onKeyDown }), jsx("label", { className: "form-check-label", htmlFor: option.id, children: option.label })] }, option.id)) })] }));
5383
+ type === 'time') && (jsx("input", { id: name, name: name, type: type, className: getCssClasses(), value: value, autoFocus: autoFocus, onInput: (e) => handleOnInput(e.target.value, type, name), onChange: (e) => handleOnChange((e?.target).value, type, name), onBlur: onBlur, placeholder: placeholder, readOnly: readonly, disabled: disabled, onKeyDown: onKeyDown })), type === 'file' && (jsx(FileInput, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, autoFocus: autoFocus, readOnly: readonly, disabled: disabled, onChange: (e) => handleOnChange(e.target.value, type, name), children: "choose a file" })), type === 'textarea' && (jsx(Textarea, { id: name, name: name, className: className, error: !isValid, value: value, disabled: disabled, autoFocus: autoFocus, onInput: (e) => handleOnInput(e.target.value, type, name), onChange: (e) => handleOnChange(e.target.value, type, name), placeholder: placeholder, rows: textareaOptions?.rows, style: textareaOptions?.resize !== false ? undefined : { resize: 'none' } })), type === 'select' && (jsx(Select, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, disabled: disabled, multiple: selectOptions?.multiple, onChange: (e) => handleOnChange(e, type, name), options: options })), type === 'autocomplete' && (jsx(AutoComplete, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, disabled: disabled, openOnFocus: autoCompleteOptions?.openOnFocus, onChange: (e) => handleOnChange(e, type, name), onSelect: (e) => handleOnChange(e.value, type, name), options: options })), type === 'checkbox' && (jsx(Checkbox, { id: name, name: name, label: label, disabled: disabled, className: !isValid ? ' is-invalid' : '', onChange: (e) => handleOnChange((e?.target).checked, type, name), checked: value })), type === 'radio' && (jsx(Fragment$1, { children: options.map(option => (jsxs("div", { className: "form-check", children: [jsx("input", { id: option.id ? option.id : option.value, name: name, type: "radio", className: "form-check-input", onChange: (e) => handleOnChange((e?.target).value, type, name), value: option.value, checked: value === option.value, onKeyDown: onKeyDown }), jsx("label", { className: "form-check-label", htmlFor: option.id, children: option.label })] }, option.id))) }))] }));
5392
5384
  };
5393
5385
 
5394
5386
  var css_248z$A = ".FormLabel-module_formLabel__TXcHc {\n display: inline-block;\n margin-bottom: 0.5rem;\n}";
package/index.js CHANGED
@@ -5359,7 +5359,7 @@ var styles$B = {"formInput":"FormInput-module_formInput__VXZip","disabled":"Form
5359
5359
  styleInject(css_248z$B);
5360
5360
 
5361
5361
  const FormInput = (props) => {
5362
- const { value, name, type, placeholder, className, isValid = true, options = [], textareaOptions, selectOptions, autoCompleteOptions, autoFocus, label, disabled = false, readonly = false, onInput, onChange, onBlur, onKeyDown } = props;
5362
+ const { value, name, type, placeholder, className, isValid = true, options = [], textareaOptions, selectOptions, autoCompleteOptions, autoFocus, label, disabled = false, readonly = false, onInput, onChange, onBlur, onKeyDown, } = props;
5363
5363
  const getCssClasses = () => {
5364
5364
  const cssClasses = [];
5365
5365
  cssClasses.push(styles$B.formInput);
@@ -5382,15 +5382,7 @@ const FormInput = (props) => {
5382
5382
  type === 'number' ||
5383
5383
  type === 'password' ||
5384
5384
  type === 'color' ||
5385
- type === 'time')
5386
- &&
5387
- jsxRuntime.jsx("input", { id: name, name: name, type: type, className: getCssClasses(), value: value, autoFocus: autoFocus, onInput: (e) => handleOnInput(e.target.value, type, name), onChange: (e) => handleOnChange((e?.target).value, type, name), onBlur: onBlur, placeholder: placeholder, readOnly: readonly, disabled: disabled, onKeyDown: onKeyDown }), type === 'file' &&
5388
- jsxRuntime.jsx(FileInput, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, autoFocus: autoFocus, readOnly: readonly, disabled: disabled, onChange: (e) => handleOnChange(e.target.value, type, name), children: "choose a file" }), type === 'textarea' &&
5389
- jsxRuntime.jsx(Textarea, { id: name, name: name, className: className, error: !isValid, value: value, autoFocus: autoFocus, onInput: (e) => handleOnInput(e.target.value, type, name), onChange: (e) => handleOnChange(e.target.value, type, name), placeholder: placeholder, rows: textareaOptions?.rows, style: textareaOptions?.resize !== false ? undefined : { resize: 'none' } }), type === 'select' &&
5390
- jsxRuntime.jsx(Select, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, multiple: selectOptions?.multiple, onChange: (e) => handleOnChange(e, type, name), options: options }), type === 'autocomplete' &&
5391
- jsxRuntime.jsx(AutoComplete, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, openOnFocus: autoCompleteOptions?.openOnFocus, onChange: (e) => handleOnChange(e, type, name), onSelect: (e) => handleOnChange(e.value, type, name), options: options }), type === 'checkbox' &&
5392
- jsxRuntime.jsx(Checkbox, { id: name, name: name, label: label, className: (!isValid ? ' is-invalid' : ''), onChange: (e) => handleOnChange((e?.target).checked, type, name), checked: value }), type === 'radio' &&
5393
- jsxRuntime.jsx(jsxRuntime.Fragment, { children: options.map((option) => jsxRuntime.jsxs("div", { className: "form-check", children: [jsxRuntime.jsx("input", { id: option.id ? option.id : option.value, name: name, type: "radio", className: "form-check-input", onChange: (e) => handleOnChange((e?.target).value, type, name), value: option.value, checked: value === option.value, onKeyDown: onKeyDown }), jsxRuntime.jsx("label", { className: "form-check-label", htmlFor: option.id, children: option.label })] }, option.id)) })] }));
5385
+ type === 'time') && (jsxRuntime.jsx("input", { id: name, name: name, type: type, className: getCssClasses(), value: value, autoFocus: autoFocus, onInput: (e) => handleOnInput(e.target.value, type, name), onChange: (e) => handleOnChange((e?.target).value, type, name), onBlur: onBlur, placeholder: placeholder, readOnly: readonly, disabled: disabled, onKeyDown: onKeyDown })), type === 'file' && (jsxRuntime.jsx(FileInput, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, autoFocus: autoFocus, readOnly: readonly, disabled: disabled, onChange: (e) => handleOnChange(e.target.value, type, name), children: "choose a file" })), type === 'textarea' && (jsxRuntime.jsx(Textarea, { id: name, name: name, className: className, error: !isValid, value: value, disabled: disabled, autoFocus: autoFocus, onInput: (e) => handleOnInput(e.target.value, type, name), onChange: (e) => handleOnChange(e.target.value, type, name), placeholder: placeholder, rows: textareaOptions?.rows, style: textareaOptions?.resize !== false ? undefined : { resize: 'none' } })), type === 'select' && (jsxRuntime.jsx(Select, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, disabled: disabled, multiple: selectOptions?.multiple, onChange: (e) => handleOnChange(e, type, name), options: options })), type === 'autocomplete' && (jsxRuntime.jsx(AutoComplete, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, disabled: disabled, openOnFocus: autoCompleteOptions?.openOnFocus, onChange: (e) => handleOnChange(e, type, name), onSelect: (e) => handleOnChange(e.value, type, name), options: options })), type === 'checkbox' && (jsxRuntime.jsx(Checkbox, { id: name, name: name, label: label, disabled: disabled, className: !isValid ? ' is-invalid' : '', onChange: (e) => handleOnChange((e?.target).checked, type, name), checked: value })), type === 'radio' && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: options.map(option => (jsxRuntime.jsxs("div", { className: "form-check", children: [jsxRuntime.jsx("input", { id: option.id ? option.id : option.value, name: name, type: "radio", className: "form-check-input", onChange: (e) => handleOnChange((e?.target).value, type, name), value: option.value, checked: value === option.value, onKeyDown: onKeyDown }), jsxRuntime.jsx("label", { className: "form-check-label", htmlFor: option.id, children: option.label })] }, option.id))) }))] }));
5394
5386
  };
5395
5387
 
5396
5388
  var css_248z$A = ".FormLabel-module_formLabel__TXcHc {\n display: inline-block;\n margin-bottom: 0.5rem;\n}";
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { IFormInputOptions, IFormTextAreaOptions, IFormSelectOptions, IFormAutoCompleteOptions } from '../form.interfaces';
2
+ import type { IFormAutoCompleteOptions, IFormInputOptions, IFormSelectOptions, IFormTextAreaOptions } from '../form.interfaces';
3
3
  import type { IFormControlType } from '../form.types';
4
4
  export interface IFormInputEvent {
5
5
  value: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-asc",
3
- "version": "25.8.1",
3
+ "version": "25.8.2",
4
4
  "description": "handcrafted react components",
5
5
  "main": "index.js",
6
6
  "module": "index.es.js",