diff --git a/resources/lang/ar.json b/resources/lang/ar.json index cc10b4b2..913e36d1 100644 --- a/resources/lang/ar.json +++ b/resources/lang/ar.json @@ -176,6 +176,7 @@ "fields per row" :"عدد الحقول في كل صف", "Full Width" :"كامل العرض", "show this field in full width row" :"عرض هذا الحقل في صف منفصل", + "Hidden Label": "اخفاء العنوان", "open" :"عرض", "Open Form" :"عرض النموذج", "Conditional Visibility" :"ظهور الحقل بشرط", diff --git a/resources/lang/ckb.json b/resources/lang/ckb.json index c47b44ec..283ef2ff 100644 --- a/resources/lang/ckb.json +++ b/resources/lang/ckb.json @@ -175,6 +175,7 @@ "fields per row" :" بەشەکان بۆ هەر ڕیزێک", "Full Width" :"پانی تەواو", "show this field in full width row" :"ئەم بەشە بە ڕیزی تەواوی پانایی نیشان بدە", + "Hidden Label": "Hidden Label", "open" :"کردنەوە", "Open Form" :"کردنەوەی فۆڕم", "Conditional Visibility" :"بینینی مەرجدار", diff --git a/resources/lang/de.json b/resources/lang/de.json index a4e840de..b254d471 100644 --- a/resources/lang/de.json +++ b/resources/lang/de.json @@ -175,6 +175,7 @@ "fields per row" :"fields per row", "Full Width" :"Full Width", "show this field in full width row" :"show this field in full width row", + "Hidden Label": "Verstecktes Etikett", "open" :"open", "Open Form" :"Open Form", "Conditional Visibility" :"Conditional Visibility", diff --git a/resources/lang/en.json b/resources/lang/en.json index 89637038..62937c1b 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -175,6 +175,7 @@ "fields per row" :"fields per row", "Full Width" :"Full Width", "show this field in full width row" :"show this field in full width row", + "Hidden Label": "Hidden Label", "open" :"open", "Open Form" :"Open Form", "Conditional Visibility" :"Conditional Visibility", diff --git a/resources/lang/es.json b/resources/lang/es.json index 89ced7d4..cbc5ae4f 100644 --- a/resources/lang/es.json +++ b/resources/lang/es.json @@ -175,6 +175,7 @@ "fields per row" :"campos por fila", "Full Width" :"Ancho Completo", "show this field in full width row" :"mostrar este campo en una fila de ancho completo", + "Hidden Label": "Etiqueta Oculta", "open" :"abrir", "Open Form" :"Abrir Formulario", "Conditional Visibility" :"Visibilidad Condicional", diff --git a/resources/lang/fr.json b/resources/lang/fr.json index 40afb82f..f8380779 100644 --- a/resources/lang/fr.json +++ b/resources/lang/fr.json @@ -175,6 +175,7 @@ "fields per row" :"fields per row", "Full Width" :"Full Width", "show this field in full width row" :"show this field in full width row", + "Hidden Label": "Étiquette cachée", "open" :"open", "Open Form" :"Open Form", "Conditional Visibility" :"Conditional Visibility", diff --git a/src/Concerns/HasHiddenOptions.php b/src/Concerns/HasHiddenOptions.php index 6cb19150..a36b86ee 100644 --- a/src/Concerns/HasHiddenOptions.php +++ b/src/Concerns/HasHiddenOptions.php @@ -39,6 +39,13 @@ public static function hiddenColumnSpanFull(): array ]; } + public static function hiddenHiddenLabel(): array + { + return [ + Hidden::make('options.hidden_label')->default(false), + ]; + } + public static function hiddenDataSource(): array { return [ diff --git a/src/Concerns/HasOptions.php b/src/Concerns/HasOptions.php index 6cf7487e..bd784f61 100644 --- a/src/Concerns/HasOptions.php +++ b/src/Concerns/HasOptions.php @@ -121,6 +121,16 @@ public static function columnSpanFull(): Grid ->columns(1); } + public static function hiddenLabel(): Grid + { + return Grid::make() + ->schema([ + Toggle::make('options.hidden_label') + ->label(__('Hidden Label')), + ]) + ->columns(1); + } + public static function dataSource(): Grid { $dataSources = BoltPlugin::getModel('Collection')::get() diff --git a/src/Fields/Classes/CheckboxList.php b/src/Fields/Classes/CheckboxList.php index c229eb95..85e3943b 100644 --- a/src/Fields/Classes/CheckboxList.php +++ b/src/Fields/Classes/CheckboxList.php @@ -43,6 +43,7 @@ public static function getOptions(?array $sections = null, ?array $field = null) ->schema([ self::required(), self::columnSpanFull(), + self::hiddenLabel(), self::htmlID(), ]), self::hintOptions(), @@ -66,6 +67,7 @@ public static function getOptionsHidden(): array self::hiddenHintOptions(), self::hiddenRequired(), self::hiddenColumnSpanFull(), + self::hiddenHiddenLabel(), ]; } diff --git a/src/Fields/Classes/ColorPicker.php b/src/Fields/Classes/ColorPicker.php index 1c4d5fba..453b0797 100644 --- a/src/Fields/Classes/ColorPicker.php +++ b/src/Fields/Classes/ColorPicker.php @@ -48,6 +48,7 @@ public static function getOptions(?array $sections = null): array ]), self::required(), self::columnSpanFull(), + self::hiddenLabel(), self::htmlID(), ]), self::hintOptions(), @@ -66,6 +67,7 @@ public static function getOptionsHidden(): array self::hiddenHintOptions(), self::hiddenRequired(), self::hiddenColumnSpanFull(), + self::hiddenHiddenLabel(), self::hiddenVisibility(), ]; } diff --git a/src/Fields/Classes/DatePicker.php b/src/Fields/Classes/DatePicker.php index 21f9e4f4..b3445f57 100644 --- a/src/Fields/Classes/DatePicker.php +++ b/src/Fields/Classes/DatePicker.php @@ -39,6 +39,7 @@ public static function getOptions(?array $sections = null, ?array $field = null) ->schema([ self::required(), self::columnSpanFull(), + self::hiddenLabel(), self::htmlID(), ]), self::hintOptions(), @@ -60,6 +61,7 @@ public static function getOptionsHidden(): array self::hiddenHintOptions(), self::hiddenRequired(), self::hiddenColumnSpanFull(), + self::hiddenHiddenLabel(), self::hiddenVisibility(), ]; } diff --git a/src/Fields/Classes/DateTimePicker.php b/src/Fields/Classes/DateTimePicker.php index b103cd80..4308d0f3 100644 --- a/src/Fields/Classes/DateTimePicker.php +++ b/src/Fields/Classes/DateTimePicker.php @@ -39,6 +39,7 @@ public static function getOptions(?array $sections = null, ?array $field = null) ->schema([ self::required(), self::columnSpanFull(), + self::hiddenLabel(), self::htmlID(), ]), self::hintOptions(), @@ -60,6 +61,7 @@ public static function getOptionsHidden(): array self::hiddenHintOptions(), self::hiddenRequired(), self::hiddenColumnSpanFull(), + self::hiddenHiddenLabel(), self::hiddenVisibility(), ]; } diff --git a/src/Fields/Classes/FileUpload.php b/src/Fields/Classes/FileUpload.php index 42123b41..3dd61f45 100644 --- a/src/Fields/Classes/FileUpload.php +++ b/src/Fields/Classes/FileUpload.php @@ -44,6 +44,7 @@ public static function getOptions(?array $sections = null): array \Filament\Forms\Components\Toggle::make('options.allow_multiple')->label(__('Allow Multiple')), self::required(), self::columnSpanFull(), + self::hiddenLabel(), self::htmlID(), ]), self::hintOptions(), @@ -61,6 +62,7 @@ public static function getOptionsHidden(): array self::hiddenHintOptions(), self::hiddenRequired(), self::hiddenColumnSpanFull(), + self::hiddenHiddenLabel(), self::hiddenVisibility(), Hidden::make('options.allow_multiple')->default(false), ]; diff --git a/src/Fields/Classes/Paragraph.php b/src/Fields/Classes/Paragraph.php index 48ea1bc4..39354998 100644 --- a/src/Fields/Classes/Paragraph.php +++ b/src/Fields/Classes/Paragraph.php @@ -39,6 +39,7 @@ public static function getOptions(?array $sections = null, ?array $field = null) ->icon('iconpark-checklist-o') ->schema([ self::columnSpanFull(), + self::hiddenLabel(), self::hintOptions(), ]), self::visibility($sections), @@ -51,6 +52,7 @@ public static function getOptionsHidden(): array return [ self::hiddenHintOptions(), self::hiddenColumnSpanFull(), + self::hiddenHiddenLabel(), self::hiddenVisibility(), ]; } diff --git a/src/Fields/Classes/Radio.php b/src/Fields/Classes/Radio.php index ca01f974..30d19e63 100644 --- a/src/Fields/Classes/Radio.php +++ b/src/Fields/Classes/Radio.php @@ -45,6 +45,7 @@ public static function getOptions(?array $sections = null, ?array $field = null) self::required(), Toggle::make('options.is_inline')->label(__('Is inline')), self::columnSpanFull(), + self::hiddenLabel(), self::htmlID(), ]), self::hintOptions(), @@ -67,6 +68,7 @@ public static function getOptionsHidden(): array self::hiddenHintOptions(), self::hiddenRequired(), self::hiddenColumnSpanFull(), + self::hiddenHiddenLabel(), Hidden::make('options.dataSource'), Hidden::make('options.is_inline')->default(false), ]; diff --git a/src/Fields/Classes/RichEditor.php b/src/Fields/Classes/RichEditor.php index a9b5627d..a179d589 100644 --- a/src/Fields/Classes/RichEditor.php +++ b/src/Fields/Classes/RichEditor.php @@ -39,6 +39,7 @@ public static function getOptions(?array $sections = null, ?array $field = null) ->schema([ self::required(), self::columnSpanFull(), + self::hiddenLabel(), self::htmlID(), ]), self::hintOptions(), @@ -61,6 +62,7 @@ public static function getOptionsHidden(): array self::hiddenHintOptions(), self::hiddenRequired(), self::hiddenColumnSpanFull(), + self::hiddenHiddenLabel(), ]; } } diff --git a/src/Fields/Classes/Select.php b/src/Fields/Classes/Select.php index f50d458f..1f13060e 100644 --- a/src/Fields/Classes/Select.php +++ b/src/Fields/Classes/Select.php @@ -47,6 +47,7 @@ public static function getOptions(?array $sections = null, ?array $field = null) ->schema([ self::required(), self::columnSpanFull(), + self::hiddenLabel(), self::htmlID(), ]), self::hintOptions(), @@ -69,6 +70,7 @@ public static function getOptionsHidden(): array self::hiddenHintOptions(), self::hiddenRequired(), self::hiddenColumnSpanFull(), + self::hiddenHiddenLabel(), Hidden::make('options.dataSource'), Hidden::make('options.allow_multiple')->default(false), ]; diff --git a/src/Fields/Classes/TextInput.php b/src/Fields/Classes/TextInput.php index 1c983829..0d90f2d8 100644 --- a/src/Fields/Classes/TextInput.php +++ b/src/Fields/Classes/TextInput.php @@ -110,6 +110,7 @@ public static function getOptions(?array $sections = null, ?array $field = null) ->label(__('Suffix Icon Color')), self::columnSpanFull(), + self::hiddenLabel(), self::htmlID(), ]), self::hintOptions(), @@ -132,6 +133,7 @@ public static function getOptionsHidden(): array self::hiddenHintOptions(), self::hiddenRequired(), self::hiddenColumnSpanFull(), + self::hiddenHiddenLabel(), Hidden::make('options.dateType'), diff --git a/src/Fields/Classes/Textarea.php b/src/Fields/Classes/Textarea.php index b50b4a8e..eef9a279 100644 --- a/src/Fields/Classes/Textarea.php +++ b/src/Fields/Classes/Textarea.php @@ -61,6 +61,7 @@ public static function getOptions(?array $sections = null, ?array $field = null) self::required(), self::columnSpanFull(), + self::hiddenLabel(), self::htmlID(), ]), self::hintOptions(), @@ -83,6 +84,7 @@ public static function getOptionsHidden(): array self::hiddenHintOptions(), self::hiddenRequired(), self::hiddenColumnSpanFull(), + self::hiddenHiddenLabel(), Hidden::make('options.rows'), Hidden::make('options.cols'), Hidden::make('options.minLength'), diff --git a/src/Fields/Classes/TimePicker.php b/src/Fields/Classes/TimePicker.php index d2cba443..31d606be 100644 --- a/src/Fields/Classes/TimePicker.php +++ b/src/Fields/Classes/TimePicker.php @@ -39,6 +39,7 @@ public static function getOptions(?array $sections = null, ?array $field = null) ->schema([ self::required(), self::columnSpanFull(), + self::hiddenLabel(), self::htmlID(), ]), self::hintOptions(), @@ -61,6 +62,7 @@ public static function getOptionsHidden(): array self::hiddenHintOptions(), self::hiddenRequired(), self::hiddenColumnSpanFull(), + self::hiddenHiddenLabel(), ]; } } diff --git a/src/Fields/Classes/Toggle.php b/src/Fields/Classes/Toggle.php index 8926d771..eebefae9 100644 --- a/src/Fields/Classes/Toggle.php +++ b/src/Fields/Classes/Toggle.php @@ -75,6 +75,7 @@ public static function getOptions(?array $sections = null, ?array $field = null) ]), self::required(), self::columnSpanFull(), + self::hiddenLabel(), self::htmlID(), ]), self::hintOptions(), @@ -97,6 +98,7 @@ public static function getOptionsHidden(): array self::hiddenHintOptions(), self::hiddenRequired(), self::hiddenColumnSpanFull(), + self::hiddenHiddenLabel(), Hidden::make('options.on-icon'), Hidden::make('options.off-icon'), Hidden::make('options.on-color'), diff --git a/src/Fields/FieldsContract.php b/src/Fields/FieldsContract.php index bead686e..79ae3369 100644 --- a/src/Fields/FieldsContract.php +++ b/src/Fields/FieldsContract.php @@ -112,6 +112,10 @@ public function appendFilamentComponentsOptions($component, $zeusField, bool $ha $component = $component->columnSpanFull(); } + if (optional($zeusField->options)['hidden_label']) { + $component = $component->hiddenLabel(); + } + if (optional($zeusField->options)['hint']) { if (optional($zeusField->options)['hint']['text']) { $component = $component->hint($zeusField->options['hint']['text']); diff --git a/stubs/ZeusField.stub b/stubs/ZeusField.stub index e10d1b92..693a4390 100644 --- a/stubs/ZeusField.stub +++ b/stubs/ZeusField.stub @@ -22,6 +22,7 @@ class {{ class }} extends FieldsContract self::htmlID(), self::required(), self::columnSpanFull(), + self::hiddenLabel(), ]; } @@ -31,6 +32,7 @@ class {{ class }} extends FieldsContract self::hiddenHtmlID(), self::hiddenRequired(), self::hiddenColumnSpanFull(), + self::hiddenHiddenLabel(), ]; } }