@ktjs/shared 0.19.0 → 0.20.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/index.d.ts CHANGED
@@ -14,6 +14,8 @@ declare const $throw: (message: string) => never;
14
14
  declare const $appendChild: <T extends Node>(node: T) => T;
15
15
  declare const originAppend: (...nodes: (Node | string)[]) => void;
16
16
  declare const $append: typeof originAppend;
17
+ declare const $buttonDisabledGetter: () => any;
18
+ declare const $buttonDisabledSetter: (v: any) => void;
17
19
  declare const parseStyle: (style: string | Partial<CSSStyleDeclaration> | undefined) => string;
18
20
  type ChangeHandler<T = string> = (value: T, ...args: any[]) => void;
19
21
  declare const generateHandler: <T = string>(props: any, key: string) => ChangeHandler<T>;
@@ -46,5 +48,5 @@ declare const emplaceParams: (path: string, params: Record<string, string>) => s
46
48
  */
47
49
  declare const extractParams: (pattern: string, path: string) => Record<string, string> | null;
48
50
 
49
- export { $append, $appendChild, $defines, $emptyFn, $entries, $hasOwn, $isArray, $isThenable, $keys, $throw, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
51
+ export { $append, $appendChild, $buttonDisabledGetter, $buttonDisabledSetter, $defines, $emptyFn, $entries, $hasOwn, $isArray, $isThenable, $keys, $throw, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
50
52
  export type { ChangeHandler };
@@ -21,6 +21,7 @@ var __ktjs_shared__ = (function (exports) {
21
21
  const $emptyFn = (() => true);
22
22
 
23
23
  // DOM manipulation utilities
24
+ // # dom natives
24
25
  /**
25
26
  * & Remove `bind` because it is shockingly slower than wrapper
26
27
  * & `window.document` is safe because it is not configurable and its setter is undefined
@@ -56,7 +57,8 @@ var __ktjs_shared__ = (function (exports) {
56
57
  $appendChild.call(this, fragment);
57
58
  }
58
59
  };
59
- // Style parsing utilities
60
+ const { get: $buttonDisabledGetter, set: $buttonDisabledSetter } = Object.getOwnPropertyDescriptor(HTMLButtonElement.prototype, 'disabled');
61
+ // # DOM utilities
60
62
  const parseStyle = (style) => {
61
63
  if (typeof style === 'string') {
62
64
  return style;
@@ -158,10 +160,12 @@ var __ktjs_shared__ = (function (exports) {
158
160
 
159
161
  // Shared utilities and cached native methods for kt.js framework
160
162
  // Re-export all utilities
161
- Object.defineProperty(window, '@ktjs/shared', { value: '0.19.0' });
163
+ Object.defineProperty(window, '@ktjs/shared', { value: '0.20.0' });
162
164
 
163
165
  exports.$append = $append;
164
166
  exports.$appendChild = $appendChild;
167
+ exports.$buttonDisabledGetter = $buttonDisabledGetter;
168
+ exports.$buttonDisabledSetter = $buttonDisabledSetter;
165
169
  exports.$defines = $defines;
166
170
  exports.$emptyFn = $emptyFn;
167
171
  exports.$entries = $entries;
@@ -23,6 +23,8 @@ var __ktjs_shared__ = (function (exports) {
23
23
  var $emptyFn = (function () { return true; });
24
24
 
25
25
  // DOM manipulation utilities
26
+ var _a;
27
+ // # dom natives
26
28
  /**
27
29
  * & Remove `bind` because it is shockingly slower than wrapper
28
30
  * & `window.document` is safe because it is not configurable and its setter is undefined
@@ -62,7 +64,8 @@ var __ktjs_shared__ = (function (exports) {
62
64
  $appendChild.call(this, fragment);
63
65
  }
64
66
  };
65
- // Style parsing utilities
67
+ var $buttonDisabledGetter = (_a = Object.getOwnPropertyDescriptor(HTMLButtonElement.prototype, 'disabled'), _a.get), $buttonDisabledSetter = _a.set;
68
+ // # DOM utilities
66
69
  var parseStyle = function (style) {
67
70
  if (typeof style === 'string') {
68
71
  return style;
@@ -170,10 +173,12 @@ var __ktjs_shared__ = (function (exports) {
170
173
 
171
174
  // Shared utilities and cached native methods for kt.js framework
172
175
  // Re-export all utilities
173
- Object.defineProperty(window, '@ktjs/shared', { value: '0.19.0' });
176
+ Object.defineProperty(window, '@ktjs/shared', { value: '0.20.0' });
174
177
 
175
178
  exports.$append = $append;
176
179
  exports.$appendChild = $appendChild;
180
+ exports.$buttonDisabledGetter = $buttonDisabledGetter;
181
+ exports.$buttonDisabledSetter = $buttonDisabledSetter;
177
182
  exports.$defines = $defines;
178
183
  exports.$emptyFn = $emptyFn;
179
184
  exports.$entries = $entries;
package/dist/index.mjs CHANGED
@@ -18,6 +18,7 @@ const $throw = (message) => {
18
18
  const $emptyFn = (() => true);
19
19
 
20
20
  // DOM manipulation utilities
21
+ // # dom natives
21
22
  /**
22
23
  * & Remove `bind` because it is shockingly slower than wrapper
23
24
  * & `window.document` is safe because it is not configurable and its setter is undefined
@@ -53,7 +54,8 @@ const $append = // for ie 9/10/11
53
54
  $appendChild.call(this, fragment);
54
55
  }
55
56
  };
56
- // Style parsing utilities
57
+ const { get: $buttonDisabledGetter, set: $buttonDisabledSetter } = Object.getOwnPropertyDescriptor(HTMLButtonElement.prototype, 'disabled');
58
+ // # DOM utilities
57
59
  const parseStyle = (style) => {
58
60
  if (typeof style === 'string') {
59
61
  return style;
@@ -155,6 +157,6 @@ const extractParams = (pattern, path) => {
155
157
 
156
158
  // Shared utilities and cached native methods for kt.js framework
157
159
  // Re-export all utilities
158
- Object.defineProperty(window, '@ktjs/shared', { value: '0.19.0' });
160
+ Object.defineProperty(window, '@ktjs/shared', { value: '0.20.0' });
159
161
 
160
- export { $append, $appendChild, $defines, $emptyFn, $entries, $hasOwn, $isArray, $isThenable, $keys, $throw, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
162
+ export { $append, $appendChild, $buttonDisabledGetter, $buttonDisabledSetter, $defines, $emptyFn, $entries, $hasOwn, $isArray, $isThenable, $keys, $throw, buildQuery, emplaceParams, extractParams, generateHandler, normalizePath, parseQuery, parseStyle };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ktjs/shared",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "description": "Shared utilities and cached native methods for kt.js framework",
5
5
  "type": "module",
6
6
  "module": "./dist/index.mjs",