@onereach/ui-components 2.63.0-beta.1896.0 → 2.63.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/{OrConfirm-8d149ece.js → OrConfirm-24e2a1a2.js} +1 -1
- package/dist/v2/{OrIconButton-5883eba0.js → OrIconButton-2088a37f.js} +1 -1
- package/dist/v2/{OrInlineInput-16a343c1.js → OrInlineInput-f00cba5e.js} +6 -5
- package/dist/v2/{OrInlineTextarea-f154bdf5.js → OrInlineTextarea-75de33d0.js} +6 -5
- package/dist/v2/{OrInput-4a50fe57.js → OrInput-24028f23.js} +7 -5
- package/dist/v2/{OrModal-64c5ae2e.js → OrModal-a1452b11.js} +1 -1
- package/dist/v2/{OrNotification-9c164908.js → OrNotification-ac420f39.js} +1 -1
- package/dist/v2/{OrSearch-a247f072.js → OrSearch-978a3a6e.js} +1 -1
- package/dist/v2/OrSegmentedControl-17df63b8.js +236 -0
- package/dist/v2/{OrSelect-bb223cce.js → OrSelect-c6d0a69e.js} +13 -33
- package/dist/v2/{OrTabs-b4a9740b.js → OrTabs-f2a60b41.js} +1 -1
- package/dist/v2/{OrTag-ab03c4f7.js → OrTag-1ced4e58.js} +1 -1
- package/dist/v2/{OrTooltip-caeac590.js → OrTooltip-afe7030b.js} +33 -3
- package/dist/v2/components/index.d.ts +1 -0
- package/dist/v2/components/{or-rich-text-editor-v3/OrRichTextEditor.stories3.d.ts → or-segmented-control-v3/OrSegmentedControl.stories3.d.ts} +1 -1
- package/dist/v2/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts +77 -0
- package/dist/v2/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +47 -0
- package/dist/v2/components/or-segmented-control-v3/components/or-segmented-control-item/styles.d.ts +3 -0
- package/dist/v2/components/or-segmented-control-v3/index.d.ts +3 -0
- package/dist/v2/components/or-segmented-control-v3/props.d.ts +4 -0
- package/dist/v2/components/or-segmented-control-v3/styles.d.ts +3 -0
- package/dist/v2/components/or-segmented-control-v3/types.d.ts +4 -0
- package/dist/v2/components/or-select-v3/OrSelect.vue.d.ts +2 -2
- package/dist/v2/components/or-tooltip-v3/styles.d.ts +2 -0
- package/dist/v2/directives/index.d.ts +2 -0
- package/dist/v2/dropdown-open-0d314aa4.js +28 -0
- package/dist/v2/index.d.ts +1 -0
- package/dist/v2/index.js +15 -13
- package/dist/v2/index2.js +15 -13
- package/dist/v2/index20.js +4 -4
- package/dist/v2/index31.js +2 -2
- package/dist/v2/index34.js +3 -3
- package/dist/v2/index36.js +3 -3
- package/dist/v2/index38.js +3 -3
- package/dist/v2/index50.js +3 -3
- package/dist/v2/index52.js +3 -3
- package/dist/v2/index62.js +12 -306
- package/dist/v2/index63.js +2 -19
- package/dist/v2/index65.js +6 -5
- package/dist/v2/index78.js +1 -1
- package/dist/v2/index80.js +3 -3
- package/dist/v2/index88.js +3 -3
- package/dist/v2/index91.js +1 -1
- package/dist/v2/index92.js +1 -6
- package/dist/v2/index93.js +5 -1
- package/dist/v2/index94.js +3 -0
- package/dist/v2/{types-fb93ea4e.js → types-89aad7fb.js} +1 -1
- package/dist/v3/{OrConfirm-456ddee1.js → OrConfirm-371630a4.js} +1 -1
- package/dist/v3/{OrIconButton-b8066b5d.js → OrIconButton-5fb3a9aa.js} +1 -1
- package/dist/v3/{OrInlineInput-280768ba.js → OrInlineInput-bac4abdd.js} +4 -3
- package/dist/v3/{OrInlineTextarea-0f63f344.js → OrInlineTextarea-d1ec1bba.js} +4 -3
- package/dist/v3/{OrInput-3eef7945.js → OrInput-256d2530.js} +6 -3
- package/dist/v3/{OrModal-f67d37d3.js → OrModal-3a43b7e7.js} +1 -1
- package/dist/v3/{OrNotification-fefa1cb4.js → OrNotification-433d16f7.js} +1 -1
- package/dist/v3/{OrSearch-15a70678.js → OrSearch-375eab55.js} +1 -1
- package/dist/v3/OrSegmentedControl-2bbc0f22.js +184 -0
- package/dist/v3/{OrSelect-63ada65d.js → OrSelect-52cfb10d.js} +12 -32
- package/dist/v3/{OrTabs-194ca950.js → OrTabs-ac0be933.js} +1 -1
- package/dist/v3/{OrTag-144b4ab8.js → OrTag-deaff080.js} +1 -1
- package/dist/v3/{OrTooltip-30e05f9e.js → OrTooltip-36c6728c.js} +33 -3
- package/dist/v3/components/index.d.ts +1 -0
- package/dist/v3/components/{or-rich-text-editor-v3/OrRichTextEditor.stories3.d.ts → or-segmented-control-v3/OrSegmentedControl.stories3.d.ts} +1 -1
- package/dist/v3/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts +77 -0
- package/dist/v3/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +47 -0
- package/dist/v3/components/or-segmented-control-v3/components/or-segmented-control-item/styles.d.ts +3 -0
- package/dist/v3/components/or-segmented-control-v3/index.d.ts +3 -0
- package/dist/v3/components/or-segmented-control-v3/props.d.ts +4 -0
- package/dist/v3/components/or-segmented-control-v3/styles.d.ts +3 -0
- package/dist/v3/components/or-segmented-control-v3/types.d.ts +4 -0
- package/dist/v3/components/or-select-v3/OrSelect.vue.d.ts +2 -2
- package/dist/v3/components/or-tooltip-v3/styles.d.ts +2 -0
- package/dist/v3/directives/index.d.ts +2 -0
- package/dist/v3/dropdown-open-0d314aa4.js +28 -0
- package/dist/v3/index.d.ts +1 -0
- package/dist/v3/index.js +15 -13
- package/dist/v3/index2.js +15 -13
- package/dist/v3/index20.js +4 -4
- package/dist/v3/index31.js +2 -2
- package/dist/v3/index34.js +3 -3
- package/dist/v3/index36.js +3 -3
- package/dist/v3/index38.js +3 -3
- package/dist/v3/index50.js +3 -3
- package/dist/v3/index52.js +3 -3
- package/dist/v3/index62.js +12 -280
- package/dist/v3/index63.js +2 -18
- package/dist/v3/index65.js +6 -5
- package/dist/v3/index78.js +1 -1
- package/dist/v3/index80.js +3 -3
- package/dist/v3/index88.js +3 -3
- package/dist/v3/index91.js +1 -1
- package/dist/v3/index92.js +1 -6
- package/dist/v3/index93.js +5 -1
- package/dist/v3/index94.js +3 -0
- package/dist/v3/{types-a2a8f948.js → types-d5d4ab32.js} +1 -1
- package/package.json +4 -9
- package/src/components/index.ts +1 -0
- package/src/components/or-avatar-v3/OrAvatar.docs.mdx +4 -0
- package/src/components/or-bottom-sheet-v3/OrBottomSheet.docs.mdx +4 -0
- package/src/components/or-button-v3/OrButton.docs.mdx +4 -0
- package/src/components/or-card-v3/OrCard.docs.mdx +4 -0
- package/src/components/or-checkbox-v3/OrCheckbox.docs.mdx +4 -0
- package/src/components/or-checkbox-v3/OrCheckbox.stories3.ts +1 -1
- package/src/components/or-confirm-v3/OrConfirm.docs.mdx +4 -0
- package/src/components/or-error-tag-v3/OrErrorTag.docs.mdx +5 -0
- package/src/components/or-error-v3/OrError.docs.mdx +4 -0
- package/src/components/or-expansion-panel-v3/OrExpansionPanel.docs.mdx +4 -0
- package/src/components/or-fab-v3/OrFab.docs.mdx +4 -0
- package/src/components/or-hint-v3/OrHint.docs.mdx +4 -0
- package/src/components/or-icon-button-v3/OrIconButton.docs.mdx +4 -0
- package/src/components/or-icon-v3/OrIcon.docs.mdx +4 -0
- package/src/components/or-inline-input-v3/OrInlineInput.docs.mdx +4 -0
- package/src/components/or-inline-input-v3/OrInlineInput.vue +2 -2
- package/src/components/or-inline-textarea-v3/OrInlineTextarea.docs.mdx +4 -0
- package/src/components/or-inline-textarea-v3/OrInlineTextarea.vue +2 -2
- package/src/components/or-input-v3/OrInput.docs.mdx +4 -0
- package/src/components/or-input-v3/OrInput.vue +21 -19
- package/src/components/or-label-v3/OrLabel.docs.mdx +4 -0
- package/src/components/or-link-v3/OrLink.docs.mdx +4 -0
- package/src/components/or-loader-v3/OrLoader.docs.mdx +4 -0
- package/src/components/or-menu-item-v3/OrMenuItem.docs.mdx +4 -0
- package/src/components/or-menu-v3/OrMenu.docs.mdx +4 -0
- package/src/components/or-modal-v3/OrModal.docs.mdx +4 -0
- package/src/components/or-notification-v3/OrNotification.docs.mdx +4 -0
- package/src/components/or-overlay-v3/OrOverlay.docs.mdx +4 -0
- package/src/components/or-popover-v3/OrPopover.docs.mdx +4 -0
- package/src/components/or-progress-v3/OrProgress.docs.mdx +4 -0
- package/src/components/or-radio-v3/OrRadio.docs.mdx +4 -0
- package/src/components/or-radio-v3/OrRadio.stories3.ts +1 -1
- package/src/components/or-search-v3/OrSearch.docs.mdx +4 -0
- package/src/components/or-segmented-control-v3/OrSegmentedControl.docs.mdx +7 -0
- package/src/components/or-segmented-control-v3/OrSegmentedControl.stories3.ts +106 -0
- package/src/components/or-segmented-control-v3/OrSegmentedControl.vue +107 -0
- package/src/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue +64 -0
- package/src/components/or-segmented-control-v3/components/or-segmented-control-item/styles.ts +50 -0
- package/src/components/or-segmented-control-v3/index.ts +3 -0
- package/src/components/or-segmented-control-v3/props.ts +4 -0
- package/src/components/or-segmented-control-v3/styles.ts +24 -0
- package/src/components/or-segmented-control-v3/types.ts +4 -0
- package/src/components/or-select-v3/OrSelect.docs.mdx +4 -0
- package/src/components/or-select-v3/OrSelect.vue +9 -6
- package/src/components/or-sidebar-v3/OrSidebar.docs.mdx +4 -0
- package/src/components/or-skeleton-v3/OrSkeleton.docs.mdx +8 -0
- package/src/components/or-switch-v3/OrSwitch.docs.mdx +4 -0
- package/src/components/or-switch-v3/OrSwitch.stories3.ts +1 -1
- package/src/components/or-tab-v3/OrTab.docs.mdx +4 -0
- package/src/components/or-tabs-v3/OrTabs.docs.mdx +4 -0
- package/src/components/or-tabs-v3/OrTabs.stories3.ts +9 -4
- package/src/components/or-tabs-v3/OrTabs.vue +1 -1
- package/src/components/or-tag-v3/OrTag.docs.mdx +4 -0
- package/src/components/or-teleport-v3/OrTeleport.docs.mdx +4 -0
- package/src/components/or-text-v3/OrText.docs.mdx +4 -0
- package/src/components/or-textarea-v3/OrTextarea.docs.mdx +4 -0
- package/src/components/or-tooltip-v3/OrTooltip.docs.mdx +3 -0
- package/src/components/or-tooltip-v3/OrTooltip.vue +3 -2
- package/src/components/or-tooltip-v3/styles.ts +55 -0
- package/src/directives/index.ts +2 -0
- package/src/hooks/useClassAttribute.ts +1 -1
- package/src/index.ts +1 -0
- package/dist/v2/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +0 -111
- package/dist/v2/components/or-rich-text-editor-v3/index.d.ts +0 -1
- package/dist/v2/components/or-rich-text-editor-v3/styles.d.ts +0 -7
- package/dist/v3/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +0 -111
- package/dist/v3/components/or-rich-text-editor-v3/index.d.ts +0 -1
- package/dist/v3/components/or-rich-text-editor-v3/styles.d.ts +0 -7
- package/src/components/or-rich-text-editor-v3/OrRichTextEditor.docs.mdx +0 -16
- package/src/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.ts +0 -57
- package/src/components/or-rich-text-editor-v3/OrRichTextEditor.vue +0 -295
- package/src/components/or-rich-text-editor-v3/index.ts +0 -1
- package/src/components/or-rich-text-editor-v3/styles.ts +0 -71
package/dist/v3/index80.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { s as OrTagV3, a as TagColor, T as TagVariant } from './OrTag-
|
|
1
|
+
export { s as OrTagV3, a as TagColor, T as TagVariant } from './OrTag-deaff080.js';
|
|
2
2
|
import 'vue-demi';
|
|
3
3
|
import './useClassAttribute-47fdb016.js';
|
|
4
4
|
import '@vueuse/core';
|
|
5
|
-
import './OrIconButton-
|
|
5
|
+
import './OrIconButton-5fb3a9aa.js';
|
|
6
6
|
import './OrIcon-b3906e35.js';
|
|
7
7
|
import 'vue';
|
|
8
|
-
import './OrTooltip-
|
|
8
|
+
import './OrTooltip-36c6728c.js';
|
|
9
9
|
import './OrPopover-3525c670.js';
|
|
10
10
|
import '@floating-ui/dom';
|
|
11
11
|
import './useElevation-0e973238.js';
|
package/dist/v3/index88.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { a as OrToastContainerV3, s as OrToastV3, t as TypesV3 } from './types-
|
|
1
|
+
export { a as OrToastContainerV3, s as OrToastV3, t as TypesV3 } from './types-d5d4ab32.js';
|
|
2
2
|
export { p as PropsV3, a as useQueueV3, u as useToastV3 } from './useToast-0665462d.js';
|
|
3
3
|
import '@vueuse/core';
|
|
4
4
|
import 'vue-demi';
|
|
5
5
|
import './OrTeleport.vue3-8099178c.js';
|
|
6
6
|
import 'vue';
|
|
7
|
-
import './OrIconButton-
|
|
7
|
+
import './OrIconButton-5fb3a9aa.js';
|
|
8
8
|
import './useClassAttribute-47fdb016.js';
|
|
9
9
|
import './OrIcon-b3906e35.js';
|
|
10
|
-
import './OrTooltip-
|
|
10
|
+
import './OrTooltip-36c6728c.js';
|
|
11
11
|
import './OrPopover-3525c670.js';
|
|
12
12
|
import '@floating-ui/dom';
|
|
13
13
|
import './useElevation-0e973238.js';
|
package/dist/v3/index91.js
CHANGED
package/dist/v3/index92.js
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { u as useElevation } from './useElevation-0e973238.js';
|
|
3
|
-
export { u as useOverflow } from './useOverflow-ac506c65.js';
|
|
4
|
-
export { u as useResponsive } from './useResponsive-a02e95b7.js';
|
|
5
|
-
export { u as useToggle } from './useToggle-29e4d7c7.js';
|
|
1
|
+
export { D as DropdownClose, a as DropdownOpen } from './dropdown-open-0d314aa4.js';
|
|
6
2
|
import 'vue-demi';
|
|
7
|
-
import '@vueuse/core';
|
package/dist/v3/index93.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
|
|
2
|
+
export { u as useElevation } from './useElevation-0e973238.js';
|
|
3
|
+
export { u as useOverflow } from './useOverflow-ac506c65.js';
|
|
1
4
|
export { u as useResponsive } from './useResponsive-a02e95b7.js';
|
|
2
|
-
|
|
5
|
+
export { u as useToggle } from './useToggle-29e4d7c7.js';
|
|
3
6
|
import 'vue-demi';
|
|
7
|
+
import '@vueuse/core';
|
|
@@ -2,7 +2,7 @@ import { useToggle } from '@vueuse/core';
|
|
|
2
2
|
import { defineComponent, ref, computed, onBeforeMount, onBeforeUnmount, nextTick } from 'vue-demi';
|
|
3
3
|
import { s as script$4 } from './OrTeleport.vue3-8099178c.js';
|
|
4
4
|
import { T as ToastType, P as PositionsX, b as PositionsY, c as TransitionType, d as useToastEventBus, a as useQueue } from './useToast-0665462d.js';
|
|
5
|
-
import { s as script$2 } from './OrIconButton-
|
|
5
|
+
import { s as script$2 } from './OrIconButton-5fb3a9aa.js';
|
|
6
6
|
import { s as script$3 } from './OrLoader-60943812.js';
|
|
7
7
|
import { resolveComponent, openBlock, createElementBlock, normalizeClass, renderSlot, createCommentVNode, createVNode, toDisplayString, createElementVNode, createBlock, withModifiers, withCtx, TransitionGroup, Fragment, renderList, mergeProps } from 'vue';
|
|
8
8
|
import { s as styleInject } from './style-inject.es-4c6f2515.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/ui-components",
|
|
3
|
-
"version": "2.63.0
|
|
3
|
+
"version": "2.63.0",
|
|
4
4
|
"description": "Vue components library for v2/3",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/auto/index.js",
|
|
@@ -29,14 +29,8 @@
|
|
|
29
29
|
"@codemirror/lang-json": "6.0.0",
|
|
30
30
|
"@codemirror/lang-markdown": "6.0.1",
|
|
31
31
|
"@floating-ui/dom": "0.3.1",
|
|
32
|
-
"@onereach/styles": "^2.
|
|
32
|
+
"@onereach/styles": "^2.31.0",
|
|
33
33
|
"@splidejs/splide": "4.0.6",
|
|
34
|
-
"@tiptap/core": "2.0.0-beta.209",
|
|
35
|
-
"@tiptap/extension-highlight": "2.0.0-beta.209",
|
|
36
|
-
"@tiptap/extension-link": "2.0.0-beta.209",
|
|
37
|
-
"@tiptap/extension-placeholder": "2.0.0-beta.209",
|
|
38
|
-
"@tiptap/extension-underline": "2.0.0-beta.209",
|
|
39
|
-
"@tiptap/starter-kit": "2.0.0-beta.209",
|
|
40
34
|
"@types/lodash": "4.14.173",
|
|
41
35
|
"@types/sortablejs": "1.10.7",
|
|
42
36
|
"@types/uuid": "8.3.1",
|
|
@@ -84,5 +78,6 @@
|
|
|
84
78
|
},
|
|
85
79
|
"publishConfig": {
|
|
86
80
|
"access": "public"
|
|
87
|
-
}
|
|
81
|
+
},
|
|
82
|
+
"gitHead": "1d365d54677891124b332a6725dc7fecc7d5c10e"
|
|
88
83
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -58,6 +58,7 @@ export * from './or-radio';
|
|
|
58
58
|
export * from './or-radio-group';
|
|
59
59
|
export * from './or-radio-v3';
|
|
60
60
|
export * from './or-search-v3';
|
|
61
|
+
export * from './or-segmented-control-v3';
|
|
61
62
|
export * from './or-select';
|
|
62
63
|
export * from './or-select-v3';
|
|
63
64
|
export * from './or-sidebar';
|
|
@@ -217,7 +217,7 @@ export default defineComponent({
|
|
|
217
217
|
|
|
218
218
|
function reset(): void {
|
|
219
219
|
if (draftModelValue.value !== proxyModelValue.value) {
|
|
220
|
-
draftModelValue.value = proxyModelValue.value;
|
|
220
|
+
draftModelValue.value = proxyModelValue.value ?? '';
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
activated.value = false;
|
|
@@ -225,7 +225,7 @@ export default defineComponent({
|
|
|
225
225
|
|
|
226
226
|
// Effects
|
|
227
227
|
watch(proxyModelValue, (value) => {
|
|
228
|
-
draftModelValue.value = value;
|
|
228
|
+
draftModelValue.value = value ?? '';
|
|
229
229
|
}, { immediate: true });
|
|
230
230
|
|
|
231
231
|
return {
|
|
@@ -205,7 +205,7 @@ export default defineComponent({
|
|
|
205
205
|
|
|
206
206
|
function reset(): void {
|
|
207
207
|
if (draftModelValue.value !== proxyModelValue.value) {
|
|
208
|
-
draftModelValue.value = proxyModelValue.value;
|
|
208
|
+
draftModelValue.value = proxyModelValue.value ?? '';
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
activated.value = false;
|
|
@@ -213,7 +213,7 @@ export default defineComponent({
|
|
|
213
213
|
|
|
214
214
|
// Effects
|
|
215
215
|
watch(proxyModelValue, (value) => {
|
|
216
|
-
draftModelValue.value = value;
|
|
216
|
+
draftModelValue.value = value ?? '';
|
|
217
217
|
}, { immediate: true });
|
|
218
218
|
|
|
219
219
|
return {
|
|
@@ -41,32 +41,34 @@
|
|
|
41
41
|
@blur="$emit('blur', $event)"
|
|
42
42
|
>
|
|
43
43
|
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
:icon="{ icon: disclosed ? 'visibility_off' : 'visibility', variant: 'filled' }"
|
|
47
|
-
:color="'inherit'"
|
|
48
|
-
:disabled="disabled"
|
|
49
|
-
@click.stop="disclosed = !disclosed"
|
|
50
|
-
/>
|
|
51
|
-
</template>
|
|
52
|
-
|
|
53
|
-
<template v-if="type === 'search'">
|
|
54
|
-
<template v-if="modelValue">
|
|
44
|
+
<div :class="['-m-xs', 'ml-none']">
|
|
45
|
+
<template v-if="type === 'password'">
|
|
55
46
|
<OrIconButton
|
|
56
|
-
:icon="'
|
|
47
|
+
:icon="{ icon: disclosed ? 'visibility_off' : 'visibility', variant: 'filled' }"
|
|
57
48
|
:color="'inherit'"
|
|
58
49
|
:disabled="disabled"
|
|
59
|
-
@click.stop="
|
|
50
|
+
@click.stop="disclosed = !disclosed"
|
|
60
51
|
/>
|
|
61
52
|
</template>
|
|
62
53
|
|
|
63
|
-
<template v-
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
54
|
+
<template v-if="type === 'search'">
|
|
55
|
+
<template v-if="modelValue">
|
|
56
|
+
<OrIconButton
|
|
57
|
+
:icon="'close'"
|
|
58
|
+
:color="'inherit'"
|
|
59
|
+
:disabled="disabled"
|
|
60
|
+
@click.stop="$emit('update:modelValue', '')"
|
|
61
|
+
/>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<template v-else>
|
|
65
|
+
<OrIcon
|
|
66
|
+
:icon="'search'"
|
|
67
|
+
:variant="'outlined'"
|
|
68
|
+
/>
|
|
69
|
+
</template>
|
|
68
70
|
</template>
|
|
69
|
-
</
|
|
71
|
+
</div>
|
|
70
72
|
</OrInputBox>
|
|
71
73
|
|
|
72
74
|
<template v-if="!invalid">
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
+
import { ref, watch } from 'vue-demi';
|
|
4
|
+
import OrSegmentedControlDocs from './OrSegmentedControl.docs.mdx';
|
|
5
|
+
import OrSegmentedControl from './OrSegmentedControl.vue';
|
|
6
|
+
import { SegmentedControlSize } from './props';
|
|
7
|
+
import { SegmentedControlOption } from './types';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Components/Forms/Segmented Control',
|
|
11
|
+
component: OrSegmentedControl,
|
|
12
|
+
|
|
13
|
+
argTypes: {
|
|
14
|
+
// Props
|
|
15
|
+
options: {
|
|
16
|
+
control: { type: 'object' },
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
modelValue: {
|
|
20
|
+
control: { type: 'text' },
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
value: { // TODO: Remove Vue 2 fallback
|
|
24
|
+
table: { disable: true },
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
size: {
|
|
28
|
+
control: { type: 'select' },
|
|
29
|
+
options: Object.values(SegmentedControlSize),
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
disabled: {
|
|
33
|
+
control: { type: 'boolean' },
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// Events
|
|
37
|
+
'update:modelValue': {
|
|
38
|
+
table: { disable: true },
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
input: {
|
|
42
|
+
table: { disable: true },
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
parameters: {
|
|
47
|
+
layout: 'centered',
|
|
48
|
+
|
|
49
|
+
docs: {
|
|
50
|
+
page: OrSegmentedControlDocs,
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
design: {
|
|
54
|
+
type: 'figma',
|
|
55
|
+
url: 'https://www.figma.com/file/o7DdkaznUW2PtX4wiSuhhQ/Core?node-id=410%3A2097&t=7N93DAotOYMOX2kx-1',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
} as Meta<typeof OrSegmentedControl>;
|
|
59
|
+
|
|
60
|
+
const Template: StoryFn<typeof OrSegmentedControl> = (args) => ({
|
|
61
|
+
components: {
|
|
62
|
+
OrSegmentedControl,
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
setup() {
|
|
66
|
+
// State
|
|
67
|
+
const model = ref<string>();
|
|
68
|
+
|
|
69
|
+
// Effects
|
|
70
|
+
watch(model, (value) => {
|
|
71
|
+
console.debug(value);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
args,
|
|
76
|
+
model,
|
|
77
|
+
onUpdateModelValue: action('update:modelValue'),
|
|
78
|
+
onInput: action('input'),
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
template: `
|
|
83
|
+
<OrSegmentedControl
|
|
84
|
+
v-model="model"
|
|
85
|
+
v-bind="args"
|
|
86
|
+
@update:modelValue="onUpdateModelValue"
|
|
87
|
+
@input="onInput"
|
|
88
|
+
/>
|
|
89
|
+
`,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export const Base = Template.bind({});
|
|
93
|
+
|
|
94
|
+
Base.args = {
|
|
95
|
+
// Props
|
|
96
|
+
options: Array.from<string, SegmentedControlOption>([
|
|
97
|
+
'Alfa',
|
|
98
|
+
'Bravo',
|
|
99
|
+
'Charlie',
|
|
100
|
+
'Delta',
|
|
101
|
+
'Echo',
|
|
102
|
+
], (item) => ({
|
|
103
|
+
value: item.toLowerCase(),
|
|
104
|
+
label: item,
|
|
105
|
+
})),
|
|
106
|
+
};
|