@pie-element/multi-trait-rubric 6.3.4-next.3 → 7.0.0-beta.1
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/CHANGELOG.md +0 -11
- package/configure/CHANGELOG.md +0 -11
- package/configure/lib/common.js +375 -534
- package/configure/lib/common.js.map +1 -1
- package/configure/lib/defaults.js +35 -6
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +96 -162
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +346 -437
- package/configure/lib/main.js.map +1 -1
- package/configure/lib/modals.js +178 -333
- package/configure/lib/modals.js.map +1 -1
- package/configure/lib/scale.js +358 -463
- package/configure/lib/scale.js.map +1 -1
- package/configure/lib/trait.js +253 -358
- package/configure/lib/trait.js.map +1 -1
- package/configure/lib/traitsHeader.js +199 -264
- package/configure/lib/traitsHeader.js.map +1 -1
- package/configure/lib/utils.js +43 -74
- package/configure/lib/utils.js.map +1 -1
- package/configure/package.json +12 -9
- package/controller/lib/defaults.js +2 -3
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +66 -123
- package/controller/lib/index.js.map +1 -1
- package/controller/lib/utils.js +1 -3
- package/controller/lib/utils.js.map +1 -1
- package/controller/package.json +1 -1
- package/lib/index.js +40 -77
- package/lib/index.js.map +1 -1
- package/lib/main.js +99 -140
- package/lib/main.js.map +1 -1
- package/lib/scale.js +217 -299
- package/lib/scale.js.map +1 -1
- package/lib/trait.js +51 -71
- package/lib/trait.js.map +1 -1
- package/package.json +10 -8
- package/esm/configure.js +0 -30404
- package/esm/configure.js.map +0 -1
- package/esm/controller.js +0 -176
- package/esm/controller.js.map +0 -1
- package/esm/element.js +0 -11204
- package/esm/element.js.map +0 -1
- package/esm/package.json +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/trait.jsx"],"names":["log","styles","theme","actions","color","text","primaryBlock","display","flexDirection","justifyContent","marginBottom","spacing","unit","controls","alignItems","width","cursor","options","marginLeft","dragHandle","removeLabel","whiteSpace","errorText","fontSize","typography","palette","error","main","paddingBottom","TraitTile","params","props","trait","onTraitChanged","Object","keys","forEach","key","descriptor","value","scorePointsDescriptors","length","event","setState","anchorEl","currentTarget","position","secondaryBlock","scrollTo","left","onTraitRemoved","handleClose","nextProps","currentPosition","scrollLeft","scrollToPosition","classes","connectDragSource","connectDropTarget","connectDragPreview","name","standards","description","traitLabel","scorePointsValues","showStandards","showDescription","enableDragAndDrop","secondaryBlockWidth","spellCheck","maxPoints","uploadSoundSupport","mathMlOptions","expandedPluginProps","labelPluginProps","imageSupport","state","handleClick","openMenu","__html","ref","join","split","map","scorePointsValue","index","adjustedBlockWidth","BlockWidth","remainingSpace","scoreDescriptor","e","onScorePointDescriptorChange","React","Component","PropTypes","bool","object","propTypes","func","isRequired","isDragging","id","any","isOver","number","shape","string","arrayOf","add","StyledTrait","NAME","traitSource","beginDrag","StyledSource","connect","monitor","dragSource","dragPreview","traitTarget","hover","drop","item","getItem","didDrop","onTraitDropped","StyledSourceAndTarget","dropTarget"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,sDAAN,CAAZ;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,OAAO,EAAE;AACPC,MAAAA,KAAK,EAAEA,gBAAMC,IAAN;AADA,KADgB;AAIzBC,IAAAA,YAAY,EAAE;AACZC,MAAAA,OAAO,EAAE,MADG;AAEZC,MAAAA,aAAa,EAAE,QAFH;AAGZC,MAAAA,cAAc,EAAE,eAHJ;AAIZC,MAAAA,YAAY,EAAER,KAAK,CAACS,OAAN,CAAcC,IAAd,GAAqB;AAJvB,KAJW;AAUzBC,IAAAA,QAAQ,EAAE;AACRN,MAAAA,OAAO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cAAN,CAAqBH,IAArB,EAA2B1F,KAAK,CAACsD,KAAjC;AACD;AATiB,CAApB;AAYA,IAAMwC,qBAAqB,GAAG,0BAAWf,IAAX,EAAiBQ,WAAjB,EAA8B,UAACJ,OAAD,EAAUC,OAAV;AAAA,SAAuB;AACjFzD,IAAAA,iBAAiB,EAAEwD,OAAO,CAACY,UAAR,EAD8D;AAEjFvB,IAAAA,MAAM,EAAEY,OAAO,CAACZ,MAAR;AAFyE,GAAvB;AAAA,CAA9B,EAG1BU,YAH0B,CAA9B;eAKeY,qB","sourcesContent":["import React from 'react';\nimport debug from 'debug';\nimport PropTypes from 'prop-types';\nimport isEmpty from 'lodash/isEmpty';\nimport { DragSource, DropTarget } from 'react-dnd';\n\nimport { withStyles } from '@material-ui/core/styles';\nimport { color } from '@pie-lib/render-ui';\n\nimport { Block, BlockWidth, ExpandedInput, PrimaryBlock, Row, SecondaryBlock, UnderlinedInput } from './common';\n\nimport IconButton from '@material-ui/core/IconButton';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport DragIndicatorIcon from '@material-ui/icons/DragIndicator';\n\nconst log = debug('@pie-element:placement-ordering:configure:trait-tile');\n\nconst styles = (theme) => ({\n actions: {\n color: color.text(),\n },\n primaryBlock: {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-between',\n marginBottom: theme.spacing.unit * 5,\n },\n controls: {\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n cursor: 'pointer',\n },\n options: {\n marginLeft: 'auto',\n },\n dragHandle: {},\n removeLabel: {\n display: 'flex',\n whiteSpace: 'break-spaces',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingBottom: theme.spacing.unit,\n },\n});\n\nexport class TraitTile extends React.Component {\n static propTypes = {\n spellCheck: PropTypes.bool,\n uploadSoundSupport: PropTypes.object,\n };\n\n state = {};\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (\n nextProps.currentPosition !== this.props.currentPosition ||\n (this.secondaryBlock && this.secondaryBlock.scrollLeft !== nextProps.currentPosition)\n ) {\n this.scrollToPosition(nextProps.currentPosition);\n }\n }\n\n onTraitChanged = (params) => {\n const { trait, onTraitChanged } = this.props;\n\n if (isEmpty(params)) return;\n\n Object.keys(params).forEach((key) => {\n trait[key] = params[key];\n });\n\n onTraitChanged(trait);\n };\n\n onScorePointDescriptorChange = ({ descriptor, value }) => {\n const {\n trait: { scorePointsDescriptors },\n } = this.props;\n\n if (value < 0 || value >= scorePointsDescriptors.length) return;\n\n scorePointsDescriptors[value] = descriptor;\n\n this.onTraitChanged({ scorePointsDescriptors });\n };\n\n handleClick = (event) => this.setState({ anchorEl: event.currentTarget });\n\n handleClose = () => this.setState({ anchorEl: null });\n\n scrollToPosition = (position) => this.secondaryBlock.scrollTo({ left: position });\n\n openMenu = () => {\n this.props.onTraitRemoved();\n this.handleClose();\n };\n\n render() {\n const {\n classes,\n connectDragSource,\n connectDropTarget,\n connectDragPreview,\n error,\n trait: { name, standards, description, scorePointsDescriptors },\n traitLabel,\n scorePointsValues,\n showStandards,\n showDescription,\n enableDragAndDrop,\n currentPosition,\n secondaryBlockWidth,\n spellCheck,\n maxPoints,\n uploadSoundSupport,\n mathMlOptions = {},\n expandedPluginProps = {},\n labelPluginProps = {},\n imageSupport = {},\n } = this.props;\n const { anchorEl } = this.state;\n\n return connectDragPreview(\n connectDropTarget(\n <div>\n <Row>\n <PrimaryBlock className={classes.primaryBlock}>\n <div className={classes.controls}>\n {enableDragAndDrop\n ? connectDragSource(\n <span className={classes.dragHandle}>\n <DragIndicatorIcon className={classes.actions} />\n </span>,\n )\n : null}\n\n <IconButton\n className={classes.options}\n aria-label=\"more\"\n aria-controls=\"long-menu\"\n aria-haspopup=\"true\"\n onClick={this.handleClick}\n >\n <MoreVertIcon />\n </IconButton>\n\n <Menu id=\"long-menu\" anchorEl={anchorEl} keepMounted open={!!anchorEl} onClose={this.handleClose}>\n <MenuItem onClick={this.openMenu}>\n <div\n className={classes.removeLabel}\n dangerouslySetInnerHTML={{ __html: `Remove ${name || traitLabel}` }}\n />\n </MenuItem>\n </Menu>\n </div>\n\n <UnderlinedInput\n markup={name}\n error={error?.name || ''}\n onChange={(name) => this.onTraitChanged({ name })}\n pluginProps={labelPluginProps}\n placeholder={`Enter ${traitLabel}`}\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n imageSupport={imageSupport}\n />\n {error && <div className={classes.errorText}>{error.name || ''}</div>}\n </PrimaryBlock>\n\n <SecondaryBlock\n setRef={(ref) => {\n this.secondaryBlock = ref;\n }}\n width={`${secondaryBlockWidth}px`}\n >\n {showStandards && standards && (\n <Block>\n <ExpandedInput\n placeholder=\"Standards\"\n markup={standards.join(',')}\n onChange={(standards) => this.onTraitChanged({ standards: standards.split(',') })}\n pluginProps={expandedPluginProps}\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n imageSupport={imageSupport}\n />\n </Block>\n )}\n\n {showDescription && (\n <Block>\n <ExpandedInput\n placeholder=\"Enter Description\"\n markup={description}\n error={error?.description || ''}\n onChange={(description) => this.onTraitChanged({ description })}\n pluginProps={expandedPluginProps}\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n imageSupport={imageSupport}\n />\n {error && <div className={classes.errorText}>{error.description || ''}</div>}\n </Block>\n )}\n\n {(scorePointsValues || []).map((scorePointsValue, index) => {\n const adjustedBlockWidth = BlockWidth + 2 * 8; // 8 is padding\n const remainingSpace = secondaryBlockWidth - adjustedBlockWidth * index + currentPosition - 98;\n const value = scorePointsValues.length - index - 1;\n let scoreDescriptor;\n\n try {\n scoreDescriptor = scorePointsDescriptors[value] || '';\n } catch (e) {\n scoreDescriptor = '';\n }\n\n return (\n <Block key={`key-key-${index}`}>\n <ExpandedInput\n placeholder=\"Enter Descriptor\"\n markup={scoreDescriptor}\n onChange={(descriptor) => this.onScorePointDescriptorChange({ descriptor, value })}\n pluginProps={expandedPluginProps}\n alignToRight={remainingSpace < 296 && scorePointsValue < maxPoints} // 296 is the space required for the toolbar\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n imageSupport={imageSupport}\n />\n </Block>\n );\n })}\n </SecondaryBlock>\n </Row>\n </div>,\n ),\n );\n }\n}\n\nTraitTile.propTypes = {\n connectDragSource: PropTypes.func.isRequired,\n connectDropTarget: PropTypes.func.isRequired,\n connectDragPreview: PropTypes.func.isRequired,\n classes: PropTypes.object.isRequired,\n error: PropTypes.object,\n isDragging: PropTypes.bool.isRequired,\n id: PropTypes.any,\n isOver: PropTypes.bool,\n index: PropTypes.number,\n onTraitChanged: PropTypes.func.isRequired,\n onTraitRemoved: PropTypes.func.isRequired,\n trait: PropTypes.shape({\n name: PropTypes.string,\n standards: PropTypes.arrayOf(PropTypes.string),\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n description: PropTypes.string,\n }),\n traitLabel: PropTypes.string,\n scorePointsValues: PropTypes.arrayOf(PropTypes.number),\n showStandards: PropTypes.bool,\n showDescription: PropTypes.bool,\n maxPoints: PropTypes.number,\n enableDragAndDrop: PropTypes.bool,\n currentPosition: PropTypes.number,\n secondaryBlockWidth: PropTypes.number,\n expandedPluginProps: PropTypes.object,\n labelPluginProps: PropTypes.object,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n};\n\nexport const StyledTrait = withStyles(styles)(TraitTile);\n\nconst NAME = 'trait-config';\n\nconst traitSource = {\n beginDrag(props) {\n return {\n name: props.trait.name,\n index: props.index,\n };\n },\n};\n\nconst StyledSource = DragSource(NAME, traitSource, (connect, monitor) => ({\n connectDragSource: connect.dragSource(),\n connectDragPreview: connect.dragPreview(),\n isDragging: monitor.isDragging(),\n}))(StyledTrait);\n\nconst traitTarget = {\n hover() {\n log('[hover]');\n },\n drop(props, monitor) {\n const item = monitor.getItem();\n log('[drop] item: ', item, 'didDrop?', monitor.didDrop());\n\n props.onTraitDropped(item, props.index);\n },\n};\n\nconst StyledSourceAndTarget = DropTarget(NAME, traitTarget, (connect, monitor) => ({\n connectDropTarget: connect.dropTarget(),\n isOver: monitor.isOver(),\n}))(StyledSource);\n\nexport default StyledSourceAndTarget;\n"],"file":"trait.js"}
|
|
1
|
+
{"version":3,"file":"trait.js","names":["_react","_interopRequireDefault","require","_debug","_propTypes","_isEmpty","_core","_styles","_renderUi","_common","_IconButton","_MoreVert","_Menu","_MenuItem","_DragIndicator","log","debug","ActionsIcon","styled","DragIndicatorIcon","color","text","StyledPrimaryBlock","PrimaryBlock","theme","display","flexDirection","justifyContent","marginBottom","spacing","Controls","alignItems","width","cursor","Options","IconButton","marginLeft","RemoveLabel","whiteSpace","ErrorText","fontSize","typography","palette","error","main","paddingBottom","TraitTile","trait","name","standards","description","scorePointsDescriptors","traitLabel","scorePointsValues","showStandards","showDescription","enableDragAndDrop","currentPosition","secondaryBlockWidth","spellCheck","maxPoints","uploadSoundSupport","mathMlOptions","expandedPluginProps","labelPluginProps","imageSupport","index","onTraitChanged","onTraitRemoved","onTraitDropped","anchorEl","setAnchorEl","React","useState","secondaryBlockRef","useRef","attributes","listeners","setNodeRef","setDragRef","transform","isDragging","useDraggable","id","data","type","setDropRef","useDroppable","useEffect","undefined","current","scrollLeft","scrollToPosition","onTraitChangedHandler","params","isEmpty","updatedTrait","onScorePointDescriptorChange","descriptor","value","length","newDescriptors","handleClick","event","currentTarget","handleClose","position","scrollTo","left","openMenu","dragStyle","x","y","opacity","default","createElement","ref","style","Row","_extends2","onClick","size","keepMounted","open","onClose","transitionDuration","enter","exit","dangerouslySetInnerHTML","__html","UnderlinedInput","markup","onChange","pluginProps","placeholder","SecondaryBlock","setRef","Block","ExpandedInput","join","split","map","scorePointsValue","scoreIndex","adjustedBlockWidth","BlockWidth","remainingSpace","scoreDescriptor","e","key","alignToRight","propTypes","PropTypes","object","number","isRequired","func","shape","string","arrayOf","bool","add","delete","_default","exports"],"sources":["../src/trait.jsx"],"sourcesContent":["import React from 'react';\nimport debug from 'debug';\nimport PropTypes from 'prop-types';\nimport isEmpty from 'lodash/isEmpty';\nimport { useDraggable, useDroppable } from '@dnd-kit/core';\n\nimport { styled } from '@mui/material/styles';\nimport { color } from '@pie-lib/render-ui';\n\nimport { Block, BlockWidth, ExpandedInput, PrimaryBlock, Row, SecondaryBlock, UnderlinedInput } from './common';\n\nimport IconButton from '@mui/material/IconButton';\nimport MoreVertIcon from '@mui/icons-material/MoreVert';\nimport Menu from '@mui/material/Menu';\nimport MenuItem from '@mui/material/MenuItem';\nimport DragIndicatorIcon from '@mui/icons-material/DragIndicator';\n\nconst log = debug('@pie-element:placement-ordering:configure:trait-tile');\n\nconst ActionsIcon = styled(DragIndicatorIcon)({\n color: color.text(),\n});\n\nconst StyledPrimaryBlock = styled(PrimaryBlock)(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-between',\n marginBottom: theme.spacing(5),\n}));\n\nconst Controls = styled('div')({\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n cursor: 'pointer',\n});\n\nconst Options = styled(IconButton)({\n marginLeft: 'auto',\n});\n\nconst RemoveLabel = styled('div')({\n display: 'flex',\n whiteSpace: 'break-spaces',\n});\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingBottom: theme.spacing(1),\n}));\n\nfunction TraitTile({\n error,\n trait: { name, standards, description, scorePointsDescriptors },\n traitLabel,\n scorePointsValues,\n showStandards,\n showDescription,\n enableDragAndDrop,\n currentPosition,\n secondaryBlockWidth,\n spellCheck,\n maxPoints,\n uploadSoundSupport,\n mathMlOptions = {},\n expandedPluginProps = {},\n labelPluginProps = {},\n imageSupport = {},\n index,\n onTraitChanged,\n onTraitRemoved,\n onTraitDropped,\n}) {\n const [anchorEl, setAnchorEl] = React.useState(null);\n const secondaryBlockRef = React.useRef(null);\n\n const { attributes, listeners, setNodeRef: setDragRef, transform, isDragging } = useDraggable({\n id: `trait-${index}`,\n data: {\n type: 'trait',\n index,\n name,\n },\n });\n\n const { setNodeRef: setDropRef } = useDroppable({\n id: `trait-drop-${index}`,\n data: {\n type: 'trait',\n index,\n },\n });\n\n React.useEffect(() => {\n if (currentPosition !== undefined && secondaryBlockRef.current && secondaryBlockRef.current.scrollLeft !== currentPosition) {\n scrollToPosition(currentPosition);\n }\n }, [currentPosition]);\n\n const onTraitChangedHandler = (params) => {\n if (isEmpty(params)) return;\n\n const updatedTrait = { ...{ name, standards, description, scorePointsDescriptors }, ...params };\n onTraitChanged(updatedTrait);\n };\n\n const onScorePointDescriptorChange = ({ descriptor, value }) => {\n if (value < 0 || value >= scorePointsDescriptors.length) return;\n\n const newDescriptors = [...scorePointsDescriptors];\n newDescriptors[value] = descriptor;\n\n onTraitChangedHandler({ scorePointsDescriptors: newDescriptors });\n };\n\n const handleClick = (event) => setAnchorEl(event.currentTarget);\n\n const handleClose = () => setAnchorEl(null);\n\n const scrollToPosition = (position) => secondaryBlockRef.current?.scrollTo({ left: position });\n\n const openMenu = () => {\n onTraitRemoved();\n handleClose();\n };\n\n const dragStyle = transform ? {\n transform: `translate3d(${transform.x}px, ${transform.y}px, 0)`,\n opacity: isDragging ? 0.5 : 1,\n } : {};\n\n return (\n <div ref={setDropRef} style={dragStyle}>\n <Row>\n <StyledPrimaryBlock>\n <Controls>\n {enableDragAndDrop && (\n <span ref={setDragRef} {...attributes} {...listeners}>\n <ActionsIcon />\n </span>\n )}\n\n <Options\n aria-label=\"more\"\n aria-controls=\"long-menu\"\n aria-haspopup=\"true\"\n onClick={handleClick}\n size=\"large\">\n <MoreVertIcon />\n </Options>\n\n <Menu\n id=\"long-menu\"\n anchorEl={anchorEl}\n keepMounted\n open={!!anchorEl}\n onClose={handleClose}\n transitionDuration={{ enter: 225, exit: 195 }}\n >\n <MenuItem onClick={openMenu}>\n <RemoveLabel\n dangerouslySetInnerHTML={{ __html: `Remove ${name || traitLabel}` }}\n />\n </MenuItem>\n </Menu>\n </Controls>\n\n <UnderlinedInput\n markup={name}\n error={error?.name || ''}\n onChange={(name) => onTraitChangedHandler({ name })}\n pluginProps={labelPluginProps}\n placeholder={`Enter ${traitLabel}`}\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n imageSupport={imageSupport}\n />\n {error && <ErrorText>{error.name || ''}</ErrorText>}\n </StyledPrimaryBlock>\n\n <SecondaryBlock\n setRef={(ref) => {\n secondaryBlockRef.current = ref;\n }}\n width={`${secondaryBlockWidth}px`}\n >\n {showStandards && standards && (\n <Block>\n <ExpandedInput\n placeholder=\"Standards\"\n markup={standards.join(',')}\n onChange={(standards) => onTraitChangedHandler({ standards: standards.split(',') })}\n pluginProps={expandedPluginProps}\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n imageSupport={imageSupport}\n />\n </Block>\n )}\n\n {showDescription && (\n <Block>\n <ExpandedInput\n placeholder=\"Enter Description\"\n markup={description}\n error={error?.description || ''}\n onChange={(description) => onTraitChangedHandler({ description })}\n pluginProps={expandedPluginProps}\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n imageSupport={imageSupport}\n />\n {error && <ErrorText>{error.description || ''}</ErrorText>}\n </Block>\n )}\n\n {(scorePointsValues || []).map((scorePointsValue, scoreIndex) => {\n const adjustedBlockWidth = BlockWidth + 2 * 8; // 8 is padding\n const remainingSpace = secondaryBlockWidth - adjustedBlockWidth * scoreIndex + currentPosition - 98;\n const value = scorePointsValues.length - scoreIndex - 1;\n let scoreDescriptor;\n\n try {\n scoreDescriptor = scorePointsDescriptors[value] || '';\n } catch (e) {\n scoreDescriptor = '';\n }\n\n return (\n <Block key={`key-key-${scoreIndex}`}>\n <ExpandedInput\n placeholder=\"Enter Descriptor\"\n markup={scoreDescriptor}\n onChange={(descriptor) => onScorePointDescriptorChange({ descriptor, value })}\n pluginProps={expandedPluginProps}\n alignToRight={remainingSpace < 296 && scorePointsValue < maxPoints} // 296 is the space required for the toolbar\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n imageSupport={imageSupport}\n />\n </Block>\n );\n })}\n </SecondaryBlock>\n </Row>\n </div>\n );\n}\n\nTraitTile.propTypes = {\n error: PropTypes.object,\n index: PropTypes.number.isRequired,\n onTraitChanged: PropTypes.func.isRequired,\n onTraitRemoved: PropTypes.func.isRequired,\n onTraitDropped: PropTypes.func,\n trait: PropTypes.shape({\n name: PropTypes.string,\n standards: PropTypes.arrayOf(PropTypes.string),\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n description: PropTypes.string,\n }),\n traitLabel: PropTypes.string,\n scorePointsValues: PropTypes.arrayOf(PropTypes.number),\n showStandards: PropTypes.bool,\n showDescription: PropTypes.bool,\n maxPoints: PropTypes.number,\n enableDragAndDrop: PropTypes.bool,\n currentPosition: PropTypes.number,\n secondaryBlockWidth: PropTypes.number,\n spellCheck: PropTypes.bool,\n uploadSoundSupport: PropTypes.object,\n mathMlOptions: PropTypes.object,\n expandedPluginProps: PropTypes.object,\n labelPluginProps: PropTypes.object,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n};\n\nexport default TraitTile;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN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CAACM,MAAM,CAAC;IAC9C3G,sBAAsB,EAAEqG,kBAAS,CAACO,OAAO,CAACP,kBAAS,CAACM,MAAM,CAAC;IAC3D5G,WAAW,EAAEsG,kBAAS,CAACM;EACzB,CAAC,CAAC;EACF1G,UAAU,EAAEoG,kBAAS,CAACM,MAAM;EAC5BzG,iBAAiB,EAAEmG,kBAAS,CAACO,OAAO,CAACP,kBAAS,CAACE,MAAM,CAAC;EACtDpG,aAAa,EAAEkG,kBAAS,CAACQ,IAAI;EAC7BzG,eAAe,EAAEiG,kBAAS,CAACQ,IAAI;EAC/BpG,SAAS,EAAE4F,kBAAS,CAACE,MAAM;EAC3BlG,iBAAiB,EAAEgG,kBAAS,CAACQ,IAAI;EACjCvG,eAAe,EAAE+F,kBAAS,CAACE,MAAM;EACjChG,mBAAmB,EAAE8F,kBAAS,CAACE,MAAM;EACrC/F,UAAU,EAAE6F,kBAAS,CAACQ,IAAI;EAC1BnG,kBAAkB,EAAE2F,kBAAS,CAACC,MAAM;EACpC3F,aAAa,EAAE0F,kBAAS,CAACC,MAAM;EAC/B1F,mBAAmB,EAAEyF,kBAAS,CAACC,MAAM;EACrCzF,gBAAgB,EAAEwF,kBAAS,CAACC,MAAM;EAClCxF,YAAY,EAAEuF,kBAAS,CAACK,KAAK,CAAC;IAC5BI,GAAG,EAAET,kBAAS,CAACI,IAAI,CAACD,UAAU;IAC9BO,MAAM,EAAEV,kBAAS,CAACI,IAAI,CAACD;EACzB,CAAC;AACH,CAAC;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAlD,OAAA,GAEapE,SAAS","ignoreList":[]}
|
|
@@ -1,296 +1,231 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
-
|
|
7
|
+
exports.default = exports.TraitsHeaderTile = void 0;
|
|
22
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
9
|
var _react = _interopRequireDefault(require("react"));
|
|
25
|
-
|
|
26
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
var _Menu = _interopRequireDefault(require("@material-ui/core/Menu"));
|
|
33
|
-
|
|
34
|
-
var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
|
|
35
|
-
|
|
36
|
-
var _MoreVert = _interopRequireDefault(require("@material-ui/icons/MoreVert"));
|
|
37
|
-
|
|
11
|
+
var _styles = require("@mui/material/styles");
|
|
12
|
+
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
13
|
+
var _Menu = _interopRequireDefault(require("@mui/material/Menu"));
|
|
14
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
15
|
+
var _MoreVert = _interopRequireDefault(require("@mui/icons-material/MoreVert"));
|
|
38
16
|
var _renderUi = require("@pie-lib/render-ui");
|
|
39
|
-
|
|
40
17
|
var _common = require("./common");
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
(0
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
(0, _classCallCheck2["default"])(this, TraitsHeaderTile);
|
|
85
|
-
|
|
86
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
87
|
-
args[_key] = arguments[_key];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
91
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
18
|
+
const Label = (0, _styles.styled)('div')({
|
|
19
|
+
width: '140px',
|
|
20
|
+
border: 'none',
|
|
21
|
+
padding: '10px 0',
|
|
22
|
+
display: 'flex',
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
justifyContent: 'space-around'
|
|
25
|
+
});
|
|
26
|
+
const GreyHeaderRow = (0, _styles.styled)('div')(({
|
|
27
|
+
height,
|
|
28
|
+
theme
|
|
29
|
+
}) => ({
|
|
30
|
+
background: _renderUi.color.secondaryBackground(),
|
|
31
|
+
borderRadius: '4px',
|
|
32
|
+
position: 'relative',
|
|
33
|
+
marginBottom: theme.spacing(2),
|
|
34
|
+
display: 'flex',
|
|
35
|
+
height: height
|
|
36
|
+
}));
|
|
37
|
+
const PrimaryBlockGreyHeader = (0, _styles.styled)('div')(({
|
|
38
|
+
theme
|
|
39
|
+
}) => ({
|
|
40
|
+
width: `${_common.PrimaryBlockWidth}px`,
|
|
41
|
+
minWidth: `${_common.PrimaryBlockWidth}px`,
|
|
42
|
+
position: 'relative',
|
|
43
|
+
padding: '0 10px',
|
|
44
|
+
boxSizing: 'border-box',
|
|
45
|
+
paddingTop: theme.spacing(1.5),
|
|
46
|
+
alignSelf: 'center'
|
|
47
|
+
}));
|
|
48
|
+
const ScorePointErrorText = (0, _styles.styled)('div')(({
|
|
49
|
+
theme
|
|
50
|
+
}) => ({
|
|
51
|
+
position: 'absolute',
|
|
52
|
+
fontSize: theme.typography.fontSize - 2,
|
|
53
|
+
color: theme.palette.error.main,
|
|
54
|
+
paddingTop: theme.spacing(0.5)
|
|
55
|
+
}));
|
|
56
|
+
class TraitsHeaderTile extends _react.default.Component {
|
|
57
|
+
constructor(...args) {
|
|
58
|
+
super(...args);
|
|
59
|
+
(0, _defineProperty2.default)(this, "state", {
|
|
92
60
|
anchorEl: null
|
|
93
61
|
});
|
|
94
|
-
(0, _defineProperty2
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
62
|
+
(0, _defineProperty2.default)(this, "onScorePointLabelChange", ({
|
|
63
|
+
scorePointLabel,
|
|
64
|
+
value
|
|
65
|
+
}) => {
|
|
66
|
+
const {
|
|
67
|
+
scorePointsLabels,
|
|
68
|
+
onScaleChange
|
|
69
|
+
} = this.props;
|
|
100
70
|
if (value < 0 || value >= scorePointsLabels.length) return;
|
|
101
71
|
scorePointsLabels[value] = scorePointLabel;
|
|
102
72
|
onScaleChange({
|
|
103
|
-
scorePointsLabels
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClick", function (event) {
|
|
107
|
-
return _this.setState({
|
|
108
|
-
anchorEl: event.currentTarget
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClose", function () {
|
|
112
|
-
return _this.setState({
|
|
113
|
-
anchorEl: null
|
|
73
|
+
scorePointsLabels
|
|
114
74
|
});
|
|
115
75
|
});
|
|
116
|
-
(0, _defineProperty2
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
76
|
+
(0, _defineProperty2.default)(this, "handleClick", event => this.setState({
|
|
77
|
+
anchorEl: event.currentTarget
|
|
78
|
+
}));
|
|
79
|
+
(0, _defineProperty2.default)(this, "handleClose", () => this.setState({
|
|
80
|
+
anchorEl: null
|
|
81
|
+
}));
|
|
82
|
+
(0, _defineProperty2.default)(this, "scrollToPosition", position => this.secondaryBlock.scrollTo({
|
|
83
|
+
left: position
|
|
84
|
+
}));
|
|
85
|
+
(0, _defineProperty2.default)(this, "openMenu", () => {
|
|
86
|
+
this.props.showDeleteScaleModal();
|
|
87
|
+
this.handleClose();
|
|
125
88
|
});
|
|
126
|
-
return _this;
|
|
127
89
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
132
|
-
if (nextProps.currentPosition !== this.props.currentPosition) {
|
|
133
|
-
this.scrollToPosition(nextProps.currentPosition);
|
|
134
|
-
}
|
|
90
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
91
|
+
if (nextProps.currentPosition !== this.props.currentPosition) {
|
|
92
|
+
this.scrollToPosition(nextProps.currentPosition);
|
|
135
93
|
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
94
|
+
}
|
|
95
|
+
render() {
|
|
96
|
+
const {
|
|
97
|
+
scorePointsValues,
|
|
98
|
+
scorePointsLabels,
|
|
99
|
+
traitLabel,
|
|
100
|
+
currentPosition,
|
|
101
|
+
showStandards,
|
|
102
|
+
onTraitLabelChange,
|
|
103
|
+
showDescription,
|
|
104
|
+
showLevelTagInput,
|
|
105
|
+
maxPoints,
|
|
106
|
+
updateMaxPointsFieldValue,
|
|
107
|
+
scaleIndex,
|
|
108
|
+
showScorePointLabels,
|
|
109
|
+
secondaryBlockWidth,
|
|
110
|
+
setSecondaryBlockRef,
|
|
111
|
+
spellCheck,
|
|
112
|
+
uploadSoundSupport,
|
|
113
|
+
maxPointsEnabled,
|
|
114
|
+
mathMlOptions = {},
|
|
115
|
+
errors = {},
|
|
116
|
+
maxMaxPoints,
|
|
117
|
+
labelPluginProps = {},
|
|
118
|
+
imageSupport = {}
|
|
119
|
+
} = this.props;
|
|
120
|
+
const {
|
|
121
|
+
anchorEl
|
|
122
|
+
} = this.state;
|
|
123
|
+
return /*#__PURE__*/_react.default.createElement(GreyHeaderRow, {
|
|
124
|
+
height: showLevelTagInput ? _common.HeaderHeightLarge : _common.HeaderHeight
|
|
125
|
+
}, /*#__PURE__*/_react.default.createElement(PrimaryBlockGreyHeader, null, showLevelTagInput && /*#__PURE__*/_react.default.createElement(_common.SimpleInput, {
|
|
126
|
+
markup: traitLabel || 'Trait',
|
|
127
|
+
onChange: onTraitLabelChange,
|
|
128
|
+
pluginProps: labelPluginProps,
|
|
129
|
+
spellCheck: spellCheck,
|
|
130
|
+
label: "Level Label",
|
|
131
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
132
|
+
mathMlOptions: mathMlOptions,
|
|
133
|
+
imageSupport: imageSupport
|
|
134
|
+
}), /*#__PURE__*/_react.default.createElement(_common.ScaleSettings, null, /*#__PURE__*/_react.default.createElement("div", null, "Scale ", scaleIndex + 1), maxPointsEnabled && /*#__PURE__*/_react.default.createElement(_common.MaxPointsPicker, {
|
|
135
|
+
maxPoints: maxPoints,
|
|
136
|
+
maxMaxPoints: maxMaxPoints,
|
|
137
|
+
onChange: updateMaxPointsFieldValue
|
|
138
|
+
}), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
139
|
+
"aria-label": "more",
|
|
140
|
+
"aria-controls": "long-menu",
|
|
141
|
+
"aria-haspopup": "true",
|
|
142
|
+
onClick: this.handleClick,
|
|
143
|
+
size: "large"
|
|
144
|
+
}, /*#__PURE__*/_react.default.createElement(_MoreVert.default, null)), /*#__PURE__*/_react.default.createElement(_Menu.default, {
|
|
145
|
+
id: "long-menu",
|
|
146
|
+
anchorEl: anchorEl,
|
|
147
|
+
keepMounted: true,
|
|
148
|
+
open: !!anchorEl,
|
|
149
|
+
onClose: this.handleClose,
|
|
150
|
+
transitionDuration: {
|
|
151
|
+
enter: 225,
|
|
152
|
+
exit: 195
|
|
153
|
+
}
|
|
154
|
+
}, ['Remove Scale'].map(option => /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
155
|
+
key: option,
|
|
156
|
+
onClick: this.openMenu
|
|
157
|
+
}, option)))))), /*#__PURE__*/_react.default.createElement(_common.SecondaryBlock, {
|
|
158
|
+
setRef: ref => {
|
|
159
|
+
if (ref) {
|
|
160
|
+
this.secondaryBlock = ref;
|
|
161
|
+
setSecondaryBlockRef(ref);
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
width: `${secondaryBlockWidth}px`
|
|
165
|
+
}, showStandards && /*#__PURE__*/_react.default.createElement(_common.Block, null, /*#__PURE__*/_react.default.createElement(Label, null, "Standard(s)")), showDescription && /*#__PURE__*/_react.default.createElement(_common.Block, null, /*#__PURE__*/_react.default.createElement(Label, null, "Description")), scorePointsValues.map((scorePointsValue, index) => {
|
|
166
|
+
const adjustedBlockWidth = _common.BlockWidth + 2 * 8; // 8 is padding
|
|
167
|
+
const remainingSpace = secondaryBlockWidth - adjustedBlockWidth * index + currentPosition - 128;
|
|
168
|
+
const value = scorePointsValues.length - index - 1;
|
|
169
|
+
let scoreDescriptor;
|
|
170
|
+
let error;
|
|
171
|
+
try {
|
|
172
|
+
scoreDescriptor = scorePointsLabels[value] || '';
|
|
173
|
+
error = errors[value] || '';
|
|
174
|
+
} catch (e) {
|
|
175
|
+
scoreDescriptor = '';
|
|
176
|
+
}
|
|
177
|
+
return /*#__PURE__*/_react.default.createElement(_common.Block, {
|
|
178
|
+
key: `secondary-block-part-${index}`
|
|
179
|
+
}, /*#__PURE__*/_react.default.createElement(_common.ScorePoint, {
|
|
180
|
+
scorePointsValue: scorePointsValue,
|
|
181
|
+
error: error,
|
|
182
|
+
scoreDescriptor: scoreDescriptor,
|
|
178
183
|
pluginProps: labelPluginProps,
|
|
184
|
+
showScorePointLabels: showScorePointLabels,
|
|
185
|
+
onChange: scorePointLabel => this.onScorePointLabelChange({
|
|
186
|
+
scorePointLabel,
|
|
187
|
+
value
|
|
188
|
+
}),
|
|
189
|
+
alignToRight: remainingSpace < 296 && scorePointsValue < maxPoints // 296 is the space required for the toolbar
|
|
190
|
+
,
|
|
179
191
|
spellCheck: spellCheck,
|
|
180
|
-
label: "Level Label",
|
|
181
192
|
uploadSoundSupport: uploadSoundSupport,
|
|
182
193
|
mathMlOptions: mathMlOptions,
|
|
183
194
|
imageSupport: imageSupport
|
|
184
|
-
}),
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
189
|
-
"aria-label": "more",
|
|
190
|
-
"aria-controls": "long-menu",
|
|
191
|
-
"aria-haspopup": "true",
|
|
192
|
-
onClick: this.handleClick
|
|
193
|
-
}, /*#__PURE__*/_react["default"].createElement(_MoreVert["default"], null)), /*#__PURE__*/_react["default"].createElement(_Menu["default"], {
|
|
194
|
-
id: "long-menu",
|
|
195
|
-
anchorEl: anchorEl,
|
|
196
|
-
keepMounted: true,
|
|
197
|
-
open: !!anchorEl,
|
|
198
|
-
onClose: this.handleClose
|
|
199
|
-
}, ['Remove Scale'].map(function (option) {
|
|
200
|
-
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
201
|
-
key: option,
|
|
202
|
-
onClick: _this2.openMenu
|
|
203
|
-
}, option);
|
|
204
|
-
}))))), /*#__PURE__*/_react["default"].createElement(_common.SecondaryBlock, {
|
|
205
|
-
setRef: function setRef(ref) {
|
|
206
|
-
if (ref) {
|
|
207
|
-
_this2.secondaryBlock = ref;
|
|
208
|
-
setSecondaryBlockRef(ref);
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
width: "".concat(secondaryBlockWidth, "px")
|
|
212
|
-
}, showStandards && /*#__PURE__*/_react["default"].createElement(_common.Block, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
213
|
-
className: classes.label
|
|
214
|
-
}, "Standard(s)")), showDescription && /*#__PURE__*/_react["default"].createElement(_common.Block, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
215
|
-
className: classes.label
|
|
216
|
-
}, "Description")), scorePointsValues.map(function (scorePointsValue, index) {
|
|
217
|
-
var adjustedBlockWidth = _common.BlockWidth + 2 * 8; // 8 is padding
|
|
218
|
-
|
|
219
|
-
var remainingSpace = secondaryBlockWidth - adjustedBlockWidth * index + currentPosition - 128;
|
|
220
|
-
var value = scorePointsValues.length - index - 1;
|
|
221
|
-
var scoreDescriptor;
|
|
222
|
-
var error;
|
|
223
|
-
|
|
224
|
-
try {
|
|
225
|
-
scoreDescriptor = scorePointsLabels[value] || '';
|
|
226
|
-
error = errors[value] || '';
|
|
227
|
-
} catch (e) {
|
|
228
|
-
scoreDescriptor = '';
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
return /*#__PURE__*/_react["default"].createElement(_common.Block, {
|
|
232
|
-
key: "secondary-block-part-".concat(index)
|
|
233
|
-
}, /*#__PURE__*/_react["default"].createElement(_common.ScorePoint, {
|
|
234
|
-
scorePointsValue: scorePointsValue,
|
|
235
|
-
error: error,
|
|
236
|
-
scoreDescriptor: scoreDescriptor,
|
|
237
|
-
pluginProps: labelPluginProps,
|
|
238
|
-
showScorePointLabels: showScorePointLabels,
|
|
239
|
-
onChange: function onChange(scorePointLabel) {
|
|
240
|
-
return _this2.onScorePointLabelChange({
|
|
241
|
-
scorePointLabel: scorePointLabel,
|
|
242
|
-
value: value
|
|
243
|
-
});
|
|
244
|
-
},
|
|
245
|
-
alignToRight: remainingSpace < 296 && scorePointsValue < maxPoints // 296 is the space required for the toolbar
|
|
246
|
-
,
|
|
247
|
-
spellCheck: spellCheck,
|
|
248
|
-
uploadSoundSupport: uploadSoundSupport,
|
|
249
|
-
mathMlOptions: mathMlOptions,
|
|
250
|
-
imageSupport: imageSupport
|
|
251
|
-
}), error && /*#__PURE__*/_react["default"].createElement("div", {
|
|
252
|
-
className: classes.scorePointErrorText
|
|
253
|
-
}, error));
|
|
254
|
-
})));
|
|
255
|
-
}
|
|
256
|
-
}]);
|
|
257
|
-
return TraitsHeaderTile;
|
|
258
|
-
}(_react["default"].Component);
|
|
259
|
-
|
|
195
|
+
}), error && /*#__PURE__*/_react.default.createElement(ScorePointErrorText, null, error));
|
|
196
|
+
})));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
260
199
|
exports.TraitsHeaderTile = TraitsHeaderTile;
|
|
261
|
-
(0, _defineProperty2
|
|
262
|
-
maxPointsEnabled: _propTypes
|
|
263
|
-
spellCheck: _propTypes
|
|
264
|
-
errors: _propTypes
|
|
200
|
+
(0, _defineProperty2.default)(TraitsHeaderTile, "propTypes", {
|
|
201
|
+
maxPointsEnabled: _propTypes.default.bool,
|
|
202
|
+
spellCheck: _propTypes.default.bool,
|
|
203
|
+
errors: _propTypes.default.object
|
|
265
204
|
});
|
|
266
205
|
TraitsHeaderTile.propTypes = {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
"delete": _propTypes["default"].func.isRequired
|
|
206
|
+
onTraitLabelChange: _propTypes.default.func,
|
|
207
|
+
onScaleChange: _propTypes.default.func,
|
|
208
|
+
scorePointsValues: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
209
|
+
scorePointsLabels: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
210
|
+
traitLabel: _propTypes.default.string,
|
|
211
|
+
showStandards: _propTypes.default.bool,
|
|
212
|
+
showLevelTagInput: _propTypes.default.bool,
|
|
213
|
+
showDescription: _propTypes.default.bool,
|
|
214
|
+
maxPoints: _propTypes.default.number,
|
|
215
|
+
updateMaxPointsFieldValue: _propTypes.default.func,
|
|
216
|
+
scaleIndex: _propTypes.default.number,
|
|
217
|
+
currentPosition: _propTypes.default.number,
|
|
218
|
+
secondaryBlockWidth: _propTypes.default.number,
|
|
219
|
+
showDeleteScaleModal: _propTypes.default.func,
|
|
220
|
+
showScorePointLabels: _propTypes.default.bool,
|
|
221
|
+
setSecondaryBlockRef: _propTypes.default.func,
|
|
222
|
+
uploadSoundSupport: _propTypes.default.object,
|
|
223
|
+
maxMaxPoints: _propTypes.default.number,
|
|
224
|
+
labelPluginProps: _propTypes.default.object,
|
|
225
|
+
imageSupport: _propTypes.default.shape({
|
|
226
|
+
add: _propTypes.default.func.isRequired,
|
|
227
|
+
delete: _propTypes.default.func.isRequired
|
|
290
228
|
})
|
|
291
229
|
};
|
|
292
|
-
|
|
293
|
-
var _default = (0, _styles.withStyles)(styles)(TraitsHeaderTile);
|
|
294
|
-
|
|
295
|
-
exports["default"] = _default;
|
|
230
|
+
var _default = exports.default = TraitsHeaderTile;
|
|
296
231
|
//# sourceMappingURL=traitsHeader.js.map
|