@malloydata/render 0.0.112-dev231207161601 → 0.0.112-dev231208224321

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -305,7 +305,7 @@ class HTMLTableRenderer extends container_1.ContainerRenderer {
305
305
  const drillIcon = (0, utils_1.createDrillIcon)(this.document);
306
306
  drillCell.appendChild(drillIcon);
307
307
  drillCell.style.cssText = `
308
- padding: 8px;
308
+ padding: 2px;
309
309
  vertical-align: top;
310
310
  border-bottom: 1px solid var(--malloy-border-color, #eaeaea);
311
311
  width: 25px;
@@ -196,22 +196,46 @@ function createNullElement(document) {
196
196
  exports.createNullElement = createNullElement;
197
197
  function createDrillIcon(document) {
198
198
  const drill = document.createElement('div');
199
- drill.style.borderRadius = '20px';
200
- drill.style.backgroundColor = 'var(--malloy-border-color, #efefef)';
201
- drill.style.width = '27px';
202
- drill.style.height = '14px';
203
- drill.style.display = 'flex';
204
- drill.style.justifyContent = 'center';
205
- drill.style.alignItems = 'center';
206
- drill.style.gap = '2px';
207
- for (let i = 0; i < 3; i++) {
208
- const dot = document.createElement('div');
209
- dot.style.backgroundColor = 'var(--malloy-title-color, rgb(181 181 181))';
210
- dot.style.borderRadius = '5px';
211
- dot.style.width = '4px';
212
- dot.style.height = '4px';
213
- drill.appendChild(dot);
199
+ drill.classList.add('drill-icon');
200
+ drill.innerHTML = `
201
+ <style>
202
+ .drill-icon:hover .copy-circle {
203
+ fill: #eef7f9;
214
204
  }
205
+
206
+ .drill-icon:active .copy-circle {
207
+ fill: #cfe9f0;
208
+ }
209
+
210
+ .drill-icon:hover .copy-icon,
211
+ .drill-icon:active .copy-icon {
212
+ fill: #53b2c8;
213
+ }
214
+ </style>
215
+ <svg
216
+ width="24"
217
+ height="24"
218
+ viewBox="0 0 24 24"
219
+ fill="none"
220
+ xmlns="http://www.w3.org/2000/svg"
221
+ >
222
+ <circle cx="12" cy="12" r="12" fill="none" class="copy-circle" />
223
+ <svg
224
+ x="6"
225
+ y="6"
226
+ width="12"
227
+ height="14"
228
+ viewBox="0 0 12 14"
229
+ fill="none"
230
+ xmlns="http://www.w3.org/2000/svg"
231
+ >
232
+ <path
233
+ d="M4 10.6667C3.63333 10.6667 3.31944 10.5361 3.05833 10.275C2.79722 10.0139 2.66667 9.7 2.66667 9.33333V1.33333C2.66667 0.966667 2.79722 0.652778 3.05833 0.391667C3.31944 0.130556 3.63333 0 4 0H10C10.3667 0 10.6806 0.130556 10.9417 0.391667C11.2028 0.652778 11.3333 0.966667 11.3333 1.33333V9.33333C11.3333 9.7 11.2028 10.0139 10.9417 10.275C10.6806 10.5361 10.3667 10.6667 10 10.6667H4ZM4 9.33333H10V1.33333H4V9.33333ZM1.33333 13.3333C0.966667 13.3333 0.652778 13.2028 0.391667 12.9417C0.130556 12.6806 0 12.3667 0 12V2.66667H1.33333V12H8.66667V13.3333H1.33333Z"
234
+ fill="#E7E7E7"
235
+ class="copy-icon"
236
+ />
237
+ </svg>
238
+ </svg>`;
215
239
  return drill;
216
240
  }
217
241
  exports.createDrillIcon = createDrillIcon;
@@ -12,6 +12,10 @@ function renderMalloy(options) {
12
12
  const div = document.createElement('div');
13
13
  runAndRender(options, {
14
14
  dataStyles: {},
15
+ isDrillingEnabled: true,
16
+ onDrill: (drillQuery, _target, _drillFilters) => {
17
+ navigator.clipboard.writeText(drillQuery);
18
+ },
15
19
  }).then(el => {
16
20
  if (options.classes)
17
21
  el.classList.add(options.classes);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/render",
3
- "version": "0.0.112-dev231207161601",
3
+ "version": "0.0.112-dev231208224321",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@lit/context": "^1.1.0",
27
- "@malloydata/malloy": "^0.0.112-dev231207161601",
27
+ "@malloydata/malloy": "^0.0.112-dev231208224321",
28
28
  "@types/luxon": "^2.4.0",
29
29
  "lit": "^3.0.2",
30
30
  "lodash": "^4.17.20",