@bodynarf/react.components 1.8.22 → 1.9.1
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/bodynarf-react.components-1.9.3.tgz +0 -0
- package/common.scss +3 -2
- package/components/accordion/component/index.d.ts +2 -3
- package/components/accordion/component/index.d.ts.map +1 -1
- package/components/accordion/component/index.js +4 -4
- package/components/accordion/types.d.ts +1 -1
- package/components/accordion/types.d.ts.map +1 -1
- package/components/anchor/component/index.d.ts +1 -1
- package/components/anchor/component/index.d.ts.map +1 -1
- package/components/anchor/component/index.js +6 -6
- package/components/anchor/components/anchorWithIcon/index.d.ts +3 -3
- package/components/anchor/components/anchorWithIcon/index.d.ts.map +1 -1
- package/components/anchor/components/anchorWithIcon/index.js +14 -9
- package/components/anchor/components/simpleAnchor/index.d.ts +3 -3
- package/components/anchor/components/simpleAnchor/index.d.ts.map +1 -1
- package/components/anchor/components/simpleAnchor/index.js +8 -2
- package/components/anchor/types.d.ts +2 -6
- package/components/anchor/types.d.ts.map +1 -1
- package/components/breadcrumbs/component/index.d.ts +34 -0
- package/components/breadcrumbs/component/index.d.ts.map +1 -0
- package/components/breadcrumbs/component/index.js +21 -0
- package/components/breadcrumbs/index.d.ts +3 -0
- package/components/breadcrumbs/index.d.ts.map +1 -0
- package/components/breadcrumbs/index.js +2 -0
- package/components/breadcrumbs/types.d.ts +13 -0
- package/components/breadcrumbs/types.d.ts.map +1 -0
- package/components/button/component/index.d.ts +1 -1
- package/components/button/component/index.d.ts.map +1 -1
- package/components/button/component/index.js +4 -8
- package/components/button/components/buttonWithIcon/index.d.ts +3 -2
- package/components/button/components/buttonWithIcon/index.d.ts.map +1 -1
- package/components/button/components/buttonWithIcon/index.js +14 -9
- package/components/button/components/simpleButton/index.d.ts +3 -2
- package/components/button/components/simpleButton/index.d.ts.map +1 -1
- package/components/button/components/simpleButton/index.js +8 -2
- package/components/button/types.d.ts +1 -1
- package/components/button/types.d.ts.map +1 -1
- package/components/button/types.js +0 -3
- package/components/dropdown/component/index.d.ts +1 -1
- package/components/dropdown/component/index.d.ts.map +1 -1
- package/components/dropdown/component/index.js +5 -8
- package/components/dropdown/component/style.scss +5 -1
- package/components/dropdown/components/compact/index.d.ts +2 -3
- package/components/dropdown/components/compact/index.d.ts.map +1 -1
- package/components/dropdown/components/compact/index.js +12 -9
- package/components/dropdown/components/item/index.d.ts +1 -1
- package/components/dropdown/components/item/index.d.ts.map +1 -1
- package/components/dropdown/components/item/index.js +34 -2
- package/components/dropdown/components/label/component/index.d.ts +27 -0
- package/components/dropdown/components/label/component/index.d.ts.map +1 -0
- package/components/dropdown/components/label/component/index.js +16 -0
- package/components/dropdown/components/label/components/empty/index.d.ts +8 -0
- package/components/dropdown/components/label/components/empty/index.d.ts.map +1 -0
- package/components/dropdown/components/label/components/empty/index.js +16 -0
- package/components/dropdown/components/label/components/selected/index.d.ts +8 -0
- package/components/dropdown/components/label/components/selected/index.d.ts.map +1 -0
- package/components/dropdown/components/label/components/selected/index.js +20 -0
- package/components/dropdown/components/label/components/selectedWithIcon/index.d.ts +8 -0
- package/components/dropdown/components/label/components/selectedWithIcon/index.d.ts.map +1 -0
- package/components/dropdown/components/label/components/selectedWithIcon/index.js +28 -0
- package/components/dropdown/components/label/components/withSearch/index.d.ts +16 -0
- package/components/dropdown/components/label/components/withSearch/index.d.ts.map +1 -0
- package/components/dropdown/components/label/components/withSearch/index.js +33 -0
- package/components/dropdown/components/label/components/withSearch/style.scss +29 -0
- package/components/dropdown/components/label/index.d.ts +1 -1
- package/components/dropdown/components/label/index.d.ts.map +1 -1
- package/components/dropdown/components/label/index.js +41 -9
- package/components/dropdown/components/withLabel/index.d.ts +2 -3
- package/components/dropdown/components/withLabel/index.d.ts.map +1 -1
- package/components/dropdown/components/withLabel/index.js +14 -12
- package/components/dropdown/types.d.ts +13 -2
- package/components/dropdown/types.d.ts.map +1 -1
- package/components/icon/component/index.d.ts +2 -2
- package/components/icon/component/index.d.ts.map +1 -1
- package/components/icon/component/index.js +9 -5
- package/components/icon/types.d.ts +2 -4
- package/components/icon/types.d.ts.map +1 -1
- package/components/index.d.ts +0 -1
- package/components/index.d.ts.map +1 -1
- package/components/index.js +0 -1
- package/components/paginator/component/index.d.ts +2 -2
- package/components/paginator/component/index.d.ts.map +1 -1
- package/components/paginator/component/index.js +19 -14
- package/components/paginator/types.d.ts +3 -5
- package/components/paginator/types.d.ts.map +1 -1
- package/components/primitives/checkbox/component/index.d.ts +2 -3
- package/components/primitives/checkbox/component/index.d.ts.map +1 -1
- package/components/primitives/checkbox/component/index.js +15 -17
- package/components/primitives/checkbox/types.d.ts +2 -2
- package/components/primitives/checkbox/types.d.ts.map +1 -1
- package/components/primitives/color/component/index.d.ts.map +1 -1
- package/components/primitives/color/components/picker/index.d.ts +11 -29
- package/components/primitives/color/components/picker/index.d.ts.map +1 -1
- package/components/primitives/color/components/picker/index.js +15 -12
- package/components/primitives/color/components/withLabel/index.d.ts +1 -1
- package/components/primitives/color/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/color/components/withLabel/index.js +8 -30
- package/components/primitives/color/components/withoutLabel/index.d.ts +1 -1
- package/components/primitives/color/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/color/components/withoutLabel/index.js +3 -13
- package/components/primitives/color/types.d.ts +1 -1
- package/components/primitives/color/types.d.ts.map +1 -1
- package/components/primitives/date/component/index.d.ts +2 -3
- package/components/primitives/date/component/index.d.ts.map +1 -1
- package/components/primitives/date/component/index.js +12 -27
- package/components/primitives/date/types.d.ts +2 -2
- package/components/primitives/date/types.d.ts.map +1 -1
- package/components/primitives/index.d.ts +0 -1
- package/components/primitives/index.d.ts.map +1 -1
- package/components/primitives/index.js +0 -1
- package/components/primitives/internal/componentWithLabel/index.d.ts +17 -0
- package/components/primitives/internal/componentWithLabel/index.d.ts.map +1 -0
- package/components/primitives/internal/componentWithLabel/index.js +26 -0
- package/components/primitives/internal/hint/index.d.ts +12 -0
- package/components/primitives/internal/hint/index.d.ts.map +1 -0
- package/components/primitives/internal/hint/index.js +47 -0
- package/components/primitives/multiline/component/index.d.ts +1 -1
- package/components/primitives/multiline/component/index.d.ts.map +1 -1
- package/components/primitives/multiline/component/index.js +5 -8
- package/components/primitives/multiline/components/withLabel/index.d.ts +5 -0
- package/components/primitives/multiline/components/withLabel/index.d.ts.map +1 -0
- package/components/primitives/multiline/components/withLabel/index.js +29 -0
- package/components/primitives/multiline/components/withoutLabel/index.d.ts +5 -0
- package/components/primitives/multiline/components/withoutLabel/index.d.ts.map +1 -0
- package/components/primitives/multiline/components/withoutLabel/index.js +28 -0
- package/components/primitives/multiline/types.d.ts +1 -1
- package/components/primitives/multiline/types.d.ts.map +1 -1
- package/components/primitives/number/component/index.d.ts +1 -1
- package/components/primitives/number/component/index.d.ts.map +1 -1
- package/components/primitives/number/component/index.js +5 -8
- package/components/primitives/number/components/withLabel/index.d.ts +2 -3
- package/components/primitives/number/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/number/components/withLabel/index.js +12 -27
- package/components/primitives/number/components/withoutLabel/index.d.ts +2 -3
- package/components/primitives/number/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/number/components/withoutLabel/index.js +11 -9
- package/components/primitives/number/types.d.ts +1 -1
- package/components/primitives/number/types.d.ts.map +1 -1
- package/components/primitives/password/component/index.d.ts +1 -1
- package/components/primitives/password/component/index.d.ts.map +1 -1
- package/components/primitives/password/component/index.js +5 -6
- package/components/primitives/password/components/withLabel/index.d.ts +2 -3
- package/components/primitives/password/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/password/components/withLabel/index.js +14 -30
- package/components/primitives/password/components/withoutLabel/index.d.ts +2 -3
- package/components/primitives/password/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/password/components/withoutLabel/index.js +13 -11
- package/components/primitives/password/types.d.ts +1 -1
- package/components/primitives/password/types.d.ts.map +1 -1
- package/components/primitives/text/component/index.d.ts +1 -1
- package/components/primitives/text/component/index.d.ts.map +1 -1
- package/components/primitives/text/component/index.js +5 -8
- package/components/primitives/text/components/withLabel/index.d.ts +5 -0
- package/components/primitives/text/components/withLabel/index.d.ts.map +1 -0
- package/components/primitives/text/components/withLabel/index.js +29 -0
- package/components/primitives/text/components/withoutLabel/index.d.ts +5 -0
- package/components/primitives/text/components/withoutLabel/index.d.ts.map +1 -0
- package/components/primitives/text/components/withoutLabel/index.js +28 -0
- package/components/primitives/text/types.d.ts +1 -1
- package/components/primitives/text/types.d.ts.map +1 -1
- package/components/search/component/index.d.ts +2 -2
- package/components/search/component/index.d.ts.map +1 -1
- package/components/search/component/index.js +16 -10
- package/components/search/types.d.ts +2 -2
- package/components/search/types.d.ts.map +1 -1
- package/components/table/component/index.d.ts +44 -0
- package/components/table/component/index.d.ts.map +1 -0
- package/components/table/component/index.js +29 -0
- package/components/table/component/style.scss +21 -0
- package/components/table/components/heading/index.d.ts +13 -0
- package/components/table/components/heading/index.d.ts.map +1 -0
- package/components/table/components/heading/index.js +21 -0
- package/components/table/index.d.ts +3 -0
- package/components/table/index.d.ts.map +1 -0
- package/components/table/index.js +2 -0
- package/components/table/types.d.ts +18 -0
- package/components/table/types.d.ts.map +1 -0
- package/components/tabs/component/index.d.ts +3 -4
- package/components/tabs/component/index.d.ts.map +1 -1
- package/components/tabs/component/index.js +14 -8
- package/components/tabs/components/item/index.d.ts +1 -1
- package/components/tabs/components/item/index.d.ts.map +1 -1
- package/components/tabs/components/item/index.js +4 -3
- package/components/tabs/types.d.ts +1 -12
- package/components/tabs/types.d.ts.map +1 -1
- package/components/tabs/types.js +0 -12
- package/components/tag/component/index.d.ts +2 -3
- package/components/tag/component/index.d.ts.map +1 -1
- package/components/tag/component/index.js +13 -7
- package/components/tag/types.d.ts +1 -1
- package/components/tag/types.d.ts.map +1 -1
- package/hooks/usePagination.d.ts.map +1 -1
- package/hooks/usePagination.js +11 -2
- package/hooks/useUnmount.d.ts +8 -0
- package/hooks/useUnmount.d.ts.map +1 -0
- package/hooks/useUnmount.js +22 -0
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -0
- package/package.json +11 -4
- package/readme.md +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/types/baseElementProps.d.ts +11 -0
- package/types/baseElementProps.d.ts.map +1 -0
- package/types/baseElementProps.js +1 -0
- package/{components/primitives/types/baseProps.d.ts → types/baseInputElementProps.d.ts} +10 -4
- package/types/baseInputElementProps.d.ts.map +1 -0
- package/types/baseInputElementProps.js +1 -0
- package/types/dataAttributes.d.ts +9 -0
- package/types/dataAttributes.d.ts.map +1 -0
- package/types/dataAttributes.js +1 -0
- package/types/elementColor.d.ts +18 -0
- package/types/elementColor.d.ts.map +1 -0
- package/types/elementColor.js +18 -0
- package/types/elementIcon.d.ts +22 -0
- package/types/elementIcon.d.ts.map +1 -0
- package/types/elementIcon.js +1 -0
- package/types/elementPosition.d.ts +12 -0
- package/types/elementPosition.d.ts.map +1 -0
- package/types/elementPosition.js +10 -0
- package/types/elementSize.d.ts +12 -0
- package/types/elementSize.d.ts.map +1 -0
- package/types/elementSize.js +12 -0
- package/types/hintConfiguration.d.ts +13 -0
- package/types/hintConfiguration.d.ts.map +1 -0
- package/types/hintConfiguration.js +1 -0
- package/types/index.d.ts +11 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.js +10 -0
- package/{components/primitives/types/label.d.ts → types/labelConfiguration.d.ts} +3 -3
- package/types/labelConfiguration.d.ts.map +1 -0
- package/types/labelConfiguration.js +1 -0
- package/{components/primitives/types → types}/validation/index.d.ts +1 -1
- package/types/validation/index.d.ts.map +1 -0
- package/{components/primitives/types → types}/validation/index.js +1 -1
- package/{components/primitives/types → types}/validation/state.d.ts +2 -2
- package/types/validation/state.d.ts.map +1 -0
- package/{components/primitives/types → types}/validation/state.js +0 -1
- package/{components/primitives/types → types}/validation/status.d.ts +1 -1
- package/types/validation/status.d.ts.map +1 -0
- package/{components/primitives/types → types}/validation/status.js +1 -2
- package/utils/dataAttributes.d.ts +1 -1
- package/utils/dataAttributes.d.ts.map +1 -1
- package/utils/index.d.ts +1 -1
- package/utils/index.d.ts.map +1 -1
- package/utils/index.js +1 -1
- package/utils/validation.d.ts +11 -0
- package/utils/validation.d.ts.map +1 -0
- package/utils/validation.js +20 -0
- package/components/primitives/multiline/components/multilineWithLabel/index.d.ts +0 -6
- package/components/primitives/multiline/components/multilineWithLabel/index.d.ts.map +0 -1
- package/components/primitives/multiline/components/multilineWithLabel/index.js +0 -44
- package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts +0 -6
- package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts.map +0 -1
- package/components/primitives/multiline/components/multilineWithoutLabel/index.js +0 -26
- package/components/primitives/text/components/textWithLabel/index.d.ts +0 -6
- package/components/primitives/text/components/textWithLabel/index.d.ts.map +0 -1
- package/components/primitives/text/components/textWithLabel/index.js +0 -44
- package/components/primitives/text/components/textWithoutLabel/index.d.ts +0 -6
- package/components/primitives/text/components/textWithoutLabel/index.d.ts.map +0 -1
- package/components/primitives/text/components/textWithoutLabel/index.js +0 -26
- package/components/primitives/types/baseProps.d.ts.map +0 -1
- package/components/primitives/types/index.d.ts +0 -4
- package/components/primitives/types/index.d.ts.map +0 -1
- package/components/primitives/types/index.js +0 -3
- package/components/primitives/types/label.d.ts.map +0 -1
- package/components/primitives/types/validation/index.d.ts.map +0 -1
- package/components/primitives/types/validation/state.d.ts.map +0 -1
- package/components/primitives/types/validation/status.d.ts.map +0 -1
- package/components/types.d.ts +0 -78
- package/components/types.d.ts.map +0 -1
- package/components/types.js +0 -41
- package/utils/formValidation.d.ts +0 -16
- package/utils/formValidation.d.ts.map +0 -1
- package/utils/formValidation.js +0 -35
- /package/components/{primitives/types/baseProps.js → breadcrumbs/types.js} +0 -0
- /package/components/{primitives/types/label.js → table/types.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./baseElementProps";
|
|
2
|
+
export * from "./baseInputElementProps";
|
|
3
|
+
export * from "./dataAttributes";
|
|
4
|
+
export * from "./elementColor";
|
|
5
|
+
export * from "./elementIcon";
|
|
6
|
+
export * from "./elementPosition";
|
|
7
|
+
export * from "./elementSize";
|
|
8
|
+
export * from "./hintConfiguration";
|
|
9
|
+
export * from "./labelConfiguration";
|
|
10
|
+
export * from "./validation";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AAErC,cAAc,cAAc,CAAC"}
|
package/types/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./baseElementProps";
|
|
2
|
+
export * from "./baseInputElementProps";
|
|
3
|
+
export * from "./dataAttributes";
|
|
4
|
+
export * from "./elementColor";
|
|
5
|
+
export * from "./elementIcon";
|
|
6
|
+
export * from "./elementPosition";
|
|
7
|
+
export * from "./elementSize";
|
|
8
|
+
export * from "./hintConfiguration";
|
|
9
|
+
export * from "./labelConfiguration";
|
|
10
|
+
export * from "./validation";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export interface
|
|
1
|
+
/** Element label configuration */
|
|
2
|
+
export interface LabelConfiguration {
|
|
3
3
|
/** Label textual content to describe input requirements */
|
|
4
4
|
caption: string;
|
|
5
5
|
/** Should component be on same line with label */
|
|
@@ -11,4 +11,4 @@ export interface InputLabel {
|
|
|
11
11
|
/** Class name for input parent container in horizontal mode */
|
|
12
12
|
horizontalFieldContainerClassName?: string;
|
|
13
13
|
}
|
|
14
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=labelConfiguration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labelConfiguration.d.ts","sourceRoot":"","sources":["../../src/types/labelConfiguration.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,MAAM,WAAW,kBAAkB;IAC/B,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAEhB,kDAAkD;IAClD,UAAU,EAAE,OAAO,CAAC;IAEpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,+DAA+D;IAC/D,4BAA4B,CAAC,EAAE,MAAM,CAAC;IAEtC,+DAA+D;IAC/D,iCAAiC,CAAC,EAAE,MAAM,CAAC;CAC9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/validation/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/types/validation/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAErC,uCAAuC;AACvC,MAAM,WAAW,eAAe;IAC5B,qBAAqB;IACrB,MAAM,EAAE,gBAAgB,CAAC;IAEzB,8BAA8B;IAC9B,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/types/validation/status.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,oBAAY,gBAAgB;IACxB,uCAAuC;IACvC,IAAI,SAAS;IAEb,qBAAqB;IACrB,KAAK,UAAU;IAEf,gDAAgD;IAChD,OAAO,YAAY;CACtB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Component value validation status */
|
|
2
2
|
export var ValidationStatus;
|
|
3
3
|
(function (ValidationStatus) {
|
|
4
4
|
/** Validation wasn"t been performed */
|
|
@@ -8,4 +8,3 @@ export var ValidationStatus;
|
|
|
8
8
|
/** Value is invalid due some validator check */
|
|
9
9
|
ValidationStatus["Invalid"] = "invalid";
|
|
10
10
|
})(ValidationStatus || (ValidationStatus = {}));
|
|
11
|
-
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataAttributes.d.ts","sourceRoot":"","sources":["../../src/utils/dataAttributes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"dataAttributes.d.ts","sourceRoot":"","sources":["../../src/utils/dataAttributes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,mBAAoB,cAAc,KAAG,MAgBlE,CAAC"}
|
package/utils/index.d.ts
CHANGED
package/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
|
package/utils/index.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ElementColor, ValidationState } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Get className component prop based on current validation state and style
|
|
4
|
+
*
|
|
5
|
+
* (!) Validation className has priority
|
|
6
|
+
* @param style Element style
|
|
7
|
+
* @param validationState Current validation state
|
|
8
|
+
* @returns Style className
|
|
9
|
+
*/
|
|
10
|
+
export declare const getStyleClassName: (style?: ElementColor, validationState?: ValidationState) => string;
|
|
11
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAoB,MAAM,YAAY,CAAC;AAE7E;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,WAClB,YAAY,oBACF,eAAe,KAClC,MAUF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { isNullOrUndefined } from "@bodynarf/utils";
|
|
2
|
+
import { ValidationStatus } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Get className component prop based on current validation state and style
|
|
5
|
+
*
|
|
6
|
+
* (!) Validation className has priority
|
|
7
|
+
* @param style Element style
|
|
8
|
+
* @param validationState Current validation state
|
|
9
|
+
* @returns Style className
|
|
10
|
+
*/
|
|
11
|
+
export const getStyleClassName = (style, validationState) => {
|
|
12
|
+
if (isNullOrUndefined(validationState) || validationState.status === ValidationStatus.None) {
|
|
13
|
+
return isNullOrUndefined(style)
|
|
14
|
+
? ""
|
|
15
|
+
: `is-${style}`;
|
|
16
|
+
}
|
|
17
|
+
return validationState.status === ValidationStatus.Invalid
|
|
18
|
+
? "is-danger"
|
|
19
|
+
: "is-success";
|
|
20
|
+
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { MultilineProps } from "../../../multiline";
|
|
3
|
-
/** Multiline textual input component with describing label */
|
|
4
|
-
declare const MultilineWithLabel: ({ defaultValue, onValueChange, validationState, readonly, disabled, name, className, size, style, loading, label, placeholder, fixed, rows, onBlur }: MultilineProps) => JSX.Element;
|
|
5
|
-
export default MultilineWithLabel;
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/multiline/components/multilineWithLabel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,8DAA8D;AAC9D,QAAA,MAAM,kBAAkB,yJAOrB,cAAc,KAAG,WAwGnB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
4
|
-
import { ElementSize } from "../../../..";
|
|
5
|
-
import { getValidationValues } from "../../../../../utils";
|
|
6
|
-
/** Multiline textual input component with describing label */
|
|
7
|
-
const MultilineWithLabel = ({ defaultValue, onValueChange, validationState, readonly, disabled, name, className, size, style, loading = false, label, placeholder, fixed = false, rows, onBlur }) => {
|
|
8
|
-
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
|
-
const id = name || generateGuid();
|
|
10
|
-
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, ElementSize.Normal));
|
|
11
|
-
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
12
|
-
const elClassName = getClassName([
|
|
13
|
-
className,
|
|
14
|
-
elSizeClassName,
|
|
15
|
-
styleClassName,
|
|
16
|
-
"textarea",
|
|
17
|
-
fixed ? "has-fixed-size" : "",
|
|
18
|
-
]);
|
|
19
|
-
const inputContainerClassName = getClassName([
|
|
20
|
-
"control",
|
|
21
|
-
loading ? "is-loading" : "",
|
|
22
|
-
]);
|
|
23
|
-
const labelClassName = getClassName([
|
|
24
|
-
"label",
|
|
25
|
-
!label.horizontal ? elSizeClassName : "",
|
|
26
|
-
label.className
|
|
27
|
-
]);
|
|
28
|
-
if (label.horizontal) {
|
|
29
|
-
const labelContainerClassName = getClassName([
|
|
30
|
-
"field-label",
|
|
31
|
-
elSizeClassName,
|
|
32
|
-
label.horizontalContainerClassName
|
|
33
|
-
]);
|
|
34
|
-
const fieldContainerClassName = getClassName([
|
|
35
|
-
"field-body",
|
|
36
|
-
label.horizontalFieldContainerClassName
|
|
37
|
-
]);
|
|
38
|
-
return (_jsxs("div", { className: "bbr-input field is-horizontal", children: [_jsx("div", { className: labelContainerClassName, children: _jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }) }), _jsx("div", { className: fieldContainerClassName, children: _jsxs("div", { className: "field", children: [_jsx("div", { className: inputContainerClassName, children: _jsx("textarea", { className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id, rows: rows }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
39
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }) })] }));
|
|
40
|
-
}
|
|
41
|
-
return (_jsxs("div", { className: "bbr-input field", children: [_jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }), _jsx("div", { className: inputContainerClassName, children: _jsx("textarea", { className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id, rows: rows }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
42
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
43
|
-
};
|
|
44
|
-
export default MultilineWithLabel;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { MultilineProps } from "../../../multiline";
|
|
3
|
-
/** Multiline textual input component without describing label*/
|
|
4
|
-
declare const MultilineWithoutLabel: ({ onValueChange, defaultValue, validationState, name, placeholder, onBlur, className, size, style, loading, fixed, rows, }: MultilineProps) => JSX.Element;
|
|
5
|
-
export default MultilineWithoutLabel;
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/multiline/components/multilineWithoutLabel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,gEAAgE;AAChE,QAAA,MAAM,qBAAqB,+HAMxB,cAAc,KAAG,WA0CnB,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
4
|
-
import { ElementSize } from "../../../..";
|
|
5
|
-
import { getValidationValues } from "../../../../../utils";
|
|
6
|
-
/** Multiline textual input component without describing label*/
|
|
7
|
-
const MultilineWithoutLabel = ({ onValueChange, defaultValue, validationState, name, placeholder, onBlur, className, size, style, loading = false, fixed = false, rows, }) => {
|
|
8
|
-
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
|
-
const id = name || generateGuid();
|
|
10
|
-
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
11
|
-
const elClassName = getClassName([
|
|
12
|
-
className,
|
|
13
|
-
"is-{0}".format(getValueOrDefault(size, ElementSize.Normal)),
|
|
14
|
-
styleClassName,
|
|
15
|
-
"textarea",
|
|
16
|
-
fixed ? "has-fixed-size" : "",
|
|
17
|
-
]);
|
|
18
|
-
const inputContainerClassName = getClassName([
|
|
19
|
-
"control",
|
|
20
|
-
"bbr-input",
|
|
21
|
-
loading ? "is-loading" : "",
|
|
22
|
-
]);
|
|
23
|
-
return (_jsxs("div", { className: "field", children: [_jsx("div", { className: inputContainerClassName, children: _jsx("textarea", { className: elClassName, placeholder: placeholder, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, id: id, name: id, rows: rows }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
24
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
25
|
-
};
|
|
26
|
-
export default MultilineWithoutLabel;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { TextProps } from "../../../text";
|
|
3
|
-
/** Textual input with describing label */
|
|
4
|
-
declare const TextWithLabel: ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, label, placeholder, onBlur, }: TextProps) => JSX.Element;
|
|
5
|
-
export default TextWithLabel;
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/textWithLabel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,0CAA0C;AAC1C,QAAA,MAAM,aAAa,sJAOhB,SAAS,KAAG,WAwGd,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { generateGuid, getClassName, getValueOrDefault, } from "@bodynarf/utils";
|
|
4
|
-
import { ElementSize } from "../../../..";
|
|
5
|
-
import { getValidationValues } from "../../../../../utils";
|
|
6
|
-
/** Textual input with describing label */
|
|
7
|
-
const TextWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded = false, loading = false, label, placeholder, onBlur, }) => {
|
|
8
|
-
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
|
-
const id = name || generateGuid();
|
|
10
|
-
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, ElementSize.Normal));
|
|
11
|
-
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
12
|
-
const elClassName = getClassName([
|
|
13
|
-
className,
|
|
14
|
-
elSizeClassName,
|
|
15
|
-
rounded ? "is-rounded" : "",
|
|
16
|
-
styleClassName,
|
|
17
|
-
"input",
|
|
18
|
-
]);
|
|
19
|
-
const inputContainerClassName = getClassName([
|
|
20
|
-
"control",
|
|
21
|
-
loading ? "is-loading" : "",
|
|
22
|
-
]);
|
|
23
|
-
const labelClassName = getClassName([
|
|
24
|
-
"label",
|
|
25
|
-
!label.horizontal ? elSizeClassName : "",
|
|
26
|
-
label.className
|
|
27
|
-
]);
|
|
28
|
-
if (label.horizontal) {
|
|
29
|
-
const labelContainerClassName = getClassName([
|
|
30
|
-
"field-label",
|
|
31
|
-
elSizeClassName,
|
|
32
|
-
label.horizontalContainerClassName
|
|
33
|
-
]);
|
|
34
|
-
const fieldContainerClassName = getClassName([
|
|
35
|
-
"field-body",
|
|
36
|
-
label.horizontalFieldContainerClassName
|
|
37
|
-
]);
|
|
38
|
-
return (_jsxs("div", { className: "bbr-input field is-horizontal", children: [_jsx("div", { className: labelContainerClassName, children: _jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }) }), _jsx("div", { className: fieldContainerClassName, children: _jsxs("div", { className: "field", children: [_jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "text", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
39
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }) })] }));
|
|
40
|
-
}
|
|
41
|
-
return (_jsxs("div", { className: "bbr-input field", children: [_jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }), _jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "text", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
42
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
43
|
-
};
|
|
44
|
-
export default TextWithLabel;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { TextProps } from "../../../text";
|
|
3
|
-
/** Textual input without describing label */
|
|
4
|
-
declare const TextWithoutLabel: ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, placeholder, onBlur, }: TextProps) => JSX.Element;
|
|
5
|
-
export default TextWithoutLabel;
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/textWithoutLabel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,6CAA6C;AAC7C,QAAA,MAAM,gBAAgB,+IAOnB,SAAS,KAAG,WA6Cd,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
4
|
-
import { ElementSize } from "../../../..";
|
|
5
|
-
import { getValidationValues } from "../../../../../utils";
|
|
6
|
-
/** Textual input without describing label */
|
|
7
|
-
const TextWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded = false, loading = false, placeholder, onBlur, }) => {
|
|
8
|
-
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
|
-
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
10
|
-
const elClassName = getClassName([
|
|
11
|
-
className,
|
|
12
|
-
"is-{0}".format(getValueOrDefault(size, ElementSize.Normal)),
|
|
13
|
-
rounded ? "is-rounded" : "",
|
|
14
|
-
styleClassName,
|
|
15
|
-
"input",
|
|
16
|
-
]);
|
|
17
|
-
const containerClassName = getClassName([
|
|
18
|
-
"control",
|
|
19
|
-
"bbr-input",
|
|
20
|
-
loading ? "is-loading" : "",
|
|
21
|
-
]);
|
|
22
|
-
const id = name || generateGuid();
|
|
23
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: containerClassName, children: _jsx("input", { className: elClassName, type: "text", placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
24
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
25
|
-
};
|
|
26
|
-
export default TextWithoutLabel;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"baseProps.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/types/baseProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;AAEhD,2CAA2C;AAC3C,MAAM,WAAW,qBAAqB,CAAC,MAAM,CAAE,SAAQ,gBAAgB;IACnE,8EAA8E;IAC9E,aAAa,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAExC,sCAAsC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,uCAAuC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,qBAAqB;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB,iFAAiF;IACjF,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,+BAA+B;IAC/B,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/types/label.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,MAAM,WAAW,UAAU;IACvB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAEhB,kDAAkD;IAClD,UAAU,EAAE,OAAO,CAAC;IAEpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,+DAA+D;IAC/D,4BAA4B,CAAC,EAAE,MAAM,CAAC;IAEtC,+DAA+D;IAC/D,iCAAiC,CAAC,EAAE,MAAM,CAAC;CAC9C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/types/validation/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/types/validation/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,4CAA4C;AAC5C,MAAM,WAAW,eAAe;IAC5B,qBAAqB;IACrB,MAAM,EAAE,gBAAgB,CAAC;IAEzB,8BAA8B;IAC9B,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/types/validation/status.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,oBAAY,gBAAgB;IACxB,uCAAuC;IACvC,IAAI,SAAS;IAEb,qBAAqB;IACrB,KAAK,UAAU;IAEf,gDAAgD;IAChD,OAAO,YAAY;CACtB"}
|
package/components/types.d.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/** Base interface for component props */
|
|
2
|
-
export interface BaseElementProps {
|
|
3
|
-
/** Additional class names */
|
|
4
|
-
className?: string;
|
|
5
|
-
/** Title */
|
|
6
|
-
title?: string;
|
|
7
|
-
/** Extra data-* attributes */
|
|
8
|
-
data?: DataAttributes;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Html data-* attributes
|
|
12
|
-
* @description All keys with defined values will be mapped injected into html element as data-{key} attributes
|
|
13
|
-
*/
|
|
14
|
-
export interface DataAttributes {
|
|
15
|
-
/** Single data-* attribute value */
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}
|
|
18
|
-
/** Input component size variety */
|
|
19
|
-
export declare enum ElementSize {
|
|
20
|
-
/** Font size is 0.75rem */
|
|
21
|
-
Small = "small",
|
|
22
|
-
/** Font size is 1rem. Default */
|
|
23
|
-
Normal = "normal",
|
|
24
|
-
/** Font size is 1.25rem */
|
|
25
|
-
Medium = "medium",
|
|
26
|
-
/** Font size is 1.5rem */
|
|
27
|
-
Large = "large"
|
|
28
|
-
}
|
|
29
|
-
/** Input component border-color type */
|
|
30
|
-
export declare enum ElementColor {
|
|
31
|
-
/** color: transparent */
|
|
32
|
-
Default = "default",
|
|
33
|
-
/** color: seawave green */
|
|
34
|
-
Primary = "primary",
|
|
35
|
-
/** color: blue-violet */
|
|
36
|
-
Link = "link",
|
|
37
|
-
/** color: sky-blue */
|
|
38
|
-
Info = "info",
|
|
39
|
-
/** color: green */
|
|
40
|
-
Success = "success",
|
|
41
|
-
/** color: yellow */
|
|
42
|
-
Warning = "warning",
|
|
43
|
-
/** color: red */
|
|
44
|
-
Danger = "danger"
|
|
45
|
-
}
|
|
46
|
-
/** Position of element */
|
|
47
|
-
export declare enum ElementPosition {
|
|
48
|
-
/** Left aligned */
|
|
49
|
-
Left = "left",
|
|
50
|
-
/** Center aligned */
|
|
51
|
-
Center = "center",
|
|
52
|
-
/** Right aligned */
|
|
53
|
-
Right = "right"
|
|
54
|
-
}
|
|
55
|
-
/** Element position, but without center placement */
|
|
56
|
-
export declare type ElementFloatPosition = ElementPosition.Left | ElementPosition.Right;
|
|
57
|
-
/** Allowed icon position */
|
|
58
|
-
export declare type IconPosition = "left" | "right";
|
|
59
|
-
/** Icon for component */
|
|
60
|
-
export interface ElementIcon {
|
|
61
|
-
/**
|
|
62
|
-
* Icon name. Must be without `bi-`
|
|
63
|
-
* @example ["Arrow repeat", "arrow-repeat"]
|
|
64
|
-
* // Icon name to icon class name.
|
|
65
|
-
* // For class name check bootstrap icons website
|
|
66
|
-
*/
|
|
67
|
-
name: string;
|
|
68
|
-
/** Additional classname */
|
|
69
|
-
className?: string;
|
|
70
|
-
/** Icon size */
|
|
71
|
-
size?: ElementSize;
|
|
72
|
-
/**
|
|
73
|
-
* Position
|
|
74
|
-
* Works only with other content
|
|
75
|
-
*/
|
|
76
|
-
position?: IconPosition;
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,MAAM,WAAW,gBAAgB;IAC7B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,YAAY;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,8BAA8B;IAC9B,IAAI,CAAC,EAAE,cAAc,CAAC;CACzB;AAED;;;EAGE;AACF,MAAM,WAAW,cAAc;IAC3B,oCAAoC;IACpC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,mCAAmC;AACnC,oBAAY,WAAW;IACnB,2BAA2B;IAC3B,KAAK,UAAU;IAEf,iCAAiC;IACjC,MAAM,WAAW;IAEjB,2BAA2B;IAC3B,MAAM,WAAW;IAEjB,0BAA0B;IAC1B,KAAK,UAAU;CAClB;AAED,wCAAwC;AACxC,oBAAY,YAAY;IACpB,yBAAyB;IACzB,OAAO,YAAY;IAEnB,2BAA2B;IAC3B,OAAO,YAAY;IAEnB,yBAAyB;IACzB,IAAI,SAAS;IAEb,sBAAsB;IACtB,IAAI,SAAS;IAEb,mBAAmB;IACnB,OAAO,YAAY;IAEnB,oBAAoB;IACpB,OAAO,YAAY;IAEnB,iBAAiB;IACjB,MAAM,WAAW;CACpB;AAED,0BAA0B;AAC1B,oBAAY,eAAe;IACvB,mBAAmB;IACnB,IAAI,SAAS;IAEb,qBAAqB;IACrB,MAAM,WAAW;IAEjB,oBAAoB;IACpB,KAAK,UAAU;CAClB;AAED,qDAAqD;AACrD,oBAAY,oBAAoB,GAAG,eAAe,CAAC,IAAI,GAAG,eAAe,CAAC,KAAK,CAAC;AAEhF,4BAA4B;AAC5B,oBAAY,YAAY,GAClB,MAAM,GACN,OAAO,CAAC;AAEd,0BAA0B;AAC1B,MAAM,WAAW,WAAW;IACxB;;;;;MAKE;IACF,IAAI,EAAE,MAAM,CAAC;IAEb,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,gBAAgB;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;;MAGE;IACF,QAAQ,CAAC,EAAE,YAAY,CAAC;CAC3B"}
|
package/components/types.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/** Input component size variety */
|
|
2
|
-
export var ElementSize;
|
|
3
|
-
(function (ElementSize) {
|
|
4
|
-
/** Font size is 0.75rem */
|
|
5
|
-
ElementSize["Small"] = "small";
|
|
6
|
-
/** Font size is 1rem. Default */
|
|
7
|
-
ElementSize["Normal"] = "normal";
|
|
8
|
-
/** Font size is 1.25rem */
|
|
9
|
-
ElementSize["Medium"] = "medium";
|
|
10
|
-
/** Font size is 1.5rem */
|
|
11
|
-
ElementSize["Large"] = "large";
|
|
12
|
-
})(ElementSize || (ElementSize = {}));
|
|
13
|
-
/** Input component border-color type */
|
|
14
|
-
export var ElementColor;
|
|
15
|
-
(function (ElementColor) {
|
|
16
|
-
/** color: transparent */
|
|
17
|
-
ElementColor["Default"] = "default";
|
|
18
|
-
/** color: seawave green */
|
|
19
|
-
ElementColor["Primary"] = "primary";
|
|
20
|
-
/** color: blue-violet */
|
|
21
|
-
ElementColor["Link"] = "link";
|
|
22
|
-
/** color: sky-blue */
|
|
23
|
-
ElementColor["Info"] = "info";
|
|
24
|
-
/** color: green */
|
|
25
|
-
ElementColor["Success"] = "success";
|
|
26
|
-
/** color: yellow */
|
|
27
|
-
ElementColor["Warning"] = "warning";
|
|
28
|
-
/** color: red */
|
|
29
|
-
ElementColor["Danger"] = "danger";
|
|
30
|
-
})(ElementColor || (ElementColor = {}));
|
|
31
|
-
;
|
|
32
|
-
/** Position of element */
|
|
33
|
-
export var ElementPosition;
|
|
34
|
-
(function (ElementPosition) {
|
|
35
|
-
/** Left aligned */
|
|
36
|
-
ElementPosition["Left"] = "left";
|
|
37
|
-
/** Center aligned */
|
|
38
|
-
ElementPosition["Center"] = "center";
|
|
39
|
-
/** Right aligned */
|
|
40
|
-
ElementPosition["Right"] = "right";
|
|
41
|
-
})(ElementPosition || (ElementPosition = {}));
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ElementColor, ValidationState } from "../components";
|
|
2
|
-
/**
|
|
3
|
-
* Get current validation state values
|
|
4
|
-
* @param style Component style color
|
|
5
|
-
* @param validationState Current form item validation state
|
|
6
|
-
* @returns [Is validation applicable; classname attribute value; validation messages]
|
|
7
|
-
*/
|
|
8
|
-
export declare const getValidationValues: (style?: ElementColor, validationState?: ValidationState) => [boolean, string, Array<string>];
|
|
9
|
-
/**
|
|
10
|
-
* Get classname attribute value based on current validation state and form item component style prop
|
|
11
|
-
* @param style Component style color
|
|
12
|
-
* @param validationState Current form item validation state
|
|
13
|
-
* @returns Classname attribute value
|
|
14
|
-
*/
|
|
15
|
-
export declare const getStyleClassName: (style?: ElementColor, validationState?: ValidationState) => string;
|
|
16
|
-
//# sourceMappingURL=formValidation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formValidation.d.ts","sourceRoot":"","sources":["../../src/utils/formValidation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAoB,MAAM,iBAAiB,CAAC;AAElF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,WAAY,YAAY,oBAAoB,eAAe,KAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC,CAO5H,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,WAAY,YAAY,oBAAoB,eAAe,KAAG,MAgB3F,CAAC"}
|
package/utils/formValidation.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { isNullOrUndefined } from "@bodynarf/utils";
|
|
2
|
-
import { ValidationStatus } from "../components";
|
|
3
|
-
/**
|
|
4
|
-
* Get current validation state values
|
|
5
|
-
* @param style Component style color
|
|
6
|
-
* @param validationState Current form item validation state
|
|
7
|
-
* @returns [Is validation applicable; classname attribute value; validation messages]
|
|
8
|
-
*/
|
|
9
|
-
export const getValidationValues = (style, validationState) => {
|
|
10
|
-
const validationStateDefined = !isNullOrUndefined(validationState) && validationState.status !== ValidationStatus.None;
|
|
11
|
-
const styleClassName = getStyleClassName(style, validationState);
|
|
12
|
-
const messages = validationState?.messages ?? [];
|
|
13
|
-
return [validationStateDefined, styleClassName, messages];
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Get classname attribute value based on current validation state and form item component style prop
|
|
17
|
-
* @param style Component style color
|
|
18
|
-
* @param validationState Current form item validation state
|
|
19
|
-
* @returns Classname attribute value
|
|
20
|
-
*/
|
|
21
|
-
export const getStyleClassName = (style, validationState) => {
|
|
22
|
-
if (isNullOrUndefined(validationState)) {
|
|
23
|
-
return isNullOrUndefined(style) ? "" : `is-${style}`;
|
|
24
|
-
}
|
|
25
|
-
const { status } = validationState;
|
|
26
|
-
switch (status) {
|
|
27
|
-
case ValidationStatus.Valid: {
|
|
28
|
-
return "is-success";
|
|
29
|
-
}
|
|
30
|
-
case ValidationStatus.Invalid: {
|
|
31
|
-
return "is-danger";
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return isNullOrUndefined(style) ? "" : `is-${style}`;
|
|
35
|
-
};
|
|
File without changes
|
|
File without changes
|