myio-js-library 0.1.519 → 0.1.520

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.
package/dist/index.cjs CHANGED
@@ -1216,7 +1216,7 @@ module.exports = __toCommonJS(index_exports);
1216
1216
  // package.json
1217
1217
  var package_default = {
1218
1218
  name: "myio-js-library",
1219
- version: "0.1.519",
1219
+ version: "0.1.520",
1220
1220
  description: "A clean, standalone JS SDK for MYIO projects",
1221
1221
  license: "MIT",
1222
1222
  repository: "github:gh-myio/myio-js-library",
@@ -17305,8 +17305,10 @@ function renderCardComponentV6({
17305
17305
  showTempRangeTooltip = false,
17306
17306
  customStyle,
17307
17307
  // V6: Per-card style overrides
17308
- enableActionSelector = false
17308
+ enableActionSelector = false,
17309
17309
  // V6: "step" — single button opens action selection modal
17310
+ actionSelectorOnCardClick = false
17311
+ // V6: card click opens the selector (suppresses the ⋮ button)
17310
17312
  }) {
17311
17313
  const {
17312
17314
  entityId,
@@ -18152,8 +18154,8 @@ function renderCardComponentV6({
18152
18154
  lastDisconnectTime
18153
18155
  }
18154
18156
  });
18157
+ const selectorOptions = [];
18155
18158
  if (enableActionSelector) {
18156
- const selectorOptions = [];
18157
18159
  if (typeof handleActionDashboard === "function") {
18158
18160
  selectorOptions.push({
18159
18161
  id: "dashboard",
@@ -18181,7 +18183,7 @@ function renderCardComponentV6({
18181
18183
  onSelect: () => handleActionSettings(entityObject, buildSettingsOpts())
18182
18184
  });
18183
18185
  }
18184
- if (selectorOptions.length > 0) {
18186
+ if (selectorOptions.length > 0 && !actionSelectorOnCardClick) {
18185
18187
  const selectorBtn = document.createElement("button");
18186
18188
  selectorBtn.className = "card-action action-selector";
18187
18189
  selectorBtn.title = "A\xE7\xF5es";
@@ -18368,7 +18370,13 @@ function renderCardComponentV6({
18368
18370
  }
18369
18371
  });
18370
18372
  }
18371
- if (typeof handleClickCard === "function") {
18373
+ if (enableActionSelector && actionSelectorOnCardClick && selectorOptions.length > 0) {
18374
+ enhancedCardElement.addEventListener("click", (e) => {
18375
+ if (!e.target.closest(".card-action") && !e.target.closest(".card-checkbox")) {
18376
+ openCardActionSelector({ title: cardEntity.name, options: selectorOptions });
18377
+ }
18378
+ });
18379
+ } else if (typeof handleClickCard === "function") {
18372
18380
  enhancedCardElement.addEventListener("click", (e) => {
18373
18381
  if (!e.target.closest(".card-action") && !e.target.closest(".card-checkbox")) {
18374
18382
  handleClickCard(entityObject);
@@ -21062,6 +21070,7 @@ var CardGridPanel = class {
21062
21070
  emptyMessage,
21063
21071
  showTempRangeTooltip,
21064
21072
  enableActionSelector,
21073
+ actionSelectorOnCardClick,
21065
21074
  enableSelection,
21066
21075
  enableDragDrop,
21067
21076
  handleSelect
@@ -21120,7 +21129,8 @@ var CardGridPanel = class {
21120
21129
  useNewComponents: true,
21121
21130
  showTempRangeTooltip: showTempRangeTooltip || false,
21122
21131
  customStyle: cardCustomStyle || void 0,
21123
- enableActionSelector: enableActionSelector || false
21132
+ enableActionSelector: enableActionSelector || false,
21133
+ actionSelectorOnCardClick: actionSelectorOnCardClick || false
21124
21134
  });
21125
21135
  }
21126
21136
  if (cardResult && cardResult[0]) {
package/dist/index.d.cts CHANGED
@@ -2650,6 +2650,12 @@ interface RenderCardV6Options {
2650
2650
  * provided are shown. Default: false (3 separate buttons).
2651
2651
  */
2652
2652
  enableActionSelector?: boolean;
2653
+ /**
2654
+ * Requires enableActionSelector. When true, the single ⋮ button is not
2655
+ * rendered and the selection modal opens on the card body click instead
2656
+ * (handleClickCard is then ignored). Default: false.
2657
+ */
2658
+ actionSelectorOnCardClick?: boolean;
2653
2659
  }
2654
2660
 
2655
2661
  interface CardResult {
@@ -3171,6 +3177,12 @@ interface CardGridPanelOptions {
3171
3177
  * are shown. Applies to cardType='device' only. Default: false.
3172
3178
  */
3173
3179
  enableActionSelector?: boolean;
3180
+ /**
3181
+ * Requires enableActionSelector. When true, device cards render no action
3182
+ * button at all — the selection modal opens on the card body click instead
3183
+ * (handleClickCard is then ignored). Default: false.
3184
+ */
3185
+ actionSelectorOnCardClick?: boolean;
3174
3186
  /** Callback for ambiente card remote toggle (only for cardType='ambiente') */
3175
3187
  handleToggleRemote?: (isOn: boolean, item: CardGridItem) => void;
3176
3188
  /** Empty state message */
package/dist/index.d.ts CHANGED
@@ -2650,6 +2650,12 @@ interface RenderCardV6Options {
2650
2650
  * provided are shown. Default: false (3 separate buttons).
2651
2651
  */
2652
2652
  enableActionSelector?: boolean;
2653
+ /**
2654
+ * Requires enableActionSelector. When true, the single ⋮ button is not
2655
+ * rendered and the selection modal opens on the card body click instead
2656
+ * (handleClickCard is then ignored). Default: false.
2657
+ */
2658
+ actionSelectorOnCardClick?: boolean;
2653
2659
  }
2654
2660
 
2655
2661
  interface CardResult {
@@ -3171,6 +3177,12 @@ interface CardGridPanelOptions {
3171
3177
  * are shown. Applies to cardType='device' only. Default: false.
3172
3178
  */
3173
3179
  enableActionSelector?: boolean;
3180
+ /**
3181
+ * Requires enableActionSelector. When true, device cards render no action
3182
+ * button at all — the selection modal opens on the card body click instead
3183
+ * (handleClickCard is then ignored). Default: false.
3184
+ */
3185
+ actionSelectorOnCardClick?: boolean;
3174
3186
  /** Callback for ambiente card remote toggle (only for cardType='ambiente') */
3175
3187
  handleToggleRemote?: (isOn: boolean, item: CardGridItem) => void;
3176
3188
  /** Empty state message */
package/dist/index.js CHANGED
@@ -535,7 +535,7 @@ var init_template_card = __esm({
535
535
  // package.json
536
536
  var package_default = {
537
537
  name: "myio-js-library",
538
- version: "0.1.519",
538
+ version: "0.1.520",
539
539
  description: "A clean, standalone JS SDK for MYIO projects",
540
540
  license: "MIT",
541
541
  repository: "github:gh-myio/myio-js-library",
@@ -15899,8 +15899,10 @@ function renderCardComponentV6({
15899
15899
  showTempRangeTooltip = false,
15900
15900
  customStyle,
15901
15901
  // V6: Per-card style overrides
15902
- enableActionSelector = false
15902
+ enableActionSelector = false,
15903
15903
  // V6: "step" — single button opens action selection modal
15904
+ actionSelectorOnCardClick = false
15905
+ // V6: card click opens the selector (suppresses the ⋮ button)
15904
15906
  }) {
15905
15907
  const {
15906
15908
  entityId,
@@ -16746,8 +16748,8 @@ function renderCardComponentV6({
16746
16748
  lastDisconnectTime
16747
16749
  }
16748
16750
  });
16751
+ const selectorOptions = [];
16749
16752
  if (enableActionSelector) {
16750
- const selectorOptions = [];
16751
16753
  if (typeof handleActionDashboard === "function") {
16752
16754
  selectorOptions.push({
16753
16755
  id: "dashboard",
@@ -16775,7 +16777,7 @@ function renderCardComponentV6({
16775
16777
  onSelect: () => handleActionSettings(entityObject, buildSettingsOpts())
16776
16778
  });
16777
16779
  }
16778
- if (selectorOptions.length > 0) {
16780
+ if (selectorOptions.length > 0 && !actionSelectorOnCardClick) {
16779
16781
  const selectorBtn = document.createElement("button");
16780
16782
  selectorBtn.className = "card-action action-selector";
16781
16783
  selectorBtn.title = "A\xE7\xF5es";
@@ -16962,7 +16964,13 @@ function renderCardComponentV6({
16962
16964
  }
16963
16965
  });
16964
16966
  }
16965
- if (typeof handleClickCard === "function") {
16967
+ if (enableActionSelector && actionSelectorOnCardClick && selectorOptions.length > 0) {
16968
+ enhancedCardElement.addEventListener("click", (e) => {
16969
+ if (!e.target.closest(".card-action") && !e.target.closest(".card-checkbox")) {
16970
+ openCardActionSelector({ title: cardEntity.name, options: selectorOptions });
16971
+ }
16972
+ });
16973
+ } else if (typeof handleClickCard === "function") {
16966
16974
  enhancedCardElement.addEventListener("click", (e) => {
16967
16975
  if (!e.target.closest(".card-action") && !e.target.closest(".card-checkbox")) {
16968
16976
  handleClickCard(entityObject);
@@ -19656,6 +19664,7 @@ var CardGridPanel = class {
19656
19664
  emptyMessage,
19657
19665
  showTempRangeTooltip,
19658
19666
  enableActionSelector,
19667
+ actionSelectorOnCardClick,
19659
19668
  enableSelection,
19660
19669
  enableDragDrop,
19661
19670
  handleSelect
@@ -19714,7 +19723,8 @@ var CardGridPanel = class {
19714
19723
  useNewComponents: true,
19715
19724
  showTempRangeTooltip: showTempRangeTooltip || false,
19716
19725
  customStyle: cardCustomStyle || void 0,
19717
- enableActionSelector: enableActionSelector || false
19726
+ enableActionSelector: enableActionSelector || false,
19727
+ actionSelectorOnCardClick: actionSelectorOnCardClick || false
19718
19728
  });
19719
19729
  }
19720
19730
  if (cardResult && cardResult[0]) {
@@ -5209,7 +5209,7 @@
5209
5209
 
5210
5210
  // package.json
5211
5211
  var package_default = {
5212
- version: "0.1.519"};
5212
+ version: "0.1.520"};
5213
5213
 
5214
5214
  // src/format/energy.ts
5215
5215
  function formatPower(value, decimals = 2) {
@@ -20463,8 +20463,10 @@
20463
20463
  showTempRangeTooltip = false,
20464
20464
  customStyle,
20465
20465
  // V6: Per-card style overrides
20466
- enableActionSelector = false
20466
+ enableActionSelector = false,
20467
20467
  // V6: "step" — single button opens action selection modal
20468
+ actionSelectorOnCardClick = false
20469
+ // V6: card click opens the selector (suppresses the ⋮ button)
20468
20470
  }) {
20469
20471
  const {
20470
20472
  entityId,
@@ -21310,8 +21312,8 @@
21310
21312
  lastDisconnectTime
21311
21313
  }
21312
21314
  });
21315
+ const selectorOptions = [];
21313
21316
  if (enableActionSelector) {
21314
- const selectorOptions = [];
21315
21317
  if (typeof handleActionDashboard === "function") {
21316
21318
  selectorOptions.push({
21317
21319
  id: "dashboard",
@@ -21339,7 +21341,7 @@
21339
21341
  onSelect: () => handleActionSettings(entityObject, buildSettingsOpts())
21340
21342
  });
21341
21343
  }
21342
- if (selectorOptions.length > 0) {
21344
+ if (selectorOptions.length > 0 && !actionSelectorOnCardClick) {
21343
21345
  const selectorBtn = document.createElement("button");
21344
21346
  selectorBtn.className = "card-action action-selector";
21345
21347
  selectorBtn.title = "A\xE7\xF5es";
@@ -21526,7 +21528,13 @@
21526
21528
  }
21527
21529
  });
21528
21530
  }
21529
- if (typeof handleClickCard === "function") {
21531
+ if (enableActionSelector && actionSelectorOnCardClick && selectorOptions.length > 0) {
21532
+ enhancedCardElement.addEventListener("click", (e) => {
21533
+ if (!e.target.closest(".card-action") && !e.target.closest(".card-checkbox")) {
21534
+ openCardActionSelector({ title: cardEntity.name, options: selectorOptions });
21535
+ }
21536
+ });
21537
+ } else if (typeof handleClickCard === "function") {
21530
21538
  enhancedCardElement.addEventListener("click", (e) => {
21531
21539
  if (!e.target.closest(".card-action") && !e.target.closest(".card-checkbox")) {
21532
21540
  handleClickCard(entityObject);
@@ -24220,6 +24228,7 @@
24220
24228
  emptyMessage,
24221
24229
  showTempRangeTooltip,
24222
24230
  enableActionSelector,
24231
+ actionSelectorOnCardClick,
24223
24232
  enableSelection,
24224
24233
  enableDragDrop,
24225
24234
  handleSelect
@@ -24278,7 +24287,8 @@
24278
24287
  useNewComponents: true,
24279
24288
  showTempRangeTooltip: showTempRangeTooltip || false,
24280
24289
  customStyle: cardCustomStyle || void 0,
24281
- enableActionSelector: enableActionSelector || false
24290
+ enableActionSelector: enableActionSelector || false,
24291
+ actionSelectorOnCardClick: actionSelectorOnCardClick || false
24282
24292
  });
24283
24293
  }
24284
24294
  if (cardResult && cardResult[0]) {