Skip to content

Commit 41b15f4

Browse files
committed
FIX: removed debugging logs
1 parent 2440c6e commit 41b15f4

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

apps/website/src/routes/docs/headless/checkbox/examples/pizza.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
CheckboxIndicator,
55
CheckList,
66
ChecklistIndicator,
7-
Checkbox,
87
} from '@qwik-ui/headless';
98
const toppingNames = ['hot peppers', 'ham', 'pineaple', 'mushroom'];
109
const toppingImages = ['🌶️', '🍗', '🍍', '🍄'];
@@ -17,7 +16,7 @@ export default component$(() => {
1716
class="flex items-center gap-3 border-2 border-black p-2"
1817
checkList={true}
1918
>
20-
<ChecklistIndicator class="w-fit bg-black">
19+
<ChecklistIndicator class="flex h-[25px] w-[25px] items-center justify-center bg-slate-600">
2120
<div q:slot="checkbox" id="true-img">
2221
🍕
2322
</div>

packages/kit-headless/src/components/checkbox/checkbox.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export type ChecklistTwoStateCheckboxProps = {
3535
export const Checkbox = component$<MixedStateCheckboxProps>((props) => {
3636
// this is done to avoid consumers dealing with two types checkboxes, could go in different files
3737
if (props._useCheckListContext && !props.checkList) {
38-
console.log('using chechlist');
3938
}
4039
if (props.checkList) {
4140
return (
@@ -45,7 +44,6 @@ export const Checkbox = component$<MixedStateCheckboxProps>((props) => {
4544
);
4645
}
4746
if (props._useCheckListContext) {
48-
console.log('using checklist checkbox');
4947
return (
5048
<ChecklistTwoStateCheckbox {...props}>
5149
<Slot />
@@ -99,10 +97,7 @@ export const ChecklistTwoStateCheckbox = component$<ChecklistTwoStateCheckboxPro
9997
const syncToChecklist = useSignal<undefined | boolean>(props._overWriteCheckbox);
10098
useContextProvider(CheckboxContext, appliedSig);
10199
useTask$(({ track }) => {
102-
console.log('overwrite: ', props._overWriteCheckbox, appliedSig.value);
103-
104100
if (syncToChecklist.value !== undefined) {
105-
console.log('change here ');
106101
appliedSig.value = syncToChecklist.value;
107102
syncToChecklist.value = undefined;
108103
}
@@ -113,7 +108,7 @@ export const ChecklistTwoStateCheckbox = component$<ChecklistTwoStateCheckboxPro
113108
// now i can say that there's one good application for object identity
114109
if (!checklistContext.checkboxes.value.some((e) => e === appliedSig)) {
115110
const currIndex = checklistContext.checkboxes.value.length;
116-
console.log('INSERTING ', checklistContext.idArr[currIndex]);
111+
117112
// TODO: refactor id to not run on wrapper but after conditional
118113
if (checklistID.value === undefined) {
119114
checklistID.value = checklistContext.idArr[currIndex];

packages/kit-headless/src/components/checkbox/checklist.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type JSXNode, Component, PropsOf } from '@builder.io/qwik';
2-
import { Checkbox, TriStateCheckboxProps } from './checkbox';
2+
import { Checkbox, type MixedStateCheckboxProps } from './checkbox';
33
import { ChecklistContextWrapper, getTriBool } from './checklist-context-wrapper';
44

55
type CheckListProps = PropsOf<'ul'> & { ariaLabeledBy: string };
@@ -35,22 +35,20 @@ export const CheckList: Component<CheckListProps> = (props: CheckListProps) => {
3535

3636
switch (child.type) {
3737
case Checkbox: {
38-
const typedProps = child.props as TriStateCheckboxProps;
38+
const typedProps = child.props as MixedStateCheckboxProps;
3939
// FYI: Obj.assign mutates
4040
Object.assign(typedProps, { _useCheckListContext: true });
4141
checkArr.push(child);
4242
// TODO: fix this if hell by making fn
4343
if (!typedProps.checkList) {
4444
checklistChilds.push(child);
45-
console.log('fav id: ', typedProps.id);
45+
4646
if (typedProps.id != undefined) {
47-
console.log('fav id: ', typedProps.id);
4847
idArr.push(typedProps.id as string);
4948
} else {
5049
idArr.push(false);
5150
}
5251
if (typedProps.checkBoxSig && typedProps.checkBoxSig.value) {
53-
console.log('current value here magial ', typedProps.checkBoxSig.value);
5452
boolArr.push(typedProps.checkBoxSig.value);
5553
hellSigs.push(typedProps.checkBoxSig);
5654
} else {
@@ -85,7 +83,6 @@ export const CheckList: Component<CheckListProps> = (props: CheckListProps) => {
8583
Object.assign(checkbox.props, { _overWriteCheckbox: true });
8684
});
8785
}
88-
console.log('fav idArr: ', idArr);
8986

9087
return (
9188
<>

0 commit comments

Comments
 (0)