@01-edu/shared 1.1.5 → 1.1.6
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/attrs-defs.js +7 -5
- package/package.json +1 -1
- package/toolbox.js +1 -1
package/attrs-defs.js
CHANGED
|
@@ -2438,7 +2438,7 @@ types.levelDefinition = TypeObject({
|
|
|
2438
2438
|
check: (level, object) => {
|
|
2439
2439
|
checkIntegerInBetween(level, 1, MAX_LEVEL)
|
|
2440
2440
|
|
|
2441
|
-
const definitionsWithSameLevel = object.attrs.levelsDefinitions
|
|
2441
|
+
const definitionsWithSameLevel = object.attrs.levelsDefinitions?.filter(
|
|
2442
2442
|
levelDefinition => levelDefinition.level === level,
|
|
2443
2443
|
)
|
|
2444
2444
|
if (definitionsWithSameLevel?.length > 1) {
|
|
@@ -2627,7 +2627,7 @@ types.rankDefinitionName = Literal('', {
|
|
|
2627
2627
|
// checkNotEmpty(name): have to be commented or it's impossible
|
|
2628
2628
|
// to add a new rank to the ranks definition, as default value is ''
|
|
2629
2629
|
// and check is done before add
|
|
2630
|
-
const definitionsWithSameName = object.attrs.ranksDefinitions
|
|
2630
|
+
const definitionsWithSameName = object.attrs.ranksDefinitions?.filter(
|
|
2631
2631
|
rankDefinition => rankDefinition.name === name,
|
|
2632
2632
|
)
|
|
2633
2633
|
if (definitionsWithSameName?.length > 1) {
|
|
@@ -2651,7 +2651,7 @@ types.rankDefinition = TypeObject({
|
|
|
2651
2651
|
check: (level, object) => {
|
|
2652
2652
|
checkIntegerInBetween(level, 0, MAX_LEVEL)
|
|
2653
2653
|
|
|
2654
|
-
const definitionsWithSameLevel = object.attrs.ranksDefinitions
|
|
2654
|
+
const definitionsWithSameLevel = object.attrs.ranksDefinitions?.filter(
|
|
2655
2655
|
rankDefinition => rankDefinition.level === level,
|
|
2656
2656
|
)
|
|
2657
2657
|
if (definitionsWithSameLevel?.length > 1) {
|
|
@@ -3636,7 +3636,7 @@ types.timelineChunk = TypeObject({
|
|
|
3636
3636
|
check: (month, object) => {
|
|
3637
3637
|
checkIntegerInBetween(month, 1, 120)
|
|
3638
3638
|
|
|
3639
|
-
const definitionsWithSameMonth = object.attrs.timeline
|
|
3639
|
+
const definitionsWithSameMonth = object.attrs.timeline?.filter(
|
|
3640
3640
|
guideline => guideline.month === month,
|
|
3641
3641
|
)
|
|
3642
3642
|
if (definitionsWithSameMonth?.length > 1) {
|
|
@@ -3677,7 +3677,9 @@ types.timelineChunk = TypeObject({
|
|
|
3677
3677
|
)
|
|
3678
3678
|
}
|
|
3679
3679
|
|
|
3680
|
-
const ranksNames = object.attrs.ranksDefinitions
|
|
3680
|
+
const ranksNames = object.attrs.ranksDefinitions?.map(
|
|
3681
|
+
({ name }) => name,
|
|
3682
|
+
)
|
|
3681
3683
|
if (!ranksNames.includes(rank)) {
|
|
3682
3684
|
throw Error(
|
|
3683
3685
|
`Must match one of the following existing rank names: ${ranksNames.join(
|
package/package.json
CHANGED
package/toolbox.js
CHANGED
|
@@ -5,7 +5,7 @@ import { onboardingTypes } from './onboarding.js'
|
|
|
5
5
|
const keyCodes = {
|
|
6
6
|
13: ({ save, value, event, allowLineBreak }) => {
|
|
7
7
|
if (event.shiftKey || allowLineBreak) return false
|
|
8
|
-
save(value)
|
|
8
|
+
return save(value)
|
|
9
9
|
}, // enter
|
|
10
10
|
27: ({ set, originalValue }) => set(originalValue), // esc
|
|
11
11
|
83: ({ save, value, event }) =>
|