litos-ui 0.17.5 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/lib/animation-CTt9qgA7.js +4 -0
  2. package/lib/base-Dm0WS1pK.js +62 -0
  3. package/lib/base.js +111 -147
  4. package/lib/button/index.d.ts +8 -3
  5. package/lib/button/index.js +2 -137
  6. package/lib/button-CC5PmAb1.js +146 -0
  7. package/lib/calendar/index.d.ts +10 -5
  8. package/lib/calendar/index.js +2 -123
  9. package/lib/calendar-GpYHNmXG.js +149 -0
  10. package/lib/carousel/index.js +2 -280
  11. package/lib/carousel/item.js +2 -15
  12. package/lib/carousel-dT3FJPQo.js +272 -0
  13. package/lib/check/checkbox.js +2 -18
  14. package/lib/check/checkbox_group.js +6 -6
  15. package/lib/check/radio.js +2 -15
  16. package/lib/check/radio_group.js +9 -9
  17. package/lib/check-B0XraJvb.js +73 -0
  18. package/lib/check-CvGaONEx.js +117 -0
  19. package/lib/checkbox-DbWsmAaL.js +16 -0
  20. package/lib/collapse/index.d.ts +18 -11
  21. package/lib/collapse/index.js +2 -88
  22. package/lib/collapse/item.d.ts +28 -9
  23. package/lib/collapse/item.js +2 -115
  24. package/lib/collapse/types.d.ts +7 -0
  25. package/lib/collapse-C3IRHLeg.js +104 -0
  26. package/lib/color_picker/index.js +2 -42
  27. package/lib/color_picker-D0brKFm-.js +41 -0
  28. package/lib/date_picker/index.d.ts +23 -0
  29. package/lib/date_picker/index.js +3 -0
  30. package/lib/date_picker-DQGoiN8v.js +103 -0
  31. package/lib/date_picker_ori/index.js +2 -129
  32. package/lib/date_picker_ori-aRuSSi9D.js +122 -0
  33. package/lib/description_panel/index.js +2 -66
  34. package/lib/description_panel-BY2yljeC.js +57 -0
  35. package/lib/dialog/dialog_container.js +2 -131
  36. package/lib/dialog/index.js +67 -85
  37. package/lib/dialog_container-DcN87wj0.js +126 -0
  38. package/lib/esm-sVEoAVPu.js +244 -0
  39. package/lib/form/form_item.d.ts +1 -0
  40. package/lib/form/form_item.js +2 -136
  41. package/lib/form/index.js +2 -147
  42. package/lib/form-DdU0yK0k.js +154 -0
  43. package/lib/form_inner-DR9tyB_r.js +117 -0
  44. package/lib/form_item-Bv-YafZK.js +137 -0
  45. package/lib/icon/arrow_down.js +12 -12
  46. package/lib/icon/arrow_left.js +9 -9
  47. package/lib/icon/arrow_right.js +9 -9
  48. package/lib/icon/arrow_up.js +12 -12
  49. package/lib/icon/base.d.ts +16 -2
  50. package/lib/icon/base.js +2 -38
  51. package/lib/icon/calendar.d.ts +5 -0
  52. package/lib/icon/calendar.js +10 -0
  53. package/lib/icon/caret_bottom.js +9 -9
  54. package/lib/icon/caret_top.js +9 -9
  55. package/lib/icon/close.js +9 -9
  56. package/lib/icon/close_filled.js +12 -12
  57. package/lib/icon/d_arrow_left.js +12 -12
  58. package/lib/icon/d_arrow_right.js +12 -12
  59. package/lib/icon/font_icon.d.ts +2 -3
  60. package/lib/icon/font_icon.js +35 -39
  61. package/lib/icon/info.js +12 -12
  62. package/lib/icon/loading.js +9 -9
  63. package/lib/icon/moon.js +12 -12
  64. package/lib/icon/more.js +12 -12
  65. package/lib/icon/reduction.js +12 -12
  66. package/lib/icon/refresh.d.ts +5 -0
  67. package/lib/icon/refresh.js +10 -0
  68. package/lib/icon/refresh_left.js +12 -12
  69. package/lib/icon/refresh_right.js +9 -9
  70. package/lib/icon/search.js +9 -9
  71. package/lib/icon/select.js +12 -12
  72. package/lib/icon/sort.js +9 -9
  73. package/lib/icon/success.js +12 -12
  74. package/lib/icon/sun.js +12 -12
  75. package/lib/icon/theme_default.js +12 -12
  76. package/lib/icon/warn.js +12 -12
  77. package/lib/icon/zoom_in.js +12 -12
  78. package/lib/icon/zoom_out.js +12 -12
  79. package/lib/image/image_preview.js +2 -104
  80. package/lib/image/index.js +2 -176
  81. package/lib/image-COPKk8Jm.js +162 -0
  82. package/lib/image_preview-CYEup07F.js +92 -0
  83. package/lib/index.d.ts +5 -81
  84. package/lib/index.js +78 -169
  85. package/lib/input/index.d.ts +6 -2
  86. package/lib/input/index.js +188 -203
  87. package/lib/input-DjKxcxry.js +4 -0
  88. package/lib/input_inner-BKJg9n9A.js +4 -0
  89. package/lib/item-B7Elh5xE.js +14 -0
  90. package/lib/item-CvoJt3wp.js +60 -0
  91. package/lib/item-DRsOV_Tc.js +119 -0
  92. package/lib/list/index.js +2 -58
  93. package/lib/list-CU7vHS6s.js +51 -0
  94. package/lib/loading/index.d.ts +3 -2
  95. package/lib/loading/index.js +109 -127
  96. package/lib/mask/index.js +2 -105
  97. package/lib/mask-CEznzwji.js +112 -0
  98. package/lib/md_input/index.js +2 -60
  99. package/lib/md_input-DSQx5TMW.js +58 -0
  100. package/lib/menu/index.d.ts +30 -13
  101. package/lib/menu/index.js +2 -105
  102. package/lib/menu/types.d.ts +6 -0
  103. package/lib/menu/types.js +0 -0
  104. package/lib/menu-CzV6lOlw.js +224 -0
  105. package/lib/message/index.js +67 -60
  106. package/lib/modal/index.js +2 -196
  107. package/lib/modal/modal_box.js +87 -86
  108. package/lib/modal-DWyWrN-D.js +192 -0
  109. package/lib/page_header/index.js +2 -109
  110. package/lib/page_header-BJkEstRw.js +101 -0
  111. package/lib/pagination/index.js +2 -248
  112. package/lib/pagination-5t7AOeFV.js +210 -0
  113. package/lib/polygon/index.js +2 -27
  114. package/lib/polygon-C4Ow2lxi.js +20 -0
  115. package/lib/qrcode/index.d.ts +13 -4
  116. package/lib/qrcode/index.js +2 -57
  117. package/lib/qrcode-BKG2MibP.js +64 -0
  118. package/lib/radio-2mNSYujz.js +13 -0
  119. package/lib/select/index.js +3 -401
  120. package/lib/select-CAgggYh7.js +326 -0
  121. package/lib/select_ori/index.js +47 -50
  122. package/lib/space/index.js +2 -35
  123. package/lib/space-Bv-p0DL8.js +38 -0
  124. package/lib/switch/index.js +2 -50
  125. package/lib/switch-BaVBi5Ip.js +48 -0
  126. package/lib/tabbar/index.js +2 -109
  127. package/lib/tabbar/item.js +2 -58
  128. package/lib/tabbar-CI1xSj1G.js +96 -0
  129. package/lib/table/index.js +2 -269
  130. package/lib/table-DfL2hFqA.js +234 -0
  131. package/lib/tabs/index.js +38 -42
  132. package/lib/tag/index.js +2 -72
  133. package/lib/tag-72DwCkvq.js +76 -0
  134. package/lib/theme/index.js +2 -89
  135. package/lib/theme/theme_color.js +22 -26
  136. package/lib/theme-BRTI2-Yk.js +83 -0
  137. package/lib/utils/clickoutside.js +18 -18
  138. package/lib/utils/context_provide.js +21 -21
  139. package/lib/utils/event.js +13 -18
  140. package/lib/utils/index.js +55 -58
  141. package/lib/utils/popover.d.ts +4 -1
  142. package/lib/utils/popover.js +276 -352
  143. package/lib/utils/transition.js +33 -31
  144. package/package.json +14 -14
  145. package/styles/container.css +4 -0
  146. package/styles/datepicker.css +55 -0
  147. package/styles/popover.css +14 -1
  148. package/lib/animation-DttknHkX.js +0 -4
  149. package/lib/calendar/langs.js +0 -8
  150. package/lib/carousel/timer.js +0 -19
  151. package/lib/check/check.js +0 -118
  152. package/lib/check/index.js +0 -68
  153. package/lib/check-CksURvTv.js +0 -4
  154. package/lib/form/form_inner.js +0 -125
  155. package/lib/form/types.js +0 -1
  156. package/lib/index-CrMiSe0x.js +0 -249
  157. package/lib/index-DY6m9Wbe.js +0 -4
  158. package/lib/litos-ui.css +0 -1
  159. package/lib/menu/menu_item.d.ts +0 -6
  160. package/lib/menu/menu_item.js +0 -21
  161. package/lib/menu/sub_menu.d.ts +0 -15
  162. package/lib/menu/sub_menu.js +0 -83
  163. package/lib/table/types.js +0 -1
@@ -0,0 +1,154 @@
1
+ import e from "./base.js";
2
+ import { parseAttrValue as t, unitNumberStr as n } from "./utils/index.js";
3
+ import { n as r } from "./esm-sVEoAVPu.js";
4
+ import { $one as i, formatClass as a, off as o, on as s } from "ph-utils/dom";
5
+ import c from "ph-utils/validator";
6
+ //#region src/components/form/index.less?inline
7
+ var l = ":host{display:block}.l-form{gap:var(--l-form-gap,20px);flex-flow:column;display:flex}.l-form-inline{gap:var(--l-form-gap,20px);flex-flow:wrap;display:flex}.l-form.l-form-inline{--l-form-item-display:flex}.l-form.l-form--left{--l-form-label-align:left}.l-form.l-form--top{--l-form-item-display:grid;--l-form-label-align:left;--l-form-label-empty-display:none;grid-template-columns:1fr}", u = class extends e {
8
+ static baseName = "form";
9
+ validator;
10
+ _data;
11
+ context;
12
+ errors;
13
+ resetCtx;
14
+ constructor() {
15
+ super(), this._state = {
16
+ inline: !1,
17
+ labelPosition: "right",
18
+ labelWidth: "80px",
19
+ novalidate: !1
20
+ }, this.validator = new c([]), this.context = r({ innerBlock: !1 }), this.errors = r({}), this.resetCtx = r(0);
21
+ }
22
+ static get observedAttributes() {
23
+ return [
24
+ "label-position",
25
+ "inner-block",
26
+ "inline",
27
+ "novalidate",
28
+ "label-width"
29
+ ];
30
+ }
31
+ attributeChanged(e, r, i) {
32
+ switch (e) {
33
+ case "label-position":
34
+ this._state.labelPosition = i;
35
+ break;
36
+ case "inner-block":
37
+ let r = t(i, !1, e);
38
+ this.context({ innerBlock: r });
39
+ break;
40
+ case "label-width":
41
+ this._state.labelWidth = n(i);
42
+ break;
43
+ default:
44
+ let a = t(i, !1, e);
45
+ this._state[e] = a;
46
+ break;
47
+ }
48
+ }
49
+ updateDOM(e) {
50
+ if (e.has("label-position") || e.has("inline")) {
51
+ let e = i("form", this.root);
52
+ e && (e.className = a([
53
+ "l-form",
54
+ this._state.inline ? "l-form-inline" : void 0,
55
+ `l-form--${this._state.labelPosition}`
56
+ ]));
57
+ }
58
+ e.has("label-width") && (this._state.labelWidth ? this.style.setProperty("--l-form-label-width", this._state.labelWidth) : this.style.removeProperty("--l-form-label-width"));
59
+ }
60
+ connectedCallback() {
61
+ s(this, "form-context-request", this._provide), this.loadStyleText([l]), super.connectedCallback();
62
+ }
63
+ afterInit() {
64
+ s(this, "form-rule-change", this.ruleChange), s(this, "form-value-change", this._valueChange), s(this, "form-action", this._formAction);
65
+ }
66
+ disconnectedCallback() {
67
+ this.validator = void 0, o(this, "form-rule-change", this.ruleChange), o(this, "form-value-change", this._valueChange), o(this, "form-context-request", this._provide), o(this, "form-action", this._formAction), super.disconnectedCallback();
68
+ }
69
+ render() {
70
+ let e = a([
71
+ "l-form",
72
+ this._state.inline ? "l-form-inline" : void 0,
73
+ `l-form--${this._state.labelPosition}`
74
+ ]);
75
+ return this._state.labelWidth && this.style.setProperty("--l-form-label-width", this._state.labelWidth), `<form class="${e}"><slot></slot></form>`;
76
+ }
77
+ ruleChange = (e) => {
78
+ e.stopPropagation(), this.validator.addSchema(e.detail);
79
+ };
80
+ _provide(e) {
81
+ let { context: t, callback: n } = e.detail;
82
+ t === "form-context-request" && n(this.context, this.errors, this.resetCtx);
83
+ }
84
+ _formAction = (e) => {
85
+ e.detail === "submit" ? this.submit() : this.reset();
86
+ };
87
+ _valueChange = (e) => {
88
+ let { name: t, value: n, valid: r } = e.detail;
89
+ if (!t) return;
90
+ this._data ??= {};
91
+ let i = Object.hasOwn(this._data, t);
92
+ this._data[t] = n, !this._state.novalidate && i && r && this.validator.validateKey(t, n, this._data).then(() => {
93
+ let e = this.errors();
94
+ e[t] = void 0, this.errors({ ...e });
95
+ }).catch((e) => {
96
+ this.errors({
97
+ ...this.errors(),
98
+ ...e.detail
99
+ });
100
+ });
101
+ };
102
+ validateField(e) {
103
+ let t = [];
104
+ if (this._data != null) {
105
+ if (Array.isArray(e)) for (let n = 0, r = e.length; n < r; n++) {
106
+ let r = e[n];
107
+ t.push(this.validator.validateKey(r, this._data[r], this._data));
108
+ }
109
+ else t.push(this.validator.validateKey(e, this._data[e], this._data));
110
+ Promise.allSettled(t).then((e) => {
111
+ let t = {};
112
+ for (let n = 0, r = e.length; n < r; n++) {
113
+ let r = e[n];
114
+ r.status === "rejected" ? t = {
115
+ ...t,
116
+ ...r.reason.detail
117
+ } : t[r.value.key] = void 0;
118
+ }
119
+ this.errors({
120
+ ...this.errors(),
121
+ ...t
122
+ });
123
+ });
124
+ }
125
+ }
126
+ clearValidate() {
127
+ this.errors({});
128
+ }
129
+ reset() {
130
+ this.clearValidate();
131
+ let e = this.resetCtx();
132
+ this.resetCtx(e >= 100 ? 1 : e + 1);
133
+ }
134
+ submit() {
135
+ this._state.novalidate ? this.dispatchEvent(new CustomEvent("submit", { detail: this.getData() })) : this.validate().then((e) => {
136
+ e && this.dispatchEvent(new CustomEvent("submit", { detail: this.getData() }));
137
+ });
138
+ }
139
+ async validate() {
140
+ try {
141
+ return await this.validator.validate(this._data), this.errors({}), Promise.resolve(!0);
142
+ } catch (e) {
143
+ return this.errors(e.detail), Promise.resolve(!1);
144
+ }
145
+ }
146
+ getData() {
147
+ return { ...this._data };
148
+ }
149
+ setErrors(e) {
150
+ this.errors(e);
151
+ }
152
+ };
153
+ //#endregion
154
+ export { u as t };
@@ -0,0 +1,117 @@
1
+ import e from "./base.js";
2
+ import { parseAttrValue as t, stopSignal as n } from "./utils/index.js";
3
+ import { t as r } from "./esm-sVEoAVPu.js";
4
+ import { getAttr as i } from "ph-utils/dom";
5
+ //#region src/components/form/form_inner.ts
6
+ var a = class extends e {
7
+ disabled = !1;
8
+ _value = void 0;
9
+ _resetValue;
10
+ _firstPushValue = !0;
11
+ _isReset = !1;
12
+ _name;
13
+ formContext;
14
+ formItemContext;
15
+ formErrors;
16
+ resetCtx;
17
+ _signalStop;
18
+ _errorSignalStop;
19
+ _resetSignalStop;
20
+ constructor(e = !0, t = !0) {
21
+ super(!0, { delegatesFocus: t }), this._firstPushValue = e;
22
+ }
23
+ get name() {
24
+ return this._name;
25
+ }
26
+ set name(e) {
27
+ this._name = e;
28
+ }
29
+ get value() {
30
+ return this._value;
31
+ }
32
+ set value(e) {
33
+ this.setValue(e);
34
+ }
35
+ setValue(e) {
36
+ this._value = e, this._resetValue ??= e, this.pushValueChange();
37
+ }
38
+ getValue() {
39
+ return this._value;
40
+ }
41
+ static get observedAttributes() {
42
+ return [
43
+ "disabled",
44
+ "value",
45
+ "name",
46
+ "inner-block"
47
+ ];
48
+ }
49
+ attributeChanged(e, n, r) {
50
+ switch (e) {
51
+ case "value":
52
+ case "name":
53
+ this[e] = r;
54
+ break;
55
+ case "disabled":
56
+ this.disabled = t(r, !1, e);
57
+ break;
58
+ case "inner-block":
59
+ let i = t(r, !1, e);
60
+ this.innerBlockChange(i);
61
+ break;
62
+ default:
63
+ this.attributeChange(e, n, r);
64
+ break;
65
+ }
66
+ }
67
+ attributeChange(e, t, n) {}
68
+ connectedCallback() {
69
+ this.emitInject("form-context-request", this.formInject), this.emitInject("form-item-context-request", this.formItemInject), super.connectedCallback(), this._signalStop = r(() => {
70
+ let e = this.formItemContext ? this.formItemContext() : null, t = this.formContext ? this.formContext() : null;
71
+ if (!this.name && e && e.prop && this.setAttribute("name", e.prop), !i(this, "inner-block")) {
72
+ let n = e?.innerBlock || t?.innerBlock;
73
+ n != null && this.innerBlockChange(n);
74
+ }
75
+ }), this._value ?? (this._resetValue = "", this._firstPushValue && this.pushValueChange()), this._errorSignalStop = r(() => {
76
+ if (!this.name) return;
77
+ let e = (this.formErrors ? this.formErrors() : {})[this.name];
78
+ this.validResult(e);
79
+ }), this._resetSignalStop = r(() => {
80
+ (this.resetCtx ? this.resetCtx() : 0) > 0 && this.reset();
81
+ });
82
+ }
83
+ disconnectedCallback() {
84
+ super.disconnectedCallback(), this._signalStop = n(this._signalStop), this._errorSignalStop = n(this._errorSignalStop), this._resetSignalStop = n(this._resetSignalStop);
85
+ }
86
+ isDisabled() {
87
+ return this.disabled;
88
+ }
89
+ getName() {
90
+ return this.name;
91
+ }
92
+ disabledChange() {}
93
+ innerBlockChange(e) {}
94
+ validResult(e) {}
95
+ formInject = (e, t, n) => {
96
+ this.formContext = e, this.formErrors = t, this.resetCtx = n;
97
+ };
98
+ formItemInject = (e) => {
99
+ this.formItemContext = e;
100
+ };
101
+ pushValueChange() {
102
+ this.name && this.emit("form-value-change", {
103
+ bubbles: !0,
104
+ composed: !0,
105
+ detail: {
106
+ name: this.name,
107
+ value: this._value,
108
+ valid: !this._isReset
109
+ }
110
+ }), this._isReset = !1;
111
+ }
112
+ reset() {
113
+ this._isReset = !0, this.value = this._resetValue || "";
114
+ }
115
+ };
116
+ //#endregion
117
+ export { a as t };
@@ -0,0 +1,137 @@
1
+ import { parseAttrValue as e, stopSignal as t } from "./utils/index.js";
2
+ import { n, t as r } from "./esm-sVEoAVPu.js";
3
+ import i from "./utils/context_provide.js";
4
+ import { $$ as a, $one as o, addClass as s, removeClass as c } from "ph-utils/dom";
5
+ //#region src/components/form/form_item.less?inline
6
+ var l = ":host{display:var(--l-form-item-display,flex);font-size:14px}.l-form-item__label{text-align:var(--l-form-label-align,right);width:var(--l-form-label-width,auto);height:var(--l-form-control-height,32px);line-height:var(--l-form-control-height,32px);color:#606266;box-sizing:border-box;padding:0 10px 0 0;display:inline-block}.l-form-item__label:empty{display:var(--l-form-label-empty-display,inline-block)}:host(.is-required) .l-form-item__label:before{content:\"*\";color:var(--l-warn-color,#f56c6c);vertical-align:middle;margin-right:4px}.l-form-item__content{flex:1;align-items:center;display:flex;position:relative}.l-form-item__error{color:var(--nt-error-color,#ed3f13);padding-top:3px;font-size:12px;line-height:1;position:absolute;top:100%;left:0}:host(.l-form-item--left){--l-form-label-align:left}:host(.l-form-item--top){--l-form-item-display:grid;--l-form-label-align:left;--l-form-label-empty-display:none;grid-template-columns:1fr}", u = class extends i {
7
+ static baseName = "form-item";
8
+ formErrors;
9
+ _errorSignalStop;
10
+ constructor() {
11
+ super(), this.contextEventName = "form-item-context-request", this._state = {
12
+ labelPosition: "right",
13
+ required: !1
14
+ }, this.context = n({ innerBlock: !1 });
15
+ }
16
+ static get observedAttributes() {
17
+ return [
18
+ "error",
19
+ "label",
20
+ "required",
21
+ "inner-block",
22
+ "prop",
23
+ "label-position",
24
+ "verify",
25
+ "pattern",
26
+ "validity"
27
+ ];
28
+ }
29
+ attributeChanged(t, n, r) {
30
+ switch (t) {
31
+ case "error":
32
+ case "label":
33
+ case "verify":
34
+ case "pattern":
35
+ case "validity":
36
+ this._state[t] = r;
37
+ break;
38
+ case "label-position":
39
+ this._state.labelPosition = r;
40
+ break;
41
+ case "inner-block":
42
+ let n = e(r, !1, t);
43
+ this.context({ innerBlock: n });
44
+ break;
45
+ case "required":
46
+ let i = e(r, !1, t);
47
+ this._state.required = i;
48
+ break;
49
+ case "prop":
50
+ this._state.prop = r, this.context({
51
+ ...this.context(),
52
+ prop: r
53
+ });
54
+ break;
55
+ }
56
+ }
57
+ updateDOM(e) {
58
+ e.has("required") && this._updateRequired(), e.has("label") && this._updateLabel(), e.has("error") && this._updateError();
59
+ }
60
+ connectedCallback() {
61
+ this.loadStyleText([l]), super.connectedCallback(), this._updateRequired(), this._parseSchema(), this.emitInject("form-context-request", ((e, t) => {
62
+ this.formErrors = t;
63
+ })), this._errorSignalStop = r(() => {
64
+ let e = this.context().prop, t = this.formErrors ? this.formErrors() : null;
65
+ e && t && (this._state.error = t[e], this._updateError());
66
+ });
67
+ }
68
+ beforeDestroy() {
69
+ this._errorSignalStop = t(this._errorSignalStop);
70
+ }
71
+ setRules(e) {
72
+ let t = this._state.prop;
73
+ if (t) {
74
+ let n = {
75
+ ...e,
76
+ key: t
77
+ };
78
+ this._updateRules(n);
79
+ }
80
+ }
81
+ render() {
82
+ this.classList.add(`l-form-item--${this._state.labelPosition}`);
83
+ let e = document.createDocumentFragment();
84
+ this._state.label != null && e.appendChild(a("label", {
85
+ class: "l-form-item__label",
86
+ textContent: this._state.label
87
+ }));
88
+ let t = a("div", { class: "l-form-item__content" }), n = a("slot");
89
+ return t.appendChild(n), this._state.error && t.appendChild(a("div", {
90
+ class: "l-form-item__error",
91
+ textContent: this._state.error
92
+ })), e.appendChild(t), e;
93
+ }
94
+ _updateRequired() {
95
+ this._state.required ? s(this, "is-required") : c(this, "is-required");
96
+ }
97
+ _parseSchema() {
98
+ let e = this.context().prop;
99
+ if (e) {
100
+ let t = [], n = this._state.verify;
101
+ n && (t = n.split("|"));
102
+ let r = this._state.pattern;
103
+ r && t.push(new RegExp(r));
104
+ let i = {
105
+ key: e,
106
+ required: this._state.required,
107
+ message: this._state.validity,
108
+ rules: t
109
+ };
110
+ this._updateRules(i);
111
+ }
112
+ }
113
+ _updateError() {
114
+ if (this._state.error ? s(this, "is-error") : c(this, "is-error"), !this.rendered) return;
115
+ let e = o(".l-form-item__error", this.root);
116
+ if (e) this._state.error ? e.textContent = this._state.error : e.remove();
117
+ else if (this._state.error) {
118
+ e = document.createElement("div"), e.className = "l-form-item__error", e.textContent = this._state.error;
119
+ let t = o(".l-form-item__content", this.root);
120
+ t && t.appendChild(e);
121
+ }
122
+ }
123
+ _updateLabel() {
124
+ if (!this.rendered) return;
125
+ let e = o(".l-form-item__label", this.root);
126
+ e == null ? this._state.label != null && (e = document.createElement("div"), e.className = "l-form-item__label", e.textContent = this._state.label, this.root.prepend(e)) : this._state.label == null ? e.remove() : e.textContent = this._state.label;
127
+ }
128
+ _updateRules(e) {
129
+ this.emit("form-rule-change", {
130
+ bubbles: !0,
131
+ composed: !0,
132
+ detail: e
133
+ });
134
+ }
135
+ };
136
+ //#endregion
137
+ export { u as t };
@@ -1,13 +1,13 @@
1
- import a from "./base.js";
2
- class n extends a {
3
- static baseName = "arrow-down-icon";
4
- connectedCallback() {
5
- super.connectedCallback();
6
- }
7
- renderChildren() {
8
- return '<path fill="currentColor" d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path>';
9
- }
10
- }
11
- export {
12
- n as default
1
+ import { t as e } from "../base-Dm0WS1pK.js";
2
+ //#region src/components/icon/arrow_down.ts
3
+ var t = class extends e {
4
+ static baseName = "arrow-down-icon";
5
+ connectedCallback() {
6
+ super.connectedCallback();
7
+ }
8
+ renderChildren() {
9
+ return "<path fill=\"currentColor\" d=\"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z\"></path>";
10
+ }
13
11
  };
12
+ //#endregion
13
+ export { t as default };
@@ -1,10 +1,10 @@
1
- import r from "./base.js";
2
- class t extends r {
3
- static baseName = "arrow-left-icon";
4
- renderChildren() {
5
- return '<path fill="currentColor" d="M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"></path>';
6
- }
7
- }
8
- export {
9
- t as default
1
+ import { t as e } from "../base-Dm0WS1pK.js";
2
+ //#region src/components/icon/arrow_left.ts
3
+ var t = class extends e {
4
+ static baseName = "arrow-left-icon";
5
+ renderChildren() {
6
+ return "<path fill=\"currentColor\" d=\"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z\"></path>";
7
+ }
10
8
  };
9
+ //#endregion
10
+ export { t as default };
@@ -1,10 +1,10 @@
1
- import r from "./base.js";
2
- class t extends r {
3
- static baseName = "arrow-right-icon";
4
- renderChildren() {
5
- return '<path fill="currentColor" d="M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"></path>';
6
- }
7
- }
8
- export {
9
- t as default
1
+ import { t as e } from "../base-Dm0WS1pK.js";
2
+ //#region src/components/icon/arrow_right.ts
3
+ var t = class extends e {
4
+ static baseName = "arrow-right-icon";
5
+ renderChildren() {
6
+ return "<path fill=\"currentColor\" d=\"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z\"></path>";
7
+ }
10
8
  };
9
+ //#endregion
10
+ export { t as default };
@@ -1,13 +1,13 @@
1
- import a from "./base.js";
2
- class l extends a {
3
- static baseName = "arrow-up-icon";
4
- connectedCallback() {
5
- super.connectedCallback();
6
- }
7
- renderChildren() {
8
- return '<path fill="currentColor" d="m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"></path>';
9
- }
10
- }
11
- export {
12
- l as default
1
+ import { t as e } from "../base-Dm0WS1pK.js";
2
+ //#region src/components/icon/arrow_up.ts
3
+ var t = class extends e {
4
+ static baseName = "arrow-up-icon";
5
+ connectedCallback() {
6
+ super.connectedCallback();
7
+ }
8
+ renderChildren() {
9
+ return "<path fill=\"currentColor\" d=\"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0\"></path>";
10
+ }
13
11
  };
12
+ //#endregion
13
+ export { t as default };
@@ -1,10 +1,24 @@
1
1
  import BaseComponent from "../base";
2
- export default class BaseIcon extends BaseComponent {
2
+ type ColorState = {
3
+ color?: string;
4
+ size?: string;
5
+ };
6
+ export default class BaseIcon extends BaseComponent<ColorState> {
3
7
  static baseName: string;
4
8
  useLink: boolean;
5
9
  viewBox: string;
10
+ constructor();
11
+ static get observedAttributes(): string[] | null | undefined;
12
+ protected attributeChanged(name: string, oldValue: string, newValue: string): void;
6
13
  connectedCallback(): void;
7
- render(): void;
14
+ protected updateDOM(changedProps: Set<string>): void;
15
+ private _updateSize;
16
+ private _updateColor;
17
+ render_v2(): {
18
+ template?: string | HTMLElement | DocumentFragment;
19
+ style?: string | string[];
20
+ };
8
21
  renderChildren(): string;
9
22
  createEl(tagName: string): SVGElement;
10
23
  }
24
+ export {};
package/lib/icon/base.js CHANGED
@@ -1,38 +1,2 @@
1
- import o from "../base.js";
2
- import { initAttr as c } from "../utils/index.js";
3
- const d = ":host{display:inline-flex}.l-icon{width:1em;height:1em;fill:currentColor;vertical-align:middle;display:inline-block}";
4
- class f extends o {
5
- static baseName = "base-icon";
6
- useLink = !1;
7
- viewBox = "0 0 1024 1024";
8
- connectedCallback() {
9
- c(this), this.loadStyleText([d]), this.render(), this.rendered = !0;
10
- }
11
- render() {
12
- const e = this.createEl("svg");
13
- e.classList.add("l-icon"), this.useLink || e.setAttribute("viewBox", this.viewBox);
14
- const t = this.renderChildren();
15
- if (typeof t == "string")
16
- if (t === "") {
17
- const n = this.children, s = [];
18
- for (let i = 0, r = n.length; i < r; i++) {
19
- const l = n[i];
20
- s.push(l.outerHTML);
21
- }
22
- e.innerHTML = s.join("");
23
- } else
24
- e.innerHTML = t;
25
- else
26
- e.append(t);
27
- this.shadow.appendChild(e);
28
- }
29
- renderChildren() {
30
- return "";
31
- }
32
- createEl(e) {
33
- return document.createElementNS("http://www.w3.org/2000/svg", e);
34
- }
35
- }
36
- export {
37
- f as default
38
- };
1
+ import { t as e } from "../base-Dm0WS1pK.js";
2
+ export { e as default };
@@ -0,0 +1,5 @@
1
+ import BaseIcon from "./base";
2
+ export default class Calendar extends BaseIcon {
3
+ static baseName: string;
4
+ renderChildren(): string;
5
+ }
@@ -0,0 +1,10 @@
1
+ import { t as e } from "../base-Dm0WS1pK.js";
2
+ //#region src/components/icon/calendar.ts
3
+ var t = class extends e {
4
+ static baseName = "calendar-icon";
5
+ renderChildren() {
6
+ return "<path fill=\"currentColor\" d=\"M128 384v512h768V192H768v32a32 32 0 1 1-64 0v-32H320v32a32 32 0 0 1-64 0v-32H128v128h768v64zm192-256h384V96a32 32 0 1 1 64 0v32h160a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h160V96a32 32 0 0 1 64 0zm-32 384h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64\"></path>";
7
+ }
8
+ };
9
+ //#endregion
10
+ export { t as default };
@@ -1,10 +1,10 @@
1
- import t from "./base.js";
2
- class a extends t {
3
- static baseName = "caret-bottom-icon";
4
- renderChildren() {
5
- return '<path fill="currentColor" d="m192 384 320 384 320-384z"></path>';
6
- }
7
- }
8
- export {
9
- a as default
1
+ import { t as e } from "../base-Dm0WS1pK.js";
2
+ //#region src/components/icon/caret_bottom.ts
3
+ var t = class extends e {
4
+ static baseName = "caret-bottom-icon";
5
+ renderChildren() {
6
+ return "<path fill=\"currentColor\" d=\"m192 384 320 384 320-384z\"></path>";
7
+ }
10
8
  };
9
+ //#endregion
10
+ export { t as default };
@@ -1,10 +1,10 @@
1
- import e from "./base.js";
2
- class a extends e {
3
- static baseName = "caret-top-icon";
4
- renderChildren() {
5
- return '<path fill="currentColor" d="M512 320 192 704h639.936z"></path>';
6
- }
7
- }
8
- export {
9
- a as default
1
+ import { t as e } from "../base-Dm0WS1pK.js";
2
+ //#region src/components/icon/caret_top.ts
3
+ var t = class extends e {
4
+ static baseName = "caret-top-icon";
5
+ renderChildren() {
6
+ return "<path fill=\"currentColor\" d=\"M512 320 192 704h639.936z\"></path>";
7
+ }
10
8
  };
9
+ //#endregion
10
+ export { t as default };
package/lib/icon/close.js CHANGED
@@ -1,10 +1,10 @@
1
- import e from "./base.js";
2
- class l extends e {
3
- static baseName = "close-icon";
4
- renderChildren() {
5
- return '<path fill="currentColor" d="M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"></path>';
6
- }
7
- }
8
- export {
9
- l as default
1
+ import { t as e } from "../base-Dm0WS1pK.js";
2
+ //#region src/components/icon/close.ts
3
+ var t = class extends e {
4
+ static baseName = "close-icon";
5
+ renderChildren() {
6
+ return "<path fill=\"currentColor\" d=\"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z\"></path>";
7
+ }
10
8
  };
9
+ //#endregion
10
+ export { t as default };