@instructure/ui-pages 8.11.2-snapshot.7 → 8.11.2-snapshot.70
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/es/Pages/Page/index.js +5 -3
- package/es/Pages/index.js +6 -4
- package/es/package.json +1 -0
- package/lib/Pages/Page/index.js +5 -3
- package/lib/Pages/index.js +6 -4
- package/package.json +16 -16
- package/src/Pages/Page/index.tsx +7 -5
- package/src/Pages/index.tsx +9 -7
- package/types/Pages/Page/index.d.ts +1 -0
- package/types/Pages/Page/index.d.ts.map +1 -1
- package/types/Pages/index.d.ts +1 -0
- package/types/Pages/index.d.ts.map +1 -1
package/es/Pages/Page/index.js
CHANGED
|
@@ -44,12 +44,14 @@ class Page extends Component {
|
|
|
44
44
|
this.ref = null;
|
|
45
45
|
|
|
46
46
|
this.handleRef = el => {
|
|
47
|
-
this._content = el; // TODO remove and keep 'ref' in v9
|
|
48
|
-
|
|
49
47
|
this.ref = el;
|
|
50
48
|
};
|
|
51
49
|
}
|
|
52
50
|
|
|
51
|
+
get _content() {
|
|
52
|
+
return this.ref;
|
|
53
|
+
}
|
|
54
|
+
|
|
53
55
|
get defaultFocusElement() {
|
|
54
56
|
let defaultFocusElement = this.props.defaultFocusElement;
|
|
55
57
|
|
|
@@ -62,7 +64,7 @@ class Page extends Component {
|
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
if (!defaultFocusElement) {
|
|
65
|
-
const tabbable = findTabbable(this.
|
|
67
|
+
const tabbable = findTabbable(this.ref);
|
|
66
68
|
defaultFocusElement = tabbable && tabbable[0];
|
|
67
69
|
}
|
|
68
70
|
|
package/es/Pages/index.js
CHANGED
|
@@ -47,14 +47,16 @@ category: components
|
|
|
47
47
|
**/
|
|
48
48
|
|
|
49
49
|
let Pages = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class Pages extends Component {
|
|
50
|
+
get _contentElement() {
|
|
51
|
+
return this.ref;
|
|
52
|
+
}
|
|
53
|
+
|
|
50
54
|
constructor(props) {
|
|
51
55
|
super(props);
|
|
52
56
|
this._timeouts = [];
|
|
53
57
|
this.ref = null;
|
|
54
58
|
|
|
55
59
|
this.handleRef = el => {
|
|
56
|
-
this._contentElement = el; // TODO remove with v9 and keep ref
|
|
57
|
-
|
|
58
60
|
this.ref = el;
|
|
59
61
|
};
|
|
60
62
|
|
|
@@ -96,7 +98,7 @@ let Pages = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
|
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
get focused() {
|
|
99
|
-
return containsActiveElement(this.
|
|
101
|
+
return containsActiveElement(this.ref);
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
focus() {
|
|
@@ -107,7 +109,7 @@ let Pages = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
|
|
|
107
109
|
activePage.focus();
|
|
108
110
|
} else {
|
|
109
111
|
// Use first tabbable as last ditch effort
|
|
110
|
-
const tabbable = findTabbable(this.
|
|
112
|
+
const tabbable = findTabbable(this.ref);
|
|
111
113
|
const element = tabbable && tabbable[0];
|
|
112
114
|
element && element.focus();
|
|
113
115
|
}
|
package/es/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
package/lib/Pages/Page/index.js
CHANGED
|
@@ -41,12 +41,14 @@ class Page extends _react.Component {
|
|
|
41
41
|
this.ref = null;
|
|
42
42
|
|
|
43
43
|
this.handleRef = el => {
|
|
44
|
-
this._content = el; // TODO remove and keep 'ref' in v9
|
|
45
|
-
|
|
46
44
|
this.ref = el;
|
|
47
45
|
};
|
|
48
46
|
}
|
|
49
47
|
|
|
48
|
+
get _content() {
|
|
49
|
+
return this.ref;
|
|
50
|
+
}
|
|
51
|
+
|
|
50
52
|
get defaultFocusElement() {
|
|
51
53
|
let defaultFocusElement = this.props.defaultFocusElement;
|
|
52
54
|
|
|
@@ -59,7 +61,7 @@ class Page extends _react.Component {
|
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
if (!defaultFocusElement) {
|
|
62
|
-
const tabbable = (0, _findTabbable.findTabbable)(this.
|
|
64
|
+
const tabbable = (0, _findTabbable.findTabbable)(this.ref);
|
|
63
65
|
defaultFocusElement = tabbable && tabbable[0];
|
|
64
66
|
}
|
|
65
67
|
|
package/lib/Pages/index.js
CHANGED
|
@@ -53,14 +53,16 @@ category: components
|
|
|
53
53
|
|
|
54
54
|
exports.PagesContext = PagesContext;
|
|
55
55
|
let Pages = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = class Pages extends _react.Component {
|
|
56
|
+
get _contentElement() {
|
|
57
|
+
return this.ref;
|
|
58
|
+
}
|
|
59
|
+
|
|
56
60
|
constructor(props) {
|
|
57
61
|
super(props);
|
|
58
62
|
this._timeouts = [];
|
|
59
63
|
this.ref = null;
|
|
60
64
|
|
|
61
65
|
this.handleRef = el => {
|
|
62
|
-
this._contentElement = el; // TODO remove with v9 and keep ref
|
|
63
|
-
|
|
64
66
|
this.ref = el;
|
|
65
67
|
};
|
|
66
68
|
|
|
@@ -102,7 +104,7 @@ let Pages = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
get focused() {
|
|
105
|
-
return (0, _containsActiveElement.containsActiveElement)(this.
|
|
107
|
+
return (0, _containsActiveElement.containsActiveElement)(this.ref);
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
focus() {
|
|
@@ -113,7 +115,7 @@ let Pages = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
113
115
|
activePage.focus();
|
|
114
116
|
} else {
|
|
115
117
|
// Use first tabbable as last ditch effort
|
|
116
|
-
const tabbable = (0, _findTabbable.findTabbable)(this.
|
|
118
|
+
const tabbable = (0, _findTabbable.findTabbable)(this.ref);
|
|
117
119
|
const element = tabbable && tabbable[0];
|
|
118
120
|
element && element.focus();
|
|
119
121
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-pages",
|
|
3
|
-
"version": "8.11.2-snapshot.
|
|
3
|
+
"version": "8.11.2-snapshot.70+9653a896e",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -24,23 +24,23 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@instructure/ui-babel-preset": "8.11.2-snapshot.
|
|
28
|
-
"@instructure/ui-color-utils": "8.11.2-snapshot.
|
|
29
|
-
"@instructure/ui-test-utils": "8.11.2-snapshot.
|
|
30
|
-
"@instructure/ui-themes": "8.11.2-snapshot.
|
|
27
|
+
"@instructure/ui-babel-preset": "8.11.2-snapshot.70+9653a896e",
|
|
28
|
+
"@instructure/ui-color-utils": "8.11.2-snapshot.70+9653a896e",
|
|
29
|
+
"@instructure/ui-test-utils": "8.11.2-snapshot.70+9653a896e",
|
|
30
|
+
"@instructure/ui-themes": "8.11.2-snapshot.70+9653a896e"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.13.10",
|
|
34
|
-
"@instructure/console": "8.11.2-snapshot.
|
|
35
|
-
"@instructure/emotion": "8.11.2-snapshot.
|
|
36
|
-
"@instructure/shared-types": "8.11.2-snapshot.
|
|
37
|
-
"@instructure/ui-a11y-utils": "8.11.2-snapshot.
|
|
38
|
-
"@instructure/ui-dom-utils": "8.11.2-snapshot.
|
|
39
|
-
"@instructure/ui-prop-types": "8.11.2-snapshot.
|
|
40
|
-
"@instructure/ui-react-utils": "8.11.2-snapshot.
|
|
41
|
-
"@instructure/ui-utils": "8.11.2-snapshot.
|
|
42
|
-
"@instructure/ui-view": "8.11.2-snapshot.
|
|
43
|
-
"@instructure/uid": "8.11.2-snapshot.
|
|
34
|
+
"@instructure/console": "8.11.2-snapshot.70+9653a896e",
|
|
35
|
+
"@instructure/emotion": "8.11.2-snapshot.70+9653a896e",
|
|
36
|
+
"@instructure/shared-types": "8.11.2-snapshot.70+9653a896e",
|
|
37
|
+
"@instructure/ui-a11y-utils": "8.11.2-snapshot.70+9653a896e",
|
|
38
|
+
"@instructure/ui-dom-utils": "8.11.2-snapshot.70+9653a896e",
|
|
39
|
+
"@instructure/ui-prop-types": "8.11.2-snapshot.70+9653a896e",
|
|
40
|
+
"@instructure/ui-react-utils": "8.11.2-snapshot.70+9653a896e",
|
|
41
|
+
"@instructure/ui-utils": "8.11.2-snapshot.70+9653a896e",
|
|
42
|
+
"@instructure/ui-view": "8.11.2-snapshot.70+9653a896e",
|
|
43
|
+
"@instructure/uid": "8.11.2-snapshot.70+9653a896e",
|
|
44
44
|
"prop-types": "^15"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"sideEffects": false,
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "9653a896e80ba4d73335225e80807746a232d96d"
|
|
54
54
|
}
|
package/src/Pages/Page/index.tsx
CHANGED
|
@@ -56,12 +56,15 @@ class Page extends Component<PagesPageProps> {
|
|
|
56
56
|
navigateToPreviousPage: PropTypes.func
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
get _content() {
|
|
60
|
+
console.warn('_content deprecated, please use ref instead')
|
|
61
|
+
|
|
62
|
+
return this.ref
|
|
63
|
+
}
|
|
64
|
+
|
|
59
65
|
ref: Element | null = null
|
|
60
66
|
|
|
61
67
|
handleRef = (el: Element | null) => {
|
|
62
|
-
// @ts-expect-error ts-migrate(2551) FIXME: Property '_content' does not exist on type 'Page'.... Remove this comment to see the full error message
|
|
63
|
-
this._content = el // TODO remove and keep 'ref' in v9
|
|
64
|
-
|
|
65
68
|
this.ref = el
|
|
66
69
|
}
|
|
67
70
|
|
|
@@ -77,8 +80,7 @@ class Page extends Component<PagesPageProps> {
|
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
if (!defaultFocusElement) {
|
|
80
|
-
|
|
81
|
-
const tabbable = findTabbable(this._content)
|
|
83
|
+
const tabbable = findTabbable(this.ref)
|
|
82
84
|
// @ts-expect-error ts-migrate(2554) FIXME:
|
|
83
85
|
defaultFocusElement = tabbable && tabbable[0]
|
|
84
86
|
}
|
package/src/Pages/index.tsx
CHANGED
|
@@ -66,12 +66,16 @@ class Pages extends Component<PagesProps> {
|
|
|
66
66
|
static Page = Page
|
|
67
67
|
|
|
68
68
|
_timeouts = []
|
|
69
|
+
get _contentElement() {
|
|
70
|
+
console.warn(
|
|
71
|
+
'_contentElement property is deprecated and will be removed in v9, please use ref instead'
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
return this.ref
|
|
75
|
+
}
|
|
69
76
|
ref: Element | null = null
|
|
70
77
|
|
|
71
78
|
handleRef = (el: Element | null) => {
|
|
72
|
-
// @ts-expect-error ts-migrate(2339) FIXME: Property '_contentElement' does not exist on type ... Remove this comment to see the full error message
|
|
73
|
-
this._contentElement = el // TODO remove with v9 and keep ref
|
|
74
|
-
|
|
75
79
|
this.ref = el
|
|
76
80
|
}
|
|
77
81
|
|
|
@@ -133,8 +137,7 @@ class Pages extends Component<PagesProps> {
|
|
|
133
137
|
}
|
|
134
138
|
|
|
135
139
|
get focused() {
|
|
136
|
-
|
|
137
|
-
return containsActiveElement(this._contentElement)
|
|
140
|
+
return containsActiveElement(this.ref)
|
|
138
141
|
}
|
|
139
142
|
|
|
140
143
|
focus() {
|
|
@@ -149,8 +152,7 @@ class Pages extends Component<PagesProps> {
|
|
|
149
152
|
activePage.focus()
|
|
150
153
|
} else {
|
|
151
154
|
// Use first tabbable as last ditch effort
|
|
152
|
-
|
|
153
|
-
const tabbable = findTabbable(this._contentElement)
|
|
155
|
+
const tabbable = findTabbable(this.ref)
|
|
154
156
|
const element = tabbable && tabbable[0]
|
|
155
157
|
|
|
156
158
|
// @ts-expect-error ts-migrate(2554) FIXME:
|
|
@@ -31,6 +31,7 @@ declare class Page extends Component<PagesPageProps> {
|
|
|
31
31
|
history: PropTypes.Requireable<any[]>;
|
|
32
32
|
navigateToPreviousPage: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
33
|
};
|
|
34
|
+
get _content(): Element | null;
|
|
34
35
|
ref: Element | null;
|
|
35
36
|
handleRef: (el: Element | null) => void;
|
|
36
37
|
get defaultFocusElement(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | ((...args: any[]) => any) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Pages/Page/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,SAAS,MAAM,YAAY,CAAA;AAMlC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAG7C;;;;;GAKG;AACH,cAAM,IAAK,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1C,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,YAAY;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;MAKlB;IAED,MAAM,CAAC,YAAY;;;MAGlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Pages/Page/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,SAAS,MAAM,YAAY,CAAA;AAMlC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;A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