MCPcopy Index your code
hub / github.com/nodegui/react-nodegui / setComboBoxProps

Function setComboBoxProps

src/components/ComboBox/RNComboBox.ts:39–96  ·  view source on GitHub ↗
(
  widget: RNComboBox,
  newProps: ComboBoxProps,
  oldProps: ComboBoxProps
)

Source from the content-addressed store, hash-verified

37};
38
39const setComboBoxProps = (
40 widget: RNComboBox,
41 newProps: ComboBoxProps,
42 oldProps: ComboBoxProps
43) => {
44 const setter: ComboBoxProps = {
45 set items(items: ComboBoxItem[]) {
46 widget.clear();
47 items.forEach(item => {
48 widget.addItem(item.icon, item.text, item.userData);
49 });
50 },
51 set count(count: number) {
52 widget.setProperty("count", count);
53 },
54 set iconSize(iconSize: QSize) {
55 widget.setProperty("iconSize", iconSize.native!);
56 },
57 set frame(frame: boolean) {
58 widget.setProperty("frame", frame);
59 },
60 set currentIndex(currentIndex: number) {
61 widget.setProperty("currentIndex", currentIndex);
62 },
63 set currentData(value: QVariant) {
64 widget.setProperty("currentData", value.native!);
65 },
66 set currentText(text: string) {
67 widget.setProperty("currentText", text);
68 },
69 set duplicatesEnabled(enabled: boolean) {
70 widget.setProperty("duplicatesEnabled", enabled);
71 },
72 set editable(enabled: boolean) {
73 widget.setProperty("editable", enabled);
74 },
75 set insertPolicy(policy: InsertPolicy) {
76 widget.setProperty("insertPolicy", policy);
77 },
78 set maxCount(count: number) {
79 widget.setProperty("maxCount", count);
80 },
81 set maxVisibleItems(count: number) {
82 widget.setProperty("maxVisibleItems", count);
83 },
84 set minimumContentsLength(count: number) {
85 widget.setProperty("minimumContentsLength", count);
86 },
87 set modelColumn(column: number) {
88 widget.setProperty("modelColumn", column);
89 },
90 set sizeAdjustPolicy(policy: SizeAdjustPolicy) {
91 widget.setProperty("sizeAdjustPolicy", policy);
92 }
93 };
94 Object.assign(setter, newProps);
95 setViewProps(widget, newProps, oldProps);
96};

Callers 1

setPropsMethod · 0.85

Calls 1

setViewPropsFunction · 0.90

Tested by

no test coverage detected