@fluffjs/fluff 0.2.2 → 0.2.4

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.
Files changed (194) hide show
  1. package/package.json +1 -1
  2. package/{src/runtime → runtime}/FluffBase.d.ts +1 -0
  3. package/{src/runtime → runtime}/FluffBase.js +20 -5
  4. package/runtime/tests/createPropertyUnwrapNativeTestComponents.d.ts +4 -0
  5. package/runtime/tests/createPropertyUnwrapNativeTestComponents.js +23 -0
  6. package/{src/runtime → runtime}/tests/typeguards.d.ts +21 -0
  7. package/runtime/tests/typeguards.js +66 -0
  8. package/src/runtime/tests/typeguards.js +0 -18
  9. /package/{src/decorators → decorators}/Component.d.ts +0 -0
  10. /package/{src/decorators → decorators}/Component.js +0 -0
  11. /package/{src/decorators → decorators}/HostBinding.d.ts +0 -0
  12. /package/{src/decorators → decorators}/HostBinding.js +0 -0
  13. /package/{src/decorators → decorators}/HostListener.d.ts +0 -0
  14. /package/{src/decorators → decorators}/HostListener.js +0 -0
  15. /package/{src/decorators → decorators}/Input.d.ts +0 -0
  16. /package/{src/decorators → decorators}/Input.js +0 -0
  17. /package/{src/decorators → decorators}/InputOutputHelper.d.ts +0 -0
  18. /package/{src/decorators → decorators}/InputOutputHelper.js +0 -0
  19. /package/{src/decorators → decorators}/LinkedProperty.d.ts +0 -0
  20. /package/{src/decorators → decorators}/LinkedProperty.js +0 -0
  21. /package/{src/decorators → decorators}/MetadataArrayHelper.d.ts +0 -0
  22. /package/{src/decorators → decorators}/MetadataArrayHelper.js +0 -0
  23. /package/{src/decorators → decorators}/Output.d.ts +0 -0
  24. /package/{src/decorators → decorators}/Output.js +0 -0
  25. /package/{src/decorators → decorators}/Pipe.d.ts +0 -0
  26. /package/{src/decorators → decorators}/Pipe.js +0 -0
  27. /package/{src/decorators → decorators}/Reactive.d.ts +0 -0
  28. /package/{src/decorators → decorators}/Reactive.js +0 -0
  29. /package/{src/decorators → decorators}/ViewChild.d.ts +0 -0
  30. /package/{src/decorators → decorators}/ViewChild.js +0 -0
  31. /package/{src/decorators → decorators}/Watch.d.ts +0 -0
  32. /package/{src/decorators → decorators}/Watch.js +0 -0
  33. /package/{src/enums → enums}/Direction.d.ts +0 -0
  34. /package/{src/enums → enums}/Direction.js +0 -0
  35. /package/{src/index.d.ts → index.d.ts} +0 -0
  36. /package/{src/index.js → index.js} +0 -0
  37. /package/{src/interfaces → interfaces}/BreakMarkerConfig.d.ts +0 -0
  38. /package/{src/interfaces → interfaces}/BreakMarkerConfig.js +0 -0
  39. /package/{src/interfaces → interfaces}/FluffHostElement.d.ts +0 -0
  40. /package/{src/interfaces → interfaces}/FluffHostElement.js +0 -0
  41. /package/{src/interfaces → interfaces}/ForMarkerConfig.d.ts +0 -0
  42. /package/{src/interfaces → interfaces}/ForMarkerConfig.js +0 -0
  43. /package/{src/interfaces → interfaces}/IfMarkerConfig.d.ts +0 -0
  44. /package/{src/interfaces → interfaces}/IfMarkerConfig.js +0 -0
  45. /package/{src/interfaces → interfaces}/MarkerConfig.d.ts +0 -0
  46. /package/{src/interfaces → interfaces}/MarkerConfig.js +0 -0
  47. /package/{src/interfaces → interfaces}/OnDestroy.d.ts +0 -0
  48. /package/{src/interfaces → interfaces}/OnDestroy.js +0 -0
  49. /package/{src/interfaces → interfaces}/OnInit.d.ts +0 -0
  50. /package/{src/interfaces → interfaces}/OnInit.js +0 -0
  51. /package/{src/interfaces → interfaces}/PropertyChain.d.ts +0 -0
  52. /package/{src/interfaces → interfaces}/PropertyChain.js +0 -0
  53. /package/{src/interfaces → interfaces}/RenderContext.d.ts +0 -0
  54. /package/{src/interfaces → interfaces}/RenderContext.js +0 -0
  55. /package/{src/interfaces → interfaces}/Subscription.d.ts +0 -0
  56. /package/{src/interfaces → interfaces}/Subscription.js +0 -0
  57. /package/{src/interfaces → interfaces}/SwitchMarkerConfig.d.ts +0 -0
  58. /package/{src/interfaces → interfaces}/SwitchMarkerConfig.js +0 -0
  59. /package/{src/interfaces → interfaces}/TextMarkerConfig.d.ts +0 -0
  60. /package/{src/interfaces → interfaces}/TextMarkerConfig.js +0 -0
  61. /package/{src/runtime → runtime}/BreakController.d.ts +0 -0
  62. /package/{src/runtime → runtime}/BreakController.js +0 -0
  63. /package/{src/runtime → runtime}/FluffElement.d.ts +0 -0
  64. /package/{src/runtime → runtime}/FluffElement.js +0 -0
  65. /package/{src/runtime → runtime}/FluffElementImpl.d.ts +0 -0
  66. /package/{src/runtime → runtime}/FluffElementImpl.js +0 -0
  67. /package/{src/runtime → runtime}/FluffMarkers.d.ts +0 -0
  68. /package/{src/runtime → runtime}/FluffMarkers.js +0 -0
  69. /package/{src/runtime → runtime}/ForController.d.ts +0 -0
  70. /package/{src/runtime → runtime}/ForController.js +0 -0
  71. /package/{src/runtime → runtime}/IfController.d.ts +0 -0
  72. /package/{src/runtime → runtime}/IfController.js +0 -0
  73. /package/{src/runtime → runtime}/MarkerConfigGuards.d.ts +0 -0
  74. /package/{src/runtime → runtime}/MarkerConfigGuards.js +0 -0
  75. /package/{src/runtime → runtime}/MarkerController.d.ts +0 -0
  76. /package/{src/runtime → runtime}/MarkerController.js +0 -0
  77. /package/{src/runtime → runtime}/MarkerManager.d.ts +0 -0
  78. /package/{src/runtime → runtime}/MarkerManager.js +0 -0
  79. /package/{src/runtime → runtime}/MarkerManagerInterface.d.ts +0 -0
  80. /package/{src/runtime → runtime}/MarkerManagerInterface.js +0 -0
  81. /package/{src/runtime → runtime}/ScopeRegistry.d.ts +0 -0
  82. /package/{src/runtime → runtime}/ScopeRegistry.js +0 -0
  83. /package/{src/runtime → runtime}/SwitchController.d.ts +0 -0
  84. /package/{src/runtime → runtime}/SwitchController.js +0 -0
  85. /package/{src/runtime → runtime}/TextController.d.ts +0 -0
  86. /package/{src/runtime → runtime}/TextController.js +0 -0
  87. /package/{src/runtime → runtime}/tests/DirectOutputChild.d.ts +0 -0
  88. /package/{src/runtime → runtime}/tests/DirectOutputChild.js +0 -0
  89. /package/{src/runtime → runtime}/tests/DirectOutputParent.d.ts +0 -0
  90. /package/{src/runtime → runtime}/tests/DirectOutputParent.js +0 -0
  91. /package/{src/runtime → runtime}/tests/TaskStats.d.ts +0 -0
  92. /package/{src/runtime → runtime}/tests/TaskStats.js +0 -0
  93. /package/{src/runtime → runtime}/tests/TestChildTasksListComponent.d.ts +0 -0
  94. /package/{src/runtime → runtime}/tests/TestChildTasksListComponent.js +0 -0
  95. /package/{src/runtime → runtime}/tests/TestDirectChildComponent.d.ts +0 -0
  96. /package/{src/runtime → runtime}/tests/TestDirectChildComponent.js +0 -0
  97. /package/{src/runtime → runtime}/tests/TestDirectParentComponent.d.ts +0 -0
  98. /package/{src/runtime → runtime}/tests/TestDirectParentComponent.js +0 -0
  99. /package/{src/runtime → runtime}/tests/TestForChildComponent.d.ts +0 -0
  100. /package/{src/runtime → runtime}/tests/TestForChildComponent.js +0 -0
  101. /package/{src/runtime → runtime}/tests/TestForComponent.d.ts +0 -0
  102. /package/{src/runtime → runtime}/tests/TestForComponent.js +0 -0
  103. /package/{src/runtime → runtime}/tests/TestForReinsertBindsInputParentComponent.d.ts +0 -0
  104. /package/{src/runtime → runtime}/tests/TestForReinsertBindsInputParentComponent.js +0 -0
  105. /package/{src/runtime → runtime}/tests/TestForTextMarkerCollisionNoTrackParentComponent.d.ts +0 -0
  106. /package/{src/runtime → runtime}/tests/TestForTextMarkerCollisionNoTrackParentComponent.js +0 -0
  107. /package/{src/runtime → runtime}/tests/TestForTextMarkerCollisionParentComponent.d.ts +0 -0
  108. /package/{src/runtime → runtime}/tests/TestForTextMarkerCollisionParentComponent.js +0 -0
  109. /package/{src/runtime → runtime}/tests/TestForUnsubscribeNestedParentComponent.d.ts +0 -0
  110. /package/{src/runtime → runtime}/tests/TestForUnsubscribeNestedParentComponent.js +0 -0
  111. /package/{src/runtime → runtime}/tests/TestGetterReactivityComponent.d.ts +0 -0
  112. /package/{src/runtime → runtime}/tests/TestGetterReactivityComponent.js +0 -0
  113. /package/{src/runtime → runtime}/tests/TestIfReinsertBindsInputChildComponent.d.ts +0 -0
  114. /package/{src/runtime → runtime}/tests/TestIfReinsertBindsInputChildComponent.js +0 -0
  115. /package/{src/runtime → runtime}/tests/TestIfReinsertBindsInputParentComponent.d.ts +0 -0
  116. /package/{src/runtime → runtime}/tests/TestIfReinsertBindsInputParentComponent.js +0 -0
  117. /package/{src/runtime → runtime}/tests/TestIfUnsubscribeNestedParentComponent.d.ts +0 -0
  118. /package/{src/runtime → runtime}/tests/TestIfUnsubscribeNestedParentComponent.js +0 -0
  119. /package/{src/runtime → runtime}/tests/TestInterpolationNestedPropertyComponentBase.d.ts +0 -0
  120. /package/{src/runtime → runtime}/tests/TestInterpolationNestedPropertyComponentBase.js +0 -0
  121. /package/{src/runtime → runtime}/tests/TestInterpolationNestedPropertyContainerClass.d.ts +0 -0
  122. /package/{src/runtime → runtime}/tests/TestInterpolationNestedPropertyContainerClass.js +0 -0
  123. /package/{src/runtime → runtime}/tests/TestLateDefineForChildComponent.d.ts +0 -0
  124. /package/{src/runtime → runtime}/tests/TestLateDefineForChildComponent.js +0 -0
  125. /package/{src/runtime → runtime}/tests/TestLateDefineForComponent.d.ts +0 -0
  126. /package/{src/runtime → runtime}/tests/TestLateDefineForComponent.js +0 -0
  127. /package/{src/runtime → runtime}/tests/TestNullInputTextComponent.d.ts +0 -0
  128. /package/{src/runtime → runtime}/tests/TestNullInputTextComponent.js +0 -0
  129. /package/{src/runtime → runtime}/tests/TestOutputBindingChildComponent.d.ts +0 -0
  130. /package/{src/runtime → runtime}/tests/TestOutputBindingChildComponent.js +0 -0
  131. /package/{src/runtime → runtime}/tests/TestOutputBindingParentComponent.d.ts +0 -0
  132. /package/{src/runtime → runtime}/tests/TestOutputBindingParentComponent.js +0 -0
  133. /package/{src/runtime → runtime}/tests/TestParentBindsTasksComponent.d.ts +0 -0
  134. /package/{src/runtime → runtime}/tests/TestParentBindsTasksComponent.js +0 -0
  135. /package/{src/runtime → runtime}/tests/TestPropertyBindingPipeChildComponent.d.ts +0 -0
  136. /package/{src/runtime → runtime}/tests/TestPropertyBindingPipeChildComponent.js +0 -0
  137. /package/{src/runtime → runtime}/tests/TestPropertyBindingPipeParentComponent.d.ts +0 -0
  138. /package/{src/runtime → runtime}/tests/TestPropertyBindingPipeParentComponent.js +0 -0
  139. /package/{src/runtime → runtime}/tests/TestPropertyUnwrapChildComponent.d.ts +0 -0
  140. /package/{src/runtime → runtime}/tests/TestPropertyUnwrapChildComponent.js +0 -0
  141. /package/{src/runtime → runtime}/tests/TestPropertyUnwrapContainerClass.d.ts +0 -0
  142. /package/{src/runtime → runtime}/tests/TestPropertyUnwrapContainerClass.js +0 -0
  143. /package/{src/runtime → runtime}/tests/TestPropertyUnwrapParentComponent.d.ts +0 -0
  144. /package/{src/runtime → runtime}/tests/TestPropertyUnwrapParentComponent.js +0 -0
  145. /package/{src/runtime → runtime}/tests/TestSwitchReinsertBindsInputChildComponent.d.ts +0 -0
  146. /package/{src/runtime → runtime}/tests/TestSwitchReinsertBindsInputChildComponent.js +0 -0
  147. /package/{src/runtime → runtime}/tests/TestSwitchReinsertBindsInputParentComponent.d.ts +0 -0
  148. /package/{src/runtime → runtime}/tests/TestSwitchReinsertBindsInputParentComponent.js +0 -0
  149. /package/{src/runtime → runtime}/tests/TestSwitchUnsubscribeNestedParentComponent.d.ts +0 -0
  150. /package/{src/runtime → runtime}/tests/TestSwitchUnsubscribeNestedParentComponent.js +0 -0
  151. /package/{src/runtime → runtime}/tests/TestTemplateNestedMarkersComponent.d.ts +0 -0
  152. /package/{src/runtime → runtime}/tests/TestTemplateNestedMarkersComponent.js +0 -0
  153. /package/{src/runtime → runtime}/tests/TestUnsubscribeNestedChildComponent.d.ts +0 -0
  154. /package/{src/runtime → runtime}/tests/TestUnsubscribeNestedChildComponent.js +0 -0
  155. /package/{src/runtime → runtime}/tests/TestUnsubscribeNestedGrandchildComponent.d.ts +0 -0
  156. /package/{src/runtime → runtime}/tests/TestUnsubscribeNestedGrandchildComponent.js +0 -0
  157. /package/{src/runtime → runtime}/tests/TestUnsubscribeNestedParentBaseComponent.d.ts +0 -0
  158. /package/{src/runtime → runtime}/tests/TestUnsubscribeNestedParentBaseComponent.js +0 -0
  159. /package/{src/runtime → runtime}/tests/TestWatchNestedPropertyChildComponent.d.ts +0 -0
  160. /package/{src/runtime → runtime}/tests/TestWatchNestedPropertyChildComponent.js +0 -0
  161. /package/{src/runtime → runtime}/tests/TestWatchNestedPropertyChildComponent2.d.ts +0 -0
  162. /package/{src/runtime → runtime}/tests/TestWatchNestedPropertyChildComponent2.js +0 -0
  163. /package/{src/runtime → runtime}/tests/TestWatchNestedPropertyContainerClass.d.ts +0 -0
  164. /package/{src/runtime → runtime}/tests/TestWatchNestedPropertyContainerClass.js +0 -0
  165. /package/{src/runtime → runtime}/tests/TestWatchNestedPropertyParentComponent.d.ts +0 -0
  166. /package/{src/runtime → runtime}/tests/TestWatchNestedPropertyParentComponent.js +0 -0
  167. /package/{src/runtime → runtime}/tests/TestWatchNestedPropertyParentComponent2.d.ts +0 -0
  168. /package/{src/runtime → runtime}/tests/TestWatchNestedPropertyParentComponent2.js +0 -0
  169. /package/{src/runtime → runtime}/tests/createPipeUnwrapChildComponent.d.ts +0 -0
  170. /package/{src/runtime → runtime}/tests/createPipeUnwrapChildComponent.js +0 -0
  171. /package/{src/runtime → runtime}/tests/createPipeUnwrapParentComponent.d.ts +0 -0
  172. /package/{src/runtime → runtime}/tests/createPipeUnwrapParentComponent.js +0 -0
  173. /package/{src/runtime → runtime}/tests/createPipeUnwrapTestComponent.d.ts +0 -0
  174. /package/{src/runtime → runtime}/tests/createPipeUnwrapTestComponent.js +0 -0
  175. /package/{src/runtime → runtime}/tests/createPropBindChildComponent.d.ts +0 -0
  176. /package/{src/runtime → runtime}/tests/createPropBindChildComponent.js +0 -0
  177. /package/{src/runtime → runtime}/tests/createPropBindParentComponent.d.ts +0 -0
  178. /package/{src/runtime → runtime}/tests/createPropBindParentComponent.js +0 -0
  179. /package/{src/runtime → runtime}/tests/createPropertyBindingPipeChildComponent.d.ts +0 -0
  180. /package/{src/runtime → runtime}/tests/createPropertyBindingPipeChildComponent.js +0 -0
  181. /package/{src/runtime → runtime}/tests/createPropertyBindingPipeParentComponent.d.ts +0 -0
  182. /package/{src/runtime → runtime}/tests/createPropertyBindingPipeParentComponent.js +0 -0
  183. /package/{src/runtime → runtime}/tests/createTestInterpolationNestedPropertyComponent.d.ts +0 -0
  184. /package/{src/runtime → runtime}/tests/createTestInterpolationNestedPropertyComponent.js +0 -0
  185. /package/{src/runtime → runtime}/tests/createTestInterpolationPipeComponent.d.ts +0 -0
  186. /package/{src/runtime → runtime}/tests/createTestInterpolationPipeComponent.js +0 -0
  187. /package/{src/runtime → runtime}/tests/createTestInterpolationPipeWithArgsComponent.d.ts +0 -0
  188. /package/{src/runtime → runtime}/tests/createTestInterpolationPipeWithArgsComponent.js +0 -0
  189. /package/{src/utils → utils}/DomUtils.d.ts +0 -0
  190. /package/{src/utils → utils}/DomUtils.js +0 -0
  191. /package/{src/utils → utils}/Property.d.ts +0 -0
  192. /package/{src/utils → utils}/Property.js +0 -0
  193. /package/{src/utils → utils}/Publisher.d.ts +0 -0
  194. /package/{src/utils → utils}/Publisher.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluffjs/fluff",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
@@ -42,6 +42,7 @@ export declare abstract class FluffBase extends HTMLElement {
42
42
  private __subscribeToNestedChain;
43
43
  protected __getReactivePropFromScope(propName: string, scope: Scope): Property<unknown> | undefined;
44
44
  protected __setChildProperty(el: Element, propName: string, value: unknown): void;
45
+ private __unwrap;
45
46
  private __applyPropertyBindingWithScope;
46
47
  private __applyEventBindingWithScope;
47
48
  private __applyOutputBinding;
@@ -156,7 +156,13 @@ export class FluffBase extends HTMLElement {
156
156
  }
157
157
  }
158
158
  }
159
- else if (!(first in scope.locals) && !(first in scope.host)) {
159
+ else if (first in scope.locals) {
160
+ const localValue = scope.locals[first];
161
+ if (localValue !== null && localValue !== undefined && rest.length > 0) {
162
+ this.__subscribeToNestedChain(localValue, rest, callback, addSub);
163
+ }
164
+ }
165
+ else if (!(first in scope.host)) {
160
166
  console.warn(`Binding dependency "${first}" not found on component ${scope.host.constructor.name}`);
161
167
  }
162
168
  }
@@ -220,12 +226,21 @@ export class FluffBase extends HTMLElement {
220
226
  if (prop instanceof Property) {
221
227
  prop.setValue(value, true);
222
228
  }
223
- else if (propName in el && el instanceof HTMLElement) {
229
+ else if (el instanceof FluffBase) {
224
230
  Reflect.set(el, propName, value);
225
231
  }
232
+ else if (propName in el && el instanceof HTMLElement) {
233
+ Reflect.set(el, propName, this.__unwrap(value));
234
+ }
226
235
  else {
227
- el.setAttribute(propName, String(value));
236
+ el.setAttribute(propName, String(this.__unwrap(value)));
237
+ }
238
+ }
239
+ __unwrap(value) {
240
+ if (value instanceof Property) {
241
+ return value.getValue();
228
242
  }
243
+ return value;
229
244
  }
230
245
  __applyPropertyBindingWithScope(el, binding, scope, subscriptions) {
231
246
  const tagName = el.tagName.toLowerCase();
@@ -343,7 +358,7 @@ export class FluffBase extends HTMLElement {
343
358
  throw new Error(`Class binding for ${binding.n} is missing exprId`);
344
359
  }
345
360
  const fn = this.__getCompiledExprFn(binding.e);
346
- const value = fn(this, scope.locals);
361
+ const value = this.__unwrap(fn(this, scope.locals));
347
362
  if (value) {
348
363
  el.classList.add(binding.n);
349
364
  }
@@ -365,7 +380,7 @@ export class FluffBase extends HTMLElement {
365
380
  throw new Error(`Style binding for ${binding.n} is missing exprId`);
366
381
  }
367
382
  const fn = this.__getCompiledExprFn(binding.e);
368
- const value = fn(this, scope.locals);
383
+ const value = this.__unwrap(fn(this, scope.locals));
369
384
  if (this.__hasStyle(el)) {
370
385
  el.style.setProperty(binding.n, String(value));
371
386
  }
@@ -0,0 +1,4 @@
1
+ export declare function createClassBindingTestComponent(): CustomElementConstructor;
2
+ export declare function createStyleBindingTestComponent(): CustomElementConstructor;
3
+ export declare function createPropertyBindingTestComponent(): CustomElementConstructor;
4
+ export declare function createAttributeBindingTestComponent(): CustomElementConstructor;
@@ -0,0 +1,23 @@
1
+ import { FluffElement } from '../FluffElement.js';
2
+ function createTestComponent(html) {
3
+ return class extends FluffElement {
4
+ __render() {
5
+ this.__getShadowRoot().innerHTML = html;
6
+ }
7
+ __setupBindings() {
8
+ this.__processBindings();
9
+ }
10
+ };
11
+ }
12
+ export function createClassBindingTestComponent() {
13
+ return createTestComponent('<div data-lid="l0">test</div>');
14
+ }
15
+ export function createStyleBindingTestComponent() {
16
+ return createTestComponent('<div data-lid="l0">test</div>');
17
+ }
18
+ export function createPropertyBindingTestComponent() {
19
+ return createTestComponent('<button data-lid="l0">test</button>');
20
+ }
21
+ export function createAttributeBindingTestComponent() {
22
+ return createTestComponent('<div data-lid="l0">test</div>');
23
+ }
@@ -1,3 +1,4 @@
1
+ import type { Property } from '../../utils/Property.js';
1
2
  import type { TestLateDefineForColumn } from './TestLateDefineForComponent.js';
2
3
  import type { TestTask } from './TestNullInputTextComponent.js';
3
4
  export declare function hasItem(t: unknown): t is {
@@ -18,3 +19,23 @@ export declare function hasValue(t: unknown): t is {
18
19
  export declare function hasTaskId(e: unknown): e is {
19
20
  taskId: number;
20
21
  };
22
+ export declare function hasItemSelected(obj: unknown): obj is {
23
+ item: {
24
+ selected: Property<boolean>;
25
+ };
26
+ };
27
+ export declare function hasItemColor(obj: unknown): obj is {
28
+ item: {
29
+ color: Property<string>;
30
+ };
31
+ };
32
+ export declare function hasItemDisabled(obj: unknown): obj is {
33
+ item: {
34
+ disabled: Property<boolean>;
35
+ };
36
+ };
37
+ export declare function hasItemValue(obj: unknown): obj is {
38
+ item: {
39
+ value: Property<string>;
40
+ };
41
+ };
@@ -0,0 +1,66 @@
1
+ export function hasItem(t) {
2
+ return t !== null && typeof t === 'object' && 'item' in t;
3
+ }
4
+ export function hasItemName(t) {
5
+ return t !== null && typeof t === 'object' && 'itemName' in t && typeof t.itemName === 'string';
6
+ }
7
+ export function hasTask(t) {
8
+ return t !== null && typeof t === 'object' && 'task' in t;
9
+ }
10
+ export function isLateDefineForColumn(l) {
11
+ return l !== null && typeof l === 'object' && 'column' in l;
12
+ }
13
+ export function hasValue(t) {
14
+ return t !== null && typeof t === 'object' && 'value' in t && typeof t.value === 'string';
15
+ }
16
+ export function hasTaskId(e) {
17
+ return e !== null && typeof e === 'object' && 'taskId' in e && typeof e.taskId === 'number';
18
+ }
19
+ export function hasItemSelected(obj) {
20
+ if (obj === null || typeof obj !== 'object')
21
+ return false;
22
+ if (!('item' in obj))
23
+ return false;
24
+ const { item } = obj;
25
+ if (item === null || typeof item !== 'object')
26
+ return false;
27
+ if (!('selected' in item))
28
+ return false;
29
+ return true;
30
+ }
31
+ export function hasItemColor(obj) {
32
+ if (obj === null || typeof obj !== 'object')
33
+ return false;
34
+ if (!('item' in obj))
35
+ return false;
36
+ const { item } = obj;
37
+ if (item === null || typeof item !== 'object')
38
+ return false;
39
+ if (!('color' in item))
40
+ return false;
41
+ return true;
42
+ }
43
+ export function hasItemDisabled(obj) {
44
+ if (obj === null || typeof obj !== 'object')
45
+ return false;
46
+ if (!('item' in obj))
47
+ return false;
48
+ const { item } = obj;
49
+ if (item === null || typeof item !== 'object')
50
+ return false;
51
+ if (!('disabled' in item))
52
+ return false;
53
+ return true;
54
+ }
55
+ export function hasItemValue(obj) {
56
+ if (obj === null || typeof obj !== 'object')
57
+ return false;
58
+ if (!('item' in obj))
59
+ return false;
60
+ const { item } = obj;
61
+ if (item === null || typeof item !== 'object')
62
+ return false;
63
+ if (!('value' in item))
64
+ return false;
65
+ return true;
66
+ }
@@ -1,18 +0,0 @@
1
- export function hasItem(t) {
2
- return t !== null && typeof t === 'object' && 'item' in t;
3
- }
4
- export function hasItemName(t) {
5
- return t !== null && typeof t === 'object' && 'itemName' in t && typeof t.itemName === 'string';
6
- }
7
- export function hasTask(t) {
8
- return t !== null && typeof t === 'object' && 'task' in t;
9
- }
10
- export function isLateDefineForColumn(l) {
11
- return l !== null && typeof l === 'object' && 'column' in l;
12
- }
13
- export function hasValue(t) {
14
- return t !== null && typeof t === 'object' && 'value' in t && typeof t.value === 'string';
15
- }
16
- export function hasTaskId(e) {
17
- return e !== null && typeof e === 'object' && 'taskId' in e && typeof e.taskId === 'number';
18
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes