@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.
Files changed (150) hide show
  1. package/dist/bundled/v2/components/OrCheckboxGroupV3/OrCheckboxGroup.js +140 -0
  2. package/dist/bundled/v2/components/OrCheckboxGroupV3/OrCheckboxGroup.vue.d.ts +115 -0
  3. package/dist/bundled/v2/components/OrCheckboxGroupV3/index.d.ts +1 -0
  4. package/dist/bundled/v2/components/OrCheckboxGroupV3/index.js +25 -0
  5. package/dist/bundled/v2/components/OrCheckboxTreeV3/OrCheckboxTree.js +203 -0
  6. package/dist/bundled/v2/components/OrCheckboxTreeV3/OrCheckboxTree.vue.d.ts +76 -0
  7. package/dist/bundled/v2/components/OrCheckboxTreeV3/index.d.ts +1 -0
  8. package/dist/bundled/v2/components/OrCheckboxTreeV3/index.js +17 -0
  9. package/dist/bundled/v2/components/OrCheckboxTreeV3/styles.d.ts +2 -0
  10. package/dist/bundled/v2/components/OrCheckboxTreeV3/styles.js +10 -0
  11. package/dist/bundled/v2/components/OrCheckboxTreeV3/types.d.ts +7 -0
  12. package/dist/bundled/v2/components/OrCheckboxTreeV3/types.js +1 -0
  13. package/dist/bundled/v2/components/OrCheckboxV3/OrCheckbox.js +34 -39
  14. package/dist/bundled/v2/components/OrCheckboxV3/OrCheckbox.vue.d.ts +18 -16
  15. package/dist/bundled/v2/components/OrCheckboxV3/index.js +1 -0
  16. package/dist/bundled/v2/components/OrFormGroupV3/OrFormGroup.js +123 -0
  17. package/dist/bundled/v2/components/OrFormGroupV3/OrFormGroup.vue.d.ts +85 -0
  18. package/dist/bundled/v2/components/OrFormGroupV3/index.d.ts +2 -0
  19. package/dist/bundled/v2/components/OrFormGroupV3/index.js +12 -0
  20. package/dist/bundled/v2/components/OrFormGroupV3/props.d.ts +4 -0
  21. package/dist/bundled/v2/components/OrFormGroupV3/props.js +7 -0
  22. package/dist/bundled/v2/components/OrFormGroupV3/styles.d.ts +6 -0
  23. package/dist/bundled/v2/components/OrFormGroupV3/styles.js +20 -0
  24. package/dist/bundled/v2/components/OrRadioGroupV3/OrRadioGroup.js +132 -0
  25. package/dist/bundled/v2/components/OrRadioGroupV3/OrRadioGroup.vue.d.ts +110 -0
  26. package/dist/bundled/v2/components/OrRadioGroupV3/index.d.ts +1 -0
  27. package/dist/bundled/v2/components/OrRadioGroupV3/index.js +19 -0
  28. package/dist/bundled/v2/components/OrSelectV3/OrSelect.js +1 -1
  29. package/dist/bundled/v2/components/OrSelectV3/index.js +1 -1
  30. package/dist/bundled/v2/index.d.ts +1 -0
  31. package/dist/bundled/v2/index.js +4 -3
  32. package/dist/bundled/v2/utils/functions/flattenDeep.d.ts +2 -0
  33. package/dist/bundled/v2/utils/functions/flattenDeep.js +5 -0
  34. package/dist/bundled/v3/{OrCheckbox.vue_vue_type_script_lang-60cefcbd.js → OrCheckbox.vue_vue_type_script_lang-51a4f8d3.js} +26 -10
  35. package/dist/bundled/v3/OrCheckboxTree.vue_vue_type_script_lang-ffa313a0.js +102 -0
  36. package/dist/bundled/v3/OrFormGroup.vue_vue_type_script_lang-360b258b.js +60 -0
  37. package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-f7601423.js → OrSelect.vue_vue_type_script_lang-c0612348.js} +1 -1
  38. package/dist/bundled/v3/components/OrCheckboxGroupV3/OrCheckboxGroup.js +112 -0
  39. package/dist/bundled/v3/components/OrCheckboxGroupV3/OrCheckboxGroup.vue.d.ts +115 -0
  40. package/dist/bundled/v3/components/OrCheckboxGroupV3/index.d.ts +1 -0
  41. package/dist/bundled/v3/components/OrCheckboxGroupV3/index.js +32 -0
  42. package/dist/bundled/v3/components/OrCheckboxTreeV3/OrCheckboxTree.js +74 -0
  43. package/dist/bundled/v3/components/OrCheckboxTreeV3/OrCheckboxTree.vue.d.ts +76 -0
  44. package/dist/bundled/v3/components/OrCheckboxTreeV3/index.d.ts +1 -0
  45. package/dist/bundled/v3/components/OrCheckboxTreeV3/index.js +20 -0
  46. package/dist/bundled/v3/components/OrCheckboxTreeV3/styles.d.ts +2 -0
  47. package/dist/bundled/v3/components/OrCheckboxTreeV3/styles.js +10 -0
  48. package/dist/bundled/v3/components/OrCheckboxTreeV3/types.d.ts +7 -0
  49. package/dist/bundled/v3/components/OrCheckboxTreeV3/types.js +1 -0
  50. package/dist/bundled/v3/components/OrCheckboxV3/OrCheckbox.js +9 -7
  51. package/dist/bundled/v3/components/OrCheckboxV3/OrCheckbox.vue.d.ts +18 -16
  52. package/dist/bundled/v3/components/OrCheckboxV3/index.js +2 -1
  53. package/dist/bundled/v3/components/OrFormGroupV3/OrFormGroup.js +58 -0
  54. package/dist/bundled/v3/components/OrFormGroupV3/OrFormGroup.vue.d.ts +85 -0
  55. package/dist/bundled/v3/components/OrFormGroupV3/index.d.ts +2 -0
  56. package/dist/bundled/v3/components/OrFormGroupV3/index.js +15 -0
  57. package/dist/bundled/v3/components/OrFormGroupV3/props.d.ts +4 -0
  58. package/dist/bundled/v3/components/OrFormGroupV3/props.js +7 -0
  59. package/dist/bundled/v3/components/OrFormGroupV3/styles.d.ts +6 -0
  60. package/dist/bundled/v3/components/OrFormGroupV3/styles.js +20 -0
  61. package/dist/bundled/v3/components/OrRadioGroupV3/OrRadioGroup.js +104 -0
  62. package/dist/bundled/v3/components/OrRadioGroupV3/OrRadioGroup.vue.d.ts +110 -0
  63. package/dist/bundled/v3/components/OrRadioGroupV3/index.d.ts +1 -0
  64. package/dist/bundled/v3/components/OrRadioGroupV3/index.js +24 -0
  65. package/dist/bundled/v3/components/OrSelectV3/OrSelect.js +4 -4
  66. package/dist/bundled/v3/components/OrSelectV3/index.js +3 -3
  67. package/dist/bundled/v3/components/index.js +2 -2
  68. package/dist/bundled/v3/index.d.ts +1 -0
  69. package/dist/bundled/v3/index.js +7 -7
  70. package/dist/bundled/v3/utils/functions/flattenDeep.d.ts +2 -0
  71. package/dist/bundled/v3/utils/functions/flattenDeep.js +5 -0
  72. package/dist/esm/v2/{OrCheckbox-dc587ec9.js → OrCheckbox-e55228e5.js} +34 -40
  73. package/dist/esm/v2/OrCheckboxTree-00fd6cf9.js +202 -0
  74. package/dist/esm/v2/OrFormGroup-7a883bce.js +140 -0
  75. package/dist/esm/v2/{OrSelect-40183874.js → OrSelect-4031334e.js} +1 -1
  76. package/dist/esm/v2/components/index.js +2 -2
  77. package/dist/esm/v2/components/or-checkbox-group-v3/OrCheckboxGroup.vue.d.ts +115 -0
  78. package/dist/esm/v2/components/or-checkbox-group-v3/index.d.ts +1 -0
  79. package/dist/esm/v2/components/or-checkbox-group-v3/index.js +129 -0
  80. package/dist/esm/v2/components/or-checkbox-tree-v3/OrCheckboxTree.vue.d.ts +76 -0
  81. package/dist/esm/v2/components/or-checkbox-tree-v3/index.d.ts +1 -0
  82. package/dist/esm/v2/components/or-checkbox-tree-v3/index.js +10 -0
  83. package/dist/esm/v2/components/or-checkbox-tree-v3/styles.d.ts +2 -0
  84. package/dist/esm/v2/components/or-checkbox-tree-v3/types.d.ts +7 -0
  85. package/dist/esm/v2/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -16
  86. package/dist/esm/v2/components/or-checkbox-v3/index.js +2 -2
  87. package/dist/esm/v2/components/or-form-group-v3/OrFormGroup.vue.d.ts +85 -0
  88. package/dist/esm/v2/components/or-form-group-v3/index.d.ts +2 -0
  89. package/dist/esm/v2/components/or-form-group-v3/index.js +6 -0
  90. package/dist/esm/v2/components/or-form-group-v3/props.d.ts +4 -0
  91. package/dist/esm/v2/components/or-form-group-v3/styles.d.ts +6 -0
  92. package/dist/esm/v2/components/or-radio-group-v3/OrRadioGroup.vue.d.ts +110 -0
  93. package/dist/esm/v2/components/or-radio-group-v3/index.d.ts +1 -0
  94. package/dist/esm/v2/components/or-radio-group-v3/index.js +124 -0
  95. package/dist/esm/v2/components/or-select-v3/index.js +2 -2
  96. package/dist/esm/v2/flattenDeep-e7a8b995.js +5 -0
  97. package/dist/esm/v2/index.d.ts +1 -0
  98. package/dist/esm/v2/index.js +3 -2
  99. package/dist/esm/v2/utils/functions/flattenDeep.d.ts +2 -0
  100. package/dist/esm/v3/{OrCheckbox-56f849f7.js → OrCheckbox-eab735d0.js} +32 -16
  101. package/dist/esm/v3/OrCheckboxTree-8ead5a31.js +162 -0
  102. package/dist/esm/v3/OrFormGroup-d9255559.js +121 -0
  103. package/dist/esm/v3/{OrSelect-5502d82d.js → OrSelect-ebdab996.js} +1 -1
  104. package/dist/esm/v3/components/index.js +2 -2
  105. package/dist/esm/v3/components/or-checkbox-group-v3/OrCheckboxGroup.vue.d.ts +115 -0
  106. package/dist/esm/v3/components/or-checkbox-group-v3/index.d.ts +1 -0
  107. package/dist/esm/v3/components/or-checkbox-group-v3/index.js +94 -0
  108. package/dist/esm/v3/components/or-checkbox-tree-v3/OrCheckboxTree.vue.d.ts +76 -0
  109. package/dist/esm/v3/components/or-checkbox-tree-v3/index.d.ts +1 -0
  110. package/dist/esm/v3/components/or-checkbox-tree-v3/index.js +10 -0
  111. package/dist/esm/v3/components/or-checkbox-tree-v3/styles.d.ts +2 -0
  112. package/dist/esm/v3/components/or-checkbox-tree-v3/types.d.ts +7 -0
  113. package/dist/esm/v3/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -16
  114. package/dist/esm/v3/components/or-checkbox-v3/index.js +2 -2
  115. package/dist/esm/v3/components/or-form-group-v3/OrFormGroup.vue.d.ts +85 -0
  116. package/dist/esm/v3/components/or-form-group-v3/index.d.ts +2 -0
  117. package/dist/esm/v3/components/or-form-group-v3/index.js +6 -0
  118. package/dist/esm/v3/components/or-form-group-v3/props.d.ts +4 -0
  119. package/dist/esm/v3/components/or-form-group-v3/styles.d.ts +6 -0
  120. package/dist/esm/v3/components/or-radio-group-v3/OrRadioGroup.vue.d.ts +110 -0
  121. package/dist/esm/v3/components/or-radio-group-v3/index.d.ts +1 -0
  122. package/dist/esm/v3/components/or-radio-group-v3/index.js +91 -0
  123. package/dist/esm/v3/components/or-select-v3/index.js +2 -2
  124. package/dist/esm/v3/flattenDeep-e7a8b995.js +5 -0
  125. package/dist/esm/v3/index.d.ts +1 -0
  126. package/dist/esm/v3/index.js +3 -2
  127. package/dist/esm/v3/utils/functions/flattenDeep.d.ts +2 -0
  128. package/package.json +2 -3
  129. package/src/components/or-checkbox-group-v3/OrCheckboxGroup.docs.mdx +7 -0
  130. package/src/components/or-checkbox-group-v3/OrCheckboxGroup.stories3.ts +263 -0
  131. package/src/components/or-checkbox-group-v3/OrCheckboxGroup.vue +82 -0
  132. package/src/components/or-checkbox-group-v3/index.ts +1 -0
  133. package/src/components/or-checkbox-tree-v3/OrCheckboxTree.docs.mdx +7 -0
  134. package/src/components/or-checkbox-tree-v3/OrCheckboxTree.stories3.ts +112 -0
  135. package/src/components/or-checkbox-tree-v3/OrCheckboxTree.vue +168 -0
  136. package/src/components/or-checkbox-tree-v3/index.ts +1 -0
  137. package/src/components/or-checkbox-tree-v3/styles.ts +15 -0
  138. package/src/components/or-checkbox-tree-v3/types.ts +7 -0
  139. package/src/components/or-checkbox-v3/OrCheckbox.vue +30 -12
  140. package/src/components/or-form-group-v3/OrFormGroup.stories3.ts +114 -0
  141. package/src/components/or-form-group-v3/OrFormGroup.vue +114 -0
  142. package/src/components/or-form-group-v3/index.ts +2 -0
  143. package/src/components/or-form-group-v3/props.ts +4 -0
  144. package/src/components/or-form-group-v3/styles.ts +36 -0
  145. package/src/components/or-radio-group-v3/OrRadioGroup.stories3.ts +81 -0
  146. package/src/components/or-radio-group-v3/OrRadioGroup.vue +80 -0
  147. package/src/components/or-radio-group-v3/index.ts +1 -0
  148. package/src/components/or-radio-v3/OrRadio.stories3.ts +1 -1
  149. package/src/index.ts +1 -0
  150. package/src/utils/functions/flattenDeep.ts +5 -0
@@ -1,4 +1,5 @@
1
1
  import { defineComponent, ref, computed, reactive } from 'vue-demi';
2
+ import { useVModel } from '@vueuse/core';
2
3
  import { CheckboxRoot, CheckboxControl, CheckboxControlHandle } from './styles.js';
3
4
  import __vue_component__$1 from '../OrLabelV3/OrLabel.js';
4
5
  import { LabelVariant } from '../OrLabelV3/props.js';
@@ -19,12 +20,12 @@ var script = defineComponent({
19
20
  },
20
21
  props: {
21
22
  modelValue: {
22
- type: [Boolean, Array],
23
- default: undefined
23
+ type: null,
24
+ default: null
24
25
  },
25
26
  value: {
26
- type: String,
27
- default: undefined
27
+ type: [String, Boolean, Number],
28
+ default: null
28
29
  },
29
30
  label: {
30
31
  type: String,
@@ -49,7 +50,9 @@ var script = defineComponent({
49
50
  },
50
51
  emits: ['update:modelValue', 'focus', 'blur'],
51
52
  expose: ['root', 'focus', 'blur'],
52
- setup(props, context) {
53
+ setup(props, {
54
+ emit
55
+ }) {
53
56
  // Refs
54
57
  const root = ref();
55
58
  const control = ref();
@@ -61,13 +64,25 @@ var script = defineComponent({
61
64
  id: useIdAttribute(),
62
65
  ...useControlAttributes()
63
66
  });
64
- const proxyModelValue = computed({
65
- get: () => props.modelValue,
66
- set: value => {
67
- context.emit('update:modelValue', value);
67
+ const proxyModelValue = useVModel(props, 'modelValue', emit);
68
+ const isChecked = computed(() => {
69
+ if (Array.isArray(proxyModelValue.value)) {
70
+ return props.value && proxyModelValue.value.includes(props.value);
68
71
  }
72
+ return !!proxyModelValue.value;
69
73
  });
70
74
  // Methods
75
+ function handleChange() {
76
+ if (Array.isArray(proxyModelValue.value)) {
77
+ if (isChecked.value) {
78
+ proxyModelValue.value = proxyModelValue.value.filter(v => v !== props.value);
79
+ } else {
80
+ proxyModelValue.value = [...proxyModelValue.value, props.value];
81
+ }
82
+ } else {
83
+ proxyModelValue.value = !proxyModelValue.value;
84
+ }
85
+ }
71
86
  function focus() {
72
87
  var _a;
73
88
  (_a = control.value) === null || _a === void 0 ? void 0 : _a.focus();
@@ -82,14 +97,15 @@ var script = defineComponent({
82
97
  rootStyles,
83
98
  controlStyles,
84
99
  controlAttributes,
85
- proxyModelValue,
100
+ isChecked,
101
+ handleChange,
86
102
  focus,
87
103
  blur
88
104
  };
89
105
  }
90
106
  });
91
107
 
92
- var css_248z = "input[data-v-7f604760]{-webkit-appearance:none;-moz-appearance:none;appearance:none;line-height:0}";
108
+ var css_248z = "input[data-v-4d2215e4]{-webkit-appearance:none;-moz-appearance:none;appearance:none;line-height:0}";
93
109
  styleInject(css_248z);
94
110
 
95
111
  /* script */
@@ -103,49 +119,28 @@ var __vue_render__ = function () {
103
119
  ref: "root",
104
120
  class: _vm.rootStyles
105
121
  }, [_c('input', _vm._b({
106
- directives: [{
107
- name: "model",
108
- rawName: "v-model",
109
- value: _vm.proxyModelValue,
110
- expression: "proxyModelValue"
111
- }],
112
122
  ref: "control",
113
123
  class: _vm.controlStyles,
114
124
  attrs: {
125
+ "type": 'checkbox',
115
126
  "indeterminate": _vm.indeterminate,
116
127
  "required": _vm.required,
117
- "disabled": _vm.disabled,
118
- "type": "checkbox"
128
+ "disabled": _vm.disabled
119
129
  },
120
130
  domProps: {
121
- "value": _vm.value,
122
- "checked": Array.isArray(_vm.proxyModelValue) ? _vm._i(_vm.proxyModelValue, _vm.value) > -1 : _vm.proxyModelValue
131
+ "checked": _vm.isChecked,
132
+ "value": _vm.value
123
133
  },
124
134
  on: {
135
+ "change": _vm.handleChange,
125
136
  "focus": function ($event) {
126
137
  return _vm.$emit('focus', $event);
127
138
  },
128
139
  "blur": function ($event) {
129
140
  return _vm.$emit('blur', $event);
130
- },
131
- "change": function ($event) {
132
- var $$a = _vm.proxyModelValue,
133
- $$el = $event.target,
134
- $$c = $$el.checked ? true : false;
135
- if (Array.isArray($$a)) {
136
- var $$v = _vm.value,
137
- $$i = _vm._i($$a, $$v);
138
- if ($$el.checked) {
139
- $$i < 0 && (_vm.proxyModelValue = $$a.concat([$$v]));
140
- } else {
141
- $$i > -1 && (_vm.proxyModelValue = $$a.slice(0, $$i).concat($$a.slice($$i + 1)));
142
- }
143
- } else {
144
- _vm.proxyModelValue = $$c;
145
- }
146
141
  }
147
142
  }
148
- }, 'input', _vm.controlAttributes, false)) , _vm._v(" "), _vm.$slots.default || _vm.label ? [_c('OrLabel', {
143
+ }, 'input', _vm.controlAttributes, false)), _vm._v(" "), _vm.$slots.default || _vm.label ? [_c('OrLabel', {
149
144
  attrs: {
150
145
  "control-id": _vm.controlAttributes.id,
151
146
  "variant": _vm.labelVariant,
@@ -168,7 +163,7 @@ var __vue_staticRenderFns__ = [];
168
163
  /* style */
169
164
  const __vue_inject_styles__ = undefined;
170
165
  /* scoped */
171
- const __vue_scope_id__ = "data-v-7f604760";
166
+ const __vue_scope_id__ = "data-v-4d2215e4";
172
167
  /* module identifier */
173
168
  const __vue_module_identifier__ = undefined;
174
169
  /* functional template */
@@ -11,17 +11,18 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
11
11
  'force-state': string | undefined;
12
12
  id: string | undefined;
13
13
  };
14
- proxyModelValue: import("@vue/composition-api").WritableComputedRef<boolean | string[]>;
14
+ isChecked: import("@vue/composition-api").ComputedRef<boolean | "" | 0>;
15
+ handleChange: () => void;
15
16
  focus: () => void;
16
17
  blur: () => void;
17
18
  }> & import("@vue/composition-api").Data, {}, {}, {
18
19
  modelValue: {
19
- type: PropType<boolean | string[]>;
20
- default: undefined;
20
+ type: any;
21
+ default: null;
21
22
  };
22
23
  value: {
23
- type: StringConstructor;
24
- default: undefined;
24
+ type: PropType<string | number | boolean>;
25
+ default: null;
25
26
  };
26
27
  label: {
27
28
  type: StringConstructor;
@@ -45,12 +46,12 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
45
46
  };
46
47
  }, import("@vue/composition-api").ExtractPropTypes<{
47
48
  modelValue: {
48
- type: PropType<boolean | string[]>;
49
- default: undefined;
49
+ type: any;
50
+ default: null;
50
51
  };
51
52
  value: {
52
- type: StringConstructor;
53
- default: undefined;
53
+ type: PropType<string | number | boolean>;
54
+ default: null;
54
55
  };
55
56
  label: {
56
57
  type: StringConstructor;
@@ -73,8 +74,8 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
73
74
  default: boolean;
74
75
  };
75
76
  }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
76
- modelValue: boolean | string[];
77
- value: string;
77
+ modelValue: any;
78
+ value: string | number | boolean;
78
79
  label: string;
79
80
  labelVariant: LabelVariant;
80
81
  indeterminate: boolean;
@@ -93,12 +94,13 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
93
94
  'force-state': string | undefined;
94
95
  id: string | undefined;
95
96
  };
96
- proxyModelValue: import("@vue/composition-api").WritableComputedRef<boolean | string[]>;
97
+ isChecked: import("@vue/composition-api").ComputedRef<boolean | "" | 0>;
98
+ handleChange: () => void;
97
99
  focus: () => void;
98
100
  blur: () => void;
99
101
  }>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
100
- modelValue: boolean | string[];
101
- value: string;
102
+ modelValue: any;
103
+ value: string | number | boolean;
102
104
  label: string;
103
105
  labelVariant: LabelVariant;
104
106
  indeterminate: boolean;
@@ -107,8 +109,8 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
107
109
  } & {} & {
108
110
  [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
109
111
  }, {
110
- modelValue: boolean | string[];
111
- value: string;
112
+ modelValue: any;
113
+ value: string | number | boolean;
112
114
  label: string;
113
115
  labelVariant: LabelVariant;
114
116
  indeterminate: boolean;
@@ -1,5 +1,6 @@
1
1
  export { default as OrCheckboxV3 } from './OrCheckbox.js';
2
2
  import 'vue-demi';
3
+ import '@vueuse/core';
3
4
  import './styles.js';
4
5
  import '../OrLabelV3/OrLabel.js';
5
6
  import '../OrLabelV3/props.js';
@@ -0,0 +1,123 @@
1
+ import { defineComponent, ref, computed } from 'vue-demi';
2
+ import { FormGroupDirection } from './props.js';
3
+ import { FormGroupRoot, FormGroupLabel, FormGroupLabelError, FormGroupContent, FormGroupContentDirections } from './styles.js';
4
+ import __vue_component__$1 from '../OrLabelV3/OrLabel.js';
5
+ import __vue_component__$2 from '../OrErrorV3/OrError.js';
6
+ import __vue_component__$3 from '../OrHintV3/OrHint.js';
7
+ import { n as normalizeComponent } from '../../normalize-component-6e8e3d80.js';
8
+ import '../OrLabelV3/props.js';
9
+ import '../OrLabelV3/styles.js';
10
+ import '../OrErrorV3/styles.js';
11
+ import '../OrHintV3/styles.js';
12
+
13
+ var script = defineComponent({
14
+ name: 'OrFormGroupV3',
15
+ components: {
16
+ OrLabel: __vue_component__$1,
17
+ OrError: __vue_component__$2,
18
+ OrHint: __vue_component__$3
19
+ },
20
+ props: {
21
+ label: {
22
+ type: String,
23
+ default: undefined
24
+ },
25
+ required: {
26
+ type: Boolean,
27
+ default: false
28
+ },
29
+ disabled: {
30
+ type: Boolean,
31
+ default: false
32
+ },
33
+ direction: {
34
+ type: String,
35
+ default: FormGroupDirection.Vertical
36
+ },
37
+ error: {
38
+ type: [String, Boolean],
39
+ default: undefined
40
+ },
41
+ hint: {
42
+ type: String,
43
+ default: undefined
44
+ }
45
+ },
46
+ setup(props) {
47
+ // Refs
48
+ const root = ref();
49
+ // Styles
50
+ const rootStyles = computed(() => ['or-form-group-v3', ...FormGroupRoot]);
51
+ const labelStyles = computed(() => [...FormGroupLabel, ...(props.error ? FormGroupLabelError : [])]);
52
+ const contentStyles = computed(() => [...FormGroupContent, ...FormGroupContentDirections[props.direction]]);
53
+ return {
54
+ root,
55
+ rootStyles,
56
+ labelStyles,
57
+ contentStyles
58
+ };
59
+ }
60
+ });
61
+
62
+ /* script */
63
+ const __vue_script__ = script;
64
+
65
+ /* template */
66
+ var __vue_render__ = function () {
67
+ var _vm = this;
68
+ var _h = _vm.$createElement;
69
+ var _c = _vm._self._c || _h;
70
+ return _c('div', {
71
+ ref: "root",
72
+ class: _vm.rootStyles
73
+ }, [_c('div', {
74
+ staticClass: "flex flex-row"
75
+ }, [_vm._t("label", function () {
76
+ return [_vm.label ? _c('OrLabel', {
77
+ class: _vm.labelStyles,
78
+ attrs: {
79
+ "required": _vm.required,
80
+ "disabled": _vm.disabled
81
+ },
82
+ scopedSlots: _vm._u([{
83
+ key: "addon",
84
+ fn: function () {
85
+ return [_vm._t("addon")];
86
+ },
87
+ proxy: true
88
+ }], null, true)
89
+ }, [_vm._v("\n " + _vm._s(_vm.label) + "\n\n ")]) : _vm._e()];
90
+ })], 2), _vm._v(" "), _c('div', {
91
+ class: _vm.contentStyles
92
+ }, [_vm._t("default")], 2), _vm._v(" "), _vm.hint && !_vm.error ? [_c('OrHint', {
93
+ attrs: {
94
+ "disabled": _vm.disabled
95
+ }
96
+ }, [_vm._v("\n " + _vm._s(_vm.hint) + "\n ")])] : _vm._e(), _vm._v(" "), typeof _vm.error === 'string' ? [_c('OrError', {
97
+ attrs: {
98
+ "disabled": _vm.disabled
99
+ }
100
+ }, [_vm._v("\n " + _vm._s(_vm.error) + "\n ")])] : _vm._e()], 2);
101
+ };
102
+ var __vue_staticRenderFns__ = [];
103
+
104
+ /* style */
105
+ const __vue_inject_styles__ = undefined;
106
+ /* scoped */
107
+ const __vue_scope_id__ = undefined;
108
+ /* module identifier */
109
+ const __vue_module_identifier__ = undefined;
110
+ /* functional template */
111
+ const __vue_is_functional_template__ = false;
112
+ /* style inject */
113
+
114
+ /* style inject SSR */
115
+
116
+ /* style inject shadow dom */
117
+
118
+ const __vue_component__ = /*#__PURE__*/normalizeComponent({
119
+ render: __vue_render__,
120
+ staticRenderFns: __vue_staticRenderFns__
121
+ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
122
+
123
+ export { __vue_component__ as default };
@@ -0,0 +1,85 @@
1
+ import { PropType } from 'vue-demi';
2
+ import { FormGroupDirection } from './props';
3
+ declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
4
+ root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
5
+ rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
6
+ labelStyles: import("@vue/composition-api").ComputedRef<string[]>;
7
+ contentStyles: import("@vue/composition-api").ComputedRef<string[]>;
8
+ }> & import("@vue/composition-api").Data, {}, {}, {
9
+ label: {
10
+ type: StringConstructor;
11
+ default: undefined;
12
+ };
13
+ required: {
14
+ type: BooleanConstructor;
15
+ default: boolean;
16
+ };
17
+ disabled: {
18
+ type: BooleanConstructor;
19
+ default: boolean;
20
+ };
21
+ direction: {
22
+ type: PropType<FormGroupDirection>;
23
+ default: FormGroupDirection;
24
+ };
25
+ error: {
26
+ type: (BooleanConstructor | StringConstructor)[];
27
+ default: undefined;
28
+ };
29
+ hint: {
30
+ type: StringConstructor;
31
+ default: undefined;
32
+ };
33
+ }, import("@vue/composition-api").ExtractPropTypes<{
34
+ label: {
35
+ type: StringConstructor;
36
+ default: undefined;
37
+ };
38
+ required: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
42
+ disabled: {
43
+ type: BooleanConstructor;
44
+ default: boolean;
45
+ };
46
+ direction: {
47
+ type: PropType<FormGroupDirection>;
48
+ default: FormGroupDirection;
49
+ };
50
+ error: {
51
+ type: (BooleanConstructor | StringConstructor)[];
52
+ default: undefined;
53
+ };
54
+ hint: {
55
+ type: StringConstructor;
56
+ default: undefined;
57
+ };
58
+ }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
59
+ label: string;
60
+ required: boolean;
61
+ disabled: boolean;
62
+ direction: FormGroupDirection;
63
+ error: string | boolean;
64
+ hint: string;
65
+ } & {}, import("@vue/composition-api").ShallowUnwrapRef<{
66
+ root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
67
+ rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
68
+ labelStyles: import("@vue/composition-api").ComputedRef<string[]>;
69
+ contentStyles: import("@vue/composition-api").ComputedRef<string[]>;
70
+ }>, import("@vue/composition-api").Data, {}, {}, {}, {}, {}, {
71
+ label: string;
72
+ required: boolean;
73
+ disabled: boolean;
74
+ direction: FormGroupDirection;
75
+ error: string | boolean;
76
+ hint: string;
77
+ } & {}, {
78
+ label: string;
79
+ required: boolean;
80
+ disabled: boolean;
81
+ direction: FormGroupDirection;
82
+ error: string | boolean;
83
+ hint: string;
84
+ }, true>);
85
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as OrFormGroupV3 } from './OrFormGroup.vue';
2
+ export * from './props';
@@ -0,0 +1,12 @@
1
+ export { default as OrFormGroupV3 } from './OrFormGroup.js';
2
+ export { FormGroupDirection } from './props.js';
3
+ import 'vue-demi';
4
+ import './styles.js';
5
+ import '../OrLabelV3/OrLabel.js';
6
+ import '../OrLabelV3/props.js';
7
+ import '../OrLabelV3/styles.js';
8
+ import '../../normalize-component-6e8e3d80.js';
9
+ import '../OrErrorV3/OrError.js';
10
+ import '../OrErrorV3/styles.js';
11
+ import '../OrHintV3/OrHint.js';
12
+ import '../OrHintV3/styles.js';
@@ -0,0 +1,4 @@
1
+ export declare enum FormGroupDirection {
2
+ Vertical = "vertical",
3
+ Horizontal = "horizontal"
4
+ }
@@ -0,0 +1,7 @@
1
+ var FormGroupDirection;
2
+ (function (FormGroupDirection) {
3
+ FormGroupDirection["Vertical"] = "vertical";
4
+ FormGroupDirection["Horizontal"] = "horizontal";
5
+ })(FormGroupDirection || (FormGroupDirection = {}));
6
+
7
+ export { FormGroupDirection };
@@ -0,0 +1,6 @@
1
+ import { FormGroupDirection } from './props';
2
+ export declare const FormGroupRoot: string[];
3
+ export declare const FormGroupContent: string[];
4
+ export declare const FormGroupLabel: string[];
5
+ export declare const FormGroupLabelError: string[];
6
+ export declare const FormGroupContentDirections: Record<FormGroupDirection, string[]>;
@@ -0,0 +1,20 @@
1
+ import { FormGroupDirection } from './props.js';
2
+
3
+ const FormGroupRoot = [
4
+ // Layout
5
+ 'flex', 'flex-col', 'gap-md md:gap-sm'];
6
+ const FormGroupContent = [
7
+ // Layout
8
+ 'flex', 'pl-[10px] md:pl-[0]', 'gap-md md:gap-sm'];
9
+ const FormGroupLabel = [
10
+ // Typography
11
+ '!typography-body-2-regular', '!theme-foreground dark:!theme-foreground-dark'];
12
+ const FormGroupLabelError = [
13
+ // Typography
14
+ '!theme-foreground-error dark:!theme-foreground-error-dark'];
15
+ const FormGroupContentDirections = {
16
+ [FormGroupDirection.Vertical]: ['flex-col', 'gap-sm'],
17
+ [FormGroupDirection.Horizontal]: ['flex-row', 'gap-[18px] md:gap-md']
18
+ };
19
+
20
+ export { FormGroupContent, FormGroupContentDirections, FormGroupLabel, FormGroupLabelError, FormGroupRoot };
@@ -0,0 +1,132 @@
1
+ import { defineComponent } from 'vue-demi';
2
+ import { useVModel } from '@vueuse/core';
3
+ import __vue_component__$1 from '../OrFormGroupV3/OrFormGroup.js';
4
+ import __vue_component__$2 from '../OrRadioV3/OrRadio.js';
5
+ import { n as normalizeComponent } from '../../normalize-component-6e8e3d80.js';
6
+ import '../OrFormGroupV3/props.js';
7
+ import '../OrFormGroupV3/styles.js';
8
+ import '../OrLabelV3/OrLabel.js';
9
+ import '../OrLabelV3/props.js';
10
+ import '../OrLabelV3/styles.js';
11
+ import '../OrErrorV3/OrError.js';
12
+ import '../OrErrorV3/styles.js';
13
+ import '../OrHintV3/OrHint.js';
14
+ import '../OrHintV3/styles.js';
15
+ import '../OrRadioV3/styles.js';
16
+ import '../../hooks/useIdAttribute.js';
17
+ import '../../hooks/useControlAttributes.js';
18
+ import '../../style-inject.es-4c6f2515.js';
19
+
20
+ var script = defineComponent({
21
+ name: 'OrRadioGroup',
22
+ components: {
23
+ OrFormGroup: __vue_component__$1,
24
+ OrRadio: __vue_component__$2
25
+ },
26
+ model: {
27
+ prop: 'modelValue',
28
+ event: 'update:modelValue'
29
+ },
30
+ props: {
31
+ modelValue: {
32
+ type: null,
33
+ default: null
34
+ },
35
+ direction: {
36
+ type: String,
37
+ default: 'vertical'
38
+ },
39
+ label: {
40
+ type: String,
41
+ default: ''
42
+ },
43
+ options: {
44
+ type: Array,
45
+ default: () => []
46
+ },
47
+ error: {
48
+ type: String,
49
+ default: ''
50
+ },
51
+ hint: {
52
+ type: String,
53
+ default: ''
54
+ },
55
+ disabled: {
56
+ type: Boolean,
57
+ default: false
58
+ }
59
+ },
60
+ setup(props, {
61
+ emit
62
+ }) {
63
+ const proxyModelValue = useVModel(props, 'modelValue', emit);
64
+ return {
65
+ proxyModelValue
66
+ };
67
+ }
68
+ });
69
+
70
+ /* script */
71
+ const __vue_script__ = script;
72
+
73
+ /* template */
74
+ var __vue_render__ = function () {
75
+ var _vm = this;
76
+ var _h = _vm.$createElement;
77
+ var _c = _vm._self._c || _h;
78
+ return _c('OrFormGroup', {
79
+ attrs: {
80
+ "direction": _vm.direction,
81
+ "label": _vm.label,
82
+ "error": _vm.error,
83
+ "hint": _vm.hint,
84
+ "disabled": _vm.disabled
85
+ },
86
+ scopedSlots: _vm._u([{
87
+ key: "addon",
88
+ fn: function () {
89
+ return [_vm._t("addon")];
90
+ },
91
+ proxy: true
92
+ }], null, true)
93
+ }, [_vm._v(" "), _vm._l(_vm.options, function (option) {
94
+ return _c('OrRadio', {
95
+ key: option.value,
96
+ attrs: {
97
+ "label": option.label,
98
+ "value": option.value,
99
+ "disabled": _vm.disabled || option.disabled
100
+ },
101
+ model: {
102
+ value: _vm.proxyModelValue,
103
+ callback: function ($$v) {
104
+ _vm.proxyModelValue = $$v;
105
+ },
106
+ expression: "proxyModelValue"
107
+ }
108
+ });
109
+ })], 2);
110
+ };
111
+ var __vue_staticRenderFns__ = [];
112
+
113
+ /* style */
114
+ const __vue_inject_styles__ = undefined;
115
+ /* scoped */
116
+ const __vue_scope_id__ = undefined;
117
+ /* module identifier */
118
+ const __vue_module_identifier__ = undefined;
119
+ /* functional template */
120
+ const __vue_is_functional_template__ = false;
121
+ /* style inject */
122
+
123
+ /* style inject SSR */
124
+
125
+ /* style inject shadow dom */
126
+
127
+ const __vue_component__ = /*#__PURE__*/normalizeComponent({
128
+ render: __vue_render__,
129
+ staticRenderFns: __vue_staticRenderFns__
130
+ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
131
+
132
+ export { __vue_component__ as default };