@onereach/ui-components 2.62.7-beta.1928.0 → 2.62.7-beta.1930.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/v2/OrCardCollection-5d5046f1.js +227 -0
- package/dist/v2/{OrConfirm-24e2a1a2.js → OrConfirm-edc537b3.js} +1 -1
- package/dist/v2/{OrInlineInput-8455f9da.js → OrInlineInput-73ec1b85.js} +5 -5
- package/dist/v2/{OrInlineTextarea-1127e512.js → OrInlineTextarea-1858a348.js} +5 -5
- package/dist/v2/{OrInput-24028f23.js → OrInput-655bed71.js} +5 -5
- package/dist/v2/{OrSearch-978a3a6e.js → OrSearch-287a08a9.js} +1 -1
- package/dist/v2/{OrSelect-c6d0a69e.js → OrSelect-1a353817.js} +3 -3
- package/dist/v2/OrSortHeader-a6004b24.js +133 -0
- package/dist/v2/{OrTextarea-8773d494.js → OrTextarea-cc70afc9.js} +5 -5
- package/dist/v2/components/index.d.ts +2 -1
- package/dist/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +17 -0
- package/dist/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +98 -0
- package/dist/v2/components/or-card-collection-v3/index.d.ts +3 -0
- package/dist/v2/components/or-card-collection-v3/props.d.ts +4 -0
- package/dist/v2/components/or-card-collection-v3/styles.d.ts +6 -0
- package/dist/v2/components/or-card-collection-v3/types.d.ts +7 -0
- package/dist/v2/components/{or-segmented-control-v3/OrSegmentedControl.stories3.d.ts → or-sort-header-v3/OrSortHeader.stories3.d.ts} +1 -1
- package/dist/{v3/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts → v2/components/or-sort-header-v3/OrSortHeader.vue.d.ts} +25 -45
- package/dist/v2/components/or-sort-header-v3/index.d.ts +2 -0
- package/dist/v2/components/or-sort-header-v3/styles.d.ts +1 -0
- package/dist/v2/components/or-sort-header-v3/types.d.ts +4 -0
- package/dist/v2/index.js +9 -8
- package/dist/v2/index11.js +20 -1
- package/dist/v2/index12.js +3 -12
- package/dist/v2/index13.js +3 -2
- package/dist/v2/index14.js +11 -5
- package/dist/v2/index15.js +5 -14
- package/dist/v2/index16.js +4 -19
- package/dist/v2/index17.js +28 -4
- package/dist/v2/index18.js +3 -7
- package/dist/v2/index19.js +5 -23
- package/dist/v2/index2.js +9 -8
- package/dist/v2/index20.js +25 -21
- package/dist/v2/index21.js +21 -18
- package/dist/v2/index22.js +20 -2
- package/dist/v2/index23.js +2 -4
- package/dist/v2/index24.js +2 -1
- package/dist/v2/index25.js +1 -2
- package/dist/v2/index26.js +2 -2
- package/dist/v2/index27.js +4 -7
- package/dist/v2/index28.js +6 -2
- package/dist/v2/index29.js +3 -3
- package/dist/v2/index30.js +3 -10
- package/dist/v2/index31.js +9 -12
- package/dist/v2/index32.js +11 -1
- package/dist/v2/index33.js +1 -1
- package/dist/v2/index34.js +1 -16
- package/dist/v2/index35.js +17 -17
- package/dist/v2/index36.js +17 -17
- package/dist/v2/index37.js +16 -1
- package/dist/v2/index38.js +1 -17
- package/dist/v2/index39.js +18 -22
- package/dist/v2/index40.js +22 -2
- package/dist/v2/index41.js +3 -3
- package/dist/v2/index42.js +1 -1
- package/dist/v2/index43.js +3 -20
- package/dist/v2/index44.js +1 -7
- package/dist/v2/index45.js +24 -1
- package/dist/v2/index46.js +3 -3
- package/dist/v2/index47.js +1 -2
- package/dist/v2/index48.js +2 -9
- package/dist/v2/index49.js +10 -17
- package/dist/v2/index50.js +17 -13
- package/dist/v2/index51.js +13 -14
- package/dist/v2/index52.js +14 -13
- package/dist/v2/index53.js +12 -15
- package/dist/v2/index54.js +16 -1
- package/dist/v2/index55.js +2 -6
- package/dist/v2/index56.js +1 -5
- package/dist/v2/index57.js +10 -3
- package/dist/v2/index58.js +2 -4
- package/dist/v2/index59.js +5 -3
- package/dist/v2/index60.js +2 -1
- package/dist/v2/index61.js +2 -5
- package/dist/v2/index62.js +3 -18
- package/dist/v2/index63.js +19 -2
- package/dist/v2/index65.js +2 -2
- package/dist/v2/index71.js +4 -15
- package/dist/v2/index72.js +13 -2
- package/dist/v2/index73.js +4 -6
- package/dist/v2/index74.js +6 -4
- package/dist/v2/index75.js +2 -1
- package/dist/v2/index76.js +3 -3
- package/dist/v2/index77.js +3 -4
- package/dist/v2/index78.js +4 -15
- package/dist/v2/index79.js +14 -11
- package/dist/v2/index80.js +11 -13
- package/dist/v2/index81.js +14 -2
- package/dist/v2/index82.js +2 -2
- package/dist/v2/index83.js +2 -3
- package/dist/v2/index84.js +1 -6
- package/dist/v2/index85.js +7 -20
- package/dist/v2/index86.js +12 -9
- package/dist/v2/index87.js +18 -1
- package/dist/v2/index88.js +2 -18
- package/dist/v2/index89.js +18 -2
- package/dist/v2/index90.js +2 -10
- package/dist/v2/index91.js +9 -11
- package/dist/v2/index92.js +12 -1
- package/dist/v2/index93.js +1 -6
- package/dist/v2/index94.js +5 -1
- package/dist/v2/index95.js +3 -0
- package/dist/v3/OrCardCollection-c6f3ac23.js +198 -0
- package/dist/v3/{OrConfirm-371630a4.js → OrConfirm-0bafcc7b.js} +1 -1
- package/dist/v3/{OrInlineInput-a080b0a3.js → OrInlineInput-dc71bbcb.js} +5 -3
- package/dist/v3/{OrInlineTextarea-08767485.js → OrInlineTextarea-bdebb784.js} +5 -3
- package/dist/v3/{OrInput-256d2530.js → OrInput-db4813b4.js} +5 -3
- package/dist/v3/{OrSearch-375eab55.js → OrSearch-0c29f499.js} +1 -1
- package/dist/v3/{OrSelect-52cfb10d.js → OrSelect-323a87b4.js} +6 -4
- package/dist/v3/OrSortHeader-5eba50cd.js +104 -0
- package/dist/v3/{OrTextarea-09aa33dc.js → OrTextarea-98895b2a.js} +6 -4
- package/dist/v3/components/index.d.ts +2 -1
- package/dist/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +17 -0
- package/dist/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +98 -0
- package/dist/v3/components/or-card-collection-v3/index.d.ts +3 -0
- package/dist/v3/components/or-card-collection-v3/props.d.ts +4 -0
- package/dist/v3/components/or-card-collection-v3/styles.d.ts +6 -0
- package/dist/v3/components/or-card-collection-v3/types.d.ts +7 -0
- package/dist/v3/components/{or-segmented-control-v3/OrSegmentedControl.stories3.d.ts → or-sort-header-v3/OrSortHeader.stories3.d.ts} +1 -1
- package/dist/{v2/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts → v3/components/or-sort-header-v3/OrSortHeader.vue.d.ts} +25 -45
- package/dist/v3/components/or-sort-header-v3/index.d.ts +2 -0
- package/dist/v3/components/or-sort-header-v3/styles.d.ts +1 -0
- package/dist/v3/components/or-sort-header-v3/types.d.ts +4 -0
- package/dist/v3/index.js +9 -8
- package/dist/v3/index11.js +19 -1
- package/dist/v3/index12.js +3 -11
- package/dist/v3/index13.js +3 -2
- package/dist/v3/index14.js +9 -4
- package/dist/v3/index15.js +4 -11
- package/dist/v3/index16.js +3 -17
- package/dist/v3/index17.js +25 -4
- package/dist/v3/index18.js +3 -6
- package/dist/v3/index19.js +5 -20
- package/dist/v3/index2.js +9 -8
- package/dist/v3/index20.js +21 -20
- package/dist/v3/index21.js +20 -15
- package/dist/v3/index22.js +16 -1
- package/dist/v3/index23.js +2 -4
- package/dist/v3/index24.js +2 -1
- package/dist/v3/index25.js +1 -2
- package/dist/v3/index26.js +2 -2
- package/dist/v3/index27.js +4 -6
- package/dist/v3/index28.js +5 -2
- package/dist/v3/index29.js +3 -3
- package/dist/v3/index30.js +3 -9
- package/dist/v3/index31.js +8 -11
- package/dist/v3/index32.js +10 -1
- package/dist/v3/index33.js +1 -1
- package/dist/v3/index34.js +1 -15
- package/dist/v3/index35.js +16 -14
- package/dist/v3/index36.js +14 -16
- package/dist/v3/index37.js +16 -2
- package/dist/v3/index38.js +2 -17
- package/dist/v3/index39.js +17 -17
- package/dist/v3/index40.js +16 -1
- package/dist/v3/index41.js +3 -3
- package/dist/v3/index42.js +1 -1
- package/dist/v3/index43.js +3 -16
- package/dist/v3/index44.js +1 -7
- package/dist/v3/index45.js +20 -1
- package/dist/v3/index46.js +3 -3
- package/dist/v3/index47.js +1 -2
- package/dist/v3/index48.js +2 -8
- package/dist/v3/index49.js +9 -14
- package/dist/v3/index50.js +14 -12
- package/dist/v3/index51.js +12 -11
- package/dist/v3/index52.js +11 -12
- package/dist/v3/index53.js +11 -11
- package/dist/v3/index54.js +12 -1
- package/dist/v3/index55.js +2 -5
- package/dist/v3/index56.js +1 -5
- package/dist/v3/index57.js +9 -3
- package/dist/v3/index58.js +2 -4
- package/dist/v3/index59.js +5 -3
- package/dist/v3/index60.js +2 -1
- package/dist/v3/index61.js +1 -4
- package/dist/v3/index62.js +3 -17
- package/dist/v3/index63.js +18 -2
- package/dist/v3/index65.js +2 -2
- package/dist/v3/index71.js +4 -12
- package/dist/v3/index72.js +10 -2
- package/dist/v3/index73.js +3 -5
- package/dist/v3/index74.js +5 -3
- package/dist/v3/index75.js +2 -1
- package/dist/v3/index76.js +3 -3
- package/dist/v3/index77.js +3 -4
- package/dist/v3/index78.js +4 -14
- package/dist/v3/index79.js +13 -10
- package/dist/v3/index80.js +10 -12
- package/dist/v3/index81.js +13 -1
- package/dist/v3/index82.js +1 -1
- package/dist/v3/index83.js +1 -3
- package/dist/v3/index84.js +1 -6
- package/dist/v3/index85.js +6 -16
- package/dist/v3/index86.js +12 -9
- package/dist/v3/index87.js +15 -1
- package/dist/v3/index88.js +2 -17
- package/dist/v3/index89.js +17 -2
- package/dist/v3/index90.js +2 -8
- package/dist/v3/index91.js +6 -9
- package/dist/v3/index92.js +11 -1
- package/dist/v3/index93.js +1 -6
- package/dist/v3/index94.js +5 -1
- package/dist/v3/index95.js +3 -0
- package/package.json +1 -1
- package/src/components/index.ts +2 -1
- package/src/components/or-card-collection-v3/OrCardCollection.docs.mdx +3 -0
- package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +162 -0
- package/src/components/or-card-collection-v3/OrCardCollection.vue +210 -0
- package/src/components/or-card-collection-v3/index.ts +3 -0
- package/src/components/or-card-collection-v3/props.ts +4 -0
- package/src/components/or-card-collection-v3/styles.ts +53 -0
- package/src/components/or-card-collection-v3/types.ts +8 -0
- package/src/components/or-checkbox-v3/OrCheckbox.stories3.ts +1 -1
- package/src/components/or-inline-input-v3/OrInlineInput.vue +12 -10
- package/src/components/or-inline-textarea-v3/OrInlineTextarea.vue +12 -10
- package/src/components/or-input-v3/OrInput.vue +12 -10
- package/src/components/or-radio-v3/OrRadio.stories3.ts +1 -1
- package/src/components/or-select-v3/OrSelect.vue +5 -3
- package/src/components/or-sort-header-v3/OrSortHeader.docs.mdx +3 -0
- package/src/components/or-sort-header-v3/OrSortHeader.stories3.ts +132 -0
- package/src/components/{or-segmented-control-v3/OrSegmentedControl.vue → or-sort-header-v3/OrSortHeader.vue} +36 -34
- package/src/components/or-sort-header-v3/index.ts +2 -0
- package/src/components/or-sort-header-v3/styles.ts +23 -0
- package/src/components/or-sort-header-v3/types.ts +4 -0
- package/src/components/or-switch-v3/OrSwitch.stories3.ts +1 -1
- package/src/components/or-textarea-v3/OrTextarea.vue +12 -10
- package/dist/v2/OrSegmentedControl-58b5db14.js +0 -231
- package/dist/v2/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +0 -47
- package/dist/v2/components/or-segmented-control-v3/components/or-segmented-control-item/styles.d.ts +0 -3
- package/dist/v2/components/or-segmented-control-v3/index.d.ts +0 -3
- package/dist/v2/components/or-segmented-control-v3/props.d.ts +0 -4
- package/dist/v2/components/or-segmented-control-v3/styles.d.ts +0 -3
- package/dist/v2/components/or-segmented-control-v3/types.d.ts +0 -4
- package/dist/v3/OrSegmentedControl-e45af169.js +0 -183
- package/dist/v3/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +0 -47
- package/dist/v3/components/or-segmented-control-v3/components/or-segmented-control-item/styles.d.ts +0 -3
- package/dist/v3/components/or-segmented-control-v3/index.d.ts +0 -3
- package/dist/v3/components/or-segmented-control-v3/props.d.ts +0 -4
- package/dist/v3/components/or-segmented-control-v3/styles.d.ts +0 -3
- package/dist/v3/components/or-segmented-control-v3/types.d.ts +0 -4
- package/src/components/or-segmented-control-v3/OrSegmentedControl.docs.mdx +0 -7
- package/src/components/or-segmented-control-v3/OrSegmentedControl.stories3.ts +0 -118
- package/src/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue +0 -63
- package/src/components/or-segmented-control-v3/components/or-segmented-control-item/styles.ts +0 -50
- package/src/components/or-segmented-control-v3/index.ts +0 -3
- package/src/components/or-segmented-control-v3/props.ts +0 -4
- package/src/components/or-segmented-control-v3/styles.ts +0 -24
- package/src/components/or-segmented-control-v3/types.ts +0 -4
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
+
import { ref, watch } from 'vue-demi';
|
|
4
|
+
import OrSortHeaderDocs from './OrSortHeader.docs.mdx';
|
|
5
|
+
import OrSortHeader from './OrSortHeader.vue';
|
|
6
|
+
import { SortHeaderModel } from './types';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/Sort Header',
|
|
10
|
+
component: OrSortHeader,
|
|
11
|
+
|
|
12
|
+
argTypes: {
|
|
13
|
+
// Slots
|
|
14
|
+
default: {
|
|
15
|
+
type: {
|
|
16
|
+
name: 'string',
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
control: { type: 'text' },
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// Props
|
|
24
|
+
modelValue: {
|
|
25
|
+
control: { type: 'object' },
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
value: { // TODO: Remove Vue 2 fallback
|
|
29
|
+
control: { type: 'object' },
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
inputValue: { // TODO: Rename to `value` after complete migration to Vue 3
|
|
33
|
+
control: { type: 'text' },
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// Events
|
|
37
|
+
'update:modelValue': {
|
|
38
|
+
table: { disable: true },
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
input: {
|
|
42
|
+
table: { disable: true },
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
focus: {
|
|
46
|
+
table: { disable: true },
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
blur: {
|
|
50
|
+
table: { disable: true },
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
parameters: {
|
|
55
|
+
layout: 'centered',
|
|
56
|
+
|
|
57
|
+
docs: {
|
|
58
|
+
page: OrSortHeaderDocs,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
decorators: [
|
|
63
|
+
() => ({
|
|
64
|
+
template: `
|
|
65
|
+
<div class="flex flex-row gap-sm">
|
|
66
|
+
<story />
|
|
67
|
+
</div>
|
|
68
|
+
`,
|
|
69
|
+
}),
|
|
70
|
+
],
|
|
71
|
+
} as Meta<typeof OrSortHeader>;
|
|
72
|
+
|
|
73
|
+
const Template: StoryFn<typeof OrSortHeader> = (args) => ({
|
|
74
|
+
components: {
|
|
75
|
+
OrSortHeader,
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
setup() {
|
|
79
|
+
// State
|
|
80
|
+
const model = ref<SortHeaderModel>();
|
|
81
|
+
|
|
82
|
+
// Effects
|
|
83
|
+
watch(model, (value) => {
|
|
84
|
+
console.debug(value);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
args,
|
|
89
|
+
model,
|
|
90
|
+
onUpdateModelValue: action('update:modelValue'),
|
|
91
|
+
onInput: action('input'),
|
|
92
|
+
onFocus: action('focus'),
|
|
93
|
+
onBlur: action('blur'),
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
template: `
|
|
98
|
+
<div class="contents">
|
|
99
|
+
<OrSortHeader
|
|
100
|
+
v-model="model"
|
|
101
|
+
v-bind="args"
|
|
102
|
+
@update:modelValue="onUpdateModelValue"
|
|
103
|
+
@input="onInput"
|
|
104
|
+
@focus="onFocus"
|
|
105
|
+
@blur="onBlur"
|
|
106
|
+
>
|
|
107
|
+
${args.default}
|
|
108
|
+
</OrSortHeader>
|
|
109
|
+
|
|
110
|
+
<OrSortHeader
|
|
111
|
+
v-model="model"
|
|
112
|
+
input-value="column-2"
|
|
113
|
+
@update:modelValue="onUpdateModelValue"
|
|
114
|
+
@input="onInput"
|
|
115
|
+
@focus="onFocus"
|
|
116
|
+
@blur="onBlur"
|
|
117
|
+
>
|
|
118
|
+
Column 2
|
|
119
|
+
</OrSortHeader>
|
|
120
|
+
</div>
|
|
121
|
+
`,
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
export const Default = Template.bind({});
|
|
125
|
+
|
|
126
|
+
Default.args = {
|
|
127
|
+
// Slots
|
|
128
|
+
default: 'Column 1',
|
|
129
|
+
|
|
130
|
+
// Props
|
|
131
|
+
inputValue: 'column-1',
|
|
132
|
+
};
|
|
@@ -3,61 +3,50 @@
|
|
|
3
3
|
ref="root"
|
|
4
4
|
v-bind="$attrs"
|
|
5
5
|
:class="rootStyles"
|
|
6
|
+
:activated="activated ? '' : null"
|
|
7
|
+
@click.stop="toggleDirection()"
|
|
6
8
|
>
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
>
|
|
15
|
-
{{ option.label }}
|
|
16
|
-
</OrSegmentedControlItem>
|
|
9
|
+
<slot />
|
|
10
|
+
|
|
11
|
+
<template v-if="activated">
|
|
12
|
+
<OrIcon
|
|
13
|
+
:class="{ 'rotate-180': proxyModelValue.direction === 'asc' }"
|
|
14
|
+
:icon="'arrow_downward'"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
17
|
</div>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<script lang="ts">
|
|
21
21
|
import { computed, defineComponent, PropType, ref } from 'vue-demi';
|
|
22
22
|
import { useClassAttribute } from '../../hooks';
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { SegmentedControlOption } from './types';
|
|
23
|
+
import { OrIconV3 as OrIcon } from '../or-icon-v3';
|
|
24
|
+
import { SortHeaderRoot } from './styles';
|
|
25
|
+
import { SortHeaderModel } from './types';
|
|
27
26
|
|
|
28
27
|
export default defineComponent({
|
|
29
|
-
name: '
|
|
28
|
+
name: 'OrSortHeader',
|
|
30
29
|
|
|
31
30
|
components: {
|
|
32
|
-
|
|
31
|
+
OrIcon,
|
|
33
32
|
},
|
|
34
33
|
|
|
35
34
|
inheritAttrs: false,
|
|
36
35
|
|
|
37
36
|
props: {
|
|
38
|
-
options: {
|
|
39
|
-
type: Array as PropType<SegmentedControlOption[]>,
|
|
40
|
-
default: [] as SegmentedControlOption[],
|
|
41
|
-
},
|
|
42
|
-
|
|
43
37
|
modelValue: {
|
|
44
|
-
type:
|
|
38
|
+
type: Object as PropType<SortHeaderModel>,
|
|
45
39
|
default: undefined,
|
|
46
40
|
},
|
|
47
41
|
|
|
48
42
|
value: { // TODO: Remove Vue 2 fallback
|
|
49
|
-
type:
|
|
43
|
+
type: Object as PropType<SortHeaderModel>,
|
|
50
44
|
default: undefined,
|
|
51
45
|
},
|
|
52
46
|
|
|
53
|
-
|
|
54
|
-
type: String
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
disabled: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: false,
|
|
47
|
+
inputValue: { // TODO: Rename to `value` after complete migration to Vue 3
|
|
48
|
+
type: String,
|
|
49
|
+
required: true,
|
|
61
50
|
},
|
|
62
51
|
},
|
|
63
52
|
|
|
@@ -81,9 +70,8 @@ export default defineComponent({
|
|
|
81
70
|
const classAttribute = useClassAttribute();
|
|
82
71
|
|
|
83
72
|
const rootStyles = computed(() => [
|
|
84
|
-
'or-
|
|
85
|
-
...
|
|
86
|
-
...SegmentedControlRootSizes[props.size],
|
|
73
|
+
'or-sort-header',
|
|
74
|
+
...SortHeaderRoot,
|
|
87
75
|
classAttribute.value,
|
|
88
76
|
]);
|
|
89
77
|
|
|
@@ -99,10 +87,24 @@ export default defineComponent({
|
|
|
99
87
|
},
|
|
100
88
|
});
|
|
101
89
|
|
|
90
|
+
const activated = computed(() => {
|
|
91
|
+
return proxyModelValue.value?.column === props.inputValue;
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// Methods
|
|
95
|
+
function toggleDirection(): void {
|
|
96
|
+
proxyModelValue.value = {
|
|
97
|
+
column: props.inputValue,
|
|
98
|
+
direction: proxyModelValue.value?.direction === 'asc' ? 'desc' : 'asc',
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
102
|
return {
|
|
103
103
|
root,
|
|
104
104
|
rootStyles,
|
|
105
105
|
proxyModelValue,
|
|
106
|
+
activated,
|
|
107
|
+
toggleDirection,
|
|
106
108
|
};
|
|
107
109
|
},
|
|
108
110
|
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const SortHeaderRoot: string[] = [
|
|
2
|
+
// Layout
|
|
3
|
+
'inline-flex',
|
|
4
|
+
'justify-normal',
|
|
5
|
+
'items-center',
|
|
6
|
+
|
|
7
|
+
// Interactivity
|
|
8
|
+
'interactivity-auto',
|
|
9
|
+
|
|
10
|
+
// Typography
|
|
11
|
+
'typography-caption-regular',
|
|
12
|
+
|
|
13
|
+
// Typography (activated)
|
|
14
|
+
'activated:typography-caption-semibold',
|
|
15
|
+
|
|
16
|
+
// Theme
|
|
17
|
+
'theme-foreground-outline',
|
|
18
|
+
'dark:theme-foreground-outline-dark',
|
|
19
|
+
|
|
20
|
+
// Theme (activated)
|
|
21
|
+
'activated:theme-foreground-default',
|
|
22
|
+
'dark:activated:theme-foreground-default-dark',
|
|
23
|
+
];
|
|
@@ -40,16 +40,18 @@
|
|
|
40
40
|
</OrInputBox>
|
|
41
41
|
|
|
42
42
|
<template v-if="!invalid">
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
<template v-if="hint || maxLength">
|
|
44
|
+
<OrHint :disabled="disabled">
|
|
45
|
+
{{ hint }}
|
|
46
|
+
|
|
47
|
+
<template
|
|
48
|
+
v-if="maxLength"
|
|
49
|
+
v-slot:addon
|
|
50
|
+
>
|
|
51
|
+
{{ currentLength }} / {{ maxLength }}
|
|
52
|
+
</template>
|
|
53
|
+
</OrHint>
|
|
54
|
+
</template>
|
|
53
55
|
</template>
|
|
54
56
|
|
|
55
57
|
<template v-else>
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, computed } from 'vue-demi';
|
|
2
|
-
import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
|
|
3
|
-
import '@vueuse/core';
|
|
4
|
-
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
5
|
-
|
|
6
|
-
const SegmentedControlItemRoot = [
|
|
7
|
-
// Layout
|
|
8
|
-
'flex', 'items-center', 'justify-center',
|
|
9
|
-
// Shape
|
|
10
|
-
'rounded-md',
|
|
11
|
-
// Interactivity
|
|
12
|
-
'interactivity-auto',
|
|
13
|
-
// Theme
|
|
14
|
-
'theme-foreground-default', 'dark:theme-foreground-default-dark',
|
|
15
|
-
// Theme (selected)
|
|
16
|
-
'selected:theme-background-default', 'dark:selected:theme-background-default-dark',
|
|
17
|
-
// Theme (selected, enabled)
|
|
18
|
-
'selected:enabled:shadow-card', 'dark:selected:enabled:shadow-card-dark'];
|
|
19
|
-
const SegmentedControlItemRootSizes = {
|
|
20
|
-
'm': [
|
|
21
|
-
// Box
|
|
22
|
-
'h-[44px] md:h-[36px]',
|
|
23
|
-
// Spacing
|
|
24
|
-
'px-sm+ md:px-sm+',
|
|
25
|
-
// Typography
|
|
26
|
-
'typography-body-2-regular'],
|
|
27
|
-
's': [
|
|
28
|
-
// Box
|
|
29
|
-
'h-[36px] md:h-[32px]',
|
|
30
|
-
// Spacing
|
|
31
|
-
'px-sm+ md:px-sm',
|
|
32
|
-
// Typography
|
|
33
|
-
'typography-caption-regular']
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
var script$1 = defineComponent({
|
|
37
|
-
name: 'OrSegmentedControlItem',
|
|
38
|
-
inheritAttrs: false,
|
|
39
|
-
props: {
|
|
40
|
-
size: {
|
|
41
|
-
type: String,
|
|
42
|
-
required: true
|
|
43
|
-
},
|
|
44
|
-
selected: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: false
|
|
47
|
-
},
|
|
48
|
-
disabled: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
default: false
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
setup(props) {
|
|
54
|
-
// Refs
|
|
55
|
-
const root = ref();
|
|
56
|
-
// Styles
|
|
57
|
-
const classAttribute = useClassAttribute();
|
|
58
|
-
const rootStyles = computed(() => ['or-segmented-control-item', ...SegmentedControlItemRoot, ...SegmentedControlItemRootSizes[props.size], classAttribute.value]);
|
|
59
|
-
return {
|
|
60
|
-
root,
|
|
61
|
-
rootStyles
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
/* script */
|
|
67
|
-
const __vue_script__$1 = script$1;
|
|
68
|
-
|
|
69
|
-
/* template */
|
|
70
|
-
var __vue_render__$1 = function () {
|
|
71
|
-
var _vm = this;
|
|
72
|
-
var _h = _vm.$createElement;
|
|
73
|
-
var _c = _vm._self._c || _h;
|
|
74
|
-
return _c('div', _vm._b({
|
|
75
|
-
ref: "root",
|
|
76
|
-
class: _vm.rootStyles,
|
|
77
|
-
attrs: {
|
|
78
|
-
"selected": _vm.selected ? '' : null,
|
|
79
|
-
"disabled": _vm.disabled ? '' : null
|
|
80
|
-
}
|
|
81
|
-
}, 'div', _vm.$attrs, false), [_c('div', {
|
|
82
|
-
class: ['truncate']
|
|
83
|
-
}, [_vm._t("default")], 2)]);
|
|
84
|
-
};
|
|
85
|
-
var __vue_staticRenderFns__$1 = [];
|
|
86
|
-
|
|
87
|
-
/* style */
|
|
88
|
-
const __vue_inject_styles__$1 = undefined;
|
|
89
|
-
/* scoped */
|
|
90
|
-
const __vue_scope_id__$1 = undefined;
|
|
91
|
-
/* module identifier */
|
|
92
|
-
const __vue_module_identifier__$1 = undefined;
|
|
93
|
-
/* functional template */
|
|
94
|
-
const __vue_is_functional_template__$1 = false;
|
|
95
|
-
/* style inject */
|
|
96
|
-
|
|
97
|
-
/* style inject SSR */
|
|
98
|
-
|
|
99
|
-
/* style inject shadow dom */
|
|
100
|
-
|
|
101
|
-
const __vue_component__$1 = /*#__PURE__*/normalizeComponent({
|
|
102
|
-
render: __vue_render__$1,
|
|
103
|
-
staticRenderFns: __vue_staticRenderFns__$1
|
|
104
|
-
}, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, false, undefined, undefined, undefined);
|
|
105
|
-
|
|
106
|
-
var SegmentedControlSize;
|
|
107
|
-
(function (SegmentedControlSize) {
|
|
108
|
-
SegmentedControlSize["M"] = "m";
|
|
109
|
-
SegmentedControlSize["S"] = "s";
|
|
110
|
-
})(SegmentedControlSize || (SegmentedControlSize = {}));
|
|
111
|
-
|
|
112
|
-
const SegmentedControlRoot = [
|
|
113
|
-
// Layout
|
|
114
|
-
'grid', 'grid-flow-col', 'auto-cols-fr',
|
|
115
|
-
// Shape
|
|
116
|
-
'rounded-md',
|
|
117
|
-
// Spacing
|
|
118
|
-
'px-[2px]', 'py-[2px]',
|
|
119
|
-
// Theme
|
|
120
|
-
'theme-background-surface-variant', 'dark:theme-background-surface-variant-dark'];
|
|
121
|
-
const SegmentedControlRootSizes = {
|
|
122
|
-
'm': [],
|
|
123
|
-
's': []
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
var script = defineComponent({
|
|
127
|
-
name: 'OrSegmentedControl',
|
|
128
|
-
components: {
|
|
129
|
-
OrSegmentedControlItem: __vue_component__$1
|
|
130
|
-
},
|
|
131
|
-
inheritAttrs: false,
|
|
132
|
-
props: {
|
|
133
|
-
options: {
|
|
134
|
-
type: Array,
|
|
135
|
-
default: []
|
|
136
|
-
},
|
|
137
|
-
modelValue: {
|
|
138
|
-
type: String,
|
|
139
|
-
default: undefined
|
|
140
|
-
},
|
|
141
|
-
value: {
|
|
142
|
-
type: String,
|
|
143
|
-
default: undefined
|
|
144
|
-
},
|
|
145
|
-
size: {
|
|
146
|
-
type: String,
|
|
147
|
-
default: SegmentedControlSize.M
|
|
148
|
-
},
|
|
149
|
-
disabled: {
|
|
150
|
-
type: Boolean,
|
|
151
|
-
default: false
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
emits: ['update:modelValue', 'input', 'focus', 'blur'],
|
|
155
|
-
expose: ['root'],
|
|
156
|
-
setup(props, context) {
|
|
157
|
-
// Refs
|
|
158
|
-
const root = ref();
|
|
159
|
-
// Styles
|
|
160
|
-
const classAttribute = useClassAttribute();
|
|
161
|
-
const rootStyles = computed(() => ['or-segmented-control', ...SegmentedControlRoot, ...SegmentedControlRootSizes[props.size], classAttribute.value]);
|
|
162
|
-
// State
|
|
163
|
-
const proxyModelValue = computed({
|
|
164
|
-
get: () => {
|
|
165
|
-
var _a;
|
|
166
|
-
return (_a = props.modelValue) !== null && _a !== void 0 ? _a : props.value; // TODO: Remove Vue 2 fallback
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
set: value => {
|
|
170
|
-
context.emit('input', value);
|
|
171
|
-
context.emit('update:modelValue', value);
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
return {
|
|
175
|
-
root,
|
|
176
|
-
rootStyles,
|
|
177
|
-
proxyModelValue
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
/* script */
|
|
183
|
-
const __vue_script__ = script;
|
|
184
|
-
|
|
185
|
-
/* template */
|
|
186
|
-
var __vue_render__ = function () {
|
|
187
|
-
var _vm = this;
|
|
188
|
-
var _h = _vm.$createElement;
|
|
189
|
-
var _c = _vm._self._c || _h;
|
|
190
|
-
return _c('div', _vm._b({
|
|
191
|
-
ref: "root",
|
|
192
|
-
class: _vm.rootStyles
|
|
193
|
-
}, 'div', _vm.$attrs, false), _vm._l(_vm.options, function (option) {
|
|
194
|
-
return _c('OrSegmentedControlItem', {
|
|
195
|
-
key: option.value,
|
|
196
|
-
attrs: {
|
|
197
|
-
"size": _vm.size,
|
|
198
|
-
"selected": option.value === _vm.proxyModelValue,
|
|
199
|
-
"disabled": _vm.disabled
|
|
200
|
-
},
|
|
201
|
-
on: {
|
|
202
|
-
"click": function ($event) {
|
|
203
|
-
$event.stopPropagation();
|
|
204
|
-
_vm.proxyModelValue = option.value;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}, [_vm._v("\n " + _vm._s(option.label) + "\n ")]);
|
|
208
|
-
}), 1);
|
|
209
|
-
};
|
|
210
|
-
var __vue_staticRenderFns__ = [];
|
|
211
|
-
|
|
212
|
-
/* style */
|
|
213
|
-
const __vue_inject_styles__ = undefined;
|
|
214
|
-
/* scoped */
|
|
215
|
-
const __vue_scope_id__ = undefined;
|
|
216
|
-
/* module identifier */
|
|
217
|
-
const __vue_module_identifier__ = undefined;
|
|
218
|
-
/* functional template */
|
|
219
|
-
const __vue_is_functional_template__ = false;
|
|
220
|
-
/* style inject */
|
|
221
|
-
|
|
222
|
-
/* style inject SSR */
|
|
223
|
-
|
|
224
|
-
/* style inject shadow dom */
|
|
225
|
-
|
|
226
|
-
const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
227
|
-
render: __vue_render__,
|
|
228
|
-
staticRenderFns: __vue_staticRenderFns__
|
|
229
|
-
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
230
|
-
|
|
231
|
-
export { SegmentedControlSize as S, __vue_component__ as _ };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { PropType } from 'vue-demi';
|
|
2
|
-
import { SegmentedControlSize } from '../../props';
|
|
3
|
-
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
|
-
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
5
|
-
rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
|
|
6
|
-
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
7
|
-
size: {
|
|
8
|
-
type: PropType<SegmentedControlSize>;
|
|
9
|
-
required: true;
|
|
10
|
-
};
|
|
11
|
-
selected: {
|
|
12
|
-
type: BooleanConstructor;
|
|
13
|
-
default: boolean;
|
|
14
|
-
};
|
|
15
|
-
disabled: {
|
|
16
|
-
type: BooleanConstructor;
|
|
17
|
-
default: boolean;
|
|
18
|
-
};
|
|
19
|
-
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
20
|
-
size: {
|
|
21
|
-
type: PropType<SegmentedControlSize>;
|
|
22
|
-
required: true;
|
|
23
|
-
};
|
|
24
|
-
selected: {
|
|
25
|
-
type: BooleanConstructor;
|
|
26
|
-
default: boolean;
|
|
27
|
-
};
|
|
28
|
-
disabled: {
|
|
29
|
-
type: BooleanConstructor;
|
|
30
|
-
default: boolean;
|
|
31
|
-
};
|
|
32
|
-
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
33
|
-
size: SegmentedControlSize;
|
|
34
|
-
selected: boolean;
|
|
35
|
-
disabled: boolean;
|
|
36
|
-
} & {}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
37
|
-
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
38
|
-
rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
|
|
39
|
-
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, {}, {
|
|
40
|
-
size: SegmentedControlSize;
|
|
41
|
-
selected: boolean;
|
|
42
|
-
disabled: boolean;
|
|
43
|
-
} & {}, {
|
|
44
|
-
selected: boolean;
|
|
45
|
-
disabled: boolean;
|
|
46
|
-
}, true>);
|
|
47
|
-
export default _default;
|