@appbaseio/reactivesearch-vue 3.0.0-alpha.7 → 3.0.0-rc
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/dist/@appbaseio/reactivesearch-vue.umd.js +3042 -1181
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{Flex-d5675ea6.js → Flex-ddde6d26.js} +3 -1
- package/dist/cjs/{ListItem-23af8974.js → ListItem-7a682970.js} +6 -1
- package/dist/cjs/MultiDropdownList.js +1 -1
- package/dist/cjs/MultiList.js +1 -1
- package/dist/cjs/RangeInput.js +1 -1
- package/dist/cjs/ReactiveComponent.js +297 -43
- package/dist/cjs/ReactiveList.js +2 -2
- package/dist/cjs/ResultList.js +1 -1
- package/dist/cjs/SingleDropdownList.js +1 -1
- package/dist/cjs/SingleList.js +1 -1
- package/dist/cjs/index.js +13 -10
- package/dist/cjs/{ReactiveComponent-8180c806.js → install-2c548585.js} +752 -240
- package/dist/cjs/install.js +24 -28
- package/dist/cjs/{utils-36b1b880.js → utils-c9bd5628.js} +9 -0
- package/dist/cjs/version.js +1 -1
- package/dist/es/{Flex-a08e22d7.js → Flex-25792bc3.js} +3 -1
- package/dist/es/{ListItem-1cb1b4de.js → ListItem-e3c6acf4.js} +6 -1
- package/dist/es/MultiDropdownList.js +1 -1
- package/dist/es/MultiList.js +1 -1
- package/dist/es/RangeInput.js +1 -1
- package/dist/es/ReactiveComponent.js +298 -42
- package/dist/es/ReactiveList.js +2 -2
- package/dist/es/ResultList.js +1 -1
- package/dist/es/SingleDropdownList.js +1 -1
- package/dist/es/SingleList.js +1 -1
- package/dist/es/index.js +7 -6
- package/dist/es/{ReactiveComponent-f78ff2cd.js → install-44a07e7a.js} +761 -251
- package/dist/es/install.js +22 -30
- package/dist/es/{utils-9e5a16a1.js → utils-d7dd4f4e.js} +9 -1
- package/dist/es/version.js +1 -1
- package/package.json +1 -1
|
@@ -13397,7 +13397,7 @@
|
|
|
13397
13397
|
}, function (props) {
|
|
13398
13398
|
return "url(" + props.src + ")";
|
|
13399
13399
|
});
|
|
13400
|
-
var ListItem = styled('a')(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\theight: auto;\n\toutline: none;\n\ttext-decoration: none;\n\tborder-radius: 0;\n\tbackground-color: ", ";\n\tdisplay: flex;\n\tflex-direction: row;\n\tmargin: 0;\n\tpadding: 10px;\n\tborder-bottom: 1px solid ", ";\n\tcolor: ", ";\n\t", "; all 0.3s ease;\n\n\t&:hover, &:focus {\n\t\tbackground-color: ", ";\n\t}\n\n\t&:last-child {\n\t\tborder: 0;\n\t}\n\n\th2 {\n\t\twidth: 100%;\n\t\tline-height: 1.2rem;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\tmargin: 0;\n\t\tpadding: 0 0 8px;\n\t}\n\n\tp {\n\t\tmargin: 0;\n\t}\n\n\tarticle {\n\t\twidth: ", ";\n\t\tpadding-left: ", ";\n\t\tfont-size: 0.9rem;\n\t}\n\n\t&:hover, &:focus {\n\t\tbox-shadow: 0 0 0 0 rgba(0,0,0,0.10);\n\t}\n\n\t@media (max-width: 420px) {\n\t\tmin-width: 0;\n\t\tmargin: 0;\n\t\tborder-radius: 0;\n\t\tbox-shadow: none;\n\t\tborder: 1px solid #eee;\n\n\t\t&:hover, &:focus {\n\t\t\tbox-shadow: 0;\n\t\t}\n\t}\n"])), function (_ref) {
|
|
13400
|
+
var ListItem = styled('a')(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\theight: auto;\n\toutline: none;\n\ttext-decoration: none;\n\tborder-radius: 0;\n\tbackground-color: ", ";\n\tdisplay: flex;\n\tflex-direction: row;\n\tmargin: 0;\n\tpadding: 10px;\n\tborder-bottom: 1px solid ", ";\n\tcolor: ", ";\n\t", "; all 0.3s ease;\n\n\t&:hover, &:focus {\n\t\tbackground-color: ", ";\n\t}\n\n\t&:last-child {\n\t\tborder: 0;\n\t}\n\n\th2 {\n\t\twidth: 100%;\n\t\tline-height: 1.2rem;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\tmargin: 0;\n\t\tpadding: 0 0 8px;\n\t}\n\n\tp {\n\t\tmargin: 0;\n\t}\n\n\tarticle {\n\t\twidth: ", ";\n\t\tpadding-left: ", ";\n\t\tfont-size: 0.9rem;\n\t}\n\n\t&:hover, &:focus {\n\t\tbox-shadow: 0 0 0 0 rgba(0,0,0,0.10);\n\t}\n\n\t@media (max-width: 420px) {\n\t\tmin-width: 0;\n\t\tmargin: 0;\n\t\tborder-radius: 0;\n\t\tbox-shadow: none;\n\t\tborder: 1px solid #eee;\n\n\t\t&:hover, &:focus {\n\t\t\tbox-shadow: 0;\n\t\t}\n\t}\n\n\t", "\n"])), function (_ref) {
|
|
13401
13401
|
var theme = _ref.theme;
|
|
13402
13402
|
return theme.colors.backgroundColor ? curriedLighten(0.1, theme.colors.backgroundColor) : '#fff';
|
|
13403
13403
|
}, function (_ref2) {
|
|
@@ -13418,6 +13418,11 @@
|
|
|
13418
13418
|
return '100%';
|
|
13419
13419
|
}, function (props) {
|
|
13420
13420
|
return props.image ? '10px' : 0;
|
|
13421
|
+
}, function (props) {
|
|
13422
|
+
if (props.isTreeListItem) {
|
|
13423
|
+
return 'border-bottom: none; width:max-content; cursor:pointer; padding: 5px 12px;';
|
|
13424
|
+
}
|
|
13425
|
+
return '';
|
|
13421
13426
|
});
|
|
13422
13427
|
|
|
13423
13428
|
var ResultListWrapper = {
|
|
@@ -13472,7 +13477,7 @@
|
|
|
13472
13477
|
colors = _ref$theme$colors === void 0 ? {} : _ref$theme$colors;
|
|
13473
13478
|
return "\n\tborder: 1px solid " + (colors.borderColor || '#ccc') + ";\n";
|
|
13474
13479
|
};
|
|
13475
|
-
var Flex = styled('div')(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n\tdisplay: ", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\tsvg.cancel-icon {\n\t\tcursor: pointer;\n\t\tfill: ", ";\n\t\tflex-basis: 30px;\n\n\t\t&:hover {\n\t\t\tfill: ", ";\n\t\t}\n\t}\n"])), function (props) {
|
|
13480
|
+
var Flex = styled('div')(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n\tdisplay: ", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\tsvg.cancel-icon {\n\t\tcursor: pointer;\n\t\tfill: ", ";\n\t\tflex-basis: 30px;\n\n\t\t&:hover {\n\t\t\tfill: ", ";\n\t\t}\n\t}\n"])), function (props) {
|
|
13476
13481
|
return props.inline ? 'inline-flex' : 'flex';
|
|
13477
13482
|
}, function (props) {
|
|
13478
13483
|
return (props.labelPosition === 'left' || props.iconPosition === 'right') && leftLabel;
|
|
@@ -13488,6 +13493,8 @@
|
|
|
13488
13493
|
return props.justifyContent && "\n\t\t\tjustify-content: " + props.justifyContent + ";\n\t\t";
|
|
13489
13494
|
}, function (props) {
|
|
13490
13495
|
return props.alignItems && "\n\t\t\talign-items: " + props.alignItems + ";\n\t\t";
|
|
13496
|
+
}, function (props) {
|
|
13497
|
+
return props.gap && "\n\t\t\tgap: " + props.gap + ";\n\t\t";
|
|
13491
13498
|
}, function (props) {
|
|
13492
13499
|
return props.flex && "\n\t\t\tflex: " + props.flex + ";\n\t\t";
|
|
13493
13500
|
}, function (props) {
|
|
@@ -20292,6 +20299,14 @@
|
|
|
20292
20299
|
}
|
|
20293
20300
|
return _extends({}, clonedQuery, extractQuery(props));
|
|
20294
20301
|
};
|
|
20302
|
+
var sanitizeObject = function sanitizeObject(obj) {
|
|
20303
|
+
return JSON.parse(JSON.stringify(obj, function (key, value) {
|
|
20304
|
+
return (
|
|
20305
|
+
// eslint-disable-next-line eqeqeq
|
|
20306
|
+
value === null || value == {} || value === false ? undefined : value
|
|
20307
|
+
);
|
|
20308
|
+
}));
|
|
20309
|
+
};
|
|
20295
20310
|
|
|
20296
20311
|
var updateQuery$2 = lib_5.updateQuery,
|
|
20297
20312
|
setQueryOptions$1 = lib_5.setQueryOptions,
|
|
@@ -21140,235 +21155,2065 @@
|
|
|
21140
21155
|
Vue.component(ListConnected$1.name, ListConnected$1);
|
|
21141
21156
|
};
|
|
21142
21157
|
|
|
21143
|
-
var
|
|
21144
|
-
|
|
21145
|
-
|
|
21146
|
-
|
|
21147
|
-
|
|
21148
|
-
|
|
21149
|
-
|
|
21150
|
-
|
|
21151
|
-
|
|
21152
|
-
|
|
21153
|
-
|
|
21154
|
-
|
|
21155
|
-
|
|
21156
|
-
|
|
21157
|
-
|
|
21158
|
+
var reactIs_development = createCommonjsModule(function (module, exports) {
|
|
21159
|
+
|
|
21160
|
+
{
|
|
21161
|
+
(function () {
|
|
21162
|
+
|
|
21163
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
21164
|
+
// nor polyfill, then a plain number is used for performance.
|
|
21165
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol["for"];
|
|
21166
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol["for"]('react.element') : 0xeac7;
|
|
21167
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol["for"]('react.portal') : 0xeaca;
|
|
21168
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol["for"]('react.fragment') : 0xeacb;
|
|
21169
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol["for"]('react.strict_mode') : 0xeacc;
|
|
21170
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol["for"]('react.profiler') : 0xead2;
|
|
21171
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol["for"]('react.provider') : 0xeacd;
|
|
21172
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol["for"]('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
21173
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
21174
|
+
|
|
21175
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol["for"]('react.async_mode') : 0xeacf;
|
|
21176
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol["for"]('react.concurrent_mode') : 0xeacf;
|
|
21177
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol["for"]('react.forward_ref') : 0xead0;
|
|
21178
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol["for"]('react.suspense') : 0xead1;
|
|
21179
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol["for"]('react.suspense_list') : 0xead8;
|
|
21180
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol["for"]('react.memo') : 0xead3;
|
|
21181
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol["for"]('react.lazy') : 0xead4;
|
|
21182
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol["for"]('react.block') : 0xead9;
|
|
21183
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol["for"]('react.fundamental') : 0xead5;
|
|
21184
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol["for"]('react.responder') : 0xead6;
|
|
21185
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol["for"]('react.scope') : 0xead7;
|
|
21186
|
+
function isValidElementType(type) {
|
|
21187
|
+
return typeof type === 'string' || typeof type === 'function' ||
|
|
21188
|
+
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
21189
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
21190
|
+
}
|
|
21191
|
+
function typeOf(object) {
|
|
21192
|
+
if (typeof object === 'object' && object !== null) {
|
|
21193
|
+
var $$typeof = object.$$typeof;
|
|
21194
|
+
switch ($$typeof) {
|
|
21195
|
+
case REACT_ELEMENT_TYPE:
|
|
21196
|
+
var type = object.type;
|
|
21197
|
+
switch (type) {
|
|
21198
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
21199
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
21200
|
+
case REACT_FRAGMENT_TYPE:
|
|
21201
|
+
case REACT_PROFILER_TYPE:
|
|
21202
|
+
case REACT_STRICT_MODE_TYPE:
|
|
21203
|
+
case REACT_SUSPENSE_TYPE:
|
|
21204
|
+
return type;
|
|
21205
|
+
default:
|
|
21206
|
+
var $$typeofType = type && type.$$typeof;
|
|
21207
|
+
switch ($$typeofType) {
|
|
21208
|
+
case REACT_CONTEXT_TYPE:
|
|
21209
|
+
case REACT_FORWARD_REF_TYPE:
|
|
21210
|
+
case REACT_LAZY_TYPE:
|
|
21211
|
+
case REACT_MEMO_TYPE:
|
|
21212
|
+
case REACT_PROVIDER_TYPE:
|
|
21213
|
+
return $$typeofType;
|
|
21214
|
+
default:
|
|
21215
|
+
return $$typeof;
|
|
21216
|
+
}
|
|
21217
|
+
}
|
|
21218
|
+
case REACT_PORTAL_TYPE:
|
|
21219
|
+
return $$typeof;
|
|
21220
|
+
}
|
|
21221
|
+
}
|
|
21222
|
+
return undefined;
|
|
21223
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
21224
|
+
|
|
21225
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
21226
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
21227
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
21228
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
21229
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
21230
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
21231
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
21232
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
21233
|
+
var Memo = REACT_MEMO_TYPE;
|
|
21234
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
21235
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
21236
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
21237
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
21238
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
21239
|
+
|
|
21240
|
+
function isAsyncMode(object) {
|
|
21241
|
+
{
|
|
21242
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
21243
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
21244
|
+
|
|
21245
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
21246
|
+
}
|
|
21247
|
+
}
|
|
21248
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
21249
|
+
}
|
|
21250
|
+
function isConcurrentMode(object) {
|
|
21251
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
21252
|
+
}
|
|
21253
|
+
function isContextConsumer(object) {
|
|
21254
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
21255
|
+
}
|
|
21256
|
+
function isContextProvider(object) {
|
|
21257
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
21258
|
+
}
|
|
21259
|
+
function isElement(object) {
|
|
21260
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
21261
|
+
}
|
|
21262
|
+
function isForwardRef(object) {
|
|
21263
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
21264
|
+
}
|
|
21265
|
+
function isFragment(object) {
|
|
21266
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
21267
|
+
}
|
|
21268
|
+
function isLazy(object) {
|
|
21269
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
21270
|
+
}
|
|
21271
|
+
function isMemo(object) {
|
|
21272
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
21273
|
+
}
|
|
21274
|
+
function isPortal(object) {
|
|
21275
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
21276
|
+
}
|
|
21277
|
+
function isProfiler(object) {
|
|
21278
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
21279
|
+
}
|
|
21280
|
+
function isStrictMode(object) {
|
|
21281
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
21282
|
+
}
|
|
21283
|
+
function isSuspense(object) {
|
|
21284
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
21285
|
+
}
|
|
21286
|
+
exports.AsyncMode = AsyncMode;
|
|
21287
|
+
exports.ConcurrentMode = ConcurrentMode;
|
|
21288
|
+
exports.ContextConsumer = ContextConsumer;
|
|
21289
|
+
exports.ContextProvider = ContextProvider;
|
|
21290
|
+
exports.Element = Element;
|
|
21291
|
+
exports.ForwardRef = ForwardRef;
|
|
21292
|
+
exports.Fragment = Fragment;
|
|
21293
|
+
exports.Lazy = Lazy;
|
|
21294
|
+
exports.Memo = Memo;
|
|
21295
|
+
exports.Portal = Portal;
|
|
21296
|
+
exports.Profiler = Profiler;
|
|
21297
|
+
exports.StrictMode = StrictMode;
|
|
21298
|
+
exports.Suspense = Suspense;
|
|
21299
|
+
exports.isAsyncMode = isAsyncMode;
|
|
21300
|
+
exports.isConcurrentMode = isConcurrentMode;
|
|
21301
|
+
exports.isContextConsumer = isContextConsumer;
|
|
21302
|
+
exports.isContextProvider = isContextProvider;
|
|
21303
|
+
exports.isElement = isElement;
|
|
21304
|
+
exports.isForwardRef = isForwardRef;
|
|
21305
|
+
exports.isFragment = isFragment;
|
|
21306
|
+
exports.isLazy = isLazy;
|
|
21307
|
+
exports.isMemo = isMemo;
|
|
21308
|
+
exports.isPortal = isPortal;
|
|
21309
|
+
exports.isProfiler = isProfiler;
|
|
21310
|
+
exports.isStrictMode = isStrictMode;
|
|
21311
|
+
exports.isSuspense = isSuspense;
|
|
21312
|
+
exports.isValidElementType = isValidElementType;
|
|
21313
|
+
exports.typeOf = typeOf;
|
|
21314
|
+
})();
|
|
21315
|
+
}
|
|
21158
21316
|
});
|
|
21317
|
+
var reactIs_development_1 = reactIs_development.AsyncMode;
|
|
21318
|
+
var reactIs_development_2 = reactIs_development.ConcurrentMode;
|
|
21319
|
+
var reactIs_development_3 = reactIs_development.ContextConsumer;
|
|
21320
|
+
var reactIs_development_4 = reactIs_development.ContextProvider;
|
|
21321
|
+
var reactIs_development_5 = reactIs_development.Element;
|
|
21322
|
+
var reactIs_development_6 = reactIs_development.ForwardRef;
|
|
21323
|
+
var reactIs_development_7 = reactIs_development.Fragment;
|
|
21324
|
+
var reactIs_development_8 = reactIs_development.Lazy;
|
|
21325
|
+
var reactIs_development_9 = reactIs_development.Memo;
|
|
21326
|
+
var reactIs_development_10 = reactIs_development.Portal;
|
|
21327
|
+
var reactIs_development_11 = reactIs_development.Profiler;
|
|
21328
|
+
var reactIs_development_12 = reactIs_development.StrictMode;
|
|
21329
|
+
var reactIs_development_13 = reactIs_development.Suspense;
|
|
21330
|
+
var reactIs_development_14 = reactIs_development.isAsyncMode;
|
|
21331
|
+
var reactIs_development_15 = reactIs_development.isConcurrentMode;
|
|
21332
|
+
var reactIs_development_16 = reactIs_development.isContextConsumer;
|
|
21333
|
+
var reactIs_development_17 = reactIs_development.isContextProvider;
|
|
21334
|
+
var reactIs_development_18 = reactIs_development.isElement;
|
|
21335
|
+
var reactIs_development_19 = reactIs_development.isForwardRef;
|
|
21336
|
+
var reactIs_development_20 = reactIs_development.isFragment;
|
|
21337
|
+
var reactIs_development_21 = reactIs_development.isLazy;
|
|
21338
|
+
var reactIs_development_22 = reactIs_development.isMemo;
|
|
21339
|
+
var reactIs_development_23 = reactIs_development.isPortal;
|
|
21340
|
+
var reactIs_development_24 = reactIs_development.isProfiler;
|
|
21341
|
+
var reactIs_development_25 = reactIs_development.isStrictMode;
|
|
21342
|
+
var reactIs_development_26 = reactIs_development.isSuspense;
|
|
21343
|
+
var reactIs_development_27 = reactIs_development.isValidElementType;
|
|
21344
|
+
var reactIs_development_28 = reactIs_development.typeOf;
|
|
21345
|
+
|
|
21346
|
+
var reactIs = createCommonjsModule(function (module) {
|
|
21159
21347
|
|
|
21160
|
-
|
|
21161
|
-
|
|
21162
|
-
|
|
21163
|
-
return props.open ? open : null;
|
|
21348
|
+
{
|
|
21349
|
+
module.exports = reactIs_development;
|
|
21350
|
+
}
|
|
21164
21351
|
});
|
|
21165
21352
|
|
|
21166
|
-
|
|
21167
|
-
|
|
21168
|
-
|
|
21169
|
-
|
|
21170
|
-
|
|
21171
|
-
|
|
21172
|
-
|
|
21173
|
-
|
|
21174
|
-
|
|
21175
|
-
|
|
21176
|
-
|
|
21177
|
-
|
|
21178
|
-
|
|
21179
|
-
}
|
|
21180
|
-
|
|
21181
|
-
|
|
21182
|
-
|
|
21183
|
-
|
|
21184
|
-
|
|
21185
|
-
|
|
21186
|
-
// change event
|
|
21187
|
-
placeholder: types.string,
|
|
21188
|
-
returnsObject: Q.bool,
|
|
21189
|
-
customLabelRenderer: types.func,
|
|
21190
|
-
hasCustomRenderer: Q.bool,
|
|
21191
|
-
customRenderer: types.func,
|
|
21192
|
-
renderItem: types.func,
|
|
21193
|
-
renderNoResults: Q.any,
|
|
21194
|
-
handleChange: types.func,
|
|
21195
|
-
transformData: types.func,
|
|
21196
|
-
selectedItem: types.selectedValue,
|
|
21197
|
-
showCount: Q.bool,
|
|
21198
|
-
single: Q.bool,
|
|
21199
|
-
small: Q.bool.def(false),
|
|
21200
|
-
themePreset: types.themePreset,
|
|
21201
|
-
showSearch: Q.bool,
|
|
21202
|
-
showClear: Q.bool,
|
|
21203
|
-
searchPlaceholder: Q.string.def('Type here to search...')
|
|
21204
|
-
},
|
|
21205
|
-
render: function render() {
|
|
21206
|
-
var _this = this;
|
|
21207
|
-
var _this$$props = this.$props,
|
|
21208
|
-
items = _this$$props.items,
|
|
21209
|
-
selectedItem = _this$$props.selectedItem,
|
|
21210
|
-
placeholder = _this$$props.placeholder,
|
|
21211
|
-
labelField = _this$$props.labelField,
|
|
21212
|
-
keyField = _this$$props.keyField,
|
|
21213
|
-
themePreset = _this$$props.themePreset,
|
|
21214
|
-
renderItem = _this$$props.renderItem,
|
|
21215
|
-
transformData = _this$$props.transformData,
|
|
21216
|
-
footer = _this$$props.footer,
|
|
21217
|
-
customLabelRenderer = _this$$props.customLabelRenderer,
|
|
21218
|
-
hasCustomRenderer = _this$$props.hasCustomRenderer,
|
|
21219
|
-
customRenderer = _this$$props.customRenderer;
|
|
21220
|
-
var itemsToRender = items;
|
|
21221
|
-
if (transformData) {
|
|
21222
|
-
itemsToRender = transformData(itemsToRender);
|
|
21353
|
+
/*
|
|
21354
|
+
object-assign
|
|
21355
|
+
(c) Sindre Sorhus
|
|
21356
|
+
@license MIT
|
|
21357
|
+
*/
|
|
21358
|
+
|
|
21359
|
+
/* eslint-disable no-unused-vars */
|
|
21360
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
21361
|
+
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
21362
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
21363
|
+
function toObject(val) {
|
|
21364
|
+
if (val === null || val === undefined) {
|
|
21365
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
21366
|
+
}
|
|
21367
|
+
return Object(val);
|
|
21368
|
+
}
|
|
21369
|
+
function shouldUseNative() {
|
|
21370
|
+
try {
|
|
21371
|
+
if (!Object.assign) {
|
|
21372
|
+
return false;
|
|
21223
21373
|
}
|
|
21224
|
-
|
|
21225
|
-
|
|
21226
|
-
|
|
21227
|
-
|
|
21228
|
-
|
|
21229
|
-
|
|
21230
|
-
|
|
21374
|
+
|
|
21375
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
21376
|
+
|
|
21377
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
21378
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
21379
|
+
test1[5] = 'de';
|
|
21380
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
21231
21381
|
return false;
|
|
21382
|
+
}
|
|
21383
|
+
|
|
21384
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
21385
|
+
var test2 = {};
|
|
21386
|
+
for (var i = 0; i < 10; i++) {
|
|
21387
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
21388
|
+
}
|
|
21389
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
21390
|
+
return test2[n];
|
|
21232
21391
|
});
|
|
21233
|
-
|
|
21234
|
-
|
|
21235
|
-
|
|
21236
|
-
|
|
21237
|
-
|
|
21238
|
-
|
|
21239
|
-
|
|
21240
|
-
|
|
21241
|
-
isOpen = _ref.isOpen,
|
|
21242
|
-
highlightedIndex = _ref.highlightedIndex,
|
|
21243
|
-
getButtonProps = _ref.getButtonProps,
|
|
21244
|
-
getItemEvents = _ref.getItemEvents,
|
|
21245
|
-
getInputEvents = _ref.getInputEvents;
|
|
21246
|
-
return vue.createVNode("div", {
|
|
21247
|
-
"class": suggestionsContainer
|
|
21248
|
-
}, [vue.createVNode(Select, vue.mergeProps(babelHelperVueTransformOn(getButtonProps({
|
|
21249
|
-
onClick: _this.toggle
|
|
21250
|
-
})), {
|
|
21251
|
-
"class": getClassName$6(_this.$props.innerClass, 'select') || '',
|
|
21252
|
-
"title": selectedItem ? _this.renderToString(selectedItem) : placeholder,
|
|
21253
|
-
"small": _this.$props.small,
|
|
21254
|
-
"themePreset": _this.$props.themePreset
|
|
21255
|
-
}), {
|
|
21256
|
-
"default": function _default() {
|
|
21257
|
-
return [customLabelRenderer ? customLabelRenderer(selectedItem) : vue.createVNode("div", null, [selectedItem ? _this.renderToString(selectedItem) : placeholder]), vue.createVNode(Chevron, {
|
|
21258
|
-
"open": isOpen
|
|
21259
|
-
}, null)];
|
|
21260
|
-
}
|
|
21261
|
-
}), hasCustomRenderer ? customRenderer(itemsToRender, {
|
|
21262
|
-
getItemProps: getItemProps,
|
|
21263
|
-
isOpen: isOpen,
|
|
21264
|
-
highlightedIndex: highlightedIndex,
|
|
21265
|
-
getButtonProps: getButtonProps,
|
|
21266
|
-
getItemEvents: getItemEvents
|
|
21267
|
-
}) : isOpen && itemsToRender.length ? vue.createVNode("ul", {
|
|
21268
|
-
"class": suggestions$1(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName$6(_this.$props.innerClass, 'list')
|
|
21269
|
-
}, [_this.$props.showSearch ? _this.renderSearchbox({
|
|
21270
|
-
on: {
|
|
21271
|
-
input: getInputEvents({
|
|
21272
|
-
onInput: _this.handleInputChange
|
|
21273
|
-
}).input
|
|
21274
|
-
}
|
|
21275
|
-
}) : null, !hasCustomRenderer && filteredItemsToRender.length === 0 ? _this.renderNoResult() : filteredItemsToRender.map(function (item, index) {
|
|
21276
|
-
var selected = _this.$props.multi // MultiDropdownList
|
|
21277
|
-
&& (selectedItem && !!selectedItem[item[keyField]] // MultiDropdownRange
|
|
21278
|
-
|| Array.isArray(selectedItem) && selectedItem.find(function (value) {
|
|
21279
|
-
return value[labelField] === item[labelField];
|
|
21280
|
-
}));
|
|
21281
|
-
if (!_this.$props.multi) selected = item.key === selectedItem;
|
|
21282
|
-
return vue.createVNode("li", vue.mergeProps(getItemProps({
|
|
21283
|
-
item: item
|
|
21284
|
-
}), babelHelperVueTransformOn(getItemEvents({
|
|
21285
|
-
item: item
|
|
21286
|
-
})), {
|
|
21287
|
-
"key": item[keyField],
|
|
21288
|
-
"class": "" + (selected ? 'active' : ''),
|
|
21289
|
-
"style": {
|
|
21290
|
-
backgroundColor: _this.getBackgroundColor(highlightedIndex === index, selected)
|
|
21291
|
-
}
|
|
21292
|
-
}), [renderItem ? renderItem({
|
|
21293
|
-
label: item[labelField],
|
|
21294
|
-
count: item.doc_count,
|
|
21295
|
-
isChecked: selected && _this.$props.multi
|
|
21296
|
-
}) : vue.createVNode("div", null, [typeof item[labelField] === 'string' ? vue.createVNode("span", {
|
|
21297
|
-
"innerHTML": item[labelField]
|
|
21298
|
-
}, null) : item[labelField], _this.$props.showCount && item.doc_count && vue.createVNode("span", {
|
|
21299
|
-
"class": getClassName$6(_this.$props.innerClass, 'count') || ''
|
|
21300
|
-
}, [vue.createTextVNode("\xA0("), item.doc_count, vue.createTextVNode(")")])]), selected && _this.$props.multi ? vue.createVNode(Tick, {
|
|
21301
|
-
"class": getClassName$6(_this.$props.innerClass, 'icon') || ''
|
|
21302
|
-
}, null) : null]);
|
|
21303
|
-
}), footer]) : null]);
|
|
21304
|
-
}
|
|
21392
|
+
if (order2.join('') !== '0123456789') {
|
|
21393
|
+
return false;
|
|
21394
|
+
}
|
|
21395
|
+
|
|
21396
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
21397
|
+
var test3 = {};
|
|
21398
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
21399
|
+
test3[letter] = letter;
|
|
21305
21400
|
});
|
|
21306
|
-
|
|
21307
|
-
|
|
21308
|
-
|
|
21309
|
-
|
|
21310
|
-
|
|
21311
|
-
|
|
21312
|
-
|
|
21313
|
-
|
|
21314
|
-
|
|
21315
|
-
|
|
21316
|
-
|
|
21317
|
-
|
|
21318
|
-
|
|
21319
|
-
|
|
21320
|
-
|
|
21321
|
-
|
|
21322
|
-
|
|
21323
|
-
|
|
21324
|
-
},
|
|
21325
|
-
handleStateChange: function handleStateChange(_ref2) {
|
|
21326
|
-
var isOpen = _ref2.isOpen;
|
|
21327
|
-
this.isOpen = isOpen;
|
|
21328
|
-
},
|
|
21329
|
-
getBackgroundColor: function getBackgroundColor(highlighted, selected) {
|
|
21330
|
-
var isDark = this.$props.themePreset === 'dark';
|
|
21331
|
-
if (highlighted) {
|
|
21332
|
-
return isDark ? '#555' : '#eee';
|
|
21333
|
-
}
|
|
21334
|
-
if (selected) {
|
|
21335
|
-
return isDark ? '#686868' : '#fafafa';
|
|
21336
|
-
}
|
|
21337
|
-
return isDark ? '#424242' : '#fff';
|
|
21338
|
-
},
|
|
21339
|
-
handleInputChange: function handleInputChange(e) {
|
|
21340
|
-
var value = e.target.value;
|
|
21341
|
-
this.searchTerm = value;
|
|
21342
|
-
},
|
|
21343
|
-
clearSearchTerm: function clearSearchTerm() {
|
|
21344
|
-
this.searchTerm = '';
|
|
21345
|
-
},
|
|
21346
|
-
renderToString: function renderToString(value) {
|
|
21347
|
-
var _this2 = this;
|
|
21348
|
-
var customLabelRenderer = this.$props.customLabelRenderer;
|
|
21349
|
-
if (customLabelRenderer) {
|
|
21350
|
-
var customLabel = customLabelRenderer(value);
|
|
21351
|
-
if (typeof customLabel === 'string') {
|
|
21352
|
-
return customLabel;
|
|
21353
|
-
}
|
|
21354
|
-
}
|
|
21355
|
-
if (Array.isArray(value) && value.length) {
|
|
21356
|
-
var arrayToRender = value.map(function (item) {
|
|
21357
|
-
return _this2.renderToString(item);
|
|
21358
|
-
});
|
|
21359
|
-
return arrayToRender.join(', ');
|
|
21401
|
+
if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
|
|
21402
|
+
return false;
|
|
21403
|
+
}
|
|
21404
|
+
return true;
|
|
21405
|
+
} catch (err) {
|
|
21406
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
21407
|
+
return false;
|
|
21408
|
+
}
|
|
21409
|
+
}
|
|
21410
|
+
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
21411
|
+
var from;
|
|
21412
|
+
var to = toObject(target);
|
|
21413
|
+
var symbols;
|
|
21414
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
21415
|
+
from = Object(arguments[s]);
|
|
21416
|
+
for (var key in from) {
|
|
21417
|
+
if (hasOwnProperty$1.call(from, key)) {
|
|
21418
|
+
to[key] = from[key];
|
|
21360
21419
|
}
|
|
21361
|
-
|
|
21362
|
-
|
|
21363
|
-
|
|
21364
|
-
|
|
21365
|
-
if (
|
|
21366
|
-
|
|
21420
|
+
}
|
|
21421
|
+
if (getOwnPropertySymbols) {
|
|
21422
|
+
symbols = getOwnPropertySymbols(from);
|
|
21423
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
21424
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
21425
|
+
to[symbols[i]] = from[symbols[i]];
|
|
21367
21426
|
}
|
|
21368
|
-
return this.$props.placeholder;
|
|
21369
21427
|
}
|
|
21370
|
-
|
|
21371
|
-
|
|
21428
|
+
}
|
|
21429
|
+
}
|
|
21430
|
+
return to;
|
|
21431
|
+
};
|
|
21432
|
+
|
|
21433
|
+
/**
|
|
21434
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
21435
|
+
*
|
|
21436
|
+
* This source code is licensed under the MIT license found in the
|
|
21437
|
+
* LICENSE file in the root directory of this source tree.
|
|
21438
|
+
*/
|
|
21439
|
+
|
|
21440
|
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
21441
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
21442
|
+
|
|
21443
|
+
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
21444
|
+
|
|
21445
|
+
var printWarning = function printWarning() {};
|
|
21446
|
+
{
|
|
21447
|
+
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
21448
|
+
var loggedTypeFailures = {};
|
|
21449
|
+
var has$1 = has;
|
|
21450
|
+
printWarning = function printWarning(text) {
|
|
21451
|
+
var message = 'Warning: ' + text;
|
|
21452
|
+
if (typeof console !== 'undefined') {
|
|
21453
|
+
console.error(message);
|
|
21454
|
+
}
|
|
21455
|
+
try {
|
|
21456
|
+
// --- Welcome to debugging React ---
|
|
21457
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
21458
|
+
// to find the callsite that caused this warning to fire.
|
|
21459
|
+
throw new Error(message);
|
|
21460
|
+
} catch (x) {/**/}
|
|
21461
|
+
};
|
|
21462
|
+
}
|
|
21463
|
+
|
|
21464
|
+
/**
|
|
21465
|
+
* Assert that the values match with the type specs.
|
|
21466
|
+
* Error messages are memorized and will only be shown once.
|
|
21467
|
+
*
|
|
21468
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
21469
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
21470
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
21471
|
+
* @param {string} componentName Name of the component for error messages.
|
|
21472
|
+
* @param {?Function} getStack Returns the component stack.
|
|
21473
|
+
* @private
|
|
21474
|
+
*/
|
|
21475
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
21476
|
+
{
|
|
21477
|
+
for (var typeSpecName in typeSpecs) {
|
|
21478
|
+
if (has$1(typeSpecs, typeSpecName)) {
|
|
21479
|
+
var error;
|
|
21480
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
21481
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
21482
|
+
// After these have been cleaned up, we'll let them throw.
|
|
21483
|
+
try {
|
|
21484
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
21485
|
+
// behavior as without this statement except with a better message.
|
|
21486
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
21487
|
+
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
|
|
21488
|
+
err.name = 'Invariant Violation';
|
|
21489
|
+
throw err;
|
|
21490
|
+
}
|
|
21491
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
|
|
21492
|
+
} catch (ex) {
|
|
21493
|
+
error = ex;
|
|
21494
|
+
}
|
|
21495
|
+
if (error && !(error instanceof Error)) {
|
|
21496
|
+
printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');
|
|
21497
|
+
}
|
|
21498
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
21499
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
21500
|
+
// same error.
|
|
21501
|
+
loggedTypeFailures[error.message] = true;
|
|
21502
|
+
var stack = getStack ? getStack() : '';
|
|
21503
|
+
printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
|
|
21504
|
+
}
|
|
21505
|
+
}
|
|
21506
|
+
}
|
|
21507
|
+
}
|
|
21508
|
+
}
|
|
21509
|
+
|
|
21510
|
+
/**
|
|
21511
|
+
* Resets warning cache when testing.
|
|
21512
|
+
*
|
|
21513
|
+
* @private
|
|
21514
|
+
*/
|
|
21515
|
+
checkPropTypes.resetWarningCache = function () {
|
|
21516
|
+
{
|
|
21517
|
+
loggedTypeFailures = {};
|
|
21518
|
+
}
|
|
21519
|
+
};
|
|
21520
|
+
var checkPropTypes_1 = checkPropTypes;
|
|
21521
|
+
|
|
21522
|
+
var printWarning$1 = function printWarning() {};
|
|
21523
|
+
{
|
|
21524
|
+
printWarning$1 = function printWarning(text) {
|
|
21525
|
+
var message = 'Warning: ' + text;
|
|
21526
|
+
if (typeof console !== 'undefined') {
|
|
21527
|
+
console.error(message);
|
|
21528
|
+
}
|
|
21529
|
+
try {
|
|
21530
|
+
// --- Welcome to debugging React ---
|
|
21531
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
21532
|
+
// to find the callsite that caused this warning to fire.
|
|
21533
|
+
throw new Error(message);
|
|
21534
|
+
} catch (x) {}
|
|
21535
|
+
};
|
|
21536
|
+
}
|
|
21537
|
+
function emptyFunctionThatReturnsNull() {
|
|
21538
|
+
return null;
|
|
21539
|
+
}
|
|
21540
|
+
var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, throwOnDirectAccess) {
|
|
21541
|
+
/* global Symbol */
|
|
21542
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
21543
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
21544
|
+
|
|
21545
|
+
/**
|
|
21546
|
+
* Returns the iterator method function contained on the iterable object.
|
|
21547
|
+
*
|
|
21548
|
+
* Be sure to invoke the function with the iterable as context:
|
|
21549
|
+
*
|
|
21550
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
21551
|
+
* if (iteratorFn) {
|
|
21552
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
21553
|
+
* ...
|
|
21554
|
+
* }
|
|
21555
|
+
*
|
|
21556
|
+
* @param {?object} maybeIterable
|
|
21557
|
+
* @return {?function}
|
|
21558
|
+
*/
|
|
21559
|
+
function getIteratorFn(maybeIterable) {
|
|
21560
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
21561
|
+
if (typeof iteratorFn === 'function') {
|
|
21562
|
+
return iteratorFn;
|
|
21563
|
+
}
|
|
21564
|
+
}
|
|
21565
|
+
|
|
21566
|
+
/**
|
|
21567
|
+
* Collection of methods that allow declaration and validation of props that are
|
|
21568
|
+
* supplied to React components. Example usage:
|
|
21569
|
+
*
|
|
21570
|
+
* var Props = require('ReactPropTypes');
|
|
21571
|
+
* var MyArticle = React.createClass({
|
|
21572
|
+
* propTypes: {
|
|
21573
|
+
* // An optional string prop named "description".
|
|
21574
|
+
* description: Props.string,
|
|
21575
|
+
*
|
|
21576
|
+
* // A required enum prop named "category".
|
|
21577
|
+
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
21578
|
+
*
|
|
21579
|
+
* // A prop named "dialog" that requires an instance of Dialog.
|
|
21580
|
+
* dialog: Props.instanceOf(Dialog).isRequired
|
|
21581
|
+
* },
|
|
21582
|
+
* render: function() { ... }
|
|
21583
|
+
* });
|
|
21584
|
+
*
|
|
21585
|
+
* A more formal specification of how these methods are used:
|
|
21586
|
+
*
|
|
21587
|
+
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
21588
|
+
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
21589
|
+
*
|
|
21590
|
+
* Each and every declaration produces a function with the same signature. This
|
|
21591
|
+
* allows the creation of custom validation functions. For example:
|
|
21592
|
+
*
|
|
21593
|
+
* var MyLink = React.createClass({
|
|
21594
|
+
* propTypes: {
|
|
21595
|
+
* // An optional string or URI prop named "href".
|
|
21596
|
+
* href: function(props, propName, componentName) {
|
|
21597
|
+
* var propValue = props[propName];
|
|
21598
|
+
* if (propValue != null && typeof propValue !== 'string' &&
|
|
21599
|
+
* !(propValue instanceof URI)) {
|
|
21600
|
+
* return new Error(
|
|
21601
|
+
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
21602
|
+
* componentName
|
|
21603
|
+
* );
|
|
21604
|
+
* }
|
|
21605
|
+
* }
|
|
21606
|
+
* },
|
|
21607
|
+
* render: function() {...}
|
|
21608
|
+
* });
|
|
21609
|
+
*
|
|
21610
|
+
* @internal
|
|
21611
|
+
*/
|
|
21612
|
+
|
|
21613
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
21614
|
+
|
|
21615
|
+
// Important!
|
|
21616
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
21617
|
+
var ReactPropTypes = {
|
|
21618
|
+
array: createPrimitiveTypeChecker('array'),
|
|
21619
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
21620
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
21621
|
+
func: createPrimitiveTypeChecker('function'),
|
|
21622
|
+
number: createPrimitiveTypeChecker('number'),
|
|
21623
|
+
object: createPrimitiveTypeChecker('object'),
|
|
21624
|
+
string: createPrimitiveTypeChecker('string'),
|
|
21625
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
21626
|
+
any: createAnyTypeChecker(),
|
|
21627
|
+
arrayOf: createArrayOfTypeChecker,
|
|
21628
|
+
element: createElementTypeChecker(),
|
|
21629
|
+
elementType: createElementTypeTypeChecker(),
|
|
21630
|
+
instanceOf: createInstanceTypeChecker,
|
|
21631
|
+
node: createNodeChecker(),
|
|
21632
|
+
objectOf: createObjectOfTypeChecker,
|
|
21633
|
+
oneOf: createEnumTypeChecker,
|
|
21634
|
+
oneOfType: createUnionTypeChecker,
|
|
21635
|
+
shape: createShapeTypeChecker,
|
|
21636
|
+
exact: createStrictShapeTypeChecker
|
|
21637
|
+
};
|
|
21638
|
+
|
|
21639
|
+
/**
|
|
21640
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
21641
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
21642
|
+
*/
|
|
21643
|
+
/*eslint-disable no-self-compare*/
|
|
21644
|
+
function is(x, y) {
|
|
21645
|
+
// SameValue algorithm
|
|
21646
|
+
if (x === y) {
|
|
21647
|
+
// Steps 1-5, 7-10
|
|
21648
|
+
// Steps 6.b-6.e: +0 != -0
|
|
21649
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
21650
|
+
} else {
|
|
21651
|
+
// Step 6.a: NaN == NaN
|
|
21652
|
+
return x !== x && y !== y;
|
|
21653
|
+
}
|
|
21654
|
+
}
|
|
21655
|
+
/*eslint-enable no-self-compare*/
|
|
21656
|
+
|
|
21657
|
+
/**
|
|
21658
|
+
* We use an Error-like object for backward compatibility as people may call
|
|
21659
|
+
* PropTypes directly and inspect their output. However, we don't use real
|
|
21660
|
+
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
21661
|
+
* is prohibitively expensive if they are created too often, such as what
|
|
21662
|
+
* happens in oneOfType() for any type before the one that matched.
|
|
21663
|
+
*/
|
|
21664
|
+
function PropTypeError(message, data) {
|
|
21665
|
+
this.message = message;
|
|
21666
|
+
this.data = data && typeof data === 'object' ? data : {};
|
|
21667
|
+
this.stack = '';
|
|
21668
|
+
}
|
|
21669
|
+
// Make `instanceof Error` still work for returned errors.
|
|
21670
|
+
PropTypeError.prototype = Error.prototype;
|
|
21671
|
+
function createChainableTypeChecker(validate) {
|
|
21672
|
+
{
|
|
21673
|
+
var manualPropTypeCallCache = {};
|
|
21674
|
+
var manualPropTypeWarningCount = 0;
|
|
21675
|
+
}
|
|
21676
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
21677
|
+
componentName = componentName || ANONYMOUS;
|
|
21678
|
+
propFullName = propFullName || propName;
|
|
21679
|
+
if (secret !== ReactPropTypesSecret_1) {
|
|
21680
|
+
if (throwOnDirectAccess) {
|
|
21681
|
+
// New behavior only for users of `prop-types` package
|
|
21682
|
+
var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
|
|
21683
|
+
err.name = 'Invariant Violation';
|
|
21684
|
+
throw err;
|
|
21685
|
+
} else if ( typeof console !== 'undefined') {
|
|
21686
|
+
// Old behavior for people using React.PropTypes
|
|
21687
|
+
var cacheKey = componentName + ':' + propName;
|
|
21688
|
+
if (!manualPropTypeCallCache[cacheKey] &&
|
|
21689
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
21690
|
+
manualPropTypeWarningCount < 3) {
|
|
21691
|
+
printWarning$1('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');
|
|
21692
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
21693
|
+
manualPropTypeWarningCount++;
|
|
21694
|
+
}
|
|
21695
|
+
}
|
|
21696
|
+
}
|
|
21697
|
+
if (props[propName] == null) {
|
|
21698
|
+
if (isRequired) {
|
|
21699
|
+
if (props[propName] === null) {
|
|
21700
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
21701
|
+
}
|
|
21702
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
21703
|
+
}
|
|
21704
|
+
return null;
|
|
21705
|
+
} else {
|
|
21706
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
21707
|
+
}
|
|
21708
|
+
}
|
|
21709
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
21710
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
21711
|
+
return chainedCheckType;
|
|
21712
|
+
}
|
|
21713
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
21714
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
21715
|
+
var propValue = props[propName];
|
|
21716
|
+
var propType = getPropType(propValue);
|
|
21717
|
+
if (propType !== expectedType) {
|
|
21718
|
+
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
21719
|
+
// check, but we can offer a more precise error message here rather than
|
|
21720
|
+
// 'of type `object`'.
|
|
21721
|
+
var preciseType = getPreciseType(propValue);
|
|
21722
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {
|
|
21723
|
+
expectedType: expectedType
|
|
21724
|
+
});
|
|
21725
|
+
}
|
|
21726
|
+
return null;
|
|
21727
|
+
}
|
|
21728
|
+
return createChainableTypeChecker(validate);
|
|
21729
|
+
}
|
|
21730
|
+
function createAnyTypeChecker() {
|
|
21731
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
21732
|
+
}
|
|
21733
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
21734
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
21735
|
+
if (typeof typeChecker !== 'function') {
|
|
21736
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
21737
|
+
}
|
|
21738
|
+
var propValue = props[propName];
|
|
21739
|
+
if (!Array.isArray(propValue)) {
|
|
21740
|
+
var propType = getPropType(propValue);
|
|
21741
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
21742
|
+
}
|
|
21743
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
21744
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
|
|
21745
|
+
if (error instanceof Error) {
|
|
21746
|
+
return error;
|
|
21747
|
+
}
|
|
21748
|
+
}
|
|
21749
|
+
return null;
|
|
21750
|
+
}
|
|
21751
|
+
return createChainableTypeChecker(validate);
|
|
21752
|
+
}
|
|
21753
|
+
function createElementTypeChecker() {
|
|
21754
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
21755
|
+
var propValue = props[propName];
|
|
21756
|
+
if (!isValidElement(propValue)) {
|
|
21757
|
+
var propType = getPropType(propValue);
|
|
21758
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
21759
|
+
}
|
|
21760
|
+
return null;
|
|
21761
|
+
}
|
|
21762
|
+
return createChainableTypeChecker(validate);
|
|
21763
|
+
}
|
|
21764
|
+
function createElementTypeTypeChecker() {
|
|
21765
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
21766
|
+
var propValue = props[propName];
|
|
21767
|
+
if (!reactIs.isValidElementType(propValue)) {
|
|
21768
|
+
var propType = getPropType(propValue);
|
|
21769
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
21770
|
+
}
|
|
21771
|
+
return null;
|
|
21772
|
+
}
|
|
21773
|
+
return createChainableTypeChecker(validate);
|
|
21774
|
+
}
|
|
21775
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
21776
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
21777
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
21778
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
21779
|
+
var actualClassName = getClassName(props[propName]);
|
|
21780
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
21781
|
+
}
|
|
21782
|
+
return null;
|
|
21783
|
+
}
|
|
21784
|
+
return createChainableTypeChecker(validate);
|
|
21785
|
+
}
|
|
21786
|
+
function createEnumTypeChecker(expectedValues) {
|
|
21787
|
+
if (!Array.isArray(expectedValues)) {
|
|
21788
|
+
{
|
|
21789
|
+
if (arguments.length > 1) {
|
|
21790
|
+
printWarning$1('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');
|
|
21791
|
+
} else {
|
|
21792
|
+
printWarning$1('Invalid argument supplied to oneOf, expected an array.');
|
|
21793
|
+
}
|
|
21794
|
+
}
|
|
21795
|
+
return emptyFunctionThatReturnsNull;
|
|
21796
|
+
}
|
|
21797
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
21798
|
+
var propValue = props[propName];
|
|
21799
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
21800
|
+
if (is(propValue, expectedValues[i])) {
|
|
21801
|
+
return null;
|
|
21802
|
+
}
|
|
21803
|
+
}
|
|
21804
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
21805
|
+
var type = getPreciseType(value);
|
|
21806
|
+
if (type === 'symbol') {
|
|
21807
|
+
return String(value);
|
|
21808
|
+
}
|
|
21809
|
+
return value;
|
|
21810
|
+
});
|
|
21811
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
21812
|
+
}
|
|
21813
|
+
return createChainableTypeChecker(validate);
|
|
21814
|
+
}
|
|
21815
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
21816
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
21817
|
+
if (typeof typeChecker !== 'function') {
|
|
21818
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
21819
|
+
}
|
|
21820
|
+
var propValue = props[propName];
|
|
21821
|
+
var propType = getPropType(propValue);
|
|
21822
|
+
if (propType !== 'object') {
|
|
21823
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
21824
|
+
}
|
|
21825
|
+
for (var key in propValue) {
|
|
21826
|
+
if (has(propValue, key)) {
|
|
21827
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
|
21828
|
+
if (error instanceof Error) {
|
|
21829
|
+
return error;
|
|
21830
|
+
}
|
|
21831
|
+
}
|
|
21832
|
+
}
|
|
21833
|
+
return null;
|
|
21834
|
+
}
|
|
21835
|
+
return createChainableTypeChecker(validate);
|
|
21836
|
+
}
|
|
21837
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
21838
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
21839
|
+
printWarning$1('Invalid argument supplied to oneOfType, expected an instance of array.') ;
|
|
21840
|
+
return emptyFunctionThatReturnsNull;
|
|
21841
|
+
}
|
|
21842
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
21843
|
+
var checker = arrayOfTypeCheckers[i];
|
|
21844
|
+
if (typeof checker !== 'function') {
|
|
21845
|
+
printWarning$1('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
|
|
21846
|
+
return emptyFunctionThatReturnsNull;
|
|
21847
|
+
}
|
|
21848
|
+
}
|
|
21849
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
21850
|
+
var expectedTypes = [];
|
|
21851
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
21852
|
+
var checker = arrayOfTypeCheckers[i];
|
|
21853
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1);
|
|
21854
|
+
if (checkerResult == null) {
|
|
21855
|
+
return null;
|
|
21856
|
+
}
|
|
21857
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
21858
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
21859
|
+
}
|
|
21860
|
+
}
|
|
21861
|
+
var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
|
|
21862
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
21863
|
+
}
|
|
21864
|
+
return createChainableTypeChecker(validate);
|
|
21865
|
+
}
|
|
21866
|
+
function createNodeChecker() {
|
|
21867
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
21868
|
+
if (!isNode(props[propName])) {
|
|
21869
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
21870
|
+
}
|
|
21871
|
+
return null;
|
|
21872
|
+
}
|
|
21873
|
+
return createChainableTypeChecker(validate);
|
|
21874
|
+
}
|
|
21875
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
21876
|
+
return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');
|
|
21877
|
+
}
|
|
21878
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
21879
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
21880
|
+
var propValue = props[propName];
|
|
21881
|
+
var propType = getPropType(propValue);
|
|
21882
|
+
if (propType !== 'object') {
|
|
21883
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
21884
|
+
}
|
|
21885
|
+
for (var key in shapeTypes) {
|
|
21886
|
+
var checker = shapeTypes[key];
|
|
21887
|
+
if (typeof checker !== 'function') {
|
|
21888
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
21889
|
+
}
|
|
21890
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
|
21891
|
+
if (error) {
|
|
21892
|
+
return error;
|
|
21893
|
+
}
|
|
21894
|
+
}
|
|
21895
|
+
return null;
|
|
21896
|
+
}
|
|
21897
|
+
return createChainableTypeChecker(validate);
|
|
21898
|
+
}
|
|
21899
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
21900
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
21901
|
+
var propValue = props[propName];
|
|
21902
|
+
var propType = getPropType(propValue);
|
|
21903
|
+
if (propType !== 'object') {
|
|
21904
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
21905
|
+
}
|
|
21906
|
+
// We need to check all keys in case some are required but missing from props.
|
|
21907
|
+
var allKeys = objectAssign({}, props[propName], shapeTypes);
|
|
21908
|
+
for (var key in allKeys) {
|
|
21909
|
+
var checker = shapeTypes[key];
|
|
21910
|
+
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
21911
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
21912
|
+
}
|
|
21913
|
+
if (!checker) {
|
|
21914
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
|
|
21915
|
+
}
|
|
21916
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
|
21917
|
+
if (error) {
|
|
21918
|
+
return error;
|
|
21919
|
+
}
|
|
21920
|
+
}
|
|
21921
|
+
return null;
|
|
21922
|
+
}
|
|
21923
|
+
return createChainableTypeChecker(validate);
|
|
21924
|
+
}
|
|
21925
|
+
function isNode(propValue) {
|
|
21926
|
+
switch (typeof propValue) {
|
|
21927
|
+
case 'number':
|
|
21928
|
+
case 'string':
|
|
21929
|
+
case 'undefined':
|
|
21930
|
+
return true;
|
|
21931
|
+
case 'boolean':
|
|
21932
|
+
return !propValue;
|
|
21933
|
+
case 'object':
|
|
21934
|
+
if (Array.isArray(propValue)) {
|
|
21935
|
+
return propValue.every(isNode);
|
|
21936
|
+
}
|
|
21937
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
21938
|
+
return true;
|
|
21939
|
+
}
|
|
21940
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
21941
|
+
if (iteratorFn) {
|
|
21942
|
+
var iterator = iteratorFn.call(propValue);
|
|
21943
|
+
var step;
|
|
21944
|
+
if (iteratorFn !== propValue.entries) {
|
|
21945
|
+
while (!(step = iterator.next()).done) {
|
|
21946
|
+
if (!isNode(step.value)) {
|
|
21947
|
+
return false;
|
|
21948
|
+
}
|
|
21949
|
+
}
|
|
21950
|
+
} else {
|
|
21951
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
21952
|
+
while (!(step = iterator.next()).done) {
|
|
21953
|
+
var entry = step.value;
|
|
21954
|
+
if (entry) {
|
|
21955
|
+
if (!isNode(entry[1])) {
|
|
21956
|
+
return false;
|
|
21957
|
+
}
|
|
21958
|
+
}
|
|
21959
|
+
}
|
|
21960
|
+
}
|
|
21961
|
+
} else {
|
|
21962
|
+
return false;
|
|
21963
|
+
}
|
|
21964
|
+
return true;
|
|
21965
|
+
default:
|
|
21966
|
+
return false;
|
|
21967
|
+
}
|
|
21968
|
+
}
|
|
21969
|
+
function isSymbol(propType, propValue) {
|
|
21970
|
+
// Native Symbol.
|
|
21971
|
+
if (propType === 'symbol') {
|
|
21972
|
+
return true;
|
|
21973
|
+
}
|
|
21974
|
+
|
|
21975
|
+
// falsy value can't be a Symbol
|
|
21976
|
+
if (!propValue) {
|
|
21977
|
+
return false;
|
|
21978
|
+
}
|
|
21979
|
+
|
|
21980
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
21981
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
21982
|
+
return true;
|
|
21983
|
+
}
|
|
21984
|
+
|
|
21985
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
21986
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
21987
|
+
return true;
|
|
21988
|
+
}
|
|
21989
|
+
return false;
|
|
21990
|
+
}
|
|
21991
|
+
|
|
21992
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
21993
|
+
function getPropType(propValue) {
|
|
21994
|
+
var propType = typeof propValue;
|
|
21995
|
+
if (Array.isArray(propValue)) {
|
|
21996
|
+
return 'array';
|
|
21997
|
+
}
|
|
21998
|
+
if (propValue instanceof RegExp) {
|
|
21999
|
+
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
22000
|
+
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
22001
|
+
// passes PropTypes.object.
|
|
22002
|
+
return 'object';
|
|
22003
|
+
}
|
|
22004
|
+
if (isSymbol(propType, propValue)) {
|
|
22005
|
+
return 'symbol';
|
|
22006
|
+
}
|
|
22007
|
+
return propType;
|
|
22008
|
+
}
|
|
22009
|
+
|
|
22010
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
22011
|
+
// See `createPrimitiveTypeChecker`.
|
|
22012
|
+
function getPreciseType(propValue) {
|
|
22013
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
22014
|
+
return '' + propValue;
|
|
22015
|
+
}
|
|
22016
|
+
var propType = getPropType(propValue);
|
|
22017
|
+
if (propType === 'object') {
|
|
22018
|
+
if (propValue instanceof Date) {
|
|
22019
|
+
return 'date';
|
|
22020
|
+
} else if (propValue instanceof RegExp) {
|
|
22021
|
+
return 'regexp';
|
|
22022
|
+
}
|
|
22023
|
+
}
|
|
22024
|
+
return propType;
|
|
22025
|
+
}
|
|
22026
|
+
|
|
22027
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
22028
|
+
// For example, "undefined" or "of type array"
|
|
22029
|
+
function getPostfixForTypeWarning(value) {
|
|
22030
|
+
var type = getPreciseType(value);
|
|
22031
|
+
switch (type) {
|
|
22032
|
+
case 'array':
|
|
22033
|
+
case 'object':
|
|
22034
|
+
return 'an ' + type;
|
|
22035
|
+
case 'boolean':
|
|
22036
|
+
case 'date':
|
|
22037
|
+
case 'regexp':
|
|
22038
|
+
return 'a ' + type;
|
|
22039
|
+
default:
|
|
22040
|
+
return type;
|
|
22041
|
+
}
|
|
22042
|
+
}
|
|
22043
|
+
|
|
22044
|
+
// Returns class name of the object, if any.
|
|
22045
|
+
function getClassName(propValue) {
|
|
22046
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
22047
|
+
return ANONYMOUS;
|
|
22048
|
+
}
|
|
22049
|
+
return propValue.constructor.name;
|
|
22050
|
+
}
|
|
22051
|
+
ReactPropTypes.checkPropTypes = checkPropTypes_1;
|
|
22052
|
+
ReactPropTypes.resetWarningCache = checkPropTypes_1.resetWarningCache;
|
|
22053
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
22054
|
+
return ReactPropTypes;
|
|
22055
|
+
};
|
|
22056
|
+
|
|
22057
|
+
var propTypes = createCommonjsModule(function (module) {
|
|
22058
|
+
/**
|
|
22059
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
22060
|
+
*
|
|
22061
|
+
* This source code is licensed under the MIT license found in the
|
|
22062
|
+
* LICENSE file in the root directory of this source tree.
|
|
22063
|
+
*/
|
|
22064
|
+
|
|
22065
|
+
{
|
|
22066
|
+
var ReactIs = reactIs;
|
|
22067
|
+
|
|
22068
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
22069
|
+
// http://fb.me/prop-types-in-prod
|
|
22070
|
+
var throwOnDirectAccess = true;
|
|
22071
|
+
module.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
|
|
22072
|
+
}
|
|
22073
|
+
});
|
|
22074
|
+
|
|
22075
|
+
var types_1 = createCommonjsModule(function (module, exports) {
|
|
22076
|
+
Object.defineProperty(exports, "__esModule", {
|
|
22077
|
+
value: true
|
|
22078
|
+
});
|
|
22079
|
+
var _dateFormats2 = _interopRequireDefault(dateFormats_1);
|
|
22080
|
+
function _interopRequireDefault(obj) {
|
|
22081
|
+
return obj && obj.__esModule ? obj : {
|
|
22082
|
+
"default": obj
|
|
22083
|
+
};
|
|
22084
|
+
}
|
|
22085
|
+
var reactKeyType = (0, propTypes.oneOfType)([propTypes.string, (0, propTypes.arrayOf)(propTypes.string), propTypes.object, (0, propTypes.arrayOf)(propTypes.object)]);
|
|
22086
|
+
function validateLocation(props, propName) {
|
|
22087
|
+
if (isNaN(props[propName])) {
|
|
22088
|
+
return new Error(propName + ' value must be a number');
|
|
22089
|
+
}
|
|
22090
|
+
if (propName === 'lat' && (props[propName] < -90 || props[propName] > 90)) {
|
|
22091
|
+
return new Error(propName + ' value should be between -90 and 90.');
|
|
22092
|
+
} else if (propName === 'lng' && (props[propName] < -180 || props[propName] > 180)) {
|
|
22093
|
+
return new Error(propName + ' value should be between -180 and 180.');
|
|
22094
|
+
}
|
|
22095
|
+
return null;
|
|
22096
|
+
}
|
|
22097
|
+
var dataFieldValidator = function dataFieldValidator(props, propName, componentName) {
|
|
22098
|
+
var requiredError = new Error(propName + ' supplied to ' + componentName + ' is required. Validation failed.');
|
|
22099
|
+
var propValue = props[propName];
|
|
22100
|
+
if (!propValue) return requiredError;
|
|
22101
|
+
if (typeof propValue !== 'string' && typeof propValue !== 'object' && !Array.isArray(propValue)) {
|
|
22102
|
+
return new Error('Invalid ' + propName + ' supplied to ' + componentName + '. Validation failed.');
|
|
22103
|
+
}
|
|
22104
|
+
if (Array.isArray(propValue) && propValue.length === 0) return requiredError;
|
|
22105
|
+
};
|
|
22106
|
+
var types = {
|
|
22107
|
+
any: propTypes.any,
|
|
22108
|
+
analyticsConfig: (0, propTypes.shape)({
|
|
22109
|
+
emptyQuery: propTypes.bool,
|
|
22110
|
+
suggestionAnalytics: propTypes.bool,
|
|
22111
|
+
userId: propTypes.string,
|
|
22112
|
+
customEvents: propTypes.object
|
|
22113
|
+
}),
|
|
22114
|
+
appbaseConfig: (0, propTypes.shape)({
|
|
22115
|
+
enableQueryRules: propTypes.bool,
|
|
22116
|
+
enableSearchRelevancy: propTypes.bool,
|
|
22117
|
+
recordAnalytics: propTypes.bool,
|
|
22118
|
+
emptyQuery: propTypes.bool,
|
|
22119
|
+
suggestionAnalytics: propTypes.bool,
|
|
22120
|
+
userId: propTypes.string,
|
|
22121
|
+
useCache: propTypes.bool,
|
|
22122
|
+
customEvents: propTypes.object,
|
|
22123
|
+
enableTelemetry: propTypes.bool,
|
|
22124
|
+
queryString: propTypes.object
|
|
22125
|
+
}),
|
|
22126
|
+
bool: propTypes.bool,
|
|
22127
|
+
boolRequired: propTypes.bool.isRequired,
|
|
22128
|
+
components: (0, propTypes.arrayOf)(propTypes.string),
|
|
22129
|
+
children: propTypes.any,
|
|
22130
|
+
data: (0, propTypes.arrayOf)(propTypes.object),
|
|
22131
|
+
dataFieldArray: (0, propTypes.oneOfType)([propTypes.string, (0, propTypes.arrayOf)(propTypes.string)]).isRequired,
|
|
22132
|
+
dataNumberBox: (0, propTypes.shape)({
|
|
22133
|
+
label: propTypes.string,
|
|
22134
|
+
start: propTypes.number.isRequired,
|
|
22135
|
+
end: propTypes.number.isRequired
|
|
22136
|
+
}).isRequired,
|
|
22137
|
+
date: (0, propTypes.oneOfType)([propTypes.string, (0, propTypes.arrayOf)(propTypes.string)]),
|
|
22138
|
+
dateObject: propTypes.object,
|
|
22139
|
+
excludeFields: (0, propTypes.arrayOf)(propTypes.string),
|
|
22140
|
+
fieldWeights: (0, propTypes.arrayOf)(propTypes.number),
|
|
22141
|
+
filterLabel: propTypes.string,
|
|
22142
|
+
func: propTypes.func,
|
|
22143
|
+
funcRequired: propTypes.func.isRequired,
|
|
22144
|
+
fuzziness: (0, propTypes.oneOf)([0, 1, 2, 'AUTO']),
|
|
22145
|
+
headers: propTypes.object,
|
|
22146
|
+
hits: (0, propTypes.arrayOf)(propTypes.object),
|
|
22147
|
+
rawData: propTypes.object,
|
|
22148
|
+
iconPosition: (0, propTypes.oneOf)(['left', 'right']),
|
|
22149
|
+
includeFields: (0, propTypes.arrayOf)(propTypes.string),
|
|
22150
|
+
labelPosition: (0, propTypes.oneOf)(['left', 'right', 'top', 'bottom']),
|
|
22151
|
+
number: propTypes.number,
|
|
22152
|
+
options: (0, propTypes.oneOfType)([(0, propTypes.arrayOf)(propTypes.object), propTypes.object]),
|
|
22153
|
+
paginationAt: (0, propTypes.oneOf)(['top', 'bottom', 'both']),
|
|
22154
|
+
range: (0, propTypes.shape)({
|
|
22155
|
+
start: (0, propTypes.oneOfType)([propTypes.number, propTypes.string, propTypes.object]).isRequired,
|
|
22156
|
+
end: (0, propTypes.oneOfType)([propTypes.number, propTypes.string, propTypes.object]).isRequired
|
|
22157
|
+
}),
|
|
22158
|
+
rangeLabels: (0, propTypes.shape)({
|
|
22159
|
+
start: propTypes.string.isRequired,
|
|
22160
|
+
end: propTypes.string.isRequired
|
|
22161
|
+
}),
|
|
22162
|
+
react: (0, propTypes.shape)({
|
|
22163
|
+
and: reactKeyType,
|
|
22164
|
+
or: reactKeyType,
|
|
22165
|
+
not: reactKeyType
|
|
22166
|
+
}),
|
|
22167
|
+
categorySearchValue: (0, propTypes.shape)({
|
|
22168
|
+
term: propTypes.string,
|
|
22169
|
+
category: propTypes.string
|
|
22170
|
+
}),
|
|
22171
|
+
selectedValues: propTypes.object,
|
|
22172
|
+
selectedValue: (0, propTypes.oneOfType)([propTypes.string, (0, propTypes.arrayOf)(propTypes.string), (0, propTypes.arrayOf)(propTypes.object), propTypes.object, propTypes.number, (0, propTypes.arrayOf)(propTypes.number)]),
|
|
22173
|
+
suggestions: (0, propTypes.arrayOf)(propTypes.object),
|
|
22174
|
+
supportedOrientations: (0, propTypes.oneOf)(['portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right']),
|
|
22175
|
+
tooltipTrigger: (0, propTypes.oneOf)(['hover', 'none', 'focus', 'always']),
|
|
22176
|
+
sortBy: (0, propTypes.oneOf)(['asc', 'desc']),
|
|
22177
|
+
sortOptions: (0, propTypes.arrayOf)((0, propTypes.shape)({
|
|
22178
|
+
label: propTypes.string,
|
|
22179
|
+
dataField: propTypes.string,
|
|
22180
|
+
sortBy: propTypes.string
|
|
22181
|
+
})),
|
|
22182
|
+
sortByWithCount: (0, propTypes.oneOf)(['asc', 'desc', 'count']),
|
|
22183
|
+
stats: (0, propTypes.arrayOf)(propTypes.object),
|
|
22184
|
+
string: propTypes.string,
|
|
22185
|
+
stringArray: (0, propTypes.arrayOf)(propTypes.string),
|
|
22186
|
+
stringOrArray: (0, propTypes.oneOfType)([propTypes.string, (0, propTypes.arrayOf)(propTypes.string)]),
|
|
22187
|
+
stringRequired: propTypes.string.isRequired,
|
|
22188
|
+
style: propTypes.object,
|
|
22189
|
+
themePreset: (0, propTypes.oneOf)(['light', 'dark']),
|
|
22190
|
+
queryFormatDate: (0, propTypes.oneOf)(Object.keys(_dateFormats2["default"])),
|
|
22191
|
+
queryFormatSearch: (0, propTypes.oneOf)(['and', 'or']),
|
|
22192
|
+
queryFormatNumberBox: (0, propTypes.oneOf)(['exact', 'lte', 'gte']),
|
|
22193
|
+
params: propTypes.object.isRequired,
|
|
22194
|
+
props: propTypes.object,
|
|
22195
|
+
rangeLabelsAlign: (0, propTypes.oneOf)(['left', 'right']),
|
|
22196
|
+
title: (0, propTypes.oneOfType)([propTypes.string, propTypes.any]),
|
|
22197
|
+
location: (0, propTypes.shape)({
|
|
22198
|
+
lat: validateLocation,
|
|
22199
|
+
lng: validateLocation
|
|
22200
|
+
}),
|
|
22201
|
+
unit: (0, propTypes.oneOf)(['mi', 'miles', 'yd', 'yards', 'ft', 'feet', 'in', 'inch', 'km', 'kilometers', 'm', 'meters', 'cm', 'centimeters', 'mm', 'millimeters', 'NM', 'nmi', 'nauticalmiles']),
|
|
22202
|
+
aggregationData: propTypes.array,
|
|
22203
|
+
showClearAll: (0, propTypes.oneOf)([constants$1.CLEAR_ALL.NEVER, constants$1.CLEAR_ALL.ALWAYS, constants$1.CLEAR_ALL.DEFAULT, true, false]),
|
|
22204
|
+
componentType: (0, propTypes.oneOf)(Object.values(constants$1.componentTypes)),
|
|
22205
|
+
componentObject: propTypes.object,
|
|
22206
|
+
dataFieldValidator: dataFieldValidator,
|
|
22207
|
+
focusShortcuts: (0, propTypes.oneOfType)([(0, propTypes.arrayOf)(propTypes.string), (0, propTypes.arrayOf)(propTypes.number)]),
|
|
22208
|
+
mongodb: (0, propTypes.shape)({
|
|
22209
|
+
db: propTypes.string,
|
|
22210
|
+
collection: propTypes.string
|
|
22211
|
+
}),
|
|
22212
|
+
calendarInterval: (0, propTypes.oneOf)(['month', 'day', 'year', 'week', 'quarter', 'hour', 'minute']),
|
|
22213
|
+
preferences: propTypes.object,
|
|
22214
|
+
endpoint: (0, propTypes.shape)({
|
|
22215
|
+
url: propTypes.string.isRequired,
|
|
22216
|
+
method: propTypes.string,
|
|
22217
|
+
headers: propTypes.object,
|
|
22218
|
+
body: propTypes.object
|
|
22219
|
+
})
|
|
22220
|
+
};
|
|
22221
|
+
exports["default"] = types;
|
|
22222
|
+
});
|
|
22223
|
+
var types$1 = unwrapExports(types_1);
|
|
22224
|
+
|
|
22225
|
+
var _templateObject$m, _templateObject2$7;
|
|
22226
|
+
var HierarchicalMenuList = styled('ul')(_templateObject$m || (_templateObject$m = _taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 0;\n\toverflow: hidden;\n\n\t&.--open {\n\t\tmax-height: 100%;\n\t}\n"])));
|
|
22227
|
+
var HierarchicalMenuListItem = styled('li')(_templateObject2$7 || (_templateObject2$7 = _taggedTemplateLiteralLoose(["\n\tfont-weight: 400;\n\tline-height: 1.5;\n\tbox-sizing: border-box;\n\n\ta {\n\t\tcolor: #424242;\n\t\ttext-decoration: none;\n\t\tgap: 5px;\n\t\t.--leaf-icon,\n\t\t.--folder-icon {\n\t\t\tline-height: 15px;\n\t\t\tsvg {\n\t\t\t\theight: 15px;\n\t\t\t}\n\t\t}\n\n\t\tinput {\n\t\t\tmargin: 0;\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n\n\t.--switcher-icon {\n\t\ttransition: all 0.2s ease-in;\n\t\tmargin-right: 2px;\n\t}\n\t.--list-child {\n\t\tpadding-left: 1rem;\n\t\tposition: relative;\n\t\t&:before {\n\t\t\theight: 100%;\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\tborder-left: 1px solid #787878;\n\t\t\twidth: 0;\n\t\t\tleft: 19px;\n\t\t\t", ";\n\t\t}\n\n\t\t&.--show-switcher-icon {\n\t\t\tpadding-left: 36px;\n\t\t}\n\t}\n\t.--list-item-label {\n\t\tline-height: 100%;\n\t}\n\t.--list-item-count {\n\t\tmargin-left: 10px;\n\t\tpadding: 0.1rem 0.4rem;\n\t\tfont-size: 0.8rem;\n\t\tcolor: #424242;\n\t\tbackground-color: #dee1e6;\n\t\tborder-radius: 8px;\n\t}\n\t&.-selected-item {\n\t\tfont-weight: 700 !important;\n\t}\n\t&.-expanded-item {\n\t\t& > a {\n\t\t\t& div > .--switcher-icon {\n\t\t\t\ttransform: rotate(90deg);\n\t\t\t}\n\t\t}\n\t}\n\t.--list-item-label-count-wrapper {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\t&:hover {\n\t\t\t.--list-item-count,\n\t\t\t.--list-item-label {\n\t\t\t\tfont-weight: 700;\n\t\t\t}\n\t\t}\n\t}\n"])), function (props) {
|
|
22228
|
+
return !props.showLine && "\n\t\t\t\t\tdisplay: none;\n\t\t\t\t";
|
|
22229
|
+
});
|
|
22230
|
+
|
|
22231
|
+
var HierarchicalMenuListItemComponent = {
|
|
22232
|
+
name: 'HierarchicalMenuListItemComponent',
|
|
22233
|
+
data: function data() {
|
|
22234
|
+
return {
|
|
22235
|
+
isExpanded: false,
|
|
22236
|
+
newParentPath: ''
|
|
22237
|
+
};
|
|
22238
|
+
},
|
|
22239
|
+
created: function created() {
|
|
22240
|
+
var listItemLabel = this.listItem.key;
|
|
22241
|
+
var newParentPath = listItemLabel;
|
|
22242
|
+
if (this.parentPath) {
|
|
22243
|
+
newParentPath = "" + this.parentPath + constants_6$1 + listItemLabel;
|
|
22244
|
+
}
|
|
22245
|
+
this.newParentPath = newParentPath;
|
|
22246
|
+
this.isExpanded = !!helper_6(this.selectedValues, newParentPath, constants_6$1);
|
|
22247
|
+
},
|
|
22248
|
+
watch: {
|
|
22249
|
+
listItem: function listItem(newVal) {
|
|
22250
|
+
if (newVal.initiallyExpanded) {
|
|
22251
|
+
this.isExpanded = newVal.initiallyExpanded;
|
|
22252
|
+
}
|
|
22253
|
+
},
|
|
22254
|
+
selectedValues: function selectedValues(newVal) {
|
|
22255
|
+
this.isExpanded = !!helper_6(newVal, this.newParentPath, constants_6$1);
|
|
22256
|
+
}
|
|
22257
|
+
},
|
|
22258
|
+
props: {
|
|
22259
|
+
parentPath: types$1.string,
|
|
22260
|
+
selectedValues: types$1.rawData,
|
|
22261
|
+
mode: types$1.string,
|
|
22262
|
+
searchTerm: types$1.string,
|
|
22263
|
+
listItem: types$1.rawData,
|
|
22264
|
+
showLine: types$1.bool,
|
|
22265
|
+
renderItem: types$1.func,
|
|
22266
|
+
handleListItemClick: types$1.func,
|
|
22267
|
+
renderSwitcherIcon: types$1.func,
|
|
22268
|
+
showCheckbox: Q.bool,
|
|
22269
|
+
innerClass: types$1.style,
|
|
22270
|
+
showRadio: Q.bool,
|
|
22271
|
+
renderIcon: types$1.func,
|
|
22272
|
+
showCount: Q.bool,
|
|
22273
|
+
showSwitcherIcon: types$1.bool,
|
|
22274
|
+
switcherIcon: types$1.children
|
|
22275
|
+
},
|
|
22276
|
+
render: function render() {
|
|
22277
|
+
var _this = this;
|
|
22278
|
+
var _this$$props = this.$props,
|
|
22279
|
+
selectedValues = _this$$props.selectedValues,
|
|
22280
|
+
mode = _this$$props.mode,
|
|
22281
|
+
searchTerm = _this$$props.searchTerm,
|
|
22282
|
+
listItem = _this$$props.listItem,
|
|
22283
|
+
parentPath = _this$$props.parentPath,
|
|
22284
|
+
showLine = _this$$props.showLine,
|
|
22285
|
+
renderItem = _this$$props.renderItem,
|
|
22286
|
+
handleListItemClick = _this$$props.handleListItemClick,
|
|
22287
|
+
showCheckbox = _this$$props.showCheckbox,
|
|
22288
|
+
innerClass = _this$$props.innerClass,
|
|
22289
|
+
showRadio = _this$$props.showRadio,
|
|
22290
|
+
renderIcon = _this$$props.renderIcon,
|
|
22291
|
+
showCount = _this$$props.showCount,
|
|
22292
|
+
showSwitcherIcon = _this$$props.showSwitcherIcon;
|
|
22293
|
+
if (!(listItem instanceof Object) || Object.keys(listItem).length === 0) {
|
|
22294
|
+
return null;
|
|
22295
|
+
}
|
|
22296
|
+
var listItemLabel = listItem.key;
|
|
22297
|
+
var listItemCount = listItem.count;
|
|
22298
|
+
var isLeafNode = !(Array.isArray(listItem.list) && listItem.list.length > 0);
|
|
22299
|
+
var renderSwitcherIcon = function renderSwitcherIcon(isExpandedProp) {
|
|
22300
|
+
if (showSwitcherIcon === false) {
|
|
22301
|
+
return null;
|
|
22302
|
+
}
|
|
22303
|
+
var switcherIcon = _this.$props.switcherIcon;
|
|
22304
|
+
if (switcherIcon) return switcherIcon(isExpandedProp);
|
|
22305
|
+
return (
|
|
22306
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events
|
|
22307
|
+
, jsx-a11y/no-static-element-interactions,jsx-a11y/no-noninteractive-tabindex */
|
|
22308
|
+
vue.createVNode("span", {
|
|
22309
|
+
"tabIndex": "0",
|
|
22310
|
+
"onClick": function onClick(e) {
|
|
22311
|
+
e.stopPropagation();
|
|
22312
|
+
_this.isExpanded = !_this.isExpanded;
|
|
22313
|
+
},
|
|
22314
|
+
"class": "--switcher-icon"
|
|
22315
|
+
}, [vue.createTextVNode("\u27A4")])
|
|
22316
|
+
);
|
|
22317
|
+
};
|
|
22318
|
+
var isSelected = false;
|
|
22319
|
+
if (mode === 'single') {
|
|
22320
|
+
if (helper_6(selectedValues, this.newParentPath, constants_6$1) === true) {
|
|
22321
|
+
isSelected = true;
|
|
22322
|
+
}
|
|
22323
|
+
} else {
|
|
22324
|
+
isSelected = !!helper_6(selectedValues, this.newParentPath, constants_6$1);
|
|
22325
|
+
}
|
|
22326
|
+
return vue.createVNode(HierarchicalMenuListItem, {
|
|
22327
|
+
"class": (isSelected ? '-selected-item' : '') + " " + (this.isExpanded ? '-expanded-item' : ''),
|
|
22328
|
+
"key": this.newParentPath,
|
|
22329
|
+
"showLine": showLine
|
|
22330
|
+
}, {
|
|
22331
|
+
"default": function _default() {
|
|
22332
|
+
return [vue.createVNode(ListItem, {
|
|
22333
|
+
"isTreeListItem": true,
|
|
22334
|
+
"onClick": function onClick() {
|
|
22335
|
+
handleListItemClick(listItemLabel, parentPath);
|
|
22336
|
+
},
|
|
22337
|
+
"style": {
|
|
22338
|
+
textDecoration: 'none'
|
|
22339
|
+
}
|
|
22340
|
+
}, {
|
|
22341
|
+
"default": function _default() {
|
|
22342
|
+
return [renderItem ? renderItem(listItemLabel, listItemCount, isSelected) : vue.createVNode(Flex, {
|
|
22343
|
+
"alignItems": "center",
|
|
22344
|
+
"gap": "5px"
|
|
22345
|
+
}, {
|
|
22346
|
+
"default": function _default() {
|
|
22347
|
+
return [!isLeafNode && renderSwitcherIcon(isSelected), mode === 'multiple' && showCheckbox && vue.createVNode(Flex, {
|
|
22348
|
+
"alignItems": "center",
|
|
22349
|
+
"gap": "5px"
|
|
22350
|
+
}, {
|
|
22351
|
+
"default": function _default() {
|
|
22352
|
+
return [vue.createVNode(Checkbox, {
|
|
22353
|
+
"type": "checkbox",
|
|
22354
|
+
"class": helper_28(innerClass, 'checkbox') || null,
|
|
22355
|
+
"checked": isSelected,
|
|
22356
|
+
"id": listItemLabel + "-checkbox-" + _this.newParentPath,
|
|
22357
|
+
"name": listItemLabel + "-checkbox-" + _this.newParentPath,
|
|
22358
|
+
"show": true,
|
|
22359
|
+
"readOnly": true
|
|
22360
|
+
}, null), vue.createVNode("label", {
|
|
22361
|
+
"style": {
|
|
22362
|
+
width: '26px',
|
|
22363
|
+
marginTop: 0,
|
|
22364
|
+
marginBottom: 0,
|
|
22365
|
+
marginRight: '-9px',
|
|
22366
|
+
left: '-3px'
|
|
22367
|
+
},
|
|
22368
|
+
"htmlFor": listItemLabel + "-checkbox-" + _this.newParentPath,
|
|
22369
|
+
"onClick": function onClick(e) {
|
|
22370
|
+
e.stopPropagation();
|
|
22371
|
+
}
|
|
22372
|
+
}, null)];
|
|
22373
|
+
}
|
|
22374
|
+
}), mode === 'single' && showRadio && vue.createVNode(Flex, {
|
|
22375
|
+
"alignItems": "center",
|
|
22376
|
+
"gap": "5px"
|
|
22377
|
+
}, {
|
|
22378
|
+
"default": function _default() {
|
|
22379
|
+
return [vue.createVNode(Radio, {
|
|
22380
|
+
"checked": isSelected,
|
|
22381
|
+
"class": helper_28(innerClass, 'radio') || null,
|
|
22382
|
+
"id": listItemLabel + "-radio-" + _this.newParentPath,
|
|
22383
|
+
"name": listItemLabel + "-radio-" + _this.newParentPath,
|
|
22384
|
+
"show": true,
|
|
22385
|
+
"readOnly": true,
|
|
22386
|
+
"type": "radio"
|
|
22387
|
+
}, null), vue.createVNode("label", {
|
|
22388
|
+
"style": {
|
|
22389
|
+
width: '26px',
|
|
22390
|
+
marginTop: 0,
|
|
22391
|
+
marginBottom: 0,
|
|
22392
|
+
marginRight: '-9px',
|
|
22393
|
+
left: '-3px'
|
|
22394
|
+
},
|
|
22395
|
+
"htmlFor": listItemLabel + "-radio-" + _this.newParentPath,
|
|
22396
|
+
"onClick": function onClick(e) {
|
|
22397
|
+
e.stopPropagation();
|
|
22398
|
+
}
|
|
22399
|
+
}, null)];
|
|
22400
|
+
}
|
|
22401
|
+
}), ' ', renderIcon(isLeafNode), vue.createVNode("div", {
|
|
22402
|
+
"class": "--list-item-label-count-wrapper"
|
|
22403
|
+
}, [vue.createVNode("span", {
|
|
22404
|
+
"class": "--list-item-label " + (helper_28(innerClass, 'label') || '')
|
|
22405
|
+
}, [listItemLabel]), showCount && vue.createVNode("span", {
|
|
22406
|
+
"class": "--list-item-count " + (helper_28(innerClass, 'count') || '')
|
|
22407
|
+
}, [listItemCount])])];
|
|
22408
|
+
}
|
|
22409
|
+
})];
|
|
22410
|
+
}
|
|
22411
|
+
}), isLeafNode === false && vue.createVNode("div", {
|
|
22412
|
+
"class": "--list-child " + (showSwitcherIcon ? ' --show-switcher-icon' : '')
|
|
22413
|
+
}, [vue.createVNode(HierarchicalMenuComponent, {
|
|
22414
|
+
"key": _this.newParentPath + "-" + listItemLabel + "-" + listItemCount,
|
|
22415
|
+
"listArray": listItem.list,
|
|
22416
|
+
"parentPath": _this.newParentPath,
|
|
22417
|
+
"isExpanded": _this.isExpanded,
|
|
22418
|
+
"listItemProps": {
|
|
22419
|
+
mode: mode,
|
|
22420
|
+
selectedValues: selectedValues,
|
|
22421
|
+
searchTerm: searchTerm,
|
|
22422
|
+
showLine: showLine,
|
|
22423
|
+
renderItem: renderItem,
|
|
22424
|
+
handleListItemClick: handleListItemClick,
|
|
22425
|
+
renderSwitcherIcon: renderSwitcherIcon,
|
|
22426
|
+
showCheckbox: showCheckbox,
|
|
22427
|
+
innerClass: innerClass,
|
|
22428
|
+
showRadio: showRadio,
|
|
22429
|
+
renderIcon: renderIcon,
|
|
22430
|
+
showCount: showCount,
|
|
22431
|
+
showSwitcherIcon: showSwitcherIcon,
|
|
22432
|
+
switcherIcon: _this.$props.switcherIcon
|
|
22433
|
+
}
|
|
22434
|
+
}, null)])];
|
|
22435
|
+
}
|
|
22436
|
+
});
|
|
22437
|
+
}
|
|
22438
|
+
};
|
|
22439
|
+
|
|
22440
|
+
function _isSlot$6(s) {
|
|
22441
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
22442
|
+
}
|
|
22443
|
+
var HierarchicalMenuComponent = {
|
|
22444
|
+
name: 'HierarchicalMenuComponent',
|
|
22445
|
+
props: {
|
|
22446
|
+
listArray: Q.arrayOf(Q.object),
|
|
22447
|
+
// array of objects
|
|
22448
|
+
parentPath: Q.string.def(''),
|
|
22449
|
+
isExpanded: Q.bool.def(false),
|
|
22450
|
+
listItemProps: types$1.rawData
|
|
22451
|
+
},
|
|
22452
|
+
render: function render() {
|
|
22453
|
+
var _slot;
|
|
22454
|
+
var _this$$props = this.$props,
|
|
22455
|
+
listArray = _this$$props.listArray,
|
|
22456
|
+
isExpanded = _this$$props.isExpanded,
|
|
22457
|
+
parentPath = _this$$props.parentPath,
|
|
22458
|
+
listItemProps = _this$$props.listItemProps;
|
|
22459
|
+
if (!Array.isArray(listArray) || listArray.length === 0) {
|
|
22460
|
+
return null;
|
|
22461
|
+
}
|
|
22462
|
+
return vue.createVNode(HierarchicalMenuList, {
|
|
22463
|
+
"class": "" + (isExpanded ? '--open' : ''),
|
|
22464
|
+
"isSelected": isExpanded
|
|
22465
|
+
}, _isSlot$6(_slot = listArray.map(function (listItem) {
|
|
22466
|
+
return vue.createVNode(HierarchicalMenuListItemComponent, vue.mergeProps({
|
|
22467
|
+
"key": parentPath + "__" + JSON.stringify(listItem),
|
|
22468
|
+
"parentPath": parentPath,
|
|
22469
|
+
"listItem": listItem
|
|
22470
|
+
}, listItemProps), null);
|
|
22471
|
+
})) ? _slot : {
|
|
22472
|
+
"default": function _default() {
|
|
22473
|
+
return [_slot];
|
|
22474
|
+
}
|
|
22475
|
+
});
|
|
22476
|
+
}
|
|
22477
|
+
};
|
|
22478
|
+
|
|
22479
|
+
function _isSlot$7(s) {
|
|
22480
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
22481
|
+
}
|
|
22482
|
+
var updateQueryAction = lib_5.updateQuery,
|
|
22483
|
+
setQueryOptions$3 = lib_5.setQueryOptions;
|
|
22484
|
+
var transformValueIntoLocalState = function transformValueIntoLocalState(valueArray) {
|
|
22485
|
+
var valueToSet = {};
|
|
22486
|
+
if (valueArray.length) {
|
|
22487
|
+
var newSelectedValues = {};
|
|
22488
|
+
valueArray.forEach(function (valueItem) {
|
|
22489
|
+
helper_48(newSelectedValues, valueItem.split(' > '), !helper_6(newSelectedValues, valueItem.split(' > '), constants_6$1), true);
|
|
22490
|
+
});
|
|
22491
|
+
valueToSet = newSelectedValues;
|
|
22492
|
+
}
|
|
22493
|
+
return valueToSet;
|
|
22494
|
+
};
|
|
22495
|
+
var TreeList = {
|
|
22496
|
+
name: 'TreeList',
|
|
22497
|
+
props: {
|
|
22498
|
+
selectedValue: types.selectedValue,
|
|
22499
|
+
error: types.title,
|
|
22500
|
+
rawData: types.rawData,
|
|
22501
|
+
aggregationData: types.rawData,
|
|
22502
|
+
themePreset: types.themePreset,
|
|
22503
|
+
updateQueryAction: types.funcRequired,
|
|
22504
|
+
setQueryOptions: types.funcRequired,
|
|
22505
|
+
// component props
|
|
22506
|
+
componentId: types.string.isRequired,
|
|
22507
|
+
className: types.string,
|
|
22508
|
+
style: types.style,
|
|
22509
|
+
showRadio: Q.bool.def(false),
|
|
22510
|
+
showCheckbox: types.bool.def(false),
|
|
22511
|
+
mode: Q.oneOf(['single', 'multiple']).def('multiple'),
|
|
22512
|
+
showCount: Q.bool.def(false),
|
|
22513
|
+
showSearch: Q.bool.def(false),
|
|
22514
|
+
showIcon: Q.bool.def(false),
|
|
22515
|
+
icon: types.children,
|
|
22516
|
+
showLeafIcon: Q.bool.def(false),
|
|
22517
|
+
leafIcon: types.children,
|
|
22518
|
+
showLine: Q.bool.def(false),
|
|
22519
|
+
switcherIcon: types.func,
|
|
22520
|
+
render: types.func,
|
|
22521
|
+
renderItem: types.func,
|
|
22522
|
+
innerClass: types.style,
|
|
22523
|
+
placeholder: types.string,
|
|
22524
|
+
title: types.title,
|
|
22525
|
+
isLoading: types.bool,
|
|
22526
|
+
dataField: types.stringArray.isRequired,
|
|
22527
|
+
onQueryChange: types.func,
|
|
22528
|
+
defaultValue: types.stringArray,
|
|
22529
|
+
value: types.stringArray,
|
|
22530
|
+
customQuery: types.func,
|
|
22531
|
+
defaultQuery: types.func,
|
|
22532
|
+
enableAppbase: types.bool,
|
|
22533
|
+
index: types.string,
|
|
22534
|
+
showFilter: types.bool,
|
|
22535
|
+
URLParams: types.bool,
|
|
22536
|
+
filterLabel: types.string,
|
|
22537
|
+
onChange: types.func,
|
|
22538
|
+
onValueChange: types.func,
|
|
22539
|
+
beforeValueChange: types.func,
|
|
22540
|
+
sortBy: types.sortByWithCount.def('count'),
|
|
22541
|
+
onError: types.func,
|
|
22542
|
+
showSwitcherIcon: types.bool.def(true),
|
|
22543
|
+
renderError: types.title,
|
|
22544
|
+
renderNoResults: types.func,
|
|
22545
|
+
loader: types.title,
|
|
22546
|
+
aggergationSize: types.number,
|
|
22547
|
+
endpoint: types.endpoint,
|
|
22548
|
+
queryFormat: types.queryFormatSearch.def('or'),
|
|
22549
|
+
size: types.number.def(100),
|
|
22550
|
+
nestedField: types.string,
|
|
22551
|
+
react: types.react,
|
|
22552
|
+
transformData: types.func,
|
|
22553
|
+
selectAllLabel: types.string,
|
|
22554
|
+
showMissing: Q.bool.def(false),
|
|
22555
|
+
missingLabel: Q.string.def('N/A')
|
|
22556
|
+
},
|
|
22557
|
+
data: function data() {
|
|
22558
|
+
var props = this.$props;
|
|
22559
|
+
this.__state = {
|
|
22560
|
+
selectedValues: {},
|
|
22561
|
+
searchTerm: '',
|
|
22562
|
+
aggregationData: []
|
|
22563
|
+
};
|
|
22564
|
+
this.internalComponent = props.componentId + "__internal";
|
|
22565
|
+
return this.__state;
|
|
22566
|
+
},
|
|
22567
|
+
created: function created() {
|
|
22568
|
+
var props = this.$props;
|
|
22569
|
+
var componentId = props.componentId;
|
|
22570
|
+
var defaultValue = this.defaultValue || this.value;
|
|
22571
|
+
var currentValueArray = this.selectedValue || defaultValue || [];
|
|
22572
|
+
// update local state for selected values
|
|
22573
|
+
if (currentValueArray.length) {
|
|
22574
|
+
var newSelectedValues = transformValueIntoLocalState(currentValueArray);
|
|
22575
|
+
this.setValue(newSelectedValues, true);
|
|
22576
|
+
}
|
|
22577
|
+
|
|
22578
|
+
// Set custom and default queries in store
|
|
22579
|
+
helper_32(componentId, props, currentValueArray);
|
|
22580
|
+
helper_31(componentId, props, currentValueArray);
|
|
22581
|
+
this.updateQueryOptions();
|
|
22582
|
+
},
|
|
22583
|
+
mounted: function mounted() {
|
|
22584
|
+
var _this$$props = this.$props,
|
|
22585
|
+
enableAppbase = _this$$props.enableAppbase,
|
|
22586
|
+
index = _this$$props.index;
|
|
22587
|
+
if (!enableAppbase && index) {
|
|
22588
|
+
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
22589
|
+
}
|
|
22590
|
+
},
|
|
22591
|
+
watch: {
|
|
22592
|
+
defaultQuery: function defaultQuery() {
|
|
22593
|
+
this.updateDefaultQuery();
|
|
22594
|
+
this.updateQuery([]);
|
|
22595
|
+
},
|
|
22596
|
+
customQuery: function customQuery() {
|
|
22597
|
+
var valueArray = helper_4(this.$data.selectedValues) || [];
|
|
22598
|
+
this.updateQuery(valueArray);
|
|
22599
|
+
},
|
|
22600
|
+
sortBy: function sortBy() {
|
|
22601
|
+
this.updateQueryOptions();
|
|
22602
|
+
},
|
|
22603
|
+
dataField: function dataField() {
|
|
22604
|
+
var valueArray = helper_4(this.$data.selectedValues) || [];
|
|
22605
|
+
this.updateQueryOptions();
|
|
22606
|
+
this.updateQuery(valueArray);
|
|
22607
|
+
},
|
|
22608
|
+
value: function value(newVal, oldVal) {
|
|
22609
|
+
if (!helper_33(newVal, oldVal)) {
|
|
22610
|
+
this.setValue(newVal);
|
|
22611
|
+
}
|
|
22612
|
+
},
|
|
22613
|
+
selectedValue: function selectedValue(newVal) {
|
|
22614
|
+
if (!helper_33(helper_4(this.$data.selectedValues), newVal)) {
|
|
22615
|
+
var _this$$props2 = this.$props,
|
|
22616
|
+
value = _this$$props2.value,
|
|
22617
|
+
onChange = _this$$props2.onChange;
|
|
22618
|
+
var valueToSet = [];
|
|
22619
|
+
if (Array.isArray(newVal) && newVal.length) {
|
|
22620
|
+
valueToSet = newVal;
|
|
22621
|
+
}
|
|
22622
|
+
if (value === undefined) {
|
|
22623
|
+
this.setValue(valueToSet);
|
|
22624
|
+
} else if (onChange && !helper_33(value, valueToSet)) {
|
|
22625
|
+
onChange(valueToSet);
|
|
22626
|
+
}
|
|
22627
|
+
}
|
|
22628
|
+
},
|
|
22629
|
+
aggregationData: function aggregationData(newVal, oldVal) {
|
|
22630
|
+
if (newVal && !helper_33(newVal, oldVal)) {
|
|
22631
|
+
this.$data.aggregationData = newVal;
|
|
22632
|
+
}
|
|
22633
|
+
}
|
|
22634
|
+
},
|
|
22635
|
+
computed: {
|
|
22636
|
+
hasCustomRenderer: function hasCustomRenderer$1() {
|
|
22637
|
+
return hasCustomRenderer(this);
|
|
22638
|
+
}
|
|
22639
|
+
},
|
|
22640
|
+
methods: {
|
|
22641
|
+
renderIcon: function renderIcon(isLeafNode) {
|
|
22642
|
+
var _this$$props3 = this.$props,
|
|
22643
|
+
showIcon = _this$$props3.showIcon,
|
|
22644
|
+
showLeafIcon = _this$$props3.showLeafIcon,
|
|
22645
|
+
icon = _this$$props3.icon;
|
|
22646
|
+
if (isLeafNode) {
|
|
22647
|
+
if (!showLeafIcon) return null;
|
|
22648
|
+
var _ref = this.$slots || this.$props,
|
|
22649
|
+
leafIcon = _ref.leafIcon;
|
|
22650
|
+
if (leafIcon) return leafIcon();
|
|
22651
|
+
return vue.createVNode("span", {
|
|
22652
|
+
"role": "img",
|
|
22653
|
+
"aria-label": "file",
|
|
22654
|
+
"class": "--leaf-icon"
|
|
22655
|
+
}, [vue.createVNode("svg", {
|
|
22656
|
+
"viewBox": "64 64 896 896",
|
|
22657
|
+
"focusable": "false",
|
|
22658
|
+
"data-icon": "file",
|
|
22659
|
+
"width": "1em",
|
|
22660
|
+
"height": "1em",
|
|
22661
|
+
"fill": "currentColor",
|
|
22662
|
+
"aria-hidden": "true"
|
|
22663
|
+
}, [vue.createVNode("path", {
|
|
22664
|
+
"d": "M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"
|
|
22665
|
+
}, null)])]);
|
|
22666
|
+
}
|
|
22667
|
+
if (!showIcon) return null;
|
|
22668
|
+
if (icon) {
|
|
22669
|
+
return icon;
|
|
22670
|
+
}
|
|
22671
|
+
if (this.$slots.icon) {
|
|
22672
|
+
return this.$slots.icon();
|
|
22673
|
+
}
|
|
22674
|
+
return vue.createVNode("span", {
|
|
22675
|
+
"role": "img",
|
|
22676
|
+
"aria-label": "folder-open",
|
|
22677
|
+
"class": "--folder-icon"
|
|
22678
|
+
}, [vue.createVNode("svg", {
|
|
22679
|
+
"viewBox": "64 64 896 896",
|
|
22680
|
+
"focusable": "false",
|
|
22681
|
+
"data-icon": "folder-open",
|
|
22682
|
+
"width": "1em",
|
|
22683
|
+
"height": "1em",
|
|
22684
|
+
"fill": "currentColor",
|
|
22685
|
+
"aria-hidden": "true"
|
|
22686
|
+
}, [vue.createVNode("path", {
|
|
22687
|
+
"d": "M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"
|
|
22688
|
+
}, null)])]);
|
|
22689
|
+
},
|
|
22690
|
+
getTransformedData: function getTransformedData() {
|
|
22691
|
+
var _this$$props4 = this.$props,
|
|
22692
|
+
dataField = _this$$props4.dataField,
|
|
22693
|
+
showSearch = _this$$props4.showSearch;
|
|
22694
|
+
var transformedData = helper_5(this.$data.aggregationData, dataField);
|
|
22695
|
+
var filteredData = [];
|
|
22696
|
+
if (showSearch && this.searchTerm) {
|
|
22697
|
+
filteredData = this.filterDataBasedOnSearchTerm(transformedData, '');
|
|
22698
|
+
}
|
|
22699
|
+
return filteredData.length ? filteredData : transformedData;
|
|
22700
|
+
},
|
|
22701
|
+
handleInputChange: function handleInputChange(e) {
|
|
22702
|
+
var value = e.target.value;
|
|
22703
|
+
this.searchTerm = value;
|
|
22704
|
+
},
|
|
22705
|
+
renderSearch: function renderSearch() {
|
|
22706
|
+
var _this$$props5 = this.$props,
|
|
22707
|
+
showSearch = _this$$props5.showSearch,
|
|
22708
|
+
innerClass = _this$$props5.innerClass,
|
|
22709
|
+
placeholder = _this$$props5.placeholder,
|
|
22710
|
+
componentId = _this$$props5.componentId,
|
|
22711
|
+
themePreset = _this$$props5.themePreset;
|
|
22712
|
+
if (showSearch) {
|
|
22713
|
+
return vue.createVNode(Input, {
|
|
22714
|
+
"class": helper_28(innerClass, 'input') || null,
|
|
22715
|
+
"onInput": this.handleInputChange,
|
|
22716
|
+
"value": this.searchTerm,
|
|
22717
|
+
"placeholder": placeholder || 'Search',
|
|
22718
|
+
"style": {
|
|
22719
|
+
margin: '0 0 8px'
|
|
22720
|
+
},
|
|
22721
|
+
"aria-label": componentId + "-search",
|
|
22722
|
+
"themePreset": themePreset
|
|
22723
|
+
}, null);
|
|
22724
|
+
}
|
|
22725
|
+
return null;
|
|
22726
|
+
},
|
|
22727
|
+
handleListItemClick: function handleListItemClick(key, parentPath) {
|
|
22728
|
+
var path = key;
|
|
22729
|
+
if (parentPath) {
|
|
22730
|
+
path = "" + parentPath + constants_6$1 + key;
|
|
22731
|
+
}
|
|
22732
|
+
var newSelectedValues = _extends({}, this.selectedValues);
|
|
22733
|
+
if (this.$props.mode === 'single') {
|
|
22734
|
+
newSelectedValues = {};
|
|
22735
|
+
helper_48(newSelectedValues, path.split(constants_6$1), true, true);
|
|
22736
|
+
} else {
|
|
22737
|
+
var newValue = !helper_6(newSelectedValues, path, constants_6$1);
|
|
22738
|
+
helper_48(newSelectedValues, path.split(constants_6$1), newValue, true);
|
|
22739
|
+
}
|
|
22740
|
+
newSelectedValues = sanitizeObject(_extends({}, newSelectedValues));
|
|
22741
|
+
if (this.$props.value === undefined) {
|
|
22742
|
+
this.setValue(newSelectedValues);
|
|
22743
|
+
} else if (this.$props.onChange) {
|
|
22744
|
+
var valueToSet = helper_4(newSelectedValues);
|
|
22745
|
+
this.$props.onChange(valueToSet);
|
|
22746
|
+
}
|
|
22747
|
+
},
|
|
22748
|
+
filterDataBasedOnSearchTerm: function filterDataBasedOnSearchTerm(listArray, parentPath) {
|
|
22749
|
+
var _this = this;
|
|
22750
|
+
if (!(listArray && Array.isArray(listArray) && listArray.length)) {
|
|
22751
|
+
return null;
|
|
22752
|
+
}
|
|
22753
|
+
var result = [];
|
|
22754
|
+
listArray.forEach(function (ele) {
|
|
22755
|
+
var isLeafItem = !ele.list;
|
|
22756
|
+
var newParentPath = ele.key;
|
|
22757
|
+
if (parentPath) {
|
|
22758
|
+
newParentPath = parentPath + "." + ele.key;
|
|
22759
|
+
}
|
|
22760
|
+
var keyHasSearchTerm = suggestions_1(ele.key).toLowerCase().includes(suggestions_1(_this.$data.searchTerm).toLowerCase()) || helper_6(_this.$data.selectedValues, newParentPath, constants_6$1);
|
|
22761
|
+
if (isLeafItem && keyHasSearchTerm) {
|
|
22762
|
+
result.push(_extends({}, ele, {
|
|
22763
|
+
initiallyExpanded: keyHasSearchTerm
|
|
22764
|
+
}));
|
|
22765
|
+
} else if (!isLeafItem) {
|
|
22766
|
+
var filteredChildrenItems = _this.filterDataBasedOnSearchTerm(ele.list, newParentPath);
|
|
22767
|
+
if (keyHasSearchTerm || !!filteredChildrenItems.length) {
|
|
22768
|
+
result.push(_extends({}, ele, {
|
|
22769
|
+
initiallyExpanded: keyHasSearchTerm || !!filteredChildrenItems.length,
|
|
22770
|
+
list: filteredChildrenItems
|
|
22771
|
+
}));
|
|
22772
|
+
}
|
|
22773
|
+
}
|
|
22774
|
+
});
|
|
22775
|
+
return result;
|
|
22776
|
+
},
|
|
22777
|
+
getComponent: function getComponent() {
|
|
22778
|
+
var _this$$props6 = this.$props,
|
|
22779
|
+
rawData = _this$$props6.rawData,
|
|
22780
|
+
error = _this$$props6.error,
|
|
22781
|
+
isLoading = _this$$props6.isLoading;
|
|
22782
|
+
var data = {
|
|
22783
|
+
data: this.getTransformedData(),
|
|
22784
|
+
rawData: rawData,
|
|
22785
|
+
error: error,
|
|
22786
|
+
handleClick: this.handleListItemClick,
|
|
22787
|
+
value: this.$data.selectedValues,
|
|
22788
|
+
loading: isLoading,
|
|
22789
|
+
PATH_SEPARATOR: constants_6$1
|
|
22790
|
+
};
|
|
22791
|
+
return this.$slots.render(data) || helper_8(data, this.$props);
|
|
22792
|
+
},
|
|
22793
|
+
getDefaultQuery: function getDefaultQuery(value) {
|
|
22794
|
+
var _this2 = this;
|
|
22795
|
+
var query = null;
|
|
22796
|
+
var type = 'term';
|
|
22797
|
+
var booleanAggregator = this.$props.queryFormat === 'or' ? 'should' : 'must';
|
|
22798
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
22799
|
+
return null;
|
|
22800
|
+
}
|
|
22801
|
+
if (value) {
|
|
22802
|
+
var _bool;
|
|
22803
|
+
// adds a sub-query with must as an array of objects for each term/value
|
|
22804
|
+
var queryArray = value.map(function (item) {
|
|
22805
|
+
return {
|
|
22806
|
+
bool: {
|
|
22807
|
+
must: item.split(' > ').map(function (subItem, i) {
|
|
22808
|
+
var _type, _ref2;
|
|
22809
|
+
return _ref2 = {}, _ref2[type] = (_type = {}, _type[_this2.$props.dataField[i]] = subItem, _type), _ref2;
|
|
22810
|
+
})
|
|
22811
|
+
}
|
|
22812
|
+
};
|
|
22813
|
+
});
|
|
22814
|
+
var listQuery = {
|
|
22815
|
+
bool: (_bool = {}, _bool[booleanAggregator] = queryArray, _bool)
|
|
22816
|
+
};
|
|
22817
|
+
query = value.length ? listQuery : null;
|
|
22818
|
+
}
|
|
22819
|
+
if (query && this.$props.nestedField) {
|
|
22820
|
+
return {
|
|
22821
|
+
nested: {
|
|
22822
|
+
path: this.$props.nestedField,
|
|
22823
|
+
query: query
|
|
22824
|
+
}
|
|
22825
|
+
};
|
|
22826
|
+
}
|
|
22827
|
+
return query;
|
|
22828
|
+
},
|
|
22829
|
+
updateQuery: function updateQuery(value) {
|
|
22830
|
+
var customQuery = this.$props.customQuery;
|
|
22831
|
+
var query = this.getDefaultQuery(value);
|
|
22832
|
+
var customQueryOptions;
|
|
22833
|
+
if (customQuery) {
|
|
22834
|
+
var _ref3 = customQuery(value, this.$props) || {};
|
|
22835
|
+
query = _ref3.query;
|
|
22836
|
+
customQueryOptions = helper_24(customQuery(value, this.$props));
|
|
22837
|
+
helper_32(this.$props.componentId, this.$props, value);
|
|
22838
|
+
}
|
|
22839
|
+
this.setQueryOptions(this.$props.componentId, _extends({}, this.generateQueryOptions(), customQueryOptions));
|
|
22840
|
+
this.updateQueryAction({
|
|
22841
|
+
componentId: this.$props.componentId,
|
|
22842
|
+
query: query,
|
|
22843
|
+
value: value,
|
|
22844
|
+
label: this.$props.filterLabel,
|
|
22845
|
+
showFilter: this.$props.showFilter,
|
|
22846
|
+
URLParams: this.$props.URLParams,
|
|
22847
|
+
componentType: constants_1$1.treeList
|
|
22848
|
+
});
|
|
22849
|
+
},
|
|
22850
|
+
setValue: function setValue(value, hasMountedParam) {
|
|
22851
|
+
var _this3 = this;
|
|
22852
|
+
if (hasMountedParam === void 0) {
|
|
22853
|
+
hasMountedParam = true;
|
|
22854
|
+
}
|
|
22855
|
+
var finalValues = Array.isArray(value) === false ? helper_4(value) : value;
|
|
22856
|
+
var performUpdate = function performUpdate() {
|
|
22857
|
+
var handleUpdates = function handleUpdates() {
|
|
22858
|
+
_this3.updateQuery(finalValues);
|
|
22859
|
+
if (_this3.$props.onValueChange) _this3.$props.onValueChange(finalValues);
|
|
22860
|
+
};
|
|
22861
|
+
if (hasMountedParam) {
|
|
22862
|
+
_this3.selectedValues = Array.isArray(value) ? transformValueIntoLocalState(value) : value;
|
|
22863
|
+
handleUpdates();
|
|
22864
|
+
} else {
|
|
22865
|
+
handleUpdates();
|
|
22866
|
+
}
|
|
22867
|
+
};
|
|
22868
|
+
helper_39(this.$props.componentId, finalValues, this.$props.beforeValueChange, performUpdate);
|
|
22869
|
+
},
|
|
22870
|
+
generateQueryOptions: function generateQueryOptions() {
|
|
22871
|
+
var queryOptions = helper_36(this.$props);
|
|
22872
|
+
var valueArray = helper_4(this.selectedValues);
|
|
22873
|
+
return helper_17(valueArray, queryOptions, this.$props);
|
|
22874
|
+
},
|
|
22875
|
+
updateDefaultQuery: function updateDefaultQuery(queryOptions) {
|
|
22876
|
+
var value = helper_4(this.selectedValues);
|
|
22877
|
+
// Update default query for RS API
|
|
22878
|
+
helper_31(this.$props.componentId, this.$props, value);
|
|
22879
|
+
helper_19(transform_11(this.$props.componentId), queryOptions, value, this.$props, this.generateQueryOptions(), null);
|
|
22880
|
+
},
|
|
22881
|
+
updateQueryOptions: function updateQueryOptions() {
|
|
22882
|
+
// for a new query due to other changes don't append after to get fresh results
|
|
22883
|
+
var queryOptions = this.generateQueryOptions(this.$props, {}, helper_4(this.$data.selectedValues));
|
|
22884
|
+
if (this.$props.defaultQuery) {
|
|
22885
|
+
// eslint-disable-next-line no-use-before-define
|
|
22886
|
+
this.updateDefaultQuery(queryOptions);
|
|
22887
|
+
} else {
|
|
22888
|
+
this.setQueryOptions(transform_11(this.$props.componentId), queryOptions);
|
|
22889
|
+
}
|
|
22890
|
+
}
|
|
22891
|
+
},
|
|
22892
|
+
render: function render() {
|
|
22893
|
+
var _this4 = this;
|
|
22894
|
+
var props = this.$props;
|
|
22895
|
+
var style = props.style,
|
|
22896
|
+
className = props.className,
|
|
22897
|
+
mode = props.mode,
|
|
22898
|
+
showLine = props.showLine,
|
|
22899
|
+
renderItem = props.renderItem,
|
|
22900
|
+
showCheckbox = props.showCheckbox,
|
|
22901
|
+
innerClass = props.innerClass,
|
|
22902
|
+
showRadio = props.showRadio,
|
|
22903
|
+
showCount = props.showCount,
|
|
22904
|
+
showSwitcherIcon = props.showSwitcherIcon,
|
|
22905
|
+
switcherIcon = props.switcherIcon,
|
|
22906
|
+
title = props.title,
|
|
22907
|
+
loader = props.loader,
|
|
22908
|
+
renderError = props.renderError;
|
|
22909
|
+
if (this.isLoading) {
|
|
22910
|
+
return (this.$slots.loader ? this.$slots.loader() : loader) || null;
|
|
22911
|
+
}
|
|
22912
|
+
if (this.error) {
|
|
22913
|
+
if (this.$slots.renderError) {
|
|
22914
|
+
return this.$slots.renderError(this.error);
|
|
22915
|
+
}
|
|
22916
|
+
return helper_9(renderError) ? renderError(this.error) : renderError;
|
|
22917
|
+
}
|
|
22918
|
+
var transformedData = this.getTransformedData();
|
|
22919
|
+
if (!transformedData || transformedData.length === 0) {
|
|
22920
|
+
return this.$slots.renderNoResults ? this.$slots.renderNoResults() : null;
|
|
22921
|
+
}
|
|
22922
|
+
return vue.createVNode(Container, {
|
|
22923
|
+
"style": style,
|
|
22924
|
+
"class": className
|
|
22925
|
+
}, {
|
|
22926
|
+
"default": function _default() {
|
|
22927
|
+
return [props.title && vue.createVNode(Title, {
|
|
22928
|
+
"class": helper_28(innerClass, 'title') || null
|
|
22929
|
+
}, _isSlot$7(title) ? title : {
|
|
22930
|
+
"default": function _default() {
|
|
22931
|
+
return [title];
|
|
22932
|
+
}
|
|
22933
|
+
}), _this4.renderSearch(), _this4.hasCustomRenderer ? _this4.getComponent() : vue.createVNode(HierarchicalMenuComponent, {
|
|
22934
|
+
"key": "initial-node",
|
|
22935
|
+
"listArray": transformedData,
|
|
22936
|
+
"parentPath": "",
|
|
22937
|
+
"isExpanded": true,
|
|
22938
|
+
"listItemProps": {
|
|
22939
|
+
mode: mode,
|
|
22940
|
+
selectedValues: _this4.selectedValues,
|
|
22941
|
+
searchTerm: _this4.searchTerm,
|
|
22942
|
+
showLine: showLine,
|
|
22943
|
+
renderItem: renderItem != null ? renderItem : _this4.$slots.renderItem,
|
|
22944
|
+
handleListItemClick: _this4.handleListItemClick,
|
|
22945
|
+
showCheckbox: showCheckbox,
|
|
22946
|
+
innerClass: innerClass,
|
|
22947
|
+
showRadio: showRadio,
|
|
22948
|
+
renderIcon: _this4.renderIcon,
|
|
22949
|
+
showCount: showCount,
|
|
22950
|
+
showSwitcherIcon: showSwitcherIcon,
|
|
22951
|
+
switcherIcon: switcherIcon != null ? switcherIcon : _this4.$slots.switcherIcon
|
|
22952
|
+
}
|
|
22953
|
+
}, null)];
|
|
22954
|
+
}
|
|
22955
|
+
});
|
|
22956
|
+
}
|
|
22957
|
+
};
|
|
22958
|
+
var mapStateToProps$6 = function mapStateToProps(state, props) {
|
|
22959
|
+
return {
|
|
22960
|
+
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
22961
|
+
rawData: state.rawData[props.componentId] || {},
|
|
22962
|
+
aggregationData: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId] || {},
|
|
22963
|
+
themePreset: state.config.themePreset,
|
|
22964
|
+
error: state.error[props.componentId],
|
|
22965
|
+
isLoading: state.isLoading[props.componentId],
|
|
22966
|
+
enableAppbase: state.config.enableAppbase
|
|
22967
|
+
};
|
|
22968
|
+
};
|
|
22969
|
+
var mapDispatchtoProps$4 = {
|
|
22970
|
+
setQueryOptions: setQueryOptions$3,
|
|
22971
|
+
updateQueryAction: updateQueryAction
|
|
22972
|
+
};
|
|
22973
|
+
TreeList.hasInternalComponent = function () {
|
|
22974
|
+
return true;
|
|
22975
|
+
};
|
|
22976
|
+
var TreeListConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$6, mapDispatchtoProps$4)(TreeList), {
|
|
22977
|
+
componentType: constants_1$1.treeList,
|
|
22978
|
+
internalComponent: TreeList.hasInternalComponent()
|
|
22979
|
+
}));
|
|
22980
|
+
TreeListConnected.name = TreeList.name;
|
|
22981
|
+
TreeListConnected.install = function (Vue) {
|
|
22982
|
+
Vue.component(TreeListConnected.name, TreeListConnected);
|
|
22983
|
+
};
|
|
22984
|
+
|
|
22985
|
+
// Add componentType for SSR
|
|
22986
|
+
TreeListConnected.componentType = constants_1$1.treeList;
|
|
22987
|
+
|
|
22988
|
+
var _templateObject$n, _templateObject2$8;
|
|
22989
|
+
var small = "\n\tmin-height: 0;\n\theight: 30px;\n\tborder: 0;\n\tbox-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;\n\tborder-radius: 2px;\n";
|
|
22990
|
+
var dark$2 = function dark(_ref) {
|
|
22991
|
+
var theme = _ref.theme;
|
|
22992
|
+
return "\n\tbackground-color: " + (theme.colors ? theme.colors.backgroundColor : '') + ";\n\tborder-color: " + (theme.colors ? theme.colors.borderColor : '') + ";\n\tcolor: " + (theme.colors ? theme.colors.textColor : '') + ";\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: " + (theme.colors ? theme.colors.backgroundColor : '') + ";\n\t}\n";
|
|
22993
|
+
};
|
|
22994
|
+
var Select = styled('button')(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tmin-height: 42px;\n\tborder-radius: 0;\n\toutline: none;\n\tpadding: 5px 12px;\n\tfont-size: 0.9rem;\n\tline-height: 1.2rem;\n\tbackground-color: #fff;\n\tborder: 1px solid #ccc;\n\tcolor: #424242;\n\tcursor: pointer;\n\tuser-select: none;\n\ttransition: all 0.3s ease;\n\n\t", ";\n\n\t& > div {\n\t\twidth: calc(100% - 24px);\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\ttext-align: left;\n\t}\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: #fcfcfc;\n\t}\n\n\t", ";\n"])), function (props) {
|
|
22995
|
+
return props.small ? small : null;
|
|
22996
|
+
}, function (_ref2) {
|
|
22997
|
+
var themePreset = _ref2.themePreset;
|
|
22998
|
+
return themePreset === 'dark' && dark$2;
|
|
22999
|
+
});
|
|
23000
|
+
var Tick = styled('span')(_templateObject2$8 || (_templateObject2$8 = _taggedTemplateLiteralLoose(["\n\twidth: 16px;\n\theight: 16px;\n\tdisplay: inline-block;\n\tposition: relative;\n\tuser-select: none;\n\talign-items: center;\n\n\t&::after {\n\t\tbox-sizing: content-box;\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\tbackground-color: transparent;\n\t\ttop: 50%;\n\t\tleft: 0;\n\t\twidth: 8px;\n\t\theight: 4px;\n\t\tmargin-top: -4px;\n\t\tborder-style: solid;\n\t\tborder-color: ", ";\n\t\tborder-width: 0 0 2px 2px;\n\t\tborder-radius: 0;\n\t\tborder-image: none;\n\t\ttransform: rotate(-45deg) scale(1);\n\t\ttransition: all 200ms ease-out;\n\t}\n"])), function (_ref3) {
|
|
23001
|
+
var theme = _ref3.theme;
|
|
23002
|
+
return theme.colors.primaryColor;
|
|
23003
|
+
});
|
|
23004
|
+
|
|
23005
|
+
var _templateObject$o;
|
|
23006
|
+
var open = "\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n";
|
|
23007
|
+
var Chevron = styled('span')(_templateObject$o || (_templateObject$o = _taggedTemplateLiteralLoose(["\n\t&::before {\n\t\tcontent: '';\n\t\tborder-style: solid;\n\t\tborder-width: 0.15em 0.15em 0 0;\n\t\tdisplay: inline-block;\n\t\theight: 0.45em;\n\t\tposition: relative;\n\t\ttop: 0.35em;\n\t\tleft: 0;\n\t\ttransform: rotate(135deg);\n\t\tvertical-align: top;\n\t\twidth: 0.45em;\n\n\t\t", ";\n\t}\n"])), function (props) {
|
|
23008
|
+
return props.open ? open : null;
|
|
23009
|
+
});
|
|
23010
|
+
|
|
23011
|
+
var getClassName$6 = lib_8.getClassName;
|
|
23012
|
+
var Dropdown = {
|
|
23013
|
+
data: function data() {
|
|
23014
|
+
this.__state = {
|
|
23015
|
+
isOpen: false,
|
|
23016
|
+
searchTerm: ''
|
|
23017
|
+
};
|
|
23018
|
+
return this.__state;
|
|
23019
|
+
},
|
|
23020
|
+
inject: {
|
|
23021
|
+
theme: {
|
|
23022
|
+
from: 'theme_reactivesearch'
|
|
23023
|
+
}
|
|
23024
|
+
},
|
|
23025
|
+
props: {
|
|
23026
|
+
innerClass: types.style,
|
|
23027
|
+
items: types.data,
|
|
23028
|
+
keyField: Q.string.def('key'),
|
|
23029
|
+
labelField: Q.string.def('label'),
|
|
23030
|
+
multi: Q.bool,
|
|
23031
|
+
// change event
|
|
23032
|
+
placeholder: types.string,
|
|
23033
|
+
returnsObject: Q.bool,
|
|
23034
|
+
customLabelRenderer: types.func,
|
|
23035
|
+
hasCustomRenderer: Q.bool,
|
|
23036
|
+
customRenderer: types.func,
|
|
23037
|
+
renderItem: types.func,
|
|
23038
|
+
renderNoResults: Q.any,
|
|
23039
|
+
handleChange: types.func,
|
|
23040
|
+
transformData: types.func,
|
|
23041
|
+
selectedItem: types.selectedValue,
|
|
23042
|
+
showCount: Q.bool,
|
|
23043
|
+
single: Q.bool,
|
|
23044
|
+
small: Q.bool.def(false),
|
|
23045
|
+
themePreset: types.themePreset,
|
|
23046
|
+
showSearch: Q.bool,
|
|
23047
|
+
showClear: Q.bool,
|
|
23048
|
+
searchPlaceholder: Q.string.def('Type here to search...')
|
|
23049
|
+
},
|
|
23050
|
+
render: function render() {
|
|
23051
|
+
var _this = this;
|
|
23052
|
+
var _this$$props = this.$props,
|
|
23053
|
+
items = _this$$props.items,
|
|
23054
|
+
selectedItem = _this$$props.selectedItem,
|
|
23055
|
+
placeholder = _this$$props.placeholder,
|
|
23056
|
+
labelField = _this$$props.labelField,
|
|
23057
|
+
keyField = _this$$props.keyField,
|
|
23058
|
+
themePreset = _this$$props.themePreset,
|
|
23059
|
+
renderItem = _this$$props.renderItem,
|
|
23060
|
+
transformData = _this$$props.transformData,
|
|
23061
|
+
footer = _this$$props.footer,
|
|
23062
|
+
customLabelRenderer = _this$$props.customLabelRenderer,
|
|
23063
|
+
hasCustomRenderer = _this$$props.hasCustomRenderer,
|
|
23064
|
+
customRenderer = _this$$props.customRenderer;
|
|
23065
|
+
var itemsToRender = items;
|
|
23066
|
+
if (transformData) {
|
|
23067
|
+
itemsToRender = transformData(itemsToRender);
|
|
23068
|
+
}
|
|
23069
|
+
var filteredItemsToRender = itemsToRender.filter(function (item) {
|
|
23070
|
+
if (String(item[labelField]).length) {
|
|
23071
|
+
if (_this.$props.showSearch && _this.$data.searchTerm) {
|
|
23072
|
+
return suggestions_1(String(item[labelField])).toLowerCase().includes(suggestions_1(_this.$data.searchTerm.toLowerCase()));
|
|
23073
|
+
}
|
|
23074
|
+
return true;
|
|
23075
|
+
}
|
|
23076
|
+
return false;
|
|
23077
|
+
});
|
|
23078
|
+
return vue.createVNode(Downshift, {
|
|
23079
|
+
"isOpen": this.$data.isOpen,
|
|
23080
|
+
"selectedItem": selectedItem,
|
|
23081
|
+
"handleChange": this.onChange,
|
|
23082
|
+
"handleMouseup": this.handleStateChange
|
|
23083
|
+
}, {
|
|
23084
|
+
"default": function _default(_ref) {
|
|
23085
|
+
var getItemProps = _ref.getItemProps,
|
|
23086
|
+
isOpen = _ref.isOpen,
|
|
23087
|
+
highlightedIndex = _ref.highlightedIndex,
|
|
23088
|
+
getButtonProps = _ref.getButtonProps,
|
|
23089
|
+
getItemEvents = _ref.getItemEvents,
|
|
23090
|
+
getInputEvents = _ref.getInputEvents;
|
|
23091
|
+
return vue.createVNode("div", {
|
|
23092
|
+
"class": suggestionsContainer
|
|
23093
|
+
}, [vue.createVNode(Select, vue.mergeProps(babelHelperVueTransformOn(getButtonProps({
|
|
23094
|
+
onClick: _this.toggle
|
|
23095
|
+
})), {
|
|
23096
|
+
"class": getClassName$6(_this.$props.innerClass, 'select') || '',
|
|
23097
|
+
"title": selectedItem ? _this.renderToString(selectedItem) : placeholder,
|
|
23098
|
+
"small": _this.$props.small,
|
|
23099
|
+
"themePreset": _this.$props.themePreset
|
|
23100
|
+
}), {
|
|
23101
|
+
"default": function _default() {
|
|
23102
|
+
return [customLabelRenderer ? customLabelRenderer(selectedItem) : vue.createVNode("div", null, [selectedItem ? _this.renderToString(selectedItem) : placeholder]), vue.createVNode(Chevron, {
|
|
23103
|
+
"open": isOpen
|
|
23104
|
+
}, null)];
|
|
23105
|
+
}
|
|
23106
|
+
}), hasCustomRenderer ? customRenderer(itemsToRender, {
|
|
23107
|
+
getItemProps: getItemProps,
|
|
23108
|
+
isOpen: isOpen,
|
|
23109
|
+
highlightedIndex: highlightedIndex,
|
|
23110
|
+
getButtonProps: getButtonProps,
|
|
23111
|
+
getItemEvents: getItemEvents
|
|
23112
|
+
}) : isOpen && itemsToRender.length ? vue.createVNode("ul", {
|
|
23113
|
+
"class": suggestions$1(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName$6(_this.$props.innerClass, 'list')
|
|
23114
|
+
}, [_this.$props.showSearch ? _this.renderSearchbox({
|
|
23115
|
+
on: {
|
|
23116
|
+
input: getInputEvents({
|
|
23117
|
+
onInput: _this.handleInputChange
|
|
23118
|
+
}).input
|
|
23119
|
+
}
|
|
23120
|
+
}) : null, !hasCustomRenderer && filteredItemsToRender.length === 0 ? _this.renderNoResult() : filteredItemsToRender.map(function (item, index) {
|
|
23121
|
+
var selected = _this.$props.multi // MultiDropdownList
|
|
23122
|
+
&& (selectedItem && !!selectedItem[item[keyField]] // MultiDropdownRange
|
|
23123
|
+
|| Array.isArray(selectedItem) && selectedItem.find(function (value) {
|
|
23124
|
+
return value[labelField] === item[labelField];
|
|
23125
|
+
}));
|
|
23126
|
+
if (!_this.$props.multi) selected = item.key === selectedItem;
|
|
23127
|
+
return vue.createVNode("li", vue.mergeProps(getItemProps({
|
|
23128
|
+
item: item
|
|
23129
|
+
}), babelHelperVueTransformOn(getItemEvents({
|
|
23130
|
+
item: item
|
|
23131
|
+
})), {
|
|
23132
|
+
"key": item[keyField],
|
|
23133
|
+
"class": "" + (selected ? 'active' : ''),
|
|
23134
|
+
"style": {
|
|
23135
|
+
backgroundColor: _this.getBackgroundColor(highlightedIndex === index, selected)
|
|
23136
|
+
}
|
|
23137
|
+
}), [renderItem ? renderItem({
|
|
23138
|
+
label: item[labelField],
|
|
23139
|
+
count: item.doc_count,
|
|
23140
|
+
isChecked: selected && _this.$props.multi
|
|
23141
|
+
}) : vue.createVNode("div", null, [typeof item[labelField] === 'string' ? vue.createVNode("span", {
|
|
23142
|
+
"innerHTML": item[labelField]
|
|
23143
|
+
}, null) : item[labelField], _this.$props.showCount && item.doc_count && vue.createVNode("span", {
|
|
23144
|
+
"class": getClassName$6(_this.$props.innerClass, 'count') || ''
|
|
23145
|
+
}, [vue.createTextVNode("\xA0("), item.doc_count, vue.createTextVNode(")")])]), selected && _this.$props.multi ? vue.createVNode(Tick, {
|
|
23146
|
+
"class": getClassName$6(_this.$props.innerClass, 'icon') || ''
|
|
23147
|
+
}, null) : null]);
|
|
23148
|
+
}), footer]) : null]);
|
|
23149
|
+
}
|
|
23150
|
+
});
|
|
23151
|
+
},
|
|
23152
|
+
methods: {
|
|
23153
|
+
toggle: function toggle() {
|
|
23154
|
+
this.isOpen = !this.$data.isOpen;
|
|
23155
|
+
},
|
|
23156
|
+
close: function close() {
|
|
23157
|
+
this.isOpen = false;
|
|
23158
|
+
},
|
|
23159
|
+
onChange: function onChange(item) {
|
|
23160
|
+
if (this.$props.returnsObject) {
|
|
23161
|
+
this.$props.handleChange(item);
|
|
23162
|
+
} else {
|
|
23163
|
+
this.$props.handleChange(item[this.$props.keyField]);
|
|
23164
|
+
}
|
|
23165
|
+
if (!this.$props.multi) {
|
|
23166
|
+
this.isOpen = false;
|
|
23167
|
+
this.searchTerm = '';
|
|
23168
|
+
}
|
|
23169
|
+
},
|
|
23170
|
+
handleStateChange: function handleStateChange(_ref2) {
|
|
23171
|
+
var isOpen = _ref2.isOpen;
|
|
23172
|
+
this.isOpen = isOpen;
|
|
23173
|
+
},
|
|
23174
|
+
getBackgroundColor: function getBackgroundColor(highlighted, selected) {
|
|
23175
|
+
var isDark = this.$props.themePreset === 'dark';
|
|
23176
|
+
if (highlighted) {
|
|
23177
|
+
return isDark ? '#555' : '#eee';
|
|
23178
|
+
}
|
|
23179
|
+
if (selected) {
|
|
23180
|
+
return isDark ? '#686868' : '#fafafa';
|
|
23181
|
+
}
|
|
23182
|
+
return isDark ? '#424242' : '#fff';
|
|
23183
|
+
},
|
|
23184
|
+
handleInputChange: function handleInputChange(e) {
|
|
23185
|
+
var value = e.target.value;
|
|
23186
|
+
this.searchTerm = value;
|
|
23187
|
+
},
|
|
23188
|
+
clearSearchTerm: function clearSearchTerm() {
|
|
23189
|
+
this.searchTerm = '';
|
|
23190
|
+
},
|
|
23191
|
+
renderToString: function renderToString(value) {
|
|
23192
|
+
var _this2 = this;
|
|
23193
|
+
var customLabelRenderer = this.$props.customLabelRenderer;
|
|
23194
|
+
if (customLabelRenderer) {
|
|
23195
|
+
var customLabel = customLabelRenderer(value);
|
|
23196
|
+
if (typeof customLabel === 'string') {
|
|
23197
|
+
return customLabel;
|
|
23198
|
+
}
|
|
23199
|
+
}
|
|
23200
|
+
if (Array.isArray(value) && value.length) {
|
|
23201
|
+
var arrayToRender = value.map(function (item) {
|
|
23202
|
+
return _this2.renderToString(item);
|
|
23203
|
+
});
|
|
23204
|
+
return arrayToRender.join(', ');
|
|
23205
|
+
}
|
|
23206
|
+
if (value && typeof value === 'object') {
|
|
23207
|
+
if (value[this.$props.labelField]) {
|
|
23208
|
+
return value[this.$props.labelField];
|
|
23209
|
+
}
|
|
23210
|
+
if (Object.keys(value).length) {
|
|
23211
|
+
return this.renderToString(Object.keys(value));
|
|
23212
|
+
}
|
|
23213
|
+
return this.$props.placeholder;
|
|
23214
|
+
}
|
|
23215
|
+
return value;
|
|
23216
|
+
},
|
|
21372
23217
|
renderNoResult: function renderNoResult() {
|
|
21373
23218
|
var renderNoResults = this.$slots.renderNoResults || this.$props.renderNoResults;
|
|
21374
23219
|
return vue.createVNode("p", {
|
|
@@ -21422,11 +23267,11 @@
|
|
|
21422
23267
|
}
|
|
21423
23268
|
};
|
|
21424
23269
|
|
|
21425
|
-
function _isSlot$
|
|
23270
|
+
function _isSlot$8(s) {
|
|
21426
23271
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
21427
23272
|
}
|
|
21428
23273
|
var updateQuery$4 = lib_5.updateQuery,
|
|
21429
|
-
setQueryOptions$
|
|
23274
|
+
setQueryOptions$4 = lib_5.setQueryOptions,
|
|
21430
23275
|
setCustomQuery$3 = lib_5.setCustomQuery,
|
|
21431
23276
|
setDefaultQuery$4 = lib_5.setDefaultQuery;
|
|
21432
23277
|
var getQueryOptions$3 = lib_8.getQueryOptions,
|
|
@@ -21637,7 +23482,7 @@
|
|
|
21637
23482
|
"css": loadMoreContainer
|
|
21638
23483
|
}, [vue.createVNode(Button, {
|
|
21639
23484
|
"onClick": _this2.handleLoadMore
|
|
21640
|
-
}, _isSlot$
|
|
23485
|
+
}, _isSlot$8(loadMoreLabel) ? loadMoreLabel : {
|
|
21641
23486
|
"default": function _default() {
|
|
21642
23487
|
return [loadMoreLabel];
|
|
21643
23488
|
}
|
|
@@ -21784,7 +23629,7 @@
|
|
|
21784
23629
|
SingleDropdownList.hasInternalComponent = function () {
|
|
21785
23630
|
return true;
|
|
21786
23631
|
};
|
|
21787
|
-
var mapStateToProps$
|
|
23632
|
+
var mapStateToProps$7 = function mapStateToProps(state, props) {
|
|
21788
23633
|
return {
|
|
21789
23634
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
21790
23635
|
rawData: state.rawData[props.componentId],
|
|
@@ -21796,13 +23641,13 @@
|
|
|
21796
23641
|
componentProps: state.props[props.componentId]
|
|
21797
23642
|
};
|
|
21798
23643
|
};
|
|
21799
|
-
var mapDispatchtoProps$
|
|
21800
|
-
setQueryOptions: setQueryOptions$
|
|
23644
|
+
var mapDispatchtoProps$5 = {
|
|
23645
|
+
setQueryOptions: setQueryOptions$4,
|
|
21801
23646
|
updateQuery: updateQuery$4,
|
|
21802
23647
|
setCustomQuery: setCustomQuery$3,
|
|
21803
23648
|
setDefaultQuery: setDefaultQuery$4
|
|
21804
23649
|
};
|
|
21805
|
-
var ListConnected$2 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$
|
|
23650
|
+
var ListConnected$2 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$7, mapDispatchtoProps$5)(SingleDropdownList), {
|
|
21806
23651
|
componentType: constants_1$1.singleDropdownList,
|
|
21807
23652
|
internalComponent: SingleDropdownList.hasInternalComponent()
|
|
21808
23653
|
}));
|
|
@@ -21816,11 +23661,11 @@
|
|
|
21816
23661
|
Vue.component(ListConnected$2.name, ListConnected$2);
|
|
21817
23662
|
};
|
|
21818
23663
|
|
|
21819
|
-
function _isSlot$
|
|
23664
|
+
function _isSlot$9(s) {
|
|
21820
23665
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
21821
23666
|
}
|
|
21822
23667
|
var updateQuery$5 = lib_5.updateQuery,
|
|
21823
|
-
setQueryOptions$
|
|
23668
|
+
setQueryOptions$5 = lib_5.setQueryOptions,
|
|
21824
23669
|
setCustomQuery$4 = lib_5.setCustomQuery,
|
|
21825
23670
|
setDefaultQuery$5 = lib_5.setDefaultQuery;
|
|
21826
23671
|
var isEqual$8 = lib_8.isEqual,
|
|
@@ -22043,7 +23888,7 @@
|
|
|
22043
23888
|
"css": loadMoreContainer
|
|
22044
23889
|
}, [vue.createVNode(Button, {
|
|
22045
23890
|
"onClick": _this3.handleLoadMore
|
|
22046
|
-
}, _isSlot$
|
|
23891
|
+
}, _isSlot$9(loadMoreLabel) ? loadMoreLabel : {
|
|
22047
23892
|
"default": function _default() {
|
|
22048
23893
|
return [loadMoreLabel];
|
|
22049
23894
|
}
|
|
@@ -22239,7 +24084,7 @@
|
|
|
22239
24084
|
MultiDropdownList.hasInternalComponent = function () {
|
|
22240
24085
|
return true;
|
|
22241
24086
|
};
|
|
22242
|
-
var mapStateToProps$
|
|
24087
|
+
var mapStateToProps$8 = function mapStateToProps(state, props) {
|
|
22243
24088
|
return {
|
|
22244
24089
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
22245
24090
|
rawData: state.rawData[props.componentId],
|
|
@@ -22251,13 +24096,13 @@
|
|
|
22251
24096
|
componentProps: state.props[props.componentId]
|
|
22252
24097
|
};
|
|
22253
24098
|
};
|
|
22254
|
-
var mapDispatchtoProps$
|
|
22255
|
-
setQueryOptions: setQueryOptions$
|
|
24099
|
+
var mapDispatchtoProps$6 = {
|
|
24100
|
+
setQueryOptions: setQueryOptions$5,
|
|
22256
24101
|
updateQuery: updateQuery$5,
|
|
22257
24102
|
setCustomQuery: setCustomQuery$4,
|
|
22258
24103
|
setDefaultQuery: setDefaultQuery$5
|
|
22259
24104
|
};
|
|
22260
|
-
var ListConnected$3 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$
|
|
24105
|
+
var ListConnected$3 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$8, mapDispatchtoProps$6)(MultiDropdownList), {
|
|
22261
24106
|
componentType: constants_1$1.multiDropdownList,
|
|
22262
24107
|
internalComponent: MultiDropdownList.hasInternalComponent()
|
|
22263
24108
|
}));
|
|
@@ -22273,7 +24118,7 @@
|
|
|
22273
24118
|
};
|
|
22274
24119
|
|
|
22275
24120
|
var updateQuery$6 = lib_5.updateQuery,
|
|
22276
|
-
setQueryOptions$
|
|
24121
|
+
setQueryOptions$6 = lib_5.setQueryOptions,
|
|
22277
24122
|
setCustomQuery$5 = lib_5.setCustomQuery;
|
|
22278
24123
|
var isEqual$9 = lib_8.isEqual,
|
|
22279
24124
|
checkValueChange$5 = lib_8.checkValueChange,
|
|
@@ -22436,123 +24281,410 @@
|
|
|
22436
24281
|
componentType: constants_1$1.toggleButton
|
|
22437
24282
|
});
|
|
22438
24283
|
},
|
|
22439
|
-
handleClick: function handleClick(item) {
|
|
22440
|
-
var _this$$props = this.$props,
|
|
22441
|
-
enableStrictSelection = _this$$props.enableStrictSelection,
|
|
22442
|
-
multiSelect = _this$$props.multiSelect;
|
|
22443
|
-
if (enableStrictSelection && !multiSelect && this.$data.currentValue.find(function (stateItem) {
|
|
22444
|
-
return isEqual$9(item, stateItem);
|
|
22445
|
-
})) {
|
|
22446
|
-
return false;
|
|
24284
|
+
handleClick: function handleClick(item) {
|
|
24285
|
+
var _this$$props = this.$props,
|
|
24286
|
+
enableStrictSelection = _this$$props.enableStrictSelection,
|
|
24287
|
+
multiSelect = _this$$props.multiSelect;
|
|
24288
|
+
if (enableStrictSelection && !multiSelect && this.$data.currentValue.find(function (stateItem) {
|
|
24289
|
+
return isEqual$9(item, stateItem);
|
|
24290
|
+
})) {
|
|
24291
|
+
return false;
|
|
24292
|
+
}
|
|
24293
|
+
var value = this.$props.value;
|
|
24294
|
+
if (value === undefined) {
|
|
24295
|
+
this.handleToggle(item);
|
|
24296
|
+
} else {
|
|
24297
|
+
this.$emit('change', item.value);
|
|
24298
|
+
}
|
|
24299
|
+
return true;
|
|
24300
|
+
},
|
|
24301
|
+
renderButton: function renderButton(item) {
|
|
24302
|
+
var _this2 = this;
|
|
24303
|
+
var renderItem = this.$slots.renderItem || this.renderItem;
|
|
24304
|
+
var isSelected = this.$data.currentValue.some(function (value) {
|
|
24305
|
+
return value.value === item.value;
|
|
24306
|
+
});
|
|
24307
|
+
return renderItem ? renderItem({
|
|
24308
|
+
item: item,
|
|
24309
|
+
isSelected: isSelected,
|
|
24310
|
+
handleClick: function handleClick() {
|
|
24311
|
+
return _this2.handleClick(item);
|
|
24312
|
+
}
|
|
24313
|
+
}) : vue.createVNode(Button, {
|
|
24314
|
+
"class": getClassName$9(this.$props.innerClass, 'button') + " " + (isSelected ? 'active' : ''),
|
|
24315
|
+
"onClick": function onClick() {
|
|
24316
|
+
return _this2.handleClick(item);
|
|
24317
|
+
},
|
|
24318
|
+
"key": item.value,
|
|
24319
|
+
"primary": isSelected,
|
|
24320
|
+
"large": true,
|
|
24321
|
+
"tabIndex": isSelected ? '-1' : '0',
|
|
24322
|
+
"onKeypress": function onKeypress(e) {
|
|
24323
|
+
return handleA11yAction$1(e, function () {
|
|
24324
|
+
return _this2.handleClick(item);
|
|
24325
|
+
});
|
|
24326
|
+
}
|
|
24327
|
+
}, {
|
|
24328
|
+
"default": function _default() {
|
|
24329
|
+
return [item.label];
|
|
24330
|
+
}
|
|
24331
|
+
});
|
|
24332
|
+
}
|
|
24333
|
+
},
|
|
24334
|
+
render: function render() {
|
|
24335
|
+
var _this3 = this;
|
|
24336
|
+
return vue.createVNode(Container, {
|
|
24337
|
+
"class": toggleButtons
|
|
24338
|
+
}, {
|
|
24339
|
+
"default": function _default() {
|
|
24340
|
+
return [_this3.$props.title && vue.createVNode(Title, {
|
|
24341
|
+
"class": getClassName$9(_this3.$props.innerClass, 'title')
|
|
24342
|
+
}, {
|
|
24343
|
+
"default": function _default() {
|
|
24344
|
+
return [_this3.$props.title];
|
|
24345
|
+
}
|
|
24346
|
+
}), _this3.$props.data.map(function (item) {
|
|
24347
|
+
return _this3.renderButton(item);
|
|
24348
|
+
})];
|
|
24349
|
+
}
|
|
24350
|
+
});
|
|
24351
|
+
}
|
|
24352
|
+
};
|
|
24353
|
+
ToggleButton.parseValue = function (value, props) {
|
|
24354
|
+
if (Array.isArray(value)) {
|
|
24355
|
+
if (typeof value[0] === 'string') {
|
|
24356
|
+
return props.data.filter(function (item) {
|
|
24357
|
+
return value.includes(item.value);
|
|
24358
|
+
});
|
|
24359
|
+
}
|
|
24360
|
+
return value;
|
|
24361
|
+
}
|
|
24362
|
+
return props.data.filter(function (item) {
|
|
24363
|
+
return item.value === value;
|
|
24364
|
+
});
|
|
24365
|
+
};
|
|
24366
|
+
ToggleButton.defaultQuery = function (value, props) {
|
|
24367
|
+
return {
|
|
24368
|
+
query: {
|
|
24369
|
+
queryFormat: props.queryFormat,
|
|
24370
|
+
dataField: props.dataField,
|
|
24371
|
+
value: value,
|
|
24372
|
+
nestedField: props.nestedField,
|
|
24373
|
+
selectAllLabel: props.selectAllLabel,
|
|
24374
|
+
showMissing: props.showMissing,
|
|
24375
|
+
multiSelect: props.multiSelect
|
|
24376
|
+
}
|
|
24377
|
+
};
|
|
24378
|
+
};
|
|
24379
|
+
var mapStateToProps$9 = function mapStateToProps(state, props) {
|
|
24380
|
+
return {
|
|
24381
|
+
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
24382
|
+
componentProps: state.props[props.componentId]
|
|
24383
|
+
};
|
|
24384
|
+
};
|
|
24385
|
+
var mapDispatchtoProps$7 = {
|
|
24386
|
+
updateQueryHandler: updateQuery$6,
|
|
24387
|
+
setQueryOptions: setQueryOptions$6,
|
|
24388
|
+
setCustomQuery: setCustomQuery$5
|
|
24389
|
+
};
|
|
24390
|
+
var TBConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$9, mapDispatchtoProps$7)(ToggleButton), {
|
|
24391
|
+
componentType: constants_1$1.toggleButton
|
|
24392
|
+
}));
|
|
24393
|
+
TBConnected.parseValue = ToggleButton.parseValue;
|
|
24394
|
+
TBConnected.defaultQuery = ToggleButton.defaultQuery;
|
|
24395
|
+
TBConnected.name = ToggleButton.name;
|
|
24396
|
+
TBConnected.install = function (Vue) {
|
|
24397
|
+
Vue.component(TBConnected.name, TBConnected);
|
|
24398
|
+
};
|
|
24399
|
+
// Add componentType for SSR
|
|
24400
|
+
TBConnected.componentType = constants_1$1.toggleButton;
|
|
24401
|
+
|
|
24402
|
+
var _excluded$1 = ["options"];
|
|
24403
|
+
var updateQuery$7 = lib_5.updateQuery,
|
|
24404
|
+
setQueryOptions$7 = lib_5.setQueryOptions,
|
|
24405
|
+
setCustomQuery$6 = lib_5.setCustomQuery,
|
|
24406
|
+
setDefaultQuery$6 = lib_5.setDefaultQuery;
|
|
24407
|
+
var parseHits$1 = lib_8.parseHits,
|
|
24408
|
+
isEqual$a = lib_8.isEqual,
|
|
24409
|
+
getCompositeAggsQuery$4 = lib_8.getCompositeAggsQuery,
|
|
24410
|
+
getResultStats$2 = lib_8.getResultStats,
|
|
24411
|
+
extractQueryFromCustomQuery$5 = lib_8.extractQueryFromCustomQuery,
|
|
24412
|
+
getOptionsForCustomQuery$5 = lib_8.getOptionsForCustomQuery;
|
|
24413
|
+
var ReactiveComponent = {
|
|
24414
|
+
name: 'ReactiveComponent',
|
|
24415
|
+
props: {
|
|
24416
|
+
componentId: types.stringRequired,
|
|
24417
|
+
aggregationField: types.string,
|
|
24418
|
+
aggregationSize: Q.number,
|
|
24419
|
+
size: Q.number,
|
|
24420
|
+
defaultQuery: types.func,
|
|
24421
|
+
customQuery: types.func,
|
|
24422
|
+
filterLabel: types.string,
|
|
24423
|
+
react: types.react,
|
|
24424
|
+
showFilter: Q.bool.def(true),
|
|
24425
|
+
URLParams: Q.bool.def(false),
|
|
24426
|
+
distinctField: types.string,
|
|
24427
|
+
distinctFieldConfig: types.props,
|
|
24428
|
+
index: Q.string,
|
|
24429
|
+
endpoint: types.endpointConfig
|
|
24430
|
+
},
|
|
24431
|
+
created: function created() {
|
|
24432
|
+
var _this = this;
|
|
24433
|
+
var props = this.$props;
|
|
24434
|
+
this.internalComponent = null;
|
|
24435
|
+
this.$defaultQuery = null;
|
|
24436
|
+
// Set custom query in store
|
|
24437
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
24438
|
+
var customQuery = props.customQuery,
|
|
24439
|
+
componentId = props.componentId,
|
|
24440
|
+
filterLabel = props.filterLabel,
|
|
24441
|
+
showFilter = props.showFilter,
|
|
24442
|
+
URLParams = props.URLParams;
|
|
24443
|
+
if (customQuery) {
|
|
24444
|
+
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
24445
|
+
var query = extractQueryFromCustomQuery$5(calcCustomQuery);
|
|
24446
|
+
var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery$5(calcCustomQuery) : null;
|
|
24447
|
+
if (customQueryOptions) {
|
|
24448
|
+
this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
|
|
24449
|
+
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
24450
|
+
this.updateQuery({
|
|
24451
|
+
componentId: componentId,
|
|
24452
|
+
query: query,
|
|
24453
|
+
value: this.selectedValue || null,
|
|
24454
|
+
label: filterLabel,
|
|
24455
|
+
showFilter: showFilter,
|
|
24456
|
+
URLParams: URLParams
|
|
24457
|
+
});
|
|
24458
|
+
}
|
|
24459
|
+
this.setQuery = function (_ref) {
|
|
24460
|
+
var options = _ref.options,
|
|
24461
|
+
obj = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
24462
|
+
var queryToBeSet = obj.query;
|
|
24463
|
+
|
|
24464
|
+
// when enableAppbase is true, Backend throws error because of repeated query in request body
|
|
24465
|
+
if (queryToBeSet && queryToBeSet.query) {
|
|
24466
|
+
queryToBeSet = queryToBeSet.query;
|
|
24467
|
+
}
|
|
24468
|
+
var customQueryCalc = _extends({}, options, {
|
|
24469
|
+
query: queryToBeSet
|
|
24470
|
+
});
|
|
24471
|
+
var rsAPIQuery = customQueryCalc;
|
|
24472
|
+
// handle stored queries
|
|
24473
|
+
if (queryToBeSet && queryToBeSet.id) {
|
|
24474
|
+
rsAPIQuery = queryToBeSet;
|
|
24475
|
+
}
|
|
24476
|
+
// Update customQuery field for RS API
|
|
24477
|
+
_this.setCustomQuery(props.componentId, rsAPIQuery);
|
|
24478
|
+
if (options) {
|
|
24479
|
+
_this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
|
|
24480
|
+
}
|
|
24481
|
+
_this.updateQuery(_extends({}, obj, {
|
|
24482
|
+
query: customQueryCalc.query,
|
|
24483
|
+
componentId: props.componentId,
|
|
24484
|
+
label: props.filterLabel,
|
|
24485
|
+
showFilter: props.showFilter,
|
|
24486
|
+
URLParams: props.URLParams
|
|
24487
|
+
}));
|
|
24488
|
+
};
|
|
24489
|
+
if (props.defaultQuery) {
|
|
24490
|
+
this.internalComponent = props.componentId + "__internal";
|
|
24491
|
+
}
|
|
24492
|
+
if (this.internalComponent && this.$props.defaultQuery) {
|
|
24493
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
24494
|
+
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
24495
|
+
var _query = extractQueryFromCustomQuery$5(this.$defaultQuery);
|
|
24496
|
+
var queryOptions = getOptionsForCustomQuery$5(this.$defaultQuery);
|
|
24497
|
+
if (queryOptions) {
|
|
24498
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
24499
|
+
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
24500
|
+
this.updateQuery({
|
|
24501
|
+
componentId: this.internalComponent,
|
|
24502
|
+
query: _query
|
|
24503
|
+
});
|
|
24504
|
+
}
|
|
24505
|
+
},
|
|
24506
|
+
watch: {
|
|
24507
|
+
hits: function hits(newVal, oldVal) {
|
|
24508
|
+
if (!isEqual$a(newVal, oldVal)) {
|
|
24509
|
+
this.$emit('data', this.getData());
|
|
24510
|
+
}
|
|
24511
|
+
},
|
|
24512
|
+
rawData: function rawData(newVal, oldVal) {
|
|
24513
|
+
if (!isEqual$a(newVal, oldVal)) {
|
|
24514
|
+
this.$emit('data', this.getData());
|
|
24515
|
+
}
|
|
24516
|
+
},
|
|
24517
|
+
aggregations: function aggregations(newVal, oldVal) {
|
|
24518
|
+
if (!isEqual$a(newVal, oldVal)) {
|
|
24519
|
+
this.$emit('data', this.getData());
|
|
24520
|
+
}
|
|
24521
|
+
},
|
|
24522
|
+
aggregationData: function aggregationData(newVal, oldVal) {
|
|
24523
|
+
if (!isEqual$a(newVal, oldVal)) {
|
|
24524
|
+
this.$emit('data', this.getData());
|
|
24525
|
+
}
|
|
24526
|
+
},
|
|
24527
|
+
promotedResults: function promotedResults(newVal, oldVal) {
|
|
24528
|
+
if (!isEqual$a(newVal, oldVal)) {
|
|
24529
|
+
this.$emit('data', this.getData());
|
|
24530
|
+
}
|
|
24531
|
+
},
|
|
24532
|
+
hidden: function hidden(newVal, oldVal) {
|
|
24533
|
+
if (!isEqual$a(newVal, oldVal)) {
|
|
24534
|
+
this.$emit('data', this.getData());
|
|
24535
|
+
}
|
|
24536
|
+
},
|
|
24537
|
+
total: function total(newVal, oldVal) {
|
|
24538
|
+
if (!isEqual$a(newVal, oldVal)) {
|
|
24539
|
+
this.$emit('data', this.getData());
|
|
24540
|
+
}
|
|
24541
|
+
},
|
|
24542
|
+
time: function time(newVal, oldVal) {
|
|
24543
|
+
if (!isEqual$a(newVal, oldVal)) {
|
|
24544
|
+
this.$emit('data', this.getData());
|
|
22447
24545
|
}
|
|
22448
|
-
|
|
22449
|
-
|
|
22450
|
-
|
|
22451
|
-
|
|
22452
|
-
this.$
|
|
24546
|
+
},
|
|
24547
|
+
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
24548
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
24549
|
+
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
24550
|
+
var query = extractQueryFromCustomQuery$5(this.$defaultQuery);
|
|
24551
|
+
var queryOptions = getOptionsForCustomQuery$5(this.$defaultQuery);
|
|
24552
|
+
if (queryOptions) {
|
|
24553
|
+
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
24554
|
+
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
24555
|
+
// Update default query for RS API
|
|
24556
|
+
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
24557
|
+
this.updateQuery({
|
|
24558
|
+
componentId: this.internalComponent,
|
|
24559
|
+
query: query
|
|
24560
|
+
});
|
|
22453
24561
|
}
|
|
22454
|
-
return true;
|
|
22455
24562
|
},
|
|
22456
|
-
|
|
22457
|
-
|
|
22458
|
-
|
|
22459
|
-
|
|
22460
|
-
|
|
24563
|
+
customQuery: function customQuery(newVal, oldVal) {
|
|
24564
|
+
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
24565
|
+
var componentId = this.$props.componentId;
|
|
24566
|
+
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
24567
|
+
var query = extractQueryFromCustomQuery$5(this.$customQuery);
|
|
24568
|
+
var queryOptions = getOptionsForCustomQuery$5(this.$customQuery);
|
|
24569
|
+
if (queryOptions) {
|
|
24570
|
+
this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
24571
|
+
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
24572
|
+
|
|
24573
|
+
// Update custom query for RS API
|
|
24574
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
24575
|
+
this.updateQuery({
|
|
24576
|
+
componentId: componentId,
|
|
24577
|
+
query: query
|
|
24578
|
+
});
|
|
24579
|
+
}
|
|
24580
|
+
}
|
|
24581
|
+
},
|
|
24582
|
+
render: function render() {
|
|
24583
|
+
try {
|
|
24584
|
+
var dom = this.$slots["default"];
|
|
24585
|
+
var error = this.error,
|
|
24586
|
+
isLoading = this.isLoading,
|
|
24587
|
+
selectedValue = this.selectedValue;
|
|
24588
|
+
var propsToBePassed = _extends({
|
|
24589
|
+
error: error,
|
|
24590
|
+
loading: isLoading
|
|
24591
|
+
}, this.getData(), {
|
|
24592
|
+
value: selectedValue,
|
|
24593
|
+
setQuery: this.setQuery
|
|
22461
24594
|
});
|
|
22462
|
-
return
|
|
22463
|
-
|
|
22464
|
-
|
|
22465
|
-
|
|
22466
|
-
|
|
22467
|
-
|
|
22468
|
-
|
|
22469
|
-
|
|
22470
|
-
|
|
22471
|
-
|
|
22472
|
-
|
|
22473
|
-
|
|
22474
|
-
|
|
22475
|
-
|
|
22476
|
-
|
|
22477
|
-
|
|
22478
|
-
|
|
22479
|
-
|
|
24595
|
+
return vue.createVNode("div", null, [dom(propsToBePassed)]);
|
|
24596
|
+
} catch (e) {
|
|
24597
|
+
return null;
|
|
24598
|
+
}
|
|
24599
|
+
},
|
|
24600
|
+
methods: {
|
|
24601
|
+
getAggsQuery: function getAggsQuery() {
|
|
24602
|
+
if (this.aggregationField) {
|
|
24603
|
+
return {
|
|
24604
|
+
aggs: getCompositeAggsQuery$4({
|
|
24605
|
+
props: this.$props,
|
|
24606
|
+
showTopHits: true,
|
|
24607
|
+
value: this.selectedValue
|
|
24608
|
+
}).aggs
|
|
24609
|
+
};
|
|
24610
|
+
}
|
|
24611
|
+
return {};
|
|
24612
|
+
},
|
|
24613
|
+
getData: function getData() {
|
|
24614
|
+
var hits = this.hits,
|
|
24615
|
+
aggregations = this.aggregations,
|
|
24616
|
+
aggregationData = this.aggregationData,
|
|
24617
|
+
promotedResults = this.promotedResults,
|
|
24618
|
+
rawData = this.rawData;
|
|
24619
|
+
var filteredResults = parseHits$1(hits);
|
|
24620
|
+
if (promotedResults.length) {
|
|
24621
|
+
var ids = promotedResults.map(function (item) {
|
|
24622
|
+
return item._id;
|
|
24623
|
+
}).filter(Boolean);
|
|
24624
|
+
if (ids) {
|
|
24625
|
+
filteredResults = filteredResults.filter(function (item) {
|
|
24626
|
+
return !ids.includes(item._id);
|
|
22480
24627
|
});
|
|
22481
24628
|
}
|
|
22482
|
-
|
|
22483
|
-
|
|
22484
|
-
|
|
22485
|
-
|
|
22486
|
-
|
|
24629
|
+
filteredResults = [].concat(promotedResults, filteredResults);
|
|
24630
|
+
}
|
|
24631
|
+
return {
|
|
24632
|
+
data: filteredResults,
|
|
24633
|
+
aggregationData: aggregationData,
|
|
24634
|
+
rawData: rawData,
|
|
24635
|
+
aggregations: aggregations,
|
|
24636
|
+
promotedData: promotedResults,
|
|
24637
|
+
resultStats: this.stats
|
|
24638
|
+
};
|
|
22487
24639
|
}
|
|
22488
24640
|
},
|
|
22489
|
-
|
|
22490
|
-
|
|
22491
|
-
|
|
22492
|
-
"class": toggleButtons
|
|
22493
|
-
}, {
|
|
22494
|
-
"default": function _default() {
|
|
22495
|
-
return [_this3.$props.title && vue.createVNode(Title, {
|
|
22496
|
-
"class": getClassName$9(_this3.$props.innerClass, 'title')
|
|
22497
|
-
}, {
|
|
22498
|
-
"default": function _default() {
|
|
22499
|
-
return [_this3.$props.title];
|
|
22500
|
-
}
|
|
22501
|
-
}), _this3.$props.data.map(function (item) {
|
|
22502
|
-
return _this3.renderButton(item);
|
|
22503
|
-
})];
|
|
22504
|
-
}
|
|
22505
|
-
});
|
|
22506
|
-
}
|
|
22507
|
-
};
|
|
22508
|
-
ToggleButton.parseValue = function (value, props) {
|
|
22509
|
-
if (Array.isArray(value)) {
|
|
22510
|
-
if (typeof value[0] === 'string') {
|
|
22511
|
-
return props.data.filter(function (item) {
|
|
22512
|
-
return value.includes(item.value);
|
|
22513
|
-
});
|
|
24641
|
+
computed: {
|
|
24642
|
+
stats: function stats() {
|
|
24643
|
+
return getResultStats$2(this);
|
|
22514
24644
|
}
|
|
22515
|
-
return value;
|
|
22516
24645
|
}
|
|
22517
|
-
return props.data.filter(function (item) {
|
|
22518
|
-
return item.value === value;
|
|
22519
|
-
});
|
|
22520
24646
|
};
|
|
22521
|
-
|
|
22522
|
-
return
|
|
22523
|
-
query: {
|
|
22524
|
-
queryFormat: props.queryFormat,
|
|
22525
|
-
dataField: props.dataField,
|
|
22526
|
-
value: value,
|
|
22527
|
-
nestedField: props.nestedField,
|
|
22528
|
-
selectAllLabel: props.selectAllLabel,
|
|
22529
|
-
showMissing: props.showMissing,
|
|
22530
|
-
multiSelect: props.multiSelect
|
|
22531
|
-
}
|
|
22532
|
-
};
|
|
24647
|
+
ReactiveComponent.hasInternalComponent = function (props) {
|
|
24648
|
+
return !!props.defaultQuery;
|
|
22533
24649
|
};
|
|
22534
|
-
var mapStateToProps$
|
|
24650
|
+
var mapStateToProps$a = function mapStateToProps(state, props) {
|
|
22535
24651
|
return {
|
|
24652
|
+
aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
|
|
24653
|
+
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
24654
|
+
hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
|
|
24655
|
+
rawData: state.rawData[props.componentId],
|
|
24656
|
+
error: state.error[props.componentId],
|
|
24657
|
+
isLoading: state.isLoading[props.componentId],
|
|
22536
24658
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
24659
|
+
promotedResults: state.promotedResults[props.componentId] || [],
|
|
24660
|
+
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
24661
|
+
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
24662
|
+
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
|
|
22537
24663
|
componentProps: state.props[props.componentId]
|
|
22538
24664
|
};
|
|
22539
24665
|
};
|
|
22540
|
-
var mapDispatchtoProps$
|
|
22541
|
-
|
|
22542
|
-
|
|
22543
|
-
setCustomQuery: setCustomQuery$
|
|
22544
|
-
|
|
22545
|
-
var TBConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$8, mapDispatchtoProps$6)(ToggleButton), {
|
|
22546
|
-
componentType: constants_1$1.toggleButton
|
|
22547
|
-
}));
|
|
22548
|
-
TBConnected.parseValue = ToggleButton.parseValue;
|
|
22549
|
-
TBConnected.defaultQuery = ToggleButton.defaultQuery;
|
|
22550
|
-
TBConnected.name = ToggleButton.name;
|
|
22551
|
-
TBConnected.install = function (Vue) {
|
|
22552
|
-
Vue.component(TBConnected.name, TBConnected);
|
|
24666
|
+
var mapDispatchtoProps$8 = {
|
|
24667
|
+
setQueryOptions: setQueryOptions$7,
|
|
24668
|
+
updateQuery: updateQuery$7,
|
|
24669
|
+
setCustomQuery: setCustomQuery$6,
|
|
24670
|
+
setDefaultQuery: setDefaultQuery$6
|
|
22553
24671
|
};
|
|
24672
|
+
var ConnectedComponent = ComponentWrapper$1(connect(mapStateToProps$a, mapDispatchtoProps$8)(ReactiveComponent), {
|
|
24673
|
+
componentType: constants_1$1.reactiveComponent
|
|
24674
|
+
});
|
|
24675
|
+
var RcConnected = PreferencesConsumer({
|
|
24676
|
+
name: 'RcConnected',
|
|
24677
|
+
render: function render() {
|
|
24678
|
+
return vue.h(ConnectedComponent, null, this.$slots);
|
|
24679
|
+
}
|
|
24680
|
+
});
|
|
24681
|
+
RcConnected.name = ReactiveComponent.name;
|
|
24682
|
+
RcConnected.hasInternalComponent = ReactiveComponent.hasInternalComponent;
|
|
22554
24683
|
// Add componentType for SSR
|
|
22555
|
-
|
|
24684
|
+
RcConnected.componentType = constants_1$1.reactiveComponent;
|
|
24685
|
+
RcConnected.install = function (Vue) {
|
|
24686
|
+
Vue.component(RcConnected.name, RcConnected);
|
|
24687
|
+
};
|
|
22556
24688
|
|
|
22557
24689
|
// client only component
|
|
22558
24690
|
// render the placeholder slot on SSR
|
|
@@ -22586,8 +24718,8 @@
|
|
|
22586
24718
|
}
|
|
22587
24719
|
});
|
|
22588
24720
|
|
|
22589
|
-
var _templateObject$
|
|
22590
|
-
var Slider = styled('div')(_templateObject$
|
|
24721
|
+
var _templateObject$p;
|
|
24722
|
+
var Slider = styled('div')(_templateObject$p || (_templateObject$p = _taggedTemplateLiteralLoose(["\n\tmargin-top: 30px;\n\tpadding: 10px;\n\n\t/* component style */\n\t.vue-slider-disabled {\n\t\topacity: 0.5;\n\t\tcursor: not-allowed;\n\t}\n\n\t/* rail style */\n\t.vue-slider-rail {\n\t\tbackground-color: #ccc;\n\t\tborder-radius: 15px;\n\t\theight: 4px;\n\t}\n\n\t/* process style */\n\t.vue-slider-process {\n\t\tbackground-color: #0b6aff;\n\t\tborder-radius: 15px;\n\t}\n\n\t/* mark style */\n\t.vue-slider-mark {\n\t\tz-index: 4;\n\t}\n\n\t.vue-slider-mark:first-child .vue-slider-mark-step,\n\t.vue-slider-mark:last-child .vue-slider-mark-step {\n\t\tdisplay: none;\n\t}\n\n\t.vue-slider-mark-step {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: rgba(0, 0, 0, 0.16);\n\t}\n\n\t.vue-slider-mark-label {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t}\n\n\t/* dot style */\n\t.vue-slider-dot {\n\t\tz-index: 2;\n\t}\n\n\t.vue-slider-dot-handle {\n\t\tcursor: pointer;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: #fff;\n\t\tbox-sizing: border-box;\n\t\tborder: 1px solid #9a9a9a;\n\t\tz-index: 2;\n\t\tbox-shadow: 0.5px 0.5px 2px 1px rgb(0 0 0 / 32%);\n\t}\n\n\t.vue-slider-dot-handle-disabled {\n\t\tcursor: not-allowed;\n\t\tbackground-color: #ccc;\n\t}\n\n\t.vue-slider-dot-tooltip-inner {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t\tpadding: 2px 5px;\n\t\tmin-width: 20px;\n\t\ttext-align: center;\n\t\tcolor: #fff;\n\t\tborder-radius: 5px;\n\t\tborder: 1px solid #3498db;\n\t\tbackground-color: #3498db;\n\t\tbox-sizing: content-box;\n\t}\n\n\t.vue-slider-dot-tooltip-inner::after {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-top::after {\n\t\ttop: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-top-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-bottom::after {\n\t\tbottom: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-bottom-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-left::after {\n\t\tleft: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-left-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-right::after {\n\t\tright: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-right-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-wrapper {\n\t\topacity: 0;\n\t\ttransition: all 0.3s;\n\t}\n\t.vue-slider-dot-tooltip-wrapper-show {\n\t\topacity: 1;\n\t}\n\n\t.label-container {\n\t\tmargin: 10px 0;\n\t\twidth: 100%;\n\t}\n\n\t.range-label-right {\n\t\tfloat: right;\n\t}\n"])));
|
|
22591
24723
|
|
|
22592
24724
|
var global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
|
|
22593
24725
|
|
|
@@ -22620,18 +24752,18 @@
|
|
|
22620
24752
|
var addComponent$1 = lib_5.addComponent,
|
|
22621
24753
|
removeComponent$1 = lib_5.removeComponent,
|
|
22622
24754
|
watchComponent$1 = lib_5.watchComponent,
|
|
22623
|
-
updateQuery$
|
|
24755
|
+
updateQuery$8 = lib_5.updateQuery,
|
|
22624
24756
|
setQueryListener$1 = lib_5.setQueryListener,
|
|
22625
|
-
setQueryOptions$
|
|
24757
|
+
setQueryOptions$8 = lib_5.setQueryOptions,
|
|
22626
24758
|
setComponentProps$1 = lib_5.setComponentProps,
|
|
22627
|
-
setCustomQuery$
|
|
24759
|
+
setCustomQuery$7 = lib_5.setCustomQuery,
|
|
22628
24760
|
updateComponentProps$2 = lib_5.updateComponentProps;
|
|
22629
24761
|
var checkValueChange$6 = lib_8.checkValueChange,
|
|
22630
24762
|
getClassName$a = lib_8.getClassName,
|
|
22631
|
-
isEqual$
|
|
24763
|
+
isEqual$b = lib_8.isEqual,
|
|
22632
24764
|
checkSomePropChange$1 = lib_8.checkSomePropChange,
|
|
22633
|
-
extractQueryFromCustomQuery$
|
|
22634
|
-
getOptionsForCustomQuery$
|
|
24765
|
+
extractQueryFromCustomQuery$6 = lib_8.extractQueryFromCustomQuery,
|
|
24766
|
+
getOptionsForCustomQuery$6 = lib_8.getOptionsForCustomQuery;
|
|
22635
24767
|
var DynamicRangeSlider = {
|
|
22636
24768
|
name: 'DynamicRangeSlider',
|
|
22637
24769
|
components: getComponents(),
|
|
@@ -22816,11 +24948,11 @@
|
|
|
22816
24948
|
var query = DynamicRangeSlider.defaultQuery(value, this.$props);
|
|
22817
24949
|
if (this.$props.customQuery) {
|
|
22818
24950
|
var customQueryTobeSet = this.$props.customQuery(value, this.$props);
|
|
22819
|
-
var queryTobeSet = extractQueryFromCustomQuery$
|
|
24951
|
+
var queryTobeSet = extractQueryFromCustomQuery$6(customQueryTobeSet);
|
|
22820
24952
|
if (queryTobeSet) {
|
|
22821
24953
|
query = queryTobeSet;
|
|
22822
24954
|
}
|
|
22823
|
-
var customQueryOptions = getOptionsForCustomQuery$
|
|
24955
|
+
var customQueryOptions = getOptionsForCustomQuery$6(customQueryTobeSet);
|
|
22824
24956
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, value);
|
|
22825
24957
|
this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
|
|
22826
24958
|
}
|
|
@@ -22867,7 +24999,7 @@
|
|
|
22867
24999
|
this.setReact();
|
|
22868
25000
|
},
|
|
22869
25001
|
selectedValue: function selectedValue(newValue) {
|
|
22870
|
-
if (isEqual$
|
|
25002
|
+
if (isEqual$b(newValue, this.currentValue)) return;
|
|
22871
25003
|
var value = newValue || {
|
|
22872
25004
|
start: this.range.start,
|
|
22873
25005
|
end: this.range.end
|
|
@@ -22876,7 +25008,7 @@
|
|
|
22876
25008
|
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
22877
25009
|
},
|
|
22878
25010
|
range: function range(newValue, oldValue) {
|
|
22879
|
-
if (isEqual$
|
|
25011
|
+
if (isEqual$b(newValue, oldValue) || !this.currentValue) return;
|
|
22880
25012
|
var _ref3 = this.currentValue || [],
|
|
22881
25013
|
currentStart = _ref3[0],
|
|
22882
25014
|
currentEnd = _ref3[1];
|
|
@@ -22893,7 +25025,7 @@
|
|
|
22893
25025
|
}
|
|
22894
25026
|
},
|
|
22895
25027
|
value: function value(newVal, oldVal) {
|
|
22896
|
-
if (!isEqual$
|
|
25028
|
+
if (!isEqual$b(newVal, oldVal)) {
|
|
22897
25029
|
this.handleChange(DynamicRangeSlider.parseValue(newVal, this.$props));
|
|
22898
25030
|
}
|
|
22899
25031
|
}
|
|
@@ -22966,7 +25098,7 @@
|
|
|
22966
25098
|
DynamicRangeSlider.hasInternalComponent = function () {
|
|
22967
25099
|
return true;
|
|
22968
25100
|
};
|
|
22969
|
-
var mapStateToProps$
|
|
25101
|
+
var mapStateToProps$b = function mapStateToProps(state, props) {
|
|
22970
25102
|
var componentId = state.aggregations[props.componentId];
|
|
22971
25103
|
var internalRange = state.aggregations[props.componentId + "__range__internal"];
|
|
22972
25104
|
var options = componentId && componentId[props.dataField];
|
|
@@ -22991,18 +25123,18 @@
|
|
|
22991
25123
|
componentProps: state.props[props.componentId]
|
|
22992
25124
|
};
|
|
22993
25125
|
};
|
|
22994
|
-
var mapDispatchtoProps$
|
|
25126
|
+
var mapDispatchtoProps$9 = {
|
|
22995
25127
|
addComponent: addComponent$1,
|
|
22996
25128
|
removeComponent: removeComponent$1,
|
|
22997
|
-
updateQuery: updateQuery$
|
|
25129
|
+
updateQuery: updateQuery$8,
|
|
22998
25130
|
watchComponent: watchComponent$1,
|
|
22999
25131
|
setQueryListener: setQueryListener$1,
|
|
23000
|
-
setQueryOptions: setQueryOptions$
|
|
25132
|
+
setQueryOptions: setQueryOptions$8,
|
|
23001
25133
|
setComponentProps: setComponentProps$1,
|
|
23002
|
-
setCustomQuery: setCustomQuery$
|
|
25134
|
+
setCustomQuery: setCustomQuery$7,
|
|
23003
25135
|
updateComponentProps: updateComponentProps$2
|
|
23004
25136
|
};
|
|
23005
|
-
var RangeConnected = PreferencesConsumer(connect(mapStateToProps$
|
|
25137
|
+
var RangeConnected = PreferencesConsumer(connect(mapStateToProps$b, mapDispatchtoProps$9)(DynamicRangeSlider));
|
|
23006
25138
|
RangeConnected.defaultQuery = DynamicRangeSlider.defaultQuery;
|
|
23007
25139
|
RangeConnected.parseValue = DynamicRangeSlider.parseValue;
|
|
23008
25140
|
RangeConnected.hasInternalComponent = DynamicRangeSlider.hasInternalComponent;
|
|
@@ -23014,13 +25146,13 @@
|
|
|
23014
25146
|
Vue.component(RangeConnected.name, RangeConnected);
|
|
23015
25147
|
};
|
|
23016
25148
|
|
|
23017
|
-
function _isSlot$
|
|
25149
|
+
function _isSlot$a(s) {
|
|
23018
25150
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
23019
25151
|
}
|
|
23020
|
-
var updateQuery$
|
|
23021
|
-
setQueryOptions$
|
|
23022
|
-
setCustomQuery$
|
|
23023
|
-
var isEqual$
|
|
25152
|
+
var updateQuery$9 = lib_5.updateQuery,
|
|
25153
|
+
setQueryOptions$9 = lib_5.setQueryOptions,
|
|
25154
|
+
setCustomQuery$8 = lib_5.setCustomQuery;
|
|
25155
|
+
var isEqual$c = lib_8.isEqual,
|
|
23024
25156
|
checkValueChange$7 = lib_8.checkValueChange,
|
|
23025
25157
|
getClassName$b = lib_8.getClassName,
|
|
23026
25158
|
getOptionsFromQuery$1 = lib_8.getOptionsFromQuery;
|
|
@@ -23072,12 +25204,12 @@
|
|
|
23072
25204
|
this.setValue(newVal);
|
|
23073
25205
|
},
|
|
23074
25206
|
value: function value(newVal, oldVal) {
|
|
23075
|
-
if (!isEqual$
|
|
25207
|
+
if (!isEqual$c(newVal, oldVal)) {
|
|
23076
25208
|
this.setValue(newVal);
|
|
23077
25209
|
}
|
|
23078
25210
|
},
|
|
23079
25211
|
selectedValue: function selectedValue(newVal) {
|
|
23080
|
-
if (!isEqual$
|
|
25212
|
+
if (!isEqual$c(this.$data.currentValue, newVal)) {
|
|
23081
25213
|
this.setValue(newVal);
|
|
23082
25214
|
}
|
|
23083
25215
|
},
|
|
@@ -23102,7 +25234,7 @@
|
|
|
23102
25234
|
}
|
|
23103
25235
|
}), vue.createVNode(UL, {
|
|
23104
25236
|
"class": getClassName$b(_this.$props.innerClass, 'list')
|
|
23105
|
-
}, _isSlot$
|
|
25237
|
+
}, _isSlot$a(_slot = _this.$props.data.map(function (item) {
|
|
23106
25238
|
var selected = !!_this.$data.currentValue && _this.$data.currentValue.label === item.label;
|
|
23107
25239
|
return vue.createVNode("li", {
|
|
23108
25240
|
"key": item.label,
|
|
@@ -23189,18 +25321,18 @@
|
|
|
23189
25321
|
}
|
|
23190
25322
|
};
|
|
23191
25323
|
};
|
|
23192
|
-
var mapStateToProps$
|
|
25324
|
+
var mapStateToProps$c = function mapStateToProps(state, props) {
|
|
23193
25325
|
return {
|
|
23194
25326
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
23195
25327
|
componentProps: state.props[props.componentId]
|
|
23196
|
-
};
|
|
23197
|
-
};
|
|
23198
|
-
var mapDispatchtoProps$
|
|
23199
|
-
updateQuery: updateQuery$
|
|
23200
|
-
setQueryOptions: setQueryOptions$
|
|
23201
|
-
setCustomQuery: setCustomQuery$
|
|
25328
|
+
};
|
|
25329
|
+
};
|
|
25330
|
+
var mapDispatchtoProps$a = {
|
|
25331
|
+
updateQuery: updateQuery$9,
|
|
25332
|
+
setQueryOptions: setQueryOptions$9,
|
|
25333
|
+
setCustomQuery: setCustomQuery$8
|
|
23202
25334
|
};
|
|
23203
|
-
var RangeConnected$1 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$
|
|
25335
|
+
var RangeConnected$1 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$c, mapDispatchtoProps$a)(SingleRange), {
|
|
23204
25336
|
componentType: constants_1$1.singleRange
|
|
23205
25337
|
}));
|
|
23206
25338
|
RangeConnected$1.name = SingleRange.name;
|
|
@@ -23213,13 +25345,13 @@
|
|
|
23213
25345
|
// Add componentType for SSR
|
|
23214
25346
|
RangeConnected$1.componentType = constants_1$1.singleRange;
|
|
23215
25347
|
|
|
23216
|
-
function _isSlot$
|
|
25348
|
+
function _isSlot$b(s) {
|
|
23217
25349
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
23218
25350
|
}
|
|
23219
|
-
var updateQuery$
|
|
23220
|
-
setQueryOptions$
|
|
23221
|
-
setCustomQuery$
|
|
23222
|
-
var isEqual$
|
|
25351
|
+
var updateQuery$a = lib_5.updateQuery,
|
|
25352
|
+
setQueryOptions$a = lib_5.setQueryOptions,
|
|
25353
|
+
setCustomQuery$9 = lib_5.setCustomQuery;
|
|
25354
|
+
var isEqual$d = lib_8.isEqual,
|
|
23223
25355
|
checkValueChange$8 = lib_8.checkValueChange,
|
|
23224
25356
|
getClassName$c = lib_8.getClassName,
|
|
23225
25357
|
getOptionsFromQuery$2 = lib_8.getOptionsFromQuery;
|
|
@@ -23345,12 +25477,12 @@
|
|
|
23345
25477
|
this.selectItem(newVal, true, undefined, true);
|
|
23346
25478
|
},
|
|
23347
25479
|
value: function value(newVal, oldVal) {
|
|
23348
|
-
if (!isEqual$
|
|
25480
|
+
if (!isEqual$d(newVal, oldVal)) {
|
|
23349
25481
|
this.selectItem(newVal, true, undefined, true);
|
|
23350
25482
|
}
|
|
23351
25483
|
},
|
|
23352
25484
|
selectedValue: function selectedValue(newVal) {
|
|
23353
|
-
if (!isEqual$
|
|
25485
|
+
if (!isEqual$d(this.$data.currentValue, newVal)) {
|
|
23354
25486
|
var processSelectedValues = newVal ? newVal.map(function (item) {
|
|
23355
25487
|
if (typeof item === 'object' && 'label' in item) {
|
|
23356
25488
|
return item.label;
|
|
@@ -23390,278 +25522,42 @@
|
|
|
23390
25522
|
"default": function _default() {
|
|
23391
25523
|
return [_this2.$props.title];
|
|
23392
25524
|
}
|
|
23393
|
-
}), vue.createVNode(UL, {
|
|
23394
|
-
"class": getClassName$c(_this2.$props.innerClass, 'list')
|
|
23395
|
-
}, _isSlot$
|
|
23396
|
-
var selected = !!_this2.$data.currentValue && _this2.$data.currentValue.label === item.label;
|
|
23397
|
-
return vue.createVNode("li", {
|
|
23398
|
-
"key": item.label,
|
|
23399
|
-
"class": "" + (selected ? 'active' : '')
|
|
23400
|
-
}, [vue.createVNode(Checkbox, vue.mergeProps(babelHelperVueTransformOn({
|
|
23401
|
-
click: _this2.handleClick
|
|
23402
|
-
}), {
|
|
23403
|
-
"class": getClassName$c(_this2.$props.innerClass, 'checkbox'),
|
|
23404
|
-
"id": _this2.$props.componentId + "-" + item.label,
|
|
23405
|
-
"name": _this2.$props.componentId,
|
|
23406
|
-
"value": item.label,
|
|
23407
|
-
"type": "Checkbox",
|
|
23408
|
-
"show": _this2.$props.showCheckbox,
|
|
23409
|
-
"checked": _this2.selectedValues[item.label]
|
|
23410
|
-
}), null), vue.createVNode("label", {
|
|
23411
|
-
"class": getClassName$c(_this2.$props.innerClass, 'label'),
|
|
23412
|
-
"for": _this2.$props.componentId + "-" + item.label
|
|
23413
|
-
}, [item.label])]);
|
|
23414
|
-
})) ? _slot : {
|
|
23415
|
-
"default": function _default() {
|
|
23416
|
-
return [_slot];
|
|
23417
|
-
}
|
|
23418
|
-
})];
|
|
23419
|
-
}
|
|
23420
|
-
});
|
|
23421
|
-
}
|
|
23422
|
-
};
|
|
23423
|
-
MultiRange.parseValue = function (value, props) {
|
|
23424
|
-
return value ? props.data.filter(function (item) {
|
|
23425
|
-
return value.includes(item.label);
|
|
23426
|
-
}) : null;
|
|
23427
|
-
};
|
|
23428
|
-
MultiRange.defaultQuery = function (value, props) {
|
|
23429
|
-
return {
|
|
23430
|
-
query: {
|
|
23431
|
-
queryFormat: props.queryFormat,
|
|
23432
|
-
dataField: props.dataField,
|
|
23433
|
-
value: value,
|
|
23434
|
-
showMissing: props.showMissing
|
|
23435
|
-
}
|
|
23436
|
-
};
|
|
23437
|
-
};
|
|
23438
|
-
var mapStateToProps$b = function mapStateToProps(state, props) {
|
|
23439
|
-
return {
|
|
23440
|
-
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
23441
|
-
componentProps: state.props[props.componentId]
|
|
23442
|
-
};
|
|
23443
|
-
};
|
|
23444
|
-
var mapDispatchtoProps$9 = {
|
|
23445
|
-
updateQuery: updateQuery$9,
|
|
23446
|
-
setQueryOptions: setQueryOptions$8,
|
|
23447
|
-
setCustomQuery: setCustomQuery$8
|
|
23448
|
-
};
|
|
23449
|
-
var RangeConnected$2 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$b, mapDispatchtoProps$9)(MultiRange), {
|
|
23450
|
-
componentType: constants_1$1.multiRange
|
|
23451
|
-
}));
|
|
23452
|
-
RangeConnected$2.name = MultiRange.name;
|
|
23453
|
-
RangeConnected$2.defaultQuery = MultiRange.defaultQuery;
|
|
23454
|
-
RangeConnected$2.parseValue = MultiRange.parseValue;
|
|
23455
|
-
RangeConnected$2.hasInternalComponent = MultiRange.hasInternalComponent;
|
|
23456
|
-
RangeConnected$2.install = function (Vue) {
|
|
23457
|
-
Vue.component(RangeConnected$2.name, RangeConnected$2);
|
|
23458
|
-
};
|
|
23459
|
-
// Add componentType for SSR
|
|
23460
|
-
RangeConnected$2.componentType = constants_1$1.multiRange;
|
|
23461
|
-
|
|
23462
|
-
var updateQuery$a = lib_5.updateQuery,
|
|
23463
|
-
setQueryOptions$9 = lib_5.setQueryOptions,
|
|
23464
|
-
setCustomQuery$9 = lib_5.setCustomQuery;
|
|
23465
|
-
var checkValueChange$9 = lib_8.checkValueChange,
|
|
23466
|
-
getClassName$d = lib_8.getClassName,
|
|
23467
|
-
getOptionsFromQuery$3 = lib_8.getOptionsFromQuery,
|
|
23468
|
-
isEqual$d = lib_8.isEqual;
|
|
23469
|
-
var RangeSlider = {
|
|
23470
|
-
name: 'RangeSlider',
|
|
23471
|
-
components: getComponents(),
|
|
23472
|
-
inject: {
|
|
23473
|
-
theme: {
|
|
23474
|
-
from: 'theme_reactivesearch'
|
|
23475
|
-
}
|
|
23476
|
-
},
|
|
23477
|
-
data: function data() {
|
|
23478
|
-
var state = {
|
|
23479
|
-
currentValue: this.$props.range ? [this.$props.range.start, this.$props.range.end] : [],
|
|
23480
|
-
stats: []
|
|
23481
|
-
};
|
|
23482
|
-
return state;
|
|
23483
|
-
},
|
|
23484
|
-
props: {
|
|
23485
|
-
beforeValueChange: types.func,
|
|
23486
|
-
className: Q.string.def(''),
|
|
23487
|
-
range: Q.shape({
|
|
23488
|
-
start: Q.integer.def(0),
|
|
23489
|
-
end: Q.integer.def(10)
|
|
23490
|
-
}),
|
|
23491
|
-
rangeLabels: types.rangeLabels,
|
|
23492
|
-
componentId: types.stringRequired,
|
|
23493
|
-
customQuery: types.func,
|
|
23494
|
-
data: types.data,
|
|
23495
|
-
dataField: types.stringRequired,
|
|
23496
|
-
defaultValue: types.range,
|
|
23497
|
-
value: types.range,
|
|
23498
|
-
filterLabel: types.string,
|
|
23499
|
-
innerClass: types.style,
|
|
23500
|
-
react: types.react,
|
|
23501
|
-
showFilter: Q.bool.def(true),
|
|
23502
|
-
showCheckbox: Q.bool.def(true),
|
|
23503
|
-
title: types.title,
|
|
23504
|
-
URLParams: Q.bool.def(false),
|
|
23505
|
-
sliderOptions: Q.object.def({}),
|
|
23506
|
-
nestedField: types.string,
|
|
23507
|
-
index: Q.string,
|
|
23508
|
-
endpoint: types.endpointConfig
|
|
23509
|
-
},
|
|
23510
|
-
methods: {
|
|
23511
|
-
handleSliderChange: function handleSliderChange(values) {
|
|
23512
|
-
var value = this.$props.value;
|
|
23513
|
-
if (value === undefined) {
|
|
23514
|
-
this.handleChange(values);
|
|
23515
|
-
} else {
|
|
23516
|
-
this.$emit('change', {
|
|
23517
|
-
start: values[0],
|
|
23518
|
-
end: values[1]
|
|
23519
|
-
});
|
|
23520
|
-
}
|
|
23521
|
-
},
|
|
23522
|
-
handleSlider: function handleSlider() {
|
|
23523
|
-
var sliderValues = this.$refs.slider.getValue();
|
|
23524
|
-
this.handleSliderChange(sliderValues);
|
|
23525
|
-
},
|
|
23526
|
-
handleChange: function handleChange(currentValue, props) {
|
|
23527
|
-
var _this = this;
|
|
23528
|
-
if (props === void 0) {
|
|
23529
|
-
props = this.$props;
|
|
23530
|
-
}
|
|
23531
|
-
var performUpdate = function performUpdate() {
|
|
23532
|
-
_this.currentValue = currentValue;
|
|
23533
|
-
_this.updateQueryHandler([currentValue[0], currentValue[1]], props);
|
|
23534
|
-
_this.$emit('valueChange', {
|
|
23535
|
-
start: currentValue[0],
|
|
23536
|
-
end: currentValue[1]
|
|
23537
|
-
});
|
|
23538
|
-
_this.$emit('value-change', {
|
|
23539
|
-
start: currentValue[0],
|
|
23540
|
-
end: currentValue[1]
|
|
23541
|
-
});
|
|
23542
|
-
};
|
|
23543
|
-
checkValueChange$9(props.componentId, {
|
|
23544
|
-
start: currentValue[0],
|
|
23545
|
-
end: currentValue[1]
|
|
23546
|
-
}, props.beforeValueChange, performUpdate);
|
|
23547
|
-
},
|
|
23548
|
-
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
23549
|
-
var customQuery = props.customQuery;
|
|
23550
|
-
var query = RangeSlider.defaultQuery(value, props);
|
|
23551
|
-
if (customQuery) {
|
|
23552
|
-
var _ref = customQuery(value, props) || {};
|
|
23553
|
-
query = _ref.query;
|
|
23554
|
-
var customQueryOptions = getOptionsFromQuery$3(customQuery(value, props));
|
|
23555
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
23556
|
-
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
23557
|
-
}
|
|
23558
|
-
var showFilter = props.showFilter,
|
|
23559
|
-
_props$range = props.range,
|
|
23560
|
-
start = _props$range.start,
|
|
23561
|
-
end = _props$range.end;
|
|
23562
|
-
var currentStart = value[0],
|
|
23563
|
-
currentEnd = value[1];
|
|
23564
|
-
// check if the slider is at its initial position
|
|
23565
|
-
var isInitialValue = currentStart === start && currentEnd === end;
|
|
23566
|
-
this.updateQuery({
|
|
23567
|
-
componentId: props.componentId,
|
|
23568
|
-
query: query,
|
|
23569
|
-
value: value,
|
|
23570
|
-
label: props.filterLabel,
|
|
23571
|
-
showFilter: showFilter && !isInitialValue,
|
|
23572
|
-
URLParams: props.URLParams,
|
|
23573
|
-
componentType: constants_1$1.rangeSlider
|
|
23574
|
-
});
|
|
23575
|
-
}
|
|
23576
|
-
},
|
|
23577
|
-
watch: {
|
|
23578
|
-
defaultValue: function defaultValue(newVal) {
|
|
23579
|
-
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
23580
|
-
},
|
|
23581
|
-
value: function value(newVal, oldVal) {
|
|
23582
|
-
if (!isEqual$d(newVal, oldVal)) {
|
|
23583
|
-
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
23584
|
-
}
|
|
23585
|
-
},
|
|
23586
|
-
selectedValue: function selectedValue(newVal) {
|
|
23587
|
-
if (!isEqual$d(this.$data.currentValue, newVal)) {
|
|
23588
|
-
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
23589
|
-
this.$emit('change', newVal);
|
|
23590
|
-
}
|
|
23591
|
-
},
|
|
23592
|
-
customQuery: function customQuery(newVal, oldVal) {
|
|
23593
|
-
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
23594
|
-
this.updateQueryHandler(this.$data.currentValue, this.$props);
|
|
23595
|
-
}
|
|
23596
|
-
}
|
|
23597
|
-
},
|
|
23598
|
-
created: function created() {
|
|
23599
|
-
if (!this.$props.range) {
|
|
23600
|
-
console.error('%crange is not defined. Read more about this at https://opensource.appbase.io/reactive-manual/vue/range-components/rangeslider.html#props', 'font-size: 12.5px;');
|
|
23601
|
-
}
|
|
23602
|
-
|
|
23603
|
-
// Set custom query in store
|
|
23604
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
23605
|
-
var _this$$props = this.$props,
|
|
23606
|
-
value = _this$$props.value,
|
|
23607
|
-
defaultValue = _this$$props.defaultValue;
|
|
23608
|
-
var selectedValue = this.selectedValue;
|
|
23609
|
-
if (this.$props.range) {
|
|
23610
|
-
if (Array.isArray(selectedValue)) {
|
|
23611
|
-
this.handleChange(selectedValue);
|
|
23612
|
-
} else if (selectedValue) {
|
|
23613
|
-
this.handleChange(RangeSlider.parseValue(selectedValue, this.$props));
|
|
23614
|
-
} else if (value) {
|
|
23615
|
-
this.handleChange(RangeSlider.parseValue(value, this.$props));
|
|
23616
|
-
} else if (defaultValue) {
|
|
23617
|
-
this.handleChange(RangeSlider.parseValue(defaultValue, this.$props));
|
|
23618
|
-
}
|
|
23619
|
-
}
|
|
23620
|
-
},
|
|
23621
|
-
render: function render() {
|
|
23622
|
-
var _this2 = this;
|
|
23623
|
-
return vue.createVNode(Container, {
|
|
23624
|
-
"class": this.$props.className
|
|
23625
|
-
}, {
|
|
23626
|
-
"default": function _default() {
|
|
23627
|
-
return [_this2.$props.title && vue.createVNode(Title, {
|
|
23628
|
-
"class": getClassName$d(_this2.$props.innerClass, 'title')
|
|
23629
|
-
}, {
|
|
23630
|
-
"default": function _default() {
|
|
23631
|
-
return [_this2.$props.title];
|
|
23632
|
-
}
|
|
23633
|
-
}), _this2.$props.range ? vue.createVNode(NoSSR, null, {
|
|
25525
|
+
}), vue.createVNode(UL, {
|
|
25526
|
+
"class": getClassName$c(_this2.$props.innerClass, 'list')
|
|
25527
|
+
}, _isSlot$b(_slot = _this2.$props.data.map(function (item) {
|
|
25528
|
+
var selected = !!_this2.$data.currentValue && _this2.$data.currentValue.label === item.label;
|
|
25529
|
+
return vue.createVNode("li", {
|
|
25530
|
+
"key": item.label,
|
|
25531
|
+
"class": "" + (selected ? 'active' : '')
|
|
25532
|
+
}, [vue.createVNode(Checkbox, vue.mergeProps(babelHelperVueTransformOn({
|
|
25533
|
+
click: _this2.handleClick
|
|
25534
|
+
}), {
|
|
25535
|
+
"class": getClassName$c(_this2.$props.innerClass, 'checkbox'),
|
|
25536
|
+
"id": _this2.$props.componentId + "-" + item.label,
|
|
25537
|
+
"name": _this2.$props.componentId,
|
|
25538
|
+
"value": item.label,
|
|
25539
|
+
"type": "Checkbox",
|
|
25540
|
+
"show": _this2.$props.showCheckbox,
|
|
25541
|
+
"checked": _this2.selectedValues[item.label]
|
|
25542
|
+
}), null), vue.createVNode("label", {
|
|
25543
|
+
"class": getClassName$c(_this2.$props.innerClass, 'label'),
|
|
25544
|
+
"for": _this2.$props.componentId + "-" + item.label
|
|
25545
|
+
}, [item.label])]);
|
|
25546
|
+
})) ? _slot : {
|
|
23634
25547
|
"default": function _default() {
|
|
23635
|
-
return [
|
|
23636
|
-
"class": getClassName$d(_this2.$props.innerClass, 'slider')
|
|
23637
|
-
}, {
|
|
23638
|
-
"default": function _default() {
|
|
23639
|
-
return [vue.createVNode(vue.resolveComponent("vue-slider-component"), vue.mergeProps({
|
|
23640
|
-
"ref": "slider",
|
|
23641
|
-
"modelValue": _this2.currentValue,
|
|
23642
|
-
"min": _this2.$props.range.start,
|
|
23643
|
-
"max": _this2.$props.range.end,
|
|
23644
|
-
"dotSize": 20,
|
|
23645
|
-
"height": 4,
|
|
23646
|
-
"enable-cross": false,
|
|
23647
|
-
"onDrag-end": _this2.handleSlider,
|
|
23648
|
-
"tooltip": "always"
|
|
23649
|
-
}, _this2.$props.sliderOptions), null), _this2.$props.rangeLabels && vue.createVNode("div", {
|
|
23650
|
-
"class": "label-container"
|
|
23651
|
-
}, [vue.createVNode("label", {
|
|
23652
|
-
"class": getClassName$d(_this2.$props.innerClass, 'label') || 'range-label-left'
|
|
23653
|
-
}, [_this2.$props.rangeLabels.start]), vue.createVNode("label", {
|
|
23654
|
-
"class": getClassName$d(_this2.$props.innerClass, 'label') || 'range-label-right'
|
|
23655
|
-
}, [_this2.$props.rangeLabels.end])])];
|
|
23656
|
-
}
|
|
23657
|
-
})];
|
|
25548
|
+
return [_slot];
|
|
23658
25549
|
}
|
|
23659
|
-
})
|
|
25550
|
+
})];
|
|
23660
25551
|
}
|
|
23661
25552
|
});
|
|
23662
25553
|
}
|
|
23663
25554
|
};
|
|
23664
|
-
|
|
25555
|
+
MultiRange.parseValue = function (value, props) {
|
|
25556
|
+
return value ? props.data.filter(function (item) {
|
|
25557
|
+
return value.includes(item.label);
|
|
25558
|
+
}) : null;
|
|
25559
|
+
};
|
|
25560
|
+
MultiRange.defaultQuery = function (value, props) {
|
|
23665
25561
|
return {
|
|
23666
25562
|
query: {
|
|
23667
25563
|
queryFormat: props.queryFormat,
|
|
@@ -23671,58 +25567,40 @@
|
|
|
23671
25567
|
}
|
|
23672
25568
|
};
|
|
23673
25569
|
};
|
|
23674
|
-
|
|
23675
|
-
if (value) {
|
|
23676
|
-
return Array.isArray(value) ? value : [value.start, value.end];
|
|
23677
|
-
}
|
|
23678
|
-
if (props.range) {
|
|
23679
|
-
return [props.range.start, props.range.end];
|
|
23680
|
-
}
|
|
23681
|
-
return [];
|
|
23682
|
-
};
|
|
23683
|
-
var mapStateToProps$c = function mapStateToProps(state, props) {
|
|
25570
|
+
var mapStateToProps$d = function mapStateToProps(state, props) {
|
|
23684
25571
|
return {
|
|
23685
|
-
|
|
23686
|
-
: [],
|
|
23687
|
-
selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
|
|
25572
|
+
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
23688
25573
|
componentProps: state.props[props.componentId]
|
|
23689
25574
|
};
|
|
23690
25575
|
};
|
|
23691
|
-
var mapDispatchtoProps$
|
|
25576
|
+
var mapDispatchtoProps$b = {
|
|
23692
25577
|
updateQuery: updateQuery$a,
|
|
23693
|
-
setQueryOptions: setQueryOptions$
|
|
25578
|
+
setQueryOptions: setQueryOptions$a,
|
|
23694
25579
|
setCustomQuery: setCustomQuery$9
|
|
23695
25580
|
};
|
|
23696
|
-
var RangeConnected$
|
|
23697
|
-
componentType: constants_1$1.
|
|
25581
|
+
var RangeConnected$2 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$d, mapDispatchtoProps$b)(MultiRange), {
|
|
25582
|
+
componentType: constants_1$1.multiRange
|
|
23698
25583
|
}));
|
|
23699
|
-
RangeConnected$
|
|
23700
|
-
RangeConnected$
|
|
23701
|
-
RangeConnected$
|
|
23702
|
-
RangeConnected$
|
|
23703
|
-
RangeConnected$
|
|
23704
|
-
Vue.component(RangeConnected$
|
|
25584
|
+
RangeConnected$2.name = MultiRange.name;
|
|
25585
|
+
RangeConnected$2.defaultQuery = MultiRange.defaultQuery;
|
|
25586
|
+
RangeConnected$2.parseValue = MultiRange.parseValue;
|
|
25587
|
+
RangeConnected$2.hasInternalComponent = MultiRange.hasInternalComponent;
|
|
25588
|
+
RangeConnected$2.install = function (Vue) {
|
|
25589
|
+
Vue.component(RangeConnected$2.name, RangeConnected$2);
|
|
23705
25590
|
};
|
|
23706
|
-
|
|
23707
25591
|
// Add componentType for SSR
|
|
23708
|
-
RangeConnected$
|
|
23709
|
-
|
|
23710
|
-
var _templateObject$p;
|
|
23711
|
-
var alert = function alert(_ref) {
|
|
23712
|
-
var theme = _ref.theme;
|
|
23713
|
-
return "\n\tcolor: " + theme.colors.alertColor + ";\n";
|
|
23714
|
-
};
|
|
23715
|
-
var Content = styled('div')(_templateObject$p || (_templateObject$p = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
|
|
23716
|
-
return props.alert && alert;
|
|
23717
|
-
});
|
|
25592
|
+
RangeConnected$2.componentType = constants_1$1.multiRange;
|
|
23718
25593
|
|
|
23719
|
-
var
|
|
25594
|
+
var updateQuery$b = lib_5.updateQuery,
|
|
25595
|
+
setQueryOptions$b = lib_5.setQueryOptions,
|
|
25596
|
+
setCustomQuery$a = lib_5.setCustomQuery;
|
|
25597
|
+
var checkValueChange$9 = lib_8.checkValueChange,
|
|
25598
|
+
getClassName$d = lib_8.getClassName,
|
|
25599
|
+
getOptionsFromQuery$3 = lib_8.getOptionsFromQuery,
|
|
23720
25600
|
isEqual$e = lib_8.isEqual;
|
|
23721
|
-
var
|
|
23722
|
-
name: '
|
|
23723
|
-
components:
|
|
23724
|
-
RangeSlider: RangeConnected$3
|
|
23725
|
-
},
|
|
25601
|
+
var RangeSlider = {
|
|
25602
|
+
name: 'RangeSlider',
|
|
25603
|
+
components: getComponents(),
|
|
23726
25604
|
inject: {
|
|
23727
25605
|
theme: {
|
|
23728
25606
|
from: 'theme_reactivesearch'
|
|
@@ -23730,43 +25608,27 @@
|
|
|
23730
25608
|
},
|
|
23731
25609
|
data: function data() {
|
|
23732
25610
|
var state = {
|
|
23733
|
-
currentValue:
|
|
23734
|
-
|
|
23735
|
-
end: this.$props.range ? this.$props.range.end : 10
|
|
23736
|
-
},
|
|
23737
|
-
isStartValid: true,
|
|
23738
|
-
isEndValid: true
|
|
25611
|
+
currentValue: this.$props.range ? [this.$props.range.start, this.$props.range.end] : [],
|
|
25612
|
+
stats: []
|
|
23739
25613
|
};
|
|
23740
25614
|
return state;
|
|
23741
25615
|
},
|
|
23742
25616
|
props: {
|
|
23743
|
-
|
|
23744
|
-
|
|
23745
|
-
|
|
23746
|
-
|
|
23747
|
-
|
|
23748
|
-
|
|
23749
|
-
value: types.range,
|
|
23750
|
-
dataField: types.stringRequired,
|
|
23751
|
-
innerClass: types.style,
|
|
23752
|
-
range: {
|
|
23753
|
-
types: types.range,
|
|
23754
|
-
"default": function _default() {
|
|
23755
|
-
return {
|
|
23756
|
-
start: 0,
|
|
23757
|
-
end: 10
|
|
23758
|
-
};
|
|
23759
|
-
}
|
|
23760
|
-
},
|
|
25617
|
+
beforeValueChange: types.func,
|
|
25618
|
+
className: Q.string.def(''),
|
|
25619
|
+
range: Q.shape({
|
|
25620
|
+
start: Q.integer.def(0),
|
|
25621
|
+
end: Q.integer.def(10)
|
|
25622
|
+
}),
|
|
23761
25623
|
rangeLabels: types.rangeLabels,
|
|
23762
|
-
stepValue: types.number,
|
|
23763
|
-
componentStyle: types.style,
|
|
23764
25624
|
componentId: types.stringRequired,
|
|
23765
|
-
includeNullValues: Q.bool,
|
|
23766
|
-
beforeValueChange: types.func,
|
|
23767
25625
|
customQuery: types.func,
|
|
23768
25626
|
data: types.data,
|
|
25627
|
+
dataField: types.stringRequired,
|
|
25628
|
+
defaultValue: types.range,
|
|
25629
|
+
value: types.range,
|
|
23769
25630
|
filterLabel: types.string,
|
|
25631
|
+
innerClass: types.style,
|
|
23770
25632
|
react: types.react,
|
|
23771
25633
|
showFilter: Q.bool.def(true),
|
|
23772
25634
|
showCheckbox: Q.bool.def(true),
|
|
@@ -23774,524 +25636,521 @@
|
|
|
23774
25636
|
URLParams: Q.bool.def(false),
|
|
23775
25637
|
sliderOptions: Q.object.def({}),
|
|
23776
25638
|
nestedField: types.string,
|
|
25639
|
+
index: Q.string,
|
|
23777
25640
|
endpoint: types.endpointConfig
|
|
23778
25641
|
},
|
|
23779
25642
|
methods: {
|
|
23780
|
-
|
|
23781
|
-
var
|
|
23782
|
-
if (
|
|
23783
|
-
|
|
23784
|
-
}
|
|
23785
|
-
|
|
23786
|
-
|
|
25643
|
+
handleSliderChange: function handleSliderChange(values) {
|
|
25644
|
+
var value = this.$props.value;
|
|
25645
|
+
if (value === undefined) {
|
|
25646
|
+
this.handleChange(values);
|
|
25647
|
+
} else {
|
|
25648
|
+
this.$emit('change', {
|
|
25649
|
+
start: values[0],
|
|
25650
|
+
end: values[1]
|
|
25651
|
+
});
|
|
23787
25652
|
}
|
|
23788
|
-
return false;
|
|
23789
25653
|
},
|
|
23790
|
-
|
|
23791
|
-
|
|
23792
|
-
|
|
23793
|
-
}
|
|
23794
|
-
return false;
|
|
25654
|
+
handleSlider: function handleSlider() {
|
|
25655
|
+
var sliderValues = this.$refs.slider.getValue();
|
|
25656
|
+
this.handleSliderChange(sliderValues);
|
|
23795
25657
|
},
|
|
23796
|
-
handleChange: function handleChange(
|
|
23797
|
-
var
|
|
23798
|
-
if (
|
|
23799
|
-
|
|
23800
|
-
case 'change':
|
|
23801
|
-
if (!value) {
|
|
23802
|
-
currentValue = {
|
|
23803
|
-
start: this.$props.range ? this.$props.range.start : 0,
|
|
23804
|
-
end: this.$props.range ? this.$props.range.end : 10
|
|
23805
|
-
};
|
|
23806
|
-
}
|
|
23807
|
-
this.currentValue = currentValue;
|
|
23808
|
-
this.$emit('change', this.currentValue);
|
|
23809
|
-
break;
|
|
23810
|
-
case 'value-change':
|
|
23811
|
-
this.$emit('valueChange', this.currentValue);
|
|
23812
|
-
this.$emit('value-change', this.currentValue);
|
|
23813
|
-
break;
|
|
23814
|
-
default:
|
|
23815
|
-
this.currentValue = _extends({}, currentValue);
|
|
23816
|
-
break;
|
|
23817
|
-
}
|
|
25658
|
+
handleChange: function handleChange(currentValue, props) {
|
|
25659
|
+
var _this = this;
|
|
25660
|
+
if (props === void 0) {
|
|
25661
|
+
props = this.$props;
|
|
23818
25662
|
}
|
|
25663
|
+
var performUpdate = function performUpdate() {
|
|
25664
|
+
_this.currentValue = currentValue;
|
|
25665
|
+
_this.updateQueryHandler([currentValue[0], currentValue[1]], props);
|
|
25666
|
+
_this.$emit('valueChange', {
|
|
25667
|
+
start: currentValue[0],
|
|
25668
|
+
end: currentValue[1]
|
|
25669
|
+
});
|
|
25670
|
+
_this.$emit('value-change', {
|
|
25671
|
+
start: currentValue[0],
|
|
25672
|
+
end: currentValue[1]
|
|
25673
|
+
});
|
|
25674
|
+
};
|
|
25675
|
+
checkValueChange$9(props.componentId, {
|
|
25676
|
+
start: currentValue[0],
|
|
25677
|
+
end: currentValue[1]
|
|
25678
|
+
}, props.beforeValueChange, performUpdate);
|
|
23819
25679
|
},
|
|
23820
|
-
|
|
23821
|
-
|
|
23822
|
-
|
|
23823
|
-
|
|
23824
|
-
|
|
23825
|
-
|
|
23826
|
-
|
|
23827
|
-
|
|
23828
|
-
|
|
23829
|
-
value = _e$target.value;
|
|
23830
|
-
if (Number.isNaN(value)) {
|
|
23831
|
-
if (name === 'start') {
|
|
23832
|
-
this.isStartValid = false;
|
|
23833
|
-
} else {
|
|
23834
|
-
this.isEndValid = false;
|
|
23835
|
-
}
|
|
23836
|
-
} else if (name === 'start' && !this.isStartValid) {
|
|
23837
|
-
this.isStartValid = true;
|
|
23838
|
-
} else if (name === 'end' && !this.isEndValid) {
|
|
23839
|
-
this.isEndValid = true;
|
|
23840
|
-
}
|
|
23841
|
-
if (this.isStartValid && this.isEndValid) {
|
|
23842
|
-
if (name === 'start') {
|
|
23843
|
-
this.handleChange({
|
|
23844
|
-
start: Number(value),
|
|
23845
|
-
end: this.currentValue.end
|
|
23846
|
-
}, 'change');
|
|
23847
|
-
} else {
|
|
23848
|
-
this.handleChange({
|
|
23849
|
-
start: this.currentValue.start,
|
|
23850
|
-
end: Number(value)
|
|
23851
|
-
}, 'change');
|
|
23852
|
-
}
|
|
25680
|
+
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
25681
|
+
var customQuery = props.customQuery;
|
|
25682
|
+
var query = RangeSlider.defaultQuery(value, props);
|
|
25683
|
+
if (customQuery) {
|
|
25684
|
+
var _ref = customQuery(value, props) || {};
|
|
25685
|
+
query = _ref.query;
|
|
25686
|
+
var customQueryOptions = getOptionsFromQuery$3(customQuery(value, props));
|
|
25687
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
25688
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
23853
25689
|
}
|
|
25690
|
+
var showFilter = props.showFilter,
|
|
25691
|
+
_props$range = props.range,
|
|
25692
|
+
start = _props$range.start,
|
|
25693
|
+
end = _props$range.end;
|
|
25694
|
+
var currentStart = value[0],
|
|
25695
|
+
currentEnd = value[1];
|
|
25696
|
+
// check if the slider is at its initial position
|
|
25697
|
+
var isInitialValue = currentStart === start && currentEnd === end;
|
|
25698
|
+
this.updateQuery({
|
|
25699
|
+
componentId: props.componentId,
|
|
25700
|
+
query: query,
|
|
25701
|
+
value: value,
|
|
25702
|
+
label: props.filterLabel,
|
|
25703
|
+
showFilter: showFilter && !isInitialValue,
|
|
25704
|
+
URLParams: props.URLParams,
|
|
25705
|
+
componentType: constants_1$1.rangeSlider
|
|
25706
|
+
});
|
|
23854
25707
|
}
|
|
23855
25708
|
},
|
|
23856
25709
|
watch: {
|
|
23857
|
-
defaultValue: function defaultValue(newVal
|
|
23858
|
-
|
|
23859
|
-
this.handleChange(newVal);
|
|
23860
|
-
}
|
|
25710
|
+
defaultValue: function defaultValue(newVal) {
|
|
25711
|
+
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
23861
25712
|
},
|
|
23862
25713
|
value: function value(newVal, oldVal) {
|
|
23863
25714
|
if (!isEqual$e(newVal, oldVal)) {
|
|
23864
|
-
|
|
23865
|
-
|
|
23866
|
-
|
|
25715
|
+
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
25716
|
+
}
|
|
25717
|
+
},
|
|
25718
|
+
selectedValue: function selectedValue(newVal) {
|
|
25719
|
+
if (!isEqual$e(this.$data.currentValue, newVal)) {
|
|
25720
|
+
this.handleChange(RangeSlider.parseValue(newVal, this.$props));
|
|
25721
|
+
this.$emit('change', newVal);
|
|
25722
|
+
}
|
|
25723
|
+
},
|
|
25724
|
+
customQuery: function customQuery(newVal, oldVal) {
|
|
25725
|
+
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
25726
|
+
this.updateQueryHandler(this.$data.currentValue, this.$props);
|
|
23867
25727
|
}
|
|
23868
25728
|
}
|
|
23869
25729
|
},
|
|
23870
25730
|
created: function created() {
|
|
23871
|
-
if (this.$props.
|
|
23872
|
-
|
|
25731
|
+
if (!this.$props.range) {
|
|
25732
|
+
console.error('%crange is not defined. Read more about this at https://opensource.appbase.io/reactive-manual/vue/range-components/rangeslider.html#props', 'font-size: 12.5px;');
|
|
23873
25733
|
}
|
|
23874
|
-
|
|
23875
|
-
|
|
25734
|
+
|
|
25735
|
+
// Set custom query in store
|
|
25736
|
+
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
25737
|
+
var _this$$props = this.$props,
|
|
25738
|
+
value = _this$$props.value,
|
|
25739
|
+
defaultValue = _this$$props.defaultValue;
|
|
25740
|
+
var selectedValue = this.selectedValue;
|
|
25741
|
+
if (this.$props.range) {
|
|
25742
|
+
if (Array.isArray(selectedValue)) {
|
|
25743
|
+
this.handleChange(selectedValue);
|
|
25744
|
+
} else if (selectedValue) {
|
|
25745
|
+
this.handleChange(RangeSlider.parseValue(selectedValue, this.$props));
|
|
25746
|
+
} else if (value) {
|
|
25747
|
+
this.handleChange(RangeSlider.parseValue(value, this.$props));
|
|
25748
|
+
} else if (defaultValue) {
|
|
25749
|
+
this.handleChange(RangeSlider.parseValue(defaultValue, this.$props));
|
|
25750
|
+
}
|
|
23876
25751
|
}
|
|
23877
25752
|
},
|
|
23878
25753
|
render: function render() {
|
|
23879
|
-
var
|
|
23880
|
-
var _this$$props = this.$props,
|
|
23881
|
-
className = _this$$props.className,
|
|
23882
|
-
dataField = _this$$props.dataField,
|
|
23883
|
-
range = _this$$props.range,
|
|
23884
|
-
rangeLabels = _this$$props.rangeLabels,
|
|
23885
|
-
componentId = _this$$props.componentId,
|
|
23886
|
-
innerClass = _this$$props.innerClass,
|
|
23887
|
-
stepValue = _this$$props.stepValue,
|
|
23888
|
-
componentStyle = _this$$props.componentStyle,
|
|
23889
|
-
themePreset = _this$$props.themePreset,
|
|
23890
|
-
includeNullValues = _this$$props.includeNullValues,
|
|
23891
|
-
beforeValueChange = _this$$props.beforeValueChange,
|
|
23892
|
-
customQuery = _this$$props.customQuery,
|
|
23893
|
-
data = _this$$props.data,
|
|
23894
|
-
filterLabel = _this$$props.filterLabel,
|
|
23895
|
-
react = _this$$props.react,
|
|
23896
|
-
showFilter = _this$$props.showFilter,
|
|
23897
|
-
showCheckbox = _this$$props.showCheckbox,
|
|
23898
|
-
title = _this$$props.title,
|
|
23899
|
-
URLParams = _this$$props.URLParams,
|
|
23900
|
-
sliderOptions = _this$$props.sliderOptions,
|
|
23901
|
-
nestedField = _this$$props.nestedField;
|
|
25754
|
+
var _this2 = this;
|
|
23902
25755
|
return vue.createVNode(Container, {
|
|
23903
|
-
"
|
|
23904
|
-
"class": className
|
|
25756
|
+
"class": this.$props.className
|
|
23905
25757
|
}, {
|
|
23906
25758
|
"default": function _default() {
|
|
23907
|
-
return [vue.createVNode(
|
|
23908
|
-
|
|
23909
|
-
'value-change': _this.handleValueChange
|
|
23910
|
-
}), {
|
|
23911
|
-
"componentId": componentId,
|
|
23912
|
-
"value": {
|
|
23913
|
-
start: _this.currentValue.start,
|
|
23914
|
-
end: _this.currentValue.end
|
|
23915
|
-
},
|
|
23916
|
-
"range": range,
|
|
23917
|
-
"dataField": dataField,
|
|
23918
|
-
"rangeLabels": rangeLabels,
|
|
23919
|
-
"includeNullValues": includeNullValues,
|
|
23920
|
-
"beforeValueChange": beforeValueChange,
|
|
23921
|
-
"customQuery": customQuery,
|
|
23922
|
-
"data": data,
|
|
23923
|
-
"filterLabel": filterLabel,
|
|
23924
|
-
"react": react,
|
|
23925
|
-
"showFilter": showFilter,
|
|
23926
|
-
"showCheckbox": showCheckbox,
|
|
23927
|
-
"title": title,
|
|
23928
|
-
"URLParams": URLParams,
|
|
23929
|
-
"sliderOptions": sliderOptions,
|
|
23930
|
-
"nestedField": nestedField
|
|
23931
|
-
}), null), vue.createVNode(Flex, {
|
|
23932
|
-
"class": getClassName$e(innerClass, 'input-container') || ''
|
|
25759
|
+
return [_this2.$props.title && vue.createVNode(Title, {
|
|
25760
|
+
"class": getClassName$d(_this2.$props.innerClass, 'title')
|
|
23933
25761
|
}, {
|
|
23934
25762
|
"default": function _default() {
|
|
23935
|
-
return [
|
|
23936
|
-
|
|
23937
|
-
|
|
23938
|
-
|
|
23939
|
-
|
|
23940
|
-
|
|
23941
|
-
change: _this.handleInputChange
|
|
23942
|
-
}), {
|
|
23943
|
-
"key": componentId + "-start-value",
|
|
23944
|
-
"name": "start",
|
|
23945
|
-
"type": "number",
|
|
23946
|
-
"step": stepValue,
|
|
23947
|
-
"themePreset": themePreset,
|
|
23948
|
-
"aria-label": componentId + "-start-input",
|
|
23949
|
-
"min": _this.$props.range ? _this.$props.range.start : 0,
|
|
23950
|
-
"class": getClassName$e(innerClass, 'input') || '',
|
|
23951
|
-
"alert": !_this.isStartValid,
|
|
23952
|
-
"value": _this.currentValue.start || 0
|
|
23953
|
-
}), null), !_this.isStartValid && vue.createVNode(Content, {
|
|
23954
|
-
"alert": true
|
|
23955
|
-
}, {
|
|
23956
|
-
"default": function _default() {
|
|
23957
|
-
return [vue.createTextVNode("Input range is invalid")];
|
|
23958
|
-
}
|
|
23959
|
-
})];
|
|
23960
|
-
}
|
|
23961
|
-
}), vue.createVNode(Flex, {
|
|
23962
|
-
"justifyContent": "center",
|
|
23963
|
-
"alignItems": "center",
|
|
23964
|
-
"flex": 1
|
|
23965
|
-
}, {
|
|
23966
|
-
"default": function _default() {
|
|
23967
|
-
return [vue.createTextVNode("-")];
|
|
23968
|
-
}
|
|
23969
|
-
}), vue.createVNode(Flex, {
|
|
23970
|
-
"direction": "column",
|
|
23971
|
-
"flex": 2
|
|
25763
|
+
return [_this2.$props.title];
|
|
25764
|
+
}
|
|
25765
|
+
}), _this2.$props.range ? vue.createVNode(NoSSR, null, {
|
|
25766
|
+
"default": function _default() {
|
|
25767
|
+
return [vue.createVNode(Slider, {
|
|
25768
|
+
"class": getClassName$d(_this2.$props.innerClass, 'slider')
|
|
23972
25769
|
}, {
|
|
23973
25770
|
"default": function _default() {
|
|
23974
|
-
return [vue.createVNode(
|
|
23975
|
-
|
|
23976
|
-
|
|
23977
|
-
"
|
|
23978
|
-
"
|
|
23979
|
-
"
|
|
23980
|
-
"
|
|
23981
|
-
"
|
|
23982
|
-
"
|
|
23983
|
-
"
|
|
23984
|
-
|
|
23985
|
-
"
|
|
23986
|
-
|
|
23987
|
-
|
|
23988
|
-
|
|
23989
|
-
|
|
23990
|
-
|
|
23991
|
-
return [vue.createTextVNode("Input range is invalid")];
|
|
23992
|
-
}
|
|
23993
|
-
})];
|
|
25771
|
+
return [vue.createVNode(vue.resolveComponent("vue-slider-component"), vue.mergeProps({
|
|
25772
|
+
"ref": "slider",
|
|
25773
|
+
"modelValue": _this2.currentValue,
|
|
25774
|
+
"min": _this2.$props.range.start,
|
|
25775
|
+
"max": _this2.$props.range.end,
|
|
25776
|
+
"dotSize": 20,
|
|
25777
|
+
"height": 4,
|
|
25778
|
+
"enable-cross": false,
|
|
25779
|
+
"onDrag-end": _this2.handleSlider,
|
|
25780
|
+
"tooltip": "always"
|
|
25781
|
+
}, _this2.$props.sliderOptions), null), _this2.$props.rangeLabels && vue.createVNode("div", {
|
|
25782
|
+
"class": "label-container"
|
|
25783
|
+
}, [vue.createVNode("label", {
|
|
25784
|
+
"class": getClassName$d(_this2.$props.innerClass, 'label') || 'range-label-left'
|
|
25785
|
+
}, [_this2.$props.rangeLabels.start]), vue.createVNode("label", {
|
|
25786
|
+
"class": getClassName$d(_this2.$props.innerClass, 'label') || 'range-label-right'
|
|
25787
|
+
}, [_this2.$props.rangeLabels.end])])];
|
|
23994
25788
|
}
|
|
23995
25789
|
})];
|
|
23996
25790
|
}
|
|
23997
|
-
})];
|
|
25791
|
+
}) : null];
|
|
23998
25792
|
}
|
|
23999
25793
|
});
|
|
24000
25794
|
}
|
|
24001
25795
|
};
|
|
24002
|
-
|
|
25796
|
+
RangeSlider.defaultQuery = function (value, props) {
|
|
24003
25797
|
return {
|
|
24004
|
-
|
|
25798
|
+
query: {
|
|
25799
|
+
queryFormat: props.queryFormat,
|
|
25800
|
+
dataField: props.dataField,
|
|
25801
|
+
value: value,
|
|
25802
|
+
showMissing: props.showMissing
|
|
25803
|
+
}
|
|
24005
25804
|
};
|
|
24006
25805
|
};
|
|
24007
|
-
|
|
24008
|
-
|
|
25806
|
+
RangeSlider.parseValue = function (value, props) {
|
|
25807
|
+
if (value) {
|
|
25808
|
+
return Array.isArray(value) ? value : [value.start, value.end];
|
|
25809
|
+
}
|
|
25810
|
+
if (props.range) {
|
|
25811
|
+
return [props.range.start, props.range.end];
|
|
25812
|
+
}
|
|
25813
|
+
return [];
|
|
25814
|
+
};
|
|
25815
|
+
var mapStateToProps$e = function mapStateToProps(state, props) {
|
|
25816
|
+
return {
|
|
25817
|
+
options: state.aggregations[props.componentId] ? state.aggregations[props.componentId][props.dataField] && state.aggregations[props.componentId][props.dataField].buckets // eslint-disable-line
|
|
25818
|
+
: [],
|
|
25819
|
+
selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
|
|
25820
|
+
componentProps: state.props[props.componentId]
|
|
25821
|
+
};
|
|
25822
|
+
};
|
|
25823
|
+
var mapDispatchtoProps$c = {
|
|
25824
|
+
updateQuery: updateQuery$b,
|
|
25825
|
+
setQueryOptions: setQueryOptions$b,
|
|
25826
|
+
setCustomQuery: setCustomQuery$a
|
|
25827
|
+
};
|
|
25828
|
+
var RangeConnected$3 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$e, mapDispatchtoProps$c)(RangeSlider), {
|
|
25829
|
+
componentType: constants_1$1.rangeSlider
|
|
24009
25830
|
}));
|
|
24010
|
-
RangeConnected$
|
|
24011
|
-
RangeConnected$
|
|
24012
|
-
|
|
25831
|
+
RangeConnected$3.name = RangeSlider.name;
|
|
25832
|
+
RangeConnected$3.defaultQuery = RangeSlider.defaultQuery;
|
|
25833
|
+
RangeConnected$3.parseValue = RangeSlider.parseValue;
|
|
25834
|
+
RangeConnected$3.hasInternalComponent = RangeSlider.hasInternalComponent;
|
|
25835
|
+
RangeConnected$3.install = function (Vue) {
|
|
25836
|
+
Vue.component(RangeConnected$3.name, RangeConnected$3);
|
|
24013
25837
|
};
|
|
24014
25838
|
|
|
24015
|
-
// Add componentType for SSR
|
|
24016
|
-
RangeConnected$
|
|
24017
|
-
|
|
24018
|
-
var
|
|
24019
|
-
var
|
|
24020
|
-
|
|
24021
|
-
|
|
24022
|
-
|
|
24023
|
-
var
|
|
24024
|
-
|
|
24025
|
-
|
|
24026
|
-
|
|
24027
|
-
|
|
24028
|
-
|
|
24029
|
-
var
|
|
24030
|
-
name: '
|
|
25839
|
+
// Add componentType for SSR
|
|
25840
|
+
RangeConnected$3.componentType = constants_1$1.rangeSlider;
|
|
25841
|
+
|
|
25842
|
+
var _templateObject$q;
|
|
25843
|
+
var alert = function alert(_ref) {
|
|
25844
|
+
var theme = _ref.theme;
|
|
25845
|
+
return "\n\tcolor: " + theme.colors.alertColor + ";\n";
|
|
25846
|
+
};
|
|
25847
|
+
var Content = styled('div')(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
|
|
25848
|
+
return props.alert && alert;
|
|
25849
|
+
});
|
|
25850
|
+
|
|
25851
|
+
var getClassName$e = lib_8.getClassName,
|
|
25852
|
+
isEqual$f = lib_8.isEqual;
|
|
25853
|
+
var RangeInput = {
|
|
25854
|
+
name: 'RangeInput',
|
|
25855
|
+
components: {
|
|
25856
|
+
RangeSlider: RangeConnected$3
|
|
25857
|
+
},
|
|
25858
|
+
inject: {
|
|
25859
|
+
theme: {
|
|
25860
|
+
from: 'theme_reactivesearch'
|
|
25861
|
+
}
|
|
25862
|
+
},
|
|
25863
|
+
data: function data() {
|
|
25864
|
+
var state = {
|
|
25865
|
+
currentValue: {
|
|
25866
|
+
start: this.$props.range ? this.$props.range.start : 0,
|
|
25867
|
+
end: this.$props.range ? this.$props.range.end : 10
|
|
25868
|
+
},
|
|
25869
|
+
isStartValid: true,
|
|
25870
|
+
isEndValid: true
|
|
25871
|
+
};
|
|
25872
|
+
return state;
|
|
25873
|
+
},
|
|
24031
25874
|
props: {
|
|
25875
|
+
className: {
|
|
25876
|
+
types: types.string,
|
|
25877
|
+
"default": ''
|
|
25878
|
+
},
|
|
25879
|
+
defaultValue: types.range,
|
|
25880
|
+
validateRange: types.func,
|
|
25881
|
+
value: types.range,
|
|
25882
|
+
dataField: types.stringRequired,
|
|
25883
|
+
innerClass: types.style,
|
|
25884
|
+
range: {
|
|
25885
|
+
types: types.range,
|
|
25886
|
+
"default": function _default() {
|
|
25887
|
+
return {
|
|
25888
|
+
start: 0,
|
|
25889
|
+
end: 10
|
|
25890
|
+
};
|
|
25891
|
+
}
|
|
25892
|
+
},
|
|
25893
|
+
rangeLabels: types.rangeLabels,
|
|
25894
|
+
stepValue: types.number,
|
|
25895
|
+
componentStyle: types.style,
|
|
24032
25896
|
componentId: types.stringRequired,
|
|
24033
|
-
|
|
24034
|
-
|
|
24035
|
-
size: Q.number,
|
|
24036
|
-
defaultQuery: types.func,
|
|
25897
|
+
includeNullValues: Q.bool,
|
|
25898
|
+
beforeValueChange: types.func,
|
|
24037
25899
|
customQuery: types.func,
|
|
25900
|
+
data: types.data,
|
|
24038
25901
|
filterLabel: types.string,
|
|
24039
25902
|
react: types.react,
|
|
24040
25903
|
showFilter: Q.bool.def(true),
|
|
25904
|
+
showCheckbox: Q.bool.def(true),
|
|
25905
|
+
title: types.title,
|
|
24041
25906
|
URLParams: Q.bool.def(false),
|
|
24042
|
-
|
|
24043
|
-
|
|
24044
|
-
index: Q.string,
|
|
25907
|
+
sliderOptions: Q.object.def({}),
|
|
25908
|
+
nestedField: types.string,
|
|
24045
25909
|
endpoint: types.endpointConfig
|
|
24046
25910
|
},
|
|
24047
|
-
|
|
24048
|
-
|
|
24049
|
-
|
|
24050
|
-
|
|
24051
|
-
|
|
24052
|
-
// Set custom query in store
|
|
24053
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
24054
|
-
var customQuery = props.customQuery,
|
|
24055
|
-
componentId = props.componentId,
|
|
24056
|
-
filterLabel = props.filterLabel,
|
|
24057
|
-
showFilter = props.showFilter,
|
|
24058
|
-
URLParams = props.URLParams;
|
|
24059
|
-
if (customQuery) {
|
|
24060
|
-
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
24061
|
-
var query = extractQueryFromCustomQuery$6(calcCustomQuery);
|
|
24062
|
-
var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery$6(calcCustomQuery) : null;
|
|
24063
|
-
if (customQueryOptions) {
|
|
24064
|
-
this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
|
|
24065
|
-
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
24066
|
-
this.updateQuery({
|
|
24067
|
-
componentId: componentId,
|
|
24068
|
-
query: query,
|
|
24069
|
-
value: this.selectedValue || null,
|
|
24070
|
-
label: filterLabel,
|
|
24071
|
-
showFilter: showFilter,
|
|
24072
|
-
URLParams: URLParams
|
|
24073
|
-
});
|
|
24074
|
-
}
|
|
24075
|
-
this.setQuery = function (_ref) {
|
|
24076
|
-
var options = _ref.options,
|
|
24077
|
-
obj = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
24078
|
-
var queryToBeSet = obj.query;
|
|
24079
|
-
|
|
24080
|
-
// when enableAppbase is true, Backend throws error because of repeated query in request body
|
|
24081
|
-
if (queryToBeSet && queryToBeSet.query) {
|
|
24082
|
-
queryToBeSet = queryToBeSet.query;
|
|
24083
|
-
}
|
|
24084
|
-
var customQueryCalc = _extends({}, options, {
|
|
24085
|
-
query: queryToBeSet
|
|
24086
|
-
});
|
|
24087
|
-
var rsAPIQuery = customQueryCalc;
|
|
24088
|
-
// handle stored queries
|
|
24089
|
-
if (queryToBeSet && queryToBeSet.id) {
|
|
24090
|
-
rsAPIQuery = queryToBeSet;
|
|
24091
|
-
}
|
|
24092
|
-
// Update customQuery field for RS API
|
|
24093
|
-
_this.setCustomQuery(props.componentId, rsAPIQuery);
|
|
24094
|
-
if (options) {
|
|
24095
|
-
_this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
|
|
24096
|
-
}
|
|
24097
|
-
_this.updateQuery(_extends({}, obj, {
|
|
24098
|
-
query: customQueryCalc.query,
|
|
24099
|
-
componentId: props.componentId,
|
|
24100
|
-
label: props.filterLabel,
|
|
24101
|
-
showFilter: props.showFilter,
|
|
24102
|
-
URLParams: props.URLParams
|
|
24103
|
-
}));
|
|
24104
|
-
};
|
|
24105
|
-
if (props.defaultQuery) {
|
|
24106
|
-
this.internalComponent = props.componentId + "__internal";
|
|
24107
|
-
}
|
|
24108
|
-
if (this.internalComponent && this.$props.defaultQuery) {
|
|
24109
|
-
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
24110
|
-
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
24111
|
-
var _query = extractQueryFromCustomQuery$6(this.$defaultQuery);
|
|
24112
|
-
var queryOptions = getOptionsForCustomQuery$6(this.$defaultQuery);
|
|
24113
|
-
if (queryOptions) {
|
|
24114
|
-
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
24115
|
-
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
24116
|
-
this.updateQuery({
|
|
24117
|
-
componentId: this.internalComponent,
|
|
24118
|
-
query: _query
|
|
24119
|
-
});
|
|
24120
|
-
}
|
|
24121
|
-
},
|
|
24122
|
-
watch: {
|
|
24123
|
-
hits: function hits(newVal, oldVal) {
|
|
24124
|
-
if (!isEqual$f(newVal, oldVal)) {
|
|
24125
|
-
this.$emit('data', this.getData());
|
|
24126
|
-
}
|
|
24127
|
-
},
|
|
24128
|
-
rawData: function rawData(newVal, oldVal) {
|
|
24129
|
-
if (!isEqual$f(newVal, oldVal)) {
|
|
24130
|
-
this.$emit('data', this.getData());
|
|
24131
|
-
}
|
|
24132
|
-
},
|
|
24133
|
-
aggregations: function aggregations(newVal, oldVal) {
|
|
24134
|
-
if (!isEqual$f(newVal, oldVal)) {
|
|
24135
|
-
this.$emit('data', this.getData());
|
|
25911
|
+
methods: {
|
|
25912
|
+
shouldUpdate: function shouldUpdate(value) {
|
|
25913
|
+
var validateRange = this.$props.validateRange;
|
|
25914
|
+
if (validateRange && value) {
|
|
25915
|
+
return validateRange([value.start, value.end]);
|
|
24136
25916
|
}
|
|
24137
|
-
|
|
24138
|
-
|
|
24139
|
-
if (!isEqual$f(newVal, oldVal)) {
|
|
24140
|
-
this.$emit('data', this.getData());
|
|
25917
|
+
if (value) {
|
|
25918
|
+
return value.start <= value.end;
|
|
24141
25919
|
}
|
|
25920
|
+
return false;
|
|
24142
25921
|
},
|
|
24143
|
-
|
|
24144
|
-
if (
|
|
24145
|
-
|
|
25922
|
+
isControlled: function isControlled() {
|
|
25923
|
+
if (this.$props.value && this.$attrs) {
|
|
25924
|
+
return true;
|
|
24146
25925
|
}
|
|
25926
|
+
return false;
|
|
24147
25927
|
},
|
|
24148
|
-
|
|
24149
|
-
|
|
24150
|
-
|
|
25928
|
+
handleChange: function handleChange(value, event) {
|
|
25929
|
+
var currentValue = value;
|
|
25930
|
+
if (this.shouldUpdate(value) && !isEqual$f(value, this.currentValue)) {
|
|
25931
|
+
switch (event) {
|
|
25932
|
+
case 'change':
|
|
25933
|
+
if (!value) {
|
|
25934
|
+
currentValue = {
|
|
25935
|
+
start: this.$props.range ? this.$props.range.start : 0,
|
|
25936
|
+
end: this.$props.range ? this.$props.range.end : 10
|
|
25937
|
+
};
|
|
25938
|
+
}
|
|
25939
|
+
this.currentValue = currentValue;
|
|
25940
|
+
this.$emit('change', this.currentValue);
|
|
25941
|
+
break;
|
|
25942
|
+
case 'value-change':
|
|
25943
|
+
this.$emit('valueChange', this.currentValue);
|
|
25944
|
+
this.$emit('value-change', this.currentValue);
|
|
25945
|
+
break;
|
|
25946
|
+
default:
|
|
25947
|
+
this.currentValue = _extends({}, currentValue);
|
|
25948
|
+
break;
|
|
25949
|
+
}
|
|
24151
25950
|
}
|
|
24152
25951
|
},
|
|
24153
|
-
|
|
24154
|
-
|
|
24155
|
-
this.$emit('data', this.getData());
|
|
24156
|
-
}
|
|
25952
|
+
handleOnChange: function handleOnChange(value) {
|
|
25953
|
+
this.handleChange(value || this.$props.range, 'change');
|
|
24157
25954
|
},
|
|
24158
|
-
|
|
24159
|
-
|
|
24160
|
-
this.$emit('data', this.getData());
|
|
24161
|
-
}
|
|
25955
|
+
handleValueChange: function handleValueChange(value) {
|
|
25956
|
+
this.handleChange(value, 'value-change');
|
|
24162
25957
|
},
|
|
24163
|
-
|
|
24164
|
-
|
|
24165
|
-
|
|
24166
|
-
|
|
24167
|
-
|
|
24168
|
-
if (
|
|
24169
|
-
this.
|
|
24170
|
-
} else
|
|
24171
|
-
|
|
24172
|
-
|
|
24173
|
-
|
|
24174
|
-
|
|
24175
|
-
|
|
24176
|
-
|
|
25958
|
+
handleInputChange: function handleInputChange(e) {
|
|
25959
|
+
var _e$target = e.target,
|
|
25960
|
+
name = _e$target.name,
|
|
25961
|
+
value = _e$target.value;
|
|
25962
|
+
if (Number.isNaN(value)) {
|
|
25963
|
+
if (name === 'start') {
|
|
25964
|
+
this.isStartValid = false;
|
|
25965
|
+
} else {
|
|
25966
|
+
this.isEndValid = false;
|
|
25967
|
+
}
|
|
25968
|
+
} else if (name === 'start' && !this.isStartValid) {
|
|
25969
|
+
this.isStartValid = true;
|
|
25970
|
+
} else if (name === 'end' && !this.isEndValid) {
|
|
25971
|
+
this.isEndValid = true;
|
|
24177
25972
|
}
|
|
24178
|
-
|
|
24179
|
-
|
|
24180
|
-
|
|
24181
|
-
|
|
24182
|
-
|
|
24183
|
-
|
|
24184
|
-
|
|
24185
|
-
|
|
24186
|
-
|
|
24187
|
-
|
|
24188
|
-
|
|
24189
|
-
|
|
24190
|
-
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
24191
|
-
this.updateQuery({
|
|
24192
|
-
componentId: componentId,
|
|
24193
|
-
query: query
|
|
24194
|
-
});
|
|
25973
|
+
if (this.isStartValid && this.isEndValid) {
|
|
25974
|
+
if (name === 'start') {
|
|
25975
|
+
this.handleChange({
|
|
25976
|
+
start: Number(value),
|
|
25977
|
+
end: this.currentValue.end
|
|
25978
|
+
}, 'change');
|
|
25979
|
+
} else {
|
|
25980
|
+
this.handleChange({
|
|
25981
|
+
start: this.currentValue.start,
|
|
25982
|
+
end: Number(value)
|
|
25983
|
+
}, 'change');
|
|
25984
|
+
}
|
|
24195
25985
|
}
|
|
24196
25986
|
}
|
|
24197
25987
|
},
|
|
24198
|
-
|
|
24199
|
-
|
|
24200
|
-
|
|
24201
|
-
|
|
24202
|
-
isLoading = this.isLoading,
|
|
24203
|
-
selectedValue = this.selectedValue;
|
|
24204
|
-
var propsToBePassed = _extends({
|
|
24205
|
-
error: error,
|
|
24206
|
-
loading: isLoading
|
|
24207
|
-
}, this.getData(), {
|
|
24208
|
-
value: selectedValue,
|
|
24209
|
-
setQuery: this.setQuery
|
|
24210
|
-
});
|
|
24211
|
-
return vue.createVNode("div", null, [dom(propsToBePassed)]);
|
|
24212
|
-
} catch (e) {
|
|
24213
|
-
return null;
|
|
24214
|
-
}
|
|
24215
|
-
},
|
|
24216
|
-
methods: {
|
|
24217
|
-
getAggsQuery: function getAggsQuery() {
|
|
24218
|
-
if (this.aggregationField) {
|
|
24219
|
-
return {
|
|
24220
|
-
aggs: getCompositeAggsQuery$4({
|
|
24221
|
-
props: this.$props,
|
|
24222
|
-
showTopHits: true,
|
|
24223
|
-
value: this.selectedValue
|
|
24224
|
-
}).aggs
|
|
24225
|
-
};
|
|
25988
|
+
watch: {
|
|
25989
|
+
defaultValue: function defaultValue(newVal, oldVal) {
|
|
25990
|
+
if (oldVal.start !== newVal.start || oldVal.end !== newVal.end) {
|
|
25991
|
+
this.handleChange(newVal);
|
|
24226
25992
|
}
|
|
24227
|
-
return {};
|
|
24228
25993
|
},
|
|
24229
|
-
|
|
24230
|
-
|
|
24231
|
-
|
|
24232
|
-
|
|
24233
|
-
promotedResults = this.promotedResults,
|
|
24234
|
-
rawData = this.rawData;
|
|
24235
|
-
var filteredResults = parseHits$1(hits);
|
|
24236
|
-
if (promotedResults.length) {
|
|
24237
|
-
var ids = promotedResults.map(function (item) {
|
|
24238
|
-
return item._id;
|
|
24239
|
-
}).filter(Boolean);
|
|
24240
|
-
if (ids) {
|
|
24241
|
-
filteredResults = filteredResults.filter(function (item) {
|
|
24242
|
-
return !ids.includes(item._id);
|
|
24243
|
-
});
|
|
25994
|
+
value: function value(newVal, oldVal) {
|
|
25995
|
+
if (!isEqual$f(newVal, oldVal)) {
|
|
25996
|
+
if (this.isControlled()) {
|
|
25997
|
+
this.handleChange(newVal, 'change');
|
|
24244
25998
|
}
|
|
24245
|
-
filteredResults = [].concat(promotedResults, filteredResults);
|
|
24246
25999
|
}
|
|
24247
|
-
return {
|
|
24248
|
-
data: filteredResults,
|
|
24249
|
-
aggregationData: aggregationData,
|
|
24250
|
-
rawData: rawData,
|
|
24251
|
-
aggregations: aggregations,
|
|
24252
|
-
promotedData: promotedResults,
|
|
24253
|
-
resultStats: this.stats
|
|
24254
|
-
};
|
|
24255
26000
|
}
|
|
24256
26001
|
},
|
|
24257
|
-
|
|
24258
|
-
|
|
24259
|
-
|
|
26002
|
+
created: function created() {
|
|
26003
|
+
if (this.$props.defaultValue && this.$props.defaultValue.start && this.$props.defaultValue.end) {
|
|
26004
|
+
this.handleChange(this.$props.defaultValue);
|
|
26005
|
+
}
|
|
26006
|
+
if (this.isControlled()) {
|
|
26007
|
+
this.handleChange(this.$props.value, 'change');
|
|
24260
26008
|
}
|
|
26009
|
+
},
|
|
26010
|
+
render: function render() {
|
|
26011
|
+
var _this = this;
|
|
26012
|
+
var _this$$props = this.$props,
|
|
26013
|
+
className = _this$$props.className,
|
|
26014
|
+
dataField = _this$$props.dataField,
|
|
26015
|
+
range = _this$$props.range,
|
|
26016
|
+
rangeLabels = _this$$props.rangeLabels,
|
|
26017
|
+
componentId = _this$$props.componentId,
|
|
26018
|
+
innerClass = _this$$props.innerClass,
|
|
26019
|
+
stepValue = _this$$props.stepValue,
|
|
26020
|
+
componentStyle = _this$$props.componentStyle,
|
|
26021
|
+
themePreset = _this$$props.themePreset,
|
|
26022
|
+
includeNullValues = _this$$props.includeNullValues,
|
|
26023
|
+
beforeValueChange = _this$$props.beforeValueChange,
|
|
26024
|
+
customQuery = _this$$props.customQuery,
|
|
26025
|
+
data = _this$$props.data,
|
|
26026
|
+
filterLabel = _this$$props.filterLabel,
|
|
26027
|
+
react = _this$$props.react,
|
|
26028
|
+
showFilter = _this$$props.showFilter,
|
|
26029
|
+
showCheckbox = _this$$props.showCheckbox,
|
|
26030
|
+
title = _this$$props.title,
|
|
26031
|
+
URLParams = _this$$props.URLParams,
|
|
26032
|
+
sliderOptions = _this$$props.sliderOptions,
|
|
26033
|
+
nestedField = _this$$props.nestedField;
|
|
26034
|
+
return vue.createVNode(Container, {
|
|
26035
|
+
"style": componentStyle,
|
|
26036
|
+
"class": className
|
|
26037
|
+
}, {
|
|
26038
|
+
"default": function _default() {
|
|
26039
|
+
return [vue.createVNode(RangeConnected$3, vue.mergeProps(babelHelperVueTransformOn({
|
|
26040
|
+
change: _this.handleOnChange,
|
|
26041
|
+
'value-change': _this.handleValueChange
|
|
26042
|
+
}), {
|
|
26043
|
+
"componentId": componentId,
|
|
26044
|
+
"value": {
|
|
26045
|
+
start: _this.currentValue.start,
|
|
26046
|
+
end: _this.currentValue.end
|
|
26047
|
+
},
|
|
26048
|
+
"range": range,
|
|
26049
|
+
"dataField": dataField,
|
|
26050
|
+
"rangeLabels": rangeLabels,
|
|
26051
|
+
"includeNullValues": includeNullValues,
|
|
26052
|
+
"beforeValueChange": beforeValueChange,
|
|
26053
|
+
"customQuery": customQuery,
|
|
26054
|
+
"data": data,
|
|
26055
|
+
"filterLabel": filterLabel,
|
|
26056
|
+
"react": react,
|
|
26057
|
+
"showFilter": showFilter,
|
|
26058
|
+
"showCheckbox": showCheckbox,
|
|
26059
|
+
"title": title,
|
|
26060
|
+
"URLParams": URLParams,
|
|
26061
|
+
"sliderOptions": sliderOptions,
|
|
26062
|
+
"nestedField": nestedField
|
|
26063
|
+
}), null), vue.createVNode(Flex, {
|
|
26064
|
+
"class": getClassName$e(innerClass, 'input-container') || ''
|
|
26065
|
+
}, {
|
|
26066
|
+
"default": function _default() {
|
|
26067
|
+
return [vue.createVNode(Flex, {
|
|
26068
|
+
"direction": "column",
|
|
26069
|
+
"flex": 2
|
|
26070
|
+
}, {
|
|
26071
|
+
"default": function _default() {
|
|
26072
|
+
return [vue.createVNode(Input, vue.mergeProps(babelHelperVueTransformOn({
|
|
26073
|
+
change: _this.handleInputChange
|
|
26074
|
+
}), {
|
|
26075
|
+
"key": componentId + "-start-value",
|
|
26076
|
+
"name": "start",
|
|
26077
|
+
"type": "number",
|
|
26078
|
+
"step": stepValue,
|
|
26079
|
+
"themePreset": themePreset,
|
|
26080
|
+
"aria-label": componentId + "-start-input",
|
|
26081
|
+
"min": _this.$props.range ? _this.$props.range.start : 0,
|
|
26082
|
+
"class": getClassName$e(innerClass, 'input') || '',
|
|
26083
|
+
"alert": !_this.isStartValid,
|
|
26084
|
+
"value": _this.currentValue.start || 0
|
|
26085
|
+
}), null), !_this.isStartValid && vue.createVNode(Content, {
|
|
26086
|
+
"alert": true
|
|
26087
|
+
}, {
|
|
26088
|
+
"default": function _default() {
|
|
26089
|
+
return [vue.createTextVNode("Input range is invalid")];
|
|
26090
|
+
}
|
|
26091
|
+
})];
|
|
26092
|
+
}
|
|
26093
|
+
}), vue.createVNode(Flex, {
|
|
26094
|
+
"justifyContent": "center",
|
|
26095
|
+
"alignItems": "center",
|
|
26096
|
+
"flex": 1
|
|
26097
|
+
}, {
|
|
26098
|
+
"default": function _default() {
|
|
26099
|
+
return [vue.createTextVNode("-")];
|
|
26100
|
+
}
|
|
26101
|
+
}), vue.createVNode(Flex, {
|
|
26102
|
+
"direction": "column",
|
|
26103
|
+
"flex": 2
|
|
26104
|
+
}, {
|
|
26105
|
+
"default": function _default() {
|
|
26106
|
+
return [vue.createVNode(Input, vue.mergeProps(babelHelperVueTransformOn({
|
|
26107
|
+
change: _this.handleInputChange
|
|
26108
|
+
}), {
|
|
26109
|
+
"key": componentId + "-end-value",
|
|
26110
|
+
"name": "end",
|
|
26111
|
+
"type": "number",
|
|
26112
|
+
"step": stepValue,
|
|
26113
|
+
"themePreset": themePreset,
|
|
26114
|
+
"aria-label": componentId + "-end-input",
|
|
26115
|
+
"max": _this.$props.range ? _this.$props.range.end : 10,
|
|
26116
|
+
"class": getClassName$e(innerClass, 'input') || '',
|
|
26117
|
+
"alert": !_this.isEndValid,
|
|
26118
|
+
"value": _this.currentValue.end || 0
|
|
26119
|
+
}), null), !_this.isEndValid && vue.createVNode(Content, {
|
|
26120
|
+
"alert": true
|
|
26121
|
+
}, {
|
|
26122
|
+
"default": function _default() {
|
|
26123
|
+
return [vue.createTextVNode("Input range is invalid")];
|
|
26124
|
+
}
|
|
26125
|
+
})];
|
|
26126
|
+
}
|
|
26127
|
+
})];
|
|
26128
|
+
}
|
|
26129
|
+
})];
|
|
26130
|
+
}
|
|
26131
|
+
});
|
|
24261
26132
|
}
|
|
24262
26133
|
};
|
|
24263
|
-
|
|
24264
|
-
return !!props.defaultQuery;
|
|
24265
|
-
};
|
|
24266
|
-
var mapStateToProps$e = function mapStateToProps(state, props) {
|
|
26134
|
+
var mapStateToProps$f = function mapStateToProps(state) {
|
|
24267
26135
|
return {
|
|
24268
|
-
|
|
24269
|
-
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
24270
|
-
hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
|
|
24271
|
-
rawData: state.rawData[props.componentId],
|
|
24272
|
-
error: state.error[props.componentId],
|
|
24273
|
-
isLoading: state.isLoading[props.componentId],
|
|
24274
|
-
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
24275
|
-
promotedResults: state.promotedResults[props.componentId] || [],
|
|
24276
|
-
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
24277
|
-
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
24278
|
-
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
|
|
24279
|
-
componentProps: state.props[props.componentId]
|
|
26136
|
+
themePreset: state.config.themePreset
|
|
24280
26137
|
};
|
|
24281
26138
|
};
|
|
24282
|
-
var
|
|
24283
|
-
|
|
24284
|
-
|
|
24285
|
-
|
|
24286
|
-
|
|
26139
|
+
var RangeConnected$4 = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$f, {})(RangeInput), {
|
|
26140
|
+
componentType: constants_1$1.rangeInput
|
|
26141
|
+
}));
|
|
26142
|
+
RangeConnected$4.name = RangeInput.name;
|
|
26143
|
+
RangeConnected$4.install = function (Vue) {
|
|
26144
|
+
Vue.component(RangeConnected$4.name, RangeConnected$4);
|
|
24287
26145
|
};
|
|
24288
|
-
|
|
24289
|
-
|
|
24290
|
-
|
|
24291
|
-
|
|
26146
|
+
|
|
26147
|
+
// Add componentType for SSR
|
|
26148
|
+
RangeConnected$4.componentType = constants_1$1.rangeInput;
|
|
26149
|
+
|
|
26150
|
+
var RcConnected$1 = PreferencesConsumer({
|
|
24292
26151
|
name: 'RcConnected',
|
|
24293
26152
|
render: function render() {
|
|
24294
|
-
var component =
|
|
26153
|
+
var component = RcConnected;
|
|
24295
26154
|
switch (this.$attrs.componentType) {
|
|
24296
26155
|
case constants_1$1.reactiveList:
|
|
24297
26156
|
component = RLConnected;
|
|
@@ -24336,12 +26195,12 @@
|
|
|
24336
26195
|
return vue.h(component, null, this.$slots);
|
|
24337
26196
|
}
|
|
24338
26197
|
});
|
|
24339
|
-
RcConnected.name =
|
|
24340
|
-
RcConnected.hasInternalComponent =
|
|
26198
|
+
RcConnected$1.name = RcConnected.name;
|
|
26199
|
+
RcConnected$1.hasInternalComponent = RcConnected.hasInternalComponent;
|
|
24341
26200
|
// Add componentType for SSR
|
|
24342
|
-
RcConnected.componentType = constants_1$1.reactiveComponent;
|
|
24343
|
-
RcConnected.install = function (Vue) {
|
|
24344
|
-
Vue.component(RcConnected.name, RcConnected);
|
|
26201
|
+
RcConnected$1.componentType = constants_1$1.reactiveComponent;
|
|
26202
|
+
RcConnected$1.install = function (Vue) {
|
|
26203
|
+
Vue.component(RcConnected$1.name, RcConnected$1);
|
|
24345
26204
|
};
|
|
24346
26205
|
|
|
24347
26206
|
var setValue$2 = lib_5.setValue,
|
|
@@ -24502,24 +26361,24 @@
|
|
|
24502
26361
|
}
|
|
24503
26362
|
}
|
|
24504
26363
|
};
|
|
24505
|
-
var mapStateToProps$
|
|
26364
|
+
var mapStateToProps$g = function mapStateToProps(state) {
|
|
24506
26365
|
return {
|
|
24507
26366
|
components: state.components,
|
|
24508
26367
|
selectedValues: state.selectedValues
|
|
24509
26368
|
};
|
|
24510
26369
|
};
|
|
24511
|
-
var mapDispatchtoProps$
|
|
26370
|
+
var mapDispatchtoProps$d = {
|
|
24512
26371
|
clearValuesAction: clearValues,
|
|
24513
26372
|
setValue: setValue$2,
|
|
24514
26373
|
resetValuesToDefault: resetValuesToDefault
|
|
24515
26374
|
};
|
|
24516
|
-
var RcConnected$
|
|
24517
|
-
RcConnected$
|
|
24518
|
-
RcConnected$
|
|
24519
|
-
Vue.component(RcConnected$
|
|
26375
|
+
var RcConnected$2 = connect(mapStateToProps$g, mapDispatchtoProps$d)(SelectedFilters);
|
|
26376
|
+
RcConnected$2.name = SelectedFilters.name;
|
|
26377
|
+
RcConnected$2.install = function (Vue) {
|
|
26378
|
+
Vue.component(RcConnected$2.name, RcConnected$2);
|
|
24520
26379
|
};
|
|
24521
26380
|
|
|
24522
|
-
function _isSlot$
|
|
26381
|
+
function _isSlot$c(s) {
|
|
24523
26382
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
24524
26383
|
}
|
|
24525
26384
|
var ResultCardTitle = {
|
|
@@ -24527,7 +26386,7 @@
|
|
|
24527
26386
|
render: function render() {
|
|
24528
26387
|
var _slot;
|
|
24529
26388
|
var children = this.$slots["default"];
|
|
24530
|
-
return vue.createVNode(Title, this.$props, _isSlot$
|
|
26389
|
+
return vue.createVNode(Title, this.$props, _isSlot$c(_slot = children()) ? _slot : {
|
|
24531
26390
|
"default": function _default() {
|
|
24532
26391
|
return [_slot];
|
|
24533
26392
|
}
|
|
@@ -24571,7 +26430,7 @@
|
|
|
24571
26430
|
};
|
|
24572
26431
|
|
|
24573
26432
|
var _excluded$3 = ["href", "target"];
|
|
24574
|
-
function _isSlot$
|
|
26433
|
+
function _isSlot$d(s) {
|
|
24575
26434
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
24576
26435
|
}
|
|
24577
26436
|
var ResultCard = {
|
|
@@ -24596,7 +26455,7 @@
|
|
|
24596
26455
|
"href": href,
|
|
24597
26456
|
"target": target,
|
|
24598
26457
|
"rel": target === '_blank' ? 'noopener noreferrer' : null
|
|
24599
|
-
}, rest), _isSlot$
|
|
26458
|
+
}, rest), _isSlot$d(_slot = children()) ? _slot : {
|
|
24600
26459
|
"default": function _default() {
|
|
24601
26460
|
return [_slot];
|
|
24602
26461
|
}
|
|
@@ -24654,7 +26513,7 @@
|
|
|
24654
26513
|
Vue.component(ResultListImage.name, ResultListImage);
|
|
24655
26514
|
};
|
|
24656
26515
|
|
|
24657
|
-
function _isSlot$
|
|
26516
|
+
function _isSlot$e(s) {
|
|
24658
26517
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
24659
26518
|
}
|
|
24660
26519
|
var ResultListTitle = {
|
|
@@ -24662,7 +26521,7 @@
|
|
|
24662
26521
|
render: function render() {
|
|
24663
26522
|
var _slot;
|
|
24664
26523
|
var children = this.$slots["default"];
|
|
24665
|
-
return vue.createVNode(Title, this.$props, _isSlot$
|
|
26524
|
+
return vue.createVNode(Title, this.$props, _isSlot$e(_slot = children()) ? _slot : {
|
|
24666
26525
|
"default": function _default() {
|
|
24667
26526
|
return [_slot];
|
|
24668
26527
|
}
|
|
@@ -24674,7 +26533,7 @@
|
|
|
24674
26533
|
};
|
|
24675
26534
|
|
|
24676
26535
|
var _excluded$5 = ["href", "target"];
|
|
24677
|
-
function _isSlot$
|
|
26536
|
+
function _isSlot$f(s) {
|
|
24678
26537
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
24679
26538
|
}
|
|
24680
26539
|
var ResultList = {
|
|
@@ -24723,7 +26582,7 @@
|
|
|
24723
26582
|
"small": isSmall,
|
|
24724
26583
|
"target": target,
|
|
24725
26584
|
"rel": target === '_blank' ? 'noopener noreferrer' : null
|
|
24726
|
-
}, props), _isSlot$
|
|
26585
|
+
}, props), _isSlot$f(_slot = children()) ? _slot : {
|
|
24727
26586
|
"default": function _default() {
|
|
24728
26587
|
return [_slot];
|
|
24729
26588
|
}
|
|
@@ -24952,7 +26811,7 @@
|
|
|
24952
26811
|
}) : null;
|
|
24953
26812
|
}
|
|
24954
26813
|
};
|
|
24955
|
-
var mapStateToProps$
|
|
26814
|
+
var mapStateToProps$h = function mapStateToProps(state, props) {
|
|
24956
26815
|
return {
|
|
24957
26816
|
selectedValues: filterByComponentIds(state.selectedValues, props),
|
|
24958
26817
|
queryLog: filterByComponentIds(state.queryLog, props),
|
|
@@ -24969,10 +26828,10 @@
|
|
|
24969
26828
|
components: state.components
|
|
24970
26829
|
};
|
|
24971
26830
|
};
|
|
24972
|
-
var mapDispatchtoProps$
|
|
26831
|
+
var mapDispatchtoProps$e = {
|
|
24973
26832
|
setSearchStateFn: setSearchState
|
|
24974
26833
|
};
|
|
24975
|
-
var StateProviderConnected = connect(mapStateToProps$
|
|
26834
|
+
var StateProviderConnected = connect(mapStateToProps$h, mapDispatchtoProps$e)(StateProvider);
|
|
24976
26835
|
StateProviderConnected.name = StateProvider.name;
|
|
24977
26836
|
StateProviderConnected.install = function (Vue) {
|
|
24978
26837
|
Vue.component(StateProviderConnected.name, StateProviderConnected);
|
|
@@ -27984,7 +29843,7 @@
|
|
|
27984
29843
|
var main = geohash;
|
|
27985
29844
|
|
|
27986
29845
|
var setStreaming = lib_5.setStreaming,
|
|
27987
|
-
setQueryOptions$
|
|
29846
|
+
setQueryOptions$c = lib_5.setQueryOptions,
|
|
27988
29847
|
updateQuery$c = lib_5.updateQuery,
|
|
27989
29848
|
loadMore$1 = lib_5.loadMore,
|
|
27990
29849
|
setValue$3 = lib_5.setValue,
|
|
@@ -28726,7 +30585,7 @@
|
|
|
28726
30585
|
}, [this.renderErrorComponent(), this.isLoading && loader, this.hasCustomRender ? this.getComponent() : null, this.renderMap(this.getMapParams()), this.pagination ? this.renderPagination() : null]);
|
|
28727
30586
|
}
|
|
28728
30587
|
};
|
|
28729
|
-
var mapStateToProps$
|
|
30588
|
+
var mapStateToProps$i = function mapStateToProps(state, props) {
|
|
28730
30589
|
return {
|
|
28731
30590
|
defaultPage: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value - 1 || -1,
|
|
28732
30591
|
error: state.error[props.componentId],
|
|
@@ -28743,7 +30602,7 @@
|
|
|
28743
30602
|
var mapDispatchToProps$3 = {
|
|
28744
30603
|
loadMoreAction: loadMore$1,
|
|
28745
30604
|
setPageURL: setValue$3,
|
|
28746
|
-
setQueryOptions: setQueryOptions$
|
|
30605
|
+
setQueryOptions: setQueryOptions$c,
|
|
28747
30606
|
setStreaming: setStreaming,
|
|
28748
30607
|
updateQuery: updateQuery$c,
|
|
28749
30608
|
updateComponentProps: updateComponentProps$3,
|
|
@@ -28751,7 +30610,7 @@
|
|
|
28751
30610
|
recordResultClick: recordResultClick$1,
|
|
28752
30611
|
setMapData: setMapData
|
|
28753
30612
|
};
|
|
28754
|
-
var RMConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$
|
|
30613
|
+
var RMConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$i, mapDispatchToProps$3)(ReactiveMap), {
|
|
28755
30614
|
componentType: constants_1$1.reactiveMap,
|
|
28756
30615
|
internalComponent: true
|
|
28757
30616
|
}));
|
|
@@ -29586,9 +31445,9 @@
|
|
|
29586
31445
|
}
|
|
29587
31446
|
};
|
|
29588
31447
|
|
|
29589
|
-
var _templateObject$
|
|
29590
|
-
var MapPin = styled('div')(_templateObject$
|
|
29591
|
-
var MapPinArrow = styled('div')(_templateObject2$
|
|
31448
|
+
var _templateObject$r, _templateObject2$9, _templateObject3$5;
|
|
31449
|
+
var MapPin = styled('div')(_templateObject$r || (_templateObject$r = _taggedTemplateLiteralLoose(["\n\theight: 24px;\n\twidth: auto;\n\tbackground-color: #fff;\n\tborder-radius: 2px;\n\tcolor: #222;\n\tbox-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.15);\n\tpadding: 3px 6px;\n\tfont-size: 15px;\n"])));
|
|
31450
|
+
var MapPinArrow = styled('div')(_templateObject2$9 || (_templateObject2$9 = _taggedTemplateLiteralLoose(["\n\tborder-color: rgba(0, 0, 0, 0.2);\n\tborder-style: solid;\n\tborder-width: 0 1px 1px 0;\n\tmargin-left: -6px;\n\tbackground-color: #fff;\n\tmargin-top: -6px;\n\twidth: 12px;\n\theight: 12px;\n\t-webkit-transform: rotate(45deg);\n\t-ms-transform: rotate(45deg);\n\ttransform: rotate(45deg);\n"])));
|
|
29592
31451
|
var mapPinWrapper = css(_templateObject3$5 || (_templateObject3$5 = _taggedTemplateLiteralLoose(["\n\t&:hover,\n\t&:focus {\n\t\tz-index: 200;\n\t}\n"])));
|
|
29593
31452
|
|
|
29594
31453
|
var recordResultClick$3 = lib_5.recordResultClick;
|
|
@@ -29917,7 +31776,7 @@
|
|
|
29917
31776
|
}
|
|
29918
31777
|
};
|
|
29919
31778
|
|
|
29920
|
-
var _templateObject$
|
|
31779
|
+
var _templateObject$s;
|
|
29921
31780
|
var ReactiveGoogleMap = {
|
|
29922
31781
|
name: 'ReactiveGoogleMap',
|
|
29923
31782
|
props: {
|
|
@@ -29992,7 +31851,7 @@
|
|
|
29992
31851
|
"style": {
|
|
29993
31852
|
height: '100%'
|
|
29994
31853
|
},
|
|
29995
|
-
"class": css(_templateObject$
|
|
31854
|
+
"class": css(_templateObject$s || (_templateObject$s = _taggedTemplateLiteralLoose(["\n\t\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t"]))),
|
|
29996
31855
|
"options": {
|
|
29997
31856
|
zoomControl: true
|
|
29998
31857
|
},
|
|
@@ -31163,9 +33022,9 @@
|
|
|
31163
33022
|
}, queryString, renderFunction);
|
|
31164
33023
|
}
|
|
31165
33024
|
|
|
31166
|
-
var version = "3.0.0-
|
|
33025
|
+
var version = "3.0.0-rc";
|
|
31167
33026
|
|
|
31168
|
-
var components = [RLConnected, ResultCard, ResultList, ReactiveBase, SBConnected, ListConnected, ListConnected$1, RangeConnected$1, RangeConnected$2, RangeConnected$3, RangeConnected, RcConnected, RcConnected$1, TBConnected, ListConnected$2, ListConnected$3, StateProviderConnected, RangeConnected$4];
|
|
33027
|
+
var components = [RLConnected, ResultCard, ResultList, ReactiveBase, SBConnected, ListConnected, ListConnected$1, RangeConnected$1, RangeConnected$2, RangeConnected$3, RangeConnected, RcConnected, RcConnected$1, RcConnected$2, TBConnected, ListConnected$2, ListConnected$3, StateProviderConnected, RangeConnected$4, TreeListConnected];
|
|
31169
33028
|
function install$1 (Vue) {
|
|
31170
33029
|
components.map(function (component) {
|
|
31171
33030
|
Vue.use(component);
|
|
@@ -31190,17 +33049,19 @@
|
|
|
31190
33049
|
exports.RangeSlider = RangeConnected$3;
|
|
31191
33050
|
exports.ReactiveBase = ReactiveBase;
|
|
31192
33051
|
exports.ReactiveComponent = RcConnected;
|
|
33052
|
+
exports.ReactiveComponentPrivate = RcConnected$1;
|
|
31193
33053
|
exports.ReactiveGoogleMap = ReactiveGoogleMap;
|
|
31194
33054
|
exports.ReactiveList = RLConnected;
|
|
31195
33055
|
exports.ResultCard = ResultCard;
|
|
31196
33056
|
exports.ResultList = ResultList;
|
|
31197
33057
|
exports.SearchBox = SBConnected;
|
|
31198
|
-
exports.SelectedFilters = RcConnected$
|
|
33058
|
+
exports.SelectedFilters = RcConnected$2;
|
|
31199
33059
|
exports.SingleDropdownList = ListConnected$2;
|
|
31200
33060
|
exports.SingleList = ListConnected;
|
|
31201
33061
|
exports.SingleRange = RangeConnected$1;
|
|
31202
33062
|
exports.StateProvider = StateProviderConnected;
|
|
31203
33063
|
exports.ToggleButton = TBConnected;
|
|
33064
|
+
exports.TreeList = TreeListConnected;
|
|
31204
33065
|
exports.componentTypes = constants_1$1;
|
|
31205
33066
|
exports.default = index$1;
|
|
31206
33067
|
exports.getServerState = getServerState;
|