@ng-atomic/common 0.0.1
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/README.md +7 -0
- package/bundles/ng-atomic-common-directives.umd.js +95 -0
- package/bundles/ng-atomic-common-directives.umd.js.map +1 -0
- package/bundles/ng-atomic-common-directives.umd.min.js +2 -0
- package/bundles/ng-atomic-common-directives.umd.min.js.map +1 -0
- package/bundles/ng-atomic-common-models.umd.js +11 -0
- package/bundles/ng-atomic-common-models.umd.js.map +1 -0
- package/bundles/ng-atomic-common-models.umd.min.js +2 -0
- package/bundles/ng-atomic-common-models.umd.min.js.map +1 -0
- package/bundles/ng-atomic-common-pipes.umd.js +266 -0
- package/bundles/ng-atomic-common-pipes.umd.js.map +1 -0
- package/bundles/ng-atomic-common-pipes.umd.min.js +2 -0
- package/bundles/ng-atomic-common-pipes.umd.min.js.map +1 -0
- package/bundles/ng-atomic-common-services.umd.js +429 -0
- package/bundles/ng-atomic-common-services.umd.js.map +1 -0
- package/bundles/ng-atomic-common-services.umd.min.js +16 -0
- package/bundles/ng-atomic-common-services.umd.min.js.map +1 -0
- package/bundles/ng-atomic-common-store.umd.js +435 -0
- package/bundles/ng-atomic-common-store.umd.js.map +1 -0
- package/bundles/ng-atomic-common-store.umd.min.js +16 -0
- package/bundles/ng-atomic-common-store.umd.min.js.map +1 -0
- package/bundles/ng-atomic-common-utils.umd.js +727 -0
- package/bundles/ng-atomic-common-utils.umd.js.map +1 -0
- package/bundles/ng-atomic-common-utils.umd.min.js +2 -0
- package/bundles/ng-atomic-common-utils.umd.min.js.map +1 -0
- package/bundles/ng-atomic-common.umd.js +11 -0
- package/bundles/ng-atomic-common.umd.js.map +1 -0
- package/bundles/ng-atomic-common.umd.min.js +2 -0
- package/bundles/ng-atomic-common.umd.min.js.map +1 -0
- package/directives/index.d.ts +1 -0
- package/directives/ios-safari-scroll-buggyfill/index.d.ts +2 -0
- package/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.directive.d.ts +10 -0
- package/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.module.d.ts +8 -0
- package/directives/ng-atomic-common-directives.d.ts +5 -0
- package/directives/package.json +10 -0
- package/esm2015/directives/index.js +2 -0
- package/esm2015/directives/index.js.map +1 -0
- package/esm2015/directives/ios-safari-scroll-buggyfill/index.js +3 -0
- package/esm2015/directives/ios-safari-scroll-buggyfill/index.js.map +1 -0
- package/esm2015/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.directive.js +27 -0
- package/esm2015/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.directive.js.map +1 -0
- package/esm2015/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.module.js +27 -0
- package/esm2015/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.module.js.map +1 -0
- package/esm2015/directives/ng-atomic-common-directives.js +5 -0
- package/esm2015/directives/ng-atomic-common-directives.js.map +1 -0
- package/esm2015/index.js +2 -0
- package/esm2015/index.js.map +1 -0
- package/esm2015/models/action-item.js +2 -0
- package/esm2015/models/action-item.js.map +1 -0
- package/esm2015/models/index.js +2 -0
- package/esm2015/models/index.js.map +1 -0
- package/esm2015/models/menu-item.js +2 -0
- package/esm2015/models/menu-item.js.map +1 -0
- package/esm2015/models/ng-atomic-common-models.js +5 -0
- package/esm2015/models/ng-atomic-common-models.js.map +1 -0
- package/esm2015/models/public_api.js +3 -0
- package/esm2015/models/public_api.js.map +1 -0
- package/esm2015/ng-atomic-common.js +5 -0
- package/esm2015/ng-atomic-common.js.map +1 -0
- package/esm2015/pipes/domain/domain.module.js +27 -0
- package/esm2015/pipes/domain/domain.module.js.map +1 -0
- package/esm2015/pipes/domain/domain.pipe.js +29 -0
- package/esm2015/pipes/domain/domain.pipe.js.map +1 -0
- package/esm2015/pipes/domain/index.js +3 -0
- package/esm2015/pipes/domain/index.js.map +1 -0
- package/esm2015/pipes/index.js +5 -0
- package/esm2015/pipes/index.js.map +1 -0
- package/esm2015/pipes/ng-atomic-common-pipes.js +5 -0
- package/esm2015/pipes/ng-atomic-common-pipes.js.map +1 -0
- package/esm2015/pipes/smart-exp/index.js +3 -0
- package/esm2015/pipes/smart-exp/index.js.map +1 -0
- package/esm2015/pipes/smart-exp/smart-exp.module.js +17 -0
- package/esm2015/pipes/smart-exp/smart-exp.module.js.map +1 -0
- package/esm2015/pipes/smart-exp/smart-exp.pipe.js +28 -0
- package/esm2015/pipes/smart-exp/smart-exp.pipe.js.map +1 -0
- package/esm2015/pipes/smart-field/index.js +3 -0
- package/esm2015/pipes/smart-field/index.js.map +1 -0
- package/esm2015/pipes/smart-field/smart-field.module.js +27 -0
- package/esm2015/pipes/smart-field/smart-field.module.js.map +1 -0
- package/esm2015/pipes/smart-field/smart-field.pipe.js +33 -0
- package/esm2015/pipes/smart-field/smart-field.pipe.js.map +1 -0
- package/esm2015/pipes/yen/index.js +3 -0
- package/esm2015/pipes/yen/index.js.map +1 -0
- package/esm2015/pipes/yen/yen.module.js +27 -0
- package/esm2015/pipes/yen/yen.module.js.map +1 -0
- package/esm2015/pipes/yen/yen.pipe.js +17 -0
- package/esm2015/pipes/yen/yen.pipe.js.map +1 -0
- package/esm2015/services/index.js +3 -0
- package/esm2015/services/index.js.map +1 -0
- package/esm2015/services/loading/index.js +2 -0
- package/esm2015/services/loading/index.js.map +1 -0
- package/esm2015/services/loading/loading.service.js +32 -0
- package/esm2015/services/loading/loading.service.js.map +1 -0
- package/esm2015/services/ng-atomic-common-services.js +5 -0
- package/esm2015/services/ng-atomic-common-services.js.map +1 -0
- package/esm2015/services/snack-bar/index.js +3 -0
- package/esm2015/services/snack-bar/index.js.map +1 -0
- package/esm2015/services/snack-bar/snack-bar.module.js +25 -0
- package/esm2015/services/snack-bar/snack-bar.module.js.map +1 -0
- package/esm2015/services/snack-bar/snack-bar.service.js +23 -0
- package/esm2015/services/snack-bar/snack-bar.service.js.map +1 -0
- package/esm2015/store/entities.page.store.js +30 -0
- package/esm2015/store/entities.page.store.js.map +1 -0
- package/esm2015/store/entity.page.store.js +41 -0
- package/esm2015/store/entity.page.store.js.map +1 -0
- package/esm2015/store/index.js +3 -0
- package/esm2015/store/index.js.map +1 -0
- package/esm2015/store/ng-atomic-common-store.js +5 -0
- package/esm2015/store/ng-atomic-common-store.js.map +1 -0
- package/esm2015/utils/comma/comma.js +4 -0
- package/esm2015/utils/comma/comma.js.map +1 -0
- package/esm2015/utils/comma/index.js +2 -0
- package/esm2015/utils/comma/index.js.map +1 -0
- package/esm2015/utils/compare-by-id/compare-by-id.js +2 -0
- package/esm2015/utils/compare-by-id/compare-by-id.js.map +1 -0
- package/esm2015/utils/compare-by-id/index.js +2 -0
- package/esm2015/utils/compare-by-id/index.js.map +1 -0
- package/esm2015/utils/index.js +6 -0
- package/esm2015/utils/index.js.map +1 -0
- package/esm2015/utils/mat-dayjs-date/dayjs-date.adapter.js +189 -0
- package/esm2015/utils/mat-dayjs-date/dayjs-date.adapter.js.map +1 -0
- package/esm2015/utils/mat-dayjs-date/dayjs-date.formats.js +15 -0
- package/esm2015/utils/mat-dayjs-date/dayjs-date.formats.js.map +1 -0
- package/esm2015/utils/mat-dayjs-date/dayjs-date.module.js +42 -0
- package/esm2015/utils/mat-dayjs-date/dayjs-date.module.js.map +1 -0
- package/esm2015/utils/mat-dayjs-date/dayjs-jp-providers.js +20 -0
- package/esm2015/utils/mat-dayjs-date/dayjs-jp-providers.js.map +1 -0
- package/esm2015/utils/mat-dayjs-date/index.js +5 -0
- package/esm2015/utils/mat-dayjs-date/index.js.map +1 -0
- package/esm2015/utils/ng-atomic-common-utils.js +5 -0
- package/esm2015/utils/ng-atomic-common-utils.js.map +1 -0
- package/esm2015/utils/query/index.js +2 -0
- package/esm2015/utils/query/index.js.map +1 -0
- package/esm2015/utils/query/query.resolver.js +59 -0
- package/esm2015/utils/query/query.resolver.js.map +1 -0
- package/esm2015/utils/to-object/index.js +2 -0
- package/esm2015/utils/to-object/index.js.map +1 -0
- package/esm2015/utils/to-object/to-object.js +10 -0
- package/esm2015/utils/to-object/to-object.js.map +1 -0
- package/fesm2015/ng-atomic-common-directives.js +58 -0
- package/fesm2015/ng-atomic-common-directives.js.map +1 -0
- package/fesm2015/ng-atomic-common-models.js +4 -0
- package/fesm2015/ng-atomic-common-models.js.map +1 -0
- package/fesm2015/ng-atomic-common-pipes.js +191 -0
- package/fesm2015/ng-atomic-common-pipes.js.map +1 -0
- package/fesm2015/ng-atomic-common-services.js +80 -0
- package/fesm2015/ng-atomic-common-services.js.map +1 -0
- package/fesm2015/ng-atomic-common-store.js +74 -0
- package/fesm2015/ng-atomic-common-store.js.map +1 -0
- package/fesm2015/ng-atomic-common-utils.js +340 -0
- package/fesm2015/ng-atomic-common-utils.js.map +1 -0
- package/fesm2015/ng-atomic-common.js +4 -0
- package/fesm2015/ng-atomic-common.js.map +1 -0
- package/index.d.ts +1 -0
- package/models/action-item.d.ts +6 -0
- package/models/index.d.ts +1 -0
- package/models/menu-item.d.ts +4 -0
- package/models/ng-atomic-common-models.d.ts +5 -0
- package/models/package.json +10 -0
- package/models/public_api.d.ts +2 -0
- package/ng-atomic-common.d.ts +5 -0
- package/package.json +21 -0
- package/pipes/domain/domain.module.d.ts +8 -0
- package/pipes/domain/domain.pipe.d.ts +11 -0
- package/pipes/domain/index.d.ts +2 -0
- package/pipes/index.d.ts +4 -0
- package/pipes/ng-atomic-common-pipes.d.ts +5 -0
- package/pipes/package.json +10 -0
- package/pipes/smart-exp/index.d.ts +2 -0
- package/pipes/smart-exp/smart-exp.module.d.ts +7 -0
- package/pipes/smart-exp/smart-exp.pipe.d.ts +7 -0
- package/pipes/smart-field/index.d.ts +2 -0
- package/pipes/smart-field/smart-field.module.d.ts +8 -0
- package/pipes/smart-field/smart-field.pipe.d.ts +31 -0
- package/pipes/yen/index.d.ts +2 -0
- package/pipes/yen/yen.module.d.ts +8 -0
- package/pipes/yen/yen.pipe.d.ts +7 -0
- package/services/index.d.ts +2 -0
- package/services/loading/index.d.ts +1 -0
- package/services/loading/loading.service.d.ts +14 -0
- package/services/ng-atomic-common-services.d.ts +5 -0
- package/services/package.json +10 -0
- package/services/snack-bar/index.d.ts +2 -0
- package/services/snack-bar/snack-bar.module.d.ts +8 -0
- package/services/snack-bar/snack-bar.service.d.ts +9 -0
- package/store/entities.page.store.d.ts +32 -0
- package/store/entity.page.store.d.ts +28 -0
- package/store/index.d.ts +2 -0
- package/store/ng-atomic-common-store.d.ts +5 -0
- package/store/package.json +10 -0
- package/utils/comma/comma.d.ts +3 -0
- package/utils/comma/index.d.ts +1 -0
- package/utils/compare-by-id/compare-by-id.d.ts +4 -0
- package/utils/compare-by-id/index.d.ts +1 -0
- package/utils/index.d.ts +5 -0
- package/utils/mat-dayjs-date/dayjs-date.adapter.d.ts +60 -0
- package/utils/mat-dayjs-date/dayjs-date.formats.d.ts +5 -0
- package/utils/mat-dayjs-date/dayjs-date.module.d.ts +11 -0
- package/utils/mat-dayjs-date/dayjs-jp-providers.d.ts +10 -0
- package/utils/mat-dayjs-date/index.d.ts +4 -0
- package/utils/ng-atomic-common-utils.d.ts +5 -0
- package/utils/package.json +10 -0
- package/utils/query/index.d.ts +1 -0
- package/utils/query/query.resolver.d.ts +1 -0
- package/utils/to-object/index.d.ts +1 -0
- package/utils/to-object/to-object.d.ts +1 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { __decorate, __metadata, __param } from "tslib";
|
|
2
|
+
import { Optional, Inject, InjectionToken } from '@angular/core';
|
|
3
|
+
import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';
|
|
4
|
+
import * as dayjs from 'dayjs';
|
|
5
|
+
import * as utc from 'dayjs/plugin/utc';
|
|
6
|
+
import * as localeData from 'dayjs/plugin/localeData';
|
|
7
|
+
import * as LocalizedFormat from 'dayjs/plugin/localizedFormat';
|
|
8
|
+
import * as customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
9
|
+
/** InjectionToken for Dayjs date adapter to configure options. */
|
|
10
|
+
export const MAT_DAYJS_DATE_ADAPTER_OPTIONS = new InjectionToken('MAT_DAYJS_DATE_ADAPTER_OPTIONS', {
|
|
11
|
+
providedIn: 'root',
|
|
12
|
+
factory: MAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY
|
|
13
|
+
});
|
|
14
|
+
export function MAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY() {
|
|
15
|
+
return {
|
|
16
|
+
useUtc: false
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** Creates an array and fills it with values. */
|
|
20
|
+
function range(length, valueFunction) {
|
|
21
|
+
const valuesArray = Array(length);
|
|
22
|
+
for (let i = 0; i < length; i++) {
|
|
23
|
+
valuesArray[i] = valueFunction(i);
|
|
24
|
+
}
|
|
25
|
+
return valuesArray;
|
|
26
|
+
}
|
|
27
|
+
/** Adapts Dayjs Dates for use with Angular Material. */
|
|
28
|
+
let DayjsDateAdapter = class DayjsDateAdapter extends DateAdapter {
|
|
29
|
+
constructor(dateLocale, options) {
|
|
30
|
+
super();
|
|
31
|
+
this.dateLocale = dateLocale;
|
|
32
|
+
this.options = options;
|
|
33
|
+
this.initializeParser(dateLocale);
|
|
34
|
+
}
|
|
35
|
+
// TODO: Implement
|
|
36
|
+
setLocale(locale) {
|
|
37
|
+
super.setLocale(locale);
|
|
38
|
+
const dayJsLocaleData = this.dayJs().localeData();
|
|
39
|
+
this.localeData = {
|
|
40
|
+
firstDayOfWeek: dayJsLocaleData.firstDayOfWeek(),
|
|
41
|
+
longMonths: dayJsLocaleData.months(),
|
|
42
|
+
shortMonths: dayJsLocaleData.monthsShort(),
|
|
43
|
+
dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),
|
|
44
|
+
longDaysOfWeek: range(7, (i) => this.dayJs().set('day', i).format('dddd')),
|
|
45
|
+
shortDaysOfWeek: dayJsLocaleData.weekdaysShort(),
|
|
46
|
+
narrowDaysOfWeek: dayJsLocaleData.weekdaysMin(),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
getYear(date) {
|
|
50
|
+
return this.dayJs(date).year();
|
|
51
|
+
}
|
|
52
|
+
getMonth(date) {
|
|
53
|
+
return this.dayJs(date).month();
|
|
54
|
+
}
|
|
55
|
+
getDate(date) {
|
|
56
|
+
return this.dayJs(date).date();
|
|
57
|
+
}
|
|
58
|
+
getDayOfWeek(date) {
|
|
59
|
+
return this.dayJs(date).day();
|
|
60
|
+
}
|
|
61
|
+
getMonthNames(style) {
|
|
62
|
+
return style === 'long' ? this.localeData.longMonths : this.localeData.shortMonths;
|
|
63
|
+
}
|
|
64
|
+
getDateNames() {
|
|
65
|
+
return this.localeData.dates;
|
|
66
|
+
}
|
|
67
|
+
getDayOfWeekNames(style) {
|
|
68
|
+
if (style === 'long') {
|
|
69
|
+
return this.localeData.longDaysOfWeek;
|
|
70
|
+
}
|
|
71
|
+
if (style === 'short') {
|
|
72
|
+
return this.localeData.shortDaysOfWeek;
|
|
73
|
+
}
|
|
74
|
+
return this.localeData.narrowDaysOfWeek;
|
|
75
|
+
}
|
|
76
|
+
getYearName(date) {
|
|
77
|
+
return this.dayJs(date).format('YYYY');
|
|
78
|
+
}
|
|
79
|
+
getFirstDayOfWeek() {
|
|
80
|
+
return this.localeData.firstDayOfWeek;
|
|
81
|
+
}
|
|
82
|
+
getNumDaysInMonth(date) {
|
|
83
|
+
return this.dayJs(date).daysInMonth();
|
|
84
|
+
}
|
|
85
|
+
clone(date) {
|
|
86
|
+
return date.clone();
|
|
87
|
+
}
|
|
88
|
+
createDate(year, month, date) {
|
|
89
|
+
const returnDayjs = this.dayJs()
|
|
90
|
+
.set('year', year)
|
|
91
|
+
.set('month', month)
|
|
92
|
+
.set('date', date);
|
|
93
|
+
return returnDayjs;
|
|
94
|
+
}
|
|
95
|
+
today() {
|
|
96
|
+
return this.dayJs();
|
|
97
|
+
}
|
|
98
|
+
parse(value, parseFormat) {
|
|
99
|
+
if (value && typeof value === 'string') {
|
|
100
|
+
return this.dayJs(value, dayjs().localeData().longDateFormat(parseFormat), this.locale);
|
|
101
|
+
}
|
|
102
|
+
return value ? this.dayJs(value).locale(this.locale) : null;
|
|
103
|
+
}
|
|
104
|
+
format(date, displayFormat) {
|
|
105
|
+
if (!this.isValid(date)) {
|
|
106
|
+
throw Error('DayjsDateAdapter: Cannot format invalid date.');
|
|
107
|
+
}
|
|
108
|
+
return date.locale(this.locale).format(displayFormat);
|
|
109
|
+
}
|
|
110
|
+
addCalendarYears(date, years) {
|
|
111
|
+
return date.add(years, 'year');
|
|
112
|
+
}
|
|
113
|
+
addCalendarMonths(date, months) {
|
|
114
|
+
return date.add(months, 'month');
|
|
115
|
+
}
|
|
116
|
+
addCalendarDays(date, days) {
|
|
117
|
+
return date.add(days, 'day');
|
|
118
|
+
}
|
|
119
|
+
toIso8601(date) {
|
|
120
|
+
return date.toISOString();
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Attempts to deserialize a value to a valid date object. This is different from parsing in that
|
|
124
|
+
* deserialize should only accept non-ambiguous, locale-independent formats (e.g. a ISO 8601
|
|
125
|
+
* string). The default implementation does not allow any deserialization, it simply checks that
|
|
126
|
+
* the given value is already a valid date object or null. The `<mat-datepicker>` will call this
|
|
127
|
+
* method on all of it's `@Input()` properties that accept dates. It is therefore possible to
|
|
128
|
+
* support passing values from your backend directly to these properties by overriding this method
|
|
129
|
+
* to also deserialize the format used by your backend.
|
|
130
|
+
* @param value The value to be deserialized into a date object.
|
|
131
|
+
* @returns The deserialized date object, either a valid date, null if the value can be
|
|
132
|
+
* deserialized into a null date (e.g. the empty string), or an invalid date.
|
|
133
|
+
*/
|
|
134
|
+
deserialize(value) {
|
|
135
|
+
let date;
|
|
136
|
+
if (value instanceof Date) {
|
|
137
|
+
date = this.dayJs(value);
|
|
138
|
+
}
|
|
139
|
+
else if (this.isDateInstance(value)) {
|
|
140
|
+
// NOTE: assumes that cloning also sets the correct locale.
|
|
141
|
+
return this.clone(value);
|
|
142
|
+
}
|
|
143
|
+
if (typeof value === 'string') {
|
|
144
|
+
if (!value) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
date = this.dayJs(value).toISOString();
|
|
148
|
+
}
|
|
149
|
+
if (date && this.isValid(date)) {
|
|
150
|
+
return this.dayJs(date); // NOTE: Is this necessary since Dayjs is immutable and Moment was not?
|
|
151
|
+
}
|
|
152
|
+
return super.deserialize(value);
|
|
153
|
+
}
|
|
154
|
+
isDateInstance(obj) {
|
|
155
|
+
return dayjs.isDayjs(obj);
|
|
156
|
+
}
|
|
157
|
+
isValid(date) {
|
|
158
|
+
return this.dayJs(date).isValid();
|
|
159
|
+
}
|
|
160
|
+
invalid() {
|
|
161
|
+
return this.dayJs(null);
|
|
162
|
+
}
|
|
163
|
+
dayJs(input, format, locale) {
|
|
164
|
+
if (!this.shouldUseUtc) {
|
|
165
|
+
return dayjs(input, { format, locale }, locale);
|
|
166
|
+
}
|
|
167
|
+
return dayjs(input, { format, locale, utc: this.shouldUseUtc }, locale).utc();
|
|
168
|
+
}
|
|
169
|
+
get shouldUseUtc() {
|
|
170
|
+
const { useUtc } = this.options || {};
|
|
171
|
+
return !!useUtc;
|
|
172
|
+
}
|
|
173
|
+
initializeParser(dateLocale) {
|
|
174
|
+
if (this.shouldUseUtc) {
|
|
175
|
+
dayjs.extend(utc);
|
|
176
|
+
}
|
|
177
|
+
dayjs.extend(LocalizedFormat);
|
|
178
|
+
dayjs.extend(customParseFormat);
|
|
179
|
+
dayjs.extend(localeData);
|
|
180
|
+
this.setLocale(dateLocale);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
DayjsDateAdapter = __decorate([
|
|
184
|
+
__param(0, Optional()), __param(0, Inject(MAT_DATE_LOCALE)),
|
|
185
|
+
__param(1, Optional()), __param(1, Inject(MAT_DAYJS_DATE_ADAPTER_OPTIONS)),
|
|
186
|
+
__metadata("design:paramtypes", [String, Object])
|
|
187
|
+
], DayjsDateAdapter);
|
|
188
|
+
export { DayjsDateAdapter };
|
|
189
|
+
//# sourceMappingURL=dayjs-date.adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dayjs-date.adapter.js","sourceRoot":"","sources":["../../../../../../libs/common/utils/mat-dayjs-date/dayjs-date.adapter.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,eAAe,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,iBAAiB,MAAM,gCAAgC,CAAC;AAYpE,kEAAkE;AAClE,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,cAAc,CAC9D,gCAAgC,EAAE;IAClC,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,sCAAsC;CAChD,CAAC,CAAC;AAEH,MAAM,UAAU,sCAAsC;IACpD,OAAO;QACL,MAAM,EAAE,KAAK;KACd,CAAC;AACJ,CAAC;AAED,iDAAiD;AACjD,SAAS,KAAK,CAAI,MAAc,EAAE,aAAmC;IACnE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,WAAW,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;KACnC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,wDAAwD;AACxD,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,WAAkB;IAWtD,YAC8C,UAAkB,EACF,OAAiC;QAE7F,KAAK,EAAE,CAAC;QAHoC,eAAU,GAAV,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AAY,YAAY;QACtB,MAAM,EAAE,MAAM,EAAE,GAA4B,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;QAC/D,OAAO,CAAC,CAAC,MAAM,CAAC;IAClB,CAAC;IAEO,gBAAgB,CAAC,UAAkB;QACzC,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACnB;QAED,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QAC9B,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAChC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAEzB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC7B,CAAC;CACF,CAAA;AAlMY,gBAAgB;IAYxB,WAAA,QAAQ,EAAE,CAAA,EAAE,WAAA,MAAM,CAAC,eAAe,CAAC,CAAA;IACnC,WAAA,QAAQ,EAAE,CAAA,EAAE,WAAA,MAAM,CAAC,8BAA8B,CAAC,CAAA;;GAb1C,gBAAgB,CAkM5B;SAlMY,gBAAgB","sourcesContent":["\nimport { Optional, Inject, InjectionToken } from '@angular/core';\nimport { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';\nimport * as dayjs from 'dayjs';\nimport { Dayjs } from 'dayjs';\nimport * as utc from 'dayjs/plugin/utc';\nimport * as localeData from 'dayjs/plugin/localeData';\nimport * as LocalizedFormat from 'dayjs/plugin/localizedFormat';\nimport * as customParseFormat from 'dayjs/plugin/customParseFormat';\n\n\nexport interface DayJsDateAdapterOptions {\n /**\n * Turns the use of utc dates on or off.\n * Changing this will change how Angular Material components like DatePicker output dates.\n * {@default false}\n */\n useUtc?: boolean;\n}\n\n/** InjectionToken for Dayjs date adapter to configure options. */\nexport const MAT_DAYJS_DATE_ADAPTER_OPTIONS = new InjectionToken<DayJsDateAdapterOptions>(\n 'MAT_DAYJS_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\nexport function MAT_DAYJS_DATE_ADAPTER_OPTIONS_FACTORY(): DayJsDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n/** Adapts Dayjs Dates for use with Angular Material. */\nexport class DayjsDateAdapter extends DateAdapter<Dayjs> {\n private localeData!: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(\n @Optional() @Inject(MAT_DATE_LOCALE) public dateLocale: string,\n @Optional() @Inject(MAT_DAYJS_DATE_ADAPTER_OPTIONS) private options?: DayJsDateAdapterOptions\n ) {\n super();\n this.initializeParser(dateLocale);\n }\n\n // TODO: Implement\n setLocale(locale: string) {\n super.setLocale(locale);\n\n const dayJsLocaleData = this.dayJs().localeData();\n this.localeData = {\n firstDayOfWeek: dayJsLocaleData.firstDayOfWeek(),\n longMonths: dayJsLocaleData.months(),\n shortMonths: dayJsLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: range(7, (i) => this.dayJs().set('day', i).format('dddd')),\n shortDaysOfWeek: dayJsLocaleData.weekdaysShort(),\n narrowDaysOfWeek: dayJsLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Dayjs): number {\n return this.dayJs(date).year();\n }\n\n getMonth(date: Dayjs): number {\n return this.dayJs(date).month();\n }\n\n getDate(date: Dayjs): number {\n return this.dayJs(date).date();\n }\n\n getDayOfWeek(date: Dayjs): number {\n return this.dayJs(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n return style === 'long' ? this.localeData.longMonths : this.localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this.localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style === 'long') {\n return this.localeData.longDaysOfWeek;\n }\n if (style === 'short') {\n return this.localeData.shortDaysOfWeek;\n }\n return this.localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Dayjs): string {\n return this.dayJs(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this.localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Dayjs): number {\n return this.dayJs(date).daysInMonth();\n }\n\n clone(date: Dayjs): Dayjs {\n return date.clone();\n }\n\n createDate(year: number, month: number, date: number): Dayjs {\n const returnDayjs = this.dayJs()\n .set('year', year)\n .set('month', month)\n .set('date', date);\n return returnDayjs;\n }\n\n today(): Dayjs {\n return this.dayJs();\n }\n\n parse(value: any, parseFormat: string): Dayjs | null {\n if (value && typeof value === 'string') {\n return this.dayJs(value, dayjs().localeData().longDateFormat(parseFormat), this.locale);\n }\n return value ? this.dayJs(value).locale(this.locale) : null;\n }\n\n format(date: Dayjs, displayFormat: string): string {\n if (!this.isValid(date)) {\n throw Error('DayjsDateAdapter: Cannot format invalid date.');\n }\n return date.locale(this.locale).format(displayFormat);\n }\n\n addCalendarYears(date: Dayjs, years: number): Dayjs {\n return date.add(years, 'year');\n }\n\n addCalendarMonths(date: Dayjs, months: number): Dayjs {\n return date.add(months, 'month');\n }\n\n addCalendarDays(date: Dayjs, days: number): Dayjs {\n return date.add(days, 'day');\n }\n\n toIso8601(date: Dayjs): string {\n return date.toISOString();\n }\n\n /**\n * Attempts to deserialize a value to a valid date object. This is different from parsing in that\n * deserialize should only accept non-ambiguous, locale-independent formats (e.g. a ISO 8601\n * string). The default implementation does not allow any deserialization, it simply checks that\n * the given value is already a valid date object or null. The `<mat-datepicker>` will call this\n * method on all of it's `@Input()` properties that accept dates. It is therefore possible to\n * support passing values from your backend directly to these properties by overriding this method\n * to also deserialize the format used by your backend.\n * @param value The value to be deserialized into a date object.\n * @returns The deserialized date object, either a valid date, null if the value can be\n * deserialized into a null date (e.g. the empty string), or an invalid date.\n */\n deserialize(value: any): Dayjs | null {\n let date;\n if (value instanceof Date) {\n date = this.dayJs(value);\n } else if (this.isDateInstance(value)) {\n // NOTE: assumes that cloning also sets the correct locale.\n return this.clone(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this.dayJs(value).toISOString();\n }\n if (date && this.isValid(date as Dayjs)) {\n return this.dayJs(date); // NOTE: Is this necessary since Dayjs is immutable and Moment was not?\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return dayjs.isDayjs(obj);\n }\n\n isValid(date: Dayjs): boolean {\n return this.dayJs(date).isValid();\n }\n\n invalid(): Dayjs {\n return this.dayJs(null);\n }\n\n private dayJs(input?: any, format?: string, locale?: string): Dayjs {\n if (!this.shouldUseUtc) {\n return dayjs(input, { format, locale }, locale);\n }\n return dayjs(input, { format, locale, utc: this.shouldUseUtc }, locale).utc();\n }\n\n private get shouldUseUtc(): boolean {\n const { useUtc }: DayJsDateAdapterOptions = this.options || {};\n return !!useUtc;\n }\n\n private initializeParser(dateLocale: string) {\n if (this.shouldUseUtc) {\n dayjs.extend(utc);\n }\n\n dayjs.extend(LocalizedFormat);\n dayjs.extend(customParseFormat);\n dayjs.extend(localeData);\n\n this.setLocale(dateLocale);\n }\n}"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom Date-Formats and Adapter (using https://github.com/iamkun/dayjs)
|
|
3
|
+
*/
|
|
4
|
+
export const MAT_DAYJS_DATE_FORMATS = {
|
|
5
|
+
parse: {
|
|
6
|
+
dateInput: 'MM/DD/YYYY',
|
|
7
|
+
},
|
|
8
|
+
display: {
|
|
9
|
+
dateInput: 'MM/DD/YYYY',
|
|
10
|
+
monthYearLabel: 'MMM YYYY',
|
|
11
|
+
dateA11yLabel: 'LL',
|
|
12
|
+
monthYearA11yLabel: 'MMMM YYYY',
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=dayjs-date.formats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dayjs-date.formats.js","sourceRoot":"","sources":["../../../../../../libs/common/utils/mat-dayjs-date/dayjs-date.formats.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAmB;IACpD,KAAK,EAAE;QACL,SAAS,EAAE,YAAY;KACxB;IACD,OAAO,EAAE;QACP,SAAS,EAAE,YAAY;QACvB,cAAc,EAAE,UAAU;QAC1B,aAAa,EAAE,IAAI;QACnB,kBAAkB,EAAE,WAAW;KAChC;CACF,CAAC","sourcesContent":["import { MatDateFormats } from '@angular/material/core';\n\n/**\n * Custom Date-Formats and Adapter (using https://github.com/iamkun/dayjs)\n */\nexport const MAT_DAYJS_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'MM/DD/YYYY',\n },\n display: {\n dateInput: 'MM/DD/YYYY',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\n }\n};"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
|
3
|
+
import { DayjsDateAdapter, MAT_DAYJS_DATE_ADAPTER_OPTIONS } from './dayjs-date.adapter';
|
|
4
|
+
import { MAT_DAYJS_DATE_FORMATS } from './dayjs-date.formats';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export class DayjsDateModule {
|
|
7
|
+
}
|
|
8
|
+
DayjsDateModule.ɵfac = function DayjsDateModule_Factory(t) { return new (t || DayjsDateModule)(); };
|
|
9
|
+
DayjsDateModule.ɵmod = i0.ɵɵdefineNgModule({ type: DayjsDateModule });
|
|
10
|
+
DayjsDateModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
|
|
11
|
+
{
|
|
12
|
+
provide: DateAdapter,
|
|
13
|
+
useClass: DayjsDateAdapter,
|
|
14
|
+
deps: [MAT_DATE_LOCALE, MAT_DAYJS_DATE_ADAPTER_OPTIONS]
|
|
15
|
+
},
|
|
16
|
+
] });
|
|
17
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DayjsDateModule, [{
|
|
18
|
+
type: NgModule,
|
|
19
|
+
args: [{
|
|
20
|
+
providers: [
|
|
21
|
+
{
|
|
22
|
+
provide: DateAdapter,
|
|
23
|
+
useClass: DayjsDateAdapter,
|
|
24
|
+
deps: [MAT_DATE_LOCALE, MAT_DAYJS_DATE_ADAPTER_OPTIONS]
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
}]
|
|
28
|
+
}], null, null); })();
|
|
29
|
+
export class MatDayjsDateModule {
|
|
30
|
+
}
|
|
31
|
+
MatDayjsDateModule.ɵfac = function MatDayjsDateModule_Factory(t) { return new (t || MatDayjsDateModule)(); };
|
|
32
|
+
MatDayjsDateModule.ɵmod = i0.ɵɵdefineNgModule({ type: MatDayjsDateModule });
|
|
33
|
+
MatDayjsDateModule.ɵinj = i0.ɵɵdefineInjector({ providers: [{ provide: MAT_DATE_FORMATS, useValue: MAT_DAYJS_DATE_FORMATS }], imports: [[DayjsDateModule]] });
|
|
34
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(MatDayjsDateModule, { imports: [DayjsDateModule] }); })();
|
|
35
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MatDayjsDateModule, [{
|
|
36
|
+
type: NgModule,
|
|
37
|
+
args: [{
|
|
38
|
+
imports: [DayjsDateModule],
|
|
39
|
+
providers: [{ provide: MAT_DATE_FORMATS, useValue: MAT_DAYJS_DATE_FORMATS }],
|
|
40
|
+
}]
|
|
41
|
+
}], null, null); })();
|
|
42
|
+
//# sourceMappingURL=dayjs-date.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dayjs-date.module.js","sourceRoot":"","sources":["../../../../../../libs/common/utils/mat-dayjs-date/dayjs-date.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;;AAW9D,MAAM,OAAO,eAAe;;8EAAf,eAAe;mDAAf,eAAe;wDARf;QACT;YACE,OAAO,EAAE,WAAW;YACpB,QAAQ,EAAE,gBAAgB;YAC1B,IAAI,EAAE,CAAC,eAAe,EAAE,8BAA8B,CAAC;SACxD;KACF;uFAEU,eAAe;cAT3B,QAAQ;eAAC;gBACR,SAAS,EAAE;oBACT;wBACE,OAAO,EAAE,WAAW;wBACpB,QAAQ,EAAE,gBAAgB;wBAC1B,IAAI,EAAE,CAAC,eAAe,EAAE,8BAA8B,CAAC;qBACxD;iBACF;aACF;;AAOD,MAAM,OAAO,kBAAkB;;oFAAlB,kBAAkB;sDAAlB,kBAAkB;2DAFlB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,sBAAsB,EAAE,CAAC,YADnE,CAAC,eAAe,CAAC;wFAGf,kBAAkB,cANlB,eAAe;uFAMf,kBAAkB;cAJ9B,QAAQ;eAAC;gBACR,OAAO,EAAE,CAAC,eAAe,CAAC;gBAC1B,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,sBAAsB,EAAE,CAAC;aAC7E","sourcesContent":["import { NgModule } from '@angular/core';\nimport { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';\nimport { DayjsDateAdapter, MAT_DAYJS_DATE_ADAPTER_OPTIONS } from './dayjs-date.adapter';\nimport { MAT_DAYJS_DATE_FORMATS } from './dayjs-date.formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: DayjsDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_DAYJS_DATE_ADAPTER_OPTIONS]\n },\n ],\n})\nexport class DayjsDateModule { }\n\n@NgModule({\n imports: [DayjsDateModule],\n providers: [{ provide: MAT_DATE_FORMATS, useValue: MAT_DAYJS_DATE_FORMATS }],\n})\nexport class MatDayjsDateModule { }"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
|
2
|
+
import * as dayjs from 'dayjs';
|
|
3
|
+
import 'dayjs/locale/ja';
|
|
4
|
+
dayjs.locale('ja');
|
|
5
|
+
export const MAT_DAYJS_DATE_FORMATS_FOR_JP = {
|
|
6
|
+
parse: {
|
|
7
|
+
dateInput: 'YYYY/MM/DD',
|
|
8
|
+
},
|
|
9
|
+
display: {
|
|
10
|
+
dateInput: 'YYYY/MM/DD',
|
|
11
|
+
monthYearLabel: 'MMM YYYY',
|
|
12
|
+
dateA11yLabel: 'LL',
|
|
13
|
+
monthYearA11yLabel: 'MMMM YYYY',
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export const MAT_DAYJS_JP_PROVIDERS = [
|
|
17
|
+
{ provide: MAT_DATE_LOCALE, useValue: 'ja' },
|
|
18
|
+
{ provide: MAT_DATE_FORMATS, useValue: MAT_DAYJS_DATE_FORMATS_FOR_JP },
|
|
19
|
+
];
|
|
20
|
+
//# sourceMappingURL=dayjs-jp-providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dayjs-jp-providers.js","sourceRoot":"","sources":["../../../../../../libs/common/utils/mat-dayjs-date/dayjs-jp-providers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,gBAAgB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,iBAAiB,CAAA;AACxB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAEnB,MAAM,CAAC,MAAM,6BAA6B,GAAmB;IAC3D,KAAK,EAAE;QACL,SAAS,EAAE,YAAY;KACxB;IACD,OAAO,EAAE;QACP,SAAS,EAAE,YAAY;QACvB,cAAc,EAAE,UAAU;QAC1B,aAAa,EAAE,IAAI;QACnB,kBAAkB,EAAE,WAAW;KAChC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC5C,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,6BAA6B,EAAE;CACvE,CAAC","sourcesContent":["import { MatDateFormats, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';\nimport * as dayjs from 'dayjs';\nimport 'dayjs/locale/ja'\ndayjs.locale('ja');\n\nexport const MAT_DAYJS_DATE_FORMATS_FOR_JP: MatDateFormats = {\n parse: {\n dateInput: 'YYYY/MM/DD',\n },\n display: {\n dateInput: 'YYYY/MM/DD',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\n }\n};\n\nexport const MAT_DAYJS_JP_PROVIDERS = [\n { provide: MAT_DATE_LOCALE, useValue: 'ja' },\n { provide: MAT_DATE_FORMATS, useValue: MAT_DAYJS_DATE_FORMATS_FOR_JP },\n];\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/common/utils/mat-dayjs-date/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC","sourcesContent":["export * from './dayjs-date.adapter';\nexport * from './dayjs-date.formats';\nexport * from './dayjs-jp-providers';\nexport * from './dayjs-date.module';"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-utils.js","sourceRoot":"","sources":["../../../../../libs/common/utils/ng-atomic-common-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC","sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/common/utils/query/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './query.resolver';\n"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { toObject } from '../to-object';
|
|
2
|
+
import { flatten } from 'flat';
|
|
3
|
+
export const filterByQuery = (items, queryString, dlm = {}) => {
|
|
4
|
+
return new QueryResolver(dlm).resolve(items, queryString);
|
|
5
|
+
};
|
|
6
|
+
class QueryResolver {
|
|
7
|
+
constructor(map) {
|
|
8
|
+
this.inQueryByKey = (items, query) => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
const [not, _key, value] = this.parseQuery(query);
|
|
11
|
+
const key = (_b = (_a = this.REVERSED_MAP) === null || _a === void 0 ? void 0 : _a[_key]) !== null && _b !== void 0 ? _b : _key;
|
|
12
|
+
return items.filter(item => { var _a; return _not(_in((_a = flatten(toObject(item))) === null || _a === void 0 ? void 0 : _a[key], value), not); });
|
|
13
|
+
};
|
|
14
|
+
this.gtQueryByKey = (items, query) => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const [_key, value] = query.split('>');
|
|
17
|
+
const key = (_b = (_a = this.REVERSED_MAP) === null || _a === void 0 ? void 0 : _a[_key]) !== null && _b !== void 0 ? _b : _key;
|
|
18
|
+
return items.filter(item => { var _a; return _gt((_a = flatten(toObject(item))) === null || _a === void 0 ? void 0 : _a[key], value); });
|
|
19
|
+
};
|
|
20
|
+
this.inQuery = (items, query) => {
|
|
21
|
+
return items.filter(item => Object.values(flatten(toObject(item))).some(value => _in(value, query)));
|
|
22
|
+
};
|
|
23
|
+
this.REVERSED_MAP = Object.entries(map).reduce((p, [k, v]) => (Object.assign(Object.assign({}, p), { [v]: k })), {});
|
|
24
|
+
}
|
|
25
|
+
resolve(items, queryString) {
|
|
26
|
+
return this.resolveQueries(items, queryString.split(' ').filter(q => q.length));
|
|
27
|
+
}
|
|
28
|
+
resolveQueries(items, queries) {
|
|
29
|
+
return queries.reduce((_items, query) => {
|
|
30
|
+
if (query.includes(':'))
|
|
31
|
+
return this.inQueryByKey(_items, query);
|
|
32
|
+
if (query.includes('='))
|
|
33
|
+
return this.inQueryByKey(_items, query);
|
|
34
|
+
if (query.includes('>'))
|
|
35
|
+
return this.gtQueryByKey(_items, query);
|
|
36
|
+
if (query.includes('<'))
|
|
37
|
+
return this.inQueryByKey(_items, query);
|
|
38
|
+
return this.inQuery(_items, query);
|
|
39
|
+
}, items);
|
|
40
|
+
}
|
|
41
|
+
parseQuery(query) {
|
|
42
|
+
const [_key, value] = query.split(':');
|
|
43
|
+
return [_key.startsWith('-'), _key.startsWith('-') ? _key.slice(1) : _key, value];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const _not = (bool, not) => {
|
|
47
|
+
return not ? !bool : bool;
|
|
48
|
+
};
|
|
49
|
+
const _in = (value, query) => {
|
|
50
|
+
return typeof value === 'string' ? value === null || value === void 0 ? void 0 : value.includes(query) : false;
|
|
51
|
+
};
|
|
52
|
+
const _gt = (value, query) => {
|
|
53
|
+
return typeof value === 'string'
|
|
54
|
+
? parseFloat(value) > parseFloat(query)
|
|
55
|
+
: typeof value === 'number'
|
|
56
|
+
? value > parseFloat(query)
|
|
57
|
+
: false;
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=query.resolver.js.map
|
|
@@ -0,0 +1 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AC3B,CAAC,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;YAC3B,CAAC,CAAC,KAAK,CAAC;AACZ,CAAC,CAAA","sourcesContent":["import { toObject } from '../to-object';\nimport { flatten } from 'flat';\n\nexport const filterByQuery = <T>(items: T[], queryString: string, dlm: Record<string, string> = {}): T[] => {\n return new QueryResolver(dlm).resolve(items, queryString);\n}\n\ntype QueryResolveFunc<T> = (items: T[], query: string) => T[];\n\nclass QueryResolver<T extends object = any> {\n REVERSED_MAP: Record<string, string>;\n\n constructor(map: Record<string, string>) {\n this.REVERSED_MAP = Object.entries(map).reduce((p, [k, v]) => ({...p, [v]: k}), {} as Record<string, string>);\n }\n\n resolve(items: T[], queryString: string): T[] {\n return this.resolveQueries(items, queryString.split(' ').filter(q => q.length));\n }\n\n resolveQueries(items: T[], queries: string[]): T[] {\n return queries.reduce((_items, query: string) => {\n if (query.includes(':')) return this.inQueryByKey(_items, query);\n if (query.includes('=')) return this.inQueryByKey(_items, query);\n if (query.includes('>')) return this.gtQueryByKey(_items, query);\n if (query.includes('<')) return this.inQueryByKey(_items, query);\n return this.inQuery(_items, query);\n }, items);\n }\n\n private parseQuery(query: string): [boolean, string, string] {\n const [_key, value] = query.split(':');\n return [_key.startsWith('-'), _key.startsWith('-') ? _key.slice(1) : _key, value];\n }\n\n private inQueryByKey: QueryResolveFunc<T> = (items, query) => {\n const [not, _key, value] = this.parseQuery(query);\n const key = this.REVERSED_MAP?.[_key] ?? _key;\n return items.filter(item => _not(_in(flatten(toObject(item as any))?.[key], value), not));\n }\n\n private gtQueryByKey: QueryResolveFunc<T> = (items, query) => {\n const [_key, value] = query.split('>');\n const key = this.REVERSED_MAP?.[_key] ?? _key;\n return items.filter(item => _gt(flatten(toObject(item as any))?.[key], value));\n }\n\n private inQuery: QueryResolveFunc<T> = (items, query) => {\n return items.filter(item => Object.values(flatten(toObject(item as T))).some(value => _in(value, query)));\n }\n}\n\nconst _not = (bool: boolean, not: boolean): boolean => {\n return not ? !bool : bool;\n}\n\nconst _in = (value: any, query: string) => {\n return typeof value === 'string' ? value?.includes(query) : false;\n}\n\nconst _gt = (value: any, query: string) => {\n return typeof value === 'string' \n ? parseFloat(value) > parseFloat(query) \n : typeof value === 'number'\n ? value > parseFloat(query)\n : false;\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/common/utils/to-object/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC","sourcesContent":["export * from './to-object';"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const getAllProps = (obj, keys = Object.keys(obj)) => {
|
|
2
|
+
const proto = Object.getPrototypeOf(obj);
|
|
3
|
+
keys = Object.getOwnPropertyNames(proto)
|
|
4
|
+
.filter(v => v !== '__proto__')
|
|
5
|
+
.filter(v => Object.getOwnPropertyDescriptor(proto, v).get instanceof Function)
|
|
6
|
+
.concat(keys);
|
|
7
|
+
return proto.constructor.name === 'Object' ? keys : getAllProps(proto, keys);
|
|
8
|
+
};
|
|
9
|
+
export const toObject = (obj) => getAllProps(obj).reduce((p, k) => (Object.assign(Object.assign({}, p), { [k]: obj[k] })), {});
|
|
10
|
+
//# sourceMappingURL=to-object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-object.js","sourceRoot":"","sources":["../../../../../../libs/common/utils/to-object/to-object.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,OAAiB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAY,EAAE;IAC/E,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,GAAG,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC;SACrC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,WAAW,CAAC;SAC9B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC,CAAE,CAAC,GAAG,YAAY,QAAQ,CAAC;SAC/E,MAAM,CAAC,IAAI,CAAC,CAAC;IAEhB,OAAO,KAAK,CAAC,WAAW,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAC/E,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,iCAAK,CAAC,KAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAE,EAAE,EAAE,CAAC,CAAC","sourcesContent":["const getAllProps = (obj: object, keys: string[] = Object.keys(obj)): string[] => {\n const proto = Object.getPrototypeOf(obj);\n keys = Object.getOwnPropertyNames(proto)\n .filter(v => v !== '__proto__')\n .filter(v => Object.getOwnPropertyDescriptor(proto, v)!.get instanceof Function)\n .concat(keys);\n\n return proto.constructor.name === 'Object' ? keys : getAllProps(proto, keys);\n}\n\nexport const toObject = (obj: object): object => getAllProps(obj).reduce((p, k) => ({...p, [k]: obj[k]}), {});\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ɵɵdirectiveInject, ElementRef, ɵɵngDeclareDirective, ɵsetClassMetadata, Directive, HostListener, ɵɵdefineNgModule, ɵɵdefineInjector, ɵɵsetNgModuleScope, NgModule } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
|
|
5
|
+
class IosSafariScrollBuggyfillDirective {
|
|
6
|
+
constructor(el) {
|
|
7
|
+
this.el = el;
|
|
8
|
+
}
|
|
9
|
+
ngAfterViewInit() {
|
|
10
|
+
// this.el.nativeElement.addEventListener('touchmove', (e: Event) => {
|
|
11
|
+
// e.preventDefault();
|
|
12
|
+
// }, {passive: false});
|
|
13
|
+
}
|
|
14
|
+
onTouchmove(event) {
|
|
15
|
+
event.preventDefault();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
IosSafariScrollBuggyfillDirective.ɵfac = function IosSafariScrollBuggyfillDirective_Factory(t) { return new (t || IosSafariScrollBuggyfillDirective)(ɵɵdirectiveInject(ElementRef)); };
|
|
19
|
+
IosSafariScrollBuggyfillDirective.ɵdir = ɵɵngDeclareDirective({ version: "11.2.14", type: IosSafariScrollBuggyfillDirective, selector: "[iosSafariScrollBuggyfill]", host: { listeners: { "touchmove": "onTouchmove($event)" } }, ngImport: i0 });
|
|
20
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵsetClassMetadata(IosSafariScrollBuggyfillDirective, [{
|
|
21
|
+
type: Directive,
|
|
22
|
+
args: [{
|
|
23
|
+
selector: '[iosSafariScrollBuggyfill]'
|
|
24
|
+
}]
|
|
25
|
+
}], function () { return [{ type: ElementRef }]; }, { onTouchmove: [{
|
|
26
|
+
type: HostListener,
|
|
27
|
+
args: ['touchmove', ['$event']]
|
|
28
|
+
}] }); })();
|
|
29
|
+
|
|
30
|
+
class IosSafariScrollBuggyfillModule {
|
|
31
|
+
}
|
|
32
|
+
IosSafariScrollBuggyfillModule.ɵfac = function IosSafariScrollBuggyfillModule_Factory(t) { return new (t || IosSafariScrollBuggyfillModule)(); };
|
|
33
|
+
IosSafariScrollBuggyfillModule.ɵmod = ɵɵdefineNgModule({ type: IosSafariScrollBuggyfillModule });
|
|
34
|
+
IosSafariScrollBuggyfillModule.ɵinj = ɵɵdefineInjector({ imports: [[
|
|
35
|
+
CommonModule,
|
|
36
|
+
]] });
|
|
37
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(IosSafariScrollBuggyfillModule, { declarations: [IosSafariScrollBuggyfillDirective], imports: [CommonModule], exports: [IosSafariScrollBuggyfillDirective] }); })();
|
|
38
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵsetClassMetadata(IosSafariScrollBuggyfillModule, [{
|
|
39
|
+
type: NgModule,
|
|
40
|
+
args: [{
|
|
41
|
+
declarations: [
|
|
42
|
+
IosSafariScrollBuggyfillDirective,
|
|
43
|
+
],
|
|
44
|
+
imports: [
|
|
45
|
+
CommonModule,
|
|
46
|
+
],
|
|
47
|
+
exports: [
|
|
48
|
+
IosSafariScrollBuggyfillDirective,
|
|
49
|
+
]
|
|
50
|
+
}]
|
|
51
|
+
}], null, null); })();
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Generated bundle index. Do not edit.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
export { IosSafariScrollBuggyfillDirective, IosSafariScrollBuggyfillModule };
|
|
58
|
+
//# sourceMappingURL=ng-atomic-common-directives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-directives.js","sources":["../../../../libs/common/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.directive.ts","../../../../libs/common/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.module.ts","../../../../libs/common/directives/ng-atomic-common-directives.ts"],"sourcesContent":["import { AfterViewInit, Directive, ElementRef, HostListener } from '@angular/core';\n\n@Directive({\n selector: '[iosSafariScrollBuggyfill]'\n})\nexport class IosSafariScrollBuggyfillDirective implements AfterViewInit {\n\n constructor(private el: ElementRef) { }\n\n ngAfterViewInit(): void {\n // this.el.nativeElement.addEventListener('touchmove', (e: Event) => {\n // e.preventDefault();\n // }, {passive: false});\n }\n\n @HostListener('touchmove', ['$event'])\n onTouchmove(event: Event) {\n event.preventDefault();\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { IosSafariScrollBuggyfillDirective } from './ios-safari-scroll-buggyfill.directive';\n\n\n\n@NgModule({\n declarations: [\n IosSafariScrollBuggyfillDirective,\n ],\n imports: [\n CommonModule,\n ],\n exports: [\n IosSafariScrollBuggyfillDirective,\n ]\n})\nexport class IosSafariScrollBuggyfillModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAKa,iCAAiC;IAE5C,YAAoB,EAAc;QAAd,OAAE,GAAF,EAAE,CAAY;KAAK;IAEvC,eAAe;;;;KAId;IAGD,WAAW,CAAC,KAAY;QACtB,KAAK,CAAC,cAAc,EAAE,CAAC;KACxB;;kHAbU,iCAAiC;0FAAjC,iCAAiC;oFAAjC,iCAAiC;cAH7C,SAAS;eAAC;gBACT,QAAQ,EAAE,4BAA4B;aACvC;0DAYC,WAAW;kBADV,YAAY;mBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;;;MCE1B,8BAA8B;;4GAA9B,8BAA8B;+DAA9B,8BAA8B;mEAPhC;YACP,YAAY;SACb;qFAKU,8BAA8B,mBATvC,iCAAiC,aAGjC,YAAY,aAGZ,iCAAiC;oFAGxB,8BAA8B;cAX1C,QAAQ;eAAC;gBACR,YAAY,EAAE;oBACZ,iCAAiC;iBAClC;gBACD,OAAO,EAAE;oBACP,YAAY;iBACb;gBACD,OAAO,EAAE;oBACP,iCAAiC;iBAClC;aACF;;;AChBD;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-models.js","sources":["../../../../libs/common/models/ng-atomic-common-models.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;;"}
|