@tscircuit/core 0.0.10 → 0.0.11
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/index.js
CHANGED
|
@@ -1111,6 +1111,19 @@ var Resistor = class extends NormalComponent {
|
|
|
1111
1111
|
}
|
|
1112
1112
|
pin1 = this.portMap.pin1;
|
|
1113
1113
|
pin2 = this.portMap.pin2;
|
|
1114
|
+
doInitialSourceRender() {
|
|
1115
|
+
const { db } = this.project;
|
|
1116
|
+
const { _parsedProps: props } = this;
|
|
1117
|
+
const source_component = db.source_component.insert({
|
|
1118
|
+
ftype: "simple_resistor",
|
|
1119
|
+
name: props.name,
|
|
1120
|
+
// @ts-ignore
|
|
1121
|
+
manufacturer_part_number: props.manufacturerPartNumber ?? props.mfn,
|
|
1122
|
+
supplier_part_numbers: props.supplierPartNumbers,
|
|
1123
|
+
resistance: props.resistance
|
|
1124
|
+
});
|
|
1125
|
+
this.source_component_id = source_component.source_component_id;
|
|
1126
|
+
}
|
|
1114
1127
|
};
|
|
1115
1128
|
|
|
1116
1129
|
// lib/components/normal-components/Led.ts
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resistorProps } from "@tscircuit/props"
|
|
2
2
|
import type { PassivePorts, Ftype, BaseSymbolName } from "lib/utils/constants"
|
|
3
3
|
import { NormalComponent } from "../base-components/NormalComponent"
|
|
4
|
+
import type { SourceSimpleResistorInput } from "@tscircuit/soup"
|
|
4
5
|
|
|
5
6
|
export class Resistor extends NormalComponent<
|
|
6
7
|
typeof resistorProps,
|
|
@@ -16,4 +17,19 @@ export class Resistor extends NormalComponent<
|
|
|
16
17
|
|
|
17
18
|
pin1 = this.portMap.pin1
|
|
18
19
|
pin2 = this.portMap.pin2
|
|
20
|
+
|
|
21
|
+
doInitialSourceRender() {
|
|
22
|
+
const { db } = this.project!
|
|
23
|
+
const { _parsedProps: props } = this
|
|
24
|
+
const source_component = db.source_component.insert({
|
|
25
|
+
ftype: "simple_resistor",
|
|
26
|
+
name: props.name,
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
manufacturer_part_number: props.manufacturerPartNumber ?? props.mfn,
|
|
29
|
+
supplier_part_numbers: props.supplierPartNumbers,
|
|
30
|
+
|
|
31
|
+
resistance: props.resistance,
|
|
32
|
+
} as SourceSimpleResistorInput)
|
|
33
|
+
this.source_component_id = source_component.source_component_id
|
|
34
|
+
}
|
|
19
35
|
}
|