smoothly 1.14.0 → 1.16.0
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/cjs/smoothly-app_99.cjs.entry.js +128 -142
- package/dist/cjs/smoothly-app_99.cjs.entry.js.map +1 -1
- package/dist/collection/components/confirm/index.js +1 -1
- package/dist/collection/components/form/index.js +9 -18
- package/dist/collection/components/form/index.js.map +1 -1
- package/dist/collection/components/input/Editable/Observer.js +17 -0
- package/dist/collection/components/input/Editable/Observer.js.map +1 -0
- package/dist/collection/components/input/{Editable.js → Editable/index.js} +3 -1
- package/dist/collection/components/input/Editable/index.js.map +1 -0
- package/dist/collection/components/input/checkbox/index.js +16 -19
- package/dist/collection/components/input/checkbox/index.js.map +1 -1
- package/dist/collection/components/input/clear/index.js +4 -3
- package/dist/collection/components/input/clear/index.js.map +1 -1
- package/dist/collection/components/input/color/index.js +11 -17
- package/dist/collection/components/input/color/index.js.map +1 -1
- package/dist/collection/components/input/date/index.js +13 -20
- package/dist/collection/components/input/date/index.js.map +1 -1
- package/dist/collection/components/input/date/range/index.js +12 -19
- package/dist/collection/components/input/date/range/index.js.map +1 -1
- package/dist/collection/components/input/date/time/index.js +16 -24
- package/dist/collection/components/input/date/time/index.js.map +1 -1
- package/dist/collection/components/input/edit/index.js +3 -3
- package/dist/collection/components/input/edit/index.js.map +1 -1
- package/dist/collection/components/input/file/index.js +10 -12
- package/dist/collection/components/input/file/index.js.map +1 -1
- package/dist/collection/components/input/index.js +12 -19
- package/dist/collection/components/input/index.js.map +1 -1
- package/dist/collection/components/input/month/index.js +9 -13
- package/dist/collection/components/input/month/index.js.map +1 -1
- package/dist/collection/components/input/radio/index.js +12 -18
- package/dist/collection/components/input/radio/index.js.map +1 -1
- package/dist/collection/components/input/range/index.js +14 -19
- package/dist/collection/components/input/range/index.js.map +1 -1
- package/dist/collection/components/input/reset/index.js +3 -3
- package/dist/collection/components/input/reset/index.js.map +1 -1
- package/dist/collection/components/input/select/index.js +13 -20
- package/dist/collection/components/input/select/index.js.map +1 -1
- package/dist/collection/components/input/submit/index.js +3 -3
- package/dist/collection/components/input/submit/index.js.map +1 -1
- package/dist/collection/components/item/index.js +1 -1
- package/dist/collection/components/submit/index.js +1 -1
- package/dist/components/{p-a412f63a.js → p-0bb48aa4.js} +8 -8
- package/dist/components/{p-a412f63a.js.map → p-0bb48aa4.js.map} +1 -1
- package/dist/components/{p-0e6d86f8.js → p-0d2feb6b.js} +4 -4
- package/dist/components/{p-0e6d86f8.js.map → p-0d2feb6b.js.map} +1 -1
- package/dist/components/{p-3bca6cd6.js → p-0f0595cd.js} +2 -2
- package/dist/components/{p-3bca6cd6.js.map → p-0f0595cd.js.map} +1 -1
- package/dist/components/{p-a20bfc11.js → p-23e20d06.js} +4 -4
- package/dist/components/p-23e20d06.js.map +1 -0
- package/dist/components/{p-bdb0f144.js → p-24f75863.js} +16 -19
- package/dist/components/p-24f75863.js.map +1 -0
- package/dist/components/{p-5420a182.js → p-298b33fe.js} +21 -21
- package/dist/components/{p-5420a182.js.map → p-298b33fe.js.map} +1 -1
- package/dist/components/{p-db2b7728.js → p-2d8fef15.js} +6 -6
- package/dist/components/{p-db2b7728.js.map → p-2d8fef15.js.map} +1 -1
- package/dist/components/{p-38cef3dc.js → p-2dc75399.js} +9 -9
- package/dist/components/{p-38cef3dc.js.map → p-2dc75399.js.map} +1 -1
- package/dist/components/{p-07481747.js → p-2e8109a4.js} +2 -2
- package/dist/components/{p-07481747.js.map → p-2e8109a4.js.map} +1 -1
- package/dist/components/{p-60a6c203.js → p-2ef598e0.js} +3 -3
- package/dist/components/{p-60a6c203.js.map → p-2ef598e0.js.map} +1 -1
- package/dist/components/{p-4aa8c380.js → p-32421607.js} +3 -3
- package/dist/components/{p-4aa8c380.js.map → p-32421607.js.map} +1 -1
- package/dist/components/{p-8bc40637.js → p-3bc98439.js} +19 -23
- package/dist/components/p-3bc98439.js.map +1 -0
- package/dist/components/{p-6d0ff8cf.js → p-40018c45.js} +3 -3
- package/dist/components/{p-6d0ff8cf.js.map → p-40018c45.js.map} +1 -1
- package/dist/components/{p-d435a1f5.js → p-4163ed78.js} +5 -5
- package/dist/components/{p-d435a1f5.js.map → p-4163ed78.js.map} +1 -1
- package/dist/components/{p-384fa7ab.js → p-43d5ef40.js} +13 -13
- package/dist/components/{p-384fa7ab.js.map → p-43d5ef40.js.map} +1 -1
- package/dist/components/{p-562041ad.js → p-4474a291.js} +5 -5
- package/dist/components/{p-562041ad.js.map → p-4474a291.js.map} +1 -1
- package/dist/components/{p-51fecc94.js → p-4906b9ce.js} +2 -2
- package/dist/components/{p-51fecc94.js.map → p-4906b9ce.js.map} +1 -1
- package/dist/components/{p-1a33e094.js → p-4b2dc6a6.js} +12 -16
- package/dist/components/p-4b2dc6a6.js.map +1 -0
- package/dist/components/{p-b9e2dd74.js → p-4c823253.js} +4 -4
- package/dist/components/{p-b9e2dd74.js.map → p-4c823253.js.map} +1 -1
- package/dist/components/{p-a5465d2c.js → p-4fe57c01.js} +15 -14
- package/dist/components/p-4fe57c01.js.map +1 -0
- package/dist/components/{p-b9e51cc2.js → p-601d4fcc.js} +17 -17
- package/dist/components/{p-b9e51cc2.js.map → p-601d4fcc.js.map} +1 -1
- package/dist/components/{p-5fc39b8c.js → p-62d76797.js} +31 -31
- package/dist/components/{p-5fc39b8c.js.map → p-62d76797.js.map} +1 -1
- package/dist/components/{p-1290ddba.js → p-641f1616.js} +5 -5
- package/dist/components/p-641f1616.js.map +1 -0
- package/dist/components/{p-d4bfa393.js → p-68a688f7.js} +9 -13
- package/dist/components/p-68a688f7.js.map +1 -0
- package/dist/components/{p-11eba790.js → p-7c09cbcc.js} +2 -2
- package/dist/components/{p-11eba790.js.map → p-7c09cbcc.js.map} +1 -1
- package/dist/components/{p-ff463ff4.js → p-7d0d2416.js} +14 -15
- package/dist/components/p-7d0d2416.js.map +1 -0
- package/dist/components/{p-ff96a9e4.js → p-81fdd280.js} +4 -4
- package/dist/components/{p-ff96a9e4.js.map → p-81fdd280.js.map} +1 -1
- package/dist/components/{p-0843d026.js → p-8b77a69c.js} +2 -2
- package/dist/components/{p-0843d026.js.map → p-8b77a69c.js.map} +1 -1
- package/dist/components/{p-2cd5ddaf.js → p-8c9c8785.js} +15 -18
- package/dist/components/p-8c9c8785.js.map +1 -0
- package/dist/components/{p-0bc118a5.js → p-8d8e4f3e.js} +10 -10
- package/dist/components/{p-0bc118a5.js.map → p-8d8e4f3e.js.map} +1 -1
- package/dist/components/{p-40237cec.js → p-9fb30832.js} +9 -9
- package/dist/components/{p-40237cec.js.map → p-9fb30832.js.map} +1 -1
- package/dist/components/{p-839aeebc.js → p-9fb82b7f.js} +15 -15
- package/dist/components/{p-839aeebc.js.map → p-9fb82b7f.js.map} +1 -1
- package/dist/components/{p-1f84e453.js → p-a6a932a2.js} +2 -2
- package/dist/components/{p-1f84e453.js.map → p-a6a932a2.js.map} +1 -1
- package/dist/components/{p-f763bcec.js → p-b05f15f1.js} +6 -5
- package/dist/components/p-b05f15f1.js.map +1 -0
- package/dist/components/{p-d97a450e.js → p-b1ac8052.js} +8 -8
- package/dist/components/{p-d97a450e.js.map → p-b1ac8052.js.map} +1 -1
- package/dist/components/{p-7bb0b100.js → p-b90d5ee0.js} +8 -8
- package/dist/components/{p-7bb0b100.js.map → p-b90d5ee0.js.map} +1 -1
- package/dist/components/{p-e1f315b2.js → p-c4c03077.js} +3 -3
- package/dist/components/{p-e1f315b2.js.map → p-c4c03077.js.map} +1 -1
- package/dist/components/{p-f920c9ee.js → p-cc199143.js} +11 -13
- package/dist/components/p-cc199143.js.map +1 -0
- package/dist/components/{p-086f7ec2.js → p-cd1ba743.js} +2 -2
- package/dist/components/{p-086f7ec2.js.map → p-cd1ba743.js.map} +1 -1
- package/dist/components/{p-c0a11593.js → p-d2df47d9.js} +9 -9
- package/dist/components/{p-c0a11593.js.map → p-d2df47d9.js.map} +1 -1
- package/dist/components/{p-01da7d16.js → p-d533c059.js} +9 -7
- package/dist/components/p-d533c059.js.map +1 -0
- package/dist/components/{p-2f458ad6.js → p-e03fef34.js} +8 -8
- package/dist/components/{p-2f458ad6.js.map → p-e03fef34.js.map} +1 -1
- package/dist/components/{p-3180c415.js → p-e3e5bddc.js} +9 -9
- package/dist/components/p-e3e5bddc.js.map +1 -0
- package/dist/components/{p-c6f18284.js → p-ee7599d6.js} +12 -14
- package/dist/components/p-ee7599d6.js.map +1 -0
- package/dist/components/{p-f1031dad.js → p-f1c7349b.js} +2 -2
- package/dist/components/{p-f1031dad.js.map → p-f1c7349b.js.map} +1 -1
- package/dist/components/{p-48f2eb43.js → p-f1e00154.js} +11 -14
- package/dist/components/p-f1e00154.js.map +1 -0
- package/dist/components/{p-cf80f679.js → p-f3cc40b4.js} +2 -2
- package/dist/components/{p-cf80f679.js.map → p-f3cc40b4.js.map} +1 -1
- package/dist/components/{p-71f661ae.js → p-f9ad2e56.js} +4 -4
- package/dist/components/p-f9ad2e56.js.map +1 -0
- package/dist/components/{p-78dd098c.js → p-fe854055.js} +19 -1
- package/dist/components/p-fe854055.js.map +1 -0
- package/dist/components/smoothly-app-demo.js +48 -48
- package/dist/components/smoothly-calendar.js +1 -1
- package/dist/components/smoothly-dialog-demo.js +1 -1
- package/dist/components/smoothly-display-demo.js +1 -1
- package/dist/components/smoothly-filter-field.js +1 -1
- package/dist/components/smoothly-filter-input.js +1 -1
- package/dist/components/smoothly-filter-select.js +1 -1
- package/dist/components/smoothly-filter.js +1 -1
- package/dist/components/smoothly-form-demo-all.js +1 -1
- package/dist/components/smoothly-form-demo-card.js +1 -1
- package/dist/components/smoothly-form-demo-controlled.js +1 -1
- package/dist/components/smoothly-form-demo-date-range.js +1 -1
- package/dist/components/smoothly-form-demo-date.js +1 -1
- package/dist/components/smoothly-form-demo-login.js +1 -1
- package/dist/components/smoothly-form-demo-pet.js +1 -1
- package/dist/components/smoothly-form-demo-prices.js +1 -1
- package/dist/components/smoothly-form-demo-schedule.js +1 -1
- package/dist/components/smoothly-form-demo-transparent.js +1 -1
- package/dist/components/smoothly-form-demo-typed.js +1 -1
- package/dist/components/smoothly-form-demo.js +1 -1
- package/dist/components/smoothly-form.js +1 -1
- package/dist/components/smoothly-icon-demo.js +1 -1
- package/dist/components/smoothly-input-checkbox-demo.js +16 -16
- package/dist/components/smoothly-input-checkbox.js +1 -1
- package/dist/components/smoothly-input-clear.js +1 -1
- package/dist/components/smoothly-input-color-demo.js +1 -1
- package/dist/components/smoothly-input-color.js +1 -1
- package/dist/components/smoothly-input-date-range.js +1 -1
- package/dist/components/smoothly-input-date-time.js +1 -1
- package/dist/components/smoothly-input-date.js +1 -1
- package/dist/components/smoothly-input-demo-standard.js +1 -1
- package/dist/components/smoothly-input-demo.js +1 -1
- package/dist/components/smoothly-input-edit.js +1 -1
- package/dist/components/smoothly-input-file.js +1 -1
- package/dist/components/smoothly-input-month.js +1 -1
- package/dist/components/smoothly-input-price-demo.js +1 -1
- package/dist/components/smoothly-input-radio.js +1 -1
- package/dist/components/smoothly-input-range-demo.js +1 -1
- package/dist/components/smoothly-input-range.js +1 -1
- package/dist/components/smoothly-input-reset.js +1 -1
- package/dist/components/smoothly-input-select.js +1 -1
- package/dist/components/smoothly-input-submit.js +1 -1
- package/dist/components/smoothly-input.js +1 -1
- package/dist/components/smoothly-summary.js +1 -1
- package/dist/components/smoothly-tab.js +1 -1
- package/dist/components/smoothly-table-demo-filtered.js +1 -1
- package/dist/components/smoothly-table-demo.js +1 -1
- package/dist/components/smoothly-tabs-demo.js +1 -1
- package/dist/components/smoothly-theme-demo.js +1 -1
- package/dist/components/smoothly-theme-picker.js +1 -1
- package/dist/esm/smoothly-app_99.entry.js +128 -142
- package/dist/esm/smoothly-app_99.entry.js.map +1 -1
- package/dist/smoothly/p-4ce2b8a4.entry.js +2 -0
- package/dist/smoothly/p-4ce2b8a4.entry.js.map +1 -0
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/dist/types/components/form/index.d.ts +2 -2
- package/dist/types/components/input/Editable/Observer.d.ts +10 -0
- package/dist/types/components/input/{Editable.d.ts → Editable/index.d.ts} +7 -2
- package/dist/types/components/input/checkbox/index.d.ts +3 -3
- package/dist/types/components/input/clear/index.d.ts +1 -0
- package/dist/types/components/input/color/index.d.ts +2 -2
- package/dist/types/components/input/date/index.d.ts +2 -2
- package/dist/types/components/input/date/range/index.d.ts +2 -2
- package/dist/types/components/input/date/time/index.d.ts +2 -2
- package/dist/types/components/input/file/index.d.ts +2 -2
- package/dist/types/components/input/index.d.ts +2 -2
- package/dist/types/components/input/month/index.d.ts +2 -2
- package/dist/types/components/input/radio/index.d.ts +2 -2
- package/dist/types/components/input/range/index.d.ts +2 -2
- package/dist/types/components/input/select/index.d.ts +2 -2
- package/dist/types/components.d.ts +12 -12
- package/package.json +1 -1
- package/dist/collection/components/input/Editable.js.map +0 -1
- package/dist/components/p-01da7d16.js.map +0 -1
- package/dist/components/p-1290ddba.js.map +0 -1
- package/dist/components/p-1a33e094.js.map +0 -1
- package/dist/components/p-2cd5ddaf.js.map +0 -1
- package/dist/components/p-3180c415.js.map +0 -1
- package/dist/components/p-48f2eb43.js.map +0 -1
- package/dist/components/p-71f661ae.js.map +0 -1
- package/dist/components/p-78dd098c.js.map +0 -1
- package/dist/components/p-8bc40637.js.map +0 -1
- package/dist/components/p-a20bfc11.js.map +0 -1
- package/dist/components/p-a5465d2c.js.map +0 -1
- package/dist/components/p-bdb0f144.js.map +0 -1
- package/dist/components/p-c6f18284.js.map +0 -1
- package/dist/components/p-d4bfa393.js.map +0 -1
- package/dist/components/p-f763bcec.js.map +0 -1
- package/dist/components/p-f920c9ee.js.map +0 -1
- package/dist/components/p-ff463ff4.js.map +0 -1
- package/dist/smoothly/p-626c7bc4.entry.js +0 -2
- package/dist/smoothly/p-626c7bc4.entry.js.map +0 -1
|
@@ -8112,8 +8112,26 @@ var Clearable;
|
|
|
8112
8112
|
Clearable.is = is;
|
|
8113
8113
|
})(Clearable || (Clearable = {}));
|
|
8114
8114
|
|
|
8115
|
+
class Observer {
|
|
8116
|
+
constructor(parent) {
|
|
8117
|
+
this.parent = parent;
|
|
8118
|
+
this.callbacks = [];
|
|
8119
|
+
}
|
|
8120
|
+
async subscribe(callback) {
|
|
8121
|
+
this.callbacks.push(callback);
|
|
8122
|
+
await callback(this.parent);
|
|
8123
|
+
}
|
|
8124
|
+
async publish() {
|
|
8125
|
+
Promise.all(this.callbacks.map(callback => callback(this.parent)));
|
|
8126
|
+
}
|
|
8127
|
+
static create(parent) {
|
|
8128
|
+
return new Observer(parent);
|
|
8129
|
+
}
|
|
8130
|
+
}
|
|
8131
|
+
|
|
8115
8132
|
var Editable;
|
|
8116
8133
|
(function (Editable) {
|
|
8134
|
+
Editable.Observer = Observer;
|
|
8117
8135
|
let Element;
|
|
8118
8136
|
(function (Element) {
|
|
8119
8137
|
Element.type = TimeZone.object({
|
|
@@ -8208,7 +8226,7 @@ const SmoothlyForm = class {
|
|
|
8208
8226
|
this.contentType = "json";
|
|
8209
8227
|
this.inputs = new Map();
|
|
8210
8228
|
this.readonlyAtLoad = this.readonly;
|
|
8211
|
-
this.
|
|
8229
|
+
this.observer = Editable.Observer.create(this);
|
|
8212
8230
|
this.color = undefined;
|
|
8213
8231
|
this.value = {};
|
|
8214
8232
|
this.action = undefined;
|
|
@@ -8231,14 +8249,11 @@ const SmoothlyForm = class {
|
|
|
8231
8249
|
this.smoothlyFormInput.emit(Scrollable.Data.convertArrays(this.value));
|
|
8232
8250
|
}
|
|
8233
8251
|
}
|
|
8234
|
-
async listen(
|
|
8235
|
-
|
|
8236
|
-
var _b;
|
|
8237
|
-
((_a = (_b = this.listeners)[property]) !== null && _a !== void 0 ? _a : (_b[property] = [])).push(listener);
|
|
8238
|
-
listener(this);
|
|
8252
|
+
async listen(listener) {
|
|
8253
|
+
this.observer.subscribe(listener);
|
|
8239
8254
|
}
|
|
8240
8255
|
async watchValue() {
|
|
8241
|
-
var _a, _b
|
|
8256
|
+
var _a, _b;
|
|
8242
8257
|
this.changed = [...this.inputs.values()].some(input => (Editable.type.is(input) ? input.changed : true));
|
|
8243
8258
|
if (this.validator) {
|
|
8244
8259
|
const flaws = (_b = (_a = this.validator) === null || _a === void 0 ? void 0 : _a.flaw(Scrollable.Data.convertArrays(this.value)).flaws) === null || _b === void 0 ? void 0 : _b.reduce((r, f) => (f.property ? Object.assign(Object.assign({}, r), { [f.property]: f }) : r), {});
|
|
@@ -8246,7 +8261,7 @@ const SmoothlyForm = class {
|
|
|
8246
8261
|
this.validate(flaws, property, input);
|
|
8247
8262
|
}
|
|
8248
8263
|
}
|
|
8249
|
-
|
|
8264
|
+
this.observer.publish();
|
|
8250
8265
|
}
|
|
8251
8266
|
validate(flaws, property, input) {
|
|
8252
8267
|
var _a, _b;
|
|
@@ -8261,8 +8276,7 @@ const SmoothlyForm = class {
|
|
|
8261
8276
|
}
|
|
8262
8277
|
}
|
|
8263
8278
|
watchReadonly() {
|
|
8264
|
-
|
|
8265
|
-
(_a = this.listeners.changed) === null || _a === void 0 ? void 0 : _a.forEach(l => l(this));
|
|
8279
|
+
this.observer.publish();
|
|
8266
8280
|
}
|
|
8267
8281
|
smoothlyInputLooksHandler(event) {
|
|
8268
8282
|
event.stopPropagation();
|
|
@@ -8361,7 +8375,7 @@ const SmoothlyForm = class {
|
|
|
8361
8375
|
await Promise.all([...this.inputs.values()].map(input => Editable.Element.type.is(input) && input.setInitialValue()));
|
|
8362
8376
|
}
|
|
8363
8377
|
render() {
|
|
8364
|
-
return (index.h(index.Host, { key: '
|
|
8378
|
+
return (index.h(index.Host, { key: '4f31c8f7638a9815689057e5a79e4bfdf3763662' }, index.h("smoothly-spinner", { key: 'bb97ac4b9327a589dc6ee737398f6f3563321e2a', overlay: true, hidden: !this.processing }), index.h("form", { key: '6d6dad4cdba6735e602433202facf334f7544f04', onSubmit: !this.prevent ? undefined : e => e.preventDefault(), name: this.name }, index.h("fieldset", { key: 'ad6218abf6ae8eeee32447d85f182d8c86db118b' }, index.h("slot", { key: 'd1406990d27589216e164185527f4eafb3dd668c' })), index.h("div", { key: '64db3c8aacd39335fa3cfbd2eb66d26e2185877a' }, index.h("slot", { key: '449a3d920b7e53ffd71f05213339c2fe5d59b7c3', name: "clear" }), index.h("slot", { key: '0afb67a1916ea46de43413e894ec20e043d2e06d', name: "edit" }), index.h("slot", { key: '35cb4dafe3f9b046176e28a8e080404f12634485', name: "reset" }), index.h("slot", { key: '0d9769f46aa24f4b6cccf85c5b74717c6b307b7d', name: "delete" }), index.h("slot", { key: '4a0dab8e81676c55af2ef7e43f768c31d98b02bf', name: "submit" })))));
|
|
8365
8379
|
}
|
|
8366
8380
|
get element() { return index.getElement(this); }
|
|
8367
8381
|
static get watchers() { return {
|
|
@@ -9013,7 +9027,7 @@ const SmoothlyInput = class {
|
|
|
9013
9027
|
this.smoothlyChange = index.createEvent(this, "smoothlyChange", 7);
|
|
9014
9028
|
this.smoothlyInput = index.createEvent(this, "smoothlyInput", 7);
|
|
9015
9029
|
this.uneditable = this.readonly;
|
|
9016
|
-
this.
|
|
9030
|
+
this.observer = Editable.Observer.create(this);
|
|
9017
9031
|
this.color = undefined;
|
|
9018
9032
|
this.looks = undefined;
|
|
9019
9033
|
this.name = undefined;
|
|
@@ -9051,9 +9065,8 @@ const SmoothlyInput = class {
|
|
|
9051
9065
|
if (this.inputElement)
|
|
9052
9066
|
this.state = this.stateHandler.setSelection(this.inputElement, this.state, start, end < 0 ? this.inputElement.value.length + end + 1 : end);
|
|
9053
9067
|
}
|
|
9054
|
-
async listen(
|
|
9055
|
-
this.listener
|
|
9056
|
-
listener(this);
|
|
9068
|
+
async listen(listener) {
|
|
9069
|
+
this.observer.subscribe(listener);
|
|
9057
9070
|
}
|
|
9058
9071
|
nameChange(_, oldName) {
|
|
9059
9072
|
Input.formRename(this, oldName);
|
|
@@ -9104,9 +9117,8 @@ const SmoothlyInput = class {
|
|
|
9104
9117
|
this.state = this.stateHandler.initialState((_a = this.value) !== null && _a !== void 0 ? _a : (_b = this.state) === null || _b === void 0 ? void 0 : _b.value);
|
|
9105
9118
|
}
|
|
9106
9119
|
stateChange() {
|
|
9107
|
-
var _a, _b;
|
|
9108
9120
|
this.smoothlyInput.emit({ [this.name]: this.stateHandler.getValue(this.state) });
|
|
9109
|
-
|
|
9121
|
+
this.observer.publish();
|
|
9110
9122
|
}
|
|
9111
9123
|
valueChange(value) {
|
|
9112
9124
|
const lastValue = this.stateHandler.getValue(this.state);
|
|
@@ -9116,17 +9128,15 @@ const SmoothlyInput = class {
|
|
|
9116
9128
|
}
|
|
9117
9129
|
}
|
|
9118
9130
|
readonlyChange() {
|
|
9119
|
-
|
|
9120
|
-
(_b = (_a = this.listener).changed) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
9131
|
+
this.observer.publish();
|
|
9121
9132
|
}
|
|
9122
9133
|
componentWillLoad() {
|
|
9123
|
-
var _a, _b;
|
|
9124
9134
|
this.typeChange();
|
|
9125
9135
|
this.initialValue = this.value;
|
|
9126
9136
|
this.smoothlyInputLooks.emit((looks, color) => { var _a; return ((this.looks = (_a = this.looks) !== null && _a !== void 0 ? _a : looks), !this.color && (this.color = color)); });
|
|
9127
9137
|
this.smoothlyInputLoad.emit(parent => (this.parent = parent));
|
|
9128
9138
|
!this.readonly && this.smoothlyFormDisable.emit(readonly => (this.readonly = readonly));
|
|
9129
|
-
|
|
9139
|
+
this.observer.publish();
|
|
9130
9140
|
}
|
|
9131
9141
|
componentDidLoad() {
|
|
9132
9142
|
if (this.inputElement)
|
|
@@ -9141,7 +9151,7 @@ const SmoothlyInput = class {
|
|
|
9141
9151
|
}
|
|
9142
9152
|
render() {
|
|
9143
9153
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
9144
|
-
return (index.h(index.Host, { key: '
|
|
9154
|
+
return (index.h(index.Host, { key: '5388810ea3cdbd5fdb01c74d1d3488d90793a51e', class: { "has-value": ((_a = this.state) === null || _a === void 0 ? void 0 : _a.value) != undefined && ((_b = this.state) === null || _b === void 0 ? void 0 : _b.value) != "" }, onclick: () => { var _a; return (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.focus(); } }, index.h("slot", { key: '8df5dba4385595cc949867cee6facb006345d1cb', name: "start" }), index.h("div", { key: '1a5708c0e27af3718f8de3dfbc558d17378f951d', class: "smoothly-input-container" }, index.h("div", { key: 'e1287ccf9714a0dfb343d7b8ab28e59839504c87', class: "ghost" }, index.h("div", { key: 'e7988dcbf0dfb660ad96bb300e508a481d6b1ae3', class: "value" }, (_c = this.state) === null || _c === void 0 ? void 0 : _c.value), index.h("div", { key: '1df3368a935e641948cda423da61a40636b7e470', class: "remainder" }, (_d = this.state) === null || _d === void 0 ? void 0 : _d.remainder)), index.h("input", { key: '7fc6db36a3f19f1c436b2f41e89122e2256fe955', ref: (el) => (this.inputElement = el), color: this.color, name: this.name, type: (_e = this.state) === null || _e === void 0 ? void 0 : _e.type, inputmode: (_f = this.state) === null || _f === void 0 ? void 0 : _f.inputmode, placeholder: this.placeholder, required: this.required, autocomplete: (_g = this.autocomplete) !== null && _g !== void 0 ? _g : (_h = this.state) === null || _h === void 0 ? void 0 : _h.autocomplete, disabled: this.disabled, readOnly: this.readonly, pattern: ((_j = this.state) === null || _j === void 0 ? void 0 : _j.pattern) && ((_k = this.state) === null || _k === void 0 ? void 0 : _k.pattern.source), onKeyDown: event => {
|
|
9145
9155
|
this.state = this.stateHandler.onKeyDown(event, this.state);
|
|
9146
9156
|
if (!this.readonly && !this.disabled)
|
|
9147
9157
|
this.smoothlyKeydown.emit(Key.create(this.name, event));
|
|
@@ -9154,7 +9164,7 @@ const SmoothlyInput = class {
|
|
|
9154
9164
|
if (Deep.notEqual(lastValue, this.stateHandler.getValue(this.state)))
|
|
9155
9165
|
this.smoothlyChange.emit({ [this.name]: this.stateHandler.getValue(this.state) });
|
|
9156
9166
|
}
|
|
9157
|
-
} }), index.h("label", { key: '
|
|
9167
|
+
} }), index.h("label", { key: 'ff40bf469c042d0aa128d6e66d7551924754713f', class: "label float-on-focus", htmlFor: this.name }, index.h("slot", { key: 'bdf8474b10e83fff9b4e92d14a90c49e37152921' }))), index.h("smoothly-icon", { key: '16c807f63ead934f26e44e48a831768b519c96c3', class: "smoothly-invalid", name: "alert-circle", color: "danger", fill: "clear", size: "small", toolTip: this.errorMessage }), index.h("slot", { key: '2d9157c04aa41189c78c8a8daef0f51e739455f0', name: "end" })));
|
|
9158
9168
|
}
|
|
9159
9169
|
get element() { return index.getElement(this); }
|
|
9160
9170
|
static get watchers() { return {
|
|
@@ -9179,7 +9189,7 @@ const SmoothlyInputCheckbox = class {
|
|
|
9179
9189
|
this.smoothlyInput = index.createEvent(this, "smoothlyInput", 7);
|
|
9180
9190
|
this.smoothlyInputLoad = index.createEvent(this, "smoothlyInputLoad", 7);
|
|
9181
9191
|
this.smoothlyFormDisable = index.createEvent(this, "smoothlyFormDisable", 7);
|
|
9182
|
-
this.
|
|
9192
|
+
this.observer = Editable.Observer.create(this);
|
|
9183
9193
|
this.name = undefined;
|
|
9184
9194
|
this.changed = false;
|
|
9185
9195
|
this.readonly = false;
|
|
@@ -9190,12 +9200,11 @@ const SmoothlyInputCheckbox = class {
|
|
|
9190
9200
|
this.color = undefined;
|
|
9191
9201
|
}
|
|
9192
9202
|
componentWillLoad() {
|
|
9193
|
-
var _a, _b;
|
|
9194
9203
|
this.initialValue = this.checked;
|
|
9195
9204
|
!this.readonly && this.smoothlyFormDisable.emit(readonly => (this.readonly = readonly));
|
|
9196
9205
|
this.smoothlyInputLooks.emit((looks, color) => { var _a; return ((this.looks = (_a = this.looks) !== null && _a !== void 0 ? _a : looks), !this.color && (this.color = color)); });
|
|
9197
9206
|
this.smoothlyInputLoad.emit(parent => (this.parent = parent));
|
|
9198
|
-
|
|
9207
|
+
this.observer.publish();
|
|
9199
9208
|
}
|
|
9200
9209
|
async disconnectedCallback() {
|
|
9201
9210
|
if (!this.element.isConnected)
|
|
@@ -9216,9 +9225,8 @@ const SmoothlyInputCheckbox = class {
|
|
|
9216
9225
|
async clear() {
|
|
9217
9226
|
!this.disabled && !this.readonly && (this.checked = false);
|
|
9218
9227
|
}
|
|
9219
|
-
async listen(
|
|
9220
|
-
this.listener
|
|
9221
|
-
listener(this);
|
|
9228
|
+
async listen(listener) {
|
|
9229
|
+
this.observer.subscribe(listener);
|
|
9222
9230
|
}
|
|
9223
9231
|
async edit(editable) {
|
|
9224
9232
|
this.readonly = !editable;
|
|
@@ -9230,17 +9238,19 @@ const SmoothlyInputCheckbox = class {
|
|
|
9230
9238
|
this.initialValue = this.checked;
|
|
9231
9239
|
this.changed = false;
|
|
9232
9240
|
}
|
|
9233
|
-
async elementCheck() {
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
|
|
9241
|
+
async elementCheck(checked, before) {
|
|
9242
|
+
this.changed = !!this.initialValue != !!this.checked;
|
|
9243
|
+
const changed = !!checked != !!before;
|
|
9244
|
+
if (changed) {
|
|
9245
|
+
this.smoothlyInput.emit({ [this.name]: await this.getValue() });
|
|
9246
|
+
this.observer.publish();
|
|
9247
|
+
}
|
|
9238
9248
|
}
|
|
9239
9249
|
click() {
|
|
9240
9250
|
!this.disabled && !this.readonly && (this.checked = !this.checked);
|
|
9241
9251
|
}
|
|
9242
9252
|
render() {
|
|
9243
|
-
return (index.h(index.Host, { key: '
|
|
9253
|
+
return (index.h(index.Host, { key: '4a9d992e99e63476c48d2bdee9b7bacb07bc9249', onMouseDown: (e) => (this.mouseDownPosition = { x: e.clientX, y: e.clientY }), onMouseUp: (e) => { var _a; return ((_a = this.mouseDownPosition) === null || _a === void 0 ? void 0 : _a.x) == e.clientX && this.mouseDownPosition.y == e.clientY && this.click(); } }, index.h("input", { key: '5fc8f81e3ab77873a81f2027b3bf7e3d658ee286', type: "checkbox", checked: this.checked, disabled: this.disabled }), this.checked && index.h("smoothly-icon", { key: 'b04698328c4e760b7e19d90313615dd8b6ae3db0', name: "checkmark-outline", size: "tiny" }), index.h("label", { key: '2665512bd77f63792b080bd2f732ec6833ba1bd8' }, index.h("slot", { key: '22a2e250c9d305e312290d07dc0a2004b5a349ad' }))));
|
|
9244
9254
|
}
|
|
9245
9255
|
get element() { return index.getElement(this); }
|
|
9246
9256
|
static get watchers() { return {
|
|
@@ -9272,7 +9282,7 @@ const SmoothlyInputClear = class {
|
|
|
9272
9282
|
if (Clearable.is(parent)) {
|
|
9273
9283
|
this.parent = parent;
|
|
9274
9284
|
if (Editable.Element.is(parent)) {
|
|
9275
|
-
parent.listen(
|
|
9285
|
+
parent.listen(async (p) => {
|
|
9276
9286
|
if (Input.is(p)) {
|
|
9277
9287
|
this.display =
|
|
9278
9288
|
!p.readonly && !p.disabled && (typeof p.defined == "boolean" ? p.defined : Boolean(await p.getValue()));
|
|
@@ -9292,8 +9302,9 @@ const SmoothlyInputClear = class {
|
|
|
9292
9302
|
}
|
|
9293
9303
|
render() {
|
|
9294
9304
|
var _a;
|
|
9295
|
-
return (index.h(index.Host, { key: '
|
|
9305
|
+
return (index.h(index.Host, { key: 'ddbb4cb1b0b278da0ac4b8dbb3a821b46a2ab8df', title: this.tooltip }, index.h("smoothly-button", { key: 'cadd8805fd38efd9c1f3f382fa12624ea303ef03', disabled: this.disabled, size: this.size, type: "button", shape: this.shape, expand: this.expand, color: this.color, fill: (_a = this.fill) !== null && _a !== void 0 ? _a : (this.type == "input" ? "clear" : undefined) }, index.h("slot", { key: 'e888976e89e666d1683e2956430ef7b93cfaf0f3' }), index.h("smoothly-icon", { key: '8b8a82692c577116515cf94d518a19d1a9a72d60', name: "close", size: "tiny" }))));
|
|
9296
9306
|
}
|
|
9307
|
+
get element() { return index.getElement(this); }
|
|
9297
9308
|
};
|
|
9298
9309
|
SmoothlyInputClear.style = SmoothlyInputClearStyle0;
|
|
9299
9310
|
|
|
@@ -9307,7 +9318,7 @@ const SmoothlyInputColor = class {
|
|
|
9307
9318
|
this.smoothlyInput = index.createEvent(this, "smoothlyInput", 7);
|
|
9308
9319
|
this.smoothlyInputLoad = index.createEvent(this, "smoothlyInputLoad", 7);
|
|
9309
9320
|
this.smoothlyFormDisable = index.createEvent(this, "smoothlyFormDisable", 7);
|
|
9310
|
-
this.
|
|
9321
|
+
this.observer = Editable.Observer.create(this);
|
|
9311
9322
|
this.rgb = { r: undefined, g: undefined, b: undefined };
|
|
9312
9323
|
this.hsl = { h: undefined, s: undefined, l: undefined };
|
|
9313
9324
|
this.value = undefined;
|
|
@@ -9348,8 +9359,7 @@ const SmoothlyInputColor = class {
|
|
|
9348
9359
|
Input.formRename(this, oldName);
|
|
9349
9360
|
}
|
|
9350
9361
|
watchingReadonly() {
|
|
9351
|
-
|
|
9352
|
-
(_b = (_a = this.listener).changed) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
9362
|
+
this.observer.publish();
|
|
9353
9363
|
}
|
|
9354
9364
|
async register() {
|
|
9355
9365
|
Input.formAdd(this);
|
|
@@ -9373,9 +9383,8 @@ const SmoothlyInputColor = class {
|
|
|
9373
9383
|
this.hsl = { h: undefined, s: undefined, l: undefined };
|
|
9374
9384
|
this.value = undefined;
|
|
9375
9385
|
}
|
|
9376
|
-
async listen(
|
|
9377
|
-
this.listener
|
|
9378
|
-
listener(this);
|
|
9386
|
+
async listen(listener) {
|
|
9387
|
+
this.observer.subscribe(listener);
|
|
9379
9388
|
}
|
|
9380
9389
|
async edit(editable) {
|
|
9381
9390
|
this.readonly = !editable;
|
|
@@ -9390,10 +9399,9 @@ const SmoothlyInputColor = class {
|
|
|
9390
9399
|
this.open = false;
|
|
9391
9400
|
}
|
|
9392
9401
|
async valueChanged() {
|
|
9393
|
-
var _a, _b;
|
|
9394
9402
|
this.changed = this.initialValue !== this.value;
|
|
9395
9403
|
this.smoothlyInput.emit({ [this.name]: await this.getValue() });
|
|
9396
|
-
|
|
9404
|
+
this.observer.publish();
|
|
9397
9405
|
}
|
|
9398
9406
|
handleSwitchMode(event) {
|
|
9399
9407
|
event.stopPropagation();
|
|
@@ -9450,7 +9458,7 @@ const SmoothlyInputColor = class {
|
|
|
9450
9458
|
}
|
|
9451
9459
|
render() {
|
|
9452
9460
|
var _a, _b, _c, _d, _e, _f;
|
|
9453
|
-
return (index.h(index.Host, { key: '
|
|
9461
|
+
return (index.h(index.Host, { key: 'be077545e01bc37aacf99975069cd4950327516b', style: {
|
|
9454
9462
|
"--hexCode": this.value,
|
|
9455
9463
|
"--rgb-r": `${Math.round((_a = this.rgb.r) !== null && _a !== void 0 ? _a : 0)}`,
|
|
9456
9464
|
"--rgb-g": `${Math.round((_b = this.rgb.g) !== null && _b !== void 0 ? _b : 0)}`,
|
|
@@ -9459,7 +9467,7 @@ const SmoothlyInputColor = class {
|
|
|
9459
9467
|
"--hsl-s": `${Math.round((_e = this.hsl.s) !== null && _e !== void 0 ? _e : 0)}%`,
|
|
9460
9468
|
"--hsl-l": `${Math.round((_f = this.hsl.l) !== null && _f !== void 0 ? _f : 0)}%`,
|
|
9461
9469
|
"--element-height": `${this.element.clientHeight}px`,
|
|
9462
|
-
} }, index.h("smoothly-input", { key: '
|
|
9470
|
+
} }, index.h("smoothly-input", { key: '4adc0864766d8a3135b9055aec0fca5f5d923ee1', value: this.value, color: this.color, looks: undefined, name: this.name, type: "hex-color", readonly: this.readonly, disabled: this.disabled, showLabel: this.showLabel, onSmoothlyInput: event => (event === null || event === void 0 ? void 0 : event.stopPropagation(), this.hexInputHandler(event.detail[this.name])) }, index.h("slot", { key: 'f920fa0859bbdf719f492fce7330b75612a236d8' })), index.h("div", { key: '63779154010069b1574f93aa92da66ae87f99736', class: "color-sample" }), index.h("smoothly-icon", { key: '8847fa69a7e0690ebdf4565ce1fead0e6542bde5', color: this.color, name: "options-outline", size: "small", onClick: () => !this.readonly && !this.disabled && this.openDropdown() }), index.h("div", { key: '24e555bf1ee6633d88a81bbca6da07fcbda867b3' }, index.h("slot", { key: '05e9074588200641ca27bd5c5cc3c74f7a4e55c7', name: "end" })), this.open && !this.readonly && !this.disabled && (index.h("div", { key: '604fdf0afed1c4dbc68007b20d96dda0860e6c4c', class: "rgb-sliders" }, index.h("smoothly-toggle-switch", { key: '2e422ab08c16385e7a41adcea211072439ff5c38', title: `${this.sliderMode === "rgb" ? "To HSL" : "To RGB"}`, onSmoothlyToggleSwitchChange: event => this.handleSwitchMode(event), size: "tiny", checkmark: false, selected: this.sliderMode === "hsl" }), Object.entries(this.rgb).map(([key, value]) => (index.h("smoothly-input-range", { style: this.sliderMode != "rgb" ? { display: "none" } : {}, name: key, min: 0, max: 255, color: undefined, type: "text", value: value, step: 1, outputSide: "right", onSmoothlyInput: event => this.sliderInputHandler(event), label: key.toUpperCase() }))), Object.entries(this.hsl).map(([key, value]) => (index.h("smoothly-input-range", { style: this.sliderMode != "hsl" ? { display: "none" } : {}, name: key, min: 0, max: key === "h" ? 359 : 1, color: undefined, type: key === "s" || key === "l" ? "percent" : "text", value: (key === "s" || key === "l") && value ? value / 100 : value, step: key === "s" || key === "l" ? 0.01 : 1, outputSide: "right", onSmoothlyInput: event => this.sliderInputHandler(event), label: key.toUpperCase() })))))));
|
|
9463
9471
|
}
|
|
9464
9472
|
get element() { return index.getElement(this); }
|
|
9465
9473
|
static get watchers() { return {
|
|
@@ -9492,7 +9500,7 @@ const SmoothlyInputDate = class {
|
|
|
9492
9500
|
this.smoothlyInput = index.createEvent(this, "smoothlyInput", 7);
|
|
9493
9501
|
this.smoothlyInputLooks = index.createEvent(this, "smoothlyInputLooks", 7);
|
|
9494
9502
|
this.smoothlyFormDisable = index.createEvent(this, "smoothlyFormDisable", 7);
|
|
9495
|
-
this.
|
|
9503
|
+
this.observer = Editable.Observer.create(this);
|
|
9496
9504
|
this.color = undefined;
|
|
9497
9505
|
this.looks = undefined;
|
|
9498
9506
|
this.name = undefined;
|
|
@@ -9508,12 +9516,11 @@ const SmoothlyInputDate = class {
|
|
|
9508
9516
|
this.showLabel = true;
|
|
9509
9517
|
}
|
|
9510
9518
|
componentWillLoad() {
|
|
9511
|
-
var _a, _b;
|
|
9512
9519
|
this.setInitialValue();
|
|
9513
9520
|
this.smoothlyInputLooks.emit((looks, color) => { var _a; return ((this.looks = (_a = this.looks) !== null && _a !== void 0 ? _a : looks), !this.color && (this.color = color)); });
|
|
9514
9521
|
this.smoothlyInputLoad.emit(parent => (this.parent = parent));
|
|
9515
9522
|
!this.readonly && this.smoothlyFormDisable.emit(readonly => (this.readonly = readonly));
|
|
9516
|
-
|
|
9523
|
+
this.observer.publish();
|
|
9517
9524
|
}
|
|
9518
9525
|
async disconnectedCallback() {
|
|
9519
9526
|
if (!this.element.isConnected)
|
|
@@ -9531,22 +9538,19 @@ const SmoothlyInputDate = class {
|
|
|
9531
9538
|
async getValue() {
|
|
9532
9539
|
return this.value;
|
|
9533
9540
|
}
|
|
9534
|
-
async listen(
|
|
9535
|
-
this.listener
|
|
9536
|
-
listener(this);
|
|
9541
|
+
async listen(listener) {
|
|
9542
|
+
this.observer.subscribe(listener);
|
|
9537
9543
|
}
|
|
9538
9544
|
async clear() {
|
|
9539
9545
|
this.value = undefined;
|
|
9540
9546
|
}
|
|
9541
9547
|
onStart(next) {
|
|
9542
|
-
var _a, _b;
|
|
9543
9548
|
this.smoothlyValueChange.emit(next);
|
|
9544
9549
|
this.smoothlyInput.emit({ [this.name]: next });
|
|
9545
|
-
|
|
9550
|
+
this.observer.publish();
|
|
9546
9551
|
}
|
|
9547
9552
|
watchingReadonly() {
|
|
9548
|
-
|
|
9549
|
-
(_b = (_a = this.listener).changed) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
9553
|
+
this.observer.publish();
|
|
9550
9554
|
}
|
|
9551
9555
|
smoothlyInputHandler(event) {
|
|
9552
9556
|
if (event.target != this.element)
|
|
@@ -9577,13 +9581,13 @@ const SmoothlyInputDate = class {
|
|
|
9577
9581
|
event.stopPropagation();
|
|
9578
9582
|
}
|
|
9579
9583
|
render() {
|
|
9580
|
-
return (index.h(index.Host, { key: '
|
|
9584
|
+
return (index.h(index.Host, { key: 'd69cd6d52d5ffc7bad35c916d3fe7f0781cd81bd' }, index.h("smoothly-input", { key: 'b92e19b7d941ca7cc4d72a4928c13bd5aae58409', color: this.color, looks: this.looks == "transparent" ? this.looks : undefined, name: this.name, onFocus: () => !this.readonly && !this.disabled && (this.open = !this.open), onClick: () => !this.readonly && !this.disabled && (this.open = !this.open), readonly: this.readonly, disabled: this.disabled, errorMessage: this.errorMessage, invalid: this.invalid, type: "date", value: this.value, showLabel: this.showLabel, onSmoothlyInputLoad: e => e.stopPropagation(), onSmoothlyInput: e => {
|
|
9581
9585
|
e.stopPropagation();
|
|
9582
9586
|
this.value = e.detail[this.name];
|
|
9583
|
-
} }, index.h("slot", { key: '
|
|
9587
|
+
} }, index.h("slot", { key: 'a4051271e461486a6329fd626f086345fb740ab3' })), index.h("span", { key: '727298b844fecca5bbae6582f9149a28a1d726e8', class: "icons" }, index.h("slot", { key: '0b80ee87cb05dbb6aac50f76807c687b90bcddd6', name: "end" })), this.open && !this.readonly && (index.h("nav", { key: '91eea6e297e5ac484720d6faaf996e3b00a33c1a' }, index.h("smoothly-calendar", { key: '34c91bd47ae15a865c8518ce7cc705cfe6415d54', doubleInput: false, value: this.value, onSmoothlyValueChange: event => {
|
|
9584
9588
|
this.value = event.detail;
|
|
9585
9589
|
event.stopPropagation();
|
|
9586
|
-
}, max: this.max, min: this.min }, index.h("div", { key: '
|
|
9590
|
+
}, max: this.max, min: this.min }, index.h("div", { key: 'ef4ad777432c718d372622bc74dfeffb69a18cc1', slot: "year-label" }, index.h("slot", { key: '9076bad2523c5294fb1eac2a556521c56910fc89', name: "year-label" })), index.h("div", { key: '40ecb34b8eb8fb164fb61c904f1fdc4ce97dfde5', slot: "month-label" }, index.h("slot", { key: '291c40aa6b03cbcb7a68d5d6d9e5b4692428ac02', name: "month-label" })))))));
|
|
9587
9591
|
}
|
|
9588
9592
|
get element() { return index.getElement(this); }
|
|
9589
9593
|
static get watchers() { return {
|
|
@@ -9605,7 +9609,7 @@ const SmoothlyInputDateRange = class {
|
|
|
9605
9609
|
this.smoothlyInputLoad = index.createEvent(this, "smoothlyInputLoad", 7);
|
|
9606
9610
|
this.smoothlyInputLooks = index.createEvent(this, "smoothlyInputLooks", 7);
|
|
9607
9611
|
this.smoothlyFormDisable = index.createEvent(this, "smoothlyFormDisable", 7);
|
|
9608
|
-
this.
|
|
9612
|
+
this.observer = Editable.Observer.create(this);
|
|
9609
9613
|
this.name = "dateRange";
|
|
9610
9614
|
this.color = undefined;
|
|
9611
9615
|
this.looks = undefined;
|
|
@@ -9623,14 +9627,13 @@ const SmoothlyInputDateRange = class {
|
|
|
9623
9627
|
this.open = undefined;
|
|
9624
9628
|
}
|
|
9625
9629
|
componentWillLoad() {
|
|
9626
|
-
var _a, _b;
|
|
9627
9630
|
this.setInitialValue();
|
|
9628
9631
|
this.updateValue();
|
|
9629
9632
|
this.smoothlyInputLooks.emit((looks, color) => { var _a; return ((this.looks = (_a = this.looks) !== null && _a !== void 0 ? _a : looks), !this.color && (this.color = color)); });
|
|
9630
9633
|
this.smoothlyInputLoad.emit(parent => (this.parent = parent));
|
|
9631
9634
|
this.start && this.end && this.smoothlyInput.emit({ [this.name]: { start: this.start, end: this.end } });
|
|
9632
9635
|
!this.readonly && this.smoothlyFormDisable.emit(readonly => (this.readonly = readonly));
|
|
9633
|
-
|
|
9636
|
+
this.observer.publish();
|
|
9634
9637
|
}
|
|
9635
9638
|
inputHandler(data) {
|
|
9636
9639
|
const split = "dateRangeInput" in data && typeof data.dateRangeInput == "string" && data.dateRangeInput.split(" - ");
|
|
@@ -9643,13 +9646,11 @@ const SmoothlyInputDateRange = class {
|
|
|
9643
9646
|
this.value = this.start && this.end ? { start: this.start, end: this.end } : undefined;
|
|
9644
9647
|
}
|
|
9645
9648
|
valueChanged() {
|
|
9646
|
-
var _a, _b;
|
|
9647
9649
|
this.changed = this.initialStart != this.start || this.initialEnd != this.end;
|
|
9648
|
-
|
|
9650
|
+
this.observer.publish();
|
|
9649
9651
|
}
|
|
9650
9652
|
watchingReadonly() {
|
|
9651
|
-
|
|
9652
|
-
(_b = (_a = this.listener).changed) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
9653
|
+
this.observer.publish();
|
|
9653
9654
|
}
|
|
9654
9655
|
smoothlyInputLoadHandler(event) {
|
|
9655
9656
|
Input.registerSubAction(this, event);
|
|
@@ -9677,9 +9678,8 @@ const SmoothlyInputDateRange = class {
|
|
|
9677
9678
|
async getValue() {
|
|
9678
9679
|
return this.start && this.end ? { start: this.start, end: this.end } : undefined;
|
|
9679
9680
|
}
|
|
9680
|
-
async listen(
|
|
9681
|
-
this.listener
|
|
9682
|
-
listener(this);
|
|
9681
|
+
async listen(listener) {
|
|
9682
|
+
this.observer.subscribe(listener);
|
|
9683
9683
|
}
|
|
9684
9684
|
async edit(editable) {
|
|
9685
9685
|
this.readonly = !editable;
|
|
@@ -9700,12 +9700,12 @@ const SmoothlyInputDateRange = class {
|
|
|
9700
9700
|
}
|
|
9701
9701
|
render() {
|
|
9702
9702
|
const locale = navigator.language;
|
|
9703
|
-
return (index.h(index.Host, { key: '
|
|
9703
|
+
return (index.h(index.Host, { key: '904c1e2d15a03af0dc32689061c8eb7cd4c04021', tabindex: this.disabled ? undefined : 0 }, index.h("section", { key: 'c55f0ee709378480d046c2ccf78609002be45fc7', onClick: () => !this.readonly && !this.disabled && (this.open = !this.open) }, index.h("smoothly-input", { key: '424a3cd79fe21242a2438d414062350ac92049ba', type: "text", name: "dateRangeInput", readonly: this.readonly, disabled: this.disabled, value: this.start && this.end
|
|
9704
9704
|
? `${format(this.start, "date", locale)} — ${format(this.end, "date", locale)}`
|
|
9705
9705
|
: undefined, invalid: this.invalid, placeholder: this.placeholder, showLabel: this.showLabel, onSmoothlyInput: e => {
|
|
9706
9706
|
e.stopPropagation();
|
|
9707
9707
|
this.inputHandler(e.detail);
|
|
9708
|
-
} }, index.h("slot", { key: '
|
|
9708
|
+
} }, index.h("slot", { key: 'f6f54308d2b805457be35bf61ee3fd6ad599e5d8' }))), index.h("span", { key: '5f6546933ab9e60e263891c45fd0bcf0daa8295f', class: "icons" }, index.h("slot", { key: 'a5428445ada79c37ff5f650e82ab4625e1507cee', name: "end" })), this.open && (index.h("nav", { key: 'be78a3fe4e0867d24125786503672de671600bbc' }, index.h("smoothly-calendar", { key: '5a622ba63f3340347dd925179395f5022b60e8c8', doubleInput: true, onSmoothlyValueChange: e => e.stopPropagation(), onSmoothlyStartChange: e => {
|
|
9709
9709
|
e.stopPropagation();
|
|
9710
9710
|
this.start = e.detail;
|
|
9711
9711
|
}, onSmoothlyEndChange: e => {
|
|
@@ -9740,7 +9740,7 @@ const SmoothlyInputDateTime = class {
|
|
|
9740
9740
|
this.smoothlyInput = index.createEvent(this, "smoothlyInput", 7);
|
|
9741
9741
|
this.smoothlyInputLooks = index.createEvent(this, "smoothlyInputLooks", 7);
|
|
9742
9742
|
this.smoothlyFormDisable = index.createEvent(this, "smoothlyFormDisable", 7);
|
|
9743
|
-
this.
|
|
9743
|
+
this.observer = Editable.Observer.create(this);
|
|
9744
9744
|
this.color = undefined;
|
|
9745
9745
|
this.looks = undefined;
|
|
9746
9746
|
this.name = undefined;
|
|
@@ -9759,12 +9759,11 @@ const SmoothlyInputDateTime = class {
|
|
|
9759
9759
|
this.minute = undefined;
|
|
9760
9760
|
}
|
|
9761
9761
|
componentWillLoad() {
|
|
9762
|
-
var _a, _b;
|
|
9763
9762
|
this.setInitialValue();
|
|
9764
9763
|
this.smoothlyInputLooks.emit((looks, color) => { var _a; return ((this.looks = (_a = this.looks) !== null && _a !== void 0 ? _a : looks), !this.color && (this.color = color)); });
|
|
9765
9764
|
this.smoothlyInputLoad.emit(parent => (this.parent = parent));
|
|
9766
9765
|
!this.readonly && this.smoothlyFormDisable.emit(readonly => (this.readonly = readonly));
|
|
9767
|
-
|
|
9766
|
+
this.observer.publish();
|
|
9768
9767
|
}
|
|
9769
9768
|
async disconnectedCallback() {
|
|
9770
9769
|
if (!this.element.isConnected)
|
|
@@ -9785,9 +9784,8 @@ const SmoothlyInputDateTime = class {
|
|
|
9785
9784
|
: undefined;
|
|
9786
9785
|
return TimeZone.DateTime.is(value) ? value : undefined;
|
|
9787
9786
|
}
|
|
9788
|
-
async listen(
|
|
9789
|
-
this.listener
|
|
9790
|
-
listener(this);
|
|
9787
|
+
async listen(listener) {
|
|
9788
|
+
this.observer.subscribe(listener);
|
|
9791
9789
|
}
|
|
9792
9790
|
async clear() {
|
|
9793
9791
|
this.value = undefined;
|
|
@@ -9796,14 +9794,12 @@ const SmoothlyInputDateTime = class {
|
|
|
9796
9794
|
this.minute = undefined;
|
|
9797
9795
|
}
|
|
9798
9796
|
async handleChange() {
|
|
9799
|
-
var _a, _b;
|
|
9800
9797
|
const value = await this.getValue();
|
|
9801
9798
|
this.smoothlyValueChange.emit(value);
|
|
9802
9799
|
this.smoothlyInput.emit({ [this.name]: value });
|
|
9803
|
-
|
|
9800
|
+
this.observer.publish();
|
|
9804
9801
|
}
|
|
9805
9802
|
valueChange(value) {
|
|
9806
|
-
var _a, _b;
|
|
9807
9803
|
if (TimeZone.DateTime.is(value)) {
|
|
9808
9804
|
this.date = TimeZone.DateTime.getDate(value);
|
|
9809
9805
|
this.hour = TimeZone.DateTime.getHour(value);
|
|
@@ -9811,11 +9807,10 @@ const SmoothlyInputDateTime = class {
|
|
|
9811
9807
|
}
|
|
9812
9808
|
this.smoothlyValueChange.emit(value);
|
|
9813
9809
|
this.smoothlyInput.emit({ [this.name]: value });
|
|
9814
|
-
|
|
9810
|
+
this.observer.publish();
|
|
9815
9811
|
}
|
|
9816
9812
|
watchingReadonly() {
|
|
9817
|
-
|
|
9818
|
-
(_b = (_a = this.listener).changed) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
9813
|
+
this.observer.publish();
|
|
9819
9814
|
}
|
|
9820
9815
|
smoothlyInputHandler(event) {
|
|
9821
9816
|
if (event.target != this.element)
|
|
@@ -9851,22 +9846,22 @@ const SmoothlyInputDateTime = class {
|
|
|
9851
9846
|
this.changed = false;
|
|
9852
9847
|
}
|
|
9853
9848
|
render() {
|
|
9854
|
-
return (index.h(index.Host, { key: '
|
|
9849
|
+
return (index.h(index.Host, { key: 'b62edf4ec82241f178230b6437a0bb8310e739eb' }, index.h("smoothly-input", { key: 'a2d514c20bd8aa429571f4bc426bdd7bf6e4efb3', color: this.color, looks: this.looks == "transparent" ? this.looks : undefined, name: "date", onFocus: () => !this.readonly && !this.disabled && (this.open = !this.open), onClick: () => !this.readonly && !this.disabled && (this.open = !this.open), readonly: this.readonly, disabled: this.disabled, type: "date", value: this.date, showLabel: this.showLabel, onSmoothlyInputLoad: e => e.stopPropagation(), onSmoothlyInput: e => {
|
|
9855
9850
|
e.stopPropagation();
|
|
9856
9851
|
this.date = e.detail.date;
|
|
9857
|
-
} }, index.h("slot", { key: '
|
|
9852
|
+
} }, index.h("slot", { key: '09155a628aa5902a8eb69dafafa52aa4e1b4b334' })), index.h("smoothly-input", { key: '2436383e1dd6d9d94899aeb50cf702656b5529de', name: "hour", type: "integer", max: 23, pad: 2, value: this.hour, readonly: this.readonly, disabled: this.disabled, placeholder: "hh", onSmoothlyInputLoad: e => e.stopPropagation(), onSmoothlyInput: e => {
|
|
9858
9853
|
e.stopPropagation();
|
|
9859
9854
|
this.hour = e.detail.hour;
|
|
9860
|
-
} }), index.h("span", { key: '
|
|
9855
|
+
} }), index.h("span", { key: '4a1d470871e94cd0346c12f409ca0d5100964b44', class: "colon" }, ":"), index.h("smoothly-input", { key: 'ca6ed49b251dab93f96080372f9e4e90c7ea57d9', name: "minute", type: "integer", max: 59, pad: 2, value: this.minute, readonly: this.readonly, disabled: this.disabled, placeholder: "mm", onSmoothlyInputLoad: e => e.stopPropagation(), onSmoothlyInput: e => {
|
|
9861
9856
|
e.stopPropagation();
|
|
9862
9857
|
this.minute = e.detail.minute;
|
|
9863
|
-
} }), index.h("span", { key: '
|
|
9858
|
+
} }), index.h("span", { key: 'deadce35d8d6921539f09f348ab42fde74f4d550', class: "icons" }, index.h("smoothly-icon", { key: '846cc166103806478ad080b89f598f15594fff92', class: "smoothly-invalid", name: "alert-circle", color: "danger", fill: "clear", size: "small", toolTip: this.errorMessage }), index.h("slot", { key: 'b358f111627d79ba1fcccd55838ea62340388e46', name: "end" })), this.open && !this.readonly && (index.h("nav", { key: '17445b9cdd49cb20cd58719ffe391f03ce50b583' }, index.h("smoothly-calendar", { key: '7a590b7c7f1281ee8e95f792483399c00edebd4f', doubleInput: false, value: this.value, min: this.min ? TimeZone.DateTime.getDate(this.min) : undefined, max: this.max ? TimeZone.DateTime.getDate(this.max) : undefined, onSmoothlyValueChange: e => {
|
|
9864
9859
|
this.date = e.detail;
|
|
9865
9860
|
e.stopPropagation();
|
|
9866
9861
|
}, onSmoothlyDateSet: e => {
|
|
9867
9862
|
this.open = false;
|
|
9868
9863
|
e.stopPropagation();
|
|
9869
|
-
} }, index.h("div", { key: '
|
|
9864
|
+
} }, index.h("div", { key: 'd92438e7c0c25f00c888916ab65a02e1b380b95d', slot: "year-label" }, index.h("slot", { key: '5f26a8e7c2f00bda65a1edab27353e6aa02e6d19', name: "year-label" })), index.h("div", { key: '3a3b6ee62f17acd8c915559cdea259fbced5971b', slot: "month-label" }, index.h("slot", { key: '304c3db5d497f329bd43cd55c308f2810febab61', name: "month-label" })))))));
|
|
9870
9865
|
}
|
|
9871
9866
|
get element() { return index.getElement(this); }
|
|
9872
9867
|
static get watchers() { return {
|
|
@@ -9954,7 +9949,7 @@ const SmoothlyInputEdit = class {
|
|
|
9954
9949
|
this.smoothlyInputLoad.emit(parent => {
|
|
9955
9950
|
if (Editable.type.is(parent)) {
|
|
9956
9951
|
this.parent = parent;
|
|
9957
|
-
parent.listen(
|
|
9952
|
+
parent.listen(async (p) => {
|
|
9958
9953
|
this.display = p.readonly;
|
|
9959
9954
|
});
|
|
9960
9955
|
}
|
|
@@ -9966,7 +9961,7 @@ const SmoothlyInputEdit = class {
|
|
|
9966
9961
|
}
|
|
9967
9962
|
render() {
|
|
9968
9963
|
var _a;
|
|
9969
|
-
return (index.h(index.Host, { key: '
|
|
9964
|
+
return (index.h(index.Host, { key: '8ebaa8909899e7a62fb654294369b40a4eee3abd', title: this.toolTip }, index.h("smoothly-button", { key: 'eea4da3ac5a525a1946cc09ca38fcd135f929231', disabled: this.disabled, size: this.size, type: "button", shape: this.shape, expand: this.expand, color: this.color, fill: (_a = this.fill) !== null && _a !== void 0 ? _a : (this.type == "input" ? "clear" : undefined) }, index.h("slot", { key: 'ac302e3629a8a24c58968a33e5da425b5a27e023' }), index.h("smoothly-icon", { key: 'af4a10eeee55d26d8c0736e9bf2b04e84684eec4', class: "default", name: "create-outline", size: "tiny" }))));
|
|
9970
9965
|
}
|
|
9971
9966
|
};
|
|
9972
9967
|
SmoothlyInputEdit.style = SmoothlyInputEditStyle0;
|
|
@@ -9981,7 +9976,7 @@ const SmoothlyInputFile = class {
|
|
|
9981
9976
|
this.smoothlyInput = index.createEvent(this, "smoothlyInput", 7);
|
|
9982
9977
|
this.smoothlyInputLoad = index.createEvent(this, "smoothlyInputLoad", 7);
|
|
9983
9978
|
this.smoothlyFormDisable = index.createEvent(this, "smoothlyFormDisable", 7);
|
|
9984
|
-
this.
|
|
9979
|
+
this.observer = Editable.Observer.create(this);
|
|
9985
9980
|
this.transfer = new DataTransfer();
|
|
9986
9981
|
this.changed = false;
|
|
9987
9982
|
this.readonly = false;
|
|
@@ -10006,6 +10001,7 @@ const SmoothlyInputFile = class {
|
|
|
10006
10001
|
this.smoothlyInput.emit({ [this.name]: await this.getValue() });
|
|
10007
10002
|
this.smoothlyInputLoad.emit(parent => (this.parent = parent));
|
|
10008
10003
|
!this.readonly && this.smoothlyFormDisable.emit(readonly => (this.readonly = readonly));
|
|
10004
|
+
this.observer.publish();
|
|
10009
10005
|
}
|
|
10010
10006
|
async disconnectedCallback() {
|
|
10011
10007
|
if (!this.element.isConnected)
|
|
@@ -10029,9 +10025,8 @@ const SmoothlyInputFile = class {
|
|
|
10029
10025
|
smoothlyInputLoadHandler(event) {
|
|
10030
10026
|
Input.registerSubAction(this, event);
|
|
10031
10027
|
}
|
|
10032
|
-
async listen(
|
|
10033
|
-
this.listener
|
|
10034
|
-
listener(this);
|
|
10028
|
+
async listen(listener) {
|
|
10029
|
+
this.observer.subscribe(listener);
|
|
10035
10030
|
}
|
|
10036
10031
|
async edit(editable) {
|
|
10037
10032
|
this.readonly = !editable;
|
|
@@ -10049,6 +10044,7 @@ const SmoothlyInputFile = class {
|
|
|
10049
10044
|
async valueChanged() {
|
|
10050
10045
|
this.changed = this.initialValue !== this.value;
|
|
10051
10046
|
this.smoothlyInput.emit({ [this.name]: await this.getValue() });
|
|
10047
|
+
this.observer.publish();
|
|
10052
10048
|
}
|
|
10053
10049
|
inputHandler(event) {
|
|
10054
10050
|
var _a, _b, _c;
|
|
@@ -10084,7 +10080,7 @@ const SmoothlyInputFile = class {
|
|
|
10084
10080
|
}
|
|
10085
10081
|
render() {
|
|
10086
10082
|
var _a, _b, _c;
|
|
10087
|
-
return (index.h(index.Host, { key: '
|
|
10083
|
+
return (index.h(index.Host, { key: '3fcd552780f72b36aa209e1df91ed3d510881851', class: { dragging: this.dragging, "has-value": !!this.value }, tabindex: this.disabled ? undefined : 0, onClick: (e) => this.clickHandler(e), onDragOver: (e) => this.dragOverHandler(e), onDragEnter: (e) => this.dragEnterHandler(e) }, index.h("label", { key: '64cb5d49549d2a608b4a67e77db6e03211c9e7e0' }, index.h("slot", { key: 'd6bf757bce81624bf72713889ffba3bbd23ce073', name: "label" })), index.h("div", { key: '23161938d05da2a09ebf5e53b744e4f8bf11c31b', class: "input" }, index.h("smoothly-button", { key: '59993dc93f5c91621a42710b783ebd8af41f77bb', disabled: this.disabled, type: "button", color: this.color, fill: "clear", size: "flexible" }, index.h("slot", { key: '4ac7897f6fbdf2e0ef93266f569c7b4d97ed2601', name: "button" })), index.h("span", { key: '53058bea1332e8ceb1de3e73ccffbd24db9d907c' }, (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : this.placeholder), index.h("div", { key: '62f98b97f191e6d24472ec859b1d759617eb1528', class: "drag-overlay", onDrop: e => this.dropHandler(e), onDragLeave: e => this.dragLeaveHandler(e) }, index.h("smoothly-icon", { key: '20ff77f16558baec3789b09aee6fed3bba339e98', name: "document-attach-outline" })), index.h("input", { key: '65c0715fdc4707f140ab3601932b00177ae65b02', onFocus: () => console.log("focus file input!"), ref: element => (this.input = element), type: "file", disabled: this.disabled, capture: this.camera == "back" ? "environment" : "user", accept: (_c = this.accept) !== null && _c !== void 0 ? _c : (!this.camera ? undefined : "image/jpeg"), files: this.files, onInput: e => this.inputHandler(e) })), index.h("div", { key: 'c92940123c0f0899f0e2e009aa6868b1b193dc55', class: "end", onClick: (e) => e.stopPropagation() }, index.h("slot", { key: '72ea4aa539cb9e72b1875f6b75d5498f3f6fa04a', name: "end" }))));
|
|
10088
10084
|
}
|
|
10089
10085
|
get element() { return index.getElement(this); }
|
|
10090
10086
|
static get watchers() { return {
|
|
@@ -10104,7 +10100,7 @@ const SmoothlyInputMonth = class {
|
|
|
10104
10100
|
this.smoothlyInputLoad = index.createEvent(this, "smoothlyInputLoad", 7);
|
|
10105
10101
|
this.smoothlyFormDisable = index.createEvent(this, "smoothlyFormDisable", 7);
|
|
10106
10102
|
this.smoothlyInputLooks = index.createEvent(this, "smoothlyInputLooks", 7);
|
|
10107
|
-
this.
|
|
10103
|
+
this.observer = Editable.Observer.create(this);
|
|
10108
10104
|
this.readonly = undefined;
|
|
10109
10105
|
this.color = undefined;
|
|
10110
10106
|
this.looks = undefined;
|
|
@@ -10169,9 +10165,8 @@ const SmoothlyInputMonth = class {
|
|
|
10169
10165
|
(_a = this.year) === null || _a === void 0 ? void 0 : _a.clear();
|
|
10170
10166
|
(_b = this.month) === null || _b === void 0 ? void 0 : _b.clear();
|
|
10171
10167
|
}
|
|
10172
|
-
async listen(
|
|
10173
|
-
this.listener
|
|
10174
|
-
listener(this);
|
|
10168
|
+
async listen(listener) {
|
|
10169
|
+
this.observer.subscribe(listener);
|
|
10175
10170
|
}
|
|
10176
10171
|
async edit(editable) {
|
|
10177
10172
|
this.readonly = !editable;
|
|
@@ -10209,9 +10204,9 @@ const SmoothlyInputMonth = class {
|
|
|
10209
10204
|
}
|
|
10210
10205
|
render() {
|
|
10211
10206
|
var _a, _b;
|
|
10212
|
-
return (index.h(index.Host, { key: '
|
|
10207
|
+
return (index.h(index.Host, { key: 'b0b371895f8814d99ec816202794541d23707330' }, index.h("smoothly-icon", { key: '5fc433c271b08d7a8960ef3848a83842ed1aad6d', name: "caret-back-outline", size: "tiny", color: this.color, fill: "default", class: {
|
|
10213
10208
|
disabled: this.readonly || !this.allowPreviousMonth,
|
|
10214
|
-
}, onClick: () => this.allowPreviousMonth && this.adjustMonth(-1) }), index.h("smoothly-input-select", { key: '
|
|
10209
|
+
}, onClick: () => this.allowPreviousMonth && this.adjustMonth(-1) }), index.h("smoothly-input-select", { key: 'c0d7d15c1122d6d56e02159f140acfbdd12b6aac', ref: e => (this.year = e), name: `${this.name}-year`, readonly: this.readonly, changed: this.changed, menuHeight: "5.5items", required: true, ordered: true, inCalendar: this.inCalendar, showLabel: this.showLabel, onSmoothlyInput: e => this.inputHandler(e), searchDisabled: true }, index.h("div", { key: 'e06d19e8abad104b04f727f92d56c224493c1948', slot: "label" }, index.h("slot", { key: '6e8cd6c34a1ba25bd2c8675bf46acb50d8403c30', name: "year-label" })), years((_a = this.value) !== null && _a !== void 0 ? _a : TimeZone.Date.now(), this.min, this.max).map(year => (index.h("smoothly-item", { key: year.date, value: year.date, selected: year.selected || this.value == year.date }, year.name)))), index.h("smoothly-input-select", { key: 'c8c22bbc649afb24ae9f21c8e02b659f5dec5c3a', ref: e => (this.month = e), name: `${this.name}-month`, readonly: this.readonly, color: this.color, looks: this.looks, changed: this.changed, menuHeight: "5.5items", required: true, ordered: true, inCalendar: this.inCalendar, showLabel: this.showLabel, onSmoothlyInput: e => this.inputHandler(e), searchDisabled: true }, index.h("div", { key: '8ed9c884883852cfa520c8439f398d6215fc1dad', slot: "label" }, index.h("slot", { key: 'c135c4f104ad829497972f6022b8b510ecbf31d4', name: "month-label" })), months((_b = this.value) !== null && _b !== void 0 ? _b : TimeZone.Date.now()).map(month => (index.h("smoothly-item", { key: month.date, value: month.date, selected: month.selected || this.value == month.date }, month.name)))), index.h("smoothly-icon", { key: 'c2c88b182e6886d10c6180e75b78948da0798849', name: "caret-forward-outline", size: "tiny", color: this.color, fill: "default", class: {
|
|
10215
10210
|
disabled: this.readonly || !this.allowNextMonth,
|
|
10216
10211
|
}, onClick: () => this.allowNextMonth && this.adjustMonth(1) })));
|
|
10217
10212
|
}
|
|
@@ -10251,7 +10246,7 @@ const SmoothlyInputRadio = class {
|
|
|
10251
10246
|
this.smoothlyInputLoad = index.createEvent(this, "smoothlyInputLoad", 7);
|
|
10252
10247
|
this.smoothlyFormDisable = index.createEvent(this, "smoothlyFormDisable", 7);
|
|
10253
10248
|
this.valueReceivedOnLoad = false;
|
|
10254
|
-
this.
|
|
10249
|
+
this.observer = Editable.Observer.create(this);
|
|
10255
10250
|
this.changed = false;
|
|
10256
10251
|
this.value = undefined;
|
|
10257
10252
|
this.looks = undefined;
|
|
@@ -10263,10 +10258,9 @@ const SmoothlyInputRadio = class {
|
|
|
10263
10258
|
this.showLabel = true;
|
|
10264
10259
|
}
|
|
10265
10260
|
componentWillLoad() {
|
|
10266
|
-
var _a, _b;
|
|
10267
10261
|
this.smoothlyInputLooks.emit((looks, color) => { var _a; return ((this.looks = (_a = this.looks) !== null && _a !== void 0 ? _a : looks), (this.color = color)); });
|
|
10268
10262
|
!this.readonly && this.smoothlyFormDisable.emit(readonly => (this.readonly = readonly));
|
|
10269
|
-
|
|
10263
|
+
this.observer.publish();
|
|
10270
10264
|
}
|
|
10271
10265
|
componentDidLoad() {
|
|
10272
10266
|
!this.valueReceivedOnLoad && this.smoothlyInput.emit({ [this.name]: this.value });
|
|
@@ -10295,9 +10289,8 @@ const SmoothlyInputRadio = class {
|
|
|
10295
10289
|
}
|
|
10296
10290
|
!this.valueReceivedOnLoad && (this.valueReceivedOnLoad = !this.valueReceivedOnLoad);
|
|
10297
10291
|
}
|
|
10298
|
-
async listen(
|
|
10299
|
-
this.listener
|
|
10300
|
-
listener(this);
|
|
10292
|
+
async listen(listener) {
|
|
10293
|
+
this.observer.subscribe(listener);
|
|
10301
10294
|
}
|
|
10302
10295
|
async disconnectedCallback() {
|
|
10303
10296
|
if (!this.element.isConnected)
|
|
@@ -10338,17 +10331,16 @@ const SmoothlyInputRadio = class {
|
|
|
10338
10331
|
this.valueChanged();
|
|
10339
10332
|
}
|
|
10340
10333
|
async valueChanged() {
|
|
10341
|
-
var _a
|
|
10334
|
+
var _a;
|
|
10342
10335
|
this.valueReceivedOnLoad && (this.changed = ((_a = this.initialValue) === null || _a === void 0 ? void 0 : _a.value) !== this.value);
|
|
10343
10336
|
this.smoothlyInput.emit({ [this.name]: await this.getValue() });
|
|
10344
|
-
|
|
10337
|
+
this.observer.publish();
|
|
10345
10338
|
}
|
|
10346
10339
|
watchingReadonly() {
|
|
10347
|
-
|
|
10348
|
-
(_b = (_a = this.listener).changed) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
10340
|
+
this.observer.publish();
|
|
10349
10341
|
}
|
|
10350
10342
|
render() {
|
|
10351
|
-
return (index.h(index.Host, { key: '
|
|
10343
|
+
return (index.h(index.Host, { key: 'b7c1455b07889830d666e6c0f8719f3617904dd9', class: "floating-label" }, index.h("slot", { key: '5a2c9f16b1b016d9a4962389a4c7d92431bf05f8', name: "start" }), index.h("div", { key: '04302d58a80fc76da61948ab97fad81c66579d5a' }, index.h("slot", { key: '5d2cd7ae129747a44d22da8e8f49ed336d3d358a', name: "label" }), index.h("div", { key: 'a28ba62a97a14a8a6978018bacb77f466f6edefb', class: "options" }, index.h("slot", { key: '9db948375488c32487a7eae6e28b7d8961d95882' }))), index.h("slot", { key: 'c708ce2b807d938ae94c9602a38376773f910a05', name: "end" })));
|
|
10352
10344
|
}
|
|
10353
10345
|
get element() { return index.getElement(this); }
|
|
10354
10346
|
static get watchers() { return {
|
|
@@ -10397,7 +10389,7 @@ const SmoothlyInputRange = class {
|
|
|
10397
10389
|
this.smoothlyInput = index.createEvent(this, "smoothlyInput", 7);
|
|
10398
10390
|
this.smoothlyInputLoad = index.createEvent(this, "smoothlyInputLoad", 7);
|
|
10399
10391
|
this.smoothlyFormDisable = index.createEvent(this, "smoothlyFormDisable", 7);
|
|
10400
|
-
this.
|
|
10392
|
+
this.observer = Editable.Observer.create(this);
|
|
10401
10393
|
this.initialValue = undefined;
|
|
10402
10394
|
this.value = undefined;
|
|
10403
10395
|
this.looks = undefined;
|
|
@@ -10452,9 +10444,8 @@ const SmoothlyInputRange = class {
|
|
|
10452
10444
|
async clear() {
|
|
10453
10445
|
this.value = undefined;
|
|
10454
10446
|
}
|
|
10455
|
-
async listen(
|
|
10456
|
-
this.listener
|
|
10457
|
-
listener(this);
|
|
10447
|
+
async listen(listener) {
|
|
10448
|
+
this.observer.subscribe(listener);
|
|
10458
10449
|
}
|
|
10459
10450
|
async edit(editable) {
|
|
10460
10451
|
this.readonly = !editable;
|
|
@@ -10467,17 +10458,16 @@ const SmoothlyInputRange = class {
|
|
|
10467
10458
|
this.valueChanged();
|
|
10468
10459
|
}
|
|
10469
10460
|
valueChanged() {
|
|
10470
|
-
var _a, _b
|
|
10461
|
+
var _a, _b;
|
|
10471
10462
|
const decimals = !this.step ? undefined : (_b = (_a = this.step.toString().split(".")[1]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
10472
10463
|
this.value = Number.isNaN(this.value) || this.value == undefined ? undefined : +this.value.toFixed(decimals);
|
|
10473
10464
|
this.changed = this.initialValue !== this.value;
|
|
10474
10465
|
this.defined = typeof this.value === "number";
|
|
10475
|
-
|
|
10466
|
+
this.observer.publish();
|
|
10476
10467
|
this.smoothlyInput.emit({ [this.name]: this.value });
|
|
10477
10468
|
}
|
|
10478
10469
|
watchingReadonly() {
|
|
10479
|
-
|
|
10480
|
-
(_b = (_a = this.listener).changed) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
10470
|
+
this.observer.publish();
|
|
10481
10471
|
}
|
|
10482
10472
|
setValue(value) {
|
|
10483
10473
|
var _a;
|
|
@@ -10493,17 +10483,17 @@ const SmoothlyInputRange = class {
|
|
|
10493
10483
|
}
|
|
10494
10484
|
render() {
|
|
10495
10485
|
var _a, _b, _c;
|
|
10496
|
-
return (index.h(index.Host, { key: '
|
|
10486
|
+
return (index.h(index.Host, { key: 'f5c73554489c4365f596dfc3acc0c3c0e126b8cf', class: {
|
|
10497
10487
|
"output-side-right": this.outputSide === "right",
|
|
10498
10488
|
"show-label": this.outputSide === "left" && !!this.label,
|
|
10499
|
-
} }, index.h("slot", { key: '
|
|
10489
|
+
} }, index.h("slot", { key: '871f8ade02e022cb67f6fef41aa654d54ef71746', name: "start" }), index.h("div", { key: 'c8de031ab411b24cfe347d6b920bd65b2c78f8c5' }, index.h("label", { key: '1e10e72beb32359ed38e0c232eeff7d7fb432168', htmlFor: this.name }, this.label), index.h("smoothly-input", { key: '53ee4a0653cd3eff5e4c10a57b3ef295ec61390a', ref: e => (this.input = e), looks: undefined, color: this.color, name: this.name, showLabel: this.outputSide === "left" && !!this.label, type: this.type, onSmoothlyInputLoad: async (e) => (e.stopPropagation(),
|
|
10500
10490
|
this.setValue(Input.Element.is(e.target) ? Number(await e.target.getValue()) : undefined)), onSmoothlyBlur: e => e.stopPropagation(), onSmoothlyInput: async (e) => {
|
|
10501
10491
|
e.stopPropagation();
|
|
10502
10492
|
this.setValue(Input.Element.is(e.target) ? Number(await e.target.getValue()) : undefined);
|
|
10503
|
-
}, value: this.type == "percent" ? this.value : (_a = this.value) === null || _a === void 0 ? void 0 : _a.toString(), placeholder: this.outputSide === "right" ? "-" : undefined, readonly: this.readonly, disabled: this.disabled }, this.label), index.h("smoothly-display", { key: '
|
|
10493
|
+
}, value: this.type == "percent" ? this.value : (_a = this.value) === null || _a === void 0 ? void 0 : _a.toString(), placeholder: this.outputSide === "right" ? "-" : undefined, readonly: this.readonly, disabled: this.disabled }, this.label), index.h("smoothly-display", { key: '035983bbe36c0c5d2f5c6c0d1a4d2ca9162cab25', label: (this.type == "percent" ? this.min * 100 : this.min).toString() }), index.h("input", { key: 'de7e00ec27fa44624d6c5efb83edc1d9028108cf', name: this.name, part: "range", type: "range", min: this.min, max: this.max, step: (_b = this.step) !== null && _b !== void 0 ? _b : "any", disabled: this.readonly || this.disabled, onInput: event => {
|
|
10504
10494
|
event.stopPropagation();
|
|
10505
10495
|
this.setValue(event.target.valueAsNumber);
|
|
10506
|
-
}, value: (_c = this.value) !== null && _c !== void 0 ? _c : this.min }), index.h("smoothly-display", { key: '
|
|
10496
|
+
}, value: (_c = this.value) !== null && _c !== void 0 ? _c : this.min }), index.h("smoothly-display", { key: 'd5e9d3fa21f133737fb31c64ba4da153f81b73d7', label: (this.type == "percent" ? this.max * 100 : this.max).toString() })), index.h("slot", { key: 'de8681886a7180a275b33d84a83864ffab34e4f7', name: "end" })));
|
|
10507
10497
|
}
|
|
10508
10498
|
get element() { return index.getElement(this); }
|
|
10509
10499
|
static get watchers() { return {
|
|
@@ -10546,7 +10536,7 @@ const SmoothlyInputReset = class {
|
|
|
10546
10536
|
if (Editable.Element.type.is(parent)) {
|
|
10547
10537
|
this.parent = parent;
|
|
10548
10538
|
this.readonlyAtLoad = parent.readonly;
|
|
10549
|
-
parent.listen(
|
|
10539
|
+
parent.listen(async (p) => {
|
|
10550
10540
|
if (Input.is(p)) {
|
|
10551
10541
|
this.display = p.readonly || p.defined ? false : p.changed;
|
|
10552
10542
|
}
|
|
@@ -10566,7 +10556,7 @@ const SmoothlyInputReset = class {
|
|
|
10566
10556
|
}
|
|
10567
10557
|
render() {
|
|
10568
10558
|
var _a;
|
|
10569
|
-
return (index.h(index.Host, { key: '
|
|
10559
|
+
return (index.h(index.Host, { key: 'cfcb512f27ac8aa99bb70dd5e735228ca0f833fc', title: this.tooltip }, index.h("smoothly-button", { key: '55e33bb0c597866cef32db38fc1e64d49b34d904', disabled: this.disabled, size: this.size, type: "button", shape: this.shape, expand: this.expand, color: this.color, fill: (_a = this.fill) !== null && _a !== void 0 ? _a : (this.type == "input" ? "clear" : undefined), onClick: event => this.clickHandler(event) }, index.h("slot", { key: '90b9c41bc16365cb62da1c3da70a70714215f200' }), index.h("smoothly-icon", { key: '971b9fe933fbefebc6df394e711518400d7c0b3d', flip: "x", name: "refresh-outline", size: "tiny" }))));
|
|
10570
10560
|
}
|
|
10571
10561
|
};
|
|
10572
10562
|
SmoothlyInputReset.style = SmoothlyInputResetStyle0;
|
|
@@ -10600,7 +10590,7 @@ const SmoothlyInputSelect = class {
|
|
|
10600
10590
|
this.smoothlyItemSelect = index.createEvent(this, "smoothlyItemSelect", 7);
|
|
10601
10591
|
this.initialValue = [];
|
|
10602
10592
|
this.initialValueHandled = false;
|
|
10603
|
-
this.
|
|
10593
|
+
this.observer = Editable.Observer.create(this);
|
|
10604
10594
|
this.items = [];
|
|
10605
10595
|
this.lastOpen = false;
|
|
10606
10596
|
this.invalid = false;
|
|
@@ -10629,11 +10619,10 @@ const SmoothlyInputSelect = class {
|
|
|
10629
10619
|
this.addedItems = [];
|
|
10630
10620
|
}
|
|
10631
10621
|
componentWillLoad() {
|
|
10632
|
-
var _a, _b;
|
|
10633
10622
|
this.smoothlyInputLooks.emit((looks, color) => { var _a; return ((this.looks = (_a = this.looks) !== null && _a !== void 0 ? _a : looks), !this.color && (this.color = color)); });
|
|
10634
10623
|
this.smoothlyInputLoad.emit(parent => (this.parent = parent));
|
|
10635
10624
|
!this.readonly && this.smoothlyFormDisable.emit(readonly => (this.readonly = readonly));
|
|
10636
|
-
|
|
10625
|
+
this.observer.publish();
|
|
10637
10626
|
}
|
|
10638
10627
|
componentDidLoad() {
|
|
10639
10628
|
this.selected && !this.initialValueHandled && (this.initialValue = [...this.selected]);
|
|
@@ -10676,9 +10665,8 @@ const SmoothlyInputSelect = class {
|
|
|
10676
10665
|
async getItems() {
|
|
10677
10666
|
return this.items;
|
|
10678
10667
|
}
|
|
10679
|
-
async listen(
|
|
10680
|
-
this.listener
|
|
10681
|
-
listener(this);
|
|
10668
|
+
async listen(listener) {
|
|
10669
|
+
this.observer.subscribe(listener);
|
|
10682
10670
|
}
|
|
10683
10671
|
async reset() {
|
|
10684
10672
|
this.selected.forEach(item => (item.selected = item.hidden = false));
|
|
@@ -10706,11 +10694,10 @@ const SmoothlyInputSelect = class {
|
|
|
10706
10694
|
this.initialValue = [...this.selected];
|
|
10707
10695
|
}
|
|
10708
10696
|
async onSelectedChange() {
|
|
10709
|
-
var _a, _b;
|
|
10710
10697
|
this.initialValueHandled && (this.changed = !this.areValuesEqual(this.selected, this.initialValue));
|
|
10711
10698
|
this.defined = this.selected.length > 0;
|
|
10712
10699
|
this.smoothlyInput.emit({ [this.name]: await this.getValue() });
|
|
10713
|
-
|
|
10700
|
+
this.observer.publish();
|
|
10714
10701
|
}
|
|
10715
10702
|
onRequiredChange() {
|
|
10716
10703
|
this.items.forEach(item => (item.deselectable = !this.required));
|
|
@@ -10720,8 +10707,7 @@ const SmoothlyInputSelect = class {
|
|
|
10720
10707
|
await Promise.all(this.items.map(item => item.filter(value)));
|
|
10721
10708
|
}
|
|
10722
10709
|
watchingReadonly() {
|
|
10723
|
-
|
|
10724
|
-
(_b = (_a = this.listener).changed) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
10710
|
+
this.observer.publish();
|
|
10725
10711
|
}
|
|
10726
10712
|
async smoothlyInputLoadHandler(event) {
|
|
10727
10713
|
if (event.target &&
|
|
@@ -10879,14 +10865,14 @@ const SmoothlyInputSelect = class {
|
|
|
10879
10865
|
this.addedItems = this.addedItems.concat(index.h("smoothly-item", { value: this.filter, selected: true }, this.filter));
|
|
10880
10866
|
}
|
|
10881
10867
|
render() {
|
|
10882
|
-
return (index.h(index.Host, { key: '
|
|
10868
|
+
return (index.h(index.Host, { key: 'c4c39905e1c703d86dd2b716bbc085025640ed4d', tabIndex: this.disabled ? undefined : 0, class: { "has-value": this.selected.length !== 0, open: this.open }, onClick: (event) => this.handleShowOptions(event) }, index.h("div", { key: '0f79512aff08e3b6fc2db109ee3e793432590c16', class: "select-display", ref: element => (this.displaySelectedElement = element) }, this.placeholder), index.h("div", { key: '1d99b6e3373ea293ba11267bde0b8ca6158ff3c5', class: "icons", ref: element => (this.iconsDiv = element) }, index.h("smoothly-icon", { key: 'fbb39d312f55c8e02d6a180cb81cd02e6fef7de5', class: "smoothly-invalid", name: "alert-circle", color: "danger", fill: "clear", size: "small", toolTip: this.errorMessage }), index.h("slot", { key: '934597ba325b7c2f63e6b1db65fe9423f29211b2', name: "end" }), this.looks == "border" && !this.readonly && (index.h("smoothly-icon", { key: '89ac02e9873174cc7ec564c60b15e62b099d2288', ref: element => (this.toggle = element), size: "tiny", name: this.open ? "caret-down-outline" : "caret-forward-outline" }))), index.h("slot", { key: 'aa23ef1f815c43637a5e66adf47c29774fa9f28c', name: "label" }), index.h("div", { key: '3917b3caee7654ee32553c53bdcc9d8ec1702f5e', class: { hidden: !this.open, options: true }, ref: (el) => (this.optionsDiv = el) }, this.filter.length > 0 && (index.h("div", { key: 'c3fcd083cdd8a4653ea0691b6bdb22e677b29903', class: "search-preview" }, index.h("smoothly-icon", { key: 'b60a35138ee592ecc1f1437362d684c2de2f883a', name: "search-outline", size: "small" }), this.filter, index.h("smoothly-icon", { key: '39801ad4f09cdc3f52bdec75168b74fca4cb4bc2', name: "backspace-outline", size: "small", onClick: e => {
|
|
10883
10869
|
e.stopPropagation();
|
|
10884
10870
|
this.filter = "";
|
|
10885
10871
|
this.element.focus();
|
|
10886
|
-
} }), this.mutable && (index.h("smoothly-icon", { key: '
|
|
10872
|
+
} }), this.mutable && (index.h("smoothly-icon", { key: '526ca5628a7b6d3e481cb963544fe016481af876', name: "add", size: "small", onClick: e => {
|
|
10887
10873
|
e.stopPropagation();
|
|
10888
10874
|
this.addItem();
|
|
10889
|
-
} })))), index.h("slot", { key: '
|
|
10875
|
+
} })))), index.h("slot", { key: 'c5586da9bfefb3d88e5336147c1dc4105556fcd6' }), this.addedItems)));
|
|
10890
10876
|
}
|
|
10891
10877
|
get element() { return index.getElement(this); }
|
|
10892
10878
|
static get watchers() { return {
|
|
@@ -10923,7 +10909,7 @@ const SmoothlyInputSubmit = class {
|
|
|
10923
10909
|
this.smoothlyInputLoad.emit(parent => {
|
|
10924
10910
|
if (Submittable.Submittable.is(parent) && Editable.type.is(parent)) {
|
|
10925
10911
|
this.parent = parent;
|
|
10926
|
-
parent.listen(
|
|
10912
|
+
parent.listen(async (p) => {
|
|
10927
10913
|
var _a;
|
|
10928
10914
|
this.display = !p.readonly;
|
|
10929
10915
|
this.disabled =
|
|
@@ -10941,7 +10927,7 @@ const SmoothlyInputSubmit = class {
|
|
|
10941
10927
|
}
|
|
10942
10928
|
render() {
|
|
10943
10929
|
var _a, _b;
|
|
10944
|
-
return (index.h(index.Host, { key: '
|
|
10930
|
+
return (index.h(index.Host, { key: 'eb9eedb06745479c999e28f157791e5ba6a72c15', title: this.toolTip }, this.delete == true ? (index.h("smoothly-button-confirm", { size: this.size, shape: this.shape, expand: this.expand, color: (_a = this.color) !== null && _a !== void 0 ? _a : "danger", fill: this.fill, onSmoothlyConfirm: () => this.clickHandler() }, index.h("slot", null), index.h("smoothly-icon", { name: "trash-outline", fill: "solid", size: "tiny" }))) : (index.h("smoothly-button", { disabled: this.disabled, size: this.size, type: "button", shape: this.shape, expand: this.expand, color: (_b = this.color) !== null && _b !== void 0 ? _b : "success", fill: this.fill, onClick: () => this.clickHandler() }, index.h("slot", null), this.icon && index.h("smoothly-icon", { name: this.icon, fill: "solid", size: "tiny" })))));
|
|
10945
10931
|
}
|
|
10946
10932
|
};
|
|
10947
10933
|
SmoothlyInputSubmit.style = SmoothlyInputSubmitStyle0;
|