@loja-integrada/admin-components 1.3.6 → 1.3.8

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,11 @@
1
+ import { a as a$3 } from './chunk-VELH5CA2.js';
2
+ import { a as a$1 } from './chunk-NW24WOHT.js';
3
+ import { a } from './chunk-7Z3CCBLX.js';
4
+ import { a as a$4 } from './chunk-G3GCVCTU.js';
5
+ import { a as a$2 } from './chunk-REQIQLRI.js';
6
+ import { forwardRef, useState } from 'react';
7
+ import { jsxs, jsx } from 'react/jsx-runtime';
8
+
9
+ var S=[{label:"mm",value:"mm"},{label:"cm",value:"cm"},{label:"m",value:"m"}],W=forwardRef(({units:r=S,maxSize:b=6,className:g="",inputClassName:v="",dropdownClassName:c="",helpText:w="",disabled:o=!1,errorMessage:t="",hasError:l=!1,required:s=!1,label:C,inputPlaceholder:I,defaultUnit:N,fixedUnit:n,onChangeValue:x,onChangeUnit:p},U)=>{let[E,T]=useState(N||r[0]);return jsxs("div",{className:`flex flex-col ${g}`,id:"input-with-unit__container",children:[jsx(a,{label:C,required:s,hasError:l||!!t,htmlFor:"input-with-unit",className:"mb-1"}),jsxs("div",{className:"flex w-full items-start gap-x-1",children:[jsx(a$1,{id:"input-with-unit",ref:U,maxLength:b,formatValue:"onlyNumber",disabled:o,hasError:l||!!t,required:s,onChange:x,placeholder:I,formGroupClassName:a$2("w-full",v)}),jsx(a$3,{id:"input-with-unit-dropdown",formGroupClassName:a$2("w-40",c),placeholder:"mm",options:r,value:n??E,onChange:i=>{n||(T({label:i.label,value:String(i.value)}),p&&p(i));},disabled:!!n||o,hasError:l||!!t})]}),jsx(a$4,{helpText:t||w,hasError:!!t})]})});W.displayName="InputWithUnit";
10
+
11
+ export { S as a, W as b };
@@ -64,6 +64,13 @@ type InputWithUnitProps = {
64
64
  * Placeholder for the input field.
65
65
  * */
66
66
  inputPlaceholder?: string;
67
+ /**
68
+ * Sets a fixed (immutable) unit.
69
+ * */
70
+ defaultUnit?: {
71
+ label: string;
72
+ value: string;
73
+ };
67
74
  /**
68
75
  * Sets a fixed (immutable) unit.
69
76
  * */
@@ -1,4 +1,4 @@
1
- "use client";export { a as DEFAULT_UNITS, b as InputWithUnit } from '../../chunk-76DAQXKH.js';
1
+ "use client";export { a as DEFAULT_UNITS, b as InputWithUnit } from '../../chunk-FA4P3LAM.js';
2
2
  import '../../chunk-VELH5CA2.js';
3
3
  import '../../chunk-NW24WOHT.js';
4
4
  import '../../chunk-SJ4MATMO.js';
@@ -9,7 +9,7 @@ import '../chunk-6W6QWPEA.js';
9
9
  import '../chunk-4QFFUXWM.js';
10
10
  import '../chunk-3BKW5XAK.js';
11
11
  import '../chunk-L6H2NDVS.js';
12
- export { a as DEFAULT_UNITS, b as InputWithUnit } from '../chunk-76DAQXKH.js';
12
+ export { a as DEFAULT_UNITS, b as InputWithUnit } from '../chunk-FA4P3LAM.js';
13
13
  export { a as Dropdown } from '../chunk-VELH5CA2.js';
14
14
  export { a as InputMask } from '../chunk-NW24WOHT.js';
15
15
  export { a as Input } from '../chunk-SJ4MATMO.js';
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ export { a as ActionBar } from './chunk-6W6QWPEA.js';
17
17
  export { b as Box, d as BoxContent, c as BoxHeader, a as BoxSeparator } from './chunk-4QFFUXWM.js';
18
18
  export { a as Container, b as ContainerHeader } from './chunk-3BKW5XAK.js';
19
19
  import './chunk-L6H2NDVS.js';
20
- export { a as DEFAULT_UNITS, b as InputWithUnit } from './chunk-76DAQXKH.js';
20
+ export { a as DEFAULT_UNITS, b as InputWithUnit } from './chunk-FA4P3LAM.js';
21
21
  export { a as Dropdown } from './chunk-VELH5CA2.js';
22
22
  export { a as InputMask } from './chunk-NW24WOHT.js';
23
23
  export { a as Input } from './chunk-SJ4MATMO.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loja-integrada/admin-components",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "author": "Loja Integrada",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,11 +0,0 @@
1
- import { a as a$3 } from './chunk-VELH5CA2.js';
2
- import { a as a$1 } from './chunk-NW24WOHT.js';
3
- import { a } from './chunk-7Z3CCBLX.js';
4
- import { a as a$4 } from './chunk-G3GCVCTU.js';
5
- import { a as a$2 } from './chunk-REQIQLRI.js';
6
- import { forwardRef, useState } from 'react';
7
- import { jsxs, jsx } from 'react/jsx-runtime';
8
-
9
- var L=[{label:"mm",value:"mm"},{label:"cm",value:"cm"},{label:"m",value:"m"}],S=forwardRef(({units:o=L,maxSize:b=6,className:c="",inputClassName:v="",dropdownClassName:g="",helpText:w="",disabled:r=!1,errorMessage:t="",hasError:l=!1,required:s=!1,label:C,inputPlaceholder:I,fixedUnit:n,onChangeValue:N,onChangeUnit:p},x)=>{let[E,U]=useState(o[0]);return jsxs("div",{className:`flex flex-col ${c}`,id:"input-with-unit__container",children:[jsx(a,{label:C,required:s,hasError:l||!!t,htmlFor:"input-with-unit",className:"mb-1"}),jsxs("div",{className:"flex w-full items-start gap-x-1",children:[jsx(a$1,{id:"input-with-unit",ref:x,maxLength:b,formatValue:"onlyNumber",disabled:r,hasError:l||!!t,required:s,onChange:N,placeholder:I,formGroupClassName:a$2("w-full",v)}),jsx(a$3,{id:"input-with-unit-dropdown",formGroupClassName:a$2("w-40",g),placeholder:"mm",options:o,value:n??E,onChange:i=>{n||(U({label:i.label,value:String(i.value)}),p&&p(i));},disabled:!!n||r,hasError:l||!!t})]}),jsx(a$4,{helpText:t||w,hasError:!!t})]})});S.displayName="InputWithUnit";
10
-
11
- export { L as a, S as b };