From 55697e601e9b94e2159aa27613edd7265d5d06af Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Mon, 20 Nov 2023 15:51:34 +0100 Subject: [PATCH 1/2] feat(Textarea): add default slot for complex usages Resolves #971 --- src/runtime/components/forms/Textarea.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/runtime/components/forms/Textarea.vue b/src/runtime/components/forms/Textarea.vue index 9b10d6c9c1..a8b41daef9 100644 --- a/src/runtime/components/forms/Textarea.vue +++ b/src/runtime/components/forms/Textarea.vue @@ -16,6 +16,8 @@ @blur="onBlur" @change="onChange" /> + + From c9b9bd6fb9d048afca4a41d9077b0516b7e31c3f Mon Sep 17 00:00:00 2001 From: Conner Blanton Date: Mon, 20 Nov 2023 10:00:16 -0600 Subject: [PATCH 2/2] docs: sort component `size` prop (#956) --- docs/components/content/ComponentCard.vue | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/components/content/ComponentCard.vue b/docs/components/content/ComponentCard.vue index d167520646..753ac4d20c 100644 --- a/docs/components/content/ComponentCard.vue +++ b/docs/components/content/ComponentCard.vue @@ -153,6 +153,23 @@ const generateOptions = (key: string, schema: { kind: string, schema: [], type: options = [...appConfig.ui.colors] } + if (key.toLowerCase() === 'size' && schema?.schema?.length > 0) { + const baseSizeOrder = { 'xs': 1, 'sm': 2, 'md': 3, 'lg': 4, 'xl': 5 } + schema.schema.sort((a: string, b: string) => { + const aBase = a.match(/[a-zA-Z]+/)[0].toLowerCase() + const bBase = b.match(/[a-zA-Z]+/)[0].toLowerCase() + + const aNum = parseInt(a.match(/\d+/)?.[0]) || 1 + const bNum = parseInt(b.match(/\d+/)?.[0]) || 1 + + if (aBase === bBase) { + return aBase === 'xs' ? bNum - aNum : aNum - bNum + } + + return baseSizeOrder[aBase] - baseSizeOrder[bBase] + }) + } + if (schema?.schema?.length > 0 && schema?.kind === 'enum' && !hasIgnoredTypes && optionItem?.restriction !== 'only') { options = schema.schema.filter(option => typeof option === 'string').map((option: string) => option.replaceAll('"', '')) }