From 818f4c87f4b91a002399400d7d629bbaffc1a258 Mon Sep 17 00:00:00 2001
From: Triin Kullisaar <95503530+tkullisaar@users.noreply.github.com>
Date: Thu, 21 Sep 2023 15:50:44 +0300
Subject: [PATCH] fix: Table and Select example fixes (#719)
---
lib/moon/design/form/select.ex | 4 ++-
.../design/table_example/responsive.ex | 26 +++++++++----------
lib/moon_web/pages/design/form/select_page.ex | 4 +--
3 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/lib/moon/design/form/select.ex b/lib/moon/design/form/select.ex
index a79641897..124396050 100644
--- a/lib/moon/design/form/select.ex
+++ b/lib/moon/design/form/select.ex
@@ -39,7 +39,9 @@ defmodule Moon.Design.Form.Select do
@doc "Some additional styling will be set to indicate the field is invalid. Generally should be set by Form.Field component"
prop(error, :boolean, from_context: :error)
- @doc "If field does support multiselect, multiple attribute for select tag in HTML terms"
+ @doc """
+ Experimental: If field does support multiselect, multiple attribute for select tag in HTML terms
+ """
prop(is_multiple, :boolean)
def render(assigns) do
diff --git a/lib/moon_web/examples/design/table_example/responsive.ex b/lib/moon_web/examples/design/table_example/responsive.ex
index 7837c49eb..387cd9b2f 100644
--- a/lib/moon_web/examples/design/table_example/responsive.ex
+++ b/lib/moon_web/examples/design/table_example/responsive.ex
@@ -29,11 +29,6 @@ defmodule MoonWeb.Examples.Design.TableExample.Responsive do
def render(assigns) do
~F"""
-
- #{model.id}: {model.name} by {model.user} at {Timex.format!(model.created_at, "%b %d, %Y", :strftime)}
-
- {model.long_text |> String.slice(0, 30)}...
-
{model.id}
@@ -54,6 +49,11 @@ defmodule MoonWeb.Examples.Design.TableExample.Responsive do
{model.long_text}
{model.long_text |> String.slice(0, 70)}...
+
+ #{model.id}: {model.name} by {model.user} at {Timex.format!(model.created_at, "%b %d, %Y", :strftime)}
+
+ {model.long_text |> String.slice(0, 30)}...
+
"""
end
@@ -80,13 +80,8 @@ defmodule MoonWeb.Examples.Design.TableExample.Responsive do
def render(assigns) do
~F\"""
-
-
- \#{model.id}: {model.name} by {model.user} at {Timex.format!(model.created_at, "%b %d, %Y", :strftime)}
-
- {model.long_text |> String.slice(0, 30)}...
-
-
+
+
{model.id}
@@ -96,7 +91,7 @@ defmodule MoonWeb.Examples.Design.TableExample.Responsive do
{Timex.format!(model.created_at, "%b %d, %Y, %H:%M:%S", :strftime)}
{Timex.format!(model.created_at, "%b %d, %Y", :strftime)}
-
+
{model.user}
@@ -106,6 +101,11 @@ defmodule MoonWeb.Examples.Design.TableExample.Responsive do
{model.long_text}
{model.long_text |> String.slice(0, 70)}...
+
+ \#{model.id}: {model.name} by {model.user} at {Timex.format!(model.created_at, "%b %d, %Y", :strftime)}
+
+ {model.long_text |> String.slice(0, 30)}...
+
\"""
end
diff --git a/lib/moon_web/pages/design/form/select_page.ex b/lib/moon_web/pages/design/form/select_page.ex
index 5d79fbedc..18f21726a 100644
--- a/lib/moon_web/pages/design/form/select_page.ex
+++ b/lib/moon_web/pages/design/form/select_page.ex
@@ -48,8 +48,8 @@ defmodule MoonWeb.Pages.Design.Form.SelectPage do
SelectExample.Sizes,
SelectExample.WithLabel,
SelectExample.DisabledAndError,
- SelectExample.WithHint,
- SelectExample.MultipleChoices
+ SelectExample.WithHint
+ # SelectExample.MultipleChoices
]} />