Skip to content

Commit

Permalink
Merge pull request #21 from RyanBirtch-aot/map-layer
Browse files Browse the repository at this point in the history
Display Settings Updated for Map Layer
  • Loading branch information
RyanBirtch-aot authored Sep 11, 2024
2 parents 1ecab43 + db9a6c2 commit 984f613
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 60 deletions.
49 changes: 17 additions & 32 deletions components/src/components/Map/Component.form.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,16 @@
import baseEditForm from 'formiojs/components/_classes/component/Component.form';
import EditData from './editForm/Component.edit.data';
import EditDisplay from './editForm/Component.edit.display';
import AdvancedEditLogic from '../Common/Advanced.edit.logic';
export default function (...extend) {
return baseEditForm(
[
EditDisplay,
EditData,
{
key: 'display',
components: [
{
// You can ignore existing fields.
key: 'placeholder',
ignore: true,
},
{
key: 'tableView',
ignore: true,
},
{
key: 'hidden',
ignore: true,
},
{
key: 'autofocus',
ignore: true,
},
{
key: 'tabindex',
ignore: true,
},
{
key: 'modalEdit',
ignore: true,
},
{
key: 'disabled',
ignore: true,
},
],
ignore: true,
},
EditData,
{
key: 'data',
ignore: true,
Expand All @@ -47,6 +19,19 @@ export default function (...extend) {
key: 'validation',
ignore: true,
},
{
key: 'api',
components: [
{
key: 'tags',
ignore: true,
},
{
key: 'properties',
ignore: true,
},
],
},
{
key: 'logic',
components: AdvancedEditLogic,
Expand Down
121 changes: 93 additions & 28 deletions components/src/components/Map/editForm/Component.edit.display.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,93 @@
import common from '../../Common/Simple.edit.display';
export default [
...common,
{
key: 'refreshOnChange',
ignore: true,
},
{
key: 'className',
ignore: true,
},
{
key: 'prefix',
ignore: true,
},
{
key: 'suffix',
ignore: true,
},
{
key: 'labelPosition',
ignore: true,
},
{
key: 'placeholder',
ignore: true,
},
];
export default {
key: 'customDisplay',
label: 'Display',
weight: 10,
components: [
{
key: 'label',
label: 'Label',
type: 'textfield',
input: true,
tooltip: 'The label for this field.',
},
{
key: 'hideLabel',
label: 'Hide Label',
type: 'checkbox',
tooltip:
'Check to hide the label for this component. This allows you to show the label in the form Builder, but not when it is rendered',
input: true,
},
{
key: 'labelPosition',
label: 'Label Position',
type: 'select',
input: true,
data: {
values: [
{ value: 'top', label: 'Top' },
{ value: 'left-left', label: 'Left (Left-aligned)' },
{ value: 'left-right', label: 'Left (Right-aligned)' },
{ value: 'right-left', label: 'Right (Left-aligned)' },
{ value: 'right-right', label: 'Right (Right-aligned)' },
{ value: 'bottom', label: 'Bottom' },
],
},
tooltip: 'Position of the label relative to the field.',
},
{
key: 'description',
label: 'Text Description (optional)',
type: 'textarea',
input: true,
placeholder: 'This will appear below the map',
tooltip: 'Enter a description for the map component here',
},
{
key: 'tooltip',
label: 'Tooltip',
type: 'textarea',
input: true,
tooltip: 'Add a tooltip to provide additional information.',
placeholder: 'Add a tooltip beside the label',
},
{
key: 'customClass',
label: 'Custom CSS Class',
type: 'textfield',
input: true,
tooltip:
'Assign one or more CSS class names to customize the appearance of this component.',
},

// {
// // You can ignore existing fields.
// key: 'placeholder',
// ignore: true,
// },
// {
// key: 'tableView',
// ignore: true,
// },
// {
// key: 'hidden',
// ignore: true,
// },
// {
// key: 'autofocus',
// ignore: true,
// },
// {
// key: 'tabindex',
// ignore: true,
// },
// {
// key: 'modalEdit',
// ignore: true,
// },
// {
// key: 'disabled',
// ignore: true,
// },
],
};

0 comments on commit 984f613

Please sign in to comment.