@ldmjs/ui 1.0.1 → 1.0.2

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/README.md CHANGED
@@ -383,6 +383,21 @@ const comboboxItems = [
383
383
  ```html
384
384
  <ld-edit-masked-text v-model="maskedText" mask="000-000-000 00" label="Ld Edit Masked Text" />
385
385
  ```
386
+ ## ld-text-markup
387
+
388
+ ### use text markup
389
+
390
+ ```html
391
+ <ld-text-markup v-model="textMarkup" required label="Ld Text Markup" />
392
+ ```
393
+
394
+ ## ld-switch
395
+
396
+ ### use switch
397
+
398
+ ```html
399
+ <ld-switch label="Ld Switch" v-model="toggle" />
400
+ ```
386
401
 
387
402
  # Utilities
388
403
 
@@ -34,3 +34,5 @@
34
34
 
35
35
  .ld-text-markup[data-v-d0f0d7f0]{display:flex;flex-direction:column;min-width:100%;max-width:100%;width:100%;min-height:180px;padding-bottom:18px}.ld-text-markup-validate[data-v-d0f0d7f0]{overflow:hidden;height:20px;flex-grow:0}.content-wrapper[data-v-d0f0d7f0]{display:flex;flex-direction:column;position:relative;background-color:var(--grey-l-6);border-radius:4px}.tabs-wrapper[data-v-d0f0d7f0]{position:relative;display:flex;width:50%;max-width:155px;margin-bottom:-1px;z-index:1;flex-shrink:0}.tabs-wrapper .v-btn[data-v-d0f0d7f0]{border:1px solid var(--grey-l-5);height:30px !important;opacity:0.6;border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.tabs-wrapper .v-btn[data-v-d0f0d7f0]:before,.tabs-wrapper .v-btn[data-v-d0f0d7f0]:after{display:none}.tabs-wrapper .v-btn.active[data-v-d0f0d7f0]{background-color:var(--white);border:1px solid var(--grey-l-4);border-bottom:none;opacity:1}.content[data-v-d0f0d7f0]{position:relative;z-index:0;flex-basis:100%;font-size:var(--font-size);color:var(--text)}.content .md-editor[data-v-d0f0d7f0]{height:100%}.contentbox[data-v-d0f0d7f0]{border:1px solid var(--grey-l-4);background-color:var(--white);border-radius:0 4px 4px 4px;padding:10px}[data-v-d0f0d7f0] .contentbox ul{padding:0 12px;list-style:disc;margin-bottom:8px}[data-v-d0f0d7f0] .contentbox ol{list-style:decimal;padding:0 12px;margin-bottom:8px}[data-v-d0f0d7f0] .contentbox p{margin-bottom:8px}[data-v-d0f0d7f0] .contentbox pre{padding:4px}[data-v-d0f0d7f0] .contentbox code{background:none;color:var(--text);padding:0;font-size:100%}[data-v-d0f0d7f0] .md-editor{border:1px solid var(--grey-l-4)}
36
36
 
37
+ .ld-switch[data-v-76d5423c] .v-switch{display:block}.ld-switch[data-v-76d5423c] .v-switch .v-selection-control{min-height:var(--input-height) !important}.ld-switch[data-v-76d5423c] .v-switch .v-selection-control .v-selection-control__wrapper{width:40px}.ld-switch[data-v-76d5423c] .v-switch .v-selection-control:not(.v-selection-control--dirty) .v-selection-control__input{transform:translateX(-12px)}.ld-switch[data-v-76d5423c] .v-switch .v-selection-control:not(.v-selection-control--dirty) .v-switch__track{color:var(--grey-l-4) !important;background-color:var(--grey-l-4) !important}.ld-switch[data-v-76d5423c] .v-switch .v-selection-control .v-switch__track{opacity:1;width:40px}.ld-switch[data-v-76d5423c] .v-switch .v-selection-control--dirty .v-selection-control__input{transform:translateX(12px)}.ld-switch[data-v-76d5423c] .v-switch .v-selection-control--dirty .v-switch__thumb{color:var(--primary-l-3) !important;background-color:var(--primary-l-3) !important}.ld-switch[data-v-76d5423c] .v-switch .v-selection-control--dirty .v-switch__track{opacity:1;background-color:var(--primary-l-2) !important}.ld-switch[data-v-76d5423c] .v-switch .v-selection-control--dirty .v-label{color:var(--primary-l-2) !important}.ld-switch[data-v-76d5423c] .v-switch .v-selection-control .v-switch__thumb{color:var(--white) !important}.ld-switch[data-v-76d5423c] .v-switch .v-selection-control .v-label{padding-inline-start:4px}
38
+
package/dist/index.js CHANGED
@@ -2723,8 +2723,8 @@ let EditTextComponent = class EditTextComponent extends (0,external_vue_class_co
2723
2723
  this.form?.unregister(this, null);
2724
2724
  }
2725
2725
  }
2726
- onValueChanged(newVal, oldVal) {
2727
- if (!newVal && !oldVal) {
2726
+ onValueChanged(newVal) {
2727
+ if (newVal === '') {
2728
2728
  return;
2729
2729
  }
2730
2730
  const emitData = this.$utils.isDefined(newVal) ? Number(newVal) : null;
@@ -2748,6 +2748,9 @@ let EditTextComponent = class EditTextComponent extends (0,external_vue_class_co
2748
2748
  }
2749
2749
  onBlur(e) {
2750
2750
  this.emitBlur(e);
2751
+ if (this.value === '') {
2752
+ this.value = '0';
2753
+ }
2751
2754
  this.validate();
2752
2755
  }
2753
2756
  onFocus(e) {
@@ -2969,7 +2972,7 @@ ld_edit_textvue_type_script_lang_ts_external_decorate([
2969
2972
  ld_edit_textvue_type_script_lang_ts_external_decorate([
2970
2973
  (0,external_vue_property_decorator_.Watch)('value'),
2971
2974
  ld_edit_textvue_type_script_lang_ts_external_metadata("design:type", Function),
2972
- ld_edit_textvue_type_script_lang_ts_external_metadata("design:paramtypes", [String, String]),
2975
+ ld_edit_textvue_type_script_lang_ts_external_metadata("design:paramtypes", [String]),
2973
2976
  ld_edit_textvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
2974
2977
  ], EditTextComponent.prototype, "onValueChanged", null);
2975
2978
  EditTextComponent = ld_edit_textvue_type_script_lang_ts_external_decorate([
@@ -10723,6 +10726,88 @@ function ld_text_markup_reg(vue, options) {
10723
10726
  }
10724
10727
  /* harmony default export */ const src_ld_text_markup = (ld_text_markup_reg);
10725
10728
 
10729
+ ;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/ld-switch/ld-switch.vue?vue&type=template&id=76d5423c&scoped=true
10730
+
10731
+
10732
+ const ld_switchvue_type_template_id_76d5423c_scoped_true_withScopeId = n => (_pushScopeId("data-v-76d5423c"),n=n(),_popScopeId(),n)
10733
+ const ld_switchvue_type_template_id_76d5423c_scoped_true_hoisted_1 = { class: "ld-switch" }
10734
+
10735
+ function ld_switchvue_type_template_id_76d5423c_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
10736
+ const _component_v_switch = (0,external_vue_.resolveComponent)("v-switch")
10737
+
10738
+ return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_switchvue_type_template_id_76d5423c_scoped_true_hoisted_1, [
10739
+ (0,external_vue_.createVNode)(_component_v_switch, {
10740
+ modelValue: _ctx.value,
10741
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.value) = $event)),
10742
+ readonly: _ctx.readonly,
10743
+ label: _ctx.label,
10744
+ "hide-details": _ctx.hideDetails
10745
+ }, null, 8, ["modelValue", "readonly", "label", "hide-details"])
10746
+ ]))
10747
+ }
10748
+ ;// CONCATENATED MODULE: ./src/ld-switch/ld-switch.vue?vue&type=template&id=76d5423c&scoped=true
10749
+
10750
+ ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-switch/ld-switch.ts?vue&type=script&lang=js&external
10751
+ var ld_switchvue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
10752
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
10753
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
10754
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
10755
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
10756
+ };
10757
+ var ld_switchvue_type_script_lang_js_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
10758
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10759
+ };
10760
+
10761
+
10762
+ class SwitchComponent extends (0,external_vue_property_decorator_.mixins)(InputMixin) {
10763
+ constructor() {
10764
+ super(...arguments);
10765
+ this.value = false;
10766
+ }
10767
+ onModelChanged() {
10768
+ this.value = this.modelValue;
10769
+ }
10770
+ onValueChanged(val) {
10771
+ this.$emit('update:model-value', val);
10772
+ }
10773
+ }
10774
+ ld_switchvue_type_script_lang_js_external_decorate([
10775
+ (0,external_vue_property_decorator_.Prop)(),
10776
+ ld_switchvue_type_script_lang_js_external_metadata("design:type", Boolean)
10777
+ ], SwitchComponent.prototype, "modelValue", void 0);
10778
+ ld_switchvue_type_script_lang_js_external_decorate([
10779
+ (0,external_vue_property_decorator_.Watch)('modelValue', { immediate: true }),
10780
+ ld_switchvue_type_script_lang_js_external_metadata("design:type", Function),
10781
+ ld_switchvue_type_script_lang_js_external_metadata("design:paramtypes", []),
10782
+ ld_switchvue_type_script_lang_js_external_metadata("design:returntype", void 0)
10783
+ ], SwitchComponent.prototype, "onModelChanged", null);
10784
+ ld_switchvue_type_script_lang_js_external_decorate([
10785
+ (0,external_vue_property_decorator_.Watch)('value'),
10786
+ ld_switchvue_type_script_lang_js_external_metadata("design:type", Function),
10787
+ ld_switchvue_type_script_lang_js_external_metadata("design:paramtypes", [Boolean]),
10788
+ ld_switchvue_type_script_lang_js_external_metadata("design:returntype", void 0)
10789
+ ], SwitchComponent.prototype, "onValueChanged", null);
10790
+
10791
+ ;// CONCATENATED MODULE: ./src/ld-switch/ld-switch.ts?vue&type=script&lang=js&external
10792
+
10793
+ ;// CONCATENATED MODULE: ./src/ld-switch/ld-switch.vue
10794
+
10795
+
10796
+
10797
+
10798
+ ;
10799
+
10800
+
10801
+ const ld_switch_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(SwitchComponent, [['render',ld_switchvue_type_template_id_76d5423c_scoped_true_render],['__scopeId',"data-v-76d5423c"]])
10802
+
10803
+ /* harmony default export */ const ld_switch = (ld_switch_exports_);
10804
+ ;// CONCATENATED MODULE: ./src/ld-switch/index.ts
10805
+
10806
+ function ld_switch_reg(vue, options) {
10807
+ vue.component(options.aliases['ld-switch'], ld_switch);
10808
+ }
10809
+ /* harmony default export */ const src_ld_switch = (ld_switch_reg);
10810
+
10726
10811
  ;// CONCATENATED MODULE: ./src/utils/delay.ts
10727
10812
  async function delay(timeout) {
10728
10813
  return new Promise(resolve => setTimeout(() => resolve(), timeout));
@@ -11149,6 +11234,7 @@ const ActiveDirectiveOptions = {
11149
11234
 
11150
11235
 
11151
11236
 
11237
+
11152
11238
 
11153
11239
 
11154
11240
  const ldmuiPlugin = {
@@ -11180,6 +11266,7 @@ const ldmuiPlugin = {
11180
11266
  'ld-text-viewer': options.aliases?.['ld-text-viewer'] ?? 'ld-text-viewer',
11181
11267
  'ld-edit-masked-text': options.aliases?.['ld-edit-masked-text'] ?? 'ld-edit-masked-text',
11182
11268
  'ld-text-markup': options.aliases?.['ld-text-markup'] ?? 'ld-text-markup',
11269
+ 'ld-switch': options.aliases?.['ld-switch'] ?? 'ld-switch',
11183
11270
  };
11184
11271
  vue.config.globalProperties.$utils = {
11185
11272
  ...utils_namespaceObject,
@@ -11217,6 +11304,7 @@ const ldmuiPlugin = {
11217
11304
  src_ld_text_viewer(vue, options);
11218
11305
  src_ld_edit_masked_text(vue, options);
11219
11306
  src_ld_text_markup(vue, options);
11307
+ src_ld_switch(vue, options);
11220
11308
  },
11221
11309
  };
11222
11310
  /* harmony default export */ const src = (ldmuiPlugin);
@@ -61,13 +61,3 @@ body,
61
61
  }
62
62
  }
63
63
 
64
- .main-gradient-h {
65
- background: var(--primary);
66
- background: linear-gradient(90deg, var(--primary) 0%, var(--primary-d-1) 100%);
67
- }
68
-
69
- .main-gradient-v {
70
- background: var(--primary);
71
- background: linear-gradient(180deg, var(--primary) 0%, var(--primary-d-1) 100%);
72
- }
73
-
@@ -22,6 +22,7 @@ export interface ldmuiOptions {
22
22
  'ld-text-viewer'?: string;
23
23
  'ld-edit-masked-text'?: string;
24
24
  'ld-text-markup'?: string;
25
+ 'ld-switch'?: string;
25
26
  },
26
27
  viewport?: {
27
28
  isMobile: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldmjs/ui",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "ldm ui",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -11,6 +11,7 @@
11
11
  "dev": "cross-env NODE_ENV=development webpack serve --config config/webpack.config.dev.js --progress --profile --stats-error-details",
12
12
  "build": "cross-env NODE_ENV=production webpack --config config/webpack.config.build.js --stats-error-details",
13
13
  "serve": "cross-env NODE_ENV=development webpack serve --config config/webpack.config.serve.js --progress --profile",
14
+ "demo": "cross-env NODE_ENV=development webpack serve --config config/webpack.config.demo.js --progress --profile",
14
15
  "test": "jest --runInBand --no-cache",
15
16
  "pub": "node config/publish.js && npm publish --access=public"
16
17
  },
@@ -52,7 +53,7 @@
52
53
  "@types/lodash-es": "^4",
53
54
  "@typescript-eslint/eslint-plugin": "5.41.0",
54
55
  "@typescript-eslint/parser": "5.41.0",
55
- "@vue/test-utils": "2.4.3",
56
+ "@vue/test-utils": "2.4.6",
56
57
  "@vue/vue3-jest": "29.2.6",
57
58
  "@vuelidate/core": "2.0.2",
58
59
  "@vuelidate/validators": "2.0.2",