@pie-element/multi-trait-rubric 8.1.1 → 8.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/common.d.ts +90 -0
- package/dist/author/common.js +275 -0
- package/dist/author/defaults.d.ts +153 -0
- package/dist/author/defaults.js +113 -0
- package/dist/author/index.d.ts +22 -0
- package/dist/author/index.js +89 -0
- package/dist/author/main.d.ts +43 -0
- package/dist/author/main.js +249 -0
- package/dist/author/modals.d.ts +94 -0
- package/dist/author/modals.js +171 -0
- package/dist/author/scale.d.ts +46 -0
- package/dist/author/scale.js +280 -0
- package/dist/author/trait.d.ts +70 -0
- package/dist/author/trait.js +202 -0
- package/dist/author/traitsHeader.d.ts +28 -0
- package/dist/author/traitsHeader.js +172 -0
- package/dist/author/utils.d.ts +10 -0
- package/dist/author/utils.js +41 -0
- package/dist/browser/Typography-CdgSBeUZ.js +8984 -0
- package/dist/browser/Typography-CdgSBeUZ.js.map +1 -0
- package/dist/browser/author/index.js +42899 -0
- package/dist/browser/author/index.js.map +1 -0
- package/dist/browser/controller/index.js +70 -0
- package/dist/browser/controller/index.js.map +1 -0
- package/dist/browser/delivery/index.js +523 -0
- package/dist/browser/delivery/index.js.map +1 -0
- package/dist/browser/multi-trait-rubric.css +2 -0
- package/dist/controller/defaults.d.ts +20 -0
- package/dist/controller/defaults.js +14 -0
- package/dist/controller/index.d.ts +26 -0
- package/dist/controller/index.js +57 -0
- package/dist/controller/utils.d.ts +9 -0
- package/dist/controller/utils.js +4 -0
- package/dist/delivery/index.d.ts +17 -0
- package/dist/delivery/index.js +37 -0
- package/dist/delivery/main.d.ts +15 -0
- package/dist/delivery/main.js +95 -0
- package/dist/delivery/scale.d.ts +17 -0
- package/dist/delivery/scale.js +175 -0
- package/dist/delivery/trait.d.ts +27 -0
- package/dist/delivery/trait.js +44 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.iife.d.ts +8 -0
- package/dist/index.iife.js +145 -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/_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/_arrayPush.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/_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/_baseTimes.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js +8 -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/_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/_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/_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/_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/_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/_toSource.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js +8 -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/debounce.js +50 -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/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/now.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/toNumber.js +19 -0
- package/package.json +80 -14
- package/CHANGELOG.json +0 -1
- package/CHANGELOG.md +0 -1584
- package/LICENSE.md +0 -5
- package/README.md +0 -55
- package/configure/CHANGELOG.json +0 -1
- package/configure/CHANGELOG.md +0 -1479
- package/configure/lib/common.js +0 -424
- package/configure/lib/common.js.map +0 -1
- package/configure/lib/defaults.js +0 -184
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/index.js +0 -157
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/main.js +0 -454
- package/configure/lib/main.js.map +0 -1
- package/configure/lib/modals.js +0 -206
- package/configure/lib/modals.js.map +0 -1
- package/configure/lib/scale.js +0 -478
- package/configure/lib/scale.js.map +0 -1
- package/configure/lib/trait.js +0 -275
- package/configure/lib/trait.js.map +0 -1
- package/configure/lib/traitsHeader.js +0 -235
- package/configure/lib/traitsHeader.js.map +0 -1
- package/configure/lib/utils.js +0 -87
- package/configure/lib/utils.js.map +0 -1
- package/configure/package.json +0 -24
- package/controller/CHANGELOG.json +0 -1
- package/controller/CHANGELOG.md +0 -911
- package/controller/lib/defaults.js +0 -18
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -158
- package/controller/lib/index.js.map +0 -1
- package/controller/lib/utils.js +0 -11
- package/controller/lib/utils.js.map +0 -1
- package/controller/package.json +0 -14
- package/docs/config-schema.json +0 -1628
- package/docs/config-schema.json.md +0 -1202
- package/docs/demo/config.js +0 -8
- package/docs/demo/generate.js +0 -117
- package/docs/demo/index.html +0 -1
- package/docs/demo/session.js +0 -6
- package/docs/pie-schema.json +0 -861
- package/docs/pie-schema.json.md +0 -614
- package/lib/index.js +0 -54
- package/lib/index.js.map +0 -1
- package/lib/main.js +0 -123
- package/lib/main.js.map +0 -1
- package/lib/scale.js +0 -248
- package/lib/scale.js.map +0 -1
- package/lib/trait.js +0 -83
- package/lib/trait.js.map +0 -1
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { DecreaseMaxPoints as e, DeleteScale as t, DeleteTrait as n, InfoDialog as r } from "./modals.js";
|
|
2
|
+
import { Arrow as i, MultiTraitButton as a } from "./common.js";
|
|
3
|
+
import o from "./traitsHeader.js";
|
|
4
|
+
import s from "./trait.js";
|
|
5
|
+
import c from "react";
|
|
6
|
+
import l from "prop-types";
|
|
7
|
+
import { styled as u } from "@mui/material/styles";
|
|
8
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
+
import p from "@mui/icons-material/ArrowBackIos";
|
|
10
|
+
import m from "@mui/icons-material/ArrowForwardIos";
|
|
11
|
+
import { DragProvider as h } from "@pie-lib/drag";
|
|
12
|
+
//#region src/author/scale.tsx
|
|
13
|
+
var g = 216, _ = u("div")(({ theme: e }) => ({
|
|
14
|
+
display: "flex",
|
|
15
|
+
flexDirection: "column",
|
|
16
|
+
wordBreak: "break-word",
|
|
17
|
+
position: "relative",
|
|
18
|
+
marginBottom: e.spacing(2.5)
|
|
19
|
+
})), v = class extends c.Component {
|
|
20
|
+
state = {
|
|
21
|
+
showDecreaseMaxPointsDialog: !1,
|
|
22
|
+
showDeleteScaleDialog: !1,
|
|
23
|
+
showDeleteTraitDialog: !1,
|
|
24
|
+
currentPosition: 0,
|
|
25
|
+
showRight: null,
|
|
26
|
+
showLeft: null,
|
|
27
|
+
showInfoDialog: !1,
|
|
28
|
+
infoDialogText: ""
|
|
29
|
+
};
|
|
30
|
+
set = (e) => this.setState(e);
|
|
31
|
+
componentDidMount() {
|
|
32
|
+
this.state.showRight === null && this.secondaryBlockRef && this.setState({ showRight: this.getMaxScroll() });
|
|
33
|
+
}
|
|
34
|
+
componentDidUpdate(e) {
|
|
35
|
+
(e.scale.maxPoints !== this.props.scale.maxPoints || e.showDescription !== this.props.showDescription || e.excludeZero !== this.props.excludeZero) && this.setState({ showRight: this.getMaxScroll() });
|
|
36
|
+
}
|
|
37
|
+
UNSAFE_componentWillReceiveProps(e) {
|
|
38
|
+
(e.excludeZero !== this.props.excludeZero || e.showStandards !== this.props.showStandards || e.showDescription !== this.props.showDescription) && this.setState({
|
|
39
|
+
currentPosition: 0,
|
|
40
|
+
showLeft: !1,
|
|
41
|
+
showRight: this.getMaxScroll()
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
updateMaxPointsFieldValue = ({ target: e }) => {
|
|
45
|
+
let { scale: t, scaleIndex: n, onScaleChanged: r } = this.props || {}, { maxPoints: i } = t, a = parseInt(e.value, 10);
|
|
46
|
+
this.setState({
|
|
47
|
+
currentPosition: 0,
|
|
48
|
+
showLeft: !1,
|
|
49
|
+
showRight: this.getMaxScroll()
|
|
50
|
+
}), a < i ? this.showDecreaseMaxPointsModal({ newMaxPoints: a }) : r(n, { maxPoints: a });
|
|
51
|
+
};
|
|
52
|
+
showDecreaseMaxPointsModal = ({ newMaxPoints: e }) => this.set({
|
|
53
|
+
showDecreaseMaxPointsDialog: !0,
|
|
54
|
+
newMaxPoints: e
|
|
55
|
+
});
|
|
56
|
+
hideDecreaseMaxPointsModal = () => this.set({
|
|
57
|
+
showDecreaseMaxPointsDialog: !1,
|
|
58
|
+
newMaxPoints: void 0
|
|
59
|
+
});
|
|
60
|
+
changeMaxPoints = () => {
|
|
61
|
+
let { newMaxPoints: e } = this.state || {}, { scaleIndex: t, onScaleChanged: n } = this.props || {};
|
|
62
|
+
e && n(t, { maxPoints: e }), this.hideDecreaseMaxPointsModal();
|
|
63
|
+
};
|
|
64
|
+
showDeleteScaleModal = () => this.set({ showDeleteScaleDialog: !0 });
|
|
65
|
+
hideDeleteScaleModal = () => this.set({ showDeleteScaleDialog: !1 });
|
|
66
|
+
deleteScale = () => {
|
|
67
|
+
let { scaleIndex: e, onScaleRemoved: t } = this.props || {};
|
|
68
|
+
this.hideDeleteScaleModal(), t(e);
|
|
69
|
+
};
|
|
70
|
+
showDeleteTraitModal = (e) => this.set({
|
|
71
|
+
showDeleteTraitDialog: !0,
|
|
72
|
+
traitToDeleteIndex: e
|
|
73
|
+
});
|
|
74
|
+
hideDeleteTraitModal = () => this.set({
|
|
75
|
+
showDeleteTraitDialog: !1,
|
|
76
|
+
traitToDeleteIndex: void 0
|
|
77
|
+
});
|
|
78
|
+
onTraitRemoved = () => {
|
|
79
|
+
let { traitToDeleteIndex: e } = this.state, { scale: t, scaleIndex: n, onScaleChanged: r, minNoOfTraits: i } = this.props || {}, { traits: a, traitLabel: o } = t || {};
|
|
80
|
+
if (!(e < 0 || e >= a.length)) {
|
|
81
|
+
if (a.length === i) return this.set({
|
|
82
|
+
infoDialogText: `There can't be less than ${i} ${(o || "trait").toLowerCase()}s.`,
|
|
83
|
+
showInfoDialog: !0
|
|
84
|
+
}), !1;
|
|
85
|
+
a = [...a.slice(0, e), ...a.slice(e + 1)], r(n, { traits: a }), this.hideDeleteTraitModal();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
onTraitAdded = () => {
|
|
89
|
+
let { scale: e, scaleIndex: t, onScaleChanged: n, maxNoOfTraits: r } = this.props || {}, { traits: i, scorePointsLabels: a } = e || {};
|
|
90
|
+
if (i.length === r) return this.set({
|
|
91
|
+
infoDialogText: `There can't be more than ${r} scales.`,
|
|
92
|
+
showInfoDialog: !0
|
|
93
|
+
}), !1;
|
|
94
|
+
i.push({
|
|
95
|
+
name: "",
|
|
96
|
+
description: "",
|
|
97
|
+
standards: [],
|
|
98
|
+
scorePointsDescriptors: Array.from({ length: a.length }, () => "")
|
|
99
|
+
}), n(t, { traits: i });
|
|
100
|
+
};
|
|
101
|
+
onTraitChanged = (e, t) => {
|
|
102
|
+
let { scale: n, scaleIndex: r, onScaleChanged: i } = this.props || {}, { traits: a } = n || {};
|
|
103
|
+
e >= 0 && e < a.length && (a[e] = t, i(r, { traits: a }));
|
|
104
|
+
};
|
|
105
|
+
onTraitDropped = (e) => {
|
|
106
|
+
let { active: t, over: n } = e;
|
|
107
|
+
if (!n || !t) return;
|
|
108
|
+
let r = t.data.current, i = n.data.current;
|
|
109
|
+
if (r?.type === "trait" && i?.type === "trait") {
|
|
110
|
+
let e = r.index, t = i.index;
|
|
111
|
+
if (e === t) return;
|
|
112
|
+
let { scale: n, scaleIndex: a, onScaleChanged: o } = this.props || {}, { traits: s } = n || {}, c = s[e], l = s.filter((t, n) => n !== e);
|
|
113
|
+
o(a, { traits: [
|
|
114
|
+
...l.slice(0, t),
|
|
115
|
+
c,
|
|
116
|
+
...l.slice(t)
|
|
117
|
+
] });
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
decreasePosition = () => {
|
|
121
|
+
let { currentPosition: e } = this.state, t = Math.max(e - g, 0), n = this.getMaxScroll();
|
|
122
|
+
this.setState({
|
|
123
|
+
currentPosition: t,
|
|
124
|
+
showRight: t < n,
|
|
125
|
+
showLeft: t > 0
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
getMaxScroll = () => {
|
|
129
|
+
if (!this.secondaryBlockRef) return 0;
|
|
130
|
+
let e = this.secondaryBlockRef.scrollWidth, t = this.getNumberOfBlocks() * 200;
|
|
131
|
+
return Math.max(0, Math.min(e, t) - this.secondaryBlockRef.offsetWidth);
|
|
132
|
+
};
|
|
133
|
+
getNumberOfBlocks = () => {
|
|
134
|
+
let { scale: e, showStandards: t, showDescription: n, excludeZero: r } = this.props, { maxPoints: i } = e || {}, a = i - +!!r + 1;
|
|
135
|
+
return +!!t + +!!n + a;
|
|
136
|
+
};
|
|
137
|
+
increasePosition = () => {
|
|
138
|
+
let { currentPosition: e } = this.state, t = this.getMaxScroll(), n = Math.min(e + g, t);
|
|
139
|
+
this.setState({
|
|
140
|
+
currentPosition: n,
|
|
141
|
+
showRight: n < t,
|
|
142
|
+
showLeft: n > 0
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
render() {
|
|
146
|
+
let { errors: c, scale: l, scaleIndex: u, showStandards: v, onScaleChanged: y, excludeZero: b, showDescription: x, showLevelTagInput: S, showScorePointLabels: C, enableDragAndDrop: w, spellCheck: T, width: E, uploadSoundSupport: D, maxPointsEnabled: O, mathMlOptions: k = {}, maxMaxPoints: A, expandedPluginProps: j = {}, labelPluginProps: M = {}, imageSupport: N = {} } = this.props || {}, { maxPoints: P, scorePointsLabels: F, traitLabel: I, traits: L } = l || {}, { showDecreaseMaxPointsDialog: R, showDeleteScaleDialog: z, showDeleteTraitDialog: B, currentPosition: V, showRight: H, showLeft: U, showInfoDialog: W, infoDialogText: G } = this.state, { traitsErrors: K, scorePointsErrors: q } = c || {}, J = K && K[u] || {}, Y = q && q[u] || {}, X = [], Z = parseInt(E) - 32 - 200 || 320;
|
|
147
|
+
for (let e = P; +(e >= b); --e) X.push(e);
|
|
148
|
+
return /* @__PURE__ */ d(h, {
|
|
149
|
+
onDragEnd: this.onTraitDropped,
|
|
150
|
+
children: /* @__PURE__ */ f(_, {
|
|
151
|
+
ref: (e) => {
|
|
152
|
+
this.scaleWrapper = e;
|
|
153
|
+
},
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ d(o, {
|
|
156
|
+
setSecondaryBlockRef: (e) => {
|
|
157
|
+
e && (this.secondaryBlockRef = e);
|
|
158
|
+
},
|
|
159
|
+
errors: Y,
|
|
160
|
+
traitLabel: I,
|
|
161
|
+
scorePointsValues: X,
|
|
162
|
+
scorePointsLabels: F,
|
|
163
|
+
onScaleChange: (e) => y(u, e),
|
|
164
|
+
onTraitLabelChange: (e) => y(u, { traitLabel: e }),
|
|
165
|
+
showStandards: v,
|
|
166
|
+
showDescription: x,
|
|
167
|
+
showLevelTagInput: S,
|
|
168
|
+
showScorePointLabels: C,
|
|
169
|
+
maxPoints: P,
|
|
170
|
+
updateMaxPointsFieldValue: this.updateMaxPointsFieldValue,
|
|
171
|
+
scaleIndex: u,
|
|
172
|
+
showDeleteScaleModal: this.showDeleteScaleModal,
|
|
173
|
+
currentPosition: V,
|
|
174
|
+
secondaryBlockWidth: Z,
|
|
175
|
+
spellCheck: T,
|
|
176
|
+
uploadSoundSupport: D,
|
|
177
|
+
maxPointsEnabled: O,
|
|
178
|
+
mathMlOptions: k,
|
|
179
|
+
maxMaxPoints: A,
|
|
180
|
+
expandedPluginProps: j,
|
|
181
|
+
labelPluginProps: M,
|
|
182
|
+
imageSupport: N
|
|
183
|
+
}, "header-key"),
|
|
184
|
+
L.map((e, t) => /* @__PURE__ */ d(s, {
|
|
185
|
+
index: t,
|
|
186
|
+
error: J && J[t],
|
|
187
|
+
trait: e,
|
|
188
|
+
traitLabel: I || "Trait",
|
|
189
|
+
scorePointsValues: X,
|
|
190
|
+
scorePointsLabels: F,
|
|
191
|
+
onTraitRemoved: () => this.showDeleteTraitModal(t),
|
|
192
|
+
onTraitChanged: (e) => this.onTraitChanged(t, e),
|
|
193
|
+
showStandards: v,
|
|
194
|
+
showDescription: x,
|
|
195
|
+
maxPoints: P,
|
|
196
|
+
currentPosition: V,
|
|
197
|
+
enableDragAndDrop: w,
|
|
198
|
+
secondaryBlockWidth: Z,
|
|
199
|
+
spellCheck: T,
|
|
200
|
+
uploadSoundSupport: D,
|
|
201
|
+
mathMlOptions: k,
|
|
202
|
+
expandedPluginProps: j,
|
|
203
|
+
labelPluginProps: M,
|
|
204
|
+
imageSupport: N
|
|
205
|
+
}, t)),
|
|
206
|
+
/* @__PURE__ */ d(i, {
|
|
207
|
+
width: `${g / 2}px`,
|
|
208
|
+
show: U,
|
|
209
|
+
onClick: this.decreasePosition,
|
|
210
|
+
left: "200px",
|
|
211
|
+
showLevelTagInput: S,
|
|
212
|
+
children: /* @__PURE__ */ d(p, {})
|
|
213
|
+
}),
|
|
214
|
+
/* @__PURE__ */ d(i, {
|
|
215
|
+
width: `${g / 2}px`,
|
|
216
|
+
show: H,
|
|
217
|
+
onClick: this.increasePosition,
|
|
218
|
+
showLevelTagInput: S,
|
|
219
|
+
children: /* @__PURE__ */ d(m, {})
|
|
220
|
+
}),
|
|
221
|
+
/* @__PURE__ */ d(a, {
|
|
222
|
+
onClick: this.onTraitAdded,
|
|
223
|
+
children: /* @__PURE__ */ d("div", { dangerouslySetInnerHTML: { __html: `Add ${I || " Trait"}` } })
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ d(e, {
|
|
226
|
+
open: !!R,
|
|
227
|
+
deleteScorePoints: this.changeMaxPoints,
|
|
228
|
+
cancel: this.hideDecreaseMaxPointsModal
|
|
229
|
+
}),
|
|
230
|
+
/* @__PURE__ */ d(t, {
|
|
231
|
+
open: !!z,
|
|
232
|
+
scaleIndex: u,
|
|
233
|
+
deleteScale: this.deleteScale,
|
|
234
|
+
cancel: this.hideDeleteScaleModal
|
|
235
|
+
}),
|
|
236
|
+
/* @__PURE__ */ d(n, {
|
|
237
|
+
open: !!B,
|
|
238
|
+
deleteTrait: this.onTraitRemoved,
|
|
239
|
+
cancel: this.hideDeleteTraitModal,
|
|
240
|
+
traitLabel: I.toLowerCase()
|
|
241
|
+
}),
|
|
242
|
+
/* @__PURE__ */ d(r, {
|
|
243
|
+
open: W,
|
|
244
|
+
text: G,
|
|
245
|
+
onClose: () => this.set({ showInfoDialog: !1 })
|
|
246
|
+
})
|
|
247
|
+
]
|
|
248
|
+
}, `scale-${u}`)
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
v.propTypes = {
|
|
253
|
+
errors: l.object,
|
|
254
|
+
scale: l.shape({
|
|
255
|
+
maxPoints: l.number,
|
|
256
|
+
scorePointsLabels: l.arrayOf(l.string),
|
|
257
|
+
traitLabel: l.string,
|
|
258
|
+
traits: l.arrayOf(l.shape({
|
|
259
|
+
name: l.string,
|
|
260
|
+
standards: l.arrayOf(l.string),
|
|
261
|
+
scorePointsDescriptors: l.arrayOf(l.string),
|
|
262
|
+
description: l.string
|
|
263
|
+
}))
|
|
264
|
+
}),
|
|
265
|
+
width: l.string,
|
|
266
|
+
excludeZero: l.bool,
|
|
267
|
+
scaleIndex: l.number,
|
|
268
|
+
onScaleChanged: l.func,
|
|
269
|
+
onScaleRemoved: l.func,
|
|
270
|
+
showStandards: l.bool,
|
|
271
|
+
showLevelTagInput: l.bool,
|
|
272
|
+
showDescription: l.bool,
|
|
273
|
+
uploadSoundSupport: l.object,
|
|
274
|
+
showScorePointLabels: l.bool,
|
|
275
|
+
enableDragAndDrop: l.bool,
|
|
276
|
+
expandedPluginProps: l.object,
|
|
277
|
+
labelPluginProps: l.object
|
|
278
|
+
};
|
|
279
|
+
//#endregion
|
|
280
|
+
export { v as default };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/multi-trait-rubric/configure/src/trait.jsx
|
|
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
|
+
import React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
declare function TraitTile({ error, trait: { name, standards, description, scorePointsDescriptors }, traitLabel, scorePointsValues, showStandards, showDescription, enableDragAndDrop, currentPosition, secondaryBlockWidth, spellCheck, maxPoints, uploadSoundSupport, mathMlOptions, expandedPluginProps, labelPluginProps, imageSupport, index, onTraitChanged, onTraitRemoved, onTraitDropped, }: {
|
|
12
|
+
error: any;
|
|
13
|
+
trait: {
|
|
14
|
+
name: any;
|
|
15
|
+
standards: any;
|
|
16
|
+
description: any;
|
|
17
|
+
scorePointsDescriptors: any;
|
|
18
|
+
};
|
|
19
|
+
traitLabel: any;
|
|
20
|
+
scorePointsValues: any;
|
|
21
|
+
showStandards: any;
|
|
22
|
+
showDescription: any;
|
|
23
|
+
enableDragAndDrop: any;
|
|
24
|
+
currentPosition: any;
|
|
25
|
+
secondaryBlockWidth: any;
|
|
26
|
+
spellCheck: any;
|
|
27
|
+
maxPoints: any;
|
|
28
|
+
uploadSoundSupport: any;
|
|
29
|
+
mathMlOptions?: {} | undefined;
|
|
30
|
+
expandedPluginProps?: {} | undefined;
|
|
31
|
+
labelPluginProps?: {} | undefined;
|
|
32
|
+
imageSupport?: {} | undefined;
|
|
33
|
+
index: any;
|
|
34
|
+
onTraitChanged: any;
|
|
35
|
+
onTraitRemoved: any;
|
|
36
|
+
onTraitDropped: any;
|
|
37
|
+
}): React.JSX.Element;
|
|
38
|
+
declare namespace TraitTile {
|
|
39
|
+
var propTypes: {
|
|
40
|
+
error: PropTypes.Requireable<object>;
|
|
41
|
+
index: PropTypes.Validator<number>;
|
|
42
|
+
onTraitChanged: PropTypes.Validator<(...args: any[]) => any>;
|
|
43
|
+
onTraitRemoved: PropTypes.Validator<(...args: any[]) => any>;
|
|
44
|
+
onTraitDropped: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
|
+
trait: PropTypes.Requireable<PropTypes.InferProps<{
|
|
46
|
+
name: PropTypes.Requireable<string>;
|
|
47
|
+
standards: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
48
|
+
scorePointsDescriptors: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
49
|
+
description: PropTypes.Requireable<string>;
|
|
50
|
+
}>>;
|
|
51
|
+
traitLabel: PropTypes.Requireable<string>;
|
|
52
|
+
scorePointsValues: PropTypes.Requireable<(number | null | undefined)[]>;
|
|
53
|
+
showStandards: PropTypes.Requireable<boolean>;
|
|
54
|
+
showDescription: PropTypes.Requireable<boolean>;
|
|
55
|
+
maxPoints: PropTypes.Requireable<number>;
|
|
56
|
+
enableDragAndDrop: PropTypes.Requireable<boolean>;
|
|
57
|
+
currentPosition: PropTypes.Requireable<number>;
|
|
58
|
+
secondaryBlockWidth: PropTypes.Requireable<number>;
|
|
59
|
+
spellCheck: PropTypes.Requireable<boolean>;
|
|
60
|
+
uploadSoundSupport: PropTypes.Requireable<object>;
|
|
61
|
+
mathMlOptions: PropTypes.Requireable<object>;
|
|
62
|
+
expandedPluginProps: PropTypes.Requireable<object>;
|
|
63
|
+
labelPluginProps: PropTypes.Requireable<object>;
|
|
64
|
+
imageSupport: PropTypes.Requireable<PropTypes.InferProps<{
|
|
65
|
+
add: PropTypes.Validator<(...args: any[]) => any>;
|
|
66
|
+
delete: PropTypes.Validator<(...args: any[]) => any>;
|
|
67
|
+
}>>;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export default TraitTile;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
|
|
2
|
+
import { Block as t, ExpandedInput as n, PrimaryBlock as r, Row as i, SecondaryBlock as a, UnderlinedInput as o } from "./common.js";
|
|
3
|
+
import s from "react";
|
|
4
|
+
import c from "prop-types";
|
|
5
|
+
import { styled as l } from "@mui/material/styles";
|
|
6
|
+
import { InlineMenu as u, color as d } from "@pie-lib/render-ui";
|
|
7
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
|
+
import m from "@mui/material/IconButton";
|
|
9
|
+
import h from "@mui/material/MenuItem";
|
|
10
|
+
import g from "@mui/icons-material/MoreVert";
|
|
11
|
+
import _ from "debug";
|
|
12
|
+
import { useDraggable as v, useDroppable as y } from "@dnd-kit/core";
|
|
13
|
+
import b from "@mui/icons-material/DragIndicator";
|
|
14
|
+
//#region src/author/trait.tsx
|
|
15
|
+
_("@pie-element:placement-ordering:configure:trait-tile");
|
|
16
|
+
var x = l(b)({ color: d.text() }), S = l(r)(({ theme: e }) => ({
|
|
17
|
+
display: "flex",
|
|
18
|
+
flexDirection: "column",
|
|
19
|
+
justifyContent: "space-between",
|
|
20
|
+
marginBottom: e.spacing(5),
|
|
21
|
+
touchAction: "none"
|
|
22
|
+
})), C = l("div")({
|
|
23
|
+
display: "flex",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
width: "100%",
|
|
26
|
+
cursor: "pointer"
|
|
27
|
+
}), w = l(m)({ marginLeft: "auto" }), T = l("div")({
|
|
28
|
+
display: "flex",
|
|
29
|
+
whiteSpace: "break-spaces"
|
|
30
|
+
}), E = l("div")(({ theme: e }) => ({
|
|
31
|
+
fontSize: e.typography.fontSize - 2,
|
|
32
|
+
color: e.palette.error.main,
|
|
33
|
+
paddingBottom: e.spacing(1)
|
|
34
|
+
}));
|
|
35
|
+
function D({ error: r, trait: { name: c, standards: l, description: d, scorePointsDescriptors: m }, traitLabel: _, scorePointsValues: b, showStandards: D, showDescription: O, enableDragAndDrop: k, currentPosition: A, secondaryBlockWidth: j, spellCheck: M, maxPoints: ee, uploadSoundSupport: N, mathMlOptions: P = {}, expandedPluginProps: F = {}, labelPluginProps: I = {}, imageSupport: L = {}, index: R, onTraitChanged: z, onTraitRemoved: B, onTraitDropped: te }) {
|
|
36
|
+
let [V, H] = s.useState(null), U = s.useRef(null), { attributes: W, listeners: G, setNodeRef: K, transform: q, isDragging: J } = v({
|
|
37
|
+
id: `trait-${R}`,
|
|
38
|
+
data: {
|
|
39
|
+
type: "trait",
|
|
40
|
+
index: R,
|
|
41
|
+
name: c
|
|
42
|
+
}
|
|
43
|
+
}), { setNodeRef: Y } = y({
|
|
44
|
+
id: `trait-drop-${R}`,
|
|
45
|
+
data: {
|
|
46
|
+
type: "trait",
|
|
47
|
+
index: R
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
s.useLayoutEffect(() => {
|
|
51
|
+
A !== void 0 && U.current && U.current.scrollTo({ left: A });
|
|
52
|
+
}, [A]);
|
|
53
|
+
let X = (t) => {
|
|
54
|
+
e(t) || z({
|
|
55
|
+
name: c,
|
|
56
|
+
standards: l,
|
|
57
|
+
description: d,
|
|
58
|
+
scorePointsDescriptors: m,
|
|
59
|
+
...t
|
|
60
|
+
});
|
|
61
|
+
}, Z = ({ descriptor: e, value: t }) => {
|
|
62
|
+
if (t < 0 || t >= m.length) return;
|
|
63
|
+
let n = [...m];
|
|
64
|
+
n[t] = e, X({ scorePointsDescriptors: n });
|
|
65
|
+
}, Q = (e) => H(e.currentTarget), $ = () => H(null), ne = () => {
|
|
66
|
+
B(), $();
|
|
67
|
+
};
|
|
68
|
+
return /* @__PURE__ */ f("div", {
|
|
69
|
+
ref: Y,
|
|
70
|
+
style: q ? {
|
|
71
|
+
transform: `translate3d(${q.x}px, ${q.y}px, 0)`,
|
|
72
|
+
opacity: J ? .5 : 1
|
|
73
|
+
} : {},
|
|
74
|
+
children: /* @__PURE__ */ p(i, { children: [/* @__PURE__ */ p(S, { children: [
|
|
75
|
+
/* @__PURE__ */ p(C, { children: [
|
|
76
|
+
k && /* @__PURE__ */ f("span", {
|
|
77
|
+
ref: K,
|
|
78
|
+
...W,
|
|
79
|
+
...G,
|
|
80
|
+
children: /* @__PURE__ */ f(x, {})
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ f(w, {
|
|
83
|
+
"aria-label": "more",
|
|
84
|
+
"aria-controls": "long-menu",
|
|
85
|
+
"aria-haspopup": "true",
|
|
86
|
+
onClick: Q,
|
|
87
|
+
size: "large",
|
|
88
|
+
children: /* @__PURE__ */ f(g, {})
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ f(u, {
|
|
91
|
+
id: "long-menu",
|
|
92
|
+
anchorEl: V,
|
|
93
|
+
keepMounted: !0,
|
|
94
|
+
open: !!V,
|
|
95
|
+
onClose: $,
|
|
96
|
+
transitionDuration: {
|
|
97
|
+
enter: 225,
|
|
98
|
+
exit: 195
|
|
99
|
+
},
|
|
100
|
+
children: /* @__PURE__ */ f(h, {
|
|
101
|
+
onClick: ne,
|
|
102
|
+
children: /* @__PURE__ */ f(T, { dangerouslySetInnerHTML: { __html: `Remove ${c || _}` } })
|
|
103
|
+
})
|
|
104
|
+
})
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ f(o, {
|
|
107
|
+
markup: c,
|
|
108
|
+
error: r?.name || "",
|
|
109
|
+
onChange: (e) => X({ name: e }),
|
|
110
|
+
pluginProps: I,
|
|
111
|
+
placeholder: `Enter ${_}`,
|
|
112
|
+
spellCheck: M,
|
|
113
|
+
uploadSoundSupport: N,
|
|
114
|
+
mathMlOptions: P,
|
|
115
|
+
imageSupport: L
|
|
116
|
+
}),
|
|
117
|
+
r && /* @__PURE__ */ f(E, { children: r.name || "" })
|
|
118
|
+
] }), /* @__PURE__ */ p(a, {
|
|
119
|
+
setRef: (e) => {
|
|
120
|
+
U.current = e;
|
|
121
|
+
},
|
|
122
|
+
width: `${j}px`,
|
|
123
|
+
children: [
|
|
124
|
+
D && l && /* @__PURE__ */ f(t, { children: /* @__PURE__ */ f(n, {
|
|
125
|
+
placeholder: "Standards",
|
|
126
|
+
markup: l.join(","),
|
|
127
|
+
onChange: (e) => X({ standards: e.split(",") }),
|
|
128
|
+
pluginProps: F,
|
|
129
|
+
spellCheck: M,
|
|
130
|
+
uploadSoundSupport: N,
|
|
131
|
+
mathMlOptions: P,
|
|
132
|
+
imageSupport: L
|
|
133
|
+
}) }),
|
|
134
|
+
O && /* @__PURE__ */ p(t, { children: [/* @__PURE__ */ f(n, {
|
|
135
|
+
placeholder: "Enter Description",
|
|
136
|
+
markup: d,
|
|
137
|
+
error: r?.description || "",
|
|
138
|
+
onChange: (e) => X({ description: e }),
|
|
139
|
+
pluginProps: F,
|
|
140
|
+
spellCheck: M,
|
|
141
|
+
uploadSoundSupport: N,
|
|
142
|
+
mathMlOptions: P,
|
|
143
|
+
imageSupport: L
|
|
144
|
+
}), r && /* @__PURE__ */ f(E, { children: r.description || "" })] }),
|
|
145
|
+
(b || []).map((e, r) => {
|
|
146
|
+
let i = j - 216 * r + A - 98, a = b.length - r - 1, o;
|
|
147
|
+
try {
|
|
148
|
+
o = m[a] || "";
|
|
149
|
+
} catch {
|
|
150
|
+
o = "";
|
|
151
|
+
}
|
|
152
|
+
return /* @__PURE__ */ f(t, { children: /* @__PURE__ */ f(n, {
|
|
153
|
+
placeholder: "Enter Descriptor",
|
|
154
|
+
markup: o,
|
|
155
|
+
onChange: (e) => Z({
|
|
156
|
+
descriptor: e,
|
|
157
|
+
value: a
|
|
158
|
+
}),
|
|
159
|
+
pluginProps: F,
|
|
160
|
+
alignToRight: i < 296 && e < ee,
|
|
161
|
+
spellCheck: M,
|
|
162
|
+
uploadSoundSupport: N,
|
|
163
|
+
mathMlOptions: P,
|
|
164
|
+
imageSupport: L
|
|
165
|
+
}) }, `key-key-${r}`);
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
})] })
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
D.propTypes = {
|
|
172
|
+
error: c.object,
|
|
173
|
+
index: c.number.isRequired,
|
|
174
|
+
onTraitChanged: c.func.isRequired,
|
|
175
|
+
onTraitRemoved: c.func.isRequired,
|
|
176
|
+
onTraitDropped: c.func,
|
|
177
|
+
trait: c.shape({
|
|
178
|
+
name: c.string,
|
|
179
|
+
standards: c.arrayOf(c.string),
|
|
180
|
+
scorePointsDescriptors: c.arrayOf(c.string),
|
|
181
|
+
description: c.string
|
|
182
|
+
}),
|
|
183
|
+
traitLabel: c.string,
|
|
184
|
+
scorePointsValues: c.arrayOf(c.number),
|
|
185
|
+
showStandards: c.bool,
|
|
186
|
+
showDescription: c.bool,
|
|
187
|
+
maxPoints: c.number,
|
|
188
|
+
enableDragAndDrop: c.bool,
|
|
189
|
+
currentPosition: c.number,
|
|
190
|
+
secondaryBlockWidth: c.number,
|
|
191
|
+
spellCheck: c.bool,
|
|
192
|
+
uploadSoundSupport: c.object,
|
|
193
|
+
mathMlOptions: c.object,
|
|
194
|
+
expandedPluginProps: c.object,
|
|
195
|
+
labelPluginProps: c.object,
|
|
196
|
+
imageSupport: c.shape({
|
|
197
|
+
add: c.func.isRequired,
|
|
198
|
+
delete: c.func.isRequired
|
|
199
|
+
})
|
|
200
|
+
};
|
|
201
|
+
//#endregion
|
|
202
|
+
export { D as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/multi-trait-rubric/configure/src/traitsHeader.jsx
|
|
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
|
+
import React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export declare class TraitsHeaderTile extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
maxPointsEnabled: PropTypes.Requireable<boolean>;
|
|
14
|
+
spellCheck: PropTypes.Requireable<boolean>;
|
|
15
|
+
errors: PropTypes.Requireable<object>;
|
|
16
|
+
};
|
|
17
|
+
state: {
|
|
18
|
+
anchorEl: null;
|
|
19
|
+
};
|
|
20
|
+
UNSAFE_componentWillReceiveProps(nextProps: any): void;
|
|
21
|
+
onScorePointLabelChange: any;
|
|
22
|
+
handleClick: (event: any) => void;
|
|
23
|
+
handleClose: () => void;
|
|
24
|
+
scrollToPosition: any;
|
|
25
|
+
openMenu: any;
|
|
26
|
+
render(): React.JSX.Element;
|
|
27
|
+
}
|
|
28
|
+
export default TraitsHeaderTile;
|