iss-ctrl 0.0.16 → 0.0.17
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/fesm2022/{iss-ctrl-iss-ctrl-CUlx5aua.mjs → iss-ctrl-iss-ctrl-BHW3shB0.mjs} +42 -20
- package/fesm2022/iss-ctrl-iss-ctrl-BHW3shB0.mjs.map +1 -0
- package/fesm2022/{iss-ctrl-load-event-B2HY44Lg.mjs → iss-ctrl-load-event-BBKfb4GM.mjs} +3 -3
- package/fesm2022/{iss-ctrl-load-event-B2HY44Lg.mjs.map → iss-ctrl-load-event-BBKfb4GM.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-load-options-event-Bvfi4PZq.mjs → iss-ctrl-load-options-event-jsZAQloX.mjs} +3 -3
- package/fesm2022/{iss-ctrl-load-options-event-Bvfi4PZq.mjs.map → iss-ctrl-load-options-event-jsZAQloX.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-load-value-event-Bq6nRj3K.mjs → iss-ctrl-load-value-event-ClkNTtds.mjs} +3 -3
- package/fesm2022/{iss-ctrl-load-value-event-Bq6nRj3K.mjs.map → iss-ctrl-load-value-event-ClkNTtds.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-note.field-DpXXdNd0.mjs → iss-ctrl-note.field-Co2Og2eO.mjs} +2 -2
- package/fesm2022/{iss-ctrl-note.field-DpXXdNd0.mjs.map → iss-ctrl-note.field-Co2Og2eO.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-replace-api-keys-Dbdwgl4g.mjs → iss-ctrl-replace-api-keys-Bx7wo5zl.mjs} +2 -2
- package/fesm2022/{iss-ctrl-replace-api-keys-Dbdwgl4g.mjs.map → iss-ctrl-replace-api-keys-Bx7wo5zl.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-set-value-event-CXVuywEr.mjs → iss-ctrl-set-value-event-D38jsLlO.mjs} +2 -2
- package/fesm2022/{iss-ctrl-set-value-event-CXVuywEr.mjs.map → iss-ctrl-set-value-event-D38jsLlO.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-table.field-C5SDeghW.mjs → iss-ctrl-table.field-BcuL_fSr.mjs} +2 -2
- package/fesm2022/{iss-ctrl-table.field-C5SDeghW.mjs.map → iss-ctrl-table.field-BcuL_fSr.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-trigger-based-on-json-value-Ck642ldN.mjs → iss-ctrl-trigger-based-on-json-value-B6M5dYnm.mjs} +2 -2
- package/fesm2022/{iss-ctrl-trigger-based-on-json-value-Ck642ldN.mjs.map → iss-ctrl-trigger-based-on-json-value-B6M5dYnm.mjs.map} +1 -1
- package/fesm2022/{iss-ctrl-user-picker.field-69Tqgu2G.mjs → iss-ctrl-user-picker.field-BCd6g9jz.mjs} +2 -2
- package/fesm2022/{iss-ctrl-user-picker.field-69Tqgu2G.mjs.map → iss-ctrl-user-picker.field-BCd6g9jz.mjs.map} +1 -1
- package/fesm2022/iss-ctrl.mjs +1 -1
- package/package.json +1 -1
- package/types/iss-ctrl.d.ts +11 -0
- package/upgrade.scss +108 -75
- package/fesm2022/iss-ctrl-iss-ctrl-CUlx5aua.mjs.map +0 -1
|
@@ -167,6 +167,21 @@ class ControlBase {
|
|
|
167
167
|
this.touched.set(true);
|
|
168
168
|
this.onTouch();
|
|
169
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Whether the control currently holds no value.
|
|
172
|
+
*
|
|
173
|
+
* Reflected on the host as `iss-ctrl-empty`, which is what `upgrade.scss` uses to keep the
|
|
174
|
+
* resting outline of an empty field: Material's own `mat-form-field-hide-placeholder` drops
|
|
175
|
+
* off the moment the field is focused, so the border would change colour on focus alone.
|
|
176
|
+
* Override it in a control whose value does not live on {@link ControlBase.ctrl}.
|
|
177
|
+
*/
|
|
178
|
+
isEmpty() {
|
|
179
|
+
const value = this.ctrl.getRawValue();
|
|
180
|
+
if (Array.isArray(value)) {
|
|
181
|
+
return value.length === 0;
|
|
182
|
+
}
|
|
183
|
+
return value === null || value === undefined || value === "";
|
|
184
|
+
}
|
|
170
185
|
validate(control) {
|
|
171
186
|
return this.ctrl.errors;
|
|
172
187
|
}
|
|
@@ -195,11 +210,14 @@ class ControlBase {
|
|
|
195
210
|
this.onChange.emit(emissionValue);
|
|
196
211
|
}
|
|
197
212
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ControlBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
198
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: ControlBase, isStandalone: true, selector: "ng-component", inputs: { formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, hints: { classPropertyName: "hints", publicName: "hints", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onChange: "onChange" }, ngImport: i0, template: ``, isInline: true });
|
|
213
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: ControlBase, isStandalone: true, selector: "ng-component", inputs: { formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, hints: { classPropertyName: "hints", publicName: "hints", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onChange: "onChange" }, host: { properties: { "class.iss-ctrl-empty": "isEmpty()" } }, ngImport: i0, template: ``, isInline: true });
|
|
199
214
|
}
|
|
200
215
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ControlBase, decorators: [{
|
|
201
216
|
type: Component,
|
|
202
|
-
args: [{
|
|
217
|
+
args: [{
|
|
218
|
+
template: ``,
|
|
219
|
+
host: { "[class.iss-ctrl-empty]": "isEmpty()" }
|
|
220
|
+
}]
|
|
203
221
|
}], propDecorators: { formControlName: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControlName", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], minLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minLength", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hints: [{ type: i0.Input, args: [{ isSignal: true, alias: "hints", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], onChange: [{ type: i0.Output, args: ["onChange"] }] } });
|
|
204
222
|
|
|
205
223
|
/**
|
|
@@ -363,6 +381,10 @@ class ChipsControl extends ControlBase {
|
|
|
363
381
|
this.keywords.set([]);
|
|
364
382
|
}
|
|
365
383
|
}
|
|
384
|
+
// the chips are the value here; `ctrl` stays untouched
|
|
385
|
+
isEmpty() {
|
|
386
|
+
return this.keywords().length === 0;
|
|
387
|
+
}
|
|
366
388
|
remove(keyword) {
|
|
367
389
|
if (this.disabled() || this.readonly()) {
|
|
368
390
|
return;
|
|
@@ -1092,6 +1114,11 @@ class DateRangePickerControl extends ControlBase {
|
|
|
1092
1114
|
this.onDateRangeObjectChange.emit(this.#getEmissionObject(values.start, values.end));
|
|
1093
1115
|
}));
|
|
1094
1116
|
}
|
|
1117
|
+
// the endpoints live on `range`; `ctrl` only holds the emitted value of a complete range
|
|
1118
|
+
isEmpty() {
|
|
1119
|
+
const { start, end } = this.range.getRawValue();
|
|
1120
|
+
return !start && !end;
|
|
1121
|
+
}
|
|
1095
1122
|
setDisabledState(isDisabled) {
|
|
1096
1123
|
super.setDisabledState(isDisabled);
|
|
1097
1124
|
// the template binds `range`, disabling ctrl alone leaves the inputs live
|
|
@@ -6356,22 +6383,22 @@ const COMPONENTS = {
|
|
|
6356
6383
|
datetime: () => Promise.resolve().then(function () { return datetimePicker_field; }).then((c) => c.DatetimePickerField),
|
|
6357
6384
|
date_range: () => Promise.resolve().then(function () { return dateRangePicker_field; }).then((c) => c.DateRangePickerField),
|
|
6358
6385
|
attachment: () => Promise.resolve().then(function () { return filePicker_field; }).then((c) => c.FilePickerField),
|
|
6359
|
-
userPicker: () => import('./iss-ctrl-user-picker.field-
|
|
6386
|
+
userPicker: () => import('./iss-ctrl-user-picker.field-BCd6g9jz.mjs').then((c) => c.UserPickerField),
|
|
6360
6387
|
vehicle_plate: () => Promise.resolve().then(function () { return plate_field; }).then((c) => c.PlateField),
|
|
6361
|
-
enrichment: () => import('./iss-ctrl-note.field-
|
|
6388
|
+
enrichment: () => import('./iss-ctrl-note.field-Co2Og2eO.mjs').then((c) => c.NoteField),
|
|
6362
6389
|
mobile: () => Promise.resolve().then(function () { return mobile_field; }).then((c) => c.MobileField),
|
|
6363
|
-
table: () => import('./iss-ctrl-table.field-
|
|
6390
|
+
table: () => import('./iss-ctrl-table.field-BcuL_fSr.mjs').then((c) => c.TableField),
|
|
6364
6391
|
chips: () => Promise.resolve().then(function () { return chips_field; }).then((c) => c.ChipsField),
|
|
6365
6392
|
switch: () => Promise.resolve().then(function () { return slideToggle_field; }).then((c) => c.SlideToggleField),
|
|
6366
6393
|
};
|
|
6367
6394
|
|
|
6368
6395
|
const SERVICES = {
|
|
6369
|
-
setValue: () => import('./iss-ctrl-set-value-event-
|
|
6396
|
+
setValue: () => import('./iss-ctrl-set-value-event-D38jsLlO.mjs').then((s) => s.SetValueEvent),
|
|
6370
6397
|
show: () => import('./iss-ctrl-show-event-BcRCwAfo.mjs').then((s) => s.ShowEvent),
|
|
6371
|
-
load: () => import('./iss-ctrl-load-value-event-
|
|
6372
|
-
loadOptions: () => import('./iss-ctrl-load-options-event-
|
|
6373
|
-
triggerBasedOnJsonValue: () => import('./iss-ctrl-trigger-based-on-json-value-
|
|
6374
|
-
replaceApiKeyDefaultImpl: () => import('./iss-ctrl-replace-api-keys-
|
|
6398
|
+
load: () => import('./iss-ctrl-load-value-event-ClkNTtds.mjs').then((s) => s.LoadValueEvent),
|
|
6399
|
+
loadOptions: () => import('./iss-ctrl-load-options-event-jsZAQloX.mjs').then((s) => s.LoadOptionsEvent),
|
|
6400
|
+
triggerBasedOnJsonValue: () => import('./iss-ctrl-trigger-based-on-json-value-B6M5dYnm.mjs').then((s) => s.TriggerBasedOnJsonValue),
|
|
6401
|
+
replaceApiKeyDefaultImpl: () => import('./iss-ctrl-replace-api-keys-Bx7wo5zl.mjs').then((s) => s.ReplaceApiKeys),
|
|
6375
6402
|
};
|
|
6376
6403
|
|
|
6377
6404
|
// Read-only counterpart of COMPONENTS: the component used to render a field's value
|
|
@@ -6594,19 +6621,15 @@ class Outlet {
|
|
|
6594
6621
|
/>
|
|
6595
6622
|
}
|
|
6596
6623
|
}
|
|
6597
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "pipe", type: FieldDataInjector, name: "FieldDataInjector" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6624
|
+
`, isInline: true, styles: [":host{display:flex;flex-direction:column;gap:1rem}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "pipe", type: FieldDataInjector, name: "FieldDataInjector" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6598
6625
|
}
|
|
6599
6626
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: Outlet, decorators: [{
|
|
6600
6627
|
type: Component,
|
|
6601
|
-
args: [{
|
|
6602
|
-
selector: "iss-form-outlet",
|
|
6603
|
-
imports: [
|
|
6628
|
+
args: [{ selector: "iss-form-outlet", imports: [
|
|
6604
6629
|
NgComponentOutlet,
|
|
6605
6630
|
FieldDataInjector,
|
|
6606
6631
|
AsyncPipe,
|
|
6607
|
-
],
|
|
6608
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
6609
|
-
template: `
|
|
6632
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
6610
6633
|
@if (components() && components()?.length) {
|
|
6611
6634
|
@for (component of components(); track $index) {
|
|
6612
6635
|
<ng-container
|
|
@@ -6616,8 +6639,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
6616
6639
|
/>
|
|
6617
6640
|
}
|
|
6618
6641
|
}
|
|
6619
|
-
|
|
6620
|
-
}]
|
|
6642
|
+
`, styles: [":host{display:flex;flex-direction:column;gap:1rem}\n"] }]
|
|
6621
6643
|
}], propDecorators: { ready: [{ type: i0.Output, args: ["ready"] }], fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: true }] }] } });
|
|
6622
6644
|
|
|
6623
6645
|
const VIEW_PROVIDER = {
|
|
@@ -9416,4 +9438,4 @@ var time_validator = /*#__PURE__*/Object.freeze({
|
|
|
9416
9438
|
*/
|
|
9417
9439
|
|
|
9418
9440
|
export { PlateViewer as $, TimePickerField as A, DatePickerField as B, ControlBase as C, DatePickerControl as D, Employee as E, FieldBase as F, DatetimePickerField as G, HOST as H, IssField as I, DateRangePickerField as J, InputViewer as K, Loader as L, MobileControl as M, TextareaViewer as N, Outlet as O, PLACEHOLDER_REGEX as P, ChipsViewer as Q, RadioControl as R, SelectControl as S, TextareaControl as T, RadioViewer as U, VIEW_PROVIDER as V, SelectViewer as W, MobileViewer as X, CheckboxViewer as Y, ToggleButtonViewer as Z, SlideToggleViewer as _, ValidationMessageComponent as a, AttachmentViewer as a0, TimePickerViewer as a1, DatePickerViewer as a2, DatePickerTimeViewer as a3, DateRangePickerViewer as a4, DEFAULT_COUNTRY as a5, COUNTRIES as a6, DATE_FORMAT_ADAPTER as a7, DATETIME_FORMAT as a8, PLATE_LETTERS as a9, startOfHijriMonth as aA, getHijriDaysInMonth as aB, createHijriDate as aC, formatHijriDate as aD, parseHijriDate as aE, toHijriDisplay as aF, IssValidators as aG, FileValidators as aH, TimeValidator as aI, VALIDATION_MESSAGES as aa, COMPONENTS as ab, SERVICES as ac, VALIDATORS as ad, FIELD_DATA as ae, UI_LANGUAGE as af, ATTACHMENT_UPLOAD_URL as ag, ATTACHMENT_UPLOAD_RESPONSE_MAPPER as ah, ATTACHMENT_DOWNLOAD_URL as ai, USER_SEARCH_API as aj, HintsComponent as ak, Droppable as al, ArabicNumberPipe as am, FieldDataInjector as an, PlateLetterPipe as ao, SelectStatusPipe as ap, TranslatePipe as aq, FileHandler as ar, IssDateAdapter as as, provideIssDateAdapter as at, Phone as au, arrayFrom as av, formatFileSize as aw, HIJRI_LOCALE as ax, HIJRI_MONTH_NAMES as ay, getHijriParts as az, ViewerBase as b, FormEngine as c, CheckboxControl as d, ChipsControl as e, DateRangePickerControl as f, getPropertyByPath as g, DatetimePickerControl as h, FilePickerControl as i, InputControl as j, PlateControl as k, SlideToggleControl as l, TimePickerControl as m, ToggleButtonControl as n, InputField as o, TextareaField as p, ChipsField as q, replacePlaceholders as r, RadioField as s, SelectField as t, MobileField as u, CheckboxField as v, ToggleButtonField as w, SlideToggleField as x, PlateField as y, FilePickerField as z };
|
|
9419
|
-
//# sourceMappingURL=iss-ctrl-iss-ctrl-
|
|
9441
|
+
//# sourceMappingURL=iss-ctrl-iss-ctrl-BHW3shB0.mjs.map
|