@deepfuture/dui-components 0.0.12 → 0.0.14

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.
Files changed (89) hide show
  1. package/_deprecated/center/center.js +2 -2
  2. package/_deprecated/hstack/hstack.js +79 -33
  3. package/_deprecated/page-inset/page-inset.js +104 -56
  4. package/_deprecated/vstack/vstack.js +61 -19
  5. package/accordion/accordion-item.js +217 -147
  6. package/accordion/accordion.js +214 -149
  7. package/alert-dialog/alert-dialog-close.js +2 -2
  8. package/alert-dialog/alert-dialog-popup.js +230 -166
  9. package/alert-dialog/alert-dialog-trigger.js +2 -2
  10. package/alert-dialog/alert-dialog.js +128 -73
  11. package/avatar/avatar.js +175 -115
  12. package/badge/badge.js +2 -2
  13. package/breadcrumb/breadcrumb-ellipsis.js +2 -2
  14. package/breadcrumb/breadcrumb-item.js +2 -2
  15. package/breadcrumb/breadcrumb-link.js +2 -2
  16. package/breadcrumb/breadcrumb-page.js +2 -2
  17. package/breadcrumb/breadcrumb-separator.js +2 -2
  18. package/breadcrumb/breadcrumb.js +2 -2
  19. package/button/button.js +109 -65
  20. package/calendar/calendar.js +368 -290
  21. package/checkbox/checkbox-group.js +146 -87
  22. package/checkbox/checkbox.js +232 -167
  23. package/collapsible/collapsible.js +210 -132
  24. package/combobox/combobox.js +318 -252
  25. package/command/command-empty.js +67 -25
  26. package/command/command-group.js +87 -47
  27. package/command/command-input.js +84 -44
  28. package/command/command-item.js +168 -124
  29. package/command/command-list.js +60 -18
  30. package/command/command-separator.js +2 -2
  31. package/command/command-shortcut.js +2 -2
  32. package/command/command.js +297 -232
  33. package/data-table/data-table.js +225 -153
  34. package/dialog/dialog-close.js +2 -2
  35. package/dialog/dialog-popup.js +247 -181
  36. package/dialog/dialog-trigger.js +2 -2
  37. package/dialog/dialog.js +128 -73
  38. package/dropzone/dropzone.js +310 -249
  39. package/icon/icon.js +2 -2
  40. package/input/input.js +204 -143
  41. package/link/link.js +62 -24
  42. package/menu/menu-item.js +66 -24
  43. package/menu/menu.js +189 -136
  44. package/menubar/menubar.js +142 -91
  45. package/number-field/number-field.js +277 -204
  46. package/package.json +2 -3
  47. package/popover/popover-close.js +2 -2
  48. package/popover/popover-popup.js +126 -76
  49. package/popover/popover-trigger.js +2 -2
  50. package/popover/popover.js +181 -120
  51. package/portal/portal.js +128 -86
  52. package/preview-card/preview-card-popup.js +114 -66
  53. package/preview-card/preview-card-trigger.js +2 -2
  54. package/preview-card/preview-card.js +211 -142
  55. package/progress/progress.js +91 -45
  56. package/radio/radio-group.js +153 -90
  57. package/radio/radio.js +137 -94
  58. package/scroll-area/scroll-area.js +382 -283
  59. package/select/select.js +260 -203
  60. package/separator/separator.js +60 -18
  61. package/sidebar/sidebar-content.js +2 -2
  62. package/sidebar/sidebar-footer.js +2 -2
  63. package/sidebar/sidebar-group-label.js +2 -2
  64. package/sidebar/sidebar-group.js +2 -2
  65. package/sidebar/sidebar-header.js +2 -2
  66. package/sidebar/sidebar-inset.js +2 -2
  67. package/sidebar/sidebar-menu-button.js +118 -74
  68. package/sidebar/sidebar-menu-item.js +2 -2
  69. package/sidebar/sidebar-menu.js +2 -2
  70. package/sidebar/sidebar-provider.js +202 -129
  71. package/sidebar/sidebar-separator.js +2 -2
  72. package/sidebar/sidebar-trigger.js +2 -2
  73. package/sidebar/sidebar.js +150 -85
  74. package/slider/slider.js +217 -159
  75. package/spinner/spinner.js +70 -28
  76. package/switch/switch.js +174 -111
  77. package/tabs/tab.js +89 -47
  78. package/tabs/tabs-indicator.js +2 -2
  79. package/tabs/tabs-list.js +92 -54
  80. package/tabs/tabs-panel.js +90 -44
  81. package/tabs/tabs.js +130 -71
  82. package/textarea/textarea.js +153 -95
  83. package/toggle/toggle-group.js +184 -125
  84. package/toggle/toggle.js +131 -76
  85. package/toolbar/toolbar.js +79 -33
  86. package/tooltip/tooltip-popup.js +108 -60
  87. package/tooltip/tooltip-trigger.js +93 -55
  88. package/tooltip/tooltip.js +225 -154
  89. package/trunc/trunc.js +78 -34
package/trunc/trunc.js CHANGED
@@ -1,9 +1,37 @@
1
1
  /** Ported from original DUI: deep-future-app/app/client/components/dui/trunc */
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
2
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
6
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
7
+ var _, done = false;
8
+ for (var i = decorators.length - 1; i >= 0; i--) {
9
+ var context = {};
10
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
11
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
12
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
13
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
14
+ if (kind === "accessor") {
15
+ if (result === void 0) continue;
16
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
17
+ if (_ = accept(result.get)) descriptor.get = _;
18
+ if (_ = accept(result.set)) descriptor.set = _;
19
+ if (_ = accept(result.init)) initializers.unshift(_);
20
+ }
21
+ else if (_ = accept(result)) {
22
+ if (kind === "field") initializers.unshift(_);
23
+ else descriptor[key] = _;
24
+ }
25
+ }
26
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
27
+ done = true;
28
+ };
29
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
30
+ var useValue = arguments.length > 2;
31
+ for (var i = 0; i < initializers.length; i++) {
32
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
33
+ }
34
+ return useValue ? value : void 0;
7
35
  };
8
36
  import { css, html, LitElement } from "lit";
9
37
  import { property } from "lit/decorators.js";
@@ -37,32 +65,48 @@ const styles = css `
37
65
  * Both attributes can be combined: `max-width` constrains inline size,
38
66
  * `max-lines` constrains block size.
39
67
  */
40
- export class DuiTrunc extends LitElement {
41
- static { this.tagName = "dui-trunc"; }
42
- static { this.styles = [base, styles]; }
43
- #maxWidth_accessor_storage = "20rem";
44
- /** Maximum inline size before single-line truncation kicks in. */
45
- get maxWidth() { return this.#maxWidth_accessor_storage; }
46
- set maxWidth(value) { this.#maxWidth_accessor_storage = value; }
47
- #maxLines_accessor_storage;
48
- /** Maximum number of visible lines before clamping. */
49
- get maxLines() { return this.#maxLines_accessor_storage; }
50
- set maxLines(value) { this.#maxLines_accessor_storage = value; }
51
- render() {
52
- const clamp = this.maxLines !== undefined
53
- ? Math.max(1, this.maxLines).toString()
54
- : undefined;
55
- const dynamicStyles = styleMap({
56
- "max-width": this.maxWidth,
57
- "-webkit-line-clamp": clamp,
58
- "line-clamp": clamp,
59
- });
60
- return html `<div part="root" style=${dynamicStyles}><slot></slot></div>`;
61
- }
62
- }
63
- __decorate([
64
- property({ attribute: "max-width" })
65
- ], DuiTrunc.prototype, "maxWidth", null);
66
- __decorate([
67
- property({ attribute: "max-lines", type: Number, reflect: true })
68
- ], DuiTrunc.prototype, "maxLines", null);
68
+ let DuiTrunc = (() => {
69
+ let _classSuper = LitElement;
70
+ let _maxWidth_decorators;
71
+ let _maxWidth_initializers = [];
72
+ let _maxWidth_extraInitializers = [];
73
+ let _maxLines_decorators;
74
+ let _maxLines_initializers = [];
75
+ let _maxLines_extraInitializers = [];
76
+ return class DuiTrunc extends _classSuper {
77
+ static {
78
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
79
+ _maxWidth_decorators = [property({ attribute: "max-width" })];
80
+ _maxLines_decorators = [property({ attribute: "max-lines", type: Number, reflect: true })];
81
+ __esDecorate(this, null, _maxWidth_decorators, { kind: "accessor", name: "maxWidth", static: false, private: false, access: { has: obj => "maxWidth" in obj, get: obj => obj.maxWidth, set: (obj, value) => { obj.maxWidth = value; } }, metadata: _metadata }, _maxWidth_initializers, _maxWidth_extraInitializers);
82
+ __esDecorate(this, null, _maxLines_decorators, { kind: "accessor", name: "maxLines", static: false, private: false, access: { has: obj => "maxLines" in obj, get: obj => obj.maxLines, set: (obj, value) => { obj.maxLines = value; } }, metadata: _metadata }, _maxLines_initializers, _maxLines_extraInitializers);
83
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
84
+ }
85
+ static tagName = "dui-trunc";
86
+ static styles = [base, styles];
87
+ #maxWidth_accessor_storage = __runInitializers(this, _maxWidth_initializers, "20rem");
88
+ /** Maximum inline size before single-line truncation kicks in. */
89
+ get maxWidth() { return this.#maxWidth_accessor_storage; }
90
+ set maxWidth(value) { this.#maxWidth_accessor_storage = value; }
91
+ #maxLines_accessor_storage = (__runInitializers(this, _maxWidth_extraInitializers), __runInitializers(this, _maxLines_initializers, void 0));
92
+ /** Maximum number of visible lines before clamping. */
93
+ get maxLines() { return this.#maxLines_accessor_storage; }
94
+ set maxLines(value) { this.#maxLines_accessor_storage = value; }
95
+ render() {
96
+ const clamp = this.maxLines !== undefined
97
+ ? Math.max(1, this.maxLines).toString()
98
+ : undefined;
99
+ const dynamicStyles = styleMap({
100
+ "max-width": this.maxWidth,
101
+ "-webkit-line-clamp": clamp,
102
+ "line-clamp": clamp,
103
+ });
104
+ return html `<div part="root" style=${dynamicStyles}><slot></slot></div>`;
105
+ }
106
+ constructor() {
107
+ super(...arguments);
108
+ __runInitializers(this, _maxLines_extraInitializers);
109
+ }
110
+ };
111
+ })();
112
+ export { DuiTrunc };