From 7a6d117a76aff03335bd8486c3db44d2d1aa5da3 Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Mon, 15 Nov 2021 20:25:40 +0530 Subject: [PATCH] feat: checkbox component --- .../hoppscotch-app/assets/scss/styles.scss | 31 -------- .../components/http/Authorization.vue | 15 +--- .../components/smart/Checkbox.vue | 77 +++++++++++++++++++ 3 files changed, 81 insertions(+), 42 deletions(-) create mode 100644 packages/hoppscotch-app/components/smart/Checkbox.vue diff --git a/packages/hoppscotch-app/assets/scss/styles.scss b/packages/hoppscotch-app/assets/scss/styles.scss index 489027c5c..6ab9329dd 100644 --- a/packages/hoppscotch-app/assets/scss/styles.scss +++ b/packages/hoppscotch-app/assets/scss/styles.scss @@ -289,37 +289,6 @@ pre.ace_editor { } } -input[type="checkbox"].checkbox { - @apply hidden; - - &, - & + label { - @apply align-middle; - @apply cursor-pointer; - - &::before { - @apply border-divider border-2; - @apply rounded; - @apply inline-flex; - @apply items-center; - @apply justify-center; - @apply text-transparent; - @apply h-4; - @apply w-4; - @apply font-icon; - - content: "\e876"; - margin: 8px 8px 8px 0; - } - } - - &:checked + label::before { - @apply bg-accent; - @apply border-accent; - @apply text-primary; - } -} - .info-response { @apply text-pink-500; } diff --git a/packages/hoppscotch-app/components/http/Authorization.vue b/packages/hoppscotch-app/components/http/Authorization.vue index 8d78b9b51..c3b474d25 100644 --- a/packages/hoppscotch-app/components/http/Authorization.vue +++ b/packages/hoppscotch-app/components/http/Authorization.vue @@ -63,19 +63,19 @@
- - --> + {{ $t("state.enabled") }} - + { if (authType.value === "basic") return "Basic Auth" @@ -263,23 +262,17 @@ export default defineComponent({ else return "None" }) const authActive = pluckRef(auth, "authActive") - const basicUsername = pluckRef(auth as Ref, "username") const basicPassword = pluckRef(auth as Ref, "password") - const bearerToken = pluckRef(auth as Ref, "token") - const oauth2Token = pluckRef(auth as Ref, "token") - const URLExcludes = useSetting("URL_EXCLUDES") - const clearContent = () => { auth.value = { authType: "none", authActive: true, } } - return { auth, authType, diff --git a/packages/hoppscotch-app/components/smart/Checkbox.vue b/packages/hoppscotch-app/components/smart/Checkbox.vue new file mode 100644 index 000000000..88a7301ce --- /dev/null +++ b/packages/hoppscotch-app/components/smart/Checkbox.vue @@ -0,0 +1,77 @@ + + + + +