@onereach/ui-components 4.1.3-beta.2560.0 → 4.1.3-beta.2563.0
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/bundled/v2/components/OrCheckboxGroupV3/OrCheckboxGroup.js +5 -6
- package/dist/bundled/v2/components/OrCheckboxGroupV3/OrCheckboxGroup.vue.d.ts +6 -30
- package/dist/bundled/v2/components/OrCheckboxTreeV3/OrCheckboxTree.js +12 -2
- package/dist/bundled/v2/components/OrCheckboxTreeV3/OrCheckboxTree.vue.d.ts +16 -5
- package/dist/bundled/v2/components/OrCheckboxTreeV3/index.d.ts +1 -0
- package/dist/bundled/v2/components/OrCheckboxTreeV3/types.d.ts +3 -2
- package/dist/bundled/v3/{OrCheckboxTree.vue_vue_type_script_lang-1a85d562.js → OrCheckboxTree.vue_vue_type_script_lang-5b6dbef1.js} +11 -2
- package/dist/bundled/v3/components/OrCheckboxGroupV3/OrCheckboxGroup.js +4 -3
- package/dist/bundled/v3/components/OrCheckboxGroupV3/OrCheckboxGroup.vue.d.ts +6 -30
- package/dist/bundled/v3/components/OrCheckboxGroupV3/index.js +1 -1
- package/dist/bundled/v3/components/OrCheckboxTreeV3/OrCheckboxTree.js +4 -3
- package/dist/bundled/v3/components/OrCheckboxTreeV3/OrCheckboxTree.vue.d.ts +16 -5
- package/dist/bundled/v3/components/OrCheckboxTreeV3/index.d.ts +1 -0
- package/dist/bundled/v3/components/OrCheckboxTreeV3/index.js +1 -1
- package/dist/bundled/v3/components/OrCheckboxTreeV3/types.d.ts +3 -2
- package/dist/esm/v2/{OrCheckboxTree-de560e80.js → OrCheckboxTree-97d78f1f.js} +12 -2
- package/dist/esm/v2/components/or-checkbox-group-v3/OrCheckboxGroup.vue.d.ts +6 -30
- package/dist/esm/v2/components/or-checkbox-group-v3/index.js +6 -7
- package/dist/esm/v2/components/or-checkbox-tree-v3/OrCheckboxTree.vue.d.ts +16 -5
- package/dist/esm/v2/components/or-checkbox-tree-v3/index.d.ts +1 -0
- package/dist/esm/v2/components/or-checkbox-tree-v3/index.js +1 -1
- package/dist/esm/v2/components/or-checkbox-tree-v3/types.d.ts +3 -2
- package/dist/esm/v3/{OrCheckboxTree-db42d072.js → OrCheckboxTree-a02567a5.js} +13 -3
- package/dist/esm/v3/components/or-checkbox-group-v3/OrCheckboxGroup.vue.d.ts +6 -30
- package/dist/esm/v3/components/or-checkbox-group-v3/index.js +4 -3
- package/dist/esm/v3/components/or-checkbox-tree-v3/OrCheckboxTree.vue.d.ts +16 -5
- package/dist/esm/v3/components/or-checkbox-tree-v3/index.d.ts +1 -0
- package/dist/esm/v3/components/or-checkbox-tree-v3/index.js +1 -1
- package/dist/esm/v3/components/or-checkbox-tree-v3/types.d.ts +3 -2
- package/package.json +1 -1
- package/src/components/or-checkbox-group-v3/OrCheckboxGroup.stories3.ts +64 -0
- package/src/components/or-checkbox-group-v3/OrCheckboxGroup.vue +3 -5
- package/src/components/or-checkbox-tree-v3/OrCheckboxTree.vue +16 -5
- package/src/components/or-checkbox-tree-v3/index.ts +1 -0
- package/src/components/or-checkbox-tree-v3/types.ts +3 -2
|
@@ -3,7 +3,6 @@ import { useVModel } from '@vueuse/core';
|
|
|
3
3
|
import __vue_component__$1 from '../OrCheckboxTreeV3/OrCheckboxTree.js';
|
|
4
4
|
import __vue_component__$2 from '../OrFormGroupV3/OrFormGroup.js';
|
|
5
5
|
import { FormGroupDirection } from '../OrFormGroupV3/props.js';
|
|
6
|
-
import { s as styleInject } from '../../style-inject.es-4c6f2515.js';
|
|
7
6
|
import { n as normalizeComponent } from '../../normalize-component-6e8e3d80.js';
|
|
8
7
|
import '../OrCheckboxTreeV3/styles.js';
|
|
9
8
|
import '../../utils/functions/flattenDeep.js';
|
|
@@ -17,6 +16,7 @@ import '../OrLabelV3/props.js';
|
|
|
17
16
|
import '../OrLabelV3/styles.js';
|
|
18
17
|
import '../../hooks/useIdAttribute.js';
|
|
19
18
|
import '../../hooks/useControlAttributes.js';
|
|
19
|
+
import '../../style-inject.es-4c6f2515.js';
|
|
20
20
|
import '../OrButtonV3/OrButton.js';
|
|
21
21
|
import '../OrButtonV3/props.js';
|
|
22
22
|
import '../OrButtonV3/styles.js';
|
|
@@ -79,11 +79,9 @@ var script = defineComponent({
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
-
var css_248z = "";
|
|
83
|
-
styleInject(css_248z);
|
|
84
|
-
|
|
85
82
|
/* script */
|
|
86
83
|
const __vue_script__ = script;
|
|
84
|
+
|
|
87
85
|
/* template */
|
|
88
86
|
var __vue_render__ = function () {
|
|
89
87
|
var _vm = this;
|
|
@@ -110,7 +108,8 @@ var __vue_render__ = function () {
|
|
|
110
108
|
attrs: {
|
|
111
109
|
"item": option,
|
|
112
110
|
"disabled": _vm.disabled || option.disabled,
|
|
113
|
-
"collapsible": option.collapsible
|
|
111
|
+
"collapsible": option.collapsible,
|
|
112
|
+
"expanded": option.expanded
|
|
114
113
|
},
|
|
115
114
|
model: {
|
|
116
115
|
value: _vm.proxyModelValue,
|
|
@@ -127,7 +126,7 @@ var __vue_staticRenderFns__ = [];
|
|
|
127
126
|
/* style */
|
|
128
127
|
const __vue_inject_styles__ = undefined;
|
|
129
128
|
/* scoped */
|
|
130
|
-
const __vue_scope_id__ =
|
|
129
|
+
const __vue_scope_id__ = undefined;
|
|
131
130
|
/* module identifier */
|
|
132
131
|
const __vue_module_identifier__ = undefined;
|
|
133
132
|
/* functional template */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
2
|
import { FormGroupDirection } from '../or-form-group-v3';
|
|
3
|
+
import { CheckboxTreeNode } from '../or-checkbox-tree-v3';
|
|
3
4
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
5
|
proxyModelValue: import("@vue/composition-api").Ref<string[]> | import("@vue/composition-api").WritableComputedRef<string[]>;
|
|
5
6
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
@@ -24,12 +25,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
24
25
|
default: FormGroupDirection;
|
|
25
26
|
};
|
|
26
27
|
options: {
|
|
27
|
-
type: PropType<
|
|
28
|
-
label: string;
|
|
29
|
-
value: any;
|
|
30
|
-
disabled?: boolean | undefined;
|
|
31
|
-
collapsible: boolean;
|
|
32
|
-
}[]>;
|
|
28
|
+
type: PropType<CheckboxTreeNode[]>;
|
|
33
29
|
default: () => never[];
|
|
34
30
|
};
|
|
35
31
|
disabled: {
|
|
@@ -58,12 +54,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
58
54
|
default: FormGroupDirection;
|
|
59
55
|
};
|
|
60
56
|
options: {
|
|
61
|
-
type: PropType<
|
|
62
|
-
label: string;
|
|
63
|
-
value: any;
|
|
64
|
-
disabled?: boolean | undefined;
|
|
65
|
-
collapsible: boolean;
|
|
66
|
-
}[]>;
|
|
57
|
+
type: PropType<CheckboxTreeNode[]>;
|
|
67
58
|
default: () => never[];
|
|
68
59
|
};
|
|
69
60
|
disabled: {
|
|
@@ -76,12 +67,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
76
67
|
error: string;
|
|
77
68
|
hint: string;
|
|
78
69
|
direction: FormGroupDirection;
|
|
79
|
-
options:
|
|
80
|
-
label: string;
|
|
81
|
-
value: any;
|
|
82
|
-
disabled?: boolean | undefined;
|
|
83
|
-
collapsible: boolean;
|
|
84
|
-
}[];
|
|
70
|
+
options: CheckboxTreeNode[];
|
|
85
71
|
disabled: boolean;
|
|
86
72
|
} & {}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
87
73
|
proxyModelValue: import("@vue/composition-api").Ref<string[]> | import("@vue/composition-api").WritableComputedRef<string[]>;
|
|
@@ -91,12 +77,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
91
77
|
error: string;
|
|
92
78
|
hint: string;
|
|
93
79
|
direction: FormGroupDirection;
|
|
94
|
-
options:
|
|
95
|
-
label: string;
|
|
96
|
-
value: any;
|
|
97
|
-
disabled?: boolean | undefined;
|
|
98
|
-
collapsible: boolean;
|
|
99
|
-
}[];
|
|
80
|
+
options: CheckboxTreeNode[];
|
|
100
81
|
disabled: boolean;
|
|
101
82
|
} & {}, {
|
|
102
83
|
modelValue: string[];
|
|
@@ -104,12 +85,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
104
85
|
error: string;
|
|
105
86
|
hint: string;
|
|
106
87
|
direction: FormGroupDirection;
|
|
107
|
-
options:
|
|
108
|
-
label: string;
|
|
109
|
-
value: any;
|
|
110
|
-
disabled?: boolean | undefined;
|
|
111
|
-
collapsible: boolean;
|
|
112
|
-
}[];
|
|
88
|
+
options: CheckboxTreeNode[];
|
|
113
89
|
disabled: boolean;
|
|
114
90
|
}, true>);
|
|
115
91
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed } from 'vue-demi';
|
|
1
|
+
import { defineComponent, computed, watch } from 'vue-demi';
|
|
2
2
|
import { useVModel, useToggle } from '@vueuse/core';
|
|
3
3
|
import { CheckboxTreeRoot, CheckboxTreeRootParent } from './styles.js';
|
|
4
4
|
import flattenDeep from '../../utils/functions/flattenDeep.js';
|
|
@@ -48,6 +48,10 @@ var script = defineComponent({
|
|
|
48
48
|
disabled: {
|
|
49
49
|
type: Boolean,
|
|
50
50
|
default: false
|
|
51
|
+
},
|
|
52
|
+
expanded: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true
|
|
51
55
|
}
|
|
52
56
|
},
|
|
53
57
|
emits: ['update:modelValue'],
|
|
@@ -86,7 +90,12 @@ var script = defineComponent({
|
|
|
86
90
|
const isIntermediate = computed(() => {
|
|
87
91
|
return isAnyChildrenSelected.value && !isAllChildrenSelected.value;
|
|
88
92
|
});
|
|
89
|
-
const [isOpen, setIsOpen] = useToggle(
|
|
93
|
+
const [isOpen, setIsOpen] = useToggle(props.expanded);
|
|
94
|
+
watch(() => props.expanded, value => {
|
|
95
|
+
if (value !== undefined) {
|
|
96
|
+
setIsOpen(value);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
90
99
|
// Styles
|
|
91
100
|
const rootStyles = computed(() => ['or-checkbox-tree-v3', ...CheckboxTreeRoot]);
|
|
92
101
|
// Styles
|
|
@@ -167,6 +176,7 @@ var __vue_render__ = function () {
|
|
|
167
176
|
attrs: {
|
|
168
177
|
"item": child,
|
|
169
178
|
"collapsible": child.collapsible,
|
|
179
|
+
"expanded": child.expanded,
|
|
170
180
|
"disabled": _vm.disabled || child.disabled
|
|
171
181
|
},
|
|
172
182
|
model: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
|
-
import {
|
|
2
|
+
import { CheckboxTreeNode } from './types';
|
|
3
3
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
4
|
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
5
5
|
parentStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
@@ -18,7 +18,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
18
18
|
default: () => never[];
|
|
19
19
|
};
|
|
20
20
|
item: {
|
|
21
|
-
type: PropType<
|
|
21
|
+
type: PropType<CheckboxTreeNode>;
|
|
22
22
|
required: true;
|
|
23
23
|
};
|
|
24
24
|
collapsible: {
|
|
@@ -29,13 +29,17 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
29
29
|
type: BooleanConstructor;
|
|
30
30
|
default: boolean;
|
|
31
31
|
};
|
|
32
|
+
expanded: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
32
36
|
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
33
37
|
modelValue: {
|
|
34
38
|
type: PropType<string[]>;
|
|
35
39
|
default: () => never[];
|
|
36
40
|
};
|
|
37
41
|
item: {
|
|
38
|
-
type: PropType<
|
|
42
|
+
type: PropType<CheckboxTreeNode>;
|
|
39
43
|
required: true;
|
|
40
44
|
};
|
|
41
45
|
collapsible: {
|
|
@@ -46,11 +50,16 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
46
50
|
type: BooleanConstructor;
|
|
47
51
|
default: boolean;
|
|
48
52
|
};
|
|
53
|
+
expanded: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
default: boolean;
|
|
56
|
+
};
|
|
49
57
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
50
58
|
modelValue: string[];
|
|
51
|
-
item:
|
|
59
|
+
item: CheckboxTreeNode;
|
|
52
60
|
collapsible: boolean;
|
|
53
61
|
disabled: boolean;
|
|
62
|
+
expanded: boolean;
|
|
54
63
|
} & {} & {
|
|
55
64
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
56
65
|
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
@@ -67,14 +76,16 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
67
76
|
handleParentClick: () => void;
|
|
68
77
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
69
78
|
modelValue: string[];
|
|
70
|
-
item:
|
|
79
|
+
item: CheckboxTreeNode;
|
|
71
80
|
collapsible: boolean;
|
|
72
81
|
disabled: boolean;
|
|
82
|
+
expanded: boolean;
|
|
73
83
|
} & {} & {
|
|
74
84
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
75
85
|
}, {
|
|
76
86
|
modelValue: string[];
|
|
77
87
|
collapsible: boolean;
|
|
78
88
|
disabled: boolean;
|
|
89
|
+
expanded: boolean;
|
|
79
90
|
}, true>);
|
|
80
91
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed } from 'vue-demi';
|
|
1
|
+
import { defineComponent, computed, watch } from 'vue-demi';
|
|
2
2
|
import { useVModel, useToggle } from '@vueuse/core';
|
|
3
3
|
import { CheckboxTreeRoot, CheckboxTreeRootParent } from './components/OrCheckboxTreeV3/styles.js';
|
|
4
4
|
import flattenDeep from './utils/functions/flattenDeep.js';
|
|
@@ -36,6 +36,10 @@ var script = defineComponent({
|
|
|
36
36
|
disabled: {
|
|
37
37
|
type: Boolean,
|
|
38
38
|
default: false
|
|
39
|
+
},
|
|
40
|
+
expanded: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: true
|
|
39
43
|
}
|
|
40
44
|
},
|
|
41
45
|
emits: ['update:modelValue'],
|
|
@@ -74,7 +78,12 @@ var script = defineComponent({
|
|
|
74
78
|
const isIntermediate = computed(() => {
|
|
75
79
|
return isAnyChildrenSelected.value && !isAllChildrenSelected.value;
|
|
76
80
|
});
|
|
77
|
-
const [isOpen, setIsOpen] = useToggle(
|
|
81
|
+
const [isOpen, setIsOpen] = useToggle(props.expanded);
|
|
82
|
+
watch(() => props.expanded, value => {
|
|
83
|
+
if (value !== undefined) {
|
|
84
|
+
setIsOpen(value);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
78
87
|
// Styles
|
|
79
88
|
const rootStyles = computed(() => ['or-checkbox-tree-v3', ...CheckboxTreeRoot]);
|
|
80
89
|
// Styles
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent } from 'vue-demi';
|
|
2
2
|
import { useVModel } from '@vueuse/core';
|
|
3
3
|
import '../OrCheckboxTreeV3/OrCheckboxTree.js';
|
|
4
|
-
import { s as script$1 } from '../../OrCheckboxTree.vue_vue_type_script_lang-
|
|
4
|
+
import { s as script$1 } from '../../OrCheckboxTree.vue_vue_type_script_lang-5b6dbef1.js';
|
|
5
5
|
import '../OrFormGroupV3/OrFormGroup.js';
|
|
6
6
|
import { FormGroupDirection } from '../OrFormGroupV3/props.js';
|
|
7
7
|
import { s as script$2 } from '../../OrFormGroup.vue_vue_type_script_lang-360b258b.js';
|
|
@@ -106,8 +106,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
106
106
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.proxyModelValue = $event),
|
|
107
107
|
item: option,
|
|
108
108
|
disabled: _ctx.disabled || option.disabled,
|
|
109
|
-
collapsible: option.collapsible
|
|
110
|
-
|
|
109
|
+
collapsible: option.collapsible,
|
|
110
|
+
expanded: option.expanded
|
|
111
|
+
}, null, 8 /* PROPS */, ["modelValue", "item", "disabled", "collapsible", "expanded"]);
|
|
111
112
|
}), 128 /* KEYED_FRAGMENT */))]),
|
|
112
113
|
|
|
113
114
|
_: 3 /* FORWARDED */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
2
|
import { FormGroupDirection } from '../or-form-group-v3';
|
|
3
|
+
import { CheckboxTreeNode } from '../or-checkbox-tree-v3';
|
|
3
4
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
5
|
proxyModelValue: import("@vue/composition-api").Ref<string[]> | import("@vue/composition-api").WritableComputedRef<string[]>;
|
|
5
6
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
@@ -24,12 +25,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
24
25
|
default: FormGroupDirection;
|
|
25
26
|
};
|
|
26
27
|
options: {
|
|
27
|
-
type: PropType<
|
|
28
|
-
label: string;
|
|
29
|
-
value: any;
|
|
30
|
-
disabled?: boolean | undefined;
|
|
31
|
-
collapsible: boolean;
|
|
32
|
-
}[]>;
|
|
28
|
+
type: PropType<CheckboxTreeNode[]>;
|
|
33
29
|
default: () => never[];
|
|
34
30
|
};
|
|
35
31
|
disabled: {
|
|
@@ -58,12 +54,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
58
54
|
default: FormGroupDirection;
|
|
59
55
|
};
|
|
60
56
|
options: {
|
|
61
|
-
type: PropType<
|
|
62
|
-
label: string;
|
|
63
|
-
value: any;
|
|
64
|
-
disabled?: boolean | undefined;
|
|
65
|
-
collapsible: boolean;
|
|
66
|
-
}[]>;
|
|
57
|
+
type: PropType<CheckboxTreeNode[]>;
|
|
67
58
|
default: () => never[];
|
|
68
59
|
};
|
|
69
60
|
disabled: {
|
|
@@ -76,12 +67,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
76
67
|
error: string;
|
|
77
68
|
hint: string;
|
|
78
69
|
direction: FormGroupDirection;
|
|
79
|
-
options:
|
|
80
|
-
label: string;
|
|
81
|
-
value: any;
|
|
82
|
-
disabled?: boolean | undefined;
|
|
83
|
-
collapsible: boolean;
|
|
84
|
-
}[];
|
|
70
|
+
options: CheckboxTreeNode[];
|
|
85
71
|
disabled: boolean;
|
|
86
72
|
} & {}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
87
73
|
proxyModelValue: import("@vue/composition-api").Ref<string[]> | import("@vue/composition-api").WritableComputedRef<string[]>;
|
|
@@ -91,12 +77,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
91
77
|
error: string;
|
|
92
78
|
hint: string;
|
|
93
79
|
direction: FormGroupDirection;
|
|
94
|
-
options:
|
|
95
|
-
label: string;
|
|
96
|
-
value: any;
|
|
97
|
-
disabled?: boolean | undefined;
|
|
98
|
-
collapsible: boolean;
|
|
99
|
-
}[];
|
|
80
|
+
options: CheckboxTreeNode[];
|
|
100
81
|
disabled: boolean;
|
|
101
82
|
} & {}, {
|
|
102
83
|
modelValue: string[];
|
|
@@ -104,12 +85,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
104
85
|
error: string;
|
|
105
86
|
hint: string;
|
|
106
87
|
direction: FormGroupDirection;
|
|
107
|
-
options:
|
|
108
|
-
label: string;
|
|
109
|
-
value: any;
|
|
110
|
-
disabled?: boolean | undefined;
|
|
111
|
-
collapsible: boolean;
|
|
112
|
-
}[];
|
|
88
|
+
options: CheckboxTreeNode[];
|
|
113
89
|
disabled: boolean;
|
|
114
90
|
}, true>);
|
|
115
91
|
export default _default;
|
|
@@ -2,7 +2,7 @@ export { default as OrCheckboxGroupV3 } from './OrCheckboxGroup.js';
|
|
|
2
2
|
import 'vue-demi';
|
|
3
3
|
import '@vueuse/core';
|
|
4
4
|
import '../OrCheckboxTreeV3/OrCheckboxTree.js';
|
|
5
|
-
import '../../OrCheckboxTree.vue_vue_type_script_lang-
|
|
5
|
+
import '../../OrCheckboxTree.vue_vue_type_script_lang-5b6dbef1.js';
|
|
6
6
|
import '../OrCheckboxTreeV3/styles.js';
|
|
7
7
|
import '../../utils/functions/flattenDeep.js';
|
|
8
8
|
import '../OrIconV3/OrIcon.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as script } from '../../OrCheckboxTree.vue_vue_type_script_lang-
|
|
2
|
-
export { s as default } from '../../OrCheckboxTree.vue_vue_type_script_lang-
|
|
1
|
+
import { s as script } from '../../OrCheckboxTree.vue_vue_type_script_lang-5b6dbef1.js';
|
|
2
|
+
export { s as default } from '../../OrCheckboxTree.vue_vue_type_script_lang-5b6dbef1.js';
|
|
3
3
|
import { resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, createElementVNode, createBlock, withCtx, createVNode, createCommentVNode, renderList } from 'vue';
|
|
4
4
|
import 'vue-demi';
|
|
5
5
|
import '@vueuse/core';
|
|
@@ -73,8 +73,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
73
73
|
class: "mt-xs",
|
|
74
74
|
item: child,
|
|
75
75
|
collapsible: child.collapsible,
|
|
76
|
+
expanded: child.expanded,
|
|
76
77
|
disabled: _ctx.disabled || child.disabled
|
|
77
|
-
}, null, 8 /* PROPS */, ["modelValue", "item", "collapsible", "disabled"]);
|
|
78
|
+
}, null, 8 /* PROPS */, ["modelValue", "item", "collapsible", "expanded", "disabled"]);
|
|
78
79
|
}), 128 /* KEYED_FRAGMENT */))], 2 /* CLASS */)) : createCommentVNode("v-if", true)], 64 /* STABLE_FRAGMENT */)) : (openBlock(), createBlock(_component_OrCheckbox, {
|
|
79
80
|
key: 1,
|
|
80
81
|
modelValue: _ctx.proxyModelValue,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
|
-
import {
|
|
2
|
+
import { CheckboxTreeNode } from './types';
|
|
3
3
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
4
|
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
5
5
|
parentStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
@@ -18,7 +18,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
18
18
|
default: () => never[];
|
|
19
19
|
};
|
|
20
20
|
item: {
|
|
21
|
-
type: PropType<
|
|
21
|
+
type: PropType<CheckboxTreeNode>;
|
|
22
22
|
required: true;
|
|
23
23
|
};
|
|
24
24
|
collapsible: {
|
|
@@ -29,13 +29,17 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
29
29
|
type: BooleanConstructor;
|
|
30
30
|
default: boolean;
|
|
31
31
|
};
|
|
32
|
+
expanded: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
32
36
|
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
33
37
|
modelValue: {
|
|
34
38
|
type: PropType<string[]>;
|
|
35
39
|
default: () => never[];
|
|
36
40
|
};
|
|
37
41
|
item: {
|
|
38
|
-
type: PropType<
|
|
42
|
+
type: PropType<CheckboxTreeNode>;
|
|
39
43
|
required: true;
|
|
40
44
|
};
|
|
41
45
|
collapsible: {
|
|
@@ -46,11 +50,16 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
46
50
|
type: BooleanConstructor;
|
|
47
51
|
default: boolean;
|
|
48
52
|
};
|
|
53
|
+
expanded: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
default: boolean;
|
|
56
|
+
};
|
|
49
57
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
50
58
|
modelValue: string[];
|
|
51
|
-
item:
|
|
59
|
+
item: CheckboxTreeNode;
|
|
52
60
|
collapsible: boolean;
|
|
53
61
|
disabled: boolean;
|
|
62
|
+
expanded: boolean;
|
|
54
63
|
} & {} & {
|
|
55
64
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
56
65
|
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
@@ -67,14 +76,16 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
67
76
|
handleParentClick: () => void;
|
|
68
77
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
69
78
|
modelValue: string[];
|
|
70
|
-
item:
|
|
79
|
+
item: CheckboxTreeNode;
|
|
71
80
|
collapsible: boolean;
|
|
72
81
|
disabled: boolean;
|
|
82
|
+
expanded: boolean;
|
|
73
83
|
} & {} & {
|
|
74
84
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
75
85
|
}, {
|
|
76
86
|
modelValue: string[];
|
|
77
87
|
collapsible: boolean;
|
|
78
88
|
disabled: boolean;
|
|
89
|
+
expanded: boolean;
|
|
79
90
|
}, true>);
|
|
80
91
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed } from 'vue-demi';
|
|
1
|
+
import { defineComponent, computed, watch } from 'vue-demi';
|
|
2
2
|
import { useVModel, useToggle } from '@vueuse/core';
|
|
3
3
|
import { _ as __vue_component__$2 } from './OrCheckbox-39c94019.js';
|
|
4
4
|
import { _ as __vue_component__$1 } from './OrIcon-d35a84d8.js';
|
|
@@ -42,6 +42,10 @@ var script = defineComponent({
|
|
|
42
42
|
disabled: {
|
|
43
43
|
type: Boolean,
|
|
44
44
|
default: false
|
|
45
|
+
},
|
|
46
|
+
expanded: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
45
49
|
}
|
|
46
50
|
},
|
|
47
51
|
emits: ['update:modelValue'],
|
|
@@ -80,7 +84,12 @@ var script = defineComponent({
|
|
|
80
84
|
const isIntermediate = computed(() => {
|
|
81
85
|
return isAnyChildrenSelected.value && !isAllChildrenSelected.value;
|
|
82
86
|
});
|
|
83
|
-
const [isOpen, setIsOpen] = useToggle(
|
|
87
|
+
const [isOpen, setIsOpen] = useToggle(props.expanded);
|
|
88
|
+
watch(() => props.expanded, value => {
|
|
89
|
+
if (value !== undefined) {
|
|
90
|
+
setIsOpen(value);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
84
93
|
// Styles
|
|
85
94
|
const rootStyles = computed(() => ['or-checkbox-tree-v3', ...CheckboxTreeRoot]);
|
|
86
95
|
// Styles
|
|
@@ -161,6 +170,7 @@ var __vue_render__ = function () {
|
|
|
161
170
|
attrs: {
|
|
162
171
|
"item": child,
|
|
163
172
|
"collapsible": child.collapsible,
|
|
173
|
+
"expanded": child.expanded,
|
|
164
174
|
"disabled": _vm.disabled || child.disabled
|
|
165
175
|
},
|
|
166
176
|
model: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
2
|
import { FormGroupDirection } from '../or-form-group-v3';
|
|
3
|
+
import { CheckboxTreeNode } from '../or-checkbox-tree-v3';
|
|
3
4
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
5
|
proxyModelValue: import("@vue/composition-api").Ref<string[]> | import("@vue/composition-api").WritableComputedRef<string[]>;
|
|
5
6
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
@@ -24,12 +25,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
24
25
|
default: FormGroupDirection;
|
|
25
26
|
};
|
|
26
27
|
options: {
|
|
27
|
-
type: PropType<
|
|
28
|
-
label: string;
|
|
29
|
-
value: any;
|
|
30
|
-
disabled?: boolean | undefined;
|
|
31
|
-
collapsible: boolean;
|
|
32
|
-
}[]>;
|
|
28
|
+
type: PropType<CheckboxTreeNode[]>;
|
|
33
29
|
default: () => never[];
|
|
34
30
|
};
|
|
35
31
|
disabled: {
|
|
@@ -58,12 +54,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
58
54
|
default: FormGroupDirection;
|
|
59
55
|
};
|
|
60
56
|
options: {
|
|
61
|
-
type: PropType<
|
|
62
|
-
label: string;
|
|
63
|
-
value: any;
|
|
64
|
-
disabled?: boolean | undefined;
|
|
65
|
-
collapsible: boolean;
|
|
66
|
-
}[]>;
|
|
57
|
+
type: PropType<CheckboxTreeNode[]>;
|
|
67
58
|
default: () => never[];
|
|
68
59
|
};
|
|
69
60
|
disabled: {
|
|
@@ -76,12 +67,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
76
67
|
error: string;
|
|
77
68
|
hint: string;
|
|
78
69
|
direction: FormGroupDirection;
|
|
79
|
-
options:
|
|
80
|
-
label: string;
|
|
81
|
-
value: any;
|
|
82
|
-
disabled?: boolean | undefined;
|
|
83
|
-
collapsible: boolean;
|
|
84
|
-
}[];
|
|
70
|
+
options: CheckboxTreeNode[];
|
|
85
71
|
disabled: boolean;
|
|
86
72
|
} & {}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
87
73
|
proxyModelValue: import("@vue/composition-api").Ref<string[]> | import("@vue/composition-api").WritableComputedRef<string[]>;
|
|
@@ -91,12 +77,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
91
77
|
error: string;
|
|
92
78
|
hint: string;
|
|
93
79
|
direction: FormGroupDirection;
|
|
94
|
-
options:
|
|
95
|
-
label: string;
|
|
96
|
-
value: any;
|
|
97
|
-
disabled?: boolean | undefined;
|
|
98
|
-
collapsible: boolean;
|
|
99
|
-
}[];
|
|
80
|
+
options: CheckboxTreeNode[];
|
|
100
81
|
disabled: boolean;
|
|
101
82
|
} & {}, {
|
|
102
83
|
modelValue: string[];
|
|
@@ -104,12 +85,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
104
85
|
error: string;
|
|
105
86
|
hint: string;
|
|
106
87
|
direction: FormGroupDirection;
|
|
107
|
-
options:
|
|
108
|
-
label: string;
|
|
109
|
-
value: any;
|
|
110
|
-
disabled?: boolean | undefined;
|
|
111
|
-
collapsible: boolean;
|
|
112
|
-
}[];
|
|
88
|
+
options: CheckboxTreeNode[];
|
|
113
89
|
disabled: boolean;
|
|
114
90
|
}, true>);
|
|
115
91
|
export default _default;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineComponent } from 'vue-demi';
|
|
2
2
|
import { useVModel } from '@vueuse/core';
|
|
3
3
|
import { _ as __vue_component__$2, F as FormGroupDirection } from '../../OrFormGroup-7a883bce.js';
|
|
4
|
-
import { _ as __vue_component__$1 } from '../../OrCheckboxTree-
|
|
5
|
-
import { s as styleInject } from '../../style-inject.es-4c6f2515.js';
|
|
4
|
+
import { _ as __vue_component__$1 } from '../../OrCheckboxTree-97d78f1f.js';
|
|
6
5
|
import { n as normalizeComponent } from '../../normalize-component-6e8e3d80.js';
|
|
7
6
|
import '../../OrLabel-63380256.js';
|
|
8
7
|
import '../../OrError-4ffc1c39.js';
|
|
9
8
|
import '../../OrHint-aa221198.js';
|
|
10
9
|
import '../../OrCheckbox-39c94019.js';
|
|
11
10
|
import '../../useIdAttribute-859439f0.js';
|
|
11
|
+
import '../../style-inject.es-4c6f2515.js';
|
|
12
12
|
import '../../OrIcon-d35a84d8.js';
|
|
13
13
|
import '../../OrButton-6b60a776.js';
|
|
14
14
|
import '../../OrLoader-b0c381f9.js';
|
|
@@ -64,11 +64,9 @@ var script = defineComponent({
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
-
var css_248z = "";
|
|
68
|
-
styleInject(css_248z);
|
|
69
|
-
|
|
70
67
|
/* script */
|
|
71
68
|
const __vue_script__ = script;
|
|
69
|
+
|
|
72
70
|
/* template */
|
|
73
71
|
var __vue_render__ = function () {
|
|
74
72
|
var _vm = this;
|
|
@@ -95,7 +93,8 @@ var __vue_render__ = function () {
|
|
|
95
93
|
attrs: {
|
|
96
94
|
"item": option,
|
|
97
95
|
"disabled": _vm.disabled || option.disabled,
|
|
98
|
-
"collapsible": option.collapsible
|
|
96
|
+
"collapsible": option.collapsible,
|
|
97
|
+
"expanded": option.expanded
|
|
99
98
|
},
|
|
100
99
|
model: {
|
|
101
100
|
value: _vm.proxyModelValue,
|
|
@@ -112,7 +111,7 @@ var __vue_staticRenderFns__ = [];
|
|
|
112
111
|
/* style */
|
|
113
112
|
const __vue_inject_styles__ = undefined;
|
|
114
113
|
/* scoped */
|
|
115
|
-
const __vue_scope_id__ =
|
|
114
|
+
const __vue_scope_id__ = undefined;
|
|
116
115
|
/* module identifier */
|
|
117
116
|
const __vue_module_identifier__ = undefined;
|
|
118
117
|
/* functional template */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
|
-
import {
|
|
2
|
+
import { CheckboxTreeNode } from './types';
|
|
3
3
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
4
|
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
5
5
|
parentStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
@@ -18,7 +18,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
18
18
|
default: () => never[];
|
|
19
19
|
};
|
|
20
20
|
item: {
|
|
21
|
-
type: PropType<
|
|
21
|
+
type: PropType<CheckboxTreeNode>;
|
|
22
22
|
required: true;
|
|
23
23
|
};
|
|
24
24
|
collapsible: {
|
|
@@ -29,13 +29,17 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
29
29
|
type: BooleanConstructor;
|
|
30
30
|
default: boolean;
|
|
31
31
|
};
|
|
32
|
+
expanded: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
32
36
|
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
33
37
|
modelValue: {
|
|
34
38
|
type: PropType<string[]>;
|
|
35
39
|
default: () => never[];
|
|
36
40
|
};
|
|
37
41
|
item: {
|
|
38
|
-
type: PropType<
|
|
42
|
+
type: PropType<CheckboxTreeNode>;
|
|
39
43
|
required: true;
|
|
40
44
|
};
|
|
41
45
|
collapsible: {
|
|
@@ -46,11 +50,16 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
46
50
|
type: BooleanConstructor;
|
|
47
51
|
default: boolean;
|
|
48
52
|
};
|
|
53
|
+
expanded: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
default: boolean;
|
|
56
|
+
};
|
|
49
57
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
50
58
|
modelValue: string[];
|
|
51
|
-
item:
|
|
59
|
+
item: CheckboxTreeNode;
|
|
52
60
|
collapsible: boolean;
|
|
53
61
|
disabled: boolean;
|
|
62
|
+
expanded: boolean;
|
|
54
63
|
} & {} & {
|
|
55
64
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
56
65
|
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
@@ -67,14 +76,16 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
67
76
|
handleParentClick: () => void;
|
|
68
77
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
69
78
|
modelValue: string[];
|
|
70
|
-
item:
|
|
79
|
+
item: CheckboxTreeNode;
|
|
71
80
|
collapsible: boolean;
|
|
72
81
|
disabled: boolean;
|
|
82
|
+
expanded: boolean;
|
|
73
83
|
} & {} & {
|
|
74
84
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
75
85
|
}, {
|
|
76
86
|
modelValue: string[];
|
|
77
87
|
collapsible: boolean;
|
|
78
88
|
disabled: boolean;
|
|
89
|
+
expanded: boolean;
|
|
79
90
|
}, true>);
|
|
80
91
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed } from 'vue-demi';
|
|
1
|
+
import { defineComponent, computed, watch } from 'vue-demi';
|
|
2
2
|
import { useVModel, useToggle } from '@vueuse/core';
|
|
3
3
|
import { s as script$2 } from './OrCheckbox-488b6915.js';
|
|
4
4
|
import { s as script$1 } from './OrIcon-62793572.js';
|
|
@@ -42,6 +42,10 @@ var script = defineComponent({
|
|
|
42
42
|
disabled: {
|
|
43
43
|
type: Boolean,
|
|
44
44
|
default: false
|
|
45
|
+
},
|
|
46
|
+
expanded: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
45
49
|
}
|
|
46
50
|
},
|
|
47
51
|
emits: ['update:modelValue'],
|
|
@@ -80,7 +84,12 @@ var script = defineComponent({
|
|
|
80
84
|
const isIntermediate = computed(() => {
|
|
81
85
|
return isAnyChildrenSelected.value && !isAllChildrenSelected.value;
|
|
82
86
|
});
|
|
83
|
-
const [isOpen, setIsOpen] = useToggle(
|
|
87
|
+
const [isOpen, setIsOpen] = useToggle(props.expanded);
|
|
88
|
+
watch(() => props.expanded, value => {
|
|
89
|
+
if (value !== undefined) {
|
|
90
|
+
setIsOpen(value);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
84
93
|
// Styles
|
|
85
94
|
const rootStyles = computed(() => ['or-checkbox-tree-v3', ...CheckboxTreeRoot]);
|
|
86
95
|
// Styles
|
|
@@ -154,8 +163,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
154
163
|
class: "mt-xs",
|
|
155
164
|
item: child,
|
|
156
165
|
collapsible: child.collapsible,
|
|
166
|
+
expanded: child.expanded,
|
|
157
167
|
disabled: _ctx.disabled || child.disabled
|
|
158
|
-
}, null, 8 /* PROPS */, ["modelValue", "item", "collapsible", "disabled"]);
|
|
168
|
+
}, null, 8 /* PROPS */, ["modelValue", "item", "collapsible", "expanded", "disabled"]);
|
|
159
169
|
}), 128 /* KEYED_FRAGMENT */))], 2 /* CLASS */)) : createCommentVNode("v-if", true)], 64 /* STABLE_FRAGMENT */)) : (openBlock(), createBlock(_component_OrCheckbox, {
|
|
160
170
|
key: 1,
|
|
161
171
|
modelValue: _ctx.proxyModelValue,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
2
|
import { FormGroupDirection } from '../or-form-group-v3';
|
|
3
|
+
import { CheckboxTreeNode } from '../or-checkbox-tree-v3';
|
|
3
4
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
5
|
proxyModelValue: import("@vue/composition-api").Ref<string[]> | import("@vue/composition-api").WritableComputedRef<string[]>;
|
|
5
6
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
@@ -24,12 +25,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
24
25
|
default: FormGroupDirection;
|
|
25
26
|
};
|
|
26
27
|
options: {
|
|
27
|
-
type: PropType<
|
|
28
|
-
label: string;
|
|
29
|
-
value: any;
|
|
30
|
-
disabled?: boolean | undefined;
|
|
31
|
-
collapsible: boolean;
|
|
32
|
-
}[]>;
|
|
28
|
+
type: PropType<CheckboxTreeNode[]>;
|
|
33
29
|
default: () => never[];
|
|
34
30
|
};
|
|
35
31
|
disabled: {
|
|
@@ -58,12 +54,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
58
54
|
default: FormGroupDirection;
|
|
59
55
|
};
|
|
60
56
|
options: {
|
|
61
|
-
type: PropType<
|
|
62
|
-
label: string;
|
|
63
|
-
value: any;
|
|
64
|
-
disabled?: boolean | undefined;
|
|
65
|
-
collapsible: boolean;
|
|
66
|
-
}[]>;
|
|
57
|
+
type: PropType<CheckboxTreeNode[]>;
|
|
67
58
|
default: () => never[];
|
|
68
59
|
};
|
|
69
60
|
disabled: {
|
|
@@ -76,12 +67,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
76
67
|
error: string;
|
|
77
68
|
hint: string;
|
|
78
69
|
direction: FormGroupDirection;
|
|
79
|
-
options:
|
|
80
|
-
label: string;
|
|
81
|
-
value: any;
|
|
82
|
-
disabled?: boolean | undefined;
|
|
83
|
-
collapsible: boolean;
|
|
84
|
-
}[];
|
|
70
|
+
options: CheckboxTreeNode[];
|
|
85
71
|
disabled: boolean;
|
|
86
72
|
} & {}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
87
73
|
proxyModelValue: import("@vue/composition-api").Ref<string[]> | import("@vue/composition-api").WritableComputedRef<string[]>;
|
|
@@ -91,12 +77,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
91
77
|
error: string;
|
|
92
78
|
hint: string;
|
|
93
79
|
direction: FormGroupDirection;
|
|
94
|
-
options:
|
|
95
|
-
label: string;
|
|
96
|
-
value: any;
|
|
97
|
-
disabled?: boolean | undefined;
|
|
98
|
-
collapsible: boolean;
|
|
99
|
-
}[];
|
|
80
|
+
options: CheckboxTreeNode[];
|
|
100
81
|
disabled: boolean;
|
|
101
82
|
} & {}, {
|
|
102
83
|
modelValue: string[];
|
|
@@ -104,12 +85,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
104
85
|
error: string;
|
|
105
86
|
hint: string;
|
|
106
87
|
direction: FormGroupDirection;
|
|
107
|
-
options:
|
|
108
|
-
label: string;
|
|
109
|
-
value: any;
|
|
110
|
-
disabled?: boolean | undefined;
|
|
111
|
-
collapsible: boolean;
|
|
112
|
-
}[];
|
|
88
|
+
options: CheckboxTreeNode[];
|
|
113
89
|
disabled: boolean;
|
|
114
90
|
}, true>);
|
|
115
91
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent } from 'vue-demi';
|
|
2
2
|
import { useVModel } from '@vueuse/core';
|
|
3
3
|
import { s as script$2, F as FormGroupDirection } from '../../OrFormGroup-d9255559.js';
|
|
4
|
-
import { s as script$1 } from '../../OrCheckboxTree-
|
|
4
|
+
import { s as script$1 } from '../../OrCheckboxTree-a02567a5.js';
|
|
5
5
|
import { resolveComponent, openBlock, createBlock, withCtx, renderSlot, createElementBlock, Fragment, renderList } from 'vue';
|
|
6
6
|
import '../../OrLabel-4da56db0.js';
|
|
7
7
|
import '../../OrError-c01d0c29.js';
|
|
@@ -82,8 +82,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
82
82
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.proxyModelValue = $event),
|
|
83
83
|
item: option,
|
|
84
84
|
disabled: _ctx.disabled || option.disabled,
|
|
85
|
-
collapsible: option.collapsible
|
|
86
|
-
|
|
85
|
+
collapsible: option.collapsible,
|
|
86
|
+
expanded: option.expanded
|
|
87
|
+
}, null, 8 /* PROPS */, ["modelValue", "item", "disabled", "collapsible", "expanded"]);
|
|
87
88
|
}), 128 /* KEYED_FRAGMENT */))]),
|
|
88
89
|
|
|
89
90
|
_: 3 /* FORWARDED */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
|
-
import {
|
|
2
|
+
import { CheckboxTreeNode } from './types';
|
|
3
3
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
4
|
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
5
5
|
parentStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
@@ -18,7 +18,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
18
18
|
default: () => never[];
|
|
19
19
|
};
|
|
20
20
|
item: {
|
|
21
|
-
type: PropType<
|
|
21
|
+
type: PropType<CheckboxTreeNode>;
|
|
22
22
|
required: true;
|
|
23
23
|
};
|
|
24
24
|
collapsible: {
|
|
@@ -29,13 +29,17 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
29
29
|
type: BooleanConstructor;
|
|
30
30
|
default: boolean;
|
|
31
31
|
};
|
|
32
|
+
expanded: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
32
36
|
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
33
37
|
modelValue: {
|
|
34
38
|
type: PropType<string[]>;
|
|
35
39
|
default: () => never[];
|
|
36
40
|
};
|
|
37
41
|
item: {
|
|
38
|
-
type: PropType<
|
|
42
|
+
type: PropType<CheckboxTreeNode>;
|
|
39
43
|
required: true;
|
|
40
44
|
};
|
|
41
45
|
collapsible: {
|
|
@@ -46,11 +50,16 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
46
50
|
type: BooleanConstructor;
|
|
47
51
|
default: boolean;
|
|
48
52
|
};
|
|
53
|
+
expanded: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
default: boolean;
|
|
56
|
+
};
|
|
49
57
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
50
58
|
modelValue: string[];
|
|
51
|
-
item:
|
|
59
|
+
item: CheckboxTreeNode;
|
|
52
60
|
collapsible: boolean;
|
|
53
61
|
disabled: boolean;
|
|
62
|
+
expanded: boolean;
|
|
54
63
|
} & {} & {
|
|
55
64
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
56
65
|
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
@@ -67,14 +76,16 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
67
76
|
handleParentClick: () => void;
|
|
68
77
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
69
78
|
modelValue: string[];
|
|
70
|
-
item:
|
|
79
|
+
item: CheckboxTreeNode;
|
|
71
80
|
collapsible: boolean;
|
|
72
81
|
disabled: boolean;
|
|
82
|
+
expanded: boolean;
|
|
73
83
|
} & {} & {
|
|
74
84
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
75
85
|
}, {
|
|
76
86
|
modelValue: string[];
|
|
77
87
|
collapsible: boolean;
|
|
78
88
|
disabled: boolean;
|
|
89
|
+
expanded: boolean;
|
|
79
90
|
}, true>);
|
|
80
91
|
export default _default;
|
package/package.json
CHANGED
|
@@ -307,3 +307,67 @@ CheckboxGroupWithAddon.args = {
|
|
|
307
307
|
},
|
|
308
308
|
],
|
|
309
309
|
};
|
|
310
|
+
|
|
311
|
+
export const CheckboxGroupDeepPartiallyCollapsed = Template.bind({});
|
|
312
|
+
|
|
313
|
+
CheckboxGroupDeepPartiallyCollapsed.args = {
|
|
314
|
+
label: 'Checkbox Group tree',
|
|
315
|
+
options: [
|
|
316
|
+
{
|
|
317
|
+
label: 'Option 1',
|
|
318
|
+
value: '1',
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
label: 'Option 2',
|
|
322
|
+
value: '2',
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
label: 'Option 3',
|
|
326
|
+
collapsible: true,
|
|
327
|
+
expanded: false,
|
|
328
|
+
children: [
|
|
329
|
+
{
|
|
330
|
+
label: 'Option 3.1',
|
|
331
|
+
value: '3.1',
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
label: 'Option 3.2',
|
|
335
|
+
value: '3.2',
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
label: 'Option 3.3',
|
|
339
|
+
collapsible: true,
|
|
340
|
+
expanded: false,
|
|
341
|
+
children: [
|
|
342
|
+
{
|
|
343
|
+
label: 'Option 3.3.1',
|
|
344
|
+
value: '3.3.1',
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
label: 'Option 3.3.2',
|
|
348
|
+
value: '3.3.2',
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
label: 'Option 3.3.3',
|
|
352
|
+
collapsible: true,
|
|
353
|
+
children: [
|
|
354
|
+
{
|
|
355
|
+
label: 'Option 3.3.3.1',
|
|
356
|
+
value: '3.3.3.1',
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
label: 'Option 3.3.3.2',
|
|
360
|
+
value: '3.3.3.2',
|
|
361
|
+
},
|
|
362
|
+
],
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
label: 'Option 3.3.4',
|
|
366
|
+
value: '3.3.3',
|
|
367
|
+
},
|
|
368
|
+
],
|
|
369
|
+
},
|
|
370
|
+
],
|
|
371
|
+
},
|
|
372
|
+
],
|
|
373
|
+
};
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
:item="option"
|
|
17
17
|
:disabled="disabled || option.disabled"
|
|
18
18
|
:collapsible="option.collapsible"
|
|
19
|
+
:expanded="option.expanded"
|
|
19
20
|
/>
|
|
20
21
|
</OrFormGroup>
|
|
21
22
|
</template>
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
import { defineComponent, PropType } from 'vue-demi';
|
|
25
26
|
import { useVModel } from '@vueuse/core';
|
|
26
27
|
import { OrFormGroupV3 as OrFormGroup, FormGroupDirection } from '../or-form-group-v3';
|
|
27
|
-
import { OrCheckboxTreeV3 as OrCheckboxTree } from '../or-checkbox-tree-v3';
|
|
28
|
+
import { OrCheckboxTreeV3 as OrCheckboxTree, CheckboxTreeNode } from '../or-checkbox-tree-v3';
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
export default defineComponent({
|
|
@@ -59,7 +60,7 @@ export default defineComponent({
|
|
|
59
60
|
default: FormGroupDirection.Vertical,
|
|
60
61
|
},
|
|
61
62
|
options: {
|
|
62
|
-
type: Array as PropType<
|
|
63
|
+
type: Array as PropType<CheckboxTreeNode[]>,
|
|
63
64
|
default: () => [],
|
|
64
65
|
},
|
|
65
66
|
disabled: {
|
|
@@ -77,6 +78,3 @@ export default defineComponent({
|
|
|
77
78
|
|
|
78
79
|
</script>
|
|
79
80
|
|
|
80
|
-
<style scoped>
|
|
81
|
-
|
|
82
|
-
</style>
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
class="mt-xs"
|
|
44
44
|
:item="child"
|
|
45
45
|
:collapsible="child.collapsible"
|
|
46
|
+
:expanded="child.expanded"
|
|
46
47
|
:disabled="disabled || child.disabled"
|
|
47
48
|
/>
|
|
48
49
|
</div>
|
|
@@ -59,13 +60,13 @@
|
|
|
59
60
|
</template>
|
|
60
61
|
|
|
61
62
|
<script lang="ts">
|
|
62
|
-
import { computed, defineComponent, PropType } from 'vue-demi';
|
|
63
|
+
import { computed, defineComponent, PropType, watch } from 'vue-demi';
|
|
63
64
|
import { useVModel, useToggle } from '@vueuse/core';
|
|
64
65
|
import { OrCheckboxV3 as OrCheckbox } from '../or-checkbox-v3';
|
|
65
66
|
import { OrIconV3 as OrIcon } from '../or-icon-v3';
|
|
66
67
|
import { OrButtonV3 as OrButton } from '../or-button-v3';
|
|
67
68
|
import { CheckboxTreeRoot, CheckboxTreeRootParent } from './styles';
|
|
68
|
-
import {
|
|
69
|
+
import { CheckboxTreeNode } from './types';
|
|
69
70
|
import flattenDeep from '../../utils/functions/flattenDeep';
|
|
70
71
|
|
|
71
72
|
export default defineComponent({
|
|
@@ -87,7 +88,7 @@ export default defineComponent({
|
|
|
87
88
|
default: () => [],
|
|
88
89
|
},
|
|
89
90
|
item: {
|
|
90
|
-
type: Object as PropType<
|
|
91
|
+
type: Object as PropType<CheckboxTreeNode>,
|
|
91
92
|
required: true,
|
|
92
93
|
},
|
|
93
94
|
collapsible: {
|
|
@@ -98,6 +99,10 @@ export default defineComponent({
|
|
|
98
99
|
type: Boolean,
|
|
99
100
|
default: false,
|
|
100
101
|
},
|
|
102
|
+
expanded: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: true,
|
|
105
|
+
},
|
|
101
106
|
},
|
|
102
107
|
|
|
103
108
|
emits: [
|
|
@@ -109,7 +114,7 @@ export default defineComponent({
|
|
|
109
114
|
// State
|
|
110
115
|
const hasChildren = computed(() => props.item.children && props.item.children.length > 0);
|
|
111
116
|
const childrenValues = computed(() => {
|
|
112
|
-
const getChildValues = (children?:
|
|
117
|
+
const getChildValues = (children?: CheckboxTreeNode[]): any[] | undefined => {
|
|
113
118
|
return children?.map((child) => {
|
|
114
119
|
if (child.children) {
|
|
115
120
|
return getChildValues(child.children);
|
|
@@ -136,7 +141,13 @@ export default defineComponent({
|
|
|
136
141
|
return isAnyChildrenSelected.value && !isAllChildrenSelected.value;
|
|
137
142
|
});
|
|
138
143
|
|
|
139
|
-
const [isOpen, setIsOpen] = useToggle(
|
|
144
|
+
const [isOpen, setIsOpen] = useToggle(props.expanded);
|
|
145
|
+
|
|
146
|
+
watch(() => props.expanded, (value) => {
|
|
147
|
+
if (value !== undefined) {
|
|
148
|
+
setIsOpen(value);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
140
151
|
|
|
141
152
|
// Styles
|
|
142
153
|
const rootStyles = computed(() => [
|