profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/TalAmuyal/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

onivim/oni 11458

Oni: Modern Modal Editing - powered by Neovim

onivim/oni-api 6

Oni's extensibility model API

bkashi/FVM-Solvers 0

Finite volume method solvers on a uniform Cartesian grid.

TalAmuyal/aiodocker 0

Python Docker API client based on asyncio and aiohttp

TalAmuyal/black 0

The uncompromising Python code formatter

TalAmuyal/grpc-docker-lb 0

GRPC Automatic server-side load balancing

TalAmuyal/justpy 0

An object oriented high-level Python Web Framework that requires no frontend programming

issue commentelimintz/justpy

Highcharts zoom events

Will take a look at it, but can't promise to do so. I am already quite late with the new version. Need to find time to test it and publish.

platinops

comment created time in 4 days

issue openedelimintz/justpy

Highcharts zoom events

Would you mind adding Highcharts zoom events to the next update?

I did an attempt myself - feel free to improve it obviously :)

In chartjp.js (maybe this can be written in a more generic way, where both x and y events are caught by the same handler):

update_dict.xAxis = {
    events: {}
};
update_dict.yAxis = {
    events: {}
};
if (this.$props.jp_props.events.indexOf('zoom_x') >= 0) {
    update_dict.xAxis.events.setExtremes = function (e) {
        var p = {
            event_type: 'zoom_x',
            id: id,
            type: e.type,
            min: e.min,
            max: e.max,
            page_id: page_id,
            websocket_id: websocket_id
        };
        send_to_server(p, 'event');
    }
}
if (this.$props.jp_props.events.indexOf('zoom_y') >= 0) {
    update_dict.yAxis.events.setExtremes = function (e) {
        var p = {
            event_type: 'zoom_y',
            id: id,
            type: e.type,
            min: e.min,
            max: e.max,
            page_id: page_id,
            websocket_id: websocket_id
        };
        send_to_server(p, 'event');
    }
}

In chartcomponents.py:

self.allowed_events = ['tooltip', 'point_click', 'point_select', 'point_unselect', 'series_hide',
                               'series_show', 'series_click', 'zoom_x', 'zoom_y']

A working example after these modifications

import justpy as jp

def chart_event_test(request):
    wp = jp.WebPage()
    chart = jp.HighCharts(a=wp)
    o = chart.options
    o.chart.type = 'line'
    o.chart.zoomType = 'xy'
    o.xAxis.data = [1, 2, 3]
    o.plotOptions.series.allowPointSelect = True
    o.plotOptions.series.cursor = 'pointer'
    o.series = [
        { 'name': 'Jane', 'data': [1, 0, 4] }, 
        { 'name': 'John', 'data': [5, 7, 3] }
    ]
    def point_select(cmp, msg):
        print(msg)
    def zoom(cmp, msg):
        print(msg)
    chart.on('point_select', point_select)
    chart.on('zoom_x', zoom)
    chart.on('zoom_y', zoom)
    return wp

jp.justpy(chart_event_test)

created time in 4 days

push eventdarrenburns/pytest-clarity

Darren Burns

commit sha 533056491c6b4e18cce54286cdb3a692a0392780

Update README.rst

view details

push time in 5 days

issue commentelimintz/justpy

issues with current version of tailwind code in "/templates/local/tailwind" -- how to update those

Thank you. Will also look into if can could replace the base.css and related files for the latest version.

sandeep-gh

comment created time in 5 days

issue closedelimintz/justpy

issues with current version of tailwind code in "/templates/local/tailwind" -- how to update those

There is a bug in tailwind current version code integrated with justpy. The code below should create a div area of half the size of the screen but ends up not creating no div element:

def split_screen():
  full_div = jp.Div(
        a=wp, classes="w-screen h-screen bg-pink-100")

    tt = jp.Div(a=full_div, classes="w-1/2 h-1/2 bg-gray-400")
    jp.P(a=tt, text="area1")
    return wp

However, if I force to use latest tailwind version

wp.head_html = '<link href="https://unpkg.com/tailwindcss/dist/tailwind.min.css" rel="stylesheet">'

the above code works as expected. Also, where can I grab base.css, components.css and other tailwind codes for justpy.

Thanks.

closed time in 5 days

sandeep-gh

issue commentelimintz/justpy

issues with current version of tailwind code in "/templates/local/tailwind" -- how to update those

The current version of JustPy loads the version 1 of Tailwind. The solution is to do what you have done. tailwind.min.css includes all three files so you don't need to load them seperately.

sandeep-gh

comment created time in 5 days

push eventpypa/pipfile

Dustin Ingram

commit sha 9f13be142fe4070318175f912bc21ad84e364cda

Update README.rst

view details

push time in 5 days

issue openedelimintz/justpy

issues with current version of tailwind code in "/templates/local/tailwind" -- how to update those

There is a bug in tailwind current version code integrated with justpy. The code below should create a div area of half the size of the screen but ends up not creating no div element:

def split_screen():
  full_div = jp.Div(
        a=wp, classes="w-screen h-screen bg-pink-100")

    tt = jp.Div(a=full_div, classes="w-1/2 h-1/2 bg-gray-400")
    jp.P(a=tt, text="area1")
    return wp

However, if I force to use latest tailwind version

wp.head_html = '<link href="https://unpkg.com/tailwindcss/dist/tailwind.min.css" rel="stylesheet">'

the above code works as expected. Also, where can I grab base.css, components.css and other tailwind codes for justpy.

Thanks.

created time in 7 days

issue closeddarrenburns/pytest-clarity

Python 3.8 incompatibility: DeprecationWarning: collections.abc

Python 3.7 is showing the following

/usr/lib/python3.7/site-packages/pytest_clarity/hints.py:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Sequence

I guess that means it is broken on py38

closed time in 8 days

jayvdb

issue closeddarrenburns/pytest-clarity

Assertions with `NaN` print as `?`

Assertions where one side of the comparison is a float("nan") render as a ? with pytest-clarity.

closed time in 8 days

lsorber

issue closeddarrenburns/pytest-clarity

six should be a listed requirements in setup.py install_requires

Using pytest-clarity 0.3.0a0 with python 3.6 leads to the following error

File ".tox/py3/lib/python3.6/site-packages/pytest_clarity/util.py", line 3, in <module>
    import six
ModuleNotFoundError: No module named 'six'

closed time in 8 days

jbernardes

issue closeddarrenburns/pytest-clarity

pprintpp might be better for complex/nested cases

https://github.com/wolever/pprintpp#why-is-it-prettier

closed time in 8 days

dz0

push eventdarrenburns/pytest-clarity

Darren Burns

commit sha 8c01481b9c2ca6e63987246d8d67ce136cbafd2f

Update README.rst

view details

push time in 8 days

delete branch darrenburns/pytest-clarity

delete branch : dependabot/pip/py-1.10.0

delete time in 8 days

PR closed darrenburns/pytest-clarity

Bump py from 1.7.0 to 1.10.0 dependencies

Bumps py from 1.7.0 to 1.10.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pytest-dev/py/blob/master/CHANGELOG.rst">py's changelog</a>.</em></p> <blockquote> <h1>1.10.0 (2020-12-12)</h1> <ul> <li>Fix a regular expression DoS vulnerability in the py.path.svnwc SVN blame functionality (CVE-2020-29651)</li> <li>Update vendored apipkg: 1.4 => 1.5</li> <li>Update vendored iniconfig: 1.0.0 => 1.1.1</li> </ul> <h1>1.9.0 (2020-06-24)</h1> <ul> <li> <p>Add type annotation stubs for the following modules:</p> <ul> <li><code>py.error</code></li> <li><code>py.iniconfig</code></li> <li><code>py.path</code> (not including SVN paths)</li> <li><code>py.io</code></li> <li><code>py.xml</code></li> </ul> <p>There are no plans to type other modules at this time.</p> <p>The type annotations are provided in external .pyi files, not inline in the code, and may therefore contain small errors or omissions. If you use <code>py</code> in conjunction with a type checker, and encounter any type errors you believe should be accepted, please report it in an issue.</p> </li> </ul> <h1>1.8.2 (2020-06-15)</h1> <ul> <li>On Windows, <code>py.path.local</code>s which differ only in case now have the same Python hash value. Previously, such paths were considered equal but had different hashes, which is not allowed and breaks the assumptions made by dicts, sets and other users of hashes.</li> </ul> <h1>1.8.1 (2019-12-27)</h1> <ul> <li> <p>Handle <code>FileNotFoundError</code> when trying to import pathlib in <code>path.common</code> on Python 3.4 (<a href="https://github-redirect.dependabot.com/pytest-dev/py/issues/207">#207</a>).</p> </li> <li> <p><code>py.path.local.samefile</code> now works correctly in Python 3 on Windows when dealing with symlinks.</p> </li> </ul> <h1>1.8.0 (2019-02-21)</h1> <ul> <li> <p>add <code>"importlib"</code> pyimport mode for python3.5+, allowing unimportable test suites to contain identically named modules.</p> </li> <li> <p>fix <code>LocalPath.as_cwd()</code> not calling <code>os.chdir()</code> with <code>None</code>, when being invoked from a non-existing directory.</p> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/pytest-dev/py/commit/e5ff378fc3bd3f7c366dec769a718bdb1ceca1f1"><code>e5ff378</code></a> Update CHANGELOG for 1.10.0</li> <li><a href="https://github.com/pytest-dev/py/commit/94cf44fd41d957eb50773d3e4fb54e931836779e"><code>94cf44f</code></a> Update vendored libs</li> <li><a href="https://github.com/pytest-dev/py/commit/5e8ded5dea0a92656fe98383b66ebfb3cb84be03"><code>5e8ded5</code></a> testing: comment out an assert which fails on Python 3.9 for now</li> <li><a href="https://github.com/pytest-dev/py/commit/afdffcc981fd3f7cd12f24b5407f40aa01dde22a"><code>afdffcc</code></a> Rename HOWTORELEASE.rst to RELEASING.rst</li> <li><a href="https://github.com/pytest-dev/py/commit/2de53a67589d8eeaea35927357c0a05dd0329ce4"><code>2de53a6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pytest-dev/py/issues/266">#266</a> from nicoddemus/gh-actions</li> <li><a href="https://github.com/pytest-dev/py/commit/fa1b32e2912ad4ea39016cd50ec3125d204bcf65"><code>fa1b32e</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pytest-dev/py/issues/264">#264</a> from hugovk/patch-2</li> <li><a href="https://github.com/pytest-dev/py/commit/887d6b8937bd74c729c89b589ec8adaa557a78cf"><code>887d6b8</code></a> Skip test_samefile_symlink on pypy3 on Windows</li> <li><a href="https://github.com/pytest-dev/py/commit/e94e670032d8ccf42ad9d37730bd03b6da6f263b"><code>e94e670</code></a> Fix test_comments() in test_source</li> <li><a href="https://github.com/pytest-dev/py/commit/fef9a32a8578e9c467f6ef8ccc7bce81b89496a4"><code>fef9a32</code></a> Adapt test</li> <li><a href="https://github.com/pytest-dev/py/commit/4a694b00a68de2d93b547c2704da4283a375a53c"><code>4a694b0</code></a> Add GitHub Actions badge to README</li> <li>Additional commits viewable in <a href="https://github.com/pytest-dev/py/compare/1.7.0...1.10.0">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+1 -1

1 comment

1 changed file

dependabot[bot]

pr closed time in 8 days

pull request commentdarrenburns/pytest-clarity

Bump py from 1.7.0 to 1.10.0

Looks like py is no longer a dependency, so this is no longer needed.

dependabot[bot]

comment created time in 8 days

push eventdarrenburns/pytest-clarity

Darren Burns

commit sha 38437cb53334be34da4ab886572135e2f9a7f21b

Small README fix

view details

push time in 8 days

push eventdarrenburns/pytest-clarity

Darren Burns

commit sha 1f2b52e67842a94839d72e55e6c8c7cf7e26d6b9

Rewrite using Ward diff

view details

push time in 8 days

CommitCommentEvent

issue commentelimintz/justpy

ag-grid custom context menu giving "WARNING justpy: No page to load message"

Thank you very much for the example!

rroyer-xyz

comment created time in 10 days

issue closedelimintz/justpy

ag-grid custom context menu giving "WARNING justpy: No page to load message"

I'm trying to implement a custom context menu in ag-grid, explained here

Below is my code. I'm getting a "WARNING justpy: No page to load" message with nothing returned in the result_ready function. Am I using the send_to_server function correctly?

import justpy as jp

grid_options = {
    'defaultColDef': {
        'filter': True,
    }, 
      'columnDefs': [
      {'headerName': "Make", 'field': "make"},
      {'headerName': "Model", 'field': "model"},
      {'headerName': "Price", 'field': "price"}
    ],
      'rowData': [
      {'make': "Toyota", 'model': "Celica", 'price': 35000},
      {'make': "Ford", 'model': "Mondeo", 'price': 32000},
      {'make': "Porsche", 'model': "Boxter", 'price': 72000}
    ],
      'getContextMenuItems': '''function getContextMenuItems(params) {
              var result = [
                {
                  // custom item
                  name: 'Testing: ' + params.value,
                  action: function () {
                    //window.alert('Alerting about ' + params.value);
                    var e = {};
                    e.result = {test: params.value};
                    send_to_server(e, 'page_event', true);
                  },
                },                
              ];
              return result;
            }'''
}

async def result_ready(self, msg): 
    print(msg)
    
def grid_test():
    wp = jp.WebPage()
    wp.on('result_ready', result_ready) 
    grid = jp.AgGrid(a=wp, options=grid_options)
    grid.evaluate = ['getContextMenuItems'] 
    return wp

jp.justpy(grid_test)

closed time in 10 days

rroyer-xyz

issue commentelimintz/justpy

ag-grid custom context menu giving "WARNING justpy: No page to load message"

Thanks, this worked great. Below is a working an example that has a custom context menu for creating, copying, and deleting rows in the grid

import justpy as jp

grid_options = {
    'columnDefs': [
      {'headerName': "Make", 'field': "make"},
      {'headerName': "Model", 'field': "model"},
      {'headerName': "Price", 'field': "price"}
    ],
    'rowData': [
      {'row_id': 0, 'make': "Toyota", 'model': "Celica", 'price': 35000},
      {'row_id': 1, 'make': "Ford", 'model': "Mondeo", 'price': 32000},
      {'row_id': 2, 'make': "Porsche", 'model': "Boxter", 'price': 72000}
    ],
    'getRowNodeId': '''function (data) {
          return data.row_id;
      }''',    
    'getContextMenuItems': '''function getContextMenuItems(params) {
          var e = {page_id: page_id, websocket_id: websocket_id, event_type: 'result_ready'};
          var result = [
            {
              // menu item 1
              name: 'New Row',
              subMenu: [
                  {
                    name: 'Chevy',
                    action: function () {
                        e.result = {menu_action: "new", make: "Chevy"};
                        send_to_server(e, 'page_event', false);
                    }
                  },
                  {
                    name: 'Honda',
                    action: function () {
                        e.result = {menu_action: "new", make: "Honda"};
                        send_to_server(e, 'page_event', false);
                    }
                  },                  
                ]
            },
            {
              // menu item 2
              name: 'Copy Row',
              action: function () {   
                if (params.node) {   
                  e.result = {menu_action: "copy", row_data: params.node.data};
                  send_to_server(e, 'page_event', false);
                }
              },
            },   
            {
              // menu item 3
              name: 'Delete Row',
              action: function () {
                if (params.node) {       
                  e.result = {menu_action: "delete", row_data: params.node.data};
                  send_to_server(e, 'page_event', false);
                }
              },
            },                   

          ];
          return result;
        }'''
}

async def result_ready(self, msg): 
    wp = msg.page

    if msg.result['menu_action'] == 'new':
      row_data = {'row_id': wp.next_row_id}   
      row_data['make'] = msg.result['make']
      row_data['model'] = f'test {wp.next_row_id}'
      row_data['price'] = wp.next_row_id * 98765   
      wp.next_row_id += 1 
      await wp.run_javascript(f"""cached_grid_def['g' + {wp.grid.id}].api.applyTransaction({{  add: [{row_data}] }})""")       

    elif msg.result['menu_action'] == 'copy':
      row_data = msg.result['row_data'] 
      row_data['row_id'] = wp.next_row_id
      wp.next_row_id += 1
      await wp.run_javascript(f"""cached_grid_def['g' + {wp.grid.id}].api.applyTransaction({{  add: [{row_data}] }})""") 
    
    elif msg.result['menu_action'] == 'delete':
      row_data = msg.result['row_data'] 
      await wp.run_javascript(f"""cached_grid_def['g' + {wp.grid.id}].api.applyTransaction({{  remove: [{row_data}] }})""") 

def grid_test():
    wp = jp.WebPage()
    wp.on('result_ready', result_ready) 
    wp.grid = jp.AgGrid(a=wp, options=grid_options)
    wp.next_row_id = len(grid_options['rowData'])
    wp.grid.evaluate = ['getContextMenuItems', 'getRowNodeId'] 
    return wp

jp.justpy(grid_test)
rroyer-xyz

comment created time in 10 days

issue commentelimintz/justpy

Update embedded Tailwind?

I'm not making promises any more... :) I have some time this month and hope to get it done.

lcosmin

comment created time in 10 days

issue commentelimintz/justpy

Update embedded Tailwind?

Any progress on a new release with a more up to date version of Tailwind? It would be great o have the support for CSS filters that was added in Tailwind 2.1 as part of the standard package, so that it can work for standalone installs.

lcosmin

comment created time in 11 days

issue closedelimintz/justpy

Add Quasar Field component

If I'm not mistaken, the Quasar Field component is not yet implemented in the current justpy version:

class QField(jp.QDiv):

    html_tag = 'q-field'
    slots = ['default_slot', 'before_slot', 'prepend_slot', 'append_slot', 'after_slot', 
             'label_slot', 'error_slot', 'hint_slot', 'counter_slot', 'loading_slot']

    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.prop_list = ['error', 'rules', 'reactive-rules', 'lazy-rules', 'autofocus', 'name',
                          'error-message', 'no-error-icon', 'label', 'stack-label', 'hint', 'hide-hint', 
                          'prefix', 'suffix', 'loading', 'clearable', 'clear-icon', 'label-slot', 'bottom-slots', 
                          'counter', 'maxlength', 'disable', 'readonly',
                          'label-color', 'color', 'bg-color', 'dark', 'filled', 'outlined', 'borderless',
                          'standout',  'hide-bottom-space', 'rounded',  'square', 'dense', 'item-aligned',
                          'value']

        self.allowed_events = ['clear', 'input', 'focus', 'blur']

Could this be added in the next version?

closed time in 11 days

platinops

issue commentelimintz/justpy

Add Quasar Field component

Thank, you. I added your code to the project and it will part of the next version.

platinops

comment created time in 11 days

issue commentelimintz/justpy

ag-grid custom context menu giving "WARNING justpy: No page to load message"

Thank you for this! You need to add additional information to e for this to work. Initialize e the following way: var e = {page_id: page_id, websocket_id: websocket_id, event_type: 'result_ready'}; Otherwise, the back end does not know with which page and websocket to associate the event. Below I also included the full example modified. I would like to add this to the docs and would appreciate it if you could post a small working example with the context menu doing some work when you have time.

import justpy as jp

grid_options = {
    'defaultColDef': {
        'filter': True,
    },
    'columnDefs': [
        {'headerName': "Make", 'field': "make"},
        {'headerName': "Model", 'field': "model"},
        {'headerName': "Price", 'field': "price"}
    ],
    'rowData': [
        {'make': "Toyota", 'model': "Celica", 'price': 35000},
        {'make': "Ford", 'model': "Mondeo", 'price': 32000},
        {'make': "Porsche", 'model': "Boxter", 'price': 72000}
    ],
    'getContextMenuItems': '''function getContextMenuItems(params) {
              console.log('hello there');
              console.log(page_id);
              if (!websocket_ready && use_websockets) return;
              var result = [
                {
                  // custom item
                  name: 'Testing: ' + params.value,
                  action: function () {
                    //window.alert('Alerting about ' + params.value);
                    var e = {page_id: page_id, websocket_id: websocket_id, event_type: 'result_ready'};
                    e.result = {test: params.value};
                    send_to_server(e, 'page_event', true);
                  },
                },                
              ];
              return result;
            }'''
}


async def result_ready(self, msg):
    print('In result ready')
    print(msg)


def grid_test():
    wp = jp.WebPage()
    jp.Button(text='click', click='print(msg)', a=wp)
    wp.on('result_ready', result_ready)
    grid = jp.AgGrid(a=wp, options=grid_options)
    grid.evaluate = ['getContextMenuItems']
    return wp


jp.justpy(grid_test)


rroyer-xyz

comment created time in 11 days

issue openedelimintz/justpy

ag-grid custom context menu giving "WARNING justpy: No page to load message"

I'm trying to implement a custom context menu in ag-grid, explained here

Below is my code. I'm getting a "WARNING justpy: No page to load" message with nothing returned in the result_ready function. Am I using the send_to_server function correctly?

import justpy as jp

grid_options = {
    'defaultColDef': {
        'filter': True,
    }, 
      'columnDefs': [
      {'headerName': "Make", 'field': "make"},
      {'headerName': "Model", 'field': "model"},
      {'headerName': "Price", 'field': "price"}
    ],
      'rowData': [
      {'make': "Toyota", 'model': "Celica", 'price': 35000},
      {'make': "Ford", 'model': "Mondeo", 'price': 32000},
      {'make': "Porsche", 'model': "Boxter", 'price': 72000}
    ],
      'getContextMenuItems': '''function getContextMenuItems(params) {
              var result = [
                {
                  // custom item
                  name: 'Testing: ' + params.value,
                  action: function () {
                    //window.alert('Alerting about ' + params.value);
                    var e = {};
                    e.result = {test: params.value};
                    send_to_server(e, 'page_event', true);
                  },
                },                
              ];
              return result;
            }'''
}

async def result_ready(self, msg): 
    print(msg)
    
def grid_test():
    wp = jp.WebPage()
    wp.on('result_ready', result_ready) 
    grid = jp.AgGrid(a=wp, options=grid_options)
    grid.evaluate = ['getContextMenuItems'] 
    return wp

jp.justpy(grid_test)

created time in 12 days

issue openedelimintz/justpy

Add QField

If I'm not mistaken, the Quasar Field component is not yet implemented in the current justpy version:

class QField(jp.QDiv):

    html_tag = 'q-field'
    slots = ['default_slot', 'before_slot', 'prepend_slot', 'append_slot', 'after_slot', 
             'label_slot', 'error_slot', 'hint_slot', 'counter_slot', 'loading_slot']

    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.prop_list = ['error', 'rules', 'reactive-rules', 'lazy-rules', 'autofocus', 'name',
                          'error-message', 'no-error-icon', 'label', 'stack-label', 'hint', 'hide-hint', 
                          'prefix', 'suffix', 'loading', 'clearable', 'clear-icon', 'label-slot', 'bottom-slots', 
                          'counter', 'maxlength', 'disable', 'readonly',
                          'label-color', 'color', 'bg-color', 'dark', 'filled', 'outlined', 'borderless',
                          'standout',  'hide-bottom-space', 'rounded',  'square', 'dense', 'item-aligned',
                          'value']

        self.allowed_events = ['clear', 'input', 'focus', 'blur']

Could this be added in the next version?

created time in 13 days

issue commentelimintz/justpy

Feature request: Add Quasar File Picker

A possible way to implement a Quasar file picker:

class QField(QDiv):

    html_tag = 'q-field'
    slots = ['default_slot', 'before_slot', 'prepend_slot', 'append_slot', 'after_slot', 
             'label_slot', 'error_slot', 'hint_slot', 'counter_slot', 'loading_slot']

    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.prop_list = ['error', 'rules', 'reactive-rules', 'lazy-rules', 'autofocus', 'name',
                          'error-message', 'no-error-icon', 'label', 'stack-label', 'hint', 'hide-hint', 
                          'prefix', 'suffix', 'loading', 'clearable', 'clear-icon', 'label-slot', 'bottom-slots', 
                          'counter', 'maxlength', 'disable', 'readonly',
                          'label-color', 'color', 'bg-color', 'dark', 'filled', 'outlined', 'borderless',
                          'standout',  'hide-bottom-space', 'rounded',  'square', 'dense', 'item-aligned',
                          'value']

        self.allowed_events = ['clear', 'input', 'focus', 'blur']

class QFilePicker(QField):

    # This component only works within a jp.Form, not within jp.QForm

    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.multiple = kwargs.get('multiple', False)
        self.file_input = jp.Input(
            a=self,
            type='file',
            classes='q-field__input fit absolute-full cursor-pointer',
            style='opacity:0 !important;',
            multiple=self.multiple,
            tabindex=-1,
            change=self.file_change
        )

    def file_change(self, msg):
        # When selecting multiple files, value only contains the first file name
        self.value = msg.target.value.split('\\')[-1]

As mentioned in the comment, this currently only works within a Form due to code that is present in html_component.js, but not (yet) in quasar_components.js.

Another issue is that when selecting multiple files, only the first file is available in the jp.Input.value prop.

platinops

comment created time in 13 days