@sarafapp/ant-design 1.0.24 → 1.0.25

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.
@@ -9,10 +9,12 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
9
9
  } & {
10
10
  inputControl: InputControl<string>;
11
11
  placeholder: string;
12
+ label?: string;
12
13
  size?: InputSizes;
13
14
  disabled?: boolean;
14
15
  isClearable?: boolean;
15
16
  type?: SarafInputTypes;
17
+ isPlaceholderAsLabel?: boolean;
16
18
  }) & Partial<{}>> & import('vue').PublicProps;
17
19
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
18
20
  attrs: any;
@@ -1,7 +1,7 @@
1
1
  import o from "./SarafTextFiled.vue.es2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.es.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0d9950b8"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a9f01369"]]);
5
5
  export {
6
- f as default
6
+ e as default
7
7
  };
@@ -1,88 +1,94 @@
1
- import { defineComponent as z, mergeModels as f, useModel as E, useSlots as M, computed as t, resolveComponent as I, resolveDirective as w, withDirectives as N, createElementBlock as D, openBlock as T, normalizeClass as a, createVNode as v, createSlots as $, withCtx as n, createElementVNode as i, renderSlot as u } from "vue";
2
- import { InputStatus as m, SarafInputTypes as F, InputSizes as A } from "./model/Constants.es.js";
3
- import L from "./SarafFiledInvalidMessage.vue.es.js";
4
- const q = /* @__PURE__ */ z({
1
+ import { defineComponent as N, mergeModels as v, useModel as I, useSlots as w, computed as t, resolveComponent as D, resolveDirective as A, withDirectives as L, createElementBlock as m, openBlock as b, normalizeClass as a, createCommentVNode as P, createVNode as C, toDisplayString as T, createSlots as $, withCtx as n, createElementVNode as i, renderSlot as r } from "vue";
2
+ import { InputStatus as x, SarafInputTypes as F, InputSizes as U } from "./model/Constants.es.js";
3
+ import j from "./SarafFiledInvalidMessage.vue.es.js";
4
+ const J = /* @__PURE__ */ N({
5
5
  __name: "SarafTextFiled",
6
- props: /* @__PURE__ */ f({
6
+ props: /* @__PURE__ */ v({
7
7
  inputControl: {},
8
8
  placeholder: {},
9
- size: { default: A.Large },
9
+ label: {},
10
+ size: { default: U.Large },
10
11
  disabled: { type: Boolean },
11
12
  isClearable: { type: Boolean, default: !1 },
12
- type: { default: F.Text }
13
+ type: { default: F.Text },
14
+ isPlaceholderAsLabel: { type: Boolean, default: !0 }
13
15
  }, {
14
16
  modelValue: {},
15
17
  modelModifiers: {}
16
18
  }),
17
- emits: /* @__PURE__ */ f(["buttonClick"], ["update:modelValue"]),
18
- setup(r, { emit: b }) {
19
- const e = r, d = E(r, "modelValue"), x = b, s = M(), C = t(() => !!s.button), y = t(() => !!s.prefix), B = t(() => !!s.suffix), c = t(() => e.inputControl.getNotValidMessage()), _ = t(() => !!c.value), k = t(() => _.value ? m.Error : m.Default), l = t(() => ({
19
+ emits: /* @__PURE__ */ v(["buttonClick"], ["update:modelValue"]),
20
+ setup(u, { emit: y }) {
21
+ const e = u, d = I(u, "modelValue"), _ = y, s = w(), B = t(() => !!s.button), h = t(() => !!s.prefix), k = t(() => !!s.suffix), c = t(() => e.inputControl.getNotValidMessage()), S = t(() => !!c.value), g = t(() => S.value ? x.Error : x.Default), l = t(() => ({
20
22
  disabled: e.disabled
21
- }));
22
- function S() {
23
- e.disabled || x("buttonClick");
23
+ })), p = t(() => e.label ? e.label : e.isPlaceholderAsLabel ? e.placeholder : "");
24
+ function V() {
25
+ e.disabled || _("buttonClick");
24
26
  }
25
- return (o, p) => {
26
- const g = I("a-input"), h = w("touch-sensitive-control");
27
- return N((T(), D("div", {
27
+ return (o, f) => {
28
+ const z = D("a-input"), E = A("touch-sensitive-control");
29
+ return L((b(), m("div", {
28
30
  tabindex: "1",
29
31
  class: a(["input__container", l.value])
30
32
  }, [
31
- v(g, {
33
+ p.value ? (b(), m("label", {
34
+ key: 0,
35
+ class: a(["input__label", l.value])
36
+ }, T(p.value), 3)) : P("", !0),
37
+ C(z, {
32
38
  value: d.value,
33
- "onUpdate:value": p[0] || (p[0] = (V) => d.value = V),
34
- status: k.value,
39
+ "onUpdate:value": f[0] || (f[0] = (M) => d.value = M),
40
+ status: g.value,
35
41
  size: e.size,
36
42
  placeholder: e.placeholder,
37
43
  disabled: e.disabled,
38
44
  "allow-clear": e.isClearable,
39
45
  type: e.type
40
46
  }, $({ _: 2 }, [
41
- y.value ? {
47
+ h.value ? {
42
48
  name: "prefix",
43
49
  fn: n(() => [
44
50
  i("span", {
45
51
  class: a(["input--icon", l.value])
46
52
  }, [
47
- u(o.$slots, "prefix", {}, void 0, !0)
53
+ r(o.$slots, "prefix", {}, void 0, !0)
48
54
  ], 2)
49
55
  ]),
50
56
  key: "0"
51
57
  } : void 0,
52
- B.value ? {
58
+ k.value ? {
53
59
  name: "suffix",
54
60
  fn: n(() => [
55
61
  i("span", {
56
62
  class: a(["input--icon", l.value])
57
63
  }, [
58
- u(o.$slots, "suffix", {}, void 0, !0)
64
+ r(o.$slots, "suffix", {}, void 0, !0)
59
65
  ], 2)
60
66
  ]),
61
67
  key: "1"
62
68
  } : void 0,
63
- C.value ? {
69
+ B.value ? {
64
70
  name: "addonAfter",
65
71
  fn: n(() => [
66
72
  i("span", {
67
73
  class: "input_button",
68
- onClick: S
74
+ onClick: V
69
75
  }, [
70
- u(o.$slots, "button", {}, void 0, !0)
76
+ r(o.$slots, "button", {}, void 0, !0)
71
77
  ])
72
78
  ]),
73
79
  key: "2"
74
80
  } : void 0
75
81
  ]), 1032, ["value", "status", "size", "placeholder", "disabled", "allow-clear", "type"]),
76
- v(L, {
82
+ C(j, {
77
83
  "invalid-message": c.value,
78
84
  disabled: e.disabled
79
85
  }, null, 8, ["invalid-message", "disabled"])
80
86
  ], 2)), [
81
- [h, e.inputControl]
87
+ [E, e.inputControl]
82
88
  ]);
83
89
  };
84
90
  }
85
91
  });
86
92
  export {
87
- q as default
93
+ J as default
88
94
  };
@@ -1 +1,3 @@
1
1
  export { default as SarafCheckbox } from './checkbox/SarafCheckbox.vue';
2
+ export { default as SarafSwitch } from './switch/SarafSwitch.vue';
3
+ export { SwitchSize } from './switch/model/Constants.ts';
@@ -0,0 +1,22 @@
1
+ type __VLS_Props = {
2
+ isDisabled?: boolean;
3
+ size?: string;
4
+ isLoading?: boolean;
5
+ checkedChildren?: string;
6
+ unCheckedChildren?: string;
7
+ };
8
+ type __VLS_PublicProps = {
9
+ modelValue?: boolean;
10
+ } & __VLS_Props;
11
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
12
+ "update:modelValue": (value: boolean) => any;
13
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
15
+ }>, {
16
+ size: string;
17
+ isDisabled: boolean;
18
+ isLoading: boolean;
19
+ checkedChildren: string;
20
+ unCheckedChildren: string;
21
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
22
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./SarafSwitch.vue.es2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.es.js";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-641863a4"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -0,0 +1,35 @@
1
+ import { defineComponent as i, mergeModels as n, useModel as s, resolveComponent as t, createBlock as r, openBlock as h } from "vue";
2
+ import { SwitchSize as u } from "./model/Constants.es.js";
3
+ const k = /* @__PURE__ */ i({
4
+ __name: "SarafSwitch",
5
+ props: /* @__PURE__ */ n({
6
+ isDisabled: { type: Boolean, default: !1 },
7
+ size: { default: u.Default },
8
+ isLoading: { type: Boolean, default: !1 },
9
+ checkedChildren: { default: "" },
10
+ unCheckedChildren: { default: "" }
11
+ }, {
12
+ modelValue: { type: Boolean, default: !1 },
13
+ modelModifiers: {}
14
+ }),
15
+ emits: ["update:modelValue"],
16
+ setup(d) {
17
+ const e = d, l = s(d, "modelValue");
18
+ return (f, a) => {
19
+ const o = t("a-switch");
20
+ return h(), r(o, {
21
+ class: "saraf-switch",
22
+ checked: l.value,
23
+ "onUpdate:checked": a[0] || (a[0] = (c) => l.value = c),
24
+ disabled: e.isDisabled,
25
+ size: e.size,
26
+ loading: e.isLoading,
27
+ "checked-children": e.checkedChildren,
28
+ "un-checked-children": e.unCheckedChildren
29
+ }, null, 8, ["checked", "disabled", "size", "loading", "checked-children", "un-checked-children"]);
30
+ };
31
+ }
32
+ });
33
+ export {
34
+ k as default
35
+ };
@@ -0,0 +1,4 @@
1
+ export declare enum SwitchSize {
2
+ Default = "default",
3
+ Small = "small"
4
+ }
@@ -0,0 +1,4 @@
1
+ var a = /* @__PURE__ */ ((l) => (l.Default = "default", l.Small = "small", l))(a || {});
2
+ export {
3
+ a as SwitchSize
4
+ };
package/dist/index.es.js CHANGED
@@ -3,15 +3,15 @@ import { ComponentSize as o } from "./Constants.es.js";
3
3
  import { default as f } from "./baseForm/SarafSearchFiled.vue.es.js";
4
4
  import { default as p } from "./baseForm/SarafPasswordFiled.vue.es.js";
5
5
  import { default as s } from "./dataDisplay/chart/SarafChart.vue.es.js";
6
- import { default as d } from "./dataDisplay/tooltip/SarafTooltip.vue.es.js";
6
+ import { default as S } from "./dataDisplay/tooltip/SarafTooltip.vue.es.js";
7
7
  import { default as x } from "./icons/ArrowDownIcon.vue.es.js";
8
8
  import { default as i } from "./icons/ArrowUpIcon.vue.es.js";
9
9
  import { default as C } from "./icons/BurgerIcon.vue.es.js";
10
10
  import { default as b } from "./loaders/spinners/SarafDefaultSpinner.vue.es.js";
11
11
  import { default as h } from "./localProvider/ApplicationLocalProvider.vue.es.js";
12
- import { BasicInputNames as y, InputSizes as P, InputStatus as g, SarafInputTypes as w, SarafSelectMode as A } from "./baseForm/model/Constants.es.js";
12
+ import { BasicInputNames as y, InputSizes as P, InputStatus as w, SarafInputTypes as g, SarafSelectMode as A } from "./baseForm/model/Constants.es.js";
13
13
  import { SelectItem as F } from "./baseForm/model/Model.es.js";
14
- import { default as v } from "./baseForm/SarafTextFiled.vue.es.js";
14
+ import { default as z } from "./baseForm/SarafTextFiled.vue.es.js";
15
15
  import { default as R } from "./baseForm/SarafNumberFiled.vue.es.js";
16
16
  import { default as L } from "./baseForm/SarafSelect.vue.es.js";
17
17
  import { default as N } from "./baseForm/SarafFiledInvalidMessage.vue.es.js";
@@ -28,25 +28,27 @@ import { default as oa } from "./baseTable/SarafDynamicCurrencyPriceTableCell.vu
28
28
  import { default as fa } from "./baseTable/SarafTableGenerator.vue.es.js";
29
29
  import { default as pa } from "./dataDisplay/tag/SarafTag.vue.es.js";
30
30
  import { TagColors as sa } from "./dataDisplay/tag/model/Constants.es.js";
31
- import { default as da } from "./dataDisplay/tab/ui/SarafTabs.vue.es.js";
31
+ import { default as Sa } from "./dataDisplay/tab/ui/SarafTabs.vue.es.js";
32
32
  import { default as xa } from "./dataDisplay/tab/ui/SarafSecondaryTabs.vue.es.js";
33
33
  import { SarafTab as ia } from "./dataDisplay/tab/model/SarafTab.es.js";
34
34
  import { AreaChartDataSource as Ca } from "./dataDisplay/chart/model/AreaChartDataSource.es.js";
35
35
  import { DonutChartDataSource as ba } from "./dataDisplay/chart/model/DonutChartDataSource.es.js";
36
36
  import { ChartSeries as ha, ChartSettings as Da, ChartType as ya, RawChartDataPoint as Pa } from "./dataDisplay/chart/model/ChartTypes.es.js";
37
- import { TooltipDirective as wa } from "./dataDisplay/tooltip/model/tooltipDirective.es.js";
37
+ import { TooltipDirective as ga } from "./dataDisplay/tooltip/model/tooltipDirective.es.js";
38
38
  import { default as Ba } from "./dataEntry/checkbox/SarafCheckbox.vue.es.js";
39
- import { default as ka } from "./datePicker/SarafDatePicker.vue.es.js";
40
- import { default as za } from "./datePicker/SarafRangePicker.vue.es.js";
41
- import { default as Ga } from "./icons/SarafArrowIcon.vue.es.js";
42
- import { default as Ma } from "./icons/GiftCardIcon.vue.es.js";
43
- import { default as Ua } from "./icons/PlusIcon.vue.es.js";
44
- import { default as qa } from "./icons/ResetIcon.vue.es.js";
45
- import { default as Ha } from "./icons/SarafLogoIcon.vue.es.js";
46
- import { default as Ka } from "./icons/SearchIcon.vue.es.js";
47
- import { ButtonColor as Qa, ButtonType as Va } from "./general/button/model/Constants.es.js";
48
- import { default as Xa } from "./general/button/SarafButton.vue.es.js";
49
- import { SpinnerSizes as Za } from "./loaders/spinners/model/Constants.es.js";
39
+ import { default as ka } from "./dataEntry/switch/SarafSwitch.vue.es.js";
40
+ import { SwitchSize as va } from "./dataEntry/switch/model/Constants.es.js";
41
+ import { default as Ga } from "./datePicker/SarafDatePicker.vue.es.js";
42
+ import { default as Ma } from "./datePicker/SarafRangePicker.vue.es.js";
43
+ import { default as Ua } from "./icons/SarafArrowIcon.vue.es.js";
44
+ import { default as qa } from "./icons/GiftCardIcon.vue.es.js";
45
+ import { default as Ha } from "./icons/PlusIcon.vue.es.js";
46
+ import { default as Ka } from "./icons/ResetIcon.vue.es.js";
47
+ import { default as Qa } from "./icons/SarafLogoIcon.vue.es.js";
48
+ import { default as Wa } from "./icons/SearchIcon.vue.es.js";
49
+ import { ButtonColor as Ya, ButtonType as Za } from "./general/button/model/Constants.es.js";
50
+ import { default as $a } from "./general/button/SarafButton.vue.es.js";
51
+ import { SpinnerSizes as rr } from "./loaders/spinners/model/Constants.es.js";
50
52
  export {
51
53
  h as ApplicationLocalProvider,
52
54
  Ca as AreaChartDataSource,
@@ -54,54 +56,56 @@ export {
54
56
  i as ArrowUpIcon,
55
57
  y as BasicInputNames,
56
58
  C as BurgerIcon,
57
- Qa as ButtonColor,
58
- Va as ButtonType,
59
+ Ya as ButtonColor,
60
+ Za as ButtonType,
59
61
  ha as ChartSeries,
60
62
  Da as ChartSettings,
61
63
  ya as ChartType,
62
64
  o as ComponentSize,
63
65
  ba as DonutChartDataSource,
64
- Ma as GiftCardIcon,
66
+ qa as GiftCardIcon,
65
67
  P as InputSizes,
66
- g as InputStatus,
67
- Ua as PlusIcon,
68
+ w as InputStatus,
69
+ Ha as PlusIcon,
68
70
  Pa as RawChartDataPoint,
69
- qa as ResetIcon,
70
- Ga as SarafArrowIcon,
71
+ Ka as ResetIcon,
72
+ Ua as SarafArrowIcon,
71
73
  E as SarafBankCardTableCell,
72
- Xa as SarafButton,
74
+ $a as SarafButton,
73
75
  s as SarafChart,
74
76
  Ba as SarafCheckbox,
75
- ka as SarafDatePicker,
77
+ Ga as SarafDatePicker,
76
78
  b as SarafDefaultSpinner,
77
79
  oa as SarafDynamicCurrencyPriceTableCell,
78
80
  N as SarafFiledInvalidMessage,
79
81
  J as SarafIbanTableCell,
80
- w as SarafInputTypes,
81
- Ha as SarafLogoIcon,
82
+ g as SarafInputTypes,
83
+ Qa as SarafLogoIcon,
82
84
  R as SarafNumberFiled,
83
85
  p as SarafPasswordFiled,
84
86
  $ as SarafPriceTableCell,
85
- za as SarafRangePicker,
87
+ Ma as SarafRangePicker,
86
88
  f as SarafSearchFiled,
87
89
  xa as SarafSecondaryTabs,
88
90
  L as SarafSelect,
89
91
  A as SarafSelectMode,
92
+ ka as SarafSwitch,
90
93
  O as SarafSymbolTableCell,
91
94
  ia as SarafTab,
92
95
  j as SarafTable,
93
96
  fa as SarafTableGenerator,
94
- da as SarafTabs,
97
+ Sa as SarafTabs,
95
98
  pa as SarafTag,
96
- v as SarafTextFiled,
97
- d as SarafTooltip,
99
+ z as SarafTextFiled,
100
+ S as SarafTooltip,
98
101
  V as SarafTradeAmountTableCell,
99
102
  Z as SarafTradeDateCell,
100
103
  ra as SarafTradeSymbolCell,
101
104
  X as SarafTradeSymbolPriceCell,
102
- Ka as SearchIcon,
105
+ Wa as SearchIcon,
103
106
  F as SelectItem,
104
- Za as SpinnerSizes,
107
+ rr as SpinnerSizes,
108
+ va as SwitchSize,
105
109
  sa as TagColors,
106
- wa as TooltipDirective
110
+ ga as TooltipDirective
107
111
  };