@onereach/ui-components 2.70.2-beta.2200.0 → 2.70.2-beta.2203.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/{OrCardCollection-046b51fd.js → OrCardCollection-0141a358.js} +1 -1
- package/dist/bundled/v2/{OrCheckbox-251ecafc.js → OrCheckbox-dbef9f9a.js} +17 -32
- package/dist/bundled/v2/{OrConfirm-4a96edab.js → OrConfirm-057e997e.js} +13 -6
- package/dist/bundled/v2/{OrInlineInput-2133e469.js → OrInlineInput-87589946.js} +22 -38
- package/dist/bundled/v2/{OrInlineTextarea-d61ca596.js → OrInlineTextarea-21b0e6fc.js} +18 -34
- package/dist/bundled/v2/{OrInput-56314ef0.js → OrInput-82ccfe00.js} +31 -42
- package/dist/bundled/v2/{OrPagination-468d0964.js → OrPagination-379c10b8.js} +1 -1
- package/dist/bundled/v2/{OrRadio-ae89bc9b.js → OrRadio-cd39b20b.js} +15 -30
- package/dist/bundled/v2/{OrSearch-5022873f.js → OrSearch-53470b0e.js} +1 -1
- package/dist/bundled/v2/{OrSelect-4f163320.js → OrSelect-c49e1bcf.js} +2 -2
- package/dist/bundled/v2/{OrSwitch-20640a05.js → OrSwitch-237a2081.js} +15 -30
- package/dist/bundled/v2/{OrTabs-85aefcba.js → OrTabs-42f7c52c.js} +1 -1
- package/dist/bundled/v2/{OrTextarea-43c4b8a2.js → OrTextarea-5593fbe9.js} +20 -40
- package/dist/bundled/v2/components/index.js +13 -15
- package/dist/bundled/v2/components/or-card-collection-v3/index.js +3 -5
- package/dist/bundled/v2/components/or-checkbox-v3/OrCheckbox.vue.d.ts +2 -18
- package/dist/bundled/v2/components/or-checkbox-v3/index.js +1 -2
- package/dist/bundled/v2/components/or-confirm-v3/index.js +4 -6
- package/dist/bundled/v2/components/or-inline-input-v3/OrInlineInput.vue.d.ts +6 -36
- package/dist/bundled/v2/components/or-inline-input-v3/index.js +1 -3
- package/dist/bundled/v2/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +6 -36
- package/dist/bundled/v2/components/or-inline-textarea-v3/index.js +1 -3
- package/dist/bundled/v2/components/or-input-v3/OrInput.vue.d.ts +8 -43
- package/dist/bundled/v2/components/or-input-v3/index.js +1 -3
- package/dist/bundled/v2/components/or-pagination-v3/index.js +1 -1
- package/dist/bundled/v2/components/or-radio-v3/OrRadio.vue.d.ts +2 -18
- package/dist/bundled/v2/components/or-radio-v3/index.js +1 -2
- package/dist/bundled/v2/components/or-search-v3/index.js +2 -4
- package/dist/bundled/v2/components/or-select-v3/index.js +3 -5
- package/dist/bundled/v2/components/or-switch-v3/OrSwitch.vue.d.ts +2 -18
- package/dist/bundled/v2/components/or-switch-v3/index.js +1 -2
- package/dist/bundled/v2/components/or-tabs-v3/index.js +1 -1
- package/dist/bundled/v2/components/or-textarea-v3/OrTextarea.vue.d.ts +6 -45
- package/dist/bundled/v2/components/or-textarea-v3/index.js +1 -3
- package/dist/bundled/v2/hooks/index.d.ts +0 -3
- package/dist/bundled/v2/hooks/index.js +0 -2
- package/dist/bundled/v2/index.js +14 -16
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-1b263db2.js → OrCardCollection.vue_vue_type_script_lang-2d78a51a.js} +1 -1
- package/dist/bundled/v3/{OrCheckbox.vue_vue_type_script_lang-2024ec32.js → OrCheckbox.vue_vue_type_script_lang-8b36e06c.js} +7 -22
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-35c1085c.js → OrConfirm.vue_vue_type_script_lang-9d9a3917.js} +14 -7
- package/dist/bundled/v3/{OrInlineInput.vue_vue_type_script_lang-40f0073f.js → OrInlineInput.vue_vue_type_script_lang-67218502.js} +11 -27
- package/dist/bundled/v3/{OrInlineTextarea.vue_vue_type_script_lang-2817edd5.js → OrInlineTextarea.vue_vue_type_script_lang-a1831ab8.js} +11 -27
- package/dist/bundled/v3/{OrInput-d1c13e6b.js → OrInput-a4f220ed.js} +13 -14
- package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-fd850b82.js → OrInput.vue_vue_type_script_lang-607d79d4.js} +15 -26
- package/dist/bundled/v3/{OrPagination.vue_vue_type_script_lang-0d9daaa7.js → OrPagination.vue_vue_type_script_lang-c96d7cd7.js} +1 -1
- package/dist/bundled/v3/{OrRadio.vue_vue_type_script_lang-29e8b856.js → OrRadio.vue_vue_type_script_lang-2e666a56.js} +7 -22
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-f5f127f6.js → OrSearch.vue_vue_type_script_lang-06f318ca.js} +2 -2
- package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-8092d0c0.js → OrSelect.vue_vue_type_script_lang-58e5a52b.js} +15 -17
- package/dist/bundled/v3/{OrSwitch.vue_vue_type_script_lang-02b4913a.js → OrSwitch.vue_vue_type_script_lang-04829f64.js} +7 -22
- package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-01188224.js → OrTabs.vue_vue_type_script_lang-61b79a5a.js} +1 -1
- package/dist/bundled/v3/{OrTextarea.vue_vue_type_script_lang-2fdac7b2.js → OrTextarea.vue_vue_type_script_lang-8e3531cd.js} +12 -31
- package/dist/bundled/v3/components/index.js +14 -16
- package/dist/bundled/v3/components/or-card-collection-v3/index.js +4 -6
- package/dist/bundled/v3/components/or-checkbox-v3/OrCheckbox.vue.d.ts +2 -18
- package/dist/bundled/v3/components/or-checkbox-v3/index.js +1 -2
- package/dist/bundled/v3/components/or-confirm-v3/index.js +4 -6
- package/dist/bundled/v3/components/or-inline-input-v3/OrInlineInput.vue.d.ts +6 -36
- package/dist/bundled/v3/components/or-inline-input-v3/index.js +1 -3
- package/dist/bundled/v3/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +6 -36
- package/dist/bundled/v3/components/or-inline-textarea-v3/index.js +1 -3
- package/dist/bundled/v3/components/or-input-v3/OrInput.vue.d.ts +8 -43
- package/dist/bundled/v3/components/or-input-v3/index.js +1 -3
- package/dist/bundled/v3/components/or-pagination-v3/index.js +1 -1
- package/dist/bundled/v3/components/or-radio-v3/OrRadio.vue.d.ts +2 -18
- package/dist/bundled/v3/components/or-radio-v3/index.js +1 -2
- package/dist/bundled/v3/components/or-search-v3/index.js +3 -5
- package/dist/bundled/v3/components/or-select-v3/index.js +4 -6
- package/dist/bundled/v3/components/or-switch-v3/OrSwitch.vue.d.ts +2 -18
- package/dist/bundled/v3/components/or-switch-v3/index.js +1 -2
- package/dist/bundled/v3/components/or-tabs-v3/index.js +1 -1
- package/dist/bundled/v3/components/or-textarea-v3/OrTextarea.vue.d.ts +6 -45
- package/dist/bundled/v3/components/or-textarea-v3/index.js +1 -3
- package/dist/bundled/v3/hooks/index.d.ts +0 -3
- package/dist/bundled/v3/hooks/index.js +0 -2
- package/dist/bundled/v3/index.js +69 -78
- package/dist/esm/v2/{OrCardCollection-d51e15f5.js → OrCardCollection-3c38fc85.js} +1 -1
- package/dist/esm/v2/{OrCheckbox-7317fe1a.js → OrCheckbox-567e387c.js} +17 -32
- package/dist/esm/v2/{OrConfirm-fe4f21bf.js → OrConfirm-047d4086.js} +13 -6
- package/dist/esm/v2/{OrInlineInput-7c4f1f92.js → OrInlineInput-10205811.js} +22 -38
- package/dist/esm/v2/{OrInlineTextarea-3381e2a9.js → OrInlineTextarea-7658611e.js} +18 -34
- package/dist/esm/v2/{OrInput-fbbf5de4.js → OrInput-ada3a970.js} +31 -42
- package/dist/esm/v2/{OrPagination-291bd1b9.js → OrPagination-c0dbec6a.js} +1 -1
- package/dist/esm/v2/{OrRadio-b0a560d2.js → OrRadio-848ce55d.js} +15 -30
- package/dist/esm/v2/{OrSearch-9e3dc7b2.js → OrSearch-0f08f2f5.js} +1 -1
- package/dist/esm/v2/{OrSelect-6d3c3d2a.js → OrSelect-1d705445.js} +2 -2
- package/dist/esm/v2/{OrSwitch-133052ca.js → OrSwitch-13b6a7ee.js} +15 -30
- package/dist/esm/v2/{OrTabs-e5b81f4b.js → OrTabs-71bd3fd2.js} +1 -1
- package/dist/esm/v2/{OrTextarea-709eea9b.js → OrTextarea-6712a150.js} +20 -40
- package/dist/esm/v2/components/index.js +13 -15
- package/dist/esm/v2/components/or-card-collection-v3/index.js +3 -5
- package/dist/esm/v2/components/or-checkbox-v3/OrCheckbox.vue.d.ts +2 -18
- package/dist/esm/v2/components/or-checkbox-v3/index.js +1 -2
- package/dist/esm/v2/components/or-confirm-v3/index.js +8 -10
- package/dist/esm/v2/components/or-inline-input-v3/OrInlineInput.vue.d.ts +6 -36
- package/dist/esm/v2/components/or-inline-input-v3/index.js +1 -3
- package/dist/esm/v2/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +6 -36
- package/dist/esm/v2/components/or-inline-textarea-v3/index.js +1 -3
- package/dist/esm/v2/components/or-input-v3/OrInput.vue.d.ts +8 -43
- package/dist/esm/v2/components/or-input-v3/index.js +1 -3
- package/dist/esm/v2/components/or-pagination-v3/index.js +1 -1
- package/dist/esm/v2/components/or-radio-v3/OrRadio.vue.d.ts +2 -18
- package/dist/esm/v2/components/or-radio-v3/index.js +1 -2
- package/dist/esm/v2/components/or-search-v3/index.js +2 -4
- package/dist/esm/v2/components/or-select-v3/index.js +3 -5
- package/dist/esm/v2/components/or-switch-v3/OrSwitch.vue.d.ts +2 -18
- package/dist/esm/v2/components/or-switch-v3/index.js +1 -2
- package/dist/esm/v2/components/or-tabs-v3/index.js +1 -1
- package/dist/esm/v2/components/or-textarea-v3/OrTextarea.vue.d.ts +6 -45
- package/dist/esm/v2/components/or-textarea-v3/index.js +1 -3
- package/dist/esm/v2/hooks/index.d.ts +0 -3
- package/dist/esm/v2/hooks/index.js +0 -2
- package/dist/esm/v2/index.js +13 -15
- package/dist/esm/v3/{OrCardCollection-14faa91f.js → OrCardCollection-dbb3e839.js} +1 -1
- package/dist/esm/v3/{OrCheckbox-7144da06.js → OrCheckbox-3e139eac.js} +19 -36
- package/dist/esm/v3/{OrConfirm-671d4ff7.js → OrConfirm-fee3c859.js} +13 -6
- package/dist/esm/v3/{OrInlineInput-a6b19dbe.js → OrInlineInput-507fc99c.js} +20 -37
- package/dist/esm/v3/{OrInlineTextarea-9eb60363.js → OrInlineTextarea-53a9e027.js} +20 -37
- package/dist/esm/v3/{OrInput-8332b985.js → OrInput-9c0426b9.js} +27 -39
- package/dist/esm/v3/{OrPagination-5e01a0a5.js → OrPagination-a703307d.js} +1 -1
- package/dist/esm/v3/{OrRadio-39d1905d.js → OrRadio-54b6d0de.js} +17 -34
- package/dist/esm/v3/{OrSearch-875646f5.js → OrSearch-9885d178.js} +1 -1
- package/dist/esm/v3/{OrSelect-1a71fec6.js → OrSelect-dfa4885f.js} +2 -2
- package/dist/esm/v3/{OrSwitch-3e9a699d.js → OrSwitch-cca30aa0.js} +18 -34
- package/dist/esm/v3/{OrTabs-91618aab.js → OrTabs-d0ee6cef.js} +1 -1
- package/dist/esm/v3/{OrTextarea-d0892f73.js → OrTextarea-bb9ef3f2.js} +22 -43
- package/dist/esm/v3/components/index.js +13 -15
- package/dist/esm/v3/components/or-card-collection-v3/index.js +3 -5
- package/dist/esm/v3/components/or-checkbox-v3/OrCheckbox.vue.d.ts +2 -18
- package/dist/esm/v3/components/or-checkbox-v3/index.js +1 -2
- package/dist/esm/v3/components/or-confirm-v3/index.js +7 -9
- package/dist/esm/v3/components/or-inline-input-v3/OrInlineInput.vue.d.ts +6 -36
- package/dist/esm/v3/components/or-inline-input-v3/index.js +1 -3
- package/dist/esm/v3/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +6 -36
- package/dist/esm/v3/components/or-inline-textarea-v3/index.js +1 -3
- package/dist/esm/v3/components/or-input-v3/OrInput.vue.d.ts +8 -43
- package/dist/esm/v3/components/or-input-v3/index.js +1 -3
- package/dist/esm/v3/components/or-pagination-v3/index.js +1 -1
- package/dist/esm/v3/components/or-radio-v3/OrRadio.vue.d.ts +2 -18
- package/dist/esm/v3/components/or-radio-v3/index.js +1 -2
- package/dist/esm/v3/components/or-search-v3/index.js +2 -4
- package/dist/esm/v3/components/or-select-v3/index.js +3 -5
- package/dist/esm/v3/components/or-switch-v3/OrSwitch.vue.d.ts +2 -18
- package/dist/esm/v3/components/or-switch-v3/index.js +1 -2
- package/dist/esm/v3/components/or-tabs-v3/index.js +1 -1
- package/dist/esm/v3/components/or-textarea-v3/OrTextarea.vue.d.ts +6 -45
- package/dist/esm/v3/components/or-textarea-v3/index.js +1 -3
- package/dist/esm/v3/hooks/index.d.ts +0 -3
- package/dist/esm/v3/hooks/index.js +0 -2
- package/dist/esm/v3/index.js +13 -15
- package/package.json +1 -1
- package/src/components/or-checkbox-v3/OrCheckbox.vue +10 -28
- package/src/components/or-confirm-v3/OrConfirm.vue +11 -10
- package/src/components/or-confirm-v3/styles.ts +13 -3
- package/src/components/or-inline-input-v3/OrInlineInput.vue +13 -32
- package/src/components/or-inline-textarea-v3/OrInlineTextarea.vue +13 -32
- package/src/components/or-input-v3/OrInput.stories3.ts +4 -4
- package/src/components/or-input-v3/OrInput.vue +20 -33
- package/src/components/or-pagination-v3/OrPagination.vue +1 -1
- package/src/components/or-radio-v3/OrRadio.vue +9 -27
- package/src/components/or-switch-v3/OrSwitch.vue +9 -27
- package/src/components/or-tabs-v3/OrTabs.vue +1 -1
- package/src/components/or-textarea-v3/OrTextarea.stories3.ts +4 -4
- package/src/components/or-textarea-v3/OrTextarea.vue +14 -37
- package/src/hooks/index.ts +0 -3
- package/dist/bundled/v2/hooks/useControlAttributes.d.ts +0 -8
- package/dist/bundled/v2/hooks/useIdAttribute.d.ts +0 -2
- package/dist/bundled/v2/hooks/useValidationAttributes.d.ts +0 -12
- package/dist/bundled/v2/useIdAttribute-cf61643f.js +0 -22
- package/dist/bundled/v2/useValidationAttributes-6df7bcf9.js +0 -17
- package/dist/bundled/v3/hooks/useControlAttributes.d.ts +0 -8
- package/dist/bundled/v3/hooks/useIdAttribute.d.ts +0 -2
- package/dist/bundled/v3/hooks/useValidationAttributes.d.ts +0 -12
- package/dist/bundled/v3/useIdAttribute-b2e42f31.js +0 -21
- package/dist/bundled/v3/useValidationAttributes-5428d8fa.js +0 -16
- package/dist/esm/v2/hooks/useControlAttributes.d.ts +0 -8
- package/dist/esm/v2/hooks/useIdAttribute.d.ts +0 -2
- package/dist/esm/v2/hooks/useValidationAttributes.d.ts +0 -12
- package/dist/esm/v2/useIdAttribute-859439f0.js +0 -21
- package/dist/esm/v2/useValidationAttributes-d1abbe34.js +0 -16
- package/dist/esm/v3/hooks/useControlAttributes.d.ts +0 -8
- package/dist/esm/v3/hooks/useIdAttribute.d.ts +0 -2
- package/dist/esm/v3/hooks/useValidationAttributes.d.ts +0 -12
- package/dist/esm/v3/useIdAttribute-859439f0.js +0 -21
- package/dist/esm/v3/useValidationAttributes-d1abbe34.js +0 -16
- package/src/hooks/useControlAttributes.ts +0 -19
- package/src/hooks/useIdAttribute.ts +0 -9
- package/src/hooks/useValidationAttributes.ts +0 -25
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
ref="root"
|
|
4
|
-
v-bind="$attrs"
|
|
5
4
|
:class="rootStyles"
|
|
6
5
|
>
|
|
7
6
|
<div :class="['layout-row', 'gap-sm+']">
|
|
@@ -10,9 +9,9 @@
|
|
|
10
9
|
:invalid="invalid"
|
|
11
10
|
>
|
|
12
11
|
<input
|
|
13
|
-
|
|
12
|
+
:id="controlId"
|
|
14
13
|
v-model="draftModelValue"
|
|
15
|
-
v-bind="
|
|
14
|
+
v-bind="$attrs"
|
|
16
15
|
:class="controlStyles"
|
|
17
16
|
:type="type"
|
|
18
17
|
:placeholder="placeholder"
|
|
@@ -72,8 +71,8 @@
|
|
|
72
71
|
</template>
|
|
73
72
|
|
|
74
73
|
<script lang="ts">
|
|
75
|
-
import { computed, defineComponent,
|
|
76
|
-
import { useClassAttribute
|
|
74
|
+
import { computed, defineComponent, getCurrentInstance, PropType, ref, watch } from 'vue-demi';
|
|
75
|
+
import { useClassAttribute } from '../../hooks';
|
|
77
76
|
import { OrErrorV3 as OrError } from '../or-error-v3';
|
|
78
77
|
import { OrHintV3 as OrHint } from '../or-hint-v3';
|
|
79
78
|
import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
|
|
@@ -147,15 +146,13 @@ export default defineComponent({
|
|
|
147
146
|
|
|
148
147
|
expose: [
|
|
149
148
|
'root',
|
|
150
|
-
|
|
151
|
-
'focus',
|
|
152
|
-
'blur',
|
|
153
149
|
],
|
|
154
150
|
|
|
155
151
|
setup(props, context) {
|
|
152
|
+
const currentInstance = getCurrentInstance()!;
|
|
153
|
+
|
|
156
154
|
// Refs
|
|
157
155
|
const root = ref<HTMLElement>();
|
|
158
|
-
const control = ref<HTMLInputElement>();
|
|
159
156
|
|
|
160
157
|
// Styles
|
|
161
158
|
const classAttribute = useClassAttribute();
|
|
@@ -176,11 +173,7 @@ export default defineComponent({
|
|
|
176
173
|
]);
|
|
177
174
|
|
|
178
175
|
// State
|
|
179
|
-
const
|
|
180
|
-
id: useIdAttribute(),
|
|
181
|
-
...useControlAttributes(),
|
|
182
|
-
...useValidationAttributes(),
|
|
183
|
-
});
|
|
176
|
+
const controlId = ref(context.attrs.id as string ?? currentInstance.uid.toString());
|
|
184
177
|
|
|
185
178
|
const proxyModelValue = computed({
|
|
186
179
|
get: () => {
|
|
@@ -195,12 +188,11 @@ export default defineComponent({
|
|
|
195
188
|
|
|
196
189
|
const draftModelValue = ref<string | number>('');
|
|
197
190
|
|
|
198
|
-
const
|
|
199
|
-
const maxLength = computed(() => controlAttributes.maxlength);
|
|
200
|
-
|
|
191
|
+
const activated = ref(false);
|
|
201
192
|
const invalid = computed(() => !!props.error);
|
|
202
193
|
|
|
203
|
-
const
|
|
194
|
+
const currentLength = computed(() => draftModelValue.value?.toString().length ?? 0);
|
|
195
|
+
const maxLength = computed(() => context.attrs.maxlength as number | undefined);
|
|
204
196
|
|
|
205
197
|
// Handlers
|
|
206
198
|
function onFocus(event: Event): void {
|
|
@@ -218,14 +210,6 @@ export default defineComponent({
|
|
|
218
210
|
}
|
|
219
211
|
|
|
220
212
|
// Methods
|
|
221
|
-
function focus(): void {
|
|
222
|
-
control.value?.focus();
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function blur(): void {
|
|
226
|
-
control.value?.blur();
|
|
227
|
-
}
|
|
228
|
-
|
|
229
213
|
function apply(): void {
|
|
230
214
|
if (draftModelValue.value !== proxyModelValue.value) {
|
|
231
215
|
proxyModelValue.value = draftModelValue.value;
|
|
@@ -249,21 +233,18 @@ export default defineComponent({
|
|
|
249
233
|
|
|
250
234
|
return {
|
|
251
235
|
root,
|
|
252
|
-
control,
|
|
253
236
|
rootStyles,
|
|
254
237
|
controlStyles,
|
|
255
238
|
actionStyles,
|
|
256
|
-
|
|
239
|
+
controlId,
|
|
257
240
|
proxyModelValue,
|
|
258
241
|
draftModelValue,
|
|
242
|
+
activated,
|
|
243
|
+
invalid,
|
|
259
244
|
currentLength,
|
|
260
245
|
maxLength,
|
|
261
|
-
invalid,
|
|
262
|
-
activated,
|
|
263
246
|
onFocus,
|
|
264
247
|
onBlur,
|
|
265
|
-
focus,
|
|
266
|
-
blur,
|
|
267
248
|
apply,
|
|
268
249
|
reset,
|
|
269
250
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
ref="root"
|
|
4
|
-
v-bind="$attrs"
|
|
5
4
|
:class="rootStyles"
|
|
6
5
|
>
|
|
7
6
|
<div :class="['layout-row', 'gap-sm+']">
|
|
@@ -10,9 +9,9 @@
|
|
|
10
9
|
:invalid="invalid"
|
|
11
10
|
>
|
|
12
11
|
<textarea
|
|
13
|
-
|
|
12
|
+
:id="controlId"
|
|
14
13
|
v-model="draftModelValue"
|
|
15
|
-
v-bind="
|
|
14
|
+
v-bind="$attrs"
|
|
16
15
|
:class="controlStyles"
|
|
17
16
|
:placeholder="placeholder"
|
|
18
17
|
:activated="activated ? '' : null"
|
|
@@ -71,8 +70,8 @@
|
|
|
71
70
|
</template>
|
|
72
71
|
|
|
73
72
|
<script lang="ts">
|
|
74
|
-
import { computed, defineComponent,
|
|
75
|
-
import { useClassAttribute
|
|
73
|
+
import { computed, defineComponent, getCurrentInstance, ref, watch } from 'vue-demi';
|
|
74
|
+
import { useClassAttribute } from '../../hooks';
|
|
76
75
|
import { OrErrorV3 as OrError } from '../or-error-v3';
|
|
77
76
|
import { OrHintV3 as OrHint } from '../or-hint-v3';
|
|
78
77
|
import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
|
|
@@ -135,15 +134,13 @@ export default defineComponent({
|
|
|
135
134
|
|
|
136
135
|
expose: [
|
|
137
136
|
'root',
|
|
138
|
-
|
|
139
|
-
'focus',
|
|
140
|
-
'blur',
|
|
141
137
|
],
|
|
142
138
|
|
|
143
139
|
setup(props, context) {
|
|
140
|
+
const currentInstance = getCurrentInstance()!;
|
|
141
|
+
|
|
144
142
|
// Refs
|
|
145
143
|
const root = ref<HTMLElement>();
|
|
146
|
-
const control = ref<HTMLTextAreaElement>();
|
|
147
144
|
|
|
148
145
|
// Styles
|
|
149
146
|
const classAttribute = useClassAttribute();
|
|
@@ -163,11 +160,7 @@ export default defineComponent({
|
|
|
163
160
|
]);
|
|
164
161
|
|
|
165
162
|
// State
|
|
166
|
-
const
|
|
167
|
-
id: useIdAttribute(),
|
|
168
|
-
...useControlAttributes(),
|
|
169
|
-
...useValidationAttributes(),
|
|
170
|
-
});
|
|
163
|
+
const controlId = ref(context.attrs.id as string ?? currentInstance.uid.toString());
|
|
171
164
|
|
|
172
165
|
const proxyModelValue = computed({
|
|
173
166
|
get: () => {
|
|
@@ -182,12 +175,11 @@ export default defineComponent({
|
|
|
182
175
|
|
|
183
176
|
const draftModelValue = ref<string>('');
|
|
184
177
|
|
|
185
|
-
const
|
|
186
|
-
const maxLength = computed(() => controlAttributes.maxlength);
|
|
187
|
-
|
|
178
|
+
const activated = ref(false);
|
|
188
179
|
const invalid = computed(() => !!props.error);
|
|
189
180
|
|
|
190
|
-
const
|
|
181
|
+
const currentLength = computed(() => draftModelValue.value?.toString().length ?? 0);
|
|
182
|
+
const maxLength = computed(() => context.attrs.maxlength as number | undefined);
|
|
191
183
|
|
|
192
184
|
// Handlers
|
|
193
185
|
function onFocus(event: Event): void {
|
|
@@ -205,14 +197,6 @@ export default defineComponent({
|
|
|
205
197
|
}
|
|
206
198
|
|
|
207
199
|
// Methods
|
|
208
|
-
function focus(): void {
|
|
209
|
-
control.value?.focus();
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function blur(): void {
|
|
213
|
-
control.value?.blur();
|
|
214
|
-
}
|
|
215
|
-
|
|
216
200
|
function apply(): void {
|
|
217
201
|
if (draftModelValue.value !== proxyModelValue.value) {
|
|
218
202
|
proxyModelValue.value = draftModelValue.value;
|
|
@@ -236,21 +220,18 @@ export default defineComponent({
|
|
|
236
220
|
|
|
237
221
|
return {
|
|
238
222
|
root,
|
|
239
|
-
control,
|
|
240
223
|
rootStyles,
|
|
241
224
|
controlStyles,
|
|
242
225
|
actionStyles,
|
|
243
|
-
|
|
226
|
+
controlId,
|
|
244
227
|
proxyModelValue,
|
|
245
228
|
draftModelValue,
|
|
229
|
+
activated,
|
|
230
|
+
invalid,
|
|
246
231
|
currentLength,
|
|
247
232
|
maxLength,
|
|
248
|
-
invalid,
|
|
249
|
-
activated,
|
|
250
233
|
onFocus,
|
|
251
234
|
onBlur,
|
|
252
|
-
focus,
|
|
253
|
-
blur,
|
|
254
235
|
apply,
|
|
255
236
|
reset,
|
|
256
237
|
};
|
|
@@ -17,6 +17,10 @@ export default {
|
|
|
17
17
|
control: { type: 'text' },
|
|
18
18
|
},
|
|
19
19
|
|
|
20
|
+
readonly: {
|
|
21
|
+
control: { type: 'boolean' },
|
|
22
|
+
},
|
|
23
|
+
|
|
20
24
|
maxlength: {
|
|
21
25
|
control: { type: 'number' },
|
|
22
26
|
},
|
|
@@ -70,10 +74,6 @@ export default {
|
|
|
70
74
|
control: { type: 'boolean' },
|
|
71
75
|
},
|
|
72
76
|
|
|
73
|
-
readonly: {
|
|
74
|
-
control: { type: 'boolean' },
|
|
75
|
-
},
|
|
76
|
-
|
|
77
77
|
disabled: {
|
|
78
78
|
control: { type: 'boolean' },
|
|
79
79
|
},
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
ref="root"
|
|
4
|
-
v-bind="$attrs"
|
|
5
4
|
:class="rootStyles"
|
|
6
5
|
>
|
|
7
6
|
<template v-if="label">
|
|
8
7
|
<OrLabel
|
|
9
|
-
:control-id="
|
|
8
|
+
:control-id="controlId"
|
|
10
9
|
:variant="'input'"
|
|
11
10
|
:required="required"
|
|
12
11
|
:disabled="disabled"
|
|
@@ -27,14 +26,14 @@
|
|
|
27
26
|
:disabled="disabled"
|
|
28
27
|
>
|
|
29
28
|
<input
|
|
30
|
-
|
|
29
|
+
:id="controlId"
|
|
30
|
+
ref="input"
|
|
31
31
|
v-model="proxyModelValue"
|
|
32
|
-
v-bind="
|
|
32
|
+
v-bind="$attrs"
|
|
33
33
|
:class="controlStyles"
|
|
34
34
|
:type="type === 'password' && disclosed ? 'text' : type"
|
|
35
35
|
:placeholder="placeholder"
|
|
36
36
|
:required="required"
|
|
37
|
-
:readonly="readonly"
|
|
38
37
|
:disabled="disabled"
|
|
39
38
|
@keydown="$emit('keydown', $event)"
|
|
40
39
|
@keyup="$emit('keyup', $event)"
|
|
@@ -57,7 +56,7 @@
|
|
|
57
56
|
<OrIconButton
|
|
58
57
|
:icon="'close'"
|
|
59
58
|
:color="'inherit'"
|
|
60
|
-
:disabled="
|
|
59
|
+
:disabled="disabled"
|
|
61
60
|
@click.stop="$emit('update:modelValue', '')"
|
|
62
61
|
/>
|
|
63
62
|
</template>
|
|
@@ -103,8 +102,8 @@
|
|
|
103
102
|
</template>
|
|
104
103
|
|
|
105
104
|
<script lang="ts">
|
|
106
|
-
import { computed, defineComponent,
|
|
107
|
-
import { useClassAttribute
|
|
105
|
+
import { computed, defineComponent, getCurrentInstance, PropType, ref } from 'vue-demi';
|
|
106
|
+
import { useClassAttribute } from '../../hooks';
|
|
108
107
|
import { OrErrorV3 as OrError } from '../or-error-v3';
|
|
109
108
|
import { OrHintV3 as OrHint } from '../or-hint-v3';
|
|
110
109
|
import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
|
|
@@ -174,11 +173,6 @@ export default defineComponent({
|
|
|
174
173
|
default: false,
|
|
175
174
|
},
|
|
176
175
|
|
|
177
|
-
readonly: {
|
|
178
|
-
type: Boolean,
|
|
179
|
-
default: false,
|
|
180
|
-
},
|
|
181
|
-
|
|
182
176
|
disabled: {
|
|
183
177
|
type: Boolean,
|
|
184
178
|
default: false,
|
|
@@ -202,15 +196,15 @@ export default defineComponent({
|
|
|
202
196
|
|
|
203
197
|
expose: [
|
|
204
198
|
'root',
|
|
205
|
-
|
|
206
199
|
'focus',
|
|
207
|
-
'blur',
|
|
208
200
|
],
|
|
209
201
|
|
|
210
202
|
setup(props, context) {
|
|
203
|
+
const currentInstance = getCurrentInstance()!;
|
|
204
|
+
|
|
211
205
|
// Refs
|
|
212
206
|
const root = ref<HTMLElement>();
|
|
213
|
-
const
|
|
207
|
+
const input = ref<HTMLInputElement>();
|
|
214
208
|
|
|
215
209
|
// Styles
|
|
216
210
|
const classAttribute = useClassAttribute();
|
|
@@ -226,11 +220,7 @@ export default defineComponent({
|
|
|
226
220
|
]);
|
|
227
221
|
|
|
228
222
|
// State
|
|
229
|
-
const
|
|
230
|
-
id: useIdAttribute(),
|
|
231
|
-
...useControlAttributes(),
|
|
232
|
-
...useValidationAttributes(),
|
|
233
|
-
});
|
|
223
|
+
const controlId = ref(context.attrs.id as string ?? currentInstance.uid.toString());
|
|
234
224
|
|
|
235
225
|
const proxyModelValue = computed({
|
|
236
226
|
get: () => {
|
|
@@ -243,35 +233,32 @@ export default defineComponent({
|
|
|
243
233
|
},
|
|
244
234
|
});
|
|
245
235
|
|
|
246
|
-
const currentLength = computed(() => proxyModelValue.value?.toString().length ?? 0);
|
|
247
|
-
const maxLength = computed(() => controlAttributes.maxlength);
|
|
248
|
-
|
|
249
236
|
const invalid = computed(() => !!props.error);
|
|
237
|
+
const readonly = computed(() => context.attrs.readonly as boolean);
|
|
238
|
+
|
|
239
|
+
const currentLength = computed(() => proxyModelValue.value?.toString().length ?? 0);
|
|
240
|
+
const maxLength = computed(() => context.attrs.maxlength as number | undefined);
|
|
250
241
|
|
|
251
242
|
const disclosed = ref(false);
|
|
252
243
|
|
|
253
244
|
// Methods
|
|
254
245
|
function focus(): void {
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
function blur(): void {
|
|
259
|
-
control.value?.blur();
|
|
246
|
+
input.value?.focus();
|
|
260
247
|
}
|
|
261
248
|
|
|
262
249
|
return {
|
|
263
250
|
root,
|
|
264
|
-
|
|
251
|
+
input,
|
|
265
252
|
rootStyles,
|
|
266
253
|
controlStyles,
|
|
267
|
-
|
|
254
|
+
controlId,
|
|
268
255
|
proxyModelValue,
|
|
256
|
+
invalid,
|
|
257
|
+
readonly,
|
|
269
258
|
currentLength,
|
|
270
259
|
maxLength,
|
|
271
|
-
invalid,
|
|
272
260
|
disclosed,
|
|
273
261
|
focus,
|
|
274
|
-
blur,
|
|
275
262
|
};
|
|
276
263
|
},
|
|
277
264
|
});
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
ref="root"
|
|
4
|
-
v-bind="$attrs"
|
|
5
4
|
:class="rootStyles"
|
|
6
5
|
>
|
|
7
6
|
<input
|
|
8
|
-
|
|
7
|
+
v-bind="$attrs"
|
|
8
|
+
:id="controlId"
|
|
9
9
|
v-model="proxyModelValue"
|
|
10
|
-
v-bind="controlAttributes"
|
|
11
10
|
:class="controlStyles"
|
|
12
11
|
type="radio"
|
|
13
12
|
:value="inputValue"
|
|
@@ -19,7 +18,7 @@
|
|
|
19
18
|
|
|
20
19
|
<template v-if="$slots.default || label">
|
|
21
20
|
<OrLabel
|
|
22
|
-
:control-id="
|
|
21
|
+
:control-id="controlId"
|
|
23
22
|
:variant="labelVariant"
|
|
24
23
|
:required="required"
|
|
25
24
|
:disabled="disabled"
|
|
@@ -35,8 +34,8 @@
|
|
|
35
34
|
</template>
|
|
36
35
|
|
|
37
36
|
<script lang="ts">
|
|
38
|
-
import { computed, defineComponent,
|
|
39
|
-
import { useClassAttribute
|
|
37
|
+
import { computed, defineComponent, getCurrentInstance, PropType, ref } from 'vue-demi';
|
|
38
|
+
import { useClassAttribute } from '../../hooks';
|
|
40
39
|
import { LabelVariant, OrLabelV3 as OrLabel } from '../or-label-v3';
|
|
41
40
|
import { RadioControl, RadioControlHandle, RadioRoot } from './styles';
|
|
42
41
|
|
|
@@ -96,15 +95,13 @@ export default defineComponent({
|
|
|
96
95
|
|
|
97
96
|
expose: [
|
|
98
97
|
'root',
|
|
99
|
-
|
|
100
|
-
'focus',
|
|
101
|
-
'blur',
|
|
102
98
|
],
|
|
103
99
|
|
|
104
100
|
setup(props, context) {
|
|
101
|
+
const currentInstance = getCurrentInstance()!;
|
|
102
|
+
|
|
105
103
|
// Refs
|
|
106
104
|
const root = ref<HTMLElement>();
|
|
107
|
-
const control = ref<HTMLInputElement>();
|
|
108
105
|
|
|
109
106
|
// Styles
|
|
110
107
|
const classAttribute = useClassAttribute();
|
|
@@ -121,10 +118,7 @@ export default defineComponent({
|
|
|
121
118
|
]);
|
|
122
119
|
|
|
123
120
|
// State
|
|
124
|
-
const
|
|
125
|
-
id: useIdAttribute(),
|
|
126
|
-
...useControlAttributes(),
|
|
127
|
-
});
|
|
121
|
+
const controlId = ref(context.attrs.id as string ?? currentInstance.uid.toString());
|
|
128
122
|
|
|
129
123
|
const proxyModelValue = computed({
|
|
130
124
|
get: () => {
|
|
@@ -137,24 +131,12 @@ export default defineComponent({
|
|
|
137
131
|
},
|
|
138
132
|
});
|
|
139
133
|
|
|
140
|
-
// Methods
|
|
141
|
-
function focus(): void {
|
|
142
|
-
control.value?.focus();
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function blur(): void {
|
|
146
|
-
control.value?.blur();
|
|
147
|
-
}
|
|
148
|
-
|
|
149
134
|
return {
|
|
150
135
|
root,
|
|
151
|
-
control,
|
|
152
136
|
rootStyles,
|
|
153
137
|
controlStyles,
|
|
154
|
-
|
|
138
|
+
controlId,
|
|
155
139
|
proxyModelValue,
|
|
156
|
-
focus,
|
|
157
|
-
blur,
|
|
158
140
|
};
|
|
159
141
|
},
|
|
160
142
|
});
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
ref="root"
|
|
4
|
-
v-bind="$attrs"
|
|
5
4
|
:class="rootStyles"
|
|
6
5
|
>
|
|
7
6
|
<template v-if="!loading">
|
|
8
7
|
<input
|
|
9
|
-
|
|
8
|
+
v-bind="$attrs"
|
|
9
|
+
:id="controlId"
|
|
10
10
|
v-model="proxyModelValue"
|
|
11
|
-
v-bind="controlAttributes"
|
|
12
11
|
:class="controlStyles"
|
|
13
12
|
type="checkbox"
|
|
14
13
|
:value="inputValue"
|
|
@@ -34,7 +33,7 @@
|
|
|
34
33
|
|
|
35
34
|
<template v-if="$slots.default || label">
|
|
36
35
|
<OrLabel
|
|
37
|
-
:control-id="
|
|
36
|
+
:control-id="controlId"
|
|
38
37
|
:variant="labelVariant"
|
|
39
38
|
:required="required"
|
|
40
39
|
:disabled="disabled"
|
|
@@ -50,8 +49,8 @@
|
|
|
50
49
|
</template>
|
|
51
50
|
|
|
52
51
|
<script lang="ts">
|
|
53
|
-
import { computed, defineComponent,
|
|
54
|
-
import { useClassAttribute
|
|
52
|
+
import { computed, defineComponent, getCurrentInstance, PropType, ref } from 'vue-demi';
|
|
53
|
+
import { useClassAttribute } from '../../hooks';
|
|
55
54
|
import { LabelVariant, OrLabelV3 as OrLabel } from '../or-label-v3';
|
|
56
55
|
import { OrLoaderV3 as OrLoader } from '../or-loader-v3';
|
|
57
56
|
import { SwitchControl, SwitchControlHandle, SwitchLoader, SwitchLoaderHandle, SwitchRoot } from './styles';
|
|
@@ -118,15 +117,13 @@ export default defineComponent({
|
|
|
118
117
|
|
|
119
118
|
expose: [
|
|
120
119
|
'root',
|
|
121
|
-
|
|
122
|
-
'focus',
|
|
123
|
-
'blur',
|
|
124
120
|
],
|
|
125
121
|
|
|
126
122
|
setup(props, context) {
|
|
123
|
+
const currentInstance = getCurrentInstance()!;
|
|
124
|
+
|
|
127
125
|
// Refs
|
|
128
126
|
const root = ref<HTMLElement>();
|
|
129
|
-
const control = ref<HTMLInputElement>();
|
|
130
127
|
|
|
131
128
|
// Styles
|
|
132
129
|
const classAttribute = useClassAttribute();
|
|
@@ -148,10 +145,7 @@ export default defineComponent({
|
|
|
148
145
|
]);
|
|
149
146
|
|
|
150
147
|
// State
|
|
151
|
-
const
|
|
152
|
-
id: useIdAttribute(),
|
|
153
|
-
...useControlAttributes(),
|
|
154
|
-
});
|
|
148
|
+
const controlId = ref(context.attrs.id as string ?? currentInstance.uid.toString());
|
|
155
149
|
|
|
156
150
|
const proxyModelValue = computed({
|
|
157
151
|
get: () => {
|
|
@@ -164,25 +158,13 @@ export default defineComponent({
|
|
|
164
158
|
},
|
|
165
159
|
});
|
|
166
160
|
|
|
167
|
-
// Methods
|
|
168
|
-
function focus(): void {
|
|
169
|
-
control.value?.focus();
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function blur(): void {
|
|
173
|
-
control.value?.blur();
|
|
174
|
-
}
|
|
175
|
-
|
|
176
161
|
return {
|
|
177
162
|
root,
|
|
178
|
-
control,
|
|
179
163
|
rootStyles,
|
|
180
164
|
controlStyles,
|
|
181
165
|
loaderStyles,
|
|
182
|
-
|
|
166
|
+
controlId,
|
|
183
167
|
proxyModelValue,
|
|
184
|
-
focus,
|
|
185
|
-
blur,
|
|
186
168
|
};
|
|
187
169
|
},
|
|
188
170
|
});
|
|
@@ -139,7 +139,7 @@ export default defineComponent({
|
|
|
139
139
|
|
|
140
140
|
const activeTab = computed(() => props.items.find(({ value }) => value === proxyModelValue.value)!);
|
|
141
141
|
|
|
142
|
-
//
|
|
142
|
+
// Functions
|
|
143
143
|
function rearrangeTabs(items: TabsItem[], activeTab: TabsItem, rootElement: Element): typeof tabs {
|
|
144
144
|
const { children } = rootElement;
|
|
145
145
|
|
|
@@ -16,6 +16,10 @@ export default {
|
|
|
16
16
|
control: { type: 'text' },
|
|
17
17
|
},
|
|
18
18
|
|
|
19
|
+
readonly: {
|
|
20
|
+
control: { type: 'boolean' },
|
|
21
|
+
},
|
|
22
|
+
|
|
19
23
|
maxlength: {
|
|
20
24
|
control: { type: 'number' },
|
|
21
25
|
},
|
|
@@ -64,10 +68,6 @@ export default {
|
|
|
64
68
|
control: { type: 'boolean' },
|
|
65
69
|
},
|
|
66
70
|
|
|
67
|
-
readonly: {
|
|
68
|
-
control: { type: 'boolean' },
|
|
69
|
-
},
|
|
70
|
-
|
|
71
71
|
disabled: {
|
|
72
72
|
control: { type: 'boolean' },
|
|
73
73
|
},
|