@wikicasa-dev/components 2.2.9-alpha.66 → 2.2.9-alpha.8
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/Swiper/autoplay.js +1 -1
- package/dist/Swiper/controller.js +1 -1
- package/dist/Swiper/keyboard.js +1 -1
- package/dist/Swiper/thumbs.js +1 -1
- package/dist/UIKit/AccessibleSelect.d.ts +4 -5
- package/dist/UIKit/AccessibleSelect.js +2 -3
- package/dist/UIKit/Autocomplete/ClearableAutocomplete.d.ts +2 -7
- package/dist/UIKit/BaseAutocomplete.d.ts +4 -4
- package/dist/UIKit/BaseButton.d.ts +8 -14
- package/dist/UIKit/BaseCard.js +3 -1
- package/dist/UIKit/BaseDropDown.d.ts +11 -17
- package/dist/UIKit/BaseFloatingLabel.js +4 -4
- package/dist/UIKit/BaseInput.d.ts +2 -3
- package/dist/UIKit/BaseInput.js +1 -1
- package/dist/UIKit/BaseSnackbar.d.ts +2 -2
- package/dist/UIKit/BaseTextarea.d.ts +2 -2
- package/dist/UIKit/Checkbox/CheckboxBtn.d.ts +7 -14
- package/dist/UIKit/Checkbox/CheckboxGroup.d.ts +2 -5
- package/dist/UIKit/Radio/RadioButton.d.ts +23 -28
- package/dist/UIKit/Radio/RadioGroup.d.ts +50 -49
- package/dist/assets/BaseCard.css +1 -1
- package/dist/assets/BaseDropDown.css +1 -1
- package/dist/assets/BaseFloatingLabel.css +1 -1
- package/dist/assets/BaseInput.css +1 -1
- package/dist/assets/tailwind.css +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +83 -92
- package/dist/packages/components/lib/UIKit/AccessibleSelect.vue.js +160 -158
- package/dist/packages/components/lib/UIKit/Accordion/BaseAccordionItem.vue.js +6 -4
- package/dist/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +106 -112
- package/dist/packages/components/lib/UIKit/BaseAutocomplete.vue.js +36 -36
- package/dist/packages/components/lib/UIKit/BaseButton.vue.js +24 -28
- package/dist/packages/components/lib/UIKit/BaseCard.vue.js +13 -13
- package/dist/packages/components/lib/UIKit/BaseDropDown.vue.js +105 -102
- package/dist/packages/components/lib/UIKit/BaseFloatingLabel.vue.js +8 -8
- package/dist/packages/components/lib/UIKit/BaseInput.vue.js +64 -65
- package/dist/packages/components/lib/UIKit/BaseModal.vue.js +36 -42
- package/dist/packages/components/lib/UIKit/BaseSelect/SelectItem.vue.js +17 -18
- package/dist/packages/components/lib/UIKit/Checkbox/CheckboxBtn.vue.js +37 -50
- package/dist/packages/components/lib/UIKit/Checkbox/CheckboxGroup.vue.js +55 -60
- package/dist/packages/components/lib/UIKit/Radio/RadioButton.vue.js +14 -16
- package/dist/packages/components/lib/UIKit/Radio/RadioGroup.vue.js +33 -37
- package/dist/types/index.d.ts +0 -3
- package/package.json +7 -8
- package/dist/UIKit/Checkbox/v2/CheckboxButtonGroup.d.ts +0 -40
- package/dist/UIKit/Checkbox/v2/CheckboxButtonGroup.js +0 -4
- package/dist/UIKit/Radio/v2/RadioButtonGroup.d.ts +0 -29
- package/dist/UIKit/Radio/v2/RadioButtonGroup.js +0 -4
- package/dist/UIKit/Radio/v2/RadioButtonItem.d.ts +0 -16
- package/dist/UIKit/Radio/v2/RadioButtonItem.js +0 -5
- package/dist/assets/AccessibleSelect.css +0 -1
- package/dist/assets/RadioButtonItem.css +0 -1
- package/dist/composables/mock.d.ts +0 -25
- package/dist/composables/mock.js +0 -49
- package/dist/packages/components/lib/UIKit/Checkbox/v2/CheckboxButtonGroup.vue.js +0 -78
- package/dist/packages/components/lib/UIKit/Radio/v2/RadioButtonGroup.vue.js +0 -49
- package/dist/packages/components/lib/UIKit/Radio/v2/RadioButtonItem.vue.js +0 -45
- /package/dist/assets/{swiper-controller.css → swiper-thumbs.css} +0 -0
|
@@ -1,64 +1,60 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as C, mergeModels as d, useModel as h, ref as $, watch as V, renderSlot as u, createElementVNode as p, normalizeClass as c, createElementBlock as k, openBlock as m, Fragment as y, renderList as R, createBlock as g } from "vue";
|
|
2
|
+
import B from "./RadioButton.vue.js";
|
|
3
|
+
const b = ["data-cy"], z = /* @__PURE__ */ C({
|
|
4
4
|
inheritAttrs: !1,
|
|
5
5
|
__name: "RadioGroup",
|
|
6
|
-
props: /* @__PURE__ */
|
|
6
|
+
props: /* @__PURE__ */ d({
|
|
7
7
|
radioValues: { default: () => [] },
|
|
8
8
|
dataCy: {},
|
|
9
9
|
radioContainerClasses: {}
|
|
10
10
|
}, {
|
|
11
11
|
resetRadio: { type: Boolean, default: !1 },
|
|
12
|
-
resetRadioModifiers: {}
|
|
13
|
-
refresh: { type: Boolean, default: !1 },
|
|
14
|
-
refreshModifiers: {}
|
|
12
|
+
resetRadioModifiers: {}
|
|
15
13
|
}),
|
|
16
|
-
emits: /* @__PURE__ */
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
a.value = e,
|
|
14
|
+
emits: /* @__PURE__ */ d(["update:modelValue"], ["update:resetRadio"]),
|
|
15
|
+
setup(t, { emit: f }) {
|
|
16
|
+
const n = f, i = h(t, "resetRadio"), a = $(null), l = (e) => {
|
|
17
|
+
a.value = e, n("update:modelValue", e);
|
|
20
18
|
}, s = () => {
|
|
21
|
-
a.value = null,
|
|
22
|
-
},
|
|
23
|
-
|
|
19
|
+
a.value = null, i.value = !1, n("update:modelValue", null);
|
|
20
|
+
}, r = (e) => a.value ? `${a.value.id}` == `${e.id}` : !1;
|
|
21
|
+
return (() => {
|
|
22
|
+
for (const e of t.radioValues)
|
|
24
23
|
if (e.active) {
|
|
25
|
-
|
|
24
|
+
l(e);
|
|
26
25
|
return;
|
|
27
26
|
}
|
|
28
|
-
}
|
|
29
|
-
return u(), v(n, (e) => {
|
|
27
|
+
})(), V(i, (e) => {
|
|
30
28
|
e && s();
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
}), (e, c) => h(e.$slots, "default", {
|
|
34
|
-
handleClick: t,
|
|
29
|
+
}), (e, A) => u(e.$slots, "default", {
|
|
30
|
+
handleClick: l,
|
|
35
31
|
activeValue: a.value,
|
|
36
32
|
reset: s,
|
|
37
|
-
isActive:
|
|
33
|
+
isActive: r
|
|
38
34
|
}, () => [
|
|
39
|
-
|
|
40
|
-
class:
|
|
41
|
-
"data-cy":
|
|
35
|
+
p("div", {
|
|
36
|
+
class: c(["radio-group-container", e.$attrs.class]),
|
|
37
|
+
"data-cy": t.dataCy
|
|
42
38
|
}, [
|
|
43
|
-
|
|
44
|
-
handleClick:
|
|
39
|
+
u(e.$slots, "radio_elements", {
|
|
40
|
+
handleClick: l,
|
|
45
41
|
activeValue: a.value,
|
|
46
42
|
reset: s,
|
|
47
|
-
isActive:
|
|
43
|
+
isActive: r
|
|
48
44
|
}, () => [
|
|
49
|
-
(
|
|
50
|
-
id:
|
|
51
|
-
key:
|
|
52
|
-
class:
|
|
53
|
-
label: `${
|
|
54
|
-
"model-value": `${
|
|
55
|
-
onChange:
|
|
45
|
+
(m(!0), k(y, null, R(t.radioValues, (o, v) => (m(), g(B, {
|
|
46
|
+
id: o.id,
|
|
47
|
+
key: v,
|
|
48
|
+
class: c(t.radioContainerClasses),
|
|
49
|
+
label: `${o.label}`,
|
|
50
|
+
"model-value": `${o.id}` == `${a.value?.id}`,
|
|
51
|
+
onChange: l
|
|
56
52
|
}, null, 8, ["id", "class", "label", "model-value"]))), 128))
|
|
57
53
|
])
|
|
58
|
-
], 10,
|
|
54
|
+
], 10, b)
|
|
59
55
|
]);
|
|
60
56
|
}
|
|
61
57
|
});
|
|
62
58
|
export {
|
|
63
|
-
|
|
59
|
+
z as default
|
|
64
60
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -8,6 +8,3 @@ export type { BaseComplexToggleProps, ToggleType, } from '../UIKit/BaseComplexTo
|
|
|
8
8
|
export type { SnackbarProps } from '../UIKit/BaseSnackbar';
|
|
9
9
|
export type { ChartOptions, ChartData } from 'chart.js';
|
|
10
10
|
export type { BaseAutocompleteThemes } from '../UIKit/BaseAutocomplete';
|
|
11
|
-
export type { RadioButtonGroupProps } from '../UIKit/Radio/v2/RadioButtonGroup';
|
|
12
|
-
export type { RadioButtonItemProps } from '../UIKit/Radio/v2/RadioButtonItem';
|
|
13
|
-
export type { CheckboxButtonGroupProps, CheckboxButtonItem, } from '../UIKit/Checkbox/v2/CheckboxButtonGroup';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wikicasa-dev/components",
|
|
3
|
-
"version": "2.2.9-alpha.
|
|
3
|
+
"version": "2.2.9-alpha.8",
|
|
4
4
|
"description": "Wikicasa frontend components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"default": "./dist/index.js"
|
|
18
18
|
},
|
|
19
19
|
"./style": "./dist/assets/tailwind.css",
|
|
20
|
-
"./css/*": "./dist/assets/*.css",
|
|
21
20
|
"./generic/*": {
|
|
22
21
|
"import": "./dist/components/*.js",
|
|
23
22
|
"types": "./dist/components/*.d.ts"
|
|
@@ -44,9 +43,9 @@
|
|
|
44
43
|
"peerDependencies": {
|
|
45
44
|
"vue": "^3.5.0",
|
|
46
45
|
"date-fns": "^4.0.0",
|
|
47
|
-
"@wikicasa-dev/svg-icons": "^1.2.
|
|
48
|
-
"@wikicasa-dev/vue-composables": "0.0.
|
|
49
|
-
"@wikicasa-dev/types": "^2.
|
|
46
|
+
"@wikicasa-dev/svg-icons": "^1.2.24",
|
|
47
|
+
"@wikicasa-dev/vue-composables": "^0.0.29",
|
|
48
|
+
"@wikicasa-dev/types": "^2.4.0",
|
|
50
49
|
"@wikicasa-dev/utilities": "^1.2.0"
|
|
51
50
|
},
|
|
52
51
|
"dependencies": {
|
|
@@ -64,10 +63,10 @@
|
|
|
64
63
|
"@vitejs/plugin-vue": "^6.0.2",
|
|
65
64
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
66
65
|
"@vue/eslint-config-typescript": "^14.6.0",
|
|
67
|
-
"@wikicasa-dev/svg-icons": "1.2.
|
|
68
|
-
"@wikicasa-dev/vue-composables": "0.0.
|
|
66
|
+
"@wikicasa-dev/svg-icons": "1.2.24",
|
|
67
|
+
"@wikicasa-dev/vue-composables": "0.0.29",
|
|
69
68
|
"@wikicasa-dev/tailwind-plugins": "^0.0.3",
|
|
70
|
-
"@wikicasa-dev/types": "2.
|
|
69
|
+
"@wikicasa-dev/types": "2.4.6",
|
|
71
70
|
"@wikicasa-dev/utilities": "1.2.0",
|
|
72
71
|
"autoprefixer": "^10.4.22",
|
|
73
72
|
"date-fns": "4.1.0",
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { CheckboxRootProps, AcceptableValue } from 'reka-ui';
|
|
2
|
-
export interface CheckboxButtonGroupProps {
|
|
3
|
-
dataCy?: string;
|
|
4
|
-
items?: CheckboxButtonItem[];
|
|
5
|
-
/**
|
|
6
|
-
* Value of the reset button
|
|
7
|
-
*/
|
|
8
|
-
resetValue?: AcceptableValue;
|
|
9
|
-
}
|
|
10
|
-
export interface CheckboxButtonItem {
|
|
11
|
-
dataCy?: string;
|
|
12
|
-
value: CheckboxRootProps["value"];
|
|
13
|
-
required?: boolean;
|
|
14
|
-
label: string;
|
|
15
|
-
}
|
|
16
|
-
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
|
|
17
|
-
modelValue?: NonNullable<AcceptableValue>[];
|
|
18
|
-
reset?: boolean;
|
|
19
|
-
} & CheckboxButtonGroupProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
20
|
-
"update:modelValue": (value: NonNullable<AcceptableValue>[]) => any;
|
|
21
|
-
"update:reset": (value: boolean) => any;
|
|
22
|
-
}, string, import('vue').PublicProps, Readonly<{
|
|
23
|
-
modelValue?: NonNullable<AcceptableValue>[];
|
|
24
|
-
reset?: boolean;
|
|
25
|
-
} & CheckboxButtonGroupProps> & Readonly<{
|
|
26
|
-
"onUpdate:modelValue"?: ((value: NonNullable<AcceptableValue>[]) => any) | undefined;
|
|
27
|
-
"onUpdate:reset"?: ((value: boolean) => any) | undefined;
|
|
28
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>, {
|
|
29
|
-
default?(_: {
|
|
30
|
-
isChecked: (value: CheckboxRootProps["value"]) => boolean;
|
|
31
|
-
handleCheck: (value: CheckboxRootProps["value"], checked: boolean) => void;
|
|
32
|
-
handleResetCheck: (checked: boolean) => void;
|
|
33
|
-
}): any;
|
|
34
|
-
}>;
|
|
35
|
-
export default _default;
|
|
36
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
37
|
-
new (): {
|
|
38
|
-
$slots: S;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { AcceptableValue, RadioGroupRootProps, RadioGroupItemProps } from 'reka-ui';
|
|
2
|
-
export type RadioButtonItem = {
|
|
3
|
-
dataCy?: string;
|
|
4
|
-
value: RadioGroupItemProps["value"];
|
|
5
|
-
required?: RadioGroupItemProps["required"];
|
|
6
|
-
as?: RadioGroupItemProps["as"];
|
|
7
|
-
label: string;
|
|
8
|
-
};
|
|
9
|
-
export interface RadioButtonGroupProps extends RadioGroupRootProps {
|
|
10
|
-
dataCy?: string;
|
|
11
|
-
items?: RadioButtonItem[];
|
|
12
|
-
}
|
|
13
|
-
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
|
|
14
|
-
modelValue?: AcceptableValue;
|
|
15
|
-
} & RadioButtonGroupProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
|
-
"update:modelValue": (value: AcceptableValue) => any;
|
|
17
|
-
}, string, import('vue').PublicProps, Readonly<{
|
|
18
|
-
modelValue?: AcceptableValue;
|
|
19
|
-
} & RadioButtonGroupProps> & Readonly<{
|
|
20
|
-
"onUpdate:modelValue"?: ((value: AcceptableValue) => any) | undefined;
|
|
21
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
|
|
22
|
-
default?(_: {}): any;
|
|
23
|
-
}>;
|
|
24
|
-
export default _default;
|
|
25
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
26
|
-
new (): {
|
|
27
|
-
$slots: S;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { RadioGroupItemProps } from 'reka-ui';
|
|
2
|
-
import { ClassTypeProp } from '../../types';
|
|
3
|
-
export interface RadioButtonItemProps extends RadioGroupItemProps {
|
|
4
|
-
itemClasses?: ClassTypeProp;
|
|
5
|
-
labelClasses?: ClassTypeProp;
|
|
6
|
-
dataCy?: string;
|
|
7
|
-
}
|
|
8
|
-
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<RadioButtonItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<RadioButtonItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>, {
|
|
9
|
-
default?(_: {}): any;
|
|
10
|
-
}>;
|
|
11
|
-
export default _default;
|
|
12
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
13
|
-
new (): {
|
|
14
|
-
$slots: S;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.uikit-select-wrapper{--btn-height: 48px}.uikit-select-dropdown.uikit-dropdown-content{--dropdown-border-color: #B4C2F0;--dropdown-max-height: 225px;--dropdown-min-width: unset;--dropdown-margin-top: 10px;margin-top:var(--dropdown-margin-top)}.uikit-select-dropdown.uikit-dropdown-content[data-side=down]{--dropdown-border-top-width: 1px;--dropdown-border-top-left-radius: 12px;--dropdown-border-top-right-radius: 12px;--dropdown-border-bottom-left-radius: 12px;--dropdown-border-bottom-right-radius: 12px}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.uikit-radio-btn{--font-size: 16px;font-size:var(--font-size)}.uikit-radio-btn .uikit-radio-group-item[data-state=checked]:focus .uikit-radio-group-indicator{width:10px;height:10px}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
|
-
interface KeyboardControllerProps {
|
|
3
|
-
optionsLength: Ref<number> | number;
|
|
4
|
-
isDropdownOpen?: Ref<boolean>;
|
|
5
|
-
disableSpaceHandler?: boolean;
|
|
6
|
-
activate?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* If true, the listener will be initialized on the document element
|
|
9
|
-
*/
|
|
10
|
-
global?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* List of keys that will close the dropdown.
|
|
13
|
-
* For the full list of keys, see
|
|
14
|
-
* @link https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
|
|
15
|
-
* @default "Escape" and "Enter"
|
|
16
|
-
*/
|
|
17
|
-
closeKeys?: string[];
|
|
18
|
-
}
|
|
19
|
-
export declare const useKeyboardController: (props: KeyboardControllerProps) => {
|
|
20
|
-
activeIdx: Ref<number, number>;
|
|
21
|
-
selectedIdx: Ref<number, number>;
|
|
22
|
-
$reset: () => void;
|
|
23
|
-
onKeyDownHandler: (e: KeyboardEvent) => void;
|
|
24
|
-
};
|
|
25
|
-
export {};
|
package/dist/composables/mock.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ref as _, onMounted as A, onUnmounted as D, unref as p } from "vue";
|
|
2
|
-
const u = "ArrowUp", a = "ArrowDown", c = "Enter", i = "Escape", v = " ", d = "PageUp", K = "Home", E = "PageDown", m = "End", O = (l) => {
|
|
3
|
-
const {
|
|
4
|
-
isDropdownOpen: t,
|
|
5
|
-
disableSpaceHandler: P,
|
|
6
|
-
global: f = !0,
|
|
7
|
-
closeKeys: Y = [i, c]
|
|
8
|
-
} = l, n = _(-1), o = _(-1), w = l.activate === void 0 ? !0 : l.activate, y = () => {
|
|
9
|
-
n.value = -1, o.value = -1, t && (t.value = !1);
|
|
10
|
-
}, k = (e) => {
|
|
11
|
-
t && Y.includes(e) && (t.value = !1);
|
|
12
|
-
}, r = (e) => {
|
|
13
|
-
if (!t?.value || ![
|
|
14
|
-
u,
|
|
15
|
-
a,
|
|
16
|
-
c,
|
|
17
|
-
i,
|
|
18
|
-
v,
|
|
19
|
-
d,
|
|
20
|
-
K,
|
|
21
|
-
E,
|
|
22
|
-
m
|
|
23
|
-
].includes(e.key))
|
|
24
|
-
return;
|
|
25
|
-
const s = p(l.optionsLength);
|
|
26
|
-
if ([u, a, d, E].includes(e.key) && e.preventDefault(), e.key === u)
|
|
27
|
-
n.value = n.value === 0 ? s - 1 : n.value - 1;
|
|
28
|
-
else if (e.key === a)
|
|
29
|
-
n.value = (n.value + 1) % s;
|
|
30
|
-
else if (e.key === c || e.key === v) {
|
|
31
|
-
if (e.key === v && P) return;
|
|
32
|
-
o.value = n.value, k(e.key);
|
|
33
|
-
} else e.key === i ? (n.value = o.value, k(e.key)) : e.key === d || e.key === K ? n.value = 0 : (e.key === E || e.key === m) && (n.value = s - 1);
|
|
34
|
-
e.stopPropagation();
|
|
35
|
-
};
|
|
36
|
-
return w ? (A(() => {
|
|
37
|
-
!document || !f || document.addEventListener("keydown", r);
|
|
38
|
-
}), D(() => {
|
|
39
|
-
!document || !f || document.removeEventListener("keydown", r);
|
|
40
|
-
}), {
|
|
41
|
-
activeIdx: n,
|
|
42
|
-
selectedIdx: o,
|
|
43
|
-
onKeyDownHandler: r,
|
|
44
|
-
$reset: y
|
|
45
|
-
}) : { activeIdx: n, selectedIdx: o, $reset: y, onKeyDownHandler: r };
|
|
46
|
-
};
|
|
47
|
-
export {
|
|
48
|
-
O as useKeyboardController
|
|
49
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { defineComponent as v, mergeModels as k, useModel as f, provide as m, watch as y, createElementBlock as h, openBlock as n, renderSlot as C, Fragment as g, renderList as B, createBlock as x, withCtx as M, createTextVNode as b, toDisplayString as U } from "vue";
|
|
2
|
-
import q from "../CheckboxBtn.vue.js";
|
|
3
|
-
import '../../../../../../assets/CheckboxBtn.css';/* empty css */
|
|
4
|
-
const w = ["data-cy"], I = /* @__PURE__ */ v({
|
|
5
|
-
__name: "CheckboxButtonGroup",
|
|
6
|
-
props: /* @__PURE__ */ k({
|
|
7
|
-
dataCy: {},
|
|
8
|
-
items: { default: () => [] },
|
|
9
|
-
resetValue: {}
|
|
10
|
-
}, {
|
|
11
|
-
modelValue: {
|
|
12
|
-
default: () => []
|
|
13
|
-
},
|
|
14
|
-
modelModifiers: {},
|
|
15
|
-
reset: { type: Boolean, default: !1 },
|
|
16
|
-
resetModifiers: {}
|
|
17
|
-
}),
|
|
18
|
-
emits: ["update:modelValue", "update:reset"],
|
|
19
|
-
setup(l) {
|
|
20
|
-
const a = f(l, "modelValue"), o = f(l, "reset"), r = /* @__PURE__ */ new Map(), c = (e) => e ? a.value.includes(e) : !1, i = (e, u) => {
|
|
21
|
-
if (!e) return;
|
|
22
|
-
let t = [];
|
|
23
|
-
if (u ? t = [...a.value, e] : t = a.value.filter((d) => d !== e), !l.resetValue) {
|
|
24
|
-
a.value = t;
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
t = t.filter((d) => d !== l.resetValue);
|
|
28
|
-
const s = Array.from(r.keys()).filter(
|
|
29
|
-
(d) => !t.includes(d)
|
|
30
|
-
);
|
|
31
|
-
console.log("DEBUG:handleCheck => update", {
|
|
32
|
-
registeredItems: r,
|
|
33
|
-
checkedList: t,
|
|
34
|
-
uncheckedList: s
|
|
35
|
-
}), s.length === r.size && (t = [l.resetValue], r.get(l.resetValue)?.focus?.()), t.length === r.size - 1 && (t = [l.resetValue], r.get(l.resetValue)?.focus?.()), a.value = t;
|
|
36
|
-
}, V = (e) => {
|
|
37
|
-
if (l.resetValue) {
|
|
38
|
-
if (console.log("DEBUG:handleResetCheck", { resetValue: l.resetValue }), e) {
|
|
39
|
-
a.value = [l.resetValue];
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
a.value = a.value.filter((u) => u !== l.resetValue);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
return m(
|
|
46
|
-
"addItem",
|
|
47
|
-
(e, u) => {
|
|
48
|
-
!e || !u || r.set(e, u);
|
|
49
|
-
}
|
|
50
|
-
), m("removeItem", (e) => {
|
|
51
|
-
e && r.delete(e);
|
|
52
|
-
}), y(o, (e) => {
|
|
53
|
-
e && (a.value = [], o.value = !1);
|
|
54
|
-
}), (e, u) => (n(), h("div", { "data-cy": l.dataCy }, [
|
|
55
|
-
C(e.$slots, "default", {
|
|
56
|
-
isChecked: c,
|
|
57
|
-
handleCheck: i,
|
|
58
|
-
handleResetCheck: V
|
|
59
|
-
}, () => [
|
|
60
|
-
(n(!0), h(g, null, B(l.items, (t) => (n(), x(q, {
|
|
61
|
-
key: `checkbox-item-${t.value}`,
|
|
62
|
-
required: t.required,
|
|
63
|
-
"data-cy": t.dataCy,
|
|
64
|
-
"model-value": c(t.value),
|
|
65
|
-
"onUpdate:modelValue": (s) => i(t.value, s)
|
|
66
|
-
}, {
|
|
67
|
-
label: M(() => [
|
|
68
|
-
b(U(t.label), 1)
|
|
69
|
-
]),
|
|
70
|
-
_: 2
|
|
71
|
-
}, 1032, ["required", "data-cy", "model-value", "onUpdate:modelValue"]))), 128))
|
|
72
|
-
])
|
|
73
|
-
], 8, w));
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
export {
|
|
77
|
-
I as default
|
|
78
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { defineComponent as s, mergeModels as f, createPropsRestProxy as p, useModel as c, createBlock as d, openBlock as o, unref as y, mergeProps as u, withCtx as m, renderSlot as V, createElementBlock as B, Fragment as C, renderList as g, createTextVNode as k, toDisplayString as x } from "vue";
|
|
2
|
-
import { RadioGroupRoot as R } from "reka-ui";
|
|
3
|
-
import v from "./RadioButtonItem.vue.js";
|
|
4
|
-
import '../../../../../../assets/RadioButtonItem.css';/* empty css */
|
|
5
|
-
const S = /* @__PURE__ */ s({
|
|
6
|
-
__name: "RadioButtonGroup",
|
|
7
|
-
props: /* @__PURE__ */ f({
|
|
8
|
-
dataCy: {},
|
|
9
|
-
items: { default: () => [] },
|
|
10
|
-
modelValue: {},
|
|
11
|
-
defaultValue: {},
|
|
12
|
-
disabled: { type: Boolean },
|
|
13
|
-
orientation: {},
|
|
14
|
-
dir: {},
|
|
15
|
-
loop: { type: Boolean },
|
|
16
|
-
asChild: { type: Boolean },
|
|
17
|
-
as: {},
|
|
18
|
-
name: {},
|
|
19
|
-
required: { type: Boolean }
|
|
20
|
-
}, {
|
|
21
|
-
modelValue: {},
|
|
22
|
-
modelModifiers: {}
|
|
23
|
-
}),
|
|
24
|
-
emits: ["update:modelValue"],
|
|
25
|
-
setup(e) {
|
|
26
|
-
const n = p(e, ["dataCy", "items"]), a = c(e, "modelValue");
|
|
27
|
-
return (i, l) => (o(), d(y(R), u({ "data-cy": e.dataCy }, n, {
|
|
28
|
-
modelValue: a.value,
|
|
29
|
-
"onUpdate:modelValue": l[0] || (l[0] = (t) => a.value = t)
|
|
30
|
-
}), {
|
|
31
|
-
default: m(() => [
|
|
32
|
-
V(i.$slots, "default", {}, () => [
|
|
33
|
-
(o(!0), B(C, null, g(e.items, ({ label: t, ...r }) => (o(), d(v, u({ ref_for: !0 }, r, {
|
|
34
|
-
key: `radio-item-${r.value}`
|
|
35
|
-
}), {
|
|
36
|
-
default: m(() => [
|
|
37
|
-
k(x(t), 1)
|
|
38
|
-
]),
|
|
39
|
-
_: 2
|
|
40
|
-
}, 1040))), 128))
|
|
41
|
-
])
|
|
42
|
-
]),
|
|
43
|
-
_: 3
|
|
44
|
-
}, 16, ["data-cy", "modelValue"]));
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
export {
|
|
48
|
-
S as default
|
|
49
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { defineComponent as l, createPropsRestProxy as n, useId as c, computed as k, createElementBlock as a, openBlock as s, createVNode as r, createCommentVNode as m, unref as u, mergeProps as p, withCtx as f, normalizeClass as y, renderSlot as C } from "vue";
|
|
2
|
-
import { RadioGroupItem as b, RadioGroupIndicator as h } from "reka-ui";
|
|
3
|
-
const x = { class: "uikit-radio-btn uikit-flex uikit-items-center uikit-gap-x-[8px]" }, g = ["for"], v = /* @__PURE__ */ l({
|
|
4
|
-
__name: "RadioButtonItem",
|
|
5
|
-
props: {
|
|
6
|
-
itemClasses: {},
|
|
7
|
-
labelClasses: {},
|
|
8
|
-
dataCy: {},
|
|
9
|
-
id: {},
|
|
10
|
-
value: {},
|
|
11
|
-
disabled: { type: Boolean },
|
|
12
|
-
asChild: { type: Boolean },
|
|
13
|
-
as: {},
|
|
14
|
-
name: {},
|
|
15
|
-
required: { type: Boolean }
|
|
16
|
-
},
|
|
17
|
-
setup(e) {
|
|
18
|
-
const i = n(e, ["itemClasses", "labelClasses", "dataCy"]), d = c(), t = k(() => i.id ?? d);
|
|
19
|
-
return (o, w) => (s(), a("div", x, [
|
|
20
|
-
r(u(b), p(i, {
|
|
21
|
-
id: t.value,
|
|
22
|
-
"data-cy": e.dataCy,
|
|
23
|
-
class: [
|
|
24
|
-
"uikit-radio-group-item uikit-inline-flex uikit-size-[18px] uikit-shrink-0 uikit-cursor-default uikit-items-center uikit-justify-center uikit-rounded-full uikit-border uikit-border-solid uikit-border-w-secondary uikit-bg-white uikit-p-0 uikit-shadow-sm uikit-outline-none focus:uikit-border-2 focus:uikit-border-w-primary",
|
|
25
|
-
e.itemClasses
|
|
26
|
-
]
|
|
27
|
-
}), {
|
|
28
|
-
default: f(() => [
|
|
29
|
-
r(u(h), { class: "uikit-radio-group-indicator uikit-size-[12px] uikit-rounded-[50%] uikit-bg-w-primary" })
|
|
30
|
-
]),
|
|
31
|
-
_: 1
|
|
32
|
-
}, 16, ["id", "data-cy", "class"]),
|
|
33
|
-
o.$slots.default ? (s(), a("label", {
|
|
34
|
-
key: 0,
|
|
35
|
-
for: t.value,
|
|
36
|
-
class: y(e.labelClasses)
|
|
37
|
-
}, [
|
|
38
|
-
C(o.$slots, "default")
|
|
39
|
-
], 10, g)) : m("", !0)
|
|
40
|
-
]));
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
export {
|
|
44
|
-
v as default
|
|
45
|
-
};
|
|
File without changes
|