Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update npm packages #3139

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ module.exports = {
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-parameter-properties': 'error', // deprecated
'@typescript-eslint/parameter-properties': 'error', // deprecated
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-this-alias': 'warn',
'@typescript-eslint/restrict-plus-operands': 'warn',
Expand All @@ -410,6 +410,9 @@ module.exports = {
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/unified-signatures': 'off', // TSDoc overloaded functions
'@typescript-eslint/no-redundant-type-constituents': 'warn',
'@typescript-eslint/no-dynamic-delete': 'warn',
'@typescript-eslint/no-extraneous-class': 'off',
'zk/noMixedHtml': [ 2, {
'htmlFunctionRules': [
'dom(?:(?!Evt|Target).)', 'getStyle', 'getSclass', 'getZclass', 'HTML_$',
Expand Down
2,248 changes: 1,408 additions & 840 deletions package-lock.json

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,52 +23,52 @@
"license": "LGPL-2.0-or-later",
"private": true,
"devDependencies": {
"@babel/core": "^7.16.10",
"@babel/core": "^7.23.9",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-decorators": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.23.9",
"@babel/plugin-proposal-object-rest-spread": "^7.16.7",
"@babel/plugin-transform-modules-commonjs": "^7.22.5",
"@babel/plugin-transform-runtime": "^7.22.10",
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
"@babel/plugin-transform-runtime": "^7.23.9",
"@babel/preset-env": "^7.16.10",
"@babel/runtime-corejs3": "^7.22.10",
"@babel/runtime-corejs3": "^7.23.9",
"@microsoft/eslint-plugin-sdl": "github:microsoft/eslint-plugin-sdl",
"@types/dompurify": "^3.0.5",
"@types/jquery": "^3.5.13",
"@types/jquery-mousewheel": "^3.1.9",
"@types/jquery.transit": "^0.9.31",
"@types/webpack-env": "^1.16.3",
"@types/webrtc": "^0.0.32",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"babel-loader": "^8.2.3",
"browser-sync": "^2.29.3",
"cssnano": "^5.0.15",
"eslint": "^8.45.0",
"@types/webpack-env": "^1.18.4",
"@types/webrtc": "^0.0.42",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"babel-loader": "^9.1.3",
"browser-sync": "^3.0.2",
"cssnano": "^6.0.3",
"eslint": "^8.56.0",
"eslint-plugin-tsdoc": "^0.2.17",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-concat": "^2.6.1",
"gulp-flatmap": "^1.0.2",
"gulp-ignore": "^3.0.0",
"gulp-postcss": "^9.0.1",
"gulp-postcss": "^9.1.0",
"gulp-print": "^5.0.2",
"gulp-rename": "^2.0.0",
"gulp-tap": "^2.0.0",
"gulp-typescript": "^6.0.0-alpha.1",
"gulp-uglify": "^3.0.2",
"merge-stream": "^2.0.0",
"minimist": "^1.2.6",
"postcss": "^8.4.31",
"minimist": "^1.2.8",
"postcss": "^8.4.33",
"resolve-options": "^2.0.0",
"ts-loader": "^9.3.0",
"ts-loader": "^9.5.1",
"tslib": "^2.6.2",
"typedoc": "^0.23.21",
"typescript": "^4.9.5",
"typedoc": "^0.25.7",
"typescript": "^5.3.3",
"vinyl-map": "^1.0.2",
"webpack": "^5.88.2",
"webpack-cli": "4.9.1",
"webpack": "^5.90.0",
"webpack-cli": "5.1.4",
"webpack-stream": "^7.0.0",
"zkless-engine": "^1.1.10"
"zkless-engine": "^1.1.13"
},
"dependencies": {
"dompurify": "^3.0.6",
Expand Down
1 change: 1 addition & 0 deletions zk/src/main/resources/web/js/zk/anima.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ zk.animating = animating;
* @see {@link zk.animating}
* @since 5.0.6
*/
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
export function afterAnimate(fn: () => void, delay?: number): boolean | void {
if (zk.animating())
_aftAnims.push(fn);
Expand Down
6 changes: 3 additions & 3 deletions zk/src/main/resources/web/js/zk/au.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ export namespace au_global {
for (var c in code as Record<number | string, string>)
zAu.setErrorURI(parseInt(c), code[c] as string);
} else
zAu._errURIs['' + code] = uri!;
zAu._errURIs['' + String(code)] = uri!;
}
/**
* Sets the URI for the server-push related error.
Expand Down Expand Up @@ -538,7 +538,7 @@ export namespace au_global {
zAu.setPushErrorURI(parseInt(c), code[c] as string);
return;
}
_perrURIs['' + code] = uri!;
_perrURIs['' + String(code)] = uri!;
}

////Ajax Send////
Expand Down Expand Up @@ -965,7 +965,7 @@ export namespace au_global {
if (!forceAjax && ws) {
zk.copy(content, zWs.encode(j, aureq, dt));
} else {
content += zAu.encode(j, aureq, dt);
(content as string) += zAu.encode(j, aureq, dt);
}
zk.copy(rtags, (aureq.opts || {}).rtags);
}
Expand Down
2 changes: 1 addition & 1 deletion zk/src/main/resources/web/js/zk/dateImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export namespace dateImpl_global {
return this._getTzMoment().year(year).valueOf();
}
toString(): string {
return this._getTzMoment().toString();
return String(this._getTzMoment());
}
valueOf(): number {
return this._moment.valueOf();
Expand Down
28 changes: 14 additions & 14 deletions zk/src/main/resources/web/js/zk/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1494,11 +1494,12 @@ export class JQZK {
vparentNode(real?: boolean): HTMLElement | undefined {
var el = this.jq[0];
if (el) {
var v = el['z_vp'] as undefined | HTMLElement; //might be empty
let v = el['z_vp'] as undefined | string; //might be empty
if (v) return jq('#' + v)[0];
v = el['z_vpagt'] as undefined | HTMLElement;
if (v && (v = jq('#' + v)[0]))
return v.parentNode as HTMLElement | undefined;
v = el['z_vpagt'] as undefined | string;
let agt: HTMLElement | undefined;
if (v && (agt = jq('#' + v)[0]))
return agt.parentNode as HTMLElement | undefined;
if (real)
return el.parentNode as HTMLElement | undefined;
}
Expand Down Expand Up @@ -1547,23 +1548,22 @@ export class JQZK {
undoVParent(): this {
if (this.hasVParent()) {
var el = this.jq[0],
p = el['z_vp'] as undefined | HTMLElement,
agt = el['z_vpagt'] as string | HTMLElement,
p = el['z_vp'] as undefined | string,
agt = el['z_vpagt'] as string,
$agt = jq('#' + agt);
el['z_vp'] = el['z_vpagt'] = undefined;
agt = $agt[0];

p = (p ? jq('#' + p)[0] : agt ? agt.parentNode : undefined) as undefined | HTMLElement;
if (p) {
const agtNode = $agt[0],
parent = (p ? jq('#' + p)[0] : agtNode ? agtNode.parentNode : undefined) as undefined | HTMLElement;
if (parent) {

// Bug 3049181
zjq._fixedVParent(el);

if (agt) {
p.insertBefore(el, agt);
if (agtNode) {
parent.insertBefore(el, agtNode);
$agt.remove();
} else
p.appendChild(el);
parent.appendChild(el);

var cf: undefined | zk.Widget, parentWidget: undefined | zk.Widget, a: undefined | HTMLElement;
// ZK-851
Expand Down Expand Up @@ -1713,7 +1713,7 @@ export class JQZK {
* <p>To parse a style (e.g., 'width:10px;padding:2px') to a map of style names and values, use {@link jq.parseStyle}.
* @deprecated As of release 5.0.2, use jq.css(map) instead
*/
setStyles(styles: JQuery.PlainObject<string | number | ((this: HTMLElement, index: number, value: string) => string | number | void | undefined)>): this {
setStyles(styles: JQuery.PlainObject<string | number | ((this: HTMLElement, index: number, value: string) => string | number | undefined)>): this {
this.jq.css(styles);
return this;
}
Expand Down
4 changes: 2 additions & 2 deletions zk/src/main/resources/web/js/zk/domtouch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ zk.override(zk.Widget.prototype, _xWidget, {
this._holdTimeout = undefined;
}
};
jq(this.$n()!).on('touchstart', this.proxy(this._tapHoldStart))
jq(this.$n()).on('touchstart', this.proxy(this._tapHoldStart))
.on('touchmove', this.proxy(this._tapHoldMove)) //cancel hold if moved
.on('click', this.proxy(this._tapHoldClick)) //prevent click during hold
.on('touchend', this.proxy(this._tapHoldEnd));
Expand All @@ -276,7 +276,7 @@ zk.override(zk.Widget.prototype, _xWidget, {
unbindTapHold_() {
if (this.isListen('onRightClick') || (window.zul && this instanceof zul.Widget && this.getContext())) { //also register context menu to tapHold event
this._startHold = this._cancelHold = undefined;
jq(this.$n()!).off('touchstart', this.proxy(this._tapHoldStart))
jq(this.$n()).off('touchstart', this.proxy(this._tapHoldStart))
.off('touchmove', this.proxy(this._tapHoldMove)) //cancel hold if moved
.off('click', this.proxy(this._tapHoldClick)) //prevent click during hold
.off('touchend', this.proxy(this._tapHoldEnd));
Expand Down
8 changes: 4 additions & 4 deletions zk/src/main/resources/web/js/zk/drag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface DraggableOptions {
snap?: zk.Offset | ((dg: Draggable, offset: zk.Offset) => zk.Offset);
}

var _dragging = {},
var _dragging = new Map(),
_actTmout: undefined | number, //if not null, it means _activate() is called but not really activated
_stackup: undefined | HTMLIFrameElement, _activedg: undefined | Draggable, _initPt: zk.Offset, _dnEvt: boolean | zk.Event | undefined,
_lastPt: zk.Offset | undefined, _lastScrlPt: zk.Offset | undefined;
Expand Down Expand Up @@ -121,7 +121,7 @@ export interface DraggableOptions {
var node: undefined | HTMLElement & {_$opacity?} = dg.node;
if (node) {
node._$opacity = jq(node).css('opacity');
_dragging[node.toString()] = true;
_dragging.set(node, true);
}
if (node) {
jq(node)
Expand Down Expand Up @@ -150,7 +150,7 @@ export interface DraggableOptions {
duration: 200,
queue: '_draggable',
complete: function () {
delete _dragging[node!.toString()];
_dragging.delete(node);
}
});
}
Expand Down Expand Up @@ -813,7 +813,7 @@ export class Draggable extends zk.Object {
var node = this.node,
evt = jq.Event.zk(devt),
target = devt.target as HTMLElement;
if (_actTmout || (node && _dragging[node.toString()]) || evt.which != 1
if (_actTmout || _dragging.has(node) || evt.which != 1
|| (zk.webkit && jq.nodeName(target, 'select'))
|| (zk(target).isInput() && this.control != zk.Widget.$(target)))
return;
Expand Down
2 changes: 1 addition & 1 deletion zk/src/main/resources/web/js/zk/effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ export namespace eff {
let zic = n.style.zIndex || jq(n).css('z-index');
if (zic && zic != 'auto') {
zicv = zk.parseInt(zic);
if (zi == 'auto' || zicv > zi)
if (zi == 'auto' || zicv > (zi as number))
zi = zicv;
}
}
Expand Down
6 changes: 3 additions & 3 deletions zk/src/main/resources/web/js/zk/evt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export class Event<TData = unknown> extends zk.Object {
* @since 9.5.0
* @see {@link zKeys}
*/
isPressed(...args: string[]): boolean {
isPressed(...args: zKeys[]): boolean {
let keyCount = 0,
result = true;
for (var i = 0, len = args.length; i < len; i++) {
Expand All @@ -294,7 +294,7 @@ export class Event<TData = unknown> extends zk.Object {
keyCount++;
if (keyCount > 1)
throw 'Invalid key combination';
else if (arg != this.key)
else if (arg as string != this.key)
result = false;
} else if ((arg == zKeys.META && !this.metaKey) || (arg == zKeys.ALT && !this.altKey)
|| (arg == zKeys.CONTROL && !this.ctrlKey) || (arg == zKeys.SHIFT && !this.shiftKey)) {
Expand Down Expand Up @@ -452,7 +452,7 @@ function _target(inf: zk.Widget | [zk.Widget, CallableFunction]): zk.Widget {
function _fn(inf, o: zk.Widget, name: string): CallableFunction {
const fn = (Array.isArray(inf) ? inf[1] : o[name]) as undefined | CallableFunction;
if (!fn)
throw (o.className || o) + ':' + name + ' not found';
throw (o.className || o.widgetName) + ':' + name + ' not found';
return fn;
}
function _sync(): void {
Expand Down
4 changes: 2 additions & 2 deletions zk/src/main/resources/web/js/zk/fmt/numfmt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export let Number = {
var useMinsuFmt;
if (fmt.indexOf(';') != -1) {
var fmtArr = fmt.split(';');
useMinsuFmt = val < 0;
useMinsuFmt = (val as number) < 0;
fmt = fmtArr[useMinsuFmt ? 1 : 0];
}

Expand All @@ -106,7 +106,7 @@ export let Number = {
var pureFmtStr = efmt.pureFmtStr,
ind = efmt.purejdot,
fixed = ind >= 0 ? pureFmtStr.length - ind - 1 : 0,
valStr = (val + '').replace(/[^e\-0123456789.]/g, '').substring(val < 0 ? 1 : 0),
valStr = (val + '').replace(/[^e\-0123456789.]/g, '').substring((val as number) < 0 ? 1 : 0),
ei = valStr.lastIndexOf('e'),
indVal = valStr.indexOf('.'),
valFixed = indVal >= 0 ? (ei < 0 ? valStr.length : ei) - indVal - 1 : 0,
Expand Down
1 change: 1 addition & 0 deletions zk/src/main/resources/web/js/zk/pkg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ export function afterLoad(func: CallableFunction): boolean
* @see {@link load}
*/
export function afterLoad(pkgs: string, func: CallableFunction, front?: boolean): void
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
export function afterLoad(a: string | CallableFunction, b?: CallableFunction, front?: boolean): boolean | void {
if (typeof a == 'string') {
if (!b) return true;
Expand Down
19 changes: 9 additions & 10 deletions zk/src/main/resources/web/js/zk/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ function _unlistenFlex(wgt: zk.Widget): void {
* It is the low-level utility reserved for overriding for advanced customization.
*/
// zk scope
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
export var DnD = class { //for easy overriding
/**
* @returns the drop target from the event, or the element from the event's
Expand Down Expand Up @@ -2818,8 +2817,8 @@ new zul.wnd.Window({
this._zIndex = zIndex;
var n = this.$n();
if (n) {
n.style.zIndex = zIndex >= 0 ? (zIndex as string) : '';
if (opts && opts.fire) this.fire('onZIndex', (zIndex > 0 || zIndex === 0) ? zIndex : -1, {ignorable: true});
n.style.zIndex = (zIndex as number) >= 0 ? (zIndex as string) : '';
if (opts && opts.fire) this.fire('onZIndex', ((zIndex as number) > 0 || zIndex === 0) ? zIndex : -1, {ignorable: true});
}
}
return this;
Expand Down Expand Up @@ -3085,7 +3084,7 @@ new zul.wnd.Window({
if ((!no || !no.top) && (s = this.getTop()))
out += 'top:' + s + ';';
let zIndex;
if ((!no || !no.zIndex) && (zIndex = this.getZIndex()) >= 0)
if ((!no || !no.zIndex) && ((zIndex = this.getZIndex() as number)) >= 0)
out += 'z-index:' + zIndex + ';';
return DOMPurify.sanitize(out);
}
Expand Down Expand Up @@ -3364,11 +3363,11 @@ new zul.wnd.Window({
rerender(skipper?: Skipper | number): this
rerender(skipper?: Skipper | number): this {
if (this.desktop) {
if (!skipper || skipper > 0) { //default: 0
if (!skipper || (skipper as number) > 0) { //default: 0
_rerender(this, typeof skipper === 'number' ? skipper : 0);
return this;
}
if (skipper < 0)
if ((skipper as number) < 0)
skipper = undefined; //negative -> immediately

var n = this.$n();
Expand Down Expand Up @@ -4983,7 +4982,7 @@ new zul.wnd.Window({
if (fn) {
inf[listener] = bklsns[listener]
// eslint-disable-next-line no-new-func
= typeof fn != 'function' ? new Function('var event=arguments[0];' + fn) : fn;
= typeof fn != 'function' ? new Function('var event=arguments[0];' + (fn as string)) : fn;
this.listen(inf);
}
return this;
Expand All @@ -5000,7 +4999,7 @@ new zul.wnd.Window({
if (fn) {
inf[listener0] = bklsns[listener0]
// eslint-disable-next-line no-new-func
= typeof fn != 'function' ? new Function('var event=arguments[0];' + fn) : fn;
= typeof fn != 'function' ? new Function('var event=arguments[0];' + (fn as string)) : fn;
this.listen(inf);
}
return this;
Expand Down Expand Up @@ -6666,7 +6665,7 @@ export namespace widget_global {
var widget = zk.Widget.$(n, opts);
if (widget)
return widget.$service();
zk.error('Not found ZK Service with [' + n + ']');
zk.error('Not found ZK Service with [' + String(n) + ']');
return undefined;
}
};
Expand Down Expand Up @@ -6993,7 +6992,7 @@ export var NoDOM = class NoDOM {
var context = this.$getInterceptorContext$();
for (var w = this.firstChild; w; w = w.nextSibling) {
if (visible)
w.setDomVisible_(w.$n()!, w.isVisible()!, opts);
w.setDomVisible_(w.$n()!, w.isVisible(), opts);
else
w.setDomVisible_(w.$n()!, visible, opts);
}
Expand Down
2 changes: 1 addition & 1 deletion zk/src/main/resources/web/js/zk/zswipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class Swipe extends zk.Object {
// eslint-disable-next-line @typescript-eslint/dot-notation
this.node = node ? jq(node, zk)[0] as HTMLElement | undefined : widget['node'] as HTMLElement | undefined || (widget.$n ? widget.$n() : undefined);
if (!this.node)
throw 'Handle required for ' + widget;
throw 'Handle required for ' + widget.uuid + ' on ' + widget.widgetName;

this.opts = zk.$default(opts, {
scrollThreshold: 5,
Expand Down
Loading
Loading