@onereach/ui-components 4.1.2 → 4.1.3-beta.2558.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 +140 -0
- package/dist/bundled/v2/components/OrCheckboxGroupV3/OrCheckboxGroup.vue.d.ts +115 -0
- package/dist/bundled/v2/components/OrCheckboxGroupV3/index.d.ts +1 -0
- package/dist/bundled/v2/components/OrCheckboxGroupV3/index.js +25 -0
- package/dist/bundled/v2/components/OrCheckboxTreeV3/OrCheckboxTree.js +203 -0
- package/dist/bundled/v2/components/OrCheckboxTreeV3/OrCheckboxTree.vue.d.ts +76 -0
- package/dist/bundled/v2/components/OrCheckboxTreeV3/index.d.ts +1 -0
- package/dist/bundled/v2/components/OrCheckboxTreeV3/index.js +17 -0
- package/dist/bundled/v2/components/OrCheckboxTreeV3/styles.d.ts +2 -0
- package/dist/bundled/v2/components/OrCheckboxTreeV3/styles.js +10 -0
- package/dist/bundled/v2/components/OrCheckboxTreeV3/types.d.ts +7 -0
- package/dist/bundled/v2/components/OrCheckboxTreeV3/types.js +1 -0
- package/dist/bundled/v2/components/OrCheckboxV3/OrCheckbox.js +34 -39
- package/dist/bundled/v2/components/OrCheckboxV3/OrCheckbox.vue.d.ts +18 -16
- package/dist/bundled/v2/components/OrCheckboxV3/index.js +1 -0
- package/dist/bundled/v2/components/OrFormGroupV3/OrFormGroup.js +123 -0
- package/dist/bundled/v2/components/OrFormGroupV3/OrFormGroup.vue.d.ts +85 -0
- package/dist/bundled/v2/components/OrFormGroupV3/index.d.ts +2 -0
- package/dist/bundled/v2/components/OrFormGroupV3/index.js +12 -0
- package/dist/bundled/v2/components/OrFormGroupV3/props.d.ts +4 -0
- package/dist/bundled/v2/components/OrFormGroupV3/props.js +7 -0
- package/dist/bundled/v2/components/OrFormGroupV3/styles.d.ts +6 -0
- package/dist/bundled/v2/components/OrFormGroupV3/styles.js +20 -0
- package/dist/bundled/v2/components/OrRadioGroupV3/OrRadioGroup.js +132 -0
- package/dist/bundled/v2/components/OrRadioGroupV3/OrRadioGroup.vue.d.ts +110 -0
- package/dist/bundled/v2/components/OrRadioGroupV3/index.d.ts +1 -0
- package/dist/bundled/v2/components/OrRadioGroupV3/index.js +19 -0
- package/dist/bundled/v2/components/OrSelectV3/OrSelect.js +1 -1
- package/dist/bundled/v2/components/OrSelectV3/index.js +1 -1
- package/dist/bundled/v2/index.d.ts +1 -0
- package/dist/bundled/v2/index.js +4 -3
- package/dist/bundled/v2/utils/functions/flattenDeep.d.ts +2 -0
- package/dist/bundled/v2/utils/functions/flattenDeep.js +5 -0
- package/dist/bundled/v3/{OrCheckbox.vue_vue_type_script_lang-60cefcbd.js → OrCheckbox.vue_vue_type_script_lang-51a4f8d3.js} +26 -10
- package/dist/bundled/v3/OrCheckboxTree.vue_vue_type_script_lang-ffa313a0.js +102 -0
- package/dist/bundled/v3/OrFormGroup.vue_vue_type_script_lang-360b258b.js +60 -0
- package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-f7601423.js → OrSelect.vue_vue_type_script_lang-c0612348.js} +1 -1
- package/dist/bundled/v3/components/OrCheckboxGroupV3/OrCheckboxGroup.js +112 -0
- package/dist/bundled/v3/components/OrCheckboxGroupV3/OrCheckboxGroup.vue.d.ts +115 -0
- package/dist/bundled/v3/components/OrCheckboxGroupV3/index.d.ts +1 -0
- package/dist/bundled/v3/components/OrCheckboxGroupV3/index.js +32 -0
- package/dist/bundled/v3/components/OrCheckboxTreeV3/OrCheckboxTree.js +74 -0
- package/dist/bundled/v3/components/OrCheckboxTreeV3/OrCheckboxTree.vue.d.ts +76 -0
- package/dist/bundled/v3/components/OrCheckboxTreeV3/index.d.ts +1 -0
- package/dist/bundled/v3/components/OrCheckboxTreeV3/index.js +20 -0
- package/dist/bundled/v3/components/OrCheckboxTreeV3/styles.d.ts +2 -0
- package/dist/bundled/v3/components/OrCheckboxTreeV3/styles.js +10 -0
- package/dist/bundled/v3/components/OrCheckboxTreeV3/types.d.ts +7 -0
- package/dist/bundled/v3/components/OrCheckboxTreeV3/types.js +1 -0
- package/dist/bundled/v3/components/OrCheckboxV3/OrCheckbox.js +9 -7
- package/dist/bundled/v3/components/OrCheckboxV3/OrCheckbox.vue.d.ts +18 -16
- package/dist/bundled/v3/components/OrCheckboxV3/index.js +2 -1
- package/dist/bundled/v3/components/OrFormGroupV3/OrFormGroup.js +58 -0
- package/dist/bundled/v3/components/OrFormGroupV3/OrFormGroup.vue.d.ts +85 -0
- package/dist/bundled/v3/components/OrFormGroupV3/index.d.ts +2 -0
- package/dist/bundled/v3/components/OrFormGroupV3/index.js +15 -0
- package/dist/bundled/v3/components/OrFormGroupV3/props.d.ts +4 -0
- package/dist/bundled/v3/components/OrFormGroupV3/props.js +7 -0
- package/dist/bundled/v3/components/OrFormGroupV3/styles.d.ts +6 -0
- package/dist/bundled/v3/components/OrFormGroupV3/styles.js +20 -0
- package/dist/bundled/v3/components/OrRadioGroupV3/OrRadioGroup.js +104 -0
- package/dist/bundled/v3/components/OrRadioGroupV3/OrRadioGroup.vue.d.ts +110 -0
- package/dist/bundled/v3/components/OrRadioGroupV3/index.d.ts +1 -0
- package/dist/bundled/v3/components/OrRadioGroupV3/index.js +24 -0
- package/dist/bundled/v3/components/OrSelectV3/OrSelect.js +4 -4
- package/dist/bundled/v3/components/OrSelectV3/index.js +3 -3
- package/dist/bundled/v3/components/index.js +2 -2
- package/dist/bundled/v3/index.d.ts +1 -0
- package/dist/bundled/v3/index.js +7 -7
- package/dist/bundled/v3/utils/functions/flattenDeep.d.ts +2 -0
- package/dist/bundled/v3/utils/functions/flattenDeep.js +5 -0
- package/dist/esm/v2/{OrCheckbox-dc587ec9.js → OrCheckbox-e55228e5.js} +34 -40
- package/dist/esm/v2/OrCheckboxTree-00fd6cf9.js +202 -0
- package/dist/esm/v2/OrFormGroup-7a883bce.js +140 -0
- package/dist/esm/v2/{OrSelect-40183874.js → OrSelect-4031334e.js} +1 -1
- package/dist/esm/v2/components/index.js +2 -2
- package/dist/esm/v2/components/or-checkbox-group-v3/OrCheckboxGroup.vue.d.ts +115 -0
- package/dist/esm/v2/components/or-checkbox-group-v3/index.d.ts +1 -0
- package/dist/esm/v2/components/or-checkbox-group-v3/index.js +129 -0
- package/dist/esm/v2/components/or-checkbox-tree-v3/OrCheckboxTree.vue.d.ts +76 -0
- 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 +10 -0
- package/dist/esm/v2/components/or-checkbox-tree-v3/styles.d.ts +2 -0
- package/dist/esm/v2/components/or-checkbox-tree-v3/types.d.ts +7 -0
- package/dist/esm/v2/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -16
- package/dist/esm/v2/components/or-checkbox-v3/index.js +2 -2
- package/dist/esm/v2/components/or-form-group-v3/OrFormGroup.vue.d.ts +85 -0
- package/dist/esm/v2/components/or-form-group-v3/index.d.ts +2 -0
- package/dist/esm/v2/components/or-form-group-v3/index.js +6 -0
- package/dist/esm/v2/components/or-form-group-v3/props.d.ts +4 -0
- package/dist/esm/v2/components/or-form-group-v3/styles.d.ts +6 -0
- package/dist/esm/v2/components/or-radio-group-v3/OrRadioGroup.vue.d.ts +110 -0
- package/dist/esm/v2/components/or-radio-group-v3/index.d.ts +1 -0
- package/dist/esm/v2/components/or-radio-group-v3/index.js +124 -0
- package/dist/esm/v2/components/or-select-v3/index.js +2 -2
- package/dist/esm/v2/flattenDeep-e7a8b995.js +5 -0
- package/dist/esm/v2/index.d.ts +1 -0
- package/dist/esm/v2/index.js +3 -2
- package/dist/esm/v2/utils/functions/flattenDeep.d.ts +2 -0
- package/dist/esm/v3/{OrCheckbox-56f849f7.js → OrCheckbox-eab735d0.js} +32 -16
- package/dist/esm/v3/OrCheckboxTree-8ead5a31.js +162 -0
- package/dist/esm/v3/OrFormGroup-d9255559.js +121 -0
- package/dist/esm/v3/{OrSelect-5502d82d.js → OrSelect-ebdab996.js} +1 -1
- package/dist/esm/v3/components/index.js +2 -2
- package/dist/esm/v3/components/or-checkbox-group-v3/OrCheckboxGroup.vue.d.ts +115 -0
- package/dist/esm/v3/components/or-checkbox-group-v3/index.d.ts +1 -0
- package/dist/esm/v3/components/or-checkbox-group-v3/index.js +94 -0
- package/dist/esm/v3/components/or-checkbox-tree-v3/OrCheckboxTree.vue.d.ts +76 -0
- 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 +10 -0
- package/dist/esm/v3/components/or-checkbox-tree-v3/styles.d.ts +2 -0
- package/dist/esm/v3/components/or-checkbox-tree-v3/types.d.ts +7 -0
- package/dist/esm/v3/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -16
- package/dist/esm/v3/components/or-checkbox-v3/index.js +2 -2
- package/dist/esm/v3/components/or-form-group-v3/OrFormGroup.vue.d.ts +85 -0
- package/dist/esm/v3/components/or-form-group-v3/index.d.ts +2 -0
- package/dist/esm/v3/components/or-form-group-v3/index.js +6 -0
- package/dist/esm/v3/components/or-form-group-v3/props.d.ts +4 -0
- package/dist/esm/v3/components/or-form-group-v3/styles.d.ts +6 -0
- package/dist/esm/v3/components/or-radio-group-v3/OrRadioGroup.vue.d.ts +110 -0
- package/dist/esm/v3/components/or-radio-group-v3/index.d.ts +1 -0
- package/dist/esm/v3/components/or-radio-group-v3/index.js +91 -0
- package/dist/esm/v3/components/or-select-v3/index.js +2 -2
- package/dist/esm/v3/flattenDeep-e7a8b995.js +5 -0
- package/dist/esm/v3/index.d.ts +1 -0
- package/dist/esm/v3/index.js +3 -2
- package/dist/esm/v3/utils/functions/flattenDeep.d.ts +2 -0
- package/package.json +2 -3
- package/src/components/or-checkbox-group-v3/OrCheckboxGroup.docs.mdx +7 -0
- package/src/components/or-checkbox-group-v3/OrCheckboxGroup.stories3.ts +263 -0
- package/src/components/or-checkbox-group-v3/OrCheckboxGroup.vue +82 -0
- package/src/components/or-checkbox-group-v3/index.ts +1 -0
- package/src/components/or-checkbox-tree-v3/OrCheckboxTree.docs.mdx +7 -0
- package/src/components/or-checkbox-tree-v3/OrCheckboxTree.stories3.ts +112 -0
- package/src/components/or-checkbox-tree-v3/OrCheckboxTree.vue +168 -0
- package/src/components/or-checkbox-tree-v3/index.ts +1 -0
- package/src/components/or-checkbox-tree-v3/styles.ts +15 -0
- package/src/components/or-checkbox-tree-v3/types.ts +7 -0
- package/src/components/or-checkbox-v3/OrCheckbox.vue +30 -12
- package/src/components/or-form-group-v3/OrFormGroup.stories3.ts +114 -0
- package/src/components/or-form-group-v3/OrFormGroup.vue +114 -0
- package/src/components/or-form-group-v3/index.ts +2 -0
- package/src/components/or-form-group-v3/props.ts +4 -0
- package/src/components/or-form-group-v3/styles.ts +36 -0
- package/src/components/or-radio-group-v3/OrRadioGroup.stories3.ts +81 -0
- package/src/components/or-radio-group-v3/OrRadioGroup.vue +80 -0
- package/src/components/or-radio-group-v3/index.ts +1 -0
- package/src/components/or-radio-v3/OrRadio.stories3.ts +1 -1
- package/src/index.ts +1 -0
- package/src/utils/functions/flattenDeep.ts +5 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, reactive } from 'vue-demi';
|
|
2
|
+
import { useVModel } from '@vueuse/core';
|
|
2
3
|
import { a as useIdAttribute, u as useControlAttributes } from './useIdAttribute-859439f0.js';
|
|
3
|
-
import '@vueuse/core';
|
|
4
4
|
import { _ as __vue_component__$1, L as LabelVariant } from './OrLabel-63380256.js';
|
|
5
5
|
import { s as styleInject } from './style-inject.es-4c6f2515.js';
|
|
6
6
|
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
@@ -46,12 +46,12 @@ var script = defineComponent({
|
|
|
46
46
|
},
|
|
47
47
|
props: {
|
|
48
48
|
modelValue: {
|
|
49
|
-
type:
|
|
50
|
-
default:
|
|
49
|
+
type: null,
|
|
50
|
+
default: null
|
|
51
51
|
},
|
|
52
52
|
value: {
|
|
53
|
-
type: String,
|
|
54
|
-
default:
|
|
53
|
+
type: [String, Boolean, Number],
|
|
54
|
+
default: null
|
|
55
55
|
},
|
|
56
56
|
label: {
|
|
57
57
|
type: String,
|
|
@@ -76,7 +76,9 @@ var script = defineComponent({
|
|
|
76
76
|
},
|
|
77
77
|
emits: ['update:modelValue', 'focus', 'blur'],
|
|
78
78
|
expose: ['root', 'focus', 'blur'],
|
|
79
|
-
setup(props,
|
|
79
|
+
setup(props, {
|
|
80
|
+
emit
|
|
81
|
+
}) {
|
|
80
82
|
// Refs
|
|
81
83
|
const root = ref();
|
|
82
84
|
const control = ref();
|
|
@@ -88,13 +90,25 @@ var script = defineComponent({
|
|
|
88
90
|
id: useIdAttribute(),
|
|
89
91
|
...useControlAttributes()
|
|
90
92
|
});
|
|
91
|
-
const proxyModelValue =
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
const proxyModelValue = useVModel(props, 'modelValue', emit);
|
|
94
|
+
const isChecked = computed(() => {
|
|
95
|
+
if (Array.isArray(proxyModelValue.value)) {
|
|
96
|
+
return props.value && proxyModelValue.value.includes(props.value);
|
|
95
97
|
}
|
|
98
|
+
return !!proxyModelValue.value;
|
|
96
99
|
});
|
|
97
100
|
// Methods
|
|
101
|
+
function handleChange() {
|
|
102
|
+
if (Array.isArray(proxyModelValue.value)) {
|
|
103
|
+
if (isChecked.value) {
|
|
104
|
+
proxyModelValue.value = proxyModelValue.value.filter(v => v !== props.value);
|
|
105
|
+
} else {
|
|
106
|
+
proxyModelValue.value = [...proxyModelValue.value, props.value];
|
|
107
|
+
}
|
|
108
|
+
} else {
|
|
109
|
+
proxyModelValue.value = !proxyModelValue.value;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
98
112
|
function focus() {
|
|
99
113
|
var _a;
|
|
100
114
|
(_a = control.value) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -109,14 +123,15 @@ var script = defineComponent({
|
|
|
109
123
|
rootStyles,
|
|
110
124
|
controlStyles,
|
|
111
125
|
controlAttributes,
|
|
112
|
-
|
|
126
|
+
isChecked,
|
|
127
|
+
handleChange,
|
|
113
128
|
focus,
|
|
114
129
|
blur
|
|
115
130
|
};
|
|
116
131
|
}
|
|
117
132
|
});
|
|
118
133
|
|
|
119
|
-
var css_248z = "input[data-v-
|
|
134
|
+
var css_248z = "input[data-v-4d2215e4]{appearance:none;line-height:0}";
|
|
120
135
|
styleInject(css_248z);
|
|
121
136
|
|
|
122
137
|
/* script */
|
|
@@ -130,49 +145,28 @@ var __vue_render__ = function () {
|
|
|
130
145
|
ref: "root",
|
|
131
146
|
class: _vm.rootStyles
|
|
132
147
|
}, [_c('input', _vm._b({
|
|
133
|
-
directives: [{
|
|
134
|
-
name: "model",
|
|
135
|
-
rawName: "v-model",
|
|
136
|
-
value: _vm.proxyModelValue,
|
|
137
|
-
expression: "proxyModelValue"
|
|
138
|
-
}],
|
|
139
148
|
ref: "control",
|
|
140
149
|
class: _vm.controlStyles,
|
|
141
150
|
attrs: {
|
|
151
|
+
"type": 'checkbox',
|
|
142
152
|
"indeterminate": _vm.indeterminate,
|
|
143
153
|
"required": _vm.required,
|
|
144
|
-
"disabled": _vm.disabled
|
|
145
|
-
"type": "checkbox"
|
|
154
|
+
"disabled": _vm.disabled
|
|
146
155
|
},
|
|
147
156
|
domProps: {
|
|
148
|
-
"
|
|
149
|
-
"
|
|
157
|
+
"checked": _vm.isChecked,
|
|
158
|
+
"value": _vm.value
|
|
150
159
|
},
|
|
151
160
|
on: {
|
|
161
|
+
"change": _vm.handleChange,
|
|
152
162
|
"focus": function ($event) {
|
|
153
163
|
return _vm.$emit('focus', $event);
|
|
154
164
|
},
|
|
155
165
|
"blur": function ($event) {
|
|
156
166
|
return _vm.$emit('blur', $event);
|
|
157
|
-
},
|
|
158
|
-
"change": function ($event) {
|
|
159
|
-
var $$a = _vm.proxyModelValue,
|
|
160
|
-
$$el = $event.target,
|
|
161
|
-
$$c = $$el.checked ? true : false;
|
|
162
|
-
if (Array.isArray($$a)) {
|
|
163
|
-
var $$v = _vm.value,
|
|
164
|
-
$$i = _vm._i($$a, $$v);
|
|
165
|
-
if ($$el.checked) {
|
|
166
|
-
$$i < 0 && (_vm.proxyModelValue = $$a.concat([$$v]));
|
|
167
|
-
} else {
|
|
168
|
-
$$i > -1 && (_vm.proxyModelValue = $$a.slice(0, $$i).concat($$a.slice($$i + 1)));
|
|
169
|
-
}
|
|
170
|
-
} else {
|
|
171
|
-
_vm.proxyModelValue = $$c;
|
|
172
|
-
}
|
|
173
167
|
}
|
|
174
168
|
}
|
|
175
|
-
}, 'input', _vm.controlAttributes, false))
|
|
169
|
+
}, 'input', _vm.controlAttributes, false)), _vm._v(" "), _vm.$slots.default || _vm.label ? [_c('OrLabel', {
|
|
176
170
|
attrs: {
|
|
177
171
|
"control-id": _vm.controlAttributes.id,
|
|
178
172
|
"variant": _vm.labelVariant,
|
|
@@ -195,7 +189,7 @@ var __vue_staticRenderFns__ = [];
|
|
|
195
189
|
/* style */
|
|
196
190
|
const __vue_inject_styles__ = undefined;
|
|
197
191
|
/* scoped */
|
|
198
|
-
const __vue_scope_id__ = "data-v-
|
|
192
|
+
const __vue_scope_id__ = "data-v-4d2215e4";
|
|
199
193
|
/* module identifier */
|
|
200
194
|
const __vue_module_identifier__ = undefined;
|
|
201
195
|
/* functional template */
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { defineComponent, computed } from 'vue-demi';
|
|
2
|
+
import { useVModel, useToggle } from '@vueuse/core';
|
|
3
|
+
import { _ as __vue_component__$2 } from './OrCheckbox-e55228e5.js';
|
|
4
|
+
import { _ as __vue_component__$1 } from './OrIcon-d35a84d8.js';
|
|
5
|
+
import { f as flattenDeep } from './flattenDeep-e7a8b995.js';
|
|
6
|
+
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
7
|
+
|
|
8
|
+
const CheckboxTreeRoot = [
|
|
9
|
+
// Layout
|
|
10
|
+
'flex', 'flex-col',
|
|
11
|
+
// Spacing
|
|
12
|
+
'gap-sm+ md:gap-sm'];
|
|
13
|
+
const CheckboxTreeRootParent = [
|
|
14
|
+
// Layout
|
|
15
|
+
'flex', 'flex-row', 'gap-xs'];
|
|
16
|
+
|
|
17
|
+
var script = defineComponent({
|
|
18
|
+
name: 'OrCheckboxTree',
|
|
19
|
+
components: {
|
|
20
|
+
OrIcon: __vue_component__$1,
|
|
21
|
+
OrCheckbox: __vue_component__$2
|
|
22
|
+
},
|
|
23
|
+
model: {
|
|
24
|
+
prop: 'modelValue',
|
|
25
|
+
event: 'update:modelValue'
|
|
26
|
+
},
|
|
27
|
+
props: {
|
|
28
|
+
modelValue: {
|
|
29
|
+
type: Array,
|
|
30
|
+
default: () => []
|
|
31
|
+
},
|
|
32
|
+
item: {
|
|
33
|
+
type: Object,
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
collapsible: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
disabled: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
setup(props, {
|
|
46
|
+
emit
|
|
47
|
+
}) {
|
|
48
|
+
// State
|
|
49
|
+
const hasChildren = computed(() => props.item.children && props.item.children.length > 0);
|
|
50
|
+
const childrenValues = computed(() => {
|
|
51
|
+
const getChildValues = children => {
|
|
52
|
+
return children === null || children === void 0 ? void 0 : children.map(child => {
|
|
53
|
+
if (child.children) {
|
|
54
|
+
return getChildValues(child.children);
|
|
55
|
+
} else {
|
|
56
|
+
return child.value;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
return flattenDeep(getChildValues(props.item.children));
|
|
61
|
+
});
|
|
62
|
+
const proxyModelValue = useVModel(props, 'modelValue', emit);
|
|
63
|
+
const isAnyChildrenSelected = computed(() => {
|
|
64
|
+
var _a;
|
|
65
|
+
return (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.some(value => {
|
|
66
|
+
var _a;
|
|
67
|
+
return (_a = childrenValues.value) === null || _a === void 0 ? void 0 : _a.includes(value);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
const isAllChildrenSelected = computed(() => {
|
|
71
|
+
var _a;
|
|
72
|
+
return (_a = childrenValues.value) === null || _a === void 0 ? void 0 : _a.every(value => {
|
|
73
|
+
var _a;
|
|
74
|
+
return (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.includes(value);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
const isIntermediate = computed(() => {
|
|
78
|
+
return isAnyChildrenSelected.value && !isAllChildrenSelected.value;
|
|
79
|
+
});
|
|
80
|
+
const [isOpen, setIsOpen] = useToggle(true);
|
|
81
|
+
// Styles
|
|
82
|
+
const rootStyles = computed(() => ['or-checkbox-tree-v3', ...CheckboxTreeRoot]);
|
|
83
|
+
// Styles
|
|
84
|
+
const parentStyles = computed(() => [...CheckboxTreeRootParent]);
|
|
85
|
+
// Methods
|
|
86
|
+
const handleParentClick = () => {
|
|
87
|
+
if (isAllChildrenSelected.value) {
|
|
88
|
+
proxyModelValue.value = proxyModelValue.value.filter(value => !childrenValues.value.includes(value));
|
|
89
|
+
} else {
|
|
90
|
+
proxyModelValue.value = [...proxyModelValue.value, ...childrenValues.value];
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
return {
|
|
94
|
+
rootStyles,
|
|
95
|
+
parentStyles,
|
|
96
|
+
hasChildren,
|
|
97
|
+
proxyModelValue,
|
|
98
|
+
isOpen,
|
|
99
|
+
setIsOpen,
|
|
100
|
+
isIntermediate,
|
|
101
|
+
isAllChildrenSelected,
|
|
102
|
+
isAnyChildrenSelected,
|
|
103
|
+
childrenValues,
|
|
104
|
+
handleParentClick
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
/* script */
|
|
110
|
+
const __vue_script__ = script;
|
|
111
|
+
|
|
112
|
+
/* template */
|
|
113
|
+
var __vue_render__ = function () {
|
|
114
|
+
var _vm = this;
|
|
115
|
+
var _h = _vm.$createElement;
|
|
116
|
+
var _c = _vm._self._c || _h;
|
|
117
|
+
return _c('div', {
|
|
118
|
+
ref: "root",
|
|
119
|
+
class: _vm.rootStyles
|
|
120
|
+
}, [_vm.hasChildren ? [_c('div', {
|
|
121
|
+
class: _vm.parentStyles
|
|
122
|
+
}, [_vm.collapsible ? [_c('OrIcon', {
|
|
123
|
+
class: [_vm.isOpen ? 'rotate-[180deg]' : 'rotate-0'],
|
|
124
|
+
attrs: {
|
|
125
|
+
"icon": "arrow_drop_down",
|
|
126
|
+
"size": "l"
|
|
127
|
+
},
|
|
128
|
+
on: {
|
|
129
|
+
"click": function () {
|
|
130
|
+
return _vm.setIsOpen(!_vm.isOpen);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
})] : _vm._e(), _vm._v(" "), _c('OrCheckbox', {
|
|
134
|
+
attrs: {
|
|
135
|
+
"value": "true",
|
|
136
|
+
"model-value": _vm.isAllChildrenSelected,
|
|
137
|
+
"indeterminate": _vm.isIntermediate,
|
|
138
|
+
"label": _vm.item.label,
|
|
139
|
+
"disabled": _vm.disabled
|
|
140
|
+
},
|
|
141
|
+
on: {
|
|
142
|
+
"click": _vm.handleParentClick
|
|
143
|
+
}
|
|
144
|
+
})], 2), _vm._v(" "), _vm.hasChildren && _vm.isOpen ? _c('div', {
|
|
145
|
+
class: {
|
|
146
|
+
'ml-2xl': _vm.collapsible,
|
|
147
|
+
'ml-lg': !_vm.collapsible
|
|
148
|
+
}
|
|
149
|
+
}, _vm._l(_vm.item.children, function (child) {
|
|
150
|
+
return _c('OrCheckboxTree', {
|
|
151
|
+
key: child.value,
|
|
152
|
+
staticClass: "mt-xs",
|
|
153
|
+
attrs: {
|
|
154
|
+
"item": child,
|
|
155
|
+
"collapsible": _vm.collapsible || child.collapsible,
|
|
156
|
+
"disabled": _vm.disabled || child.disabled
|
|
157
|
+
},
|
|
158
|
+
model: {
|
|
159
|
+
value: _vm.proxyModelValue,
|
|
160
|
+
callback: function ($$v) {
|
|
161
|
+
_vm.proxyModelValue = $$v;
|
|
162
|
+
},
|
|
163
|
+
expression: "proxyModelValue"
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}), 1) : _vm._e()] : [_c('OrCheckbox', {
|
|
167
|
+
attrs: {
|
|
168
|
+
"disabled": _vm.disabled || _vm.item.disabled,
|
|
169
|
+
"label": _vm.item.label,
|
|
170
|
+
"value": _vm.item.value
|
|
171
|
+
},
|
|
172
|
+
model: {
|
|
173
|
+
value: _vm.proxyModelValue,
|
|
174
|
+
callback: function ($$v) {
|
|
175
|
+
_vm.proxyModelValue = $$v;
|
|
176
|
+
},
|
|
177
|
+
expression: "proxyModelValue"
|
|
178
|
+
}
|
|
179
|
+
})]], 2);
|
|
180
|
+
};
|
|
181
|
+
var __vue_staticRenderFns__ = [];
|
|
182
|
+
|
|
183
|
+
/* style */
|
|
184
|
+
const __vue_inject_styles__ = undefined;
|
|
185
|
+
/* scoped */
|
|
186
|
+
const __vue_scope_id__ = undefined;
|
|
187
|
+
/* module identifier */
|
|
188
|
+
const __vue_module_identifier__ = undefined;
|
|
189
|
+
/* functional template */
|
|
190
|
+
const __vue_is_functional_template__ = false;
|
|
191
|
+
/* style inject */
|
|
192
|
+
|
|
193
|
+
/* style inject SSR */
|
|
194
|
+
|
|
195
|
+
/* style inject shadow dom */
|
|
196
|
+
|
|
197
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
198
|
+
render: __vue_render__,
|
|
199
|
+
staticRenderFns: __vue_staticRenderFns__
|
|
200
|
+
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
201
|
+
|
|
202
|
+
export { __vue_component__ as _ };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { defineComponent, ref, computed } from 'vue-demi';
|
|
2
|
+
import { _ as __vue_component__$1 } from './OrLabel-63380256.js';
|
|
3
|
+
import { _ as __vue_component__$2 } from './OrError-4ffc1c39.js';
|
|
4
|
+
import { _ as __vue_component__$3 } from './OrHint-aa221198.js';
|
|
5
|
+
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
6
|
+
|
|
7
|
+
var FormGroupDirection;
|
|
8
|
+
(function (FormGroupDirection) {
|
|
9
|
+
FormGroupDirection["Vertical"] = "vertical";
|
|
10
|
+
FormGroupDirection["Horizontal"] = "horizontal";
|
|
11
|
+
})(FormGroupDirection || (FormGroupDirection = {}));
|
|
12
|
+
|
|
13
|
+
const FormGroupRoot = [
|
|
14
|
+
// Layout
|
|
15
|
+
'flex', 'flex-col', 'gap-md md:gap-sm'];
|
|
16
|
+
const FormGroupContent = [
|
|
17
|
+
// Layout
|
|
18
|
+
'flex', 'pl-[10px] md:pl-[0]', 'gap-md md:gap-sm'];
|
|
19
|
+
const FormGroupLabel = [
|
|
20
|
+
// Typography
|
|
21
|
+
'!typography-body-2-regular', '!theme-foreground dark:!theme-foreground-dark'];
|
|
22
|
+
const FormGroupLabelError = [
|
|
23
|
+
// Typography
|
|
24
|
+
'!theme-foreground-error dark:!theme-foreground-error-dark'];
|
|
25
|
+
const FormGroupContentDirections = {
|
|
26
|
+
[FormGroupDirection.Vertical]: ['flex-col', 'gap-sm'],
|
|
27
|
+
[FormGroupDirection.Horizontal]: ['flex-row', 'gap-[18px] md:gap-md']
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
var script = defineComponent({
|
|
31
|
+
name: 'OrFormGroupV3',
|
|
32
|
+
components: {
|
|
33
|
+
OrLabel: __vue_component__$1,
|
|
34
|
+
OrError: __vue_component__$2,
|
|
35
|
+
OrHint: __vue_component__$3
|
|
36
|
+
},
|
|
37
|
+
props: {
|
|
38
|
+
label: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: undefined
|
|
41
|
+
},
|
|
42
|
+
required: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
disabled: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
50
|
+
direction: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: FormGroupDirection.Vertical
|
|
53
|
+
},
|
|
54
|
+
error: {
|
|
55
|
+
type: [String, Boolean],
|
|
56
|
+
default: undefined
|
|
57
|
+
},
|
|
58
|
+
hint: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: undefined
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
setup(props) {
|
|
64
|
+
// Refs
|
|
65
|
+
const root = ref();
|
|
66
|
+
// Styles
|
|
67
|
+
const rootStyles = computed(() => ['or-form-group-v3', ...FormGroupRoot]);
|
|
68
|
+
const labelStyles = computed(() => [...FormGroupLabel, ...(props.error ? FormGroupLabelError : [])]);
|
|
69
|
+
const contentStyles = computed(() => [...FormGroupContent, ...FormGroupContentDirections[props.direction]]);
|
|
70
|
+
return {
|
|
71
|
+
root,
|
|
72
|
+
rootStyles,
|
|
73
|
+
labelStyles,
|
|
74
|
+
contentStyles
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/* script */
|
|
80
|
+
const __vue_script__ = script;
|
|
81
|
+
|
|
82
|
+
/* template */
|
|
83
|
+
var __vue_render__ = function () {
|
|
84
|
+
var _vm = this;
|
|
85
|
+
var _h = _vm.$createElement;
|
|
86
|
+
var _c = _vm._self._c || _h;
|
|
87
|
+
return _c('div', {
|
|
88
|
+
ref: "root",
|
|
89
|
+
class: _vm.rootStyles
|
|
90
|
+
}, [_c('div', {
|
|
91
|
+
staticClass: "flex flex-row"
|
|
92
|
+
}, [_vm._t("label", function () {
|
|
93
|
+
return [_vm.label ? _c('OrLabel', {
|
|
94
|
+
class: _vm.labelStyles,
|
|
95
|
+
attrs: {
|
|
96
|
+
"required": _vm.required,
|
|
97
|
+
"disabled": _vm.disabled
|
|
98
|
+
},
|
|
99
|
+
scopedSlots: _vm._u([{
|
|
100
|
+
key: "addon",
|
|
101
|
+
fn: function () {
|
|
102
|
+
return [_vm._t("addon")];
|
|
103
|
+
},
|
|
104
|
+
proxy: true
|
|
105
|
+
}], null, true)
|
|
106
|
+
}, [_vm._v("\n " + _vm._s(_vm.label) + "\n\n ")]) : _vm._e()];
|
|
107
|
+
})], 2), _vm._v(" "), _c('div', {
|
|
108
|
+
class: _vm.contentStyles
|
|
109
|
+
}, [_vm._t("default")], 2), _vm._v(" "), _vm.hint && !_vm.error ? [_c('OrHint', {
|
|
110
|
+
attrs: {
|
|
111
|
+
"disabled": _vm.disabled
|
|
112
|
+
}
|
|
113
|
+
}, [_vm._v("\n " + _vm._s(_vm.hint) + "\n ")])] : _vm._e(), _vm._v(" "), typeof _vm.error === 'string' ? [_c('OrError', {
|
|
114
|
+
attrs: {
|
|
115
|
+
"disabled": _vm.disabled
|
|
116
|
+
}
|
|
117
|
+
}, [_vm._v("\n " + _vm._s(_vm.error) + "\n ")])] : _vm._e()], 2);
|
|
118
|
+
};
|
|
119
|
+
var __vue_staticRenderFns__ = [];
|
|
120
|
+
|
|
121
|
+
/* style */
|
|
122
|
+
const __vue_inject_styles__ = undefined;
|
|
123
|
+
/* scoped */
|
|
124
|
+
const __vue_scope_id__ = undefined;
|
|
125
|
+
/* module identifier */
|
|
126
|
+
const __vue_module_identifier__ = undefined;
|
|
127
|
+
/* functional template */
|
|
128
|
+
const __vue_is_functional_template__ = false;
|
|
129
|
+
/* style inject */
|
|
130
|
+
|
|
131
|
+
/* style inject SSR */
|
|
132
|
+
|
|
133
|
+
/* style inject shadow dom */
|
|
134
|
+
|
|
135
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
136
|
+
render: __vue_render__,
|
|
137
|
+
staticRenderFns: __vue_staticRenderFns__
|
|
138
|
+
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
139
|
+
|
|
140
|
+
export { FormGroupDirection as F, __vue_component__ as _ };
|
|
@@ -2,7 +2,7 @@ import { defineComponent, getCurrentInstance, ref, computed, onMounted, watch }
|
|
|
2
2
|
import { D as DropdownClose, a as DropdownOpen } from './dropdown-open-0d314aa4.js';
|
|
3
3
|
import { u as useOverflow } from './useOverflow-af6161c8.js';
|
|
4
4
|
import '@vueuse/core';
|
|
5
|
-
import { _ as __vue_component__$1 } from './OrCheckbox-
|
|
5
|
+
import { _ as __vue_component__$1 } from './OrCheckbox-e55228e5.js';
|
|
6
6
|
import { _ as __vue_component__$2 } from './OrError-4ffc1c39.js';
|
|
7
7
|
import { _ as __vue_component__$3 } from './OrExpansionPanel-7c359bb0.js';
|
|
8
8
|
import { _ as __vue_component__$4 } from './OrHint-aa221198.js';
|
|
@@ -13,7 +13,7 @@ export { _ as OrCardV3 } from '../OrCard-0da13cbe.js';
|
|
|
13
13
|
export { _ as OrCarousel } from '../OrCarousel-e0c2e387.js';
|
|
14
14
|
export { _ as OrCarouselItem } from '../OrCarouselItem-c614bab9.js';
|
|
15
15
|
export { _ as OrCheckbox } from '../OrCheckbox-7b98fc08.js';
|
|
16
|
-
export { _ as OrCheckboxV3 } from '../OrCheckbox-
|
|
16
|
+
export { _ as OrCheckboxV3 } from '../OrCheckbox-e55228e5.js';
|
|
17
17
|
export { _ as OrChip } from '../OrChip-8a1abfc5.js';
|
|
18
18
|
export { _ as OrChips } from '../OrChips-a01d8520.js';
|
|
19
19
|
export { _ as OrCode, O as OrCodeLanguages } from '../OrCode-e54e09f7.js';
|
|
@@ -71,7 +71,7 @@ export { _ as OrSearch } from '../OrSearch-620d5d76.js';
|
|
|
71
71
|
export { _ as OrSearchV3 } from '../OrSearch-a3038272.js';
|
|
72
72
|
export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from '../OrSegmentedControl-a1ea5b72.js';
|
|
73
73
|
export { _ as OrSelect } from '../OrSelect-d887118b.js';
|
|
74
|
-
export { _ as OrSelectV3 } from '../OrSelect-
|
|
74
|
+
export { _ as OrSelectV3 } from '../OrSelect-4031334e.js';
|
|
75
75
|
export { _ as OrSidebar, O as OrSidebarSide } from '../OrSidebar-feacf13a.js';
|
|
76
76
|
export { _ as OrSidebarV3 } from '../OrSidebar-26785a1e.js';
|
|
77
77
|
export { O as OrSidebarPlacement } from '../OrSidebarCollapseButton-9c424133.js';
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { PropType } from 'vue-demi';
|
|
2
|
+
import { FormGroupDirection } from '../or-form-group-v3';
|
|
3
|
+
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
|
+
proxyModelValue: import("@vue/composition-api").Ref<string[]> | import("@vue/composition-api").WritableComputedRef<string[]>;
|
|
5
|
+
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: PropType<string[]>;
|
|
8
|
+
default: () => never[];
|
|
9
|
+
};
|
|
10
|
+
label: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
error: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
hint: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
direction: {
|
|
23
|
+
type: PropType<FormGroupDirection>;
|
|
24
|
+
default: FormGroupDirection;
|
|
25
|
+
};
|
|
26
|
+
options: {
|
|
27
|
+
type: PropType<{
|
|
28
|
+
label: string;
|
|
29
|
+
value: any;
|
|
30
|
+
disabled?: boolean | undefined;
|
|
31
|
+
collapsible: boolean;
|
|
32
|
+
}[]>;
|
|
33
|
+
default: () => never[];
|
|
34
|
+
};
|
|
35
|
+
disabled: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: boolean;
|
|
38
|
+
};
|
|
39
|
+
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
40
|
+
modelValue: {
|
|
41
|
+
type: PropType<string[]>;
|
|
42
|
+
default: () => never[];
|
|
43
|
+
};
|
|
44
|
+
label: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
error: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
hint: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
direction: {
|
|
57
|
+
type: PropType<FormGroupDirection>;
|
|
58
|
+
default: FormGroupDirection;
|
|
59
|
+
};
|
|
60
|
+
options: {
|
|
61
|
+
type: PropType<{
|
|
62
|
+
label: string;
|
|
63
|
+
value: any;
|
|
64
|
+
disabled?: boolean | undefined;
|
|
65
|
+
collapsible: boolean;
|
|
66
|
+
}[]>;
|
|
67
|
+
default: () => never[];
|
|
68
|
+
};
|
|
69
|
+
disabled: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
73
|
+
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
74
|
+
modelValue: string[];
|
|
75
|
+
label: string;
|
|
76
|
+
error: string;
|
|
77
|
+
hint: string;
|
|
78
|
+
direction: FormGroupDirection;
|
|
79
|
+
options: {
|
|
80
|
+
label: string;
|
|
81
|
+
value: any;
|
|
82
|
+
disabled?: boolean | undefined;
|
|
83
|
+
collapsible: boolean;
|
|
84
|
+
}[];
|
|
85
|
+
disabled: boolean;
|
|
86
|
+
} & {}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
87
|
+
proxyModelValue: import("@vue/composition-api").Ref<string[]> | import("@vue/composition-api").WritableComputedRef<string[]>;
|
|
88
|
+
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, {}, {
|
|
89
|
+
modelValue: string[];
|
|
90
|
+
label: string;
|
|
91
|
+
error: string;
|
|
92
|
+
hint: string;
|
|
93
|
+
direction: FormGroupDirection;
|
|
94
|
+
options: {
|
|
95
|
+
label: string;
|
|
96
|
+
value: any;
|
|
97
|
+
disabled?: boolean | undefined;
|
|
98
|
+
collapsible: boolean;
|
|
99
|
+
}[];
|
|
100
|
+
disabled: boolean;
|
|
101
|
+
} & {}, {
|
|
102
|
+
modelValue: string[];
|
|
103
|
+
label: string;
|
|
104
|
+
error: string;
|
|
105
|
+
hint: string;
|
|
106
|
+
direction: FormGroupDirection;
|
|
107
|
+
options: {
|
|
108
|
+
label: string;
|
|
109
|
+
value: any;
|
|
110
|
+
disabled?: boolean | undefined;
|
|
111
|
+
collapsible: boolean;
|
|
112
|
+
}[];
|
|
113
|
+
disabled: boolean;
|
|
114
|
+
}, true>);
|
|
115
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OrCheckboxGroupV3 } from './OrCheckboxGroup.vue';
|