@quidgest/ui 0.16.15 → 0.16.17

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.
Files changed (52) hide show
  1. package/dist/manifest/components.json +1 -0
  2. package/dist/ui.css +182 -9
  3. package/dist/ui.esm.js +4570 -4382
  4. package/dist/ui.js +12 -12
  5. package/dist/ui.min.css +1 -1
  6. package/dist/ui.min.js +723 -710
  7. package/dist/ui.scss +200 -12
  8. package/esm/components/QCheckbox/QCheckbox.d.ts +6 -2
  9. package/esm/components/QCheckbox/QCheckbox.d.ts.map +1 -1
  10. package/esm/components/QCheckbox/QCheckbox.vue.js +88 -77
  11. package/esm/components/QCheckbox/QCheckboxLabel.d.ts +2 -3
  12. package/esm/components/QCheckbox/QCheckboxLabel.d.ts.map +1 -1
  13. package/esm/components/QCheckbox/QCheckboxLabel.vue.js +32 -24
  14. package/esm/components/QCheckbox/index.d.ts +12 -4
  15. package/esm/components/QCheckbox/index.d.ts.map +1 -1
  16. package/esm/components/QCheckbox/types.d.ts +2 -7
  17. package/esm/components/QCheckbox/types.d.ts.map +1 -1
  18. package/esm/components/QCombobox/QCombobox.d.ts +16 -4
  19. package/esm/components/QCombobox/QCombobox.d.ts.map +1 -1
  20. package/esm/components/QCombobox/index.d.ts +8 -2
  21. package/esm/components/QCombobox/index.d.ts.map +1 -1
  22. package/esm/components/QDropdownMenu/QDropdownMenu.vue.js +11 -9
  23. package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts +22 -6
  24. package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts.map +1 -1
  25. package/esm/components/QDropdownMenu/QDropdownMenuContent.vue.js +171 -84
  26. package/esm/components/QDropdownMenu/index.d.ts +4 -0
  27. package/esm/components/QDropdownMenu/index.d.ts.map +1 -1
  28. package/esm/components/QDropdownMenu/types.d.ts +8 -8
  29. package/esm/components/QDropdownMenu/types.d.ts.map +1 -1
  30. package/esm/components/QList/QList.d.ts +9 -0
  31. package/esm/components/QList/QList.d.ts.map +1 -1
  32. package/esm/components/QList/QList.vue.js +73 -68
  33. package/esm/components/QList/index.d.ts +8 -0
  34. package/esm/components/QList/index.d.ts.map +1 -1
  35. package/esm/components/QSelect/QSelect.d.ts +16 -4
  36. package/esm/components/QSelect/QSelect.d.ts.map +1 -1
  37. package/esm/components/QSelect/index.d.ts +8 -2
  38. package/esm/components/QSelect/index.d.ts.map +1 -1
  39. package/esm/components/QSwitch/QSwitch.d.ts +16 -0
  40. package/esm/components/QSwitch/QSwitch.d.ts.map +1 -0
  41. package/esm/components/QSwitch/QSwitch.vue.js +129 -0
  42. package/esm/components/QSwitch/QSwitch.vue2.js +4 -0
  43. package/esm/components/QSwitch/index.d.ts +33 -0
  44. package/esm/components/QSwitch/index.d.ts.map +1 -0
  45. package/esm/components/QSwitch/index.js +6 -0
  46. package/esm/components/QSwitch/types.d.ts +39 -0
  47. package/esm/components/QSwitch/types.d.ts.map +1 -0
  48. package/esm/components/index.d.ts +1 -0
  49. package/esm/components/index.d.ts.map +1 -1
  50. package/esm/components/index.js +31 -29
  51. package/esm/index.d.ts +1 -0
  52. package/package.json +1 -1
package/dist/ui.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Quidgest UI v0.16.15
2
+ * Quidgest UI v0.16.17
3
3
  * (c) 2025 Quidgest - Consultores de Gestão, S.A.
4
4
  * Released under the MIT License.
5
5
  */
@@ -926,15 +926,14 @@ $transition-duration: 0.2s !default;
926
926
  --box-size: 1.15rem;
927
927
  --icon-color: var(--q-theme-on-primary);
928
928
  --icon-opacity: 0;
929
+ --transition-duration: 0.15s;
929
930
  display: flex;
930
- align-items: center;
931
+ align-items: flex-start;
931
932
  gap: 0.5rem;
932
933
  width: fit-content;
933
934
  color: var(--q-theme-neutral-dark);
934
- cursor: pointer;
935
935
  &__input {
936
936
  display: flex;
937
- align-self: flex-start;
938
937
  align-items: center;
939
938
  justify-content: center;
940
939
  width: var(--box-size);
@@ -944,9 +943,9 @@ $transition-duration: 0.2s !default;
944
943
  border-radius: var(--border-radius);
945
944
  padding: 0;
946
945
  transition:
947
- background 0.2s,
948
- border-color 0.2s,
949
- box-shadow 0.2s;
946
+ background var(--transition-duration),
947
+ border-color var(--transition-duration),
948
+ box-shadow var(--transition-duration);
950
949
  background-color: transparent;
951
950
  flex-shrink: 0;
952
951
  cursor: inherit;
@@ -963,16 +962,20 @@ $transition-duration: 0.2s !default;
963
962
  color: var(--icon-color);
964
963
  pointer-events: none;
965
964
  user-select: none;
966
- transition: transform 0.2s ease;
965
+ transition: transform var(--transition-duration) ease;
967
966
  opacity: var(--icon-opacity);
968
967
  }
969
968
  }
970
969
  &__native-input {
971
- transform: translateX(-100%);
972
970
  position: absolute;
973
- pointer-events: none;
974
971
  opacity: 0;
975
- margin: 0;
972
+ pointer-events: none;
973
+ width: 0;
974
+ height: 0;
975
+ }
976
+ &__label.q-label {
977
+ user-select: none;
978
+ line-height: var(--box-size);
976
979
  }
977
980
 
978
981
  &--small {
@@ -2207,7 +2210,6 @@ $base-border: 1px solid rgb(0 0 0 / 10%);
2207
2210
  flex-shrink: 0;
2208
2211
  appearance: none;
2209
2212
  border-width: 1px;
2210
- border-color: var(--q-theme-neutral);
2211
2213
  border-radius: 50%;
2212
2214
 
2213
2215
  &::before {
@@ -2558,6 +2560,192 @@ $spinner-color: var(--q-theme-primary);
2558
2560
  transform: rotate(1turn);
2559
2561
  }
2560
2562
  }
2563
+ .q-switch {
2564
+
2565
+
2566
+
2567
+ --q-switch-inner-padding: 2px;
2568
+ --q-switch-border-radius: 9999px;
2569
+ --q-switch-transition-duration: 0.15s;
2570
+ --q-switch-transition-easing: ease-out;
2571
+
2572
+ --q-switch-label-padding-v: 10px;
2573
+ --q-switch-label-padding-h: 15px;
2574
+ --q-switch-font-size: 0.75rem;
2575
+
2576
+ --q-switch-shadow-color-primary: rgb(var(--q-theme-on-background-rgb) / 20%);
2577
+ --q-switch-shadow-color-secondary: rgb(var(--q-theme-on-background-rgb) / 10%);
2578
+ --q-switch-shadow-blur-base: 3px;
2579
+ --q-switch-shadow-offset-y: 1px;
2580
+ --q-switch-shadow-spread: 2px;
2581
+
2582
+ --q-switch-shadow-color-primary-hover: rgb(var(--q-theme-on-background-rgb) / 30%);
2583
+ --q-switch-shadow-color-secondary-hover: rgb(var(--q-theme-on-background-rgb) / 15%);
2584
+ --q-switch-shadow-blur-hover: 6px;
2585
+ --q-switch-shadow-offset-y-hover: 2px;
2586
+ --q-switch-shadow-spread-hover: 4px;
2587
+
2588
+ --q-switch-disabled-opacity: 0.5;
2589
+ --q-switch-hover-background-opacity: 0.5;
2590
+
2591
+ --q-switch-checked-background: var(--q-theme-primary);
2592
+ --q-switch-on-checked-background: var(--q-theme-on-primary);
2593
+ --q-switch-unchecked-background: rgb(var(--q-theme-neutral-light-rgb) / 50%);
2594
+ --q-switch-on-unchecked-background: var(--q-theme-neutral);
2595
+
2596
+
2597
+
2598
+ display: inline-flex;
2599
+ align-items: center;
2600
+ position: relative;
2601
+ white-space: nowrap;
2602
+ background: var(--q-switch-unchecked-background);
2603
+ border-radius: var(--q-switch-border-radius);
2604
+ padding: var(--q-switch-inner-padding);
2605
+ transition: background var(--q-switch-transition-duration) var(--q-switch-transition-easing);
2606
+
2607
+
2608
+
2609
+ &--small {
2610
+ --q-switch-inner-padding: 1px;
2611
+ --q-switch-label-padding-v: 8px;
2612
+ --q-switch-label-padding-h: 12px;
2613
+ --q-switch-font-size: 0.6875rem;
2614
+ }
2615
+ &--large {
2616
+ --q-switch-inner-padding: 3px;
2617
+ --q-switch-label-padding-v: 12px;
2618
+ --q-switch-label-padding-h: 18px;
2619
+ --q-switch-font-size: 0.875rem;
2620
+ }
2621
+
2622
+
2623
+
2624
+ &--disabled {
2625
+ opacity: var(--q-switch-disabled-opacity);
2626
+ pointer-events: none;
2627
+ cursor: not-allowed;
2628
+ }
2629
+ }
2630
+ .q-switch__container {
2631
+ position: relative;
2632
+ display: inline-flex;
2633
+ align-items: center;
2634
+ justify-content: center;
2635
+ gap: 0.5em;
2636
+ }
2637
+ .q-switch__input {
2638
+ position: absolute;
2639
+ inset: 0;
2640
+ width: 100%;
2641
+ height: 100%;
2642
+ margin: 0;
2643
+ padding: 0;
2644
+ appearance: none;
2645
+ border: none;
2646
+ background: transparent;
2647
+ cursor: pointer;
2648
+ border-radius: var(--q-switch-border-radius);
2649
+ z-index: 2;
2650
+
2651
+ &:focus-visible {
2652
+ outline: $outline;
2653
+ }
2654
+
2655
+ &:disabled {
2656
+ cursor: not-allowed;
2657
+ &:focus-visible {
2658
+ outline: none;
2659
+ }
2660
+ }
2661
+ }
2662
+ .q-switch__labels {
2663
+ display: flex;
2664
+ align-items: center;
2665
+ width: 100%;
2666
+ position: relative;
2667
+ }
2668
+ .q-switch__label {
2669
+ display: inline-flex;
2670
+ align-items: center;
2671
+ justify-content: center;
2672
+ border-radius: var(--q-switch-border-radius);
2673
+ padding: var(--q-switch-label-padding-v) var(--q-switch-label-padding-h);
2674
+ user-select: none;
2675
+ transition:
2676
+ padding-left var(--q-switch-transition-duration) var(--q-switch-transition-easing),
2677
+ padding-right var(--q-switch-transition-duration) var(--q-switch-transition-easing),
2678
+ box-shadow var(--q-switch-transition-duration) var(--q-switch-transition-easing);
2679
+ cursor: pointer;
2680
+ color: var(--q-switch-on-unchecked-background);
2681
+ background: transparent;
2682
+ font-size: var(--q-switch-font-size);
2683
+ line-height: 1;
2684
+ pointer-events: none;
2685
+ font-weight: 500;
2686
+ flex: 1;
2687
+ min-width: 0;
2688
+ }
2689
+ .q-switch__label--off {
2690
+ padding-right: var(--q-switch-label-padding-v);
2691
+ }
2692
+ .q-switch__label--on {
2693
+ padding-left: var(--q-switch-label-padding-v);
2694
+ }
2695
+ .q-switch--with-labels {
2696
+ --q-switch-label-padding-v: 4px;
2697
+ .q-switch__label {
2698
+ padding: var(--q-switch-label-padding-v) var(--q-switch-label-padding-h);
2699
+ }
2700
+ }
2701
+ .q-switch--checked:not(.q-switch--readonly) {
2702
+ background: var(--q-switch-checked-background);
2703
+ .q-switch__label--off {
2704
+ color: var(--q-switch-on-checked-background);
2705
+ }
2706
+ }
2707
+ .q-switch__input:checked ~ .q-switch__labels .q-switch__label--on,
2708
+ .q-switch__input:not(:checked) ~ .q-switch__labels .q-switch__label--off {
2709
+ background: var(--q-theme-background);
2710
+ color: var(--q-theme-on-background);
2711
+ box-shadow:
2712
+ var(--q-switch-shadow-color-primary) 0 0 var(--q-switch-shadow-blur-base),
2713
+ var(--q-switch-shadow-color-secondary) 0 var(--q-switch-shadow-offset-y)
2714
+ var(--q-switch-shadow-spread);
2715
+ padding: var(--q-switch-label-padding-v) var(--q-switch-label-padding-h);
2716
+ }
2717
+ .q-switch--readonly {
2718
+ cursor: default;
2719
+ pointer-events: none;
2720
+ .q-switch__input:checked ~ .q-switch__labels .q-switch__label--on,
2721
+ .q-switch__input:not(:checked) ~ .q-switch__labels .q-switch__label--off {
2722
+ background: var(--q-theme-neutral);
2723
+ color: var(--q-theme-on-neutral);
2724
+ box-shadow: none;
2725
+ }
2726
+ }
2727
+ .q-switch:not(.q-switch--disabled) {
2728
+ .q-switch__input:hover ~ .q-switch__labels .q-switch__label--on,
2729
+ .q-switch__input:hover ~ .q-switch__labels .q-switch__label--off {
2730
+ background: rgba(
2731
+ var(--q-theme-background-rgb, 255, 255, 255),
2732
+ var(--q-switch-hover-background-opacity)
2733
+ );
2734
+ }
2735
+ .q-switch__input:checked:hover ~ .q-switch__labels .q-switch__label--on,
2736
+ .q-switch__input:not(:checked):hover ~ .q-switch__labels .q-switch__label--off {
2737
+ background: var(--q-theme-background);
2738
+ box-shadow:
2739
+ var(--q-switch-shadow-color-primary-hover) 0 0 var(--q-switch-shadow-blur-hover),
2740
+ var(--q-switch-shadow-color-secondary-hover) 0 var(--q-switch-shadow-offset-y-hover)
2741
+ var(--q-switch-shadow-spread-hover);
2742
+ }
2743
+ }
2744
+ @media (prefers-reduced-motion: reduce) {
2745
+ .q-switch__label {
2746
+ transition: none;
2747
+ }
2748
+ }
2561
2749
  .q-text-area {
2562
2750
 
2563
2751
  display: flex;
@@ -10,7 +10,9 @@ declare function __VLS_template(): {
10
10
  extras?(_: {}): any;
11
11
  extras?(_: {}): any;
12
12
  };
13
- refs: {};
13
+ refs: {
14
+ inputEl: HTMLInputElement;
15
+ };
14
16
  rootEl: any;
15
17
  };
16
18
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
@@ -23,7 +25,9 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
23
25
  color: string;
24
26
  icons: typeof DEFAULT_ICONS;
25
27
  labelPlacement: import('./types').QCheckboxLabelPlacement;
26
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
28
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
29
+ inputEl: HTMLInputElement;
30
+ }, any>;
27
31
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
28
32
  export default _default;
29
33
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1 +1 @@
1
- {"version":3,"file":"QCheckbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QCheckbox/QCheckbox.vue"],"names":[],"mappings":"AAiDA;AAwGC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAO3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAK7C,KAAK,WAAW,GAAG,cAAc,CAAC;AA+CnC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAkGT,OAAO,IAA6B;;wBAZtB,GAAG;wBACF,GAAG;;;;EAgB/B;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;6EAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"QCheckbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QCheckbox/QCheckbox.vue"],"names":[],"mappings":"AAyDA;AA4HC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAU3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAK7C,KAAK,WAAW,GAAG,cAAc,CAAC;AAwDnC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAgHT,OAAO,IAA6B;;wBAbtB,GAAG;wBACF,GAAG;;;;;;EAiB/B;AAgBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;OASnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,28 +1,31 @@
1
- import { defineComponent as x, mergeModels as v, useModel as _, computed as q, createElementBlock as g, openBlock as a, Fragment as C, createElementVNode as o, normalizeClass as B, createBlock as n, createCommentVNode as d, unref as i, createSlots as b, withCtx as m, renderSlot as h, mergeProps as k, withKeys as p, withModifiers as r } from "vue";
2
- import { DEFAULT_ICONS as $ } from "./constants.js";
3
- import { QIcon as w } from "../QIcon/index.js";
4
- import { QCheckboxLabel as f } from "./index.js";
5
- const V = ["id"], M = ["aria-checked", "disabled", "onKeydown"], P = ["checked", "disabled"], Q = /* @__PURE__ */ x({
1
+ import { defineComponent as x, mergeModels as C, useModel as _, toRef as g, useTemplateRef as B, computed as $, watch as w, createElementBlock as E, openBlock as r, normalizeClass as V, createBlock as n, createCommentVNode as t, createElementVNode as b, unref as a, createSlots as f, withCtx as p, renderSlot as h, mergeProps as k, withKeys as y, withModifiers as d } from "vue";
2
+ import { DEFAULT_ICONS as M } from "./constants.js";
3
+ import { QIcon as P } from "../QIcon/index.js";
4
+ import { QCheckboxLabel as q } from "./index.js";
5
+ import { useId as z } from "../../composables/uid.js";
6
+ const I = ["checked", "disabled", "required", "aria-readonly"], K = ["id", "aria-checked", "disabled", "onKeydown"], L = /* @__PURE__ */ x({
6
7
  inheritAttrs: !1,
7
8
  __name: "QCheckbox",
8
- props: /* @__PURE__ */ v({
9
+ props: /* @__PURE__ */ C({
9
10
  id: {},
10
11
  class: {},
11
12
  label: {},
13
+ for: {},
14
+ required: { type: Boolean },
12
15
  labelPlacement: { default: "right" },
13
16
  disabled: { type: Boolean },
14
17
  readonly: { type: Boolean },
15
18
  indeterminate: { type: Boolean },
16
19
  color: { default: "primary" },
17
20
  size: { default: "regular" },
18
- icons: { default: () => $ }
21
+ icons: { default: () => M }
19
22
  }, {
20
23
  modelValue: { type: Boolean },
21
24
  modelModifiers: {}
22
25
  }),
23
26
  emits: ["update:modelValue"],
24
27
  setup(s) {
25
- const e = s, l = _(s, "modelValue"), y = q(() => [
28
+ const e = s, l = _(s, "modelValue"), i = z(g(e, "id")), c = B("inputEl"), v = $(() => [
26
29
  "q-checkbox",
27
30
  `q-checkbox--${e.size}`,
28
31
  `q-checkbox--${e.color}`,
@@ -34,84 +37,92 @@ const V = ["id"], M = ["aria-checked", "disabled", "onKeydown"], P = ["checked",
34
37
  },
35
38
  e.class
36
39
  ]);
37
- function c() {
40
+ function u() {
38
41
  !e.disabled && !e.readonly && (l.value = !l.value);
39
42
  }
40
- return (t, u) => (a(), g(
41
- C,
42
- null,
43
+ return w(l, (o) => {
44
+ c.value && (c.value.checked = !!o);
45
+ }), (o, m) => (r(), E(
46
+ "div",
47
+ {
48
+ class: V(v.value)
49
+ },
43
50
  [
44
- o("label", {
45
- id: e.id,
46
- class: B(y.value)
51
+ e.label && e.labelPlacement !== "right" ? (r(), n(a(q), {
52
+ key: 0,
53
+ for: a(i),
54
+ label: e.label,
55
+ required: e.required
56
+ }, f({
57
+ _: 2
58
+ /* DYNAMIC */
47
59
  }, [
48
- e.labelPlacement !== "right" ? (a(), n(i(f), {
49
- key: 0,
50
- label: e.label
51
- }, b({
52
- _: 2
53
- /* DYNAMIC */
54
- }, [
55
- t.$slots.extras ? {
56
- name: "extras",
57
- fn: m(() => [
58
- h(t.$slots, "extras")
59
- ]),
60
- key: "0"
61
- } : void 0
62
- ]), 1032, ["label"])) : d("v-if", !0),
63
- o("button", k({
64
- role: "checkbox",
65
- type: "button",
66
- class: "q-checkbox__input",
67
- "aria-checked": e.indeterminate ? "mixed" : l.value,
68
- disabled: e.disabled || e.readonly
69
- }, t.$attrs, {
70
- onClick: r(c, ["prevent"]),
71
- onKeydown: [
72
- p(r(c, ["prevent"]), ["space"]),
73
- u[0] || (u[0] = p(r(() => {
74
- }, ["prevent"]), ["enter"]))
75
- ]
76
- }), [
77
- l.value || t.indeterminate ? (a(), n(
78
- i(w),
79
- k({ key: 0 }, l.value ? e.icons.checked : e.icons.indeterminate, { class: "q-checkbox__input-icon" }),
80
- null,
81
- 16
82
- /* FULL_PROPS */
83
- )) : d("v-if", !0)
84
- ], 16, M),
85
- e.labelPlacement === "right" ? (a(), n(i(f), {
86
- key: 1,
87
- label: e.label
88
- }, b({
89
- _: 2
90
- /* DYNAMIC */
91
- }, [
92
- t.$slots.extras ? {
93
- name: "extras",
94
- fn: m(() => [
95
- h(t.$slots, "extras")
96
- ]),
97
- key: "0"
98
- } : void 0
99
- ]), 1032, ["label"])) : d("v-if", !0)
100
- ], 10, V),
101
- o("input", {
60
+ o.$slots.extras ? {
61
+ name: "extras",
62
+ fn: p(() => [
63
+ h(o.$slots, "extras")
64
+ ]),
65
+ key: "0"
66
+ } : void 0
67
+ ]), 1032, ["for", "label", "required"])) : t("v-if", !0),
68
+ t(" Hidden native input for form submission "),
69
+ b("input", k({
70
+ ref: "inputEl",
102
71
  type: "checkbox",
103
- tabindex: "-1",
104
- "aria-hidden": "true",
105
72
  class: "q-checkbox__native-input",
106
- checked: !!l.value,
107
- disabled: e.disabled || e.readonly
108
- }, null, 8, P)
73
+ checked: l.value,
74
+ disabled: e.disabled || e.readonly,
75
+ required: e.required,
76
+ "aria-readonly": e.readonly,
77
+ tabindex: "-1",
78
+ "aria-hidden": "true"
79
+ }, o.$attrs), null, 16, I),
80
+ t(" Custom interactive button "),
81
+ b("button", {
82
+ id: a(i),
83
+ role: "checkbox",
84
+ type: "button",
85
+ class: "q-checkbox__input",
86
+ "aria-checked": e.indeterminate ? "mixed" : l.value,
87
+ disabled: e.disabled || e.readonly,
88
+ onClick: d(u, ["prevent"]),
89
+ onKeydown: [
90
+ y(d(u, ["prevent"]), ["space"]),
91
+ m[0] || (m[0] = y(d(() => {
92
+ }, ["prevent"]), ["enter"]))
93
+ ]
94
+ }, [
95
+ l.value || o.indeterminate ? (r(), n(
96
+ a(P),
97
+ k({ key: 0 }, l.value ? e.icons.checked : e.icons.indeterminate, { class: "q-checkbox__input-icon" }),
98
+ null,
99
+ 16
100
+ /* FULL_PROPS */
101
+ )) : t("v-if", !0)
102
+ ], 40, K),
103
+ e.label && e.labelPlacement === "right" ? (r(), n(a(q), {
104
+ key: 1,
105
+ for: a(i),
106
+ label: e.label,
107
+ required: e.required
108
+ }, f({
109
+ _: 2
110
+ /* DYNAMIC */
111
+ }, [
112
+ o.$slots.extras ? {
113
+ name: "extras",
114
+ fn: p(() => [
115
+ h(o.$slots, "extras")
116
+ ]),
117
+ key: "0"
118
+ } : void 0
119
+ ]), 1032, ["for", "label", "required"])) : t("v-if", !0)
109
120
  ],
110
- 64
111
- /* STABLE_FRAGMENT */
121
+ 2
122
+ /* CLASS */
112
123
  ));
113
124
  }
114
125
  });
115
126
  export {
116
- Q as default
127
+ L as default
117
128
  };
@@ -1,14 +1,13 @@
1
- import { QCheckboxLabelProps } from './types';
2
1
  declare function __VLS_template(): {
3
2
  attrs: Partial<{}>;
4
3
  slots: {
5
4
  extras?(_: {}): any;
6
5
  };
7
6
  refs: {};
8
- rootEl: any;
7
+ rootEl: HTMLDivElement;
9
8
  };
10
9
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
- declare const __VLS_component: import('vue').DefineComponent<QCheckboxLabelProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<QCheckboxLabelProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
10
+ declare const __VLS_component: import('vue').DefineComponent<import('..').QLabelProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('..').QLabelProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
12
11
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
13
12
  export default _default;
14
13
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1 +1 @@
1
- {"version":3,"file":"QCheckboxLabel.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QCheckbox/QCheckboxLabel.vue"],"names":[],"mappings":"AAWA;AAqBC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAOnD,iBAAS,cAAc;WAoCT,OAAO,IAA6B;;wBAVtB,GAAG;;;;EAe9B;AAQD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kTAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"QCheckboxLabel.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QCheckbox/QCheckboxLabel.vue"],"names":[],"mappings":"AAeA;AAsCA,iBAAS,cAAc;WA6CT,OAAO,IAA6B;;wBAVtB,GAAG;;;;EAe9B;AASD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,uUAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,33 +1,41 @@
1
- import { defineComponent as r, createElementBlock as t, openBlock as o, createElementVNode as l, toDisplayString as n, renderSlot as c } from "vue";
2
- const i = { key: 0 }, p = { class: "q-field__extras" }, _ = { key: 1 }, b = /* @__PURE__ */ r({
1
+ import { defineComponent as a, createElementBlock as o, openBlock as t, createVNode as l, createCommentVNode as c, unref as i, withCtx as n, createTextVNode as d, toDisplayString as _, renderSlot as p } from "vue";
2
+ import { QLabel as f } from "../QLabel/index.js";
3
+ const u = { class: "q-checkbox__label-wrapper" }, m = {
4
+ key: 0,
5
+ class: "q-field__extras"
6
+ }, q = /* @__PURE__ */ a({
3
7
  __name: "QCheckboxLabel",
4
8
  props: {
5
9
  id: {},
6
10
  class: {},
7
- label: {}
11
+ label: {},
12
+ for: {},
13
+ required: { type: Boolean }
8
14
  },
9
- setup(a) {
10
- const e = a;
11
- return (s, d) => s.$slots.extras ? (o(), t("div", i, [
12
- l(
13
- "span",
14
- null,
15
- n(e.label),
16
- 1
17
- /* TEXT */
18
- ),
19
- l("div", p, [
20
- c(s.$slots, "extras")
21
- ])
22
- ])) : (o(), t(
23
- "span",
24
- _,
25
- n(e.label),
26
- 1
27
- /* TEXT */
28
- ));
15
+ setup(s) {
16
+ const e = s;
17
+ return (r, b) => (t(), o("div", u, [
18
+ l(i(f), {
19
+ class: "q-checkbox__label",
20
+ for: e.for,
21
+ required: e.required
22
+ }, {
23
+ default: n(() => [
24
+ d(
25
+ _(e.label),
26
+ 1
27
+ /* TEXT */
28
+ )
29
+ ]),
30
+ _: 1
31
+ /* STABLE */
32
+ }, 8, ["for", "required"]),
33
+ r.$slots.extras ? (t(), o("div", m, [
34
+ p(r.$slots, "extras")
35
+ ])) : c("v-if", !0)
36
+ ]));
29
37
  }
30
38
  });
31
39
  export {
32
- b as default
40
+ q as default
33
41
  };
@@ -3,6 +3,8 @@ declare const QCheckbox: {
3
3
  modelValue?: boolean;
4
4
  } & import('../../types/component').QBaseComponentProps & {
5
5
  label?: string;
6
+ for?: string;
7
+ required?: boolean;
6
8
  } & {
7
9
  labelPlacement?: import('./types').QCheckboxLabelPlacement;
8
10
  disabled?: boolean;
@@ -20,7 +22,9 @@ declare const QCheckbox: {
20
22
  color: string;
21
23
  icons: typeof import('./constants').DEFAULT_ICONS;
22
24
  labelPlacement: import('./types').QCheckboxLabelPlacement;
23
- }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
25
+ }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
26
+ inputEl: HTMLInputElement;
27
+ }, any, import('vue').ComponentProvideOptions, {
24
28
  P: {};
25
29
  B: {};
26
30
  D: {};
@@ -31,6 +35,8 @@ declare const QCheckbox: {
31
35
  modelValue?: boolean;
32
36
  } & import('../../types/component').QBaseComponentProps & {
33
37
  label?: string;
38
+ for?: string;
39
+ required?: boolean;
34
40
  } & {
35
41
  labelPlacement?: import('./types').QCheckboxLabelPlacement;
36
42
  disabled?: boolean;
@@ -54,6 +60,8 @@ declare const QCheckbox: {
54
60
  modelValue?: boolean;
55
61
  } & import('../../types/component').QBaseComponentProps & {
56
62
  label?: string;
63
+ for?: string;
64
+ required?: boolean;
57
65
  } & {
58
66
  labelPlacement?: import('./types').QCheckboxLabelPlacement;
59
67
  disabled?: boolean;
@@ -78,18 +86,18 @@ declare const QCheckbox: {
78
86
  };
79
87
  });
80
88
  declare const QCheckboxLabel: {
81
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./types').QCheckboxLabelProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
89
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('..').QLabelProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
82
90
  P: {};
83
91
  B: {};
84
92
  D: {};
85
93
  C: {};
86
94
  M: {};
87
95
  Defaults: {};
88
- }, Readonly<import('./types').QCheckboxLabelProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
96
+ }, Readonly<import('..').QLabelProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
89
97
  __isFragment?: never;
90
98
  __isTeleport?: never;
91
99
  __isSuspense?: never;
92
- } & import('vue').ComponentOptionsBase<Readonly<import('./types').QCheckboxLabelProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
100
+ } & import('vue').ComponentOptionsBase<Readonly<import('..').QLabelProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
93
101
  $slots: {
94
102
  extras?(_: {}): any;
95
103
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QCheckbox/index.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA8B,CAAA;AAC7C,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;EAAmC,CAAA;AAGvD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QCheckbox/index.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA8B,CAAA;AAC7C,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;EAAmC,CAAA;AAGvD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAA"}
@@ -1,11 +1,6 @@
1
1
  import { DEFAULT_ICONS } from './constants';
2
- import { QBaseComponentProps } from '../../types/component';
3
- export type QCheckboxLabelProps = QBaseComponentProps & {
4
- /**
5
- * The text content of the checkbox.
6
- */
7
- label?: string;
8
- };
2
+ import { QLabelProps } from '../QLabel';
3
+ export type QCheckboxLabelProps = QLabelProps;
9
4
  export type QCheckboxLabelPlacement = 'left' | 'right';
10
5
  export type QCheckboxLabelSize = 'small' | 'regular' | 'large';
11
6
  export type QCheckboxProps = QCheckboxLabelProps & {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QCheckbox/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAG3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAEhE,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,GAAG;IACvD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,OAAO,CAAA;AAEtD,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;AAE9D,MAAM,MAAM,cAAc,GAAG,mBAAmB,GAAG;IAClD;;OAEG;IACH,cAAc,CAAC,EAAE,uBAAuB,CAAA;IAExC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAA;IAEzB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QCheckbox/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAG3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAA;AAE7C,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,OAAO,CAAA;AAEtD,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;AAE9D,MAAM,MAAM,cAAc,GAAG,mBAAmB,GAAG;IAClD;;OAEG;IACH,cAAc,CAAC,EAAE,uBAAuB,CAAA;IAExC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAA;IAEzB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA"}