@sis-cc/dotstatsuite-visions 12.18.0 → 12.20.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/es/DynamicDrawer/AdvancedSelection.js +532 -0
- package/es/DynamicDrawer/DynamicDrawer.js +370 -0
- package/es/DynamicDrawer/SelectionModesMobile.js +85 -0
- package/es/DynamicDrawer/index.js +44 -0
- package/es/PeriodPicker/PeriodPicker.js +98 -93
- package/es/index.js +1 -0
- package/lib/DynamicDrawer/AdvancedSelection.js +590 -0
- package/lib/DynamicDrawer/DynamicDrawer.js +410 -0
- package/lib/DynamicDrawer/SelectionModesMobile.js +105 -0
- package/lib/DynamicDrawer/index.js +16 -0
- package/lib/PeriodPicker/PeriodPicker.js +97 -92
- package/lib/index.js +10 -1
- package/package.json +1 -1
- package/umd/@sis-cc/dotstatsuite-visions.js +64402 -63359
- package/umd/@sis-cc/dotstatsuite-visions.min.js +10 -10
- package/umd/@sis-cc/dotstatsuite-visions.min.js.map +1 -1
|
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import dateFns from 'date-fns';
|
|
5
5
|
import { Grid, Typography } from '@mui/material';
|
|
6
6
|
import { numeralFormat } from './lib';
|
|
7
|
-
import { Select } from '../';
|
|
7
|
+
import { Button, Select } from '../';
|
|
8
8
|
import useStyles from './styles';
|
|
9
9
|
import { defaultfreq } from './constants';
|
|
10
10
|
import { getRange, getFrequencyOptions, getDefaultFrequency, getLayout, getPeriodValue, getDate, getDateInTheRange, getDestructuringDate, isValidNumber } from './lib';
|
|
@@ -46,7 +46,8 @@ var Period = function Period(_ref) {
|
|
|
46
46
|
var showFrequency = R.and(R.gt(R.length(frequencies), 1), R.not(frequencyDisabled));
|
|
47
47
|
var destructuringDates = R.map(getDestructuringDate)(period);
|
|
48
48
|
|
|
49
|
-
var
|
|
49
|
+
var onClickFrequency = function onClickFrequency(e, value) {
|
|
50
|
+
console.log(value);
|
|
50
51
|
if (R.is(Function, changeFrequency)) return changeFrequency(value);
|
|
51
52
|
};
|
|
52
53
|
var _getIsDisabled = function _getIsDisabled(getter) {
|
|
@@ -100,110 +101,114 @@ var Period = function Period(_ref) {
|
|
|
100
101
|
className: classes.headerContainer,
|
|
101
102
|
'data-testid': 'period-picker-frequency-test-id'
|
|
102
103
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
)
|
|
117
|
-
)
|
|
104
|
+
R.map(function (freq) {
|
|
105
|
+
return React.createElement(
|
|
106
|
+
Button,
|
|
107
|
+
{
|
|
108
|
+
sx: { margin: 2 },
|
|
109
|
+
'aria-label': freq.label,
|
|
110
|
+
key: freq.value,
|
|
111
|
+
onClick: function onClick(e) {
|
|
112
|
+
return onClickFrequency(e, R.prop('value', freq));
|
|
113
|
+
},
|
|
114
|
+
selected: frequency
|
|
115
|
+
},
|
|
116
|
+
freq.label
|
|
117
|
+
);
|
|
118
|
+
})(frequencies)
|
|
118
119
|
),
|
|
119
|
-
R.not(isPeriodDisabled) &&
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
React.createElement(
|
|
120
|
+
R.not(isPeriodDisabled) && React.createElement(
|
|
121
|
+
Grid,
|
|
122
|
+
{ container: true, xs: 12, justifyContent: 'space-between' },
|
|
123
|
+
R.map(function (_ref3) {
|
|
124
|
+
var getter = _ref3.getter,
|
|
125
|
+
layout = _ref3.layout,
|
|
126
|
+
label = _ref3.label,
|
|
127
|
+
value = _ref3.value,
|
|
128
|
+
testId = _ref3.testId,
|
|
129
|
+
getIsDisabled = _ref3.getIsDisabled;
|
|
130
|
+
return React.createElement(
|
|
130
131
|
Grid,
|
|
131
|
-
{
|
|
132
|
+
{ key: getter, item: true, xs: 5, 'data-testid': testId, justifyContent: 'space-between' },
|
|
132
133
|
React.createElement(
|
|
133
134
|
Grid,
|
|
134
|
-
{
|
|
135
|
+
{ container: true, direction: 'row' },
|
|
135
136
|
React.createElement(
|
|
136
|
-
|
|
137
|
-
{
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
137
|
+
Grid,
|
|
138
|
+
{ item: true, xs: 12, className: classes.sideLabel },
|
|
139
|
+
React.createElement(
|
|
140
|
+
Typography,
|
|
141
|
+
{
|
|
142
|
+
variant: 'body2',
|
|
143
|
+
tabIndex: 0 // eslint-disable-line jsx-a11y/no-noninteractive-tabindex
|
|
144
|
+
, 'aria-label': label
|
|
145
|
+
},
|
|
146
|
+
label
|
|
147
|
+
)
|
|
143
148
|
)
|
|
144
|
-
)
|
|
145
|
-
),
|
|
146
|
-
React.createElement(
|
|
147
|
-
Grid,
|
|
148
|
-
{ container: true, direction: 'row' },
|
|
149
|
+
),
|
|
149
150
|
React.createElement(
|
|
150
151
|
Grid,
|
|
151
|
-
{
|
|
152
|
+
{ container: true, direction: 'row' },
|
|
152
153
|
React.createElement(
|
|
153
154
|
Grid,
|
|
154
|
-
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
{ item: true, xs: 12 },
|
|
156
|
+
React.createElement(
|
|
157
|
+
Grid,
|
|
158
|
+
{ container: true, className: classes.headerContainer, spacing: 1 },
|
|
159
|
+
R.map(function (row) {
|
|
160
|
+
return R.map(function (_ref4) {
|
|
161
|
+
var id = _ref4.id,
|
|
162
|
+
values = _ref4.values;
|
|
159
163
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
164
|
+
var selectedValue = R.isNil(R.prop(id)(value)) ? R.head(values) : R.prop(id)(value);
|
|
165
|
+
return React.createElement(
|
|
166
|
+
Grid,
|
|
167
|
+
{
|
|
168
|
+
key: id,
|
|
169
|
+
item: true,
|
|
170
|
+
xs: 12 / R.length(row),
|
|
171
|
+
className: classes.selectContainer
|
|
172
|
+
},
|
|
173
|
+
React.createElement(Select, {
|
|
174
|
+
onChange: onChangePeriod(getter, id),
|
|
175
|
+
label: R.prop(id)(labels),
|
|
176
|
+
id: id + '-' + label,
|
|
177
|
+
dataTestId: id + '-' + label + '-test-id',
|
|
178
|
+
value: selectedValue,
|
|
179
|
+
disabled: disabled || false,
|
|
180
|
+
items: R.map(function (option) {
|
|
181
|
+
return {
|
|
182
|
+
id: id,
|
|
183
|
+
value: option,
|
|
184
|
+
disabled: getIsDisabled(option, id),
|
|
185
|
+
label: R.ifElse(R.is(String), R.identity, R.prop(id)(numeralFormat))(option)
|
|
186
|
+
};
|
|
187
|
+
})(values)
|
|
188
|
+
})
|
|
189
|
+
);
|
|
190
|
+
})(row);
|
|
191
|
+
})(layout)
|
|
192
|
+
)
|
|
188
193
|
)
|
|
189
194
|
)
|
|
190
|
-
)
|
|
191
|
-
)
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
195
|
+
);
|
|
196
|
+
})([{
|
|
197
|
+
getter: 'start',
|
|
198
|
+
testId: 'period-picker-start-period-test-id',
|
|
199
|
+
layout: getLayout(frequency, R.head(ranges)),
|
|
200
|
+
label: R.prop('start')(labels),
|
|
201
|
+
value: getPeriodValue(R.head(destructuringDates)),
|
|
202
|
+
getIsDisabled: _getIsDisabled('start')
|
|
203
|
+
}, {
|
|
204
|
+
getter: 'end',
|
|
205
|
+
testId: 'period-picker-end-period-test-id',
|
|
206
|
+
layout: getLayout(frequency, R.last(ranges), /*R.last(availableRanges)*/[]),
|
|
207
|
+
label: R.prop('end')(labels),
|
|
208
|
+
value: getPeriodValue(R.last(destructuringDates)),
|
|
209
|
+
getIsDisabled: _getIsDisabled('end')
|
|
210
|
+
}])
|
|
211
|
+
)
|
|
207
212
|
);
|
|
208
213
|
};
|
|
209
214
|
|
package/es/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export { default as DataEdit } from './DataEdit';
|
|
|
16
16
|
export { default as Dataflow } from './Dataflow';
|
|
17
17
|
export { default as DataHeader } from './DataHeader';
|
|
18
18
|
export { default as DataFooter } from './DataFooter';
|
|
19
|
+
export { default as DynamicDrawer } from './DynamicDrawer';
|
|
19
20
|
export { default as ExpansionPanel } from './ExpansionPanel';
|
|
20
21
|
export * from './Icons';
|
|
21
22
|
export { default as Input } from './Input';
|