@bigbinary/neeto-filters-frontend 2.12.6 → 2.12.8

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.js CHANGED
@@ -1,4 +1,4 @@
1
- import React, { createContext, useContext, useState, useRef, useEffect, useMemo } from 'react';
1
+ import React, { createElement, isValidElement, cloneElement, createContext, useContext, useState, useRef, useEffect, useMemo } from 'react';
2
2
  import classnames from 'classnames';
3
3
  import { capitalize as capitalize$1, removeBy, findBy, isNotEmpty, humanize, noop as noop$2, toLabelAndValue, replaceBy, isPresent, existsBy, filterBy } from '@bigbinary/neeto-commons-frontend/pure';
4
4
  import { Tooltip, Typography, Dropdown as Dropdown$2, Button, Pane as Pane$1, Alert, Select, DatePicker, TimePicker, Input as Input$1, Accordion, Spinner } from '@bigbinary/neetoui';
@@ -2281,13 +2281,37 @@ instance.reloadResources;
2281
2281
  instance.use;
2282
2282
  instance.changeLanguage;
2283
2283
  instance.getFixedT;
2284
- const t$1 = instance.t;
2284
+ const t$2 = instance.t;
2285
2285
  instance.exists;
2286
2286
  instance.setDefaultNamespace;
2287
2287
  instance.hasLoadedNamespace;
2288
2288
  instance.loadNamespaces;
2289
2289
  instance.loadLanguages;
2290
2290
 
2291
+ /**
2292
+ * This file automatically generated from `pre-publish.js`.
2293
+ * Do not manually edit.
2294
+ */
2295
+
2296
+ var voidElements = {
2297
+ "area": true,
2298
+ "base": true,
2299
+ "br": true,
2300
+ "col": true,
2301
+ "embed": true,
2302
+ "hr": true,
2303
+ "img": true,
2304
+ "input": true,
2305
+ "link": true,
2306
+ "meta": true,
2307
+ "param": true,
2308
+ "source": true,
2309
+ "track": true,
2310
+ "wbr": true
2311
+ };
2312
+
2313
+ 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)},"")}};
2314
+
2291
2315
  function warn() {
2292
2316
  if (console && console.warn) {
2293
2317
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -2418,6 +2442,244 @@ function getI18n() {
2418
2442
  return i18nInstance;
2419
2443
  }
2420
2444
 
2445
+ function hasChildren(node, checkLength) {
2446
+ if (!node) return false;
2447
+ const base = node.props ? node.props.children : node.children;
2448
+ if (checkLength) return base.length > 0;
2449
+ return !!base;
2450
+ }
2451
+ function getChildren(node) {
2452
+ if (!node) return [];
2453
+ return node.props ? node.props.children : node.children;
2454
+ }
2455
+ function hasValidReactChildren(children) {
2456
+ if (Object.prototype.toString.call(children) !== '[object Array]') return false;
2457
+ return children.every(child => isValidElement(child));
2458
+ }
2459
+ function getAsArray(data) {
2460
+ return Array.isArray(data) ? data : [data];
2461
+ }
2462
+ function mergeProps(source, target) {
2463
+ const newTarget = {
2464
+ ...target
2465
+ };
2466
+ newTarget.props = Object.assign(source.props, target.props);
2467
+ return newTarget;
2468
+ }
2469
+ function nodesToString(children, i18nOptions) {
2470
+ if (!children) return '';
2471
+ let stringNode = '';
2472
+ const childrenArray = getAsArray(children);
2473
+ const keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : [];
2474
+ childrenArray.forEach((child, childIndex) => {
2475
+ if (typeof child === 'string') {
2476
+ stringNode += `${child}`;
2477
+ } else if (isValidElement(child)) {
2478
+ const childPropsCount = Object.keys(child.props).length;
2479
+ const shouldKeepChild = keepArray.indexOf(child.type) > -1;
2480
+ const childChildren = child.props.children;
2481
+ if (!childChildren && shouldKeepChild && childPropsCount === 0) {
2482
+ stringNode += `<${child.type}/>`;
2483
+ } else if (!childChildren && (!shouldKeepChild || childPropsCount !== 0)) {
2484
+ stringNode += `<${childIndex}></${childIndex}>`;
2485
+ } else if (child.props.i18nIsDynamicList) {
2486
+ stringNode += `<${childIndex}></${childIndex}>`;
2487
+ } else if (shouldKeepChild && childPropsCount === 1 && typeof childChildren === 'string') {
2488
+ stringNode += `<${child.type}>${childChildren}</${child.type}>`;
2489
+ } else {
2490
+ const content = nodesToString(childChildren, i18nOptions);
2491
+ stringNode += `<${childIndex}>${content}</${childIndex}>`;
2492
+ }
2493
+ } else if (child === null) {
2494
+ warn(`Trans: the passed in value is invalid - seems you passed in a null child.`);
2495
+ } else if (typeof child === 'object') {
2496
+ const {
2497
+ format,
2498
+ ...clone
2499
+ } = child;
2500
+ const keys = Object.keys(clone);
2501
+ if (keys.length === 1) {
2502
+ const value = format ? `${keys[0]}, ${format}` : keys[0];
2503
+ stringNode += `{{${value}}}`;
2504
+ } else {
2505
+ warn(`react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.`, child);
2506
+ }
2507
+ } else {
2508
+ 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);
2509
+ }
2510
+ });
2511
+ return stringNode;
2512
+ }
2513
+ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) {
2514
+ if (targetString === '') return [];
2515
+ const keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];
2516
+ const emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.join('|')).test(targetString);
2517
+ if (!children && !emptyChildrenButNeedsHandling) return [targetString];
2518
+ const data = {};
2519
+ function getData(childs) {
2520
+ const childrenArray = getAsArray(childs);
2521
+ childrenArray.forEach(child => {
2522
+ if (typeof child === 'string') return;
2523
+ if (hasChildren(child)) getData(getChildren(child));else if (typeof child === 'object' && !isValidElement(child)) Object.assign(data, child);
2524
+ });
2525
+ }
2526
+ getData(children);
2527
+ const ast = c.parse(`<0>${targetString}</0>`);
2528
+ const opts = {
2529
+ ...data,
2530
+ ...combinedTOpts
2531
+ };
2532
+ function renderInner(child, node, rootReactNode) {
2533
+ const childs = getChildren(child);
2534
+ const mappedChildren = mapAST(childs, node.children, rootReactNode);
2535
+ return hasValidReactChildren(childs) && mappedChildren.length === 0 ? childs : mappedChildren;
2536
+ }
2537
+ function pushTranslatedJSX(child, inner, mem, i, isVoid) {
2538
+ if (child.dummy) child.children = inner;
2539
+ mem.push(cloneElement(child, {
2540
+ ...child.props,
2541
+ key: i
2542
+ }, isVoid ? undefined : inner));
2543
+ }
2544
+ function mapAST(reactNode, astNode, rootReactNode) {
2545
+ const reactNodes = getAsArray(reactNode);
2546
+ const astNodes = getAsArray(astNode);
2547
+ return astNodes.reduce((mem, node, i) => {
2548
+ const translationContent = node.children && node.children[0] && node.children[0].content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);
2549
+ if (node.type === 'tag') {
2550
+ let tmp = reactNodes[parseInt(node.name, 10)];
2551
+ if (!tmp && rootReactNode.length === 1 && rootReactNode[0][node.name]) tmp = rootReactNode[0][node.name];
2552
+ if (!tmp) tmp = {};
2553
+ const child = Object.keys(node.attrs).length !== 0 ? mergeProps({
2554
+ props: node.attrs
2555
+ }, tmp) : tmp;
2556
+ const isElement = isValidElement(child);
2557
+ const isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
2558
+ const isEmptyTransWithHTML = emptyChildrenButNeedsHandling && typeof child === 'object' && child.dummy && !isElement;
2559
+ const isKnownComponent = typeof children === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);
2560
+ if (typeof child === 'string') {
2561
+ const value = i18n.services.interpolator.interpolate(child, opts, i18n.language);
2562
+ mem.push(value);
2563
+ } else if (hasChildren(child) || isValidTranslationWithChildren) {
2564
+ const inner = renderInner(child, node, rootReactNode);
2565
+ pushTranslatedJSX(child, inner, mem, i);
2566
+ } else if (isEmptyTransWithHTML) {
2567
+ const inner = mapAST(reactNodes, node.children, rootReactNode);
2568
+ mem.push(cloneElement(child, {
2569
+ ...child.props,
2570
+ key: i
2571
+ }, inner));
2572
+ } else if (Number.isNaN(parseFloat(node.name))) {
2573
+ if (isKnownComponent) {
2574
+ const inner = renderInner(child, node, rootReactNode);
2575
+ pushTranslatedJSX(child, inner, mem, i, node.voidElement);
2576
+ } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {
2577
+ if (node.voidElement) {
2578
+ mem.push(createElement(node.name, {
2579
+ key: `${node.name}-${i}`
2580
+ }));
2581
+ } else {
2582
+ const inner = mapAST(reactNodes, node.children, rootReactNode);
2583
+ mem.push(createElement(node.name, {
2584
+ key: `${node.name}-${i}`
2585
+ }, inner));
2586
+ }
2587
+ } else if (node.voidElement) {
2588
+ mem.push(`<${node.name} />`);
2589
+ } else {
2590
+ const inner = mapAST(reactNodes, node.children, rootReactNode);
2591
+ mem.push(`<${node.name}>${inner}</${node.name}>`);
2592
+ }
2593
+ } else if (typeof child === 'object' && !isElement) {
2594
+ const content = node.children[0] ? translationContent : null;
2595
+ if (content) mem.push(content);
2596
+ } else if (node.children.length === 1 && translationContent) {
2597
+ mem.push(cloneElement(child, {
2598
+ ...child.props,
2599
+ key: i
2600
+ }, translationContent));
2601
+ } else {
2602
+ mem.push(cloneElement(child, {
2603
+ ...child.props,
2604
+ key: i
2605
+ }));
2606
+ }
2607
+ } else if (node.type === 'text') {
2608
+ const wrapTextNodes = i18nOptions.transWrapTextNodes;
2609
+ const content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
2610
+ if (wrapTextNodes) {
2611
+ mem.push(createElement(wrapTextNodes, {
2612
+ key: `${node.name}-${i}`
2613
+ }, content));
2614
+ } else {
2615
+ mem.push(content);
2616
+ }
2617
+ }
2618
+ return mem;
2619
+ }, []);
2620
+ }
2621
+ const result = mapAST([{
2622
+ dummy: true,
2623
+ children: children || []
2624
+ }], ast, getAsArray(children || []));
2625
+ return getChildren(result[0]);
2626
+ }
2627
+ function Trans$1(_ref) {
2628
+ let {
2629
+ children,
2630
+ count,
2631
+ parent,
2632
+ i18nKey,
2633
+ context,
2634
+ tOptions = {},
2635
+ values,
2636
+ defaults,
2637
+ components,
2638
+ ns,
2639
+ i18n: i18nFromProps,
2640
+ t: tFromProps,
2641
+ shouldUnescape,
2642
+ ...additionalProps
2643
+ } = _ref;
2644
+ const i18n = i18nFromProps || getI18n();
2645
+ if (!i18n) {
2646
+ warnOnce('You will need to pass in an i18next instance by using i18nextReactModule');
2647
+ return children;
2648
+ }
2649
+ const t = tFromProps || i18n.t.bind(i18n) || (k => k);
2650
+ if (context) tOptions.context = context;
2651
+ const reactI18nextOptions = {
2652
+ ...getDefaults(),
2653
+ ...(i18n.options && i18n.options.react)
2654
+ };
2655
+ let namespaces = ns || t.ns || i18n.options && i18n.options.defaultNS;
2656
+ namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
2657
+ const defaultValue = defaults || nodesToString(children, reactI18nextOptions) || reactI18nextOptions.transEmptyNodeValue || i18nKey;
2658
+ const {
2659
+ hashTransKey
2660
+ } = reactI18nextOptions;
2661
+ const key = i18nKey || (hashTransKey ? hashTransKey(defaultValue) : defaultValue);
2662
+ const interpolationOverride = values ? tOptions.interpolation : {
2663
+ interpolation: {
2664
+ ...tOptions.interpolation,
2665
+ prefix: '#$?',
2666
+ suffix: '?$#'
2667
+ }
2668
+ };
2669
+ const combinedTOpts = {
2670
+ ...tOptions,
2671
+ count,
2672
+ ...values,
2673
+ ...interpolationOverride,
2674
+ defaultValue,
2675
+ ns: namespaces
2676
+ };
2677
+ const translation = key ? t(key, combinedTOpts) : defaultValue;
2678
+ const content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
2679
+ const useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;
2680
+ return useAsParent ? createElement(useAsParent, additionalProps, content) : content;
2681
+ }
2682
+
2421
2683
  const initReactI18next = {
2422
2684
  type: '3rdParty',
2423
2685
  init(instance) {
@@ -2441,6 +2703,47 @@ class ReportNamespaces {
2441
2703
  }
2442
2704
  }
2443
2705
 
2706
+ function Trans(_ref) {
2707
+ let {
2708
+ children,
2709
+ count,
2710
+ parent,
2711
+ i18nKey,
2712
+ context,
2713
+ tOptions = {},
2714
+ values,
2715
+ defaults,
2716
+ components,
2717
+ ns,
2718
+ i18n: i18nFromProps,
2719
+ t: tFromProps,
2720
+ shouldUnescape,
2721
+ ...additionalProps
2722
+ } = _ref;
2723
+ const {
2724
+ i18n: i18nFromContext,
2725
+ defaultNS: defaultNSFromContext
2726
+ } = useContext(I18nContext) || {};
2727
+ const i18n = i18nFromProps || i18nFromContext || getI18n();
2728
+ const t = tFromProps || i18n && i18n.t.bind(i18n);
2729
+ return Trans$1({
2730
+ children,
2731
+ count,
2732
+ parent,
2733
+ i18nKey,
2734
+ context,
2735
+ tOptions,
2736
+ values,
2737
+ defaults,
2738
+ components,
2739
+ ns: ns || t && t.ns || defaultNSFromContext || i18n && i18n.options && i18n.options.defaultNS,
2740
+ i18n,
2741
+ t: tFromProps,
2742
+ shouldUnescape,
2743
+ ...additionalProps
2744
+ });
2745
+ }
2746
+
2444
2747
  const usePrevious = (value, ignore) => {
2445
2748
  const ref = useRef();
2446
2749
  useEffect(() => {
@@ -2559,7 +2862,8 @@ var common = {
2559
2862
  rename: "Rename",
2560
2863
  segments: "Segments",
2561
2864
  userCount: "{{count}} Users",
2562
- yes: "Yes"
2865
+ yes: "Yes",
2866
+ update: "Update"
2563
2867
  };
2564
2868
  var messages = {
2565
2869
  enterResource: "Enter {{resource}}",
@@ -2590,8 +2894,8 @@ var shortcuts = {
2590
2894
  };
2591
2895
  var segments = {
2592
2896
  addNewSegment: "Add new segment",
2593
- deleteAlertMessage: "Are you sure you want to delete this {{entity}} ? This action cannot be undone.",
2594
- deleteAlertTitle: "Delete {{entity}} segment?",
2897
+ deleteAlertMessage: "You are permanently deleting the segment <strong>{{entity}}</strong>. This can't be undone.",
2898
+ deleteAlertTitle: "Delete segment?",
2595
2899
  manageSegments: "Manage segments",
2596
2900
  name: "Segment name",
2597
2901
  noSegmentsFound: "No segments found",
@@ -2602,8 +2906,8 @@ var segments = {
2602
2906
  segmentName: "Segment name",
2603
2907
  showLess: "See less",
2604
2908
  showMoreNumbers: "See {{entity}} more",
2605
- updateSegment: "Update segment",
2606
- updateSegmentMessage: "Are you sure you want to update the current segment?"
2909
+ updateSegment: "Update segment?",
2910
+ updateSegmentMessage: "You are trying to update the current segment."
2607
2911
  };
2608
2912
  var labels = {
2609
2913
  keyword: "Keyword"
@@ -2702,15 +3006,15 @@ function _defineProperty(obj, key, value) {
2702
3006
  var SHORTCUTS = {
2703
3007
  closePane: {
2704
3008
  sequence: "escape",
2705
- description: t$1("shortcuts.closePane")
3009
+ description: t$2("shortcuts.closePane")
2706
3010
  },
2707
3011
  deleteBlock: {
2708
3012
  sequence: "backspace",
2709
- description: t$1("shortcuts.deleteBlock")
3013
+ description: t$2("shortcuts.deleteBlock")
2710
3014
  },
2711
3015
  openFilterPane: {
2712
3016
  sequence: "enter",
2713
- description: t$1("shortcuts.openFilterPane")
3017
+ description: t$2("shortcuts.openFilterPane")
2714
3018
  }
2715
3019
  };
2716
3020
 
@@ -2798,48 +3102,48 @@ var DATE_RULES = {
2798
3102
  };
2799
3103
 
2800
3104
  var NUMBER_RULES = [{
2801
- label: t$1("rules.exactly"),
3105
+ label: t$2("rules.exactly"),
2802
3106
  value: "is"
2803
3107
  }, {
2804
- label: t$1("rules.notExactly"),
3108
+ label: t$2("rules.notExactly"),
2805
3109
  value: "is_not"
2806
3110
  }, {
2807
- label: t$1("rules.greaterThan"),
3111
+ label: t$2("rules.greaterThan"),
2808
3112
  value: "greater_than"
2809
3113
  }, {
2810
- label: t$1("rules.lessThan"),
3114
+ label: t$2("rules.lessThan"),
2811
3115
  value: "less_than"
2812
3116
  }];
2813
3117
  var TEXT_RULES = [{
2814
- label: t$1("rules.contains"),
3118
+ label: t$2("rules.contains"),
2815
3119
  value: "contains"
2816
3120
  }, {
2817
- label: t$1("rules.doesNotContain"),
3121
+ label: t$2("rules.doesNotContain"),
2818
3122
  value: "does_not_contain"
2819
3123
  }, {
2820
- label: t$1("rules.exactly"),
3124
+ label: t$2("rules.exactly"),
2821
3125
  value: "is"
2822
3126
  }, {
2823
- label: t$1("rules.notExactly"),
3127
+ label: t$2("rules.notExactly"),
2824
3128
  value: "is_not"
2825
3129
  }, {
2826
- label: t$1("rules.startsWith"),
3130
+ label: t$2("rules.startsWith"),
2827
3131
  value: "starts_with"
2828
3132
  }, {
2829
- label: t$1("rules.doesNotStartWith"),
3133
+ label: t$2("rules.doesNotStartWith"),
2830
3134
  value: "does_not_start_with"
2831
3135
  }, {
2832
- label: t$1("rules.endsWith"),
3136
+ label: t$2("rules.endsWith"),
2833
3137
  value: "ends_with"
2834
3138
  }, {
2835
- label: t$1("rules.doesNotEndWith"),
3139
+ label: t$2("rules.doesNotEndWith"),
2836
3140
  value: "does_not_end_with"
2837
3141
  }];
2838
3142
  var DEFAULT_BOOLEAN_OPTIONS = [{
2839
- label: t$1("common.yes"),
3143
+ label: t$2("common.yes"),
2840
3144
  value: "true"
2841
3145
  }, {
2842
- label: t$1("common.no"),
3146
+ label: t$2("common.no"),
2843
3147
  value: "false"
2844
3148
  }];
2845
3149
 
@@ -3852,6 +4156,7 @@ var Segment = function Segment(_ref) {
3852
4156
  isOpen: isUpdateAlertOpen,
3853
4157
  isSubmitting: isUpdating,
3854
4158
  message: t("segments.updateSegmentMessage"),
4159
+ submitButtonLabel: t("common.update"),
3855
4160
  title: t("segments.updateSegment"),
3856
4161
  onClose: function onClose() {
3857
4162
  return setIsUpdateAlertOpen(false);
@@ -6960,7 +7265,8 @@ var Text = function Text(_ref) {
6960
7265
  filter = _ref.filter,
6961
7266
  filters = _ref.filters,
6962
7267
  handleApplyFilter = _ref.handleApplyFilter,
6963
- autoFocus = _ref.autoFocus;
7268
+ autoFocus = _ref.autoFocus,
7269
+ onClose = _ref.onClose;
6964
7270
  var key = column.key,
6965
7271
  _column$defaultType = column.defaultType,
6966
7272
  defaultType = _column$defaultType === void 0 ? column.type : _column$defaultType,
@@ -6987,6 +7293,30 @@ var Text = function Text(_ref) {
6987
7293
  var debouncedInputValue = useDebounce(inputValue);
6988
7294
  var _useTranslation = useTranslation(),
6989
7295
  t = _useTranslation.t;
7296
+ var handleUpdateAndApplyFilter = function handleUpdateAndApplyFilter() {
7297
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : debouncedInputValue;
7298
+ var rule = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : selectedRule;
7299
+ if (equals(filter === null || filter === void 0 ? void 0 : filter.value, value) && equals(selectedRule, rule)) return;
7300
+ var updatedFilter = buildUpdatedFilter({
7301
+ column: column,
7302
+ defaultType: defaultType,
7303
+ option: {},
7304
+ rule: rule.value,
7305
+ value: value.trim()
7306
+ });
7307
+ handleApplyFilter(updatedFilter);
7308
+ };
7309
+ var handleKeydown = function handleKeydown(e) {
7310
+ if (e.key === "Enter") {
7311
+ handleUpdateAndApplyFilter(inputValue);
7312
+ onClose();
7313
+ }
7314
+ };
7315
+ var handleRuleChange = function handleRuleChange(ruleOption) {
7316
+ setSelectedRule(ruleOption);
7317
+ if (!debouncedInputValue) return;
7318
+ handleUpdateAndApplyFilter(debouncedInputValue, ruleOption);
7319
+ };
6990
7320
 
6991
7321
  // Reset states when "Clear filters" button is clicked.
6992
7322
  useEffect(function () {
@@ -7002,27 +7332,8 @@ var Text = function Text(_ref) {
7002
7332
  });
7003
7333
  return;
7004
7334
  }
7005
- var updatedFilter = buildUpdatedFilter({
7006
- column: column,
7007
- defaultType: defaultType,
7008
- option: {},
7009
- rule: selectedRule.value,
7010
- value: debouncedInputValue.trim()
7011
- });
7012
- handleApplyFilter(updatedFilter);
7335
+ handleUpdateAndApplyFilter();
7013
7336
  }, [debouncedInputValue]);
7014
- var handleRuleChange = function handleRuleChange(ruleOption) {
7015
- setSelectedRule(ruleOption);
7016
- if (!debouncedInputValue) return;
7017
- var updatedFilter = buildUpdatedFilter({
7018
- column: column,
7019
- defaultType: defaultType,
7020
- option: {},
7021
- rule: ruleOption.value,
7022
- value: debouncedInputValue.trim()
7023
- });
7024
- handleApplyFilter(updatedFilter);
7025
- };
7026
7337
  return /*#__PURE__*/React.createElement("div", {
7027
7338
  className: "neeto-filters-pane-filter__item-wrapper"
7028
7339
  }, showRuleSelector && /*#__PURE__*/React.createElement(Select, {
@@ -7044,7 +7355,8 @@ var Text = function Text(_ref) {
7044
7355
  }),
7045
7356
  onChange: function onChange(event) {
7046
7357
  return setInputValue(event.target.value);
7047
- }
7358
+ },
7359
+ onKeyDown: handleKeydown
7048
7360
  }, otherProps)));
7049
7361
  };
7050
7362
 
@@ -7117,7 +7429,8 @@ var Item = function Item(_ref) {
7117
7429
  var column = _ref.column,
7118
7430
  filters = _ref.filters,
7119
7431
  onChange = _ref.onChange,
7120
- autoFocus = _ref.autoFocus;
7432
+ autoFocus = _ref.autoFocus,
7433
+ onClose = _ref.onClose;
7121
7434
  var key = column.key,
7122
7435
  _column$defaultType = column.defaultType,
7123
7436
  defaultType = _column$defaultType === void 0 ? column.type : _column$defaultType;
@@ -7139,7 +7452,8 @@ var Item = function Item(_ref) {
7139
7452
  column: column,
7140
7453
  filter: filter,
7141
7454
  filters: filters,
7142
- handleApplyFilter: handleApplyFilter
7455
+ handleApplyFilter: handleApplyFilter,
7456
+ onClose: onClose
7143
7457
  });
7144
7458
  }
7145
7459
  if (isDate(defaultType)) {
@@ -7301,7 +7615,8 @@ var Pane = function Pane(_ref) {
7301
7615
  column: column,
7302
7616
  filters: filters,
7303
7617
  key: column.key,
7304
- onChange: handleChange
7618
+ onChange: handleChange,
7619
+ onClose: onClose
7305
7620
  });
7306
7621
  }), isPresent(groupedColumns) && /*#__PURE__*/React.createElement(Accordion, {
7307
7622
  defaultActiveKey: groupedColumns.findIndex(function (_ref4) {
@@ -7435,12 +7750,13 @@ var DeleteAlert = function DeleteAlert(_ref) {
7435
7750
  return /*#__PURE__*/React.createElement(Alert, {
7436
7751
  isOpen: isOpen,
7437
7752
  isSubmitting: isDeleting,
7438
- message: t("segments.deleteAlertMessage", {
7439
- entity: segment.name
7440
- }),
7441
- submitButtonLabel: t("common.proceed"),
7442
- title: t("segments.deleteAlertTitle", {
7443
- entity: segment.name
7753
+ submitButtonLabel: t("common.delete"),
7754
+ title: t("segments.deleteAlertTitle"),
7755
+ message: /*#__PURE__*/React.createElement(Trans, {
7756
+ i18nKey: "segments.deleteAlertMessage",
7757
+ values: {
7758
+ entity: segment.name
7759
+ }
7444
7760
  }),
7445
7761
  onClose: onClose,
7446
7762
  onSubmit: handleDelete