コード例 #1
0
ファイル: JsQueryUi.py プロジェクト: ylwb/epyk-ui
    def toggleClass(self, cls_name, delay):
        """
    Toggle class(es) on elements while animating all style changes.

    Related Pages:

      https://jqueryui.com/toggleClass/

    :param cls_name:
    :param delay:

    :return:
    """
        cls_name = JsUtils.jsConvertData(cls_name, None)
        self._js.append("toggleClass(%s, %s)" % (cls_name, delay))
        return self
コード例 #2
0
ファイル: JsVis.py プロジェクト: ylwb/epyk-ui
    def setOptions(self, options):
        """
    Description:
    -----------
    Update options of Graph3d. The provided options will be merged with current options.

    Related Pages:

      https://visjs.github.io/vis-graph3d/docs/graph3d/

    Attributes:
    ----------
    :param options:
    """
        return self.fnc_closure("setOptions(%s)" %
                                JsUtils.jsConvertData(options, None))
コード例 #3
0
ファイル: JsVis.py プロジェクト: ylwb/epyk-ui
    def setData(self, data):
        """
    Description:
    -----------
    Replace the data in the Graph3d.

    Related Pages:

      https://visjs.github.io/vis-graph3d/docs/graph3d/

    Attributes:
    ----------
    :param data:
    """
        return self.fnc_closure("setData(%s)" %
                                JsUtils.jsConvertData(data, None))
コード例 #4
0
ファイル: JsQueryUi.py プロジェクト: ylwb/epyk-ui
    def animate(self, css=None, delay=None):
        """
    Animate the properties of elements between colors.

    Related Pages:

      https://jqueryui.com/animate/

    :param css:
    :param delay:

    :return:
    """
        self._js.append("animate(%s, %s)" %
                        (JsUtils.jsConvertData(css, None), delay))
        return self
コード例 #5
0
ファイル: JsBillboard.py プロジェクト: epykure/epyk-ui
    def revert(self, target: Union[str, list, primitives.JsDataModel] = None):
        """
    Description:
    -----------
    Export chart as an image.

    Related Pages:

      https://naver.github.io/billboard.js/release/latest/doc/Chart.html#export

    Attributes:
    ----------
    :param Union[str, list, primitives.JsDataModel] target: ids to be reverted.
    """
        target = JsUtils.jsConvertData(target, None)
        return JsObjects.JsVoid("%s.revert(%s)" % (self._selector, target))
コード例 #6
0
ファイル: JsNodeAttributes.py プロジェクト: epykure/epyk-ui
    def getNamedItem(self, node_name: Union[str, primitives.JsDataModel]):
        """
    Description:
    ------------
    The getNamedItem() method returns the attribute node with the specified name from a NamedNodeMap object.

    Related Pages:

      https://www.w3schools.com/jsref/met_namednodemap_getnameditem.asp

    Attributes:
    ----------
    :param Union[str, primitives.JsDataModel] node_name: The name of the node in the namedNodeMap you want to return.

    :return: A Node object, representing the attribute node with the specified name.
    """
        return "getNamedItem(%s)" % JsUtils.jsConvertData(node_name, None)
コード例 #7
0
ファイル: JsDatatable.py プロジェクト: ylwb/epyk-ui
    def destroy(self, remove=False, checkUndefined=False):
        """
    Restore the tables in the current context to its original state in the DOM by removing all of DataTables enhancements,
    alterations to the DOM structure of the table and event listeners.

    Related Pages:

      https://datatables.net/reference/api/destroy()

    :param remove: Boolean, Completely remove the table from the DOM (true) or leave it in the DOM in its original plain un-enhanced HTML state (default, false).
    :param checkUndefined: Boolean

    :return:
    """
        return self.fnc_closure("destroy(%s)" %
                                JsUtils.jsConvertData(remove, None),
                                checkUndefined=checkUndefined)
コード例 #8
0
    def getRowNode(self, row_id):
        """
    Description:
    -----------
    Returns the row node with the given ID. The row node ID is the one you provide with the callback getRowNodeId(data),
    otherwise the ID is a number auto generated by the grid when the row data is set.

    Related Pages:

      https://www.ag-grid.com/javascript-grid-api/

    Attributes:
    ----------
    :param row_id:
    """
        row_id = JsUtils.jsConvertData(row_id, None)
        return JsObjects.JsVoid("%s.api.getRowNode(%s)" % (self.varId, row_id))
コード例 #9
0
    def setRowData(self, rows):
        """
    Description:
    -----------
    Set rows.

    Related Pages:

      https://www.ag-grid.com/javascript-grid-api/

    Attributes:
    ----------
    :param rows:
    """
        return JsObjects.JsVoid(
            "%s.api.setRowData(%s)" %
            (self.varId, JsUtils.jsConvertData(rows, None)))
コード例 #10
0
    def setColumnDefs(self, col_defs: Any):
        """
    Description:
    -----------
    Call to set new column definitions. The grid will redraw all the column headers, and then redraw all of the rows.

    Related Pages:

      https://www.ag-grid.com/javascript-grid-api/

    Attributes:
    ----------
    :param col_defs:
    """
        return JsObjects.JsVoid(
            "%s.api.setColumnDefs(%s)" %
            (self.varId, JsUtils.jsConvertData(col_defs, None)))
コード例 #11
0
    def getColumnGroup(self, name):
        """
    Description:
    -----------
    Returns the column group with the given name.

    Related Pages:

      https://www.ag-grid.com/javascript-grid-column-api/

    Attributes:
    ----------
    :param name:
    """
        return JsObjects.JsVoid(
            "%s.getColumnGroup(%s)" %
            (self.varId, JsUtils.jsConvertData(name, None)))
コード例 #12
0
ファイル: JsHtmlNetwork.py プロジェクト: ylwb/epyk-ui
    def series(self, names):
        """
    Description:
    ------------

    Attributes:
    ----------
    :param names:
    """
        names = JsUtils.jsConvertData(names, None)
        return JsObjects.JsArray.JsArray.get('''
      (function(records, cols){
        var vector = []; records.forEach(function(rec){
          var row = []; cols.forEach(function(r){row.push(rec[r])}); vector.push(row)});
        return vector
      })(%s, %s)
      ''' % (self.varName, names))
コード例 #13
0
ファイル: JsD3.py プロジェクト: epykure/epyk-ui
  def append(self, html_type, set_var=True):
    """
    Description:
    -----------
    If the specified type is a string, appends a new element of this type (tag name) as the last child of each
    selected element, or before the next following sibling in the update selection if this is an enter selection.

    Related Pages:

      https://github.com/d3/d3-selection/blob/v1.4.0/README.md#selecting-elements

    Attributes:
    ----------
    :param html_type:
    :param bool set_var:
    """
    return self.fnc("append(%s)" % JsUtils.jsConvertData(html_type, None))
コード例 #14
0
ファイル: std.py プロジェクト: ylwb/epyk-ui
def querySelectorAll(selector):
    """
  Description:
  ------------
  The querySelectorAll() method returns all elements in the document that matches a specified CSS selector(s), as a static NodeList object.

  Related Pages:

      https://www.w3schools.com/jsref/met_document_queryselectorall.asp

  Attributes:
  ----------
  :param selector: String. CSS selectors
  """
    return JsDomsList("document.querySelectorAll(%s)" %
                      JsUtils.jsConvertData(selector, None),
                      isPyData=False)
コード例 #15
0
    def disable(self, flag):
        """
    Description:
    ------------
    Disable the selection component.

    Related Pages:

      https://developer.snapappointments.com/bootstrap-select/methods/

    Attributes:
    ----------
    :param flag: Boolean. A flag to specify the status of the component.
    """
        flag = JsUtils.jsConvertData(flag, None)
        return JsObjects.JsObjects.get("%s.prop('disabled', %s)" %
                                       (self.component.dom.jquery.varId, flag))
コード例 #16
0
ファイル: JsApexChart.py プロジェクト: epykure/epyk-ui
    def toggleSeries(self, series_name):
        """
    Description:
    -----------
    This method allows you to toggle the visibility of series programmatically. Useful when you have a custom legend.

    Related Pages:

      https://apexcharts.com/docs/methods/#toggleSeries

    Attributes:
    ----------
    :param series_name: String. The series name which you want to toggle visibility for.
    """
        series_name = JsUtils.jsConvertData(series_name, None)
        return JsObjects.JsVoid("%s.toggleSeries(%s)" %
                                (self.varName, series_name))
コード例 #17
0
ファイル: JsApexChart.py プロジェクト: epykure/epyk-ui
    def appendData(self, new_data):
        """
    Description:
    -----------
    This method allows you to append new data to the series array.
    If you have existing multiple series, provide the new array in the same indexed order.

    Related Pages:

      https://apexcharts.com/docs/methods/#appendData

    Attributes:
    ----------
    :param new_data: List. The data array to append the existing series datasets.
    """
        new_data = JsUtils.jsConvertData(new_data, None)
        return JsObjects.JsVoid("%s.appendData(%s)" % (self.varName, new_data))
コード例 #18
0
    def send(self, msg):
        """
    Description:
    ------------
    This will send an event called message(built in) to our client, four seconds after the client connects.
    The send function on socket object associates the 'message' event.

    Usage::

      https://www.tutorialspoint.com/socket.io/socket.io_event_handling.htm

    Attributes:
    ----------
    :param msg:
    """
        msg = JsUtils.jsConvertData(msg, None)
        return JsObjects.JsVoid("%s.send(%s)" % (self._selector, msg))
コード例 #19
0
    def custom(self, func_nam, *argv):
        """
    Description:
    ------------
    Generic function to call any missing function form a package.
    This will automatically convert the object to JavaScript and also put the right object reference.

    Attributes:
    ----------
    :param func_nam: String. The function name
    :param argv: Objects. Optional. The function arguments on the JavasScript side
    """
        js_args = []
        for arg in argv:
            js_args.append(str(JsUtils.jsConvertData(arg, None)))
        return JsObjects.JsObject.JsObject.get(
            "%s.%s(%s)" % (self.varId, func_nam, ", ".join(js_args)))
コード例 #20
0
ファイル: JsData.py プロジェクト: epykure/epyk-ui
    def update(self, attrs: Union[Datamap, dict]):
        """
    Description:
    ------------

    Attributes:
    ----------
    :param Union[Datamap, dict] attrs:
    """
        appends = []
        if isinstance(attrs, Datamap):
            for k, v in attrs._data:
                appends.append(self.append(k, v))
        else:
            for k, v in attrs.items():
                appends.append(self.append(k, JsUtils.jsConvertData(v, None)))
        return appends
コード例 #21
0
    def getColumn(self, name):
        """
    Description:
    -----------
    Returns the column with the given colKey, which can either be the colId (a string) or the colDef (an object).

    Related Pages:

      https://www.ag-grid.com/javascript-grid-column-api/

    Attributes:
    ----------
    :param name:
    """
        return JsObjects.JsVoid(
            "%s.getColumn(%s)" %
            (self.varId, JsUtils.jsConvertData(name, None)))
コード例 #22
0
ファイル: JsData.py プロジェクト: epykure/epyk-ui
    def effectAllowed(self, flag: Union[bool, primitives.JsDataModel] = False):
        """
    Description:
    -----------

    Related Pages:

      https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/effectAllowed
    """
        if flag == False:
            return JsBoolean.JsBoolean("%s.effectAllowed" % self.varId)

        if flag not in [None, 'move', 'link', 'copy']:
            raise ValueError("")

        flag = JsUtils.jsConvertData(flag, None)
        return JsFncs.JsFunction("%s.effectAllowed = %s" % (self.varId, flag))
コード例 #23
0
    def applyTransaction(self, transaction):
        """
    Description:
    -----------
    Update row data. Pass a transaction object with lists for add, remove and update.

    Related Pages:

      https://www.ag-grid.com/javascript-grid-api/

    Attributes:
    ----------
    :param transaction:
    """
        return JsObjects.JsVoid(
            "%s.api.applyTransaction(%s)" %
            (self.varId, JsUtils.jsConvertData(transaction, None)))
コード例 #24
0
ファイル: JsTabulator.py プロジェクト: ylwb/epyk-ui
    def showColumn(self, column):
        """
    Description:
    ------------
    You can show a hidden column at any point using the showColumn function. Pass the field name of the column you wish to show as the first parameter of the function.

    Related Pages:

			http://tabulator.info/docs/4.0/columns

    Attributes:
    ----------
    :param column: String. The column name to be displayed
    """
        return JsObjects.JsPromise(
            "%s.showColumn(%s)" %
            (self.varId, JsUtils.jsConvertData(column, None)))
コード例 #25
0
ファイル: JsDatatable.py プロジェクト: ylwb/epyk-ui
    def info(self, jsFlag=None):
        """
    Get / set the information summary display state.

    Related Pages:

      https://datatables.net/reference/api/select.info()

    :param jsFlag: Value to set for the information summary display state - true to enable, false to disable.
    :return:
    """
        if jsFlag is None:
            return JsObjects.JsBoolean.JsBoolean("%s.info()" % self._selector)

        return JsObjects.JsObject.JsObject(
            "%s.info(%s)" %
            (self._selector, JsUtils.jsConvertData(jsFlag, None)))
コード例 #26
0
  def tickValues(self, values):
    """
    Description:
    ------------
    Chart axis settings.

    Usage::

       chart.xAxis.tickValues(10)

    Attributes:
    ----------
    :param values:
    """
    values = JsUtils.jsConvertData(values, None)
    self._js.append("tickValues(%s)" % values)
    return self
コード例 #27
0
ファイル: JsDatatable.py プロジェクト: ylwb/epyk-ui
    def order(self, data=None):
        """

    Example


    Related Pages:

      https://datatables.net/reference/api/order()

    :return:
    """
        if data is not None:
            data = JsUtils.jsConvertData(data, None)
            return self.fnc("order(%s)" % data)

        return self.fnc("order()")
コード例 #28
0
  def donutRatio(self, value):
    """
    Description:
    ------------
    Configure how big you want the donut hole size to be.

    Related Pages:

      http://nvd3.org/examples/pie.html

    Attributes:
    ----------
    :param value:
    """
    self.donut(True)
    self.fnc("donutRatio(%s)" % JsUtils.jsConvertData(value, None))
    return self
コード例 #29
0
ファイル: JsStream.py プロジェクト: epykure/epyk-ui
  def abort(self, reason: Union[str, primitives.JsDataModel] = None):
    """
    Description:
    ------------
    The abort() method of the WritableStream interface aborts the stream, signaling that the producer can no longer
    successfully write to the stream and it is to be immediately moved to an error state, with any queued writes
    discarded.

    Related Pages:

      https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort
    """
    if reason is None:
      return JsObjects.JsPromise("%s.abort()" % self.varId)

    reason = JsUtils.jsConvertData(reason, None)
    return JsObjects.JsPromise("%s.abort(%s)" % (self.varId, reason))
コード例 #30
0
  def axisLabel(self, text: str):
    """
    Description:
    ------------
    Chart axis settings.

    Usage::

      chart.xAxis.axisLabel('Time (ms)')

    Attributes:
    ----------
    :param text: String.
    """
    text = JsUtils.jsConvertData(text, None)
    self._js.append("axisLabel(%s)" % text)
    return self