@trackunit/filters-filter-bar 0.0.340 → 0.0.342

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/index.cjs.js CHANGED
@@ -439,11 +439,10 @@ const ResetFiltersButton = ({ filtersHaveBeenApplied, resetFiltersToInitialState
439
439
  * which properties are required/recommended when using logEvent() on said event
440
440
  */
441
441
  const FilterEvents = {
442
- FilterApplied: reactCoreContextsApi.createEvent({
443
- amplitudeName: "Filters Applied - V2",
442
+ "Filters Applied - V2": reactCoreContextsApi.createEvent({
444
443
  description: "A filter was applied",
445
444
  }),
446
- StarringFilter: reactCoreContextsApi.createEvent({ amplitudeName: "Starring Filter - Toggled" }),
445
+ "Starring Filter - Toggled": reactCoreContextsApi.createEvent(),
447
446
  };
448
447
 
449
448
  /**
@@ -472,14 +471,14 @@ const StarredFiltersMenu = ({ filterBarDefinition, updateStarredFilters, starred
472
471
  return (jsxRuntime.jsxs("div", { className: "mb-2", children: [jsxRuntime.jsx("div", { className: "mt-2 mb-1 flex px-2", children: jsxRuntime.jsx(reactComponents.Text, { dataTestId: "starred-filters-group-title", size: "small", subtle: true, uppercase: true, weight: "bold", children: group.key }) }), group.filters.map(filter => {
473
472
  return (jsxRuntime.jsxs("div", { className: "flex w-full cursor-pointer items-center justify-between rounded-sm py-0 px-2 transition hover:bg-neutral-50", "data-testid": `${filter.filterKey}-star-filter`, onClick: () => {
474
473
  updateStarredFilters(filter.filterKey);
475
- logEvent("StarringFilter", {
474
+ logEvent("Starring Filter - Toggled", {
476
475
  type: filter.filterKey,
477
476
  });
478
477
  }, children: [jsxRuntime.jsx(reactComponents.Text, { weight: "thick", children: filter.title }), jsxRuntime.jsx(reactComponents.StarButton, { onClick: e => {
479
478
  e.preventDefault();
480
479
  e.stopPropagation();
481
480
  updateStarredFilters(filter.filterKey);
482
- logEvent("StarringFilter", {
481
+ logEvent("Starring Filter - Toggled", {
483
482
  type: filter.filterKey,
484
483
  });
485
484
  }, starred: starredFilterKeys.includes(filter.filterKey) })] }, filter.filterKey));
@@ -615,7 +614,7 @@ const DefaultCheckboxFilter = ({ filterDefinition, filterBarActions, options, lo
615
614
  const [undefinedCount, setUndefinedCount] = react.useState(null);
616
615
  const { logEvent } = reactCoreHooks.useAnalytics(FilterEvents);
617
616
  const handleClick = (value) => {
618
- logEvent("FilterApplied", {
617
+ logEvent("Filters Applied - V2", {
619
618
  type: filterName !== null && filterName !== void 0 ? filterName : `${sharedUtils.capitalize(filterDefinition.filterKey)}Filter`,
620
619
  value: value.key,
621
620
  });
@@ -723,7 +722,7 @@ const DefaultDateRangeFilter = ({ filterDefinition, filterName, value, setValue,
723
722
  };
724
723
  const { logEvent } = reactCoreHooks.useAnalytics(FilterEvents);
725
724
  const handleApply = (fromDateValue, toDateValue) => {
726
- logEvent("FilterApplied", {
725
+ logEvent("Filters Applied - V2", {
727
726
  type: filterName !== null && filterName !== void 0 ? filterName : `${sharedUtils.capitalize(filterDefinition.filterKey)}Filter`,
728
727
  value: JSON.stringify({ from: fromDateValue, to: toDateValue }),
729
728
  });
@@ -756,7 +755,7 @@ const DefaultMinMaxFilter = ({ filterDefinition, filterName, value, setValue, fi
756
755
  const handleApply = () => {
757
756
  const realMinValue = minValue === 0 ? undefined : minValue !== null && minValue !== void 0 ? minValue : undefined;
758
757
  const realMaxValue = maxValue === 0 ? undefined : maxValue !== null && maxValue !== void 0 ? maxValue : undefined;
759
- logEvent("FilterApplied", {
758
+ logEvent("Filters Applied - V2", {
760
759
  type: filterName !== null && filterName !== void 0 ? filterName : `${sharedUtils.capitalize(filterDefinition.filterKey)}Filter`,
761
760
  value: JSON.stringify({ min: realMinValue, max: realMaxValue }),
762
761
  });
@@ -781,7 +780,7 @@ const DefaultRadioFilter = ({ filterDefinition, filterBarActions, options, loadi
781
780
  const { key, label } = (_a = filteredOptions.find(({ key: id }) => id === selectedId)) !== null && _a !== void 0 ? _a : {};
782
781
  if (key && label) {
783
782
  filterBarActions.setArrayObjectValue(filterDefinition.filterKey, [{ value: key, name: label }]);
784
- logEvent("FilterApplied", {
783
+ logEvent("Filters Applied - V2", {
785
784
  type: filterName !== null && filterName !== void 0 ? filterName : `${sharedUtils.capitalize(filterDefinition.filterKey)}Filter`,
786
785
  value: String(label),
787
786
  });
package/index.esm.js CHANGED
@@ -431,11 +431,10 @@ const ResetFiltersButton = ({ filtersHaveBeenApplied, resetFiltersToInitialState
431
431
  * which properties are required/recommended when using logEvent() on said event
432
432
  */
433
433
  const FilterEvents = {
434
- FilterApplied: createEvent({
435
- amplitudeName: "Filters Applied - V2",
434
+ "Filters Applied - V2": createEvent({
436
435
  description: "A filter was applied",
437
436
  }),
438
- StarringFilter: createEvent({ amplitudeName: "Starring Filter - Toggled" }),
437
+ "Starring Filter - Toggled": createEvent(),
439
438
  };
440
439
 
441
440
  /**
@@ -464,14 +463,14 @@ const StarredFiltersMenu = ({ filterBarDefinition, updateStarredFilters, starred
464
463
  return (jsxs("div", { className: "mb-2", children: [jsx("div", { className: "mt-2 mb-1 flex px-2", children: jsx(Text, { dataTestId: "starred-filters-group-title", size: "small", subtle: true, uppercase: true, weight: "bold", children: group.key }) }), group.filters.map(filter => {
465
464
  return (jsxs("div", { className: "flex w-full cursor-pointer items-center justify-between rounded-sm py-0 px-2 transition hover:bg-neutral-50", "data-testid": `${filter.filterKey}-star-filter`, onClick: () => {
466
465
  updateStarredFilters(filter.filterKey);
467
- logEvent("StarringFilter", {
466
+ logEvent("Starring Filter - Toggled", {
468
467
  type: filter.filterKey,
469
468
  });
470
469
  }, children: [jsx(Text, { weight: "thick", children: filter.title }), jsx(StarButton, { onClick: e => {
471
470
  e.preventDefault();
472
471
  e.stopPropagation();
473
472
  updateStarredFilters(filter.filterKey);
474
- logEvent("StarringFilter", {
473
+ logEvent("Starring Filter - Toggled", {
475
474
  type: filter.filterKey,
476
475
  });
477
476
  }, starred: starredFilterKeys.includes(filter.filterKey) })] }, filter.filterKey));
@@ -607,7 +606,7 @@ const DefaultCheckboxFilter = ({ filterDefinition, filterBarActions, options, lo
607
606
  const [undefinedCount, setUndefinedCount] = useState(null);
608
607
  const { logEvent } = useAnalytics(FilterEvents);
609
608
  const handleClick = (value) => {
610
- logEvent("FilterApplied", {
609
+ logEvent("Filters Applied - V2", {
611
610
  type: filterName !== null && filterName !== void 0 ? filterName : `${capitalize$1(filterDefinition.filterKey)}Filter`,
612
611
  value: value.key,
613
612
  });
@@ -715,7 +714,7 @@ const DefaultDateRangeFilter = ({ filterDefinition, filterName, value, setValue,
715
714
  };
716
715
  const { logEvent } = useAnalytics(FilterEvents);
717
716
  const handleApply = (fromDateValue, toDateValue) => {
718
- logEvent("FilterApplied", {
717
+ logEvent("Filters Applied - V2", {
719
718
  type: filterName !== null && filterName !== void 0 ? filterName : `${capitalize$1(filterDefinition.filterKey)}Filter`,
720
719
  value: JSON.stringify({ from: fromDateValue, to: toDateValue }),
721
720
  });
@@ -748,7 +747,7 @@ const DefaultMinMaxFilter = ({ filterDefinition, filterName, value, setValue, fi
748
747
  const handleApply = () => {
749
748
  const realMinValue = minValue === 0 ? undefined : minValue !== null && minValue !== void 0 ? minValue : undefined;
750
749
  const realMaxValue = maxValue === 0 ? undefined : maxValue !== null && maxValue !== void 0 ? maxValue : undefined;
751
- logEvent("FilterApplied", {
750
+ logEvent("Filters Applied - V2", {
752
751
  type: filterName !== null && filterName !== void 0 ? filterName : `${capitalize$1(filterDefinition.filterKey)}Filter`,
753
752
  value: JSON.stringify({ min: realMinValue, max: realMaxValue }),
754
753
  });
@@ -773,7 +772,7 @@ const DefaultRadioFilter = ({ filterDefinition, filterBarActions, options, loadi
773
772
  const { key, label } = (_a = filteredOptions.find(({ key: id }) => id === selectedId)) !== null && _a !== void 0 ? _a : {};
774
773
  if (key && label) {
775
774
  filterBarActions.setArrayObjectValue(filterDefinition.filterKey, [{ value: key, name: label }]);
776
- logEvent("FilterApplied", {
775
+ logEvent("Filters Applied - V2", {
777
776
  type: filterName !== null && filterName !== void 0 ? filterName : `${capitalize$1(filterDefinition.filterKey)}Filter`,
778
777
  value: String(label),
779
778
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/filters-filter-bar",
3
- "version": "0.0.340",
3
+ "version": "0.0.342",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -12,6 +12,6 @@ export interface FilterEvent extends BaseEvent {
12
12
  * which properties are required/recommended when using logEvent() on said event
13
13
  */
14
14
  export declare const FilterEvents: {
15
- FilterApplied: import("@trackunit/react-core-contexts-api").Event<FilterEvent>;
16
- StarringFilter: import("@trackunit/react-core-contexts-api").Event<import("@trackunit/react-core-contexts-api").AdditionalProperties>;
15
+ "Filters Applied - V2": import("@trackunit/react-core-contexts-api").Event<FilterEvent>;
16
+ "Starring Filter - Toggled": import("@trackunit/react-core-contexts-api").Event<import("@trackunit/react-core-contexts-api").AdditionalProperties>;
17
17
  };