@taiga-ui/cdk 3.46.0-canary.f5ca9d3 → 3.47.0-canary.2d7569f
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/bundles/taiga-ui-cdk-components-dialog-host.umd.js +56 -28
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-scroll-controls.umd.js +609 -0
- package/bundles/taiga-ui-cdk-components-scroll-controls.umd.js.map +1 -0
- package/bundles/taiga-ui-cdk-components.umd.js +10 -4
- package/bundles/taiga-ui-cdk-components.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js +2 -5
- package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +4 -4
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.js +15 -0
- package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-dom.umd.js +12 -0
- package/bundles/taiga-ui-cdk-utils-dom.umd.js.map +1 -1
- package/components/dialog-host/dialog-host.component.d.ts +3 -2
- package/components/dialog-host/dialog-host.module.d.ts +3 -4
- package/components/index.d.ts +1 -0
- package/components/scroll-controls/index.d.ts +4 -0
- package/components/scroll-controls/package.json +10 -0
- package/components/scroll-controls/scroll-controls.component.d.ts +13 -0
- package/components/scroll-controls/scroll-controls.module.d.ts +10 -0
- package/components/scroll-controls/scroll-ref.directive.d.ts +6 -0
- package/components/scroll-controls/scrollbar.directive.d.ts +19 -0
- package/components/scroll-controls/taiga-ui-cdk-components-scroll-controls.d.ts +5 -0
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/esm2015/components/dialog-host/dialog-host.component.js +41 -16
- package/esm2015/components/dialog-host/dialog-host.module.js +7 -5
- package/esm2015/components/index.js +2 -1
- package/esm2015/components/scroll-controls/index.js +5 -0
- package/esm2015/components/scroll-controls/scroll-controls.component.js +45 -0
- package/esm2015/components/scroll-controls/scroll-controls.module.js +26 -0
- package/esm2015/components/scroll-controls/scroll-ref.directive.js +26 -0
- package/esm2015/components/scroll-controls/scrollbar.directive.js +133 -0
- package/esm2015/components/scroll-controls/taiga-ui-cdk-components-scroll-controls.js +5 -0
- package/esm2015/constants/parent-animation.js +3 -6
- package/esm2015/constants/version.js +2 -2
- package/esm2015/directives/auto-focus/handlers/default.handler.js +3 -3
- package/esm2015/directives/auto-focus/handlers/ios.handler.js +2 -2
- package/esm2015/directives/auto-focus/handlers/sync.handler.js +2 -2
- package/esm2015/tokens/dialogs.js +2 -1
- package/esm2015/tokens/fonts-ready.js +11 -0
- package/esm2015/tokens/index.js +3 -1
- package/esm2015/tokens/scroll-ref.js +8 -0
- package/esm2015/utils/dom/index.js +2 -1
- package/esm2015/utils/dom/retarget-boundary-crossing.js +11 -0
- package/fesm2015/taiga-ui-cdk-components-dialog-host.js +46 -19
- package/fesm2015/taiga-ui-cdk-components-dialog-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-components-scroll-controls.js +220 -0
- package/fesm2015/taiga-ui-cdk-components-scroll-controls.js.map +1 -0
- package/fesm2015/taiga-ui-cdk-components.js +1 -0
- package/fesm2015/taiga-ui-cdk-components.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js +3 -6
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +4 -4
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-tokens.js +16 -3
- package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-dom.js +12 -1
- package/fesm2015/taiga-ui-cdk-utils-dom.js.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-update/steps/replace-services.js +1 -1
- package/tokens/fonts-ready.d.ts +3 -0
- package/tokens/index.d.ts +2 -0
- package/tokens/scroll-ref.d.ts +5 -0
- package/utils/dom/index.d.ts +1 -0
- package/utils/dom/retarget-boundary-crossing.d.ts +1 -0
@@ -0,0 +1,609 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ng-web-apis/common'), require('@taiga-ui/cdk/observables'), require('@taiga-ui/cdk/tokens'), require('rxjs/operators'), require('@angular/common'), require('@taiga-ui/cdk/constants'), require('@taiga-ui/cdk/services'), require('rxjs')) :
|
3
|
+
typeof define === 'function' && define.amd ? define('@taiga-ui/cdk/components/scroll-controls', ['exports', '@angular/core', '@ng-web-apis/common', '@taiga-ui/cdk/observables', '@taiga-ui/cdk/tokens', 'rxjs/operators', '@angular/common', '@taiga-ui/cdk/constants', '@taiga-ui/cdk/services', 'rxjs'], factory) :
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"].cdk = global["taiga-ui"].cdk || {}, global["taiga-ui"].cdk.components = global["taiga-ui"].cdk.components || {}, global["taiga-ui"].cdk.components["scroll-controls"] = {}), global.ng.core, global.common, global["taiga-ui"].cdk.observables, global["taiga-ui"].cdk.tokens, global.rxjs.operators, global.ng.common, global["taiga-ui"].cdk.constants, global["taiga-ui"].cdk.services, global.rxjs));
|
5
|
+
})(this, (function (exports, i0, common, observables, tokens, operators, i1$1, constants, services, i1) { 'use strict';
|
6
|
+
|
7
|
+
function _interopNamespace(e) {
|
8
|
+
if (e && e.__esModule) return e;
|
9
|
+
var n = Object.create(null);
|
10
|
+
if (e) {
|
11
|
+
Object.keys(e).forEach(function (k) {
|
12
|
+
if (k !== 'default') {
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
15
|
+
enumerable: true,
|
16
|
+
get: function () { return e[k]; }
|
17
|
+
});
|
18
|
+
}
|
19
|
+
});
|
20
|
+
}
|
21
|
+
n["default"] = e;
|
22
|
+
return Object.freeze(n);
|
23
|
+
}
|
24
|
+
|
25
|
+
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
26
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
27
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
28
|
+
|
29
|
+
/*! *****************************************************************************
|
30
|
+
Copyright (c) Microsoft Corporation.
|
31
|
+
|
32
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
33
|
+
purpose with or without fee is hereby granted.
|
34
|
+
|
35
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
36
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
37
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
38
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
39
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
40
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
41
|
+
PERFORMANCE OF THIS SOFTWARE.
|
42
|
+
***************************************************************************** */
|
43
|
+
/* global Reflect, Promise */
|
44
|
+
var extendStatics = function (d, b) {
|
45
|
+
extendStatics = Object.setPrototypeOf ||
|
46
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
47
|
+
function (d, b) { for (var p in b)
|
48
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
49
|
+
d[p] = b[p]; };
|
50
|
+
return extendStatics(d, b);
|
51
|
+
};
|
52
|
+
function __extends(d, b) {
|
53
|
+
if (typeof b !== "function" && b !== null)
|
54
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
55
|
+
extendStatics(d, b);
|
56
|
+
function __() { this.constructor = d; }
|
57
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
58
|
+
}
|
59
|
+
var __assign = function () {
|
60
|
+
__assign = Object.assign || function __assign(t) {
|
61
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
62
|
+
s = arguments[i];
|
63
|
+
for (var p in s)
|
64
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
65
|
+
t[p] = s[p];
|
66
|
+
}
|
67
|
+
return t;
|
68
|
+
};
|
69
|
+
return __assign.apply(this, arguments);
|
70
|
+
};
|
71
|
+
function __rest(s, e) {
|
72
|
+
var t = {};
|
73
|
+
for (var p in s)
|
74
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
75
|
+
t[p] = s[p];
|
76
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
77
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
78
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
79
|
+
t[p[i]] = s[p[i]];
|
80
|
+
}
|
81
|
+
return t;
|
82
|
+
}
|
83
|
+
function __decorate(decorators, target, key, desc) {
|
84
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
85
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
86
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
87
|
+
else
|
88
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
89
|
+
if (d = decorators[i])
|
90
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
91
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
92
|
+
}
|
93
|
+
function __param(paramIndex, decorator) {
|
94
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
95
|
+
}
|
96
|
+
function __metadata(metadataKey, metadataValue) {
|
97
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
98
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
99
|
+
}
|
100
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
101
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
102
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
103
|
+
function fulfilled(value) { try {
|
104
|
+
step(generator.next(value));
|
105
|
+
}
|
106
|
+
catch (e) {
|
107
|
+
reject(e);
|
108
|
+
} }
|
109
|
+
function rejected(value) { try {
|
110
|
+
step(generator["throw"](value));
|
111
|
+
}
|
112
|
+
catch (e) {
|
113
|
+
reject(e);
|
114
|
+
} }
|
115
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
116
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
117
|
+
});
|
118
|
+
}
|
119
|
+
function __generator(thisArg, body) {
|
120
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
121
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
122
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
123
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
124
|
+
function step(op) {
|
125
|
+
if (f)
|
126
|
+
throw new TypeError("Generator is already executing.");
|
127
|
+
while (_)
|
128
|
+
try {
|
129
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
130
|
+
return t;
|
131
|
+
if (y = 0, t)
|
132
|
+
op = [op[0] & 2, t.value];
|
133
|
+
switch (op[0]) {
|
134
|
+
case 0:
|
135
|
+
case 1:
|
136
|
+
t = op;
|
137
|
+
break;
|
138
|
+
case 4:
|
139
|
+
_.label++;
|
140
|
+
return { value: op[1], done: false };
|
141
|
+
case 5:
|
142
|
+
_.label++;
|
143
|
+
y = op[1];
|
144
|
+
op = [0];
|
145
|
+
continue;
|
146
|
+
case 7:
|
147
|
+
op = _.ops.pop();
|
148
|
+
_.trys.pop();
|
149
|
+
continue;
|
150
|
+
default:
|
151
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
152
|
+
_ = 0;
|
153
|
+
continue;
|
154
|
+
}
|
155
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
156
|
+
_.label = op[1];
|
157
|
+
break;
|
158
|
+
}
|
159
|
+
if (op[0] === 6 && _.label < t[1]) {
|
160
|
+
_.label = t[1];
|
161
|
+
t = op;
|
162
|
+
break;
|
163
|
+
}
|
164
|
+
if (t && _.label < t[2]) {
|
165
|
+
_.label = t[2];
|
166
|
+
_.ops.push(op);
|
167
|
+
break;
|
168
|
+
}
|
169
|
+
if (t[2])
|
170
|
+
_.ops.pop();
|
171
|
+
_.trys.pop();
|
172
|
+
continue;
|
173
|
+
}
|
174
|
+
op = body.call(thisArg, _);
|
175
|
+
}
|
176
|
+
catch (e) {
|
177
|
+
op = [6, e];
|
178
|
+
y = 0;
|
179
|
+
}
|
180
|
+
finally {
|
181
|
+
f = t = 0;
|
182
|
+
}
|
183
|
+
if (op[0] & 5)
|
184
|
+
throw op[1];
|
185
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
186
|
+
}
|
187
|
+
}
|
188
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
189
|
+
if (k2 === undefined)
|
190
|
+
k2 = k;
|
191
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
192
|
+
}) : (function (o, m, k, k2) {
|
193
|
+
if (k2 === undefined)
|
194
|
+
k2 = k;
|
195
|
+
o[k2] = m[k];
|
196
|
+
});
|
197
|
+
function __exportStar(m, o) {
|
198
|
+
for (var p in m)
|
199
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
200
|
+
__createBinding(o, m, p);
|
201
|
+
}
|
202
|
+
function __values(o) {
|
203
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
204
|
+
if (m)
|
205
|
+
return m.call(o);
|
206
|
+
if (o && typeof o.length === "number")
|
207
|
+
return {
|
208
|
+
next: function () {
|
209
|
+
if (o && i >= o.length)
|
210
|
+
o = void 0;
|
211
|
+
return { value: o && o[i++], done: !o };
|
212
|
+
}
|
213
|
+
};
|
214
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
215
|
+
}
|
216
|
+
function __read(o, n) {
|
217
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
218
|
+
if (!m)
|
219
|
+
return o;
|
220
|
+
var i = m.call(o), r, ar = [], e;
|
221
|
+
try {
|
222
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
223
|
+
ar.push(r.value);
|
224
|
+
}
|
225
|
+
catch (error) {
|
226
|
+
e = { error: error };
|
227
|
+
}
|
228
|
+
finally {
|
229
|
+
try {
|
230
|
+
if (r && !r.done && (m = i["return"]))
|
231
|
+
m.call(i);
|
232
|
+
}
|
233
|
+
finally {
|
234
|
+
if (e)
|
235
|
+
throw e.error;
|
236
|
+
}
|
237
|
+
}
|
238
|
+
return ar;
|
239
|
+
}
|
240
|
+
/** @deprecated */
|
241
|
+
function __spread() {
|
242
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
243
|
+
ar = ar.concat(__read(arguments[i]));
|
244
|
+
return ar;
|
245
|
+
}
|
246
|
+
/** @deprecated */
|
247
|
+
function __spreadArrays() {
|
248
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
249
|
+
s += arguments[i].length;
|
250
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
251
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
252
|
+
r[k] = a[j];
|
253
|
+
return r;
|
254
|
+
}
|
255
|
+
function __spreadArray(to, from, pack) {
|
256
|
+
if (pack || arguments.length === 2)
|
257
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
258
|
+
if (ar || !(i in from)) {
|
259
|
+
if (!ar)
|
260
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
261
|
+
ar[i] = from[i];
|
262
|
+
}
|
263
|
+
}
|
264
|
+
return to.concat(ar || from);
|
265
|
+
}
|
266
|
+
function __await(v) {
|
267
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
268
|
+
}
|
269
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
270
|
+
if (!Symbol.asyncIterator)
|
271
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
272
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
273
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
274
|
+
function verb(n) { if (g[n])
|
275
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
276
|
+
function resume(n, v) { try {
|
277
|
+
step(g[n](v));
|
278
|
+
}
|
279
|
+
catch (e) {
|
280
|
+
settle(q[0][3], e);
|
281
|
+
} }
|
282
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
283
|
+
function fulfill(value) { resume("next", value); }
|
284
|
+
function reject(value) { resume("throw", value); }
|
285
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
286
|
+
resume(q[0][0], q[0][1]); }
|
287
|
+
}
|
288
|
+
function __asyncDelegator(o) {
|
289
|
+
var i, p;
|
290
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
291
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
292
|
+
}
|
293
|
+
function __asyncValues(o) {
|
294
|
+
if (!Symbol.asyncIterator)
|
295
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
296
|
+
var m = o[Symbol.asyncIterator], i;
|
297
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
298
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
299
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
300
|
+
}
|
301
|
+
function __makeTemplateObject(cooked, raw) {
|
302
|
+
if (Object.defineProperty) {
|
303
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
304
|
+
}
|
305
|
+
else {
|
306
|
+
cooked.raw = raw;
|
307
|
+
}
|
308
|
+
return cooked;
|
309
|
+
}
|
310
|
+
;
|
311
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
312
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
313
|
+
}) : function (o, v) {
|
314
|
+
o["default"] = v;
|
315
|
+
};
|
316
|
+
function __importStar(mod) {
|
317
|
+
if (mod && mod.__esModule)
|
318
|
+
return mod;
|
319
|
+
var result = {};
|
320
|
+
if (mod != null)
|
321
|
+
for (var k in mod)
|
322
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
323
|
+
__createBinding(result, mod, k);
|
324
|
+
__setModuleDefault(result, mod);
|
325
|
+
return result;
|
326
|
+
}
|
327
|
+
function __importDefault(mod) {
|
328
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
329
|
+
}
|
330
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
331
|
+
if (kind === "a" && !f)
|
332
|
+
throw new TypeError("Private accessor was defined without a getter");
|
333
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
334
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
335
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
336
|
+
}
|
337
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
338
|
+
if (kind === "m")
|
339
|
+
throw new TypeError("Private method is not writable");
|
340
|
+
if (kind === "a" && !f)
|
341
|
+
throw new TypeError("Private accessor was defined without a setter");
|
342
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
343
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
344
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
345
|
+
}
|
346
|
+
|
347
|
+
var MIN_WIDTH = 24;
|
348
|
+
var TuiScrollbarDirective = /** @class */ (function () {
|
349
|
+
function TuiScrollbarDirective(zone, destroy$, animationFrame$, container, doc, el) {
|
350
|
+
var _this = this;
|
351
|
+
this.container = container;
|
352
|
+
this.doc = doc;
|
353
|
+
this.el = el;
|
354
|
+
this.tuiScrollbar = 'vertical';
|
355
|
+
var nativeElement = this.el.nativeElement;
|
356
|
+
var mousedown$ = observables.tuiTypedFromEvent(nativeElement, 'mousedown');
|
357
|
+
var mousemove$ = observables.tuiTypedFromEvent(this.doc, 'mousemove');
|
358
|
+
var mouseup$ = observables.tuiTypedFromEvent(this.doc, 'mouseup');
|
359
|
+
var mousedownWrapper$ = observables.tuiTypedFromEvent(this.wrapper, 'mousedown');
|
360
|
+
i1.merge(mousedownWrapper$.pipe(observables.tuiPreventDefault(), operators.map(function (event) { return _this.getScrolled(event, 0.5, 0.5); })), mousedown$.pipe(observables.tuiPreventDefault(), observables.tuiStopPropagation(), operators.switchMap(function (event) {
|
361
|
+
var rect = nativeElement.getBoundingClientRect();
|
362
|
+
var vertical = getOffsetVertical(event, rect);
|
363
|
+
var horizontal = getOffsetHorizontal(event, rect);
|
364
|
+
return mousemove$.pipe(operators.map(function (event) { return _this.getScrolled(event, vertical, horizontal); }), operators.takeUntil(mouseup$));
|
365
|
+
})))
|
366
|
+
.pipe(observables.tuiZonefree(zone), operators.takeUntil(destroy$))
|
367
|
+
.subscribe(function (_a) {
|
368
|
+
var _b = __read(_a, 2), scrollTop = _b[0], scrollLeft = _b[1];
|
369
|
+
if (_this.tuiScrollbar === 'vertical') {
|
370
|
+
_this.element.scrollTop = scrollTop;
|
371
|
+
}
|
372
|
+
else {
|
373
|
+
_this.element.scrollLeft = scrollLeft;
|
374
|
+
}
|
375
|
+
});
|
376
|
+
i1.merge(animationFrame$.pipe(operators.throttleTime(constants.POLLING_TIME)), observables.tuiScrollFrom(this.element))
|
377
|
+
.pipe(observables.tuiZonefree(zone), operators.takeUntil(destroy$))
|
378
|
+
.subscribe(function () {
|
379
|
+
if (_this.tuiScrollbar === 'vertical') {
|
380
|
+
nativeElement.style.top = _this.thumb * 100 + "%";
|
381
|
+
nativeElement.style.height = _this.view * 100 + "%";
|
382
|
+
}
|
383
|
+
else {
|
384
|
+
nativeElement.style.left = _this.thumb * 100 + "%";
|
385
|
+
nativeElement.style.width = _this.view * 100 + "%";
|
386
|
+
}
|
387
|
+
});
|
388
|
+
}
|
389
|
+
Object.defineProperty(TuiScrollbarDirective.prototype, "wrapper", {
|
390
|
+
get: function () {
|
391
|
+
return this.el.nativeElement.parentElement;
|
392
|
+
},
|
393
|
+
enumerable: false,
|
394
|
+
configurable: true
|
395
|
+
});
|
396
|
+
Object.defineProperty(TuiScrollbarDirective.prototype, "scrolled", {
|
397
|
+
get: function () {
|
398
|
+
var _a = this.element, scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight, scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
|
399
|
+
return this.tuiScrollbar === 'vertical'
|
400
|
+
? scrollTop / (scrollHeight - clientHeight)
|
401
|
+
: scrollLeft / (scrollWidth - clientWidth);
|
402
|
+
},
|
403
|
+
enumerable: false,
|
404
|
+
configurable: true
|
405
|
+
});
|
406
|
+
Object.defineProperty(TuiScrollbarDirective.prototype, "compensation", {
|
407
|
+
get: function () {
|
408
|
+
var _a = this.element, clientHeight = _a.clientHeight, scrollHeight = _a.scrollHeight, clientWidth = _a.clientWidth, scrollWidth = _a.scrollWidth;
|
409
|
+
if (((clientHeight * clientHeight) / scrollHeight > MIN_WIDTH &&
|
410
|
+
this.tuiScrollbar === 'vertical') ||
|
411
|
+
((clientWidth * clientWidth) / scrollWidth > MIN_WIDTH &&
|
412
|
+
this.tuiScrollbar === 'horizontal')) {
|
413
|
+
return 0;
|
414
|
+
}
|
415
|
+
return this.tuiScrollbar === 'vertical'
|
416
|
+
? MIN_WIDTH / clientHeight
|
417
|
+
: MIN_WIDTH / clientWidth;
|
418
|
+
},
|
419
|
+
enumerable: false,
|
420
|
+
configurable: true
|
421
|
+
});
|
422
|
+
Object.defineProperty(TuiScrollbarDirective.prototype, "thumb", {
|
423
|
+
get: function () {
|
424
|
+
var compensation = this.compensation || this.view;
|
425
|
+
return this.scrolled * (1 - compensation);
|
426
|
+
},
|
427
|
+
enumerable: false,
|
428
|
+
configurable: true
|
429
|
+
});
|
430
|
+
Object.defineProperty(TuiScrollbarDirective.prototype, "view", {
|
431
|
+
get: function () {
|
432
|
+
var _a = this.element, clientHeight = _a.clientHeight, scrollHeight = _a.scrollHeight, clientWidth = _a.clientWidth, scrollWidth = _a.scrollWidth;
|
433
|
+
return this.tuiScrollbar === 'vertical'
|
434
|
+
? Math.ceil((clientHeight / scrollHeight) * 100) / 100
|
435
|
+
: Math.ceil((clientWidth / scrollWidth) * 100) / 100;
|
436
|
+
},
|
437
|
+
enumerable: false,
|
438
|
+
configurable: true
|
439
|
+
});
|
440
|
+
Object.defineProperty(TuiScrollbarDirective.prototype, "element", {
|
441
|
+
get: function () {
|
442
|
+
return this.container.nativeElement;
|
443
|
+
},
|
444
|
+
enumerable: false,
|
445
|
+
configurable: true
|
446
|
+
});
|
447
|
+
TuiScrollbarDirective.prototype.getScrolled = function (_a, offsetVertical, offsetHorizontal) {
|
448
|
+
var clientY = _a.clientY, clientX = _a.clientX;
|
449
|
+
var _b = this.el.nativeElement, offsetHeight = _b.offsetHeight, offsetWidth = _b.offsetWidth;
|
450
|
+
var _c = this.wrapper.getBoundingClientRect(), top = _c.top, left = _c.left, width = _c.width, height = _c.height;
|
451
|
+
var maxTop = this.element.scrollHeight - height;
|
452
|
+
var maxLeft = this.element.scrollWidth - width;
|
453
|
+
var scrolledTop = (clientY - top - offsetHeight * offsetVertical) / (height - offsetHeight);
|
454
|
+
var scrolledLeft = (clientX - left - offsetWidth * offsetHorizontal) / (width - offsetWidth);
|
455
|
+
return [maxTop * scrolledTop, maxLeft * scrolledLeft];
|
456
|
+
};
|
457
|
+
return TuiScrollbarDirective;
|
458
|
+
}());
|
459
|
+
TuiScrollbarDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiScrollbarDirective, deps: [{ token: i0.NgZone }, { token: services.TuiDestroyService, self: true }, { token: common.ANIMATION_FRAME }, { token: tokens.TUI_SCROLL_REF }, { token: i1$1.DOCUMENT }, { token: i0.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
460
|
+
TuiScrollbarDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiScrollbarDirective, selector: "[tuiScrollbar]", inputs: { tuiScrollbar: "tuiScrollbar" }, providers: [services.TuiDestroyService], ngImport: i0__namespace });
|
461
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiScrollbarDirective, decorators: [{
|
462
|
+
type: i0.Directive,
|
463
|
+
args: [{
|
464
|
+
selector: '[tuiScrollbar]',
|
465
|
+
providers: [services.TuiDestroyService],
|
466
|
+
}]
|
467
|
+
}], ctorParameters: function () {
|
468
|
+
return [{ type: i0__namespace.NgZone, decorators: [{
|
469
|
+
type: i0.Inject,
|
470
|
+
args: [i0.NgZone]
|
471
|
+
}] }, { type: i1__namespace.Observable, decorators: [{
|
472
|
+
type: i0.Self
|
473
|
+
}, {
|
474
|
+
type: i0.Inject,
|
475
|
+
args: [services.TuiDestroyService]
|
476
|
+
}] }, { type: i1__namespace.Observable, decorators: [{
|
477
|
+
type: i0.Inject,
|
478
|
+
args: [common.ANIMATION_FRAME]
|
479
|
+
}] }, { type: i0__namespace.ElementRef, decorators: [{
|
480
|
+
type: i0.Inject,
|
481
|
+
args: [tokens.TUI_SCROLL_REF]
|
482
|
+
}] }, { type: Document, decorators: [{
|
483
|
+
type: i0.Inject,
|
484
|
+
args: [i1$1.DOCUMENT]
|
485
|
+
}] }, { type: i0__namespace.ElementRef, decorators: [{
|
486
|
+
type: i0.Inject,
|
487
|
+
args: [i0.ElementRef]
|
488
|
+
}] }];
|
489
|
+
}, propDecorators: { tuiScrollbar: [{
|
490
|
+
type: i0.Input
|
491
|
+
}] } });
|
492
|
+
function getOffsetVertical(_a, _b) {
|
493
|
+
var clientY = _a.clientY;
|
494
|
+
var top = _b.top, height = _b.height;
|
495
|
+
return (clientY - top) / height;
|
496
|
+
}
|
497
|
+
function getOffsetHorizontal(_a, _b) {
|
498
|
+
var clientX = _a.clientX;
|
499
|
+
var left = _b.left, width = _b.width;
|
500
|
+
return (clientX - left) / width;
|
501
|
+
}
|
502
|
+
|
503
|
+
var TuiScrollControlsComponent = /** @class */ (function () {
|
504
|
+
function TuiScrollControlsComponent(zone, scrollRef, animationFrame$) {
|
505
|
+
var _this = this;
|
506
|
+
this.zone = zone;
|
507
|
+
this.scrollRef = scrollRef;
|
508
|
+
this.animationFrame$ = animationFrame$;
|
509
|
+
this.refresh$ = this.animationFrame$.pipe(operators.throttleTime(300), operators.map(function () { return _this.scrollbars; }), operators.startWith([false, false]), operators.distinctUntilChanged(function (a, b) { return a[0] === b[0] && a[1] === b[1]; }), observables.tuiZoneOptimized(this.zone));
|
510
|
+
}
|
511
|
+
Object.defineProperty(TuiScrollControlsComponent.prototype, "scrollbars", {
|
512
|
+
get: function () {
|
513
|
+
var _a = this.scrollRef.nativeElement, clientHeight = _a.clientHeight, scrollHeight = _a.scrollHeight, clientWidth = _a.clientWidth, scrollWidth = _a.scrollWidth;
|
514
|
+
return [
|
515
|
+
Math.ceil((clientHeight / scrollHeight) * 100) < 100,
|
516
|
+
Math.ceil((clientWidth / scrollWidth) * 100) < 100,
|
517
|
+
];
|
518
|
+
},
|
519
|
+
enumerable: false,
|
520
|
+
configurable: true
|
521
|
+
});
|
522
|
+
return TuiScrollControlsComponent;
|
523
|
+
}());
|
524
|
+
TuiScrollControlsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiScrollControlsComponent, deps: [{ token: i0.NgZone }, { token: tokens.TUI_SCROLL_REF }, { token: common.ANIMATION_FRAME }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
525
|
+
TuiScrollControlsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiScrollControlsComponent, selector: "tui-scroll-controls", ngImport: i0__namespace, template: "<ng-container *ngIf=\"refresh$ | async as bars\">\n <div\n *ngIf=\"bars[0]\"\n class=\"t-bar t-bar_vertical\"\n [class.t-bar_has-horizontal]=\"bars[1]\"\n >\n <div\n tuiScrollbar=\"vertical\"\n class=\"t-thumb\"\n ></div>\n </div>\n <div\n *ngIf=\"bars[1]\"\n class=\"t-bar t-bar_horizontal\"\n [class.t-bar_has-vertical]=\"bars[0]\"\n >\n <div\n tuiScrollbar=\"horizontal\"\n class=\"t-thumb\"\n ></div>\n </div>\n</ng-container>\n", styles: [":host{position:-webkit-sticky;position:sticky;top:0;left:0;z-index:1;min-width:calc(100% - 1px);min-height:calc(100% - 1px);max-width:calc(100% - 1px);max-height:calc(100% - 1px);float:left;-webkit-margin-end:calc(-100% + 1px);margin-inline-end:calc(-100% + 1px);pointer-events:none}.t-bar{position:absolute;right:0;bottom:0;pointer-events:auto;animation:tuiFadeIn var(--tui-duration, .3s) ease-in-out}.t-bar_vertical{top:0;width:.875rem}.t-bar_horizontal{left:0;height:.875rem}.t-bar_has-horizontal{bottom:.5rem}.t-bar_has-vertical{right:.5rem}.t-thumb{position:absolute;border-radius:6.25rem;border:.25rem solid transparent;cursor:pointer;pointer-events:auto;background:currentColor;background-clip:content-box;box-sizing:border-box;transition:all var(--tui-duration, .3s) ease-in-out;transition-property:width,height,opacity;opacity:.2}.t-thumb:hover{opacity:.24}.t-thumb:active{opacity:.48}.t-bar_vertical .t-thumb{right:0;width:.75rem;min-height:1.25rem}.t-bar_vertical:hover .t-thumb,.t-bar_vertical .t-thumb:active{width:.875rem}.t-bar_horizontal .t-thumb{bottom:0;height:.75rem;min-width:1.25rem}.t-bar_horizontal:hover .t-thumb,.t-bar_horizontal .t-thumb:active{height:.875rem}\n"], directives: [{ type: i1__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: TuiScrollbarDirective, selector: "[tuiScrollbar]", inputs: ["tuiScrollbar"] }], pipes: { "async": i1__namespace$1.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
526
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiScrollControlsComponent, decorators: [{
|
527
|
+
type: i0.Component,
|
528
|
+
args: [{
|
529
|
+
selector: 'tui-scroll-controls',
|
530
|
+
templateUrl: './scroll-controls.template.html',
|
531
|
+
styleUrls: ['./scroll-controls.style.less'],
|
532
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
533
|
+
}]
|
534
|
+
}], ctorParameters: function () {
|
535
|
+
return [{ type: i0__namespace.NgZone, decorators: [{
|
536
|
+
type: i0.Inject,
|
537
|
+
args: [i0.NgZone]
|
538
|
+
}] }, { type: i0__namespace.ElementRef, decorators: [{
|
539
|
+
type: i0.Inject,
|
540
|
+
args: [tokens.TUI_SCROLL_REF]
|
541
|
+
}] }, { type: i1__namespace.Observable, decorators: [{
|
542
|
+
type: i0.Inject,
|
543
|
+
args: [common.ANIMATION_FRAME]
|
544
|
+
}] }];
|
545
|
+
} });
|
546
|
+
|
547
|
+
var SCROLL_REF_SELECTOR = '[tuiScrollRef]';
|
548
|
+
var TuiScrollRefDirective = /** @class */ (function () {
|
549
|
+
function TuiScrollRefDirective() {
|
550
|
+
}
|
551
|
+
return TuiScrollRefDirective;
|
552
|
+
}());
|
553
|
+
TuiScrollRefDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiScrollRefDirective, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
554
|
+
TuiScrollRefDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiScrollRefDirective, selector: "[tuiScrollRef]", providers: [
|
555
|
+
{
|
556
|
+
provide: tokens.TUI_SCROLL_REF,
|
557
|
+
useExisting: i0.ElementRef,
|
558
|
+
},
|
559
|
+
], ngImport: i0__namespace });
|
560
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiScrollRefDirective, decorators: [{
|
561
|
+
type: i0.Directive,
|
562
|
+
args: [{
|
563
|
+
selector: SCROLL_REF_SELECTOR,
|
564
|
+
providers: [
|
565
|
+
{
|
566
|
+
provide: tokens.TUI_SCROLL_REF,
|
567
|
+
useExisting: i0.ElementRef,
|
568
|
+
},
|
569
|
+
],
|
570
|
+
}]
|
571
|
+
}] });
|
572
|
+
|
573
|
+
var TuiScrollControlsModule = /** @class */ (function () {
|
574
|
+
function TuiScrollControlsModule() {
|
575
|
+
}
|
576
|
+
return TuiScrollControlsModule;
|
577
|
+
}());
|
578
|
+
TuiScrollControlsModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiScrollControlsModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
579
|
+
TuiScrollControlsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiScrollControlsModule, declarations: [TuiScrollbarDirective,
|
580
|
+
TuiScrollControlsComponent,
|
581
|
+
TuiScrollRefDirective], imports: [i1$1.CommonModule], exports: [TuiScrollControlsComponent, TuiScrollRefDirective] });
|
582
|
+
TuiScrollControlsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiScrollControlsModule, imports: [[i1$1.CommonModule]] });
|
583
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiScrollControlsModule, decorators: [{
|
584
|
+
type: i0.NgModule,
|
585
|
+
args: [{
|
586
|
+
imports: [i1$1.CommonModule],
|
587
|
+
declarations: [
|
588
|
+
TuiScrollbarDirective,
|
589
|
+
TuiScrollControlsComponent,
|
590
|
+
TuiScrollRefDirective,
|
591
|
+
],
|
592
|
+
exports: [TuiScrollControlsComponent, TuiScrollRefDirective],
|
593
|
+
}]
|
594
|
+
}] });
|
595
|
+
|
596
|
+
/**
|
597
|
+
* Generated bundle index. Do not edit.
|
598
|
+
*/
|
599
|
+
|
600
|
+
exports.SCROLL_REF_SELECTOR = SCROLL_REF_SELECTOR;
|
601
|
+
exports.TuiScrollControlsComponent = TuiScrollControlsComponent;
|
602
|
+
exports.TuiScrollControlsModule = TuiScrollControlsModule;
|
603
|
+
exports.TuiScrollRefDirective = TuiScrollRefDirective;
|
604
|
+
exports.TuiScrollbarDirective = TuiScrollbarDirective;
|
605
|
+
|
606
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
607
|
+
|
608
|
+
}));
|
609
|
+
//# sourceMappingURL=taiga-ui-cdk-components-scroll-controls.umd.js.map
|