@ni/ok-components 1.12.4 → 1.14.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/all-components-bundle.js +1037 -458
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +4331 -4089
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/custom-elements.json +406 -0
- package/dist/custom-elements.md +66 -0
- package/dist/esm/fv/all-fv.d.ts +2 -0
- package/dist/esm/fv/all-fv.js +2 -0
- package/dist/esm/fv/all-fv.js.map +1 -1
- package/dist/esm/fv/filter-bar/index.d.ts +30 -0
- package/dist/esm/fv/filter-bar/index.js +120 -0
- package/dist/esm/fv/filter-bar/index.js.map +1 -0
- package/dist/esm/fv/filter-bar/styles.d.ts +1 -0
- package/dist/esm/fv/filter-bar/styles.js +119 -0
- package/dist/esm/fv/filter-bar/styles.js.map +1 -0
- package/dist/esm/fv/filter-bar/template.d.ts +2 -0
- package/dist/esm/fv/filter-bar/template.js +34 -0
- package/dist/esm/fv/filter-bar/template.js.map +1 -0
- package/dist/esm/fv/filter-bar/types.d.ts +53 -0
- package/dist/esm/fv/filter-bar/types.js +2 -0
- package/dist/esm/fv/filter-bar/types.js.map +1 -0
- package/dist/esm/fv/toolbar/index.d.ts +36 -0
- package/dist/esm/fv/toolbar/index.js +253 -0
- package/dist/esm/fv/toolbar/index.js.map +1 -0
- package/dist/esm/fv/toolbar/styles.d.ts +1 -0
- package/dist/esm/fv/toolbar/styles.js +39 -0
- package/dist/esm/fv/toolbar/styles.js.map +1 -0
- package/dist/esm/fv/toolbar/template.d.ts +4 -0
- package/dist/esm/fv/toolbar/template.js +40 -0
- package/dist/esm/fv/toolbar/template.js.map +1 -0
- package/package.json +3 -3
|
@@ -1518,6 +1518,222 @@
|
|
|
1518
1518
|
"declarations": [],
|
|
1519
1519
|
"exports": []
|
|
1520
1520
|
},
|
|
1521
|
+
{
|
|
1522
|
+
"kind": "javascript-module",
|
|
1523
|
+
"path": "src/fv/filter-bar/index.ts",
|
|
1524
|
+
"declarations": [
|
|
1525
|
+
{
|
|
1526
|
+
"kind": "class",
|
|
1527
|
+
"description": "Displays an active query and dispatches edit and clear actions.",
|
|
1528
|
+
"name": "FvFilterBar",
|
|
1529
|
+
"members": [
|
|
1530
|
+
{
|
|
1531
|
+
"kind": "field",
|
|
1532
|
+
"name": "label",
|
|
1533
|
+
"type": {
|
|
1534
|
+
"text": "string"
|
|
1535
|
+
},
|
|
1536
|
+
"privacy": "public",
|
|
1537
|
+
"default": "'Filters'",
|
|
1538
|
+
"description": "Text shown before the active query expression."
|
|
1539
|
+
},
|
|
1540
|
+
{
|
|
1541
|
+
"kind": "field",
|
|
1542
|
+
"name": "disabled",
|
|
1543
|
+
"type": {
|
|
1544
|
+
"text": "boolean"
|
|
1545
|
+
},
|
|
1546
|
+
"privacy": "public",
|
|
1547
|
+
"default": "false",
|
|
1548
|
+
"description": "Prevents editing and clearing the displayed query."
|
|
1549
|
+
},
|
|
1550
|
+
{
|
|
1551
|
+
"kind": "field",
|
|
1552
|
+
"name": "showClearButton",
|
|
1553
|
+
"type": {
|
|
1554
|
+
"text": "boolean"
|
|
1555
|
+
},
|
|
1556
|
+
"privacy": "public",
|
|
1557
|
+
"default": "true",
|
|
1558
|
+
"description": "Controls visibility of the clear button when a query is active."
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
"kind": "field",
|
|
1562
|
+
"name": "query",
|
|
1563
|
+
"type": {
|
|
1564
|
+
"text": "FvFilterBarQueryDocument"
|
|
1565
|
+
},
|
|
1566
|
+
"privacy": "public",
|
|
1567
|
+
"default": "{ version: 1, root: null }",
|
|
1568
|
+
"description": "Query document shared with FvQueryBuilder."
|
|
1569
|
+
},
|
|
1570
|
+
{
|
|
1571
|
+
"kind": "field",
|
|
1572
|
+
"name": "definition",
|
|
1573
|
+
"type": {
|
|
1574
|
+
"text": "FvFilterBarDefinition | undefined"
|
|
1575
|
+
},
|
|
1576
|
+
"privacy": "public",
|
|
1577
|
+
"description": "Field and operator labels used to display the query."
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
"kind": "field",
|
|
1581
|
+
"name": "expression",
|
|
1582
|
+
"type": {
|
|
1583
|
+
"text": "string"
|
|
1584
|
+
},
|
|
1585
|
+
"privacy": "public",
|
|
1586
|
+
"readonly": true
|
|
1587
|
+
},
|
|
1588
|
+
{
|
|
1589
|
+
"kind": "method",
|
|
1590
|
+
"name": "handleEditClick",
|
|
1591
|
+
"privacy": "public",
|
|
1592
|
+
"return": {
|
|
1593
|
+
"type": {
|
|
1594
|
+
"text": "void"
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
"kind": "method",
|
|
1600
|
+
"name": "handleClearClick",
|
|
1601
|
+
"privacy": "public",
|
|
1602
|
+
"return": {
|
|
1603
|
+
"type": {
|
|
1604
|
+
"text": "void"
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
},
|
|
1608
|
+
{
|
|
1609
|
+
"kind": "method",
|
|
1610
|
+
"name": "formatNode",
|
|
1611
|
+
"privacy": "private",
|
|
1612
|
+
"return": {
|
|
1613
|
+
"type": {
|
|
1614
|
+
"text": "FvFilterBarToken[]"
|
|
1615
|
+
}
|
|
1616
|
+
},
|
|
1617
|
+
"parameters": [
|
|
1618
|
+
{
|
|
1619
|
+
"name": "node",
|
|
1620
|
+
"type": {
|
|
1621
|
+
"text": "FvFilterBarQueryNode"
|
|
1622
|
+
}
|
|
1623
|
+
},
|
|
1624
|
+
{
|
|
1625
|
+
"name": "isRoot",
|
|
1626
|
+
"default": "false"
|
|
1627
|
+
}
|
|
1628
|
+
]
|
|
1629
|
+
},
|
|
1630
|
+
{
|
|
1631
|
+
"kind": "method",
|
|
1632
|
+
"name": "formatValue",
|
|
1633
|
+
"privacy": "private",
|
|
1634
|
+
"return": {
|
|
1635
|
+
"type": {
|
|
1636
|
+
"text": "string"
|
|
1637
|
+
}
|
|
1638
|
+
},
|
|
1639
|
+
"parameters": [
|
|
1640
|
+
{
|
|
1641
|
+
"name": "value",
|
|
1642
|
+
"type": {
|
|
1643
|
+
"text": "unknown"
|
|
1644
|
+
}
|
|
1645
|
+
},
|
|
1646
|
+
{
|
|
1647
|
+
"name": "schema",
|
|
1648
|
+
"type": {
|
|
1649
|
+
"text": "unknown"
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
]
|
|
1653
|
+
}
|
|
1654
|
+
],
|
|
1655
|
+
"events": [
|
|
1656
|
+
{
|
|
1657
|
+
"name": "edit-filter",
|
|
1658
|
+
"type": {
|
|
1659
|
+
"text": "CustomEvent"
|
|
1660
|
+
}
|
|
1661
|
+
},
|
|
1662
|
+
{
|
|
1663
|
+
"name": "clear-filter",
|
|
1664
|
+
"type": {
|
|
1665
|
+
"text": "CustomEvent"
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
],
|
|
1669
|
+
"attributes": [
|
|
1670
|
+
{
|
|
1671
|
+
"name": "label",
|
|
1672
|
+
"type": {
|
|
1673
|
+
"text": "string"
|
|
1674
|
+
},
|
|
1675
|
+
"default": "'Filters'",
|
|
1676
|
+
"description": "Text shown before the active query expression.",
|
|
1677
|
+
"fieldName": "label"
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
"name": "disabled",
|
|
1681
|
+
"type": {
|
|
1682
|
+
"text": "boolean"
|
|
1683
|
+
},
|
|
1684
|
+
"default": "false",
|
|
1685
|
+
"description": "Prevents editing and clearing the displayed query.",
|
|
1686
|
+
"fieldName": "disabled"
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
"name": "show-clear-button",
|
|
1690
|
+
"type": {
|
|
1691
|
+
"text": "boolean"
|
|
1692
|
+
},
|
|
1693
|
+
"default": "true",
|
|
1694
|
+
"description": "Controls visibility of the clear button when a query is active.",
|
|
1695
|
+
"fieldName": "showClearButton"
|
|
1696
|
+
}
|
|
1697
|
+
],
|
|
1698
|
+
"superclass": {
|
|
1699
|
+
"name": "FoundationElement",
|
|
1700
|
+
"package": "@ni/fast-foundation"
|
|
1701
|
+
}
|
|
1702
|
+
},
|
|
1703
|
+
{
|
|
1704
|
+
"kind": "variable",
|
|
1705
|
+
"name": "fvFilterBarTag",
|
|
1706
|
+
"type": {
|
|
1707
|
+
"text": "string"
|
|
1708
|
+
},
|
|
1709
|
+
"default": "'ok-fv-filter-bar'"
|
|
1710
|
+
}
|
|
1711
|
+
],
|
|
1712
|
+
"exports": [
|
|
1713
|
+
{
|
|
1714
|
+
"kind": "js",
|
|
1715
|
+
"name": "FvFilterBar",
|
|
1716
|
+
"declaration": {
|
|
1717
|
+
"name": "FvFilterBar",
|
|
1718
|
+
"module": "src/fv/filter-bar/index.ts"
|
|
1719
|
+
}
|
|
1720
|
+
},
|
|
1721
|
+
{
|
|
1722
|
+
"kind": "js",
|
|
1723
|
+
"name": "fvFilterBarTag",
|
|
1724
|
+
"declaration": {
|
|
1725
|
+
"name": "fvFilterBarTag",
|
|
1726
|
+
"module": "src/fv/filter-bar/index.ts"
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
]
|
|
1730
|
+
},
|
|
1731
|
+
{
|
|
1732
|
+
"kind": "javascript-module",
|
|
1733
|
+
"path": "src/fv/filter-bar/types.ts",
|
|
1734
|
+
"declarations": [],
|
|
1735
|
+
"exports": []
|
|
1736
|
+
},
|
|
1521
1737
|
{
|
|
1522
1738
|
"kind": "javascript-module",
|
|
1523
1739
|
"path": "src/fv/master-detail-list/index.ts",
|
|
@@ -3542,6 +3758,196 @@
|
|
|
3542
3758
|
}
|
|
3543
3759
|
]
|
|
3544
3760
|
},
|
|
3761
|
+
{
|
|
3762
|
+
"kind": "javascript-module",
|
|
3763
|
+
"path": "src/fv/toolbar/index.ts",
|
|
3764
|
+
"declarations": [
|
|
3765
|
+
{
|
|
3766
|
+
"kind": "class",
|
|
3767
|
+
"description": "A Nimble toolbar that automatically collapses declaratively configured actions.",
|
|
3768
|
+
"name": "FvToolbar",
|
|
3769
|
+
"members": [
|
|
3770
|
+
{
|
|
3771
|
+
"kind": "field",
|
|
3772
|
+
"name": "overflowLabel",
|
|
3773
|
+
"type": {
|
|
3774
|
+
"text": "string"
|
|
3775
|
+
},
|
|
3776
|
+
"privacy": "public",
|
|
3777
|
+
"default": "'More actions'"
|
|
3778
|
+
},
|
|
3779
|
+
{
|
|
3780
|
+
"kind": "field",
|
|
3781
|
+
"name": "items",
|
|
3782
|
+
"privacy": "private",
|
|
3783
|
+
"readonly": true,
|
|
3784
|
+
"default": "new Map<Button, ResponsiveItem>()"
|
|
3785
|
+
},
|
|
3786
|
+
{
|
|
3787
|
+
"kind": "field",
|
|
3788
|
+
"name": "resizeObserver",
|
|
3789
|
+
"privacy": "private",
|
|
3790
|
+
"readonly": true,
|
|
3791
|
+
"default": "new ResizeObserver(() => this.scheduleLayout())"
|
|
3792
|
+
},
|
|
3793
|
+
{
|
|
3794
|
+
"kind": "field",
|
|
3795
|
+
"name": "mutationObserver",
|
|
3796
|
+
"privacy": "private",
|
|
3797
|
+
"readonly": true,
|
|
3798
|
+
"default": "new MutationObserver(records => { for (const record of records) { const item = record.target instanceof Button ? this.items.get(record.target) : undefined; if (item && record.attributeName === 'hidden') { item.hidden = item.button.hidden; } if (item && record.attributeName === 'content-hidden') { item.contentHidden = item.button.contentHidden; } } this.scheduleLayout(); })"
|
|
3799
|
+
},
|
|
3800
|
+
{
|
|
3801
|
+
"kind": "field",
|
|
3802
|
+
"name": "observedChildren",
|
|
3803
|
+
"privacy": "private",
|
|
3804
|
+
"readonly": true,
|
|
3805
|
+
"default": "new Set<Element>()"
|
|
3806
|
+
},
|
|
3807
|
+
{
|
|
3808
|
+
"kind": "field",
|
|
3809
|
+
"name": "frame",
|
|
3810
|
+
"type": {
|
|
3811
|
+
"text": "number"
|
|
3812
|
+
},
|
|
3813
|
+
"privacy": "private",
|
|
3814
|
+
"default": "0"
|
|
3815
|
+
},
|
|
3816
|
+
{
|
|
3817
|
+
"kind": "field",
|
|
3818
|
+
"name": "allSlottedItems",
|
|
3819
|
+
"type": {
|
|
3820
|
+
"text": "(HTMLElement | Node)[]"
|
|
3821
|
+
},
|
|
3822
|
+
"privacy": "protected",
|
|
3823
|
+
"readonly": true
|
|
3824
|
+
},
|
|
3825
|
+
{
|
|
3826
|
+
"kind": "method",
|
|
3827
|
+
"name": "observeMutations",
|
|
3828
|
+
"privacy": "private",
|
|
3829
|
+
"return": {
|
|
3830
|
+
"type": {
|
|
3831
|
+
"text": "void"
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
},
|
|
3835
|
+
{
|
|
3836
|
+
"kind": "field",
|
|
3837
|
+
"name": "scheduleLayout",
|
|
3838
|
+
"privacy": "private",
|
|
3839
|
+
"readonly": true
|
|
3840
|
+
},
|
|
3841
|
+
{
|
|
3842
|
+
"kind": "method",
|
|
3843
|
+
"name": "restoreItem",
|
|
3844
|
+
"privacy": "private",
|
|
3845
|
+
"return": {
|
|
3846
|
+
"type": {
|
|
3847
|
+
"text": "void"
|
|
3848
|
+
}
|
|
3849
|
+
},
|
|
3850
|
+
"parameters": [
|
|
3851
|
+
{
|
|
3852
|
+
"name": "item",
|
|
3853
|
+
"type": {
|
|
3854
|
+
"text": "ResponsiveItem"
|
|
3855
|
+
}
|
|
3856
|
+
}
|
|
3857
|
+
]
|
|
3858
|
+
},
|
|
3859
|
+
{
|
|
3860
|
+
"kind": "method",
|
|
3861
|
+
"name": "syncItems",
|
|
3862
|
+
"privacy": "private",
|
|
3863
|
+
"return": {
|
|
3864
|
+
"type": {
|
|
3865
|
+
"text": "ResponsiveItem[]"
|
|
3866
|
+
}
|
|
3867
|
+
}
|
|
3868
|
+
},
|
|
3869
|
+
{
|
|
3870
|
+
"kind": "method",
|
|
3871
|
+
"name": "updateLayout",
|
|
3872
|
+
"privacy": "private",
|
|
3873
|
+
"return": {
|
|
3874
|
+
"type": {
|
|
3875
|
+
"text": "void"
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
},
|
|
3879
|
+
{
|
|
3880
|
+
"kind": "method",
|
|
3881
|
+
"name": "showOverflow",
|
|
3882
|
+
"privacy": "private",
|
|
3883
|
+
"return": {
|
|
3884
|
+
"type": {
|
|
3885
|
+
"text": "void"
|
|
3886
|
+
}
|
|
3887
|
+
},
|
|
3888
|
+
"parameters": [
|
|
3889
|
+
{
|
|
3890
|
+
"name": "show",
|
|
3891
|
+
"type": {
|
|
3892
|
+
"text": "boolean"
|
|
3893
|
+
}
|
|
3894
|
+
}
|
|
3895
|
+
]
|
|
3896
|
+
},
|
|
3897
|
+
{
|
|
3898
|
+
"kind": "method",
|
|
3899
|
+
"name": "fits",
|
|
3900
|
+
"privacy": "private",
|
|
3901
|
+
"return": {
|
|
3902
|
+
"type": {
|
|
3903
|
+
"text": "boolean"
|
|
3904
|
+
}
|
|
3905
|
+
}
|
|
3906
|
+
}
|
|
3907
|
+
],
|
|
3908
|
+
"attributes": [
|
|
3909
|
+
{
|
|
3910
|
+
"name": "overflow-label",
|
|
3911
|
+
"type": {
|
|
3912
|
+
"text": "string"
|
|
3913
|
+
},
|
|
3914
|
+
"default": "'More actions'",
|
|
3915
|
+
"fieldName": "overflowLabel"
|
|
3916
|
+
}
|
|
3917
|
+
],
|
|
3918
|
+
"superclass": {
|
|
3919
|
+
"name": "Toolbar",
|
|
3920
|
+
"package": "@ni/nimble-components/dist/esm/toolbar"
|
|
3921
|
+
}
|
|
3922
|
+
},
|
|
3923
|
+
{
|
|
3924
|
+
"kind": "variable",
|
|
3925
|
+
"name": "fvToolbarTag",
|
|
3926
|
+
"type": {
|
|
3927
|
+
"text": "string"
|
|
3928
|
+
},
|
|
3929
|
+
"default": "'ok-fv-toolbar'"
|
|
3930
|
+
}
|
|
3931
|
+
],
|
|
3932
|
+
"exports": [
|
|
3933
|
+
{
|
|
3934
|
+
"kind": "js",
|
|
3935
|
+
"name": "FvToolbar",
|
|
3936
|
+
"declaration": {
|
|
3937
|
+
"name": "FvToolbar",
|
|
3938
|
+
"module": "src/fv/toolbar/index.ts"
|
|
3939
|
+
}
|
|
3940
|
+
},
|
|
3941
|
+
{
|
|
3942
|
+
"kind": "js",
|
|
3943
|
+
"name": "fvToolbarTag",
|
|
3944
|
+
"declaration": {
|
|
3945
|
+
"name": "fvToolbarTag",
|
|
3946
|
+
"module": "src/fv/toolbar/index.ts"
|
|
3947
|
+
}
|
|
3948
|
+
}
|
|
3949
|
+
]
|
|
3950
|
+
},
|
|
3545
3951
|
{
|
|
3546
3952
|
"kind": "javascript-module",
|
|
3547
3953
|
"path": "src/ts/icon-dynamic/index.ts",
|
package/dist/custom-elements.md
CHANGED
|
@@ -230,6 +230,49 @@
|
|
|
230
230
|
|
|
231
231
|
<hr/>
|
|
232
232
|
|
|
233
|
+
## class: `FvFilterBar`
|
|
234
|
+
|
|
235
|
+
### Superclass
|
|
236
|
+
|
|
237
|
+
| Name | Module | Package |
|
|
238
|
+
| ------------------- | ------ | ------------------- |
|
|
239
|
+
| `FoundationElement` | | @ni/fast-foundation |
|
|
240
|
+
|
|
241
|
+
### Fields
|
|
242
|
+
|
|
243
|
+
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
244
|
+
| ----------------- | ------- | ------------------------------------ | ---------------------------- | --------------------------------------------------------------- | -------------- |
|
|
245
|
+
| `label` | public | `string` | `'Filters'` | Text shown before the active query expression. | |
|
|
246
|
+
| `disabled` | public | `boolean` | `false` | Prevents editing and clearing the displayed query. | |
|
|
247
|
+
| `showClearButton` | public | `boolean` | `true` | Controls visibility of the clear button when a query is active. | |
|
|
248
|
+
| `query` | public | `FvFilterBarQueryDocument` | `{ version: 1, root: null }` | Query document shared with FvQueryBuilder. | |
|
|
249
|
+
| `definition` | public | `FvFilterBarDefinition \| undefined` | | Field and operator labels used to display the query. | |
|
|
250
|
+
| `expression` | public | `string` | | | |
|
|
251
|
+
|
|
252
|
+
### Methods
|
|
253
|
+
|
|
254
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
255
|
+
| ------------------ | ------- | ----------- | ---------- | ------ | -------------- |
|
|
256
|
+
| `handleEditClick` | public | | | `void` | |
|
|
257
|
+
| `handleClearClick` | public | | | `void` | |
|
|
258
|
+
|
|
259
|
+
### Events
|
|
260
|
+
|
|
261
|
+
| Name | Type | Description | Inherited From |
|
|
262
|
+
| -------------- | ------------- | ----------- | -------------- |
|
|
263
|
+
| `edit-filter` | `CustomEvent` | | |
|
|
264
|
+
| `clear-filter` | `CustomEvent` | | |
|
|
265
|
+
|
|
266
|
+
### Attributes
|
|
267
|
+
|
|
268
|
+
| Name | Field | Inherited From |
|
|
269
|
+
| ------------------- | --------------- | -------------- |
|
|
270
|
+
| `label` | label | |
|
|
271
|
+
| `disabled` | disabled | |
|
|
272
|
+
| `show-clear-button` | showClearButton | |
|
|
273
|
+
|
|
274
|
+
<hr/>
|
|
275
|
+
|
|
233
276
|
## class: `FvMasterDetailList`
|
|
234
277
|
|
|
235
278
|
### Superclass
|
|
@@ -565,6 +608,29 @@
|
|
|
565
608
|
|
|
566
609
|
<hr/>
|
|
567
610
|
|
|
611
|
+
## class: `FvToolbar`
|
|
612
|
+
|
|
613
|
+
### Superclass
|
|
614
|
+
|
|
615
|
+
| Name | Module | Package |
|
|
616
|
+
| --------- | ------ | -------------------------------------- |
|
|
617
|
+
| `Toolbar` | | @ni/nimble-components/dist/esm/toolbar |
|
|
618
|
+
|
|
619
|
+
### Fields
|
|
620
|
+
|
|
621
|
+
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
622
|
+
| ----------------- | --------- | ------------------------- | ---------------- | ----------- | -------------- |
|
|
623
|
+
| `overflowLabel` | public | `string` | `'More actions'` | | |
|
|
624
|
+
| `allSlottedItems` | protected | `(HTMLElement \| Node)[]` | | | |
|
|
625
|
+
|
|
626
|
+
### Attributes
|
|
627
|
+
|
|
628
|
+
| Name | Field | Inherited From |
|
|
629
|
+
| ---------------- | ------------- | -------------- |
|
|
630
|
+
| `overflow-label` | overflowLabel | |
|
|
631
|
+
|
|
632
|
+
<hr/>
|
|
633
|
+
|
|
568
634
|
## class: `TsIconDynamic`
|
|
569
635
|
|
|
570
636
|
### Superclass
|
package/dist/esm/fv/all-fv.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import './bulk-edit-field';
|
|
|
4
4
|
import './chip-selector';
|
|
5
5
|
import './context-help';
|
|
6
6
|
import './edit-commit-bar';
|
|
7
|
+
import './filter-bar';
|
|
7
8
|
import './master-detail-list-item';
|
|
8
9
|
import './master-detail-list';
|
|
9
10
|
import './split-button';
|
|
@@ -14,3 +15,4 @@ import './summary-panel-tile';
|
|
|
14
15
|
import './search-input';
|
|
15
16
|
import './splitter';
|
|
16
17
|
import './split-layout';
|
|
18
|
+
import './toolbar';
|
package/dist/esm/fv/all-fv.js
CHANGED
|
@@ -4,6 +4,7 @@ import './bulk-edit-field';
|
|
|
4
4
|
import './chip-selector';
|
|
5
5
|
import './context-help';
|
|
6
6
|
import './edit-commit-bar';
|
|
7
|
+
import './filter-bar';
|
|
7
8
|
import './master-detail-list-item';
|
|
8
9
|
import './master-detail-list';
|
|
9
10
|
import './split-button';
|
|
@@ -14,4 +15,5 @@ import './summary-panel-tile';
|
|
|
14
15
|
import './search-input';
|
|
15
16
|
import './splitter';
|
|
16
17
|
import './split-layout';
|
|
18
|
+
import './toolbar';
|
|
17
19
|
//# sourceMappingURL=all-fv.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-fv.js","sourceRoot":"","sources":["../../../src/fv/all-fv.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,QAAQ,CAAC;AAChB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,2BAA2B,CAAC;AACnC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC;AACxB,OAAO,uBAAuB,CAAC;AAC/B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC;AACxB,OAAO,YAAY,CAAC;AACpB,OAAO,gBAAgB,CAAC","sourcesContent":["import './accordion-item';\nimport './card';\nimport './bulk-edit-field';\nimport './chip-selector';\nimport './context-help';\nimport './edit-commit-bar';\nimport './master-detail-list-item';\nimport './master-detail-list';\nimport './split-button';\nimport './split-button-anchor';\nimport './sticky-header';\nimport './summary-panel';\nimport './summary-panel-tile';\nimport './search-input';\nimport './splitter';\nimport './split-layout';\n"]}
|
|
1
|
+
{"version":3,"file":"all-fv.js","sourceRoot":"","sources":["../../../src/fv/all-fv.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,QAAQ,CAAC;AAChB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,2BAA2B,CAAC;AACnC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC;AACxB,OAAO,uBAAuB,CAAC;AAC/B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC;AACxB,OAAO,YAAY,CAAC;AACpB,OAAO,gBAAgB,CAAC;AACxB,OAAO,WAAW,CAAC","sourcesContent":["import './accordion-item';\nimport './card';\nimport './bulk-edit-field';\nimport './chip-selector';\nimport './context-help';\nimport './edit-commit-bar';\nimport './filter-bar';\nimport './master-detail-list-item';\nimport './master-detail-list';\nimport './split-button';\nimport './split-button-anchor';\nimport './sticky-header';\nimport './summary-panel';\nimport './summary-panel-tile';\nimport './search-input';\nimport './splitter';\nimport './split-layout';\nimport './toolbar';\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FoundationElement } from '@ni/fast-foundation';
|
|
2
|
+
import type { FvFilterBarDefinition, FvFilterBarQueryDocument, FvFilterBarToken } from './types';
|
|
3
|
+
declare global {
|
|
4
|
+
interface HTMLElementTagNameMap {
|
|
5
|
+
'ok-fv-filter-bar': FvFilterBar;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/** Displays an active query and dispatches edit and clear actions. */
|
|
9
|
+
export declare class FvFilterBar extends FoundationElement {
|
|
10
|
+
/** Text shown before the active query expression. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Prevents editing and clearing the displayed query. */
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
/** Controls visibility of the clear button when a query is active. */
|
|
15
|
+
showClearButton: boolean;
|
|
16
|
+
/** Query document shared with FvQueryBuilder. */
|
|
17
|
+
query: FvFilterBarQueryDocument;
|
|
18
|
+
/** Field and operator labels used to display the query. */
|
|
19
|
+
definition?: FvFilterBarDefinition;
|
|
20
|
+
/** @internal */
|
|
21
|
+
editButton: HTMLButtonElement;
|
|
22
|
+
get expression(): string;
|
|
23
|
+
/** @internal */
|
|
24
|
+
get queryTokens(): readonly FvFilterBarToken[];
|
|
25
|
+
handleEditClick(): void;
|
|
26
|
+
handleClearClick(): void;
|
|
27
|
+
private formatNode;
|
|
28
|
+
private formatValue;
|
|
29
|
+
}
|
|
30
|
+
export declare const fvFilterBarTag = "ok-fv-filter-bar";
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr, observable, volatile } from '@ni/fast-element';
|
|
3
|
+
import { DesignSystem, FoundationElement } from '@ni/fast-foundation';
|
|
4
|
+
import { styles } from './styles';
|
|
5
|
+
import { template } from './template';
|
|
6
|
+
function isRecord(value) {
|
|
7
|
+
return typeof value === 'object' && value !== null;
|
|
8
|
+
}
|
|
9
|
+
/** Displays an active query and dispatches edit and clear actions. */
|
|
10
|
+
export class FvFilterBar extends FoundationElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/** Text shown before the active query expression. */
|
|
14
|
+
this.label = 'Filters';
|
|
15
|
+
/** Prevents editing and clearing the displayed query. */
|
|
16
|
+
this.disabled = false;
|
|
17
|
+
/** Controls visibility of the clear button when a query is active. */
|
|
18
|
+
this.showClearButton = true;
|
|
19
|
+
/** Query document shared with FvQueryBuilder. */
|
|
20
|
+
this.query = { version: 1, root: null };
|
|
21
|
+
}
|
|
22
|
+
get expression() {
|
|
23
|
+
return this.queryTokens.map(token => (token.kind === 'predicate'
|
|
24
|
+
? `${token.field} ${token.operator}${token.value}`
|
|
25
|
+
: token.text)).join('');
|
|
26
|
+
}
|
|
27
|
+
/** @internal */
|
|
28
|
+
get queryTokens() {
|
|
29
|
+
return this.query.root ? this.formatNode(this.query.root, true) : [];
|
|
30
|
+
}
|
|
31
|
+
handleEditClick() {
|
|
32
|
+
this.dispatchEvent(new CustomEvent('edit-filter', {
|
|
33
|
+
bubbles: true,
|
|
34
|
+
composed: true,
|
|
35
|
+
detail: { query: this.query }
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
handleClearClick() {
|
|
39
|
+
this.editButton.focus();
|
|
40
|
+
this.dispatchEvent(new CustomEvent('clear-filter', {
|
|
41
|
+
bubbles: true,
|
|
42
|
+
composed: true,
|
|
43
|
+
detail: { query: this.query }
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
formatNode(node, isRoot = false) {
|
|
47
|
+
if (node.kind === 'predicate') {
|
|
48
|
+
const field = this.definition?.fields.find(candidate => candidate.id === node.fieldId);
|
|
49
|
+
const operator = this.definition?.operators.find(candidate => candidate.id === node.operatorId);
|
|
50
|
+
const valueSchema = operator?.operand?.kind === 'schema' ? operator.operand.schema : field?.valueSchema;
|
|
51
|
+
return [{
|
|
52
|
+
kind: 'predicate',
|
|
53
|
+
field: field?.label ?? node.fieldId,
|
|
54
|
+
operator: operator?.label ?? node.operatorId,
|
|
55
|
+
value: node.value === undefined ? '' : ` ${this.formatValue(node.value, valueSchema)}`
|
|
56
|
+
}];
|
|
57
|
+
}
|
|
58
|
+
const tokens = [];
|
|
59
|
+
for (const child of node.children) {
|
|
60
|
+
const childTokens = this.formatNode(child);
|
|
61
|
+
if (childTokens.length > 0) {
|
|
62
|
+
if (tokens.length > 0) {
|
|
63
|
+
tokens.push({ kind: 'logic', text: ` ${node.combinator.toUpperCase()} ` });
|
|
64
|
+
}
|
|
65
|
+
tokens.push(...childTokens);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return tokens.length > 0 && !isRoot
|
|
69
|
+
? [{ kind: 'group', text: '(' }, ...tokens, { kind: 'group', text: ')' }]
|
|
70
|
+
: tokens;
|
|
71
|
+
}
|
|
72
|
+
formatValue(value, schema) {
|
|
73
|
+
if (Array.isArray(value)) {
|
|
74
|
+
return value.map(item => this.formatValue(item, schema)).join(', ');
|
|
75
|
+
}
|
|
76
|
+
if (isRecord(schema) && Array.isArray(schema.oneOf)) {
|
|
77
|
+
for (const option of schema.oneOf) {
|
|
78
|
+
if (isRecord(option) && option.const === value && typeof option.title === 'string') {
|
|
79
|
+
return option.title;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (value !== null && typeof value === 'object') {
|
|
84
|
+
return JSON.stringify(value) ?? '';
|
|
85
|
+
}
|
|
86
|
+
if (typeof value === 'string') {
|
|
87
|
+
return value;
|
|
88
|
+
}
|
|
89
|
+
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
90
|
+
return value.toString();
|
|
91
|
+
}
|
|
92
|
+
return 'null';
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
__decorate([
|
|
96
|
+
attr
|
|
97
|
+
], FvFilterBar.prototype, "label", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
attr({ mode: 'boolean' })
|
|
100
|
+
], FvFilterBar.prototype, "disabled", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
attr({ attribute: 'show-clear-button', mode: 'boolean' })
|
|
103
|
+
], FvFilterBar.prototype, "showClearButton", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
observable
|
|
106
|
+
], FvFilterBar.prototype, "query", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
observable
|
|
109
|
+
], FvFilterBar.prototype, "definition", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
volatile
|
|
112
|
+
], FvFilterBar.prototype, "queryTokens", null);
|
|
113
|
+
const okFvFilterBar = FvFilterBar.compose({
|
|
114
|
+
baseName: 'fv-filter-bar',
|
|
115
|
+
template,
|
|
116
|
+
styles
|
|
117
|
+
});
|
|
118
|
+
DesignSystem.getOrCreate().withPrefix('ok').register(okFvFilterBar());
|
|
119
|
+
export const fvFilterBarTag = 'ok-fv-filter-bar';
|
|
120
|
+
//# sourceMappingURL=index.js.map
|