iguazio.dashboard-react-controls 0.0.7 → 0.0.10

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/dist/index.js CHANGED
@@ -5,12 +5,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.types = exports.hooks = exports.constants = exports.components = void 0;
8
+ exports.types = exports.hooks = exports.elements = exports.constants = exports.components = void 0;
9
9
 
10
10
  var components = _interopRequireWildcard(require("./components"));
11
11
 
12
12
  exports.components = components;
13
13
 
14
+ var constants = _interopRequireWildcard(require("./constants"));
15
+
16
+ exports.constants = constants;
17
+
18
+ var elements = _interopRequireWildcard(require("./elements"));
19
+
20
+ exports.elements = elements;
21
+
14
22
  var hooks = _interopRequireWildcard(require("./hooks"));
15
23
 
16
24
  exports.hooks = hooks;
@@ -19,10 +27,6 @@ var types = _interopRequireWildcard(require("./types"));
19
27
 
20
28
  exports.types = types;
21
29
 
22
- var constants = _interopRequireWildcard(require("./constants"));
23
-
24
- exports.constants = constants;
25
-
26
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
31
 
28
32
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -48,6 +48,41 @@ textarea {
48
48
  line-height: 18px;
49
49
  white-space: nowrap;
50
50
  text-overflow: ellipsis;
51
+ border: 0;
52
+ color: inherit;
53
+ background-color: transparent;
54
+ padding: 0;
55
+ resize: none;
56
+ width: 100%;
57
+
58
+ &::placeholder {
59
+ color: $spunPearl;
60
+ }
61
+
62
+ &::-webkit-input-placeholder {
63
+ /* Chrome/Opera/Safari */
64
+ color: $spunPearl;
65
+ }
66
+
67
+ &::-moz-placeholder {
68
+ /* Firefox 19+ */
69
+ color: $spunPearl;
70
+ }
71
+
72
+ &:-ms-input-placeholder {
73
+ /* IE 10+ */
74
+ color: $spunPearl;
75
+ }
76
+
77
+ &:-moz-placeholder {
78
+ /* Firefox 18- */
79
+ color: $spunPearl;
80
+ }
81
+
82
+ &:disabled {
83
+ background: transparent;
84
+ cursor: not-allowed;
85
+ }
51
86
 
52
87
  &:active,
53
88
  &:focus {
@@ -1,5 +1,6 @@
1
1
  @import './colors';
2
2
  @import './borders';
3
+ @import './variables.scss';
3
4
 
4
5
  @mixin fixed {
5
6
  position: fixed;
@@ -983,6 +984,10 @@
983
984
  }
984
985
 
985
986
  @mixin fieldWrapper {
987
+ display: flex;
988
+ flex: 1;
989
+ flex-flow: row nowrap;
990
+ align-items: center;
986
991
  position: relative;
987
992
  width: 100%;
988
993
  color: $primary;
@@ -990,3 +995,99 @@
990
995
  border: $primaryBorder;
991
996
  border-radius: 4px;
992
997
  }
998
+
999
+ @mixin formField {
1000
+ position: relative;
1001
+ display: flex;
1002
+ flex-flow: column nowrap;
1003
+ height: 100%;
1004
+ width: 100%;
1005
+
1006
+ &__label {
1007
+ margin-bottom: 5px;
1008
+ color: $topaz;
1009
+ font-size: 12px;
1010
+ text-align: left;
1011
+ text-transform: capitalize;
1012
+ background-color: transparent;
1013
+
1014
+ &-mandatory {
1015
+ color: $amaranth;
1016
+ }
1017
+
1018
+ &-disabled {
1019
+ color: $spunPearl;
1020
+
1021
+ .form-field__label-mandatory {
1022
+ color: $spunPearl;
1023
+ }
1024
+ }
1025
+ }
1026
+
1027
+ &__wrapper {
1028
+ @include fieldWrapper;
1029
+
1030
+ &-disabled {
1031
+ color: $spunPearl;
1032
+ cursor: not-allowed;
1033
+ }
1034
+
1035
+ &-invalid {
1036
+ border: $errorBorder;
1037
+ }
1038
+
1039
+ &.without-border {
1040
+ border-color: transparent;
1041
+ }
1042
+
1043
+ &-dense {
1044
+ .form-field__control > *:first-child {
1045
+ height: $fieldDense;
1046
+ }
1047
+ }
1048
+
1049
+ &-normal {
1050
+ .form-field__control > *:first-child {
1051
+ height: $fieldNormal;
1052
+ }
1053
+ }
1054
+
1055
+ &-medium {
1056
+ .form-field__control > *:first-child {
1057
+ height: $fieldMedium;
1058
+ }
1059
+ }
1060
+
1061
+ &-chunky {
1062
+ .form-field__control > *:first-child {
1063
+ height: $fieldChunky;
1064
+ }
1065
+ }
1066
+ }
1067
+
1068
+ &__control {
1069
+ position: relative;
1070
+ display: flex;
1071
+ flex: 1;
1072
+ align-items: center;
1073
+ overflow: hidden;
1074
+ padding: 0 8px 0 16px;
1075
+ }
1076
+
1077
+ &__icons {
1078
+ display: flex;
1079
+ flex-shrink: 0;
1080
+ align-items: center;
1081
+ min-height: 25px;
1082
+
1083
+ & > * {
1084
+ display: flex;
1085
+ align-items: center;
1086
+ padding: 0 4px;
1087
+
1088
+ &:last-child {
1089
+ margin-right: 4px;
1090
+ }
1091
+ }
1092
+ }
1093
+ }
@@ -12,3 +12,9 @@ $headerHeight: 64px;
12
12
 
13
13
  $primaryTextColor: $primary;
14
14
  $secondaryTextColor: $topaz;
15
+
16
+ //Fields and button heights
17
+ $fieldDense: 36px;
18
+ $fieldNormal: 40px;
19
+ $fieldMedium: 44px;
20
+ $fieldChunky: 48px;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.setFieldState = void 0;
7
+
8
+ var _lodash = require("lodash");
9
+
10
+ var setFieldState = function setFieldState(args, state) {
11
+ var fieldName = args[0];
12
+ var states = args[1];
13
+ var field = state.fields[fieldName];
14
+
15
+ if (field) {
16
+ for (var stateName in states) {
17
+ (0, _lodash.set)(field, stateName, states[stateName]);
18
+ }
19
+ }
20
+ };
21
+
22
+ exports.setFieldState = setFieldState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iguazio.dashboard-react-controls",
3
- "version": "0.0.7",
3
+ "version": "0.0.10",
4
4
  "description": "Collection of resources (such as CSS styles, fonts and images) and ReactJS 17.x components to share among different Iguazio React repos.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -26,8 +26,10 @@
26
26
  "react-dom": "*",
27
27
  "react-modal-promise": "*",
28
28
  "react-transition-group": "*",
29
- "final-form": "^4.20.7",
30
- "react-final-form": "^6.5.9"
29
+ "final-form": "*",
30
+ "final-form-arrays": "*",
31
+ "react-final-form": "*",
32
+ "react-final-form-arrays": "*"
31
33
  },
32
34
  "devDependencies": {
33
35
  "@babel/cli": "^7.17.6",
@@ -59,13 +61,15 @@
59
61
  "eslint-plugin-storybook": "^0.5.10",
60
62
  "eslint-webpack-plugin": "^3.1.1",
61
63
  "lodash": "^4.17.21",
62
- "node": "14.18.1",
64
+ "node": "14.19.0",
63
65
  "prettier": "^2.5.1",
64
66
  "prop-types": "^15.8.1",
65
67
  "react": "^17.0.2",
66
68
  "react-dom": "^17.0.2",
67
69
  "final-form": "^4.20.7",
70
+ "final-form-arrays": "^3.0.2",
68
71
  "react-final-form": "^6.5.9",
72
+ "react-final-form-arrays": "^3.1.3",
69
73
  "react-modal-promise": "^1.0.2",
70
74
  "react-scripts": "5.0.0",
71
75
  "react-transition-group": "^4.4.2",