@onereach/ui-components 2.70.1 → 2.70.2-beta.2199.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 (185) hide show
  1. package/dist/bundled/v2/{OrCardCollection-0141a358.js → OrCardCollection-1bb83cfb.js} +1 -1
  2. package/dist/bundled/v2/{OrCheckbox-dbef9f9a.js → OrCheckbox-251ecafc.js} +32 -17
  3. package/dist/bundled/v2/{OrConfirm-23c3ce56.js → OrConfirm-4cae7867.js} +1 -1
  4. package/dist/bundled/v2/{OrInlineInput-87589946.js → OrInlineInput-2133e469.js} +38 -22
  5. package/dist/bundled/v2/{OrInlineTextarea-21b0e6fc.js → OrInlineTextarea-d61ca596.js} +34 -18
  6. package/dist/bundled/v2/{OrInput-82ccfe00.js → OrInput-770f1bed.js} +38 -30
  7. package/dist/bundled/v2/{OrPagination-379c10b8.js → OrPagination-468d0964.js} +1 -1
  8. package/dist/bundled/v2/{OrRadio-cd39b20b.js → OrRadio-ae89bc9b.js} +30 -15
  9. package/dist/bundled/v2/{OrSearch-53470b0e.js → OrSearch-2e5f9e24.js} +1 -1
  10. package/dist/bundled/v2/{OrSelect-c49e1bcf.js → OrSelect-039c0711.js} +2 -2
  11. package/dist/bundled/v2/{OrSwitch-237a2081.js → OrSwitch-20640a05.js} +30 -15
  12. package/dist/bundled/v2/{OrTabs-42f7c52c.js → OrTabs-85aefcba.js} +1 -1
  13. package/dist/bundled/v2/{OrTextarea-5593fbe9.js → OrTextarea-0ff8063b.js} +39 -20
  14. package/dist/bundled/v2/components/index.js +15 -13
  15. package/dist/bundled/v2/components/or-card-collection-v3/index.js +5 -3
  16. package/dist/bundled/v2/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -2
  17. package/dist/bundled/v2/components/or-checkbox-v3/index.js +2 -1
  18. package/dist/bundled/v2/components/or-confirm-v3/index.js +4 -2
  19. package/dist/bundled/v2/components/or-inline-input-v3/OrInlineInput.vue.d.ts +36 -6
  20. package/dist/bundled/v2/components/or-inline-input-v3/index.js +3 -1
  21. package/dist/bundled/v2/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +36 -6
  22. package/dist/bundled/v2/components/or-inline-textarea-v3/index.js +3 -1
  23. package/dist/bundled/v2/components/or-input-v3/OrInput.vue.d.ts +43 -8
  24. package/dist/bundled/v2/components/or-input-v3/index.js +3 -1
  25. package/dist/bundled/v2/components/or-pagination-v3/index.js +1 -1
  26. package/dist/bundled/v2/components/or-radio-v3/OrRadio.vue.d.ts +18 -2
  27. package/dist/bundled/v2/components/or-radio-v3/index.js +2 -1
  28. package/dist/bundled/v2/components/or-search-v3/index.js +4 -2
  29. package/dist/bundled/v2/components/or-select-v3/index.js +5 -3
  30. package/dist/bundled/v2/components/or-switch-v3/OrSwitch.vue.d.ts +18 -2
  31. package/dist/bundled/v2/components/or-switch-v3/index.js +2 -1
  32. package/dist/bundled/v2/components/or-tabs-v3/index.js +1 -1
  33. package/dist/bundled/v2/components/or-textarea-v3/OrTextarea.vue.d.ts +45 -6
  34. package/dist/bundled/v2/components/or-textarea-v3/index.js +3 -1
  35. package/dist/bundled/v2/hooks/index.d.ts +3 -0
  36. package/dist/bundled/v2/hooks/index.js +2 -0
  37. package/dist/bundled/v2/hooks/useControlAttributes.d.ts +8 -0
  38. package/dist/bundled/v2/hooks/useIdAttribute.d.ts +2 -0
  39. package/dist/bundled/v2/hooks/useValidationAttributes.d.ts +12 -0
  40. package/dist/bundled/v2/index.js +15 -13
  41. package/dist/bundled/v2/useIdAttribute-cf61643f.js +22 -0
  42. package/dist/bundled/v2/useValidationAttributes-6df7bcf9.js +17 -0
  43. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-2d78a51a.js → OrCardCollection.vue_vue_type_script_lang-a0f29a55.js} +1 -1
  44. package/dist/bundled/v3/{OrCheckbox.vue_vue_type_script_lang-8b36e06c.js → OrCheckbox.vue_vue_type_script_lang-2024ec32.js} +22 -7
  45. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-05b21989.js → OrConfirm.vue_vue_type_script_lang-7d9d3810.js} +2 -2
  46. package/dist/bundled/v3/{OrInlineInput.vue_vue_type_script_lang-67218502.js → OrInlineInput.vue_vue_type_script_lang-40f0073f.js} +27 -11
  47. package/dist/bundled/v3/{OrInlineTextarea.vue_vue_type_script_lang-a1831ab8.js → OrInlineTextarea.vue_vue_type_script_lang-2817edd5.js} +27 -11
  48. package/dist/bundled/v3/{OrInput-a4f220ed.js → OrInput-e325a104.js} +12 -12
  49. package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-607d79d4.js → OrInput.vue_vue_type_script_lang-fd850b82.js} +26 -15
  50. package/dist/bundled/v3/{OrPagination.vue_vue_type_script_lang-c96d7cd7.js → OrPagination.vue_vue_type_script_lang-0d9daaa7.js} +1 -1
  51. package/dist/bundled/v3/{OrRadio.vue_vue_type_script_lang-2e666a56.js → OrRadio.vue_vue_type_script_lang-29e8b856.js} +22 -7
  52. package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-06f318ca.js → OrSearch.vue_vue_type_script_lang-480f4b1c.js} +2 -2
  53. package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-58e5a52b.js → OrSelect.vue_vue_type_script_lang-7aa8956a.js} +17 -15
  54. package/dist/bundled/v3/{OrSwitch.vue_vue_type_script_lang-04829f64.js → OrSwitch.vue_vue_type_script_lang-02b4913a.js} +22 -7
  55. package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-61b79a5a.js → OrTabs.vue_vue_type_script_lang-01188224.js} +1 -1
  56. package/dist/bundled/v3/{OrTextarea.vue_vue_type_script_lang-8e3531cd.js → OrTextarea.vue_vue_type_script_lang-2fdac7b2.js} +31 -12
  57. package/dist/bundled/v3/components/index.js +16 -14
  58. package/dist/bundled/v3/components/or-card-collection-v3/index.js +6 -4
  59. package/dist/bundled/v3/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -2
  60. package/dist/bundled/v3/components/or-checkbox-v3/index.js +2 -1
  61. package/dist/bundled/v3/components/or-confirm-v3/index.js +5 -3
  62. package/dist/bundled/v3/components/or-inline-input-v3/OrInlineInput.vue.d.ts +36 -6
  63. package/dist/bundled/v3/components/or-inline-input-v3/index.js +3 -1
  64. package/dist/bundled/v3/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +36 -6
  65. package/dist/bundled/v3/components/or-inline-textarea-v3/index.js +3 -1
  66. package/dist/bundled/v3/components/or-input-v3/OrInput.vue.d.ts +43 -8
  67. package/dist/bundled/v3/components/or-input-v3/index.js +3 -1
  68. package/dist/bundled/v3/components/or-pagination-v3/index.js +1 -1
  69. package/dist/bundled/v3/components/or-radio-v3/OrRadio.vue.d.ts +18 -2
  70. package/dist/bundled/v3/components/or-radio-v3/index.js +2 -1
  71. package/dist/bundled/v3/components/or-search-v3/index.js +5 -3
  72. package/dist/bundled/v3/components/or-select-v3/index.js +6 -4
  73. package/dist/bundled/v3/components/or-switch-v3/OrSwitch.vue.d.ts +18 -2
  74. package/dist/bundled/v3/components/or-switch-v3/index.js +2 -1
  75. package/dist/bundled/v3/components/or-tabs-v3/index.js +1 -1
  76. package/dist/bundled/v3/components/or-textarea-v3/OrTextarea.vue.d.ts +45 -6
  77. package/dist/bundled/v3/components/or-textarea-v3/index.js +3 -1
  78. package/dist/bundled/v3/hooks/index.d.ts +3 -0
  79. package/dist/bundled/v3/hooks/index.js +2 -0
  80. package/dist/bundled/v3/hooks/useControlAttributes.d.ts +8 -0
  81. package/dist/bundled/v3/hooks/useIdAttribute.d.ts +2 -0
  82. package/dist/bundled/v3/hooks/useValidationAttributes.d.ts +12 -0
  83. package/dist/bundled/v3/index.js +76 -68
  84. package/dist/bundled/v3/useIdAttribute-b2e42f31.js +21 -0
  85. package/dist/bundled/v3/useValidationAttributes-5428d8fa.js +16 -0
  86. package/dist/esm/v2/{OrCardCollection-3c38fc85.js → OrCardCollection-784318ac.js} +1 -1
  87. package/dist/esm/v2/{OrCheckbox-567e387c.js → OrCheckbox-7317fe1a.js} +32 -17
  88. package/dist/esm/v2/{OrConfirm-e2ab9b4c.js → OrConfirm-3d064f6c.js} +1 -1
  89. package/dist/esm/v2/{OrInlineInput-10205811.js → OrInlineInput-7c4f1f92.js} +38 -22
  90. package/dist/esm/v2/{OrInlineTextarea-7658611e.js → OrInlineTextarea-3381e2a9.js} +34 -18
  91. package/dist/esm/v2/{OrInput-ada3a970.js → OrInput-e10cc643.js} +38 -30
  92. package/dist/esm/v2/{OrPagination-c0dbec6a.js → OrPagination-291bd1b9.js} +1 -1
  93. package/dist/esm/v2/{OrRadio-848ce55d.js → OrRadio-b0a560d2.js} +30 -15
  94. package/dist/esm/v2/{OrSearch-0f08f2f5.js → OrSearch-1490c00b.js} +1 -1
  95. package/dist/esm/v2/{OrSelect-1d705445.js → OrSelect-1fbeed4f.js} +2 -2
  96. package/dist/esm/v2/{OrSwitch-13b6a7ee.js → OrSwitch-133052ca.js} +30 -15
  97. package/dist/esm/v2/{OrTabs-71bd3fd2.js → OrTabs-e5b81f4b.js} +1 -1
  98. package/dist/esm/v2/{OrTextarea-6712a150.js → OrTextarea-a7c846da.js} +39 -20
  99. package/dist/esm/v2/components/index.js +15 -13
  100. package/dist/esm/v2/components/or-card-collection-v3/index.js +5 -3
  101. package/dist/esm/v2/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -2
  102. package/dist/esm/v2/components/or-checkbox-v3/index.js +2 -1
  103. package/dist/esm/v2/components/or-confirm-v3/index.js +4 -2
  104. package/dist/esm/v2/components/or-inline-input-v3/OrInlineInput.vue.d.ts +36 -6
  105. package/dist/esm/v2/components/or-inline-input-v3/index.js +3 -1
  106. package/dist/esm/v2/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +36 -6
  107. package/dist/esm/v2/components/or-inline-textarea-v3/index.js +3 -1
  108. package/dist/esm/v2/components/or-input-v3/OrInput.vue.d.ts +43 -8
  109. package/dist/esm/v2/components/or-input-v3/index.js +3 -1
  110. package/dist/esm/v2/components/or-pagination-v3/index.js +1 -1
  111. package/dist/esm/v2/components/or-radio-v3/OrRadio.vue.d.ts +18 -2
  112. package/dist/esm/v2/components/or-radio-v3/index.js +2 -1
  113. package/dist/esm/v2/components/or-search-v3/index.js +4 -2
  114. package/dist/esm/v2/components/or-select-v3/index.js +5 -3
  115. package/dist/esm/v2/components/or-switch-v3/OrSwitch.vue.d.ts +18 -2
  116. package/dist/esm/v2/components/or-switch-v3/index.js +2 -1
  117. package/dist/esm/v2/components/or-tabs-v3/index.js +1 -1
  118. package/dist/esm/v2/components/or-textarea-v3/OrTextarea.vue.d.ts +45 -6
  119. package/dist/esm/v2/components/or-textarea-v3/index.js +3 -1
  120. package/dist/esm/v2/hooks/index.d.ts +3 -0
  121. package/dist/esm/v2/hooks/index.js +2 -0
  122. package/dist/esm/v2/hooks/useControlAttributes.d.ts +8 -0
  123. package/dist/esm/v2/hooks/useIdAttribute.d.ts +2 -0
  124. package/dist/esm/v2/hooks/useValidationAttributes.d.ts +12 -0
  125. package/dist/esm/v2/index.js +15 -13
  126. package/dist/esm/v2/useIdAttribute-859439f0.js +21 -0
  127. package/dist/esm/v2/useValidationAttributes-d1abbe34.js +16 -0
  128. package/dist/esm/v3/{OrCardCollection-dbb3e839.js → OrCardCollection-110b3a0b.js} +1 -1
  129. package/dist/esm/v3/{OrCheckbox-3e139eac.js → OrCheckbox-7144da06.js} +36 -19
  130. package/dist/esm/v3/{OrConfirm-1bcd39b1.js → OrConfirm-1a38ed1b.js} +1 -1
  131. package/dist/esm/v3/{OrInlineInput-507fc99c.js → OrInlineInput-a6b19dbe.js} +37 -20
  132. package/dist/esm/v3/{OrInlineTextarea-53a9e027.js → OrInlineTextarea-9eb60363.js} +37 -20
  133. package/dist/esm/v3/{OrInput-9c0426b9.js → OrInput-e07ec00c.js} +37 -26
  134. package/dist/esm/v3/{OrPagination-a703307d.js → OrPagination-5e01a0a5.js} +1 -1
  135. package/dist/esm/v3/{OrRadio-54b6d0de.js → OrRadio-39d1905d.js} +34 -17
  136. package/dist/esm/v3/{OrSearch-9885d178.js → OrSearch-a60f67f0.js} +1 -1
  137. package/dist/esm/v3/{OrSelect-dfa4885f.js → OrSelect-2c70e384.js} +2 -2
  138. package/dist/esm/v3/{OrSwitch-cca30aa0.js → OrSwitch-3e9a699d.js} +34 -18
  139. package/dist/esm/v3/{OrTabs-d0ee6cef.js → OrTabs-91618aab.js} +1 -1
  140. package/dist/esm/v3/{OrTextarea-bb9ef3f2.js → OrTextarea-fd6b9f31.js} +42 -22
  141. package/dist/esm/v3/components/index.js +15 -13
  142. package/dist/esm/v3/components/or-card-collection-v3/index.js +5 -3
  143. package/dist/esm/v3/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -2
  144. package/dist/esm/v3/components/or-checkbox-v3/index.js +2 -1
  145. package/dist/esm/v3/components/or-confirm-v3/index.js +4 -2
  146. package/dist/esm/v3/components/or-inline-input-v3/OrInlineInput.vue.d.ts +36 -6
  147. package/dist/esm/v3/components/or-inline-input-v3/index.js +3 -1
  148. package/dist/esm/v3/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +36 -6
  149. package/dist/esm/v3/components/or-inline-textarea-v3/index.js +3 -1
  150. package/dist/esm/v3/components/or-input-v3/OrInput.vue.d.ts +43 -8
  151. package/dist/esm/v3/components/or-input-v3/index.js +3 -1
  152. package/dist/esm/v3/components/or-pagination-v3/index.js +1 -1
  153. package/dist/esm/v3/components/or-radio-v3/OrRadio.vue.d.ts +18 -2
  154. package/dist/esm/v3/components/or-radio-v3/index.js +2 -1
  155. package/dist/esm/v3/components/or-search-v3/index.js +4 -2
  156. package/dist/esm/v3/components/or-select-v3/index.js +5 -3
  157. package/dist/esm/v3/components/or-switch-v3/OrSwitch.vue.d.ts +18 -2
  158. package/dist/esm/v3/components/or-switch-v3/index.js +2 -1
  159. package/dist/esm/v3/components/or-tabs-v3/index.js +1 -1
  160. package/dist/esm/v3/components/or-textarea-v3/OrTextarea.vue.d.ts +45 -6
  161. package/dist/esm/v3/components/or-textarea-v3/index.js +3 -1
  162. package/dist/esm/v3/hooks/index.d.ts +3 -0
  163. package/dist/esm/v3/hooks/index.js +2 -0
  164. package/dist/esm/v3/hooks/useControlAttributes.d.ts +8 -0
  165. package/dist/esm/v3/hooks/useIdAttribute.d.ts +2 -0
  166. package/dist/esm/v3/hooks/useValidationAttributes.d.ts +12 -0
  167. package/dist/esm/v3/index.js +15 -13
  168. package/dist/esm/v3/useIdAttribute-859439f0.js +21 -0
  169. package/dist/esm/v3/useValidationAttributes-d1abbe34.js +16 -0
  170. package/package.json +2 -3
  171. package/src/components/or-checkbox-v3/OrCheckbox.vue +28 -10
  172. package/src/components/or-inline-input-v3/OrInlineInput.vue +32 -13
  173. package/src/components/or-inline-textarea-v3/OrInlineTextarea.vue +32 -13
  174. package/src/components/or-input-v3/OrInput.stories3.ts +4 -4
  175. package/src/components/or-input-v3/OrInput.vue +31 -19
  176. package/src/components/or-pagination-v3/OrPagination.vue +1 -1
  177. package/src/components/or-radio-v3/OrRadio.vue +27 -9
  178. package/src/components/or-switch-v3/OrSwitch.vue +27 -9
  179. package/src/components/or-tabs-v3/OrTabs.vue +1 -1
  180. package/src/components/or-textarea-v3/OrTextarea.stories3.ts +4 -4
  181. package/src/components/or-textarea-v3/OrTextarea.vue +36 -14
  182. package/src/hooks/index.ts +3 -0
  183. package/src/hooks/useControlAttributes.ts +19 -0
  184. package/src/hooks/useIdAttribute.ts +9 -0
  185. package/src/hooks/useValidationAttributes.ts +25 -0
@@ -1,8 +1,9 @@
1
- import { defineComponent, getCurrentInstance, ref, computed } from 'vue-demi';
1
+ import { defineComponent, ref, computed, reactive } from 'vue-demi';
2
2
  import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
3
+ import { a as useIdAttribute, u as useControlAttributes } from './useIdAttribute-859439f0.js';
3
4
  import '@vueuse/core';
4
5
  import { s as script$1, L as LabelVariant } from './OrLabel-bdaec602.js';
5
- import { resolveComponent, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, mergeProps, vModelCheckbox, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
6
+ import { resolveComponent, openBlock, createElementBlock, mergeProps, withDirectives, createElementVNode, vModelDynamic, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
6
7
  import { s as styleInject } from './style-inject.es-4c6f2515.js';
7
8
 
8
9
  const CheckboxRoot = [
@@ -76,18 +77,20 @@ var script = defineComponent({
76
77
  }
77
78
  },
78
79
  emits: ['update:modelValue', 'input', 'focus', 'blur'],
79
- expose: ['root'],
80
+ expose: ['root', 'focus', 'blur'],
80
81
  setup(props, context) {
81
- var _a;
82
- const currentInstance = getCurrentInstance();
83
82
  // Refs
84
83
  const root = ref();
84
+ const control = ref();
85
85
  // Styles
86
86
  const classAttribute = useClassAttribute();
87
87
  const rootStyles = computed(() => ['or-checkbox', ...CheckboxRoot, classAttribute.value]);
88
88
  const controlStyles = computed(() => [...CheckboxControl, ...CheckboxControlHandle]);
89
89
  // State
90
- const controlId = ref((_a = context.attrs.id) !== null && _a !== void 0 ? _a : currentInstance.uid.toString());
90
+ const controlAttributes = reactive({
91
+ id: useIdAttribute(),
92
+ ...useControlAttributes()
93
+ });
91
94
  const proxyModelValue = computed({
92
95
  get: () => {
93
96
  var _a;
@@ -99,36 +102,50 @@ var script = defineComponent({
99
102
  context.emit('update:modelValue', value);
100
103
  }
101
104
  });
105
+ // Methods
106
+ function focus() {
107
+ var _a;
108
+ (_a = control.value) === null || _a === void 0 ? void 0 : _a.focus();
109
+ }
110
+ function blur() {
111
+ var _a;
112
+ (_a = control.value) === null || _a === void 0 ? void 0 : _a.blur();
113
+ }
102
114
  return {
103
115
  root,
116
+ control,
104
117
  rootStyles,
105
118
  controlStyles,
106
- controlId,
107
- proxyModelValue
119
+ controlAttributes,
120
+ proxyModelValue,
121
+ focus,
122
+ blur
108
123
  };
109
124
  }
110
125
  });
111
126
 
112
- const _hoisted_1 = ["id", "value", "indeterminate", "required", "disabled"];
127
+ const _hoisted_1 = ["value", "indeterminate", "required", "disabled"];
113
128
  function render(_ctx, _cache, $props, $setup, $data, $options) {
114
129
  const _component_OrLabel = resolveComponent("OrLabel");
115
- return openBlock(), createElementBlock("div", {
116
- ref: "root",
117
- class: normalizeClass(_ctx.rootStyles)
118
- }, [withDirectives(createElementVNode("input", mergeProps(_ctx.$attrs, {
119
- id: _ctx.controlId,
120
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.proxyModelValue = $event),
130
+ return openBlock(), createElementBlock("div", mergeProps({
131
+ ref: "root"
132
+ }, _ctx.$attrs, {
133
+ class: _ctx.rootStyles
134
+ }), [withDirectives(createElementVNode("input", mergeProps({
135
+ ref: "control",
136
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.proxyModelValue = $event)
137
+ }, _ctx.controlAttributes, {
121
138
  class: _ctx.controlStyles,
122
- type: "checkbox",
139
+ type: 'checkbox',
123
140
  value: _ctx.inputValue,
124
141
  indeterminate: _ctx.indeterminate,
125
142
  required: _ctx.required,
126
143
  disabled: _ctx.disabled,
127
144
  onFocus: _cache[1] || (_cache[1] = $event => _ctx.$emit('focus', $event)),
128
145
  onBlur: _cache[2] || (_cache[2] = $event => _ctx.$emit('blur', $event))
129
- }), null, 16 /* FULL_PROPS */, _hoisted_1), [[vModelCheckbox, _ctx.proxyModelValue]]), _ctx.$slots.default || _ctx.label ? (openBlock(), createBlock(_component_OrLabel, {
146
+ }), null, 16 /* FULL_PROPS */, _hoisted_1), [[vModelDynamic, _ctx.proxyModelValue]]), _ctx.$slots.default || _ctx.label ? (openBlock(), createBlock(_component_OrLabel, {
130
147
  key: 0,
131
- "control-id": _ctx.controlId,
148
+ "control-id": _ctx.controlAttributes.id,
132
149
  variant: _ctx.labelVariant,
133
150
  required: _ctx.required,
134
151
  disabled: _ctx.disabled
@@ -137,7 +154,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
137
154
  default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(_ctx.label), 1 /* TEXT */)])]),
138
155
 
139
156
  _: 3 /* FORWARDED */
140
- }, 8 /* PROPS */, ["control-id", "variant", "required", "disabled"])) : createCommentVNode("v-if", true)], 2 /* CLASS */);
157
+ }, 8 /* PROPS */, ["control-id", "variant", "required", "disabled"])) : createCommentVNode("v-if", true)], 16 /* FULL_PROPS */);
141
158
  }
142
159
 
143
160
  var css_248z = "\ninput[data-v-5358d710] {\n appearance: none;\n line-height: 0;\n}\n";
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, ref, computed, watch } from 'vue-demi';
2
2
  import { s as script$2, a as ButtonColor } from './OrButton-0fa67a0d.js';
3
3
  import { s as script$1 } from './OrOverlay-738a44d5.js';
4
- import { s as script$3 } from './OrInput-9c0426b9.js';
4
+ import { s as script$3 } from './OrInput-e07ec00c.js';
5
5
  import { useMagicKeys, whenever } from '@vueuse/core';
6
6
  import { logicAnd } from '@vueuse/math';
7
7
  import { resolveComponent, openBlock, createBlock, withCtx, createElementVNode, mergeProps, normalizeClass, renderSlot, createTextVNode, toDisplayString, createElementBlock, createVNode, createCommentVNode } from 'vue';
@@ -1,11 +1,13 @@
1
- import { defineComponent, getCurrentInstance, ref, computed, watch } from 'vue-demi';
1
+ import { defineComponent, ref, computed, reactive, watch } from 'vue-demi';
2
2
  import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
3
+ import { a as useIdAttribute, u as useControlAttributes } from './useIdAttribute-859439f0.js';
3
4
  import '@vueuse/core';
5
+ import { u as useValidationAttributes } from './useValidationAttributes-d1abbe34.js';
4
6
  import { s as script$1 } from './OrError-ec8c709d.js';
5
7
  import { s as script$2 } from './OrHint-74bb732d.js';
6
8
  import { s as script$3 } from './OrIconButton-1a89fbf9.js';
7
9
  import { s as script$4, I as InlineInputBoxSize } from './OrInlineInputBox-8049f95a.js';
8
- import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, withCtx, withDirectives, mergeProps, vModelDynamic, withModifiers, createCommentVNode, Fragment, createBlock, createSlots, createTextVNode, toDisplayString } from 'vue';
10
+ import { resolveComponent, openBlock, createElementBlock, mergeProps, createElementVNode, createVNode, withCtx, withDirectives, vModelDynamic, normalizeClass, withModifiers, createCommentVNode, Fragment, createBlock, createSlots, createTextVNode, toDisplayString } from 'vue';
9
11
  import { s as styleInject } from './style-inject.es-4c6f2515.js';
10
12
 
11
13
  var InlineInputType;
@@ -86,19 +88,22 @@ var script = defineComponent({
86
88
  }
87
89
  },
88
90
  emits: ['update:modelValue', 'input', 'keydown', 'keyup', 'focus', 'blur'],
89
- expose: ['root'],
91
+ expose: ['root', 'focus', 'blur'],
90
92
  setup(props, context) {
91
- var _a;
92
- const currentInstance = getCurrentInstance();
93
93
  // Refs
94
94
  const root = ref();
95
+ const control = ref();
95
96
  // Styles
96
97
  const classAttribute = useClassAttribute();
97
98
  const rootStyles = computed(() => ['or-inline-input', ...InlineInputRoot, classAttribute.value]);
98
99
  const controlStyles = computed(() => [...InlineInputControl]);
99
100
  const actionStyles = computed(() => [...InlineInputAction, ...InlineInputActionSizes[props.size]]);
100
101
  // State
101
- const controlId = ref((_a = context.attrs.id) !== null && _a !== void 0 ? _a : currentInstance.uid.toString());
102
+ const controlAttributes = reactive({
103
+ id: useIdAttribute(),
104
+ ...useControlAttributes(),
105
+ ...useValidationAttributes()
106
+ });
102
107
  const proxyModelValue = computed({
103
108
  get: () => {
104
109
  var _a;
@@ -111,13 +116,13 @@ var script = defineComponent({
111
116
  }
112
117
  });
113
118
  const draftModelValue = ref('');
114
- const activated = ref(false);
115
- const invalid = computed(() => !!props.error);
116
119
  const currentLength = computed(() => {
117
120
  var _a, _b;
118
121
  return (_b = (_a = draftModelValue.value) === null || _a === void 0 ? void 0 : _a.toString().length) !== null && _b !== void 0 ? _b : 0;
119
122
  });
120
- const maxLength = computed(() => context.attrs.maxlength);
123
+ const maxLength = computed(() => controlAttributes.maxlength);
124
+ const invalid = computed(() => !!props.error);
125
+ const activated = ref(false);
121
126
  // Handlers
122
127
  function onFocus(event) {
123
128
  activated.value = true;
@@ -130,6 +135,14 @@ var script = defineComponent({
130
135
  context.emit('blur', event);
131
136
  }
132
137
  // Methods
138
+ function focus() {
139
+ var _a;
140
+ (_a = control.value) === null || _a === void 0 ? void 0 : _a.focus();
141
+ }
142
+ function blur() {
143
+ var _a;
144
+ (_a = control.value) === null || _a === void 0 ? void 0 : _a.blur();
145
+ }
133
146
  function apply() {
134
147
  if (draftModelValue.value !== proxyModelValue.value) {
135
148
  proxyModelValue.value = draftModelValue.value;
@@ -151,18 +164,21 @@ var script = defineComponent({
151
164
  });
152
165
  return {
153
166
  root,
167
+ control,
154
168
  rootStyles,
155
169
  controlStyles,
156
170
  actionStyles,
157
- controlId,
171
+ controlAttributes,
158
172
  proxyModelValue,
159
173
  draftModelValue,
160
- activated,
161
- invalid,
162
174
  currentLength,
163
175
  maxLength,
176
+ invalid,
177
+ activated,
164
178
  onFocus,
165
179
  onBlur,
180
+ focus,
181
+ blur,
166
182
  apply,
167
183
  reset
168
184
  };
@@ -172,23 +188,24 @@ var script = defineComponent({
172
188
  const _hoisted_1 = {
173
189
  class: /*#__PURE__*/normalizeClass(['layout-row', 'gap-sm+'])
174
190
  };
175
- const _hoisted_2 = ["id", "type", "placeholder", "activated"];
191
+ const _hoisted_2 = ["type", "placeholder", "activated"];
176
192
  function render(_ctx, _cache, $props, $setup, $data, $options) {
177
193
  const _component_OrInlineInputBox = resolveComponent("OrInlineInputBox");
178
194
  const _component_OrIconButton = resolveComponent("OrIconButton");
179
195
  const _component_OrHint = resolveComponent("OrHint");
180
196
  const _component_OrError = resolveComponent("OrError");
181
- return openBlock(), createElementBlock("div", {
182
- ref: "root",
183
- class: normalizeClass(_ctx.rootStyles)
184
- }, [createElementVNode("div", _hoisted_1, [createVNode(_component_OrInlineInputBox, {
197
+ return openBlock(), createElementBlock("div", mergeProps({
198
+ ref: "root"
199
+ }, _ctx.$attrs, {
200
+ class: _ctx.rootStyles
201
+ }), [createElementVNode("div", _hoisted_1, [createVNode(_component_OrInlineInputBox, {
185
202
  size: _ctx.size,
186
203
  invalid: _ctx.invalid
187
204
  }, {
188
205
  default: withCtx(() => [withDirectives(createElementVNode("input", mergeProps({
189
- id: _ctx.controlId,
206
+ ref: "control",
190
207
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.draftModelValue = $event)
191
- }, _ctx.$attrs, {
208
+ }, _ctx.controlAttributes, {
192
209
  class: _ctx.controlStyles,
193
210
  type: _ctx.type,
194
211
  placeholder: _ctx.placeholder,
@@ -234,7 +251,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
234
251
  fn: withCtx(() => [createTextVNode(toDisplayString(_ctx.currentLength) + " / " + toDisplayString(_ctx.maxLength), 1 /* TEXT */)]),
235
252
 
236
253
  key: "0"
237
- } : undefined]), 1024 /* DYNAMIC_SLOTS */))], 2 /* CLASS */);
254
+ } : undefined]), 1024 /* DYNAMIC_SLOTS */))], 16 /* FULL_PROPS */);
238
255
  }
239
256
 
240
257
  var css_248z = "\ninput[data-v-29d9ad19] {\n min-width: 0;\n background: none;\n outline: none;\n}\ninput[type=\"number\"][data-v-29d9ad19]::-webkit-inner-spin-button {\n display: none;\n}\ninput[type=\"search\"][data-v-29d9ad19]::-webkit-search-cancel-button {\n display: none;\n}\n";
@@ -1,11 +1,13 @@
1
- import { defineComponent, getCurrentInstance, ref, computed, watch } from 'vue-demi';
1
+ import { defineComponent, ref, computed, reactive, watch } from 'vue-demi';
2
2
  import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
3
+ import { a as useIdAttribute, u as useControlAttributes } from './useIdAttribute-859439f0.js';
3
4
  import '@vueuse/core';
5
+ import { u as useValidationAttributes } from './useValidationAttributes-d1abbe34.js';
4
6
  import { s as script$1 } from './OrError-ec8c709d.js';
5
7
  import { s as script$2 } from './OrHint-74bb732d.js';
6
8
  import { s as script$3 } from './OrIconButton-1a89fbf9.js';
7
9
  import { s as script$4 } from './OrInlineInputBox-8049f95a.js';
8
- import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, withCtx, withDirectives, mergeProps, vModelText, withModifiers, createCommentVNode, Fragment, createBlock, createSlots, createTextVNode, toDisplayString } from 'vue';
10
+ import { resolveComponent, openBlock, createElementBlock, mergeProps, createElementVNode, createVNode, withCtx, withDirectives, vModelText, normalizeClass, withModifiers, createCommentVNode, Fragment, createBlock, createSlots, createTextVNode, toDisplayString } from 'vue';
9
11
  import { s as styleInject } from './style-inject.es-4c6f2515.js';
10
12
 
11
13
  const InlineTextareaRoot = [
@@ -64,19 +66,22 @@ var script = defineComponent({
64
66
  }
65
67
  },
66
68
  emits: ['update:modelValue', 'input', 'keydown', 'keyup', 'focus', 'blur'],
67
- expose: ['root'],
69
+ expose: ['root', 'focus', 'blur'],
68
70
  setup(props, context) {
69
- var _a;
70
- const currentInstance = getCurrentInstance();
71
71
  // Refs
72
72
  const root = ref();
73
+ const control = ref();
73
74
  // Styles
74
75
  const classAttribute = useClassAttribute();
75
76
  const rootStyles = computed(() => ['or-inline-textarea', ...InlineTextareaRoot, classAttribute.value]);
76
77
  const controlStyles = computed(() => [...InlineTextareaControl]);
77
78
  const actionStyles = computed(() => [...InlineTextareaAction]);
78
79
  // State
79
- const controlId = ref((_a = context.attrs.id) !== null && _a !== void 0 ? _a : currentInstance.uid.toString());
80
+ const controlAttributes = reactive({
81
+ id: useIdAttribute(),
82
+ ...useControlAttributes(),
83
+ ...useValidationAttributes()
84
+ });
80
85
  const proxyModelValue = computed({
81
86
  get: () => {
82
87
  var _a;
@@ -89,13 +94,13 @@ var script = defineComponent({
89
94
  }
90
95
  });
91
96
  const draftModelValue = ref('');
92
- const activated = ref(false);
93
- const invalid = computed(() => !!props.error);
94
97
  const currentLength = computed(() => {
95
98
  var _a, _b;
96
99
  return (_b = (_a = draftModelValue.value) === null || _a === void 0 ? void 0 : _a.toString().length) !== null && _b !== void 0 ? _b : 0;
97
100
  });
98
- const maxLength = computed(() => context.attrs.maxlength);
101
+ const maxLength = computed(() => controlAttributes.maxlength);
102
+ const invalid = computed(() => !!props.error);
103
+ const activated = ref(false);
99
104
  // Handlers
100
105
  function onFocus(event) {
101
106
  activated.value = true;
@@ -108,6 +113,14 @@ var script = defineComponent({
108
113
  context.emit('blur', event);
109
114
  }
110
115
  // Methods
116
+ function focus() {
117
+ var _a;
118
+ (_a = control.value) === null || _a === void 0 ? void 0 : _a.focus();
119
+ }
120
+ function blur() {
121
+ var _a;
122
+ (_a = control.value) === null || _a === void 0 ? void 0 : _a.blur();
123
+ }
111
124
  function apply() {
112
125
  if (draftModelValue.value !== proxyModelValue.value) {
113
126
  proxyModelValue.value = draftModelValue.value;
@@ -129,18 +142,21 @@ var script = defineComponent({
129
142
  });
130
143
  return {
131
144
  root,
145
+ control,
132
146
  rootStyles,
133
147
  controlStyles,
134
148
  actionStyles,
135
- controlId,
149
+ controlAttributes,
136
150
  proxyModelValue,
137
151
  draftModelValue,
138
- activated,
139
- invalid,
140
152
  currentLength,
141
153
  maxLength,
154
+ invalid,
155
+ activated,
142
156
  onFocus,
143
157
  onBlur,
158
+ focus,
159
+ blur,
144
160
  apply,
145
161
  reset
146
162
  };
@@ -150,23 +166,24 @@ var script = defineComponent({
150
166
  const _hoisted_1 = {
151
167
  class: /*#__PURE__*/normalizeClass(['layout-row', 'gap-sm+'])
152
168
  };
153
- const _hoisted_2 = ["id", "placeholder", "activated"];
169
+ const _hoisted_2 = ["placeholder", "activated"];
154
170
  function render(_ctx, _cache, $props, $setup, $data, $options) {
155
171
  const _component_OrInlineInputBox = resolveComponent("OrInlineInputBox");
156
172
  const _component_OrIconButton = resolveComponent("OrIconButton");
157
173
  const _component_OrHint = resolveComponent("OrHint");
158
174
  const _component_OrError = resolveComponent("OrError");
159
- return openBlock(), createElementBlock("div", {
160
- ref: "root",
161
- class: normalizeClass(_ctx.rootStyles)
162
- }, [createElementVNode("div", _hoisted_1, [createVNode(_component_OrInlineInputBox, {
175
+ return openBlock(), createElementBlock("div", mergeProps({
176
+ ref: "root"
177
+ }, _ctx.$attrs, {
178
+ class: _ctx.rootStyles
179
+ }), [createElementVNode("div", _hoisted_1, [createVNode(_component_OrInlineInputBox, {
163
180
  size: 's',
164
181
  invalid: _ctx.invalid
165
182
  }, {
166
183
  default: withCtx(() => [withDirectives(createElementVNode("textarea", mergeProps({
167
- id: _ctx.controlId,
184
+ ref: "control",
168
185
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.draftModelValue = $event)
169
- }, _ctx.$attrs, {
186
+ }, _ctx.controlAttributes, {
170
187
  class: _ctx.controlStyles,
171
188
  placeholder: _ctx.placeholder,
172
189
  activated: _ctx.activated ? '' : null,
@@ -211,7 +228,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
211
228
  fn: withCtx(() => [createTextVNode(toDisplayString(_ctx.currentLength) + " / " + toDisplayString(_ctx.maxLength), 1 /* TEXT */)]),
212
229
 
213
230
  key: "0"
214
- } : undefined]), 1024 /* DYNAMIC_SLOTS */))], 2 /* CLASS */);
231
+ } : undefined]), 1024 /* DYNAMIC_SLOTS */))], 16 /* FULL_PROPS */);
215
232
  }
216
233
 
217
234
  var css_248z = "\ntextarea[data-v-3f016b22] {\n min-width: 0;\n background: none;\n outline: none;\n}\n";
@@ -1,13 +1,15 @@
1
- import { defineComponent, getCurrentInstance, ref, computed } from 'vue-demi';
1
+ import { defineComponent, ref, computed, reactive } from 'vue-demi';
2
2
  import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
3
+ import { a as useIdAttribute, u as useControlAttributes } from './useIdAttribute-859439f0.js';
3
4
  import '@vueuse/core';
5
+ import { u as useValidationAttributes } from './useValidationAttributes-d1abbe34.js';
4
6
  import { s as script$1 } from './OrError-ec8c709d.js';
5
7
  import { s as script$2 } from './OrHint-74bb732d.js';
6
8
  import { s as script$4 } from './OrIconButton-1a89fbf9.js';
7
9
  import { s as script$3 } from './OrIcon-b195169c.js';
8
10
  import { s as script$5, a as InputBoxSize } from './OrInputBox-6d1b6059.js';
9
11
  import { s as script$6 } from './OrLabel-bdaec602.js';
10
- import { resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, withDirectives, createElementVNode, mergeProps, vModelDynamic, withModifiers, Fragment, createSlots } from 'vue';
12
+ import { resolveComponent, openBlock, createElementBlock, mergeProps, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, withDirectives, createElementVNode, vModelDynamic, withModifiers, Fragment, createSlots, normalizeClass } from 'vue';
11
13
  import { s as styleInject } from './style-inject.es-4c6f2515.js';
12
14
 
13
15
  var InputType;
@@ -79,6 +81,10 @@ var script = defineComponent({
79
81
  type: Boolean,
80
82
  default: false
81
83
  },
84
+ readonly: {
85
+ type: Boolean,
86
+ default: false
87
+ },
82
88
  disabled: {
83
89
  type: Boolean,
84
90
  default: false
@@ -89,19 +95,21 @@ var script = defineComponent({
89
95
  }
90
96
  },
91
97
  emits: ['update:modelValue', 'input', 'keydown', 'keyup', 'focus', 'blur'],
92
- expose: ['root', 'focus'],
98
+ expose: ['root', 'focus', 'blur'],
93
99
  setup(props, context) {
94
- var _a;
95
- const currentInstance = getCurrentInstance();
96
100
  // Refs
97
101
  const root = ref();
98
- const input = ref();
102
+ const control = ref();
99
103
  // Styles
100
104
  const classAttribute = useClassAttribute();
101
105
  const rootStyles = computed(() => ['or-input', ...InputRoot, classAttribute.value]);
102
106
  const controlStyles = computed(() => [...InputControl]);
103
107
  // State
104
- const controlId = ref((_a = context.attrs.id) !== null && _a !== void 0 ? _a : currentInstance.uid.toString());
108
+ const controlAttributes = reactive({
109
+ id: useIdAttribute(),
110
+ ...useControlAttributes(),
111
+ ...useValidationAttributes()
112
+ });
105
113
  const proxyModelValue = computed({
106
114
  get: () => {
107
115
  var _a;
@@ -113,37 +121,40 @@ var script = defineComponent({
113
121
  context.emit('update:modelValue', value);
114
122
  }
115
123
  });
116
- const invalid = computed(() => !!props.error);
117
- const readonly = computed(() => context.attrs.readonly);
118
124
  const currentLength = computed(() => {
119
125
  var _a, _b;
120
126
  return (_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.toString().length) !== null && _b !== void 0 ? _b : 0;
121
127
  });
122
- const maxLength = computed(() => context.attrs.maxlength);
128
+ const maxLength = computed(() => controlAttributes.maxlength);
129
+ const invalid = computed(() => !!props.error);
123
130
  const disclosed = ref(false);
124
131
  // Methods
125
132
  function focus() {
126
133
  var _a;
127
- (_a = input.value) === null || _a === void 0 ? void 0 : _a.focus();
134
+ (_a = control.value) === null || _a === void 0 ? void 0 : _a.focus();
135
+ }
136
+ function blur() {
137
+ var _a;
138
+ (_a = control.value) === null || _a === void 0 ? void 0 : _a.blur();
128
139
  }
129
140
  return {
130
141
  root,
131
- input,
142
+ control,
132
143
  rootStyles,
133
144
  controlStyles,
134
- controlId,
145
+ controlAttributes,
135
146
  proxyModelValue,
136
- invalid,
137
- readonly,
138
147
  currentLength,
139
148
  maxLength,
149
+ invalid,
140
150
  disclosed,
141
- focus
151
+ focus,
152
+ blur
142
153
  };
143
154
  }
144
155
  });
145
156
 
146
- const _hoisted_1 = ["id", "type", "placeholder", "required", "disabled"];
157
+ const _hoisted_1 = ["type", "placeholder", "required", "disabled"];
147
158
  const _hoisted_2 = {
148
159
  class: /*#__PURE__*/normalizeClass(['layout-row'])
149
160
  };
@@ -154,12 +165,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
154
165
  const _component_OrInputBox = resolveComponent("OrInputBox");
155
166
  const _component_OrHint = resolveComponent("OrHint");
156
167
  const _component_OrError = resolveComponent("OrError");
157
- return openBlock(), createElementBlock("div", {
158
- ref: "root",
159
- class: normalizeClass(_ctx.rootStyles)
160
- }, [_ctx.label ? (openBlock(), createBlock(_component_OrLabel, {
168
+ return openBlock(), createElementBlock("div", mergeProps({
169
+ ref: "root"
170
+ }, _ctx.$attrs, {
171
+ class: _ctx.rootStyles
172
+ }), [_ctx.label ? (openBlock(), createBlock(_component_OrLabel, {
161
173
  key: 0,
162
- "control-id": _ctx.controlId,
174
+ "control-id": _ctx.controlAttributes.id,
163
175
  variant: 'input',
164
176
  required: _ctx.required,
165
177
  disabled: _ctx.disabled
@@ -176,10 +188,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
176
188
  disabled: _ctx.disabled
177
189
  }, {
178
190
  default: withCtx(() => [withDirectives(createElementVNode("input", mergeProps({
179
- id: _ctx.controlId,
180
- ref: "input",
191
+ ref: "control",
181
192
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.proxyModelValue = $event)
182
- }, _ctx.$attrs, {
193
+ }, _ctx.controlAttributes, {
183
194
  class: _ctx.controlStyles,
184
195
  type: _ctx.type === 'password' && _ctx.disclosed ? 'text' : _ctx.type,
185
196
  placeholder: _ctx.placeholder,
@@ -238,7 +249,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
238
249
  fn: withCtx(() => [createTextVNode(toDisplayString(_ctx.currentLength) + " / " + toDisplayString(_ctx.maxLength), 1 /* TEXT */)]),
239
250
 
240
251
  key: "0"
241
- } : undefined]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["disabled"]))], 2 /* CLASS */);
252
+ } : undefined]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["disabled"]))], 16 /* FULL_PROPS */);
242
253
  }
243
254
 
244
255
  var css_248z = "\ninput[data-v-78975fa2] {\n min-width: 0;\n background: none;\n outline: none;\n}\ninput[type=\"number\"][data-v-78975fa2]::-webkit-inner-spin-button {\n display: none;\n}\ninput[type=\"search\"][data-v-78975fa2]::-webkit-search-cancel-button {\n display: none;\n}\n";
@@ -149,7 +149,7 @@ var script = defineComponent({
149
149
  return [...accumulator, page];
150
150
  }, []);
151
151
  });
152
- // Functions
152
+ // Methods
153
153
  function toPreviousPage() {
154
154
  currentPage.value = currentPage.value - 1;
155
155
  }
@@ -1,8 +1,9 @@
1
- import { defineComponent, getCurrentInstance, ref, computed } from 'vue-demi';
1
+ import { defineComponent, ref, computed, reactive } from 'vue-demi';
2
2
  import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
3
+ import { a as useIdAttribute, u as useControlAttributes } from './useIdAttribute-859439f0.js';
3
4
  import '@vueuse/core';
4
5
  import { s as script$1, L as LabelVariant } from './OrLabel-bdaec602.js';
5
- import { resolveComponent, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, mergeProps, vModelRadio, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
6
+ import { resolveComponent, openBlock, createElementBlock, mergeProps, withDirectives, createElementVNode, vModelRadio, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
6
7
  import { s as styleInject } from './style-inject.es-4c6f2515.js';
7
8
 
8
9
  const RadioRoot = [
@@ -72,18 +73,20 @@ var script = defineComponent({
72
73
  }
73
74
  },
74
75
  emits: ['update:modelValue', 'input', 'focus', 'blur'],
75
- expose: ['root'],
76
+ expose: ['root', 'focus', 'blur'],
76
77
  setup(props, context) {
77
- var _a;
78
- const currentInstance = getCurrentInstance();
79
78
  // Refs
80
79
  const root = ref();
80
+ const control = ref();
81
81
  // Styles
82
82
  const classAttribute = useClassAttribute();
83
83
  const rootStyles = computed(() => ['or-radio', ...RadioRoot, classAttribute.value]);
84
84
  const controlStyles = computed(() => [...RadioControl, ...RadioControlHandle]);
85
85
  // State
86
- const controlId = ref((_a = context.attrs.id) !== null && _a !== void 0 ? _a : currentInstance.uid.toString());
86
+ const controlAttributes = reactive({
87
+ id: useIdAttribute(),
88
+ ...useControlAttributes()
89
+ });
87
90
  const proxyModelValue = computed({
88
91
  get: () => {
89
92
  var _a;
@@ -95,25 +98,39 @@ var script = defineComponent({
95
98
  context.emit('update:modelValue', value);
96
99
  }
97
100
  });
101
+ // Methods
102
+ function focus() {
103
+ var _a;
104
+ (_a = control.value) === null || _a === void 0 ? void 0 : _a.focus();
105
+ }
106
+ function blur() {
107
+ var _a;
108
+ (_a = control.value) === null || _a === void 0 ? void 0 : _a.blur();
109
+ }
98
110
  return {
99
111
  root,
112
+ control,
100
113
  rootStyles,
101
114
  controlStyles,
102
- controlId,
103
- proxyModelValue
115
+ controlAttributes,
116
+ proxyModelValue,
117
+ focus,
118
+ blur
104
119
  };
105
120
  }
106
121
  });
107
122
 
108
- const _hoisted_1 = ["id", "value", "required", "disabled"];
123
+ const _hoisted_1 = ["value", "required", "disabled"];
109
124
  function render(_ctx, _cache, $props, $setup, $data, $options) {
110
125
  const _component_OrLabel = resolveComponent("OrLabel");
111
- return openBlock(), createElementBlock("div", {
112
- ref: "root",
113
- class: normalizeClass(_ctx.rootStyles)
114
- }, [withDirectives(createElementVNode("input", mergeProps(_ctx.$attrs, {
115
- id: _ctx.controlId,
116
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.proxyModelValue = $event),
126
+ return openBlock(), createElementBlock("div", mergeProps({
127
+ ref: "root"
128
+ }, _ctx.$attrs, {
129
+ class: _ctx.rootStyles
130
+ }), [withDirectives(createElementVNode("input", mergeProps({
131
+ ref: "control",
132
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.proxyModelValue = $event)
133
+ }, _ctx.controlAttributes, {
117
134
  class: _ctx.controlStyles,
118
135
  type: "radio",
119
136
  value: _ctx.inputValue,
@@ -123,7 +140,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
123
140
  onBlur: _cache[2] || (_cache[2] = $event => _ctx.$emit('blur', $event))
124
141
  }), null, 16 /* FULL_PROPS */, _hoisted_1), [[vModelRadio, _ctx.proxyModelValue]]), _ctx.$slots.default || _ctx.label ? (openBlock(), createBlock(_component_OrLabel, {
125
142
  key: 0,
126
- "control-id": _ctx.controlId,
143
+ "control-id": _ctx.controlAttributes.id,
127
144
  variant: _ctx.labelVariant,
128
145
  required: _ctx.required,
129
146
  disabled: _ctx.disabled
@@ -132,7 +149,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
132
149
  default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(_ctx.label), 1 /* TEXT */)])]),
133
150
 
134
151
  _: 3 /* FORWARDED */
135
- }, 8 /* PROPS */, ["control-id", "variant", "required", "disabled"])) : createCommentVNode("v-if", true)], 2 /* CLASS */);
152
+ }, 8 /* PROPS */, ["control-id", "variant", "required", "disabled"])) : createCommentVNode("v-if", true)], 16 /* FULL_PROPS */);
136
153
  }
137
154
 
138
155
  var css_248z = "\ninput[data-v-2567d702] {\n appearance: none;\n line-height: 0;\n}\n";