@instructure/ui-table 11.6.0 → 11.6.1-snapshot-129
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 +43 -308
- package/es/Table/{Body → v1/Body}/index.js +2 -2
- package/es/Table/{Cell → v1/Cell}/index.js +2 -2
- package/es/Table/{ColHeader → v1/ColHeader}/index.js +1 -1
- package/es/Table/{Head → v1/Head}/index.js +2 -2
- package/es/Table/{Row → v1/Row}/index.js +2 -2
- package/es/Table/{RowHeader → v1/RowHeader}/index.js +2 -2
- package/es/Table/{index.js → v1/index.js} +2 -2
- package/es/Table/v2/Body/index.js +73 -0
- package/es/Table/v2/Body/props.js +26 -0
- package/es/Table/v2/Body/styles.js +45 -0
- package/es/Table/v2/Cell/index.js +68 -0
- package/es/Table/v2/Cell/props.js +26 -0
- package/es/Table/v2/Cell/styles.js +54 -0
- package/es/Table/v2/ColHeader/index.js +117 -0
- package/es/Table/v2/ColHeader/props.js +26 -0
- package/es/Table/v2/ColHeader/styles.js +93 -0
- package/es/Table/v2/Head/index.js +173 -0
- package/es/Table/v2/Head/props.js +26 -0
- package/es/Table/v2/Head/styles.js +45 -0
- package/es/Table/v2/Row/index.js +82 -0
- package/es/Table/v2/Row/props.js +26 -0
- package/es/Table/v2/Row/styles.js +67 -0
- package/es/Table/v2/RowHeader/index.js +68 -0
- package/es/Table/v2/RowHeader/props.js +26 -0
- package/es/Table/v2/RowHeader/styles.js +54 -0
- package/es/Table/v2/TableContext.js +46 -0
- package/es/Table/v2/index.js +135 -0
- package/es/Table/v2/props.js +26 -0
- package/es/Table/v2/styles.js +58 -0
- package/es/exports/a.js +31 -0
- package/es/exports/b.js +31 -0
- package/lib/Table/{Body → v1/Body}/index.js +4 -4
- package/lib/Table/{Cell → v1/Cell}/index.js +4 -4
- package/lib/Table/{ColHeader → v1/ColHeader}/index.js +4 -4
- package/lib/Table/{Head → v1/Head}/index.js +5 -5
- package/lib/Table/{Row → v1/Row}/index.js +4 -4
- package/lib/Table/{RowHeader → v1/RowHeader}/index.js +4 -4
- package/lib/Table/{index.js → v1/index.js} +4 -4
- package/lib/Table/v2/Body/index.js +79 -0
- package/lib/Table/v2/Body/props.js +31 -0
- package/lib/Table/v2/Body/styles.js +51 -0
- package/lib/Table/v2/Cell/index.js +74 -0
- package/lib/Table/v2/Cell/props.js +31 -0
- package/lib/Table/v2/Cell/styles.js +60 -0
- package/lib/Table/v2/ColHeader/index.js +122 -0
- package/lib/Table/v2/ColHeader/props.js +31 -0
- package/lib/Table/v2/ColHeader/styles.js +99 -0
- package/lib/Table/v2/Head/index.js +179 -0
- package/lib/Table/v2/Head/props.js +31 -0
- package/lib/Table/v2/Head/styles.js +51 -0
- package/lib/Table/v2/Row/index.js +88 -0
- package/lib/Table/v2/Row/props.js +31 -0
- package/lib/Table/v2/Row/styles.js +73 -0
- package/lib/Table/v2/RowHeader/index.js +74 -0
- package/lib/Table/v2/RowHeader/props.js +31 -0
- package/lib/Table/v2/RowHeader/styles.js +60 -0
- package/lib/Table/v2/TableContext.js +51 -0
- package/lib/Table/v2/index.js +140 -0
- package/lib/Table/v2/props.js +31 -0
- package/lib/Table/v2/styles.js +64 -0
- package/lib/{index.js → exports/a.js} +9 -9
- package/lib/exports/b.js +61 -0
- package/package.json +43 -21
- package/src/Table/{Body → v1/Body}/index.tsx +2 -2
- package/src/Table/{Cell → v1/Cell}/index.tsx +2 -2
- package/src/Table/{ColHeader → v1/ColHeader}/index.tsx +1 -1
- package/src/Table/{Head → v1/Head}/index.tsx +3 -3
- package/src/Table/{README.md → v1/README.md} +1 -1
- package/src/Table/{Row → v1/Row}/index.tsx +2 -2
- package/src/Table/{RowHeader → v1/RowHeader}/index.tsx +2 -2
- package/src/Table/{index.tsx → v1/index.tsx} +2 -2
- package/src/Table/v2/Body/index.tsx +91 -0
- package/src/Table/v2/Body/props.ts +50 -0
- package/src/Table/v2/Body/styles.ts +51 -0
- package/src/Table/v2/Cell/index.tsx +83 -0
- package/src/Table/v2/Cell/props.ts +54 -0
- package/src/Table/v2/Cell/styles.ts +60 -0
- package/src/Table/v2/ColHeader/index.tsx +118 -0
- package/src/Table/v2/ColHeader/props.ts +93 -0
- package/src/Table/v2/ColHeader/styles.ts +95 -0
- package/src/Table/v2/Head/index.tsx +200 -0
- package/src/Table/v2/Head/props.ts +64 -0
- package/src/Table/v2/Head/styles.ts +51 -0
- package/src/Table/v2/README.md +1155 -0
- package/src/Table/v2/Row/index.tsx +105 -0
- package/src/Table/v2/Row/props.ts +67 -0
- package/src/Table/v2/Row/styles.ts +78 -0
- package/src/Table/v2/RowHeader/index.tsx +84 -0
- package/src/Table/v2/RowHeader/props.ts +48 -0
- package/src/Table/v2/RowHeader/styles.ts +60 -0
- package/src/Table/v2/TableContext.ts +66 -0
- package/src/Table/v2/index.tsx +160 -0
- package/src/Table/v2/props.ts +98 -0
- package/src/Table/v2/styles.ts +63 -0
- package/src/exports/a.ts +39 -0
- package/src/exports/b.ts +39 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Table/v1/Body/index.d.ts.map +1 -0
- package/types/Table/v1/Body/props.d.ts.map +1 -0
- package/types/Table/v1/Body/styles.d.ts.map +1 -0
- package/types/Table/v1/Body/theme.d.ts.map +1 -0
- package/types/Table/v1/Cell/index.d.ts.map +1 -0
- package/types/Table/v1/Cell/props.d.ts.map +1 -0
- package/types/Table/v1/Cell/styles.d.ts.map +1 -0
- package/types/Table/v1/Cell/theme.d.ts.map +1 -0
- package/types/Table/v1/ColHeader/index.d.ts.map +1 -0
- package/types/Table/v1/ColHeader/props.d.ts.map +1 -0
- package/types/Table/v1/ColHeader/styles.d.ts.map +1 -0
- package/types/Table/v1/ColHeader/theme.d.ts.map +1 -0
- package/types/Table/v1/Head/index.d.ts.map +1 -0
- package/types/Table/v1/Head/props.d.ts.map +1 -0
- package/types/Table/v1/Head/styles.d.ts.map +1 -0
- package/types/Table/v1/Head/theme.d.ts.map +1 -0
- package/types/Table/v1/Row/index.d.ts.map +1 -0
- package/types/Table/v1/Row/props.d.ts.map +1 -0
- package/types/Table/v1/Row/styles.d.ts.map +1 -0
- package/types/Table/v1/Row/theme.d.ts.map +1 -0
- package/types/Table/v1/RowHeader/index.d.ts.map +1 -0
- package/types/Table/v1/RowHeader/props.d.ts.map +1 -0
- package/types/Table/v1/RowHeader/styles.d.ts.map +1 -0
- package/types/Table/v1/RowHeader/theme.d.ts.map +1 -0
- package/types/Table/v1/TableContext.d.ts.map +1 -0
- package/types/Table/v1/index.d.ts.map +1 -0
- package/types/Table/v1/props.d.ts.map +1 -0
- package/types/Table/v1/styles.d.ts.map +1 -0
- package/types/Table/v1/theme.d.ts.map +1 -0
- package/types/Table/v2/Body/index.d.ts +24 -0
- package/types/Table/v2/Body/index.d.ts.map +1 -0
- package/types/Table/v2/Body/props.d.ts +20 -0
- package/types/Table/v2/Body/props.d.ts.map +1 -0
- package/types/Table/v2/Body/styles.d.ts +13 -0
- package/types/Table/v2/Body/styles.d.ts.map +1 -0
- package/types/Table/v2/Cell/index.d.ts +29 -0
- package/types/Table/v2/Cell/index.d.ts.map +1 -0
- package/types/Table/v2/Cell/props.d.ts +23 -0
- package/types/Table/v2/Cell/props.d.ts.map +1 -0
- package/types/Table/v2/Cell/styles.d.ts +14 -0
- package/types/Table/v2/Cell/styles.d.ts.map +1 -0
- package/types/Table/v2/ColHeader/index.d.ts +37 -0
- package/types/Table/v2/ColHeader/index.d.ts.map +1 -0
- package/types/Table/v2/ColHeader/props.d.ts +47 -0
- package/types/Table/v2/ColHeader/props.d.ts.map +1 -0
- package/types/Table/v2/ColHeader/styles.d.ts +15 -0
- package/types/Table/v2/ColHeader/styles.d.ts.map +1 -0
- package/types/Table/v2/Head/index.d.ts +38 -0
- package/types/Table/v2/Head/index.d.ts.map +1 -0
- package/types/Table/v2/Head/props.d.ts +34 -0
- package/types/Table/v2/Head/props.d.ts.map +1 -0
- package/types/Table/v2/Head/styles.d.ts +13 -0
- package/types/Table/v2/Head/styles.d.ts.map +1 -0
- package/types/Table/v2/Row/index.d.ts +27 -0
- package/types/Table/v2/Row/index.d.ts.map +1 -0
- package/types/Table/v2/Row/props.d.ts +29 -0
- package/types/Table/v2/Row/props.d.ts.map +1 -0
- package/types/Table/v2/Row/styles.d.ts +19 -0
- package/types/Table/v2/Row/styles.d.ts.map +1 -0
- package/types/Table/v2/RowHeader/index.d.ts +28 -0
- package/types/Table/v2/RowHeader/index.d.ts.map +1 -0
- package/types/Table/v2/RowHeader/props.d.ts +17 -0
- package/types/Table/v2/RowHeader/props.d.ts.map +1 -0
- package/types/Table/v2/RowHeader/styles.d.ts +14 -0
- package/types/Table/v2/RowHeader/styles.d.ts.map +1 -0
- package/types/Table/v2/TableContext.d.ts +36 -0
- package/types/Table/v2/TableContext.d.ts.map +1 -0
- package/types/Table/v2/index.d.ts +45 -0
- package/types/Table/v2/index.d.ts.map +1 -0
- package/types/Table/v2/props.d.ts +53 -0
- package/types/Table/v2/props.d.ts.map +1 -0
- package/types/Table/v2/styles.d.ts +15 -0
- package/types/Table/v2/styles.d.ts.map +1 -0
- package/types/exports/a.d.ts +16 -0
- package/types/exports/a.d.ts.map +1 -0
- package/types/exports/b.d.ts +16 -0
- package/types/exports/b.d.ts.map +1 -0
- package/es/index.js +0 -31
- package/src/index.ts +0 -39
- package/types/Table/Body/index.d.ts.map +0 -1
- package/types/Table/Body/props.d.ts.map +0 -1
- package/types/Table/Body/styles.d.ts.map +0 -1
- package/types/Table/Body/theme.d.ts.map +0 -1
- package/types/Table/Cell/index.d.ts.map +0 -1
- package/types/Table/Cell/props.d.ts.map +0 -1
- package/types/Table/Cell/styles.d.ts.map +0 -1
- package/types/Table/Cell/theme.d.ts.map +0 -1
- package/types/Table/ColHeader/index.d.ts.map +0 -1
- package/types/Table/ColHeader/props.d.ts.map +0 -1
- package/types/Table/ColHeader/styles.d.ts.map +0 -1
- package/types/Table/ColHeader/theme.d.ts.map +0 -1
- package/types/Table/Head/index.d.ts.map +0 -1
- package/types/Table/Head/props.d.ts.map +0 -1
- package/types/Table/Head/styles.d.ts.map +0 -1
- package/types/Table/Head/theme.d.ts.map +0 -1
- package/types/Table/Row/index.d.ts.map +0 -1
- package/types/Table/Row/props.d.ts.map +0 -1
- package/types/Table/Row/styles.d.ts.map +0 -1
- package/types/Table/Row/theme.d.ts.map +0 -1
- package/types/Table/RowHeader/index.d.ts.map +0 -1
- package/types/Table/RowHeader/props.d.ts.map +0 -1
- package/types/Table/RowHeader/styles.d.ts.map +0 -1
- package/types/Table/RowHeader/theme.d.ts.map +0 -1
- package/types/Table/TableContext.d.ts.map +0 -1
- package/types/Table/index.d.ts.map +0 -1
- package/types/Table/props.d.ts.map +0 -1
- package/types/Table/styles.d.ts.map +0 -1
- package/types/Table/theme.d.ts.map +0 -1
- package/types/index.d.ts +0 -16
- package/types/index.d.ts.map +0 -1
- /package/es/Table/{Body → v1/Body}/props.js +0 -0
- /package/es/Table/{Body → v1/Body}/styles.js +0 -0
- /package/es/Table/{Body → v1/Body}/theme.js +0 -0
- /package/es/Table/{Cell → v1/Cell}/props.js +0 -0
- /package/es/Table/{Cell → v1/Cell}/styles.js +0 -0
- /package/es/Table/{Cell → v1/Cell}/theme.js +0 -0
- /package/es/Table/{ColHeader → v1/ColHeader}/props.js +0 -0
- /package/es/Table/{ColHeader → v1/ColHeader}/styles.js +0 -0
- /package/es/Table/{ColHeader → v1/ColHeader}/theme.js +0 -0
- /package/es/Table/{Head → v1/Head}/props.js +0 -0
- /package/es/Table/{Head → v1/Head}/styles.js +0 -0
- /package/es/Table/{Head → v1/Head}/theme.js +0 -0
- /package/es/Table/{Row → v1/Row}/props.js +0 -0
- /package/es/Table/{Row → v1/Row}/styles.js +0 -0
- /package/es/Table/{Row → v1/Row}/theme.js +0 -0
- /package/es/Table/{RowHeader → v1/RowHeader}/props.js +0 -0
- /package/es/Table/{RowHeader → v1/RowHeader}/styles.js +0 -0
- /package/es/Table/{RowHeader → v1/RowHeader}/theme.js +0 -0
- /package/es/Table/{TableContext.js → v1/TableContext.js} +0 -0
- /package/es/Table/{props.js → v1/props.js} +0 -0
- /package/es/Table/{styles.js → v1/styles.js} +0 -0
- /package/es/Table/{theme.js → v1/theme.js} +0 -0
- /package/lib/Table/{Body → v1/Body}/props.js +0 -0
- /package/lib/Table/{Body → v1/Body}/styles.js +0 -0
- /package/lib/Table/{Body → v1/Body}/theme.js +0 -0
- /package/lib/Table/{Cell → v1/Cell}/props.js +0 -0
- /package/lib/Table/{Cell → v1/Cell}/styles.js +0 -0
- /package/lib/Table/{Cell → v1/Cell}/theme.js +0 -0
- /package/lib/Table/{ColHeader → v1/ColHeader}/props.js +0 -0
- /package/lib/Table/{ColHeader → v1/ColHeader}/styles.js +0 -0
- /package/lib/Table/{ColHeader → v1/ColHeader}/theme.js +0 -0
- /package/lib/Table/{Head → v1/Head}/props.js +0 -0
- /package/lib/Table/{Head → v1/Head}/styles.js +0 -0
- /package/lib/Table/{Head → v1/Head}/theme.js +0 -0
- /package/lib/Table/{Row → v1/Row}/props.js +0 -0
- /package/lib/Table/{Row → v1/Row}/styles.js +0 -0
- /package/lib/Table/{Row → v1/Row}/theme.js +0 -0
- /package/lib/Table/{RowHeader → v1/RowHeader}/props.js +0 -0
- /package/lib/Table/{RowHeader → v1/RowHeader}/styles.js +0 -0
- /package/lib/Table/{RowHeader → v1/RowHeader}/theme.js +0 -0
- /package/lib/Table/{TableContext.js → v1/TableContext.js} +0 -0
- /package/lib/Table/{props.js → v1/props.js} +0 -0
- /package/lib/Table/{styles.js → v1/styles.js} +0 -0
- /package/lib/Table/{theme.js → v1/theme.js} +0 -0
- /package/src/Table/{Body → v1/Body}/props.ts +0 -0
- /package/src/Table/{Body → v1/Body}/styles.ts +0 -0
- /package/src/Table/{Body → v1/Body}/theme.ts +0 -0
- /package/src/Table/{Cell → v1/Cell}/props.ts +0 -0
- /package/src/Table/{Cell → v1/Cell}/styles.ts +0 -0
- /package/src/Table/{Cell → v1/Cell}/theme.ts +0 -0
- /package/src/Table/{ColHeader → v1/ColHeader}/props.ts +0 -0
- /package/src/Table/{ColHeader → v1/ColHeader}/styles.ts +0 -0
- /package/src/Table/{ColHeader → v1/ColHeader}/theme.ts +0 -0
- /package/src/Table/{Head → v1/Head}/props.ts +0 -0
- /package/src/Table/{Head → v1/Head}/styles.ts +0 -0
- /package/src/Table/{Head → v1/Head}/theme.ts +0 -0
- /package/src/Table/{Row → v1/Row}/props.ts +0 -0
- /package/src/Table/{Row → v1/Row}/styles.ts +0 -0
- /package/src/Table/{Row → v1/Row}/theme.ts +0 -0
- /package/src/Table/{RowHeader → v1/RowHeader}/props.ts +0 -0
- /package/src/Table/{RowHeader → v1/RowHeader}/styles.ts +0 -0
- /package/src/Table/{RowHeader → v1/RowHeader}/theme.ts +0 -0
- /package/src/Table/{TableContext.ts → v1/TableContext.ts} +0 -0
- /package/src/Table/{props.ts → v1/props.ts} +0 -0
- /package/src/Table/{styles.ts → v1/styles.ts} +0 -0
- /package/src/Table/{theme.ts → v1/theme.ts} +0 -0
- /package/types/Table/{Body → v1/Body}/index.d.ts +0 -0
- /package/types/Table/{Body → v1/Body}/props.d.ts +0 -0
- /package/types/Table/{Body → v1/Body}/styles.d.ts +0 -0
- /package/types/Table/{Body → v1/Body}/theme.d.ts +0 -0
- /package/types/Table/{Cell → v1/Cell}/index.d.ts +0 -0
- /package/types/Table/{Cell → v1/Cell}/props.d.ts +0 -0
- /package/types/Table/{Cell → v1/Cell}/styles.d.ts +0 -0
- /package/types/Table/{Cell → v1/Cell}/theme.d.ts +0 -0
- /package/types/Table/{ColHeader → v1/ColHeader}/index.d.ts +0 -0
- /package/types/Table/{ColHeader → v1/ColHeader}/props.d.ts +0 -0
- /package/types/Table/{ColHeader → v1/ColHeader}/styles.d.ts +0 -0
- /package/types/Table/{ColHeader → v1/ColHeader}/theme.d.ts +0 -0
- /package/types/Table/{Head → v1/Head}/index.d.ts +0 -0
- /package/types/Table/{Head → v1/Head}/props.d.ts +0 -0
- /package/types/Table/{Head → v1/Head}/styles.d.ts +0 -0
- /package/types/Table/{Head → v1/Head}/theme.d.ts +0 -0
- /package/types/Table/{Row → v1/Row}/index.d.ts +0 -0
- /package/types/Table/{Row → v1/Row}/props.d.ts +0 -0
- /package/types/Table/{Row → v1/Row}/styles.d.ts +0 -0
- /package/types/Table/{Row → v1/Row}/theme.d.ts +0 -0
- /package/types/Table/{RowHeader → v1/RowHeader}/index.d.ts +0 -0
- /package/types/Table/{RowHeader → v1/RowHeader}/props.d.ts +0 -0
- /package/types/Table/{RowHeader → v1/RowHeader}/styles.d.ts +0 -0
- /package/types/Table/{RowHeader → v1/RowHeader}/theme.d.ts +0 -0
- /package/types/Table/{TableContext.d.ts → v1/TableContext.d.ts} +0 -0
- /package/types/Table/{index.d.ts → v1/index.d.ts} +0 -0
- /package/types/Table/{props.d.ts → v1/props.d.ts} +0 -0
- /package/types/Table/{styles.d.ts → v1/styles.d.ts} +0 -0
- /package/types/Table/{theme.d.ts → v1/theme.d.ts} +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* The MIT License (MIT)
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
11
|
+
*
|
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
* in the Software without restriction, including without limitation the rights
|
|
15
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
* furnished to do so, subject to the following conditions:
|
|
18
|
+
*
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
* copies or substantial portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
* SOFTWARE.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* ---
|
|
33
|
+
* private: true
|
|
34
|
+
* ---
|
|
35
|
+
* Generates the style object from the theme and provided additional information
|
|
36
|
+
* @param {Object} componentTheme The theme variable object.
|
|
37
|
+
* @return {Object} The final style object, which will be used in the component
|
|
38
|
+
*/
|
|
39
|
+
const generateStyle = componentTheme => {
|
|
40
|
+
return {
|
|
41
|
+
head: {
|
|
42
|
+
label: 'head',
|
|
43
|
+
fontSize: componentTheme.fontSize,
|
|
44
|
+
fontFamily: componentTheme.fontFamily,
|
|
45
|
+
fontWeight: componentTheme.fontWeight,
|
|
46
|
+
color: componentTheme.color,
|
|
47
|
+
background: componentTheme.background
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
var _default = exports.default = generateStyle;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.Row = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
10
|
+
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
11
|
+
var _latest = require("@instructure/ui-view/latest");
|
|
12
|
+
var _emotion = require("@instructure/emotion");
|
|
13
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
14
|
+
var _props = require("./props");
|
|
15
|
+
var _TableContext = _interopRequireDefault(require("../TableContext"));
|
|
16
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
|
+
var _dec, _class, _Row;
|
|
18
|
+
/*
|
|
19
|
+
* The MIT License (MIT)
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
22
|
+
*
|
|
23
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
24
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
25
|
+
* in the Software without restriction, including without limitation the rights
|
|
26
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
27
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
28
|
+
* furnished to do so, subject to the following conditions:
|
|
29
|
+
*
|
|
30
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
31
|
+
* copies or substantial portions of the Software.
|
|
32
|
+
*
|
|
33
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
34
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
35
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
36
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
37
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
38
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
39
|
+
* SOFTWARE.
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
---
|
|
43
|
+
parent: Table
|
|
44
|
+
id: Table.Row
|
|
45
|
+
---
|
|
46
|
+
**/
|
|
47
|
+
let Row = exports.Row = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = (_Row = class Row extends _react.Component {
|
|
48
|
+
componentDidMount() {
|
|
49
|
+
var _this$props$makeStyle, _this$props;
|
|
50
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, {
|
|
51
|
+
isStacked: this.context.isStacked,
|
|
52
|
+
hover: this.context.hover
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
componentDidUpdate() {
|
|
56
|
+
var _this$props$makeStyle2, _this$props2;
|
|
57
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, {
|
|
58
|
+
isStacked: this.context.isStacked,
|
|
59
|
+
hover: this.context.hover
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
render() {
|
|
63
|
+
const _this$props3 = this.props,
|
|
64
|
+
children = _this$props3.children,
|
|
65
|
+
styles = _this$props3.styles;
|
|
66
|
+
const isStacked = this.context.isStacked;
|
|
67
|
+
const headers = this.context.headers;
|
|
68
|
+
return (0, _jsxRuntime.jsx)(_latest.View, {
|
|
69
|
+
..._latest.View.omitViewProps((0, _omitProps.omitProps)(this.props, Row.allowedProps), Row),
|
|
70
|
+
as: isStacked ? 'div' : 'tr',
|
|
71
|
+
css: styles === null || styles === void 0 ? void 0 : styles.row,
|
|
72
|
+
role: isStacked ? 'row' : void 0,
|
|
73
|
+
children: _react.Children.toArray(children).filter(Boolean).map((child, index) => {
|
|
74
|
+
if (/*#__PURE__*/(0, _react.isValidElement)(child)) {
|
|
75
|
+
return (0, _safeCloneElement.safeCloneElement)(child, {
|
|
76
|
+
key: child.props.name,
|
|
77
|
+
// used by `Cell` to render its column title in `stacked` layout
|
|
78
|
+
header: headers && headers[index]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return child;
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}, _Row.displayName = "Row", _Row.componentId = 'Table.Row', _Row.contextType = _TableContext.default, _Row.allowedProps = _props.allowedProps, _Row.defaultProps = {
|
|
86
|
+
children: null
|
|
87
|
+
}, _Row)) || _class);
|
|
88
|
+
var _default = exports.default = Row;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.allowedProps = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* The MIT License (MIT)
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
11
|
+
*
|
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
* in the Software without restriction, including without limitation the rights
|
|
15
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
* furnished to do so, subject to the following conditions:
|
|
18
|
+
*
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
* copies or substantial portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
* SOFTWARE.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
const allowedProps = exports.allowedProps = ['children', 'setHoverStateTo'];
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* The MIT License (MIT)
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
11
|
+
*
|
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
* in the Software without restriction, including without limitation the rights
|
|
15
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
* furnished to do so, subject to the following conditions:
|
|
18
|
+
*
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
* copies or substantial portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
* SOFTWARE.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* ---
|
|
33
|
+
* private: true
|
|
34
|
+
* ---
|
|
35
|
+
* Generates the style object from the theme and provided additional information
|
|
36
|
+
* @param {Object} componentTheme The theme variable object.
|
|
37
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
38
|
+
* @param {Object} _sharedTokens Shared token object (not used in this component)
|
|
39
|
+
* @param {Object} extraArgs the state of the component, the style is applied to
|
|
40
|
+
* @return {Object} The final style object, which will be used in the component
|
|
41
|
+
*/
|
|
42
|
+
const generateStyle = (componentTheme, props, _sharedTokens, extraArgs) => {
|
|
43
|
+
const setHoverStateTo = props.setHoverStateTo;
|
|
44
|
+
const hoverStyles = {
|
|
45
|
+
borderLeftColor: componentTheme.hoverBorderColor,
|
|
46
|
+
borderRightColor: componentTheme.hoverBorderColor
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
row: {
|
|
50
|
+
label: 'row',
|
|
51
|
+
fontSize: componentTheme.fontSize,
|
|
52
|
+
fontFamily: componentTheme.fontFamily,
|
|
53
|
+
fontWeight: componentTheme.fontWeight,
|
|
54
|
+
color: componentTheme.color,
|
|
55
|
+
background: componentTheme.background,
|
|
56
|
+
boxSizing: 'border-box',
|
|
57
|
+
borderBottomStyle: 'solid',
|
|
58
|
+
borderBottomWidth: '0.0625rem',
|
|
59
|
+
borderBottomColor: componentTheme.borderColor,
|
|
60
|
+
...((setHoverStateTo !== null && setHoverStateTo !== void 0 ? setHoverStateTo : extraArgs.hover) && {
|
|
61
|
+
borderLeft: '0.1875rem solid transparent',
|
|
62
|
+
borderRight: '0.1875rem solid transparent',
|
|
63
|
+
...(setHoverStateTo === true ? hoverStyles : {
|
|
64
|
+
'&:hover': hoverStyles
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
67
|
+
...(extraArgs.isStacked && {
|
|
68
|
+
padding: `${componentTheme.paddingVertical} ${componentTheme.paddingHorizontal}`
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
var _default = exports.default = generateStyle;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.RowHeader = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
10
|
+
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
11
|
+
var _latest = require("@instructure/ui-view/latest");
|
|
12
|
+
var _emotion = require("@instructure/emotion");
|
|
13
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
14
|
+
var _props = require("./props");
|
|
15
|
+
var _TableContext = _interopRequireDefault(require("../TableContext"));
|
|
16
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
|
+
var _dec, _class, _RowHeader;
|
|
18
|
+
/*
|
|
19
|
+
* The MIT License (MIT)
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
22
|
+
*
|
|
23
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
24
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
25
|
+
* in the Software without restriction, including without limitation the rights
|
|
26
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
27
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
28
|
+
* furnished to do so, subject to the following conditions:
|
|
29
|
+
*
|
|
30
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
31
|
+
* copies or substantial portions of the Software.
|
|
32
|
+
*
|
|
33
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
34
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
35
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
36
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
37
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
38
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
39
|
+
* SOFTWARE.
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
---
|
|
43
|
+
parent: Table
|
|
44
|
+
id: Table.RowHeader
|
|
45
|
+
---
|
|
46
|
+
**/
|
|
47
|
+
let RowHeader = exports.RowHeader = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = (_RowHeader = class RowHeader extends _react.Component {
|
|
48
|
+
componentDidMount() {
|
|
49
|
+
var _this$props$makeStyle, _this$props;
|
|
50
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
51
|
+
}
|
|
52
|
+
componentDidUpdate() {
|
|
53
|
+
var _this$props$makeStyle2, _this$props2;
|
|
54
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
const _this$props3 = this.props,
|
|
58
|
+
children = _this$props3.children,
|
|
59
|
+
styles = _this$props3.styles;
|
|
60
|
+
const isStacked = this.context.isStacked;
|
|
61
|
+
return (0, _jsxRuntime.jsx)(_latest.View, {
|
|
62
|
+
..._latest.View.omitViewProps((0, _omitProps.omitProps)(this.props, RowHeader.allowedProps), RowHeader),
|
|
63
|
+
as: isStacked ? 'div' : 'th',
|
|
64
|
+
css: styles === null || styles === void 0 ? void 0 : styles.rowHeader,
|
|
65
|
+
scope: "row",
|
|
66
|
+
role: isStacked ? 'rowheader' : void 0,
|
|
67
|
+
children: (0, _callRenderProp.callRenderProp)(children)
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}, _RowHeader.displayName = "RowHeader", _RowHeader.componentId = 'Table.RowHeader', _RowHeader.contextType = _TableContext.default, _RowHeader.allowedProps = _props.allowedProps, _RowHeader.defaultProps = {
|
|
71
|
+
textAlign: 'start',
|
|
72
|
+
children: null
|
|
73
|
+
}, _RowHeader)) || _class);
|
|
74
|
+
var _default = exports.default = RowHeader;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.allowedProps = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* The MIT License (MIT)
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
11
|
+
*
|
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
* in the Software without restriction, including without limitation the rights
|
|
15
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
* furnished to do so, subject to the following conditions:
|
|
18
|
+
*
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
* copies or substantial portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
* SOFTWARE.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
const allowedProps = exports.allowedProps = ['children', 'textAlign'];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* The MIT License (MIT)
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
11
|
+
*
|
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
* in the Software without restriction, including without limitation the rights
|
|
15
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
* furnished to do so, subject to the following conditions:
|
|
18
|
+
*
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
* copies or substantial portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
* SOFTWARE.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* ---
|
|
33
|
+
* private: true
|
|
34
|
+
* ---
|
|
35
|
+
* Generates the style object from the theme and provided additional information
|
|
36
|
+
* @param {Object} componentTheme The theme variable object.
|
|
37
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
38
|
+
* @return {Object} The final style object, which will be used in the component
|
|
39
|
+
*/
|
|
40
|
+
const generateStyle = (componentTheme, props) => {
|
|
41
|
+
const textAlign = props.textAlign;
|
|
42
|
+
return {
|
|
43
|
+
rowHeader: {
|
|
44
|
+
label: 'rowHeader',
|
|
45
|
+
fontSize: componentTheme.fontSize,
|
|
46
|
+
fontFamily: componentTheme.fontFamily,
|
|
47
|
+
fontWeight: componentTheme.fontWeight,
|
|
48
|
+
color: componentTheme.color,
|
|
49
|
+
background: componentTheme.background,
|
|
50
|
+
boxSizing: 'border-box',
|
|
51
|
+
verticalAlign: 'middle',
|
|
52
|
+
lineHeight: componentTheme.lineHeight,
|
|
53
|
+
padding: `${componentTheme.paddingVertical} ${componentTheme.paddingHorizontal}`,
|
|
54
|
+
...(textAlign && {
|
|
55
|
+
textAlign
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
var _default = exports.default = generateStyle;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.TableContext = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
/*
|
|
9
|
+
* The MIT License (MIT)
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
* furnished to do so, subject to the following conditions:
|
|
19
|
+
*
|
|
20
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
* copies or substantial portions of the Software.
|
|
22
|
+
*
|
|
23
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
* SOFTWARE.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* ---
|
|
34
|
+
* category: components/contexts
|
|
35
|
+
* ---
|
|
36
|
+
* React context created by the `Table` component to hold its data which are
|
|
37
|
+
* read by its children. You can access these to make custom Table cells/rows.
|
|
38
|
+
*
|
|
39
|
+
* It stores the following parameters:
|
|
40
|
+
* - `isStacked`: Whether the `Table` is in `stacked` layout.
|
|
41
|
+
* - `hover`: Whether highlight rows on mouse hover
|
|
42
|
+
* - `headers`: in `stacked` layout the children of the first row of cells
|
|
43
|
+
* (e.g. the titles in a table). This is used in `stacked` layout to display
|
|
44
|
+
* the titles inline
|
|
45
|
+
* @module
|
|
46
|
+
*/
|
|
47
|
+
const TableContext = exports.TableContext = /*#__PURE__*/(0, _react.createContext)({
|
|
48
|
+
isStacked: false,
|
|
49
|
+
hover: false
|
|
50
|
+
});
|
|
51
|
+
var _default = exports.default = TableContext;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.Table = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
11
|
+
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
12
|
+
var _latest = require("@instructure/ui-view/latest");
|
|
13
|
+
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
14
|
+
var _emotion = require("@instructure/emotion");
|
|
15
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
16
|
+
var _Head = require("./Head");
|
|
17
|
+
var _Body = require("./Body");
|
|
18
|
+
var _Row = require("./Row");
|
|
19
|
+
var _ColHeader = require("./ColHeader");
|
|
20
|
+
var _RowHeader = require("./RowHeader");
|
|
21
|
+
var _Cell = require("./Cell");
|
|
22
|
+
var _props = require("./props");
|
|
23
|
+
var _TableContext = _interopRequireDefault(require("./TableContext"));
|
|
24
|
+
var _console = require("@instructure/console");
|
|
25
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
26
|
+
var _dec, _class, _Table;
|
|
27
|
+
/*
|
|
28
|
+
* The MIT License (MIT)
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
31
|
+
*
|
|
32
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
33
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
34
|
+
* in the Software without restriction, including without limitation the rights
|
|
35
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
36
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
37
|
+
* furnished to do so, subject to the following conditions:
|
|
38
|
+
*
|
|
39
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
40
|
+
* copies or substantial portions of the Software.
|
|
41
|
+
*
|
|
42
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
43
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
44
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
45
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
46
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
47
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
48
|
+
* SOFTWARE.
|
|
49
|
+
*/
|
|
50
|
+
/**
|
|
51
|
+
---
|
|
52
|
+
category: components
|
|
53
|
+
---
|
|
54
|
+
**/
|
|
55
|
+
let Table = exports.Table = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = (_Table = class Table extends _react.Component {
|
|
56
|
+
constructor(...args) {
|
|
57
|
+
super(...args);
|
|
58
|
+
this.ref = null;
|
|
59
|
+
this.handleRef = el => {
|
|
60
|
+
const elementRef = this.props.elementRef;
|
|
61
|
+
this.ref = el;
|
|
62
|
+
if (typeof elementRef === 'function') {
|
|
63
|
+
elementRef(el);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
componentDidMount() {
|
|
68
|
+
var _this$props$makeStyle, _this$props;
|
|
69
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
70
|
+
}
|
|
71
|
+
componentDidUpdate() {
|
|
72
|
+
var _this$props$makeStyle2, _this$props2;
|
|
73
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
74
|
+
}
|
|
75
|
+
getHeaders() {
|
|
76
|
+
const _Children$toArray = _react.Children.toArray(this.props.children),
|
|
77
|
+
_Children$toArray2 = (0, _slicedToArray2.default)(_Children$toArray, 1),
|
|
78
|
+
headChild = _Children$toArray2[0];
|
|
79
|
+
if (!headChild || ! /*#__PURE__*/(0, _react.isValidElement)(headChild)) return void 0;
|
|
80
|
+
const _Children$toArray3 = _react.Children.toArray(headChild.props.children),
|
|
81
|
+
_Children$toArray4 = (0, _slicedToArray2.default)(_Children$toArray3, 1),
|
|
82
|
+
firstRow = _Children$toArray4[0];
|
|
83
|
+
if (!firstRow || ! /*#__PURE__*/(0, _react.isValidElement)(firstRow)) return void 0;
|
|
84
|
+
return _react.Children.map(firstRow.props.children, colHeader => {
|
|
85
|
+
if (! /*#__PURE__*/(0, _react.isValidElement)(colHeader)) return void 0;
|
|
86
|
+
return colHeader.props.children;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
render() {
|
|
90
|
+
const _this$props3 = this.props,
|
|
91
|
+
margin = _this$props3.margin,
|
|
92
|
+
layout = _this$props3.layout,
|
|
93
|
+
caption = _this$props3.caption,
|
|
94
|
+
children = _this$props3.children,
|
|
95
|
+
hover = _this$props3.hover,
|
|
96
|
+
styles = _this$props3.styles,
|
|
97
|
+
minWidth = _this$props3.minWidth;
|
|
98
|
+
const isStacked = layout === 'stacked';
|
|
99
|
+
const headers = isStacked ? this.getHeaders() : void 0;
|
|
100
|
+
if (!caption) {
|
|
101
|
+
(0, _console.error)(false, `[Table] required prop caption is not set.`);
|
|
102
|
+
}
|
|
103
|
+
return (0, _jsxRuntime.jsx)(_TableContext.default.Provider, {
|
|
104
|
+
value: {
|
|
105
|
+
isStacked: isStacked,
|
|
106
|
+
hover: hover,
|
|
107
|
+
headers: headers
|
|
108
|
+
},
|
|
109
|
+
children: (0, _jsxRuntime.jsxs)(_latest.View
|
|
110
|
+
// All HTML props, except the ones accepted by `View` and `Table`
|
|
111
|
+
, {
|
|
112
|
+
..._latest.View.omitViewProps((0, _omitProps.omitProps)(this.props, Table.allowedProps), Table),
|
|
113
|
+
minWidth: minWidth,
|
|
114
|
+
as: isStacked ? 'div' : 'table',
|
|
115
|
+
margin: margin,
|
|
116
|
+
elementRef: this.handleRef,
|
|
117
|
+
css: styles === null || styles === void 0 ? void 0 : styles.table,
|
|
118
|
+
role: isStacked ? 'table' : void 0,
|
|
119
|
+
"aria-label": isStacked ? caption : void 0,
|
|
120
|
+
children: [!isStacked && (0, _jsxRuntime.jsx)("caption", {
|
|
121
|
+
children: (0, _jsxRuntime.jsx)(_ScreenReaderContent.ScreenReaderContent, {
|
|
122
|
+
children: caption
|
|
123
|
+
})
|
|
124
|
+
}), _react.Children.map(children, child => {
|
|
125
|
+
if (/*#__PURE__*/(0, _react.isValidElement)(child)) {
|
|
126
|
+
return (0, _safeCloneElement.safeCloneElement)(child, {
|
|
127
|
+
key: child.props.name
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return child;
|
|
131
|
+
})]
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}, _Table.displayName = "Table", _Table.componentId = 'Table', _Table.allowedProps = _props.allowedProps, _Table.defaultProps = {
|
|
136
|
+
children: null,
|
|
137
|
+
hover: false,
|
|
138
|
+
layout: 'auto'
|
|
139
|
+
}, _Table.Head = _Head.Head, _Table.Body = _Body.Body, _Table.Row = _Row.Row, _Table.ColHeader = _ColHeader.ColHeader, _Table.RowHeader = _RowHeader.RowHeader, _Table.Cell = _Cell.Cell, _Table)) || _class);
|
|
140
|
+
var _default = exports.default = Table;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.allowedProps = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* The MIT License (MIT)
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
11
|
+
*
|
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
* in the Software without restriction, including without limitation the rights
|
|
15
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
* furnished to do so, subject to the following conditions:
|
|
18
|
+
*
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
* copies or substantial portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
* SOFTWARE.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
const allowedProps = exports.allowedProps = ['caption', 'children', 'margin', 'elementRef', 'hover', 'layout'];
|