discourse/app/assets/stylesheets
Joffrey JAFFEUX f6a4de4805
DEV: adds support for nested collections and objects (#30265)
Collections were an existing concept in FormKit but didn't allow nesting. You can now do infinite nesting:

```gjs
<Form
  @data={{hash
    foo=(array
      (hash bar=(array (hash baz=1))) (hash bar=(array (hash baz=2)))
    )
  }}
  as |form|
>
  <form.Collection @name="foo" as |parent parentIndex|>
    <parent.Collection @name="bar" as |child childIndex|>
      <child.Field @name="baz" @title="Baz" as |field|>
        <field.Input />
      </child.Field>
    </parent.Collection>
  </form.Collection>
</Form>
```

On top of this a new component has been added: `Object`. It allows you to represent objects in your form data. Collections are basically handling arrays, and Objects are objects.

This is useful if you form data has this shape for example:

```javascript
{ foo: { bar: 1, baz: 2 } }
```

This can now be mapped in your form using this syntax:

```gjs
<Form @data={{hash foo=(hash bar=1 baz=2)}} as |form|>
  <form.Object @name="foo" as |object name|>
    <object.Field @name={{name}} @title={{name}} as |field|>
      <field.Input />
    </object.Field>
  </form.Object>
</Form>
```

Objects accept nested collections and nested objects. Just like Collections.

A small addition has also been made to `Collection`, they now support a custom `@tagName`, it's useful if each item of your collection is the row of a table for example.
2024-12-13 15:43:32 +01:00
..
common DEV: adds support for nested collections and objects (#30265) 2024-12-13 15:43:32 +01:00
desktop Cleanup mobile topic footer area (#30132) 2024-12-11 14:59:37 +01:00
mobile UX: increase button sizes and timeline size (#30240) 2024-12-12 16:09:44 +01:00
vendor DEV: FloatKit (#23650) 2023-09-26 13:39:52 +02:00
admin_rtl.scss FEATURE: Serve RTL versions of admin and plugins CSS bundles for RTL locales (#21876) 2023-06-01 05:27:11 +03:00
admin.scss
color_definitions.scss UX: Multiple codeblocks fixes (#29898) 2024-11-22 13:52:23 -06:00
common.scss DEV: form-kit 2024-07-17 11:59:35 +02:00
desktop_rtl.scss
desktop.scss
embed.scss FIX: Broken hashtags on embed and publish pages (#24210) 2023-11-02 11:43:55 +10:00
ember_cli.scss
mobile_rtl.scss
mobile.scss DEV: form-kit 2024-07-17 11:59:35 +02:00
publish.scss FIX: Broken hashtags on embed and publish pages (#24210) 2023-11-02 11:43:55 +10:00
qunit-custom.scss UX: update twitter blue to X black (#26343) 2024-03-25 11:36:33 -04:00
qunit.scss
wcag.scss Cleanup mobile topic footer area (#30132) 2024-12-11 14:59:37 +01:00
wizard_rtl.scss FEATURE: Serve RTL versions of admin and plugins CSS bundles for RTL locales (#21876) 2023-06-01 05:27:11 +03:00
wizard.scss DEV: Update member access wizard step to use toggle group (#28013) 2024-07-29 14:07:06 +08:00