@onereach/ui-components-vue2 26.15.1 → 26.15.2-beta.6065.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.
@@ -11,10 +11,10 @@ import '../../utils-72d9c2bb.js';
11
11
  import '../or-icon-v3/index.js';
12
12
  import '../or-checkbox-v3/index.js';
13
13
  import '../or-label-v3/index.js';
14
+ import '../or-loader-v3/index.js';
14
15
  import '../or-button-v3/index.js';
15
16
  import '../../constants-2e3ea701.js';
16
17
  import '../../props-bba3dca8.js';
17
- import '../or-loader-v3/index.js';
18
18
  import '../or-error-v3/index.js';
19
19
  import '../or-hint-v3/index.js';
20
20
 
@@ -10,9 +10,9 @@ import '../../dom-qGGG2YCX-4d4cca6e.js';
10
10
  import '@onereach/styles/screens.json';
11
11
  import '@onereach/styles/tailwind.config.json';
12
12
  import '../or-label-v3/index.js';
13
+ import '../or-loader-v3/index.js';
13
14
  import '../../constants-2e3ea701.js';
14
15
  import '../../props-bba3dca8.js';
15
- import '../or-loader-v3/index.js';
16
16
 
17
17
  const CheckboxTreeRoot = [
18
18
  // Layout
@@ -74,6 +74,10 @@ var script = defineComponent({
74
74
  expanded: {
75
75
  type: Boolean,
76
76
  default: true
77
+ },
78
+ loading: {
79
+ type: Boolean,
80
+ default: false
77
81
  }
78
82
  },
79
83
  emits: ['update:modelValue'],
@@ -90,19 +94,16 @@ var script = defineComponent({
90
94
  return hasChildren.value ? extractChildrenValues(children.value) : [];
91
95
  });
92
96
  const proxyModelValue = ne(modelValue, context.emit);
97
+ const localLoading = computed(() => Boolean(props.loading || item.value.loading));
93
98
  const isAnyChildrenSelected = computed(() => {
94
99
  var _a;
95
- return (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.some(value => {
96
- var _a;
97
- return (_a = childrenValues.value) === null || _a === void 0 ? void 0 : _a.includes(value);
98
- });
100
+ return (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.some(value => childrenValues.value.includes(value));
99
101
  });
100
102
  const isAllChildrenSelected = computed(() => {
101
- var _a;
102
- return childrenValues.value.length > 0 && ((_a = childrenValues.value) === null || _a === void 0 ? void 0 : _a.every(value => {
103
+ return childrenValues.value.length > 0 && childrenValues.value.every(value => {
103
104
  var _a;
104
105
  return (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.includes(value);
105
- }));
106
+ });
106
107
  });
107
108
  const isIntermediate = computed(() => {
108
109
  return isAnyChildrenSelected.value && !isAllChildrenSelected.value;
@@ -120,7 +121,9 @@ var script = defineComponent({
120
121
  // Methods
121
122
  const handleParentClick = () => {
122
123
  if (isAllChildrenSelected.value) {
123
- proxyModelValue.value = proxyModelValue.value.filter(value => !childrenValues.value.includes(value));
124
+ proxyModelValue.value = proxyModelValue.value.filter(value => {
125
+ return !childrenValues.value.includes(value);
126
+ });
124
127
  } else {
125
128
  proxyModelValue.value = [...new Set([...proxyModelValue.value, ...childrenValues.value])];
126
129
  }
@@ -130,6 +133,7 @@ var script = defineComponent({
130
133
  parentStyles,
131
134
  hasChildren,
132
135
  proxyModelValue,
136
+ localLoading,
133
137
  isOpen,
134
138
  setIsOpen,
135
139
  isIntermediate,
@@ -175,6 +179,7 @@ var __vue_render__ = function () {
175
179
  "model-value": _vm.isAllChildrenSelected,
176
180
  "value": true,
177
181
  "indeterminate": _vm.isIntermediate,
182
+ "loading": _vm.localLoading,
178
183
  "disabled": _vm.disabled,
179
184
  "readonly": _vm.readonly
180
185
  },
@@ -195,17 +200,18 @@ var __vue_render__ = function () {
195
200
  "item": child,
196
201
  "collapsible": child.collapsible,
197
202
  "expanded": child.expanded,
203
+ "loading": _vm.localLoading,
198
204
  "disabled": _vm.disabled || child.disabled,
199
205
  "readonly": _vm.readonly || child.readonly
200
206
  },
201
207
  scopedSlots: _vm._u([{
202
208
  key: "checkboxLabel",
203
209
  fn: function (ref) {
204
- var item = ref.item;
210
+ var checkboxItem = ref.item;
205
211
  return [_vm._t("checkboxLabel", function () {
206
- return [_vm._v("\n " + _vm._s(item.label) + "\n ")];
212
+ return [_vm._v("\n " + _vm._s(checkboxItem.label) + "\n ")];
207
213
  }, {
208
- "item": item
214
+ "item": checkboxItem
209
215
  })];
210
216
  }
211
217
  }], null, true),
@@ -220,6 +226,7 @@ var __vue_render__ = function () {
220
226
  }), 1) : _vm._e()] : [_c('OrCheckbox', {
221
227
  attrs: {
222
228
  "value": _vm.item.value,
229
+ "loading": _vm.localLoading,
223
230
  "disabled": _vm.disabled || _vm.item.disabled,
224
231
  "readonly": _vm.readonly || _vm.item.readonly
225
232
  },
@@ -5,5 +5,7 @@ export type CheckboxTreeNode = {
5
5
  collapsible?: boolean;
6
6
  disabled?: boolean;
7
7
  expanded?: boolean;
8
+ loading?: boolean;
8
9
  readonly?: boolean;
9
10
  };
11
+ export type CheckboxTreeValue = string | CheckboxTreeValue[] | undefined;
@@ -1,2 +1,2 @@
1
1
  import { CheckboxTreeNode } from '../types';
2
- export declare function extractChildrenValues(children: CheckboxTreeNode[]): any[];
2
+ export declare function extractChildrenValues(children: CheckboxTreeNode[]): string[];
@@ -2,6 +2,7 @@ import { J, V, n as ne } from '../../useValidationAttributes-Da9U8-T7-fd6d5d7d.j
2
2
  import { aa as c, aj as i, a8 as Ht, P as Pt } from '../../utils-72d9c2bb.js';
3
3
  import { defineComponent, reactive, ref, computed, toRef } from 'vue-demi';
4
4
  import { OrLabelV3 as OrLabel, LabelVariant } from '../or-label-v3/index.js';
5
+ import { OrLoaderV3 as OrLoader } from '../or-loader-v3/index.js';
5
6
  import { n as normalizeComponent } from '../../normalize-component-cf2db48b.js';
6
7
  import '../../dom-qGGG2YCX-4d4cca6e.js';
7
8
  import '@vueuse/core';
@@ -43,11 +44,19 @@ const CheckboxControlHandle = [
43
44
  'after:checked:content-checkbox-checked',
44
45
  // Content (indeterminate / children)
45
46
  'after:indeterminate:content-checkbox-indeterminate'];
47
+ const CheckboxLoader = [
48
+ // Layout
49
+ 'layout-inline-row justify-center',
50
+ // Shape
51
+ 'rounded-sm',
52
+ // Box
53
+ 'w-md+ md:w-md', 'h-md+ md:h-md', 'm-[10px] md:m-none'];
46
54
 
47
55
  var script = defineComponent({
48
56
  name: 'OrCheckbox',
49
57
  components: {
50
- OrLabel
58
+ OrLabel,
59
+ OrLoader
51
60
  },
52
61
  model: {
53
62
  prop: 'modelValue',
@@ -74,6 +83,10 @@ var script = defineComponent({
74
83
  type: Boolean,
75
84
  default: false
76
85
  },
86
+ loading: {
87
+ type: Boolean,
88
+ default: false
89
+ },
77
90
  required: {
78
91
  type: Boolean,
79
92
  default: false
@@ -99,6 +112,7 @@ var script = defineComponent({
99
112
  const rootStyles = computed(() => ['or-checkbox-v3', ...Checkbox]);
100
113
  const control = ref();
101
114
  const controlStyles = computed(() => [...CheckboxControl, ...CheckboxControlHandle]);
115
+ const loaderStyles = computed(() => [...CheckboxLoader]);
102
116
  // State
103
117
  const model = ne(toRef(props, 'modelValue'), context.emit);
104
118
  const checked = computed(() => {
@@ -140,6 +154,7 @@ var script = defineComponent({
140
154
  rootStyles,
141
155
  control,
142
156
  controlStyles,
157
+ loaderStyles,
143
158
  checked,
144
159
  onChange,
145
160
  focus,
@@ -159,7 +174,7 @@ var __vue_render__ = function () {
159
174
  return _c('div', {
160
175
  ref: 'root',
161
176
  class: _vm.rootStyles
162
- }, [_c('input', _vm._b({
177
+ }, [!_vm.loading ? [_c('input', _vm._b({
163
178
  ref: 'control',
164
179
  class: _vm.controlStyles,
165
180
  attrs: {
@@ -187,7 +202,18 @@ var __vue_render__ = function () {
187
202
  return _vm.$emit('blur', $event);
188
203
  }
189
204
  }
190
- }, 'input', _vm.attributes, false)), _vm._v(" "), _vm.$slots.default || _vm.label ? [_c('OrLabel', {
205
+ }, 'input', _vm.attributes, false))] : [_c('div', {
206
+ class: _vm.loaderStyles,
207
+ attrs: {
208
+ "aria-busy": 'true'
209
+ }
210
+ }, [_c('OrLoader', {
211
+ attrs: {
212
+ "variant": 'circular',
213
+ "color": 'primary',
214
+ "size": 's'
215
+ }
216
+ })], 1)], _vm._v(" "), _vm.$slots.default || _vm.label ? [_c('OrLabel', {
191
217
  attrs: {
192
218
  "control-id": _vm.attributes.id,
193
219
  "variant": _vm.labelVariant,
@@ -1,3 +1,4 @@
1
1
  export declare const Checkbox: string[];
2
2
  export declare const CheckboxControl: string[];
3
3
  export declare const CheckboxControlHandle: string[];
4
+ export declare const CheckboxLoader: string[];
@@ -23,13 +23,13 @@ import '../../useValidationAttributes-Da9U8-T7-fd6d5d7d.js';
23
23
  import '@onereach/styles/screens.json';
24
24
  import '@onereach/styles/tailwind.config.json';
25
25
  import '../or-label-v3/index.js';
26
+ import '../or-loader-v3/index.js';
26
27
  import '../../directives-0869d2a4.js';
27
28
  import '../../OrDateTimePickerMonthSelect-1bf6ca3b.js';
28
29
  import '../../formatDate-0536a8d5.js';
29
30
  import '../or-button-v3/index.js';
30
31
  import '../../constants-2e3ea701.js';
31
32
  import '../../props-bba3dca8.js';
32
- import '../or-loader-v3/index.js';
33
33
  import '../or-menu-v3/index.js';
34
34
  import '../or-popover-v3/index.js';
35
35
  import '@floating-ui/dom';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components-vue2",
3
- "version": "26.15.1",
3
+ "version": "26.15.2-beta.6065.0",
4
4
  "description": "Vue components library for v2",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -40,8 +40,8 @@
40
40
  "@codemirror/view": "^6",
41
41
  "@floating-ui/dom": "1.7.6",
42
42
  "@lezer/highlight": "*",
43
- "@onereach/styles": "^26.15.1",
44
- "@onereach/ui-components-common": "^26.15.1",
43
+ "@onereach/styles": "^26.15.2-beta.6065.0",
44
+ "@onereach/ui-components-common": "^26.15.2-beta.6065.0",
45
45
  "@splidejs/splide": "4.0.6",
46
46
  "@tiptap/core": "2.27.1",
47
47
  "@tiptap/extension-blockquote": "2.27.1",
@@ -102,6 +102,5 @@
102
102
  "publishConfig": {
103
103
  "access": "public"
104
104
  },
105
- "npmUnpacked": "4.15.2",
106
- "gitHead": "873827cb9be68728ee4ed6f4f296749108881a83"
105
+ "npmUnpacked": "4.15.2"
107
106
  }