@cleartrip/ct-design-horizontal-scroll 1.1.0
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/ct-design-horizontal-scroll.browser.cjs.js +2 -0
- package/dist/ct-design-horizontal-scroll.browser.cjs.js.map +1 -0
- package/dist/ct-design-horizontal-scroll.browser.esm.js +2 -0
- package/dist/ct-design-horizontal-scroll.browser.esm.js.map +1 -0
- package/dist/ct-design-horizontal-scroll.cjs.js +131 -0
- package/dist/ct-design-horizontal-scroll.cjs.js.map +1 -0
- package/dist/ct-design-horizontal-scroll.esm.js +123 -0
- package/dist/ct-design-horizontal-scroll.esm.js.map +1 -0
- package/dist/ct-design-horizontal-scroll.umd.js +1016 -0
- package/dist/ct-design-horizontal-scroll.umd.js.map +1 -0
- package/dist/src/HorizontalScroll.d.ts +5 -0
- package/dist/src/HorizontalScroll.d.ts.map +1 -0
- package/dist/src/StyledHorizontalScroll/StyledHorizontalScroll.d.ts +3 -0
- package/dist/src/StyledHorizontalScroll/StyledHorizontalScroll.d.ts.map +1 -0
- package/dist/src/StyledHorizontalScroll/index.d.ts +2 -0
- package/dist/src/StyledHorizontalScroll/index.d.ts.map +1 -0
- package/dist/src/StyledLeftShadow/StyledLeftShadow.d.ts +8 -0
- package/dist/src/StyledLeftShadow/StyledLeftShadow.d.ts.map +1 -0
- package/dist/src/StyledLeftShadow/index.d.ts +2 -0
- package/dist/src/StyledLeftShadow/index.d.ts.map +1 -0
- package/dist/src/StyledRightShadow/StyledRightShadow.d.ts +8 -0
- package/dist/src/StyledRightShadow/StyledRightShadow.d.ts.map +1 -0
- package/dist/src/StyledRightShadow/index.d.ts +2 -0
- package/dist/src/StyledRightShadow/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/type.d.ts +30 -0
- package/dist/src/type.d.ts.map +1 -0
- package/dist/stats.html +4838 -0
- package/dist/stories/HorizontalScroll.stories.d.ts +6 -0
- package/dist/stories/HorizontalScroll.stories.d.ts.map +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,1016 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('@cleartrip/ct-design-container'), require('styled-components'), require('@cleartrip/ct-design-use-theme'), require('@cleartrip/ct-design-icons')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', '@cleartrip/ct-design-container', 'styled-components', '@cleartrip/ct-design-use-theme', '@cleartrip/ct-design-icons'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CTDesignSystemHorizontalScroll = {}, global.jsxRuntime, global.React, global.ctDesignContainer, global.styled, global.useTheme, global.ctDesignIcons));
|
|
5
|
+
})(this, (function (exports, jsxRuntime, react, ctDesignContainer, styled, useTheme, ctDesignIcons) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
10
|
+
var useTheme__default = /*#__PURE__*/_interopDefault(useTheme);
|
|
11
|
+
|
|
12
|
+
/******************************************************************************
|
|
13
|
+
Copyright (c) Microsoft Corporation.
|
|
14
|
+
|
|
15
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
16
|
+
purpose with or without fee is hereby granted.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
19
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
20
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
21
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
22
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
23
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
24
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
25
|
+
***************************************************************************** */
|
|
26
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
27
|
+
|
|
28
|
+
var __assign = function () {
|
|
29
|
+
__assign = Object.assign || function __assign(t) {
|
|
30
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
31
|
+
s = arguments[i];
|
|
32
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
return __assign.apply(this, arguments);
|
|
37
|
+
};
|
|
38
|
+
function __makeTemplateObject(cooked, raw) {
|
|
39
|
+
if (Object.defineProperty) {
|
|
40
|
+
Object.defineProperty(cooked, "raw", {
|
|
41
|
+
value: raw
|
|
42
|
+
});
|
|
43
|
+
} else {
|
|
44
|
+
cooked.raw = raw;
|
|
45
|
+
}
|
|
46
|
+
return cooked;
|
|
47
|
+
}
|
|
48
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
49
|
+
var e = new Error(message);
|
|
50
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
var StyledRightShadow = styled__default.default.div(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n position: absolute;\n right: 0;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n height: 100%;\n width: ", ";\n z-index: 10px;\n background: ", ";\n"], ["\n position: absolute;\n right: 0;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n height: 100%;\n width: ", ";\n z-index: 10px;\n background: ", ";\n"])), function (_a) {
|
|
54
|
+
var width = _a.width;
|
|
55
|
+
return width || '64px';
|
|
56
|
+
}, function (_a) {
|
|
57
|
+
var shadowGradientStyle = _a.shadowGradientStyle;
|
|
58
|
+
return (shadowGradientStyle === null || shadowGradientStyle === void 0 ? void 0 : shadowGradientStyle.right) || "linear-gradient(270deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%)";
|
|
59
|
+
});
|
|
60
|
+
var templateObject_1$2;
|
|
61
|
+
|
|
62
|
+
var StyledLeftShadow = styled__default.default.div(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n height: 100%;\n width: ", ";\n z-index: 10px;\n background: ", ";\n"], ["\n position: absolute;\n left: 0;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n height: 100%;\n width: ", ";\n z-index: 10px;\n background: ", ";\n"])), function (_a) {
|
|
63
|
+
var width = _a.width;
|
|
64
|
+
return width || '64px';
|
|
65
|
+
}, function (_a) {
|
|
66
|
+
var shadowGradientStyle = _a.shadowGradientStyle;
|
|
67
|
+
return (shadowGradientStyle === null || shadowGradientStyle === void 0 ? void 0 : shadowGradientStyle.left) || "linear-gradient(90deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%)";
|
|
68
|
+
});
|
|
69
|
+
var templateObject_1$1;
|
|
70
|
+
|
|
71
|
+
var StyledHorizontalScroll = styled__default.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n white-space: no-wrap;\n overflow-x: auto;\n scroll-behavior: smooth;\n -webkit-tap-highlight-color: transparent;\n scrollbar-width: none; /* Firefox */\n -ms-overflow-style: none; /* Internet Explorer 10+ */\n\n &::-webkit-scrollbar {\n /* WebKit */\n display: none;\n }\n"], ["\n display: flex;\n white-space: no-wrap;\n overflow-x: auto;\n scroll-behavior: smooth;\n -webkit-tap-highlight-color: transparent;\n scrollbar-width: none; /* Firefox */\n -ms-overflow-style: none; /* Internet Explorer 10+ */\n\n &::-webkit-scrollbar {\n /* WebKit */\n display: none;\n }\n"])));
|
|
72
|
+
var templateObject_1;
|
|
73
|
+
|
|
74
|
+
var dayjs_minExports = {};
|
|
75
|
+
var dayjs_min = {
|
|
76
|
+
get exports(){ return dayjs_minExports; },
|
|
77
|
+
set exports(v){ dayjs_minExports = v; },
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
(function (module, exports) {
|
|
81
|
+
!function (t, e) {
|
|
82
|
+
module.exports = e() ;
|
|
83
|
+
}(this, function () {
|
|
84
|
+
|
|
85
|
+
var t = 1e3,
|
|
86
|
+
e = 6e4,
|
|
87
|
+
n = 36e5,
|
|
88
|
+
r = "millisecond",
|
|
89
|
+
i = "second",
|
|
90
|
+
s = "minute",
|
|
91
|
+
u = "hour",
|
|
92
|
+
a = "day",
|
|
93
|
+
o = "week",
|
|
94
|
+
c = "month",
|
|
95
|
+
f = "quarter",
|
|
96
|
+
h = "year",
|
|
97
|
+
d = "date",
|
|
98
|
+
l = "Invalid Date",
|
|
99
|
+
$ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
|
|
100
|
+
y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,
|
|
101
|
+
M = {
|
|
102
|
+
name: "en",
|
|
103
|
+
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
104
|
+
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
|
|
105
|
+
ordinal: function (t) {
|
|
106
|
+
var e = ["th", "st", "nd", "rd"],
|
|
107
|
+
n = t % 100;
|
|
108
|
+
return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]";
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
m = function (t, e, n) {
|
|
112
|
+
var r = String(t);
|
|
113
|
+
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
|
|
114
|
+
},
|
|
115
|
+
v = {
|
|
116
|
+
s: m,
|
|
117
|
+
z: function (t) {
|
|
118
|
+
var e = -t.utcOffset(),
|
|
119
|
+
n = Math.abs(e),
|
|
120
|
+
r = Math.floor(n / 60),
|
|
121
|
+
i = n % 60;
|
|
122
|
+
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
|
|
123
|
+
},
|
|
124
|
+
m: function t(e, n) {
|
|
125
|
+
if (e.date() < n.date()) return -t(n, e);
|
|
126
|
+
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),
|
|
127
|
+
i = e.clone().add(r, c),
|
|
128
|
+
s = n - i < 0,
|
|
129
|
+
u = e.clone().add(r + (s ? -1 : 1), c);
|
|
130
|
+
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
|
|
131
|
+
},
|
|
132
|
+
a: function (t) {
|
|
133
|
+
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
|
|
134
|
+
},
|
|
135
|
+
p: function (t) {
|
|
136
|
+
return {
|
|
137
|
+
M: c,
|
|
138
|
+
y: h,
|
|
139
|
+
w: o,
|
|
140
|
+
d: a,
|
|
141
|
+
D: d,
|
|
142
|
+
h: u,
|
|
143
|
+
m: s,
|
|
144
|
+
s: i,
|
|
145
|
+
ms: r,
|
|
146
|
+
Q: f
|
|
147
|
+
}[t] || String(t || "").toLowerCase().replace(/s$/, "");
|
|
148
|
+
},
|
|
149
|
+
u: function (t) {
|
|
150
|
+
return void 0 === t;
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
g = "en",
|
|
154
|
+
D = {};
|
|
155
|
+
D[g] = M;
|
|
156
|
+
var p = "$isDayjsObject",
|
|
157
|
+
S = function (t) {
|
|
158
|
+
return t instanceof _ || !(!t || !t[p]);
|
|
159
|
+
},
|
|
160
|
+
w = function t(e, n, r) {
|
|
161
|
+
var i;
|
|
162
|
+
if (!e) return g;
|
|
163
|
+
if ("string" == typeof e) {
|
|
164
|
+
var s = e.toLowerCase();
|
|
165
|
+
D[s] && (i = s), n && (D[s] = n, i = s);
|
|
166
|
+
var u = e.split("-");
|
|
167
|
+
if (!i && u.length > 1) return t(u[0]);
|
|
168
|
+
} else {
|
|
169
|
+
var a = e.name;
|
|
170
|
+
D[a] = e, i = a;
|
|
171
|
+
}
|
|
172
|
+
return !r && i && (g = i), i || !r && g;
|
|
173
|
+
},
|
|
174
|
+
O = function (t, e) {
|
|
175
|
+
if (S(t)) return t.clone();
|
|
176
|
+
var n = "object" == typeof e ? e : {};
|
|
177
|
+
return n.date = t, n.args = arguments, new _(n);
|
|
178
|
+
},
|
|
179
|
+
b = v;
|
|
180
|
+
b.l = w, b.i = S, b.w = function (t, e) {
|
|
181
|
+
return O(t, {
|
|
182
|
+
locale: e.$L,
|
|
183
|
+
utc: e.$u,
|
|
184
|
+
x: e.$x,
|
|
185
|
+
$offset: e.$offset
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
var _ = function () {
|
|
189
|
+
function M(t) {
|
|
190
|
+
this.$L = w(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[p] = !0;
|
|
191
|
+
}
|
|
192
|
+
var m = M.prototype;
|
|
193
|
+
return m.parse = function (t) {
|
|
194
|
+
this.$d = function (t) {
|
|
195
|
+
var e = t.date,
|
|
196
|
+
n = t.utc;
|
|
197
|
+
if (null === e) return new Date(NaN);
|
|
198
|
+
if (b.u(e)) return new Date();
|
|
199
|
+
if (e instanceof Date) return new Date(e);
|
|
200
|
+
if ("string" == typeof e && !/Z$/i.test(e)) {
|
|
201
|
+
var r = e.match($);
|
|
202
|
+
if (r) {
|
|
203
|
+
var i = r[2] - 1 || 0,
|
|
204
|
+
s = (r[7] || "0").substring(0, 3);
|
|
205
|
+
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return new Date(e);
|
|
209
|
+
}(t), this.init();
|
|
210
|
+
}, m.init = function () {
|
|
211
|
+
var t = this.$d;
|
|
212
|
+
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
|
|
213
|
+
}, m.$utils = function () {
|
|
214
|
+
return b;
|
|
215
|
+
}, m.isValid = function () {
|
|
216
|
+
return !(this.$d.toString() === l);
|
|
217
|
+
}, m.isSame = function (t, e) {
|
|
218
|
+
var n = O(t);
|
|
219
|
+
return this.startOf(e) <= n && n <= this.endOf(e);
|
|
220
|
+
}, m.isAfter = function (t, e) {
|
|
221
|
+
return O(t) < this.startOf(e);
|
|
222
|
+
}, m.isBefore = function (t, e) {
|
|
223
|
+
return this.endOf(e) < O(t);
|
|
224
|
+
}, m.$g = function (t, e, n) {
|
|
225
|
+
return b.u(t) ? this[e] : this.set(n, t);
|
|
226
|
+
}, m.unix = function () {
|
|
227
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
228
|
+
}, m.valueOf = function () {
|
|
229
|
+
return this.$d.getTime();
|
|
230
|
+
}, m.startOf = function (t, e) {
|
|
231
|
+
var n = this,
|
|
232
|
+
r = !!b.u(e) || e,
|
|
233
|
+
f = b.p(t),
|
|
234
|
+
l = function (t, e) {
|
|
235
|
+
var i = b.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
|
|
236
|
+
return r ? i : i.endOf(a);
|
|
237
|
+
},
|
|
238
|
+
$ = function (t, e) {
|
|
239
|
+
return b.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n);
|
|
240
|
+
},
|
|
241
|
+
y = this.$W,
|
|
242
|
+
M = this.$M,
|
|
243
|
+
m = this.$D,
|
|
244
|
+
v = "set" + (this.$u ? "UTC" : "");
|
|
245
|
+
switch (f) {
|
|
246
|
+
case h:
|
|
247
|
+
return r ? l(1, 0) : l(31, 11);
|
|
248
|
+
case c:
|
|
249
|
+
return r ? l(1, M) : l(0, M + 1);
|
|
250
|
+
case o:
|
|
251
|
+
var g = this.$locale().weekStart || 0,
|
|
252
|
+
D = (y < g ? y + 7 : y) - g;
|
|
253
|
+
return l(r ? m - D : m + (6 - D), M);
|
|
254
|
+
case a:
|
|
255
|
+
case d:
|
|
256
|
+
return $(v + "Hours", 0);
|
|
257
|
+
case u:
|
|
258
|
+
return $(v + "Minutes", 1);
|
|
259
|
+
case s:
|
|
260
|
+
return $(v + "Seconds", 2);
|
|
261
|
+
case i:
|
|
262
|
+
return $(v + "Milliseconds", 3);
|
|
263
|
+
default:
|
|
264
|
+
return this.clone();
|
|
265
|
+
}
|
|
266
|
+
}, m.endOf = function (t) {
|
|
267
|
+
return this.startOf(t, !1);
|
|
268
|
+
}, m.$set = function (t, e) {
|
|
269
|
+
var n,
|
|
270
|
+
o = b.p(t),
|
|
271
|
+
f = "set" + (this.$u ? "UTC" : ""),
|
|
272
|
+
l = (n = {}, n[a] = f + "Date", n[d] = f + "Date", n[c] = f + "Month", n[h] = f + "FullYear", n[u] = f + "Hours", n[s] = f + "Minutes", n[i] = f + "Seconds", n[r] = f + "Milliseconds", n)[o],
|
|
273
|
+
$ = o === a ? this.$D + (e - this.$W) : e;
|
|
274
|
+
if (o === c || o === h) {
|
|
275
|
+
var y = this.clone().set(d, 1);
|
|
276
|
+
y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
|
|
277
|
+
} else l && this.$d[l]($);
|
|
278
|
+
return this.init(), this;
|
|
279
|
+
}, m.set = function (t, e) {
|
|
280
|
+
return this.clone().$set(t, e);
|
|
281
|
+
}, m.get = function (t) {
|
|
282
|
+
return this[b.p(t)]();
|
|
283
|
+
}, m.add = function (r, f) {
|
|
284
|
+
var d,
|
|
285
|
+
l = this;
|
|
286
|
+
r = Number(r);
|
|
287
|
+
var $ = b.p(f),
|
|
288
|
+
y = function (t) {
|
|
289
|
+
var e = O(l);
|
|
290
|
+
return b.w(e.date(e.date() + Math.round(t * r)), l);
|
|
291
|
+
};
|
|
292
|
+
if ($ === c) return this.set(c, this.$M + r);
|
|
293
|
+
if ($ === h) return this.set(h, this.$y + r);
|
|
294
|
+
if ($ === a) return y(1);
|
|
295
|
+
if ($ === o) return y(7);
|
|
296
|
+
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1,
|
|
297
|
+
m = this.$d.getTime() + r * M;
|
|
298
|
+
return b.w(m, this);
|
|
299
|
+
}, m.subtract = function (t, e) {
|
|
300
|
+
return this.add(-1 * t, e);
|
|
301
|
+
}, m.format = function (t) {
|
|
302
|
+
var e = this,
|
|
303
|
+
n = this.$locale();
|
|
304
|
+
if (!this.isValid()) return n.invalidDate || l;
|
|
305
|
+
var r = t || "YYYY-MM-DDTHH:mm:ssZ",
|
|
306
|
+
i = b.z(this),
|
|
307
|
+
s = this.$H,
|
|
308
|
+
u = this.$m,
|
|
309
|
+
a = this.$M,
|
|
310
|
+
o = n.weekdays,
|
|
311
|
+
c = n.months,
|
|
312
|
+
f = n.meridiem,
|
|
313
|
+
h = function (t, n, i, s) {
|
|
314
|
+
return t && (t[n] || t(e, r)) || i[n].slice(0, s);
|
|
315
|
+
},
|
|
316
|
+
d = function (t) {
|
|
317
|
+
return b.s(s % 12 || 12, t, "0");
|
|
318
|
+
},
|
|
319
|
+
$ = f || function (t, e, n) {
|
|
320
|
+
var r = t < 12 ? "AM" : "PM";
|
|
321
|
+
return n ? r.toLowerCase() : r;
|
|
322
|
+
};
|
|
323
|
+
return r.replace(y, function (t, r) {
|
|
324
|
+
return r || function (t) {
|
|
325
|
+
switch (t) {
|
|
326
|
+
case "YY":
|
|
327
|
+
return String(e.$y).slice(-2);
|
|
328
|
+
case "YYYY":
|
|
329
|
+
return b.s(e.$y, 4, "0");
|
|
330
|
+
case "M":
|
|
331
|
+
return a + 1;
|
|
332
|
+
case "MM":
|
|
333
|
+
return b.s(a + 1, 2, "0");
|
|
334
|
+
case "MMM":
|
|
335
|
+
return h(n.monthsShort, a, c, 3);
|
|
336
|
+
case "MMMM":
|
|
337
|
+
return h(c, a);
|
|
338
|
+
case "D":
|
|
339
|
+
return e.$D;
|
|
340
|
+
case "DD":
|
|
341
|
+
return b.s(e.$D, 2, "0");
|
|
342
|
+
case "d":
|
|
343
|
+
return String(e.$W);
|
|
344
|
+
case "dd":
|
|
345
|
+
return h(n.weekdaysMin, e.$W, o, 2);
|
|
346
|
+
case "ddd":
|
|
347
|
+
return h(n.weekdaysShort, e.$W, o, 3);
|
|
348
|
+
case "dddd":
|
|
349
|
+
return o[e.$W];
|
|
350
|
+
case "H":
|
|
351
|
+
return String(s);
|
|
352
|
+
case "HH":
|
|
353
|
+
return b.s(s, 2, "0");
|
|
354
|
+
case "h":
|
|
355
|
+
return d(1);
|
|
356
|
+
case "hh":
|
|
357
|
+
return d(2);
|
|
358
|
+
case "a":
|
|
359
|
+
return $(s, u, !0);
|
|
360
|
+
case "A":
|
|
361
|
+
return $(s, u, !1);
|
|
362
|
+
case "m":
|
|
363
|
+
return String(u);
|
|
364
|
+
case "mm":
|
|
365
|
+
return b.s(u, 2, "0");
|
|
366
|
+
case "s":
|
|
367
|
+
return String(e.$s);
|
|
368
|
+
case "ss":
|
|
369
|
+
return b.s(e.$s, 2, "0");
|
|
370
|
+
case "SSS":
|
|
371
|
+
return b.s(e.$ms, 3, "0");
|
|
372
|
+
case "Z":
|
|
373
|
+
return i;
|
|
374
|
+
}
|
|
375
|
+
return null;
|
|
376
|
+
}(t) || i.replace(":", "");
|
|
377
|
+
});
|
|
378
|
+
}, m.utcOffset = function () {
|
|
379
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
380
|
+
}, m.diff = function (r, d, l) {
|
|
381
|
+
var $,
|
|
382
|
+
y = this,
|
|
383
|
+
M = b.p(d),
|
|
384
|
+
m = O(r),
|
|
385
|
+
v = (m.utcOffset() - this.utcOffset()) * e,
|
|
386
|
+
g = this - m,
|
|
387
|
+
D = function () {
|
|
388
|
+
return b.m(y, m);
|
|
389
|
+
};
|
|
390
|
+
switch (M) {
|
|
391
|
+
case h:
|
|
392
|
+
$ = D() / 12;
|
|
393
|
+
break;
|
|
394
|
+
case c:
|
|
395
|
+
$ = D();
|
|
396
|
+
break;
|
|
397
|
+
case f:
|
|
398
|
+
$ = D() / 3;
|
|
399
|
+
break;
|
|
400
|
+
case o:
|
|
401
|
+
$ = (g - v) / 6048e5;
|
|
402
|
+
break;
|
|
403
|
+
case a:
|
|
404
|
+
$ = (g - v) / 864e5;
|
|
405
|
+
break;
|
|
406
|
+
case u:
|
|
407
|
+
$ = g / n;
|
|
408
|
+
break;
|
|
409
|
+
case s:
|
|
410
|
+
$ = g / e;
|
|
411
|
+
break;
|
|
412
|
+
case i:
|
|
413
|
+
$ = g / t;
|
|
414
|
+
break;
|
|
415
|
+
default:
|
|
416
|
+
$ = g;
|
|
417
|
+
}
|
|
418
|
+
return l ? $ : b.a($);
|
|
419
|
+
}, m.daysInMonth = function () {
|
|
420
|
+
return this.endOf(c).$D;
|
|
421
|
+
}, m.$locale = function () {
|
|
422
|
+
return D[this.$L];
|
|
423
|
+
}, m.locale = function (t, e) {
|
|
424
|
+
if (!t) return this.$L;
|
|
425
|
+
var n = this.clone(),
|
|
426
|
+
r = w(t, e, !0);
|
|
427
|
+
return r && (n.$L = r), n;
|
|
428
|
+
}, m.clone = function () {
|
|
429
|
+
return b.w(this.$d, this);
|
|
430
|
+
}, m.toDate = function () {
|
|
431
|
+
return new Date(this.valueOf());
|
|
432
|
+
}, m.toJSON = function () {
|
|
433
|
+
return this.isValid() ? this.toISOString() : null;
|
|
434
|
+
}, m.toISOString = function () {
|
|
435
|
+
return this.$d.toISOString();
|
|
436
|
+
}, m.toString = function () {
|
|
437
|
+
return this.$d.toUTCString();
|
|
438
|
+
}, M;
|
|
439
|
+
}(),
|
|
440
|
+
k = _.prototype;
|
|
441
|
+
return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function (t) {
|
|
442
|
+
k[t[1]] = function (e) {
|
|
443
|
+
return this.$g(e, t[0], t[1]);
|
|
444
|
+
};
|
|
445
|
+
}), O.extend = function (t, e) {
|
|
446
|
+
return t.$i || (t(e, _, O), t.$i = !0), O;
|
|
447
|
+
}, O.locale = w, O.isDayjs = S, O.unix = function (t) {
|
|
448
|
+
return O(1e3 * t);
|
|
449
|
+
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
|
450
|
+
});
|
|
451
|
+
})(dayjs_min);
|
|
452
|
+
|
|
453
|
+
var ButtonVariant;
|
|
454
|
+
(function (ButtonVariant) {
|
|
455
|
+
ButtonVariant["CONTAINED"] = "contained";
|
|
456
|
+
ButtonVariant["OUTLINED"] = "outlined";
|
|
457
|
+
ButtonVariant["BARE"] = "bare";
|
|
458
|
+
})(ButtonVariant || (ButtonVariant = {}));
|
|
459
|
+
var ButtonColor;
|
|
460
|
+
(function (ButtonColor) {
|
|
461
|
+
ButtonColor["PRIMARY"] = "primary";
|
|
462
|
+
ButtonColor["SECONDARY"] = "secondary";
|
|
463
|
+
})(ButtonColor || (ButtonColor = {}));
|
|
464
|
+
var ButtonSize;
|
|
465
|
+
(function (ButtonSize) {
|
|
466
|
+
ButtonSize["SMALL"] = "sm";
|
|
467
|
+
ButtonSize["MEDIUM"] = "md";
|
|
468
|
+
ButtonSize["LARGE"] = "lg";
|
|
469
|
+
})(ButtonSize || (ButtonSize = {}));
|
|
470
|
+
var ButtonIconPosition;
|
|
471
|
+
(function (ButtonIconPosition) {
|
|
472
|
+
ButtonIconPosition["LEFT"] = "left";
|
|
473
|
+
ButtonIconPosition["RIGHT"] = "right";
|
|
474
|
+
})(ButtonIconPosition || (ButtonIconPosition = {}));
|
|
475
|
+
var ButtonPosition;
|
|
476
|
+
(function (ButtonPosition) {
|
|
477
|
+
ButtonPosition["LEFT"] = "left";
|
|
478
|
+
ButtonPosition["RIGHT"] = "right";
|
|
479
|
+
ButtonPosition["CENTER"] = "center";
|
|
480
|
+
ButtonPosition["STRETCH"] = "stretch";
|
|
481
|
+
})(ButtonPosition || (ButtonPosition = {}));
|
|
482
|
+
var ToastTypes;
|
|
483
|
+
(function (ToastTypes) {
|
|
484
|
+
ToastTypes["ERROR"] = "ERROR";
|
|
485
|
+
ToastTypes["SUCCESS"] = "SUCCESS";
|
|
486
|
+
})(ToastTypes || (ToastTypes = {}));
|
|
487
|
+
var CalloutTypes;
|
|
488
|
+
(function (CalloutTypes) {
|
|
489
|
+
CalloutTypes["ERROR"] = "ERROR";
|
|
490
|
+
CalloutTypes["WARNING"] = "WARNING";
|
|
491
|
+
CalloutTypes["SUCCESS"] = "SUCCESS";
|
|
492
|
+
})(CalloutTypes || (CalloutTypes = {}));
|
|
493
|
+
var CalenderMode;
|
|
494
|
+
(function (CalenderMode) {
|
|
495
|
+
CalenderMode["PWA"] = "pwa";
|
|
496
|
+
CalenderMode["DESKTOP"] = "desktop";
|
|
497
|
+
})(CalenderMode || (CalenderMode = {}));
|
|
498
|
+
var Theme;
|
|
499
|
+
(function (Theme) {
|
|
500
|
+
Theme["PRIMARY"] = "PRIMARY";
|
|
501
|
+
})(Theme || (Theme = {}));
|
|
502
|
+
var Tabs;
|
|
503
|
+
(function (Tabs) {
|
|
504
|
+
Tabs["FlatTabs"] = "FlatTab";
|
|
505
|
+
Tabs["CapsuleTabs"] = "CapsuleTab";
|
|
506
|
+
})(Tabs || (Tabs = {}));
|
|
507
|
+
var BorderStyle;
|
|
508
|
+
(function (BorderStyle) {
|
|
509
|
+
BorderStyle["SOLID"] = "SOLID";
|
|
510
|
+
BorderStyle["DOTTED"] = "DOTTED";
|
|
511
|
+
})(BorderStyle || (BorderStyle = {}));
|
|
512
|
+
var IconPosition;
|
|
513
|
+
(function (IconPosition) {
|
|
514
|
+
IconPosition["TOP"] = "top";
|
|
515
|
+
IconPosition["BOTTOM"] = "bottom";
|
|
516
|
+
IconPosition["LEFT"] = "left";
|
|
517
|
+
IconPosition["RIGHT"] = "right";
|
|
518
|
+
})(IconPosition || (IconPosition = {}));
|
|
519
|
+
|
|
520
|
+
var colors = {
|
|
521
|
+
neutral900: '#1A1A1A',
|
|
522
|
+
neutral700: '#808080',
|
|
523
|
+
neutral500: '#B3B3B3',
|
|
524
|
+
neutral400: '#CAC9C9',
|
|
525
|
+
neutral350: '#DBDBDB',
|
|
526
|
+
neutral300: '#F3F3F3',
|
|
527
|
+
neutral100: '#FFFFFF',
|
|
528
|
+
brand: '#FF4F17',
|
|
529
|
+
link: '#0F6BFF',
|
|
530
|
+
success: '#11A670',
|
|
531
|
+
alert: '#DF9641',
|
|
532
|
+
warning: '#C83232',
|
|
533
|
+
line: '#E7E7E7',
|
|
534
|
+
brandBg: '#FEF3ED',
|
|
535
|
+
linkBg: '#EFF3FB',
|
|
536
|
+
successBg: '#ECF8F4',
|
|
537
|
+
alertBg: '#FCF7F0',
|
|
538
|
+
warningBg: '#FBEFEF',
|
|
539
|
+
brandText: '#FF4F17',
|
|
540
|
+
successText: '#11A670',
|
|
541
|
+
alertText: '#DF9641',
|
|
542
|
+
warningText: '#C83232',
|
|
543
|
+
disabledText: '#B3B3B3',
|
|
544
|
+
disabled100: '#E6E6E6',
|
|
545
|
+
linkText: '#0F6BFF',
|
|
546
|
+
highlightBg: 'rgba(255, 255, 255, 0.2)',
|
|
547
|
+
shadow: '#1a1a1a14',
|
|
548
|
+
link2: '#3366CC',
|
|
549
|
+
link2Hover: '#1A469D',
|
|
550
|
+
bgPrimary: '#ED6521',
|
|
551
|
+
bgPrimaryHover: '#CE4501',
|
|
552
|
+
blue100: '#ECF3FF',
|
|
553
|
+
orange100: '#FFF1EC'
|
|
554
|
+
};
|
|
555
|
+
var border = {
|
|
556
|
+
radius: {
|
|
557
|
+
0: '0px',
|
|
558
|
+
2: '2px',
|
|
559
|
+
4: '4px',
|
|
560
|
+
6: '6px',
|
|
561
|
+
8: '8px',
|
|
562
|
+
12: '12px',
|
|
563
|
+
16: '16px',
|
|
564
|
+
30: '30px',
|
|
565
|
+
32: '32px',
|
|
566
|
+
'50P': '50%'
|
|
567
|
+
},
|
|
568
|
+
width: {
|
|
569
|
+
none: '0px',
|
|
570
|
+
sm: '1px',
|
|
571
|
+
md: '1.5px',
|
|
572
|
+
lg: '2px'
|
|
573
|
+
},
|
|
574
|
+
style: {
|
|
575
|
+
solid: 'solid',
|
|
576
|
+
dotted: 'dotted'
|
|
577
|
+
}
|
|
578
|
+
};
|
|
579
|
+
var typography = {
|
|
580
|
+
weight: {
|
|
581
|
+
bold: 700,
|
|
582
|
+
semibold: 600,
|
|
583
|
+
medium: 500,
|
|
584
|
+
normal: 400
|
|
585
|
+
},
|
|
586
|
+
size: {
|
|
587
|
+
10: '10px',
|
|
588
|
+
12: '12px',
|
|
589
|
+
14: '14px',
|
|
590
|
+
16: '16px',
|
|
591
|
+
20: '20px',
|
|
592
|
+
24: '24px',
|
|
593
|
+
32: '32px',
|
|
594
|
+
40: '40px',
|
|
595
|
+
48: '48px'
|
|
596
|
+
},
|
|
597
|
+
lineHeight: {
|
|
598
|
+
12: '12px',
|
|
599
|
+
14: '14px',
|
|
600
|
+
16: '16px',
|
|
601
|
+
18: '18px',
|
|
602
|
+
20: '20px',
|
|
603
|
+
22: '22px',
|
|
604
|
+
24: '24px',
|
|
605
|
+
28: '28px',
|
|
606
|
+
32: '32px',
|
|
607
|
+
40: '40px',
|
|
608
|
+
48: '48px',
|
|
609
|
+
56: '56px'
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
var spacing = {
|
|
613
|
+
0: '0px',
|
|
614
|
+
1: '4px',
|
|
615
|
+
2: '8px',
|
|
616
|
+
3: '12px',
|
|
617
|
+
4: '16px',
|
|
618
|
+
5: '20px',
|
|
619
|
+
6: '24px',
|
|
620
|
+
7: '28px',
|
|
621
|
+
8: '32px',
|
|
622
|
+
9: '36px',
|
|
623
|
+
10: '40px',
|
|
624
|
+
14: '56px'
|
|
625
|
+
};
|
|
626
|
+
var size = {
|
|
627
|
+
0: '0px',
|
|
628
|
+
1: '4px',
|
|
629
|
+
2: '8px',
|
|
630
|
+
'2.5': '10px',
|
|
631
|
+
3: '12px',
|
|
632
|
+
4: '16px',
|
|
633
|
+
5: '20px',
|
|
634
|
+
6: '24px',
|
|
635
|
+
7: '28px',
|
|
636
|
+
8: '32px',
|
|
637
|
+
9: '36px',
|
|
638
|
+
10: '40px',
|
|
639
|
+
11: '44px',
|
|
640
|
+
12: '48px',
|
|
641
|
+
13: '52px',
|
|
642
|
+
14: '56px',
|
|
643
|
+
15: '60px',
|
|
644
|
+
50: '200px'
|
|
645
|
+
};
|
|
646
|
+
var elevation = {
|
|
647
|
+
bottomE1: '0px 1px 0px #E7E7E7',
|
|
648
|
+
bottomE2: '0px 4px 16px rgba(26, 26, 26, 0.08)',
|
|
649
|
+
bottomE3: '0px 8px 24px rgba(26, 26, 26, 0.1)',
|
|
650
|
+
bottomE4: '0px 10px 32px rgba(26, 26, 26, 0.2)',
|
|
651
|
+
topE1: '0px -1px 0px #E7E7E7',
|
|
652
|
+
topE2: '0px -4px 16px rgba(26, 26, 26, 0.08)',
|
|
653
|
+
topE3: '0px -8px 24px rgba(26, 26, 26, 0.1)',
|
|
654
|
+
topE4: '0px -10px 32px rgba(26, 26, 26, 0.2)'
|
|
655
|
+
};
|
|
656
|
+
var duration = {
|
|
657
|
+
shortest: 150,
|
|
658
|
+
shorter: 200,
|
|
659
|
+
short: 250,
|
|
660
|
+
standard: 300,
|
|
661
|
+
complex: 375,
|
|
662
|
+
enteringScreen: 225,
|
|
663
|
+
leavingScreen: 195
|
|
664
|
+
};
|
|
665
|
+
var easing = {
|
|
666
|
+
easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
|
|
667
|
+
easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',
|
|
668
|
+
easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
|
|
669
|
+
sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'
|
|
670
|
+
};
|
|
671
|
+
function getAutoHeightDuration(height) {
|
|
672
|
+
if (!height) {
|
|
673
|
+
return 0;
|
|
674
|
+
}
|
|
675
|
+
var constant = height / 36;
|
|
676
|
+
return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10);
|
|
677
|
+
}
|
|
678
|
+
var create = function (props, options) {
|
|
679
|
+
if (props === void 0) {
|
|
680
|
+
props = ['all'];
|
|
681
|
+
}
|
|
682
|
+
if (options === void 0) {
|
|
683
|
+
options = {};
|
|
684
|
+
}
|
|
685
|
+
var _a = options.duration,
|
|
686
|
+
durationOption = _a === void 0 ? duration.standard : _a,
|
|
687
|
+
_b = options.easing,
|
|
688
|
+
easingOption = _b === void 0 ? easing.easeInOut : _b,
|
|
689
|
+
_c = options.delay,
|
|
690
|
+
delay = _c === void 0 ? 0 : _c;
|
|
691
|
+
return (Array.isArray(props) ? props : [props]).map(function (animatedProp) {
|
|
692
|
+
return "".concat(animatedProp, " ").concat(typeof durationOption === 'string' ? durationOption : "".concat(durationOption, "ms"), " ").concat(easingOption, " ").concat(typeof delay === 'string' ? delay : "".concat(delay, "ms"));
|
|
693
|
+
}).join(',');
|
|
694
|
+
};
|
|
695
|
+
var hover$1 = function (key) {
|
|
696
|
+
var _a;
|
|
697
|
+
var bg = (_a = {}, _a[colors.neutral100] = colors.neutral100, _a[colors.neutral900] = colors.neutral900, _a[colors.neutral900] = colors.neutral900, _a[colors.neutral100] = colors.neutral100, _a[colors.brand] = colors.bgPrimaryHover, _a[colors.neutral100] = colors.neutral100, _a[colors.disabledText] = colors.disabledText, _a[colors.neutral300] = colors.neutral300, _a[colors.neutral100] = colors.neutral100, _a[colors.link2] = colors.link2Hover, _a[colors.neutral100] = colors.neutral100, _a[colors.neutral900] = colors.neutral900, _a[colors.neutral100] = colors.neutral100, _a[colors.disabledText] = colors.disabledText, _a[colors.neutral300] = colors.neutral300, _a);
|
|
698
|
+
return bg[key];
|
|
699
|
+
};
|
|
700
|
+
var zIndex = {
|
|
701
|
+
drawer: 1200,
|
|
702
|
+
modal: 1300,
|
|
703
|
+
popOver: 1300,
|
|
704
|
+
tooltip: 1500,
|
|
705
|
+
sideNav: 100,
|
|
706
|
+
toolbar: 50
|
|
707
|
+
};
|
|
708
|
+
var counter = {
|
|
709
|
+
enabled: {
|
|
710
|
+
stroke: colors.neutral900
|
|
711
|
+
},
|
|
712
|
+
disabled: {
|
|
713
|
+
stroke: colors.neutral500
|
|
714
|
+
}
|
|
715
|
+
};
|
|
716
|
+
var BaseTheme = {
|
|
717
|
+
color: {
|
|
718
|
+
text: {
|
|
719
|
+
primary: colors.neutral900,
|
|
720
|
+
secondary: colors.brandText,
|
|
721
|
+
tertiary: colors.neutral500,
|
|
722
|
+
heading: colors.neutral900,
|
|
723
|
+
subHeading: colors.neutral700,
|
|
724
|
+
disabled: colors.disabledText,
|
|
725
|
+
success: colors.successText,
|
|
726
|
+
alert: colors.alertText,
|
|
727
|
+
warning: colors.warningText,
|
|
728
|
+
link: colors.linkText,
|
|
729
|
+
brand: colors.brandText,
|
|
730
|
+
neutral: colors.neutral100,
|
|
731
|
+
link2: colors.link2
|
|
732
|
+
},
|
|
733
|
+
button: {
|
|
734
|
+
outlinedPrimaryLabel: colors.neutral900,
|
|
735
|
+
outlinedPrimaryBorder: colors.neutral900,
|
|
736
|
+
outlinedPrimaryBg: colors.neutral100,
|
|
737
|
+
outlinedSecondaryLabel: colors.brand,
|
|
738
|
+
outlinedSecondaryBorder: colors.brand,
|
|
739
|
+
outlinedSecondaryBg: colors.neutral100,
|
|
740
|
+
outlinedTertiaryLabel: colors.link,
|
|
741
|
+
outlinedTertiaryBorder: colors.link,
|
|
742
|
+
outlinedTertiaryBg: colors.neutral100,
|
|
743
|
+
outlinedDisabledLabel: colors.disabledText,
|
|
744
|
+
outlinedDisabledBg: colors.neutral300,
|
|
745
|
+
containedPrimaryLabel: colors.neutral100,
|
|
746
|
+
containedPrimaryBg: colors.neutral900,
|
|
747
|
+
containedSecondaryLabel: colors.neutral100,
|
|
748
|
+
containedSecondaryBg: colors.brand,
|
|
749
|
+
containedTertiaryLabel: colors.neutral100,
|
|
750
|
+
containedTertiaryBg: colors.link,
|
|
751
|
+
containedDisabledLabel: colors.disabledText,
|
|
752
|
+
containedDisabledBg: colors.neutral300,
|
|
753
|
+
hover: hover$1
|
|
754
|
+
},
|
|
755
|
+
chip: {
|
|
756
|
+
nonSelectedPrimaryLabel: colors.neutral900,
|
|
757
|
+
disabledPrimaryLabel: colors.disabledText,
|
|
758
|
+
selectedPrimaryLabel: colors.neutral900,
|
|
759
|
+
selectedPrimaryBorder: colors.neutral900,
|
|
760
|
+
selectedPrimaryBg: colors.neutral300
|
|
761
|
+
},
|
|
762
|
+
dropdown: {
|
|
763
|
+
shadow: colors.shadow
|
|
764
|
+
},
|
|
765
|
+
tab: {
|
|
766
|
+
nonSelectedPrimaryLabel: colors.neutral700,
|
|
767
|
+
selectedPrimaryLabel: colors.neutral900
|
|
768
|
+
},
|
|
769
|
+
sidenav: {
|
|
770
|
+
primaryBg: colors.neutral900,
|
|
771
|
+
selectedTabBg: colors.highlightBg
|
|
772
|
+
},
|
|
773
|
+
tooltip: {
|
|
774
|
+
primaryBg: colors.neutral900
|
|
775
|
+
},
|
|
776
|
+
background: {
|
|
777
|
+
primary: colors.neutral900,
|
|
778
|
+
secondary: colors.brand,
|
|
779
|
+
tertiary: colors.link,
|
|
780
|
+
brand: colors.brand,
|
|
781
|
+
brandLightBg: colors.brandBg,
|
|
782
|
+
link: colors.link,
|
|
783
|
+
linkLightBg: colors.linkBg,
|
|
784
|
+
success: colors.success,
|
|
785
|
+
successLightBg: colors.successBg,
|
|
786
|
+
alert: colors.alert,
|
|
787
|
+
alertLightBg: colors.alertBg,
|
|
788
|
+
warning: colors.warning,
|
|
789
|
+
warningLightBg: colors.warningBg,
|
|
790
|
+
neutral: colors.neutral100,
|
|
791
|
+
disabled: colors.neutral300,
|
|
792
|
+
disabledSecondaryLight: colors.neutral350,
|
|
793
|
+
disabledSecondary: colors.neutral400,
|
|
794
|
+
disabledDark: colors.disabled100,
|
|
795
|
+
defaultDark: colors.neutral700,
|
|
796
|
+
defaultDarkest: colors.neutral900
|
|
797
|
+
},
|
|
798
|
+
border: {
|
|
799
|
+
primary: colors.neutral900,
|
|
800
|
+
secondary: colors.brand,
|
|
801
|
+
tertiary: colors.link,
|
|
802
|
+
brand: colors.brand,
|
|
803
|
+
neutral: colors.neutral900,
|
|
804
|
+
link: colors.link,
|
|
805
|
+
default: colors.line,
|
|
806
|
+
defaultDark: colors.neutral700,
|
|
807
|
+
disabled: colors.neutral500,
|
|
808
|
+
disabledDark: colors.disabled100,
|
|
809
|
+
warning: colors.warning
|
|
810
|
+
},
|
|
811
|
+
spinner: {
|
|
812
|
+
primary: colors.neutral700,
|
|
813
|
+
primaryBg: colors.alertBg
|
|
814
|
+
},
|
|
815
|
+
coupon: {
|
|
816
|
+
primaryBg: colors.blue100
|
|
817
|
+
},
|
|
818
|
+
alert: {
|
|
819
|
+
success: colors.successBg,
|
|
820
|
+
warning: colors.alertBg,
|
|
821
|
+
info: colors.blue100,
|
|
822
|
+
error: colors.alertBg
|
|
823
|
+
},
|
|
824
|
+
counter: counter
|
|
825
|
+
},
|
|
826
|
+
elevation: __assign({}, elevation),
|
|
827
|
+
border: __assign({}, border),
|
|
828
|
+
spacing: __assign({}, spacing),
|
|
829
|
+
typography: __assign({}, typography),
|
|
830
|
+
size: __assign({}, size),
|
|
831
|
+
transitions: {
|
|
832
|
+
duration: duration,
|
|
833
|
+
easing: easing,
|
|
834
|
+
create: create,
|
|
835
|
+
getAutoHeightDuration: getAutoHeightDuration
|
|
836
|
+
},
|
|
837
|
+
zIndex: zIndex
|
|
838
|
+
};
|
|
839
|
+
__assign({}, BaseTheme);
|
|
840
|
+
var hover = function (key) {
|
|
841
|
+
var _a;
|
|
842
|
+
var bg = (_a = {}, _a[colors.neutral100] = colors.neutral100, _a[colors.neutral900] = colors.neutral900, _a[colors.neutral900] = colors.neutral900, _a[colors.neutral100] = colors.neutral100, _a[colors.brand] = colors.bgPrimaryHover, _a[colors.neutral100] = colors.neutral100, _a[colors.disabledText] = colors.disabledText, _a[colors.neutral300] = colors.neutral300, _a[colors.neutral100] = colors.neutral100, _a[colors.link2] = colors.link2Hover, _a[colors.neutral100] = colors.neutral100, _a[colors.neutral900] = colors.neutral900, _a[colors.neutral100] = colors.neutral100, _a[colors.disabledText] = colors.disabledText, _a[colors.neutral300] = colors.neutral300, _a);
|
|
843
|
+
return bg[key];
|
|
844
|
+
};
|
|
845
|
+
__assign(__assign({}, BaseTheme), {
|
|
846
|
+
color: __assign(__assign({}, BaseTheme.color), {
|
|
847
|
+
text: __assign(__assign({}, BaseTheme.color.text), {
|
|
848
|
+
secondary: colors.link2,
|
|
849
|
+
tertiary: colors.neutral500
|
|
850
|
+
}),
|
|
851
|
+
button: {
|
|
852
|
+
outlinedPrimaryLabel: colors.link2,
|
|
853
|
+
outlinedPrimaryBorder: colors.link2,
|
|
854
|
+
outlinedPrimaryBg: colors.neutral100,
|
|
855
|
+
outlinedSecondaryLabel: colors.neutral900,
|
|
856
|
+
outlinedSecondaryBorder: colors.neutral900,
|
|
857
|
+
outlinedSecondaryBg: colors.neutral100,
|
|
858
|
+
outlinedTertiaryLabel: colors.brand,
|
|
859
|
+
outlinedTertiaryBorder: colors.brand,
|
|
860
|
+
outlinedTertiaryBg: colors.neutral100,
|
|
861
|
+
outlinedDisabledLabel: colors.disabledText,
|
|
862
|
+
outlinedDisabledBg: colors.neutral300,
|
|
863
|
+
containedPrimaryLabel: colors.neutral100,
|
|
864
|
+
containedPrimaryBg: colors.link2,
|
|
865
|
+
containedSecondaryLabel: colors.neutral100,
|
|
866
|
+
containedSecondaryBg: colors.neutral900,
|
|
867
|
+
containedTertiaryLabel: colors.neutral100,
|
|
868
|
+
containedTertiaryBg: colors.brand,
|
|
869
|
+
containedDisabledLabel: colors.disabledText,
|
|
870
|
+
containedDisabledBg: colors.neutral300,
|
|
871
|
+
hover: hover
|
|
872
|
+
},
|
|
873
|
+
chip: __assign(__assign({}, BaseTheme.color.chip), {
|
|
874
|
+
selectedPrimaryLabel: colors.link2,
|
|
875
|
+
selectedPrimaryBorder: colors.link2,
|
|
876
|
+
selectedPrimaryBg: colors.linkBg
|
|
877
|
+
}),
|
|
878
|
+
tab: __assign(__assign({}, BaseTheme.color.tab), {
|
|
879
|
+
nonSelectedPrimaryLabel: colors.neutral900,
|
|
880
|
+
selectedPrimaryLabel: colors.link2
|
|
881
|
+
}),
|
|
882
|
+
background: __assign(__assign({}, BaseTheme.color.background), {
|
|
883
|
+
primary: colors.link2,
|
|
884
|
+
secondary: colors.neutral900,
|
|
885
|
+
tertiary: colors.brand
|
|
886
|
+
}),
|
|
887
|
+
border: __assign(__assign({}, BaseTheme.color.border), {
|
|
888
|
+
primary: colors.link2,
|
|
889
|
+
secondary: colors.neutral900,
|
|
890
|
+
tertiary: colors.brand
|
|
891
|
+
}),
|
|
892
|
+
spinner: {
|
|
893
|
+
primary: colors.link2,
|
|
894
|
+
primaryBg: colors.alertBg
|
|
895
|
+
}
|
|
896
|
+
})
|
|
897
|
+
});
|
|
898
|
+
|
|
899
|
+
var HOVER_TYPE;
|
|
900
|
+
(function (HOVER_TYPE) {
|
|
901
|
+
HOVER_TYPE["ENTER"] = "ENTER";
|
|
902
|
+
HOVER_TYPE["LEAVE"] = "LEAVE";
|
|
903
|
+
})(HOVER_TYPE || (HOVER_TYPE = {}));
|
|
904
|
+
var ITooltipV2BorderSize;
|
|
905
|
+
(function (ITooltipV2BorderSize) {
|
|
906
|
+
ITooltipV2BorderSize["XS"] = "xs";
|
|
907
|
+
ITooltipV2BorderSize["SM"] = "sm";
|
|
908
|
+
ITooltipV2BorderSize["MD"] = "md";
|
|
909
|
+
ITooltipV2BorderSize["LG"] = "lg";
|
|
910
|
+
ITooltipV2BorderSize["XL"] = "xl";
|
|
911
|
+
})(ITooltipV2BorderSize || (ITooltipV2BorderSize = {}));
|
|
912
|
+
var ITooltipV2Position;
|
|
913
|
+
(function (ITooltipV2Position) {
|
|
914
|
+
ITooltipV2Position["AUTO"] = "auto";
|
|
915
|
+
ITooltipV2Position["LEFT"] = "left";
|
|
916
|
+
ITooltipV2Position["RIGHT"] = "right";
|
|
917
|
+
ITooltipV2Position["TOP"] = "top";
|
|
918
|
+
ITooltipV2Position["BOTTOM"] = "bottom";
|
|
919
|
+
})(ITooltipV2Position || (ITooltipV2Position = {}));
|
|
920
|
+
|
|
921
|
+
exports.ARROW_SIZE = void 0;
|
|
922
|
+
(function (ARROW_SIZE) {
|
|
923
|
+
ARROW_SIZE["SM"] = "sm";
|
|
924
|
+
ARROW_SIZE["MD"] = "md";
|
|
925
|
+
ARROW_SIZE["LG"] = "lg";
|
|
926
|
+
})(exports.ARROW_SIZE || (exports.ARROW_SIZE = {}));
|
|
927
|
+
exports.ARROW_DIRECTION = void 0;
|
|
928
|
+
(function (ARROW_DIRECTION) {
|
|
929
|
+
ARROW_DIRECTION["LEFT"] = "LEFT";
|
|
930
|
+
ARROW_DIRECTION["RIGHT"] = "RIGHT";
|
|
931
|
+
})(exports.ARROW_DIRECTION || (exports.ARROW_DIRECTION = {}));
|
|
932
|
+
|
|
933
|
+
var HorizontalScroll = function (_a) {
|
|
934
|
+
var children = _a.children, showShadow = _a.showShadow, showArrow = _a.showArrow, className = _a.className, containerClassname = _a.containerClassname, childrenClassname = _a.childrenClassname, shadowWidth = _a.shadowWidth, _b = _a.arrowSize, arrowSize = _b === void 0 ? exports.ARROW_SIZE.MD : _b, shadowGradientStyle = _a.shadowGradientStyle;
|
|
935
|
+
var _c = shadowWidth || {}, leftShadowWidth = _c.left, rightShadowWidth = _c.right;
|
|
936
|
+
var theme = useTheme__default.default();
|
|
937
|
+
var _d = react.useState(false), isHovering = _d[0], setIsHovering = _d[1];
|
|
938
|
+
var _e = react.useState({
|
|
939
|
+
left: false,
|
|
940
|
+
right: false,
|
|
941
|
+
}), shadowDirection = _e[0], setShadowDirection = _e[1];
|
|
942
|
+
var horizontalScrollRef = react.useRef(null);
|
|
943
|
+
var parentContainerRef = react.useRef(null);
|
|
944
|
+
var childContainerRef = react.useRef(null);
|
|
945
|
+
var updateArrowIcons = function () {
|
|
946
|
+
if (horizontalScrollRef.current && childContainerRef.current) {
|
|
947
|
+
var _a = horizontalScrollRef.current.getBoundingClientRect(), horizontalScrollRight = _a.right, horizontalScrollLeft = _a.left;
|
|
948
|
+
var _b = childContainerRef.current.getBoundingClientRect(), childContainerRight = _b.right, childContainerLeft = _b.left;
|
|
949
|
+
if (childContainerLeft < horizontalScrollLeft) {
|
|
950
|
+
setShadowDirection(function (prevState) { return (__assign(__assign({}, prevState), { left: true })); });
|
|
951
|
+
}
|
|
952
|
+
else {
|
|
953
|
+
setShadowDirection(function (prevState) { return (__assign(__assign({}, prevState), { left: false })); });
|
|
954
|
+
}
|
|
955
|
+
if (childContainerRight > horizontalScrollRight) {
|
|
956
|
+
setShadowDirection(function (prevState) { return (__assign(__assign({}, prevState), { right: true })); });
|
|
957
|
+
}
|
|
958
|
+
else {
|
|
959
|
+
setShadowDirection(function (prevState) { return (__assign(__assign({}, prevState), { right: false })); });
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
};
|
|
963
|
+
react.useEffect(function () {
|
|
964
|
+
updateArrowIcons();
|
|
965
|
+
}, []);
|
|
966
|
+
var onHover = react.useCallback(function (type) { return function () {
|
|
967
|
+
if (type === HOVER_TYPE.ENTER) {
|
|
968
|
+
setIsHovering(true);
|
|
969
|
+
}
|
|
970
|
+
else {
|
|
971
|
+
setIsHovering(false);
|
|
972
|
+
}
|
|
973
|
+
}; }, []);
|
|
974
|
+
var onArrowClick = function (arrowDirection) { return function () {
|
|
975
|
+
if (parentContainerRef.current && horizontalScrollRef.current) {
|
|
976
|
+
var parentContainerElement = parentContainerRef.current;
|
|
977
|
+
var horizontalScrollWidth = horizontalScrollRef.current.getBoundingClientRect().width;
|
|
978
|
+
if (arrowDirection === exports.ARROW_DIRECTION.RIGHT) {
|
|
979
|
+
parentContainerElement.scrollLeft = parentContainerElement.scrollLeft + horizontalScrollWidth / 2;
|
|
980
|
+
}
|
|
981
|
+
else {
|
|
982
|
+
parentContainerElement.scrollLeft = parentContainerElement.scrollLeft - horizontalScrollWidth / 2;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
setTimeout(function () {
|
|
986
|
+
updateArrowIcons();
|
|
987
|
+
}, 200);
|
|
988
|
+
}; };
|
|
989
|
+
var arrowDimension = react.useMemo(function () {
|
|
990
|
+
switch (arrowSize) {
|
|
991
|
+
case exports.ARROW_SIZE.SM: {
|
|
992
|
+
return theme.size[6];
|
|
993
|
+
}
|
|
994
|
+
case exports.ARROW_SIZE.MD: {
|
|
995
|
+
return theme.size[6];
|
|
996
|
+
}
|
|
997
|
+
case exports.ARROW_SIZE.LG: {
|
|
998
|
+
return theme.size[10];
|
|
999
|
+
}
|
|
1000
|
+
default: {
|
|
1001
|
+
return theme.size[6];
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
}, [arrowSize]);
|
|
1005
|
+
return (jsxRuntime.jsxs(ctDesignContainer.Container, __assign({ position: 'relative', onMouseEnter: onHover(HOVER_TYPE.ENTER), onMouseLeave: onHover(HOVER_TYPE.LEAVE), className: containerClassname, ref: horizontalScrollRef }, { children: [showShadow && shadowDirection.left && (jsxRuntime.jsx(StyledLeftShadow, __assign({ width: leftShadowWidth, shadowGradientStyle: shadowGradientStyle }, { children: showArrow && isHovering && (jsxRuntime.jsx(ctDesignContainer.Container, __assign({ display: 'flex', justifyContent: 'center', alignItems: 'center', cursor: 'pointer', paddingLeft: theme.spacing[4], onClick: onArrowClick(exports.ARROW_DIRECTION.LEFT) }, { children: jsxRuntime.jsx(ctDesignIcons.LeftChevronWithBoundingBox, { height: arrowDimension, width: arrowDimension }) }))) }))), jsxRuntime.jsx(StyledHorizontalScroll, __assign({ ref: parentContainerRef, className: className }, { children: jsxRuntime.jsx(ctDesignContainer.Container, __assign({ className: childrenClassname, ref: childContainerRef, display: 'flex' }, { children: children })) })), showShadow && shadowDirection.right && (jsxRuntime.jsx(StyledRightShadow, __assign({ width: rightShadowWidth, shadowGradientStyle: shadowGradientStyle }, { children: showArrow && isHovering && (jsxRuntime.jsx(ctDesignContainer.Container, __assign({ display: 'flex', justifyContent: 'center', alignItems: 'center', cursor: 'pointer', paddingRight: theme.spacing[4], onClick: onArrowClick(exports.ARROW_DIRECTION.RIGHT) }, { children: jsxRuntime.jsx(ctDesignIcons.RightChevronWithBoundingBox, { height: arrowDimension, width: arrowDimension }) }))) })))] })));
|
|
1006
|
+
};
|
|
1007
|
+
HorizontalScroll.defaultProps = {
|
|
1008
|
+
children: null,
|
|
1009
|
+
className: '',
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
exports.HorizontalScroll = HorizontalScroll;
|
|
1013
|
+
exports.StyledHorizontalScroll = StyledHorizontalScroll;
|
|
1014
|
+
|
|
1015
|
+
}));
|
|
1016
|
+
//# sourceMappingURL=ct-design-horizontal-scroll.umd.js.map
|