@ixfx/ui 0.50.3 → 0.56.2

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 (38) hide show
  1. package/LICENSE +26 -1
  2. package/dist/chunk-BN_g-Awi.js +18 -0
  3. package/dist/index.d.ts +557 -0
  4. package/dist/index.js +958 -0
  5. package/package.json +32 -18
  6. package/bundle/chunk-Cl8Af3a2.js +0 -1
  7. package/bundle/index.d.ts +0 -569
  8. package/bundle/index.d.ts.map +0 -1
  9. package/bundle/index.js +0 -2
  10. package/bundle/index.js.map +0 -1
  11. package/dist/__tests__/test.d.ts +0 -2
  12. package/dist/__tests__/test.d.ts.map +0 -1
  13. package/dist/__tests__/test.js +0 -1
  14. package/dist/src/index.d.ts +0 -2
  15. package/dist/src/index.d.ts.map +0 -1
  16. package/dist/src/index.js +0 -1
  17. package/dist/src/rx/browser-resize.d.ts +0 -26
  18. package/dist/src/rx/browser-resize.d.ts.map +0 -1
  19. package/dist/src/rx/browser-resize.js +0 -41
  20. package/dist/src/rx/browser-theme-change.d.ts +0 -13
  21. package/dist/src/rx/browser-theme-change.d.ts.map +0 -1
  22. package/dist/src/rx/browser-theme-change.js +0 -28
  23. package/dist/src/rx/colour.d.ts +0 -8
  24. package/dist/src/rx/colour.d.ts.map +0 -1
  25. package/dist/src/rx/colour.js +0 -20
  26. package/dist/src/rx/dom-source.d.ts +0 -96
  27. package/dist/src/rx/dom-source.d.ts.map +0 -1
  28. package/dist/src/rx/dom-source.js +0 -374
  29. package/dist/src/rx/dom-types.d.ts +0 -128
  30. package/dist/src/rx/dom-types.d.ts.map +0 -1
  31. package/dist/src/rx/dom-types.js +0 -1
  32. package/dist/src/rx/dom.d.ts +0 -284
  33. package/dist/src/rx/dom.d.ts.map +0 -1
  34. package/dist/src/rx/dom.js +0 -727
  35. package/dist/src/rx/index.d.ts +0 -7
  36. package/dist/src/rx/index.d.ts.map +0 -1
  37. package/dist/src/rx/index.js +0 -5
  38. package/dist/tsconfig.tsbuildinfo +0 -1
package/package.json CHANGED
@@ -1,31 +1,45 @@
1
1
  {
2
2
  "name": "@ixfx/ui",
3
- "version": "0.50.3",
3
+ "version": "0.56.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "files": [
8
- "dist/",
9
- "bundle/"
8
+ "dist"
10
9
  ],
11
10
  "dependencies": {
12
- "@ixfx/core": "^0.51.0",
13
- "@ixfx/collections": "^0.51.2",
14
- "@ixfx/dom": "^0.50.3",
15
- "@ixfx/geometry": "^0.56.3",
16
- "@ixfx/numbers": "^0.53.0",
17
- "@ixfx/visual": "^0.55.3",
18
- "@ixfx/rx": "^0.49.2"
11
+ "@ixfx/core": "0.56.2",
12
+ "@ixfx/dom": "0.56.2",
13
+ "@ixfx/collections": "0.56.2",
14
+ "@ixfx/visual": "0.56.2",
15
+ "@ixfx/rx": "0.56.2"
19
16
  },
20
17
  "exports": {
21
- ".": {
22
- "types": "./dist/src/index.d.ts",
23
- "import": "./dist/src/index.js"
24
- }
18
+ ".": "./dist/index.js",
19
+ "./package.json": "./package.json"
25
20
  },
26
- "scripts": {
27
- "package-bundle": "tsdown",
28
- "clean": "rm -rf dist && rm -rf bundle"
21
+ "publishConfig": {
22
+ "access": "public"
29
23
  },
30
- "main": "dist/src/index.js"
24
+ "description": "ixfx ui",
25
+ "keywords": [
26
+ "ixfx",
27
+ "interactivity",
28
+ "ui"
29
+ ],
30
+ "homepage": "https://ixfxfun.dev",
31
+ "bugs": {
32
+ "url": "https://github.com/clinth/ixfx/issues"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/clinth/ixfx.git",
37
+ "directory": "packages/ui"
38
+ },
39
+ "author": "Clint Heyer <clint@thestaticvoid.net>",
40
+ "engines": {
41
+ "node": ">=24.0.0"
42
+ },
43
+ "main": "./dist/index.js",
44
+ "scripts": {}
31
45
  }
@@ -1 +0,0 @@
1
- var e=Object.defineProperty,t=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})};export{t as __export};
package/bundle/index.d.ts DELETED
@@ -1,569 +0,0 @@
1
- import * as _ixfx_core0 from "@ixfx/core";
2
- import { Interval, Pathed } from "@ixfx/core";
3
- import * as Rx from "@ixfx/rx";
4
- import { Reactive, ReactiveInitial, ReactiveNonInitial, ReactiveWritable } from "@ixfx/rx";
5
- import { HslScalar } from "@ixfx/visual/colour";
6
- import { EventSourceOptions } from "@ixfx/rx/from";
7
- import { Colour } from "@ixfx/visual";
8
-
9
- //#region src/rx/browser-resize.d.ts
10
-
11
- /**
12
- * Observe when element resizes. Specify `interval` to debounce, uses 100ms by default.
13
- *
14
- * ```
15
- * const o = resizeObservable(myEl, 500);
16
- * o.subscribe(() => {
17
- * // called 500ms after last resize
18
- * });
19
- * ```
20
- * @param elem
21
- * @param interval Tiemout before event gets triggered
22
- * @returns
23
- */
24
- declare const browserResizeObservable: (elem: Readonly<Element>, interval?: Interval) => Rx.Reactive<ResizeObserverEntry[]>;
25
- /**
26
- * Returns an Reactive for window resize. Default 100ms debounce.
27
- * @param elapsed
28
- * @returns
29
- */
30
- declare const windowResize: (elapsed?: Interval) => Rx.Reactive<{
31
- innerWidth: number;
32
- innerHeight: number;
33
- }>;
34
- //# sourceMappingURL=browser-resize.d.ts.map
35
- //#endregion
36
- //#region src/rx/browser-theme-change.d.ts
37
- /**
38
- * Observe when a class changes on a target element, by default the document.
39
- * Useful for tracking theme changes.
40
- *
41
- * ```js
42
- * const c = cssClassChange();
43
- * c.on(msg => {
44
- * // some class has changed on the document
45
- * });
46
- * ```
47
- */
48
- declare const cssClassChange: (target?: HTMLElement) => Rx.Reactive<MutationRecord[]>;
49
- //# sourceMappingURL=browser-theme-change.d.ts.map
50
- //#endregion
51
- //#region src/rx/colour.d.ts
52
- type ReactiveColour = ReactiveWritable<HslScalar> & {
53
- setHsl: (hsl: HslScalar) => void;
54
- };
55
- declare function colour(initialValue: HslScalar): ReactiveColour & ReactiveInitial<HslScalar>;
56
- declare function colour(): ReactiveColour & ReactiveNonInitial<HslScalar>;
57
- //# sourceMappingURL=colour.d.ts.map
58
- //#endregion
59
- //#region src/rx/dom-types.d.ts
60
- type DomBindValueTarget = {
61
- /**
62
- * If _true_ `innerHTML` is set (a shortcut for elField:`innerHTML`)
63
- */
64
- htmlContent?: boolean;
65
- /**
66
- * If _true_, 'textContent' is set (a shortcut for elField:'textContext')
67
- */
68
- textContent?: boolean;
69
- /**
70
- * If set, this DOM element field is set. Eg 'textContent'
71
- */
72
- elField?: string;
73
- /**
74
- * If set, this DOM attribute is set, Eg 'width'
75
- */
76
- attribName?: string;
77
- /**
78
- * If set, this CSS variable is set, Eg 'hue' (sets '--hue')
79
- */
80
- cssVariable?: string;
81
- /**
82
- * If set, this CSS property is set, Eg 'background-color'
83
- */
84
- cssProperty?: string;
85
- };
86
- type ElementBind = {
87
- /**
88
- * Tag name for this binding.
89
- * Overrides `defaultTag`
90
- */
91
- tagName?: string;
92
- /**
93
- * If _true_, sub-paths are appended to element, rather than `container`
94
- */
95
- nestChildren?: boolean;
96
- transform?: (value: any) => string;
97
- };
98
- type ElementsOptions = {
99
- container: HTMLElement | string;
100
- defaultTag: string;
101
- binds: Record<string, DomBindValueTarget & ElementBind>;
102
- };
103
- type DomBindTargetNode = {
104
- query?: string;
105
- element?: HTMLElement;
106
- };
107
- type DomBindTargetNodeResolved = {
108
- element: HTMLElement;
109
- };
110
- type DomBindUnresolvedSource<TSource, TDestination> = DomBindTargetNode & DomBindSourceValue<TSource, TDestination> & DomBindValueTarget;
111
- type DomBindResolvedSource<TSource, TDestination> = DomBindTargetNodeResolved & DomBindSourceValue<TSource, TDestination> & DomBindValueTarget;
112
- type DomBindSourceValue<TSource, TDestination> = {
113
- twoway?: boolean;
114
- /**
115
- * Field from source value to pluck and use.
116
- * This will also be the value passed to the transform
117
- */
118
- sourceField?: keyof TSource;
119
- transform?: (input: TSource) => TDestination;
120
- transformValue?: (input: any) => TDestination;
121
- };
122
- type DomBindInputOptions<TSource, TDestination> = DomBindSourceValue<TSource, TDestination> & {
123
- transformFromInput: (input: TDestination) => TSource;
124
- };
125
- type BindUpdateOpts<V> = {
126
- initial: (v: V, el: HTMLElement) => void;
127
- binds: Record<string, DomBindValueTarget & {
128
- transform?: (value: any) => string;
129
- }>;
130
- };
131
- type DomCreateOptions = {
132
- tagName: string;
133
- parentEl: string | HTMLElement;
134
- };
135
- type PipeDomBinding = {
136
- /**
137
- * Remove binding and optionally delete element(s) (false by default)
138
- */
139
- remove(deleteElements: boolean): void;
140
- };
141
- type DomValueOptions = EventSourceOptions & {
142
- /**
143
- * If true, the current value will be emitted even though it wasn't
144
- * triggered by an event.
145
- * Default: false
146
- */
147
- emitInitialValue: boolean;
148
- attributeName: string;
149
- fieldName: string;
150
- /**
151
- * Respond to when value has changed or when value is changing
152
- * Default: `changed`
153
- */
154
- when: `changed` | `changing`;
155
- fallbackValue: string;
156
- upstreamSource?: Reactive<unknown>;
157
- upstreamFilter?: (value: unknown) => string;
158
- };
159
- type DomFormOptions<T extends Record<string, unknown>> = EventSourceOptions & {
160
- /**
161
- * If true, the current value will be emitted even though it wasn't
162
- * triggered by an event.
163
- * Default: false
164
- */
165
- emitInitialValue: boolean;
166
- /**
167
- * Respond to when value has changed or when value is changing
168
- * Default: `changed`
169
- */
170
- when: `changed` | `changing`;
171
- upstreamSource?: Reactive<T>;
172
- upstreamFilter?: (name: string, value: unknown) => string;
173
- };
174
- type DomNumberInputValueOptions = DomValueOptions & {
175
- /**
176
- * If true, sets up INPUT element to operate with relative values
177
- */
178
- relative?: boolean;
179
- /**
180
- * If true, when setting up, sets max to be on left side
181
- */
182
- inverted?: boolean;
183
- upstreamSource?: Reactive<number>;
184
- };
185
- //# sourceMappingURL=dom-types.d.ts.map
186
- //#endregion
187
- //#region src/rx/dom-source.d.ts
188
- /**
189
- * Reactive getting/setting of values to a HTML INPUT element.
190
- *
191
- * Options:
192
- * - relative: if _true_, values are 0..1 (default: false)
193
- * - inverted: if _true_, values are 1..0 (default: false)
194
- *
195
- * If element is missing a 'type' attribute, this will be set to 'range'.
196
- * @param targetOrQuery
197
- * @param options
198
- * @returns
199
- */
200
- declare function domNumberInputValue(targetOrQuery: HTMLInputElement | string, options?: Partial<DomNumberInputValueOptions>): ReactiveInitial<number> & ReactiveWritable<number>;
201
- declare function domHslInputValue(targetOrQuery: HTMLInputElement | string, options?: Partial<DomValueOptions>): ReactiveInitial<Colour.HslScalar> & Reactive<Colour.HslScalar> & ReactiveWritable<Colour.HslScalar>;
202
- /**
203
- * A stream of values when the a HTMLInputElement changes. Eg a <input type="range">
204
- * ```js
205
- * const r = Rx.From.domInputValue(`#myEl`);
206
- * r.onValue(value => {
207
- * // value will be string
208
- * });
209
- * ```
210
- *
211
- * Options:
212
- * * emitInitialValue: If _true_ emits the HTML value of element (default: false)
213
- * * attributeName: If set, this is the HTML attribute value is set to when writing to stream (default: 'value')
214
- * * fieldName: If set, this is the DOM object field set when writing to stream (default: 'value')
215
- * * when: 'changed'|'changing' when values are emitted. (default: 'changed')
216
- * * fallbackValue: Fallback value to use if field/attribute cannot be read (default: '')
217
- * @param targetOrQuery
218
- * @param options
219
- * @returns
220
- */
221
- declare function domInputValue(targetOrQuery: HTMLInputElement | string, options?: Partial<DomValueOptions>): {
222
- el: HTMLInputElement;
223
- } & ReactiveInitial<string> & ReactiveWritable<string>;
224
- /**
225
- * Listens for data changes from elements within a HTML form element.
226
- * Input elements must have a 'name' attribute.
227
- *
228
- * Simple usage:
229
- * ```js
230
- * const rx = Rx.From.domForm(`#my-form`);
231
- * rx.onValue(value => {
232
- * // Object containing values from form
233
- * });
234
- *
235
- * rx.last(); // Read current values of form
236
- * ```
237
- *
238
- * UI can be updated
239
- * ```js
240
- * // Set using an object of key-value pairs
241
- * rx.set({
242
- * size: 'large'
243
- * });
244
- *
245
- * // Or set a single name-value pair
246
- * rx.setNamedValue(`size`, `large`);
247
- * ```
248
- *
249
- * If an 'upstream' reactive is provided, this is used to set initial values of the UI, overriding
250
- * whatever may be in the HTML. Upstream changes modify UI elements, but UI changes do not modify the upstream
251
- * source.
252
- *
253
- * ```js
254
- * // Create a reactive object
255
- * const obj = Rx.From.object({
256
- * when: `2024-10-03`,
257
- * size: 12,
258
- * checked: true
259
- * });
260
- *
261
- * // Use this as initial values for a HTML form
262
- * // (assuming appropriate INPUT/SELECT elements exist)
263
- * const rx = Rx.From.domForm(`form`, {
264
- * upstreamSource: obj
265
- * });
266
- *
267
- * // Listen for changes in the UI
268
- * rx.onValue(value => {
269
- *
270
- * });
271
- * ```
272
- * @param formElOrQuery
273
- * @param options
274
- * @returns
275
- */
276
- declare function domForm<T extends Record<string, any>>(formElOrQuery: HTMLFormElement | string, options?: Partial<DomFormOptions<T>>): {
277
- setNamedValue: (name: string, value: any) => void;
278
- el: HTMLFormElement;
279
- } & ReactiveInitial<T> & ReactiveWritable<T>;
280
- //# sourceMappingURL=dom-source.d.ts.map
281
- //#endregion
282
- //#region src/rx/dom.d.ts
283
- /**
284
- * Reactive stream of array of elements that match `query`.
285
- * @param query
286
- * @returns
287
- */
288
- declare function fromDomQuery(query: string): Rx.Reactive<HTMLElement[]> & {
289
- set(value: HTMLElement[]): void;
290
- } & {
291
- onField(fieldName: string, handler: (result: Rx.ObjectFieldHandler) => void): () => void;
292
- onDiff(changes: (changes: Pathed.PathDataChange<any>[]) => void): () => void;
293
- update(changedPart: (_ixfx_core0.RecursivePartial<HTMLElement> | undefined)[]): HTMLElement[];
294
- updateField(field: string, value: any): void;
295
- } & {
296
- last(): HTMLElement[];
297
- };
298
- /**
299
- * Updates an element's `textContent` when the source value changes.
300
- * ```js
301
- * bindText(source, `#blah`);
302
- * ```
303
- * @param elOrQuery
304
- * @param source
305
- * @param bindOpts
306
- */
307
- declare const bindText: <TSource>(source: Rx.Reactive<TSource>, elOrQuery: string | HTMLElement | null, bindOpts?: Partial<DomBindSourceValue<TSource, string>>) => PipeDomBinding;
308
- /**
309
- * Updates an element's `value` (as well as the 'value' attribute) when the source value changes.s
310
- * @param source
311
- * @param elOrQuery
312
- * @param bindOpts
313
- * @returns
314
- */
315
- declare const bindValueText: <TSource>(source: Rx.Reactive<TSource>, elOrQuery: string | HTMLInputElement | null, bindOpts?: Partial<DomBindSourceValue<TSource, string>>) => PipeDomBinding;
316
- /**
317
- * Updates an element's `innerHTML` when the source value changes
318
- * ```js
319
- * bindHtml(source, `#blah`);
320
- * ```
321
- *
322
- * Uses {@link bindElement}, with `{elField:'innerHTML'}` as the options.
323
- * @param elOrQuery
324
- * @param source
325
- * @param bindOpts
326
- * @returns
327
- */
328
- declare const bindHtml: <TSource>(source: Rx.Reactive<TSource>, elOrQuery: string | HTMLElement | null, bindOpts?: DomBindSourceValue<TSource, string>) => PipeDomBinding;
329
- /**
330
- * Shortcut to bind to an elements attribute
331
- * @param elOrQuery
332
- * @param source
333
- * @param attribute
334
- * @param bindOpts
335
- * @returns
336
- */
337
- /**
338
- * Shortcut to bind to a CSS variable
339
- * @param elOrQuery
340
- * @param source
341
- * @param cssVariable
342
- * @param bindOpts
343
- * @returns
344
- */
345
- /**
346
- * Creates a new HTML element, calling {@link bind} on it to update when `source` emits new values.
347
- *
348
- *
349
- * ```js
350
- * // Set textContent of a SPAN with values from `source`
351
- * create(source, { tagName: `span`, parentEl: document.body })
352
- * ```
353
- *
354
- * If `parentEl` is not given in the options, the created element needs to be manually added
355
- * ```js
356
- * const b = create(source);
357
- * someEl.append(b.el); // Append manually
358
- * ```
359
- *
360
- * ```
361
- * // Set 'title' attribute based on values from `source`
362
- * create(source, { parentEl: document.body, attribName: `title` })
363
- * ```
364
- * @param source
365
- * @param options
366
- * @returns
367
- */
368
- /**
369
- * Update a DOM element's field, attribute or CSS variable when `source` produces a value.
370
- *
371
- * ```js
372
- * // Access via DOM query. Binds to 'textContent' by default
373
- * bind(readableSource, `#someEl`);
374
- *
375
- * // Set innerHTML instead
376
- * bind(readableSource, someEl, { elField: `innerHTML` });
377
- *
378
- * // An attribute
379
- * bind(readableSource, someEl, { attribName: `width` });
380
- *
381
- * // A css variable ('--' optiona)
382
- * bind(readableSource, someEl, { cssVariable: `hue` });
383
- *
384
- * // Pluck a particular field from source data.
385
- * // Ie someEl.textContent = value.colour
386
- * bind(readableSource, someEl, { sourceField: `colour` });
387
- *
388
- * // Transform value before setting it to field
389
- * bind(readableSource, someEl, {
390
- * field: `innerHTML`,
391
- * transform: (v) => `Colour: ${v.colour}`
392
- * })
393
- * ```
394
- *
395
- * If `source` has an initial value, this is used when first bound.
396
- *
397
- * Returns {@link PipeDomBinding} to control binding:
398
- * ```js
399
- * const bind = bind(source, `#someEl`);
400
- * bind.remove(); // Unbind
401
- * bind.remove(true); // Unbind and remove HTML element
402
- * ```
403
- *
404
- * If several fields need to be updated based on a new value, consider using {@link bindUpdate} instead.
405
- * @param elOrQuery Element to update to, or query string such as '#someid'
406
- * @param source Source of data
407
- * @param binds Bindings
408
- */
409
- declare const bindElement: <TSource, TDestination>(source: Rx.Reactive<TSource>, elOrQuery: string | HTMLElement | null, ...binds: (DomBindSourceValue<TSource, TDestination> & DomBindValueTarget)[]) => PipeDomBinding;
410
- /**
411
- * Binds `source` to one or more element(s). One or more bindings for the same source
412
- * can be provided.
413
- *
414
- * ```js
415
- * bind(source,
416
- * // Binds .name field of source values to textContent of #some-element
417
- * { query: `#some-element`, sourceField: `name` },
418
- * { query: `section`, }
419
- * );
420
- * ```
421
- *
422
- * Can update
423
- * * CSS variables
424
- * * CSS styles
425
- * * textContent / innerHTML
426
- * * HTML DOM attributes and object fields
427
- *
428
- * Can use a particular field on source values, or use the whole value. These can
429
- * pass through `transformValue` or `transform` respectively.
430
- *
431
- * Returns a function to unbind from source and optionally remove HTML element
432
- * ```js
433
- * const unbind = bind( . . . );
434
- * unbind(); // Unbind
435
- * unbind(true); // Unbind and remove HTML element(s)
436
- * ```
437
- * @param source
438
- * @param bindsUnresolvedElements
439
- * @returns
440
- */
441
- declare const bind: <TSource, TDestination>(source: Rx.Reactive<TSource>, ...bindsUnresolvedElements: DomBindUnresolvedSource<TSource, TDestination>[]) => PipeDomBinding;
442
- /**
443
- * Calls `updater` whenever `source` produces a value. Useful when several fields from a value
444
- * are needed to update an element.
445
- * ```js
446
- * bindUpdate(source, `#someEl`, (v, el) => {
447
- * el.setAttribute(`width`, v.width);
448
- * el.setAttribute(`height`, v.height);
449
- * });
450
- * ```
451
- *
452
- * Returns a {@link PipeDomBinding} to manage binding
453
- * ```js
454
- * const b = bindUpdate(...);
455
- * b.remove(); // Disconnect binding
456
- * b.remove(true); // Disconnect binding and remove element
457
- * b.el; // HTML element
458
- * ```
459
- * @param elOrQuery
460
- * @param source
461
- * @param updater
462
- * @returns
463
- */
464
- declare const bindUpdate: <V>(source: Rx.Reactive<V>, elOrQuery: string | HTMLElement, updater: (v: V, el: HTMLElement) => void) => PipeDomBinding;
465
- /**
466
- * Updates a HTML element based on diffs on an object.
467
- * ```js
468
- * // Wrap an object
469
- * const o = Rx.object({ name: `Jane`, ticks: 0 });
470
- * const b = bindDiffUpdate(`#test`, o, (diffs, el) => {
471
- * // el = reference to #test
472
- * // diff = Array of Changes,
473
- * // eg [ { path: `ticks`, value: 797, previous: 0 } ]
474
- * for (const diff of diffs) {
475
- * if (diff.path === `ticks`) el.textContent = `${diff.previous} -> ${diff.value}`
476
- * }
477
- * })
478
- *
479
- * // Eg. update field
480
- * o.updateField(`ticks`, Math.floor(Math.random()*1000));
481
- * ```
482
- *
483
- * If `initial` is provided as an option, this will be called if `source` has an initial value. Without this, the DOM won't be updated until the first data
484
- * update happens.
485
- * ```js
486
- * bindDiffUpdate(el, source, updater, {
487
- * initial: (v, el) => {
488
- * el.innerHTML = v.name;
489
- * }
490
- * })
491
- * ```
492
- * @param elOrQuery
493
- * @param source
494
- * @param updater
495
- * @param opts
496
- * @returns
497
- */
498
- declare const bindDiffUpdate: <V>(source: Rx.ReactiveDiff<V>, elOrQuery: string | HTMLElement | null, updater: (diffs: Pathed.PathDataChange<any>[], el: HTMLElement) => void, opts?: Partial<BindUpdateOpts<V>>) => PipeDomBinding & {
499
- refresh: () => void;
500
- };
501
- /**
502
- * Creates a new HTML element and calls `bindUpdate` so values from `source` can be used
503
- * to update it.
504
- *
505
- *
506
- * ```js
507
- * // Creates a span, adding it to <body>
508
- * const b = createUpdate(dataSource, (value, el) => {
509
- * el.width = value.width;
510
- * el.height = value.height;
511
- * }, {
512
- * tagName: `SPAN`,
513
- * parentEl: document.body
514
- * })
515
- * ```
516
- * @param source
517
- * @param updater
518
- * @param options
519
- * @returns
520
- */
521
- /**
522
- * Creates, updates & deletes elements based on pathed values from a reactive.
523
- *
524
- * This means that elements are only manipulated if its associated data changes,
525
- * and elements are not modified if there's no need to.
526
- * @param source
527
- * @param options
528
- */
529
- declare const elements: <T>(source: Rx.ReactiveDiff<T> | (Rx.ReactiveDiff<T> & Rx.ReactiveInitial<T>), options: Partial<ElementsOptions>) => void;
530
- declare function win(): {
531
- dispose: (reason?: string) => void;
532
- size: Rx.Reactive<{
533
- lazy: string;
534
- transform: () => {
535
- width: number;
536
- height: number;
537
- };
538
- }> & {
539
- last(): {
540
- lazy: string;
541
- transform: () => {
542
- width: number;
543
- height: number;
544
- };
545
- };
546
- };
547
- pointer: Rx.Reactive<{
548
- lazy: string;
549
- transform: (args: Event | undefined) => {
550
- x: number;
551
- y: number;
552
- };
553
- }> & {
554
- last(): {
555
- lazy: string;
556
- transform: (args: Event | undefined) => {
557
- x: number;
558
- y: number;
559
- };
560
- };
561
- };
562
- };
563
- //# sourceMappingURL=dom.d.ts.map
564
- declare namespace index_d_exports {
565
- export { BindUpdateOpts, DomBindInputOptions, DomBindResolvedSource, DomBindSourceValue, DomBindTargetNode, DomBindTargetNodeResolved, DomBindUnresolvedSource, DomBindValueTarget, DomCreateOptions, DomFormOptions, DomNumberInputValueOptions, DomValueOptions, ElementBind, ElementsOptions, PipeDomBinding, ReactiveColour, bind, bindDiffUpdate, bindElement, bindHtml, bindText, bindUpdate, bindValueText, browserResizeObservable, colour, cssClassChange, domForm, domHslInputValue, domInputValue, domNumberInputValue, elements, fromDomQuery, win, windowResize };
566
- }
567
- //#endregion
568
- export { index_d_exports as RxUi };
569
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/rx/browser-resize.ts","../../src/rx/browser-theme-change.ts","../../src/rx/colour.ts","../../src/rx/dom-types.ts","../../src/rx/dom-source.ts","../../src/rx/dom.ts","../../src/rx/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;AAiBA;;;;;AAEqB,cAFR,uBAEQ,EAAA,CAAA,IAAA,EADb,QACa,CADJ,OACI,CAAA,EAAA,QAAA,CAAA,EAAR,QAAQ,EAAA,GAAA,EAAA,CAAA,QAAA,CAAA,mBAAA,EAAA,CAAA;;AAAA;AA4BrB;;;AAA+C,cAAlC,YAAkC,EAAA,CAAA,OAAA,CAAA,EAAR,QAAQ,EAAA,GAAA,EAAA,CAAA,QAAA,CAAA;EAAA,UAAA,EAAA,MAAA;;;;;;;;;;;;;;;;AA9B/C;AAuBC,cC3BY,cD2BZ,EAAA,CAAA,MAAA,CAAA,EC3B8B,WD2B9B,EAAA,GC3B+D,EAAA,CAAA,QD2B/D,CC3B+D,cD2B/D,EAAA,CAAA;;;;KEpCW,cAAA,GAAiB,iBAAiB;gBAC9B;;iBAGA,MAAA,eAAqB,YAAY,iBAAiB,gBAAgB;iBAClE,MAAA,CAAA,GAAU,iBAAiB,mBAAmB;;;;KCNlD,kBAAA;;;;;;;;EHcC,WAAA,CAAA,EAAA,OAAA;EAuBZ;;;EAtBe,OACH,CAAA,EAAA,MAAA;EAAQ;;AAAA;EA4BR,UAAA,CAAA,EAAA,MAA6L;EAAA;;;EAA3J,WAAA,CAAA,EAAA,MAAA;;;;EClClC,WAAA,CAAA,EAAA,MAgBZ;CAAA;AAhB8B,KEiBnB,WAAA,GFjBmB;EAAiC;;AAAA;;;;ACThE;;EAA0B,YAAoB,CAAA,EAAA,OAAA;EAAS,SAA1B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