ngx-tethys 19.0.4 → 19.0.6
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 +21 -0
- package/anchor/anchor-link.component.d.ts +2 -1
- package/anchor/anchor.component.d.ts +2 -1
- package/anchor/anchor.token.d.ts +9 -0
- package/calendar/calendar-header.component.d.ts +3 -2
- package/carousel/carousel.component.d.ts +2 -1
- package/carousel/carousel.token.d.ts +7 -0
- package/carousel/engine/carousel-base.d.ts +3 -3
- package/carousel/engine/carousel-fade.d.ts +2 -2
- package/carousel/engine/carousel-noop.d.ts +2 -2
- package/carousel/engine/carousel-slide.d.ts +2 -2
- package/collapse/collapse-item.component.d.ts +2 -1
- package/collapse/collapse.component.d.ts +5 -5
- package/collapse/collapse.token.d.ts +15 -0
- package/color-picker/color-picker.component.d.ts +15 -3
- package/core/theme/enum.d.ts +5 -0
- package/core/theme/index.d.ts +1 -0
- package/core/theme/store.d.ts +1 -1
- package/core/theme/theme.d.ts +0 -5
- 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 +2 -1
- package/date-picker/picker.util.d.ts +5 -5
- package/date-picker/standard-types.d.ts +7 -2
- package/drag-drop/drag-drop.service.d.ts +2 -2
- package/drag-drop/{drop-container.class.d.ts → drag-drop.token.d.ts} +12 -7
- package/drag-drop/drag-handle.directive.d.ts +2 -1
- package/drag-drop/drag-ref.d.ts +3 -5
- package/drag-drop/drag.directive.d.ts +3 -3
- package/drag-drop/drop-container.directive.d.ts +1 -1
- package/drag-drop/index.d.ts +1 -1
- 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 +26 -13
- package/fesm2022/ngx-tethys-anchor.mjs.map +1 -1
- 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 +28 -17
- 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 +97 -85
- 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 +232 -248
- 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 -30
- 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 +46 -51
- package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
- package/fesm2022/ngx-tethys-guider.mjs +55 -61
- package/fesm2022/ngx-tethys-guider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-i18n.mjs +51 -54
- 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 +32 -21
- 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 +24 -24
- package/fesm2022/ngx-tethys-message.mjs.map +1 -1
- package/fesm2022/ngx-tethys-nav.mjs +26 -29
- package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
- package/fesm2022/ngx-tethys-notify.mjs +17 -17
- package/fesm2022/ngx-tethys-notify.mjs.map +1 -1
- 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 +125 -115
- package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
- package/fesm2022/ngx-tethys-rate.mjs +10 -10
- package/fesm2022/ngx-tethys-resizable.mjs +18 -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-segment.mjs.map +1 -1
- package/fesm2022/ngx-tethys-select.mjs +10 -10
- package/fesm2022/ngx-tethys-shared.mjs +81 -109
- 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-timeline.mjs.map +1 -1
- 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.mjs +17 -21
- 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 +418 -396
- 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/grid/grid.type.d.ts +5 -0
- package/grid/index.d.ts +1 -0
- package/grid/thy-grid-item.component.d.ts +1 -1
- package/grid/thy-grid.component.d.ts +1 -11
- package/guider/guider-manager.d.ts +2 -1
- package/guider/guider-ref.d.ts +6 -6
- package/guider/guider-step-ref.d.ts +3 -4
- package/guider/guider.interface.d.ts +26 -0
- package/i18n/i18n.service.d.ts +1 -1
- package/i18n/index.d.ts +2 -5
- package/i18n/locale.d.ts +1 -7
- package/i18n/locales/index.d.ts +5 -0
- package/i18n/util.d.ts +3 -0
- package/icon/index.d.ts +1 -1
- package/image/image-group.component.d.ts +4 -4
- package/image/image.directive.d.ts +2 -1
- package/image/image.token.d.ts +17 -0
- package/layout/header.component.d.ts +6 -18
- package/list/selection/selection-list.d.ts +2 -1
- package/list/selection/selection.interface.d.ts +2 -3
- package/message/abstract/abstract-message-queue.service.d.ts +2 -2
- package/message/abstract/abstract-message-ref.d.ts +6 -2
- package/package.json +2 -1
- package/popover/popover.directive.d.ts +6 -2
- package/radio/group/radio-group.component.d.ts +2 -1
- package/radio/radio.component.d.ts +3 -3
- package/radio/radio.token.d.ts +12 -0
- package/resizable/interface.d.ts +5 -0
- package/resizable/resizable.directive.d.ts +9 -3
- package/resizable/resizable.service.d.ts +1 -1
- package/resizable/resize-handle.component.d.ts +1 -6
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/segment/segment-item.component.d.ts +2 -1
- package/segment/segment.token.d.ts +10 -4
- package/shared/index.d.ts +1 -0
- package/shared/option/list-option/list-option.component.d.ts +10 -5
- package/shared/option/option.component.d.ts +1 -3
- package/shared/option/option.token.d.ts +11 -11
- package/shared/shared.type.d.ts +1 -0
- package/table/index.d.ts +1 -0
- package/table/styles/table.scss +9 -1
- package/table/table-column.component.d.ts +5 -30
- package/table/table-skeleton.component.d.ts +11 -3
- package/table/table.component.d.ts +1 -3
- package/table/table.type.d.ts +3 -0
- 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.utils.d.ts +5 -5
- package/timeline/index.d.ts +1 -0
- package/timeline/timeline-item.component.d.ts +1 -1
- package/timeline/timeline.component.d.ts +1 -1
- package/timeline/timeline.type.d.ts +1 -0
- package/tooltip/tooltip.directive.d.ts +2 -10
- package/tree/index.d.ts +0 -1
- package/tree/tree-abstract.d.ts +1 -1
- package/tree/tree-node.component.d.ts +17 -8
- package/tree/tree.class.d.ts +40 -1
- package/tree/tree.component.d.ts +1 -1
- package/tree/tree.pipe.d.ts +1 -1
- package/tree/tree.service.d.ts +3 -9
- package/util/helpers/helpers.d.ts +1 -0
- package/tree/tree-node.class.d.ts +0 -29
|
@@ -3,8 +3,9 @@ import { setHours, setMinutes, setSeconds } from 'date-fns';
|
|
|
3
3
|
import * as dateFnsLocales from 'date-fns/locale';
|
|
4
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,80 +110,434 @@ 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
|
-
|
|
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]';
|
|
141
|
+
}
|
|
142
|
+
if (!(symToStringTag && symToStringTag in Object(value))) {
|
|
143
|
+
return toString.call(value);
|
|
144
|
+
}
|
|
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;
|
|
151
|
+
}
|
|
152
|
+
catch (e) { }
|
|
153
|
+
const result = toString.call(value);
|
|
154
|
+
if (unmasked) {
|
|
155
|
+
if (isOwn) {
|
|
156
|
+
value[symToStringTag] = tag;
|
|
137
157
|
}
|
|
138
158
|
else {
|
|
139
|
-
|
|
159
|
+
delete value[symToStringTag];
|
|
140
160
|
}
|
|
141
161
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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()];
|
|
152
189
|
}
|
|
153
|
-
|
|
154
|
-
|
|
190
|
+
return result === undefined ? defaultValue : result;
|
|
191
|
+
}
|
|
192
|
+
function set(object, path, value) {
|
|
193
|
+
if (object == null) {
|
|
194
|
+
return object;
|
|
155
195
|
}
|
|
156
|
-
|
|
157
|
-
|
|
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];
|
|
158
216
|
}
|
|
159
|
-
|
|
160
|
-
|
|
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
|
+
}
|
|
161
240
|
}
|
|
162
|
-
|
|
163
|
-
|
|
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})`;
|
|
164
254
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
return this.nativeDate.getTime();
|
|
255
|
+
else {
|
|
256
|
+
return `rgb(${resultR}, ${resultG}, ${resultB})`;
|
|
168
257
|
}
|
|
169
|
-
|
|
170
|
-
|
|
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
|
+
}
|
|
171
267
|
}
|
|
172
|
-
|
|
173
|
-
return
|
|
268
|
+
else {
|
|
269
|
+
return parseInt((date.getTime() / 1000).toFixed(0), 10);
|
|
174
270
|
}
|
|
175
|
-
|
|
176
|
-
|
|
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
|
+
}, '');
|
|
177
300
|
}
|
|
178
|
-
|
|
179
|
-
return
|
|
301
|
+
else {
|
|
302
|
+
return;
|
|
180
303
|
}
|
|
181
|
-
|
|
182
|
-
|
|
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;
|
|
183
323
|
}
|
|
184
|
-
|
|
185
|
-
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
|
+
// If the string contains time, you need to convert the time to UTC time before passing it to 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);
|
|
186
541
|
}
|
|
187
542
|
getDay() {
|
|
188
543
|
return this.nativeDate.getDay();
|
|
@@ -207,14 +562,10 @@ class TinyDate {
|
|
|
207
562
|
}
|
|
208
563
|
// set
|
|
209
564
|
setDate(amount) {
|
|
210
|
-
|
|
211
|
-
date.setDate(amount);
|
|
212
|
-
return new TinyDate(date, this.useTimeZone);
|
|
565
|
+
return new TinyDate(this.nativeDate.setDate(amount), this.useTimeZone);
|
|
213
566
|
}
|
|
214
567
|
setHms(hour, minute, second) {
|
|
215
|
-
|
|
216
|
-
date.setHours(hour, minute, second);
|
|
217
|
-
return new TinyDate(date, this.useTimeZone);
|
|
568
|
+
return new TinyDate(this.nativeDate?.setHours(hour, minute, second), this.useTimeZone);
|
|
218
569
|
}
|
|
219
570
|
setYear(year) {
|
|
220
571
|
return new TinyDate(setYear(this.nativeDate, year), this.useTimeZone);
|
|
@@ -418,7 +769,7 @@ class TinyDate {
|
|
|
418
769
|
return new TinyDate(startOfWeek(startOfMonth(this.nativeDate), options), this.useTimeZone);
|
|
419
770
|
}
|
|
420
771
|
clone() {
|
|
421
|
-
return new TinyDate(
|
|
772
|
+
return new TinyDate(this.nativeDate, this.useTimeZone);
|
|
422
773
|
}
|
|
423
774
|
getUnixTime() {
|
|
424
775
|
return getUnixTime(this.nativeDate);
|
|
@@ -482,335 +833,6 @@ class TinyDate {
|
|
|
482
833
|
}
|
|
483
834
|
}
|
|
484
835
|
|
|
485
|
-
function isUndefined(value) {
|
|
486
|
-
return value === undefined;
|
|
487
|
-
}
|
|
488
|
-
function isNull(value) {
|
|
489
|
-
return value === null;
|
|
490
|
-
}
|
|
491
|
-
function isUndefinedOrNull(value) {
|
|
492
|
-
return isUndefined(value) || isNull(value);
|
|
493
|
-
}
|
|
494
|
-
function isArray(value) {
|
|
495
|
-
return value && baseGetTag(value) === '[object Array]';
|
|
496
|
-
}
|
|
497
|
-
function isEmpty(value) {
|
|
498
|
-
return !(isArray(value) && value.length > 0);
|
|
499
|
-
}
|
|
500
|
-
function isString(value) {
|
|
501
|
-
return typeof value == 'string' || (!isArray(value) && isObjectLike(value) && baseGetTag(value) === '[object String]');
|
|
502
|
-
}
|
|
503
|
-
function isObjectLike(value) {
|
|
504
|
-
return value !== null && typeof value === 'object';
|
|
505
|
-
}
|
|
506
|
-
function baseGetTag(value) {
|
|
507
|
-
const objectProto = Object.prototype;
|
|
508
|
-
const hasOwnProperty = objectProto.hasOwnProperty;
|
|
509
|
-
const toString = objectProto.toString;
|
|
510
|
-
const symToStringTag = typeof Symbol !== 'undefined' ? Symbol.toStringTag : undefined;
|
|
511
|
-
if (value == null) {
|
|
512
|
-
return value === undefined ? '[object Undefined]' : '[object Null]';
|
|
513
|
-
}
|
|
514
|
-
if (!(symToStringTag && symToStringTag in Object(value))) {
|
|
515
|
-
return toString.call(value);
|
|
516
|
-
}
|
|
517
|
-
const isOwn = hasOwnProperty.call(value, symToStringTag);
|
|
518
|
-
const tag = value[symToStringTag];
|
|
519
|
-
let unmasked = false;
|
|
520
|
-
try {
|
|
521
|
-
value[symToStringTag] = undefined;
|
|
522
|
-
unmasked = true;
|
|
523
|
-
}
|
|
524
|
-
catch (e) { }
|
|
525
|
-
const result = toString.call(value);
|
|
526
|
-
if (unmasked) {
|
|
527
|
-
if (isOwn) {
|
|
528
|
-
value[symToStringTag] = tag;
|
|
529
|
-
}
|
|
530
|
-
else {
|
|
531
|
-
delete value[symToStringTag];
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
return result;
|
|
535
|
-
}
|
|
536
|
-
function isNumber(value) {
|
|
537
|
-
return typeof value === 'number' || (isObjectLike(value) && baseGetTag(value) === '[object Number]');
|
|
538
|
-
}
|
|
539
|
-
function isObject(value) {
|
|
540
|
-
// Avoid a V8 JIT bug in Chrome 19-20.
|
|
541
|
-
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
|
|
542
|
-
const type = typeof value;
|
|
543
|
-
return !!value && (type === 'object' || type === 'function');
|
|
544
|
-
}
|
|
545
|
-
function isFunction(value) {
|
|
546
|
-
const type = typeof value;
|
|
547
|
-
return !!value && type === 'function';
|
|
548
|
-
}
|
|
549
|
-
function isDate(value) {
|
|
550
|
-
const type = typeof value;
|
|
551
|
-
return !!value && type === 'object' && !!value.getTime;
|
|
552
|
-
}
|
|
553
|
-
function coerceArray(value) {
|
|
554
|
-
return Array.isArray(value) ? value : [value];
|
|
555
|
-
}
|
|
556
|
-
function get(object, path, defaultValue) {
|
|
557
|
-
const paths = path.split('.');
|
|
558
|
-
let result = object[paths.shift()];
|
|
559
|
-
while (result && paths.length) {
|
|
560
|
-
result = result[paths.shift()];
|
|
561
|
-
}
|
|
562
|
-
return result === undefined ? defaultValue : result;
|
|
563
|
-
}
|
|
564
|
-
function set(object, path, value) {
|
|
565
|
-
if (object == null) {
|
|
566
|
-
return object;
|
|
567
|
-
}
|
|
568
|
-
const paths = path.split('.');
|
|
569
|
-
let index = -1;
|
|
570
|
-
const length = paths.length;
|
|
571
|
-
const lastIndex = length - 1;
|
|
572
|
-
let nested = object;
|
|
573
|
-
while (nested !== null && ++index < length) {
|
|
574
|
-
const key = paths[index];
|
|
575
|
-
if (isObject(nested)) {
|
|
576
|
-
if (index === lastIndex) {
|
|
577
|
-
nested[key] = value;
|
|
578
|
-
nested = nested[key];
|
|
579
|
-
break;
|
|
580
|
-
}
|
|
581
|
-
else {
|
|
582
|
-
if (nested[key] == null) {
|
|
583
|
-
nested[key] = {};
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
nested = nested[key];
|
|
588
|
-
}
|
|
589
|
-
return object;
|
|
590
|
-
}
|
|
591
|
-
function isBoolean(value) {
|
|
592
|
-
return value === true || value === false || (isObjectLike(value) && baseGetTag(value) === '[object Boolean]');
|
|
593
|
-
}
|
|
594
|
-
function isClass(value) {
|
|
595
|
-
return isFunction(value) && /^\s*class\s+/.test(value.toString());
|
|
596
|
-
}
|
|
597
|
-
function htmlElementIsEmpty(element) {
|
|
598
|
-
if (element && element.childNodes) {
|
|
599
|
-
const nodes = element.childNodes;
|
|
600
|
-
for (let i = 0; i < nodes.length; i++) {
|
|
601
|
-
const node = nodes[i];
|
|
602
|
-
if (node.nodeType === Node.ELEMENT_NODE && node.outerHTML.toString().trim().length !== 0) {
|
|
603
|
-
return false;
|
|
604
|
-
}
|
|
605
|
-
else if (node.nodeType === Node.TEXT_NODE && node.textContent.toString().trim().length !== 0) {
|
|
606
|
-
return false;
|
|
607
|
-
}
|
|
608
|
-
else if (node.nodeType !== Node.COMMENT_NODE) {
|
|
609
|
-
return false;
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
return true;
|
|
614
|
-
}
|
|
615
|
-
function hexToRgb(hexValue, alpha) {
|
|
616
|
-
const rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
617
|
-
const hex = hexValue.replace(rgx, (m, r, g, b) => r + r + g + g + b + b);
|
|
618
|
-
const rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
619
|
-
if (!rgb)
|
|
620
|
-
return;
|
|
621
|
-
const resultR = parseInt(rgb[1], 16);
|
|
622
|
-
const resultG = parseInt(rgb[2], 16);
|
|
623
|
-
const resultB = parseInt(rgb[3], 16);
|
|
624
|
-
if (!isUndefinedOrNull(alpha)) {
|
|
625
|
-
return `rgba(${resultR}, ${resultG}, ${resultB}, ${alpha})`;
|
|
626
|
-
}
|
|
627
|
-
else {
|
|
628
|
-
return `rgb(${resultR}, ${resultG}, ${resultB})`;
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
function dateToUnixTimestamp(date) {
|
|
632
|
-
if (isNumber(date)) {
|
|
633
|
-
if (date.toString().length === 10) {
|
|
634
|
-
return date;
|
|
635
|
-
}
|
|
636
|
-
else {
|
|
637
|
-
return parseInt((date / 1000).toFixed(0), 10);
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
else {
|
|
641
|
-
return parseInt((date.getTime() / 1000).toFixed(0), 10);
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
function clamp(value, min = 0, max = 100) {
|
|
645
|
-
return Math.max(min, Math.min(max, value));
|
|
646
|
-
}
|
|
647
|
-
function keyBy(array, key) {
|
|
648
|
-
const result = {};
|
|
649
|
-
array.forEach(item => {
|
|
650
|
-
const keyValue = item[key];
|
|
651
|
-
result[keyValue] = item;
|
|
652
|
-
});
|
|
653
|
-
return result;
|
|
654
|
-
}
|
|
655
|
-
function indexKeyBy(array, key) {
|
|
656
|
-
const result = {};
|
|
657
|
-
array.forEach((item, index) => {
|
|
658
|
-
const keyValue = item[key];
|
|
659
|
-
result[keyValue] = index;
|
|
660
|
-
});
|
|
661
|
-
return result;
|
|
662
|
-
}
|
|
663
|
-
function upperFirst(string) {
|
|
664
|
-
return string.slice(0, 1).toUpperCase() + string.slice(1);
|
|
665
|
-
}
|
|
666
|
-
function camelCase(values) {
|
|
667
|
-
if (isArray(values)) {
|
|
668
|
-
return values.reduce((result, word, index) => {
|
|
669
|
-
word = word.toLowerCase();
|
|
670
|
-
return result + (index ? upperFirst(word) : word);
|
|
671
|
-
}, '');
|
|
672
|
-
}
|
|
673
|
-
else {
|
|
674
|
-
return;
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
function generateRandomStr() {
|
|
678
|
-
return Math.random().toString(36).substring(2);
|
|
679
|
-
}
|
|
680
|
-
function isTemplateRef(value) {
|
|
681
|
-
return value instanceof TemplateRef;
|
|
682
|
-
}
|
|
683
|
-
function isHTMLElement(value) {
|
|
684
|
-
return value instanceof HTMLElement;
|
|
685
|
-
}
|
|
686
|
-
function isElementRef(value) {
|
|
687
|
-
return value instanceof ElementRef;
|
|
688
|
-
}
|
|
689
|
-
/**
|
|
690
|
-
* fix angular cdk's coerceBooleanProperty will transform 0 to true
|
|
691
|
-
*/
|
|
692
|
-
function coerceBooleanProperty(value) {
|
|
693
|
-
if (value === '' || (value && value !== 'false')) {
|
|
694
|
-
return true;
|
|
695
|
-
}
|
|
696
|
-
else {
|
|
697
|
-
return false;
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
/**
|
|
701
|
-
* @deprecated Please use Angular cdk's coerceNumberProperty instead
|
|
702
|
-
*/
|
|
703
|
-
function coerceNumberValue(value, fallbackValue = 0) {
|
|
704
|
-
return _isNumberValue(value) ? Number(value) : fallbackValue;
|
|
705
|
-
}
|
|
706
|
-
/**
|
|
707
|
-
* @deprecated Please use Angular cdk's coerceCssPixelValue instead
|
|
708
|
-
*/
|
|
709
|
-
function coerceCssPixelValue(value) {
|
|
710
|
-
value = _isNumberValue(value) ? Number(value) : value;
|
|
711
|
-
return coerceCssPixelValue$1(value);
|
|
712
|
-
}
|
|
713
|
-
function valueFunctionProp(prop, ...args) {
|
|
714
|
-
return typeof prop === 'function' ? prop(...args) : prop;
|
|
715
|
-
}
|
|
716
|
-
function shallowEqual(objA, objB) {
|
|
717
|
-
if (objA === objB) {
|
|
718
|
-
return true;
|
|
719
|
-
}
|
|
720
|
-
if (typeof objA !== 'object' || !objA || typeof objB !== 'object' || !objB) {
|
|
721
|
-
return false;
|
|
722
|
-
}
|
|
723
|
-
const keysA = Object.keys(objA);
|
|
724
|
-
const keysB = Object.keys(objB);
|
|
725
|
-
if (keysA.length !== keysB.length) {
|
|
726
|
-
return false;
|
|
727
|
-
}
|
|
728
|
-
const bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
|
|
729
|
-
for (let idx = 0; idx < keysA.length; idx++) {
|
|
730
|
-
const key = keysA[idx];
|
|
731
|
-
if (!bHasOwnProperty(key)) {
|
|
732
|
-
return false;
|
|
733
|
-
}
|
|
734
|
-
if (objA[key] !== objB[key]) {
|
|
735
|
-
return false;
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
return true;
|
|
739
|
-
}
|
|
740
|
-
function concatArray(items, originalItems = []) {
|
|
741
|
-
let _originalItems = [];
|
|
742
|
-
if (!originalItems) {
|
|
743
|
-
_originalItems = [];
|
|
744
|
-
}
|
|
745
|
-
else {
|
|
746
|
-
_originalItems = coerceArray(originalItems);
|
|
747
|
-
}
|
|
748
|
-
if (items) {
|
|
749
|
-
if (isArray(items)) {
|
|
750
|
-
return [..._originalItems, ...items];
|
|
751
|
-
}
|
|
752
|
-
else {
|
|
753
|
-
return [..._originalItems, items];
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
else {
|
|
757
|
-
return _originalItems;
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
function humanizeBytes(bytes, noSpace = false, fractionDigits = 1) {
|
|
761
|
-
if (bytes === 0) {
|
|
762
|
-
return '0 Byte';
|
|
763
|
-
}
|
|
764
|
-
const k = 1024;
|
|
765
|
-
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
766
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
767
|
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(fractionDigits)) + (noSpace ? '' : ' ') + sizes[i];
|
|
768
|
-
}
|
|
769
|
-
function isFloat(value) {
|
|
770
|
-
if (!value) {
|
|
771
|
-
return false;
|
|
772
|
-
}
|
|
773
|
-
return /^[-+]?([0-9]+([.][0-9]*)?|[.][0-9]+)([Ee][-+]?[0-9]+)?$/.test(value);
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
var index = /*#__PURE__*/Object.freeze({
|
|
777
|
-
__proto__: null,
|
|
778
|
-
camelCase: camelCase,
|
|
779
|
-
clamp: clamp,
|
|
780
|
-
coerceArray: coerceArray,
|
|
781
|
-
coerceBooleanProperty: coerceBooleanProperty,
|
|
782
|
-
coerceCssPixelValue: coerceCssPixelValue,
|
|
783
|
-
coerceNumberValue: coerceNumberValue,
|
|
784
|
-
concatArray: concatArray,
|
|
785
|
-
dateToUnixTimestamp: dateToUnixTimestamp,
|
|
786
|
-
generateRandomStr: generateRandomStr,
|
|
787
|
-
get: get,
|
|
788
|
-
hexToRgb: hexToRgb,
|
|
789
|
-
htmlElementIsEmpty: htmlElementIsEmpty,
|
|
790
|
-
humanizeBytes: humanizeBytes,
|
|
791
|
-
indexKeyBy: indexKeyBy,
|
|
792
|
-
isArray: isArray,
|
|
793
|
-
isBoolean: isBoolean,
|
|
794
|
-
isClass: isClass,
|
|
795
|
-
isDate: isDate,
|
|
796
|
-
isElementRef: isElementRef,
|
|
797
|
-
isEmpty: isEmpty,
|
|
798
|
-
isFloat: isFloat,
|
|
799
|
-
isFunction: isFunction,
|
|
800
|
-
isHTMLElement: isHTMLElement,
|
|
801
|
-
isNull: isNull,
|
|
802
|
-
isNumber: isNumber,
|
|
803
|
-
isObject: isObject,
|
|
804
|
-
isString: isString,
|
|
805
|
-
isTemplateRef: isTemplateRef,
|
|
806
|
-
isUndefined: isUndefined,
|
|
807
|
-
isUndefinedOrNull: isUndefinedOrNull,
|
|
808
|
-
keyBy: keyBy,
|
|
809
|
-
set: set,
|
|
810
|
-
shallowEqual: shallowEqual,
|
|
811
|
-
valueFunctionProp: valueFunctionProp
|
|
812
|
-
});
|
|
813
|
-
|
|
814
836
|
const proto = Element.prototype;
|
|
815
837
|
const vendor = proto.matches ||
|
|
816
838
|
proto['matchesSelector'] ||
|
|
@@ -1325,5 +1347,5 @@ function setWarnDeprecation(enabled) {
|
|
|
1325
1347
|
* Generated bundle index. Do not edit.
|
|
1326
1348
|
*/
|
|
1327
1349
|
|
|
1328
|
-
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 };
|
|
1350
|
+
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 };
|
|
1329
1351
|
//# sourceMappingURL=ngx-tethys-util.mjs.map
|