Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material UI #299

Merged
merged 33 commits into from
Oct 16, 2020
Merged

Material UI #299

merged 33 commits into from
Oct 16, 2020

Conversation

ukrbublik
Copy link
Owner

@ukrbublik ukrbublik commented Oct 7, 2020

  • MaterialTextWidget

  • MaterialDateWidget

  • MaterialDateTimeWidget

  • MaterialTimeWidget

  • MaterialSelectWidget

  • MaterialNumberWidget

  • MaterialSliderWidget

  • MaterialRangeWidget

  • MaterialBooleanWidget

  • MaterialMultiSelectWidget

  • MaterialFieldSelect

  • MaterialButton

  • MaterialButtonGroup

  • MaterialConjs

  • MaterialValueSources

  • MaterialConfirm

  • MaterialProvider


  • Number Between: "Warning: value prop on input should not be null. Consider using an empty string to clear the component or undefined for uncontrolled components."
  • Fix vertical position of "from"/"to" labels in Number Between
  • Warning of nullish 2nd value source for Number Between: "Material-UI: You have provided an out-of-range value null for the select component. The available values are value, field, func."
  • Try with showLabels: true
  • ? MaterialFieldSelect - use renderValue as in MaterialSelect, instead of first item "Select field.." in field list
  • TS def
  • Update docs, readme (don't forget to mention al needed MUI packages), bump version

@ukrbublik ukrbublik changed the title Material UI [wip] Material UI Oct 7, 2020
@ukrbublik

This comment has been minimized.

@megantaylor
Copy link
Contributor

so excited for this!

@ukrbublik ukrbublik linked an issue Oct 9, 2020 that may be closed by this pull request
examples/demo/init_value.js Outdated Show resolved Hide resolved
@megantaylor
Copy link
Contributor

hey, my team is really excited for this feature and i was wondering if you'd like some help finishing it?

@ukrbublik
Copy link
Owner Author

Yeah, go for it )
If you want to work in parallel with me, take some widgets and write that list

megantaylor and others added 8 commits October 9, 2020 19:55
time - show/hide seconds according to timeFormat
boolean - use grid for 2 labels
select - use renderValue intead of empty value
multiselect - new
all - don't show placeholer in r/o mode
all - use customProps
lint fix
@megantaylor
Copy link
Contributor

any thoughts on using https://github.com/jonatanklosko/material-ui-confirm for the Material Confirm widget instead of DIY?

@ukrbublik
Copy link
Owner Author

any thoughts on using https://github.com/jonatanklosko/material-ui-confirm for the Material Confirm widget instead of DIY?

I think we can use it. If you want to submit PR, welcome :)

megantaylor and others added 2 commits October 14, 2020 23:40
* partial material-ui slider widget

* finish working on material-ui slider widget

* use Number() instead of parse*

* customSliderProps

* slider

* range

* fix uncontrolled

Co-authored-by: Denis Oblogin <ukrbublik@gmail.com>
@megantaylor
Copy link
Contributor

i spent some time trying to get the material ui confirm thing to work, and just couldnt figure out how to make renderConfirm render a component because right now its just a click handler. any thoughts?

examples/demo/config.tsx Outdated Show resolved Hide resolved
examples/demo/config.tsx Outdated Show resolved Hide resolved
@megantaylor
Copy link
Contributor

megantaylor commented Oct 14, 2020

  • Fix vertical position of "from"/"to" labels in Date Between

@megantaylor
Copy link
Contributor

Fix vertical position of "from"/"to" labels in Date Between

can i just flexbox the container? not sure how else to get the vertical alignment to work, unless there's a way to target the widget sep class only for mui?

@ukrbublik
Copy link
Owner Author

ukrbublik commented Oct 15, 2020

If it just works and not breaks other skins (antd), yes.

If you need to distinguish skin in CSS, you can render root div wrapper with appropriate class like "mui" here I guess: https://github.com/ukrbublik/react-awesome-query-builder/pull/299/files#diff-35a4e08d4dd32566534b002381a4c2611a87a4a447692fc4b632e0f95093dd18R41
(in Provider)
and then use rule like '.mui .widget--sep'


* use inline-flex and alignment to fix the vertical alignment of to/from labels

* fix css formatting

* fix formatting

* start on materialValueSources using popover and radio btns

* nit

* lint

Co-authored-by: Denis Oblogin <ukrbublik@gmail.com>
@ukrbublik
Copy link
Owner Author

@megantaylor Flex approach breaks styles with showLabels: true in config.
Can you please try another approach with MUI-only class?

@megantaylor
Copy link
Contributor

@megantaylor Flex approach breaks styles with showLabels: true in config.
Can you please try another approach with MUI-only class?

yup, i can do that today

@megantaylor
Copy link
Contributor

pushed css solution for from/to labels and value src button alignment for number/date + slider/range

megantaylor and others added 2 commits October 16, 2020 02:36
* better alignment styling for mui widget sep and widget value src
* ...

Co-authored-by: Denis Oblogin <ukrbublik@gmail.com>
@ukrbublik
Copy link
Owner Author

Changed styles a bit. I think now looks good

@megantaylor
Copy link
Contributor

anything else i can help with?

@ukrbublik
Copy link
Owner Author

ukrbublik commented Oct 16, 2020

3 checks left (1st is optional). If you want to finish, I'd appreciate

@megantaylor
Copy link
Contributor

3 checks left (1st is optional). If you want to finish, I'd appreciate

those 3 tasks are unclear to me, can you be more specific about what needs to be done?

@ukrbublik
Copy link
Owner Author

ukrbublik commented Oct 16, 2020

As for 1st one, compare value select for field "Color" and field select for new rule.
They render placeholder in different ways.
For field select there is first disabled item "Select field" which renders in items list, which is not very nice.

In this commit
for MaterialSelect I removed placeholder item

{!hasValue && <MenuItem disabled value={""}>{placeholder}</MenuItem>}

and used renderValue instead

  const renderValue = (selectedValue) => {
      if (!readonly && !selectedValue)
        return placeholder;
      return mapListValues(listValues, ({title, value}) => (value === selectedValue ? title : null)).filter(v => v !== null).shift();
    };

So now placeholder will not be rendered as first disabled item "Select value".

I would like to use such approach in MaterialFieldSelect

In renderValue you need to convert selectedValue (which is path of selected field) to field's label.

I'll do rest 2 tasks and going to publish MUI support

@ukrbublik ukrbublik changed the title [wip] Material UI Material UI Oct 16, 2020
@ukrbublik
Copy link
Owner Author

@megantaylor Thanks for the help.
I think I can release this PR.
Updated readme and config docs
Wdyt?

@megantaylor
Copy link
Contributor

do iiiiiit!!!!!

@ukrbublik ukrbublik merged commit bf4eaa4 into master Oct 16, 2020
@siamak-haschemi
Copy link

Fantastic guys! We will try that on our UI. I yesterday removed antd because of the huge bundle size. As we anyway use material-ui for the rest of our UI, this is great news! Thank you very much for your efforts!

@ukrbublik ukrbublik deleted the material-ui branch June 13, 2021 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When you are planning to release Material UI framework support?
3 participants