@pie-element/match 12.1.1-next.11 → 12.1.2-next.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/configure.js +2 -0
- package/controller.js +1 -0
- package/dist/author/add-row.d.ts +17 -0
- package/dist/author/add-row.js +24 -0
- package/dist/author/answer-config-block.d.ts +36 -0
- package/dist/author/answer-config-block.js +176 -0
- package/dist/author/common.d.ts +22 -0
- package/dist/author/configure.d.ts +48 -0
- package/dist/author/configure.js +259 -0
- package/dist/author/defaults.d.ts +203 -0
- package/dist/author/defaults.js +151 -0
- package/dist/author/general-config-block.d.ts +22 -0
- package/dist/author/general-config-block.js +93 -0
- package/dist/author/index.d.ts +44 -0
- package/dist/author/index.js +78 -0
- package/dist/author/row.d.ts +51 -0
- package/dist/author/row.js +204 -0
- package/dist/author/utils.d.ts +10 -0
- package/dist/author/utils.js +10 -0
- package/dist/browser/Typography-CbSskKxx.js +9217 -0
- package/dist/browser/Typography-CbSskKxx.js.map +1 -0
- package/dist/browser/author/index.js +42080 -0
- package/dist/browser/author/index.js.map +1 -0
- package/dist/browser/browser-kkT1XVKw.js +210 -0
- package/dist/browser/browser-kkT1XVKw.js.map +1 -0
- package/dist/browser/controller/index.js +267 -0
- package/dist/browser/controller/index.js.map +1 -0
- package/dist/browser/delivery/index.js +1984 -0
- package/dist/browser/delivery/index.js.map +1 -0
- package/dist/browser/isEqual-xtQxYITi.js +856 -0
- package/dist/browser/isEqual-xtQxYITi.js.map +1 -0
- package/dist/browser/match.css +2 -0
- package/dist/controller/defaults.d.ts +27 -0
- package/dist/controller/defaults.js +25 -0
- package/dist/controller/index.d.ts +29 -0
- package/dist/controller/index.js +156 -0
- package/dist/delivery/answer-grid.d.ts +28 -0
- package/dist/delivery/answer-grid.js +99 -0
- package/dist/delivery/index.d.ts +21 -0
- package/dist/delivery/index.js +51 -0
- package/dist/delivery/main.d.ts +26 -0
- package/dist/delivery/main.js +112 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.iife.d.ts +8 -0
- package/dist/index.iife.js +148 -0
- package/dist/index.js +2 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +57 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSet.js +22 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +35 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +35 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +32 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +23 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +33 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +21 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/set.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +7 -0
- package/package.json +82 -19
- package/CHANGELOG.json +0 -1462
- package/CHANGELOG.md +0 -2327
- package/LICENSE.md +0 -5
- package/README.md +0 -1
- package/configure/CHANGELOG.json +0 -892
- package/configure/CHANGELOG.md +0 -2030
- package/configure/lib/add-row.js +0 -40
- package/configure/lib/add-row.js.map +0 -1
- package/configure/lib/answer-config-block.js +0 -288
- package/configure/lib/answer-config-block.js.map +0 -1
- package/configure/lib/common.js +0 -31
- package/configure/lib/common.js.map +0 -1
- package/configure/lib/configure.js +0 -410
- package/configure/lib/configure.js.map +0 -1
- package/configure/lib/defaults.js +0 -201
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/general-config-block.js +0 -144
- package/configure/lib/general-config-block.js.map +0 -1
- package/configure/lib/index.js +0 -152
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/row.js +0 -321
- package/configure/lib/row.js.map +0 -1
- package/configure/lib/utils.js +0 -12
- package/configure/lib/utils.js.map +0 -1
- package/configure/package.json +0 -29
- package/configure/utils.js +0 -19
- package/controller/CHANGELOG.json +0 -502
- package/controller/CHANGELOG.md +0 -1359
- package/controller/lib/defaults.js +0 -25
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -424
- package/controller/lib/index.js.map +0 -1
- package/controller/package.json +0 -24
- package/docs/config-schema.json +0 -2929
- package/docs/config-schema.json.md +0 -2162
- package/docs/demo/config.js +0 -8
- package/docs/demo/generate.js +0 -49
- package/docs/demo/index.html +0 -1
- package/docs/demo/session.js +0 -11
- package/docs/pie-schema.json +0 -1530
- package/docs/pie-schema.json.md +0 -907
- package/lib/answer-grid.js +0 -166
- package/lib/answer-grid.js.map +0 -1
- package/lib/index.js +0 -85
- package/lib/index.js.map +0 -1
- package/lib/main.js +0 -163
- package/lib/main.js.map +0 -1
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import { color as n } from "@pie-lib/render-ui";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import a from "@mui/material/Radio";
|
|
6
|
+
import { styled as o } from "@mui/material/styles";
|
|
7
|
+
import s from "debug";
|
|
8
|
+
import { AlertDialog as c, Checkbox as l } from "@pie-lib/config-ui";
|
|
9
|
+
import u, { DEFAULT_PLUGINS as d } from "@pie-lib/editable-html-tip-tap";
|
|
10
|
+
import f from "@mui/icons-material/DragHandle";
|
|
11
|
+
import p from "@mui/material/IconButton";
|
|
12
|
+
import m from "@mui/icons-material/Delete";
|
|
13
|
+
import { useDraggable as h, useDroppable as g } from "@dnd-kit/core";
|
|
14
|
+
//#region src/author/row.tsx
|
|
15
|
+
s("@pie-element:categorize:configure:choice");
|
|
16
|
+
var _ = o("span")({ cursor: "move" }), v = o("div")(({ theme: e }) => ({
|
|
17
|
+
marginTop: e.spacing(2),
|
|
18
|
+
display: "flex",
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
flex: 1
|
|
21
|
+
})), y = o("div")(({ theme: e }) => ({
|
|
22
|
+
flex: 1,
|
|
23
|
+
display: "flex",
|
|
24
|
+
justifyContent: "center",
|
|
25
|
+
alignItems: "center",
|
|
26
|
+
minWidth: "120px",
|
|
27
|
+
padding: `0 ${e.spacing(1)}`
|
|
28
|
+
})), b = o(a)(({ theme: e, error: t }) => ({
|
|
29
|
+
"& input": { width: "100% !important" },
|
|
30
|
+
"&.MuiRadio-root": { color: `${t ? e.palette.error.main : n.tertiary()} !important` }
|
|
31
|
+
})), x = o("div")(({ theme: e }) => ({
|
|
32
|
+
flex: .5,
|
|
33
|
+
display: "flex",
|
|
34
|
+
justifyContent: "center",
|
|
35
|
+
minWidth: "45px",
|
|
36
|
+
padding: `0 ${e.spacing(1)}`
|
|
37
|
+
})), S = o(y)(({ theme: e }) => ({
|
|
38
|
+
flex: 2,
|
|
39
|
+
display: "flex",
|
|
40
|
+
justifyContent: "flex-start",
|
|
41
|
+
padding: 0,
|
|
42
|
+
maxWidth: "unset",
|
|
43
|
+
textAlign: "left",
|
|
44
|
+
minWidth: "200px",
|
|
45
|
+
marginRight: e.spacing(1),
|
|
46
|
+
"&> div": { width: "100%" }
|
|
47
|
+
})), C = o("hr")(({ theme: e }) => ({
|
|
48
|
+
marginTop: e.spacing(2),
|
|
49
|
+
border: 0,
|
|
50
|
+
borderTop: `2px solid ${e.palette.grey.A100}`,
|
|
51
|
+
width: "100%"
|
|
52
|
+
})), w = o("div")(({ theme: e }) => ({
|
|
53
|
+
fontSize: e.typography.fontSize - 2,
|
|
54
|
+
color: e.palette.error.main,
|
|
55
|
+
paddingTop: e.spacing(1)
|
|
56
|
+
})), T = class extends e.Component {
|
|
57
|
+
static propTypes = {
|
|
58
|
+
model: t.object.isRequired,
|
|
59
|
+
row: t.object.isRequired,
|
|
60
|
+
idx: t.number.isRequired,
|
|
61
|
+
maxImageWidth: t.object,
|
|
62
|
+
maxImageHeight: t.object,
|
|
63
|
+
onDeleteRow: t.func.isRequired,
|
|
64
|
+
onChange: t.func.isRequired,
|
|
65
|
+
imageSupport: t.shape({
|
|
66
|
+
add: t.func.isRequired,
|
|
67
|
+
delete: t.func.isRequired
|
|
68
|
+
}),
|
|
69
|
+
uploadSoundSupport: t.shape({
|
|
70
|
+
add: t.func.isRequired,
|
|
71
|
+
delete: t.func.isRequired
|
|
72
|
+
}),
|
|
73
|
+
inputConfiguration: t.object,
|
|
74
|
+
toolbarOpts: t.object,
|
|
75
|
+
error: t.string,
|
|
76
|
+
spellCheck: t.bool,
|
|
77
|
+
minQuestions: t.number
|
|
78
|
+
};
|
|
79
|
+
static defaultProps = {};
|
|
80
|
+
state = { dialog: {
|
|
81
|
+
open: !1,
|
|
82
|
+
text: ""
|
|
83
|
+
} };
|
|
84
|
+
componentDidMount() {
|
|
85
|
+
document.addEventListener("mouseup", this.onMouseUpOnHandle);
|
|
86
|
+
}
|
|
87
|
+
onRowTitleChange = (e) => (t) => {
|
|
88
|
+
let { model: n, onChange: r } = this.props, i = { ...n };
|
|
89
|
+
i.rows[e].title = t, r(i);
|
|
90
|
+
};
|
|
91
|
+
onRowValueChange = (e, t) => (n) => {
|
|
92
|
+
let { model: r, onChange: i } = this.props, a = { ...r };
|
|
93
|
+
if (r.choiceMode === "radio") for (let t = 0; t < a.rows[e].values.length; t++) a.rows[e].values[t] = !1;
|
|
94
|
+
a.rows[e].values[t] = n.target.checked, i(a);
|
|
95
|
+
};
|
|
96
|
+
onDeleteRow = (e) => () => {
|
|
97
|
+
let { model: t, onDeleteRow: n, minQuestions: r } = this.props;
|
|
98
|
+
t.rows && t.rows.length === r ? this.setState({ dialog: {
|
|
99
|
+
open: !0,
|
|
100
|
+
text: `There should be at least ${r} question row` + (r > 1 ? "s" : "") + "."
|
|
101
|
+
} }) : n(e);
|
|
102
|
+
};
|
|
103
|
+
onMouseDownOnHandle = () => {};
|
|
104
|
+
onMouseUpOnHandle = () => {};
|
|
105
|
+
render() {
|
|
106
|
+
let { imageSupport: e, model: t, row: n, idx: a, inputConfiguration: o = {}, toolbarOpts: s, spellCheck: h, error: g, maxImageWidth: T, maxImageHeight: E, uploadSoundSupport: D, mathMlOptions: O = {} } = this.props, { dialog: k } = this.state, A = (d || []).filter((e) => e !== "bulleted-list" && e !== "numbered-list");
|
|
107
|
+
return /* @__PURE__ */ i("div", {
|
|
108
|
+
style: { width: "100%" },
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ r(_, {
|
|
111
|
+
itemID: "handle",
|
|
112
|
+
onMouseDown: this.onMouseDownOnHandle,
|
|
113
|
+
children: /* @__PURE__ */ r(f, { color: "primary" })
|
|
114
|
+
}),
|
|
115
|
+
/* @__PURE__ */ i(v, { children: [
|
|
116
|
+
/* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(u, {
|
|
117
|
+
imageSupport: e,
|
|
118
|
+
autoWidthToolbar: !0,
|
|
119
|
+
disableUnderline: !0,
|
|
120
|
+
label: "label",
|
|
121
|
+
markup: n.title,
|
|
122
|
+
onChange: this.onRowTitleChange(a),
|
|
123
|
+
pluginProps: o,
|
|
124
|
+
toolbarOpts: s,
|
|
125
|
+
activePlugins: A,
|
|
126
|
+
spellCheck: h,
|
|
127
|
+
maxImageWidth: T,
|
|
128
|
+
maxImageHeight: E,
|
|
129
|
+
uploadSoundSupport: D,
|
|
130
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
131
|
+
error: g && g !== "No correct response defined.",
|
|
132
|
+
mathMlOptions: O
|
|
133
|
+
}) }),
|
|
134
|
+
n.values.map((e, n) => /* @__PURE__ */ r(y, { children: t.choiceMode === "radio" ? /* @__PURE__ */ r(b, {
|
|
135
|
+
error: g?.includes("No correct response defined."),
|
|
136
|
+
onChange: this.onRowValueChange(a, n),
|
|
137
|
+
checked: e === !0
|
|
138
|
+
}) : /* @__PURE__ */ r(l, {
|
|
139
|
+
onChange: this.onRowValueChange(a, n),
|
|
140
|
+
checked: e === !0,
|
|
141
|
+
label: "",
|
|
142
|
+
error: g?.includes("No correct response defined.")
|
|
143
|
+
}) }, n)),
|
|
144
|
+
/* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(p, {
|
|
145
|
+
onClick: this.onDeleteRow(a),
|
|
146
|
+
"aria-label": "Delete",
|
|
147
|
+
size: "large",
|
|
148
|
+
children: /* @__PURE__ */ r(m, {})
|
|
149
|
+
}) })
|
|
150
|
+
] }),
|
|
151
|
+
g && /* @__PURE__ */ r(w, { children: g }),
|
|
152
|
+
/* @__PURE__ */ r(C, {}),
|
|
153
|
+
/* @__PURE__ */ r(c, {
|
|
154
|
+
open: k.open,
|
|
155
|
+
title: "Warning",
|
|
156
|
+
text: k.text,
|
|
157
|
+
onConfirm: () => this.setState({ dialog: { open: !1 } })
|
|
158
|
+
})
|
|
159
|
+
]
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
function E(e) {
|
|
164
|
+
let { attributes: t, listeners: n, setNodeRef: i, transform: a, transition: o, isDragging: s } = h({
|
|
165
|
+
id: `row-${e.row.id}`,
|
|
166
|
+
data: {
|
|
167
|
+
type: "row",
|
|
168
|
+
index: e.idx,
|
|
169
|
+
id: e.row.id
|
|
170
|
+
}
|
|
171
|
+
}), { setNodeRef: c, isOver: l } = g({
|
|
172
|
+
id: `row-drop-${e.row.id}`,
|
|
173
|
+
data: {
|
|
174
|
+
type: "row",
|
|
175
|
+
index: e.idx,
|
|
176
|
+
id: e.row.id
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
return /* @__PURE__ */ r("div", {
|
|
180
|
+
ref: c,
|
|
181
|
+
style: {
|
|
182
|
+
transform: a ? `translate3d(${a.x}px, ${a.y}px, 0)` : void 0,
|
|
183
|
+
transition: o,
|
|
184
|
+
opacity: s ? .5 : 1,
|
|
185
|
+
backgroundColor: l ? "rgba(0, 0, 0, 0.1)" : "transparent"
|
|
186
|
+
},
|
|
187
|
+
children: /* @__PURE__ */ r("div", {
|
|
188
|
+
ref: i,
|
|
189
|
+
...n,
|
|
190
|
+
onKeyDown: (e) => {
|
|
191
|
+
let t = e.target;
|
|
192
|
+
t.closest("[contenteditable]") || t.closest("input") || t.closest("textarea") || t.isContentEditable || n?.onKeyDown?.(e);
|
|
193
|
+
},
|
|
194
|
+
onPointerDown: (e) => {
|
|
195
|
+
let t = e.target;
|
|
196
|
+
t.closest("[contenteditable]") || t.closest("input") || t.closest("textarea") || t.isContentEditable || n?.onPointerDown?.(e);
|
|
197
|
+
},
|
|
198
|
+
...t,
|
|
199
|
+
children: /* @__PURE__ */ r(T, { ...e })
|
|
200
|
+
})
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
export { E as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/match/configure/src/utils.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getPluginProps: (props?: {}, baseInputConfiguration?: {}) => {};
|
|
10
|
+
export declare const generateValidationMessage: (model: any, configuration: any) => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/author/utils.ts
|
|
2
|
+
var e = (e = {}, t = {}) => ({
|
|
3
|
+
...t,
|
|
4
|
+
...e
|
|
5
|
+
}), t = (e, t) => {
|
|
6
|
+
let { choiceMode: n } = e, { minQuestions: r, maxQuestions: i, maxAnswers: a } = t, o = `\nThere should be at least ${r}` + (i ? ` and at most ${i}` : "") + " question row" + (r > 1 || i ? "s." : ".") + "\nRow and column headings should be non-blank and unique. \nFirst column heading is excluded from validation." + (a ? `\nThere should be at most ${a} answer choices.` : ""), s = n === "radio" ? "\nThere should be a correct response defined for every row." : "\nThere should be at least one correct response defined for every row.";
|
|
7
|
+
return "Validation requirements:" + o + s;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as generateValidationMessage, e as getPluginProps };
|