sygnal 5.1.3 → 5.1.5
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/README.md +2 -1
- package/dist/astro/client.cjs.js +27 -27
- package/dist/astro/client.mjs +16 -16
- package/dist/index.cjs.js +35 -35
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +17 -17
- package/dist/sygnal.min.js +1 -1
- package/package.json +1 -1
- package/src/component.ts +7 -7
- package/src/cycle/dom/snabbdom.ts +12 -12
- package/src/index.d.ts +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ cd my-app
|
|
|
26
26
|
npm run dev
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
Choose from Vite (SPA), Vike (SSR), or Astro templates
|
|
29
|
+
Choose from Vite (SPA), Vike (SSR), or Astro templates in JavaScript or TypeScript.
|
|
30
30
|
|
|
31
31
|
**Or add to an existing project:**
|
|
32
32
|
|
|
@@ -469,6 +469,7 @@ h('div', [h('h1', 'Hello'), h('button.btn', 'Click')])
|
|
|
469
469
|
| [AI Discussion Panel](./examples/ai-panel-spa) | Complex SPA with custom drivers |
|
|
470
470
|
| [Sygnal ToDoMVC](https://github.com/tpresley/sygnal-todomvc) | [Live Demo](https://tpresley.github.io/sygnal-todomvc/) |
|
|
471
471
|
| [Sygnal 2048](https://github.com/tpresley/sygnal-2048) | [Live Demo](https://tpresley.github.io/sygnal-2048/) |
|
|
472
|
+
| [Sygnal Mahjong](https://github.com/tpresley/mahjong-trainer) | [Live Demo](https://tpresley.github.io/mahjong-trainer/) |
|
|
472
473
|
| [Sygnal Calculator](https://github.com/tpresley/sygnal-calculator) | [Live Demo](https://tpresley.github.io/sygnal-calculator/) |
|
|
473
474
|
|
|
474
475
|
## Acknowledgments
|
package/dist/astro/client.cjs.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
3
|
+
var h_js = require('snabbdom/build/h.js');
|
|
4
|
+
var init_js = require('snabbdom/build/init.js');
|
|
5
|
+
var tovnode_js = require('snabbdom/build/tovnode.js');
|
|
6
|
+
var vnode_js = require('snabbdom/build/vnode.js');
|
|
7
|
+
var jsx_js = require('snabbdom/build/jsx.js');
|
|
8
|
+
var class_js = require('snabbdom/build/modules/class.js');
|
|
9
|
+
var props_js = require('snabbdom/build/modules/props.js');
|
|
10
|
+
var attributes_js = require('snabbdom/build/modules/attributes.js');
|
|
11
|
+
var dataset_js = require('snabbdom/build/modules/dataset.js');
|
|
12
12
|
|
|
13
13
|
function _mergeNamespaces(n, m) {
|
|
14
14
|
m.forEach(function (e) {
|
|
@@ -3582,7 +3582,7 @@ function withState(main, name = 'state') {
|
|
|
3582
3582
|
*/
|
|
3583
3583
|
// Core
|
|
3584
3584
|
// Tag Fragment so we can identify it even after minification mangles Function.name
|
|
3585
|
-
|
|
3585
|
+
jsx_js.Fragment.__sygnalFragment = true;
|
|
3586
3586
|
|
|
3587
3587
|
function fromEvent(element, eventName, useCapture = false, preventDefault = false, passive = false) {
|
|
3588
3588
|
let next = null;
|
|
@@ -4221,14 +4221,14 @@ class VNodeWrapper {
|
|
|
4221
4221
|
return this.wrap([vnode]);
|
|
4222
4222
|
}
|
|
4223
4223
|
wrapDocFrag(children) {
|
|
4224
|
-
return
|
|
4224
|
+
return vnode_js.vnode('', { isolate: [] }, children, undefined, this
|
|
4225
4225
|
.rootElement);
|
|
4226
4226
|
}
|
|
4227
4227
|
wrap(children) {
|
|
4228
4228
|
const { tagName, id, className } = this.rootElement;
|
|
4229
4229
|
const selId = id ? `#${id}` : '';
|
|
4230
4230
|
const selClass = className ? `.${className.split(` `).join(`.`)}` : '';
|
|
4231
|
-
const vnode =
|
|
4231
|
+
const vnode = h_js.h(`${tagName.toLowerCase()}${selId}${selClass}`, {}, children);
|
|
4232
4232
|
vnode.data = vnode.data || {};
|
|
4233
4233
|
vnode.data.isolate = vnode.data.isolate || [];
|
|
4234
4234
|
return vnode;
|
|
@@ -4364,10 +4364,10 @@ const styleModule = {
|
|
|
4364
4364
|
|
|
4365
4365
|
const modules = [
|
|
4366
4366
|
styleModule,
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4367
|
+
class_js.classModule,
|
|
4368
|
+
props_js.propsModule,
|
|
4369
|
+
attributes_js.attributesModule,
|
|
4370
|
+
dataset_js.datasetModule,
|
|
4371
4371
|
];
|
|
4372
4372
|
|
|
4373
4373
|
class SymbolTree {
|
|
@@ -4967,7 +4967,7 @@ function makeDOMDriver(container, options = {}) {
|
|
|
4967
4967
|
makeDOMDriverInputGuard(modules$1);
|
|
4968
4968
|
const isolateModule = new IsolateModule();
|
|
4969
4969
|
const snabbdomOptions = options && options.snabbdomOptions || undefined;
|
|
4970
|
-
const patch =
|
|
4970
|
+
const patch = init_js.init([isolateModule.createModule()].concat(modules$1), undefined, snabbdomOptions);
|
|
4971
4971
|
const domReady$ = makeDOMReady$();
|
|
4972
4972
|
let vnodeWrapper;
|
|
4973
4973
|
let mutationObserver;
|
|
@@ -4994,8 +4994,8 @@ function makeDOMDriver(container, options = {}) {
|
|
|
4994
4994
|
.map(firstRoot => _default$5
|
|
4995
4995
|
.merge(rememberedVNode$.endWhen(sanitation$), sanitation$)
|
|
4996
4996
|
.map(vnode => vnodeWrapper.call(vnode))
|
|
4997
|
-
.startWith(addRootScope(
|
|
4998
|
-
.fold(patch,
|
|
4997
|
+
.startWith(addRootScope(tovnode_js.toVNode(firstRoot)))
|
|
4998
|
+
.fold(patch, tovnode_js.toVNode(firstRoot))
|
|
4999
4999
|
.drop(1)
|
|
5000
5000
|
.map(unwrapElementFromVNode)
|
|
5001
5001
|
.startWith(firstRoot)
|
|
@@ -7071,7 +7071,7 @@ function processSuspensePost(vnode) {
|
|
|
7071
7071
|
}
|
|
7072
7072
|
return vnode;
|
|
7073
7073
|
}
|
|
7074
|
-
const portalPatch =
|
|
7074
|
+
const portalPatch = init_js.init(modules);
|
|
7075
7075
|
function processPortals(vnode) {
|
|
7076
7076
|
if (!vnode || !vnode.sel)
|
|
7077
7077
|
return vnode;
|
|
@@ -7336,11 +7336,11 @@ function __sortFunctionFromObj(item) {
|
|
|
7336
7336
|
}
|
|
7337
7337
|
let ascending = true;
|
|
7338
7338
|
if (typeof directionRaw === 'string') {
|
|
7339
|
-
if (!['asc', '
|
|
7340
|
-
console.error('Sort object string values must be asc or
|
|
7339
|
+
if (!['asc', 'desc'].includes(directionRaw.toLowerCase())) {
|
|
7340
|
+
console.error('Sort object string values must be asc or desc:', item);
|
|
7341
7341
|
return undefined;
|
|
7342
7342
|
}
|
|
7343
|
-
ascending = directionRaw.toLowerCase()
|
|
7343
|
+
ascending = directionRaw.toLowerCase() !== 'desc';
|
|
7344
7344
|
}
|
|
7345
7345
|
if (typeof directionRaw === 'number') {
|
|
7346
7346
|
if (directionRaw !== 1 && directionRaw !== -1) {
|
|
@@ -7359,9 +7359,9 @@ function sortFunctionFromProp(sortProp) {
|
|
|
7359
7359
|
if (propType === 'function')
|
|
7360
7360
|
return sortProp;
|
|
7361
7361
|
if (propType === 'string') {
|
|
7362
|
-
// if passed either 'asc' or '
|
|
7363
|
-
if (sortProp.toLowerCase() === 'asc' || sortProp.toLowerCase() === '
|
|
7364
|
-
const ascending = sortProp.toLowerCase()
|
|
7362
|
+
// if passed either 'asc' or 'desc' sort on the entire item
|
|
7363
|
+
if (sortProp.toLowerCase() === 'asc' || sortProp.toLowerCase() === 'desc') {
|
|
7364
|
+
const ascending = sortProp.toLowerCase() !== 'desc';
|
|
7365
7365
|
return (a, b) => __baseSort(a, b, ascending);
|
|
7366
7366
|
}
|
|
7367
7367
|
// assume it's a field/property name, and sort it ascending
|
|
@@ -7372,7 +7372,7 @@ function sortFunctionFromProp(sortProp) {
|
|
|
7372
7372
|
const sorters = sortProp.map(item => {
|
|
7373
7373
|
if (typeof item === 'function')
|
|
7374
7374
|
return item;
|
|
7375
|
-
if (typeof item === 'string' && !['asc', '
|
|
7375
|
+
if (typeof item === 'string' && !['asc', 'desc'].includes(item.toLowerCase()))
|
|
7376
7376
|
return (a, b) => __baseSort(a[item], b[item], true);
|
|
7377
7377
|
if (isObj(item)) {
|
|
7378
7378
|
return __sortFunctionFromObj(item);
|
package/dist/astro/client.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { h } from 'snabbdom/build/h';
|
|
2
|
-
import { init } from 'snabbdom/build/init';
|
|
3
|
-
import { toVNode } from 'snabbdom/build/tovnode';
|
|
4
|
-
import { vnode } from 'snabbdom/build/vnode';
|
|
5
|
-
import { Fragment } from 'snabbdom/build/jsx';
|
|
6
|
-
import { classModule } from 'snabbdom/build/modules/class';
|
|
7
|
-
import { propsModule } from 'snabbdom/build/modules/props';
|
|
8
|
-
import { attributesModule } from 'snabbdom/build/modules/attributes';
|
|
9
|
-
import { datasetModule } from 'snabbdom/build/modules/dataset';
|
|
1
|
+
import { h } from 'snabbdom/build/h.js';
|
|
2
|
+
import { init } from 'snabbdom/build/init.js';
|
|
3
|
+
import { toVNode } from 'snabbdom/build/tovnode.js';
|
|
4
|
+
import { vnode } from 'snabbdom/build/vnode.js';
|
|
5
|
+
import { Fragment } from 'snabbdom/build/jsx.js';
|
|
6
|
+
import { classModule } from 'snabbdom/build/modules/class.js';
|
|
7
|
+
import { propsModule } from 'snabbdom/build/modules/props.js';
|
|
8
|
+
import { attributesModule } from 'snabbdom/build/modules/attributes.js';
|
|
9
|
+
import { datasetModule } from 'snabbdom/build/modules/dataset.js';
|
|
10
10
|
|
|
11
11
|
function _mergeNamespaces(n, m) {
|
|
12
12
|
m.forEach(function (e) {
|
|
@@ -7334,11 +7334,11 @@ function __sortFunctionFromObj(item) {
|
|
|
7334
7334
|
}
|
|
7335
7335
|
let ascending = true;
|
|
7336
7336
|
if (typeof directionRaw === 'string') {
|
|
7337
|
-
if (!['asc', '
|
|
7338
|
-
console.error('Sort object string values must be asc or
|
|
7337
|
+
if (!['asc', 'desc'].includes(directionRaw.toLowerCase())) {
|
|
7338
|
+
console.error('Sort object string values must be asc or desc:', item);
|
|
7339
7339
|
return undefined;
|
|
7340
7340
|
}
|
|
7341
|
-
ascending = directionRaw.toLowerCase()
|
|
7341
|
+
ascending = directionRaw.toLowerCase() !== 'desc';
|
|
7342
7342
|
}
|
|
7343
7343
|
if (typeof directionRaw === 'number') {
|
|
7344
7344
|
if (directionRaw !== 1 && directionRaw !== -1) {
|
|
@@ -7357,9 +7357,9 @@ function sortFunctionFromProp(sortProp) {
|
|
|
7357
7357
|
if (propType === 'function')
|
|
7358
7358
|
return sortProp;
|
|
7359
7359
|
if (propType === 'string') {
|
|
7360
|
-
// if passed either 'asc' or '
|
|
7361
|
-
if (sortProp.toLowerCase() === 'asc' || sortProp.toLowerCase() === '
|
|
7362
|
-
const ascending = sortProp.toLowerCase()
|
|
7360
|
+
// if passed either 'asc' or 'desc' sort on the entire item
|
|
7361
|
+
if (sortProp.toLowerCase() === 'asc' || sortProp.toLowerCase() === 'desc') {
|
|
7362
|
+
const ascending = sortProp.toLowerCase() !== 'desc';
|
|
7363
7363
|
return (a, b) => __baseSort(a, b, ascending);
|
|
7364
7364
|
}
|
|
7365
7365
|
// assume it's a field/property name, and sort it ascending
|
|
@@ -7370,7 +7370,7 @@ function sortFunctionFromProp(sortProp) {
|
|
|
7370
7370
|
const sorters = sortProp.map(item => {
|
|
7371
7371
|
if (typeof item === 'function')
|
|
7372
7372
|
return item;
|
|
7373
|
-
if (typeof item === 'string' && !['asc', '
|
|
7373
|
+
if (typeof item === 'string' && !['asc', 'desc'].includes(item.toLowerCase()))
|
|
7374
7374
|
return (a, b) => __baseSort(a[item], b[item], true);
|
|
7375
7375
|
if (isObj(item)) {
|
|
7376
7376
|
return __sortFunctionFromObj(item);
|
package/dist/index.cjs.js
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
var xs$1 = require('xstream');
|
|
4
4
|
var dropRepeatsModule = require('xstream/extra/dropRepeats.js');
|
|
5
5
|
var concat$1 = require('xstream/extra/concat.js');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
6
|
+
var h_js = require('snabbdom/build/h.js');
|
|
7
|
+
var init_js = require('snabbdom/build/init.js');
|
|
8
|
+
var tovnode_js = require('snabbdom/build/tovnode.js');
|
|
9
|
+
var vnode_js = require('snabbdom/build/vnode.js');
|
|
10
|
+
var jsx_js = require('snabbdom/build/jsx.js');
|
|
11
|
+
var class_js = require('snabbdom/build/modules/class.js');
|
|
12
|
+
var props_js = require('snabbdom/build/modules/props.js');
|
|
13
|
+
var attributes_js = require('snabbdom/build/modules/attributes.js');
|
|
14
|
+
var dataset_js = require('snabbdom/build/modules/dataset.js');
|
|
15
15
|
var sampleCombine = require('xstream/extra/sampleCombine.js');
|
|
16
16
|
var delayModule = require('xstream/extra/delay.js');
|
|
17
17
|
var debounceModule = require('xstream/extra/debounce.js');
|
|
@@ -631,7 +631,7 @@ function withState(main, name = 'state') {
|
|
|
631
631
|
*/
|
|
632
632
|
// Core
|
|
633
633
|
// Tag Fragment so we can identify it even after minification mangles Function.name
|
|
634
|
-
|
|
634
|
+
jsx_js.Fragment.__sygnalFragment = true;
|
|
635
635
|
|
|
636
636
|
function copyToThunk(vnode, thunkVNode) {
|
|
637
637
|
thunkVNode.elm = vnode.elm;
|
|
@@ -669,7 +669,7 @@ function thunk(sel, key, fn, args) {
|
|
|
669
669
|
fn = key;
|
|
670
670
|
key = undefined;
|
|
671
671
|
}
|
|
672
|
-
return
|
|
672
|
+
return h_js.h(sel, {
|
|
673
673
|
key: key,
|
|
674
674
|
hook: { init: init, prepatch: prepatch },
|
|
675
675
|
fn: fn,
|
|
@@ -1130,14 +1130,14 @@ class VNodeWrapper {
|
|
|
1130
1130
|
return this.wrap([vnode]);
|
|
1131
1131
|
}
|
|
1132
1132
|
wrapDocFrag(children) {
|
|
1133
|
-
return
|
|
1133
|
+
return vnode_js.vnode('', { isolate: [] }, children, undefined, this
|
|
1134
1134
|
.rootElement);
|
|
1135
1135
|
}
|
|
1136
1136
|
wrap(children) {
|
|
1137
1137
|
const { tagName, id, className } = this.rootElement;
|
|
1138
1138
|
const selId = id ? `#${id}` : '';
|
|
1139
1139
|
const selClass = className ? `.${className.split(` `).join(`.`)}` : '';
|
|
1140
|
-
const vnode =
|
|
1140
|
+
const vnode = h_js.h(`${tagName.toLowerCase()}${selId}${selClass}`, {}, children);
|
|
1141
1141
|
vnode.data = vnode.data || {};
|
|
1142
1142
|
vnode.data.isolate = vnode.data.isolate || [];
|
|
1143
1143
|
return vnode;
|
|
@@ -1273,10 +1273,10 @@ const styleModule = {
|
|
|
1273
1273
|
|
|
1274
1274
|
const modules = [
|
|
1275
1275
|
styleModule,
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1276
|
+
class_js.classModule,
|
|
1277
|
+
props_js.propsModule,
|
|
1278
|
+
attributes_js.attributesModule,
|
|
1279
|
+
dataset_js.datasetModule,
|
|
1280
1280
|
];
|
|
1281
1281
|
|
|
1282
1282
|
class SymbolTree {
|
|
@@ -1876,7 +1876,7 @@ function makeDOMDriver(container, options = {}) {
|
|
|
1876
1876
|
makeDOMDriverInputGuard(modules$1);
|
|
1877
1877
|
const isolateModule = new IsolateModule();
|
|
1878
1878
|
const snabbdomOptions = options && options.snabbdomOptions || undefined;
|
|
1879
|
-
const patch =
|
|
1879
|
+
const patch = init_js.init([isolateModule.createModule()].concat(modules$1), undefined, snabbdomOptions);
|
|
1880
1880
|
const domReady$ = makeDOMReady$();
|
|
1881
1881
|
let vnodeWrapper;
|
|
1882
1882
|
let mutationObserver;
|
|
@@ -1903,8 +1903,8 @@ function makeDOMDriver(container, options = {}) {
|
|
|
1903
1903
|
.map(firstRoot => xs$1
|
|
1904
1904
|
.merge(rememberedVNode$.endWhen(sanitation$), sanitation$)
|
|
1905
1905
|
.map(vnode => vnodeWrapper.call(vnode))
|
|
1906
|
-
.startWith(addRootScope(
|
|
1907
|
-
.fold(patch,
|
|
1906
|
+
.startWith(addRootScope(tovnode_js.toVNode(firstRoot)))
|
|
1907
|
+
.fold(patch, tovnode_js.toVNode(firstRoot))
|
|
1908
1908
|
.drop(1)
|
|
1909
1909
|
.map(unwrapElementFromVNode)
|
|
1910
1910
|
.startWith(firstRoot)
|
|
@@ -2044,7 +2044,7 @@ function makeIsolatedCollection(collectionOpts, isolateOpts, sources) {
|
|
|
2044
2044
|
}
|
|
2045
2045
|
const Collection = (props) => {
|
|
2046
2046
|
const { children, ...sanitizedProps } = props;
|
|
2047
|
-
return
|
|
2047
|
+
return h_js.h('collection', { props: sanitizedProps }, children);
|
|
2048
2048
|
};
|
|
2049
2049
|
Collection.label = 'collection';
|
|
2050
2050
|
Collection.preventInstantiation = true;
|
|
@@ -2152,7 +2152,7 @@ function _switchable(factories, sources, name$, switched = ['DOM'], stateSourceN
|
|
|
2152
2152
|
}
|
|
2153
2153
|
const Switchable = (props) => {
|
|
2154
2154
|
const { children, ...sanitizedProps } = props;
|
|
2155
|
-
return
|
|
2155
|
+
return h_js.h('switchable', { props: sanitizedProps }, children);
|
|
2156
2156
|
};
|
|
2157
2157
|
Switchable.label = 'switchable';
|
|
2158
2158
|
Switchable.preventInstantiation = true;
|
|
@@ -3809,7 +3809,7 @@ function processSuspensePost(vnode) {
|
|
|
3809
3809
|
}
|
|
3810
3810
|
return vnode;
|
|
3811
3811
|
}
|
|
3812
|
-
const portalPatch =
|
|
3812
|
+
const portalPatch = init_js.init(modules);
|
|
3813
3813
|
function processPortals(vnode) {
|
|
3814
3814
|
if (!vnode || !vnode.sel)
|
|
3815
3815
|
return vnode;
|
|
@@ -4074,11 +4074,11 @@ function __sortFunctionFromObj(item) {
|
|
|
4074
4074
|
}
|
|
4075
4075
|
let ascending = true;
|
|
4076
4076
|
if (typeof directionRaw === 'string') {
|
|
4077
|
-
if (!['asc', '
|
|
4078
|
-
console.error('Sort object string values must be asc or
|
|
4077
|
+
if (!['asc', 'desc'].includes(directionRaw.toLowerCase())) {
|
|
4078
|
+
console.error('Sort object string values must be asc or desc:', item);
|
|
4079
4079
|
return undefined;
|
|
4080
4080
|
}
|
|
4081
|
-
ascending = directionRaw.toLowerCase()
|
|
4081
|
+
ascending = directionRaw.toLowerCase() !== 'desc';
|
|
4082
4082
|
}
|
|
4083
4083
|
if (typeof directionRaw === 'number') {
|
|
4084
4084
|
if (directionRaw !== 1 && directionRaw !== -1) {
|
|
@@ -4097,9 +4097,9 @@ function sortFunctionFromProp(sortProp) {
|
|
|
4097
4097
|
if (propType === 'function')
|
|
4098
4098
|
return sortProp;
|
|
4099
4099
|
if (propType === 'string') {
|
|
4100
|
-
// if passed either 'asc' or '
|
|
4101
|
-
if (sortProp.toLowerCase() === 'asc' || sortProp.toLowerCase() === '
|
|
4102
|
-
const ascending = sortProp.toLowerCase()
|
|
4100
|
+
// if passed either 'asc' or 'desc' sort on the entire item
|
|
4101
|
+
if (sortProp.toLowerCase() === 'asc' || sortProp.toLowerCase() === 'desc') {
|
|
4102
|
+
const ascending = sortProp.toLowerCase() !== 'desc';
|
|
4103
4103
|
return (a, b) => __baseSort(a, b, ascending);
|
|
4104
4104
|
}
|
|
4105
4105
|
// assume it's a field/property name, and sort it ascending
|
|
@@ -4110,7 +4110,7 @@ function sortFunctionFromProp(sortProp) {
|
|
|
4110
4110
|
const sorters = sortProp.map(item => {
|
|
4111
4111
|
if (typeof item === 'function')
|
|
4112
4112
|
return item;
|
|
4113
|
-
if (typeof item === 'string' && !['asc', '
|
|
4113
|
+
if (typeof item === 'string' && !['asc', 'desc'].includes(item.toLowerCase()))
|
|
4114
4114
|
return (a, b) => __baseSort(a[item], b[item], true);
|
|
4115
4115
|
if (isObj(item)) {
|
|
4116
4116
|
return __sortFunctionFromObj(item);
|
|
@@ -4155,28 +4155,28 @@ function extractSlots(children) {
|
|
|
4155
4155
|
|
|
4156
4156
|
const Portal = (props) => {
|
|
4157
4157
|
const { children, ...sanitizedProps } = props;
|
|
4158
|
-
return
|
|
4158
|
+
return h_js.h('portal', { props: sanitizedProps }, children);
|
|
4159
4159
|
};
|
|
4160
4160
|
Portal.label = 'portal';
|
|
4161
4161
|
Portal.preventInstantiation = true;
|
|
4162
4162
|
|
|
4163
4163
|
const Transition = (props) => {
|
|
4164
4164
|
const { children, ...sanitizedProps } = props;
|
|
4165
|
-
return
|
|
4165
|
+
return h_js.h('transition', { props: sanitizedProps }, children);
|
|
4166
4166
|
};
|
|
4167
4167
|
Transition.label = 'transition';
|
|
4168
4168
|
Transition.preventInstantiation = true;
|
|
4169
4169
|
|
|
4170
4170
|
const Suspense = (props) => {
|
|
4171
4171
|
const { children, ...sanitizedProps } = props;
|
|
4172
|
-
return
|
|
4172
|
+
return h_js.h('suspense', { props: sanitizedProps }, children);
|
|
4173
4173
|
};
|
|
4174
4174
|
Suspense.label = 'suspense';
|
|
4175
4175
|
Suspense.preventInstantiation = true;
|
|
4176
4176
|
|
|
4177
4177
|
const Slot = (props) => {
|
|
4178
4178
|
const { children, ...sanitizedProps } = props;
|
|
4179
|
-
return
|
|
4179
|
+
return h_js.h('slot', { props: sanitizedProps }, children);
|
|
4180
4180
|
};
|
|
4181
4181
|
Slot.label = 'slot';
|
|
4182
4182
|
Slot.preventInstantiation = true;
|
|
@@ -6472,7 +6472,7 @@ function buildAttributes(data, selectorId, selectorClasses) {
|
|
|
6472
6472
|
exports.dropRepeats = dropRepeatsModule;
|
|
6473
6473
|
Object.defineProperty(exports, 'h', {
|
|
6474
6474
|
enumerable: true,
|
|
6475
|
-
get: function () { return
|
|
6475
|
+
get: function () { return h_js.h; }
|
|
6476
6476
|
});
|
|
6477
6477
|
exports.sampleCombine = sampleCombine;
|
|
6478
6478
|
exports.delay = delayModule;
|
package/dist/index.d.ts
CHANGED
|
@@ -239,7 +239,7 @@ export type Filter<ITEM = any> = (item: ITEM) => boolean
|
|
|
239
239
|
export type SortFunction<ITEM = any> = (a: ITEM, b: ITEM) => number
|
|
240
240
|
|
|
241
241
|
export type SortObject<ITEM = any> = {
|
|
242
|
-
[field: string]: 'asc' | '
|
|
242
|
+
[field: string]: 'asc' | 'desc' | SortFunction<ITEM>
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
/**
|
package/dist/index.esm.js
CHANGED
|
@@ -5,16 +5,16 @@ import dropRepeatsModule__default from 'xstream/extra/dropRepeats.js';
|
|
|
5
5
|
export { default as dropRepeats } from 'xstream/extra/dropRepeats.js';
|
|
6
6
|
import * as concat$1 from 'xstream/extra/concat.js';
|
|
7
7
|
import concat__default from 'xstream/extra/concat.js';
|
|
8
|
-
import { h } from 'snabbdom/build/h';
|
|
9
|
-
export { h } from 'snabbdom/build/h';
|
|
10
|
-
import { init as init$1 } from 'snabbdom/build/init';
|
|
11
|
-
import { toVNode } from 'snabbdom/build/tovnode';
|
|
12
|
-
import { vnode as vnode$1 } from 'snabbdom/build/vnode';
|
|
13
|
-
import { Fragment } from 'snabbdom/build/jsx';
|
|
14
|
-
import { classModule } from 'snabbdom/build/modules/class';
|
|
15
|
-
import { propsModule } from 'snabbdom/build/modules/props';
|
|
16
|
-
import { attributesModule } from 'snabbdom/build/modules/attributes';
|
|
17
|
-
import { datasetModule } from 'snabbdom/build/modules/dataset';
|
|
8
|
+
import { h } from 'snabbdom/build/h.js';
|
|
9
|
+
export { h } from 'snabbdom/build/h.js';
|
|
10
|
+
import { init as init$1 } from 'snabbdom/build/init.js';
|
|
11
|
+
import { toVNode } from 'snabbdom/build/tovnode.js';
|
|
12
|
+
import { vnode as vnode$1 } from 'snabbdom/build/vnode.js';
|
|
13
|
+
import { Fragment } from 'snabbdom/build/jsx.js';
|
|
14
|
+
import { classModule } from 'snabbdom/build/modules/class.js';
|
|
15
|
+
import { propsModule } from 'snabbdom/build/modules/props.js';
|
|
16
|
+
import { attributesModule } from 'snabbdom/build/modules/attributes.js';
|
|
17
|
+
import { datasetModule } from 'snabbdom/build/modules/dataset.js';
|
|
18
18
|
import sampleCombine from 'xstream/extra/sampleCombine.js';
|
|
19
19
|
export { default as sampleCombine } from 'xstream/extra/sampleCombine.js';
|
|
20
20
|
import * as delayModule from 'xstream/extra/delay.js';
|
|
@@ -4057,11 +4057,11 @@ function __sortFunctionFromObj(item) {
|
|
|
4057
4057
|
}
|
|
4058
4058
|
let ascending = true;
|
|
4059
4059
|
if (typeof directionRaw === 'string') {
|
|
4060
|
-
if (!['asc', '
|
|
4061
|
-
console.error('Sort object string values must be asc or
|
|
4060
|
+
if (!['asc', 'desc'].includes(directionRaw.toLowerCase())) {
|
|
4061
|
+
console.error('Sort object string values must be asc or desc:', item);
|
|
4062
4062
|
return undefined;
|
|
4063
4063
|
}
|
|
4064
|
-
ascending = directionRaw.toLowerCase()
|
|
4064
|
+
ascending = directionRaw.toLowerCase() !== 'desc';
|
|
4065
4065
|
}
|
|
4066
4066
|
if (typeof directionRaw === 'number') {
|
|
4067
4067
|
if (directionRaw !== 1 && directionRaw !== -1) {
|
|
@@ -4080,9 +4080,9 @@ function sortFunctionFromProp(sortProp) {
|
|
|
4080
4080
|
if (propType === 'function')
|
|
4081
4081
|
return sortProp;
|
|
4082
4082
|
if (propType === 'string') {
|
|
4083
|
-
// if passed either 'asc' or '
|
|
4084
|
-
if (sortProp.toLowerCase() === 'asc' || sortProp.toLowerCase() === '
|
|
4085
|
-
const ascending = sortProp.toLowerCase()
|
|
4083
|
+
// if passed either 'asc' or 'desc' sort on the entire item
|
|
4084
|
+
if (sortProp.toLowerCase() === 'asc' || sortProp.toLowerCase() === 'desc') {
|
|
4085
|
+
const ascending = sortProp.toLowerCase() !== 'desc';
|
|
4086
4086
|
return (a, b) => __baseSort(a, b, ascending);
|
|
4087
4087
|
}
|
|
4088
4088
|
// assume it's a field/property name, and sort it ascending
|
|
@@ -4093,7 +4093,7 @@ function sortFunctionFromProp(sortProp) {
|
|
|
4093
4093
|
const sorters = sortProp.map(item => {
|
|
4094
4094
|
if (typeof item === 'function')
|
|
4095
4095
|
return item;
|
|
4096
|
-
if (typeof item === 'string' && !['asc', '
|
|
4096
|
+
if (typeof item === 'string' && !['asc', 'desc'].includes(item.toLowerCase()))
|
|
4097
4097
|
return (a, b) => __baseSort(a[item], b[item], true);
|
|
4098
4098
|
if (isObj(item)) {
|
|
4099
4099
|
return __sortFunctionFromObj(item);
|