Socket
Socket
Sign inDemoInstall

@ewc-lib/ewc-dialog

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ewc-lib/ewc-dialog

![Screenshot](./screenshot.png)


Version published
Maintainers
2
Created
Source

Screenshot

Screenshot

API

There are the following setters:

  • visible - true to show modally, false to hide
  • title - sets the header text
  • bodyHtml - sets the body html

And one optional attribute:

  • assetBaseURL - location to the icons which this element needs. If omitted, "./assets" is assumed. User of this element has to make sure the assets exist in the specified location (please see also webpack.config.js below).

Usage with WebPack

package.json

"dependencies": {
  "@ewc-lib/ewc-dialog": "^0.1.0"
},

webpack.config.js

const CopyPlugin = require("copy-webpack-plugin")

...

module: {
  rules: [
    {
      test: /\.css$/i,
      use: [
        'style-loader',
        'css-loader'
      ]
    }
  ]
},
plugins: [
  new CopyPlugin({
    patterns: [
      { from: "./node_modules/@ewc-lib/ewc-banner/assets/close-filled.svg", to: "./assets" }
    ],
  }),
],

index.html

<body>

  <script src="bundle.js"></script>

  <ewc-dialog></ewc-dialog>

  <script>
    document.addEventListener("DOMContentLoaded", function(event) {
      const el = document.getElementsByTagName("ewc-dialog")[0]
      el.title = "Information"
      el.bodyHtml = "<ul> <li>This</li> <li>That</li> </ul> And some more."
      el.visible = true
    })
  </script>

</body>

main.js

import "@ewc-lib/ewc-css/ewc.css"
import "@ewc-lib/ewc-dialog"

FAQs

Package last updated on 22 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc