| 1 | "use strict";
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports.updateOptions = exports.rootPropsReducer = exports.initialState = void 0;
|
|---|
| 7 | var _toolkit = require("@reduxjs/toolkit");
|
|---|
| 8 | /**
|
|---|
| 9 | * These are chart options that users can choose - which means they can also
|
|---|
| 10 | * choose to change them which should trigger a re-render.
|
|---|
| 11 | */
|
|---|
| 12 |
|
|---|
| 13 | var initialState = exports.initialState = {
|
|---|
| 14 | accessibilityLayer: true,
|
|---|
| 15 | barCategoryGap: '10%',
|
|---|
| 16 | barGap: 4,
|
|---|
| 17 | barSize: undefined,
|
|---|
| 18 | className: undefined,
|
|---|
| 19 | maxBarSize: undefined,
|
|---|
| 20 | stackOffset: 'none',
|
|---|
| 21 | syncId: undefined,
|
|---|
| 22 | syncMethod: 'index',
|
|---|
| 23 | baseValue: undefined,
|
|---|
| 24 | reverseStackOrder: false
|
|---|
| 25 | };
|
|---|
| 26 | var rootPropsSlice = (0, _toolkit.createSlice)({
|
|---|
| 27 | name: 'rootProps',
|
|---|
| 28 | initialState,
|
|---|
| 29 | reducers: {
|
|---|
| 30 | updateOptions: (state, action) => {
|
|---|
| 31 | var _action$payload$barGa;
|
|---|
| 32 | state.accessibilityLayer = action.payload.accessibilityLayer;
|
|---|
| 33 | state.barCategoryGap = action.payload.barCategoryGap;
|
|---|
| 34 | state.barGap = (_action$payload$barGa = action.payload.barGap) !== null && _action$payload$barGa !== void 0 ? _action$payload$barGa : initialState.barGap;
|
|---|
| 35 | state.barSize = action.payload.barSize;
|
|---|
| 36 | state.maxBarSize = action.payload.maxBarSize;
|
|---|
| 37 | state.stackOffset = action.payload.stackOffset;
|
|---|
| 38 | state.syncId = action.payload.syncId;
|
|---|
| 39 | state.syncMethod = action.payload.syncMethod;
|
|---|
| 40 | state.className = action.payload.className;
|
|---|
| 41 | state.baseValue = action.payload.baseValue;
|
|---|
| 42 | state.reverseStackOrder = action.payload.reverseStackOrder;
|
|---|
| 43 | }
|
|---|
| 44 | }
|
|---|
| 45 | });
|
|---|
| 46 | var rootPropsReducer = exports.rootPropsReducer = rootPropsSlice.reducer;
|
|---|
| 47 | var {
|
|---|
| 48 | updateOptions
|
|---|
| 49 | } = rootPropsSlice.actions;
|
|---|
| 50 | exports.updateOptions = updateOptions; |
|---|