@wavemaker/react-runtime 11.14.2-1.245 → 12.0.0-next.28533
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/actions/base-action.js +5 -7
- package/actions/login-action.js +7 -8
- package/actions/logout-action.js +5 -7
- package/actions/navigation-action.js +32 -10
- package/actions/notification-action.js +22 -8
- package/actions/timer-action.js +13 -15
- package/actions/toast.js +4 -2
- package/actions/toast.service.js +1 -2
- package/components/advanced/carousel/index.js +1 -1
- package/components/advanced/carousel/template.js +1 -1
- package/components/basic/anchor/index.js +26 -9
- package/components/basic/html/index.js +115 -24
- package/components/basic/icon/index.js +2 -1
- package/components/basic/iframe/index.js +2 -1
- package/components/basic/label/index.js +12 -9
- package/components/basic/message/index.js +12 -3
- package/components/basic/picture/index.js +11 -4
- package/components/basic/progress-bar/index.js +1 -1
- package/components/basic/progress-circle/index.js +34 -28
- package/components/basic/progress-circle/props.js +10 -2
- package/components/basic/richtexteditor/index.js +95 -94
- package/components/basic/search/index.js +401 -156
- package/components/basic/search/providers.js +126 -61
- package/components/basic/spinner/index.js +2 -1
- package/components/basic/tree/index.js +34 -34
- package/components/basic/tree/utils.js +10 -4
- package/components/chart/components/barColumnChart/index.js +36 -33
- package/components/chart/components/bubbleChart/index.js +35 -25
- package/components/chart/components/chartLegend/utils.js +2 -1
- package/components/chart/components/cumulativeLineChart/index.js +30 -26
- package/components/chart/components/lineAreaChart/index.js +50 -32
- package/components/chart/components/pieDonutChart/index.js +13 -4
- package/components/chart/hooks/useXAxisConfig.js +15 -8
- package/components/chart/index.js +223 -53
- package/components/chart/utils.js +12 -1
- package/components/constants.js +5 -2
- package/components/container/accordion/accordion-pane/index.js +17 -12
- package/components/container/accordion/index.js +9 -4
- package/components/container/alignment-utils.js +56 -1
- package/components/container/index.js +49 -20
- package/components/container/panel/components/panel-header/index.js +3 -4
- package/components/container/panel/index.js +15 -10
- package/components/container/tabs/index.js +92 -14
- package/components/container/tabs/tab-pane/index.js +15 -8
- package/components/container/tabs/utils.js +51 -0
- package/components/container/wizard/components/StepComponents.js +2 -1
- package/components/container/wizard/components/WizardStep.js +2 -1
- package/components/container/wizard/index.js +64 -35
- package/components/container/wizard/utils.js +46 -1
- package/components/container/wizard/wizard-step/index.js +11 -1
- package/components/data/card/card-content/index.js +1 -1
- package/components/data/form/base-form/index.js +991 -180
- package/components/data/form/base-form/props.js +3 -1
- package/components/data/form/base-form/utils.js +159 -1
- package/components/data/form/dynamic-fields/constant.js +53 -0
- package/components/data/form/dynamic-fields/index.js +10 -45
- package/components/data/form/dynamic-fields/utils.js +37 -2
- package/components/data/form/form-action/index.js +5 -4
- package/components/data/form/form-context.js +5 -1
- package/components/data/form/form-controller/utils.js +84 -0
- package/components/data/form/form-controller/validation-contrustor.js +402 -189
- package/components/data/form/form-controller/withFormController.js +191 -52
- package/components/data/form/form-field/base-field.js +54 -33
- package/components/data/form/form-field/index.js +28 -5
- package/components/data/form/form-header/index.js +3 -4
- package/components/data/form/index.js +20 -1
- package/components/data/list/components/ListDND.js +2 -1
- package/components/data/list/components/ListItem.js +6 -2
- package/components/data/list/components/ListItemWithTemplate.js +46 -2
- package/components/data/list/components/ListItems.js +17 -26
- package/components/data/list/components/ListPagination.js +3 -3
- package/components/data/list/components/StandardListItems.js +3 -4
- package/components/data/list/hooks/useListEffects.js +55 -14
- package/components/data/list/hooks/useListEventHandlers.js +3 -1
- package/components/data/list/hooks/useListState.js +3 -1
- package/components/data/list/hooks/usePaginatedGroupedData.js +18 -5
- package/components/data/list/index.js +74 -55
- package/components/data/list/utils/list-helpers.js +73 -35
- package/components/data/list/utils/list-widget-methods.js +138 -95
- package/components/data/live-filter/index.js +26 -15
- package/components/data/live-form/index.js +23 -7
- package/components/data/live-form/props.js +1 -1
- package/components/data/pagination/components/BasicPagination.js +71 -16
- package/components/data/pagination/components/PageSizeSelector.js +8 -3
- package/components/data/pagination/components/TotalRecords.js +1 -5
- package/components/data/pagination/hooks/usePagination.js +349 -66
- package/components/data/pagination/index.js +137 -19
- package/components/data/table/components/AddNewRow.js +5 -1
- package/components/data/table/components/EditableCell.js +2 -2
- package/components/data/table/components/RowCells.js +64 -0
- package/components/data/table/components/RowExpansionButton.js +2 -2
- package/components/data/table/components/SummaryCell.js +111 -0
- package/components/data/table/components/SummaryRow.js +54 -0
- package/components/data/table/components/SummaryRowFooter.js +46 -0
- package/components/data/table/components/TableBody.js +61 -59
- package/components/data/table/components/TableDataRow.js +109 -0
- package/components/data/table/components/TableFilters.js +225 -121
- package/components/data/table/components/TableHeader.js +291 -23
- package/components/data/table/components/TablePanelHeading.js +139 -8
- package/components/data/table/components/index.js +22 -1
- package/components/data/table/hooks/use-edited-rows.js +141 -0
- package/components/data/table/hooks/useCellState.js +5 -12
- package/components/data/table/hooks/useFormWidget.js +58 -51
- package/components/data/table/hooks/usePaginationState.js +45 -24
- package/components/data/table/hooks/usePanelStructure.js +4 -4
- package/components/data/table/hooks/useRowHandlers.js +39 -5
- package/components/data/table/hooks/useRowSelection.js +244 -50
- package/components/data/table/hooks/useServerSideSorting.js +81 -37
- package/components/data/table/hooks/useTableColumns.js +211 -118
- package/components/data/table/hooks/useTableData.js +54 -9
- package/components/data/table/hooks/useTableEdit.js +272 -97
- package/components/data/table/hooks/useTableEffects.js +31 -13
- package/components/data/table/hooks/useTableFilter.js +1 -1
- package/components/data/table/hooks/useTableInitialization.js +23 -22
- package/components/data/table/hooks/useTableState.js +11 -5
- package/components/data/table/hooks/useTableStateManager.js +140 -65
- package/components/data/table/index.js +637 -274
- package/components/data/table/live-table/index.js +54 -22
- package/components/data/table/table-action/index.js +1 -1
- package/components/data/table/table-group/index.js +26 -0
- package/components/data/table/table-row-action/index.js +32 -18
- package/components/data/table/utils/buildSelectionColumns.js +12 -21
- package/components/data/table/utils/columnBuilder.js +29 -14
- package/components/data/table/utils/columnProxy.js +68 -1
- package/components/data/table/utils/constants.js +6 -2
- package/components/data/table/utils/crud-handlers.js +68 -63
- package/components/data/table/utils/groupHeaderUtils.js +102 -0
- package/components/data/table/utils/index.js +210 -21
- package/components/data/table/utils/renderDisplayCell.js +6 -6
- package/components/data/table/utils/selectionUtils.js +25 -26
- package/components/data/table/utils/validation.js +1 -0
- package/components/data/utils/filter-field-util.js +3 -3
- package/components/dialogs/alert-dialog/index.js +1 -1
- package/components/dialogs/confirm-dialog/index.js +1 -1
- package/components/dialogs/dialog/index.js +4 -1
- package/components/dialogs/dialog-content/index.js +3 -1
- package/components/dialogs/dialog-header/index.js +2 -2
- package/components/dialogs/iframe-dialog/index.js +11 -5
- package/components/dialogs/index.js +1 -1
- package/components/dialogs/login-dialog/index.js +1 -1
- package/components/dialogs/page-dialog/index.js +1 -1
- package/components/form/button/index.js +33 -7
- package/components/input/calendar/index.js +18 -6
- package/components/input/chips/index.js +99 -28
- package/components/input/chips/utils.js +34 -4
- package/components/input/color-picker/index.js +74 -25
- package/components/input/composite/index.js +3 -3
- package/components/input/currency/index.js +35 -49
- package/components/input/default/checkbox/index.js +23 -28
- package/components/input/default/checkboxset/index.js +38 -18
- package/components/input/default/checkboxset/utils.js +30 -0
- package/components/input/default/radioset/index.js +36 -39
- package/components/input/default/switch/index.js +30 -13
- package/components/input/epoch/date/index.js +130 -69
- package/components/input/epoch/date/utils.js +94 -1
- package/components/input/epoch/datetime/index.js +72 -22
- package/components/input/epoch/datetime/utils.js +49 -10
- package/components/input/epoch/time/index.js +68 -19
- package/components/input/epoch/time/utils.js +62 -14
- package/components/input/fileupload/Utils.js +12 -7
- package/components/input/fileupload/components/MultiUpload.js +2 -6
- package/components/input/fileupload/components/SingleUpload.js +3 -7
- package/components/input/fileupload/index.js +6 -10
- package/components/input/fileupload/useFileUpload.js +16 -5
- package/components/input/number/index.js +158 -43
- package/components/input/rating/index.js +90 -7
- package/components/input/select/index.js +147 -70
- package/components/input/slider/index.js +84 -26
- package/components/input/text/index.js +38 -18
- package/components/input/text/util.js +283 -130
- package/components/input/textarea/index.js +13 -10
- package/components/input/upload/index.js +124 -0
- package/components/input/upload/props.js +5 -0
- package/components/input/util/index.js +11 -0
- package/components/navbar/index.js +51 -3
- package/components/navbar/nav/index.js +46 -16
- package/components/navbar/nav-item/index.js +11 -5
- package/components/navigation/menu/components/ListItems.js +3 -0
- package/components/navigation/menu/constants.js +2 -1
- package/components/navigation/menu/hooks/useHoverState.hook.js +48 -0
- package/components/navigation/menu/hooks/useKeyboardMovements.hook.js +37 -0
- package/components/navigation/menu/hooks/useTransformedDataset.hook.js +15 -0
- package/components/navigation/menu/index.js +326 -188
- package/components/navigation/menu/utils/action-task.js +14 -0
- package/components/navigation/menu/utils/role-filter.js +76 -0
- package/components/navigation/popover/index.js +99 -26
- package/components/page/partial-container/index.js +34 -5
- package/components/prefab/index.js +2 -4
- package/context/PrefabContext.js +10 -6
- package/context/WidgetProvider.js +30 -31
- package/core/app.service.js +1 -1
- package/core/constants/events.js +57 -1
- package/core/dialog.service.js +1 -2
- package/core/event-notifier.js +1 -2
- package/core/formatter/array-formatters.js +33 -0
- package/core/formatter/date-formatters.js +2 -4
- package/core/formatter/index.js +2 -1
- package/core/formatter/number-formatters.js +5 -10
- package/core/formatter/security-formatters.js +2 -4
- package/core/formatter/string-formatters.js +3 -6
- package/core/proxy-service.js +84 -13
- package/core/script-registry.js +108 -48
- package/core/util/common.js +4 -4
- package/core/util/compare.js +30 -0
- package/core/util/dom.js +8 -8
- package/core/util/index.js +16 -6
- package/core/util/safe-is-equal.js +156 -0
- package/core/util/security.js +1 -2
- package/core/util/utils.js +16 -7
- package/higherOrder/BaseApp.js +108 -65
- package/higherOrder/BaseDateTime.js +31 -13
- package/higherOrder/BasePage.js +268 -144
- package/higherOrder/BasePartial.js +1 -1
- package/higherOrder/BasePrefab.js +33 -15
- package/higherOrder/DataNav.js +99 -16
- package/higherOrder/helper.js +5 -0
- package/higherOrder/withBaseWrapper.js +41 -28
- package/hooks/useAuth.js +11 -5
- package/hooks/useHttp.js +280 -94
- package/mui-config/theme-provider.js +1 -1
- package/mui-config/theme.js +1 -1
- package/package-lock.json +711 -669
- package/package.json +8 -8
- package/store/bindActions/i18nActions.js +18 -0
- package/store/index.js +3 -1
- package/store/slices/appConfigSlice.js +2 -2
- package/store/slices/authSlice.js +31 -28
- package/store/slices/i18nSlice.js +2 -2
- package/store/slices/navigationSlice.js +35 -0
- package/store/viewport.service.js +255 -0
- package/utils/attr.js +35 -0
- package/utils/dataset-util.js +1 -2
- package/utils/form-state.util.js +43 -12
- package/utils/form-utils.js +47 -2
- package/utils/format-util.js +28 -13
- package/utils/page-params-util.js +33 -1
- package/utils/state-persistance.js +72 -13
- package/utils/transformedDataset-utils.js +35 -24
- package/variables/base-variable.js +12 -14
- package/variables/crud-variable.js +225 -0
- package/variables/live-variable.js +56 -20
- package/variables/metadata.service.js +123 -0
- package/variables/model-variable.js +21 -15
- package/variables/service-variable.js +88 -83
|
@@ -25,13 +25,13 @@ var _cumulativeLineChart = require("./components/cumulativeLineChart");
|
|
|
25
25
|
var _pieDonutChart = require("./components/pieDonutChart");
|
|
26
26
|
var _useXAxisConfig = require("./hooks/useXAxisConfig");
|
|
27
27
|
var _useBarYAxisExtras = require("./hooks/useBarYAxisExtras");
|
|
28
|
-
var _excluded = ["title", "type", "subheading", "datavalue", "groupby", "aggregation", "aggregationcolumn", "orderby", "xaxisdatakey", "xaxislabel", "xnumberformat", "xdigits", "xdateformat", "xaxislabeldistance", "xunits", "yaxisdatakey", "yaxislabel", "ynumberformat", "ydigits", "yaxislabeldistance", "yunits", "iconclass", "nodatamessage", "loadingdatamsg", "tooltips", "showlegend", "showlabelsoutside", "showvalues", "staggerlabels", "reducexticks", "showlabels", "labeltype", "barspacing", "donutratio", "bubblesize", "showxdistance", "showydistance", "areaviewtype", "interpolation", "centerlabel", "customcolors", "theme", "offset", "offsettop", "offsetbottom", "offsetright", "offsetleft", "showxaxis", "showyaxis", "linethickness", "highlightpoints", "formattype", "dataset", "datasource", "width", "height", "shape", "onSelect", "onTransform", "onBeforerender", "xdomain", "ydomain", "labelthreshold", "legendtype", "viewtype", "fontsize", "fontunit", "color", "fontfamily", "fontweight", "fontstyle", "textdecoration", "className", "show", "styles", "name"];
|
|
28
|
+
var _excluded = ["title", "type", "subheading", "datavalue", "groupby", "aggregation", "aggregationcolumn", "orderby", "xaxisdatakey", "xaxislabel", "xnumberformat", "xdigits", "xdateformat", "xaxislabeldistance", "xunits", "yaxisdatakey", "yaxislabel", "ynumberformat", "ydigits", "yaxislabeldistance", "yunits", "iconclass", "nodatamessage", "loadingdatamsg", "tooltips", "showlegend", "showlabelsoutside", "showvalues", "staggerlabels", "reducexticks", "showlabels", "labeltype", "barspacing", "donutratio", "bubblesize", "showxdistance", "showydistance", "areaviewtype", "interpolation", "centerlabel", "customcolors", "theme", "offset", "offsettop", "offsetbottom", "offsetright", "offsetleft", "showxaxis", "showyaxis", "linethickness", "highlightpoints", "formattype", "dataset", "datasource", "width", "height", "shape", "onSelect", "onTransform", "onBeforerender", "xdomain", "ydomain", "labelthreshold", "legendtype", "viewtype", "fontsize", "fontunit", "color", "fontfamily", "fontweight", "fontstyle", "textdecoration", "className", "show", "styles", "name", "hidden"];
|
|
29
29
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
30
30
|
var __jsx = _react["default"].createElement;
|
|
31
31
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
32
32
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
33
33
|
var WmChart = function WmChart(props) {
|
|
34
|
-
var _chartContainerRef$cu,
|
|
34
|
+
var _chartContainerRef$cu, _width, _height, _minWidth;
|
|
35
35
|
var title = props.title,
|
|
36
36
|
_props$type = props.type,
|
|
37
37
|
type = _props$type === void 0 ? "Column" : _props$type,
|
|
@@ -79,7 +79,7 @@ var WmChart = function WmChart(props) {
|
|
|
79
79
|
_props$labeltype = props.labeltype,
|
|
80
80
|
labeltype = _props$labeltype === void 0 ? "percent" : _props$labeltype,
|
|
81
81
|
_props$barspacing = props.barspacing,
|
|
82
|
-
barspacing = _props$barspacing === void 0 ? "
|
|
82
|
+
barspacing = _props$barspacing === void 0 ? "0.5" : _props$barspacing,
|
|
83
83
|
_props$donutratio = props.donutratio,
|
|
84
84
|
donutratio = _props$donutratio === void 0 ? "small" : _props$donutratio,
|
|
85
85
|
bubblesize = props.bubblesize,
|
|
@@ -96,14 +96,10 @@ var WmChart = function WmChart(props) {
|
|
|
96
96
|
_props$theme = props.theme,
|
|
97
97
|
theme = _props$theme === void 0 ? "Azure" : _props$theme,
|
|
98
98
|
offset = props.offset,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
_props$offsetright = props.offsetright,
|
|
104
|
-
offsetright = _props$offsetright === void 0 ? 25 : _props$offsetright,
|
|
105
|
-
_props$offsetleft = props.offsetleft,
|
|
106
|
-
offsetleft = _props$offsetleft === void 0 ? 75 : _props$offsetleft,
|
|
99
|
+
offsettop = props.offsettop,
|
|
100
|
+
offsetbottom = props.offsetbottom,
|
|
101
|
+
offsetright = props.offsetright,
|
|
102
|
+
offsetleft = props.offsetleft,
|
|
107
103
|
_props$showxaxis = props.showxaxis,
|
|
108
104
|
showxaxis = _props$showxaxis === void 0 ? true : _props$showxaxis,
|
|
109
105
|
_props$showyaxis = props.showyaxis,
|
|
@@ -114,7 +110,8 @@ var WmChart = function WmChart(props) {
|
|
|
114
110
|
formattype = props.formattype,
|
|
115
111
|
dataset = props.dataset,
|
|
116
112
|
datasource = props.datasource,
|
|
117
|
-
width = props.width,
|
|
113
|
+
_props$width = props.width,
|
|
114
|
+
width = _props$width === void 0 ? "100%" : _props$width,
|
|
118
115
|
_props$height = props.height,
|
|
119
116
|
height = _props$height === void 0 ? "400px" : _props$height,
|
|
120
117
|
_props$shape = props.shape,
|
|
@@ -145,6 +142,8 @@ var WmChart = function WmChart(props) {
|
|
|
145
142
|
_props$styles = props.styles,
|
|
146
143
|
styles = _props$styles === void 0 ? {} : _props$styles,
|
|
147
144
|
name = props.name,
|
|
145
|
+
_props$hidden = props.hidden,
|
|
146
|
+
hidden = _props$hidden === void 0 ? false : _props$hidden,
|
|
148
147
|
otherProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
149
148
|
|
|
150
149
|
// const muiTheme = useTheme();
|
|
@@ -169,21 +168,18 @@ var WmChart = function WmChart(props) {
|
|
|
169
168
|
var _useState7 = (0, _react.useState)([]),
|
|
170
169
|
xDataKeyArr = _useState7[0],
|
|
171
170
|
setXDataKeyArr = _useState7[1];
|
|
172
|
-
var _useState8 = (0, _react.useState)(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
var _useState9 = (0, _react.useState)(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
var _useState0 = (0, _react.useState)(
|
|
179
|
-
|
|
180
|
-
|
|
171
|
+
var _useState8 = (0, _react.useState)(false),
|
|
172
|
+
isVisuallyGrouped = _useState8[0],
|
|
173
|
+
setIsVisuallyGrouped = _useState8[1];
|
|
174
|
+
var _useState9 = (0, _react.useState)(""),
|
|
175
|
+
xAxisDataType = _useState9[0],
|
|
176
|
+
setXAxisDataType = _useState9[1];
|
|
177
|
+
var _useState0 = (0, _react.useState)([]),
|
|
178
|
+
selectedRegions = _useState0[0],
|
|
179
|
+
setSelectedRegions = _useState0[1];
|
|
181
180
|
var _useState1 = (0, _react.useState)([]),
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
var _useState10 = (0, _react.useState)([]),
|
|
185
|
-
availableRegions = _useState10[0],
|
|
186
|
-
setAvailableRegions = _useState10[1];
|
|
181
|
+
availableRegions = _useState1[0],
|
|
182
|
+
setAvailableRegions = _useState1[1];
|
|
187
183
|
var chartContainerRef = (0, _react.useRef)(null);
|
|
188
184
|
var chartColors = (0, _react.useMemo)(function () {
|
|
189
185
|
var _themes;
|
|
@@ -272,11 +268,11 @@ var WmChart = function WmChart(props) {
|
|
|
272
268
|
}
|
|
273
269
|
return "y caption";
|
|
274
270
|
}, [type, yaxislabel, yaxisdatakey, yunits, xaxislabel, xaxisdatakey, xunits]);
|
|
275
|
-
|
|
276
|
-
// COMPLETE Angular helper functions
|
|
277
271
|
var isGroupByEnabled = (0, _react.useCallback)(function () {
|
|
278
272
|
return !!(groupby && groupby !== _utils.NONE);
|
|
279
273
|
}, [groupby]);
|
|
274
|
+
|
|
275
|
+
// check if aggregation is enabled, aggregationcolumn is not empty and groupby is not empty
|
|
280
276
|
var isAggregationEnabled = (0, _react.useCallback)(function () {
|
|
281
277
|
return !!(isGroupByEnabled() && aggregation !== _utils.NONE && aggregationcolumn);
|
|
282
278
|
}, [aggregation, aggregationcolumn, isGroupByEnabled]);
|
|
@@ -369,7 +365,13 @@ var WmChart = function WmChart(props) {
|
|
|
369
365
|
var yAxisKeys = yaxisdatakey ? yaxisdatakey.split(",").map(function (k) {
|
|
370
366
|
return k.trim();
|
|
371
367
|
}) : [];
|
|
368
|
+
|
|
369
|
+
// Apply orderby if specified and not visually grouped
|
|
372
370
|
var dataSet = processedDataset;
|
|
371
|
+
if (orderby && !isVisuallyGrouped) {
|
|
372
|
+
var orderByDetails = (0, _utils.getLodashOrderByFormat)(orderby);
|
|
373
|
+
dataSet = (0, _lodash.orderBy)(processedDataset, orderByDetails.columns, orderByDetails.orders);
|
|
374
|
+
}
|
|
373
375
|
if ((0, _lodash.isArray)(dataSet)) {
|
|
374
376
|
if ((0, _utils.isPieType)(type)) {
|
|
375
377
|
yAxisKey = yAxisKeys[0];
|
|
@@ -400,7 +402,7 @@ var WmChart = function WmChart(props) {
|
|
|
400
402
|
}
|
|
401
403
|
}
|
|
402
404
|
return datum;
|
|
403
|
-
}, [binddataset, type, xaxisdatakey, yaxisdatakey, shape, valueFinder, getValidData]);
|
|
405
|
+
}, [binddataset, type, xaxisdatakey, yaxisdatakey, shape, valueFinder, getValidData, orderby, isVisuallyGrouped]);
|
|
404
406
|
|
|
405
407
|
// COMPLETE getVisuallyGroupedData function from Angular - FIXED to avoid state updates
|
|
406
408
|
var getVisuallyGroupedData = (0, _react.useCallback)(function (queryResponse, groupingColumn) {
|
|
@@ -492,6 +494,56 @@ var WmChart = function WmChart(props) {
|
|
|
492
494
|
return (0, _utils.convertToRechartsFormat)(data, type);
|
|
493
495
|
}, [type]);
|
|
494
496
|
|
|
497
|
+
// Client-side aggregation function
|
|
498
|
+
var performClientSideAggregation = (0, _react.useCallback)(function (data) {
|
|
499
|
+
if (!data || data.length === 0) return [];
|
|
500
|
+
if (!isAggregationEnabled()) return data;
|
|
501
|
+
var groupByKey = groupby || "";
|
|
502
|
+
var aggregationCol = aggregationcolumn || "";
|
|
503
|
+
var aggregationType = aggregation || "none";
|
|
504
|
+
|
|
505
|
+
// Group data by the groupby field
|
|
506
|
+
var grouped = (0, _lodash.groupBy)(data, groupByKey);
|
|
507
|
+
|
|
508
|
+
// Apply aggregation
|
|
509
|
+
var aggregatedData = [];
|
|
510
|
+
(0, _lodash.forEach)(grouped, function (items, key) {
|
|
511
|
+
var values = items.map(function (item) {
|
|
512
|
+
return parseFloat(item[aggregationCol]) || 0;
|
|
513
|
+
});
|
|
514
|
+
var aggregatedValue;
|
|
515
|
+
switch (aggregationType.toLowerCase()) {
|
|
516
|
+
case "sum":
|
|
517
|
+
aggregatedValue = values.reduce(function (acc, val) {
|
|
518
|
+
return acc + val;
|
|
519
|
+
}, 0);
|
|
520
|
+
break;
|
|
521
|
+
case "average":
|
|
522
|
+
case "avg":
|
|
523
|
+
aggregatedValue = values.reduce(function (acc, val) {
|
|
524
|
+
return acc + val;
|
|
525
|
+
}, 0) / values.length;
|
|
526
|
+
break;
|
|
527
|
+
case "count":
|
|
528
|
+
aggregatedValue = values.length;
|
|
529
|
+
break;
|
|
530
|
+
case "min":
|
|
531
|
+
aggregatedValue = Math.min.apply(Math, (0, _toConsumableArray2["default"])(values));
|
|
532
|
+
break;
|
|
533
|
+
case "max":
|
|
534
|
+
aggregatedValue = Math.max.apply(Math, (0, _toConsumableArray2["default"])(values));
|
|
535
|
+
break;
|
|
536
|
+
default:
|
|
537
|
+
aggregatedValue = values[0] || 0;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
// Create aggregated item preserving the first item's structure
|
|
541
|
+
var aggregatedItem = _objectSpread(_objectSpread({}, items[0]), {}, (0, _defineProperty2["default"])({}, aggregationCol, aggregatedValue));
|
|
542
|
+
aggregatedData.push(aggregatedItem);
|
|
543
|
+
});
|
|
544
|
+
return aggregatedData;
|
|
545
|
+
}, [groupby, aggregationcolumn, aggregation, isAggregationEnabled]);
|
|
546
|
+
|
|
495
547
|
// COMPLETE getAggregatedData function from Angular (simplified for React)
|
|
496
548
|
var getAggregatedData = (0, _react.useCallback)(function (callback) {
|
|
497
549
|
// This would typically make API calls in a real implementation
|
|
@@ -547,15 +599,21 @@ var WmChart = function WmChart(props) {
|
|
|
547
599
|
try {
|
|
548
600
|
var groupingDetails = getGroupingDetails();
|
|
549
601
|
var data;
|
|
602
|
+
var dataToProcess = chartData;
|
|
603
|
+
|
|
604
|
+
// Apply client-side aggregation if enabled and using dataset (not datasource)
|
|
605
|
+
if (isAggregationEnabled() && !datasource && chartData.length > 0) {
|
|
606
|
+
dataToProcess = performClientSideAggregation(chartData);
|
|
607
|
+
}
|
|
550
608
|
var isValidAxis = binddataset ? !!(xaxisdatakey && yaxisdatakey) : true;
|
|
551
609
|
if (!isValidAxis) {
|
|
552
610
|
setProcessedData([]);
|
|
553
611
|
} else if (groupingDetails.isVisuallyGrouped && !(0, _utils.isPieType)(type)) {
|
|
554
|
-
data = getVisuallyGroupedData(
|
|
612
|
+
data = getVisuallyGroupedData(dataToProcess, groupingDetails.visualGroupingColumn || "");
|
|
555
613
|
var filteredData = filterDataByRegions(data);
|
|
556
614
|
setProcessedData(transformForRecharts(filteredData));
|
|
557
615
|
} else {
|
|
558
|
-
data = processChartData(
|
|
616
|
+
data = processChartData(dataToProcess);
|
|
559
617
|
var _filteredData = filterDataByRegions(data);
|
|
560
618
|
setProcessedData(transformForRecharts(_filteredData));
|
|
561
619
|
}
|
|
@@ -567,7 +625,7 @@ var WmChart = function WmChart(props) {
|
|
|
567
625
|
} finally {
|
|
568
626
|
setIsLoadInProgress(false);
|
|
569
627
|
}
|
|
570
|
-
}, [binddataset, chartData, getGroupingDetails, getVisuallyGroupedData, processChartData, transformForRecharts, type, xaxisdatakey, yaxisdatakey, filterDataByRegions, props]);
|
|
628
|
+
}, [binddataset, chartData, getGroupingDetails, getVisuallyGroupedData, processChartData, transformForRecharts, type, xaxisdatakey, yaxisdatakey, filterDataByRegions, props, isAggregationEnabled, performClientSideAggregation, datasource]);
|
|
571
629
|
var handleTransform = (0, _react.useCallback)(function () {
|
|
572
630
|
if (onTransform) {
|
|
573
631
|
var transformedData = onTransform({}, props);
|
|
@@ -700,14 +758,106 @@ var WmChart = function WmChart(props) {
|
|
|
700
758
|
}, [binddataset, chartData.length]);
|
|
701
759
|
|
|
702
760
|
// BUG FIX 10: Fixed onSelect event handler
|
|
703
|
-
var handleChartClick = (0, _react.useCallback)(function (data, event) {
|
|
761
|
+
var handleChartClick = (0, _react.useCallback)(function (data, seriesIndex, event) {
|
|
762
|
+
var _ref, _data$payload$x, _data$payload, _data$payload2, _data$payload3;
|
|
704
763
|
if (!data || !onSelect) return;
|
|
705
764
|
var selectedChartItem = data;
|
|
706
|
-
var dataObj = (data === null || data === void 0 ? void 0 : data._dataObj) || data;
|
|
707
|
-
|
|
708
|
-
|
|
765
|
+
var dataObj = (data === null || data === void 0 ? void 0 : data._dataObj) || (data === null || data === void 0 ? void 0 : data.payload) || data;
|
|
766
|
+
|
|
767
|
+
// Get point index from clicked data
|
|
768
|
+
var pointIndex = (_ref = (_data$payload$x = data === null || data === void 0 || (_data$payload = data.payload) === null || _data$payload === void 0 ? void 0 : _data$payload.x) !== null && _data$payload$x !== void 0 ? _data$payload$x : data === null || data === void 0 ? void 0 : data.x) !== null && _ref !== void 0 ? _ref : 0;
|
|
769
|
+
|
|
770
|
+
// Get series name/dataKey
|
|
771
|
+
var seriesName = (data === null || data === void 0 || (_data$payload2 = data.payload) === null || _data$payload2 === void 0 ? void 0 : _data$payload2.seriesName) || (data === null || data === void 0 || (_data$payload3 = data.payload) === null || _data$payload3 === void 0 ? void 0 : _data$payload3.dataKey) || (data === null || data === void 0 ? void 0 : data.dataKey);
|
|
772
|
+
|
|
773
|
+
// Build series data array in Angular nvd3 format: [[x, y], [x, y], ...]
|
|
774
|
+
var seriesData = [];
|
|
775
|
+
if (processedData && seriesName) {
|
|
776
|
+
processedData.forEach(function (item, idx) {
|
|
777
|
+
var _item$x, _item$seriesName;
|
|
778
|
+
var xVal = (_item$x = item.x) !== null && _item$x !== void 0 ? _item$x : idx;
|
|
779
|
+
var yVal = (_item$seriesName = item[seriesName]) !== null && _item$seriesName !== void 0 ? _item$seriesName : 0;
|
|
780
|
+
seriesData.push([xVal, yVal]);
|
|
781
|
+
});
|
|
782
|
+
// Add index property to match Angular format (point index in original data)
|
|
783
|
+
seriesData.index = pointIndex;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
// Enrich dataObj with Angular-compatible properties
|
|
787
|
+
dataObj = _objectSpread(_objectSpread({}, dataObj), {}, {
|
|
788
|
+
data: seriesData,
|
|
789
|
+
point: pointIndex,
|
|
790
|
+
series: seriesIndex !== null && seriesIndex !== void 0 ? seriesIndex : 0
|
|
791
|
+
});
|
|
792
|
+
onSelect === null || onSelect === void 0 || onSelect(event, props, dataObj, _objectSpread(_objectSpread({}, selectedChartItem), {}, {
|
|
793
|
+
data: seriesData,
|
|
794
|
+
point: pointIndex,
|
|
795
|
+
series: seriesIndex !== null && seriesIndex !== void 0 ? seriesIndex : 0
|
|
796
|
+
}));
|
|
797
|
+
}, [onSelect, props, processedData]);
|
|
798
|
+
|
|
799
|
+
// onSelect wrapper for column chart since the props are different can't use the same handleChartClick
|
|
800
|
+
var handleColumnChartSelect = (0, _react.useCallback)(function (colItem, index, event) {
|
|
801
|
+
var _props$xaxisdatakey, _props$yaxisdatakey$s, _props$yaxisdatakey, _colItem$payload;
|
|
802
|
+
if (!colItem || !onSelect) return;
|
|
803
|
+
var payload = colItem === null || colItem === void 0 ? void 0 : colItem.payload;
|
|
804
|
+
var xAxisDataKey = (_props$xaxisdatakey = props === null || props === void 0 ? void 0 : props.xaxisdatakey) !== null && _props$xaxisdatakey !== void 0 ? _props$xaxisdatakey : ""; // location
|
|
805
|
+
var yAxisDataKey = (_props$yaxisdatakey$s = props === null || props === void 0 || (_props$yaxisdatakey = props.yaxisdatakey) === null || _props$yaxisdatakey === void 0 || (_props$yaxisdatakey = _props$yaxisdatakey.split(",")[0]) === null || _props$yaxisdatakey === void 0 ? void 0 : _props$yaxisdatakey.trim()) !== null && _props$yaxisdatakey$s !== void 0 ? _props$yaxisdatakey$s : ""; // budget
|
|
806
|
+
var xAxisDataValue = colItem === null || colItem === void 0 || (_colItem$payload = colItem.payload) === null || _colItem$payload === void 0 ? void 0 : _colItem$payload.x; // Austin
|
|
807
|
+
var yAxisDataValue = 0;
|
|
808
|
+
Object.keys(payload).forEach(function (key) {
|
|
809
|
+
if (key.toLowerCase() === yAxisDataKey.toLowerCase()) {
|
|
810
|
+
yAxisDataValue = payload[key];
|
|
811
|
+
}
|
|
812
|
+
});
|
|
813
|
+
var selectedItem = (0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, xAxisDataKey, xAxisDataValue), yAxisDataKey, yAxisDataValue);
|
|
814
|
+
var selectedChartItem = {
|
|
815
|
+
key: yAxisDataKey,
|
|
816
|
+
series: index,
|
|
817
|
+
seriesIndex: index,
|
|
818
|
+
x: xAxisDataValue,
|
|
819
|
+
y: yAxisDataValue,
|
|
820
|
+
_dataObj: selectedItem
|
|
821
|
+
};
|
|
822
|
+
onSelect === null || onSelect === void 0 || onSelect(event.nativeEvent, props, selectedItem, selectedChartItem);
|
|
709
823
|
}, [onSelect, props]);
|
|
710
824
|
|
|
825
|
+
// onSelect wrapper for area chart since the props are different can't use the same handleChartClick
|
|
826
|
+
var handleAreaChartClick = (0, _react.useCallback)(function (dotProp, dotPropsExtendedWithItem) {
|
|
827
|
+
if (!dotProp || !onSelect) return;
|
|
828
|
+
var value = dotPropsExtendedWithItem === null || dotPropsExtendedWithItem === void 0 ? void 0 : dotPropsExtendedWithItem.value;
|
|
829
|
+
if (!Array.isArray(value) && value.length > 1) return; // type guard
|
|
830
|
+
var selectedChartItem = [{
|
|
831
|
+
x: dotPropsExtendedWithItem === null || dotPropsExtendedWithItem === void 0 ? void 0 : dotPropsExtendedWithItem.index,
|
|
832
|
+
y: value[1],
|
|
833
|
+
series: dotPropsExtendedWithItem === null || dotPropsExtendedWithItem === void 0 ? void 0 : dotPropsExtendedWithItem.payload,
|
|
834
|
+
seriesIndex: dotPropsExtendedWithItem === null || dotPropsExtendedWithItem === void 0 ? void 0 : dotPropsExtendedWithItem.index,
|
|
835
|
+
index: dotPropsExtendedWithItem === null || dotPropsExtendedWithItem === void 0 ? void 0 : dotPropsExtendedWithItem.index,
|
|
836
|
+
display: {
|
|
837
|
+
y: value[1]
|
|
838
|
+
}
|
|
839
|
+
}, dotPropsExtendedWithItem === null || dotPropsExtendedWithItem === void 0 ? void 0 : dotPropsExtendedWithItem.index];
|
|
840
|
+
onSelect === null || onSelect === void 0 || onSelect(dotPropsExtendedWithItem, props, dotProp, selectedChartItem);
|
|
841
|
+
}, [onSelect, props, processedData]);
|
|
842
|
+
|
|
843
|
+
// onSelect wrapper for line chart since the props are different can't use the same handleChartClick
|
|
844
|
+
var handleLineChartSelect = (0, _react.useCallback)(function (dotProp, dotPropsExtendedWithItem) {
|
|
845
|
+
if (!dotProp || !onSelect) return;
|
|
846
|
+
var value = dotPropsExtendedWithItem === null || dotPropsExtendedWithItem === void 0 ? void 0 : dotPropsExtendedWithItem.value;
|
|
847
|
+
if (!Array.isArray(value) && value.length > 1) return; // type guard
|
|
848
|
+
var selectedChartItem = [{
|
|
849
|
+
x: dotPropsExtendedWithItem === null || dotPropsExtendedWithItem === void 0 ? void 0 : dotPropsExtendedWithItem.index,
|
|
850
|
+
y: value,
|
|
851
|
+
series: dotPropsExtendedWithItem === null || dotPropsExtendedWithItem === void 0 ? void 0 : dotPropsExtendedWithItem.payload,
|
|
852
|
+
seriesIndex: dotPropsExtendedWithItem === null || dotPropsExtendedWithItem === void 0 ? void 0 : dotPropsExtendedWithItem.index,
|
|
853
|
+
index: dotPropsExtendedWithItem === null || dotPropsExtendedWithItem === void 0 ? void 0 : dotPropsExtendedWithItem.index,
|
|
854
|
+
display: {
|
|
855
|
+
y: value
|
|
856
|
+
}
|
|
857
|
+
}, dotPropsExtendedWithItem === null || dotPropsExtendedWithItem === void 0 ? void 0 : dotPropsExtendedWithItem.index];
|
|
858
|
+
onSelect === null || onSelect === void 0 || onSelect(dotPropsExtendedWithItem, props, dotProp, selectedChartItem);
|
|
859
|
+
}, [onSelect, props, processedData]);
|
|
860
|
+
|
|
711
861
|
// For Bar charts the categorical axis is Y; reduce label crowding and add ellipsis + tooltip
|
|
712
862
|
var barYAxisExtras = (0, _useBarYAxisExtras.useBarYAxisExtras)({
|
|
713
863
|
type: type,
|
|
@@ -729,26 +879,34 @@ var WmChart = function WmChart(props) {
|
|
|
729
879
|
getDefaultXAxisLabel: getDefaultXAxisLabel,
|
|
730
880
|
xnumberformat: xnumberformat,
|
|
731
881
|
showxaxis: xAxisShow,
|
|
732
|
-
xaxislabeldistance: xaxislabeldistance
|
|
882
|
+
xaxislabeldistance: xaxislabeldistance,
|
|
883
|
+
showxdistance: showxdistance
|
|
733
884
|
});
|
|
734
885
|
var getYAxisConfig = (0, _react.useMemo)(function () {
|
|
735
|
-
|
|
886
|
+
// For Bar charts, YAxis should be category type (handled in BarColumnChart)
|
|
887
|
+
// For other charts, YAxis should be number type
|
|
888
|
+
var axisType = type === "Bar" ? undefined : "number";
|
|
889
|
+
return _objectSpread(_objectSpread(_objectSpread({}, barYAxisExtras), axisType ? {
|
|
890
|
+
type: axisType
|
|
891
|
+
} : {}), {}, {
|
|
736
892
|
hide: !yAxisShow,
|
|
737
893
|
label: {
|
|
894
|
+
value: getDefaultYAxisLabel(),
|
|
738
895
|
angle: -90,
|
|
739
896
|
position: "insideLeft",
|
|
740
|
-
offset: yaxislabeldistance,
|
|
897
|
+
offset: -yaxislabeldistance,
|
|
741
898
|
fill: "#000",
|
|
742
899
|
style: {
|
|
743
900
|
textAnchor: "middle"
|
|
744
901
|
}
|
|
745
902
|
},
|
|
903
|
+
tickLine: showydistance,
|
|
904
|
+
domain: ["dataMin", "dataMax + 100"],
|
|
746
905
|
tick: {
|
|
747
906
|
fontSize: 12,
|
|
748
907
|
fontFamily: "inherit",
|
|
749
908
|
fill: "currentColor"
|
|
750
|
-
}
|
|
751
|
-
}, barYAxisExtras), {}, {
|
|
909
|
+
},
|
|
752
910
|
tickFormatter: function tickFormatter(value, index) {
|
|
753
911
|
if (typeof value === "number") {
|
|
754
912
|
return (0, _utils.formatNumber)(value, ynumberformat);
|
|
@@ -756,7 +914,7 @@ var WmChart = function WmChart(props) {
|
|
|
756
914
|
return value;
|
|
757
915
|
}
|
|
758
916
|
});
|
|
759
|
-
}, [yAxisShow, getDefaultYAxisLabel, ynumberformat, yaxislabeldistance, processedData]);
|
|
917
|
+
}, [type, yAxisShow, getDefaultYAxisLabel, ynumberformat, yaxislabeldistance, processedData, barYAxisExtras]);
|
|
760
918
|
var handleRegionChange = (0, _react.useCallback)(function (region) {
|
|
761
919
|
var isDoubleClick = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
762
920
|
setSelectedRegions(function (prev) {
|
|
@@ -798,8 +956,10 @@ var WmChart = function WmChart(props) {
|
|
|
798
956
|
legendClickTimeoutRef.current = null;
|
|
799
957
|
}, 200);
|
|
800
958
|
}, [handleRegionChange]);
|
|
959
|
+
|
|
960
|
+
// get aggregated data if datasource is enabled and data filtering is enabled
|
|
801
961
|
(0, _react.useEffect)(function () {
|
|
802
|
-
if (binddataset &&
|
|
962
|
+
if (binddataset && dataset && isDataFilteringEnabled()) {
|
|
803
963
|
getAggregatedData(function () {
|
|
804
964
|
return _plotChartProxy();
|
|
805
965
|
});
|
|
@@ -821,6 +981,10 @@ var WmChart = function WmChart(props) {
|
|
|
821
981
|
var strokeWidth = linethickness ? parseInt(linethickness) : 2;
|
|
822
982
|
var pointSize = highlightpoints ? 5 : 0;
|
|
823
983
|
var commonProps = {
|
|
984
|
+
offsettop: offsettop,
|
|
985
|
+
offsetbottom: offsetbottom,
|
|
986
|
+
offsetleft: offsetleft,
|
|
987
|
+
offsetright: offsetright,
|
|
824
988
|
data: processedData,
|
|
825
989
|
dataKeys: dataKeys,
|
|
826
990
|
selectedRegions: selectedRegions,
|
|
@@ -848,13 +1012,13 @@ var WmChart = function WmChart(props) {
|
|
|
848
1012
|
case "Column":
|
|
849
1013
|
return __jsx(_barColumnChart.BarColumnChart, (0, _extends2["default"])({}, commonProps, {
|
|
850
1014
|
type: "Column",
|
|
851
|
-
viewtype: viewtype
|
|
1015
|
+
viewtype: viewtype,
|
|
1016
|
+
onChartClick: handleColumnChartSelect
|
|
852
1017
|
}));
|
|
853
1018
|
case "Bar":
|
|
854
1019
|
return __jsx(_barColumnChart.BarColumnChart, (0, _extends2["default"])({}, commonProps, {
|
|
855
1020
|
type: "Bar",
|
|
856
|
-
viewtype: viewtype
|
|
857
|
-
shouldShowLegend: shouldShowLegend
|
|
1021
|
+
viewtype: viewtype
|
|
858
1022
|
}));
|
|
859
1023
|
case "Line":
|
|
860
1024
|
return __jsx(_lineAreaChart.LineAreaChart, (0, _extends2["default"])({}, commonProps, {
|
|
@@ -863,7 +1027,8 @@ var WmChart = function WmChart(props) {
|
|
|
863
1027
|
strokeWidth: strokeWidth,
|
|
864
1028
|
pointSize: pointSize,
|
|
865
1029
|
legendtype: legendtype,
|
|
866
|
-
availableRegions: availableRegions
|
|
1030
|
+
availableRegions: availableRegions,
|
|
1031
|
+
onChartClick: handleLineChartSelect
|
|
867
1032
|
}));
|
|
868
1033
|
case "Area":
|
|
869
1034
|
return __jsx(_lineAreaChart.LineAreaChart, (0, _extends2["default"])({}, commonProps, {
|
|
@@ -871,7 +1036,8 @@ var WmChart = function WmChart(props) {
|
|
|
871
1036
|
areaViewType: areaviewtype,
|
|
872
1037
|
interpolation: interpolation,
|
|
873
1038
|
strokeWidth: strokeWidth,
|
|
874
|
-
pointSize: pointSize
|
|
1039
|
+
pointSize: pointSize,
|
|
1040
|
+
onAreaSelect: handleAreaChartClick
|
|
875
1041
|
}));
|
|
876
1042
|
case "Cumulative Line":
|
|
877
1043
|
return __jsx(_cumulativeLineChart.CumulativeLineChart, (0, _extends2["default"])({}, commonProps, {
|
|
@@ -915,13 +1081,17 @@ var WmChart = function WmChart(props) {
|
|
|
915
1081
|
return __jsx(_material.Box, {
|
|
916
1082
|
component: "div",
|
|
917
1083
|
className: "app-chart ".concat(className || "", " ").concat(title ? "panel" : ""),
|
|
918
|
-
style: _objectSpread(_objectSpread(
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
1084
|
+
style: _objectSpread(_objectSpread({}, fontStyles), {}, {
|
|
1085
|
+
backgroundPosition: "center",
|
|
1086
|
+
width: (_width = styles === null || styles === void 0 ? void 0 : styles.width) !== null && _width !== void 0 ? _width : width,
|
|
1087
|
+
height: (_height = styles === null || styles === void 0 ? void 0 : styles.height) !== null && _height !== void 0 ? _height : height,
|
|
1088
|
+
minWidth: (_minWidth = styles === null || styles === void 0 ? void 0 : styles.minWidth) !== null && _minWidth !== void 0 ? _minWidth : "300px",
|
|
1089
|
+
overflow: "hidden"
|
|
1090
|
+
}, styles),
|
|
922
1091
|
ref: chartContainerRef,
|
|
923
1092
|
id: "wmChart-".concat(type),
|
|
924
|
-
name: name
|
|
1093
|
+
name: name,
|
|
1094
|
+
hidden: hidden
|
|
925
1095
|
}, title && __jsx(_material.Box, {
|
|
926
1096
|
component: "div",
|
|
927
1097
|
className: "panel-heading"
|
|
@@ -46,6 +46,11 @@ var barSpacingMap = {
|
|
|
46
46
|
medium: 0.5,
|
|
47
47
|
large: 0.8
|
|
48
48
|
};
|
|
49
|
+
var barCategorySpacingPercentage = {
|
|
50
|
+
0.3: "10%",
|
|
51
|
+
0.5: "20%",
|
|
52
|
+
0.8: "30%"
|
|
53
|
+
};
|
|
49
54
|
var donutRatioMap = {
|
|
50
55
|
small: 0.3,
|
|
51
56
|
medium: 0.6,
|
|
@@ -489,6 +494,12 @@ var getLodashOrderByFormat = exports.getLodashOrderByFormat = function getLodash
|
|
|
489
494
|
};
|
|
490
495
|
};
|
|
491
496
|
var getBarSpacingValue = exports.getBarSpacingValue = function getBarSpacingValue(value, prop) {
|
|
497
|
+
if (!isNaN(+value)) {
|
|
498
|
+
if (Number.isFinite(+value)) {
|
|
499
|
+
var _barCategorySpacingPe;
|
|
500
|
+
return (_barCategorySpacingPe = barCategorySpacingPercentage[+value]) !== null && _barCategorySpacingPe !== void 0 ? _barCategorySpacingPe : +value * 100;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
492
503
|
if (prop === "value") {
|
|
493
504
|
return barSpacingMap[value];
|
|
494
505
|
}
|
|
@@ -649,7 +660,7 @@ var getLegendPopupStyle = exports.getLegendPopupStyle = function getLegendPopupS
|
|
|
649
660
|
case "bottom":
|
|
650
661
|
return _objectSpread(_objectSpread({}, baseStyle), {}, {
|
|
651
662
|
right: "3%",
|
|
652
|
-
bottom: "
|
|
663
|
+
bottom: "9%",
|
|
653
664
|
width: "80%",
|
|
654
665
|
display: "flex",
|
|
655
666
|
flexWrap: "wrap",
|
package/components/constants.js
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.progressBarConstants = exports.isVideoFile = exports.isImageFile = exports.isDocumentFile = exports.isDataFile = exports.isAudioFile = exports.isArchiveFile = exports.getFileIconClass = exports.getFileExtension = exports.fileUploadConstants = exports.defaultItems = exports.currencyConstants = void 0;
|
|
6
|
+
exports.progressBarConstants = exports.isVideoFile = exports.isImageFile = exports.isDocumentFile = exports.isDataFile = exports.isAudioFile = exports.isArchiveFile = exports.getFileIconClass = exports.getFileExtension = exports.fileUploadConstants = exports.defaultItems = exports.currencyConstants = exports.DEFAULT_CHIPS_DATASET = exports.ALL_FIELDS = void 0;
|
|
7
7
|
var _lodashEs = require("lodash-es");
|
|
8
8
|
//Radioset Constants
|
|
9
9
|
|
|
10
|
+
var ALL_FIELDS = exports.ALL_FIELDS = "All Fields";
|
|
10
11
|
var defaultItems = exports.defaultItems = [{
|
|
11
12
|
key: "Option 1",
|
|
12
13
|
value: "Option 1",
|
|
@@ -24,6 +25,7 @@ var defaultItems = exports.defaultItems = [{
|
|
|
24
25
|
selected: false
|
|
25
26
|
}];
|
|
26
27
|
var progressBarConstants = exports.progressBarConstants = {
|
|
28
|
+
DEFAULT_DATAVALUE: 30,
|
|
27
29
|
DEFAULT_TYPE: "default",
|
|
28
30
|
DEFAULT_CAPTION_PLACEMENT: "hidden",
|
|
29
31
|
DEFAULT_MIN_VALUE: 0,
|
|
@@ -1205,4 +1207,5 @@ var getFileIconClass = exports.getFileIconClass = function getFileIconClass(file
|
|
|
1205
1207
|
return "fa fa-file-audio-o";
|
|
1206
1208
|
}
|
|
1207
1209
|
return "fa fa-file-o"; // Default icon
|
|
1208
|
-
};
|
|
1210
|
+
};
|
|
1211
|
+
var DEFAULT_CHIPS_DATASET = exports.DEFAULT_CHIPS_DATASET = ["Option 1", "Option 2", "Option 3"];
|
|
@@ -51,21 +51,26 @@ var WmAccordionPane = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
51
51
|
}, [props.onLoad]);
|
|
52
52
|
return __jsx(_accordion.Accordion.Root, {
|
|
53
53
|
tabIndex: props.tabindex,
|
|
54
|
-
className: (0, _clsx["default"])(DEFAULT_CLASS, props.className,
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
className: (0, _clsx["default"])(DEFAULT_CLASS, props.className),
|
|
55
|
+
name: props.name,
|
|
56
|
+
hidden: props.hidden || false,
|
|
57
|
+
show: props.show || true
|
|
57
58
|
}, __jsx(_AccordionSummary["default"], {
|
|
58
|
-
className: "panel-heading clearfix",
|
|
59
|
+
className: (0, _clsx["default"])("panel-heading clearfix", {
|
|
60
|
+
active: props.active
|
|
61
|
+
}),
|
|
59
62
|
onClick: handleToggle,
|
|
60
63
|
onKeyDown: handleKeyDown,
|
|
61
64
|
tabIndex: props.tabindex,
|
|
62
65
|
"aria-expanded": props.active,
|
|
63
|
-
component: "div"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
component: "div"
|
|
67
|
+
}, __jsx(_Typography["default"], {
|
|
68
|
+
className: "panel-title",
|
|
69
|
+
variant: "h3",
|
|
70
|
+
component: "h3"
|
|
71
|
+
}, __jsx(_Typography["default"], {
|
|
72
|
+
className: "accordion-toggle clearfix",
|
|
73
|
+
component: "a"
|
|
69
74
|
}, props.iconclass && __jsx("div", {
|
|
70
75
|
className: "pull-left"
|
|
71
76
|
}, __jsx("i", {
|
|
@@ -94,8 +99,8 @@ var WmAccordionPane = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
94
99
|
variant: "body2",
|
|
95
100
|
className: "app-icon panel-action wi"
|
|
96
101
|
}, __jsx("i", {
|
|
97
|
-
className: (0, _clsx["default"])(
|
|
98
|
-
}))))), __jsx(_AccordionDetails["default"], {
|
|
102
|
+
className: (0, _clsx["default"])(props.active ? "wi-minus" : "wi-plus")
|
|
103
|
+
})))))), __jsx(_AccordionDetails["default"], {
|
|
99
104
|
className: (0, _clsx["default"])("panel-collapse collapse", {
|
|
100
105
|
"in": props.active
|
|
101
106
|
})
|
|
@@ -12,7 +12,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
12
12
|
var _isArray = _interopRequireDefault(require("lodash-es/isArray"));
|
|
13
13
|
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/withBaseWrapper"));
|
|
14
14
|
var _accordionPane = _interopRequireDefault(require("./accordion-pane"));
|
|
15
|
-
var
|
|
15
|
+
var _props3 = require("./props");
|
|
16
16
|
var _statePersistance = require("@wavemaker/react-runtime/utils/state-persistance");
|
|
17
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
18
18
|
var __jsx = _react["default"].createElement;
|
|
@@ -20,7 +20,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
20
20
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
21
|
var DEFAULT_CLASS = "app-accordion panel-group";
|
|
22
22
|
var WmAccordion = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
23
|
-
var props = _objectSpread(_objectSpread({},
|
|
23
|
+
var props = _objectSpread(_objectSpread({}, _props3.DEFAULT_PROPS), Props);
|
|
24
24
|
var isMounted = (0, _react.useRef)(false);
|
|
25
25
|
var _useState = (0, _react.useState)(props.defaultpaneindex || 0),
|
|
26
26
|
activePaneIndex = _useState[0],
|
|
@@ -199,7 +199,9 @@ var WmAccordion = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
199
199
|
}
|
|
200
200
|
return props.type === "static" ? _react["default"].Children.map(props.children, function (child, index) {
|
|
201
201
|
if (/*#__PURE__*/_react["default"].isValidElement(child) && child.type === _accordionPane["default"]) {
|
|
202
|
+
var _props, _props2;
|
|
202
203
|
return /*#__PURE__*/_react["default"].cloneElement(child, {
|
|
204
|
+
key: "".concat(props.name, "-").concat(index, "-").concat(((_props = child.props) === null || _props === void 0 ? void 0 : _props.name) || ((_props2 = child.props) === null || _props2 === void 0 ? void 0 : _props2.id)),
|
|
203
205
|
active: activePanes.has(index),
|
|
204
206
|
toggle: function toggle(event, name) {
|
|
205
207
|
return handlePaneToggle(index, !activePanes.has(index), event, name);
|
|
@@ -220,10 +222,13 @@ var WmAccordion = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
220
222
|
style: props.styles,
|
|
221
223
|
id: (props === null || props === void 0 ? void 0 : props.id) || (props === null || props === void 0 ? void 0 : props.name),
|
|
222
224
|
"data-type": "accordion",
|
|
223
|
-
"data-statehandler": props.statehandler
|
|
225
|
+
"data-statehandler": props.statehandler,
|
|
226
|
+
name: props.name,
|
|
227
|
+
hidden: props.hidden || false,
|
|
228
|
+
show: props.show || true
|
|
224
229
|
}, renderPanes());
|
|
225
230
|
}, function (prevProps, nextProps) {
|
|
226
|
-
var keys = ["dataset", "defaultpaneindex", "closeothers", "children"];
|
|
231
|
+
var keys = ["dataset", "defaultpaneindex", "closeothers", "children", "hidden", "show"];
|
|
227
232
|
return keys.every(function (key) {
|
|
228
233
|
return prevProps[key] === nextProps[key];
|
|
229
234
|
});
|