gramex icon indicating copy to clipboard operation
gramex copied to clipboard

Gramex form components should support custom scripts & stylesheets

Open sanand0 opened this issue 4 years ago • 1 comments

Let's add this kind of structure to config.json

  "requires": [
    "bootstrap@4",
    "lodash@4",
  ],
  "scripts": [
    {"type": "npm", "url": "lodash/lodash.min.js"},
    "jquery/dist/any-npm-link",
    "/absolute-url-treated-as-is",
    "https://full-url-treated-as-is"
  ],
  "stylesheets": [
    {"type": "npm", "url": "bootstrap/dist/bootstrap.min.css"},
    "bootstrap/dist/bootstrap.min.css",
    "/absolute-url-treated-as-is",
    "https://full-url-treated-as-is"
  ]
  • scripts and stylesheets are added to the component
  • requires uses a requires.json that maps each collection to a list of scripts and stylesheets that the component uses. requires.json looks like this:
{
  "bootstrap@4": {
    "scripts": [
      "jquery/dist/jquery.min.js",
      "bootstrap/dist/bootstrap.bundle.min.js"
    ],
    "stylesheets": [
      "bootstrap/dist/bootstrap.min.css"
    ]
  },
  "lodash@4": {

  }
}

sanand0 avatar Feb 09 '21 10:02 sanand0

@bkamapantula will be working on this

sanand0 avatar Feb 09 '21 12:02 sanand0