@mirai/ui 2.1.96 → 2.1.98
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/README.md +30 -1
- package/build/components/InputList/__tests__/__snapshots__/InputList.test.js.snap +48 -16
- package/build/components/InputList/helpers/getCaption.js +1 -1
- package/build/components/InputList/helpers/getCaption.js.map +1 -1
- package/build/components/InputNumber/InputNumber.js +4 -2
- package/build/components/InputNumber/InputNumber.js.map +1 -1
- package/build/components/InputOption/InputOption.js +4 -2
- package/build/components/InputOption/InputOption.js.map +1 -1
- package/build/components/InputPhone/InputPhone.js +4 -2
- package/build/components/InputPhone/InputPhone.js.map +1 -1
- package/build/components/InputSelect/InputSelect.js +8 -3
- package/build/components/InputSelect/InputSelect.js.map +1 -1
- package/build/components/InputSelect/__tests__/__snapshots__/InputSelect.test.js.snap +76 -0
- package/build/components/InputText/InputText.js +4 -2
- package/build/components/InputText/InputText.js.map +1 -1
- package/build/components/InputText/partials/InputText.Label.js +1 -1
- package/build/components/InputText/partials/InputText.Label.js.map +1 -1
- package/build/components/Table/Table.js +16 -8
- package/build/components/Table/Table.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -659,6 +659,7 @@ Input date component that receives the following props:
|
|
|
659
659
|
- `max:string` maximum date value allowed
|
|
660
660
|
- `min:string` minimum date value allowed
|
|
661
661
|
- `placeholder:bool` indicated whether to show placeholder with format or not
|
|
662
|
+
- `requiredText:string` custom text shown next to the label when `required` and `showRequired` are true
|
|
662
663
|
- `value:string` current value
|
|
663
664
|
- `onChange:function` executed when the value is changed
|
|
664
665
|
- `onError:function` executed when there's an error
|
|
@@ -702,6 +703,7 @@ A custom select input component that receives the following props:
|
|
|
702
703
|
- `label:string` label text
|
|
703
704
|
- `maxVisibleOptions:number` maximum number of visible options before the menu becomes scrollable. Default value is `5`
|
|
704
705
|
- `name:string` - required prop, input name
|
|
706
|
+
- `requiredText:string` custom text shown next to the label when `required` and `showRequired` are true
|
|
705
707
|
- `showRequired:boolean` indicating whether the "required" indicator should be shown
|
|
706
708
|
- `showState:boolean` indicating whether to show the state icons for errors, success, and warning
|
|
707
709
|
- `success:boolean` indicating whether the input has a success state
|
|
@@ -756,6 +758,7 @@ Input number component controlling the value with 2 buttons. Receives the follow
|
|
|
756
758
|
- `max:number` maximum input value
|
|
757
759
|
- `min:number` minimum input value
|
|
758
760
|
- `name:string` input name attribute (required)
|
|
761
|
+
- `requiredText:string` custom text shown next to the label when `required` and `showRequired` are true
|
|
759
762
|
- `rounded:bool` if you want use the `rounded` property of `<Button>`
|
|
760
763
|
- `showRequired:bool` displays `*` next to the label
|
|
761
764
|
- `step:number` to be added/subtracted from value on each button click
|
|
@@ -768,7 +771,18 @@ import { InputNumber } from '@mirai/ui';
|
|
|
768
771
|
const MyComponent = (props) => {
|
|
769
772
|
const [number, setNumber] = useState(1);
|
|
770
773
|
|
|
771
|
-
return
|
|
774
|
+
return (
|
|
775
|
+
<InputNumber
|
|
776
|
+
min={1}
|
|
777
|
+
name="candies"
|
|
778
|
+
label="Candies"
|
|
779
|
+
required
|
|
780
|
+
requiredText="Required"
|
|
781
|
+
showRequired
|
|
782
|
+
value={number}
|
|
783
|
+
onChange={(next) => setNumber(next)}
|
|
784
|
+
/>
|
|
785
|
+
);
|
|
772
786
|
};
|
|
773
787
|
```
|
|
774
788
|
|
|
@@ -788,6 +802,7 @@ This component is used to display a radio button or checkbox base on a mandatory
|
|
|
788
802
|
- `indeterminate:boolean` applying 'indeterminate' attribute (only for type checkbox)
|
|
789
803
|
- `label:string` input label
|
|
790
804
|
- `name:string` input name
|
|
805
|
+
- `requiredText:string` custom text shown next to the label when `required` and `showRequired` are true
|
|
791
806
|
- `showRequired:bool` displays `*` next to the label
|
|
792
807
|
- `small:bool` modifying font-size
|
|
793
808
|
- `type:string` type of input (radio or checkbox)
|
|
@@ -854,6 +869,7 @@ Input element for phone numbers that receives the following props:
|
|
|
854
869
|
- `labelPrefix:string` label text for the country code part
|
|
855
870
|
- `name:string` - required prop, input name
|
|
856
871
|
- `prefixes:string[]` available country codes
|
|
872
|
+
- `requiredText:string` custom text shown next to the label when `required` and `showRequired` are true
|
|
857
873
|
- `showRequired:boolean` indicating whether the "required" indicator should be shown
|
|
858
874
|
- `showState:boolean` indicating whether to show the state icons for errors, success, and warning
|
|
859
875
|
- `success:boolean` indicating whether the input has a success state
|
|
@@ -884,6 +900,8 @@ export const Story = (props) => {
|
|
|
884
900
|
name="name"
|
|
885
901
|
prefixes={['+34', '+44', '+001', '+999', '+39', '+56']}
|
|
886
902
|
required
|
|
903
|
+
requiredText="Required"
|
|
904
|
+
showRequired
|
|
887
905
|
value={value}
|
|
888
906
|
onChange={handleChange}
|
|
889
907
|
onError={handleError}
|
|
@@ -897,12 +915,14 @@ export const Story = (props) => {
|
|
|
897
915
|
A select input component that receives the following props:
|
|
898
916
|
|
|
899
917
|
- `caption:string` a support text (Ex. currency symbol)
|
|
918
|
+
- `capitalize:boolean` capitalize the first word of the label
|
|
900
919
|
- `disabled:boolean` applying 'disabled' attribute
|
|
901
920
|
- `error:boolean` indicating whether there is an error in the input
|
|
902
921
|
- `hint:string` text with additional info to be displayed below the input
|
|
903
922
|
- `icon:string` if you want use an `<Icon>` within the component
|
|
904
923
|
- `label:string` label text
|
|
905
924
|
- `name:string` - required prop, input name
|
|
925
|
+
- `requiredText:string` custom text shown next to the label when `required` and `showRequired` are true
|
|
906
926
|
- `showRequired:boolean` indicating whether the "required" indicator should be shown
|
|
907
927
|
- `showState:boolean` indicating whether to show the state icons for errors, success, and warning
|
|
908
928
|
- `success:boolean` indicating whether the input has a success state
|
|
@@ -931,6 +951,9 @@ const Example = (props) => {
|
|
|
931
951
|
label="label"
|
|
932
952
|
name="name"
|
|
933
953
|
options={['one', 'two', 'three', 'four', 'five']}
|
|
954
|
+
required
|
|
955
|
+
requiredText="Required"
|
|
956
|
+
showRequired
|
|
934
957
|
value={value}
|
|
935
958
|
onChange={handleChange}
|
|
936
959
|
onEnter={handleEnter}
|
|
@@ -953,6 +976,7 @@ Text input component receiving the following props:
|
|
|
953
976
|
- `markdown:boolean` if true shows a preview of your markdown text
|
|
954
977
|
- `multiline:boolean` if true returning textarea
|
|
955
978
|
- `name:string` input name (required)
|
|
979
|
+
- `requiredText:string` custom text shown next to the label when `required` and `showRequired` are true
|
|
956
980
|
- `showRequired:bool` displays `*` next to the label
|
|
957
981
|
- `showState:bool` displays state of input (error, warning or success)
|
|
958
982
|
- `success:bool` sets success state
|
|
@@ -974,6 +998,9 @@ const MyComponent = (props) => {
|
|
|
974
998
|
hint="hint"
|
|
975
999
|
label="My epic input"
|
|
976
1000
|
placeholder="Some epic text"
|
|
1001
|
+
required
|
|
1002
|
+
requiredText="Required"
|
|
1003
|
+
showRequired
|
|
977
1004
|
type="text"
|
|
978
1005
|
value={text}
|
|
979
1006
|
onChange={(next) => setText(next)}
|
|
@@ -1215,6 +1242,7 @@ This component helps you to create a pure html table receiving the following pro
|
|
|
1215
1242
|
- `showEmpty:bool` when true, shows an empty-state row if there are no filtered results
|
|
1216
1243
|
- `sort:bool` specifies whether the table can be sorted or not
|
|
1217
1244
|
- `store:string` if you want use storage feature for some features of your table (ex. keep the current filters).
|
|
1245
|
+
- `onChangeFilteredRows:function` executed when filtered rows change. It receives all rows matching the current filters, search and sort, excluding pagination.
|
|
1218
1246
|
- `onPress:function` executed once press in any row
|
|
1219
1247
|
- `onScroll:function` executed once scroll the table
|
|
1220
1248
|
- `onSelect:function` executed once select a determinate row
|
|
@@ -1257,6 +1285,7 @@ const MyComponent = () => {
|
|
|
1257
1285
|
<Table
|
|
1258
1286
|
{...{ dataSource, schema, search }}
|
|
1259
1287
|
selected={[dataSource[4]]}
|
|
1288
|
+
onChangeFilteredRows={(rows) => console.log('::onChangeFilteredRows::', rows)}
|
|
1260
1289
|
onPress={(row) => console.log('::onPress::', row)}
|
|
1261
1290
|
onSelect={(row) => console.log('::onSelect::', row)}
|
|
1262
1291
|
onScroll={(event) => console.log('::onScroll::', event)}
|
|
@@ -93,7 +93,9 @@ exports[`component:<InputList> groups:renders with groups 1`] = `
|
|
|
93
93
|
class="select empty input"
|
|
94
94
|
name="name"
|
|
95
95
|
>
|
|
96
|
-
<option
|
|
96
|
+
<option
|
|
97
|
+
value=""
|
|
98
|
+
/>
|
|
97
99
|
</select>
|
|
98
100
|
</ui-view>
|
|
99
101
|
<ui-icon
|
|
@@ -154,7 +156,9 @@ exports[`component:<InputList> groups:search within groups 1`] = `
|
|
|
154
156
|
class="select empty input"
|
|
155
157
|
name="name"
|
|
156
158
|
>
|
|
157
|
-
<option
|
|
159
|
+
<option
|
|
160
|
+
value=""
|
|
161
|
+
/>
|
|
158
162
|
</select>
|
|
159
163
|
</ui-view>
|
|
160
164
|
<ui-icon
|
|
@@ -387,7 +391,9 @@ exports[`component:<InputList> inherit:className 1`] = `
|
|
|
387
391
|
class="select empty input"
|
|
388
392
|
name="name"
|
|
389
393
|
>
|
|
390
|
-
<option
|
|
394
|
+
<option
|
|
395
|
+
value=""
|
|
396
|
+
/>
|
|
391
397
|
</select>
|
|
392
398
|
</ui-view>
|
|
393
399
|
<ui-icon
|
|
@@ -453,7 +459,9 @@ exports[`component:<InputList> prop:caption 1`] = `
|
|
|
453
459
|
class="select empty input"
|
|
454
460
|
name="name"
|
|
455
461
|
>
|
|
456
|
-
<option
|
|
462
|
+
<option
|
|
463
|
+
value=""
|
|
464
|
+
/>
|
|
457
465
|
</select>
|
|
458
466
|
</ui-view>
|
|
459
467
|
<ui-icon
|
|
@@ -513,7 +521,9 @@ exports[`component:<InputList> prop:disabled 1`] = `
|
|
|
513
521
|
disabled=""
|
|
514
522
|
name="name"
|
|
515
523
|
>
|
|
516
|
-
<option
|
|
524
|
+
<option
|
|
525
|
+
value=""
|
|
526
|
+
/>
|
|
517
527
|
</select>
|
|
518
528
|
</ui-view>
|
|
519
529
|
</ui-view>
|
|
@@ -552,7 +562,9 @@ exports[`component:<InputList> prop:error 1`] = `
|
|
|
552
562
|
class="select empty input"
|
|
553
563
|
name="name"
|
|
554
564
|
>
|
|
555
|
-
<option
|
|
565
|
+
<option
|
|
566
|
+
value=""
|
|
567
|
+
/>
|
|
556
568
|
</select>
|
|
557
569
|
</ui-view>
|
|
558
570
|
<ui-icon
|
|
@@ -613,7 +625,9 @@ exports[`component:<InputList> prop:hint 1`] = `
|
|
|
613
625
|
class="select empty input"
|
|
614
626
|
name="name"
|
|
615
627
|
>
|
|
616
|
-
<option
|
|
628
|
+
<option
|
|
629
|
+
value=""
|
|
630
|
+
/>
|
|
617
631
|
</select>
|
|
618
632
|
</ui-view>
|
|
619
633
|
<ui-icon
|
|
@@ -700,7 +714,9 @@ exports[`component:<InputList> prop:icon 1`] = `
|
|
|
700
714
|
class="select empty input"
|
|
701
715
|
name="name"
|
|
702
716
|
>
|
|
703
|
-
<option
|
|
717
|
+
<option
|
|
718
|
+
value=""
|
|
719
|
+
/>
|
|
704
720
|
</select>
|
|
705
721
|
</ui-view>
|
|
706
722
|
<ui-icon
|
|
@@ -768,7 +784,9 @@ exports[`component:<InputList> prop:label 1`] = `
|
|
|
768
784
|
id="name"
|
|
769
785
|
name="name"
|
|
770
786
|
>
|
|
771
|
-
<option
|
|
787
|
+
<option
|
|
788
|
+
value=""
|
|
789
|
+
/>
|
|
772
790
|
</select>
|
|
773
791
|
</ui-view>
|
|
774
792
|
<ui-icon
|
|
@@ -842,7 +860,9 @@ exports[`component:<InputList> prop:required & prop:showRequired (true) 1`] = `
|
|
|
842
860
|
name="name"
|
|
843
861
|
required=""
|
|
844
862
|
>
|
|
845
|
-
<option
|
|
863
|
+
<option
|
|
864
|
+
value=""
|
|
865
|
+
/>
|
|
846
866
|
</select>
|
|
847
867
|
</ui-view>
|
|
848
868
|
<ui-icon
|
|
@@ -911,7 +931,9 @@ exports[`component:<InputList> prop:required 1`] = `
|
|
|
911
931
|
name="name"
|
|
912
932
|
required=""
|
|
913
933
|
>
|
|
914
|
-
<option
|
|
934
|
+
<option
|
|
935
|
+
value=""
|
|
936
|
+
/>
|
|
915
937
|
</select>
|
|
916
938
|
</ui-view>
|
|
917
939
|
<ui-icon
|
|
@@ -972,7 +994,9 @@ exports[`component:<InputList> prop:success 1`] = `
|
|
|
972
994
|
class="select empty input"
|
|
973
995
|
name="name"
|
|
974
996
|
>
|
|
975
|
-
<option
|
|
997
|
+
<option
|
|
998
|
+
value=""
|
|
999
|
+
/>
|
|
976
1000
|
</select>
|
|
977
1001
|
</ui-view>
|
|
978
1002
|
<ui-icon
|
|
@@ -1054,7 +1078,9 @@ exports[`component:<InputList> prop:value 1`] = `
|
|
|
1054
1078
|
class="select empty input"
|
|
1055
1079
|
name="name"
|
|
1056
1080
|
>
|
|
1057
|
-
<option
|
|
1081
|
+
<option
|
|
1082
|
+
value=""
|
|
1083
|
+
/>
|
|
1058
1084
|
</select>
|
|
1059
1085
|
</ui-view>
|
|
1060
1086
|
<ui-icon
|
|
@@ -1115,7 +1141,9 @@ exports[`component:<InputList> prop:warning 1`] = `
|
|
|
1115
1141
|
class="select empty input"
|
|
1116
1142
|
name="name"
|
|
1117
1143
|
>
|
|
1118
|
-
<option
|
|
1144
|
+
<option
|
|
1145
|
+
value=""
|
|
1146
|
+
/>
|
|
1119
1147
|
</select>
|
|
1120
1148
|
</ui-view>
|
|
1121
1149
|
<ui-icon
|
|
@@ -1193,7 +1221,9 @@ exports[`component:<InputList> renders 1`] = `
|
|
|
1193
1221
|
class="select empty input"
|
|
1194
1222
|
name="name"
|
|
1195
1223
|
>
|
|
1196
|
-
<option
|
|
1224
|
+
<option
|
|
1225
|
+
value=""
|
|
1226
|
+
/>
|
|
1197
1227
|
</select>
|
|
1198
1228
|
</ui-view>
|
|
1199
1229
|
<ui-icon
|
|
@@ -1255,7 +1285,9 @@ exports[`component:<InputList> testId 1`] = `
|
|
|
1255
1285
|
class="select empty input"
|
|
1256
1286
|
name="name"
|
|
1257
1287
|
>
|
|
1258
|
-
<option
|
|
1288
|
+
<option
|
|
1289
|
+
value=""
|
|
1290
|
+
/>
|
|
1259
1291
|
</select>
|
|
1260
1292
|
</ui-view>
|
|
1261
1293
|
<ui-icon
|
|
@@ -10,7 +10,7 @@ var getCaption = function getCaption(_ref) {
|
|
|
10
10
|
multiple = _ref.multiple,
|
|
11
11
|
labelSelected = _ref.labelSelected,
|
|
12
12
|
selected = _ref.selected;
|
|
13
|
-
return (multiple ? (selected === null || selected === void 0 ? void 0 : selected.length) > 1 ? "".concat(selected.length, " ").concat(labelSelected) : (_selected$ = selected[0]) === null || _selected$ === void 0 ? void 0 : _selected$.name : selected === null || selected === void 0 ? void 0 : selected.name) || emptyOption;
|
|
13
|
+
return (multiple ? (selected === null || selected === void 0 ? void 0 : selected.length) > 1 ? "".concat(selected.length, " ").concat(labelSelected) : (_selected$ = selected[0]) === null || _selected$ === void 0 ? void 0 : _selected$.name : selected === null || selected === void 0 ? void 0 : selected.name) || emptyOption || '';
|
|
14
14
|
};
|
|
15
15
|
exports.getCaption = getCaption;
|
|
16
16
|
//# sourceMappingURL=getCaption.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCaption.js","names":["getCaption","_ref","_selected$","emptyOption","multiple","labelSelected","selected","length","concat","name","exports"],"sources":["../../../../src/components/InputList/helpers/getCaption.js"],"sourcesContent":["export const getCaption = ({ emptyOption, multiple, labelSelected, selected }) =>\n (multiple ? (selected?.length > 1 ? `${selected.length} ${labelSelected}` : selected[0]?.name) : selected?.name) ||\n emptyOption;\n"],"mappings":";;;;;;AAAO,IAAMA,UAAU,GAAG,SAAbA,UAAUA,CAAAC,IAAA;EAAA,IAAAC,UAAA;EAAA,IAAMC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAEC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IAAEC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;EAAA,OACzE,CAACF,QAAQ,GAAI,CAAAE,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEC,MAAM,IAAG,CAAC,MAAAC,MAAA,CAAMF,QAAQ,CAACC,MAAM,OAAAC,MAAA,CAAIH,aAAa,KAAAH,UAAA,GAAKI,QAAQ,CAAC,CAAC,CAAC,cAAAJ,UAAA,uBAAXA,UAAA,CAAaO,IAAI,GAAIH,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEG,IAAI,KAC/GN,WAAW;AAAA;AAACO,OAAA,CAAAV,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"getCaption.js","names":["getCaption","_ref","_selected$","emptyOption","multiple","labelSelected","selected","length","concat","name","exports"],"sources":["../../../../src/components/InputList/helpers/getCaption.js"],"sourcesContent":["export const getCaption = ({ emptyOption, multiple, labelSelected, selected }) =>\n (multiple ? (selected?.length > 1 ? `${selected.length} ${labelSelected}` : selected[0]?.name) : selected?.name) ||\n emptyOption ||\n '';\n"],"mappings":";;;;;;AAAO,IAAMA,UAAU,GAAG,SAAbA,UAAUA,CAAAC,IAAA;EAAA,IAAAC,UAAA;EAAA,IAAMC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAEC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IAAEC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;EAAA,OACzE,CAACF,QAAQ,GAAI,CAAAE,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEC,MAAM,IAAG,CAAC,MAAAC,MAAA,CAAMF,QAAQ,CAACC,MAAM,OAAAC,MAAA,CAAIH,aAAa,KAAAH,UAAA,GAAKI,QAAQ,CAAC,CAAC,CAAC,cAAAJ,UAAA,uBAAXA,UAAA,CAAaO,IAAI,GAAIH,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEG,IAAI,KAC/GN,WAAW,IACX,EAAE;AAAA;AAACO,OAAA,CAAAV,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ var _primitives = require("../../primitives");
|
|
|
11
11
|
var _Button = require("../Button");
|
|
12
12
|
var _partials = require("../InputText/partials");
|
|
13
13
|
var _InputNumberModule = _interopRequireDefault(require("./InputNumber.module.css"));
|
|
14
|
-
var _excluded = ["disabled", "hint", "label", "max", "min", "name", "required", "rounded", "showRequired", "step", "success", "value", "onChange", "aria"];
|
|
14
|
+
var _excluded = ["disabled", "hint", "label", "max", "min", "name", "required", "requiredText", "rounded", "showRequired", "step", "success", "value", "onChange", "aria"];
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
16
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
17
17
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) { o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
@@ -25,6 +25,7 @@ var InputNumber = function InputNumber(_ref) {
|
|
|
25
25
|
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
26
26
|
name = _ref.name,
|
|
27
27
|
required = _ref.required,
|
|
28
|
+
requiredText = _ref.requiredText,
|
|
28
29
|
_ref$rounded = _ref.rounded,
|
|
29
30
|
rounded = _ref$rounded === void 0 ? true : _ref$rounded,
|
|
30
31
|
_ref$showRequired = _ref.showRequired,
|
|
@@ -53,7 +54,7 @@ var InputNumber = function InputNumber(_ref) {
|
|
|
53
54
|
disabled: disabled,
|
|
54
55
|
label: label,
|
|
55
56
|
required: showRequired && required,
|
|
56
|
-
requiredText:
|
|
57
|
+
requiredText: requiredText,
|
|
57
58
|
success: success,
|
|
58
59
|
value: value,
|
|
59
60
|
className: _InputNumberModule["default"].label
|
|
@@ -101,6 +102,7 @@ InputNumber.propTypes = {
|
|
|
101
102
|
min: _propTypes["default"].number,
|
|
102
103
|
name: _propTypes["default"].string.isRequired,
|
|
103
104
|
required: _propTypes["default"].bool,
|
|
105
|
+
requiredText: _propTypes["default"].string,
|
|
104
106
|
rounded: _propTypes["default"].bool,
|
|
105
107
|
showRequired: _propTypes["default"].bool,
|
|
106
108
|
step: _propTypes["default"].number,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputNumber.js","names":["_propTypes","_interopRequireDefault","require","_react","_helpers","_primitives","_Button","_partials","_InputNumberModule","_excluded","e","__esModule","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","_objectWithoutProperties","o","i","_objectWithoutPropertiesLoose","getOwnPropertySymbols","s","includes","propertyIsEnumerable","InputNumber","_ref","disabled","hint","label","max","_ref$min","min","name","required","_ref$rounded","rounded","_ref$showRequired","showRequired","_ref$step","step","success","_ref$value","value","_ref$onChange","onChange","_ref$aria","aria","_ref$aria$buttonAdd","buttonAdd","ariaAdd","_ref$aria$buttonRemov","buttonRemove","ariaRemove","others","createElement","View","tag","row","className","styles","style","inputNumber","texts","Label","
|
|
1
|
+
{"version":3,"file":"InputNumber.js","names":["_propTypes","_interopRequireDefault","require","_react","_helpers","_primitives","_Button","_partials","_InputNumberModule","_excluded","e","__esModule","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","_objectWithoutProperties","o","i","_objectWithoutPropertiesLoose","getOwnPropertySymbols","s","includes","propertyIsEnumerable","InputNumber","_ref","disabled","hint","label","max","_ref$min","min","name","required","requiredText","_ref$rounded","rounded","_ref$showRequired","showRequired","_ref$step","step","success","_ref$value","value","_ref$onChange","onChange","_ref$aria","aria","_ref$aria$buttonAdd","buttonAdd","ariaAdd","_ref$aria$buttonRemov","buttonRemove","ariaRemove","others","createElement","View","tag","row","className","styles","style","inputNumber","texts","Label","Hint","Button","secondary","small","squared","onPress","testId","concat","Icon","ICON","REMOVE","Text","ADD","exports","displayName","propTypes","PropTypes","bool","oneOfType","string","array","number","isRequired","func","shape"],"sources":["../../../src/components/InputNumber/InputNumber.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Icon, ICON, Text, View } from '../../primitives';\nimport { Button } from '../Button';\nimport { Hint, Label } from '../InputText/partials';\nimport style from './InputNumber.module.css';\n\nconst InputNumber = ({\n disabled,\n hint,\n label,\n max,\n min = 0,\n name,\n required,\n requiredText,\n rounded = true,\n showRequired = false,\n step = 1,\n success,\n value = 0,\n onChange = () => {},\n aria: { buttonAdd: ariaAdd = 'Add', buttonRemove: ariaRemove = 'Remove' } = {},\n ...others\n}) => (\n <View {...others} tag=\"input-number\" row className={styles(style.inputNumber, others.className)}>\n <View className={style.texts}>\n {label && (\n <Label\n {...{\n disabled,\n label,\n required: showRequired && required,\n requiredText,\n success,\n value,\n }}\n className={style.label}\n />\n )}\n {hint && <Hint {...{ disabled, hint }} className={style.hint} />}\n </View>\n <Button\n disabled={disabled || value <= min}\n rounded={rounded}\n secondary\n small\n squared\n onPress={() => onChange(value - step, name)}\n aria-label={ariaRemove}\n testId={`${others.testId ? `${others.testId}-` : ''}button-min`}\n >\n <Icon value={ICON.REMOVE} />\n </Button>\n <Text className={styles(style.value, disabled && style.disabled)}>{typeof value === 'number' ? value : min}</Text>\n <Button\n disabled={disabled || value >= max}\n rounded={rounded}\n secondary\n small\n squared\n onPress={() => onChange(value + step, name)}\n aria-label={ariaAdd}\n testId={`${others.testId ? `${others.testId}-` : ''}button-max`}\n >\n <Icon value={ICON.ADD} />\n </Button>\n </View>\n);\n\nInputNumber.displayName = 'Component:InputNumber';\n\nInputNumber.propTypes = {\n disabled: PropTypes.bool,\n hint: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),\n label: PropTypes.string,\n max: PropTypes.number,\n min: PropTypes.number,\n name: PropTypes.string.isRequired,\n required: PropTypes.bool,\n requiredText: PropTypes.string,\n rounded: PropTypes.bool,\n showRequired: PropTypes.bool,\n step: PropTypes.number,\n success: PropTypes.bool,\n value: PropTypes.number,\n onChange: PropTypes.func,\n aria: PropTypes.shape({\n buttonAdd: PropTypes.string,\n buttonRemove: PropTypes.string,\n }),\n};\n\nexport { InputNumber };\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAP,sBAAA,CAAAC,OAAA;AAA6C,IAAAO,SAAA;AAAA,SAAAR,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAN,CAAA,MAAAA,CAAA,GAAAO,SAAA,CAAAC,MAAA,EAAAR,CAAA,UAAAS,CAAA,GAAAF,SAAA,CAAAP,CAAA,YAAAU,CAAA,IAAAD,CAAA,SAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,eAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;AAAA,SAAAO,yBAAAd,CAAA,EAAAS,CAAA,gBAAAT,CAAA,iBAAAe,CAAA,EAAAL,CAAA,EAAAM,CAAA,GAAAC,6BAAA,CAAAjB,CAAA,EAAAS,CAAA,OAAAN,MAAA,CAAAe,qBAAA,QAAAC,CAAA,GAAAhB,MAAA,CAAAe,qBAAA,CAAAlB,CAA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7 @@ var _primitives = require("../../primitives");
|
|
|
12
12
|
var _partials = require("../InputText/partials");
|
|
13
13
|
var _InputOption = require("./InputOption.constants");
|
|
14
14
|
var _InputOptionModule = _interopRequireDefault(require("./InputOption.module.css"));
|
|
15
|
-
var _excluded = ["checked", "disabled", "error", "indeterminate", "label", "name", "required", "showRequired", "small", "type", "value", "onChange"];
|
|
15
|
+
var _excluded = ["checked", "disabled", "error", "indeterminate", "label", "name", "required", "requiredText", "showRequired", "small", "type", "value", "onChange"];
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
17
17
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
18
18
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) { o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
@@ -25,6 +25,7 @@ var InputOption = function InputOption(_ref) {
|
|
|
25
25
|
label = _ref.label,
|
|
26
26
|
name = _ref.name,
|
|
27
27
|
required = _ref.required,
|
|
28
|
+
requiredText = _ref.requiredText,
|
|
28
29
|
_ref$showRequired = _ref.showRequired,
|
|
29
30
|
showRequired = _ref$showRequired === void 0 ? false : _ref$showRequired,
|
|
30
31
|
small = _ref.small,
|
|
@@ -72,7 +73,7 @@ var InputOption = function InputOption(_ref) {
|
|
|
72
73
|
id: labelId,
|
|
73
74
|
label: label,
|
|
74
75
|
required: showRequired && required && !checked,
|
|
75
|
-
requiredText:
|
|
76
|
+
requiredText: requiredText,
|
|
76
77
|
success: checked,
|
|
77
78
|
value: (value === null || value === void 0 ? void 0 : value.length) > 0,
|
|
78
79
|
className: _InputOptionModule["default"].label
|
|
@@ -88,6 +89,7 @@ InputOption.propTypes = {
|
|
|
88
89
|
label: _propTypes["default"].string,
|
|
89
90
|
name: _propTypes["default"].string.isRequired,
|
|
90
91
|
required: _propTypes["default"].bool,
|
|
92
|
+
requiredText: _propTypes["default"].string,
|
|
91
93
|
showRequired: _propTypes["default"].bool,
|
|
92
94
|
small: _propTypes["default"].bool,
|
|
93
95
|
type: _propTypes["default"].oneOf([_InputOption.CHECKBOX, _InputOption.RADIO, _InputOption.SWITCH]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputOption.js","names":["_propTypes","_interopRequireDefault","require","_react","_helpers","_hooks","_primitives","_partials","_InputOption","_InputOptionModule","_excluded","e","__esModule","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","_objectWithoutProperties","o","i","_objectWithoutPropertiesLoose","getOwnPropertySymbols","s","includes","propertyIsEnumerable","InputOption","_ref","checked","disabled","error","indeterminate","label","name","required","_ref$showRequired","showRequired","small","_ref$type","type","CHECKBOX","_ref$value","value","_ref$onChange","onChange","others","_useDevice","useDevice","isMobile","Primitive","Checkbox","RADIO","Radio","Switch","handleChange","event","SWITCH","id","labelId","concat","undefined","createElement","Pressable","tag","preventDefault","onPress","className","styles","style","inputOption","Icon","paragraph","ICON","CHECK","REMOVE","icon","Label","action","focus","
|
|
1
|
+
{"version":3,"file":"InputOption.js","names":["_propTypes","_interopRequireDefault","require","_react","_helpers","_hooks","_primitives","_partials","_InputOption","_InputOptionModule","_excluded","e","__esModule","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","_objectWithoutProperties","o","i","_objectWithoutPropertiesLoose","getOwnPropertySymbols","s","includes","propertyIsEnumerable","InputOption","_ref","checked","disabled","error","indeterminate","label","name","required","requiredText","_ref$showRequired","showRequired","small","_ref$type","type","CHECKBOX","_ref$value","value","_ref$onChange","onChange","others","_useDevice","useDevice","isMobile","Primitive","Checkbox","RADIO","Radio","Switch","handleChange","event","SWITCH","id","labelId","concat","undefined","createElement","Pressable","tag","preventDefault","onPress","className","styles","style","inputOption","Icon","paragraph","ICON","CHECK","REMOVE","icon","Label","action","focus","success","exports","displayName","propTypes","PropTypes","bool","string","isRequired","oneOf","oneOfType","func"],"sources":["../../../src/components/InputOption/InputOption.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Checkbox, Icon, ICON, Pressable, Radio, Switch } from '../../primitives';\nimport { Label } from '../InputText/partials';\nimport { CHECKBOX, RADIO, SWITCH } from './InputOption.constants';\nimport style from './InputOption.module.css';\n\nconst InputOption = ({\n checked,\n disabled,\n error,\n indeterminate,\n label,\n name,\n required,\n requiredText,\n showRequired = false,\n small,\n type = CHECKBOX,\n value = '',\n onChange = () => {},\n ...others\n}) => {\n const { isMobile } = useDevice();\n\n const Primitive = type === CHECKBOX ? Checkbox : type === RADIO ? Radio : Switch;\n\n const handleChange = (event) => {\n onChange([CHECKBOX, SWITCH].includes(type) ? !checked : value, event);\n };\n\n const id = label ? others.id || name : others.id;\n const labelId = label ? `${id}-label` : undefined;\n\n return (\n <Pressable\n {...others}\n tag=\"input-option\"\n preventDefault={false}\n onPress={handleChange}\n className={styles(style.inputOption, others.className)}\n >\n <Primitive\n {...{ disabled, error, id, name, type, value }}\n checked={checked || (type === CHECKBOX && indeterminate)}\n aria-label={label}\n aria-labelledby={labelId}\n >\n {type === CHECKBOX && (checked || indeterminate) ? (\n <Icon paragraph={!isMobile} value={checked ? ICON.CHECK : ICON.REMOVE} className={style.icon} />\n ) : undefined}\n </Primitive>\n {label && (\n <Label\n action={!small}\n small={small}\n {...{\n disabled,\n error,\n focus: checked,\n for: id,\n id: labelId,\n label,\n required: showRequired && required && !checked,\n requiredText,\n success: checked,\n value: value?.length > 0,\n }}\n className={style.label}\n />\n )}\n </Pressable>\n );\n};\n\nInputOption.displayName = 'Component:InputOption';\n\nInputOption.propTypes = {\n checked: PropTypes.bool,\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n indeterminate: PropTypes.bool,\n label: PropTypes.string,\n name: PropTypes.string.isRequired,\n required: PropTypes.bool,\n requiredText: PropTypes.string,\n showRequired: PropTypes.bool,\n small: PropTypes.bool,\n type: PropTypes.oneOf([CHECKBOX, RADIO, SWITCH]),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),\n onChange: PropTypes.func,\n};\n\nexport { InputOption };\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAR,sBAAA,CAAAC,OAAA;AAA6C,IAAAQ,SAAA;AAAA,SAAAT,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAN,CAAA,MAAAA,CAAA,GAAAO,SAAA,CAAAC,MAAA,EAAAR,CAAA,UAAAS,CAAA,GAAAF,SAAA,CAAAP,CAAA,YAAAU,CAAA,IAAAD,CAAA,SAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,eAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;AAAA,SAAAO,yBAAAd,CAAA,EAAAS,CAAA,gBAAAT,CAAA,iBAAAe,CAAA,EAAAL,CAAA,EAAAM,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BAAS,CAACC,IAAI;EACvBxD,QAAQ,EAAEuD,qBAAS,CAACC,IAAI;EACxBvD,KAAK,EAAEsD,qBAAS,CAACC,IAAI;EACrBtD,aAAa,EAAEqD,qBAAS,CAACC,IAAI;EAC7BrD,KAAK,EAAEoD,qBAAS,CAACE,MAAM;EACvBrD,IAAI,EAAEmD,qBAAS,CAACE,MAAM,CAACC,UAAU;EACjCrD,QAAQ,EAAEkD,qBAAS,CAACC,IAAI;EACxBlD,YAAY,EAAEiD,qBAAS,CAACE,MAAM;EAC9BjD,YAAY,EAAE+C,qBAAS,CAACC,IAAI;EAC5B/C,KAAK,EAAE8C,qBAAS,CAACC,IAAI;EACrB7C,IAAI,EAAE4C,qBAAS,CAACI,KAAK,CAAC,CAAC/C,qBAAQ,EAAEW,kBAAK,EAAEK,mBAAM,CAAC,CAAC;EAChDd,KAAK,EAAEyC,qBAAS,CAACK,SAAS,CAAC,CAACL,qBAAS,CAACE,MAAM,EAAEF,qBAAS,CAACC,IAAI,CAAC,CAAC;EAC9DxC,QAAQ,EAAEuC,qBAAS,CAACM;AACtB,CAAC","ignoreList":[]}
|
|
@@ -15,7 +15,7 @@ var _InputTextModule = _interopRequireDefault(require("../InputText/InputText.mo
|
|
|
15
15
|
var _partials2 = require("../InputText/partials");
|
|
16
16
|
var _helpers2 = require("./helpers");
|
|
17
17
|
var _InputPhoneModule = _interopRequireDefault(require("./InputPhone.module.css"));
|
|
18
|
-
var _excluded = ["disabled", "emptyOption", "error", "hint", "icon", "label", "labelPrefix", "name", "prefixes", "showRequired", "showState", "success", "value", "warning", "onChange", "onEnter", "onError", "onLeave"];
|
|
18
|
+
var _excluded = ["disabled", "emptyOption", "error", "hint", "icon", "label", "labelPrefix", "name", "prefixes", "requiredText", "showRequired", "showState", "success", "value", "warning", "onChange", "onEnter", "onError", "onLeave"];
|
|
19
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n["default"] = e, t && t.set(e, n), n; }
|
|
21
21
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -39,6 +39,7 @@ var InputPhone = function InputPhone(_ref) {
|
|
|
39
39
|
name = _ref.name,
|
|
40
40
|
_ref$prefixes = _ref.prefixes,
|
|
41
41
|
prefixes = _ref$prefixes === void 0 ? [] : _ref$prefixes,
|
|
42
|
+
requiredText = _ref.requiredText,
|
|
42
43
|
_ref$showRequired = _ref.showRequired,
|
|
43
44
|
showRequired = _ref$showRequired === void 0 ? false : _ref$showRequired,
|
|
44
45
|
_ref$showState = _ref.showState,
|
|
@@ -194,7 +195,7 @@ var InputPhone = function InputPhone(_ref) {
|
|
|
194
195
|
"for": id,
|
|
195
196
|
label: label,
|
|
196
197
|
required: showRequired && others.required,
|
|
197
|
-
requiredText:
|
|
198
|
+
requiredText: requiredText,
|
|
198
199
|
success: success,
|
|
199
200
|
value: phone
|
|
200
201
|
}), /*#__PURE__*/_react["default"].createElement(_primitives.Input, _extends({}, others, {
|
|
@@ -238,6 +239,7 @@ InputPhone.propTypes = {
|
|
|
238
239
|
labelPrefix: _propTypes["default"].string,
|
|
239
240
|
name: _propTypes["default"].string.isRequired,
|
|
240
241
|
prefixes: _propTypes["default"].arrayOf(_propTypes["default"].string),
|
|
242
|
+
requiredText: _propTypes["default"].string,
|
|
241
243
|
showRequired: _propTypes["default"].bool,
|
|
242
244
|
showState: _propTypes["default"].bool,
|
|
243
245
|
success: _propTypes["default"].bool,
|