@@ -598,6 +598,87 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
598
598
< Link href = "https://pnp.github.io/sp-dev-fx-controls-react/" > See all</ Link >
599
599
} />
600
600
601
+ < div className = "ms-font-m" > Services tester:
602
+ < TaxonomyPicker
603
+ allowMultipleSelections = { true }
604
+ termsetNameOrID = "61837936-29c5-46de-982c-d1adb6664b32" // id to termset that has a custom sort
605
+ panelTitle = "Select Sorted Term"
606
+ label = "Service Picker with custom actions"
607
+ context = { this . props . context }
608
+ onChange = { this . onServicePickerChange }
609
+ isTermSetSelectable = { false }
610
+ termActions = { {
611
+ actions : [ {
612
+ title : "Get term labels" ,
613
+ iconName : "LocaleLanguage" ,
614
+ id : "test" ,
615
+ invokeActionOnRender : true ,
616
+ hidden : true ,
617
+ actionCallback : async ( taxService : SPTermStorePickerService , term : ITerm ) => {
618
+ // const labels = await taxService.getTermLabels(term.Id);
619
+ // if (labels) {
620
+ // let termLabel: string = labels.join(" ; ");
621
+ // const updateAction = {
622
+ // updateActionType: UpdateType.updateTermLabel,
623
+ // value: `${termLabel} (updated)`
624
+ // };
625
+ // return updateAction;
626
+ // }
627
+ const updateAction = {
628
+ updateActionType : UpdateType . updateTermLabel ,
629
+ value : `${ term . Name } (updated)`
630
+ } ;
631
+ return updateAction ;
632
+ } ,
633
+ applyToTerm : ( term : ITerm ) => ( term && term . Name && term . Name . toLowerCase ( ) === "about us" )
634
+ } ,
635
+ // new TermLabelAction("Get Labels")
636
+ ] ,
637
+ termActionsDisplayMode : TermActionsDisplayMode . buttons ,
638
+ termActionsDisplayStyle : TermActionsDisplayStyle . textAndIcon
639
+ } }
640
+ />
641
+
642
+ < TaxonomyPicker
643
+ allowMultipleSelections = { true }
644
+ termsetNameOrID = "e813224c-bb1b-4086-b828-3d71434ddcd7" // id to termset that has a default sort
645
+ panelTitle = "Select Default Sorted Term"
646
+ label = "Service Picker"
647
+ context = { this . props . context }
648
+ onChange = { this . onServicePickerChange }
649
+ isTermSetSelectable = { false }
650
+ placeholder = "Select service"
651
+ />
652
+
653
+ < TaxonomyPicker
654
+ initialValues = { this . state . initialValues }
655
+ allowMultipleSelections = { true }
656
+ termsetNameOrID = "41dec50a-3e09-4b3f-842a-7224cffc74c0"
657
+ anchorId = "436a6154-9691-4925-baa5-4c9bb9212cbf"
658
+ // disabledTermIds={["943fd9f0-3d7c-415c-9192-93c0e54573fb", "0e415292-cce5-44ac-87c7-ef99dd1f01f4"]}
659
+ // disabledTermIds={["943fd9f0-3d7c-415c-9192-93c0e54573fb", "73d18756-20af-41de-808c-2a1e21851e44", "0e415292-cce5-44ac-87c7-ef99dd1f01f4"]}
660
+ // disabledTermIds={["cd6f6d3c-672d-4244-9320-c1e64cc0626f", "0e415292-cce5-44ac-87c7-ef99dd1f01f4"]}
661
+ // disableChildrenOfDisabledParents={true}
662
+ panelTitle = "Select Term"
663
+ label = "Taxonomy Picker"
664
+ context = { this . props . context }
665
+ onChange = { this . _onTaxPickerChange }
666
+ isTermSetSelectable = { false }
667
+ hideDeprecatedTags = { true }
668
+ hideTagsNotAvailableForTagging = { true } />
669
+
670
+ < DefaultButton text = "Add" onClick = { ( ) => {
671
+ this . setState ( {
672
+ initialValues : [ {
673
+ key : "ab703558-2546-4b23-b8b8-2bcb2c0086f5" ,
674
+ name : "HR" ,
675
+ path : "HR" ,
676
+ termSet : "b3e9b754-2593-4ae6-abc2-35345402e186"
677
+ } ]
678
+ } ) ;
679
+ } } />
680
+ </ div >
681
+
601
682
602
683
< DateTimePicker label = "DateTime Picker (unspecified = date and time)" isMonthPickerVisible = { false } showSeconds = { false } onChange = { ( value ) => console . log ( "DateTimePicker value:" , value ) } placeholder = "Pick a date" />
603
684
< DateTimePicker label = "DateTime Picker 12-hour clock" showSeconds = { true } onChange = { ( value ) => console . log ( "DateTimePicker value:" , value ) } />
@@ -886,86 +967,6 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
886
967
887
968
</ div >
888
969
889
- < div className = "ms-font-m" > Services tester:
890
- < TaxonomyPicker
891
- allowMultipleSelections = { true }
892
- termsetNameOrID = "61837936-29c5-46de-982c-d1adb6664b32" // id to termset that has a custom sort
893
- panelTitle = "Select Sorted Term"
894
- label = "Service Picker with custom actions"
895
- context = { this . props . context }
896
- onChange = { this . onServicePickerChange }
897
- isTermSetSelectable = { false }
898
- termActions = { {
899
- actions : [ {
900
- title : "Get term labels" ,
901
- iconName : "LocaleLanguage" ,
902
- id : "test" ,
903
- invokeActionOnRender : true ,
904
- hidden : true ,
905
- actionCallback : async ( taxService : SPTermStorePickerService , term : ITerm ) => {
906
- // const labels = await taxService.getTermLabels(term.Id);
907
- // if (labels) {
908
- // let termLabel: string = labels.join(" ; ");
909
- // const updateAction = {
910
- // updateActionType: UpdateType.updateTermLabel,
911
- // value: `${termLabel} (updated)`
912
- // };
913
- // return updateAction;
914
- // }
915
- const updateAction = {
916
- updateActionType : UpdateType . updateTermLabel ,
917
- value : `${ term . Name } (updated)`
918
- } ;
919
- return updateAction ;
920
- } ,
921
- applyToTerm : ( term : ITerm ) => ( term && term . Name && term . Name . toLowerCase ( ) === "about us" )
922
- } ,
923
- // new TermLabelAction("Get Labels")
924
- ] ,
925
- termActionsDisplayMode : TermActionsDisplayMode . buttons ,
926
- termActionsDisplayStyle : TermActionsDisplayStyle . textAndIcon
927
- } }
928
- />
929
-
930
- < TaxonomyPicker
931
- allowMultipleSelections = { true }
932
- termsetNameOrID = "e813224c-bb1b-4086-b828-3d71434ddcd7" // id to termset that has a default sort
933
- panelTitle = "Select Default Sorted Term"
934
- label = "Service Picker"
935
- context = { this . props . context }
936
- onChange = { this . onServicePickerChange }
937
- isTermSetSelectable = { false }
938
- placeholder = "Select service"
939
- />
940
-
941
- < TaxonomyPicker
942
- initialValues = { this . state . initialValues }
943
- allowMultipleSelections = { true }
944
- termsetNameOrID = "313362ca-6813-4433-bcce-7bf74a18b9cb"
945
- // anchorId="0ec2f948-3978-499e-9d3f-e51c4494d44c"
946
- // disabledTermIds={["943fd9f0-3d7c-415c-9192-93c0e54573fb", "0e415292-cce5-44ac-87c7-ef99dd1f01f4"]}
947
- // disabledTermIds={["943fd9f0-3d7c-415c-9192-93c0e54573fb", "73d18756-20af-41de-808c-2a1e21851e44", "0e415292-cce5-44ac-87c7-ef99dd1f01f4"]}
948
- // disabledTermIds={["cd6f6d3c-672d-4244-9320-c1e64cc0626f", "0e415292-cce5-44ac-87c7-ef99dd1f01f4"]}
949
- // disableChildrenOfDisabledParents={true}
950
- panelTitle = "Select Term"
951
- label = "Taxonomy Picker"
952
- context = { this . props . context }
953
- onChange = { this . _onTaxPickerChange }
954
- isTermSetSelectable = { false }
955
- hideDeprecatedTags = { true }
956
- hideTagsNotAvailableForTagging = { true } />
957
-
958
- < DefaultButton text = "Add" onClick = { ( ) => {
959
- this . setState ( {
960
- initialValues : [ {
961
- key : "ab703558-2546-4b23-b8b8-2bcb2c0086f5" ,
962
- name : "HR" ,
963
- path : "HR" ,
964
- termSet : "b3e9b754-2593-4ae6-abc2-35345402e186"
965
- } ]
966
- } ) ;
967
- } } />
968
- </ div >
969
970
< div className = "ms-font-m" > iframe dialog tester:
970
971
< PrimaryButton
971
972
text = "Open iframe Dialog"
0 commit comments