@pie-lib/mask-markup 1.33.3-next.0 → 1.33.3-next.162

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +13 -67
  2. package/esm/package.json +3 -0
  3. package/lib/choices/choice.js +98 -203
  4. package/lib/choices/choice.js.map +1 -1
  5. package/lib/choices/index.js +21 -53
  6. package/lib/choices/index.js.map +1 -1
  7. package/lib/componentize.js +1 -5
  8. package/lib/componentize.js.map +1 -1
  9. package/lib/components/blank.js +303 -361
  10. package/lib/components/blank.js.map +1 -1
  11. package/lib/components/correct-input.js +41 -65
  12. package/lib/components/correct-input.js.map +1 -1
  13. package/lib/components/dropdown.js +218 -257
  14. package/lib/components/dropdown.js.map +1 -1
  15. package/lib/components/input.js +10 -17
  16. package/lib/components/input.js.map +1 -1
  17. package/lib/constructed-response.js +38 -52
  18. package/lib/constructed-response.js.map +1 -1
  19. package/lib/customizable.js +5 -9
  20. package/lib/customizable.js.map +1 -1
  21. package/lib/drag-in-the-blank.js +140 -105
  22. package/lib/drag-in-the-blank.js.map +1 -1
  23. package/lib/index.js +0 -7
  24. package/lib/index.js.map +1 -1
  25. package/lib/inline-dropdown.js +4 -12
  26. package/lib/inline-dropdown.js.map +1 -1
  27. package/lib/mask.js +60 -118
  28. package/lib/mask.js.map +1 -1
  29. package/lib/serialization.js +8 -48
  30. package/lib/serialization.js.map +1 -1
  31. package/lib/with-mask.js +30 -58
  32. package/lib/with-mask.js.map +1 -1
  33. package/package.json +20 -12
  34. package/src/__tests__/drag-in-the-blank.test.js +66 -26
  35. package/src/__tests__/mask.test.js +147 -112
  36. package/src/__tests__/with-mask.test.js +44 -19
  37. package/src/choices/__tests__/index.test.js +38 -25
  38. package/src/choices/choice.jsx +86 -153
  39. package/src/choices/index.jsx +9 -3
  40. package/src/components/__tests__/blank.test.js +92 -156
  41. package/src/components/__tests__/correct-input.test.js +60 -19
  42. package/src/components/__tests__/dropdown.test.js +61 -19
  43. package/src/components/__tests__/input.test.js +72 -20
  44. package/src/components/blank.jsx +273 -272
  45. package/src/components/correct-input.jsx +33 -39
  46. package/src/components/dropdown.jsx +173 -161
  47. package/src/constructed-response.jsx +22 -18
  48. package/src/drag-in-the-blank.jsx +131 -42
  49. package/src/mask.jsx +38 -29
  50. package/src/with-mask.jsx +7 -4
  51. package/src/__tests__/__snapshots__/drag-in-the-blank.test.js.snap +0 -316
  52. package/src/__tests__/__snapshots__/mask.test.js.snap +0 -55
  53. package/src/__tests__/__snapshots__/with-mask.test.js.snap +0 -62
  54. package/src/choices/__tests__/__snapshots__/index.test.js.snap +0 -209
  55. package/src/components/__tests__/__snapshots__/blank.test.js.snap +0 -111
  56. package/src/components/__tests__/__snapshots__/correct-input.test.js.snap +0 -64
  57. package/src/components/__tests__/__snapshots__/dropdown.test.js.snap +0 -136
  58. package/src/components/__tests__/__snapshots__/input.test.js.snap +0 -34
@@ -1,55 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Mask render renders correctly a div 1`] = `
4
- <div>
5
- <div
6
- key="div-0"
7
- >
8
- <WithStyles(Component)
9
- key="p-0"
10
- >
11
- Foo
12
- </WithStyles(Component)>
13
- </div>
14
- </div>
15
- `;
16
-
17
- exports[`Mask render renders correctly a em 1`] = `
18
- <WithStyles(Component)>
19
- Foo
20
- <em
21
- key="1"
22
- >
23
- x
24
- </em>
25
- bar
26
- </WithStyles(Component)>
27
- `;
28
-
29
- exports[`Mask render renders correctly a paragraph 1`] = `
30
- <div>
31
- <WithStyles(Component)
32
- key="p-0"
33
- >
34
- Foo
35
- </WithStyles(Component)>
36
- </div>
37
- `;
38
-
39
- exports[`Mask render renders correctly with default props 1`] = `
40
- <div>
41
- Foo
42
- </div>
43
- `;
44
-
45
- exports[`Mask render renders without space under tbody 1`] = `
46
- <div>
47
- <tbody
48
- key="tbody-0"
49
- >
50
- <tr
51
- key="tr-1"
52
- />
53
- </tbody>
54
- </div>
55
- `;
@@ -1,62 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`WithMask render renders correctly with default props 1`] = `
4
- <Mask
5
- layout={
6
- Object {
7
- "data": Object {},
8
- "nodes": Array [
9
- Object {
10
- "data": Object {
11
- "attributes": Object {},
12
- "dataset": Object {},
13
- },
14
- "nodes": Array [
15
- Object {
16
- "leaves": Array [
17
- Object {
18
- "text": "Foo bar ",
19
- },
20
- ],
21
- "object": "text",
22
- },
23
- Object {
24
- "data": Object {
25
- "attributes": Object {
26
- "data-component": "foo",
27
- "data-id": "0",
28
- },
29
- "dataset": Object {
30
- "component": "foo",
31
- "id": "0",
32
- },
33
- },
34
- "nodes": Array [],
35
- "object": "inline",
36
- "type": "span",
37
- },
38
- Object {
39
- "leaves": Array [
40
- Object {
41
- "text": " over the moon;",
42
- },
43
- ],
44
- "object": "text",
45
- },
46
- ],
47
- "object": "block",
48
- "type": "p",
49
- },
50
- ],
51
- "object": "document",
52
- }
53
- }
54
- onChange={[MockFunction]}
55
- renderChildren={[Function]}
56
- value={
57
- Object {
58
- "0": "blank",
59
- }
60
- }
61
- />
62
- `;
@@ -1,209 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`index Choice render renders correctly with default props 1`] = `
4
- <BlankContentComp
5
- classes={
6
- Object {
7
- "chip": "BlankContentComp-chip-2",
8
- "chipLabel": "BlankContentComp-chipLabel-3",
9
- "choice": "BlankContentComp-choice-1",
10
- "disabled": "BlankContentComp-disabled-4",
11
- }
12
- }
13
- disabled={false}
14
- label="Label"
15
- targetId="1"
16
- value="1"
17
- />
18
- `;
19
-
20
- exports[`index Choice render renders correctly with disabled prop as true 1`] = `
21
- <BlankContentComp
22
- classes={
23
- Object {
24
- "chip": "BlankContentComp-chip-2",
25
- "chipLabel": "BlankContentComp-chipLabel-3",
26
- "choice": "BlankContentComp-choice-1",
27
- "disabled": "BlankContentComp-disabled-4",
28
- }
29
- }
30
- disabled={true}
31
- label="Label"
32
- targetId="1"
33
- value="1"
34
- />
35
- `;
36
-
37
- exports[`index Choices renders correctly with default props 1`] = `
38
- <div
39
- style={
40
- Object {
41
- "margin": "0 40px 0 0",
42
- "minWidth": "100px",
43
- }
44
- }
45
- >
46
- <DropTarget(DroppablePlaceholder)
47
- disabled={false}
48
- >
49
- <DragSource(WithStyles(BlankContentComp))
50
- choice={
51
- Object {
52
- "id": "0",
53
- "label": "Jumped",
54
- "value": "Jumped",
55
- }
56
- }
57
- disabled={false}
58
- key="Jumped-0"
59
- />
60
- <DragSource(WithStyles(BlankContentComp))
61
- choice={
62
- Object {
63
- "id": "1",
64
- "label": "Laughed",
65
- "value": "Laughed",
66
- }
67
- }
68
- disabled={false}
69
- key="Laughed-1"
70
- />
71
- <DragSource(WithStyles(BlankContentComp))
72
- choice={
73
- Object {
74
- "id": "2",
75
- "label": "Spoon",
76
- "value": "Spoon",
77
- }
78
- }
79
- disabled={false}
80
- key="Spoon-2"
81
- />
82
- </DropTarget(DroppablePlaceholder)>
83
- </div>
84
- `;
85
-
86
- exports[`index Choices renders correctly with disabled prop as true 1`] = `
87
- <div
88
- style={
89
- Object {
90
- "margin": "0 40px 0 0",
91
- "minWidth": "100px",
92
- }
93
- }
94
- >
95
- <DropTarget(DroppablePlaceholder)
96
- disabled={true}
97
- >
98
- <DragSource(WithStyles(BlankContentComp))
99
- choice={
100
- Object {
101
- "id": "0",
102
- "label": "Jumped",
103
- "value": "Jumped",
104
- }
105
- }
106
- disabled={true}
107
- key="Jumped-0"
108
- />
109
- <DragSource(WithStyles(BlankContentComp))
110
- choice={
111
- Object {
112
- "id": "1",
113
- "label": "Laughed",
114
- "value": "Laughed",
115
- }
116
- }
117
- disabled={true}
118
- key="Laughed-1"
119
- />
120
- <DragSource(WithStyles(BlankContentComp))
121
- choice={
122
- Object {
123
- "id": "2",
124
- "label": "Spoon",
125
- "value": "Spoon",
126
- }
127
- }
128
- disabled={true}
129
- key="Spoon-2"
130
- />
131
- </DropTarget(DroppablePlaceholder)>
132
- </div>
133
- `;
134
-
135
- exports[`index Choices renders with duplicates 1`] = `
136
- <div
137
- style={
138
- Object {
139
- "margin": "0 40px 0 0",
140
- "minWidth": "100px",
141
- }
142
- }
143
- >
144
- <DropTarget(DroppablePlaceholder)
145
- disabled={false}
146
- >
147
- <DragSource(WithStyles(BlankContentComp))
148
- choice={
149
- Object {
150
- "id": "0",
151
- "label": "Jumped",
152
- "value": "Jumped",
153
- }
154
- }
155
- disabled={false}
156
- key="Jumped-0"
157
- />
158
- <DragSource(WithStyles(BlankContentComp))
159
- choice={
160
- Object {
161
- "id": "1",
162
- "label": "Laughed",
163
- "value": "Laughed",
164
- }
165
- }
166
- disabled={false}
167
- key="Laughed-1"
168
- />
169
- <DragSource(WithStyles(BlankContentComp))
170
- choice={
171
- Object {
172
- "id": "2",
173
- "label": "Spoon",
174
- "value": "Spoon",
175
- }
176
- }
177
- disabled={false}
178
- key="Spoon-2"
179
- />
180
- </DropTarget(DroppablePlaceholder)>
181
- </div>
182
- `;
183
-
184
- exports[`index Choices renders without duplicates 1`] = `
185
- <div
186
- style={
187
- Object {
188
- "margin": "0 40px 0 0",
189
- "minWidth": "100px",
190
- }
191
- }
192
- >
193
- <DropTarget(DroppablePlaceholder)
194
- disabled={false}
195
- >
196
- <DragSource(WithStyles(BlankContentComp))
197
- choice={
198
- Object {
199
- "id": "2",
200
- "label": "Spoon",
201
- "value": "Spoon",
202
- }
203
- }
204
- disabled={false}
205
- key="Spoon-0"
206
- />
207
- </DropTarget(DroppablePlaceholder)>
208
- </div>
209
- `;
@@ -1,111 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Blank render renders correctly with default props 1`] = `
4
- <WithStyles(Chip)
5
- className="undefined"
6
- clickable={false}
7
- component="span"
8
- disabled={true}
9
- label={
10
- <React.Fragment>
11
- <span
12
- className=""
13
- >
14
-
15
- </span>
16
- </React.Fragment>
17
- }
18
- style={
19
- Object {
20
- "height": 0,
21
- "minHeight": 32,
22
- "minWidth": 90,
23
- "width": 0,
24
- }
25
- }
26
- />
27
- `;
28
-
29
- exports[`Blank render renders correctly with disabled prop as true 1`] = `
30
- <WithStyles(Chip)
31
- className="undefined"
32
- clickable={false}
33
- component="span"
34
- disabled={true}
35
- label={
36
- <React.Fragment>
37
- <span
38
- className=""
39
- >
40
-
41
- </span>
42
- </React.Fragment>
43
- }
44
- style={
45
- Object {
46
- "height": 0,
47
- "minHeight": 32,
48
- "minWidth": 90,
49
- "width": 0,
50
- }
51
- }
52
- variant="outlined"
53
- />
54
- `;
55
-
56
- exports[`Blank render renders correctly with draggedItem 1`] = `
57
- <WithStyles(Chip)
58
- className="undefined"
59
- clickable={false}
60
- component="span"
61
- disabled={true}
62
- label={
63
- <React.Fragment>
64
- <span
65
- className=""
66
- >
67
-
68
- </span>
69
- </React.Fragment>
70
- }
71
- style={
72
- Object {
73
- "height": 0,
74
- "minHeight": 32,
75
- "minWidth": 90,
76
- "width": 0,
77
- }
78
- }
79
- />
80
- `;
81
-
82
- exports[`Blank render renders correctly with draggedItem and isOver 1`] = `
83
- <WithStyles(Chip)
84
- className="undefined"
85
- clickable={false}
86
- component="span"
87
- disabled={true}
88
- label={
89
- <React.Fragment>
90
- <span
91
- className="undefined"
92
- >
93
-
94
- </span>
95
- <span
96
- className=""
97
- >
98
-
99
- </span>
100
- </React.Fragment>
101
- }
102
- style={
103
- Object {
104
- "height": 0,
105
- "minHeight": 32,
106
- "minWidth": 90,
107
- "width": 0,
108
- }
109
- }
110
- />
111
- `;
@@ -1,64 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`CorrectInput render renders correctly with correct as false 1`] = `
4
- <Component
5
- classes={
6
- Object {
7
- "box": "Component-box-5",
8
- "correct": "Component-correct-3",
9
- "crInput": "Component-crInput-2",
10
- "incorrect": "Component-incorrect-4",
11
- "input": "Component-input-1",
12
- "notchedOutline": "Component-notchedOutline-7",
13
- "outlinedInput": "Component-outlinedInput-6",
14
- }
15
- }
16
- correct={false}
17
- disabled={false}
18
- onChange={[MockFunction]}
19
- value="Cow"
20
- variant="outlined"
21
- />
22
- `;
23
-
24
- exports[`CorrectInput render renders correctly with default props 1`] = `
25
- <Component
26
- classes={
27
- Object {
28
- "box": "Component-box-5",
29
- "correct": "Component-correct-3",
30
- "crInput": "Component-crInput-2",
31
- "incorrect": "Component-incorrect-4",
32
- "input": "Component-input-1",
33
- "notchedOutline": "Component-notchedOutline-7",
34
- "outlinedInput": "Component-outlinedInput-6",
35
- }
36
- }
37
- correct={false}
38
- disabled={false}
39
- onChange={[MockFunction]}
40
- value="Cow"
41
- variant="outlined"
42
- />
43
- `;
44
-
45
- exports[`CorrectInput render renders correctly with disabled prop as true 1`] = `
46
- <Component
47
- classes={
48
- Object {
49
- "box": "Component-box-5",
50
- "correct": "Component-correct-3",
51
- "crInput": "Component-crInput-2",
52
- "incorrect": "Component-incorrect-4",
53
- "input": "Component-input-1",
54
- "notchedOutline": "Component-notchedOutline-7",
55
- "outlinedInput": "Component-outlinedInput-6",
56
- }
57
- }
58
- correct={false}
59
- disabled={true}
60
- onChange={[MockFunction]}
61
- value="Cow"
62
- variant="outlined"
63
- />
64
- `;
@@ -1,136 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Dropdown render renders correctly with correct as true 1`] = `
4
- <Dropdown
5
- choices={
6
- Array [
7
- Object {
8
- "id": undefined,
9
- "label": "Jumped",
10
- "value": "Jumped",
11
- },
12
- Object {
13
- "id": undefined,
14
- "label": "Laughed",
15
- "value": "Laughed",
16
- },
17
- Object {
18
- "id": undefined,
19
- "label": "Smiled",
20
- "value": "Smiled",
21
- },
22
- ]
23
- }
24
- classes={
25
- Object {
26
- "correctIcon": "Dropdown-correctIcon-11",
27
- "correctnessIndicatorIcon": "Dropdown-correctnessIndicatorIcon-10",
28
- "disabledCorrect": "Dropdown-disabledCorrect-2",
29
- "disabledIncorrect": "Dropdown-disabledIncorrect-3",
30
- "incorrectIcon": "Dropdown-incorrectIcon-12",
31
- "label": "Dropdown-label-7",
32
- "menuRoot": "Dropdown-menuRoot-6",
33
- "root": "Dropdown-root-1",
34
- "selectMenu": "Dropdown-selectMenu-4",
35
- "selected": "Dropdown-selected-5",
36
- "selectedIndicator": "Dropdown-selectedIndicator-8",
37
- "srOnly": "Dropdown-srOnly-9",
38
- }
39
- }
40
- correct={true}
41
- disabled={false}
42
- id="1"
43
- onChange={[MockFunction]}
44
- value="Jumped"
45
- />
46
- `;
47
-
48
- exports[`Dropdown render renders correctly with default props 1`] = `
49
- <Dropdown
50
- choices={
51
- Array [
52
- Object {
53
- "id": undefined,
54
- "label": "Jumped",
55
- "value": "Jumped",
56
- },
57
- Object {
58
- "id": undefined,
59
- "label": "Laughed",
60
- "value": "Laughed",
61
- },
62
- Object {
63
- "id": undefined,
64
- "label": "Smiled",
65
- "value": "Smiled",
66
- },
67
- ]
68
- }
69
- classes={
70
- Object {
71
- "correctIcon": "Dropdown-correctIcon-11",
72
- "correctnessIndicatorIcon": "Dropdown-correctnessIndicatorIcon-10",
73
- "disabledCorrect": "Dropdown-disabledCorrect-2",
74
- "disabledIncorrect": "Dropdown-disabledIncorrect-3",
75
- "incorrectIcon": "Dropdown-incorrectIcon-12",
76
- "label": "Dropdown-label-7",
77
- "menuRoot": "Dropdown-menuRoot-6",
78
- "root": "Dropdown-root-1",
79
- "selectMenu": "Dropdown-selectMenu-4",
80
- "selected": "Dropdown-selected-5",
81
- "selectedIndicator": "Dropdown-selectedIndicator-8",
82
- "srOnly": "Dropdown-srOnly-9",
83
- }
84
- }
85
- correct={false}
86
- disabled={false}
87
- id="1"
88
- onChange={[MockFunction]}
89
- value="Jumped"
90
- />
91
- `;
92
-
93
- exports[`Dropdown render renders correctly with disabled prop as true 1`] = `
94
- <Dropdown
95
- choices={
96
- Array [
97
- Object {
98
- "id": undefined,
99
- "label": "Jumped",
100
- "value": "Jumped",
101
- },
102
- Object {
103
- "id": undefined,
104
- "label": "Laughed",
105
- "value": "Laughed",
106
- },
107
- Object {
108
- "id": undefined,
109
- "label": "Smiled",
110
- "value": "Smiled",
111
- },
112
- ]
113
- }
114
- classes={
115
- Object {
116
- "correctIcon": "Dropdown-correctIcon-11",
117
- "correctnessIndicatorIcon": "Dropdown-correctnessIndicatorIcon-10",
118
- "disabledCorrect": "Dropdown-disabledCorrect-2",
119
- "disabledIncorrect": "Dropdown-disabledIncorrect-3",
120
- "incorrectIcon": "Dropdown-incorrectIcon-12",
121
- "label": "Dropdown-label-7",
122
- "menuRoot": "Dropdown-menuRoot-6",
123
- "root": "Dropdown-root-1",
124
- "selectMenu": "Dropdown-selectMenu-4",
125
- "selected": "Dropdown-selected-5",
126
- "selectedIndicator": "Dropdown-selectedIndicator-8",
127
- "srOnly": "Dropdown-srOnly-9",
128
- }
129
- }
130
- correct={false}
131
- disabled={true}
132
- id="1"
133
- onChange={[MockFunction]}
134
- value="Jumped"
135
- />
136
- `;
@@ -1,34 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Input render renders correctly with correct as false 1`] = `
4
- <WithStyles(Component)
5
- correct={false}
6
- disabled={false}
7
- isBox={true}
8
- onChange={[Function]}
9
- value="Cow"
10
- variant="outlined"
11
- />
12
- `;
13
-
14
- exports[`Input render renders correctly with default props 1`] = `
15
- <WithStyles(Component)
16
- correct={false}
17
- disabled={false}
18
- isBox={true}
19
- onChange={[Function]}
20
- value="Cow"
21
- variant="outlined"
22
- />
23
- `;
24
-
25
- exports[`Input render renders correctly with disabled prop as true 1`] = `
26
- <WithStyles(Component)
27
- correct={false}
28
- disabled={true}
29
- isBox={true}
30
- onChange={[Function]}
31
- value="Cow"
32
- variant="outlined"
33
- />
34
- `;