@redvars/peacock 3.11.0 → 3.12.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/cb-divider.js +7 -6
- package/dist/cb-divider.js.map +1 -1
- package/dist/cb-group-base-D9gv7SDY.js +114 -0
- package/dist/cb-group-base-D9gv7SDY.js.map +1 -0
- package/dist/cb-group-base-DsX_2aFl.js +325 -0
- package/dist/cb-group-base-DsX_2aFl.js.map +1 -0
- package/dist/cb-group.js +96 -0
- package/dist/cb-group.js.map +1 -0
- package/dist/cb-rule.js +212 -0
- package/dist/cb-rule.js.map +1 -0
- package/dist/condition-builder.js +90 -35
- package/dist/condition-builder.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +176 -96
- package/dist/custom-elements.json +1412 -225
- package/dist/field.js +2 -0
- package/dist/field.js.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/loader.js +6 -13
- package/dist/loader.js.map +1 -1
- package/dist/src/condition-builder/cb-divider.d.ts +3 -1
- package/dist/src/condition-builder/cb-drag.d.ts +10 -0
- package/dist/src/condition-builder/cb-group-base.d.ts +59 -0
- package/dist/src/condition-builder/cb-group.d.ts +34 -0
- package/dist/src/condition-builder/cb-rule.d.ts +32 -0
- package/dist/src/condition-builder/cb-types.d.ts +13 -0
- package/dist/src/condition-builder/condition-builder.d.ts +35 -14
- package/dist/src/condition-builder/index.d.ts +3 -3
- package/dist/src/index.d.ts +2 -1
- package/dist/test/condition-builder.test.d.ts +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/readme.md +2 -2
- package/src/condition-builder/cb-divider.scss +4 -5
- package/src/condition-builder/cb-divider.ts +3 -1
- package/src/condition-builder/cb-drag.ts +35 -0
- package/src/condition-builder/cb-group-base.scss +97 -0
- package/src/condition-builder/cb-group-base.ts +335 -0
- package/src/condition-builder/cb-group.scss +21 -0
- package/src/condition-builder/cb-group.ts +72 -0
- package/src/condition-builder/cb-rule.scss +90 -0
- package/src/condition-builder/cb-rule.ts +129 -0
- package/src/condition-builder/cb-types.ts +16 -0
- package/src/condition-builder/condition-builder.scss +12 -9
- package/src/condition-builder/condition-builder.ts +77 -17
- package/src/condition-builder/index.ts +7 -3
- package/src/field/field.scss +3 -0
- package/src/index.ts +7 -3
- package/src/loader.ts +6 -13
- package/dist/cb-compound-expression.js +0 -133
- package/dist/cb-compound-expression.js.map +0 -1
- package/dist/cb-expression.js +0 -78
- package/dist/cb-expression.js.map +0 -1
- package/dist/cb-predicate.js +0 -141
- package/dist/cb-predicate.js.map +0 -1
- package/dist/src/condition-builder/cb-compound-expression.d.ts +0 -30
- package/dist/src/condition-builder/cb-expression.d.ts +0 -30
- package/dist/src/condition-builder/cb-predicate.d.ts +0 -29
- package/src/condition-builder/cb-compound-expression.scss +0 -41
- package/src/condition-builder/cb-compound-expression.ts +0 -79
- package/src/condition-builder/cb-expression.scss +0 -13
- package/src/condition-builder/cb-expression.ts +0 -48
- package/src/condition-builder/cb-predicate.scss +0 -35
- package/src/condition-builder/cb-predicate.ts +0 -101
|
@@ -1289,65 +1289,26 @@
|
|
|
1289
1289
|
}
|
|
1290
1290
|
},
|
|
1291
1291
|
{
|
|
1292
|
-
"label": "CB
|
|
1293
|
-
"tag": "wc-cb-
|
|
1294
|
-
"rawTag": "cb-
|
|
1295
|
-
"summary": "A
|
|
1292
|
+
"label": "CB Divider",
|
|
1293
|
+
"tag": "wc-cb-divider",
|
|
1294
|
+
"rawTag": "cb-divider",
|
|
1295
|
+
"summary": "A divider line used within a condition builder to visually connect rules with an operator.",
|
|
1296
|
+
"cssprop": "--cb-divider-arm-length - Length of the connecting arms drawn by `connect-start` and `connect-end`.",
|
|
1296
1297
|
"tags": "condition-builder",
|
|
1297
|
-
"example": "```html\n<wc-cb-
|
|
1298
|
+
"example": "```html\n<wc-cb-divider>\n <wc-tag color=\"green\">and</wc-tag>\n</wc-cb-divider>\n```",
|
|
1298
1299
|
"customElement": {
|
|
1299
1300
|
"kind": "class",
|
|
1300
1301
|
"description": "",
|
|
1301
|
-
"
|
|
1302
|
-
{
|
|
1303
|
-
"name": "condition-operator",
|
|
1304
|
-
"type": {
|
|
1305
|
-
"text": "'and' | 'or' | undefined"
|
|
1306
|
-
},
|
|
1307
|
-
"description": "The logical operator joining conditions in this group ('and' or 'or').",
|
|
1308
|
-
"fieldName": "conditionOperator"
|
|
1309
|
-
},
|
|
1302
|
+
"cssProperties": [
|
|
1310
1303
|
{
|
|
1311
|
-
"
|
|
1312
|
-
"
|
|
1313
|
-
"text": "string"
|
|
1314
|
-
},
|
|
1315
|
-
"default": "''",
|
|
1316
|
-
"description": "The field name for the compound expression.",
|
|
1317
|
-
"fieldName": "fieldName"
|
|
1304
|
+
"description": "Color of the divider line.",
|
|
1305
|
+
"name": "--cb-divider-line-color"
|
|
1318
1306
|
},
|
|
1319
1307
|
{
|
|
1320
|
-
"
|
|
1321
|
-
"
|
|
1322
|
-
"text": "string"
|
|
1323
|
-
},
|
|
1324
|
-
"default": "''",
|
|
1325
|
-
"description": "The display label for the field.",
|
|
1326
|
-
"fieldName": "fieldLabel"
|
|
1308
|
+
"description": "Length of the connecting arms drawn by `connect-start` and `connect-end`.",
|
|
1309
|
+
"name": "--cb-divider-arm-length"
|
|
1327
1310
|
}
|
|
1328
1311
|
],
|
|
1329
|
-
"superclass": {
|
|
1330
|
-
"name": "LitElement",
|
|
1331
|
-
"package": "lit"
|
|
1332
|
-
},
|
|
1333
|
-
"tagName": "wc-cb-compound-expression",
|
|
1334
|
-
"customElement": true,
|
|
1335
|
-
"rawTag": {
|
|
1336
|
-
"name": "cb-compound-expression",
|
|
1337
|
-
"description": ""
|
|
1338
|
-
}
|
|
1339
|
-
}
|
|
1340
|
-
},
|
|
1341
|
-
{
|
|
1342
|
-
"label": "CB Divider",
|
|
1343
|
-
"tag": "wc-cb-divider",
|
|
1344
|
-
"rawTag": "cb-divider",
|
|
1345
|
-
"summary": "A divider line used within a condition builder to visually connect expressions with operator tags.",
|
|
1346
|
-
"tags": "condition-builder",
|
|
1347
|
-
"example": "```html\n<wc-cb-divider>\n <wc-tag color=\"green\">and</wc-tag>\n</wc-cb-divider>\n```",
|
|
1348
|
-
"customElement": {
|
|
1349
|
-
"kind": "class",
|
|
1350
|
-
"description": "",
|
|
1351
1312
|
"attributes": [
|
|
1352
1313
|
{
|
|
1353
1314
|
"name": "vertical",
|
|
@@ -1390,84 +1351,121 @@
|
|
|
1390
1351
|
}
|
|
1391
1352
|
},
|
|
1392
1353
|
{
|
|
1393
|
-
"label": "CB
|
|
1394
|
-
"tag": "wc-cb-
|
|
1395
|
-
"rawTag": "cb-
|
|
1396
|
-
"summary": "
|
|
1354
|
+
"label": "CB Group",
|
|
1355
|
+
"tag": "wc-cb-group",
|
|
1356
|
+
"rawTag": "cb-group",
|
|
1357
|
+
"summary": "A bordered, nested group of rules in a condition builder, joined by its own And/Or operator.",
|
|
1358
|
+
"overview": "<p>A bracket on the left joins the group's rules, with a pill to switch between And and Or. Rules can be dragged into, out of and within the group.</p>",
|
|
1397
1359
|
"tags": "condition-builder",
|
|
1398
|
-
"
|
|
1360
|
+
"fires": "add-rule - Dispatched when the default \"Add condition\" link is clicked.",
|
|
1361
|
+
"slot": "actions - Replaces the default \"Add condition\" link.",
|
|
1362
|
+
"example": "```html\n<wc-cb-group operator=\"or\">\n <wc-cb-rule>\n <wc-input placeholder=\"Value\"></wc-input>\n </wc-cb-rule>\n <wc-cb-rule>\n <wc-input placeholder=\"Value\"></wc-input>\n </wc-cb-rule>\n</wc-cb-group>\n```",
|
|
1399
1363
|
"customElement": {
|
|
1400
1364
|
"kind": "class",
|
|
1401
1365
|
"description": "",
|
|
1402
|
-
"
|
|
1366
|
+
"slots": [
|
|
1403
1367
|
{
|
|
1404
|
-
"
|
|
1368
|
+
"description": "Rules (`wc-cb-rule`) and nested groups.",
|
|
1369
|
+
"name": ""
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
"description": "Replaces the default \"Add condition\" link.",
|
|
1373
|
+
"name": "actions"
|
|
1374
|
+
}
|
|
1375
|
+
],
|
|
1376
|
+
"events": [
|
|
1377
|
+
{
|
|
1378
|
+
"name": "add-rule",
|
|
1405
1379
|
"type": {
|
|
1406
|
-
"text": "{
|
|
1380
|
+
"text": "CustomEvent<{group: HTMLElement}>"
|
|
1407
1381
|
},
|
|
1408
|
-
"
|
|
1409
|
-
"description": "The list of operator options to display in the operator select.\nEach item should have at least `label` and `value` properties.",
|
|
1410
|
-
"fieldName": "operators"
|
|
1382
|
+
"description": "Dispatched when the default \"Add condition\" link is clicked."
|
|
1411
1383
|
},
|
|
1412
1384
|
{
|
|
1413
|
-
"name": "operator-
|
|
1385
|
+
"name": "operator-change",
|
|
1414
1386
|
"type": {
|
|
1415
|
-
"text": "
|
|
1387
|
+
"text": "CustomEvent"
|
|
1416
1388
|
},
|
|
1417
|
-
"
|
|
1418
|
-
"
|
|
1419
|
-
|
|
1389
|
+
"description": "Dispatched when the user picks a different operator.",
|
|
1390
|
+
"inheritedFrom": {
|
|
1391
|
+
"name": "CbGroupBase",
|
|
1392
|
+
"module": "src/condition-builder/cb-group-base.ts"
|
|
1393
|
+
}
|
|
1394
|
+
},
|
|
1395
|
+
{
|
|
1396
|
+
"type": {
|
|
1397
|
+
"text": "CustomEvent<{rule: CbRule, from: HTMLElement | null, to: HTMLElement, index: number}>"
|
|
1398
|
+
},
|
|
1399
|
+
"description": "Dispatched before a rule is moved into this group. Cancelable: unless prevented, the group moves the rule.",
|
|
1400
|
+
"name": "rule-move"
|
|
1420
1401
|
}
|
|
1421
1402
|
],
|
|
1422
1403
|
"superclass": {
|
|
1423
|
-
"name": "
|
|
1424
|
-
"
|
|
1404
|
+
"name": "CbGroupBase",
|
|
1405
|
+
"module": "/src/condition-builder/cb-group-base.js"
|
|
1425
1406
|
},
|
|
1426
|
-
"tagName": "wc-cb-
|
|
1407
|
+
"tagName": "wc-cb-group",
|
|
1427
1408
|
"customElement": true,
|
|
1428
1409
|
"rawTag": {
|
|
1429
|
-
"name": "cb-
|
|
1410
|
+
"name": "cb-group",
|
|
1430
1411
|
"description": ""
|
|
1431
|
-
}
|
|
1412
|
+
},
|
|
1413
|
+
"attributes": [
|
|
1414
|
+
{
|
|
1415
|
+
"name": "operator",
|
|
1416
|
+
"type": {
|
|
1417
|
+
"text": "CbOperator"
|
|
1418
|
+
},
|
|
1419
|
+
"default": "'and'",
|
|
1420
|
+
"description": "The logical operator joining the rules and groups in this group.",
|
|
1421
|
+
"fieldName": "operator",
|
|
1422
|
+
"expandedType": {
|
|
1423
|
+
"text": "'and' | 'or'"
|
|
1424
|
+
},
|
|
1425
|
+
"inheritedFrom": {
|
|
1426
|
+
"name": "CbGroupBase",
|
|
1427
|
+
"module": "src/condition-builder/cb-group-base.ts"
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
]
|
|
1432
1431
|
}
|
|
1433
1432
|
},
|
|
1434
1433
|
{
|
|
1435
|
-
"label": "CB
|
|
1436
|
-
"tag": "wc-cb-
|
|
1437
|
-
"rawTag": "cb-
|
|
1438
|
-
"summary": "
|
|
1434
|
+
"label": "CB Rule",
|
|
1435
|
+
"tag": "wc-cb-rule",
|
|
1436
|
+
"rawTag": "cb-rule",
|
|
1437
|
+
"summary": "One condition row in a condition builder: a drag handle, the slotted field, operator and value controls, and a remove button.",
|
|
1438
|
+
"overview": "<p>Drag the handle to reorder the rule, or to move it into another group. With the handle focused, ArrowUp and ArrowDown move the rule within its group.</p>",
|
|
1439
1439
|
"tags": "condition-builder",
|
|
1440
|
-
"
|
|
1440
|
+
"cssprop": "--cb-rule-field-height - Height of the slotted fields (wc-select, wc-input…). Defaults to `2.5rem`.",
|
|
1441
|
+
"fires": "rule-remove - Dispatched when the remove button is clicked. Cancelable: unless prevented, the rule removes itself.",
|
|
1442
|
+
"example": "```html\n<wc-cb-rule>\n <wc-select placeholder=\"Field\"></wc-select>\n <wc-select placeholder=\"Operator\"></wc-select>\n <wc-input placeholder=\"Value\"></wc-input>\n</wc-cb-rule>\n```",
|
|
1441
1443
|
"customElement": {
|
|
1442
1444
|
"kind": "class",
|
|
1443
1445
|
"description": "",
|
|
1444
|
-
"
|
|
1446
|
+
"cssProperties": [
|
|
1445
1447
|
{
|
|
1446
|
-
"
|
|
1447
|
-
"
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
"fieldName": "conditionOperator"
|
|
1452
|
-
},
|
|
1448
|
+
"description": "Height of the slotted fields (wc-select, wc-input…). Defaults to `2.5rem`.",
|
|
1449
|
+
"name": "--cb-rule-field-height"
|
|
1450
|
+
}
|
|
1451
|
+
],
|
|
1452
|
+
"events": [
|
|
1453
1453
|
{
|
|
1454
|
-
"name": "vertical",
|
|
1455
1454
|
"type": {
|
|
1456
|
-
"text": "
|
|
1455
|
+
"text": "CustomEvent<{rule: CbRule, group: HTMLElement | null}>"
|
|
1457
1456
|
},
|
|
1458
|
-
"
|
|
1459
|
-
"
|
|
1460
|
-
"fieldName": "vertical"
|
|
1457
|
+
"description": "Dispatched when the remove button is clicked. Cancelable: unless prevented, the rule removes itself.",
|
|
1458
|
+
"name": "rule-remove"
|
|
1461
1459
|
}
|
|
1462
1460
|
],
|
|
1463
1461
|
"superclass": {
|
|
1464
1462
|
"name": "LitElement",
|
|
1465
1463
|
"package": "lit"
|
|
1466
1464
|
},
|
|
1467
|
-
"tagName": "wc-cb-
|
|
1465
|
+
"tagName": "wc-cb-rule",
|
|
1468
1466
|
"customElement": true,
|
|
1469
1467
|
"rawTag": {
|
|
1470
|
-
"name": "cb-
|
|
1468
|
+
"name": "cb-rule",
|
|
1471
1469
|
"description": ""
|
|
1472
1470
|
}
|
|
1473
1471
|
}
|
|
@@ -2744,22 +2742,104 @@
|
|
|
2744
2742
|
"label": "Condition Builder",
|
|
2745
2743
|
"tag": "wc-condition-builder",
|
|
2746
2744
|
"rawTag": "condition-builder",
|
|
2747
|
-
"summary": "A
|
|
2745
|
+
"summary": "A query builder for composing filter conditions from rules and nested groups joined by And/Or.",
|
|
2746
|
+
"overview": "<p>The condition builder is the root group of a query. It holds rules (<code>wc-cb-rule</code>) and bordered nested groups (<code>wc-cb-group</code>), each joined by a bracket with an And/Or pill.</p>\n<ul>\n <li>Click the pill to switch a group between And and Or.</li>\n <li>Drag a rule by its handle to reorder it or move it between groups.</li>\n <li>Removing, moving and switching are built in; adding rules and groups is up to you, since only you know what a new rule contains. Listen for <code>add-rule</code> and <code>add-group</code>.</li>\n</ul>",
|
|
2748
2747
|
"tags": "condition-builder",
|
|
2749
|
-
"
|
|
2748
|
+
"fires": "add-group - Dispatched when \"Add inner group\" is clicked.",
|
|
2749
|
+
"slot": "actions-end - Actions aligned to the end of the footer, such as a \"Run query\" button.",
|
|
2750
|
+
"example": "```html\n<wc-condition-builder operator=\"and\">\n <wc-cb-rule>\n <wc-input placeholder=\"Value\"></wc-input>\n </wc-cb-rule>\n <wc-cb-group operator=\"or\">\n <wc-cb-rule>\n <wc-input placeholder=\"Value\"></wc-input>\n </wc-cb-rule>\n <wc-cb-rule>\n <wc-input placeholder=\"Value\"></wc-input>\n </wc-cb-rule>\n </wc-cb-group>\n <wc-button slot=\"actions-end\">Run query</wc-button>\n</wc-condition-builder>\n```",
|
|
2750
2751
|
"customElement": {
|
|
2751
2752
|
"kind": "class",
|
|
2752
2753
|
"description": "",
|
|
2754
|
+
"slots": [
|
|
2755
|
+
{
|
|
2756
|
+
"description": "Rules (`wc-cb-rule`) and groups (`wc-cb-group`).",
|
|
2757
|
+
"name": ""
|
|
2758
|
+
},
|
|
2759
|
+
{
|
|
2760
|
+
"description": "Replaces the default \"Add rule\" and \"Add inner group\" buttons.",
|
|
2761
|
+
"name": "actions"
|
|
2762
|
+
},
|
|
2763
|
+
{
|
|
2764
|
+
"description": "Actions aligned to the end of the footer, such as a \"Run query\" button.",
|
|
2765
|
+
"name": "actions-end"
|
|
2766
|
+
}
|
|
2767
|
+
],
|
|
2768
|
+
"events": [
|
|
2769
|
+
{
|
|
2770
|
+
"name": "type",
|
|
2771
|
+
"type": {
|
|
2772
|
+
"text": "CustomEvent"
|
|
2773
|
+
}
|
|
2774
|
+
},
|
|
2775
|
+
{
|
|
2776
|
+
"name": "operator-change",
|
|
2777
|
+
"type": {
|
|
2778
|
+
"text": "CustomEvent"
|
|
2779
|
+
},
|
|
2780
|
+
"description": "Dispatched when the user picks a different operator, on this or a nested group.",
|
|
2781
|
+
"inheritedFrom": {
|
|
2782
|
+
"name": "CbGroupBase",
|
|
2783
|
+
"module": "src/condition-builder/cb-group-base.ts"
|
|
2784
|
+
}
|
|
2785
|
+
},
|
|
2786
|
+
{
|
|
2787
|
+
"type": {
|
|
2788
|
+
"text": "CustomEvent<{rule: CbRule, from: HTMLElement | null, to: HTMLElement, index: number}>"
|
|
2789
|
+
},
|
|
2790
|
+
"description": "Dispatched before a rule is moved. Cancelable: unless prevented, the target group moves the rule.",
|
|
2791
|
+
"name": "rule-move"
|
|
2792
|
+
},
|
|
2793
|
+
{
|
|
2794
|
+
"type": {
|
|
2795
|
+
"text": "CustomEvent<{rule: CbRule, group: HTMLElement | null}>"
|
|
2796
|
+
},
|
|
2797
|
+
"description": "Dispatched when a rule's remove button is clicked. Cancelable: unless prevented, the rule removes itself.",
|
|
2798
|
+
"name": "rule-remove"
|
|
2799
|
+
},
|
|
2800
|
+
{
|
|
2801
|
+
"type": {
|
|
2802
|
+
"text": "CustomEvent<{group: HTMLElement}>"
|
|
2803
|
+
},
|
|
2804
|
+
"description": "Dispatched when \"Add rule\" (or a nested group's \"Add condition\") is clicked.",
|
|
2805
|
+
"name": "add-rule"
|
|
2806
|
+
},
|
|
2807
|
+
{
|
|
2808
|
+
"type": {
|
|
2809
|
+
"text": "CustomEvent<{group: HTMLElement}>"
|
|
2810
|
+
},
|
|
2811
|
+
"description": "Dispatched when \"Add inner group\" is clicked.",
|
|
2812
|
+
"name": "add-group"
|
|
2813
|
+
}
|
|
2814
|
+
],
|
|
2753
2815
|
"superclass": {
|
|
2754
|
-
"name": "
|
|
2755
|
-
"
|
|
2816
|
+
"name": "CbGroupBase",
|
|
2817
|
+
"module": "/src/condition-builder/cb-group-base.js"
|
|
2756
2818
|
},
|
|
2757
2819
|
"tagName": "wc-condition-builder",
|
|
2758
2820
|
"customElement": true,
|
|
2759
2821
|
"rawTag": {
|
|
2760
2822
|
"name": "condition-builder",
|
|
2761
2823
|
"description": ""
|
|
2762
|
-
}
|
|
2824
|
+
},
|
|
2825
|
+
"attributes": [
|
|
2826
|
+
{
|
|
2827
|
+
"name": "operator",
|
|
2828
|
+
"type": {
|
|
2829
|
+
"text": "CbOperator"
|
|
2830
|
+
},
|
|
2831
|
+
"default": "'and'",
|
|
2832
|
+
"description": "The logical operator joining the rules and groups in this group.",
|
|
2833
|
+
"fieldName": "operator",
|
|
2834
|
+
"expandedType": {
|
|
2835
|
+
"text": "'and' | 'or'"
|
|
2836
|
+
},
|
|
2837
|
+
"inheritedFrom": {
|
|
2838
|
+
"name": "CbGroupBase",
|
|
2839
|
+
"module": "src/condition-builder/cb-group-base.ts"
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
]
|
|
2763
2843
|
}
|
|
2764
2844
|
},
|
|
2765
2845
|
{
|