@neovici/cosmoz-omnitable 7.2.0 → 8.0.0-beta.10

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.
Files changed (52) hide show
  1. package/cosmoz-omnitable-column-amount.js +89 -320
  2. package/cosmoz-omnitable-column-autocomplete.js +38 -47
  3. package/cosmoz-omnitable-column-boolean.js +107 -209
  4. package/cosmoz-omnitable-column-date.js +89 -102
  5. package/cosmoz-omnitable-column-datetime.js +86 -119
  6. package/cosmoz-omnitable-column-list-data.js +4 -1
  7. package/cosmoz-omnitable-column-list-horizontal.js +20 -38
  8. package/cosmoz-omnitable-column-list-mixin.js +135 -140
  9. package/cosmoz-omnitable-column-list.js +19 -28
  10. package/cosmoz-omnitable-column-mixin.js +70 -447
  11. package/cosmoz-omnitable-column-number.js +91 -183
  12. package/cosmoz-omnitable-column-time.js +77 -162
  13. package/cosmoz-omnitable-column.js +49 -93
  14. package/cosmoz-omnitable-group-row.js +1 -5
  15. package/cosmoz-omnitable-header-row.js +9 -6
  16. package/cosmoz-omnitable-item-expand.js +0 -3
  17. package/cosmoz-omnitable-item-row.js +5 -8
  18. package/cosmoz-omnitable-styles.js +4 -8
  19. package/cosmoz-omnitable.js +74 -771
  20. package/lib/cosmoz-omnitable-amount-range-input.js +295 -0
  21. package/{cosmoz-omnitable-column-date-mixin.js → lib/cosmoz-omnitable-date-input-mixin.js} +4 -26
  22. package/lib/cosmoz-omnitable-date-range-input.js +81 -0
  23. package/lib/cosmoz-omnitable-datetime-range-input.js +75 -0
  24. package/lib/cosmoz-omnitable-number-range-input.js +159 -0
  25. package/{cosmoz-omnitable-column-range-mixin.js → lib/cosmoz-omnitable-range-input-mixin.js} +45 -129
  26. package/lib/cosmoz-omnitable-settings.js +8 -5
  27. package/lib/cosmoz-omnitable-time-range-input.js +130 -0
  28. package/lib/generic-sorter.js +2 -2
  29. package/lib/invoke.js +1 -0
  30. package/lib/memoize.js +54 -0
  31. package/lib/normalize-settings.js +2 -5
  32. package/lib/polymer-haunted-render-mixin.js +19 -0
  33. package/lib/save-as-csv-action.js +32 -0
  34. package/lib/save-as-xlsx-action.js +25 -0
  35. package/lib/use-canvas-width.js +1 -1
  36. package/lib/use-dom-columns.js +143 -0
  37. package/lib/use-fast-layout.js +23 -18
  38. package/lib/use-hash-state.js +59 -0
  39. package/lib/use-layout.js +1 -1
  40. package/lib/use-omnitable.js +81 -22
  41. package/lib/use-processed-items.js +133 -0
  42. package/lib/use-resizable-columns.js +1 -2
  43. package/lib/use-sort-and-group-options.js +30 -0
  44. package/lib/utils-amount.js +147 -0
  45. package/lib/utils-data.js +41 -0
  46. package/lib/utils-date.js +204 -0
  47. package/lib/utils-datetime.js +71 -0
  48. package/lib/utils-number.js +112 -0
  49. package/lib/utils-time.js +115 -0
  50. package/package.json +1 -2
  51. package/lib/use-force-render.js +0 -8
  52. package/lib/use-render-on-column-updates.js +0 -18
@@ -0,0 +1,147 @@
1
+ import { get } from '@polymer/polymer/lib/utils/path';
2
+ import { toNumber } from './utils-number';
3
+
4
+ export const
5
+ /**
6
+ * Converts a value to an amount object optionaly limiting it.
7
+ *
8
+ * @param {Object} rates The rates
9
+ * @param {Object} value The value to convert to number
10
+ * @param {Object} limit The value used to limit the number
11
+ * @param {Function} limitFunc The function used to limit the number (Math.min|Math.max)
12
+ * @returns {Object|void} Value converted to Number or void
13
+ */
14
+ toAmount = (rates = {}, value, limit, limitFunc) => { // eslint-disable-line max-statements
15
+ if (value == null || value === '') {
16
+ return;
17
+ }
18
+
19
+ if (typeof value !== 'object' || value.currency == null || value.currency === '') {
20
+ return null;
21
+ }
22
+
23
+ const number = toNumber(value.amount);
24
+ if (number == null || Number.isNaN(number)) {
25
+ return null;
26
+ }
27
+ const amount = {
28
+ currency: value.currency,
29
+ amount: number
30
+ };
31
+
32
+ if (limitFunc == null || limit == null) {
33
+ return amount;
34
+ }
35
+ const lAmount = toAmount(rates, limit);
36
+ if (lAmount == null) {
37
+ return amount;
38
+ }
39
+
40
+ // calculate value and limit amounts with rates
41
+ const
42
+ valAmount = amount.amount * (rates[amount.currency] || 1),
43
+ limAmount = lAmount.amount * (rates[lAmount.currency] || 1),
44
+ lNumber = toNumber(valAmount, limAmount, limitFunc);
45
+ return lNumber === valAmount ? amount : lAmount;
46
+ },
47
+
48
+ getComparableValue = ({ valuePath, rates }, item) => {
49
+ if (item == null) {
50
+ return;
51
+ }
52
+
53
+ let value = item;
54
+
55
+ if (valuePath != null) {
56
+ value = get(item, valuePath);
57
+ }
58
+ value = toAmount(rates, value);
59
+
60
+ if (value == null) {
61
+ return;
62
+ }
63
+ const amount = toNumber(value.amount);
64
+
65
+ if (rates == null) {
66
+ return amount;
67
+ }
68
+
69
+ return amount * (rates[value.currency] || 1);
70
+ },
71
+
72
+ applySingleFilter = (column, filter) => item => {
73
+ const value = getComparableValue(column, item);
74
+
75
+ if (value == null) {
76
+ return false;
77
+ }
78
+
79
+ const
80
+ min = getComparableValue({ ...column, valuePath: 'min' }, filter),
81
+ max = getComparableValue({ ...column, valuePath: 'max' }, filter);
82
+
83
+ return !(value < min || value > max);
84
+ },
85
+
86
+ formatters = {},
87
+ getFormatter = (currency, locale) => {
88
+ const id = locale ? locale : '',
89
+ key = currency + id || '';
90
+
91
+ if (formatters[key]) {
92
+ return formatters[key];
93
+ }
94
+
95
+ formatters[key] = new Intl.NumberFormat(locale || undefined, {
96
+ style: 'currency',
97
+ currency
98
+ });
99
+
100
+ return formatters[key];
101
+ },
102
+
103
+ renderValue = (rates, value, locale) => {
104
+ const amount = toAmount(rates, value);
105
+ if (amount == null) {
106
+ return '';
107
+ }
108
+ return getFormatter(amount.currency, locale)
109
+ .format(value.amount);
110
+ },
111
+
112
+
113
+ getString = ({ valuePath, rates, locale }, item) => {
114
+ const value = toAmount(rates, get(item, valuePath));
115
+ if (value === undefined) {
116
+ return '';
117
+ }
118
+ if (value === null) {
119
+ return 'Invalid value';
120
+ }
121
+ return renderValue(rates, value, locale);
122
+ },
123
+
124
+ toHashString = value => {
125
+ if (!value) {
126
+ return '';
127
+ }
128
+ return value.amount + value.currency;
129
+ },
130
+
131
+ fromHashString = value => {
132
+ if (value == null || value === '') {
133
+ return;
134
+ }
135
+ const params = value.match(/^(-?[\d]+)([\D]+?)$/iu);
136
+ if (!Array.isArray(params) || params.length < 0) {
137
+ return null;
138
+ }
139
+ return {
140
+ amount: params[1],
141
+ currency: params[2]
142
+ };
143
+ },
144
+
145
+ getCurrency = ({ valuePath }, item) => get(item, valuePath)?.currency,
146
+
147
+ getInputString = ({ valuePath }, item) => get(item, valuePath)?.amount;
@@ -0,0 +1,41 @@
1
+ import { get, set } from '@polymer/polymer/lib/utils/path';
2
+ import { columnSymbol } from './use-dom-columns';
3
+
4
+ export const
5
+ valuesFrom = (data, valuePath) => data
6
+ ?.map(item => get(item, valuePath))
7
+ .filter((value, index, self) =>
8
+ value != null && self.indexOf(value) === index
9
+ ),
10
+
11
+ defaultComputeSource = ({ externalValues, values, valuePath }, data) =>
12
+ externalValues || typeof values === 'function'
13
+ ? values
14
+ : valuesFrom(data, valuePath),
15
+
16
+ onItemChange = (host, column, item, value) => {
17
+ const
18
+ { valuePath } = column,
19
+ oldValue = get(item, valuePath);
20
+
21
+ if (value === oldValue) {
22
+ return;
23
+ }
24
+
25
+ set(item, valuePath, value);
26
+
27
+ const
28
+ change = {
29
+ item,
30
+ valuePath,
31
+ value,
32
+ oldValue,
33
+ column: column[columnSymbol]
34
+ };
35
+
36
+ host.dispatchEvent(new CustomEvent('column-item-changed', {
37
+ bubbles: true,
38
+ composed: true,
39
+ detail: change
40
+ }));
41
+ };
@@ -0,0 +1,204 @@
1
+ import { toLocalISOString } from '@neovici/cosmoz-utils/lib/date';
2
+ import { get } from '@polymer/polymer/lib/utils/path';
3
+ import { toNumber } from './utils-number';
4
+
5
+ export const
6
+
7
+
8
+ /**
9
+ * Calculates the local timezone offset and formats it to ISO Timezone string.
10
+ * @param {String} localISOString an ISO date string
11
+ * @return {String} the ISO timezone
12
+ */
13
+ getTimezoneString = localISOString => {
14
+ const off = -new Date(localISOString).getTimezoneOffset() / 60;
15
+ return (off < 0 ? '-' : '+') + ['0', Math.abs(off)].join('').substr(-2) + ':00';
16
+ },
17
+
18
+ /**
19
+ * Computes the local timezone and adds it to a local ISO string
20
+ * @param {String} localISOString an ISO date string, without timezone info
21
+ * @return {String} an ISO date string, with timezone info
22
+ */
23
+ getAbsoluteISOString = localISOString => {
24
+ // Most browsers use local timezone when no timezone is specified
25
+ // but Safari uses UTC, so we set it implicitly
26
+ // TODO: Consider removing this when/if Safari handles local timezone correctly
27
+ if (localISOString.length === 19) {
28
+ return localISOString + getTimezoneString(localISOString);
29
+ }
30
+ return localISOString;
31
+ },
32
+
33
+ parseDate = value => {
34
+ if (value == null || value === '') {
35
+ return;
36
+ }
37
+
38
+ // convert value to Date
39
+ let date = value;
40
+ if (!(date instanceof Date)) {
41
+ // if the value is an ISO string, make sure that it has an explicit timezone
42
+ if (typeof value === 'string') {
43
+ date = getAbsoluteISOString(date);
44
+ }
45
+
46
+ date = new Date(date);
47
+ }
48
+
49
+ if (Number.isNaN(date.getTime())) {
50
+ return null;
51
+ }
52
+
53
+ return date;
54
+ },
55
+
56
+ /**
57
+ * Get comparable number from date
58
+ *
59
+ * @param {String} valuePath Property path
60
+ * @param {Object} item Item to be processed
61
+ * @returns {Number|void} Valid value or void
62
+ */
63
+ getComparableValue = ({ valuePath }, item) => {
64
+ if (item == null) {
65
+ return;
66
+ }
67
+ let value = item;
68
+ if (valuePath != null) {
69
+ value = get(item, valuePath);
70
+ }
71
+ value = parseDate(value);
72
+
73
+ if (value == null) {
74
+ return;
75
+ }
76
+ return toNumber(value.getTime());
77
+ },
78
+
79
+ /**
80
+ * Converts an value to date optionaly limiting it.
81
+ *
82
+ * @param {Date|String} value Value to convert to date
83
+ * @param {Date|String} limit Value used to limit the date
84
+ * @param {Function} limitFunc Function used to limit the date (Math.min|Math.max)
85
+ * @returns {Date|void} Value converted to date optionaly limitated
86
+ */
87
+ toDate = (value, limit, limitFunc) => { // eslint-disable-line max-statements
88
+ const date = parseDate(value);
89
+
90
+ if (date == null) {
91
+ return null;
92
+ }
93
+
94
+ if (limitFunc == null || limit == null) {
95
+ return date;
96
+ }
97
+
98
+ const lDate = toDate(limit);
99
+ if (lDate == null) {
100
+ return date;
101
+ }
102
+
103
+ const comparableDate = getComparableValue({}, date),
104
+ comparableLDate = getComparableValue({}, lDate),
105
+ limitedValue = limitFunc(comparableDate, comparableLDate);
106
+ return limitedValue === comparableDate ? date : lDate;
107
+ },
108
+
109
+ renderValue = (value, formatter) => {
110
+ if (formatter == null) {
111
+ return;
112
+ }
113
+ const date = toDate(value);
114
+ if (date == null) {
115
+ return;
116
+ }
117
+ return formatter.format(date);
118
+ },
119
+
120
+ formatters = {},
121
+ getFormatter = locale => {
122
+ const key = locale || '';
123
+
124
+ if (formatters[key]) {
125
+ return formatters[key];
126
+ }
127
+
128
+ formatters[key] = new Intl.DateTimeFormat(locale || undefined);
129
+
130
+ return formatters[key];
131
+ },
132
+
133
+ getString = ({ valuePath, locale }, item) => {
134
+ let value = get(item, valuePath);
135
+ if (value === undefined) {
136
+ return '';
137
+ }
138
+ value = toDate(value);
139
+ if (value === null) {
140
+ return 'Invalid Date';
141
+ }
142
+ return renderValue(value, getFormatter(locale));
143
+ },
144
+
145
+ toInputString = value => {
146
+ const date = toDate(value);
147
+ if (date == null) {
148
+ return null;
149
+ }
150
+ return toLocalISOString(date).slice(0, 10);
151
+ },
152
+
153
+ getInputString = ({ valuePath }, item) => toInputString(get(item, valuePath)),
154
+
155
+ fromInputString = (value, property) => {
156
+ const date = toDate(value);
157
+ if (date == null) {
158
+ return;
159
+ }
160
+ if (property === 'min') {
161
+ date.setHours(0, 0, 0, 0);
162
+ }
163
+ if (property === 'max') {
164
+ date.setHours(23, 59, 59);
165
+ }
166
+ return date;
167
+ },
168
+
169
+ toHashString = value => {
170
+ const string = toInputString(value);
171
+ if (string == null) {
172
+ return '';
173
+ }
174
+ return string;
175
+ },
176
+
177
+ toXlsxValue = ({ valuePath }, item) => {
178
+ if (!valuePath) {
179
+ return '';
180
+ }
181
+ const date = toDate(get(item, valuePath));
182
+ if (!date) {
183
+ return '';
184
+ }
185
+ const localDate = toDate(toLocalISOString(date));
186
+ localDate.setHours(0, 0, 0, 0);
187
+ return localDate;
188
+ },
189
+
190
+ applySingleFilter = (column, filter) => item => {
191
+ const value = getComparableValue(column, item);
192
+
193
+ if (value == null) {
194
+ return false;
195
+ }
196
+
197
+ const
198
+ min = getComparableValue({ ...column, valuePath: 'min' }, filter),
199
+ max = getComparableValue({ ...column, valuePath: 'max' }, filter);
200
+
201
+ return !(value < min || value > max);
202
+ };
203
+
204
+
@@ -0,0 +1,71 @@
1
+ import { toLocalISOString } from '@neovici/cosmoz-utils/lib/date';
2
+ import { get } from '@polymer/polymer/lib/utils/path';
3
+ import { renderValue, toDate } from './utils-date';
4
+
5
+ export const
6
+
7
+ formatters = {},
8
+ getFormatter = locale => {
9
+ const key = locale || '';
10
+
11
+ if (formatters[key]) {
12
+ return formatters[key];
13
+ }
14
+
15
+ const timeFormatOption = {
16
+ year: 'numeric',
17
+ month: 'numeric',
18
+ day: 'numeric',
19
+ hour: 'numeric',
20
+ minute: 'numeric'
21
+ };
22
+
23
+ formatters[key] = new Intl.DateTimeFormat(locale || undefined, timeFormatOption);
24
+
25
+ return formatters[key];
26
+ },
27
+
28
+ getString = ({ valuePath, locale }, item) => {
29
+ const value = toDate(get(item, valuePath));
30
+ if (value === undefined) {
31
+ return '';
32
+ }
33
+ if (value === null) {
34
+ return 'Invalid Date';
35
+ }
36
+ return renderValue(value, getFormatter(locale));
37
+ },
38
+
39
+ toXlsxValue = ({ valuePath }, item) => {
40
+ if (!valuePath) {
41
+ return '';
42
+ }
43
+ return get(item, valuePath);
44
+ },
45
+
46
+ toHashString = value => {
47
+ const date = toDate(value);
48
+ if (date == null) {
49
+ return '';
50
+ }
51
+ //Use utc in hash
52
+ return date.toISOString().slice(0, 19).replace(/:/gu, '.');
53
+ },
54
+
55
+ fromHashString = value => {
56
+ if (value == null || value === '') {
57
+ return;
58
+ }
59
+ //Parse utc from hash string
60
+ return toDate(value.replace(/\./gu, ':') + 'Z');
61
+ },
62
+
63
+ toInputString = value => {
64
+ const date = toDate(value);
65
+ if (date == null) {
66
+ return null;
67
+ }
68
+ return toLocalISOString(date).slice(0, 19);
69
+ },
70
+
71
+ getInputString = ({ valuePath }, item) => toInputString(get(item, valuePath));
@@ -0,0 +1,112 @@
1
+
2
+ import { get } from '@polymer/polymer/lib/utils/path';
3
+ import { memoooize } from './memoize';
4
+
5
+ export const
6
+ /**
7
+ * Converts a value to number optionaly limiting it.
8
+ *
9
+ * @param {Number|*} value The value to convert to number
10
+ * @param {Number|*} limit The value used to limit the number
11
+ * @param {Function} limitFunc The function used to limit the number (Math.min|Math.max)
12
+ * @returns {Number|void} Value converted to Number or void
13
+ */
14
+ toNumber = (value, limit, limitFunc) => {
15
+ if (value == null || value === '') {
16
+ return;
17
+ }
18
+ const number = typeof value === 'number' ? value : Number(value);
19
+ if (Number.isNaN(number)) {
20
+ return;
21
+ }
22
+ if (limitFunc == null || limit == null) {
23
+ return number;
24
+ }
25
+ const lNumber = toNumber(limit);
26
+ if (lNumber == null) {
27
+ return number;
28
+ }
29
+ return limitFunc(number, lNumber);
30
+ },
31
+
32
+ toInputString = value => {
33
+ const val = toNumber(value);
34
+ if (val == null) {
35
+ return null;
36
+ }
37
+ return val.toString();
38
+ },
39
+
40
+ getInputString = ({ valuePath }, item) => {
41
+ const value = toNumber(get(item, valuePath));
42
+ return toInputString(value);
43
+ },
44
+
45
+ toHashString = value => {
46
+ const string = toInputString(value);
47
+ if (string == null) {
48
+ return '';
49
+ }
50
+ return string;
51
+ },
52
+
53
+ getComparableValue = ({ valuePath, maximumFractionDigits }, item) => {
54
+ if (item == null) {
55
+ return;
56
+ }
57
+ let value = item;
58
+ if (valuePath != null) {
59
+ value = get(item, valuePath);
60
+ }
61
+ value = toNumber(value);
62
+ if (value == null) {
63
+ return;
64
+ }
65
+
66
+ if (maximumFractionDigits !== null) {
67
+ return toNumber(value.toFixed(maximumFractionDigits));
68
+ }
69
+ return value;
70
+ },
71
+
72
+ makeFormatter = memoooize((locale, minimumFractionDigits, maximumFractionDigits) => {
73
+ const options = {
74
+ localeMatcher: 'best fit' // chrome expects this when using custom options
75
+ };
76
+ if (minimumFractionDigits !== null) {
77
+ options.minimumFractionDigits = minimumFractionDigits;
78
+ }
79
+ if (maximumFractionDigits !== null) {
80
+ options.maximumFractionDigits = maximumFractionDigits;
81
+ }
82
+ return new Intl.NumberFormat(locale || undefined, options);
83
+ }),
84
+
85
+ getString = ({ valuePath, locale, minimumFractionDigits, maximumFractionDigits }, item) => {
86
+ const value = get(item, valuePath);
87
+
88
+ if (value == null) {
89
+ return '';
90
+ }
91
+
92
+ const number = toNumber(value);
93
+ if (number == null) {
94
+ return;
95
+ }
96
+ const formatter = makeFormatter(locale, minimumFractionDigits, maximumFractionDigits);
97
+ return formatter.format(number);
98
+ },
99
+
100
+ applySingleFilter = (column, filter) => item => {
101
+ const value = getComparableValue(column, item);
102
+
103
+ if (value == null) {
104
+ return false;
105
+ }
106
+
107
+ const
108
+ min = getComparableValue({ ...column, valuePath: 'min' }, filter),
109
+ max = getComparableValue({ ...column, valuePath: 'max' }, filter);
110
+
111
+ return !(value < min || value > max);
112
+ };
@@ -0,0 +1,115 @@
1
+ import { toLocalISOString } from '@neovici/cosmoz-utils/lib/date';
2
+ import { get } from '@polymer/polymer/lib/utils/path';
3
+ import { getAbsoluteISOString, renderValue, toDate as superToDate } from './utils-date';
4
+ import { toNumber } from './utils-number';
5
+
6
+ export const
7
+
8
+ _fixedDate = '1970-01-01',
9
+
10
+ /**
11
+ * Converts time to date optionaly limiting it.
12
+ *
13
+ * @param {Date|Number} value Date or Timestamp ( miliseconds since property _fixedDate ) to be converted
14
+ * @param {Date|Number} limit Optional value to limit the date.
15
+ * @param {Function} limitFunc Function used to limit the date (Math.min|Math.max)
16
+ * @returns {Date|void} Value converted to date optionaly limitated
17
+ */
18
+ toDate = (value, limit, limitFunc) => {
19
+ // Most browsers use local timezone when no timezone is specified
20
+ // but Safari uses UTC, so we set it implicitly
21
+ // TODO: Consider removing this when/if Safari handles local timezone correctly
22
+ const date = typeof value === 'string' && value.length > 3 && value.length <= 9
23
+ ? getAbsoluteISOString(_fixedDate + 'T' + value)
24
+ : value;
25
+ return superToDate(date, limit, limitFunc);
26
+ },
27
+
28
+ formatters = {},
29
+ getFormatter = locale => {
30
+ const key = locale || '';
31
+
32
+ if (formatters[key]) {
33
+ return formatters[key];
34
+ }
35
+
36
+ const timeFormatOption = {
37
+ hour: 'numeric',
38
+ minute: 'numeric',
39
+ second: 'numeric'
40
+ };
41
+ formatters[key] = new Intl.DateTimeFormat(locale || undefined, timeFormatOption);
42
+
43
+ return formatters[key];
44
+ },
45
+ getString = ({ valuePath, locale }, item) => {
46
+ const value = toDate(get(item, valuePath));
47
+ if (value === undefined) {
48
+ return '';
49
+ }
50
+ if (value === null) {
51
+ return 'Invalid Date';
52
+ }
53
+ return renderValue(value, getFormatter(locale));
54
+ },
55
+
56
+ toXlsxValue = (column, item) => {
57
+ if (!column.valuePath) {
58
+ return '';
59
+ }
60
+ return getString(column, item);
61
+ },
62
+ toInputString = value => {
63
+ const date = toDate(value);
64
+ if (date == null) {
65
+ return null;
66
+ }
67
+ return toLocalISOString(date).slice(11, 19);
68
+ },
69
+
70
+ getComparableValue = ({ valuePath }, item) => {
71
+ if (item == null) {
72
+ return;
73
+ }
74
+ let value = toInputString(valuePath == null ? item : get(item, valuePath));
75
+ if (value == null) {
76
+ return;
77
+ }
78
+ value = toDate(getAbsoluteISOString(_fixedDate + 'T' + value));
79
+ if (value == null) {
80
+ return;
81
+ }
82
+ return toNumber(value.getTime());
83
+ },
84
+
85
+ applySingleFilter = (column, filter) => item => {
86
+ const value = getComparableValue(column, item);
87
+
88
+ if (value == null) {
89
+ return false;
90
+ }
91
+
92
+ const
93
+ min = getComparableValue({ ...column, valuePath: 'min' }, filter),
94
+ max = getComparableValue({ ...column, valuePath: 'max' }, filter);
95
+
96
+ return !(value < min || value > max);
97
+ },
98
+
99
+ toHashString = value => {
100
+ const date = toDate(value);
101
+ if (date == null) {
102
+ return '';
103
+ }
104
+ //Use utc in hash
105
+ return date.toISOString().slice(11, 19).replace(/:/gu, '.');
106
+ },
107
+
108
+ fromHashString = value => {
109
+ if (value == null || value === '') {
110
+ return;
111
+ }
112
+ //Parse utc from hash string
113
+ return toDate(value.replace(/\./gu, ':') + 'Z');
114
+ };
115
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-omnitable",
3
- "version": "7.2.0",
3
+ "version": "8.0.0-beta.10",
4
4
  "description": "[![Build Status](https://travis-ci.org/Neovici/cosmoz-omnitable.svg?branch=master)](https://travis-ci.org/Neovici/cosmoz-omnitable)",
5
5
  "keywords": [
6
6
  "web-components"
@@ -64,7 +64,6 @@
64
64
  "@polymer/iron-icons": "^3.0.0",
65
65
  "@polymer/iron-label": "^3.0.0",
66
66
  "@polymer/paper-button": "^3.0.0",
67
- "@polymer/paper-checkbox": "^3.0.0",
68
67
  "@polymer/paper-dropdown-menu": "^3.2.0",
69
68
  "@polymer/paper-icon-button": "^3.0.0",
70
69
  "@polymer/paper-input": "^3.2.0",
@@ -1,8 +0,0 @@
1
- import {
2
- useState, useCallback
3
- } from 'haunted';
4
-
5
- export const useForceRender = () => {
6
- const [, setState] = useState(0);
7
- return useCallback(() => setState(state => state + 1), [setState]);
8
- };