1
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties" ;
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck" ;
3
- import _createClass from "@babel/runtime/helpers/createClass" ;
4
- import _inherits from "@babel/runtime/helpers/inherits" ;
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn" ;
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf" ;
7
- import _defineProperty from "@babel/runtime/helpers/defineProperty" ;
8
1
var _excluded = [ "href" , "context" , "showClearFiltersButton" , "schemas" , "currentAction" , "facets" , "navigate" , "columns" , "columnExtensionMap" , "placeholderReplacementFxn" , "keepSelectionInStorage" , "windowWidth" ] ;
9
-
2
+ function _typeof ( obj ) { "@babel/helpers - typeof" ; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol . iterator ? function ( obj ) { return typeof obj ; } : function ( obj ) { return obj && "function" == typeof Symbol && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ; } , _typeof ( obj ) ; }
10
3
function ownKeys ( object , enumerableOnly ) { var keys = Object . keys ( object ) ; if ( Object . getOwnPropertySymbols ) { var symbols = Object . getOwnPropertySymbols ( object ) ; enumerableOnly && ( symbols = symbols . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( object , sym ) . enumerable ; } ) ) , keys . push . apply ( keys , symbols ) ; } return keys ; }
11
-
12
4
function _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = null != arguments [ i ] ? arguments [ i ] : { } ; i % 2 ? ownKeys ( Object ( source ) , ! 0 ) . forEach ( function ( key ) { _defineProperty ( target , key , source [ key ] ) ; } ) : Object . getOwnPropertyDescriptors ? Object . defineProperties ( target , Object . getOwnPropertyDescriptors ( source ) ) : ownKeys ( Object ( source ) ) . forEach ( function ( key ) { Object . defineProperty ( target , key , Object . getOwnPropertyDescriptor ( source , key ) ) ; } ) ; } return target ; }
13
-
5
+ function _objectWithoutProperties ( source , excluded ) { if ( source == null ) return { } ; var target = _objectWithoutPropertiesLoose ( source , excluded ) ; var key , i ; if ( Object . getOwnPropertySymbols ) { var sourceSymbolKeys = Object . getOwnPropertySymbols ( source ) ; for ( i = 0 ; i < sourceSymbolKeys . length ; i ++ ) { key = sourceSymbolKeys [ i ] ; if ( excluded . indexOf ( key ) >= 0 ) continue ; if ( ! Object . prototype . propertyIsEnumerable . call ( source , key ) ) continue ; target [ key ] = source [ key ] ; } } return target ; }
6
+ function _objectWithoutPropertiesLoose ( source , excluded ) { if ( source == null ) return { } ; var target = { } ; var sourceKeys = Object . keys ( source ) ; var key , i ; for ( i = 0 ; i < sourceKeys . length ; i ++ ) { key = sourceKeys [ i ] ; if ( excluded . indexOf ( key ) >= 0 ) continue ; target [ key ] = source [ key ] ; } return target ; }
7
+ function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
8
+ function _defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( "value" in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , _toPropertyKey ( descriptor . key ) , descriptor ) ; } }
9
+ function _createClass ( Constructor , protoProps , staticProps ) { if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) _defineProperties ( Constructor , staticProps ) ; Object . defineProperty ( Constructor , "prototype" , { writable : false } ) ; return Constructor ; }
10
+ function _inherits ( subClass , superClass ) { if ( typeof superClass !== "function" && superClass !== null ) { throw new TypeError ( "Super expression must either be null or a function" ) ; } subClass . prototype = Object . create ( superClass && superClass . prototype , { constructor : { value : subClass , writable : true , configurable : true } } ) ; Object . defineProperty ( subClass , "prototype" , { writable : false } ) ; if ( superClass ) _setPrototypeOf ( subClass , superClass ) ; }
11
+ function _setPrototypeOf ( o , p ) { _setPrototypeOf = Object . setPrototypeOf ? Object . setPrototypeOf . bind ( ) : function ( o , p ) { o . __proto__ = p ; return o ; } ; return _setPrototypeOf ( o , p ) ; }
14
12
function _createSuper ( Derived ) { var hasNativeReflectConstruct = _isNativeReflectConstruct ( ) ; return function ( ) { var Super = _getPrototypeOf ( Derived ) , result ; if ( hasNativeReflectConstruct ) { var NewTarget = _getPrototypeOf ( this ) . constructor ; result = Reflect . construct ( Super , arguments , NewTarget ) ; } else { result = Super . apply ( this , arguments ) ; } return _possibleConstructorReturn ( this , result ) ; } ; }
15
-
13
+ function _possibleConstructorReturn ( self , call ) { if ( call && ( _typeof ( call ) === "object" || typeof call === "function" ) ) { return call ; } else if ( call !== void 0 ) { throw new TypeError ( "Derived constructors may only return object or undefined" ) ; } return _assertThisInitialized ( self ) ; }
14
+ function _assertThisInitialized ( self ) { if ( self === void 0 ) { throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ; } return self ; }
16
15
function _isNativeReflectConstruct ( ) { if ( typeof Reflect === "undefined" || ! Reflect . construct ) return false ; if ( Reflect . construct . sham ) return false ; if ( typeof Proxy === "function" ) return true ; try { Boolean . prototype . valueOf . call ( Reflect . construct ( Boolean , [ ] , function ( ) { } ) ) ; return true ; } catch ( e ) { return false ; } }
17
-
16
+ function _getPrototypeOf ( o ) { _getPrototypeOf = Object . setPrototypeOf ? Object . getPrototypeOf . bind ( ) : function ( o ) { return o . __proto__ || Object . getPrototypeOf ( o ) ; } ; return _getPrototypeOf ( o ) ; }
17
+ function _defineProperty ( obj , key , value ) { key = _toPropertyKey ( key ) ; if ( key in obj ) { Object . defineProperty ( obj , key , { value : value , enumerable : true , configurable : true , writable : true } ) ; } else { obj [ key ] = value ; } return obj ; }
18
+ function _toPropertyKey ( arg ) { var key = _toPrimitive ( arg , "string" ) ; return _typeof ( key ) === "symbol" ? key : String ( key ) ; }
19
+ function _toPrimitive ( input , hint ) { if ( _typeof ( input ) !== "object" || input === null ) return input ; var prim = input [ Symbol . toPrimitive ] ; if ( prim !== undefined ) { var res = prim . call ( input , hint || "default" ) ; if ( _typeof ( res ) !== "object" ) return res ; throw new TypeError ( "@@toPrimitive must return a primitive value." ) ; } return ( hint === "string" ? String : Number ) ( input ) ; }
18
20
import React from 'react' ;
19
21
import PropTypes from 'prop-types' ;
20
22
import _ from 'underscore' ;
@@ -28,21 +30,18 @@ import { CustomColumnController } from './components/CustomColumnController';
28
30
import { SortController } from './components/SortController' ;
29
31
import { SelectedItemsController } from './components/SelectedItemsController' ;
30
32
import { WindowNavigationController } from './components/WindowNavigationController' ;
31
- import { ControlsAndResults } from './components/ControlsAndResults' ; // eslint-disable-next-line no-unused-vars
33
+ import { ControlsAndResults } from './components/ControlsAndResults' ;
32
34
35
+ // eslint-disable-next-line no-unused-vars
33
36
import { SearchResponse , Item , ColumnDefinition , URLParts } from './../util/typedefs' ;
34
37
export { SortController , SelectedItemsController , ColumnCombiner , CustomColumnController } ;
35
38
export var SearchView = /*#__PURE__*/ function ( _React$PureComponent ) {
36
39
_inherits ( SearchView , _React$PureComponent ) ;
37
-
38
40
var _super = _createSuper ( SearchView ) ;
39
-
40
41
function SearchView ( ) {
41
42
_classCallCheck ( this , SearchView ) ;
42
-
43
43
return _super . apply ( this , arguments ) ;
44
44
}
45
-
46
45
_createClass ( SearchView , [ {
47
46
key : "componentDidMount" ,
48
47
value :
@@ -52,38 +51,40 @@ export var SearchView = /*#__PURE__*/function (_React$PureComponent) {
52
51
* @property {Object.<ColumnDefinition> } columnExtensionMap - Object keyed by field name with overrides for column definition.
53
52
* @property {boolean } separateSingleTermFacets - If true, will push facets w/ only 1 term available to bottom of FacetList.
54
53
*/
54
+
55
55
function componentDidMount ( ) {
56
56
ReactTooltip . rebuild ( ) ;
57
57
}
58
+
58
59
/**
59
60
* TODO once we have @type : [..more stuff..], change to use instead of `getSchemaTypeFromSearchContext`.
60
61
* For custom styling from CSS stylesheet (e.g. to sync override of rowHeight in both CSS and in props here)
61
62
*/
62
-
63
63
} , {
64
64
key : "render" ,
65
65
value : function render ( ) {
66
66
var _this$props = this . props ,
67
- href = _this$props . href ,
68
- context = _this$props . context ,
69
- showClearFiltersButton = _this$props . showClearFiltersButton ,
70
- _this$props$schemas = _this$props . schemas ,
71
- schemas = _this$props$schemas === void 0 ? null : _this$props$schemas ,
72
- _this$props$currentAc = _this$props . currentAction ,
73
- currentAction = _this$props$currentAc === void 0 ? null : _this$props$currentAc ,
74
- propFacets = _this$props . facets ,
75
- _this$props$navigate = _this$props . navigate ,
76
- propNavigate = _this$props$navigate === void 0 ? navigate : _this$props$navigate ,
77
- _this$props$columns = _this$props . columns ,
78
- columns = _this$props$columns === void 0 ? null : _this$props$columns ,
79
- _this$props$columnExt = _this$props . columnExtensionMap ,
80
- columnExtensionMap = _this$props$columnExt === void 0 ? basicColumnExtensionMap : _this$props$columnExt ,
81
- placeholderReplacementFxn = _this$props . placeholderReplacementFxn ,
82
- keepSelectionInStorage = _this$props . keepSelectionInStorage ,
83
- windowWidth = _this$props . windowWidth ,
84
- passProps = _objectWithoutProperties ( _this$props , _excluded ) ;
85
-
86
- var contextFacets = context . facets ; // All these controllers pass props down to their children.
67
+ href = _this$props . href ,
68
+ context = _this$props . context ,
69
+ showClearFiltersButton = _this$props . showClearFiltersButton ,
70
+ _this$props$schemas = _this$props . schemas ,
71
+ schemas = _this$props$schemas === void 0 ? null : _this$props$schemas ,
72
+ _this$props$currentAc = _this$props . currentAction ,
73
+ currentAction = _this$props$currentAc === void 0 ? null : _this$props$currentAc ,
74
+ propFacets = _this$props . facets ,
75
+ _this$props$navigate = _this$props . navigate ,
76
+ propNavigate = _this$props$navigate === void 0 ? navigate : _this$props$navigate ,
77
+ _this$props$columns = _this$props . columns ,
78
+ columns = _this$props$columns === void 0 ? null : _this$props$columns ,
79
+ _this$props$columnExt = _this$props . columnExtensionMap ,
80
+ columnExtensionMap = _this$props$columnExt === void 0 ? basicColumnExtensionMap : _this$props$columnExt ,
81
+ placeholderReplacementFxn = _this$props . placeholderReplacementFxn ,
82
+ keepSelectionInStorage = _this$props . keepSelectionInStorage ,
83
+ windowWidth = _this$props . windowWidth ,
84
+ passProps = _objectWithoutProperties ( _this$props , _excluded ) ;
85
+ var contextFacets = context . facets ;
86
+
87
+ // All these controllers pass props down to their children.
87
88
// So we don't need to be repetitive here; i.e. may assume 'context' is available
88
89
// in each controller that's child of <ColumnCombiner {...{ context, columns, columnExtensionMap }}>.
89
90
// As well as in ControlsAndResults.
@@ -97,7 +98,6 @@ export var SearchView = /*#__PURE__*/function (_React$PureComponent) {
97
98
isOwnPage : true ,
98
99
facets : propFacets || contextFacets
99
100
} ) ;
100
-
101
101
var controllersAndView = /*#__PURE__*/ React . createElement ( WindowNavigationController , {
102
102
href : href ,
103
103
context : context ,
@@ -107,7 +107,6 @@ export var SearchView = /*#__PURE__*/function (_React$PureComponent) {
107
107
columns : columns ,
108
108
columnExtensionMap : columnExtensionMap
109
109
} , /*#__PURE__*/ React . createElement ( CustomColumnController , null , /*#__PURE__*/ React . createElement ( SortController , null , /*#__PURE__*/ React . createElement ( ControlsAndResults , childViewProps ) ) ) ) ) ;
110
-
111
110
if ( isSelectAction ( currentAction ) ) {
112
111
// We don't allow "SelectionMode" unless is own page.
113
112
// Could consider changing later once a use case exists.
@@ -122,7 +121,6 @@ export var SearchView = /*#__PURE__*/function (_React$PureComponent) {
122
121
keepSelectionInStorage : keepSelectionInStorage
123
122
} , controllersAndView ) ;
124
123
}
125
-
126
124
return /*#__PURE__*/ React . createElement ( "div" , {
127
125
className : "search-page-container"
128
126
} , /*#__PURE__*/ React . createElement ( AboveSearchTablePanel , {
@@ -131,10 +129,8 @@ export var SearchView = /*#__PURE__*/function (_React$PureComponent) {
131
129
} ) , controllersAndView ) ;
132
130
}
133
131
} ] ) ;
134
-
135
132
return SearchView ;
136
133
} ( React . PureComponent ) ;
137
-
138
134
_defineProperty ( SearchView , "propTypes" , {
139
135
'context' : PropTypes . object . isRequired ,
140
136
'columns' : PropTypes . object ,
@@ -156,7 +152,6 @@ _defineProperty(SearchView, "propTypes", {
156
152
// Passed down to AboveSearchTablePanel StaticSection
157
153
'keepSelectionInStorage' : PropTypes . bool
158
154
} ) ;
159
-
160
155
_defineProperty ( SearchView , "defaultProps" , {
161
156
'href' : null ,
162
157
// `props.context.columns` is used in place of `props.columns` if `props.columns` is falsy.
0 commit comments