@carbon/ibm-products 2.43.2-canary.172 → 2.43.2-canary.174

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. package/css/index-full-carbon.css +13 -1
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +4 -0
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +13 -1
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +1 -1
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +13 -1
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +1 -1
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +7 -3
  18. package/es/components/ConditionBuilder/ConditionBuilder.js +2 -1
  19. package/es/components/ConditionBuilder/ConditionBuilder.types.d.ts +2 -1
  20. package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +1 -1
  21. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +1 -1
  22. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +3 -1
  23. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +1 -1
  24. package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -2
  25. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +4 -1
  26. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +2 -2
  27. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +1 -1
  28. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +5 -0
  29. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -0
  30. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +9 -3
  31. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +1 -2
  32. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +1 -1
  33. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +3 -1
  34. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +11 -5
  35. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +1 -1
  36. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +1 -2
  37. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
  38. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +7 -4
  39. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +1 -1
  40. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +1 -2
  41. package/es/components/ConditionBuilder/utils/useDataConfigs.d.ts +18 -0
  42. package/es/components/ConditionBuilder/utils/useDataConfigs.js +120 -0
  43. package/es/components/ConditionBuilder/utils/useTranslations.d.ts +1 -1
  44. package/es/components/ConditionBuilder/utils/useTranslations.js +4 -1
  45. package/es/components/ConditionBuilder/utils/util.d.ts +12 -0
  46. package/es/components/ConditionBuilder/utils/util.js +48 -2
  47. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +8 -3
  48. package/es/components/Datagrid/types/index.d.ts +1 -0
  49. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +17 -13
  50. package/lib/components/ConditionBuilder/ConditionBuilder.js +5 -4
  51. package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts +2 -1
  52. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +9 -9
  53. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +6 -6
  54. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +3 -1
  55. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +3 -3
  56. package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +7 -5
  57. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +8 -5
  58. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +11 -11
  59. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +1 -1
  60. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +5 -0
  61. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -0
  62. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +13 -7
  63. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +2 -3
  64. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +2 -2
  65. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +3 -1
  66. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +17 -11
  67. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +12 -12
  68. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +1 -2
  69. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +2 -2
  70. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +20 -17
  71. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +17 -17
  72. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +8 -9
  73. package/lib/components/ConditionBuilder/utils/useDataConfigs.d.ts +18 -0
  74. package/lib/components/ConditionBuilder/utils/useDataConfigs.js +124 -0
  75. package/lib/components/ConditionBuilder/utils/useTranslations.d.ts +1 -1
  76. package/lib/components/ConditionBuilder/utils/useTranslations.js +4 -1
  77. package/lib/components/ConditionBuilder/utils/util.d.ts +12 -0
  78. package/lib/components/ConditionBuilder/utils/util.js +53 -3
  79. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +8 -3
  80. package/lib/components/Datagrid/types/index.d.ts +1 -0
  81. package/package.json +3 -3
  82. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +10 -1
  83. package/scss/components/Datagrid/styles/_datagrid.scss +6 -0
  84. package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +0 -30
  85. package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +0 -125
  86. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +0 -30
  87. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +0 -135
@@ -1,125 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2020, 2024
3
- *
4
- * This source code is licensed under the Apache-2.0 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- import { pkg } from '../../../settings.js';
9
-
10
- var statementConfig = [{
11
- label: 'if',
12
- id: 'if',
13
- connector: 'and'
14
- }, {
15
- label: 'excl.if',
16
- id: 'excl_if',
17
- connector: 'or'
18
- }];
19
- var connectorConfig = [{
20
- label: 'and',
21
- id: 'and'
22
- }, {
23
- label: 'or',
24
- id: 'or'
25
- }];
26
- var operatorConfig = [{
27
- label: 'is',
28
- id: 'is',
29
- type: 'all'
30
- }, {
31
- label: 'is greater than',
32
- id: 'greater',
33
- type: 'number'
34
- }, {
35
- label: 'is greater than or equal to',
36
- id: 'greaterEqual',
37
- type: 'number'
38
- }, {
39
- label: 'is lower than',
40
- id: 'lower',
41
- type: 'number'
42
- }, {
43
- label: 'is lower than or equal to',
44
- id: 'lowerEqual',
45
- type: 'number'
46
- }, {
47
- label: 'starts with',
48
- id: 'startsWith',
49
- type: 'text,textarea'
50
- }, {
51
- label: 'ends with',
52
- id: 'endsWith',
53
- type: 'text,textarea'
54
- }, {
55
- label: 'contains',
56
- id: 'contains',
57
- type: 'text,textarea'
58
- }, {
59
- label: 'is one of',
60
- id: 'oneOf',
61
- type: 'option'
62
- }, {
63
- label: 'is before',
64
- id: 'before',
65
- type: 'date,time'
66
- }, {
67
- label: 'is after',
68
- id: 'after',
69
- type: 'date,time'
70
- }, {
71
- label: 'is between',
72
- id: 'between',
73
- type: 'date'
74
- }];
75
- var NON_HIERARCHICAL_VARIANT = 'Non-Hierarchical';
76
- var HIERARCHICAL_VARIANT = 'Hierarchical';
77
- // The block part of our conventional BEM class names (blockClass__E--M).
78
- var blockClass = "".concat(pkg.prefix, "--condition-builder");
79
- var formatDate = function formatDate(date) {
80
- var day = String(date.getDate()).padStart(2, '0');
81
- var month = String(date.getMonth() + 1).padStart(2, '0');
82
- var year = date.getFullYear();
83
- return "".concat(day, "/").concat(month, "/").concat(year);
84
- };
85
- //const translationsObjectCurrent = translationsObject['en']; // TO DO: need to discuss if language is to be passed as prop
86
-
87
- var valueRenderers = {
88
- text: function text(val) {
89
- return val;
90
- },
91
- textarea: function textarea(val) {
92
- return val;
93
- },
94
- time: function time(val) {
95
- return val;
96
- },
97
- number: function number(val) {
98
- return val;
99
- },
100
- option: function option(value) {
101
- if (value && typeof value !== 'string') {
102
- var selectedValues = Array.isArray(value) ? value : [value];
103
- return selectedValues.map(function (option) {
104
- return option.label;
105
- }).join(', ');
106
- }
107
- return value;
108
- },
109
- date: function date(value) {
110
- if (Array.isArray(value) && value.length > 1) {
111
- var start = value !== null && value !== void 0 && value[0] && !isNaN(new Date(value[0])) ? formatDate(new Date(value[0])) : '';
112
- var end = value !== null && value !== void 0 && value[1] && !isNaN(new Date(value[1])) ? formatDate(new Date(value[1])) : '';
113
- return "".concat(start, " To ").concat(end);
114
- } else if (Array.isArray(value) && !isNaN(new Date(value[0]))) {
115
- return formatDate(new Date(value[0]));
116
- } else {
117
- return value;
118
- }
119
- },
120
- custom: function custom(value) {
121
- return value;
122
- }
123
- };
124
-
125
- export { HIERARCHICAL_VARIANT, NON_HIERARCHICAL_VARIANT, blockClass, connectorConfig, operatorConfig, statementConfig, valueRenderers };
@@ -1,30 +0,0 @@
1
- export const statementConfig: {
2
- label: string;
3
- id: string;
4
- connector: string;
5
- }[];
6
- export const connectorConfig: {
7
- label: string;
8
- id: string;
9
- }[];
10
- export const actionConfig: {
11
- label: string;
12
- id: string;
13
- }[];
14
- export const operatorConfig: {
15
- label: string;
16
- id: string;
17
- type: string;
18
- }[];
19
- export const NON_HIERARCHICAL_VARIANT: "Non-Hierarchical";
20
- export const HIERARCHICAL_VARIANT: "Hierarchical";
21
- export const blockClass: string;
22
- export namespace valueRenderers {
23
- function text(val: any): any;
24
- function textarea(val: any): any;
25
- function time(val: any): any;
26
- function number(val: any): any;
27
- function option(value: any): any;
28
- function date(value: any): any;
29
- function custom(value: any): any;
30
- }
@@ -1,135 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2020, 2024
3
- *
4
- * This source code is licensed under the Apache-2.0 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- 'use strict';
9
-
10
- Object.defineProperty(exports, '__esModule', { value: true });
11
-
12
- var settings = require('../../../settings.js');
13
-
14
- var statementConfig = [{
15
- label: 'if',
16
- id: 'if',
17
- connector: 'and'
18
- }, {
19
- label: 'excl.if',
20
- id: 'excl_if',
21
- connector: 'or'
22
- }];
23
- var connectorConfig = [{
24
- label: 'and',
25
- id: 'and'
26
- }, {
27
- label: 'or',
28
- id: 'or'
29
- }];
30
- var operatorConfig = [{
31
- label: 'is',
32
- id: 'is',
33
- type: 'all'
34
- }, {
35
- label: 'is greater than',
36
- id: 'greater',
37
- type: 'number'
38
- }, {
39
- label: 'is greater than or equal to',
40
- id: 'greaterEqual',
41
- type: 'number'
42
- }, {
43
- label: 'is lower than',
44
- id: 'lower',
45
- type: 'number'
46
- }, {
47
- label: 'is lower than or equal to',
48
- id: 'lowerEqual',
49
- type: 'number'
50
- }, {
51
- label: 'starts with',
52
- id: 'startsWith',
53
- type: 'text,textarea'
54
- }, {
55
- label: 'ends with',
56
- id: 'endsWith',
57
- type: 'text,textarea'
58
- }, {
59
- label: 'contains',
60
- id: 'contains',
61
- type: 'text,textarea'
62
- }, {
63
- label: 'is one of',
64
- id: 'oneOf',
65
- type: 'option'
66
- }, {
67
- label: 'is before',
68
- id: 'before',
69
- type: 'date,time'
70
- }, {
71
- label: 'is after',
72
- id: 'after',
73
- type: 'date,time'
74
- }, {
75
- label: 'is between',
76
- id: 'between',
77
- type: 'date'
78
- }];
79
- var NON_HIERARCHICAL_VARIANT = 'Non-Hierarchical';
80
- var HIERARCHICAL_VARIANT = 'Hierarchical';
81
- // The block part of our conventional BEM class names (blockClass__E--M).
82
- var blockClass = "".concat(settings.pkg.prefix, "--condition-builder");
83
- var formatDate = function formatDate(date) {
84
- var day = String(date.getDate()).padStart(2, '0');
85
- var month = String(date.getMonth() + 1).padStart(2, '0');
86
- var year = date.getFullYear();
87
- return "".concat(day, "/").concat(month, "/").concat(year);
88
- };
89
- //const translationsObjectCurrent = translationsObject['en']; // TO DO: need to discuss if language is to be passed as prop
90
-
91
- var valueRenderers = {
92
- text: function text(val) {
93
- return val;
94
- },
95
- textarea: function textarea(val) {
96
- return val;
97
- },
98
- time: function time(val) {
99
- return val;
100
- },
101
- number: function number(val) {
102
- return val;
103
- },
104
- option: function option(value) {
105
- if (value && typeof value !== 'string') {
106
- var selectedValues = Array.isArray(value) ? value : [value];
107
- return selectedValues.map(function (option) {
108
- return option.label;
109
- }).join(', ');
110
- }
111
- return value;
112
- },
113
- date: function date(value) {
114
- if (Array.isArray(value) && value.length > 1) {
115
- var start = value !== null && value !== void 0 && value[0] && !isNaN(new Date(value[0])) ? formatDate(new Date(value[0])) : '';
116
- var end = value !== null && value !== void 0 && value[1] && !isNaN(new Date(value[1])) ? formatDate(new Date(value[1])) : '';
117
- return "".concat(start, " To ").concat(end);
118
- } else if (Array.isArray(value) && !isNaN(new Date(value[0]))) {
119
- return formatDate(new Date(value[0]));
120
- } else {
121
- return value;
122
- }
123
- },
124
- custom: function custom(value) {
125
- return value;
126
- }
127
- };
128
-
129
- exports.HIERARCHICAL_VARIANT = HIERARCHICAL_VARIANT;
130
- exports.NON_HIERARCHICAL_VARIANT = NON_HIERARCHICAL_VARIANT;
131
- exports.blockClass = blockClass;
132
- exports.connectorConfig = connectorConfig;
133
- exports.operatorConfig = operatorConfig;
134
- exports.statementConfig = statementConfig;
135
- exports.valueRenderers = valueRenderers;