@bigbinary/neeto-filters-frontend 2.12.5 → 2.12.7
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/index.cjs.js +359 -42
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +360 -43
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -2316,13 +2316,37 @@ instance.reloadResources;
|
|
|
2316
2316
|
instance.use;
|
|
2317
2317
|
instance.changeLanguage;
|
|
2318
2318
|
instance.getFixedT;
|
|
2319
|
-
const t$
|
|
2319
|
+
const t$2 = instance.t;
|
|
2320
2320
|
instance.exists;
|
|
2321
2321
|
instance.setDefaultNamespace;
|
|
2322
2322
|
instance.hasLoadedNamespace;
|
|
2323
2323
|
instance.loadNamespaces;
|
|
2324
2324
|
instance.loadLanguages;
|
|
2325
2325
|
|
|
2326
|
+
/**
|
|
2327
|
+
* This file automatically generated from `pre-publish.js`.
|
|
2328
|
+
* Do not manually edit.
|
|
2329
|
+
*/
|
|
2330
|
+
|
|
2331
|
+
var voidElements = {
|
|
2332
|
+
"area": true,
|
|
2333
|
+
"base": true,
|
|
2334
|
+
"br": true,
|
|
2335
|
+
"col": true,
|
|
2336
|
+
"embed": true,
|
|
2337
|
+
"hr": true,
|
|
2338
|
+
"img": true,
|
|
2339
|
+
"input": true,
|
|
2340
|
+
"link": true,
|
|
2341
|
+
"meta": true,
|
|
2342
|
+
"param": true,
|
|
2343
|
+
"source": true,
|
|
2344
|
+
"track": true,
|
|
2345
|
+
"wbr": true
|
|
2346
|
+
};
|
|
2347
|
+
|
|
2348
|
+
var t$1=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n$1(n){var r={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},i=n.match(/<\/?([^\s]+?)[/\s>]/);if(i&&(r.name=i[1],(voidElements[i[1]]||"/"===n.charAt(n.length-2))&&(r.voidElement=!0),r.name.startsWith("!--"))){var s=n.indexOf("--\x3e");return {type:"comment",comment:-1!==s?n.slice(4,s):""}}for(var a=new RegExp(t$1),c=null;null!==(c=a.exec(n));)if(c[0].trim())if(c[1]){var o=c[1].trim(),l=[o,""];o.indexOf("=")>-1&&(l=o.split("=")),r.attrs[l[0]]=l[1],a.lastIndex--;}else c[2]&&(r.attrs[c[2]]=c[3].trim().substring(1,c[3].length-1));return r}var r=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,i=/^\s*$/,s=Object.create(null);function a(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'="'+e[n]+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(a,"")+"</"+t.name+">";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var c={parse:function(e,t){t||(t={}),t.components||(t.components=s);var a,c=[],o=[],l=-1,m=!1;if(0!==e.indexOf("<")){var u=e.indexOf("<");c.push({type:"text",content:-1===u?e:e.substring(0,u)});}return e.replace(r,function(r,s){if(m){if(r!=="</"+a.name+">")return;m=!1;}var u,f="/"!==r.charAt(1),h=r.startsWith("\x3c!--"),p=s+r.length,d=e.charAt(p);if(h){var v=n$1(r);return l<0?(c.push(v),c):((u=o[l]).children.push(v),c)}if(f&&(l++,"tag"===(a=n$1(r)).type&&t.components[a.name]&&(a.type="component",m=!0),a.voidElement||m||!d||"<"===d||a.children.push({type:"text",content:e.slice(p,e.indexOf("<",p))}),0===l&&c.push(a),(u=o[l-1])&&u.children.push(a),o[l]=a),(!f||a.voidElement)&&(l>-1&&(a.voidElement||a.name===r.slice(2,-1))&&(l--,a=-1===l?c:o[l]),!m&&"<"!==d&&d)){u=-1===l?c:o[l].children;var x=e.indexOf("<",p),g=e.slice(p,-1===x?void 0:x);i.test(g)&&(g=" "),(x>-1&&l+u.length>=0||" "!==g)&&u.push({type:"text",content:g});}}),c},stringify:function(e){return e.reduce(function(e,t){return e+a("",t)},"")}};
|
|
2349
|
+
|
|
2326
2350
|
function warn() {
|
|
2327
2351
|
if (console && console.warn) {
|
|
2328
2352
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -2453,6 +2477,244 @@ function getI18n() {
|
|
|
2453
2477
|
return i18nInstance;
|
|
2454
2478
|
}
|
|
2455
2479
|
|
|
2480
|
+
function hasChildren(node, checkLength) {
|
|
2481
|
+
if (!node) return false;
|
|
2482
|
+
const base = node.props ? node.props.children : node.children;
|
|
2483
|
+
if (checkLength) return base.length > 0;
|
|
2484
|
+
return !!base;
|
|
2485
|
+
}
|
|
2486
|
+
function getChildren(node) {
|
|
2487
|
+
if (!node) return [];
|
|
2488
|
+
return node.props ? node.props.children : node.children;
|
|
2489
|
+
}
|
|
2490
|
+
function hasValidReactChildren(children) {
|
|
2491
|
+
if (Object.prototype.toString.call(children) !== '[object Array]') return false;
|
|
2492
|
+
return children.every(child => React.isValidElement(child));
|
|
2493
|
+
}
|
|
2494
|
+
function getAsArray(data) {
|
|
2495
|
+
return Array.isArray(data) ? data : [data];
|
|
2496
|
+
}
|
|
2497
|
+
function mergeProps(source, target) {
|
|
2498
|
+
const newTarget = {
|
|
2499
|
+
...target
|
|
2500
|
+
};
|
|
2501
|
+
newTarget.props = Object.assign(source.props, target.props);
|
|
2502
|
+
return newTarget;
|
|
2503
|
+
}
|
|
2504
|
+
function nodesToString(children, i18nOptions) {
|
|
2505
|
+
if (!children) return '';
|
|
2506
|
+
let stringNode = '';
|
|
2507
|
+
const childrenArray = getAsArray(children);
|
|
2508
|
+
const keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : [];
|
|
2509
|
+
childrenArray.forEach((child, childIndex) => {
|
|
2510
|
+
if (typeof child === 'string') {
|
|
2511
|
+
stringNode += `${child}`;
|
|
2512
|
+
} else if (React.isValidElement(child)) {
|
|
2513
|
+
const childPropsCount = Object.keys(child.props).length;
|
|
2514
|
+
const shouldKeepChild = keepArray.indexOf(child.type) > -1;
|
|
2515
|
+
const childChildren = child.props.children;
|
|
2516
|
+
if (!childChildren && shouldKeepChild && childPropsCount === 0) {
|
|
2517
|
+
stringNode += `<${child.type}/>`;
|
|
2518
|
+
} else if (!childChildren && (!shouldKeepChild || childPropsCount !== 0)) {
|
|
2519
|
+
stringNode += `<${childIndex}></${childIndex}>`;
|
|
2520
|
+
} else if (child.props.i18nIsDynamicList) {
|
|
2521
|
+
stringNode += `<${childIndex}></${childIndex}>`;
|
|
2522
|
+
} else if (shouldKeepChild && childPropsCount === 1 && typeof childChildren === 'string') {
|
|
2523
|
+
stringNode += `<${child.type}>${childChildren}</${child.type}>`;
|
|
2524
|
+
} else {
|
|
2525
|
+
const content = nodesToString(childChildren, i18nOptions);
|
|
2526
|
+
stringNode += `<${childIndex}>${content}</${childIndex}>`;
|
|
2527
|
+
}
|
|
2528
|
+
} else if (child === null) {
|
|
2529
|
+
warn(`Trans: the passed in value is invalid - seems you passed in a null child.`);
|
|
2530
|
+
} else if (typeof child === 'object') {
|
|
2531
|
+
const {
|
|
2532
|
+
format,
|
|
2533
|
+
...clone
|
|
2534
|
+
} = child;
|
|
2535
|
+
const keys = Object.keys(clone);
|
|
2536
|
+
if (keys.length === 1) {
|
|
2537
|
+
const value = format ? `${keys[0]}, ${format}` : keys[0];
|
|
2538
|
+
stringNode += `{{${value}}}`;
|
|
2539
|
+
} else {
|
|
2540
|
+
warn(`react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.`, child);
|
|
2541
|
+
}
|
|
2542
|
+
} else {
|
|
2543
|
+
warn(`Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.`, child);
|
|
2544
|
+
}
|
|
2545
|
+
});
|
|
2546
|
+
return stringNode;
|
|
2547
|
+
}
|
|
2548
|
+
function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) {
|
|
2549
|
+
if (targetString === '') return [];
|
|
2550
|
+
const keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];
|
|
2551
|
+
const emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.join('|')).test(targetString);
|
|
2552
|
+
if (!children && !emptyChildrenButNeedsHandling) return [targetString];
|
|
2553
|
+
const data = {};
|
|
2554
|
+
function getData(childs) {
|
|
2555
|
+
const childrenArray = getAsArray(childs);
|
|
2556
|
+
childrenArray.forEach(child => {
|
|
2557
|
+
if (typeof child === 'string') return;
|
|
2558
|
+
if (hasChildren(child)) getData(getChildren(child));else if (typeof child === 'object' && !React.isValidElement(child)) Object.assign(data, child);
|
|
2559
|
+
});
|
|
2560
|
+
}
|
|
2561
|
+
getData(children);
|
|
2562
|
+
const ast = c.parse(`<0>${targetString}</0>`);
|
|
2563
|
+
const opts = {
|
|
2564
|
+
...data,
|
|
2565
|
+
...combinedTOpts
|
|
2566
|
+
};
|
|
2567
|
+
function renderInner(child, node, rootReactNode) {
|
|
2568
|
+
const childs = getChildren(child);
|
|
2569
|
+
const mappedChildren = mapAST(childs, node.children, rootReactNode);
|
|
2570
|
+
return hasValidReactChildren(childs) && mappedChildren.length === 0 ? childs : mappedChildren;
|
|
2571
|
+
}
|
|
2572
|
+
function pushTranslatedJSX(child, inner, mem, i, isVoid) {
|
|
2573
|
+
if (child.dummy) child.children = inner;
|
|
2574
|
+
mem.push(React.cloneElement(child, {
|
|
2575
|
+
...child.props,
|
|
2576
|
+
key: i
|
|
2577
|
+
}, isVoid ? undefined : inner));
|
|
2578
|
+
}
|
|
2579
|
+
function mapAST(reactNode, astNode, rootReactNode) {
|
|
2580
|
+
const reactNodes = getAsArray(reactNode);
|
|
2581
|
+
const astNodes = getAsArray(astNode);
|
|
2582
|
+
return astNodes.reduce((mem, node, i) => {
|
|
2583
|
+
const translationContent = node.children && node.children[0] && node.children[0].content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);
|
|
2584
|
+
if (node.type === 'tag') {
|
|
2585
|
+
let tmp = reactNodes[parseInt(node.name, 10)];
|
|
2586
|
+
if (!tmp && rootReactNode.length === 1 && rootReactNode[0][node.name]) tmp = rootReactNode[0][node.name];
|
|
2587
|
+
if (!tmp) tmp = {};
|
|
2588
|
+
const child = Object.keys(node.attrs).length !== 0 ? mergeProps({
|
|
2589
|
+
props: node.attrs
|
|
2590
|
+
}, tmp) : tmp;
|
|
2591
|
+
const isElement = React.isValidElement(child);
|
|
2592
|
+
const isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
|
|
2593
|
+
const isEmptyTransWithHTML = emptyChildrenButNeedsHandling && typeof child === 'object' && child.dummy && !isElement;
|
|
2594
|
+
const isKnownComponent = typeof children === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);
|
|
2595
|
+
if (typeof child === 'string') {
|
|
2596
|
+
const value = i18n.services.interpolator.interpolate(child, opts, i18n.language);
|
|
2597
|
+
mem.push(value);
|
|
2598
|
+
} else if (hasChildren(child) || isValidTranslationWithChildren) {
|
|
2599
|
+
const inner = renderInner(child, node, rootReactNode);
|
|
2600
|
+
pushTranslatedJSX(child, inner, mem, i);
|
|
2601
|
+
} else if (isEmptyTransWithHTML) {
|
|
2602
|
+
const inner = mapAST(reactNodes, node.children, rootReactNode);
|
|
2603
|
+
mem.push(React.cloneElement(child, {
|
|
2604
|
+
...child.props,
|
|
2605
|
+
key: i
|
|
2606
|
+
}, inner));
|
|
2607
|
+
} else if (Number.isNaN(parseFloat(node.name))) {
|
|
2608
|
+
if (isKnownComponent) {
|
|
2609
|
+
const inner = renderInner(child, node, rootReactNode);
|
|
2610
|
+
pushTranslatedJSX(child, inner, mem, i, node.voidElement);
|
|
2611
|
+
} else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {
|
|
2612
|
+
if (node.voidElement) {
|
|
2613
|
+
mem.push(React.createElement(node.name, {
|
|
2614
|
+
key: `${node.name}-${i}`
|
|
2615
|
+
}));
|
|
2616
|
+
} else {
|
|
2617
|
+
const inner = mapAST(reactNodes, node.children, rootReactNode);
|
|
2618
|
+
mem.push(React.createElement(node.name, {
|
|
2619
|
+
key: `${node.name}-${i}`
|
|
2620
|
+
}, inner));
|
|
2621
|
+
}
|
|
2622
|
+
} else if (node.voidElement) {
|
|
2623
|
+
mem.push(`<${node.name} />`);
|
|
2624
|
+
} else {
|
|
2625
|
+
const inner = mapAST(reactNodes, node.children, rootReactNode);
|
|
2626
|
+
mem.push(`<${node.name}>${inner}</${node.name}>`);
|
|
2627
|
+
}
|
|
2628
|
+
} else if (typeof child === 'object' && !isElement) {
|
|
2629
|
+
const content = node.children[0] ? translationContent : null;
|
|
2630
|
+
if (content) mem.push(content);
|
|
2631
|
+
} else if (node.children.length === 1 && translationContent) {
|
|
2632
|
+
mem.push(React.cloneElement(child, {
|
|
2633
|
+
...child.props,
|
|
2634
|
+
key: i
|
|
2635
|
+
}, translationContent));
|
|
2636
|
+
} else {
|
|
2637
|
+
mem.push(React.cloneElement(child, {
|
|
2638
|
+
...child.props,
|
|
2639
|
+
key: i
|
|
2640
|
+
}));
|
|
2641
|
+
}
|
|
2642
|
+
} else if (node.type === 'text') {
|
|
2643
|
+
const wrapTextNodes = i18nOptions.transWrapTextNodes;
|
|
2644
|
+
const content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
|
|
2645
|
+
if (wrapTextNodes) {
|
|
2646
|
+
mem.push(React.createElement(wrapTextNodes, {
|
|
2647
|
+
key: `${node.name}-${i}`
|
|
2648
|
+
}, content));
|
|
2649
|
+
} else {
|
|
2650
|
+
mem.push(content);
|
|
2651
|
+
}
|
|
2652
|
+
}
|
|
2653
|
+
return mem;
|
|
2654
|
+
}, []);
|
|
2655
|
+
}
|
|
2656
|
+
const result = mapAST([{
|
|
2657
|
+
dummy: true,
|
|
2658
|
+
children: children || []
|
|
2659
|
+
}], ast, getAsArray(children || []));
|
|
2660
|
+
return getChildren(result[0]);
|
|
2661
|
+
}
|
|
2662
|
+
function Trans$1(_ref) {
|
|
2663
|
+
let {
|
|
2664
|
+
children,
|
|
2665
|
+
count,
|
|
2666
|
+
parent,
|
|
2667
|
+
i18nKey,
|
|
2668
|
+
context,
|
|
2669
|
+
tOptions = {},
|
|
2670
|
+
values,
|
|
2671
|
+
defaults,
|
|
2672
|
+
components,
|
|
2673
|
+
ns,
|
|
2674
|
+
i18n: i18nFromProps,
|
|
2675
|
+
t: tFromProps,
|
|
2676
|
+
shouldUnescape,
|
|
2677
|
+
...additionalProps
|
|
2678
|
+
} = _ref;
|
|
2679
|
+
const i18n = i18nFromProps || getI18n();
|
|
2680
|
+
if (!i18n) {
|
|
2681
|
+
warnOnce('You will need to pass in an i18next instance by using i18nextReactModule');
|
|
2682
|
+
return children;
|
|
2683
|
+
}
|
|
2684
|
+
const t = tFromProps || i18n.t.bind(i18n) || (k => k);
|
|
2685
|
+
if (context) tOptions.context = context;
|
|
2686
|
+
const reactI18nextOptions = {
|
|
2687
|
+
...getDefaults(),
|
|
2688
|
+
...(i18n.options && i18n.options.react)
|
|
2689
|
+
};
|
|
2690
|
+
let namespaces = ns || t.ns || i18n.options && i18n.options.defaultNS;
|
|
2691
|
+
namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
|
|
2692
|
+
const defaultValue = defaults || nodesToString(children, reactI18nextOptions) || reactI18nextOptions.transEmptyNodeValue || i18nKey;
|
|
2693
|
+
const {
|
|
2694
|
+
hashTransKey
|
|
2695
|
+
} = reactI18nextOptions;
|
|
2696
|
+
const key = i18nKey || (hashTransKey ? hashTransKey(defaultValue) : defaultValue);
|
|
2697
|
+
const interpolationOverride = values ? tOptions.interpolation : {
|
|
2698
|
+
interpolation: {
|
|
2699
|
+
...tOptions.interpolation,
|
|
2700
|
+
prefix: '#$?',
|
|
2701
|
+
suffix: '?$#'
|
|
2702
|
+
}
|
|
2703
|
+
};
|
|
2704
|
+
const combinedTOpts = {
|
|
2705
|
+
...tOptions,
|
|
2706
|
+
count,
|
|
2707
|
+
...values,
|
|
2708
|
+
...interpolationOverride,
|
|
2709
|
+
defaultValue,
|
|
2710
|
+
ns: namespaces
|
|
2711
|
+
};
|
|
2712
|
+
const translation = key ? t(key, combinedTOpts) : defaultValue;
|
|
2713
|
+
const content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
|
|
2714
|
+
const useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;
|
|
2715
|
+
return useAsParent ? React.createElement(useAsParent, additionalProps, content) : content;
|
|
2716
|
+
}
|
|
2717
|
+
|
|
2456
2718
|
const initReactI18next = {
|
|
2457
2719
|
type: '3rdParty',
|
|
2458
2720
|
init(instance) {
|
|
@@ -2476,6 +2738,47 @@ class ReportNamespaces {
|
|
|
2476
2738
|
}
|
|
2477
2739
|
}
|
|
2478
2740
|
|
|
2741
|
+
function Trans(_ref) {
|
|
2742
|
+
let {
|
|
2743
|
+
children,
|
|
2744
|
+
count,
|
|
2745
|
+
parent,
|
|
2746
|
+
i18nKey,
|
|
2747
|
+
context,
|
|
2748
|
+
tOptions = {},
|
|
2749
|
+
values,
|
|
2750
|
+
defaults,
|
|
2751
|
+
components,
|
|
2752
|
+
ns,
|
|
2753
|
+
i18n: i18nFromProps,
|
|
2754
|
+
t: tFromProps,
|
|
2755
|
+
shouldUnescape,
|
|
2756
|
+
...additionalProps
|
|
2757
|
+
} = _ref;
|
|
2758
|
+
const {
|
|
2759
|
+
i18n: i18nFromContext,
|
|
2760
|
+
defaultNS: defaultNSFromContext
|
|
2761
|
+
} = React.useContext(I18nContext) || {};
|
|
2762
|
+
const i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
2763
|
+
const t = tFromProps || i18n && i18n.t.bind(i18n);
|
|
2764
|
+
return Trans$1({
|
|
2765
|
+
children,
|
|
2766
|
+
count,
|
|
2767
|
+
parent,
|
|
2768
|
+
i18nKey,
|
|
2769
|
+
context,
|
|
2770
|
+
tOptions,
|
|
2771
|
+
values,
|
|
2772
|
+
defaults,
|
|
2773
|
+
components,
|
|
2774
|
+
ns: ns || t && t.ns || defaultNSFromContext || i18n && i18n.options && i18n.options.defaultNS,
|
|
2775
|
+
i18n,
|
|
2776
|
+
t: tFromProps,
|
|
2777
|
+
shouldUnescape,
|
|
2778
|
+
...additionalProps
|
|
2779
|
+
});
|
|
2780
|
+
}
|
|
2781
|
+
|
|
2479
2782
|
const usePrevious = (value, ignore) => {
|
|
2480
2783
|
const ref = React.useRef();
|
|
2481
2784
|
React.useEffect(() => {
|
|
@@ -2594,7 +2897,8 @@ var common = {
|
|
|
2594
2897
|
rename: "Rename",
|
|
2595
2898
|
segments: "Segments",
|
|
2596
2899
|
userCount: "{{count}} Users",
|
|
2597
|
-
yes: "Yes"
|
|
2900
|
+
yes: "Yes",
|
|
2901
|
+
update: "Update"
|
|
2598
2902
|
};
|
|
2599
2903
|
var messages = {
|
|
2600
2904
|
enterResource: "Enter {{resource}}",
|
|
@@ -2625,8 +2929,8 @@ var shortcuts = {
|
|
|
2625
2929
|
};
|
|
2626
2930
|
var segments = {
|
|
2627
2931
|
addNewSegment: "Add new segment",
|
|
2628
|
-
deleteAlertMessage: "
|
|
2629
|
-
deleteAlertTitle: "Delete
|
|
2932
|
+
deleteAlertMessage: "You are permanently deleting the segment <strong>{{entity}}</strong>. This can't be undone.",
|
|
2933
|
+
deleteAlertTitle: "Delete segment?",
|
|
2630
2934
|
manageSegments: "Manage segments",
|
|
2631
2935
|
name: "Segment name",
|
|
2632
2936
|
noSegmentsFound: "No segments found",
|
|
@@ -2637,8 +2941,8 @@ var segments = {
|
|
|
2637
2941
|
segmentName: "Segment name",
|
|
2638
2942
|
showLess: "See less",
|
|
2639
2943
|
showMoreNumbers: "See {{entity}} more",
|
|
2640
|
-
updateSegment: "Update segment",
|
|
2641
|
-
updateSegmentMessage: "
|
|
2944
|
+
updateSegment: "Update segment?",
|
|
2945
|
+
updateSegmentMessage: "You are trying to update the current segment."
|
|
2642
2946
|
};
|
|
2643
2947
|
var labels = {
|
|
2644
2948
|
keyword: "Keyword"
|
|
@@ -2737,15 +3041,15 @@ function _defineProperty(obj, key, value) {
|
|
|
2737
3041
|
var SHORTCUTS = {
|
|
2738
3042
|
closePane: {
|
|
2739
3043
|
sequence: "escape",
|
|
2740
|
-
description: t$
|
|
3044
|
+
description: t$2("shortcuts.closePane")
|
|
2741
3045
|
},
|
|
2742
3046
|
deleteBlock: {
|
|
2743
3047
|
sequence: "backspace",
|
|
2744
|
-
description: t$
|
|
3048
|
+
description: t$2("shortcuts.deleteBlock")
|
|
2745
3049
|
},
|
|
2746
3050
|
openFilterPane: {
|
|
2747
3051
|
sequence: "enter",
|
|
2748
|
-
description: t$
|
|
3052
|
+
description: t$2("shortcuts.openFilterPane")
|
|
2749
3053
|
}
|
|
2750
3054
|
};
|
|
2751
3055
|
|
|
@@ -2833,48 +3137,48 @@ var DATE_RULES = {
|
|
|
2833
3137
|
};
|
|
2834
3138
|
|
|
2835
3139
|
var NUMBER_RULES = [{
|
|
2836
|
-
label: t$
|
|
3140
|
+
label: t$2("rules.exactly"),
|
|
2837
3141
|
value: "is"
|
|
2838
3142
|
}, {
|
|
2839
|
-
label: t$
|
|
3143
|
+
label: t$2("rules.notExactly"),
|
|
2840
3144
|
value: "is_not"
|
|
2841
3145
|
}, {
|
|
2842
|
-
label: t$
|
|
3146
|
+
label: t$2("rules.greaterThan"),
|
|
2843
3147
|
value: "greater_than"
|
|
2844
3148
|
}, {
|
|
2845
|
-
label: t$
|
|
3149
|
+
label: t$2("rules.lessThan"),
|
|
2846
3150
|
value: "less_than"
|
|
2847
3151
|
}];
|
|
2848
3152
|
var TEXT_RULES = [{
|
|
2849
|
-
label: t$
|
|
3153
|
+
label: t$2("rules.contains"),
|
|
2850
3154
|
value: "contains"
|
|
2851
3155
|
}, {
|
|
2852
|
-
label: t$
|
|
3156
|
+
label: t$2("rules.doesNotContain"),
|
|
2853
3157
|
value: "does_not_contain"
|
|
2854
3158
|
}, {
|
|
2855
|
-
label: t$
|
|
3159
|
+
label: t$2("rules.exactly"),
|
|
2856
3160
|
value: "is"
|
|
2857
3161
|
}, {
|
|
2858
|
-
label: t$
|
|
3162
|
+
label: t$2("rules.notExactly"),
|
|
2859
3163
|
value: "is_not"
|
|
2860
3164
|
}, {
|
|
2861
|
-
label: t$
|
|
3165
|
+
label: t$2("rules.startsWith"),
|
|
2862
3166
|
value: "starts_with"
|
|
2863
3167
|
}, {
|
|
2864
|
-
label: t$
|
|
3168
|
+
label: t$2("rules.doesNotStartWith"),
|
|
2865
3169
|
value: "does_not_start_with"
|
|
2866
3170
|
}, {
|
|
2867
|
-
label: t$
|
|
3171
|
+
label: t$2("rules.endsWith"),
|
|
2868
3172
|
value: "ends_with"
|
|
2869
3173
|
}, {
|
|
2870
|
-
label: t$
|
|
3174
|
+
label: t$2("rules.doesNotEndWith"),
|
|
2871
3175
|
value: "does_not_end_with"
|
|
2872
3176
|
}];
|
|
2873
3177
|
var DEFAULT_BOOLEAN_OPTIONS = [{
|
|
2874
|
-
label: t$
|
|
3178
|
+
label: t$2("common.yes"),
|
|
2875
3179
|
value: "true"
|
|
2876
3180
|
}, {
|
|
2877
|
-
label: t$
|
|
3181
|
+
label: t$2("common.no"),
|
|
2878
3182
|
value: "false"
|
|
2879
3183
|
}];
|
|
2880
3184
|
|
|
@@ -3887,6 +4191,7 @@ var Segment = function Segment(_ref) {
|
|
|
3887
4191
|
isOpen: isUpdateAlertOpen,
|
|
3888
4192
|
isSubmitting: isUpdating,
|
|
3889
4193
|
message: t("segments.updateSegmentMessage"),
|
|
4194
|
+
submitButtonLabel: t("common.update"),
|
|
3890
4195
|
title: t("segments.updateSegment"),
|
|
3891
4196
|
onClose: function onClose() {
|
|
3892
4197
|
return setIsUpdateAlertOpen(false);
|
|
@@ -6504,6 +6809,15 @@ var useFilters = function useFilters(_ref) {
|
|
|
6504
6809
|
rule: "contains",
|
|
6505
6810
|
label: "Keyword"
|
|
6506
6811
|
}, keyword);
|
|
6812
|
+
var handlePrecenseOfDefaultFilters = function handlePrecenseOfDefaultFilters(defaultFilters) {
|
|
6813
|
+
var params = buildUrlFromFilters({
|
|
6814
|
+
columns: columns,
|
|
6815
|
+
filters: keyword.value !== "" ? [].concat(_toConsumableArray(defaultFilters), [keywordFilter]) : defaultFilters
|
|
6816
|
+
});
|
|
6817
|
+
history.replace({
|
|
6818
|
+
search: params
|
|
6819
|
+
});
|
|
6820
|
+
};
|
|
6507
6821
|
|
|
6508
6822
|
//This function sends the updated filters to host via callbacks.
|
|
6509
6823
|
var sendUpdatedFilters = function sendUpdatedFilters() {
|
|
@@ -6539,6 +6853,8 @@ var useFilters = function useFilters(_ref) {
|
|
|
6539
6853
|
initialRender.current = false;
|
|
6540
6854
|
var keywordValue = getKeywordValueFromUrl();
|
|
6541
6855
|
keyword.setValue(keywordValue);
|
|
6856
|
+
var defaultFilters = buildDefaultFilters(columns, filters);
|
|
6857
|
+
pure.isNotEmpty(defaultFilters) && handlePrecenseOfDefaultFilters(defaultFilters);
|
|
6542
6858
|
} else {
|
|
6543
6859
|
handleChangesInURL();
|
|
6544
6860
|
sendUpdatedFilters();
|
|
@@ -7248,6 +7564,19 @@ var Pane = function Pane(_ref) {
|
|
|
7248
7564
|
groupedColumns = _buildFilteredColumns2 === void 0 ? [] : _buildFilteredColumns2,
|
|
7249
7565
|
_buildFilteredColumns3 = _buildFilteredColumns.ungroupedColumns,
|
|
7250
7566
|
ungroupedColumns = _buildFilteredColumns3 === void 0 ? [] : _buildFilteredColumns3;
|
|
7567
|
+
var handleChange = function handleChange(newFilters) {
|
|
7568
|
+
var isClearAll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7569
|
+
var params = buildUrlFromFilters(_objectSpread({
|
|
7570
|
+
columns: columns,
|
|
7571
|
+
filters: keyword.value !== "" ? [].concat(_toConsumableArray(newFilters), [keywordFilter]) : newFilters
|
|
7572
|
+
}, isClearAll && {
|
|
7573
|
+
isClearAll: true,
|
|
7574
|
+
childrenKeys: childrenKeys
|
|
7575
|
+
}));
|
|
7576
|
+
history.push({
|
|
7577
|
+
search: params
|
|
7578
|
+
});
|
|
7579
|
+
};
|
|
7251
7580
|
var filters = useFilters({
|
|
7252
7581
|
onFiltersChange: onChange,
|
|
7253
7582
|
columns: columns,
|
|
@@ -7275,19 +7604,6 @@ var Pane = function Pane(_ref) {
|
|
|
7275
7604
|
});
|
|
7276
7605
|
onClose();
|
|
7277
7606
|
};
|
|
7278
|
-
var handleChange = function handleChange(newFilters) {
|
|
7279
|
-
var isClearAll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7280
|
-
var params = buildUrlFromFilters(_objectSpread({
|
|
7281
|
-
columns: columns,
|
|
7282
|
-
filters: keyword.value !== "" ? [].concat(_toConsumableArray(newFilters), [keywordFilter]) : newFilters
|
|
7283
|
-
}, isClearAll && {
|
|
7284
|
-
isClearAll: true,
|
|
7285
|
-
childrenKeys: childrenKeys
|
|
7286
|
-
}));
|
|
7287
|
-
history.push({
|
|
7288
|
-
search: params
|
|
7289
|
-
});
|
|
7290
|
-
};
|
|
7291
7607
|
var isClearFiltersDisabled = !filters.some(function (_ref3) {
|
|
7292
7608
|
var value = _ref3.value,
|
|
7293
7609
|
defaultValue = _ref3.defaultValue;
|
|
@@ -7459,12 +7775,13 @@ var DeleteAlert = function DeleteAlert(_ref) {
|
|
|
7459
7775
|
return /*#__PURE__*/React__default["default"].createElement(neetoui.Alert, {
|
|
7460
7776
|
isOpen: isOpen,
|
|
7461
7777
|
isSubmitting: isDeleting,
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7778
|
+
submitButtonLabel: t("common.delete"),
|
|
7779
|
+
title: t("segments.deleteAlertTitle"),
|
|
7780
|
+
message: /*#__PURE__*/React__default["default"].createElement(Trans, {
|
|
7781
|
+
i18nKey: "segments.deleteAlertMessage",
|
|
7782
|
+
values: {
|
|
7783
|
+
entity: segment.name
|
|
7784
|
+
}
|
|
7468
7785
|
}),
|
|
7469
7786
|
onClose: onClose,
|
|
7470
7787
|
onSubmit: handleDelete
|