@bodynarf/react.components 1.12.6 → 1.13.0
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/changelog.md +54 -0
- package/components/accordion/component/index.d.ts +6 -6
- package/components/accordion/component/index.d.ts.map +1 -1
- package/components/accordion/component/index.js +33 -35
- package/components/accordion/index.d.ts +2 -2
- package/components/accordion/index.js +2 -2
- package/components/accordion/types.d.ts +16 -17
- package/components/accordion/types.d.ts.map +1 -1
- package/components/accordion/types.js +1 -1
- package/components/anchor/component/index.d.ts +7 -5
- package/components/anchor/component/index.d.ts.map +1 -1
- package/components/anchor/component/index.js +23 -20
- package/components/anchor/components/anchorWithIcon/index.d.ts +10 -10
- package/components/anchor/components/anchorWithIcon/index.d.ts.map +1 -1
- package/components/anchor/components/anchorWithIcon/index.js +24 -24
- package/components/anchor/components/simpleAnchor/index.d.ts +4 -5
- package/components/anchor/components/simpleAnchor/index.d.ts.map +1 -1
- package/components/anchor/components/simpleAnchor/index.js +11 -11
- package/components/anchor/index.d.ts +2 -2
- package/components/anchor/index.js +2 -2
- package/components/anchor/types.d.ts +19 -16
- package/components/anchor/types.d.ts.map +1 -1
- package/components/anchor/types.js +1 -1
- package/components/breadcrumbs/component/index.d.ts +8 -8
- package/components/breadcrumbs/component/index.d.ts.map +1 -1
- package/components/breadcrumbs/component/index.js +38 -37
- package/components/breadcrumbs/index.d.ts +2 -2
- package/components/breadcrumbs/index.js +2 -2
- package/components/breadcrumbs/types.d.ts +54 -46
- package/components/breadcrumbs/types.d.ts.map +1 -1
- package/components/breadcrumbs/types.js +1 -1
- package/components/button/component/index.d.ts +9 -8
- package/components/button/component/index.d.ts.map +1 -1
- package/components/button/component/index.js +35 -33
- package/components/button/components/buttonWithIcon/index.d.ts +5 -4
- package/components/button/components/buttonWithIcon/index.d.ts.map +1 -1
- package/components/button/components/buttonWithIcon/index.js +27 -27
- package/components/button/components/simpleButton/index.d.ts +5 -5
- package/components/button/components/simpleButton/index.d.ts.map +1 -1
- package/components/button/components/simpleButton/index.js +11 -11
- package/components/button/index.d.ts +2 -2
- package/components/button/index.js +2 -2
- package/components/button/types.d.ts +71 -37
- package/components/button/types.d.ts.map +1 -1
- package/components/button/types.js +30 -1
- package/components/dropdown/component/index.d.ts +6 -6
- package/components/dropdown/component/index.d.ts.map +1 -1
- package/components/dropdown/component/index.js +12 -12
- package/components/dropdown/components/compact/index.d.ts +10 -10
- package/components/dropdown/components/compact/index.d.ts.map +1 -1
- package/components/dropdown/components/compact/index.js +80 -80
- package/components/dropdown/components/item/index.d.ts +14 -14
- package/components/dropdown/components/item/index.d.ts.map +1 -1
- package/components/dropdown/components/item/index.js +39 -38
- package/components/dropdown/components/label/component/index.d.ts +26 -26
- package/components/dropdown/components/label/component/index.d.ts.map +1 -1
- package/components/dropdown/components/label/component/index.js +16 -16
- package/components/dropdown/components/label/components/empty/index.d.ts +7 -7
- package/components/dropdown/components/label/components/empty/index.d.ts.map +1 -1
- package/components/dropdown/components/label/components/empty/index.js +16 -16
- package/components/dropdown/components/label/components/selected/index.d.ts +7 -7
- package/components/dropdown/components/label/components/selected/index.d.ts.map +1 -1
- package/components/dropdown/components/label/components/selected/index.js +20 -20
- package/components/dropdown/components/label/components/selectedWithIcon/index.d.ts +7 -7
- package/components/dropdown/components/label/components/selectedWithIcon/index.d.ts.map +1 -1
- package/components/dropdown/components/label/components/selectedWithIcon/index.js +28 -28
- package/components/dropdown/components/label/components/withSearch/index.d.ts +15 -15
- package/components/dropdown/components/label/components/withSearch/index.d.ts.map +1 -1
- package/components/dropdown/components/label/components/withSearch/index.js +33 -33
- package/components/dropdown/components/label/index.d.ts +1 -1
- package/components/dropdown/components/label/index.js +1 -1
- package/components/dropdown/components/withLabel/index.d.ts +5 -5
- package/components/dropdown/components/withLabel/index.js +11 -11
- package/components/dropdown/index.d.ts +2 -2
- package/components/dropdown/index.js +2 -2
- package/components/dropdown/types.d.ts +65 -64
- package/components/dropdown/types.d.ts.map +1 -1
- package/components/dropdown/types.js +1 -1
- package/components/file/component/index.d.ts +6 -6
- package/components/file/component/index.d.ts.map +1 -1
- package/components/file/component/index.js +51 -50
- package/components/file/component/styles.scss +13 -0
- package/components/file/index.d.ts +2 -2
- package/components/file/index.js +2 -2
- package/components/file/types.d.ts +31 -31
- package/components/file/types.d.ts.map +1 -1
- package/components/file/types.js +1 -1
- package/components/icon/component/index.d.ts +8 -8
- package/components/icon/component/index.d.ts.map +1 -1
- package/components/icon/component/index.js +23 -28
- package/components/icon/component/style.scss +3 -3
- package/components/icon/index.d.ts +2 -2
- package/components/icon/index.js +2 -2
- package/components/icon/types.d.ts +13 -15
- package/components/icon/types.d.ts.map +1 -1
- package/components/icon/types.js +1 -1
- package/components/index.d.ts +10 -10
- package/components/index.js +10 -10
- package/components/multiselect/component/index.d.ts +7 -7
- package/components/multiselect/component/index.js +13 -13
- package/components/multiselect/components/item/index.d.ts +24 -24
- package/components/multiselect/components/item/index.d.ts.map +1 -1
- package/components/multiselect/components/item/index.js +63 -62
- package/components/multiselect/components/label/component/index.d.ts +19 -19
- package/components/multiselect/components/label/component/index.d.ts.map +1 -1
- package/components/multiselect/components/label/component/index.js +12 -12
- package/components/multiselect/components/label/components/empty/index.d.ts +7 -7
- package/components/multiselect/components/label/components/empty/index.d.ts.map +1 -1
- package/components/multiselect/components/label/components/empty/index.js +16 -16
- package/components/multiselect/components/label/components/nonEmpty/index.d.ts +7 -7
- package/components/multiselect/components/label/components/nonEmpty/index.d.ts.map +1 -1
- package/components/multiselect/components/label/components/nonEmpty/index.js +16 -16
- package/components/multiselect/components/label/index.d.ts +1 -1
- package/components/multiselect/components/label/index.js +1 -1
- package/components/multiselect/components/withLabel/index.d.ts +5 -5
- package/components/multiselect/components/withLabel/index.js +11 -11
- package/components/multiselect/components/withoutLabel/index.d.ts +9 -9
- package/components/multiselect/components/withoutLabel/index.d.ts.map +1 -1
- package/components/multiselect/components/withoutLabel/index.js +85 -84
- package/components/multiselect/index.d.ts +2 -2
- package/components/multiselect/index.js +2 -2
- package/components/multiselect/types.d.ts +32 -40
- package/components/multiselect/types.d.ts.map +1 -1
- package/components/multiselect/types.js +1 -1
- package/components/paginator/component/index.d.ts +8 -8
- package/components/paginator/component/index.d.ts.map +1 -1
- package/components/paginator/component/index.js +65 -70
- package/components/paginator/index.d.ts +2 -2
- package/components/paginator/index.js +2 -2
- package/components/paginator/types.d.ts +54 -54
- package/components/paginator/types.d.ts.map +1 -1
- package/components/paginator/types.js +1 -1
- package/components/primitives/checkbox/component/index.d.ts +5 -6
- package/components/primitives/checkbox/component/index.d.ts.map +1 -1
- package/components/primitives/checkbox/component/index.js +43 -41
- package/components/primitives/checkbox/index.d.ts +2 -2
- package/components/primitives/checkbox/index.js +2 -2
- package/components/primitives/checkbox/types.d.ts +26 -24
- package/components/primitives/checkbox/types.d.ts.map +1 -1
- package/components/primitives/checkbox/types.js +1 -1
- package/components/primitives/color/component/index.d.ts +5 -6
- package/components/primitives/color/component/index.d.ts.map +1 -1
- package/components/primitives/color/component/index.js +10 -10
- package/components/primitives/color/components/picker/index.d.ts +19 -19
- package/components/primitives/color/components/picker/index.d.ts.map +1 -1
- package/components/primitives/color/components/picker/index.js +43 -42
- package/components/primitives/color/components/withLabel/index.d.ts +5 -5
- package/components/primitives/color/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/color/components/withLabel/index.js +25 -25
- package/components/primitives/color/components/withoutLabel/index.d.ts +5 -5
- package/components/primitives/color/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/color/components/withoutLabel/index.js +21 -21
- package/components/primitives/color/index.d.ts +2 -2
- package/components/primitives/color/index.js +2 -2
- package/components/primitives/color/types.d.ts +23 -23
- package/components/primitives/color/types.d.ts.map +1 -1
- package/components/primitives/color/types.js +1 -1
- package/components/primitives/date/component/index.d.ts +5 -6
- package/components/primitives/date/component/index.d.ts.map +1 -1
- package/components/primitives/date/component/index.js +31 -31
- package/components/primitives/date/index.d.ts +2 -2
- package/components/primitives/date/index.js +2 -2
- package/components/primitives/date/types.d.ts +3 -8
- package/components/primitives/date/types.d.ts.map +1 -1
- package/components/primitives/date/types.js +1 -1
- package/components/primitives/index.d.ts +7 -7
- package/components/primitives/index.js +7 -7
- package/components/primitives/internal/componentWithLabel/index.d.ts +16 -16
- package/components/primitives/internal/componentWithLabel/index.d.ts.map +1 -1
- package/components/primitives/internal/componentWithLabel/index.js +30 -30
- package/components/primitives/internal/hint/index.d.ts +8 -8
- package/components/primitives/internal/hint/index.d.ts.map +1 -1
- package/components/primitives/internal/hint/index.js +49 -48
- package/components/primitives/multiline/component/index.d.ts +4 -5
- package/components/primitives/multiline/component/index.d.ts.map +1 -1
- package/components/primitives/multiline/component/index.js +11 -11
- package/components/primitives/multiline/components/withLabel/index.d.ts +4 -5
- package/components/primitives/multiline/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/multiline/components/withLabel/index.js +27 -27
- package/components/primitives/multiline/components/withoutLabel/index.d.ts +4 -5
- package/components/primitives/multiline/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/multiline/components/withoutLabel/index.js +27 -27
- package/components/primitives/multiline/index.d.ts +2 -2
- package/components/primitives/multiline/index.js +2 -2
- package/components/primitives/multiline/types.d.ts +8 -10
- package/components/primitives/multiline/types.d.ts.map +1 -1
- package/components/primitives/multiline/types.js +1 -1
- package/components/primitives/number/component/index.d.ts +4 -5
- package/components/primitives/number/component/index.d.ts.map +1 -1
- package/components/primitives/number/component/index.js +11 -11
- package/components/primitives/number/components/withLabel/index.d.ts +4 -5
- package/components/primitives/number/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/number/components/withLabel/index.js +27 -27
- package/components/primitives/number/components/withoutLabel/index.d.ts +4 -5
- package/components/primitives/number/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/number/components/withoutLabel/index.js +27 -27
- package/components/primitives/number/index.d.ts +2 -2
- package/components/primitives/number/index.js +2 -2
- package/components/primitives/number/types.d.ts +10 -12
- package/components/primitives/number/types.d.ts.map +1 -1
- package/components/primitives/number/types.js +1 -1
- package/components/primitives/password/component/index.d.ts +5 -5
- package/components/primitives/password/component/index.d.ts.map +1 -1
- package/components/primitives/password/component/index.js +12 -12
- package/components/primitives/password/components/withLabel/index.d.ts +3 -3
- package/components/primitives/password/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/password/components/withLabel/index.js +34 -34
- package/components/primitives/password/components/withoutLabel/index.d.ts +3 -3
- package/components/primitives/password/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/password/components/withoutLabel/index.js +34 -34
- package/components/primitives/password/index.d.ts +2 -2
- package/components/primitives/password/index.js +2 -2
- package/components/primitives/password/types.d.ts +14 -14
- package/components/primitives/password/types.d.ts.map +1 -1
- package/components/primitives/password/types.js +1 -1
- package/components/primitives/text/component/index.d.ts +4 -5
- package/components/primitives/text/component/index.d.ts.map +1 -1
- package/components/primitives/text/component/index.js +11 -11
- package/components/primitives/text/components/withLabel/index.d.ts +4 -5
- package/components/primitives/text/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/text/components/withLabel/index.js +27 -27
- package/components/primitives/text/components/withoutLabel/index.d.ts +4 -5
- package/components/primitives/text/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/text/components/withoutLabel/index.js +27 -27
- package/components/primitives/text/index.d.ts +2 -2
- package/components/primitives/text/index.js +2 -2
- package/components/primitives/text/types.d.ts +3 -6
- package/components/primitives/text/types.d.ts.map +1 -1
- package/components/primitives/text/types.js +1 -1
- package/components/search/component/index.d.ts +6 -5
- package/components/search/component/index.d.ts.map +1 -1
- package/components/search/component/index.js +41 -40
- package/components/search/index.d.ts +2 -2
- package/components/search/index.js +2 -2
- package/components/search/types.d.ts +41 -41
- package/components/search/types.d.ts.map +1 -1
- package/components/search/types.js +1 -1
- package/components/table/component/index.d.ts +8 -9
- package/components/table/component/index.d.ts.map +1 -1
- package/components/table/component/index.js +28 -29
- package/components/table/components/heading/index.d.ts +14 -12
- package/components/table/components/heading/index.d.ts.map +1 -1
- package/components/table/components/heading/index.js +21 -21
- package/components/table/index.d.ts +2 -2
- package/components/table/index.js +2 -2
- package/components/table/types.d.ts +52 -52
- package/components/table/types.d.ts.map +1 -1
- package/components/table/types.js +1 -1
- package/components/tabs/component/index.d.ts +9 -9
- package/components/tabs/component/index.d.ts.map +1 -1
- package/components/tabs/component/index.js +68 -74
- package/components/tabs/components/item/index.d.ts +11 -12
- package/components/tabs/components/item/index.d.ts.map +1 -1
- package/components/tabs/components/item/index.js +28 -28
- package/components/tabs/index.d.ts +2 -2
- package/components/tabs/index.js +2 -2
- package/components/tabs/types.d.ts +54 -54
- package/components/tabs/types.js +22 -22
- package/components/tag/component/index.d.ts +6 -6
- package/components/tag/component/index.d.ts.map +1 -1
- package/components/tag/component/index.js +32 -32
- package/components/tag/index.d.ts +2 -2
- package/components/tag/index.js +2 -2
- package/components/tag/types.d.ts +24 -26
- package/components/tag/types.d.ts.map +1 -1
- package/components/tag/types.js +1 -1
- package/hooks/index.d.ts +11 -5
- package/hooks/index.d.ts.map +1 -1
- package/hooks/index.js +11 -5
- package/hooks/useComponentOutsideClick.d.ts +11 -11
- package/hooks/useComponentOutsideClick.d.ts.map +1 -1
- package/hooks/useComponentOutsideClick.js +31 -31
- package/hooks/useDebounceHandler.d.ts +17 -17
- package/hooks/useDebounceHandler.d.ts.map +1 -1
- package/hooks/useDebounceHandler.js +30 -30
- package/hooks/useEventListener.d.ts +13 -0
- package/hooks/useEventListener.d.ts.map +1 -0
- package/hooks/useEventListener.js +23 -0
- package/hooks/useInterval.d.ts +12 -0
- package/hooks/useInterval.d.ts.map +1 -0
- package/hooks/useInterval.js +23 -0
- package/hooks/useLocalStorage.d.ts +13 -0
- package/hooks/useLocalStorage.d.ts.map +1 -0
- package/hooks/useLocalStorage.js +23 -0
- package/hooks/useMount.d.ts +11 -11
- package/hooks/useMount.d.ts.map +1 -1
- package/hooks/useMount.js +16 -16
- package/hooks/usePagination.d.ts +19 -19
- package/hooks/usePagination.d.ts.map +1 -1
- package/hooks/usePagination.js +37 -37
- package/hooks/usePrevious.d.ts +12 -0
- package/hooks/usePrevious.d.ts.map +1 -0
- package/hooks/usePrevious.js +18 -0
- package/hooks/useTimeout.d.ts +12 -0
- package/hooks/useTimeout.d.ts.map +1 -0
- package/hooks/useTimeout.js +23 -0
- package/hooks/useUnmount.d.ts +8 -8
- package/hooks/useUnmount.d.ts.map +1 -1
- package/hooks/useUnmount.js +22 -22
- package/hooks/useUpdateEffect.d.ts +16 -0
- package/hooks/useUpdateEffect.d.ts.map +1 -0
- package/hooks/useUpdateEffect.js +25 -0
- package/index.d.ts +4 -4
- package/index.js +4 -4
- package/package.json +12 -10
- package/tsconfig.tsbuildinfo +1 -1
- package/types/{baseElementProps.d.ts → base/baseElementProps.d.ts} +10 -10
- package/types/base/baseElementProps.d.ts.map +1 -0
- package/types/{baseElementProps.js → base/baseElementProps.js} +1 -1
- package/types/{baseInputElementProps.d.ts → base/baseInputElementProps.d.ts} +49 -41
- package/types/base/baseInputElementProps.d.ts.map +1 -0
- package/types/{baseInputElementProps.js → base/baseInputElementProps.js} +1 -1
- package/types/base/blurableElement.d.ts +9 -0
- package/types/base/blurableElement.d.ts.map +1 -0
- package/types/base/blurableElement.js +1 -0
- package/types/base/clickableElement.d.ts +7 -0
- package/types/base/clickableElement.d.ts.map +1 -0
- package/types/base/clickableElement.js +1 -0
- package/types/base/index.d.ts +5 -0
- package/types/base/index.d.ts.map +1 -0
- package/types/base/index.js +4 -0
- package/types/dataAttributes.d.ts +8 -8
- package/types/dataAttributes.d.ts.map +1 -1
- package/types/dataAttributes.js +1 -1
- package/types/elementIcon.d.ts +21 -21
- package/types/elementIcon.d.ts.map +1 -1
- package/types/elementIcon.js +1 -1
- package/types/{elementColor.d.ts → enums/elementColor.d.ts} +17 -17
- package/types/enums/elementColor.d.ts.map +1 -0
- package/types/{elementColor.js → enums/elementColor.js} +18 -18
- package/types/{elementPosition.d.ts → enums/elementPosition.d.ts} +11 -11
- package/types/enums/elementPosition.d.ts.map +1 -0
- package/types/{elementPosition.js → enums/elementPosition.js} +10 -10
- package/types/{elementSize.d.ts → enums/elementSize.d.ts} +11 -11
- package/types/enums/elementSize.d.ts.map +1 -0
- package/types/{elementSize.js → enums/elementSize.js} +12 -12
- package/types/enums/index.d.ts +4 -0
- package/types/enums/index.d.ts.map +1 -0
- package/types/enums/index.js +3 -0
- package/types/hintConfiguration.d.ts +12 -12
- package/types/hintConfiguration.d.ts.map +1 -1
- package/types/hintConfiguration.js +1 -1
- package/types/index.d.ts +7 -10
- package/types/index.d.ts.map +1 -1
- package/types/index.js +7 -10
- package/types/labelConfiguration.d.ts +14 -14
- package/types/labelConfiguration.d.ts.map +1 -1
- package/types/labelConfiguration.js +1 -1
- package/types/validation/index.d.ts +2 -2
- package/types/validation/index.js +2 -2
- package/types/validation/state.d.ts +8 -8
- package/types/validation/state.js +1 -1
- package/types/validation/status.d.ts +9 -9
- package/types/validation/status.js +10 -10
- package/utils/dataAttributes.d.ts +7 -7
- package/utils/dataAttributes.d.ts.map +1 -1
- package/utils/dataAttributes.js +22 -21
- package/utils/index.d.ts +3 -2
- package/utils/index.d.ts.map +1 -1
- package/utils/index.js +3 -2
- package/utils/styles.d.ts +14 -0
- package/utils/styles.d.ts.map +1 -0
- package/utils/styles.js +33 -0
- package/utils/validation.d.ts +10 -10
- package/utils/validation.d.ts.map +1 -1
- package/utils/validation.js +20 -20
- package/bodynarf-react.components-1.12.2.tgz +0 -0
- package/bodynarf-react.components-1.12.3.tgz +0 -0
- package/bodynarf-react.components-1.12.4.tgz +0 -0
- package/types/baseElementProps.d.ts.map +0 -1
- package/types/baseInputElementProps.d.ts.map +0 -1
- package/types/elementColor.d.ts.map +0 -1
- package/types/elementPosition.d.ts.map +0 -1
- package/types/elementSize.d.ts.map +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default Number;
|
|
1
|
+
import { NumberProps } from "..";
|
|
2
|
+
/** Number input component */
|
|
3
|
+
declare const Number: (props: NumberProps) => JSX.Element;
|
|
4
|
+
export default Number;
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/number/component/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/number/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAIjC,6BAA6B;AAC7B,QAAA,MAAM,MAAM,GAAI,OAAO,WAAW,KAAG,GAAG,CAAC,OAIxC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { isNullOrUndefined } from "@bodynarf/utils";
|
|
3
|
-
import NumberWithLabel from "../components/withLabel";
|
|
4
|
-
import NumberWithoutLabel from "../components/withoutLabel";
|
|
5
|
-
/** Number input component */
|
|
6
|
-
const Number = (props) => {
|
|
7
|
-
return isNullOrUndefined(props.label)
|
|
8
|
-
? _jsx(NumberWithoutLabel, { ...props })
|
|
9
|
-
: _jsx(NumberWithLabel, { ...props });
|
|
10
|
-
};
|
|
11
|
-
export default Number;
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isNullOrUndefined } from "@bodynarf/utils";
|
|
3
|
+
import NumberWithLabel from "../components/withLabel";
|
|
4
|
+
import NumberWithoutLabel from "../components/withoutLabel";
|
|
5
|
+
/** Number input component */
|
|
6
|
+
const Number = (props) => {
|
|
7
|
+
return isNullOrUndefined(props.label)
|
|
8
|
+
? _jsx(NumberWithoutLabel, { ...props })
|
|
9
|
+
: _jsx(NumberWithLabel, { ...props });
|
|
10
|
+
};
|
|
11
|
+
export default Number;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default NumberWithLabel;
|
|
1
|
+
import { NumberProps } from "../..";
|
|
2
|
+
/** Number component with label */
|
|
3
|
+
declare const NumberWithLabel: ({ onValueChange, defaultValue, validationState, name, label, placeholder, size, style, rounded, loading, readonly, disabled, autoFocus, onBlur, step, className, title, data, hint, }: NumberProps) => JSX.Element;
|
|
4
|
+
export default NumberWithLabel;
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withLabel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withLabel/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,kCAAkC;AAClC,QAAA,MAAM,eAAe,GAAI,uLAWtB,WAAW,KAAG,GAAG,CAAC,OAwDpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { generateGuid, getClassName, isNullOrUndefined, isStringEmpty } from "@bodynarf/utils";
|
|
4
|
-
import { ElementSize } from "../../../../../types";
|
|
5
|
-
import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
6
|
-
import ComponentWithLabel from "../../../internal/componentWithLabel";
|
|
7
|
-
import InternalHint from "../../../internal/hint";
|
|
8
|
-
/** Number component with label */
|
|
9
|
-
const NumberWithLabel = ({ onValueChange, defaultValue, validationState, name = generateGuid(), label, placeholder, size = ElementSize.Normal, style, rounded = false, loading = false, readonly = false, disabled = false, autoFocus = false, onBlur, step = 1, className, title, data, hint, }) => {
|
|
10
|
-
const onChange = useCallback((event) => onValueChange(isStringEmpty(event.target.value) ? undefined : +event.target.value), [onValueChange]);
|
|
11
|
-
const elClassName = getClassName([
|
|
12
|
-
className,
|
|
13
|
-
size === ElementSize.Normal ? "" : `is-${size}`,
|
|
14
|
-
rounded ? "is-rounded" : "",
|
|
15
|
-
getStyleClassName(style, validationState),
|
|
16
|
-
"input",
|
|
17
|
-
]);
|
|
18
|
-
const inputContainerClassName = getClassName([
|
|
19
|
-
"control",
|
|
20
|
-
loading ? "is-loading" : "",
|
|
21
|
-
]);
|
|
22
|
-
const dataAttributes = isNullOrUndefined(data)
|
|
23
|
-
? undefined
|
|
24
|
-
: mapDataAttributes(data);
|
|
25
|
-
return (_jsxs(ComponentWithLabel, { id: name, size: size, label: label, children: [_jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "number", id: name, name: name, step: step, onBlur: onBlur, onChange: onChange, readOnly: readonly, disabled: disabled, autoFocus: autoFocus, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }) }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
26
|
-
};
|
|
27
|
-
export default NumberWithLabel;
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { emptyFn, generateGuid, getClassName, isNullOrUndefined, isStringEmpty } from "@bodynarf/utils";
|
|
4
|
+
import { ElementSize } from "../../../../../types";
|
|
5
|
+
import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
6
|
+
import ComponentWithLabel from "../../../internal/componentWithLabel";
|
|
7
|
+
import InternalHint from "../../../internal/hint";
|
|
8
|
+
/** Number component with label */
|
|
9
|
+
const NumberWithLabel = ({ onValueChange = emptyFn, defaultValue, validationState, name = generateGuid(), label, placeholder, size = ElementSize.Normal, style, rounded = false, loading = false, readonly = false, disabled = false, autoFocus = false, onBlur, step = 1, className, title, data, hint, }) => {
|
|
10
|
+
const onChange = useCallback((event) => onValueChange(isStringEmpty(event.target.value) ? undefined : +event.target.value), [onValueChange]);
|
|
11
|
+
const elClassName = getClassName([
|
|
12
|
+
className,
|
|
13
|
+
size === ElementSize.Normal ? "" : `is-${size}`,
|
|
14
|
+
rounded ? "is-rounded" : "",
|
|
15
|
+
getStyleClassName(style, validationState),
|
|
16
|
+
"input",
|
|
17
|
+
]);
|
|
18
|
+
const inputContainerClassName = getClassName([
|
|
19
|
+
"control",
|
|
20
|
+
loading ? "is-loading" : "",
|
|
21
|
+
]);
|
|
22
|
+
const dataAttributes = isNullOrUndefined(data)
|
|
23
|
+
? undefined
|
|
24
|
+
: mapDataAttributes(data);
|
|
25
|
+
return (_jsxs(ComponentWithLabel, { id: name, size: size, label: label, children: [_jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "number", id: name, name: name, step: step, onBlur: onBlur, onChange: onChange, readOnly: readonly, disabled: disabled, autoFocus: autoFocus, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }) }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
26
|
+
};
|
|
27
|
+
export default NumberWithLabel;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default NumberWithoutLabel;
|
|
1
|
+
import { NumberProps } from "../..";
|
|
2
|
+
/** Number component without label */
|
|
3
|
+
declare const NumberWithoutLabel: ({ onValueChange, defaultValue, validationState, name, size, style, readonly, disabled, autoFocus, rounded, loading, placeholder, onBlur, step, className, title, data, hint, }: NumberProps) => JSX.Element;
|
|
4
|
+
export default NumberWithoutLabel;
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withoutLabel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withoutLabel/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,qCAAqC;AACrC,QAAA,MAAM,kBAAkB,GAAI,gLAYzB,WAAW,KAAG,GAAG,CAAC,OAsDpB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { generateGuid, getClassName, isNullOrUndefined } from "@bodynarf/utils";
|
|
4
|
-
import { ElementSize } from "../../../../../types";
|
|
5
|
-
import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
6
|
-
import InternalHint from "../../../internal/hint";
|
|
7
|
-
/** Number component without label */
|
|
8
|
-
const NumberWithoutLabel = ({ onValueChange, defaultValue, validationState, name = generateGuid(), size, style, readonly = false, disabled = false, autoFocus = false, rounded = false, loading = false, placeholder, onBlur, step = 1, className, title, data, hint, }) => {
|
|
9
|
-
const onChange = useCallback((event) => onValueChange(+event.target.value), [onValueChange]);
|
|
10
|
-
const elClassName = getClassName([
|
|
11
|
-
className,
|
|
12
|
-
size === ElementSize.Normal ? "" : `is-${size}`,
|
|
13
|
-
rounded ? "is-rounded" : "",
|
|
14
|
-
getStyleClassName(style, validationState),
|
|
15
|
-
"input",
|
|
16
|
-
]);
|
|
17
|
-
const containerClassName = getClassName([
|
|
18
|
-
"control",
|
|
19
|
-
"bbr-input",
|
|
20
|
-
loading ? "is-loading" : "",
|
|
21
|
-
]);
|
|
22
|
-
const dataAttributes = isNullOrUndefined(data)
|
|
23
|
-
? undefined
|
|
24
|
-
: mapDataAttributes(data);
|
|
25
|
-
return (_jsxs("div", { className: "bbr-field field", children: [_jsx("div", { className: containerClassName, children: _jsx("input", { type: "number", id: name, name: name, step: step, onBlur: onBlur, onChange: onChange, readOnly: readonly, disabled: disabled, autoFocus: autoFocus, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }) }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
26
|
-
};
|
|
27
|
-
export default NumberWithoutLabel;
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { emptyFn, generateGuid, getClassName, isNullOrUndefined } from "@bodynarf/utils";
|
|
4
|
+
import { ElementSize } from "../../../../../types";
|
|
5
|
+
import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
6
|
+
import InternalHint from "../../../internal/hint";
|
|
7
|
+
/** Number component without label */
|
|
8
|
+
const NumberWithoutLabel = ({ onValueChange = emptyFn, defaultValue, validationState, name = generateGuid(), size, style, readonly = false, disabled = false, autoFocus = false, rounded = false, loading = false, placeholder, onBlur, step = 1, className, title, data, hint, }) => {
|
|
9
|
+
const onChange = useCallback((event) => onValueChange(+event.target.value), [onValueChange]);
|
|
10
|
+
const elClassName = getClassName([
|
|
11
|
+
className,
|
|
12
|
+
size === ElementSize.Normal ? "" : `is-${size}`,
|
|
13
|
+
rounded ? "is-rounded" : "",
|
|
14
|
+
getStyleClassName(style, validationState),
|
|
15
|
+
"input",
|
|
16
|
+
]);
|
|
17
|
+
const containerClassName = getClassName([
|
|
18
|
+
"control",
|
|
19
|
+
"bbr-input",
|
|
20
|
+
loading ? "is-loading" : "",
|
|
21
|
+
]);
|
|
22
|
+
const dataAttributes = isNullOrUndefined(data)
|
|
23
|
+
? undefined
|
|
24
|
+
: mapDataAttributes(data);
|
|
25
|
+
return (_jsxs("div", { className: "bbr-field field", children: [_jsx("div", { className: containerClassName, children: _jsx("input", { type: "number", id: name, name: name, step: step, onBlur: onBlur, onChange: onChange, readOnly: readonly, disabled: disabled, autoFocus: autoFocus, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }) }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
26
|
+
};
|
|
27
|
+
export default NumberWithoutLabel;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default } from "./component";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export { default } from "./component";
|
|
2
|
+
export * from "./types";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from "./component";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export { default } from "./component";
|
|
2
|
+
export * from "./types";
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/** Number component props type */
|
|
3
|
-
export
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
step?: number;
|
|
12
|
-
}
|
|
1
|
+
import { BaseNullableInputElementProps, BlurableElement } from "../../../types";
|
|
2
|
+
/** Number component props type */
|
|
3
|
+
export type NumberProps = BaseNullableInputElementProps<number> & BlurableElement & {
|
|
4
|
+
/**
|
|
5
|
+
* Difference which will be used to change value after step button click.
|
|
6
|
+
* See html input step documentation.
|
|
7
|
+
* @default 1
|
|
8
|
+
*/
|
|
9
|
+
step?: number;
|
|
10
|
+
};
|
|
13
11
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/number/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/number/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE5E,kCAAkC;AAClC,MAAM,MAAM,WAAW,GAAG,6BAA6B,CAAC,MAAM,CAAC,GACzD,eAAe,GACf;IACE;;;;MAIE;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./style.scss";
|
|
2
|
-
import { PasswordProps } from "../..";
|
|
3
|
-
/** Password input component */
|
|
4
|
-
declare const Password: (props: PasswordProps) => JSX.Element;
|
|
5
|
-
export default Password;
|
|
1
|
+
import "./style.scss";
|
|
2
|
+
import { PasswordProps } from "../..";
|
|
3
|
+
/** Password input component */
|
|
4
|
+
declare const Password: (props: PasswordProps) => JSX.Element;
|
|
5
|
+
export default Password;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/password/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,+BAA+B;AAC/B,QAAA,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/password/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,+BAA+B;AAC/B,QAAA,MAAM,QAAQ,GAAI,OAAO,aAAa,KAAG,GAAG,CAAC,OAI5C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { isNullOrUndefined } from "@bodynarf/utils";
|
|
3
|
-
import "./style.scss";
|
|
4
|
-
import PasswordWithLabel from "../components/withLabel";
|
|
5
|
-
import PasswordWithoutLabel from "../components/withoutLabel";
|
|
6
|
-
/** Password input component */
|
|
7
|
-
const Password = (props) => {
|
|
8
|
-
return isNullOrUndefined(props.label)
|
|
9
|
-
? _jsx(PasswordWithoutLabel, { ...props })
|
|
10
|
-
: _jsx(PasswordWithLabel, { ...props });
|
|
11
|
-
};
|
|
12
|
-
export default Password;
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isNullOrUndefined } from "@bodynarf/utils";
|
|
3
|
+
import "./style.scss";
|
|
4
|
+
import PasswordWithLabel from "../components/withLabel";
|
|
5
|
+
import PasswordWithoutLabel from "../components/withoutLabel";
|
|
6
|
+
/** Password input component */
|
|
7
|
+
const Password = (props) => {
|
|
8
|
+
return isNullOrUndefined(props.label)
|
|
9
|
+
? _jsx(PasswordWithoutLabel, { ...props })
|
|
10
|
+
: _jsx(PasswordWithLabel, { ...props });
|
|
11
|
+
};
|
|
12
|
+
export default Password;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PasswordProps } from "../..";
|
|
2
|
-
declare const PasswordWithLabel: ({ defaultValue, onValueChange, validationState, name, size, style, rounded, loading, autoFocus, disabled, canShowPassword, label, placeholder, showPasswordIconTitle, className, title, data, hint, }: PasswordProps) => JSX.Element;
|
|
3
|
-
export default PasswordWithLabel;
|
|
1
|
+
import { PasswordProps } from "../..";
|
|
2
|
+
declare const PasswordWithLabel: ({ defaultValue, onValueChange, validationState, name, size, style, rounded, loading, autoFocus, disabled, canShowPassword, label, placeholder, showPasswordIconTitle, className, title, data, hint, }: PasswordProps) => JSX.Element;
|
|
3
|
+
export default PasswordWithLabel;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withLabel/index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,QAAA,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withLabel/index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,QAAA,MAAM,iBAAiB,GAAI,uMAWxB,aAAa,KAAG,GAAG,CAAC,OAuEtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useState } from "react";
|
|
3
|
-
import { generateGuid, getClassName, isNullOrUndefined } from "@bodynarf/utils";
|
|
4
|
-
import { ElementSize } from "../../../../../types";
|
|
5
|
-
import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
6
|
-
import Icon from "../../../../icon";
|
|
7
|
-
import ComponentWithLabel from "../../../internal/componentWithLabel";
|
|
8
|
-
import InternalHint from "../../../internal/hint";
|
|
9
|
-
const PasswordWithLabel = ({ defaultValue, onValueChange, validationState, name = generateGuid(), size = ElementSize.Normal, style, rounded = false, loading = false, autoFocus = false, disabled = false, canShowPassword = false, label, placeholder, showPasswordIconTitle = "Show password", className, title, data, hint, }) => {
|
|
10
|
-
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
11
|
-
const [contentIsHidden, setContentIsHidden] = useState(true);
|
|
12
|
-
const onIconClick = useCallback(() => setContentIsHidden(state => !state), [setContentIsHidden]);
|
|
13
|
-
const elSizeClassName = size === ElementSize.Normal ? "" : "is-{0}".format(size);
|
|
14
|
-
const elClassName = getClassName([
|
|
15
|
-
"bbr-password",
|
|
16
|
-
className,
|
|
17
|
-
elSizeClassName,
|
|
18
|
-
rounded ? "is-rounded" : "",
|
|
19
|
-
getStyleClassName(style, validationState),
|
|
20
|
-
"input",
|
|
21
|
-
]);
|
|
22
|
-
const inputContainerClassName = getClassName([
|
|
23
|
-
"control",
|
|
24
|
-
loading ? "is-loading" : "",
|
|
25
|
-
canShowPassword ? "has-icons-right" : "",
|
|
26
|
-
"bbr-password__wrapper",
|
|
27
|
-
]);
|
|
28
|
-
const dataAttributes = isNullOrUndefined(data)
|
|
29
|
-
? undefined
|
|
30
|
-
: mapDataAttributes(data);
|
|
31
|
-
return (_jsxs(ComponentWithLabel, { id: name, size: size, label: label, children: [_jsxs("div", { className: inputContainerClassName, children: [_jsx("input", { type: contentIsHidden ? "password" : "text", id: name, name: name, disabled: disabled, onChange: onChange, autoFocus: autoFocus, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }), canShowPassword && !loading &&
|
|
32
|
-
_jsx("span", { onClick: onIconClick, title: showPasswordIconTitle, className: `icon is-right ${elSizeClassName}`, children: _jsx(Icon, { name: contentIsHidden ? "eye" : "eye-slash"
|
|
33
|
-
};
|
|
34
|
-
export default PasswordWithLabel;
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { emptyFn, generateGuid, getClassName, isNullOrUndefined } from "@bodynarf/utils";
|
|
4
|
+
import { ElementSize } from "../../../../../types";
|
|
5
|
+
import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
6
|
+
import Icon from "../../../../icon";
|
|
7
|
+
import ComponentWithLabel from "../../../internal/componentWithLabel";
|
|
8
|
+
import InternalHint from "../../../internal/hint";
|
|
9
|
+
const PasswordWithLabel = ({ defaultValue, onValueChange = emptyFn, validationState, name = generateGuid(), size = ElementSize.Normal, style, rounded = false, loading = false, autoFocus = false, disabled = false, canShowPassword = false, label, placeholder, showPasswordIconTitle = "Show password", className, title, data, hint, }) => {
|
|
10
|
+
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
11
|
+
const [contentIsHidden, setContentIsHidden] = useState(true);
|
|
12
|
+
const onIconClick = useCallback(() => setContentIsHidden(state => !state), [setContentIsHidden]);
|
|
13
|
+
const elSizeClassName = size === ElementSize.Normal ? "" : "is-{0}".format(size);
|
|
14
|
+
const elClassName = getClassName([
|
|
15
|
+
"bbr-password",
|
|
16
|
+
className,
|
|
17
|
+
elSizeClassName,
|
|
18
|
+
rounded ? "is-rounded" : "",
|
|
19
|
+
getStyleClassName(style, validationState),
|
|
20
|
+
"input",
|
|
21
|
+
]);
|
|
22
|
+
const inputContainerClassName = getClassName([
|
|
23
|
+
"control",
|
|
24
|
+
loading ? "is-loading" : "",
|
|
25
|
+
canShowPassword ? "has-icons-right" : "",
|
|
26
|
+
"bbr-password__wrapper",
|
|
27
|
+
]);
|
|
28
|
+
const dataAttributes = isNullOrUndefined(data)
|
|
29
|
+
? undefined
|
|
30
|
+
: mapDataAttributes(data);
|
|
31
|
+
return (_jsxs(ComponentWithLabel, { id: name, size: size, label: label, children: [_jsxs("div", { className: inputContainerClassName, children: [_jsx("input", { type: contentIsHidden ? "password" : "text", id: name, name: name, disabled: disabled, onChange: onChange, autoFocus: autoFocus, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }), !!canShowPassword && !loading &&
|
|
32
|
+
_jsx("span", { onClick: onIconClick, title: showPasswordIconTitle, className: `icon is-right ${elSizeClassName}`, children: _jsx(Icon, { size: size, name: contentIsHidden ? "eye" : "eye-slash" }) })] }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
33
|
+
};
|
|
34
|
+
export default PasswordWithLabel;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PasswordProps } from "../..";
|
|
2
|
-
declare const PasswordWithoutLabel: ({ defaultValue, onValueChange, disabled, validationState, name, size, style, rounded, loading, autoFocus, placeholder, canShowPassword, showPasswordIconTitle, className, title, data, hint, }: PasswordProps) => JSX.Element;
|
|
3
|
-
export default PasswordWithoutLabel;
|
|
1
|
+
import { PasswordProps } from "../..";
|
|
2
|
+
declare const PasswordWithoutLabel: ({ defaultValue, onValueChange, disabled, validationState, name, size, style, rounded, loading, autoFocus, placeholder, canShowPassword, showPasswordIconTitle, className, title, data, hint, }: PasswordProps) => JSX.Element;
|
|
3
|
+
export default PasswordWithoutLabel;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withoutLabel/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,QAAA,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withoutLabel/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,QAAA,MAAM,oBAAoB,GAAI,gMAW3B,aAAa,KAAG,GAAG,CAAC,OAsEtB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useState } from "react";
|
|
3
|
-
import { generateGuid, getClassName, isNullOrUndefined } from "@bodynarf/utils";
|
|
4
|
-
import { ElementSize } from "../../../../../types";
|
|
5
|
-
import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
6
|
-
import Icon from "../../../../icon";
|
|
7
|
-
import InternalHint from "../../../internal/hint";
|
|
8
|
-
const PasswordWithoutLabel = ({ defaultValue, onValueChange, disabled, validationState, name = generateGuid(), size = ElementSize.Normal, style, rounded = false, loading = false, autoFocus = false, placeholder, canShowPassword = false, showPasswordIconTitle = "Show password", className, title, data, hint, }) => {
|
|
9
|
-
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
10
|
-
const [contentIsHidden, setContentIsHidden] = useState(true);
|
|
11
|
-
const onIconClick = useCallback(() => setContentIsHidden(state => !state), [setContentIsHidden]);
|
|
12
|
-
const elSizeClassName = size === ElementSize.Normal ? "" : "is-{0}".format(size);
|
|
13
|
-
const elClassName = getClassName([
|
|
14
|
-
"bbr-password",
|
|
15
|
-
className,
|
|
16
|
-
elSizeClassName,
|
|
17
|
-
rounded ? "is-rounded" : "",
|
|
18
|
-
getStyleClassName(style, validationState),
|
|
19
|
-
"input",
|
|
20
|
-
]);
|
|
21
|
-
const containerClassName = getClassName([
|
|
22
|
-
"control",
|
|
23
|
-
"bbr-input",
|
|
24
|
-
loading ? "is-loading" : "",
|
|
25
|
-
canShowPassword ? "has-icons-right" : "",
|
|
26
|
-
"bbr-password__wrapper",
|
|
27
|
-
]);
|
|
28
|
-
const dataAttributes = isNullOrUndefined(data)
|
|
29
|
-
? undefined
|
|
30
|
-
: mapDataAttributes(data);
|
|
31
|
-
return (_jsxs("div", { className: "bbr-field field", children: [_jsxs("div", { className: containerClassName, children: [_jsx("input", { type: contentIsHidden ? "password" : "text", id: name, name: name, disabled: disabled, onChange: onChange, autoFocus: autoFocus, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }), canShowPassword && !loading &&
|
|
32
|
-
_jsx("span", { onClick: onIconClick, title: showPasswordIconTitle, className: `icon is-right ${elSizeClassName}`, children: _jsx(Icon, { name: contentIsHidden ? "eye" : "eye-slash"
|
|
33
|
-
};
|
|
34
|
-
export default PasswordWithoutLabel;
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { emptyFn, generateGuid, getClassName, isNullOrUndefined } from "@bodynarf/utils";
|
|
4
|
+
import { ElementSize } from "../../../../../types";
|
|
5
|
+
import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
6
|
+
import Icon from "../../../../icon";
|
|
7
|
+
import InternalHint from "../../../internal/hint";
|
|
8
|
+
const PasswordWithoutLabel = ({ defaultValue, onValueChange = emptyFn, disabled, validationState, name = generateGuid(), size = ElementSize.Normal, style, rounded = false, loading = false, autoFocus = false, placeholder, canShowPassword = false, showPasswordIconTitle = "Show password", className, title, data, hint, }) => {
|
|
9
|
+
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
10
|
+
const [contentIsHidden, setContentIsHidden] = useState(true);
|
|
11
|
+
const onIconClick = useCallback(() => setContentIsHidden(state => !state), [setContentIsHidden]);
|
|
12
|
+
const elSizeClassName = size === ElementSize.Normal ? "" : "is-{0}".format(size);
|
|
13
|
+
const elClassName = getClassName([
|
|
14
|
+
"bbr-password",
|
|
15
|
+
className,
|
|
16
|
+
elSizeClassName,
|
|
17
|
+
rounded ? "is-rounded" : "",
|
|
18
|
+
getStyleClassName(style, validationState),
|
|
19
|
+
"input",
|
|
20
|
+
]);
|
|
21
|
+
const containerClassName = getClassName([
|
|
22
|
+
"control",
|
|
23
|
+
"bbr-input",
|
|
24
|
+
loading ? "is-loading" : "",
|
|
25
|
+
canShowPassword ? "has-icons-right" : "",
|
|
26
|
+
"bbr-password__wrapper",
|
|
27
|
+
]);
|
|
28
|
+
const dataAttributes = isNullOrUndefined(data)
|
|
29
|
+
? undefined
|
|
30
|
+
: mapDataAttributes(data);
|
|
31
|
+
return (_jsxs("div", { className: "bbr-field field", children: [_jsxs("div", { className: containerClassName, children: [_jsx("input", { type: contentIsHidden ? "password" : "text", id: name, name: name, disabled: disabled, onChange: onChange, autoFocus: autoFocus, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }), !!canShowPassword && !loading &&
|
|
32
|
+
_jsx("span", { onClick: onIconClick, title: showPasswordIconTitle, className: `icon is-right ${elSizeClassName}`, children: _jsx(Icon, { size: size, name: contentIsHidden ? "eye" : "eye-slash" }) })] }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
33
|
+
};
|
|
34
|
+
export default PasswordWithoutLabel;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default } from "./component";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export { default } from "./component";
|
|
2
|
+
export * from "./types";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from "./component";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export { default } from "./component";
|
|
2
|
+
export * from "./types";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/** Password component props type */
|
|
3
|
-
export interface PasswordProps extends Omit<
|
|
4
|
-
/**
|
|
5
|
-
* Is clickable icon "Show password" visible.
|
|
6
|
-
* Will show password on click
|
|
7
|
-
*/
|
|
8
|
-
canShowPassword?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Title for slow password icon
|
|
11
|
-
* @default "Show password"
|
|
12
|
-
*/
|
|
13
|
-
showPasswordIconTitle?: string;
|
|
14
|
-
}
|
|
1
|
+
import { BaseNotNullableInputElementProps } from "../../../types";
|
|
2
|
+
/** Password component props type */
|
|
3
|
+
export interface PasswordProps extends Omit<BaseNotNullableInputElementProps<string>, "readonly"> {
|
|
4
|
+
/**
|
|
5
|
+
* Is clickable icon "Show password" visible.
|
|
6
|
+
* Will show password on click
|
|
7
|
+
*/
|
|
8
|
+
canShowPassword?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Title for slow password icon
|
|
11
|
+
* @default "Show password"
|
|
12
|
+
*/
|
|
13
|
+
showPasswordIconTitle?: string;
|
|
14
|
+
}
|
|
15
15
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/password/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/password/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,YAAY,CAAC;AAE9D,oCAAoC;AACpC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,gCAAgC,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC7F;;;MAGE;IACF,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAClC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default Text;
|
|
1
|
+
import { TextProps } from "..";
|
|
2
|
+
/** Textual input component */
|
|
3
|
+
declare const Text: (props: TextProps) => JSX.Element;
|
|
4
|
+
export default Text;
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/text/component/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/text/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAI/B,8BAA8B;AAC9B,QAAA,MAAM,IAAI,GAAI,OAAO,SAAS,KAAG,GAAG,CAAC,OAIpC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { isNullOrUndefined } from "@bodynarf/utils";
|
|
3
|
-
import TextWithLabel from "../components/withLabel";
|
|
4
|
-
import TextWithoutLabel from "../components/withoutLabel";
|
|
5
|
-
/** Textual input component */
|
|
6
|
-
const Text = (props) => {
|
|
7
|
-
return isNullOrUndefined(props.label)
|
|
8
|
-
? _jsx(TextWithoutLabel, { ...props })
|
|
9
|
-
: _jsx(TextWithLabel, { ...props });
|
|
10
|
-
};
|
|
11
|
-
export default Text;
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isNullOrUndefined } from "@bodynarf/utils";
|
|
3
|
+
import TextWithLabel from "../components/withLabel";
|
|
4
|
+
import TextWithoutLabel from "../components/withoutLabel";
|
|
5
|
+
/** Textual input component */
|
|
6
|
+
const Text = (props) => {
|
|
7
|
+
return isNullOrUndefined(props.label)
|
|
8
|
+
? _jsx(TextWithoutLabel, { ...props })
|
|
9
|
+
: _jsx(TextWithLabel, { ...props });
|
|
10
|
+
};
|
|
11
|
+
export default Text;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default TextWithLabel;
|
|
1
|
+
import { TextProps } from "../..";
|
|
2
|
+
/** Textual input with describing label */
|
|
3
|
+
declare const TextWithLabel: ({ onValueChange, readonly, disabled, defaultValue, validationState, name, size, style, rounded, loading, autoFocus, label, placeholder, onBlur, className, title, data, hint, }: TextProps) => JSX.Element;
|
|
4
|
+
export default TextWithLabel;
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/withLabel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/withLabel/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,0CAA0C;AAC1C,QAAA,MAAM,aAAa,GAAI,iLAUpB,SAAS,KAAG,GAAG,CAAC,OAsDlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|