@onereach/ui-components 2.69.2-beta.2107.0 → 2.69.2-beta.2113.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/{OrAvatar-2fa559e1.js → OrAvatar-ae61bfb9.js} +41 -15
- package/dist/bundled/v2/{OrCardCollection-3d1b3b9a.js → OrCardCollection-a9a779ea.js} +1 -1
- package/dist/bundled/v2/{OrConfirm-43626f94.js → OrConfirm-18c534df.js} +1 -1
- package/dist/bundled/v2/{OrInput-0a3666aa.js → OrInput-8b90e08f.js} +11 -18
- package/dist/bundled/v2/{OrInputBox-dfdcbdce.js → OrInputBox-79ec54ad.js} +14 -4
- package/dist/bundled/v2/{OrSearch-847c1bab.js → OrSearch-9d402f56.js} +2 -2
- package/dist/bundled/v2/{OrSelect-41c6588d.js → OrSelect-b20a9be0.js} +2 -8
- package/dist/bundled/v2/{OrTextarea-ff2ba975.js → OrTextarea-5593fbe9.js} +1 -2
- package/dist/bundled/v2/components/index.js +8 -9
- package/dist/bundled/v2/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
- package/dist/bundled/v2/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
- package/dist/bundled/v2/components/or-avatar-v3/index.js +2 -1
- package/dist/bundled/v2/components/or-avatar-v3/props.d.ts +2 -1
- package/dist/bundled/v2/components/or-avatar-v3/styles.d.ts +2 -0
- package/dist/bundled/v2/components/or-card-collection-v3/index.js +3 -4
- package/dist/bundled/v2/components/or-confirm-v3/index.js +3 -4
- package/dist/bundled/v2/components/or-input-box-v3/index.js +1 -2
- package/dist/bundled/v2/components/or-input-v3/index.js +2 -3
- package/dist/bundled/v2/components/or-search-v3/index.js +3 -4
- package/dist/bundled/v2/components/or-select-v3/OrSelect.vue.d.ts +0 -11
- package/dist/bundled/v2/components/or-select-v3/index.js +3 -4
- package/dist/bundled/v2/components/or-textarea-v3/index.js +2 -3
- package/dist/bundled/v2/index.js +9 -10
- package/dist/bundled/v3/{OrAvatar.vue_vue_type_script_lang-22e46ce1.js → OrAvatar.vue_vue_type_script_lang-0426862b.js} +35 -13
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-fd4d589f.js → OrCardCollection.vue_vue_type_script_lang-861158b5.js} +4 -4
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-338631e0.js → OrConfirm.vue_vue_type_script_lang-289b5600.js} +2 -2
- package/dist/bundled/v3/{OrIconButton-4bd33e3c.js → OrIconButton-1581013c.js} +1 -1
- package/dist/bundled/v3/{OrIconButton.vue_vue_type_script_lang-641f6e06.js → OrIconButton.vue_vue_type_script_lang-f6f801ff.js} +1 -1
- package/dist/bundled/v3/{OrInlineInput.vue_vue_type_script_lang-3a8189f4.js → OrInlineInput.vue_vue_type_script_lang-f29483f4.js} +2 -2
- package/dist/bundled/v3/{OrInlineTextarea.vue_vue_type_script_lang-890b97ab.js → OrInlineTextarea.vue_vue_type_script_lang-cc40af48.js} +2 -2
- package/dist/bundled/v3/{OrInput-5efc4b9a.js → OrInput-fa782fc1.js} +14 -17
- package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-a9f3e530.js → OrInput.vue_vue_type_script_lang-f6d793d3.js} +4 -5
- package/dist/bundled/v3/{OrInputBox-1b143e00.js → OrInputBox-eb54d73d.js} +1 -1
- package/dist/{esm/v2/OrInputBox.vue_rollup-plugin-vue_script-52a54a49.js → bundled/v3/OrInputBox.vue_vue_type_script_lang-5ee4ee45.js} +4 -5
- package/dist/bundled/v3/{OrModal.vue_vue_type_script_lang-00a477f0.js → OrModal.vue_vue_type_script_lang-80a7b906.js} +2 -2
- package/dist/bundled/v3/OrNotification.vue_vue_type_script_lang-fbb35355.js +2 -2
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-df09cad8.js → OrSearch.vue_vue_type_script_lang-ed78b21f.js} +3 -3
- package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-cf991ed8.js → OrSelect.vue_vue_type_script_lang-15285ce4.js} +5 -10
- package/dist/bundled/v3/{OrTag.vue_vue_type_script_lang-92d9fb12.js → OrTag.vue_vue_type_script_lang-dc6a4011.js} +2 -2
- package/dist/bundled/v3/{OrTextarea.vue_vue_type_script_lang-115a1244.js → OrTextarea.vue_vue_type_script_lang-8e3531cd.js} +2 -3
- package/dist/bundled/v3/{OrToastContainer-afb51e5d.js → OrToastContainer-7c3c0b12.js} +1 -1
- package/dist/bundled/v3/components/index.js +18 -19
- package/dist/bundled/v3/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
- package/dist/bundled/v3/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
- package/dist/bundled/v3/components/or-avatar-v3/index.js +3 -1
- package/dist/bundled/v3/components/or-avatar-v3/props.d.ts +2 -1
- package/dist/bundled/v3/components/or-avatar-v3/styles.d.ts +2 -0
- package/dist/bundled/v3/components/or-card-collection-v3/index.js +7 -8
- package/dist/bundled/v3/components/or-confirm-v3/index.js +7 -8
- package/dist/bundled/v3/components/or-icon-button-v3/index.js +1 -1
- package/dist/bundled/v3/components/or-inline-input-v3/index.js +3 -3
- package/dist/bundled/v3/components/or-inline-textarea-v3/index.js +3 -3
- package/dist/bundled/v3/components/or-input-box-v3/index.js +1 -2
- package/dist/bundled/v3/components/or-input-v3/index.js +5 -6
- package/dist/bundled/v3/components/or-modal-v3/index.js +3 -3
- package/dist/bundled/v3/components/or-notification-v3/index.js +2 -2
- package/dist/bundled/v3/components/or-search-v3/index.js +7 -8
- package/dist/bundled/v3/components/or-select-v3/OrSelect.vue.d.ts +0 -11
- package/dist/bundled/v3/components/or-select-v3/index.js +8 -9
- package/dist/bundled/v3/components/or-tag-v3/index.js +3 -3
- package/dist/bundled/v3/components/or-textarea-v3/index.js +3 -4
- package/dist/bundled/v3/components/or-toast-v3/index.js +4 -4
- package/dist/bundled/v3/index.js +39 -35
- package/dist/bundled/v3/{types-6c5eee23.js → types-dcc78caa.js} +2 -2
- package/dist/esm/v2/{OrAvatar-0afdef36.js → OrAvatar-3d155af3.js} +41 -15
- package/dist/esm/v2/{OrCardCollection-09e4cb8a.js → OrCardCollection-4f001551.js} +1 -1
- package/dist/esm/v2/{OrConfirm-93376443.js → OrConfirm-b0b2e43c.js} +1 -1
- package/dist/esm/v2/{OrInput-f92456ea.js → OrInput-2f16a7ac.js} +11 -18
- package/dist/{bundled/v3/OrInputBox.vue_vue_type_script_lang-70dec655.js → esm/v2/OrInputBox-4d5a318d.js} +57 -6
- package/dist/esm/v2/{OrSearch-4296eecb.js → OrSearch-ddb7c1fe.js} +2 -2
- package/dist/esm/v2/{OrSelect-633a9e09.js → OrSelect-f0ff5a85.js} +2 -8
- package/dist/esm/v2/{OrTextarea-823d0529.js → OrTextarea-6712a150.js} +1 -2
- package/dist/esm/v2/components/index.js +8 -9
- package/dist/esm/v2/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
- package/dist/esm/v2/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
- package/dist/esm/v2/components/or-avatar-v3/index.js +2 -1
- package/dist/esm/v2/components/or-avatar-v3/props.d.ts +2 -1
- package/dist/esm/v2/components/or-avatar-v3/styles.d.ts +2 -0
- package/dist/esm/v2/components/or-card-collection-v3/index.js +3 -4
- package/dist/esm/v2/components/or-confirm-v3/index.js +3 -4
- package/dist/esm/v2/components/or-input-box-v3/index.js +2 -3
- package/dist/esm/v2/components/or-input-v3/index.js +2 -3
- package/dist/esm/v2/components/or-search-v3/index.js +3 -4
- package/dist/esm/v2/components/or-select-v3/OrSelect.vue.d.ts +0 -11
- package/dist/esm/v2/components/or-select-v3/index.js +3 -4
- package/dist/esm/v2/components/or-textarea-v3/index.js +2 -3
- package/dist/esm/v2/index.js +8 -9
- package/dist/esm/v3/{OrAvatar-ef88d31c.js → OrAvatar-53a4429d.js} +43 -16
- package/dist/esm/v3/{OrCardCollection-37226d46.js → OrCardCollection-5a0febaf.js} +1 -1
- package/dist/esm/v3/{OrConfirm-b27e7221.js → OrConfirm-906427ef.js} +1 -1
- package/dist/esm/v3/{OrInput-99776ffe.js → OrInput-41691fb3.js} +14 -17
- package/dist/esm/v3/{OrInputBox-36c102a4.js → OrInputBox-5247ab25.js} +2 -2
- package/dist/esm/v3/{OrSearch-188c643f.js → OrSearch-cdde55ce.js} +2 -2
- package/dist/esm/v3/{OrSelect-cba3966c.js → OrSelect-7e813982.js} +3 -8
- package/dist/esm/v3/{OrTextarea-b3ecc40d.js → OrTextarea-bb9ef3f2.js} +1 -1
- package/dist/esm/v3/components/index.js +8 -8
- package/dist/esm/v3/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
- package/dist/esm/v3/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
- package/dist/esm/v3/components/or-avatar-v3/index.js +2 -1
- package/dist/esm/v3/components/or-avatar-v3/props.d.ts +2 -1
- package/dist/esm/v3/components/or-avatar-v3/styles.d.ts +2 -0
- package/dist/esm/v3/components/or-card-collection-v3/index.js +3 -3
- package/dist/esm/v3/components/or-confirm-v3/index.js +3 -3
- package/dist/esm/v3/components/or-input-box-v3/index.js +1 -1
- package/dist/esm/v3/components/or-input-v3/index.js +2 -2
- package/dist/esm/v3/components/or-search-v3/index.js +3 -3
- package/dist/esm/v3/components/or-select-v3/OrSelect.vue.d.ts +0 -11
- package/dist/esm/v3/components/or-select-v3/index.js +3 -3
- package/dist/esm/v3/components/or-textarea-v3/index.js +2 -2
- package/dist/esm/v3/index.js +8 -8
- package/package.json +2 -2
- package/src/components/or-avatar-v3/OrAvatar.stories3.ts +9 -7
- package/src/components/or-avatar-v3/OrAvatar.vue +22 -2
- package/src/components/or-avatar-v3/props.ts +1 -0
- package/src/components/or-avatar-v3/styles.ts +49 -11
- package/src/components/or-input-box-v3/styles.ts +3 -3
- package/src/components/or-input-v3/OrInput.vue +22 -28
- package/src/components/or-select-v3/OrSelect.stories3.ts +0 -4
- package/src/components/or-select-v3/OrSelect.vue +0 -6
- package/dist/bundled/v2/components/or-combined-input-v3/OrCombinedInput.stories3.d.ts +0 -27
- package/dist/bundled/v2/components/or-combined-input-v3/OrCombinedInput.vue.d.ts +0 -98
- package/dist/bundled/v2/components/or-combined-input-v3/index.d.ts +0 -2
- package/dist/bundled/v2/components/or-combined-input-v3/index.js +0 -149
- package/dist/bundled/v2/components/or-combined-input-v3/props.d.ts +0 -1
- package/dist/bundled/v2/components/or-combined-input-v3/styles.d.ts +0 -2
- package/dist/bundled/v2/props-78496a2d.js +0 -12
- package/dist/bundled/v3/components/or-combined-input-v3/OrCombinedInput.stories3.d.ts +0 -27
- package/dist/bundled/v3/components/or-combined-input-v3/OrCombinedInput.vue.d.ts +0 -98
- package/dist/bundled/v3/components/or-combined-input-v3/index.d.ts +0 -2
- package/dist/bundled/v3/components/or-combined-input-v3/index.js +0 -132
- package/dist/bundled/v3/components/or-combined-input-v3/props.d.ts +0 -1
- package/dist/bundled/v3/components/or-combined-input-v3/styles.d.ts +0 -2
- package/dist/bundled/v3/props-78496a2d.js +0 -12
- package/dist/esm/v2/OrInputBox-ad7c1875.js +0 -43
- package/dist/esm/v2/components/or-combined-input-v3/OrCombinedInput.stories3.d.ts +0 -27
- package/dist/esm/v2/components/or-combined-input-v3/OrCombinedInput.vue.d.ts +0 -98
- package/dist/esm/v2/components/or-combined-input-v3/index.d.ts +0 -2
- package/dist/esm/v2/components/or-combined-input-v3/index.js +0 -147
- package/dist/esm/v2/components/or-combined-input-v3/props.d.ts +0 -1
- package/dist/esm/v2/components/or-combined-input-v3/styles.d.ts +0 -2
- package/dist/esm/v3/components/or-combined-input-v3/OrCombinedInput.stories3.d.ts +0 -27
- package/dist/esm/v3/components/or-combined-input-v3/OrCombinedInput.vue.d.ts +0 -98
- package/dist/esm/v3/components/or-combined-input-v3/index.d.ts +0 -2
- package/dist/esm/v3/components/or-combined-input-v3/index.js +0 -132
- package/dist/esm/v3/components/or-combined-input-v3/props.d.ts +0 -1
- package/dist/esm/v3/components/or-combined-input-v3/styles.d.ts +0 -2
- package/src/components/or-combined-input-v3/OrCombinedInput.docs.mdx +0 -7
- package/src/components/or-combined-input-v3/OrCombinedInput.stories3.ts +0 -202
- package/src/components/or-combined-input-v3/OrCombinedInput.vue +0 -134
- package/src/components/or-combined-input-v3/index.ts +0 -2
- package/src/components/or-combined-input-v3/props.ts +0 -1
- package/src/components/or-combined-input-v3/styles.ts +0 -25
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
-
import { ref, watch } from 'vue-demi';
|
|
3
|
-
import { OrIconV3 as OrIcon } from '../or-icon-v3';
|
|
4
|
-
import { OrInputV3 as OrInput } from '../or-input-v3';
|
|
5
|
-
import { OrSelectV3 as OrSelect, SelectOption } from '../or-select-v3';
|
|
6
|
-
import OrCombinedInputDocs from './OrCombinedInput.docs.mdx';
|
|
7
|
-
import OrCombinedInput from './OrCombinedInput.vue';
|
|
8
|
-
import { CombinedInputSize } from './props';
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
title: 'Components/Forms/Combined Input',
|
|
12
|
-
component: OrCombinedInput,
|
|
13
|
-
|
|
14
|
-
argTypes: {
|
|
15
|
-
// Attrs
|
|
16
|
-
readonly: {
|
|
17
|
-
control: { type: 'boolean' },
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
// Slots
|
|
21
|
-
default: {
|
|
22
|
-
type: {
|
|
23
|
-
name: 'string',
|
|
24
|
-
required: true,
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
control: { type: 'text' },
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
addon: {
|
|
31
|
-
type: {
|
|
32
|
-
name: 'string',
|
|
33
|
-
required: false,
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
control: { type: 'text' },
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
// Props
|
|
40
|
-
size: {
|
|
41
|
-
control: { type: 'select' },
|
|
42
|
-
options: Object.values(CombinedInputSize),
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
label: {
|
|
46
|
-
control: { type: 'text' },
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
hint: {
|
|
50
|
-
control: { type: 'text' },
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
error: {
|
|
54
|
-
control: { type: 'text' },
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
required: {
|
|
58
|
-
control: { type: 'boolean' },
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
disabled: {
|
|
62
|
-
control: { type: 'boolean' },
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
disableDefaultStyles: {
|
|
66
|
-
control: { type: 'boolean' },
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
parameters: {
|
|
71
|
-
docs: {
|
|
72
|
-
page: OrCombinedInputDocs,
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
design: {
|
|
76
|
-
type: 'figma',
|
|
77
|
-
url: 'https://www.figma.com/file/o7DdkaznUW2PtX4wiSuhhQ/Core?node-id=4423%3A39753&t=grpHUrgJi4X2W67L-4',
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
} as Meta<typeof OrCombinedInput>;
|
|
81
|
-
|
|
82
|
-
const Template: StoryFn<typeof OrCombinedInput> = (args) => ({
|
|
83
|
-
components: {
|
|
84
|
-
OrCombinedInput,
|
|
85
|
-
OrIcon,
|
|
86
|
-
OrInput,
|
|
87
|
-
OrSelect,
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
setup() {
|
|
91
|
-
// State
|
|
92
|
-
const options = Array.from<string, SelectOption>([
|
|
93
|
-
'Alfa',
|
|
94
|
-
'Bravo',
|
|
95
|
-
'Charlie',
|
|
96
|
-
'Delta',
|
|
97
|
-
'Echo',
|
|
98
|
-
'Foxtrot',
|
|
99
|
-
'Golf',
|
|
100
|
-
'Hotel',
|
|
101
|
-
'India',
|
|
102
|
-
'Juliett',
|
|
103
|
-
'Kilo',
|
|
104
|
-
'Lima',
|
|
105
|
-
'Mike',
|
|
106
|
-
'November',
|
|
107
|
-
'Oscar',
|
|
108
|
-
'Papa',
|
|
109
|
-
'Quebec',
|
|
110
|
-
'Romeo',
|
|
111
|
-
'Sierra',
|
|
112
|
-
'Tango',
|
|
113
|
-
'Uniform',
|
|
114
|
-
'Victor',
|
|
115
|
-
'Whiskey',
|
|
116
|
-
'X-Ray',
|
|
117
|
-
'Yankee',
|
|
118
|
-
'Zulu',
|
|
119
|
-
], (item) => ({
|
|
120
|
-
value: item.toLowerCase(),
|
|
121
|
-
label: item,
|
|
122
|
-
}));
|
|
123
|
-
|
|
124
|
-
const selectModel = ref<string>();
|
|
125
|
-
const inputModel = ref<string>();
|
|
126
|
-
|
|
127
|
-
// Effects
|
|
128
|
-
watch([selectModel, inputModel], (values) => {
|
|
129
|
-
console.debug(values);
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
return {
|
|
133
|
-
args,
|
|
134
|
-
options,
|
|
135
|
-
selectModel,
|
|
136
|
-
inputModel,
|
|
137
|
-
};
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
template: `
|
|
141
|
-
<OrCombinedInput v-bind="args">
|
|
142
|
-
${args.default}
|
|
143
|
-
${args.addon}
|
|
144
|
-
</OrCombinedInput>
|
|
145
|
-
`,
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
export const Default = Template.bind({});
|
|
149
|
-
|
|
150
|
-
Default.args = {
|
|
151
|
-
// Slots
|
|
152
|
-
default: `
|
|
153
|
-
<template v-slot="props">
|
|
154
|
-
<OrSelect
|
|
155
|
-
class="basis-1/4"
|
|
156
|
-
v-model="selectModel"
|
|
157
|
-
v-bind="props"
|
|
158
|
-
:options="options"
|
|
159
|
-
/>
|
|
160
|
-
|
|
161
|
-
<OrInput
|
|
162
|
-
class="basis-3/4"
|
|
163
|
-
v-model="inputModel"
|
|
164
|
-
v-bind="props"
|
|
165
|
-
/>
|
|
166
|
-
</template>
|
|
167
|
-
`,
|
|
168
|
-
|
|
169
|
-
// Props
|
|
170
|
-
label: 'Combined Input',
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
export const Addon = Template.bind({});
|
|
174
|
-
|
|
175
|
-
Addon.args = {
|
|
176
|
-
...Default.args,
|
|
177
|
-
|
|
178
|
-
// Slots
|
|
179
|
-
addon: `
|
|
180
|
-
<template v-slot:addon>
|
|
181
|
-
<OrIcon icon="info" />
|
|
182
|
-
</template>
|
|
183
|
-
`,
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
export const Hint = Template.bind({});
|
|
187
|
-
|
|
188
|
-
Hint.args = {
|
|
189
|
-
...Default.args,
|
|
190
|
-
|
|
191
|
-
// Props
|
|
192
|
-
hint: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
export const Error = Template.bind({});
|
|
196
|
-
|
|
197
|
-
Error.args = {
|
|
198
|
-
...Default.args,
|
|
199
|
-
|
|
200
|
-
// Props
|
|
201
|
-
error: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
|
202
|
-
};
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="root"
|
|
4
|
-
v-bind="$attrs"
|
|
5
|
-
:class="rootStyles"
|
|
6
|
-
>
|
|
7
|
-
<template v-if="label">
|
|
8
|
-
<OrLabel
|
|
9
|
-
:variant="'input'"
|
|
10
|
-
:required="required"
|
|
11
|
-
:disabled="disabled"
|
|
12
|
-
>
|
|
13
|
-
{{ label }}
|
|
14
|
-
|
|
15
|
-
<template v-slot:addon>
|
|
16
|
-
<slot name="addon" />
|
|
17
|
-
</template>
|
|
18
|
-
</OrLabel>
|
|
19
|
-
</template>
|
|
20
|
-
|
|
21
|
-
<div :class="controlGroup">
|
|
22
|
-
<slot
|
|
23
|
-
:size="size"
|
|
24
|
-
:required="required"
|
|
25
|
-
:readonly="readonly"
|
|
26
|
-
:disabled="disabled"
|
|
27
|
-
:disable-default-styles="disableDefaultStyles"
|
|
28
|
-
/>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
<template v-if="!invalid">
|
|
32
|
-
<template v-if="hint">
|
|
33
|
-
<OrHint :disabled="disabled">
|
|
34
|
-
{{ hint }}
|
|
35
|
-
</OrHint>
|
|
36
|
-
</template>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<template v-else>
|
|
40
|
-
<OrError :disabled="disabled">
|
|
41
|
-
{{ error }}
|
|
42
|
-
</OrError>
|
|
43
|
-
</template>
|
|
44
|
-
</div>
|
|
45
|
-
</template>
|
|
46
|
-
|
|
47
|
-
<script lang="ts">
|
|
48
|
-
import { computed, defineComponent, PropType, ref } from 'vue-demi';
|
|
49
|
-
import { useClassAttribute } from '../../hooks';
|
|
50
|
-
import { OrErrorV3 as OrError } from '../or-error-v3';
|
|
51
|
-
import { OrHintV3 as OrHint } from '../or-hint-v3';
|
|
52
|
-
import { OrLabelV3 as OrLabel } from '../or-label-v3';
|
|
53
|
-
import { CombinedInputSize } from './props';
|
|
54
|
-
import { CombinedInputControlGroup, CombinedInputRoot } from './styles';
|
|
55
|
-
|
|
56
|
-
export default defineComponent({
|
|
57
|
-
name: 'OrCombinedInput',
|
|
58
|
-
|
|
59
|
-
components: {
|
|
60
|
-
OrError,
|
|
61
|
-
OrHint,
|
|
62
|
-
OrLabel,
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
inheritAttrs: false,
|
|
66
|
-
|
|
67
|
-
props: {
|
|
68
|
-
size: {
|
|
69
|
-
type: String as PropType<CombinedInputSize>,
|
|
70
|
-
default: CombinedInputSize.M,
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
label: {
|
|
74
|
-
type: String,
|
|
75
|
-
default: undefined,
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
hint: {
|
|
79
|
-
type: String,
|
|
80
|
-
default: undefined,
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
error: {
|
|
84
|
-
type: String,
|
|
85
|
-
default: undefined,
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
required: {
|
|
89
|
-
type: Boolean,
|
|
90
|
-
default: false,
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
disabled: {
|
|
94
|
-
type: Boolean,
|
|
95
|
-
default: false,
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
disableDefaultStyles: {
|
|
99
|
-
type: Boolean,
|
|
100
|
-
default: false,
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
setup(props, context) {
|
|
105
|
-
// Refs
|
|
106
|
-
const root = ref<HTMLElement>();
|
|
107
|
-
|
|
108
|
-
// Styles
|
|
109
|
-
const classAttribute = useClassAttribute();
|
|
110
|
-
|
|
111
|
-
const rootStyles = computed(() => [
|
|
112
|
-
'or-combined-input',
|
|
113
|
-
...CombinedInputRoot,
|
|
114
|
-
classAttribute.value,
|
|
115
|
-
]);
|
|
116
|
-
|
|
117
|
-
const controlGroup = computed(() => [
|
|
118
|
-
...CombinedInputControlGroup,
|
|
119
|
-
]);
|
|
120
|
-
|
|
121
|
-
// State
|
|
122
|
-
const invalid = computed(() => !!props.error);
|
|
123
|
-
const readonly = computed(() => context.attrs.readonly as boolean);
|
|
124
|
-
|
|
125
|
-
return {
|
|
126
|
-
root,
|
|
127
|
-
rootStyles,
|
|
128
|
-
controlGroup,
|
|
129
|
-
invalid,
|
|
130
|
-
readonly,
|
|
131
|
-
};
|
|
132
|
-
},
|
|
133
|
-
});
|
|
134
|
-
</script>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { InputBoxSize as CombinedInputSize } from '../or-input-box-v3';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export const CombinedInputRoot: string[] = [
|
|
2
|
-
// Layout
|
|
3
|
-
'layout-column',
|
|
4
|
-
|
|
5
|
-
// Spacing
|
|
6
|
-
'gap-xs',
|
|
7
|
-
];
|
|
8
|
-
|
|
9
|
-
export const CombinedInputControlGroup: string[] = [
|
|
10
|
-
// Layout
|
|
11
|
-
'layout-row',
|
|
12
|
-
|
|
13
|
-
// Box
|
|
14
|
-
'w-full',
|
|
15
|
-
|
|
16
|
-
// Shape (.or-input-box)
|
|
17
|
-
'[&_.or-input-box]:first-child:rounded-r-none',
|
|
18
|
-
'[&_.or-input-box]:intermediate-child:rounded-none',
|
|
19
|
-
'[&_.or-input-box]:last-child:rounded-l-none',
|
|
20
|
-
|
|
21
|
-
// Spacing (children)
|
|
22
|
-
'[&_.or-input-box]:first-child:mr-[-1px]',
|
|
23
|
-
'[&_.or-input-box]:intermediate-child:border-x-0',
|
|
24
|
-
'[&_.or-input-box]:last-child:ml-[-1px]',
|
|
25
|
-
];
|