@adyen/adyen-platform-experience-web 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/components/internal/Calendar/calendar/facade/Calendar.js +221 -211
- package/dist/es/components/internal/Calendar/calendar/timeframe/frames/MonthFrame.js +103 -94
- package/dist/es/components/internal/Calendar/calendar/timeframe/frames/TimeFrame.js +201 -200
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/lastNDays.js +19 -18
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/shared/offsetMonth.js +18 -17
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/shared/offsetWeek.js +17 -20
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/yearToDate.js +9 -12
- package/dist/es/components/internal/Calendar/calendar/timerange/utils.js +39 -43
- package/dist/es/components/internal/Calendar/calendar/timeslice/TimeSlice.js +10 -10
- package/dist/es/components/internal/Calendar/calendar/timeslice/index.js +25 -26
- package/dist/es/components/internal/Calendar/calendar/utils.js +64 -16
- package/dist/es/components/internal/Calendar/hooks/useCalendar.js +40 -38
- package/dist/es/components/internal/Calendar/hooks/useTimezone.js +2 -2
- package/dist/es/components/internal/DatePicker/DatePicker.js +17 -16
- package/dist/es/components/internal/FilterBar/filters/AmountFilter/AmountFilter.js +14 -14
- package/dist/es/components/internal/FilterBar/filters/AmountFilter/RangeSelection.js +19 -17
- package/dist/es/components/internal/FilterBar/filters/DateFilter/DateFilterCore.js +81 -76
- package/dist/es/core/Http/utils.js +1 -1
- package/dist/es/core/Localization/datetime/restamper/utils.js +26 -26
- package/dist/es/core/core.js +1 -1
- package/dist/es/primitives/time/today/main.js +38 -43
- package/dist/style.css +1 -1
- package/dist/types/components/internal/Calendar/calendar/facade/Calendar.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeframe/frames/MonthFrame.d.ts +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeframe/frames/MonthFrame.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeframe/frames/TimeFrame.d.ts +3 -3
- package/dist/types/components/internal/Calendar/calendar/timeframe/frames/TimeFrame.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeframe/frames/YearFrame.d.ts +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeframe/frames/YearFrame.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timerange/presets/lastNDays.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timerange/presets/shared/offsetMonth.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timerange/presets/shared/offsetWeek.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timerange/presets/yearToDate.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timerange/utils.d.ts +0 -5
- package/dist/types/components/internal/Calendar/calendar/timerange/utils.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeslice/TimeSlice.d.ts +2 -2
- package/dist/types/components/internal/Calendar/calendar/timeslice/TimeSlice.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeslice/index.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/types.d.ts +6 -1
- package/dist/types/components/internal/Calendar/calendar/types.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/utils.d.ts +13 -4
- package/dist/types/components/internal/Calendar/calendar/utils.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/hooks/useCalendar.d.ts +1 -1
- package/dist/types/components/internal/Calendar/hooks/useCalendar.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/types.d.ts +1 -0
- package/dist/types/components/internal/Calendar/types.d.ts.map +1 -1
- package/dist/types/components/internal/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/types/components/internal/FilterBar/filters/AmountFilter/RangeSelection.d.ts.map +1 -1
- package/dist/types/components/internal/FilterBar/filters/DateFilter/DateFilterCore.d.ts.map +1 -1
- package/dist/types/core/Localization/datetime/restamper/utils.d.ts.map +1 -1
- package/dist/types/primitives/time/today/main.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -1,59 +1,60 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var rt = Object.defineProperty;
|
|
2
|
+
var ot = (r, s, t) => s in r ? rt(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
|
|
3
|
+
var Z = (r, s, t) => (ot(r, typeof s != "symbol" ? s + "" : s, t), t), $ = (r, s, t) => {
|
|
4
4
|
if (!s.has(r))
|
|
5
5
|
throw TypeError("Cannot " + t);
|
|
6
6
|
};
|
|
7
|
-
var i = (r, s, t) => (
|
|
7
|
+
var i = (r, s, t) => ($(r, s, "read from private field"), t ? t.call(r) : s.get(r)), n = (r, s, t) => {
|
|
8
8
|
if (s.has(r))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
s instanceof WeakSet ? s.add(r) : s.set(r, t);
|
|
11
|
-
},
|
|
12
|
-
var
|
|
13
|
-
import
|
|
14
|
-
import { getWeekendDays as
|
|
15
|
-
import { getEdgesDistance as
|
|
16
|
-
import { DAY_OF_WEEK_FORMATS as
|
|
17
|
-
import
|
|
18
|
-
import { TimeFlag as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
}, u = (r, s, t, e) => ($(r, s, "write to private field"), e ? e.call(r, t) : s.set(r, t), t);
|
|
12
|
+
var c = (r, s, t) => ($(r, s, "access private method"), t);
|
|
13
|
+
import nt from "./TimeFrame.js";
|
|
14
|
+
import { getWeekendDays as X } from "../common/utils.js";
|
|
15
|
+
import { getEdgesDistance as j, withTimezone as q, getTimezoneDateParts as k, computeTimestampOffset as mt, getMonthDays as b, startOfMonth as at, startOfWeek as ht } from "../../utils.js";
|
|
16
|
+
import { DAY_OF_WEEK_FORMATS as ft, MAXIMUM_MONTH_UNITS as J, DAY_MS as Q } from "../../constants.js";
|
|
17
|
+
import ct from "../common/flags.js";
|
|
18
|
+
import { TimeFlag as m } from "../../types.js";
|
|
19
|
+
import { timezoneToSystem as V, systemToTimezone as tt } from "../../../../../../core/Localization/datetime/restamper/utils.js";
|
|
20
|
+
import { isUndefined as lt, isString as gt } from "../../../../../../utils/value/is.js";
|
|
21
|
+
import { isInfinity as ut, isBitSafeInteger as pt } from "../../../../../../utils/value/number.js";
|
|
22
|
+
import { enumerable as K } from "../../../../../../utils/struct/property.js";
|
|
23
|
+
import { struct as _, withFreezeProxyHandlers as Tt, structFrom as dt } from "../../../../../../utils/struct/main.js";
|
|
24
|
+
var y, D, S, M, E, O, R, F, H, N, B, W, L, Y, w, P, T, I, z, v;
|
|
25
|
+
class At extends nt {
|
|
25
26
|
constructor() {
|
|
26
27
|
super();
|
|
27
|
-
n(this,
|
|
28
|
-
n(this,
|
|
29
|
-
n(this,
|
|
30
|
-
n(this,
|
|
31
|
-
n(this,
|
|
32
|
-
n(this,
|
|
28
|
+
n(this, L);
|
|
29
|
+
n(this, w);
|
|
30
|
+
n(this, T);
|
|
31
|
+
n(this, z);
|
|
32
|
+
n(this, y, 7);
|
|
33
|
+
n(this, D, []);
|
|
34
|
+
n(this, S, X(this.firstWeekDay));
|
|
35
|
+
n(this, M, void 0);
|
|
36
|
+
n(this, E, -1 / 0);
|
|
37
|
+
n(this, O, 1 / 0);
|
|
38
|
+
n(this, R, 1 / 0);
|
|
39
|
+
n(this, F, void 0);
|
|
40
|
+
n(this, H, void 0);
|
|
33
41
|
n(this, N, void 0);
|
|
34
|
-
n(this,
|
|
35
|
-
n(this, I, 1 / 0);
|
|
36
|
-
n(this, B, 1 / 0);
|
|
37
|
-
n(this, A, void 0);
|
|
42
|
+
n(this, B, void 0);
|
|
38
43
|
n(this, W, void 0);
|
|
39
|
-
|
|
40
|
-
n(this, k, void 0);
|
|
41
|
-
n(this, S, void 0);
|
|
42
|
-
n(this, E, void 0);
|
|
43
|
-
P(this, "daysInWeek", i(this, u));
|
|
44
|
+
Z(this, "daysInWeek", i(this, y));
|
|
44
45
|
this.initialize();
|
|
45
46
|
}
|
|
46
47
|
get fromTimestamp() {
|
|
47
|
-
return i(this,
|
|
48
|
+
return i(this, E);
|
|
48
49
|
}
|
|
49
50
|
get toTimestamp() {
|
|
50
|
-
return i(this,
|
|
51
|
+
return i(this, O);
|
|
51
52
|
}
|
|
52
53
|
get numberOfBlocks() {
|
|
53
|
-
return i(this,
|
|
54
|
+
return i(this, R);
|
|
54
55
|
}
|
|
55
56
|
get currentDayTimestamp() {
|
|
56
|
-
return i(this,
|
|
57
|
+
return i(this, M);
|
|
57
58
|
}
|
|
58
59
|
get dynamicBlockHeight() {
|
|
59
60
|
return super.dynamicBlockHeight;
|
|
@@ -63,71 +64,73 @@ class St extends tt {
|
|
|
63
64
|
super.dynamicBlockHeight = t, this.dynamicBlockHeight !== e && this.refreshFrame(!0);
|
|
64
65
|
}
|
|
65
66
|
get rowspan() {
|
|
66
|
-
return i(this,
|
|
67
|
+
return i(this, y);
|
|
67
68
|
}
|
|
68
69
|
get firstWeekDay() {
|
|
69
70
|
return super.firstWeekDay;
|
|
70
71
|
}
|
|
71
72
|
set firstWeekDay(t) {
|
|
72
73
|
const e = this.firstWeekDay;
|
|
73
|
-
super.firstWeekDay = t, this.firstWeekDay !== e && (i(this,
|
|
74
|
+
super.firstWeekDay = t, this.firstWeekDay !== e && (i(this, D).length = 0, u(this, S, X(this.firstWeekDay)), this.reoriginate(), this.refreshFrame());
|
|
74
75
|
}
|
|
75
76
|
getCursorBlockOriginTimestampOffset(t) {
|
|
76
|
-
return
|
|
77
|
+
return k(t, this.timezone)[2] - 1;
|
|
77
78
|
}
|
|
78
79
|
getDayOfWeekAtIndex(t) {
|
|
79
|
-
if (!i(this,
|
|
80
|
+
if (!i(this, D)[t]) {
|
|
80
81
|
const e = new Date(this.getTimestampAtIndex(t));
|
|
81
|
-
let
|
|
82
|
-
i(this,
|
|
83
|
-
const
|
|
84
|
-
for (const
|
|
85
|
-
|
|
86
|
-
weekday:
|
|
82
|
+
let o = 0;
|
|
83
|
+
i(this, S).includes(t) && (o |= m.WEEKEND), t === 0 ? o |= m.LINE_START : t === 6 && (o |= m.LINE_END);
|
|
84
|
+
const l = {};
|
|
85
|
+
for (const f of ft)
|
|
86
|
+
l[f] = K(e.toLocaleDateString(this.locale, {
|
|
87
|
+
weekday: f,
|
|
88
|
+
timeZone: this.timezone
|
|
87
89
|
}));
|
|
88
|
-
i(this,
|
|
89
|
-
flags:
|
|
90
|
-
labels:
|
|
90
|
+
i(this, D)[t] = _({
|
|
91
|
+
flags: K(ct(o)),
|
|
92
|
+
labels: K(_(l))
|
|
91
93
|
});
|
|
92
94
|
}
|
|
93
|
-
return i(this,
|
|
95
|
+
return i(this, D)[t];
|
|
94
96
|
}
|
|
95
97
|
getEdgeBlockOffsetsFromOrigin() {
|
|
96
|
-
return [
|
|
98
|
+
return [c(this, L, Y).call(this, i(this, E)), c(this, L, Y).call(this, i(this, O))];
|
|
97
99
|
}
|
|
98
100
|
getFormattedDataForBlockCell(t) {
|
|
99
|
-
const e =
|
|
100
|
-
return [Number(
|
|
101
|
+
const [e, o, l] = k(t, this.timezone);
|
|
102
|
+
return [Number(l).toLocaleString(this.locale), `${e}-${`${o + 1}`.padStart(2, "0")}-${`${l}`.padStart(2, "0")}`];
|
|
101
103
|
}
|
|
102
104
|
getFormattedDataForFrameBlock(t) {
|
|
103
|
-
const e =
|
|
104
|
-
return [
|
|
105
|
+
const [e, o] = k(t, this.timezone);
|
|
106
|
+
return [new Date(t).toLocaleDateString(this.locale, {
|
|
105
107
|
month: "long",
|
|
106
|
-
year: "numeric"
|
|
107
|
-
|
|
108
|
+
year: "numeric",
|
|
109
|
+
timeZone: this.timezone
|
|
110
|
+
}), `${e}-${`${o + 1}`.padStart(2, "0")}`];
|
|
108
111
|
}
|
|
109
112
|
getFrameBlockAtIndex(t) {
|
|
110
|
-
const [e,
|
|
111
|
-
get: (
|
|
112
|
-
if (
|
|
113
|
-
const
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
116
|
-
let
|
|
117
|
-
return
|
|
113
|
+
const [e, o, l] = b(this.origin, i(this, N), t), f = t > 0 ? this.getFrameBlockAtIndex(t - 1).inner.to + 1 : i(this, F), a = f + e - 1, g = Math.floor(f / 7) * 7, A = this.dynamicBlockHeight ? Math.ceil((a + 1) / 7) * 7 : g + J, G = this.dynamicBlockHeight ? A - g : J, et = new Proxy(_(), Tt({
|
|
114
|
+
get: (it, x, st) => {
|
|
115
|
+
if (gt(x)) {
|
|
116
|
+
const C = +x;
|
|
117
|
+
if (pt(C) && C >= 0 && C < G) {
|
|
118
|
+
const d = g + C, p = this.getTimestampAtIndex(d), U = d % i(this, y);
|
|
119
|
+
let h = p === this.currentDayTimestamp ? m.CURRENT : 0;
|
|
120
|
+
return d === this.cursor && (h |= m.CURSOR), i(this, S).includes(U) && (h |= m.WEEKEND), U === 0 ? h |= m.LINE_START : U === i(this, y) - 1 && (h |= m.LINE_END), d >= f && d <= a && (d === f ? h |= m.BLOCK_START : d === a && (h |= m.BLOCK_END), h |= m.WITHIN_BLOCK), p >= this.fromTimestamp && p <= this.toTimestamp && (p === this.fromTimestamp && (h |= m.RANGE_START), p === this.toTimestamp && (h |= m.RANGE_END), h |= m.WITHIN_RANGE), p >= i(this, B) && p <= i(this, W) && (p === i(this, B) && (h |= m.SELECTION_START), p === i(this, W) && (h |= m.SELECTION_END), h |= m.WITHIN_SELECTION), [p, h];
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
|
-
return Reflect.get(
|
|
123
|
+
return Reflect.get(it, x, st);
|
|
121
124
|
}
|
|
122
125
|
}));
|
|
123
|
-
return
|
|
126
|
+
return dt(et, {
|
|
124
127
|
inner: {
|
|
125
|
-
value:
|
|
128
|
+
value: _({
|
|
126
129
|
from: {
|
|
127
|
-
value:
|
|
130
|
+
value: f
|
|
128
131
|
},
|
|
129
132
|
to: {
|
|
130
|
-
value:
|
|
133
|
+
value: a
|
|
131
134
|
},
|
|
132
135
|
units: {
|
|
133
136
|
value: e
|
|
@@ -135,15 +138,15 @@ class St extends tt {
|
|
|
135
138
|
})
|
|
136
139
|
},
|
|
137
140
|
month: {
|
|
138
|
-
value:
|
|
141
|
+
value: o
|
|
139
142
|
},
|
|
140
143
|
outer: {
|
|
141
|
-
value:
|
|
144
|
+
value: _({
|
|
142
145
|
from: {
|
|
143
|
-
value:
|
|
146
|
+
value: g
|
|
144
147
|
},
|
|
145
148
|
to: {
|
|
146
|
-
value:
|
|
149
|
+
value: A - 1
|
|
147
150
|
},
|
|
148
151
|
units: {
|
|
149
152
|
value: G
|
|
@@ -151,47 +154,53 @@ class St extends tt {
|
|
|
151
154
|
})
|
|
152
155
|
},
|
|
153
156
|
year: {
|
|
154
|
-
value:
|
|
157
|
+
value: l
|
|
155
158
|
}
|
|
156
159
|
});
|
|
157
160
|
}
|
|
158
161
|
getUnitsForFrameBlockAtIndex(t) {
|
|
159
|
-
return
|
|
162
|
+
return b(this.origin, i(this, N), t)[0];
|
|
160
163
|
}
|
|
161
164
|
getUnitsOffsetForTimestamp(t, e) {
|
|
162
|
-
return Math.round((e - t) /
|
|
165
|
+
return Math.round((e - t) / Q);
|
|
163
166
|
}
|
|
164
167
|
reoriginate() {
|
|
165
|
-
|
|
166
|
-
|
|
168
|
+
this.originTimestamp = at(this.originTimestamp, this.timezone);
|
|
169
|
+
const [t, e] = k(this.originTimestamp, this.timezone), o = ht(this.originTimestamp, this.timezone, this.firstWeekDay);
|
|
170
|
+
this.origin = e, u(this, N, t), u(this, F, this.getUnitsOffsetForTimestamp(o, this.originTimestamp)), u(this, H, c(this, w, P).call(this, this.originTimestamp, -i(this, F)));
|
|
167
171
|
}
|
|
168
172
|
reslice() {
|
|
169
|
-
|
|
173
|
+
c(this, z, v).call(this), u(this, E, c(this, T, I).call(this, super.fromTimestamp)), u(this, O, c(this, T, I).call(this, super.toTimestamp)), u(this, R, j(super.fromTimestamp, super.toTimestamp, this.timezone) + 1);
|
|
170
174
|
}
|
|
171
175
|
shiftOrigin(t) {
|
|
172
|
-
|
|
176
|
+
const [e, o] = k(this.originTimestamp, this.timezone), [, l, f] = b(o, e, t), a = q(this.timezone), g = new Date(V(a, this.originTimestamp)).setFullYear(f, l);
|
|
177
|
+
this.originTimestamp = tt(a, g), this.reoriginate();
|
|
173
178
|
}
|
|
174
179
|
clearSelection() {
|
|
175
|
-
super.clearSelection(),
|
|
180
|
+
super.clearSelection(), c(this, z, v).call(this), this.refreshFrame(!0);
|
|
176
181
|
}
|
|
177
182
|
getTimestampAtIndex(t) {
|
|
178
|
-
return
|
|
183
|
+
return c(this, w, P).call(this, i(this, H), t);
|
|
179
184
|
}
|
|
180
185
|
updateSelection(t, e) {
|
|
181
|
-
super.updateSelection(t, e),
|
|
186
|
+
super.updateSelection(t, e), c(this, z, v).call(this), this.refreshFrame(!0);
|
|
182
187
|
}
|
|
183
|
-
withCurrentDayTimestamp(
|
|
184
|
-
|
|
188
|
+
withCurrentDayTimestamp() {
|
|
189
|
+
u(this, M, c(this, T, I).call(this, Date.now()));
|
|
185
190
|
}
|
|
186
191
|
}
|
|
187
|
-
|
|
188
|
-
const e =
|
|
192
|
+
y = new WeakMap(), D = new WeakMap(), S = new WeakMap(), M = new WeakMap(), E = new WeakMap(), O = new WeakMap(), R = new WeakMap(), F = new WeakMap(), H = new WeakMap(), N = new WeakMap(), B = new WeakMap(), W = new WeakMap(), L = new WeakSet(), Y = function(t) {
|
|
193
|
+
const e = j(t, this.originTimestamp, this.timezone);
|
|
189
194
|
return t < this.originTimestamp ? 0 - e : e;
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
195
|
+
}, w = new WeakSet(), P = function(t, e = 0) {
|
|
196
|
+
const o = q(this.timezone), l = V(o, t), f = tt(o, l + e * Q);
|
|
197
|
+
let [, , , a, g] = k(f, this.timezone), A = 0;
|
|
198
|
+
return (a > 0 || g > 0) && (a = (a > 12 ? 24 : 0) - a, g = (a > 1 ? 1 : -1) * g, A = a * 36e5 + g * 6e4), f + A;
|
|
199
|
+
}, T = new WeakSet(), I = function(t) {
|
|
200
|
+
return lt(t) || ut(t) ? t : t - mt(t, this.timezone);
|
|
201
|
+
}, z = new WeakSet(), v = function() {
|
|
202
|
+
u(this, B, c(this, T, I).call(this, this.selectionStart)), u(this, W, c(this, T, I).call(this, this.selectionEnd));
|
|
194
203
|
};
|
|
195
204
|
export {
|
|
196
|
-
|
|
205
|
+
At as default
|
|
197
206
|
};
|