@ktjs/shared 0.22.6 → 0.22.7
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/index.d.ts +4 -2
- package/dist/index.iife.js +22 -18
- package/dist/index.legacy.js +22 -18
- package/dist/index.mjs +20 -18
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -40,6 +40,8 @@ declare const $isThenable: (o: any) => o is Promise<any>;
|
|
|
40
40
|
*/
|
|
41
41
|
declare const $throw: (message: string) => never;
|
|
42
42
|
declare const $warn: (message: string) => void;
|
|
43
|
+
declare const $error: (message: string) => void;
|
|
44
|
+
declare const $debug: (message: string) => void;
|
|
43
45
|
|
|
44
46
|
type otherstring = string & {};
|
|
45
47
|
|
|
@@ -123,7 +125,6 @@ declare const $buttonDisabledGetter: () => any;
|
|
|
123
125
|
declare const $buttonDisabledSetter: (v: any) => void;
|
|
124
126
|
declare const parseStyle: (style: string | Partial<CSSStyleDeclaration> | undefined) => string;
|
|
125
127
|
type ChangeHandler<T = string> = (value: T, ...args: any[]) => void;
|
|
126
|
-
declare const generateHandler: <T = string>(props: any, key: string) => ChangeHandler<T>;
|
|
127
128
|
/**
|
|
128
129
|
* Used for `k-model`
|
|
129
130
|
*/
|
|
@@ -136,6 +137,7 @@ declare const applyModel: (element: HTMLElementTagNameMap[InputElementTag], valu
|
|
|
136
137
|
* Default empty function
|
|
137
138
|
*/
|
|
138
139
|
declare const $emptyFn: (...args: any[]) => any;
|
|
140
|
+
declare const $isSame: (a: unknown, b: unknown) => boolean;
|
|
139
141
|
|
|
140
142
|
/**
|
|
141
143
|
* Normalize path by joining parts and ensuring leading slash
|
|
@@ -160,5 +162,5 @@ declare const emplaceParams: (path: string, params: Record<string, string>) => s
|
|
|
160
162
|
*/
|
|
161
163
|
declare const extractParams: (pattern: string, path: string) => Record<string, string> | null;
|
|
162
164
|
|
|
163
|
-
export { $ArrayFrom, $append, $appendChild, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $define, $defines, $emptyFn, $entries, $hasOwn, $is, $isArray, $isNode, $isThenable, $keys, $random, $replaceNode, $throw, $toString, $warn, DIRV_TYPE, MATHML_ATTR_FLAG, SVG_ATTR_FLAG, applyModel, buildQuery, emplaceParams, extractParams,
|
|
165
|
+
export { $ArrayFrom, $append, $appendChild, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $debug, $define, $defines, $emptyFn, $entries, $error, $hasOwn, $is, $isArray, $isNode, $isSame, $isThenable, $keys, $random, $replaceNode, $throw, $toString, $warn, DIRV_TYPE, MATHML_ATTR_FLAG, SVG_ATTR_FLAG, applyModel, buildQuery, emplaceParams, extractParams, normalizePath, parseQuery, parseStyle };
|
|
164
166
|
export type { ChangeHandler, ChangeTriggerField, HTMLTag, InputElementTag, MathMLTag, NoTextNodeTag, NonSpecialTags, SVGTag, otherstring };
|
package/dist/index.iife.js
CHANGED
|
@@ -41,12 +41,12 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
41
41
|
const $warn = (message) => {
|
|
42
42
|
console.warn('[kt.js warn] ' + message);
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
const $error = (message) => {
|
|
45
|
+
console.error('[kt.js error] ' + message);
|
|
46
|
+
};
|
|
47
|
+
const $debug = (message) => {
|
|
48
|
+
console.debug('[kt.js debug] ' + message);
|
|
49
|
+
};
|
|
50
50
|
|
|
51
51
|
// DOM manipulation utilities
|
|
52
52
|
// # dom natives
|
|
@@ -114,16 +114,6 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
114
114
|
}
|
|
115
115
|
return '';
|
|
116
116
|
};
|
|
117
|
-
const generateHandler = (props, key) => {
|
|
118
|
-
const handler = props[key];
|
|
119
|
-
if (typeof handler === 'function') {
|
|
120
|
-
return handler;
|
|
121
|
-
}
|
|
122
|
-
else if (handler && typeof handler === 'object' && handler.isKT) {
|
|
123
|
-
return (value) => (handler.value = value);
|
|
124
|
-
}
|
|
125
|
-
return $emptyFn;
|
|
126
|
-
};
|
|
127
117
|
/**
|
|
128
118
|
* Used for `k-model`
|
|
129
119
|
*/
|
|
@@ -133,6 +123,18 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
133
123
|
element.addEventListener(eventName, () => (valueRef.value = element[propName]));
|
|
134
124
|
};
|
|
135
125
|
|
|
126
|
+
// String manipulation utilities
|
|
127
|
+
/**
|
|
128
|
+
* Default empty function
|
|
129
|
+
*/
|
|
130
|
+
const $emptyFn = (() => true);
|
|
131
|
+
const $isSame = (a, b) => {
|
|
132
|
+
if ($isArray(a)) {
|
|
133
|
+
return true; // always trigger an array
|
|
134
|
+
}
|
|
135
|
+
return $is(a, b);
|
|
136
|
+
};
|
|
137
|
+
|
|
136
138
|
/**
|
|
137
139
|
* Normalize path by joining parts and ensuring leading slash
|
|
138
140
|
*/
|
|
@@ -213,7 +215,7 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
213
215
|
}
|
|
214
216
|
|
|
215
217
|
// Shared utilities and cached native methods for kt.js framework
|
|
216
|
-
Object.defineProperty(window, '__ktjs__', { value: '0.22.
|
|
218
|
+
Object.defineProperty(window, '__ktjs__', { value: '0.22.7' });
|
|
217
219
|
|
|
218
220
|
exports.$ArrayFrom = $ArrayFrom;
|
|
219
221
|
exports.$append = $append;
|
|
@@ -221,14 +223,17 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
221
223
|
exports.$assign = $assign;
|
|
222
224
|
exports.$buttonDisabledGetter = $buttonDisabledGetter;
|
|
223
225
|
exports.$buttonDisabledSetter = $buttonDisabledSetter;
|
|
226
|
+
exports.$debug = $debug;
|
|
224
227
|
exports.$define = $define;
|
|
225
228
|
exports.$defines = $defines;
|
|
226
229
|
exports.$emptyFn = $emptyFn;
|
|
227
230
|
exports.$entries = $entries;
|
|
231
|
+
exports.$error = $error;
|
|
228
232
|
exports.$hasOwn = $hasOwn;
|
|
229
233
|
exports.$is = $is;
|
|
230
234
|
exports.$isArray = $isArray;
|
|
231
235
|
exports.$isNode = $isNode;
|
|
236
|
+
exports.$isSame = $isSame;
|
|
232
237
|
exports.$isThenable = $isThenable;
|
|
233
238
|
exports.$keys = $keys;
|
|
234
239
|
exports.$random = $random;
|
|
@@ -243,7 +248,6 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
243
248
|
exports.buildQuery = buildQuery;
|
|
244
249
|
exports.emplaceParams = emplaceParams;
|
|
245
250
|
exports.extractParams = extractParams;
|
|
246
|
-
exports.generateHandler = generateHandler;
|
|
247
251
|
exports.normalizePath = normalizePath;
|
|
248
252
|
exports.parseQuery = parseQuery;
|
|
249
253
|
exports.parseStyle = parseStyle;
|
package/dist/index.legacy.js
CHANGED
|
@@ -41,12 +41,12 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
41
41
|
var $warn = function (message) {
|
|
42
42
|
console.warn('[kt.js warn] ' + message);
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
var $error = function (message) {
|
|
45
|
+
console.error('[kt.js error] ' + message);
|
|
46
|
+
};
|
|
47
|
+
var $debug = function (message) {
|
|
48
|
+
console.debug('[kt.js debug] ' + message);
|
|
49
|
+
};
|
|
50
50
|
|
|
51
51
|
// DOM manipulation utilities
|
|
52
52
|
var _a;
|
|
@@ -120,16 +120,6 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
120
120
|
}
|
|
121
121
|
return '';
|
|
122
122
|
};
|
|
123
|
-
var generateHandler = function (props, key) {
|
|
124
|
-
var handler = props[key];
|
|
125
|
-
if (typeof handler === 'function') {
|
|
126
|
-
return handler;
|
|
127
|
-
}
|
|
128
|
-
else if (handler && typeof handler === 'object' && handler.isKT) {
|
|
129
|
-
return function (value) { return (handler.value = value); };
|
|
130
|
-
}
|
|
131
|
-
return $emptyFn;
|
|
132
|
-
};
|
|
133
123
|
/**
|
|
134
124
|
* Used for `k-model`
|
|
135
125
|
*/
|
|
@@ -139,6 +129,18 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
139
129
|
element.addEventListener(eventName, function () { return (valueRef.value = element[propName]); });
|
|
140
130
|
};
|
|
141
131
|
|
|
132
|
+
// String manipulation utilities
|
|
133
|
+
/**
|
|
134
|
+
* Default empty function
|
|
135
|
+
*/
|
|
136
|
+
var $emptyFn = (function () { return true; });
|
|
137
|
+
var $isSame = function (a, b) {
|
|
138
|
+
if ($isArray(a)) {
|
|
139
|
+
return true; // always trigger an array
|
|
140
|
+
}
|
|
141
|
+
return $is(a, b);
|
|
142
|
+
};
|
|
143
|
+
|
|
142
144
|
/**
|
|
143
145
|
* Normalize path by joining parts and ensuring leading slash
|
|
144
146
|
*/
|
|
@@ -224,7 +226,7 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
224
226
|
}
|
|
225
227
|
|
|
226
228
|
// Shared utilities and cached native methods for kt.js framework
|
|
227
|
-
Object.defineProperty(window, '__ktjs__', { value: '0.22.
|
|
229
|
+
Object.defineProperty(window, '__ktjs__', { value: '0.22.7' });
|
|
228
230
|
|
|
229
231
|
exports.$ArrayFrom = $ArrayFrom;
|
|
230
232
|
exports.$append = $append;
|
|
@@ -232,14 +234,17 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
232
234
|
exports.$assign = $assign;
|
|
233
235
|
exports.$buttonDisabledGetter = $buttonDisabledGetter;
|
|
234
236
|
exports.$buttonDisabledSetter = $buttonDisabledSetter;
|
|
237
|
+
exports.$debug = $debug;
|
|
235
238
|
exports.$define = $define;
|
|
236
239
|
exports.$defines = $defines;
|
|
237
240
|
exports.$emptyFn = $emptyFn;
|
|
238
241
|
exports.$entries = $entries;
|
|
242
|
+
exports.$error = $error;
|
|
239
243
|
exports.$hasOwn = $hasOwn;
|
|
240
244
|
exports.$is = $is;
|
|
241
245
|
exports.$isArray = $isArray;
|
|
242
246
|
exports.$isNode = $isNode;
|
|
247
|
+
exports.$isSame = $isSame;
|
|
243
248
|
exports.$isThenable = $isThenable;
|
|
244
249
|
exports.$keys = $keys;
|
|
245
250
|
exports.$random = $random;
|
|
@@ -254,7 +259,6 @@ var __ktjs_shared__ = (function (exports) {
|
|
|
254
259
|
exports.buildQuery = buildQuery;
|
|
255
260
|
exports.emplaceParams = emplaceParams;
|
|
256
261
|
exports.extractParams = extractParams;
|
|
257
|
-
exports.generateHandler = generateHandler;
|
|
258
262
|
exports.normalizePath = normalizePath;
|
|
259
263
|
exports.parseQuery = parseQuery;
|
|
260
264
|
exports.parseStyle = parseStyle;
|
package/dist/index.mjs
CHANGED
|
@@ -38,12 +38,12 @@ const $throw = (message) => {
|
|
|
38
38
|
const $warn = (message) => {
|
|
39
39
|
console.warn('[kt.js warn] ' + message);
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
const $error = (message) => {
|
|
42
|
+
console.error('[kt.js error] ' + message);
|
|
43
|
+
};
|
|
44
|
+
const $debug = (message) => {
|
|
45
|
+
console.debug('[kt.js debug] ' + message);
|
|
46
|
+
};
|
|
47
47
|
|
|
48
48
|
// DOM manipulation utilities
|
|
49
49
|
// # dom natives
|
|
@@ -111,16 +111,6 @@ const parseStyle = (style) => {
|
|
|
111
111
|
}
|
|
112
112
|
return '';
|
|
113
113
|
};
|
|
114
|
-
const generateHandler = (props, key) => {
|
|
115
|
-
const handler = props[key];
|
|
116
|
-
if (typeof handler === 'function') {
|
|
117
|
-
return handler;
|
|
118
|
-
}
|
|
119
|
-
else if (handler && typeof handler === 'object' && handler.isKT) {
|
|
120
|
-
return (value) => (handler.value = value);
|
|
121
|
-
}
|
|
122
|
-
return $emptyFn;
|
|
123
|
-
};
|
|
124
114
|
/**
|
|
125
115
|
* Used for `k-model`
|
|
126
116
|
*/
|
|
@@ -130,6 +120,18 @@ const applyModel = (element, valueRef, propName, eventName) => {
|
|
|
130
120
|
element.addEventListener(eventName, () => (valueRef.value = element[propName]));
|
|
131
121
|
};
|
|
132
122
|
|
|
123
|
+
// String manipulation utilities
|
|
124
|
+
/**
|
|
125
|
+
* Default empty function
|
|
126
|
+
*/
|
|
127
|
+
const $emptyFn = (() => true);
|
|
128
|
+
const $isSame = (a, b) => {
|
|
129
|
+
if ($isArray(a)) {
|
|
130
|
+
return true; // always trigger an array
|
|
131
|
+
}
|
|
132
|
+
return $is(a, b);
|
|
133
|
+
};
|
|
134
|
+
|
|
133
135
|
/**
|
|
134
136
|
* Normalize path by joining parts and ensuring leading slash
|
|
135
137
|
*/
|
|
@@ -210,6 +212,6 @@ if (typeof Symbol === 'undefined') {
|
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
// Shared utilities and cached native methods for kt.js framework
|
|
213
|
-
Object.defineProperty(window, '__ktjs__', { value: '0.22.
|
|
215
|
+
Object.defineProperty(window, '__ktjs__', { value: '0.22.7' });
|
|
214
216
|
|
|
215
|
-
export { $ArrayFrom, $append, $appendChild, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $define, $defines, $emptyFn, $entries, $hasOwn, $is, $isArray, $isNode, $isThenable, $keys, $random, $replaceNode, $throw, $toString, $warn, DIRV_TYPE, MATHML_ATTR_FLAG, SVG_ATTR_FLAG, applyModel, buildQuery, emplaceParams, extractParams,
|
|
217
|
+
export { $ArrayFrom, $append, $appendChild, $assign, $buttonDisabledGetter, $buttonDisabledSetter, $debug, $define, $defines, $emptyFn, $entries, $error, $hasOwn, $is, $isArray, $isNode, $isSame, $isThenable, $keys, $random, $replaceNode, $throw, $toString, $warn, DIRV_TYPE, MATHML_ATTR_FLAG, SVG_ATTR_FLAG, applyModel, buildQuery, emplaceParams, extractParams, normalizePath, parseQuery, parseStyle };
|