@eturnity/eturnity_reusable_components 8.40.2 → 8.40.3

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/main.es18.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isSymbol, hasChanged, isObject, NOOP, isArray, extend, toRawType, isFunction, def, hasOwn, isIntegerKey, isMap, makeMap, capitalize } from "./main.es742.js";
1
+ import { isSymbol, hasChanged, isObject, NOOP, isArray, extend, toRawType, isFunction, def, hasOwn, isIntegerKey, isMap, makeMap, capitalize } from "./main.es743.js";
2
2
  function warn(msg, ...args) {
3
3
  console.warn(`[Vue warn] ${msg}`, ...args);
4
4
  }
@@ -1,5 +1,5 @@
1
1
  import { HOOK_PLUGIN_SETTINGS_SET } from "./main.es385.js";
2
- import { now } from "./main.es743.js";
2
+ import { now } from "./main.es742.js";
3
3
  class ApiProxy {
4
4
  constructor(plugin, hook) {
5
5
  this.target = null;
@@ -1,64 +1,25 @@
1
- function makeMap(str, expectsLowerCase) {
2
- const map = /* @__PURE__ */ Object.create(null);
3
- const list = str.split(",");
4
- for (let i = 0; i < list.length; i++) {
5
- map[list[i]] = true;
1
+ let supported;
2
+ let perf;
3
+ function isPerformanceSupported() {
4
+ var _a;
5
+ if (supported !== void 0) {
6
+ return supported;
6
7
  }
7
- return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
8
+ if (typeof window !== "undefined" && window.performance) {
9
+ supported = true;
10
+ perf = window.performance;
11
+ } else if (typeof globalThis !== "undefined" && ((_a = globalThis.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {
12
+ supported = true;
13
+ perf = globalThis.perf_hooks.performance;
14
+ } else {
15
+ supported = false;
16
+ }
17
+ return supported;
18
+ }
19
+ function now() {
20
+ return isPerformanceSupported() ? perf.now() : Date.now();
8
21
  }
9
- !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
10
- !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
11
- const NOOP = () => {
12
- };
13
- const extend = Object.assign;
14
- const hasOwnProperty = Object.prototype.hasOwnProperty;
15
- const hasOwn = (val, key) => hasOwnProperty.call(val, key);
16
- const isArray = Array.isArray;
17
- const isMap = (val) => toTypeString(val) === "[object Map]";
18
- const isFunction = (val) => typeof val === "function";
19
- const isString = (val) => typeof val === "string";
20
- const isSymbol = (val) => typeof val === "symbol";
21
- const isObject = (val) => val !== null && typeof val === "object";
22
- const objectToString = Object.prototype.toString;
23
- const toTypeString = (value) => objectToString.call(value);
24
- const toRawType = (value) => {
25
- return toTypeString(value).slice(8, -1);
26
- };
27
- const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
28
- const cacheStringFunction = (fn) => {
29
- const cache = /* @__PURE__ */ Object.create(null);
30
- return (str) => {
31
- const hit = cache[str];
32
- return hit || (cache[str] = fn(str));
33
- };
34
- };
35
- const capitalize = cacheStringFunction(
36
- (str) => str.charAt(0).toUpperCase() + str.slice(1)
37
- );
38
- const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
39
- const def = (obj, key, value) => {
40
- Object.defineProperty(obj, key, {
41
- configurable: true,
42
- enumerable: false,
43
- value
44
- });
45
- };
46
22
  export {
47
- NOOP,
48
- capitalize,
49
- def,
50
- extend,
51
- hasChanged,
52
- hasOwn,
53
- isArray,
54
- isFunction,
55
- isIntegerKey,
56
- isMap,
57
- isObject,
58
- isString,
59
- isSymbol,
60
- makeMap,
61
- objectToString,
62
- toRawType,
63
- toTypeString
23
+ isPerformanceSupported,
24
+ now
64
25
  };
@@ -1,25 +1,64 @@
1
- let supported;
2
- let perf;
3
- function isPerformanceSupported() {
4
- var _a;
5
- if (supported !== void 0) {
6
- return supported;
1
+ function makeMap(str, expectsLowerCase) {
2
+ const map = /* @__PURE__ */ Object.create(null);
3
+ const list = str.split(",");
4
+ for (let i = 0; i < list.length; i++) {
5
+ map[list[i]] = true;
7
6
  }
8
- if (typeof window !== "undefined" && window.performance) {
9
- supported = true;
10
- perf = window.performance;
11
- } else if (typeof globalThis !== "undefined" && ((_a = globalThis.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {
12
- supported = true;
13
- perf = globalThis.perf_hooks.performance;
14
- } else {
15
- supported = false;
16
- }
17
- return supported;
18
- }
19
- function now() {
20
- return isPerformanceSupported() ? perf.now() : Date.now();
7
+ return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
21
8
  }
9
+ !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
10
+ !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
11
+ const NOOP = () => {
12
+ };
13
+ const extend = Object.assign;
14
+ const hasOwnProperty = Object.prototype.hasOwnProperty;
15
+ const hasOwn = (val, key) => hasOwnProperty.call(val, key);
16
+ const isArray = Array.isArray;
17
+ const isMap = (val) => toTypeString(val) === "[object Map]";
18
+ const isFunction = (val) => typeof val === "function";
19
+ const isString = (val) => typeof val === "string";
20
+ const isSymbol = (val) => typeof val === "symbol";
21
+ const isObject = (val) => val !== null && typeof val === "object";
22
+ const objectToString = Object.prototype.toString;
23
+ const toTypeString = (value) => objectToString.call(value);
24
+ const toRawType = (value) => {
25
+ return toTypeString(value).slice(8, -1);
26
+ };
27
+ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
28
+ const cacheStringFunction = (fn) => {
29
+ const cache = /* @__PURE__ */ Object.create(null);
30
+ return (str) => {
31
+ const hit = cache[str];
32
+ return hit || (cache[str] = fn(str));
33
+ };
34
+ };
35
+ const capitalize = cacheStringFunction(
36
+ (str) => str.charAt(0).toUpperCase() + str.slice(1)
37
+ );
38
+ const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
39
+ const def = (obj, key, value) => {
40
+ Object.defineProperty(obj, key, {
41
+ configurable: true,
42
+ enumerable: false,
43
+ value
44
+ });
45
+ };
22
46
  export {
23
- isPerformanceSupported,
24
- now
47
+ NOOP,
48
+ capitalize,
49
+ def,
50
+ extend,
51
+ hasChanged,
52
+ hasOwn,
53
+ isArray,
54
+ isFunction,
55
+ isIntegerKey,
56
+ isMap,
57
+ isObject,
58
+ isString,
59
+ isSymbol,
60
+ makeMap,
61
+ objectToString,
62
+ toRawType,
63
+ toTypeString
25
64
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "8.40.2",
3
+ "version": "8.40.3",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -3,6 +3,7 @@
3
3
  <ParentDropdown
4
4
  :dropdown-text="dropdownText ? dropdownText : 'Default view'"
5
5
  :is-open="isDropdownOpen"
6
+ :number-of-filters-applied="numberOfFiltersApplied"
6
7
  @on-toggle="onToggleDropdown()"
7
8
  />
8
9
  <FilterSettings
@@ -74,6 +75,11 @@
74
75
  closeDropdown: {
75
76
  required: false,
76
77
  },
78
+ activeFilterView: {
79
+ type: Object,
80
+ default: null,
81
+ required: false,
82
+ },
77
83
  },
78
84
  data() {
79
85
  return {
@@ -82,6 +88,14 @@
82
88
  preventOutsideClick: false,
83
89
  }
84
90
  },
91
+ computed: {
92
+ numberOfFiltersApplied() {
93
+ const filterColumns = this.activeFilterView?.columns?.filter(
94
+ (column) => column.custom_view_filter !== null
95
+ )
96
+ return filterColumns?.length > 0 ? filterColumns.length : 0
97
+ },
98
+ },
85
99
  watch: {
86
100
  closeDropdown(newVal) {
87
101
  if (newVal) {
@@ -6,6 +6,9 @@
6
6
  <TitleWrapper :is-open="isOpen">
7
7
  <TitleText>
8
8
  {{ dropdownText }}
9
+ <Counter v-if="numberOfFiltersApplied">
10
+ {{ numberOfFiltersApplied }}
11
+ </Counter>
9
12
  </TitleText>
10
13
  <ArrowWrapper>
11
14
  <Icon
@@ -43,18 +46,32 @@
43
46
  grid-template-columns: auto auto;
44
47
  align-items: center;
45
48
  justify-items: center;
46
- grid-gap: 10px;
49
+ grid-gap: 8px;
47
50
  border: 1px solid ${(props) => props.theme.colors.grey4};
48
51
  background-color: ${(props) =>
49
52
  props.isOpen ? props.theme.colors.grey5 : props.theme.colors.white};
50
53
  border-left: none;
51
54
  border-radius: 0px 4px 4px 0px;
52
- padding: 6px 14px;
55
+ padding: 6px 10px;
53
56
  user-select: none;
54
57
  `
55
58
 
56
59
  const TitleText = styled.div`
57
60
  font-size: 13px;
61
+ display: flex;
62
+ align-items: center;
63
+ gap: 8px;
64
+ `
65
+
66
+ const Counter = styled.div`
67
+ line-height: 18px;
68
+ border-radius: 8px;
69
+ padding: 0 8px;
70
+ background: ${(props) => props.theme.semanticColors.purple['100']};
71
+ color: ${(props) => props.theme.colors.primary};
72
+ display: flex;
73
+ align-items: center;
74
+ justify-content: center;
58
75
  `
59
76
 
60
77
  const ArrowWrapper = styled.div`
@@ -75,6 +92,7 @@
75
92
  IconWrapper,
76
93
  TitleWrapper,
77
94
  TitleText,
95
+ Counter,
78
96
  ArrowWrapper,
79
97
  },
80
98
  props: {
@@ -86,6 +104,11 @@
86
104
  required: true,
87
105
  default: 'View',
88
106
  },
107
+ numberOfFiltersApplied: {
108
+ required: false,
109
+ default: 0,
110
+ type: Number,
111
+ },
89
112
  },
90
113
  }
91
114
  </script>