@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
@@ -1,9 +1,41 @@
1
1
  /** Ported from original DUI: deep-future-app/app/client/components/dui/checkbox */
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;
35
+ };
36
+ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
37
+ if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
38
+ return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
7
39
  };
8
40
  import { css, html, LitElement } from "lit";
9
41
  import { property, state } from "lit/decorators.js";
@@ -39,73 +71,110 @@ const styles = css `
39
71
  *
40
72
  * @fires value-change - Fired when the set of checked values changes. Detail: string[]
41
73
  */
42
- export class DuiCheckboxGroup extends LitElement {
43
- static { this.tagName = "dui-checkbox-group"; }
44
- static { this.styles = [base, styles]; }
45
- #value_accessor_storage = undefined;
46
- /** Checked values (controlled). */
47
- get value() { return this.#value_accessor_storage; }
48
- set value(value) { this.#value_accessor_storage = value; }
49
- #defaultValue_accessor_storage = [];
50
- /** Initial checked values for uncontrolled usage. */
51
- get defaultValue() { return this.#defaultValue_accessor_storage; }
52
- set defaultValue(value) { this.#defaultValue_accessor_storage = value; }
53
- #allValues_accessor_storage = [];
54
- /**
55
- * All possible checkbox values in the group.
56
- * Required when using a parent (select-all) checkbox.
57
- */
58
- get allValues() { return this.#allValues_accessor_storage; }
59
- set allValues(value) { this.#allValues_accessor_storage = value; }
60
- #disabled_accessor_storage = false;
61
- /** Whether all checkboxes in the group are disabled. */
62
- get disabled() { return this.#disabled_accessor_storage; }
63
- set disabled(value) { this.#disabled_accessor_storage = value; }
64
- #internalValues_accessor_storage = [];
65
- get #internalValues() { return this.#internalValues_accessor_storage; }
66
- set #internalValues(value) { this.#internalValues_accessor_storage = value; }
67
- #getCheckedValues = () => this.value ?? this.#internalValues;
68
- #toggle = (val) => {
69
- const current = this.#getCheckedValues();
70
- const next = current.includes(val)
71
- ? current.filter((v) => v !== val)
72
- : [...current, val];
73
- if (this.value === undefined) {
74
- this.#internalValues = next;
75
- }
76
- this.dispatchEvent(valueChangeEvent(next));
77
- };
78
- #toggleAll = (checked) => {
79
- const next = checked ? [...this.allValues] : [];
80
- if (this.value === undefined) {
81
- this.#internalValues = next;
74
+ let DuiCheckboxGroup = (() => {
75
+ let _classSuper = LitElement;
76
+ let _value_decorators;
77
+ let _value_initializers = [];
78
+ let _value_extraInitializers = [];
79
+ let _defaultValue_decorators;
80
+ let _defaultValue_initializers = [];
81
+ let _defaultValue_extraInitializers = [];
82
+ let _allValues_decorators;
83
+ let _allValues_initializers = [];
84
+ let _allValues_extraInitializers = [];
85
+ let _disabled_decorators;
86
+ let _disabled_initializers = [];
87
+ let _disabled_extraInitializers = [];
88
+ let _private_internalValues_decorators;
89
+ let _private_internalValues_initializers = [];
90
+ let _private_internalValues_extraInitializers = [];
91
+ let _private_internalValues_descriptor;
92
+ let __ctx_decorators;
93
+ let __ctx_initializers = [];
94
+ let __ctx_extraInitializers = [];
95
+ return class DuiCheckboxGroup extends _classSuper {
96
+ static {
97
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
98
+ _value_decorators = [property({ attribute: false })];
99
+ _defaultValue_decorators = [property({ attribute: false })];
100
+ _allValues_decorators = [property({ attribute: false })];
101
+ _disabled_decorators = [property({ type: Boolean, reflect: true })];
102
+ _private_internalValues_decorators = [state()];
103
+ __ctx_decorators = [provide({ context: checkboxGroupContext }), state()];
104
+ __esDecorate(this, null, _value_decorators, { kind: "accessor", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
105
+ __esDecorate(this, null, _defaultValue_decorators, { kind: "accessor", name: "defaultValue", static: false, private: false, access: { has: obj => "defaultValue" in obj, get: obj => obj.defaultValue, set: (obj, value) => { obj.defaultValue = value; } }, metadata: _metadata }, _defaultValue_initializers, _defaultValue_extraInitializers);
106
+ __esDecorate(this, null, _allValues_decorators, { kind: "accessor", name: "allValues", static: false, private: false, access: { has: obj => "allValues" in obj, get: obj => obj.allValues, set: (obj, value) => { obj.allValues = value; } }, metadata: _metadata }, _allValues_initializers, _allValues_extraInitializers);
107
+ __esDecorate(this, null, _disabled_decorators, { kind: "accessor", name: "disabled", static: false, private: false, access: { has: obj => "disabled" in obj, get: obj => obj.disabled, set: (obj, value) => { obj.disabled = value; } }, metadata: _metadata }, _disabled_initializers, _disabled_extraInitializers);
108
+ __esDecorate(this, _private_internalValues_descriptor = { get: __setFunctionName(function () { return this.#internalValues_accessor_storage; }, "#internalValues", "get"), set: __setFunctionName(function (value) { this.#internalValues_accessor_storage = value; }, "#internalValues", "set") }, _private_internalValues_decorators, { kind: "accessor", name: "#internalValues", static: false, private: true, access: { has: obj => #internalValues in obj, get: obj => obj.#internalValues, set: (obj, value) => { obj.#internalValues = value; } }, metadata: _metadata }, _private_internalValues_initializers, _private_internalValues_extraInitializers);
109
+ __esDecorate(this, null, __ctx_decorators, { kind: "accessor", name: "_ctx", static: false, private: false, access: { has: obj => "_ctx" in obj, get: obj => obj._ctx, set: (obj, value) => { obj._ctx = value; } }, metadata: _metadata }, __ctx_initializers, __ctx_extraInitializers);
110
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
82
111
  }
83
- this.dispatchEvent(valueChangeEvent(next));
84
- };
85
- #_ctx_accessor_storage = this.#buildContext();
86
- get _ctx() { return this.#_ctx_accessor_storage; }
87
- set _ctx(value) { this.#_ctx_accessor_storage = value; }
88
- #buildContext() {
89
- return {
90
- checkedValues: this.#getCheckedValues(),
91
- allValues: this.allValues,
92
- disabled: this.disabled,
93
- toggle: this.#toggle,
94
- toggleAll: this.#toggleAll,
112
+ static tagName = "dui-checkbox-group";
113
+ static styles = [base, styles];
114
+ #value_accessor_storage = __runInitializers(this, _value_initializers, undefined);
115
+ /** Checked values (controlled). */
116
+ get value() { return this.#value_accessor_storage; }
117
+ set value(value) { this.#value_accessor_storage = value; }
118
+ #defaultValue_accessor_storage = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _defaultValue_initializers, []));
119
+ /** Initial checked values for uncontrolled usage. */
120
+ get defaultValue() { return this.#defaultValue_accessor_storage; }
121
+ set defaultValue(value) { this.#defaultValue_accessor_storage = value; }
122
+ #allValues_accessor_storage = (__runInitializers(this, _defaultValue_extraInitializers), __runInitializers(this, _allValues_initializers, []));
123
+ /**
124
+ * All possible checkbox values in the group.
125
+ * Required when using a parent (select-all) checkbox.
126
+ */
127
+ get allValues() { return this.#allValues_accessor_storage; }
128
+ set allValues(value) { this.#allValues_accessor_storage = value; }
129
+ #disabled_accessor_storage = (__runInitializers(this, _allValues_extraInitializers), __runInitializers(this, _disabled_initializers, false));
130
+ /** Whether all checkboxes in the group are disabled. */
131
+ get disabled() { return this.#disabled_accessor_storage; }
132
+ set disabled(value) { this.#disabled_accessor_storage = value; }
133
+ #internalValues_accessor_storage = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _private_internalValues_initializers, []));
134
+ get #internalValues() { return _private_internalValues_descriptor.get.call(this); }
135
+ set #internalValues(value) { return _private_internalValues_descriptor.set.call(this, value); }
136
+ #getCheckedValues = (__runInitializers(this, _private_internalValues_extraInitializers), () => this.value ?? this.#internalValues);
137
+ #toggle = (val) => {
138
+ const current = this.#getCheckedValues();
139
+ const next = current.includes(val)
140
+ ? current.filter((v) => v !== val)
141
+ : [...current, val];
142
+ if (this.value === undefined) {
143
+ this.#internalValues = next;
144
+ }
145
+ this.dispatchEvent(valueChangeEvent(next));
95
146
  };
96
- }
97
- connectedCallback() {
98
- super.connectedCallback();
99
- if (this.value === undefined && this.defaultValue.length > 0) {
100
- this.#internalValues = [...this.defaultValue];
147
+ #toggleAll = (checked) => {
148
+ const next = checked ? [...this.allValues] : [];
149
+ if (this.value === undefined) {
150
+ this.#internalValues = next;
151
+ }
152
+ this.dispatchEvent(valueChangeEvent(next));
153
+ };
154
+ #_ctx_accessor_storage = __runInitializers(this, __ctx_initializers, this.#buildContext());
155
+ get _ctx() { return this.#_ctx_accessor_storage; }
156
+ set _ctx(value) { this.#_ctx_accessor_storage = value; }
157
+ #buildContext() {
158
+ return {
159
+ checkedValues: this.#getCheckedValues(),
160
+ allValues: this.allValues,
161
+ disabled: this.disabled,
162
+ toggle: this.#toggle,
163
+ toggleAll: this.#toggleAll,
164
+ };
101
165
  }
102
- this._ctx = this.#buildContext();
103
- }
104
- willUpdate() {
105
- this._ctx = this.#buildContext();
106
- }
107
- render() {
108
- return html `
166
+ connectedCallback() {
167
+ super.connectedCallback();
168
+ if (this.value === undefined && this.defaultValue.length > 0) {
169
+ this.#internalValues = [...this.defaultValue];
170
+ }
171
+ this._ctx = this.#buildContext();
172
+ }
173
+ willUpdate() {
174
+ this._ctx = this.#buildContext();
175
+ }
176
+ render() {
177
+ return html `
109
178
  <div
110
179
  part="root"
111
180
  role="group"
@@ -114,21 +183,11 @@ export class DuiCheckboxGroup extends LitElement {
114
183
  <slot></slot>
115
184
  </div>
116
185
  `;
117
- }
118
- }
119
- __decorate([
120
- property({ attribute: false })
121
- ], DuiCheckboxGroup.prototype, "value", null);
122
- __decorate([
123
- property({ attribute: false })
124
- ], DuiCheckboxGroup.prototype, "defaultValue", null);
125
- __decorate([
126
- property({ attribute: false })
127
- ], DuiCheckboxGroup.prototype, "allValues", null);
128
- __decorate([
129
- property({ type: Boolean, reflect: true })
130
- ], DuiCheckboxGroup.prototype, "disabled", null);
131
- __decorate([
132
- provide({ context: checkboxGroupContext }),
133
- state()
134
- ], DuiCheckboxGroup.prototype, "_ctx", null);
186
+ }
187
+ constructor() {
188
+ super(...arguments);
189
+ __runInitializers(this, __ctx_extraInitializers);
190
+ }
191
+ };
192
+ })();
193
+ export { DuiCheckboxGroup };