ngx-tethys 19.0.3 → 19.0.5
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/CHANGELOG.md +20 -0
- package/calendar/calendar-header.component.d.ts +3 -2
- package/color-picker/color-picker.component.d.ts +15 -3
- package/date-picker/abstract-picker.component.d.ts +6 -1
- package/date-picker/base-picker.component.d.ts +1 -1
- package/date-picker/lib/calendar/calendar-footer.component.d.ts +2 -1
- package/date-picker/lib/calendar/calendar-table.component.d.ts +4 -3
- package/date-picker/lib/popups/date-popup.component.d.ts +2 -1
- package/date-picker/lib/popups/inner-popup.component.d.ts +2 -1
- package/date-picker/picker.component.d.ts +4 -3
- package/date-picker/picker.util.d.ts +5 -5
- package/fesm2022/ngx-tethys-action.mjs +11 -12
- package/fesm2022/ngx-tethys-action.mjs.map +1 -1
- package/fesm2022/ngx-tethys-affix.mjs +8 -9
- package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
- package/fesm2022/ngx-tethys-alert.mjs +11 -12
- package/fesm2022/ngx-tethys-alert.mjs.map +1 -1
- package/fesm2022/ngx-tethys-anchor.mjs +10 -10
- package/fesm2022/ngx-tethys-arrow-switcher.mjs +7 -7
- package/fesm2022/ngx-tethys-autocomplete.mjs +17 -18
- package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
- package/fesm2022/ngx-tethys-avatar.mjs +25 -28
- package/fesm2022/ngx-tethys-avatar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-back-top.mjs +7 -7
- package/fesm2022/ngx-tethys-badge.mjs +7 -7
- package/fesm2022/ngx-tethys-breadcrumb.mjs +10 -10
- package/fesm2022/ngx-tethys-button.mjs +14 -15
- package/fesm2022/ngx-tethys-button.mjs.map +1 -1
- package/fesm2022/ngx-tethys-calendar.mjs +18 -20
- package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-card.mjs +15 -17
- package/fesm2022/ngx-tethys-card.mjs.map +1 -1
- package/fesm2022/ngx-tethys-carousel.mjs +14 -15
- package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
- package/fesm2022/ngx-tethys-cascader.mjs +16 -16
- package/fesm2022/ngx-tethys-checkbox.mjs +7 -7
- package/fesm2022/ngx-tethys-collapse.mjs +11 -12
- package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
- package/fesm2022/ngx-tethys-color-picker.mjs +34 -36
- package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-comment.mjs +15 -17
- package/fesm2022/ngx-tethys-comment.mjs.map +1 -1
- package/fesm2022/ngx-tethys-copy.mjs +8 -9
- package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
- package/fesm2022/ngx-tethys-core.mjs +21 -22
- package/fesm2022/ngx-tethys-core.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-picker.mjs +231 -247
- package/fesm2022/ngx-tethys-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-range.mjs +10 -10
- package/fesm2022/ngx-tethys-dialog.mjs +22 -23
- package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
- package/fesm2022/ngx-tethys-divider.mjs +7 -7
- package/fesm2022/ngx-tethys-dot.mjs +8 -9
- package/fesm2022/ngx-tethys-dot.mjs.map +1 -1
- package/fesm2022/ngx-tethys-drag-drop.mjs +23 -27
- package/fesm2022/ngx-tethys-drag-drop.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dropdown.mjs +58 -70
- package/fesm2022/ngx-tethys-dropdown.mjs.map +1 -1
- package/fesm2022/ngx-tethys-empty.mjs +10 -10
- package/fesm2022/ngx-tethys-flexible-text.mjs +8 -8
- package/fesm2022/ngx-tethys-flexible-text.mjs.map +1 -1
- package/fesm2022/ngx-tethys-form.mjs +47 -54
- package/fesm2022/ngx-tethys-form.mjs.map +1 -1
- package/fesm2022/ngx-tethys-fullscreen.mjs +15 -16
- package/fesm2022/ngx-tethys-fullscreen.mjs.map +1 -1
- package/fesm2022/ngx-tethys-grid.mjs +35 -41
- package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
- package/fesm2022/ngx-tethys-guider.mjs +17 -18
- package/fesm2022/ngx-tethys-guider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-i18n.mjs +20 -8
- package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
- package/fesm2022/ngx-tethys-icon.mjs +11 -12
- package/fesm2022/ngx-tethys-icon.mjs.map +1 -1
- package/fesm2022/ngx-tethys-image.mjs +18 -20
- package/fesm2022/ngx-tethys-image.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input-number.mjs +7 -7
- package/fesm2022/ngx-tethys-input.mjs +21 -23
- package/fesm2022/ngx-tethys-input.mjs.map +1 -1
- package/fesm2022/ngx-tethys-layout.mjs +73 -88
- package/fesm2022/ngx-tethys-layout.mjs.map +1 -1
- package/fesm2022/ngx-tethys-list.mjs +19 -22
- package/fesm2022/ngx-tethys-list.mjs.map +1 -1
- package/fesm2022/ngx-tethys-loading.mjs +7 -7
- package/fesm2022/ngx-tethys-mention.mjs +11 -12
- package/fesm2022/ngx-tethys-mention.mjs.map +1 -1
- package/fesm2022/ngx-tethys-menu.mjs +30 -30
- package/fesm2022/ngx-tethys-menu.mjs.map +1 -1
- package/fesm2022/ngx-tethys-message.mjs +22 -22
- package/fesm2022/ngx-tethys-nav.mjs +26 -29
- package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
- package/fesm2022/ngx-tethys-notify.mjs +16 -16
- package/fesm2022/ngx-tethys-pagination.mjs +15 -17
- package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
- package/fesm2022/ngx-tethys-popover.mjs +21 -23
- package/fesm2022/ngx-tethys-popover.mjs.map +1 -1
- package/fesm2022/ngx-tethys-progress.mjs +13 -13
- package/fesm2022/ngx-tethys-property-operation.mjs +11 -11
- package/fesm2022/ngx-tethys-property-operation.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property.mjs +11 -11
- package/fesm2022/ngx-tethys-property.mjs.map +1 -1
- package/fesm2022/ngx-tethys-radio.mjs +15 -15
- package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
- package/fesm2022/ngx-tethys-rate.mjs +10 -10
- package/fesm2022/ngx-tethys-resizable.mjs +17 -18
- package/fesm2022/ngx-tethys-resizable.mjs.map +1 -1
- package/fesm2022/ngx-tethys-result.mjs +7 -7
- package/fesm2022/ngx-tethys-segment.mjs +10 -10
- package/fesm2022/ngx-tethys-select.mjs +10 -10
- package/fesm2022/ngx-tethys-shared.mjs +80 -93
- package/fesm2022/ngx-tethys-shared.mjs.map +1 -1
- package/fesm2022/ngx-tethys-skeleton.mjs +23 -24
- package/fesm2022/ngx-tethys-skeleton.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slide.mjs +36 -41
- package/fesm2022/ngx-tethys-slide.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slider.mjs +7 -7
- package/fesm2022/ngx-tethys-space.mjs +11 -12
- package/fesm2022/ngx-tethys-space.mjs.map +1 -1
- package/fesm2022/ngx-tethys-statistic.mjs +7 -7
- package/fesm2022/ngx-tethys-stepper.mjs +22 -24
- package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
- package/fesm2022/ngx-tethys-strength.mjs +8 -8
- package/fesm2022/ngx-tethys-strength.mjs.map +1 -1
- package/fesm2022/ngx-tethys-switch.mjs +7 -7
- package/fesm2022/ngx-tethys-table.mjs +22 -25
- package/fesm2022/ngx-tethys-table.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tabs.mjs +14 -15
- package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tag.mjs +12 -13
- package/fesm2022/ngx-tethys-tag.mjs.map +1 -1
- package/fesm2022/ngx-tethys-time-picker.mjs +58 -56
- package/fesm2022/ngx-tethys-time-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-timeline.mjs +13 -13
- package/fesm2022/ngx-tethys-tooltip.mjs +14 -15
- package/fesm2022/ngx-tethys-tooltip.mjs.map +1 -1
- package/fesm2022/ngx-tethys-transfer.mjs +10 -10
- package/fesm2022/ngx-tethys-tree-select.mjs +10 -10
- package/fesm2022/ngx-tethys-tree-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree.mjs +17 -18
- package/fesm2022/ngx-tethys-tree.mjs.map +1 -1
- package/fesm2022/ngx-tethys-typography.mjs +15 -17
- package/fesm2022/ngx-tethys-typography.mjs.map +1 -1
- package/fesm2022/ngx-tethys-upload.mjs +18 -19
- package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
- package/fesm2022/ngx-tethys-util.mjs +419 -391
- package/fesm2022/ngx-tethys-util.mjs.map +1 -1
- package/fesm2022/ngx-tethys-vote.mjs +7 -7
- package/fesm2022/ngx-tethys-watermark.mjs +8 -9
- package/fesm2022/ngx-tethys-watermark.mjs.map +1 -1
- package/fesm2022/ngx-tethys.mjs +1 -1
- package/fesm2022/ngx-tethys.mjs.map +1 -1
- package/i18n/locale.d.ts +7 -1
- package/icon/index.d.ts +1 -1
- package/layout/header.component.d.ts +6 -18
- package/package.json +2 -1
- package/popover/popover.directive.d.ts +6 -2
- package/resizable/resizable.directive.d.ts +21 -3
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/table/table-column.component.d.ts +5 -30
- package/tag/tag.component.d.ts +2 -4
- package/time-picker/inner/inner-time-picker.component.d.ts +3 -1
- package/time-picker/inner/inner-time-picker.store.d.ts +5 -5
- package/time-picker/time-picker.component.d.ts +2 -2
- package/time-picker/time-picker.utils.d.ts +5 -5
- package/tooltip/tooltip.directive.d.ts +2 -10
- package/tree-select/tree-select.component.d.ts +2 -2
- package/util/helpers/helpers.d.ts +1 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as dateFns from 'date-fns';
|
|
2
2
|
import { setHours, setMinutes, setSeconds } from 'date-fns';
|
|
3
3
|
import * as dateFnsLocales from 'date-fns/locale';
|
|
4
|
-
import { ThyLocaleType } from 'ngx-tethys/i18n';
|
|
4
|
+
import { ThyLocaleType, getDefaultLocaleId } from 'ngx-tethys/i18n';
|
|
5
5
|
import { TZDate } from '@date-fns/tz';
|
|
6
|
-
import {
|
|
6
|
+
import { fromZonedTime } from 'date-fns-tz';
|
|
7
7
|
import { _isNumberValue, coerceCssPixelValue as coerceCssPixelValue$1 } from '@angular/cdk/coercion';
|
|
8
|
+
import { TemplateRef, ElementRef, isDevMode } from '@angular/core';
|
|
8
9
|
export * from '@angular/cdk/keycodes';
|
|
9
10
|
import * as keycodes from '@angular/cdk/keycodes';
|
|
10
11
|
export { keycodes };
|
|
@@ -109,81 +110,437 @@ const getDateFnsLocale = (locale) => {
|
|
|
109
110
|
}
|
|
110
111
|
};
|
|
111
112
|
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
-
const [start, end] = rangeValue;
|
|
115
|
-
return start && end && start.isAfterSecond(end) ? [end, start] : [start, end];
|
|
116
|
-
}
|
|
117
|
-
return rangeValue;
|
|
113
|
+
function isUndefined(value) {
|
|
114
|
+
return value === undefined;
|
|
118
115
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
116
|
+
function isNull(value) {
|
|
117
|
+
return value === null;
|
|
118
|
+
}
|
|
119
|
+
function isUndefinedOrNull(value) {
|
|
120
|
+
return isUndefined(value) || isNull(value);
|
|
121
|
+
}
|
|
122
|
+
function isArray(value) {
|
|
123
|
+
return value && baseGetTag(value) === '[object Array]';
|
|
124
|
+
}
|
|
125
|
+
function isEmpty(value) {
|
|
126
|
+
return !(isArray(value) && value.length > 0);
|
|
127
|
+
}
|
|
128
|
+
function isString(value) {
|
|
129
|
+
return typeof value == 'string' || (!isArray(value) && isObjectLike(value) && baseGetTag(value) === '[object String]');
|
|
130
|
+
}
|
|
131
|
+
function isObjectLike(value) {
|
|
132
|
+
return value !== null && typeof value === 'object';
|
|
133
|
+
}
|
|
134
|
+
function baseGetTag(value) {
|
|
135
|
+
const objectProto = Object.prototype;
|
|
136
|
+
const hasOwnProperty = objectProto.hasOwnProperty;
|
|
137
|
+
const toString = objectProto.toString;
|
|
138
|
+
const symToStringTag = typeof Symbol !== 'undefined' ? Symbol.toStringTag : undefined;
|
|
139
|
+
if (value == null) {
|
|
140
|
+
return value === undefined ? '[object Undefined]' : '[object Null]';
|
|
139
141
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
TinyDate.dateFnsLocale = getDateFnsLocale(locale);
|
|
143
|
-
return setDefaultOptions({ locale: TinyDate.dateFnsLocale });
|
|
142
|
+
if (!(symToStringTag && symToStringTag in Object(value))) {
|
|
143
|
+
return toString.call(value);
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
const isOwn = hasOwnProperty.call(value, symToStringTag);
|
|
146
|
+
const tag = value[symToStringTag];
|
|
147
|
+
let unmasked = false;
|
|
148
|
+
try {
|
|
149
|
+
value[symToStringTag] = undefined;
|
|
150
|
+
unmasked = true;
|
|
147
151
|
}
|
|
148
|
-
|
|
149
|
-
|
|
152
|
+
catch (e) { }
|
|
153
|
+
const result = toString.call(value);
|
|
154
|
+
if (unmasked) {
|
|
155
|
+
if (isOwn) {
|
|
156
|
+
value[symToStringTag] = tag;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
delete value[symToStringTag];
|
|
160
|
+
}
|
|
150
161
|
}
|
|
151
|
-
|
|
152
|
-
|
|
162
|
+
return result;
|
|
163
|
+
}
|
|
164
|
+
function isNumber(value) {
|
|
165
|
+
return typeof value === 'number' || (isObjectLike(value) && baseGetTag(value) === '[object Number]');
|
|
166
|
+
}
|
|
167
|
+
function isObject(value) {
|
|
168
|
+
// Avoid a V8 JIT bug in Chrome 19-20.
|
|
169
|
+
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
|
|
170
|
+
const type = typeof value;
|
|
171
|
+
return !!value && (type === 'object' || type === 'function');
|
|
172
|
+
}
|
|
173
|
+
function isFunction(value) {
|
|
174
|
+
const type = typeof value;
|
|
175
|
+
return !!value && type === 'function';
|
|
176
|
+
}
|
|
177
|
+
function isDate(value) {
|
|
178
|
+
const type = typeof value;
|
|
179
|
+
return !!value && type === 'object' && !!value.getTime;
|
|
180
|
+
}
|
|
181
|
+
function coerceArray(value) {
|
|
182
|
+
return Array.isArray(value) ? value : [value];
|
|
183
|
+
}
|
|
184
|
+
function get(object, path, defaultValue) {
|
|
185
|
+
const paths = path.split('.');
|
|
186
|
+
let result = object[paths.shift()];
|
|
187
|
+
while (result && paths.length) {
|
|
188
|
+
result = result[paths.shift()];
|
|
153
189
|
}
|
|
154
|
-
|
|
155
|
-
|
|
190
|
+
return result === undefined ? defaultValue : result;
|
|
191
|
+
}
|
|
192
|
+
function set(object, path, value) {
|
|
193
|
+
if (object == null) {
|
|
194
|
+
return object;
|
|
156
195
|
}
|
|
157
|
-
|
|
158
|
-
|
|
196
|
+
const paths = path.split('.');
|
|
197
|
+
let index = -1;
|
|
198
|
+
const length = paths.length;
|
|
199
|
+
const lastIndex = length - 1;
|
|
200
|
+
let nested = object;
|
|
201
|
+
while (nested !== null && ++index < length) {
|
|
202
|
+
const key = paths[index];
|
|
203
|
+
if (isObject(nested)) {
|
|
204
|
+
if (index === lastIndex) {
|
|
205
|
+
nested[key] = value;
|
|
206
|
+
nested = nested[key];
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
if (nested[key] == null) {
|
|
211
|
+
nested[key] = {};
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
nested = nested[key];
|
|
159
216
|
}
|
|
160
|
-
|
|
161
|
-
|
|
217
|
+
return object;
|
|
218
|
+
}
|
|
219
|
+
function isBoolean(value) {
|
|
220
|
+
return value === true || value === false || (isObjectLike(value) && baseGetTag(value) === '[object Boolean]');
|
|
221
|
+
}
|
|
222
|
+
function isClass(value) {
|
|
223
|
+
return isFunction(value) && /^\s*class\s+/.test(value.toString());
|
|
224
|
+
}
|
|
225
|
+
function htmlElementIsEmpty(element) {
|
|
226
|
+
if (element && element.childNodes) {
|
|
227
|
+
const nodes = element.childNodes;
|
|
228
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
229
|
+
const node = nodes[i];
|
|
230
|
+
if (node.nodeType === Node.ELEMENT_NODE && node.outerHTML.toString().trim().length !== 0) {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
else if (node.nodeType === Node.TEXT_NODE && node.textContent.toString().trim().length !== 0) {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
else if (node.nodeType !== Node.COMMENT_NODE) {
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
162
240
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
function hexToRgb(hexValue, alpha) {
|
|
244
|
+
const rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
245
|
+
const hex = hexValue.replace(rgx, (m, r, g, b) => r + r + g + g + b + b);
|
|
246
|
+
const rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
247
|
+
if (!rgb)
|
|
248
|
+
return;
|
|
249
|
+
const resultR = parseInt(rgb[1], 16);
|
|
250
|
+
const resultG = parseInt(rgb[2], 16);
|
|
251
|
+
const resultB = parseInt(rgb[3], 16);
|
|
252
|
+
if (!isUndefinedOrNull(alpha)) {
|
|
253
|
+
return `rgba(${resultR}, ${resultG}, ${resultB}, ${alpha})`;
|
|
166
254
|
}
|
|
167
|
-
|
|
168
|
-
return
|
|
255
|
+
else {
|
|
256
|
+
return `rgb(${resultR}, ${resultG}, ${resultB})`;
|
|
169
257
|
}
|
|
170
|
-
|
|
171
|
-
|
|
258
|
+
}
|
|
259
|
+
function dateToUnixTimestamp(date) {
|
|
260
|
+
if (isNumber(date)) {
|
|
261
|
+
if (date.toString().length === 10) {
|
|
262
|
+
return date;
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
return parseInt((date / 1000).toFixed(0), 10);
|
|
266
|
+
}
|
|
172
267
|
}
|
|
173
|
-
|
|
174
|
-
return
|
|
268
|
+
else {
|
|
269
|
+
return parseInt((date.getTime() / 1000).toFixed(0), 10);
|
|
175
270
|
}
|
|
176
|
-
|
|
177
|
-
|
|
271
|
+
}
|
|
272
|
+
function clamp(value, min = 0, max = 100) {
|
|
273
|
+
return Math.max(min, Math.min(max, value));
|
|
274
|
+
}
|
|
275
|
+
function keyBy(array, key) {
|
|
276
|
+
const result = {};
|
|
277
|
+
array.forEach(item => {
|
|
278
|
+
const keyValue = item[key];
|
|
279
|
+
result[keyValue] = item;
|
|
280
|
+
});
|
|
281
|
+
return result;
|
|
282
|
+
}
|
|
283
|
+
function indexKeyBy(array, key) {
|
|
284
|
+
const result = {};
|
|
285
|
+
array.forEach((item, index) => {
|
|
286
|
+
const keyValue = item[key];
|
|
287
|
+
result[keyValue] = index;
|
|
288
|
+
});
|
|
289
|
+
return result;
|
|
290
|
+
}
|
|
291
|
+
function upperFirst(string) {
|
|
292
|
+
return string.slice(0, 1).toUpperCase() + string.slice(1);
|
|
293
|
+
}
|
|
294
|
+
function camelCase(values) {
|
|
295
|
+
if (isArray(values)) {
|
|
296
|
+
return values.reduce((result, word, index) => {
|
|
297
|
+
word = word.toLowerCase();
|
|
298
|
+
return result + (index ? upperFirst(word) : word);
|
|
299
|
+
}, '');
|
|
178
300
|
}
|
|
179
|
-
|
|
180
|
-
return
|
|
301
|
+
else {
|
|
302
|
+
return;
|
|
181
303
|
}
|
|
182
|
-
|
|
183
|
-
|
|
304
|
+
}
|
|
305
|
+
function generateRandomStr() {
|
|
306
|
+
return Math.random().toString(36).substring(2);
|
|
307
|
+
}
|
|
308
|
+
function isTemplateRef(value) {
|
|
309
|
+
return value instanceof TemplateRef;
|
|
310
|
+
}
|
|
311
|
+
function isHTMLElement(value) {
|
|
312
|
+
return value instanceof HTMLElement;
|
|
313
|
+
}
|
|
314
|
+
function isElementRef(value) {
|
|
315
|
+
return value instanceof ElementRef;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* fix angular cdk's coerceBooleanProperty will transform 0 to true
|
|
319
|
+
*/
|
|
320
|
+
function coerceBooleanProperty(value) {
|
|
321
|
+
if (value === '' || (value && value !== 'false')) {
|
|
322
|
+
return true;
|
|
184
323
|
}
|
|
185
|
-
|
|
186
|
-
return
|
|
324
|
+
else {
|
|
325
|
+
return false;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* @deprecated Please use Angular cdk's coerceNumberProperty instead
|
|
330
|
+
*/
|
|
331
|
+
function coerceNumberValue(value, fallbackValue = 0) {
|
|
332
|
+
return _isNumberValue(value) ? Number(value) : fallbackValue;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* @deprecated Please use Angular cdk's coerceCssPixelValue instead
|
|
336
|
+
*/
|
|
337
|
+
function coerceCssPixelValue(value) {
|
|
338
|
+
value = _isNumberValue(value) ? Number(value) : value;
|
|
339
|
+
return coerceCssPixelValue$1(value);
|
|
340
|
+
}
|
|
341
|
+
function valueFunctionProp(prop, ...args) {
|
|
342
|
+
return typeof prop === 'function' ? prop(...args) : prop;
|
|
343
|
+
}
|
|
344
|
+
function shallowEqual(objA, objB) {
|
|
345
|
+
if (objA === objB) {
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
if (typeof objA !== 'object' || !objA || typeof objB !== 'object' || !objB) {
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
351
|
+
const keysA = Object.keys(objA);
|
|
352
|
+
const keysB = Object.keys(objB);
|
|
353
|
+
if (keysA.length !== keysB.length) {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
const bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
|
|
357
|
+
for (let idx = 0; idx < keysA.length; idx++) {
|
|
358
|
+
const key = keysA[idx];
|
|
359
|
+
if (!bHasOwnProperty(key)) {
|
|
360
|
+
return false;
|
|
361
|
+
}
|
|
362
|
+
if (objA[key] !== objB[key]) {
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return true;
|
|
367
|
+
}
|
|
368
|
+
function concatArray(items, originalItems = []) {
|
|
369
|
+
let _originalItems = [];
|
|
370
|
+
if (!originalItems) {
|
|
371
|
+
_originalItems = [];
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
_originalItems = coerceArray(originalItems);
|
|
375
|
+
}
|
|
376
|
+
if (items) {
|
|
377
|
+
if (isArray(items)) {
|
|
378
|
+
return [..._originalItems, ...items];
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
return [..._originalItems, items];
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
return _originalItems;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
function humanizeBytes(bytes, noSpace = false, fractionDigits = 1) {
|
|
389
|
+
if (bytes === 0) {
|
|
390
|
+
return '0 Byte';
|
|
391
|
+
}
|
|
392
|
+
const k = 1024;
|
|
393
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
394
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
395
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(fractionDigits)) + (noSpace ? '' : ' ') + sizes[i];
|
|
396
|
+
}
|
|
397
|
+
function isFloat(value) {
|
|
398
|
+
if (!value) {
|
|
399
|
+
return false;
|
|
400
|
+
}
|
|
401
|
+
return /^[-+]?([0-9]+([.][0-9]*)?|[.][0-9]+)([Ee][-+]?[0-9]+)?$/.test(value);
|
|
402
|
+
}
|
|
403
|
+
function hasTimeInStringDate(dateString) {
|
|
404
|
+
const standardFormat = /\d{4}[-/]\d{1,2}[-/]\d{1,2}\s+\d{1,2}:\d{1,2}/;
|
|
405
|
+
const chineseFormat = /\d{4}年\d{1,2}月\d{1,2}日?\s+\d{1,2}[时:]\d{1,2}[分]?/;
|
|
406
|
+
const reverseEnglishFormat = /\d{1,2}\s+[A-Za-z]{3,}\s+\d{4}\s+\d{1,2}:\d{1,2}/;
|
|
407
|
+
const englishFormat = /[A-Za-z]{3,}\s+\d{1,2},?\s+\d{4}\s+\d{1,2}:\d{1,2}/;
|
|
408
|
+
const isoFormat = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/;
|
|
409
|
+
return (standardFormat.test(dateString) ||
|
|
410
|
+
chineseFormat.test(dateString) ||
|
|
411
|
+
reverseEnglishFormat.test(dateString) ||
|
|
412
|
+
englishFormat.test(dateString) ||
|
|
413
|
+
isoFormat.test(dateString));
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
417
|
+
__proto__: null,
|
|
418
|
+
camelCase: camelCase,
|
|
419
|
+
clamp: clamp,
|
|
420
|
+
coerceArray: coerceArray,
|
|
421
|
+
coerceBooleanProperty: coerceBooleanProperty,
|
|
422
|
+
coerceCssPixelValue: coerceCssPixelValue,
|
|
423
|
+
coerceNumberValue: coerceNumberValue,
|
|
424
|
+
concatArray: concatArray,
|
|
425
|
+
dateToUnixTimestamp: dateToUnixTimestamp,
|
|
426
|
+
generateRandomStr: generateRandomStr,
|
|
427
|
+
get: get,
|
|
428
|
+
hasTimeInStringDate: hasTimeInStringDate,
|
|
429
|
+
hexToRgb: hexToRgb,
|
|
430
|
+
htmlElementIsEmpty: htmlElementIsEmpty,
|
|
431
|
+
humanizeBytes: humanizeBytes,
|
|
432
|
+
indexKeyBy: indexKeyBy,
|
|
433
|
+
isArray: isArray,
|
|
434
|
+
isBoolean: isBoolean,
|
|
435
|
+
isClass: isClass,
|
|
436
|
+
isDate: isDate,
|
|
437
|
+
isElementRef: isElementRef,
|
|
438
|
+
isEmpty: isEmpty,
|
|
439
|
+
isFloat: isFloat,
|
|
440
|
+
isFunction: isFunction,
|
|
441
|
+
isHTMLElement: isHTMLElement,
|
|
442
|
+
isNull: isNull,
|
|
443
|
+
isNumber: isNumber,
|
|
444
|
+
isObject: isObject,
|
|
445
|
+
isString: isString,
|
|
446
|
+
isTemplateRef: isTemplateRef,
|
|
447
|
+
isUndefined: isUndefined,
|
|
448
|
+
isUndefinedOrNull: isUndefinedOrNull,
|
|
449
|
+
keyBy: keyBy,
|
|
450
|
+
set: set,
|
|
451
|
+
shallowEqual: shallowEqual,
|
|
452
|
+
valueFunctionProp: valueFunctionProp
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
function sortRangeValue(rangeValue) {
|
|
456
|
+
if (Array.isArray(rangeValue)) {
|
|
457
|
+
const [start, end] = rangeValue;
|
|
458
|
+
return start && end && start.isAfterSecond(end) ? [end, start] : [start, end];
|
|
459
|
+
}
|
|
460
|
+
return rangeValue;
|
|
461
|
+
}
|
|
462
|
+
const DEFAULT_TIMEZONE = 'Asia/Shanghai';
|
|
463
|
+
class TinyDate {
|
|
464
|
+
static { this.locale = getDefaultLocaleId(); }
|
|
465
|
+
static { this.dateFnsLocale = getDateFnsLocale(TinyDate.locale); }
|
|
466
|
+
static { this.defaultTimeZone = DEFAULT_TIMEZONE; }
|
|
467
|
+
constructor(date, zone) {
|
|
468
|
+
setDefaultOptions({ locale: TinyDate.dateFnsLocale });
|
|
469
|
+
this.useTimeZone = zone || TinyDate.defaultTimeZone;
|
|
470
|
+
if (date) {
|
|
471
|
+
if (date instanceof Date) {
|
|
472
|
+
this.nativeDate = TinyDate.utcToZonedTime(date, this.useTimeZone);
|
|
473
|
+
}
|
|
474
|
+
else if (typeof date === 'string') {
|
|
475
|
+
if (hasTimeInStringDate(date)) {
|
|
476
|
+
// 如果字符串中包含时间,则需要将时间转换为UTC时间再传递给TZDate
|
|
477
|
+
const originTime = new Date(date);
|
|
478
|
+
const zoneTime = TZDate.tz(this.useTimeZone, originTime);
|
|
479
|
+
const utcDate = fromZonedTime(zoneTime, this.useTimeZone).toISOString();
|
|
480
|
+
this.nativeDate = new TZDate(utcDate, this.useTimeZone);
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
this.nativeDate = new TZDate(date, this.useTimeZone);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
else if (typeof date === 'number') {
|
|
487
|
+
this.nativeDate = new TZDate(date, this.useTimeZone);
|
|
488
|
+
}
|
|
489
|
+
else if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
490
|
+
throw new Error(`The input date type is not supported expect Date | string | number | { date: number; with_time: 0 | 1}, actual ${JSON.stringify(date)}`);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
this.nativeDate = new TZDate(Date.now(), this.useTimeZone);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
static setDefaultLocale(locale) {
|
|
498
|
+
TinyDate.locale = locale;
|
|
499
|
+
TinyDate.dateFnsLocale = getDateFnsLocale(locale);
|
|
500
|
+
return setDefaultOptions({ locale: TinyDate.dateFnsLocale });
|
|
501
|
+
}
|
|
502
|
+
static getDefaultLocale() {
|
|
503
|
+
return { locale: TinyDate.locale, dateFnsLocale: TinyDate.dateFnsLocale };
|
|
504
|
+
}
|
|
505
|
+
static setDefaultTimeZone(zone) {
|
|
506
|
+
TinyDate.defaultTimeZone = zone ?? DEFAULT_TIMEZONE;
|
|
507
|
+
}
|
|
508
|
+
static getDefaultTimeZone() {
|
|
509
|
+
return TinyDate.defaultTimeZone;
|
|
510
|
+
}
|
|
511
|
+
static utcToZonedTime(value, timeZone) {
|
|
512
|
+
return TZDate.tz(timeZone || TinyDate.defaultTimeZone, value);
|
|
513
|
+
}
|
|
514
|
+
static createDateInTimeZone(year, month, day, hours, minutes, seconds, timeZone) {
|
|
515
|
+
return new TZDate(year, month, day, hours, minutes, seconds, timeZone || TinyDate.defaultTimeZone);
|
|
516
|
+
}
|
|
517
|
+
static fromUnixTime(unixTime, timeZone) {
|
|
518
|
+
return new TinyDate(fromUnixTime(unixTime), timeZone || TinyDate.defaultTimeZone);
|
|
519
|
+
}
|
|
520
|
+
// get
|
|
521
|
+
getTime() {
|
|
522
|
+
return this.nativeDate.getTime();
|
|
523
|
+
}
|
|
524
|
+
getDate() {
|
|
525
|
+
return this.nativeDate.getDate();
|
|
526
|
+
}
|
|
527
|
+
getYear() {
|
|
528
|
+
return this.nativeDate.getFullYear();
|
|
529
|
+
}
|
|
530
|
+
getQuarter() {
|
|
531
|
+
return getQuarter(this.nativeDate);
|
|
532
|
+
}
|
|
533
|
+
getMonth() {
|
|
534
|
+
return this.nativeDate.getMonth();
|
|
535
|
+
}
|
|
536
|
+
getFullYear() {
|
|
537
|
+
return this.nativeDate.getFullYear();
|
|
538
|
+
}
|
|
539
|
+
getWeek(options = { weekStartsOn: 1 }) {
|
|
540
|
+
return getWeek(this.nativeDate, options);
|
|
541
|
+
}
|
|
542
|
+
getDay() {
|
|
543
|
+
return this.nativeDate.getDay();
|
|
187
544
|
}
|
|
188
545
|
getHours() {
|
|
189
546
|
return this.nativeDate.getHours();
|
|
@@ -480,335 +837,6 @@ class TinyDate {
|
|
|
480
837
|
}
|
|
481
838
|
}
|
|
482
839
|
|
|
483
|
-
function isUndefined(value) {
|
|
484
|
-
return value === undefined;
|
|
485
|
-
}
|
|
486
|
-
function isNull(value) {
|
|
487
|
-
return value === null;
|
|
488
|
-
}
|
|
489
|
-
function isUndefinedOrNull(value) {
|
|
490
|
-
return isUndefined(value) || isNull(value);
|
|
491
|
-
}
|
|
492
|
-
function isArray(value) {
|
|
493
|
-
return value && baseGetTag(value) === '[object Array]';
|
|
494
|
-
}
|
|
495
|
-
function isEmpty(value) {
|
|
496
|
-
return !(isArray(value) && value.length > 0);
|
|
497
|
-
}
|
|
498
|
-
function isString(value) {
|
|
499
|
-
return typeof value == 'string' || (!isArray(value) && isObjectLike(value) && baseGetTag(value) === '[object String]');
|
|
500
|
-
}
|
|
501
|
-
function isObjectLike(value) {
|
|
502
|
-
return value !== null && typeof value === 'object';
|
|
503
|
-
}
|
|
504
|
-
function baseGetTag(value) {
|
|
505
|
-
const objectProto = Object.prototype;
|
|
506
|
-
const hasOwnProperty = objectProto.hasOwnProperty;
|
|
507
|
-
const toString = objectProto.toString;
|
|
508
|
-
const symToStringTag = typeof Symbol !== 'undefined' ? Symbol.toStringTag : undefined;
|
|
509
|
-
if (value == null) {
|
|
510
|
-
return value === undefined ? '[object Undefined]' : '[object Null]';
|
|
511
|
-
}
|
|
512
|
-
if (!(symToStringTag && symToStringTag in Object(value))) {
|
|
513
|
-
return toString.call(value);
|
|
514
|
-
}
|
|
515
|
-
const isOwn = hasOwnProperty.call(value, symToStringTag);
|
|
516
|
-
const tag = value[symToStringTag];
|
|
517
|
-
let unmasked = false;
|
|
518
|
-
try {
|
|
519
|
-
value[symToStringTag] = undefined;
|
|
520
|
-
unmasked = true;
|
|
521
|
-
}
|
|
522
|
-
catch (e) { }
|
|
523
|
-
const result = toString.call(value);
|
|
524
|
-
if (unmasked) {
|
|
525
|
-
if (isOwn) {
|
|
526
|
-
value[symToStringTag] = tag;
|
|
527
|
-
}
|
|
528
|
-
else {
|
|
529
|
-
delete value[symToStringTag];
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
return result;
|
|
533
|
-
}
|
|
534
|
-
function isNumber(value) {
|
|
535
|
-
return typeof value === 'number' || (isObjectLike(value) && baseGetTag(value) === '[object Number]');
|
|
536
|
-
}
|
|
537
|
-
function isObject(value) {
|
|
538
|
-
// Avoid a V8 JIT bug in Chrome 19-20.
|
|
539
|
-
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
|
|
540
|
-
const type = typeof value;
|
|
541
|
-
return !!value && (type === 'object' || type === 'function');
|
|
542
|
-
}
|
|
543
|
-
function isFunction(value) {
|
|
544
|
-
const type = typeof value;
|
|
545
|
-
return !!value && type === 'function';
|
|
546
|
-
}
|
|
547
|
-
function isDate(value) {
|
|
548
|
-
const type = typeof value;
|
|
549
|
-
return !!value && type === 'object' && !!value.getTime;
|
|
550
|
-
}
|
|
551
|
-
function coerceArray(value) {
|
|
552
|
-
return Array.isArray(value) ? value : [value];
|
|
553
|
-
}
|
|
554
|
-
function get(object, path, defaultValue) {
|
|
555
|
-
const paths = path.split('.');
|
|
556
|
-
let result = object[paths.shift()];
|
|
557
|
-
while (result && paths.length) {
|
|
558
|
-
result = result[paths.shift()];
|
|
559
|
-
}
|
|
560
|
-
return result === undefined ? defaultValue : result;
|
|
561
|
-
}
|
|
562
|
-
function set(object, path, value) {
|
|
563
|
-
if (object == null) {
|
|
564
|
-
return object;
|
|
565
|
-
}
|
|
566
|
-
const paths = path.split('.');
|
|
567
|
-
let index = -1;
|
|
568
|
-
const length = paths.length;
|
|
569
|
-
const lastIndex = length - 1;
|
|
570
|
-
let nested = object;
|
|
571
|
-
while (nested !== null && ++index < length) {
|
|
572
|
-
const key = paths[index];
|
|
573
|
-
if (isObject(nested)) {
|
|
574
|
-
if (index === lastIndex) {
|
|
575
|
-
nested[key] = value;
|
|
576
|
-
nested = nested[key];
|
|
577
|
-
break;
|
|
578
|
-
}
|
|
579
|
-
else {
|
|
580
|
-
if (nested[key] == null) {
|
|
581
|
-
nested[key] = {};
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
nested = nested[key];
|
|
586
|
-
}
|
|
587
|
-
return object;
|
|
588
|
-
}
|
|
589
|
-
function isBoolean(value) {
|
|
590
|
-
return value === true || value === false || (isObjectLike(value) && baseGetTag(value) === '[object Boolean]');
|
|
591
|
-
}
|
|
592
|
-
function isClass(value) {
|
|
593
|
-
return isFunction(value) && /^\s*class\s+/.test(value.toString());
|
|
594
|
-
}
|
|
595
|
-
function htmlElementIsEmpty(element) {
|
|
596
|
-
if (element && element.childNodes) {
|
|
597
|
-
const nodes = element.childNodes;
|
|
598
|
-
for (let i = 0; i < nodes.length; i++) {
|
|
599
|
-
const node = nodes[i];
|
|
600
|
-
if (node.nodeType === Node.ELEMENT_NODE && node.outerHTML.toString().trim().length !== 0) {
|
|
601
|
-
return false;
|
|
602
|
-
}
|
|
603
|
-
else if (node.nodeType === Node.TEXT_NODE && node.textContent.toString().trim().length !== 0) {
|
|
604
|
-
return false;
|
|
605
|
-
}
|
|
606
|
-
else if (node.nodeType !== Node.COMMENT_NODE) {
|
|
607
|
-
return false;
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
return true;
|
|
612
|
-
}
|
|
613
|
-
function hexToRgb(hexValue, alpha) {
|
|
614
|
-
const rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
615
|
-
const hex = hexValue.replace(rgx, (m, r, g, b) => r + r + g + g + b + b);
|
|
616
|
-
const rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
617
|
-
if (!rgb)
|
|
618
|
-
return;
|
|
619
|
-
const resultR = parseInt(rgb[1], 16);
|
|
620
|
-
const resultG = parseInt(rgb[2], 16);
|
|
621
|
-
const resultB = parseInt(rgb[3], 16);
|
|
622
|
-
if (!isUndefinedOrNull(alpha)) {
|
|
623
|
-
return `rgba(${resultR}, ${resultG}, ${resultB}, ${alpha})`;
|
|
624
|
-
}
|
|
625
|
-
else {
|
|
626
|
-
return `rgb(${resultR}, ${resultG}, ${resultB})`;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
function dateToUnixTimestamp(date) {
|
|
630
|
-
if (isNumber(date)) {
|
|
631
|
-
if (date.toString().length === 10) {
|
|
632
|
-
return date;
|
|
633
|
-
}
|
|
634
|
-
else {
|
|
635
|
-
return parseInt((date / 1000).toFixed(0), 10);
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
else {
|
|
639
|
-
return parseInt((date.getTime() / 1000).toFixed(0), 10);
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
function clamp(value, min = 0, max = 100) {
|
|
643
|
-
return Math.max(min, Math.min(max, value));
|
|
644
|
-
}
|
|
645
|
-
function keyBy(array, key) {
|
|
646
|
-
const result = {};
|
|
647
|
-
array.forEach(item => {
|
|
648
|
-
const keyValue = item[key];
|
|
649
|
-
result[keyValue] = item;
|
|
650
|
-
});
|
|
651
|
-
return result;
|
|
652
|
-
}
|
|
653
|
-
function indexKeyBy(array, key) {
|
|
654
|
-
const result = {};
|
|
655
|
-
array.forEach((item, index) => {
|
|
656
|
-
const keyValue = item[key];
|
|
657
|
-
result[keyValue] = index;
|
|
658
|
-
});
|
|
659
|
-
return result;
|
|
660
|
-
}
|
|
661
|
-
function upperFirst(string) {
|
|
662
|
-
return string.slice(0, 1).toUpperCase() + string.slice(1);
|
|
663
|
-
}
|
|
664
|
-
function camelCase(values) {
|
|
665
|
-
if (isArray(values)) {
|
|
666
|
-
return values.reduce((result, word, index) => {
|
|
667
|
-
word = word.toLowerCase();
|
|
668
|
-
return result + (index ? upperFirst(word) : word);
|
|
669
|
-
}, '');
|
|
670
|
-
}
|
|
671
|
-
else {
|
|
672
|
-
return;
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
function generateRandomStr() {
|
|
676
|
-
return Math.random().toString(36).substring(2);
|
|
677
|
-
}
|
|
678
|
-
function isTemplateRef(value) {
|
|
679
|
-
return value instanceof TemplateRef;
|
|
680
|
-
}
|
|
681
|
-
function isHTMLElement(value) {
|
|
682
|
-
return value instanceof HTMLElement;
|
|
683
|
-
}
|
|
684
|
-
function isElementRef(value) {
|
|
685
|
-
return value instanceof ElementRef;
|
|
686
|
-
}
|
|
687
|
-
/**
|
|
688
|
-
* fix angular cdk's coerceBooleanProperty will transform 0 to true
|
|
689
|
-
*/
|
|
690
|
-
function coerceBooleanProperty(value) {
|
|
691
|
-
if (value === '' || (value && value !== 'false')) {
|
|
692
|
-
return true;
|
|
693
|
-
}
|
|
694
|
-
else {
|
|
695
|
-
return false;
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
/**
|
|
699
|
-
* @deprecated Please use Angular cdk's coerceNumberProperty instead
|
|
700
|
-
*/
|
|
701
|
-
function coerceNumberValue(value, fallbackValue = 0) {
|
|
702
|
-
return _isNumberValue(value) ? Number(value) : fallbackValue;
|
|
703
|
-
}
|
|
704
|
-
/**
|
|
705
|
-
* @deprecated Please use Angular cdk's coerceCssPixelValue instead
|
|
706
|
-
*/
|
|
707
|
-
function coerceCssPixelValue(value) {
|
|
708
|
-
value = _isNumberValue(value) ? Number(value) : value;
|
|
709
|
-
return coerceCssPixelValue$1(value);
|
|
710
|
-
}
|
|
711
|
-
function valueFunctionProp(prop, ...args) {
|
|
712
|
-
return typeof prop === 'function' ? prop(...args) : prop;
|
|
713
|
-
}
|
|
714
|
-
function shallowEqual(objA, objB) {
|
|
715
|
-
if (objA === objB) {
|
|
716
|
-
return true;
|
|
717
|
-
}
|
|
718
|
-
if (typeof objA !== 'object' || !objA || typeof objB !== 'object' || !objB) {
|
|
719
|
-
return false;
|
|
720
|
-
}
|
|
721
|
-
const keysA = Object.keys(objA);
|
|
722
|
-
const keysB = Object.keys(objB);
|
|
723
|
-
if (keysA.length !== keysB.length) {
|
|
724
|
-
return false;
|
|
725
|
-
}
|
|
726
|
-
const bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
|
|
727
|
-
for (let idx = 0; idx < keysA.length; idx++) {
|
|
728
|
-
const key = keysA[idx];
|
|
729
|
-
if (!bHasOwnProperty(key)) {
|
|
730
|
-
return false;
|
|
731
|
-
}
|
|
732
|
-
if (objA[key] !== objB[key]) {
|
|
733
|
-
return false;
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
return true;
|
|
737
|
-
}
|
|
738
|
-
function concatArray(items, originalItems = []) {
|
|
739
|
-
let _originalItems = [];
|
|
740
|
-
if (!originalItems) {
|
|
741
|
-
_originalItems = [];
|
|
742
|
-
}
|
|
743
|
-
else {
|
|
744
|
-
_originalItems = coerceArray(originalItems);
|
|
745
|
-
}
|
|
746
|
-
if (items) {
|
|
747
|
-
if (isArray(items)) {
|
|
748
|
-
return [..._originalItems, ...items];
|
|
749
|
-
}
|
|
750
|
-
else {
|
|
751
|
-
return [..._originalItems, items];
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
else {
|
|
755
|
-
return _originalItems;
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
function humanizeBytes(bytes, noSpace = false, fractionDigits = 1) {
|
|
759
|
-
if (bytes === 0) {
|
|
760
|
-
return '0 Byte';
|
|
761
|
-
}
|
|
762
|
-
const k = 1024;
|
|
763
|
-
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
764
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
765
|
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(fractionDigits)) + (noSpace ? '' : ' ') + sizes[i];
|
|
766
|
-
}
|
|
767
|
-
function isFloat(value) {
|
|
768
|
-
if (!value) {
|
|
769
|
-
return false;
|
|
770
|
-
}
|
|
771
|
-
return /^[-+]?([0-9]+([.][0-9]*)?|[.][0-9]+)([Ee][-+]?[0-9]+)?$/.test(value);
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
var index = /*#__PURE__*/Object.freeze({
|
|
775
|
-
__proto__: null,
|
|
776
|
-
camelCase: camelCase,
|
|
777
|
-
clamp: clamp,
|
|
778
|
-
coerceArray: coerceArray,
|
|
779
|
-
coerceBooleanProperty: coerceBooleanProperty,
|
|
780
|
-
coerceCssPixelValue: coerceCssPixelValue,
|
|
781
|
-
coerceNumberValue: coerceNumberValue,
|
|
782
|
-
concatArray: concatArray,
|
|
783
|
-
dateToUnixTimestamp: dateToUnixTimestamp,
|
|
784
|
-
generateRandomStr: generateRandomStr,
|
|
785
|
-
get: get,
|
|
786
|
-
hexToRgb: hexToRgb,
|
|
787
|
-
htmlElementIsEmpty: htmlElementIsEmpty,
|
|
788
|
-
humanizeBytes: humanizeBytes,
|
|
789
|
-
indexKeyBy: indexKeyBy,
|
|
790
|
-
isArray: isArray,
|
|
791
|
-
isBoolean: isBoolean,
|
|
792
|
-
isClass: isClass,
|
|
793
|
-
isDate: isDate,
|
|
794
|
-
isElementRef: isElementRef,
|
|
795
|
-
isEmpty: isEmpty,
|
|
796
|
-
isFloat: isFloat,
|
|
797
|
-
isFunction: isFunction,
|
|
798
|
-
isHTMLElement: isHTMLElement,
|
|
799
|
-
isNull: isNull,
|
|
800
|
-
isNumber: isNumber,
|
|
801
|
-
isObject: isObject,
|
|
802
|
-
isString: isString,
|
|
803
|
-
isTemplateRef: isTemplateRef,
|
|
804
|
-
isUndefined: isUndefined,
|
|
805
|
-
isUndefinedOrNull: isUndefinedOrNull,
|
|
806
|
-
keyBy: keyBy,
|
|
807
|
-
set: set,
|
|
808
|
-
shallowEqual: shallowEqual,
|
|
809
|
-
valueFunctionProp: valueFunctionProp
|
|
810
|
-
});
|
|
811
|
-
|
|
812
840
|
const proto = Element.prototype;
|
|
813
841
|
const vendor = proto.matches ||
|
|
814
842
|
proto['matchesSelector'] ||
|
|
@@ -1323,5 +1351,5 @@ function setWarnDeprecation(enabled) {
|
|
|
1323
1351
|
* Generated bundle index. Do not edit.
|
|
1324
1352
|
*/
|
|
1325
1353
|
|
|
1326
|
-
export { DEFAULT_TIMEZONE, PREFIX, Producer, TinyDate, addDays, addHours, addMinutes, addMonths, addQuarters, addSeconds, addWeeks, addYears, assertIconOnly, buildReferencesKeyBy, camelCase, clamp, coerceArray, coerceBooleanProperty, coerceCssPixelValue, coerceNumberValue, concatArray, createWarnDeprecation, dateToUnixTimestamp, differenceInCalendarDays, differenceInCalendarMonths, differenceInCalendarQuarters, differenceInCalendarYears, differenceInDays, differenceInHours, differenceInMinutes, differenceInMonths, differenceInSeconds, differenceInWeeks, differenceInYears, dom, eachDayOfInterval, eachHourOfInterval, eachMonthOfInterval, eachWeekOfInterval, eachYearOfInterval, elementMatchClosest, endOfDay, endOfHour, endOfISOWeek, endOfMinute, endOfMonth, endOfQuarter, endOfWeek, endOfYear, fallbackMatches, format, formatDistance, fromUnixTime, generateRandomStr, get, getClientSize, getContainerRect, getDate, getDateFnsLocale, getDay, getDaysInMonth, getElementOffset, getFitContentPosition, getHTMLElementBySelector, getHours, getMinutes, getMonth, getOffset, getQuarter, getSeconds, getStyleAsText, getTime, getUnixTime, getWeek, getWindow, getYear, hasLaterChange, index as helpers, hexToRgb, htmlElementIsEmpty, humanizeBytes, indexKeyBy, isAfter, isArray, isBoolean, isClass, isDate, isDocument, isElement, isElementRef, isEmpty, isFloat, isFunction, isHTMLElement, isInputOrTextarea, isNull, isNumber, isObject, isSameDay, isSameHour, isSameMinute, isSameMonth, isSameQuarter, isSameSecond, isSameYear, isString, isTemplateRef, isToday, isTomorrow, isTouchEvent, isUndefined, isUndefinedOrNull, isValid, isWeekend, isWindow, keyBy, log, match, mergeReferences, produce, references, set, setDate, setDay, setDefaultOptions, setMonth, setQuarter, setWarnDeprecation, setYear, shallowEqual, sortRangeValue, startOfDay, startOfHour, startOfISOWeek, startOfMinute, startOfMonth, startOfQuarter, startOfWeek, startOfYear, subBusinessDays, subDays, subHours, subMilliseconds, subMinutes, subMonths, subQuarters, subSeconds, subWeeks, subYears, valueFunctionProp, warn, warnDeprecation };
|
|
1354
|
+
export { DEFAULT_TIMEZONE, PREFIX, Producer, TinyDate, addDays, addHours, addMinutes, addMonths, addQuarters, addSeconds, addWeeks, addYears, assertIconOnly, buildReferencesKeyBy, camelCase, clamp, coerceArray, coerceBooleanProperty, coerceCssPixelValue, coerceNumberValue, concatArray, createWarnDeprecation, dateToUnixTimestamp, differenceInCalendarDays, differenceInCalendarMonths, differenceInCalendarQuarters, differenceInCalendarYears, differenceInDays, differenceInHours, differenceInMinutes, differenceInMonths, differenceInSeconds, differenceInWeeks, differenceInYears, dom, eachDayOfInterval, eachHourOfInterval, eachMonthOfInterval, eachWeekOfInterval, eachYearOfInterval, elementMatchClosest, endOfDay, endOfHour, endOfISOWeek, endOfMinute, endOfMonth, endOfQuarter, endOfWeek, endOfYear, fallbackMatches, format, formatDistance, fromUnixTime, generateRandomStr, get, getClientSize, getContainerRect, getDate, getDateFnsLocale, getDay, getDaysInMonth, getElementOffset, getFitContentPosition, getHTMLElementBySelector, getHours, getMinutes, getMonth, getOffset, getQuarter, getSeconds, getStyleAsText, getTime, getUnixTime, getWeek, getWindow, getYear, hasLaterChange, hasTimeInStringDate, index as helpers, hexToRgb, htmlElementIsEmpty, humanizeBytes, indexKeyBy, isAfter, isArray, isBoolean, isClass, isDate, isDocument, isElement, isElementRef, isEmpty, isFloat, isFunction, isHTMLElement, isInputOrTextarea, isNull, isNumber, isObject, isSameDay, isSameHour, isSameMinute, isSameMonth, isSameQuarter, isSameSecond, isSameYear, isString, isTemplateRef, isToday, isTomorrow, isTouchEvent, isUndefined, isUndefinedOrNull, isValid, isWeekend, isWindow, keyBy, log, match, mergeReferences, produce, references, set, setDate, setDay, setDefaultOptions, setMonth, setQuarter, setWarnDeprecation, setYear, shallowEqual, sortRangeValue, startOfDay, startOfHour, startOfISOWeek, startOfMinute, startOfMonth, startOfQuarter, startOfWeek, startOfYear, subBusinessDays, subDays, subHours, subMilliseconds, subMinutes, subMonths, subQuarters, subSeconds, subWeeks, subYears, valueFunctionProp, warn, warnDeprecation };
|
|
1327
1355
|
//# sourceMappingURL=ngx-tethys-util.mjs.map
|