DVUI

childOption

If this FieldOption supports child options, return the child options, otherwise return self.

Parameters

#
self:FieldOptions
FieldOptions

Source

Implementation

#
pub fn childOption(self: FieldOptions) FieldOptions {
        switch (self) {
            inline else => |fo| {
                if (@hasField(@TypeOf(fo), "child")) {
                    return fo.child.asFieldOption() orelse .{ .standard = .{
                        .display = fo.display,
                        .label = fo.label,
                        .customDisplayFn = fo.customDisplayFn,
                    } };
                }
                return self;
            },
        }
    }