@nexxtmove/ui 1.15.0 → 1.16.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/components/editor/molecules/EditorFlexDirection/EditorFlexDirection.vue.d.ts +39 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +465 -424
- package/dist/nuxt.js +2 -1
- package/package.json +1 -1
- package/src/components/editor/atoms/EditorSettingsBlock/EditorSettingsBlock.vue +1 -1
- package/src/components/editor/molecules/EditorFlexDirection/EditorFlexDirection.vue +73 -0
- package/src/components.json +2 -1
- package/src/index.ts +5 -0
package/dist/nuxt.js
CHANGED
|
@@ -64,7 +64,8 @@ var s = {
|
|
|
64
64
|
NexxtTimelineTrack: "components/organisms/TimelineTrack/TimelineTrack.vue",
|
|
65
65
|
NexxtToaster: "components/organisms/Toaster/Toaster.vue",
|
|
66
66
|
NexxtVideoPlayer: "components/organisms/VideoPlayer/VideoPlayer.vue",
|
|
67
|
-
NexxtEditorSettingsBlock: "components/editor/atoms/EditorSettingsBlock/EditorSettingsBlock.vue"
|
|
67
|
+
NexxtEditorSettingsBlock: "components/editor/atoms/EditorSettingsBlock/EditorSettingsBlock.vue",
|
|
68
|
+
NexxtEditorFlexDirection: "components/editor/molecules/EditorFlexDirection/EditorFlexDirection.vue"
|
|
68
69
|
}, c = ["@nexxtmove/ui/ui.css", "@nexxtmove/ui/dist/ui.css"], l = (e, t) => e.some((e) => e === t || c.includes(e)), u = i({
|
|
69
70
|
meta: {
|
|
70
71
|
name: "@nexxtmove/ui",
|
package/package.json
CHANGED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* The flex direction as the editor needs it: the Tailwind class itself, so the
|
|
4
|
+
* consumer can put the model value straight on the element it styles.
|
|
5
|
+
*/
|
|
6
|
+
export type EditorFlexDirectionValue = 'flex-row' | 'flex-col'
|
|
7
|
+
|
|
8
|
+
/** Overridable copy for the two options. Every key is optional. */
|
|
9
|
+
export interface EditorFlexDirectionMessages {
|
|
10
|
+
/** Label of the `flex-row` option. Defaults to `'Horizontaal'`. */
|
|
11
|
+
horizontal?: string
|
|
12
|
+
/** Label of the `flex-col` option. Defaults to `'Verticaal'`. */
|
|
13
|
+
vertical?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface NexxtEditorFlexDirectionProps {
|
|
17
|
+
/**
|
|
18
|
+
* Header text of the settings block. Defaults to the Dutch `'Richting'`;
|
|
19
|
+
* the library has no i18n layer, so a consumer in another language passes
|
|
20
|
+
* its own copy in.
|
|
21
|
+
*/
|
|
22
|
+
label?: string
|
|
23
|
+
/**
|
|
24
|
+
* Labels of the two options. Defaults are Dutch and are merged per key, so
|
|
25
|
+
* overriding one label keeps the default of the other. Copy is never
|
|
26
|
+
* translated inside the component.
|
|
27
|
+
*/
|
|
28
|
+
messages?: EditorFlexDirectionMessages
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const DEFAULT_MESSAGES = {
|
|
32
|
+
horizontal: 'Horizontaal',
|
|
33
|
+
vertical: 'Verticaal',
|
|
34
|
+
} satisfies Required<EditorFlexDirectionMessages>
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<script lang="ts" setup>
|
|
38
|
+
import { computed } from 'vue'
|
|
39
|
+
import NexxtEditorSettingsBlock from '../../atoms/EditorSettingsBlock/EditorSettingsBlock.vue'
|
|
40
|
+
import NexxtToggleGroup from '../../../molecules/ToggleGroup/ToggleGroup.vue'
|
|
41
|
+
import type { NexxtToggleGroupOption } from '../../../molecules/ToggleGroup/ToggleGroup.vue'
|
|
42
|
+
|
|
43
|
+
defineOptions({ name: 'NexxtEditorFlexDirection' })
|
|
44
|
+
|
|
45
|
+
const { label = 'Richting', messages } = defineProps<NexxtEditorFlexDirectionProps>()
|
|
46
|
+
|
|
47
|
+
/** The selected direction, as the Tailwind class to apply. */
|
|
48
|
+
const model = defineModel<EditorFlexDirectionValue>({ required: true })
|
|
49
|
+
|
|
50
|
+
const copy = computed(() => ({ ...DEFAULT_MESSAGES, ...messages }))
|
|
51
|
+
|
|
52
|
+
const options = computed<NexxtToggleGroupOption[]>(() => [
|
|
53
|
+
{ value: 'flex-row', label: copy.value.horizontal, icon: 'arrow-right' },
|
|
54
|
+
{ value: 'flex-col', label: copy.value.vertical, icon: 'arrow-down' },
|
|
55
|
+
])
|
|
56
|
+
|
|
57
|
+
// ToggleGroup types its model as the open `string` of its options, so writing
|
|
58
|
+
// straight back into the narrower model is a type error. The setter is the one
|
|
59
|
+
// place that narrowing happens, and it is safe: the only values ToggleGroup can
|
|
60
|
+
// emit are the option values built above.
|
|
61
|
+
const selected = computed({
|
|
62
|
+
get: () => model.value,
|
|
63
|
+
set: (value: string) => {
|
|
64
|
+
model.value = value as EditorFlexDirectionValue
|
|
65
|
+
},
|
|
66
|
+
})
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<template>
|
|
70
|
+
<NexxtEditorSettingsBlock :label="label">
|
|
71
|
+
<NexxtToggleGroup v-model="selected" :options="options" />
|
|
72
|
+
</NexxtEditorSettingsBlock>
|
|
73
|
+
</template>
|
package/src/components.json
CHANGED
|
@@ -61,5 +61,6 @@
|
|
|
61
61
|
"NexxtTimelineTrack": "components/organisms/TimelineTrack/TimelineTrack.vue",
|
|
62
62
|
"NexxtToaster": "components/organisms/Toaster/Toaster.vue",
|
|
63
63
|
"NexxtVideoPlayer": "components/organisms/VideoPlayer/VideoPlayer.vue",
|
|
64
|
-
"NexxtEditorSettingsBlock": "components/editor/atoms/EditorSettingsBlock/EditorSettingsBlock.vue"
|
|
64
|
+
"NexxtEditorSettingsBlock": "components/editor/atoms/EditorSettingsBlock/EditorSettingsBlock.vue",
|
|
65
|
+
"NexxtEditorFlexDirection": "components/editor/molecules/EditorFlexDirection/EditorFlexDirection.vue"
|
|
65
66
|
}
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,10 @@ export type { EnergyLabelLetter } from './components/atoms/EnergyLabel/EnergyLab
|
|
|
13
13
|
export type { IconType, NexxtIconName } from './components/atoms/Icon/Icon.vue'
|
|
14
14
|
export type { CustomIconName } from './components/atoms/Icon/customIcons'
|
|
15
15
|
export type { NexxtTabItem } from './components/molecules/Tabs/Tabs.vue'
|
|
16
|
+
export type {
|
|
17
|
+
EditorFlexDirectionMessages,
|
|
18
|
+
EditorFlexDirectionValue,
|
|
19
|
+
} from './components/editor/molecules/EditorFlexDirection/EditorFlexDirection.vue'
|
|
16
20
|
export type {
|
|
17
21
|
NexxtTemplateCardContentFeature,
|
|
18
22
|
NexxtTemplateCardProps,
|
|
@@ -36,6 +40,7 @@ export { default as NexxtCustomerJourneyTile } from './components/molecules/Cust
|
|
|
36
40
|
export { default as NexxtDatePicker } from './components/organisms/DatePicker/DatePicker.vue'
|
|
37
41
|
export { default as NexxtDoughnutChart } from './components/molecules/DoughnutChart/DoughnutChart.vue'
|
|
38
42
|
export { default as NexxtDropdownButton } from './components/organisms/DropdownButton/DropdownButton.vue'
|
|
43
|
+
export { default as NexxtEditorFlexDirection } from './components/editor/molecules/EditorFlexDirection/EditorFlexDirection.vue'
|
|
39
44
|
export { default as NexxtEditorSettingsBlock } from './components/editor/atoms/EditorSettingsBlock/EditorSettingsBlock.vue'
|
|
40
45
|
export { default as NexxtEnergyLabel } from './components/atoms/EnergyLabel/EnergyLabel.vue'
|
|
41
46
|
export { default as NexxtFloatingPanel } from './components/atoms/FloatingPanel/FloatingPanel.vue'
|