@govtechsg/sgds-web-component 3.29.0 → 3.29.1-rc.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.
Files changed (37) hide show
  1. package/base/dropdown-list-element.d.ts +3 -3
  2. package/base/dropdown-list-element.js.map +1 -1
  3. package/components/Appnav/index.umd.min.js.map +1 -1
  4. package/components/Breadcrumb/index.umd.min.js.map +1 -1
  5. package/components/ComboBox/combo-box.js +1 -1
  6. package/components/ComboBox/combo-box.js.map +1 -1
  7. package/components/ComboBox/index.umd.min.js +28 -19
  8. package/components/ComboBox/index.umd.min.js.map +1 -1
  9. package/components/ComboBox/sgds-combo-box.d.ts +23 -2
  10. package/components/ComboBox/sgds-combo-box.js +95 -4
  11. package/components/ComboBox/sgds-combo-box.js.map +1 -1
  12. package/components/ComboBox/types.d.ts +3 -0
  13. package/components/Dropdown/index.umd.min.js.map +1 -1
  14. package/components/Mainnav/index.umd.min.js.map +1 -1
  15. package/components/OverflowMenu/index.umd.min.js.map +1 -1
  16. package/components/Select/index.umd.min.js.map +1 -1
  17. package/components/index.umd.min.js +14 -5
  18. package/components/index.umd.min.js.map +1 -1
  19. package/custom-elements.json +155 -34
  20. package/index.umd.min.js +711 -702
  21. package/index.umd.min.js.map +1 -1
  22. package/package.json +1 -1
  23. package/react/base/dropdown-list-element.cjs.js.map +1 -1
  24. package/react/base/dropdown-list-element.js.map +1 -1
  25. package/react/combo-box/index.cjs.js +1 -0
  26. package/react/combo-box/index.cjs.js.map +1 -1
  27. package/react/combo-box/index.js +1 -0
  28. package/react/combo-box/index.js.map +1 -1
  29. package/react/components/ComboBox/combo-box.cjs.js +1 -1
  30. package/react/components/ComboBox/combo-box.cjs.js.map +1 -1
  31. package/react/components/ComboBox/combo-box.js +1 -1
  32. package/react/components/ComboBox/combo-box.js.map +1 -1
  33. package/react/components/ComboBox/sgds-combo-box.cjs.js +95 -4
  34. package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
  35. package/react/components/ComboBox/sgds-combo-box.js +95 -4
  36. package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
  37. package/types/react.d.ts +7 -0
@@ -5352,6 +5352,10 @@
5352
5352
  {
5353
5353
  "description": "default slot to pass in sgds-combo-box-option",
5354
5354
  "name": "default"
5355
+ },
5356
+ {
5357
+ "description": "Custom content for the \"Create\" option shown when `creatable` is true and no match is found. Use `sgds-input` event to dynamically update the slotted content with the current input value.",
5358
+ "name": "create"
5355
5359
  }
5356
5360
  ],
5357
5361
  "members": [
@@ -5434,6 +5438,17 @@
5434
5438
  "attribute": "emptyMenuAsync",
5435
5439
  "reflects": true
5436
5440
  },
5441
+ {
5442
+ "kind": "field",
5443
+ "name": "creatable",
5444
+ "type": {
5445
+ "text": "boolean"
5446
+ },
5447
+ "default": "false",
5448
+ "description": "When true, shows a \"Create xxx\" option when the typed value does not match any existing option. Selecting it emits the `sgds-create-option` event.",
5449
+ "attribute": "creatable",
5450
+ "reflects": true
5451
+ },
5437
5452
  {
5438
5453
  "kind": "field",
5439
5454
  "name": "scrollBottomOffset",
@@ -5738,6 +5753,107 @@
5738
5753
  "description": "Used `repeat` helper from Lit to render instead of .map:\nThe reassigning of value is affecting the truncation on badge as it is not triggering the slot change event.\n\nTo compare this to lit-html's default handling for lists, consider reversing a large list of names:\nFor a list created using Array.map, lit-html maintains the DOM nodes for the list items, but reassigns the values\nFor a list created using repeat, the repeat directive reorders the existing DOM nodes, so the nodes representing the first list item move to the last position.",
5739
5754
  "type": {}
5740
5755
  },
5756
+ {
5757
+ "kind": "field",
5758
+ "name": "_createOptionSlotContent",
5759
+ "type": {
5760
+ "text": "Element[]"
5761
+ },
5762
+ "privacy": "private",
5763
+ "default": "[]",
5764
+ "description": "Slotted elements from the `create-option` named slot."
5765
+ },
5766
+ {
5767
+ "kind": "field",
5768
+ "name": "_createOptionValue",
5769
+ "type": {
5770
+ "text": "string"
5771
+ },
5772
+ "privacy": "private",
5773
+ "default": "\"\"",
5774
+ "description": "The typed value captured when the create option was last synced."
5775
+ },
5776
+ {
5777
+ "kind": "field",
5778
+ "name": "_showCreateOption",
5779
+ "type": {
5780
+ "text": "boolean"
5781
+ },
5782
+ "privacy": "private",
5783
+ "default": "false",
5784
+ "description": "Whether the shadow-DOM create-option container is visible."
5785
+ },
5786
+ {
5787
+ "kind": "method",
5788
+ "name": "_syncCreateOption",
5789
+ "privacy": "private",
5790
+ "description": "Updates visibility of the create-option container based on creatable + filter state.",
5791
+ "type": {}
5792
+ },
5793
+ {
5794
+ "kind": "method",
5795
+ "name": "_handleCreateOptionSlotChange",
5796
+ "privacy": "private",
5797
+ "parameters": [
5798
+ {
5799
+ "name": "e",
5800
+ "type": {
5801
+ "text": "Event"
5802
+ }
5803
+ }
5804
+ ],
5805
+ "description": "Handles slotchange for the create-option named slot.",
5806
+ "type": {}
5807
+ },
5808
+ {
5809
+ "kind": "method",
5810
+ "name": "_handleCreateOptionClick",
5811
+ "privacy": "private",
5812
+ "parameters": [
5813
+ {
5814
+ "name": "evt",
5815
+ "type": {
5816
+ "text": "Event"
5817
+ }
5818
+ }
5819
+ ],
5820
+ "description": "Click handler for the create-option container. Lets interactive slotted elements (links, buttons) pass through.",
5821
+ "type": {}
5822
+ },
5823
+ {
5824
+ "kind": "method",
5825
+ "name": "_handleCreateOptionKeydown",
5826
+ "privacy": "private",
5827
+ "parameters": [
5828
+ {
5829
+ "name": "evt",
5830
+ "type": {
5831
+ "text": "KeyboardEvent"
5832
+ }
5833
+ }
5834
+ ],
5835
+ "description": "Keydown handler for the create-option container.",
5836
+ "type": {}
5837
+ },
5838
+ {
5839
+ "kind": "method",
5840
+ "name": "_handleKeyboardMenuItemsEvent",
5841
+ "privacy": "protected",
5842
+ "parameters": [
5843
+ {
5844
+ "name": "e",
5845
+ "type": {
5846
+ "text": "KeyboardEvent"
5847
+ }
5848
+ }
5849
+ ],
5850
+ "type": {},
5851
+ "description": "Override base keyboard handler to include create-option in ArrowDown/Tab navigation.",
5852
+ "inheritedFrom": {
5853
+ "name": "DropdownListElement",
5854
+ "module": "src/base/dropdown-list-element.ts"
5855
+ }
5856
+ },
5741
5857
  {
5742
5858
  "kind": "method",
5743
5859
  "name": "_renderFeedbackMenu",
@@ -6280,28 +6396,10 @@
6280
6396
  "module": "src/base/dropdown-list-element.ts"
6281
6397
  }
6282
6398
  },
6283
- {
6284
- "kind": "method",
6285
- "name": "_handleKeyboardMenuItemsEvent",
6286
- "privacy": "protected",
6287
- "parameters": [
6288
- {
6289
- "name": "e",
6290
- "type": {
6291
- "text": "KeyboardEvent"
6292
- }
6293
- }
6294
- ],
6295
- "type": {},
6296
- "inheritedFrom": {
6297
- "name": "DropdownListElement",
6298
- "module": "src/base/dropdown-list-element.ts"
6299
- }
6300
- },
6301
6399
  {
6302
6400
  "kind": "method",
6303
6401
  "name": "_getMenuItems",
6304
- "privacy": "private",
6402
+ "privacy": "protected",
6305
6403
  "return": {
6306
6404
  "type": {
6307
6405
  "text": "SgdsDropdownItem[]"
@@ -6316,7 +6414,7 @@
6316
6414
  {
6317
6415
  "kind": "method",
6318
6416
  "name": "_getActiveMenuItems",
6319
- "privacy": "private",
6417
+ "privacy": "protected",
6320
6418
  "return": {
6321
6419
  "type": {
6322
6420
  "text": "SgdsDropdownItem[]"
@@ -6331,7 +6429,7 @@
6331
6429
  {
6332
6430
  "kind": "method",
6333
6431
  "name": "_setMenuItem",
6334
- "privacy": "private",
6432
+ "privacy": "protected",
6335
6433
  "parameters": [
6336
6434
  {
6337
6435
  "name": "currentItemIdx",
@@ -6621,6 +6719,12 @@
6621
6719
  "name": "sgds-scroll-end",
6622
6720
  "reactName": "onSgdsScrollEnd"
6623
6721
  },
6722
+ {
6723
+ "description": "Emitted when the user selects the \"Create xxx\" option. `event.detail = { value }`",
6724
+ "name": "sgds-create-option",
6725
+ "detailType": "ISgdsComboBoxCreateOptionEventDetail",
6726
+ "reactName": "onSgdsCreateOption"
6727
+ },
6624
6728
  {
6625
6729
  "description": "Emitted event when show instance is called",
6626
6730
  "name": "sgds-show",
@@ -6713,6 +6817,15 @@
6713
6817
  "description": "When filtering remotely and there are no results, set this to true to enable no options feedback on the menu. Applicable for async combo box only.",
6714
6818
  "fieldName": "emptyMenuAsync"
6715
6819
  },
6820
+ {
6821
+ "name": "creatable",
6822
+ "type": {
6823
+ "text": "boolean"
6824
+ },
6825
+ "default": "false",
6826
+ "description": "When true, shows a \"Create xxx\" option when the typed value does not match any existing option. Selecting it emits the `sgds-create-option` event.",
6827
+ "fieldName": "creatable"
6828
+ },
6716
6829
  {
6717
6830
  "name": "scrollBottomOffset",
6718
6831
  "type": {
@@ -6977,6 +7090,14 @@
6977
7090
  }
6978
7091
  ],
6979
7092
  "exports": [
7093
+ {
7094
+ "kind": "js",
7095
+ "name": "ISgdsComboBoxCreateOptionEventDetail",
7096
+ "declaration": {
7097
+ "name": "ISgdsComboBoxCreateOptionEventDetail",
7098
+ "module": "src/components/ComboBox/sgds-combo-box.ts"
7099
+ }
7100
+ },
6980
7101
  {
6981
7102
  "kind": "js",
6982
7103
  "name": "ISgdsComboBoxInputEventDetail",
@@ -10636,7 +10757,7 @@
10636
10757
  {
10637
10758
  "kind": "method",
10638
10759
  "name": "_getMenuItems",
10639
- "privacy": "private",
10760
+ "privacy": "protected",
10640
10761
  "return": {
10641
10762
  "type": {
10642
10763
  "text": "SgdsDropdownItem[]"
@@ -10651,7 +10772,7 @@
10651
10772
  {
10652
10773
  "kind": "method",
10653
10774
  "name": "_getActiveMenuItems",
10654
- "privacy": "private",
10775
+ "privacy": "protected",
10655
10776
  "return": {
10656
10777
  "type": {
10657
10778
  "text": "SgdsDropdownItem[]"
@@ -10666,7 +10787,7 @@
10666
10787
  {
10667
10788
  "kind": "method",
10668
10789
  "name": "_setMenuItem",
10669
- "privacy": "private",
10790
+ "privacy": "protected",
10670
10791
  "parameters": [
10671
10792
  {
10672
10793
  "name": "currentItemIdx",
@@ -20491,7 +20612,7 @@
20491
20612
  {
20492
20613
  "kind": "method",
20493
20614
  "name": "_getMenuItems",
20494
- "privacy": "private",
20615
+ "privacy": "protected",
20495
20616
  "return": {
20496
20617
  "type": {
20497
20618
  "text": "SgdsDropdownItem[]"
@@ -20506,7 +20627,7 @@
20506
20627
  {
20507
20628
  "kind": "method",
20508
20629
  "name": "_getActiveMenuItems",
20509
- "privacy": "private",
20630
+ "privacy": "protected",
20510
20631
  "return": {
20511
20632
  "type": {
20512
20633
  "text": "SgdsDropdownItem[]"
@@ -20521,7 +20642,7 @@
20521
20642
  {
20522
20643
  "kind": "method",
20523
20644
  "name": "_setMenuItem",
20524
- "privacy": "private",
20645
+ "privacy": "protected",
20525
20646
  "parameters": [
20526
20647
  {
20527
20648
  "name": "currentItemIdx",
@@ -29332,7 +29453,7 @@
29332
29453
  {
29333
29454
  "kind": "method",
29334
29455
  "name": "_getMenuItems",
29335
- "privacy": "private",
29456
+ "privacy": "protected",
29336
29457
  "return": {
29337
29458
  "type": {
29338
29459
  "text": "SgdsDropdownItem[]"
@@ -29343,7 +29464,7 @@
29343
29464
  {
29344
29465
  "kind": "method",
29345
29466
  "name": "_getActiveMenuItems",
29346
- "privacy": "private",
29467
+ "privacy": "protected",
29347
29468
  "return": {
29348
29469
  "type": {
29349
29470
  "text": "SgdsDropdownItem[]"
@@ -29354,7 +29475,7 @@
29354
29475
  {
29355
29476
  "kind": "method",
29356
29477
  "name": "_setMenuItem",
29357
- "privacy": "private",
29478
+ "privacy": "protected",
29358
29479
  "parameters": [
29359
29480
  {
29360
29481
  "name": "currentItemIdx",
@@ -31321,7 +31442,7 @@
31321
31442
  {
31322
31443
  "kind": "method",
31323
31444
  "name": "_getMenuItems",
31324
- "privacy": "private",
31445
+ "privacy": "protected",
31325
31446
  "return": {
31326
31447
  "type": {
31327
31448
  "text": "SgdsDropdownItem[]"
@@ -31336,7 +31457,7 @@
31336
31457
  {
31337
31458
  "kind": "method",
31338
31459
  "name": "_getActiveMenuItems",
31339
- "privacy": "private",
31460
+ "privacy": "protected",
31340
31461
  "return": {
31341
31462
  "type": {
31342
31463
  "text": "SgdsDropdownItem[]"
@@ -31351,7 +31472,7 @@
31351
31472
  {
31352
31473
  "kind": "method",
31353
31474
  "name": "_setMenuItem",
31354
- "privacy": "private",
31475
+ "privacy": "protected",
31355
31476
  "parameters": [
31356
31477
  {
31357
31478
  "name": "currentItemIdx",
@@ -31864,7 +31985,7 @@
31864
31985
  "package": {
31865
31986
  "name": "@govtechsg/sgds-web-component",
31866
31987
  "description": "",
31867
- "version": "3.29.0",
31988
+ "version": "3.29.1-rc.0",
31868
31989
  "author": "GovTechSG",
31869
31990
  "license": "MIT"
31870
31991
  }