@pie-element/charting 12.1.2-next.0 → 12.1.2-next.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/author/charting-config.js +4 -4
- package/dist/author/configure.js +3 -3
- package/dist/author/correct-response.js +39 -40
- package/dist/author/index.d.ts +1 -0
- package/dist/author/index.js +5 -2
- package/dist/author/utils.js +2 -2
- package/dist/browser/author/index.js +2254 -310
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/{chart-Dghjf6JQ.js → chart-CqKCTwCe.js} +44492 -47179
- package/dist/browser/chart-CqKCTwCe.js.map +1 -0
- package/dist/browser/controller/index.js +68 -107
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +83 -65
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/dist-D6aoYeoC.js +334 -0
- package/dist/browser/dist-D6aoYeoC.js.map +1 -0
- package/dist/controller/index.js +14 -16
- package/dist/delivery/index.d.ts +3 -0
- package/dist/delivery/index.js +25 -7
- package/dist/delivery/main.js +47 -47
- package/dist/index.iife.js +111 -109
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +20 -17
- package/dist/browser/_baseSet-Cse6EM9A.js +0 -1015
- package/dist/browser/_baseSet-Cse6EM9A.js.map +0 -1
- package/dist/browser/chart-Dghjf6JQ.js.map +0 -1
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePick.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePickBy.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSet.js +0 -22
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_flatRest.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js +0 -18
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/flatten.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/pick.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
|
@@ -16,10 +16,10 @@ var u = n("div")(({ theme: e }) => ({
|
|
|
16
16
|
if (!e) return t;
|
|
17
17
|
let n = [];
|
|
18
18
|
return (t || []).forEach((t, r) => {
|
|
19
|
-
let { editable: i, interactive: a } = t;
|
|
19
|
+
let { editable: i, interactive: a } = t, o = i && e[r]?.label ? e[r].label : t.label, s = a && e[r]?.value ? e[r].value : t.value;
|
|
20
20
|
n[r] = {
|
|
21
|
-
label:
|
|
22
|
-
value:
|
|
21
|
+
label: o,
|
|
22
|
+
value: s,
|
|
23
23
|
editable: t.editable,
|
|
24
24
|
interactive: t.interactive
|
|
25
25
|
};
|
|
@@ -123,4 +123,4 @@ var u = n("div")(({ theme: e }) => ({
|
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
125
|
//#endregion
|
|
126
|
-
export { h as default };
|
|
126
|
+
export { h as ChartingConfig, h as default };
|
package/dist/author/configure.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import e from "./charting-config.js";
|
|
2
|
-
import t from "./correct-response.js";
|
|
1
|
+
import { ChartingConfig as e } from "./charting-config.js";
|
|
2
|
+
import { CorrectResponse as t } from "./correct-response.js";
|
|
3
3
|
import { applyConstraints as n, getGridValues as r, getLabelValues as i } from "./utils.js";
|
|
4
4
|
import a from "react";
|
|
5
5
|
import o from "prop-types";
|
|
@@ -202,4 +202,4 @@ var _ = f("@pie-element:graphing:configure"), { Panel: te, toggle: v, radio: ne,
|
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
204
|
//#endregion
|
|
205
|
-
export { C as default };
|
|
205
|
+
export { C as Configure, C as default };
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import
|
|
4
|
-
import r from "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Chart as s } from "@pie-lib/charting";
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import { styled as n } from "@mui/material/styles";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { Chart as a } from "@pie-lib/charting";
|
|
6
|
+
import { cloneDeep as o, isEqual as s } from "@pie-element/shared-lodash";
|
|
8
7
|
import c from "@mui/material/Typography";
|
|
9
8
|
//#region src/author/correct-response.tsx
|
|
10
|
-
var l =
|
|
9
|
+
var l = n("div")(({ theme: e }) => ({
|
|
11
10
|
marginBottom: e.spacing(2.5),
|
|
12
11
|
display: "flex",
|
|
13
12
|
flex: 1
|
|
14
|
-
})), u =
|
|
13
|
+
})), u = n("div")({ flex: 1 }), d = n("div")(({ theme: e }) => ({ border: `2px solid ${e.palette.error.main}` })), f = n(c)(({ theme: e }) => ({
|
|
15
14
|
fontSize: e.typography.fontSize - 2,
|
|
16
15
|
color: e.palette.error.main,
|
|
17
16
|
paddingTop: e.spacing(1)
|
|
18
|
-
})), p =
|
|
17
|
+
})), p = n("div")(({ theme: e }) => ({ marginBottom: e.spacing(1) })), m = (e, t) => e.map((e, n) => ({
|
|
19
18
|
...e,
|
|
20
19
|
editable: n < t.length ? t[n].editable : !0,
|
|
21
20
|
interactive: n < t.length ? t[n].interactive : !0,
|
|
@@ -24,10 +23,10 @@ var l = i("div")(({ theme: e }) => ({
|
|
|
24
23
|
if (!e) return t;
|
|
25
24
|
let n = [...e], r = [];
|
|
26
25
|
if ((t || []).forEach((t, n) => {
|
|
27
|
-
let i = t.editable, a = t.interactive;
|
|
26
|
+
let i = t.editable, a = t.interactive, o = i && e[n]?.label ? e[n].label : t.label, s = a && e[n]?.value || a && e[n]?.value == 0 ? e[n].value : t.value;
|
|
28
27
|
r[n] = {
|
|
29
|
-
label:
|
|
30
|
-
value:
|
|
28
|
+
label: o,
|
|
29
|
+
value: s,
|
|
31
30
|
editable: t.editable,
|
|
32
31
|
interactive: t.interactive
|
|
33
32
|
};
|
|
@@ -39,26 +38,26 @@ var l = i("div")(({ theme: e }) => ({
|
|
|
39
38
|
}, g = (e, t) => {
|
|
40
39
|
let n = t.length - 1, { editable: r, interactive: i, deletable: a, ...o } = t[t.length - 1];
|
|
41
40
|
return (e || []).splice(n, 0, o), m([...e], t);
|
|
42
|
-
}, _ = (e, t, n) => ((e || []).splice(n, 1), m([...e], t)), v = (t, n
|
|
43
|
-
let
|
|
44
|
-
if (
|
|
45
|
-
if (
|
|
46
|
-
let e =
|
|
47
|
-
for (let t = 0; t <
|
|
41
|
+
}, _ = (e, t, n) => ((e || []).splice(n, 1), m([...e], t)), v = (e, t, n) => {
|
|
42
|
+
let r = e && e.model && e.model.data || [], i = t && t.model && t.model.data || [], a = o(e && e.model && e.model.correctAnswer && e.model.correctAnswer.data || []), s = o(n ? n.categories : []), c = [];
|
|
43
|
+
if (r.length > i.length) return c = g(a, r), c;
|
|
44
|
+
if (r.length < i.length) {
|
|
45
|
+
let e = r.length;
|
|
46
|
+
for (let t = 0; t < r.length; t++) if (r[t].index !== t) {
|
|
48
47
|
e = t;
|
|
49
48
|
break;
|
|
50
49
|
}
|
|
51
|
-
return c = _(s,
|
|
50
|
+
return c = _(s, r, e), c;
|
|
52
51
|
}
|
|
53
|
-
return c = h(
|
|
54
|
-
}, y = class extends
|
|
52
|
+
return c = h(a, r), c;
|
|
53
|
+
}, y = class extends e.Component {
|
|
55
54
|
static propTypes = {
|
|
56
|
-
correctAnswerErrors:
|
|
57
|
-
studentNewCategoryDefaultLabel:
|
|
58
|
-
model:
|
|
59
|
-
onChange:
|
|
60
|
-
charts:
|
|
61
|
-
error:
|
|
55
|
+
correctAnswerErrors: t.object,
|
|
56
|
+
studentNewCategoryDefaultLabel: t.string,
|
|
57
|
+
model: t.object.isRequired,
|
|
58
|
+
onChange: t.func.isRequired,
|
|
59
|
+
charts: t.array,
|
|
60
|
+
error: t.string
|
|
62
61
|
};
|
|
63
62
|
constructor(e) {
|
|
64
63
|
super(e), this.state = { categories: [] };
|
|
@@ -77,19 +76,19 @@ var l = i("div")(({ theme: e }) => ({
|
|
|
77
76
|
let e = v(this.props, this.props, null);
|
|
78
77
|
this.setState({ categories: e || h(this.props.model.correctAnswer.data, this.props.model.data) });
|
|
79
78
|
}
|
|
80
|
-
componentDidUpdate(e,
|
|
81
|
-
let
|
|
82
|
-
|
|
79
|
+
componentDidUpdate(e, t) {
|
|
80
|
+
let n = v(this.props, e, t);
|
|
81
|
+
n && !s(n, this.state.categories) && (this.changeData(n), this.setState({ categories: n }));
|
|
83
82
|
}
|
|
84
83
|
render() {
|
|
85
|
-
let { model: e, charts: t, error: n, studentNewCategoryDefaultLabel:
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
84
|
+
let { model: e, charts: t, error: n, studentNewCategoryDefaultLabel: o, correctAnswerErrors: s, mathMlOptions: m = {}, labelsPlaceholders: h = {} } = this.props, { categories: g } = this.state, { domain: _ = {}, range: v = {} } = e || {}, { identicalError: y, categoriesError: b } = s || {};
|
|
85
|
+
return /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r(p, { children: "Define Correct Response" }), /* @__PURE__ */ r(l, { children: /* @__PURE__ */ i(u, { children: [
|
|
86
|
+
/* @__PURE__ */ r(c, {
|
|
88
87
|
component: "div",
|
|
89
88
|
type: "body1",
|
|
90
|
-
children: /* @__PURE__ */
|
|
89
|
+
children: /* @__PURE__ */ r("span", { children: "Use the tools below to define the correct answer." })
|
|
91
90
|
}),
|
|
92
|
-
|
|
91
|
+
r(y || b ? d : "div", { children: /* @__PURE__ */ r(a, {
|
|
93
92
|
chartType: e.chartType,
|
|
94
93
|
size: e.graph,
|
|
95
94
|
domain: _,
|
|
@@ -99,18 +98,18 @@ var l = i("div")(({ theme: e }) => ({
|
|
|
99
98
|
title: e.title,
|
|
100
99
|
onDataChange: this.changeData,
|
|
101
100
|
addCategoryEnabled: e.addCategoryEnabled,
|
|
102
|
-
categoryDefaultLabel:
|
|
101
|
+
categoryDefaultLabel: o,
|
|
103
102
|
error: n,
|
|
104
103
|
mathMlOptions: m,
|
|
105
104
|
labelsPlaceholders: h
|
|
106
105
|
}) }, `correct-response-graph-${e.correctAnswer.name}`),
|
|
107
|
-
(y || b) && /* @__PURE__ */
|
|
106
|
+
(y || b) && /* @__PURE__ */ r(f, {
|
|
108
107
|
component: "div",
|
|
109
108
|
type: "body1",
|
|
110
|
-
children: /* @__PURE__ */
|
|
109
|
+
children: /* @__PURE__ */ r("span", { children: y || b })
|
|
111
110
|
})
|
|
112
111
|
] }, "graph") })] });
|
|
113
112
|
}
|
|
114
113
|
};
|
|
115
114
|
//#endregion
|
|
116
|
-
export { y as default };
|
|
115
|
+
export { y as CorrectResponse, y as default, v as getUpdatedCategories };
|
package/dist/author/index.d.ts
CHANGED
package/dist/author/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e from "./configure.js";
|
|
1
|
+
import { Configure as e } from "./configure.js";
|
|
2
2
|
import t from "./defaults.js";
|
|
3
3
|
import n from "react";
|
|
4
4
|
import { createRoot as r } from "react-dom/client";
|
|
@@ -66,8 +66,11 @@ var d = a("pie-elements:graphing:configure"), f = class a extends HTMLElement {
|
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
+
connectedCallback() {
|
|
70
|
+
this._render();
|
|
71
|
+
}
|
|
69
72
|
disconnectedCallback() {
|
|
70
|
-
this._root
|
|
73
|
+
this._root &&= (this._root.unmount(), null);
|
|
71
74
|
}
|
|
72
75
|
};
|
|
73
76
|
//#endregion
|
package/dist/author/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e from "
|
|
1
|
+
import { isEqual as e } from "@pie-element/shared-lodash";
|
|
2
2
|
//#region src/author/utils.ts
|
|
3
3
|
var t = [
|
|
4
4
|
.01,
|
|
@@ -241,4 +241,4 @@ var t = [
|
|
|
241
241
|
};
|
|
242
242
|
};
|
|
243
243
|
//#endregion
|
|
244
|
-
export { o as applyConstraints, i as getGridValues, a as getLabelValues };
|
|
244
|
+
export { r as VALID_LABEL_VALUES, o as applyConstraints, i as getGridValues, a as getLabelValues };
|